// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/external/sqlite-3.33.0/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( pLevel->pWLoop->aLTerm[iEq]==pTerm );
  assert( iTarget>0 );
  if( pX->op==TK_EQ || pX->op==TK_IS ){
    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 = IN_INDEX_NOOP;
    int iTab;
    struct InLoop *pIn;
    WhereLoop *pLoop = pLevel->pWLoop;
    int i;
    int nEq = 0;
    int *aiMap = 0;

    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;

    for(i=0; i<iEq; i++){
      if( pLoop->aLTerm[i] && pLoop->aLTerm[i]->pExpr==pX ){
        disableTerm(pLevel, pTerm);
        return iTarget;
      }
    }
    for(i=iEq;i<pLoop->nLTerm; i++){
      assert( pLoop->aLTerm[i]!=0 );
      if( pLoop->aLTerm[i]->pExpr==pX ) nEq++;
    }

    iTab = 0;
    if( (pX->flags & EP_xIsSelect)==0 || pX->x.pSelect->pEList->nExpr==1 ){
      eType = sqlite3FindInIndex(pParse, pX, IN_INDEX_LOOP, 0, 0, &iTab);
    }else{
      sqlite3 *db = pParse->db;
      pX = removeUnindexableInClauseTerms(pParse, iEq, pLoop, pX);

      if( !db->mallocFailed ){
        aiMap = (int*)sqlite3DbMallocZero(pParse->db, sizeof(int)*nEq);
        eType = sqlite3FindInIndex(pParse, pX, IN_INDEX_LOOP, 0, aiMap, &iTab);
        pTerm->pExpr->iTable = iTab;
      }
      sqlite3ExprDelete(db, pX);
      pX = pTerm->pExpr;
    }

    if( eType==IN_INDEX_INDEX_DESC ){
      testcase( bRev );
      bRev = !bRev;
    }
    sqlite3VdbeAddOp2(v, bRev ? OP_Last : OP_Rewind, iTab, 0);
    VdbeCoverageIf(v, bRev);
    VdbeCoverageIf(v, !bRev);
    assert( (pLoop->wsFlags & WHERE_MULTI_OR)==0 );

    pLoop->wsFlags |= WHERE_IN_ABLE;
    if( pLevel->u.in.nIn==0 ){
      pLevel->addrNxt = sqlite3VdbeMakeLabel(pParse);
    }

    i = pLevel->u.in.nIn;
    pLevel->u.in.nIn += nEq;
    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 ){
      int iMap = 0;               /* Index in aiMap[] */
      pIn += i;
      for(i=iEq;i<pLoop->nLTerm; i++){
        if( pLoop->aLTerm[i]->pExpr==pX ){
          int iOut = iReg + i - iEq;
          if( eType==IN_INDEX_ROWID ){
            pIn->addrInTop = sqlite3VdbeAddOp2(v, OP_Rowid, iTab, iOut);
          }else{
            int iCol = aiMap ? aiMap[iMap++] : 0;
            pIn->addrInTop = sqlite3VdbeAddOp3(v,OP_Column,iTab, iCol, iOut);
          }
          sqlite3VdbeAddOp1(v, OP_IsNull, iOut); VdbeCoverage(v);
          if( i==iEq ){
            pIn->iCur = iTab;
            pIn->eEndLoopOp = bRev ? OP_Prev : OP_Next;
            if( iEq>0 ){
              pIn->iBase = iReg - i;
              pIn->nPrefix = i;
              pLoop->wsFlags |= WHERE_IN_EARLYOUT;
            }else{
              pIn->nPrefix = 0;
            }
          }else{
            pIn->eEndLoopOp = OP_Noop;
          }
          pIn++;
        }
      }
    }else{
      pLevel->u.in.nIn = 0;
    }
    sqlite3DbFree(pParse->db, aiMap);
#endif
  }
  disableTerm(pLevel, pTerm);
  return iReg;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl %ecx, -0x24(%rbp)
