protected static void generateRegisterSleigh(List<String> result, Language language,
			AddressSpace space, SemisparseByteArray array) {
		byte[] data = new byte[8];
		MutableULongSpanSet remains = new DefaultULongSpanSet();
		remains.addAll(array.getInitialized(0, -1));
		while (!remains.isEmpty()) {
			ULongSpan bound = remains.bound();
			Address min = space.getAddress(bound.min());
			Register register = Stream.of(language.getRegisters(min))
					.filter(r -> r.getAddress().equals(min))
					.filter(r -> r.getNumBytes() <= data.length)
					.filter(r -> isContained(r, remains))
					.sorted(Comparator.comparing(r -> -r.getNumBytes()))
					.findFirst()
					.orElse(null);
			if (register == null) {
				throw new IllegalArgumentException("Could not find a register for " + min);
			}
			if (register.getBaseRegister().isProgramCounter()) {
				register = register.getBaseRegister();
			}
			int length = register.getNumBytes();
			array.getData(register.getOffset(), data, 0, length);
			BigInteger value = Utils.bytesToBigInteger(data, length, language.isBigEndian(), false);
			if (register.isProgramCounter()) {
				result.add(String.format("goto 0x%s", value.toString(16)));
			}
			else {
				result.add(String.format("%s=0x%s", register, value.toString(16)));
			}
			remains.remove(spanOfRegister(register));
		}
	}
Generate multiple lines of Sleigh, all to set a single variable

@param language the target language
@param address the (start) address of the variable
@param data the bytes to write to the variable
@return the lines of Sleigh code
Ghidra/Debug/Framework-TraceModeling/src/main/java/ghidra/trace/model/time/schedule/PatchStep.java