// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: exprCodeBetween
static void exprCodeBetween(
  Parse *pParse,    /* Parsing and code generating context */
  Expr *pExpr,      /* The BETWEEN expression */
  int dest,         /* Jump here if the jump is taken */
  int jumpIfTrue,   /* Take the jump if the BETWEEN is true */
  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 */
  Expr exprX;       /* The  x  subexpression */
  int regFree1 = 0; /* Temporary use register */

  assert( !ExprHasProperty(pExpr, EP_xIsSelect) );
  exprX = *pExpr->pLeft;
  exprAnd.op = TK_AND;
  exprAnd.pLeft = &compLeft;
  exprAnd.pRight = &compRight;
  compLeft.op = TK_GE;
  compLeft.pLeft = &exprX;
  compLeft.pRight = pExpr->x.pList->a[0].pExpr;
  compRight.op = TK_LE;
  compRight.pLeft = &exprX;
  compRight.pRight = pExpr->x.pList->a[1].pExpr;
  exprX.iTable = sqlite3ExprCodeTemp(pParse, &exprX, &regFree1);
  exprX.op2 = exprX.op;
  exprX.op = TK_REGISTER;
  if( jumpIfTrue ){
    sqlite3ExprIfTrue(pParse, &exprAnd, dest, jumpIfNull);
  }else{
    sqlite3ExprIfFalse(pParse, &exprAnd, dest, jumpIfNull);
  }
  sqlite3ReleaseTempReg(pParse, regFree1);

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x128, %rsp            # imm = 0x128
movl %r8d, %r14d
movl %ecx, %r12d
movl %edx, %r15d
movq %rsi, %rax
movq %rdi, %rbx
leaq -0x2c(%rbp), %rdx
movl $0x0, (%rdx)
movq 0x10(%rsi), %rsi
leaq -0xc0(%rbp), %r13
movl $0x9, %ecx
movq %r13, %rdi
rep  movsq (%rsi), %es:(%rdi)
movb $0x45, -0x78(%rbp)
leaq -0x150(%rbp), %rcx
movq %rcx, -0x68(%rbp)
leaq -0x108(%rbp), %rsi
movq %rsi, -0x60(%rbp)
movb $0x50, (%rcx)
movq %r13, 0x10(%rcx)
movq 0x20(%rax), %rax
movq 0x8(%rax), %rax
movq (%rax), %rdi
movq %rdi, 0x18(%rcx)
movb $0x4e, (%rsi)
movq %r13, 0x10(%rsi)
movq 0x20(%rax), %rax
movq %rax, 0x18(%rsi)
movq %rbx, %rdi
movq %r13, %rsi
callq 0x4cdbd
movl %eax, 0x2c(%r13)
movb (%r13), %al
movb %al, 0x37(%r13)
movb $-0x7c, (%r13)
leaq -0x78(%rbp), %rsi
movq %rbx, %rdi
movl %r15d, %edx
movl %r14d, %ecx
testl %r12d, %r12d
je 0x4cfa2
callq 0x4ca74
jmp 0x4cfa7
callq 0x4c638
movl -0x2c(%rbp), %eax
testl %eax, %eax
je 0x4cfe0
movzbl 0x1f(%rbx), %ecx
cmpq $0x7, %rcx
ja 0x4cfe0
xorl %edx, %edx
cmpl %eax, 0x84(%rbx,%rdx)
je 0x4cfdb
addq $0x18, %rdx
cmpl $0xf0, %edx
jne 0x4cfba
leal 0x1(%rcx), %edx
movb %dl, 0x1f(%rbx)
movl %eax, 0x28(%rbx,%rcx,4)
jmp 0x4cfe0
movb $0x1, 0x7c(%rbx,%rdx)
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq