presto-main/src/main/java/io/prestosql/sql/gen/IfCodeGenerator.java/IfCodeGenerator/generateExpression
class IfCodeGenerator:    @Override
    public BytecodeNode generateExpression(ResolvedFunction resolvedFunction, BytecodeGeneratorContext context, Type returnType, List<RowExpression> arguments)
    {
        Preconditions.checkArgument(arguments.size() == 3);

        Variable wasNull = context.wasNull();
        BytecodeBlock condition = new BytecodeBlock()
                .append(context.generate(arguments.get(0)))
                .comment("... and condition value was not null")
                .append(wasNull)
                .invokeStatic(CompilerOperations.class, "not", boolean.class, boolean.class)
                .invokeStatic(CompilerOperations.class, "and", boolean.class, boolean.class, boolean.class)
                .append(wasNull.set(constantFalse()));

        return new IfStatement()
                .condition(condition)
                .ifTrue(context.generate(arguments.get(1)))
                .ifFalse(context.generate(arguments.get(2)));
    }