private Symbol findRefSymbol(Iterator<Symbol> symbolIterator) throws NotFoundException {
		Symbol candidateSymbol = null;
		Symbol candidateThunkSymbol = null;
		Symbol candidateThunkedSymbol = null; // corresponds to candidateThunkSymbol
		while (symbolIterator.hasNext()) {
			Symbol s = symbolIterator.next();
			SymbolType type = s.getSymbolType();
			if (type == SymbolType.FUNCTION || type == SymbolType.LABEL) {
				Symbol thunkedSymbol = getThunkedSymbol(s);
				if (thunkedSymbol != null) {
					// ignore equivalent thunks
					if (candidateThunkSymbol != null &&
						!thunkedSymbol.equals(candidateThunkedSymbol)) {
						return null;
					}
					candidateThunkedSymbol = thunkedSymbol;
					candidateThunkSymbol = s;
				}
				else { // non-thunk symbol
					if (candidateSymbol != null) {
						return null;
					}
					candidateSymbol = s;
				}
			}
		}
		if (candidateSymbol == null) {
			candidateSymbol = candidateThunkSymbol;
		}
		else if (candidateThunkSymbol != null && !candidateSymbol.equals(candidateThunkedSymbol)) {
			return null;
		}
		if (candidateSymbol == null) {
			throw new NotFoundException();
		}
		return candidateSymbol;
	}
Find unique symbol from iterator ignoring related thunks.  
@param symbolIterator symbol iterator
@return unique function or code symbol or null if multiple symbols found
@throws NotFoundException if no symbols were found
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/function/ThunkReferenceAddressDialog.java