// File: /workspace/github_c_makefile_star2_O3/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 $0xf8, %rsp
movl %r8d, 0xc(%rsp)
movq %rcx, %r12
movl %edx, %ebp
movq %rsi, %r13
movq %rdi, %r14
movl $0x0, 0x8(%rsp)
movq (%rdi), %rbx
xorl %r15d, %r15d
movq %r15, 0xf0(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0xe0(%rsp)
movaps %xmm0, 0xd0(%rsp)
movaps %xmm0, 0xc0(%rsp)
movaps %xmm0, 0xb0(%rsp)
movaps %xmm0, 0x60(%rsp)
movaps %xmm0, 0x70(%rsp)
movaps %xmm0, 0x80(%rsp)
movaps %xmm0, 0x90(%rsp)
movq %r15, 0xa0(%rsp)
movaps %xmm0, 0x10(%rsp)
movaps %xmm0, 0x20(%rsp)
movaps %xmm0, 0x30(%rsp)
movaps %xmm0, 0x40(%rsp)
movq %r15, 0x50(%rsp)
movq 0x10(%rsi), %rsi
testq %rsi, %rsi
je 0x2bfb0e
movq %rbx, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x2c2864
movq %rax, %r15
cmpb $0x0, 0x61(%rbx)
je 0x2bfb36
testq %r15, %r15
je 0x2bfb24
movq %rbx, %rdi
movq %r15, %rsi
callq 0x2a6164
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movb $0x2c, 0x10(%rsp)
leaq 0xb0(%rsp), %rax
movq %rax, 0x20(%rsp)
leaq 0x60(%rsp), %rcx
movq %rcx, 0x28(%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 0x8(%rsp), %rdx
movq %r14, %rdi
movq %r15, %rsi
callq 0x2bfc20
movq %r15, %rdi
movl %eax, %esi
callq 0x2bfbe9
testq %r12, %r12
je 0x2bfba6
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
movl %ebp, %edx
movl 0xc(%rsp), %ecx
callq *%r12
jmp 0x2bfbba
orb $0x1, 0x4(%r15)
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
movl %ebp, %edx
callq 0x2bcc6c
movl 0x8(%rsp), %eax
testl %eax, %eax
je 0x2bfb14
movzbl 0x1f(%r14), %ecx
cmpq $0x7, %rcx
ja 0x2bfb14
leal 0x1(%rcx), %edx
movb %dl, 0x1f(%r14)
movl %eax, 0xd4(%r14,%rcx,4)
jmp 0x2bfb14