private int demangleSymbols(Program program, AddressSetView set, int initialCount,
			DemanglerOptions options, MessageLog log, TaskMonitor monitor)
			throws CancelledException {

		int count = initialCount;
		SymbolTable symbolTable = program.getSymbolTable();
		// TODO: iterator will continually need to reinitialize due to symbol changes
		//       consider copying primary symbols to alt storage for iteration
		SymbolIterator it = symbolTable.getPrimarySymbolIterator(set, true);
		while (it.hasNext()) {
			monitor.checkCancelled();

			if (++count % 100 == 0) {
				monitor.setMessage(getName() + " - " + count + " symbols");
			}

			Symbol symbol = it.next();
			if (skipSymbol(symbol)) {
				continue;
			}

			Address address = symbol.getAddress();
			MangledContext mangledContext = createMangledContext(program, options, symbol);
			DemangledObject demangled = demangle(mangledContext, log);
			if (demangled != null) {
				apply(mangledContext, demangled, log, monitor);
				continue;
			}

			// Only attempt to demangle a non-primary symbol if primary is imported and will
			// not demangle.
			if (symbol.getSource() != SourceType.IMPORTED) {
				continue;
			}

			for (Symbol altSym : symbolTable.getSymbols(address)) {
				if (altSym.isPrimary() || skipSymbol(altSym)) {
					continue;
				}
				mangledContext = createMangledContext(program, options, altSym);
				demangled = demangle(mangledContext, log);
				if (demangled != null) {
					apply(mangledContext, demangled, log, monitor);
					break;
				}
			}

		}
		return count;
	}
Demangles and applies the program's symbols
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/analysis/AbstractDemanglerAnalyzer.java