need code generation for if-then-else