codegen: codegen just in time for the if