// File: /workspace/github_c_makefile_star2_O2/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3ExprIfTrue
SQLITE_PRIVATE void sqlite3ExprIfTrue(Parse *pParse, Expr *pExpr, int dest, int jumpIfNull){
  Vdbe *v = pParse->pVdbe;
  int op = 0;
  int regFree1 = 0;
  int regFree2 = 0;
  int r1, r2;

  assert( jumpIfNull==SQLITE_JUMPIFNULL || jumpIfNull==0 );
  if( NEVER(v==0) )     return;  /* Existence of VDBE checked by caller */
  if( NEVER(pExpr==0) ) return;  /* No way this can happen */
  op = pExpr->op;
  switch( op ){
    case TK_AND: {
      int d2 = sqlite3VdbeMakeLabel(v);
      testcase( jumpIfNull==0 );
      sqlite3ExprCachePush(pParse);
      sqlite3ExprIfFalse(pParse, pExpr->pLeft, d2,jumpIfNull^SQLITE_JUMPIFNULL);
      sqlite3ExprIfTrue(pParse, pExpr->pRight, dest, jumpIfNull);
      sqlite3VdbeResolveLabel(v, d2);
      sqlite3ExprCachePop(pParse, 1);
      break;
    }
    case TK_OR: {
      testcase( jumpIfNull==0 );
      sqlite3ExprIfTrue(pParse, pExpr->pLeft, dest, jumpIfNull);
      sqlite3ExprIfTrue(pParse, pExpr->pRight, dest, jumpIfNull);
      break;
    }
    case TK_NOT: {
      testcase( jumpIfNull==0 );
      sqlite3ExprIfFalse(pParse, pExpr->pLeft, dest, jumpIfNull);
      break;
    }
    case TK_LT:
    case TK_LE:
    case TK_GT:
    case TK_GE:
    case TK_NE:
    case TK_EQ: {
      assert( TK_LT==OP_Lt );
      assert( TK_LE==OP_Le );
      assert( TK_GT==OP_Gt );
      assert( TK_GE==OP_Ge );
      assert( TK_EQ==OP_Eq );
      assert( TK_NE==OP_Ne );
      testcase( op==TK_LT );
      testcase( op==TK_LE );
      testcase( op==TK_GT );
      testcase( op==TK_GE );
      testcase( op==TK_EQ );
      testcase( op==TK_NE );
      testcase( jumpIfNull==0 );
      r1 = sqlite3ExprCodeTemp(pParse, pExpr->pLeft, &regFree1);
      r2 = sqlite3ExprCodeTemp(pParse, pExpr->pRight, &regFree2);
      codeCompare(pParse, pExpr->pLeft, pExpr->pRight, op,
                  r1, r2, dest, jumpIfNull);
      testcase( regFree1==0 );
      testcase( regFree2==0 );
      break;
    }
    case TK_IS:
    case TK_ISNOT: {
      testcase( op==TK_IS );
      testcase( op==TK_ISNOT );
      r1 = sqlite3ExprCodeTemp(pParse, pExpr->pLeft, &regFree1);
      r2 = sqlite3ExprCodeTemp(pParse, pExpr->pRight, &regFree2);
      op = (op==TK_IS) ? TK_EQ : TK_NE;
      codeCompare(pParse, pExpr->pLeft, pExpr->pRight, op,
                  r1, r2, dest, SQLITE_NULLEQ);
      testcase( regFree1==0 );
      testcase( regFree2==0 );
      break;
    }
    case TK_ISNULL:
    case TK_NOTNULL: {
      assert( TK_ISNULL==OP_IsNull );
      assert( TK_NOTNULL==OP_NotNull );
      testcase( op==TK_ISNULL );
      testcase( op==TK_NOTNULL );
      r1 = sqlite3ExprCodeTemp(pParse, pExpr->pLeft, &regFree1);
      sqlite3VdbeAddOp2(v, op, r1, dest);
      testcase( regFree1==0 );
      break;
    }
    case TK_BETWEEN: {
      testcase( jumpIfNull==0 );
      exprCodeBetween(pParse, pExpr, dest, 1, jumpIfNull);
      break;
    }
#ifndef SQLITE_OMIT_SUBQUERY
    case TK_IN: {
      int destIfFalse = sqlite3VdbeMakeLabel(v);
      int destIfNull = jumpIfNull ? dest : destIfFalse;
      sqlite3ExprCodeIN(pParse, pExpr, destIfFalse, destIfNull);
      sqlite3VdbeAddOp2(v, OP_Goto, 0, dest);
      sqlite3VdbeResolveLabel(v, destIfFalse);
      break;
    }
#endif
    default: {
      r1 = sqlite3ExprCodeTemp(pParse, pExpr, &regFree1);
      sqlite3VdbeAddOp3(v, OP_If, r1, dest, jumpIfNull!=0);
      testcase( regFree1==0 );
      testcase( jumpIfNull==0 );
      break;
    }
  }
  sqlite3ReleaseTempReg(pParse, regFree1);
  sqlite3ReleaseTempReg(pParse, regFree2);  
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %ecx, %r15d
movq 0x10(%rdi), %r12
andl $0x0, -0x2c(%rbp)
andl $0x0, -0x30(%rbp)
testq %r12, %r12
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
je 0x47ddb
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rsi, %r13
movq %rdi, %rbx
movzbl (%rsi), %r14d
leal -0x44(%r14), %eax
cmpl $0xc, %eax
ja 0x47e40
leaq 0x1febf(%rip), %rcx     # 0x67cb4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x10(%r13), %rsi
movq %rdx, -0x38(%rbp)
leaq -0x2c(%rbp), %rdx
movq %rbx, %rdi
callq 0x4808a
movl %eax, %r12d
movq 0x18(%r13), %rsi
leaq -0x30(%rbp), %rdx
movq %rbx, %rdi
callq 0x4808a
movq 0x10(%r13), %rsi
movq 0x18(%r13), %rdx
movq %rbx, %rdi
movl %r14d, %ecx
movl %r12d, %r8d
movl %eax, %r9d
pushq %r15
pushq -0x38(%rbp)
jmp 0x47ea1
cmpl $0x13, %r14d
je 0x47f54
cmpl $0x92, %r14d
jne 0x47fcb
movq 0x10(%r13), %rsi
movq %rdx, %r12
leaq -0x2c(%rbp), %rdx
movq %rbx, %rdi
callq 0x4808a
movl %eax, %r15d
movq 0x18(%r13), %rsi
leaq -0x30(%rbp), %rdx
movq %rbx, %rdi
callq 0x4808a
xorl %ecx, %ecx
cmpl $0x46, %r14d
sete %cl
addl $0x4b, %ecx
movq 0x10(%r13), %rsi
movq 0x18(%r13), %rdx
movq %rbx, %rdi
movl %r15d, %r8d
movl %eax, %r9d
pushq $0x80
pushq %r12
callq 0x480d8
popq %rax
popq %rcx
movl -0x2c(%rbp), %esi
movq %rbx, %rdi
callq 0x4701c
movl -0x30(%rbp), %esi
movq %rbx, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x4701c
movq 0x10(%r13), %rsi
movq %rdx, %r15
leaq -0x2c(%rbp), %rdx
movq %rbx, %rdi
callq 0x4808a
movq %r12, %rdi
movl %r14d, %esi
movl %eax, %edx
movl %r15d, %ecx
callq 0x41f42
jmp 0x47ea8
movq %r12, %rdi
movq %rdx, -0x38(%rbp)
callq 0x47934
movl %eax, %r14d
testl %r15d, %r15d
movq -0x38(%rbp), %r15
movl %r15d, %ecx
cmovel %eax, %ecx
movq %rbx, %rdi
movq %r13, %rsi
movl %eax, %edx
callq 0x4823e
pushq $0xe
popq %rsi
movq %r12, %rdi
xorl %edx, %edx
movl %r15d, %ecx
callq 0x41f42
testl %r14d, %r14d
jns 0x47ea8
movq 0x40(%r12), %rax
testq %rax, %rax
je 0x47ea8
notl %r14d
movl 0x34(%r12), %ecx
movl %r14d, %edx
movl %ecx, (%rax,%rdx,4)
jmp 0x47ea8
movq 0x10(%r13), %rsi
movq %rbx, %rdi
movl %r15d, %ecx
callq 0x4797e
jmp 0x47ea8
movq %r12, %rdi
movq %rdx, -0x38(%rbp)
callq 0x47934
incl 0x6c(%rbx)
movl %eax, %r14d
movq 0x10(%r13), %rsi
movl %r15d, %ecx
xorl $0x8, %ecx
movq %rbx, %rdi
movl %eax, %edx
callq 0x4797e
movq 0x18(%r13), %rsi
movq %rbx, %rdi
movq -0x38(%rbp), %rdx
movl %r15d, %ecx
callq 0x47d9c
testl %r14d, %r14d
jns 0x47fbe
movq 0x40(%r12), %rax
testq %rax, %rax
je 0x47fbe
notl %r14d
movl 0x34(%r12), %ecx
movl %r14d, %edx
movl %ecx, (%rax,%rdx,4)
movq %rbx, %rdi
callq 0x4803b
jmp 0x47ea8
movq %rdx, %r14
leaq -0x2c(%rbp), %rdx
movq %rbx, %rdi
movq %r13, %rsi
callq 0x4808a
xorl %r8d, %r8d
testl %r15d, %r15d
setne %r8b
pushq $0x27
popq %rsi
movq %r12, %rdi
movl %eax, %edx
movl %r14d, %ecx
callq 0x41f4c
jmp 0x47ea8
pushq $0x1
popq %rcx
movq %rbx, %rdi
movq %r13, %rsi
movl %r15d, %r8d
callq 0x4816a
jmp 0x47ea8
movq 0x10(%r13), %rsi
movq %rbx, %rdi
movq %rdx, %r14
movl %r15d, %ecx
callq 0x47d9c
movq 0x18(%r13), %rsi
movq %rbx, %rdi
movl %r14d, %edx
movl %r15d, %ecx
callq 0x47d9c
jmp 0x47ea8