// File: /workspace/github_c_makefile_star2_O0/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: codeEqualityTerm
static int codeEqualityTerm(
  Parse *pParse,      /* The parsing context */
  WhereTerm *pTerm,   /* The term of the WHERE clause to be coded */
  WhereLevel *pLevel, /* The level of the FROM clause we are working on */
  int iEq,            /* Index of the equality term within this level */
  int bRev,           /* True for reverse-order IN operations */
  int iTarget         /* Attempt to leave results in this register */
){
  Expr *pX = pTerm->pExpr;
  Vdbe *v = pParse->pVdbe;
  int iReg;                  /* Register holding results */

  assert( iTarget>0 );
  if( pX->op==TK_EQ ){
    iReg = sqlite3ExprCodeTarget(pParse, pX->pRight, iTarget);
  }else if( pX->op==TK_ISNULL ){
    iReg = iTarget;
    sqlite3VdbeAddOp2(v, OP_Null, 0, iReg);
#ifndef SQLITE_OMIT_SUBQUERY
  }else{
    int eType;
    int iTab;
    struct InLoop *pIn;
    WhereLoop *pLoop = pLevel->pWLoop;

    if( (pLoop->wsFlags & WHERE_VIRTUALTABLE)==0
      && pLoop->u.btree.pIndex!=0
      && pLoop->u.btree.pIndex->aSortOrder[iEq]
    ){
      testcase( iEq==0 );
      testcase( bRev );
      bRev = !bRev;
    }
    assert( pX->op==TK_IN );
    iReg = iTarget;
    eType = sqlite3FindInIndex(pParse, pX, 0);
    if( eType==IN_INDEX_INDEX_DESC ){
      testcase( bRev );
      bRev = !bRev;
    }
    iTab = pX->iTable;
    sqlite3VdbeAddOp2(v, bRev ? OP_Last : OP_Rewind, iTab, 0);
    assert( (pLoop->wsFlags & WHERE_MULTI_OR)==0 );
    pLoop->wsFlags |= WHERE_IN_ABLE;
    if( pLevel->u.in.nIn==0 ){
      pLevel->addrNxt = sqlite3VdbeMakeLabel(v);
    }
    pLevel->u.in.nIn++;
    pLevel->u.in.aInLoop =
       sqlite3DbReallocOrFree(pParse->db, pLevel->u.in.aInLoop,
                              sizeof(pLevel->u.in.aInLoop[0])*pLevel->u.in.nIn);
    pIn = pLevel->u.in.aInLoop;
    if( pIn ){
      pIn += pLevel->u.in.nIn - 1;
      pIn->iCur = iTab;
      if( eType==IN_INDEX_ROWID ){
        pIn->addrInTop = sqlite3VdbeAddOp2(v, OP_Rowid, iTab, iReg);
      }else{
        pIn->addrInTop = sqlite3VdbeAddOp3(v, OP_Column, iTab, 0, iReg);
      }
      pIn->eEndLoopOp = bRev ? OP_Prev : OP_Next;
      sqlite3VdbeAddOp1(v, OP_IsNull, iReg);
    }else{
      pLevel->u.in.nIn = 0;
    }
#endif
  }
  disableTerm(pLevel, pTerm);
  return iReg;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movl %r8d, -0x20(%rbp)
movl %r9d, -0x24(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x4c, %eax
jne 0x7b0fe
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rax
movq 0x18(%rax), %rsi
movl -0x24(%rbp), %edx
callq 0x687c0
movl %eax, -0x3c(%rbp)
jmp 0x7b2fb
movq -0x30(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x49, %eax
jne 0x7b128
movl -0x24(%rbp), %eax
movl %eax, -0x3c(%rbp)
movq -0x38(%rbp), %rdi
movl -0x3c(%rbp), %ecx
movl $0x18, %esi
xorl %edx, %edx
callq 0x5e0c0
jmp 0x7b2f9
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
movl 0x28(%rax), %eax
andl $0x400, %eax            # imm = 0x400
cmpl $0x0, %eax
jne 0x7b17a
movq -0x58(%rbp), %rax
cmpq $0x0, 0x20(%rax)
je 0x7b17a
movq -0x58(%rbp), %rax
movq 0x20(%rax), %rax
movq 0x38(%rax), %rax
movslq -0x1c(%rbp), %rcx
movzbl (%rax,%rcx), %eax
cmpl $0x0, %eax
je 0x7b17a
cmpl $0x0, -0x20(%rbp)
setne %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x20(%rbp)
movl -0x24(%rbp), %eax
movl %eax, -0x3c(%rbp)
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x6abf0
movl %eax, -0x40(%rbp)
cmpl $0x4, -0x40(%rbp)
jne 0x7b1ab
cmpl $0x0, -0x20(%rbp)
setne %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x20(%rbp)
movq -0x30(%rbp), %rax
movl 0x2c(%rax), %eax
movl %eax, -0x44(%rbp)
movq -0x38(%rbp), %rdi
movl -0x20(%rbp), %ecx
movl $0x65, %esi
movl $0x62, %eax
cmpl $0x0, %ecx
cmovnel %eax, %esi
movl -0x44(%rbp), %edx
xorl %ecx, %ecx
callq 0x5e0c0
movq -0x58(%rbp), %rax
movl 0x28(%rax), %ecx
orl $0x800, %ecx            # imm = 0x800
movl %ecx, 0x28(%rax)
movq -0x18(%rbp), %rax
cmpl $0x0, 0x30(%rax)
jne 0x7b202
movq -0x38(%rbp), %rdi
callq 0x67890
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x10(%rax)
movq -0x18(%rbp), %rax
movl 0x30(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x30(%rax)
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rsi
movq -0x18(%rbp), %rax
movslq 0x30(%rax), %rax
imulq $0xc, %rax, %rax
movl %eax, %edx
callq 0x46020
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x38(%rax)
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x50(%rbp)
cmpq $0x0, -0x50(%rbp)
je 0x7b2ec
movq -0x18(%rbp), %rax
movl 0x30(%rax), %ecx
subl $0x1, %ecx
movq -0x50(%rbp), %rax
movslq %ecx, %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x50(%rbp)
movl -0x44(%rbp), %ecx
movq -0x50(%rbp), %rax
movl %ecx, (%rax)
cmpl $0x1, -0x40(%rbp)
jne 0x7b29d
movq -0x38(%rbp), %rdi
movl -0x44(%rbp), %edx
movl -0x3c(%rbp), %ecx
movl $0x60, %esi
callq 0x5e0c0
movl %eax, %ecx
movq -0x50(%rbp), %rax
movl %ecx, 0x4(%rax)
jmp 0x7b2bd
movq -0x38(%rbp), %rdi
movl -0x44(%rbp), %edx
movl -0x3c(%rbp), %r8d
movl $0x29, %esi
xorl %ecx, %ecx
callq 0x5e0f0
movl %eax, %ecx
movq -0x50(%rbp), %rax
movl %ecx, 0x4(%rax)
movl -0x20(%rbp), %edx
movl $0x7, %eax
movl $0x6, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
movb %al, %cl
movq -0x50(%rbp), %rax
movb %cl, 0x8(%rax)
movq -0x38(%rbp), %rdi
movl -0x3c(%rbp), %edx
movl $0x49, %esi
callq 0x5ecf0
jmp 0x7b2f7
movq -0x18(%rbp), %rax
movl $0x0, 0x30(%rax)
jmp 0x7b2f9
jmp 0x7b2fb
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x7b320
movl -0x3c(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)