private void initializeNode(StackNode node) {
		FunctionManager fmanage = program.getFunctionManager();
		Function function = fmanage.getFunctionAt(node.address);
		if (function.isThunk()) {
			Function thunkedfunc = function.getThunkedFunction(false);
			node.children = new Address[1];
			node.children[0] = thunkedfunc.getEntryPoint();
			return;
		}
		ArrayList<Address> children = new ArrayList<>();
		ReferenceManager referenceManager = program.getReferenceManager();
		AddressIterator referenceSourceIterator =
			referenceManager.getReferenceSourceIterator(function.getBody(), true);

		while (referenceSourceIterator.hasNext()) {
			Address fromAddr = referenceSourceIterator.next();
			for (Reference ref : referenceManager.getFlowReferencesFrom(fromAddr)) {
				Address toAddr = ref.getToAddress();
				if (ref.getReferenceType().isCall()) {
					Function childfunc = fmanage.getFunctionAt(toAddr);
					if (childfunc != null && killThunks) {
						if (childfunc.isThunk()) {
							childfunc = childfunc.getThunkedFunction(true);
							toAddr = childfunc.getEntryPoint();
						}
					}
					if (functionSet.contains(toAddr)) {
						children.add(toAddr);
					}
				}
			}
		}
		node.children = new Address[children.size()];
		children.toArray(node.children);
	}
Builds the DependencyGraph for the acyclic call graph represented by this object.
@param monitor the taskMonitor to use for reporting progress or cancelling.
@return the DependencyGraph for the acyclic call graph represented by this object.
@throws CancelledException if the monitor was cancelled.
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/util/AcyclicCallGraphBuilder.java