Build control flow graph