// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: exprCodeBetween
static void exprCodeBetween(
  Parse *pParse,    /* Parsing and code generating context */
  Expr *pExpr,      /* The BETWEEN expression */
  int dest,         /* Jump destination or storage location */
  void (*xJump)(Parse*,Expr*,int,int), /* Action to take */
  int jumpIfNull    /* Take the jump if the BETWEEN is NULL */
){
  Expr exprAnd;     /* The AND operator in  x>=y AND x<=z  */
  Expr compLeft;    /* The  x>=y  term */
  Expr compRight;   /* The  x<=z  term */
  int regFree1 = 0; /* Temporary use register */
  Expr *pDel = 0;
  sqlite3 *db = pParse->db;

  memset(&compLeft, 0, sizeof(Expr));
  memset(&compRight, 0, sizeof(Expr));
  memset(&exprAnd, 0, sizeof(Expr));

  assert( !ExprHasProperty(pExpr, EP_xIsSelect) );
  pDel = sqlite3ExprDup(db, pExpr->pLeft, 0);
  if( db->mallocFailed==0 ){
    exprAnd.op = TK_AND;
    exprAnd.pLeft = &compLeft;
    exprAnd.pRight = &compRight;
    compLeft.op = TK_GE;
    compLeft.pLeft = pDel;
    compLeft.pRight = pExpr->x.pList->a[0].pExpr;
    compRight.op = TK_LE;
    compRight.pLeft = pDel;
    compRight.pRight = pExpr->x.pList->a[1].pExpr;
    exprToRegister(pDel, exprCodeVector(pParse, pDel, &regFree1));
    if( xJump ){
      xJump(pParse, &exprAnd, dest, jumpIfNull);
    }else{
      /* Mark the expression is being from the ON or USING clause of a join
      ** so that the sqlite3ExprCodeTarget() routine will not attempt to move
      ** it into the Parse.pConstExpr list.  We should use a new bit for this,
      ** for clarity, but we are out of bits in the Expr.flags field so we
      ** have to reuse the EP_FromJoin bit.  Bummer. */
      pDel->flags |= EP_FromJoin;
      sqlite3ExprCodeTarget(pParse, &exprAnd, dest);
    }
    sqlite3ReleaseTempReg(pParse, regFree1);
  }
  sqlite3ExprDelete(db, pDel);

  /* Ensure adequate test coverage */
  testcase( xJump==sqlite3ExprIfTrue  && jumpIfNull==0 && regFree1==0 );
  testcase( xJump==sqlite3ExprIfTrue  && jumpIfNull==0 && regFree1!=0 );
  testcase( xJump==sqlite3ExprIfTrue  && jumpIfNull!=0 && regFree1==0 );
  testcase( xJump==sqlite3ExprIfTrue  && jumpIfNull!=0 && regFree1!=0 );
  testcase( xJump==sqlite3ExprIfFalse && jumpIfNull==0 && regFree1==0 );
  testcase( xJump==sqlite3ExprIfFalse && jumpIfNull==0 && regFree1!=0 );
  testcase( xJump==sqlite3ExprIfFalse && jumpIfNull!=0 && regFree1==0 );
  testcase( xJump==sqlite3ExprIfFalse && jumpIfNull!=0 && regFree1!=0 );
  testcase( xJump==0 );
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movl %r8d, %ebp
movq %rcx, 0x18(%rsp)
movl %edx, %r12d
movq %rsi, %r13
movq %rdi, %r14
andl $0x0, 0x10(%rsp)
movq (%rdi), %rbx
xorps %xmm0, %xmm0
movaps %xmm0, 0xf0(%rsp)
movaps %xmm0, 0xe0(%rsp)
movaps %xmm0, 0xd0(%rsp)
andq $0x0, 0x100(%rsp)
movaps %xmm0, 0xc0(%rsp)
movaps %xmm0, 0x70(%rsp)
movaps %xmm0, 0x80(%rsp)
movaps %xmm0, 0x90(%rsp)
movaps %xmm0, 0xa0(%rsp)
andq $0x0, 0xb0(%rsp)
movaps %xmm0, 0x20(%rsp)
movaps %xmm0, 0x30(%rsp)
movaps %xmm0, 0x40(%rsp)
movaps %xmm0, 0x50(%rsp)
andq $0x0, 0x60(%rsp)
movq 0x10(%rsi), %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x267197
movq %rax, %r15
cmpb $0x0, 0x61(%rbx)
je 0x2670d3
movq %rbx, %rdi
movq %r15, %rsi
callq 0x24b639
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %r12d, 0xc(%rsp)
movl %ebp, 0x14(%rsp)
movb $0x2c, 0x20(%rsp)
leaq 0xc0(%rsp), %rax
movq %rax, 0x30(%rsp)
leaq 0x70(%rsp), %rcx
movq %rcx, 0x38(%rsp)
movb $0x39, (%rax)
movq %r15, 0x10(%rax)
movq 0x20(%r13), %rdx
movq 0x8(%rdx), %rsi
movq %rsi, 0x18(%rax)
movb $0x37, (%rcx)
movq %r15, 0x10(%rcx)
movq 0x20(%rdx), %rax
movq %rax, 0x18(%rcx)
leaq 0x10(%rsp), %rdx
movq %r14, %rdi
movq %r15, %rsi
callq 0x2671bf
movq %r15, %rdi
movl %eax, %esi
callq 0x2671a6
movq 0x18(%rsp), %rax
testq %rax, %rax
je 0x267152
leaq 0x20(%rsp), %rsi
movq %r14, %rdi
movl 0xc(%rsp), %edx
movl 0x14(%rsp), %ecx
callq *%rax
jmp 0x267168
orb $0x1, 0x4(%r15)
leaq 0x20(%rsp), %rsi
movq %r14, %rdi
movl 0xc(%rsp), %edx
callq 0x264a71
movl 0x10(%rsp), %eax
testl %eax, %eax
je 0x2670b6
movzbl 0x1f(%r14), %ecx
cmpq $0x7, %rcx
ja 0x2670b6
leal 0x1(%rcx), %edx
movb %dl, 0x1f(%r14)
movl %eax, 0xd4(%r14,%rcx,4)
jmp 0x2670b6