public static Varnode getCompatibleVarnode(Program program, Varnode varnode,
			Program otherProgram) {
		if (varnode == null || varnode.isConstant()) {
			return varnode;
		}
		Address addr = varnode.getAddress();
		if (addr.isRegisterAddress()) {
			if (program.getLanguageID().equals(otherProgram.getLanguageID())) {
				return varnode;
			}
			// TODO: Handle improperly aligned offcut register varnodes.
			Register reg = program.getRegister(addr, varnode.getSize());
			if (reg != null) {
				Register otherReg = otherProgram.getRegister(reg.getName());
				if (otherReg != null && reg.getMinimumByteSize() == otherReg.getMinimumByteSize()) {
					long delta = addr.subtract(reg.getAddress());
					if (delta != 0) {
						return new Varnode(otherReg.getAddress().add(delta), varnode.getSize());
					}
					return new Varnode(otherReg.getAddress(), varnode.getSize());
				}
			}
			return null;
		}
		else if (addr.isMemoryAddress() || addr.isStackAddress()) {
			Address otherAddr = getCompatibleAddress(program, addr, otherProgram);
			if (otherAddr != null) {
				return new Varnode(otherAddr, varnode.getSize());
			}
		}
		return null;
	}
Convert a varnode from the specified program to a comparable varnode in the
specified otherProgram.  Certain varnode addresses spaces (UNIQUE, HASH) will
always produce a null return varnode.
@param program program which contains the specified address instance
@param varnode varnode in program
@param otherProgram other program
@return varnode for otherProgram or null if varnode can not be mapped to other program
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/util/SimpleDiffUtility.java