DominatorTree domTree = GraphUtils.buildDominatorTree(ProgramUtils.buildControlFlowGraph(program));
Graph domGraph = GraphUtils.buildDominatorGraph(domTree, program.basicBlockCount());
Task[] stack = new Task[cfg.size() * 2];
int head = 0;
for (int i = 0; i < program.basicBlockCount(); ++i) {
if (domGraph.incomingEdgesCount(i) == 0) {
Task task = new Task();
task.block = program.basicBlockAt(i);
task.variables = Arrays.copyOf(variableMap, variableMap.length);
stack[head++] = task;
}