public static AddressSpace getCompatibleAddressSpace(AddressSpace addrSpace,
			Program otherProgram) {
		AddressSpace otherSpace =
			otherProgram.getAddressFactory().getAddressSpace(addrSpace.getName());
		if (otherSpace != null && otherSpace.getType() == addrSpace.getType() &&
			otherSpace.isOverlaySpace() == addrSpace.isOverlaySpace()) {
			int id = addrSpace.isOverlaySpace() ? ((OverlayAddressSpace) addrSpace).getBaseSpaceID()
					: addrSpace.getSpaceID();
			int otherid =
				otherSpace.isOverlaySpace() ? ((OverlayAddressSpace) otherSpace).getBaseSpaceID()
						: otherSpace.getSpaceID();
			// NOTE: This only works for the same language
			if (id == otherid) {
				return otherSpace;
			}
		}
		return null;
	}
Convert an address from the specified program to a comparable address in the
specified otherProgram.
@param addr address in program
@param otherProgram other program
@param exactMatchOnly if false and addr is an overlay address, a closest match will be returned
if possible
@return address for otherProgram or null if no such address exists.
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/util/SimpleDiffUtility.java