public static String getLabelString(MemBuffer buf, Settings settings, int len,
			DataTypeDisplayOptions options) {

		Program program = buf.getMemory().getProgram();
		if (program == null) {
			return POINTER_LABEL_PREFIX;
		}

		Address fromAddr = buf.getAddress();

		ReferenceManager refMgr = program.getReferenceManager();
		Reference ref = refMgr.getPrimaryReferenceFrom(fromAddr, 0);
		if (ref == null) {
			return POINTER_LABEL_PREFIX;
		}

		Symbol symbol = program.getSymbolTable().getSymbol(ref);
		if (symbol == null) {
			// unexpected since we have a reference to the location
			return POINTER_LABEL_PREFIX;
		}
		if (symbol.getSource() != SourceType.DEFAULT) {
			return POINTER_LABEL_PREFIX_U + symbol.getName();
		}

		// Check for deep pointers or recursive conditions
		PointerReferenceClassification pointerClassification =
			getPointerClassification(program, ref);
		if (pointerClassification == PointerReferenceClassification.DEEP) {
			// multi-level pointer exceeds depth limit of 2
			return POINTER_LABEL_PREFIX_U + POINTER_LABEL_PREFIX;
		}
		if (pointerClassification == PointerReferenceClassification.LOOP) {
			// multi-level pointer is self referencing
			return POINTER_LOOP_LABEL;
		}

		String symName = symbol.getName();
		symName = SymbolUtilities.getCleanSymbolName(symName, ref.getToAddress());
		symName = symName.replace(Namespace.DELIMITER, "_");

		if (!symName.startsWith(POINTER_LABEL_PREFIX_U)) {
			return POINTER_LABEL_PREFIX_U + symName;
		}

		return POINTER_LABEL_PREFIX_U + symName;
	}
Construct a pointer of a specified length to a referencedDataType. Note: It
is preferred to use default sized pointers when possible (i.e., length=-1,
see {@link #PointerDataType(DataType, DataTypeManager)}) instead of
explicitly specifying the pointer length value.

@param referencedDataType data type this pointer points to
@param length             pointer length (-1 will result in dynamically-sized
                          pointer)
@param dtm                associated data type manager whose data
                          organization will be used
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/PointerDataType.java