private int compareAddressSameSpace(AddressBasedLocation otherLocation) {

		if (address.isExternalAddress() || address.isVariableAddress() ||
			address.isRegisterAddress()) {
			// These address types have meaningless address offsets
			return stringRepresentation.compareTo(otherLocation.stringRepresentation);
		}

		// for most space types use space specific sort of address when space is the same
		int rc = address.compareTo(otherLocation.address);

		if (rc == 0) {
			// For the same memory offset, after normal addresses and memory references
			// are ShiftedReferences followed by OffsetReferences
			if (isShiftedAddress()) {
				if (otherLocation.isOffsetAddress()) {
					rc = -1;
				}
				else if (otherLocation.isShiftedAddress()) {
					rc = stringRepresentation.compareTo(otherLocation.stringRepresentation);
				}
				else {
					rc = 1;
				}
			}
			else if (isOffsetAddress()) {
				if (!otherLocation.isOffsetAddress()) {
					rc = 1;
				}
			}
			else if (otherLocation.isOffsetAddress() || otherLocation.isShiftedAddress()) {
				rc = -1;
			}
		}
		return rc;
	}
Compare this location's address with another location's given that they
are both within the same address space.
@param otherLocation other location object
@return comparison value
@see #compareTo(AddressBasedLocation)
Ghidra/Features/Base/src/main/java/ghidra/util/table/field/AddressBasedLocation.java