// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x120, %rsp            # imm = 0x120
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq %rcx, -0x20(%rbp)
movl %r8d, -0x24(%rbp)
movl $0x0, -0x104(%rbp)
movq $0x0, -0x110(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x118(%rbp)
leaq -0xb8(%rbp), %rdi
xorl %esi, %esi
movl $0x48, %edx
callq 0x19360
leaq -0x100(%rbp), %rdi
xorl %esi, %esi
movl $0x48, %edx
callq 0x19360
leaq -0x70(%rbp), %rdi
xorl %esi, %esi
movl $0x48, %edx
callq 0x19360
movq -0x118(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rsi
xorl %edx, %edx
callq 0x42dee0
movq %rax, -0x110(%rbp)
movq -0x118(%rbp), %rax
movzbl 0x61(%rax), %eax
cmpl $0x0, %eax
jne 0x42de91
movb $0x2c, -0x70(%rbp)
leaq -0xb8(%rbp), %rax
movq %rax, -0x60(%rbp)
leaq -0x100(%rbp), %rax
movq %rax, -0x58(%rbp)
movb $0x39, -0xb8(%rbp)
movq -0x110(%rbp), %rax
movq %rax, -0xa8(%rbp)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, -0xa0(%rbp)
movb $0x37, -0x100(%rbp)
movq -0x110(%rbp), %rax
movq %rax, -0xf0(%rbp)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq 0x20(%rax), %rax
movq %rax, -0xe8(%rbp)
movq -0x110(%rbp), %rax
movq %rax, -0x120(%rbp)
movq -0x8(%rbp), %rdi
movq -0x110(%rbp), %rsi
leaq -0x104(%rbp), %rdx
callq 0x42df80
movq -0x120(%rbp), %rdi
movl %eax, %esi
callq 0x42df30
cmpq $0x0, -0x20(%rbp)
je 0x42de62
movq -0x20(%rbp), %rax
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %edx
movl -0x24(%rbp), %ecx
leaq -0x70(%rbp), %rsi
callq *%rax
jmp 0x42de82
movq -0x110(%rbp), %rax
movl 0x4(%rax), %ecx
orl $0x1, %ecx
movl %ecx, 0x4(%rax)
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %edx
leaq -0x70(%rbp), %rsi
callq 0x42a500
movq -0x8(%rbp), %rdi
movl -0x104(%rbp), %esi
callq 0x42e560
movq -0x118(%rbp), %rdi
movq -0x110(%rbp), %rsi
callq 0x40c670
addq $0x120, %rsp            # imm = 0x120
popq %rbp
retq
nopl (%rax)