Implement code generation for if expressions