private void cleanUpSymbols(Address address, Symbol symbolToPromote, Symbol primary) {
		if (symbolToPromote != null) {
			if (symbolToPromote.isDynamic()) {
				deleteDynamicSymbol(symbolToPromote);
				primary = null;
			}
			else {
				symbolToPromote.delete();
				primary = getPrimarySymbol(address);
				if (primary != null && primary.isDynamic()) {
					deleteDynamicSymbol(primary);
					primary = null;
				}
			}
		}
		// clear the primary symbol during cleanup because a new symbol is about to be created
		// that will be the primary symbol
		if (primary != null && !primary.isDynamic()) {
			((CodeSymbol) primary).setPrimary(false);
		}
	}
Finds the appropriate symbol to promote when function is created.
<p>
And by promote, we really mean find the symbol that needs to be deleted before creating the
function symbol. If the found symbol is not dynamic, the function symbol will assume its name
and namespace.
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/symbol/SymbolManager.java