Code generation for control flow and Phis