private BlockGraph buildCurrentFunctionGraph(Program program,
			VisualGraph<FGVertex, FGEdge> jungGraph, TaskMonitor taskMonitor)
			throws CancelledException {

		CodeBlockModel blockModel = new BasicBlockModel(program);
		AddressSetView addresses = function.getBody();
		CodeBlockIterator iterator = blockModel.getCodeBlocksContaining(addresses, taskMonitor);

		BlockGraph blockGraph = new BlockGraph();
		BidiMap<CodeBlock, PcodeBlock> bidiMap = new DualHashBidiMap<>();
		for (; iterator.hasNext();) {
			taskMonitor.checkCancelled();

			CodeBlock codeBlock = iterator.next();
			FGVertex vertex = getVertex(jungGraph, codeBlock.getMinAddress());
			if (vertex == null) {
				// this is unusual; can happen if the program is being changed while this is running
				continue;
			}

			PcodeBlock pcodeBlock = new BlockCopy(vertex, codeBlock.getMinAddress());
			bidiMap.put(codeBlock, pcodeBlock);
			blockGraph.addBlock(pcodeBlock);
		}

		for (CodeBlock block : bidiMap.keySet()) {
			taskMonitor.checkCancelled();

			CodeBlockReferenceIterator destinations = block.getDestinations(taskMonitor);
			while (destinations.hasNext()) {
				taskMonitor.checkCancelled();

				CodeBlockReference ref = destinations.next();
				// We only want control flow that is internal to the function. Make sure to
				// exclude the case where a function contains a (recursive) call to itself:
				// The reference would be between addresses internal to the function, but the
				// link doesn't represent internal flow. So we filter out ANY call reference.
				if (ref.getFlowType().isCall()) {
					continue;
				}
				CodeBlock destination = ref.getDestinationBlock();

				PcodeBlock sourcePcodeBlock = bidiMap.get(block);
				PcodeBlock destPcodeBlock = bidiMap.get(destination);
				if (destPcodeBlock == null) {
					continue;
				}

				blockGraph.addEdge(sourcePcodeBlock, destPcodeBlock);
			}
		}

		blockGraph.setIndices();
		return blockGraph;
	}
An amount by which edges entering a vertex from the left are offset to avoid overlapping
Ghidra/Features/FunctionGraphDecompilerExtension/src/main/java/ghidra/app/plugin/core/functiongraph/graph/layout/DecompilerNestedLayout.java