private Object getReferenceRepresentation(CodeUnit cu, Reference ref, Variable var) {
		if (ref == null) {
			return null;
		}

		if (!ref.isExternalReference()) {
			if (var != null || ref.isStackReference() || ref.isRegisterReference()) {
				return getVariableReferenceRepresentation(ref, var, null);
			}
		}

		if (ref.isMemoryReference() && (ref instanceof OffsetReference)) {
			return getOffsetReferenceRepresentation(cu, (OffsetReference) ref);
		}

		if (ref.isMemoryReference() || ref.isExternalReference()) {
			return getMemoryReferenceLabel(cu, ref);
		}

		return null;

	}
Get a representation object corresponding to the specified reference.
Format options are considered when generating label.

@param cu
@param ref
@param var variable which corresponds to reference or null
@param showIndirectValue if true, indirect memory references which refer
           to a pointer will get an additional "=value" appended where
           value corresponds to data pointed to by the referenced
           pointer.
@return reference representation object
Ghidra/Features/Base/src/main/java/ghidra/program/model/listing/CodeUnitFormat.java