presto-main/src/main/java/io/prestosql/sql/gen/BetweenCodeGenerator.java/BetweenCodeGenerator/generateExpression
class BetweenCodeGenerator:    @Override
    public BytecodeNode generateExpression(ResolvedFunction resolvedFunction, BytecodeGeneratorContext context, Type returnType, List<RowExpression> arguments)
    {
        RowExpression value = arguments.get(0);
        RowExpression min = arguments.get(1);
        RowExpression max = arguments.get(2);

        Variable firstValue = context.getScope().createTempVariable(value.getType().getJavaType());
        VariableReferenceExpression valueReference = createTempVariableReferenceExpression(firstValue, value.getType());

        StandardFunctionResolution standardFunctionResolution = new StandardFunctionResolution(context.getMetadata());
        SpecialForm newExpression = new SpecialForm(
                AND,
                BOOLEAN,
                call(
                        standardFunctionResolution.comparisonFunction(Operator.GREATER_THAN_OR_EQUAL, value.getType(), min.getType()),
                        BOOLEAN,
                        valueReference,
                        min),
                call(
                        standardFunctionResolution.comparisonFunction(Operator.LESS_THAN_OR_EQUAL, value.getType(), max.getType()),
                        BOOLEAN,
                        valueReference,
                        max));

        LabelNode done = new LabelNode("done");

        // push value arg on the stack
        BytecodeBlock block = new BytecodeBlock()
                .comment("check if value is null")
                .append(context.generate(value))
                .append(ifWasNullPopAndGoto(context.getScope(), done, boolean.class, value.getType().getJavaType()))
                .putVariable(firstValue)
                .append(context.generate(newExpression))
                .visitLabel(done);

        return block;
    }