movl %r8d, -0x28(%rbp)
movl %r9d, -0x2c(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x38(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x35, %eax
je 0x456081
movq -0x38(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x2d, %eax
jne 0x45609d
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rax
movq 0x18(%rax), %rsi
movl -0x2c(%rbp), %edx
callq 0x42a500
movl %eax, -0x44(%rbp)
jmp 0x45650e
movq -0x38(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x32, %eax
jne 0x4560c7
movl -0x2c(%rbp), %eax
movl %eax, -0x44(%rbp)
movq -0x40(%rbp), %rdi
movl -0x44(%rbp), %ecx
movl $0x48, %esi
xorl %edx, %edx
callq 0x410100
jmp 0x45650c
movl $0x5, -0x48(%rbp)
movq -0x20(%rbp), %rax
movq 0x50(%rax), %rax
movq %rax, -0x60(%rbp)
movl $0x0, -0x68(%rbp)
movq $0x0, -0x70(%rbp)
movq -0x60(%rbp), %rax
movl 0x28(%rax), %eax
andl $0x400, %eax            # imm = 0x400
cmpl $0x0, %eax
jne 0x45612f
movq -0x60(%rbp), %rax
cmpq $0x0, 0x20(%rax)
je 0x45612f
movq -0x60(%rbp), %rax
movq 0x20(%rax), %rax
movq 0x38(%rax), %rax
movslq -0x24(%rbp), %rcx
movzbl (%rax,%rcx), %eax
cmpl $0x0, %eax
je 0x45612f
cmpl $0x0, -0x28(%rbp)
setne %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x28(%rbp)
movl -0x2c(%rbp), %eax
movl %eax, -0x44(%rbp)
movl $0x0, -0x64(%rbp)
movl -0x64(%rbp), %eax
cmpl -0x24(%rbp), %eax
jge 0x456195
movq -0x60(%rbp), %rax
movq 0x38(%rax), %rax
movslq -0x64(%rbp), %rcx
cmpq $0x0, (%rax,%rcx,8)
je 0x456188
movq -0x60(%rbp), %rax
movq 0x38(%rax), %rax
movslq -0x64(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax), %rax
cmpq -0x38(%rbp), %rax
jne 0x456188
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x456620
movl -0x2c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x456521
jmp 0x45618a
movl -0x64(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x64(%rbp)
jmp 0x45613c
movl -0x24(%rbp), %eax
movl %eax, -0x64(%rbp)
movl -0x64(%rbp), %eax
movq -0x60(%rbp), %rcx
movzwl 0x2c(%rcx), %ecx
cmpl %ecx, %eax
jge 0x4561d9
movq -0x60(%rbp), %rax
movq 0x38(%rax), %rax
movslq -0x64(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax), %rax
cmpq -0x38(%rbp), %rax
jne 0x4561cc
movl -0x68(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x68(%rbp)
jmp 0x4561ce
movl -0x64(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x64(%rbp)
jmp 0x45619b
movl $0x0, -0x4c(%rbp)
movq -0x38(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
je 0x456202
movq -0x38(%rbp), %rax
movq 0x20(%rax), %rax
movq 0x20(%rax), %rax
cmpl $0x1, (%rax)
jne 0x456228
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rsi
movl $0x4, %edx
xorl %eax, %eax
movl %eax, %r8d
leaq -0x4c(%rbp), %r9
movq %r8, %rcx
callq 0x430e80
movl %eax, -0x48(%rbp)
jmp 0x4562b3
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x78(%rbp)
movq -0x10(%rbp), %rdi
movl -0x24(%rbp), %esi
movq -0x60(%rbp), %rdx
movq -0x38(%rbp), %rcx
callq 0x457060
movq %rax, -0x38(%rbp)
movq -0x78(%rbp), %rax
cmpb $0x0, 0x61(%rax)
jne 0x45629b
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movslq -0x68(%rbp), %rsi
shlq $0x2, %rsi
callq 0x3c9520
movq %rax, -0x70(%rbp)
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x70(%rbp), %r8
movl $0x4, %edx
xorl %eax, %eax
movl %eax, %ecx
leaq -0x4c(%rbp), %r9
callq 0x430e80
movl %eax, -0x48(%rbp)
movl -0x4c(%rbp), %ecx
movq -0x18(%rbp), %rax
movq (%rax), %rax
movl %ecx, 0x2c(%rax)
movq -0x78(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x40c670
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x38(%rbp)
cmpl $0x4, -0x48(%rbp)
jne 0x4562ca
cmpl $0x0, -0x28(%rbp)
setne %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x28(%rbp)
movq -0x40(%rbp), %rdi
movl -0x28(%rbp), %ecx
movl $0x25, %esi
movl $0x21, %eax
cmpl $0x0, %ecx
cmovnel %eax, %esi
movl -0x4c(%rbp), %edx
xorl %ecx, %ecx
callq 0x410100
movq -0x60(%rbp), %rax
movl 0x28(%rax), %ecx
orl $0x800, %ecx            # imm = 0x800
movl %ecx, 0x28(%rax)
movq -0x20(%rbp), %rax
cmpl $0x0, 0x40(%rax)
jne 0x456317
movq -0x10(%rbp), %rdi
callq 0x42d540
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x10(%rax)
movq -0x20(%rbp), %rax
movl 0x40(%rax), %eax
movl %eax, -0x64(%rbp)
movl -0x68(%rbp), %ecx
movq -0x20(%rbp), %rax
addl 0x40(%rax), %ecx
movl %ecx, 0x40(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x20(%rbp), %rax
movq 0x48(%rax), %rsi
movq -0x20(%rbp), %rax
movslq 0x40(%rax), %rax
imulq $0x14, %rax, %rdx
callq 0x3ee240
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x48(%rax)
movq -0x20(%rbp), %rax
movq 0x48(%rax), %rax
movq %rax, -0x58(%rbp)
cmpq $0x0, -0x58(%rbp)
je 0x4564f1
movl $0x0, -0x7c(%rbp)
movl -0x64(%rbp), %ecx
movq -0x58(%rbp), %rax
movslq %ecx, %rcx
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x58(%rbp)
movl -0x24(%rbp), %eax
movl %eax, -0x64(%rbp)
movl -0x64(%rbp), %eax
movq -0x60(%rbp), %rcx
movzwl 0x2c(%rcx), %ecx
cmpl %ecx, %eax
jge 0x4564ef
movq -0x60(%rbp), %rax
movq 0x38(%rax), %rax
movslq -0x64(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax), %rax
cmpq -0x38(%rbp), %rax
jne 0x4564df
movl -0x44(%rbp), %eax
addl -0x64(%rbp), %eax
subl -0x24(%rbp), %eax
movl %eax, -0x80(%rbp)
cmpl $0x1, -0x48(%rbp)
jne 0x4563f3
movq -0x40(%rbp), %rdi
movl -0x4c(%rbp), %edx
movl -0x80(%rbp), %ecx
movl $0x7f, %esi
callq 0x410100
movl %eax, %ecx
movq -0x58(%rbp), %rax
movl %ecx, 0x4(%rax)
jmp 0x456451
cmpq $0x0, -0x70(%rbp)
je 0x456417
movq -0x70(%rbp), %rax
movl -0x7c(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x7c(%rbp)
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x88(%rbp)
jmp 0x456421
xorl %eax, %eax
movl %eax, -0x88(%rbp)
jmp 0x456421
movl -0x88(%rbp), %eax
movl %eax, -0x84(%rbp)
movq -0x40(%rbp), %rdi
movl -0x4c(%rbp), %edx
movl -0x84(%rbp), %ecx
movl -0x80(%rbp), %r8d
movl $0x59, %esi
callq 0x410130
movl %eax, %ecx
movq -0x58(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x40(%rbp), %rdi
movl -0x80(%rbp), %edx
movl $0x32, %esi
callq 0x42ba70
movl -0x64(%rbp), %eax
cmpl -0x24(%rbp), %eax
jne 0x4564cb
movl -0x4c(%rbp), %ecx
movq -0x58(%rbp), %rax
movl %ecx, (%rax)
movl -0x28(%rbp), %edx
movl $0x5, %eax
movl $0x4, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
movb %al, %cl
movq -0x58(%rbp), %rax
movb %cl, 0x10(%rax)
cmpl $0x0, -0x24(%rbp)
jle 0x4564be
movl -0x44(%rbp), %ecx
subl -0x64(%rbp), %ecx
movq -0x58(%rbp), %rax
movl %ecx, 0x8(%rax)
movl -0x64(%rbp), %ecx
movq -0x58(%rbp), %rax
movl %ecx, 0xc(%rax)
movq -0x60(%rbp), %rax
movl 0x28(%rax), %ecx
orl $0x40000, %ecx          # imm = 0x40000
movl %ecx, 0x28(%rax)
jmp 0x4564c9
movq -0x58(%rbp), %rax
movl $0x0, 0xc(%rax)
jmp 0x4564d3
movq -0x58(%rbp), %rax
movb $-0x53, 0x10(%rax)
movq -0x58(%rbp), %rax
addq $0x14, %rax
movq %rax, -0x58(%rbp)
jmp 0x4564e1
movl -0x64(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x64(%rbp)
jmp 0x456392
jmp 0x4564fc
movq -0x20(%rbp), %rax
movl $0x0, 0x40(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x70(%rbp), %rsi
callq 0x3c00a0
jmp 0x45650e
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x456620
movl -0x44(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x90, %rsp
popq %rbp
retq
nopl (%rax)