private Varnode combineValues(Varnode leftValue, Varnode rightValue) {
		if (leftValue == null || rightValue == null) {
			return null; // can't combine - missing value
		}
		if (leftValue instanceof MaskedVarnodeOperation) {
			if (rightValue instanceof MaskedVarnodeOperation) {
				MaskedVarnodeOperation leftOp = (MaskedVarnodeOperation) leftValue;
				MaskedVarnodeOperation rightOp = (MaskedVarnodeOperation) rightValue;
				if (leftOp.op == rightOp.op &&
					leftOp.byteShift == (rightOp.getSize() + rightOp.byteShift)) {
					int size = leftOp.getSize() + rightOp.getSize();
					if (rightOp.byteShift == 0 && size == rightOp.op.getSize()) {
						return rightOp.op;
					}
					return new MaskedVarnodeOperation(rightOp.op, rightOp.byteShift, size);
				}
			}
			return null;  // can't combine
		}
		if (leftValue.isConstant()) {
			if (rightValue.isConstant()) {
				// Combine constant values
				int leftShift = rightValue.getSize() * 8;
				long rightMask = (1L << leftShift) - 1;
				long val =
					(rightValue.getOffset() & rightMask) + (leftValue.getOffset() << leftShift);
				return new Varnode(addrFactory.getConstantAddress(val), leftValue.getSize() +
					rightValue.getSize());
			}
			return null;  // can't combine
		}

		// Combine adjacent address/register nodes 
		Address addr;
		if (leftValue.getSpace() != rightValue.getSpace()) {
			return null;  // can't combine
		}
		if (language.isBigEndian()) {
			if (rightValue.getOffset() != (leftValue.getOffset() + leftValue.getSize())) {
				return null;  // can't combine
			}
			addr = leftValue.getAddress();
		}
		else {
			if (leftValue.getOffset() != (rightValue.getOffset() + rightValue.getSize())) {
				return null;  // can't combine
			}
			addr = rightValue.getAddress();
		}
		return new Varnode(addr, leftValue.getSize() + rightValue.getSize());
	}
Combine byte values into a single varnode value.
@param byteValues bytes stored with LSB in bytes[0] and MSB in bytes[bytes.length-1] with correct endianness.
@return varnode or null
Ghidra/Features/Base/src/main/java/ghidra/util/state/ContextState.java