public ProgramLocation getProgramLocation(Side side, ProgramLocation otherSideLocation) {
		if (correlator == null) {
			return null;
		}
		if (otherSideLocation == null) {
			return null;
		}
		if (otherSideLocation instanceof VariableLocation) {
			return getVariableLocation(side, (VariableLocation) otherSideLocation);
		}

		SaveState saveState = new SaveState();
		otherSideLocation.saveState(saveState);
		Address otherSideAddress = otherSideLocation.getAddress();

		// Try to get the indicated side's address using one of the address correlators.
		Address address = getAddress(side, otherSideAddress);
		if (address == null || address == Address.NO_ADDRESS) {
			return null; // Couldn't determine the indicated side's address.
		}

		saveState.remove("_ADDRESS");
		saveState.putString("_ADDRESS", address.toString());

		Address byteAddress = otherSideLocation.getByteAddress();
		saveState.remove("_BYTE_ADDR");
		Address desiredByteAddress = null;
		Program program = correlator.getProgram(side);
		if (byteAddress != null) {
			// Try to get the indicated side's byte address using one of the address
			// correlators or by inferring it.
			desiredByteAddress =
				inferDesiredByteAddress(otherSideAddress, address, byteAddress,
					otherSideLocation.getProgram(), program);
			if (desiredByteAddress != null) {
				saveState.putString("_BYTE_ADDR", desiredByteAddress.toString());
			}
		}

		// Adjust symbol path for labels if it is part of the location.
		adjustSymbolPath(saveState, otherSideAddress, address, byteAddress, desiredByteAddress,
			otherSideLocation.getProgram(), program);

		// ref address can't be used with indicated side so remove it.
		saveState.remove("_REF_ADDRESS");
		// Don't know how to find equivalent referenced address for the indicated side,
		// so don't put any _REF_ADDRESS back.

		return ProgramLocation.getLocation(program, saveState);

	}
Converts a program location from the other side to the given side.
@param side the side to get a location for
@param otherSideLocation the location from the other side
@return a program location for the given side that matches the other given location
Ghidra/Features/Base/src/main/java/ghidra/app/util/viewer/listingpanel/ProgramLocationTranslator.java