// File: /workspace/github_c_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movl %r9d, %ebx
movq %rdx, %r15
movq %rsi, %r14
movq (%rsi), %rbp
movzbl (%rbp), %eax
cmpl $0x35, %eax
je 0x27c266
movq 0x10(%rdi), %r9
cmpl $0x32, %eax
je 0x27c278
cmpl $0x2d, %eax
jne 0x27c28c
movq 0x18(%rbp), %rsi
movl %ebx, %edx
callq 0x264a71
movl %eax, %ebx
jmp 0x27c76c
pushq $0x48
popq %rsi
movq %r9, %rdi
xorl %edx, %edx
movl %ebx, %ecx
callq 0x24d51a
jmp 0x27c76c
movq 0x50(%r15), %r12
testb $0x4, 0x29(%r12)
movq %rdi, 0x18(%rsp)
movq %r9, 0x60(%rsp)
jne 0x27c2c4
movq 0x20(%r12), %rax
testq %rax, %rax
je 0x27c2c4
movq 0x38(%rax), %rax
movslq %ecx, %rdx
cmpb $0x0, (%rax,%rdx)
je 0x27c2c4
xorl %eax, %eax
testl %r8d, %r8d
sete %al
movl %eax, %r8d
movl %ecx, %edx
movslq %ecx, %r13
xorl %eax, %eax
testl %ecx, %ecx
movl $0x0, %ecx
movl %edx, 0x34(%rsp)
cmovgl %edx, %ecx
cmpq %rax, %rcx
je 0x27c2fa
movq 0x38(%r12), %rdx
movq (%rdx,%rax,8), %rdx
testq %rdx, %rdx
je 0x27c2f5
cmpq %rbp, (%rdx)
je 0x27c76c
incq %rax
jmp 0x27c2d9
movq %r15, 0x70(%rsp)
movl %ebx, 0x30(%rsp)
movzwl 0x2c(%r12), %eax
xorl %r15d, %r15d
movq %r13, %rcx
cmpq %rax, %rcx
jge 0x27c32e
movq 0x38(%r12), %rdx
movq (%rdx,%rcx,8), %rdx
xorl %esi, %esi
cmpq %rbp, (%rdx)
sete %sil
addl %esi, %r15d
incq %rcx
jmp 0x27c30f
movl %r8d, 0x28(%rsp)
andl $0x0, 0x24(%rsp)
testb $0x8, 0x5(%rbp)
movq %r14, 0x68(%rsp)
je 0x27c350
movq 0x20(%rbp), %rax
movq 0x20(%rax), %rax
cmpl $0x1, (%rax)
jne 0x27c37d
movq $0x0, 0x10(%rsp)
pushq $0x4
popq %rdx
leaq 0x24(%rsp), %rbx
movq 0x18(%rsp), %rdi
movq %rbp, %rsi
xorl %ecx, %ecx
xorl %r8d, %r8d
movq %rbx, %r9
callq 0x268c8b
movl (%rbx), %edx
jmp 0x27c5a6
movq 0x18(%rsp), %rax
movq (%rax), %rbx
movq $0x0, (%rsp)
movq %rbx, %rdi
movq %rbp, %rsi
xorl %edx, %edx
callq 0x267197
movq %rax, %rsi
pushq $0x5
popq %rax
movl %eax, 0xc(%rsp)
movq %rbx, 0x48(%rsp)
cmpb $0x0, 0x61(%rbx)
je 0x27c3c2
movq $0x0, 0x10(%rsp)
movq 0x48(%rsp), %rbp
jmp 0x27c593
movq 0x10(%rsi), %rax
movq %rsi, 0x38(%rsp)
movq 0x20(%rsi), %rcx
movq 0x20(%rcx), %rcx
movq 0x20(%rax), %rax
movq %rcx, 0x78(%rsp)
leaq 0x8(%rcx), %rsi
movq %rax, 0x80(%rsp)
addq $0x8, %rax
movq %rax, 0x10(%rsp)
xorl %eax, %eax
movq %r13, %r14
movq $0x0, (%rsp)
movq %rsi, 0x50(%rsp)
movzwl 0x2c(%r12), %ecx
cmpq %rcx, %r14
jge 0x27c488
movq 0x38(%r12), %rcx
movq (%rcx,%r14,8), %rcx
cmpq %rbp, (%rcx)
jne 0x27c480
movslq 0x20(%rcx), %rcx
decq %rcx
imulq $0x18, %rcx, %rbx
movq (%rsi,%rbx), %rdx
testq %rdx, %rdx
je 0x27c480
leaq (%rsi,%rbx), %rcx
movq %rcx, 0x58(%rsp)
movq 0x18(%rsp), %rdi
movq %rax, 0x40(%rsp)
movq (%rsp), %rsi
callq 0x25bc95
movq %rax, (%rsp)
movq 0x58(%rsp), %rax
andq $0x0, (%rax)
movq 0x10(%rsp), %rax
movq (%rax,%rbx), %rdx
movq 0x18(%rsp), %rdi
movq 0x40(%rsp), %rsi
callq 0x25bc95
movq 0x50(%rsp), %rsi
movq 0x10(%rsp), %rcx
andq $0x0, (%rcx,%rbx)
incq %r14
jmp 0x27c403
movq 0x48(%rsp), %rbp
movq %rbp, %rdi
movq %rax, %rbx
movq 0x78(%rsp), %rsi
callq 0x24b63f
movq %rbp, %rdi
movq 0x80(%rsp), %rsi
callq 0x24b63f
movq 0x38(%rsp), %rcx
movq 0x10(%rcx), %rax
movq %rbx, 0x20(%rax)
movq 0x20(%rcx), %rax
movq (%rsp), %rsi
movq %rsi, 0x20(%rax)
testq %rbx, %rbx
je 0x27c4f1
movq %rbx, %rdx
cmpl $0x1, (%rbx)
jne 0x27c4f1
movq 0x8(%rdx), %rbx
andq $0x0, 0x8(%rdx)
movq 0x10(%rcx), %rsi
movq %rbp, %rdi
callq 0x24b639
movq 0x38(%rsp), %rcx
movq %rbx, 0x10(%rcx)
movq 0x20(%rcx), %rax
movq 0x48(%rax), %rax
testq %rax, %rax
movq 0x68(%rsp), %r14
je 0x27c521
movl (%rax), %edx
xorl %ecx, %ecx
testl %edx, %edx
cmovlel %ecx, %edx
imulq $0x18, %rdx, %rdx
cmpq %rcx, %rdx
je 0x27c521
andw $0x0, 0x1c(%rax,%rcx)
addq $0x18, %rcx
jmp 0x27c510
cmpb $0x0, 0x61(%rbp)
je 0x27c53f
movq $0x0, (%rsp)
movq $0x0, 0x10(%rsp)
movq 0x38(%rsp), %rsi
jmp 0x27c593
movq 0x18(%rsp), %rbp
movq (%rbp), %rdi
movl %r15d, %esi
shlq $0x2, %rsi
callq 0x2258ed
pushq $0x4
popq %rdx
leaq 0x24(%rsp), %r9
movq %rbp, %rdi
movq 0x48(%rsp), %rbp
movq 0x38(%rsp), %rbx
movq %rbx, %rsi
xorl %ecx, %ecx
movq %rax, %r8
movq %rax, 0x10(%rsp)
callq 0x268c8b
movl %eax, 0xc(%rsp)
leaq 0x24(%rsp), %rax
movl (%rax), %ecx
movq (%r14), %rax
movq %rcx, (%rsp)
movl %ecx, 0x2c(%rax)
movq %rbx, %rsi
movq %rbp, %rdi
callq 0x24b639
movq (%r14), %rbp
movl 0xc(%rsp), %eax
movq (%rsp), %rdx
xorl %ebx, %ebx
movl 0x28(%rsp), %ecx
testl %ecx, %ecx
sete %bl
movl %eax, 0xc(%rsp)
cmpl $0x4, %eax
cmovnel %ecx, %ebx
xorl %eax, %eax
testl %ebx, %ebx
sete %al
leal 0x21(,%rax,4), %esi
movq 0x60(%rsp), %rdi
movq %rdx, (%rsp)
xorl %ecx, %ecx
callq 0x24d51a
orb $0x8, 0x29(%r12)
movq 0x70(%rsp), %r14
movl 0x40(%r14), %eax
testl %eax, %eax
jne 0x27c601
movq 0x18(%rsp), %rcx
movl 0x44(%rcx), %eax
decl %eax
movl %eax, 0x44(%rcx)
movl %eax, 0x10(%r14)
movl 0x40(%r14), %eax
movl %eax, 0x28(%rsp)
addl %eax, %r15d
movl %r15d, 0x40(%r14)
movq 0x18(%rsp), %rax
movq (%rax), %rdi
movq 0x48(%r14), %rsi
movslq %r15d, %rax
imulq $0x14, %rax, %rdx
callq 0x23a149
movq %rax, 0x48(%r14)
testq %rax, %rax
je 0x27c747
movq %rax, %r15
testl %ebx, %ebx
sete %cl
movslq 0x28(%rsp), %rax
imulq $0x14, %rax, %rax
addq %rax, %r15
orb $0x4, %cl
movb %cl, 0x58(%rsp)
movl 0x30(%rsp), %ebx
movl %ebx, %eax
subl 0x34(%rsp), %eax
movl %eax, 0x50(%rsp)
xorl %r14d, %r14d
movl $0x0, 0x40(%rsp)
movq (%rsp), %rdx
movzwl 0x2c(%r12), %eax
cmpq %rax, %r13
jge 0x27c74c
movq 0x38(%r12), %rax
movq (%rax,%r13,8), %rax
cmpq %rbp, (%rax)
jne 0x27c73a
cmpl $0x1, 0xc(%rsp)
movq %r13, 0x28(%rsp)
jne 0x27c6aa
movq 0x60(%rsp), %r13
movq %r13, %rdi
pushq $0x7f
popq %rsi
movl %ebx, %ecx
callq 0x24d51a
jmp 0x27c6db
movq 0x10(%rsp), %rcx
testq %rcx, %rcx
je 0x27c6c6
movl 0x40(%rsp), %esi
movslq %esi, %rax
incl %esi
movl %esi, 0x40(%rsp)
movl (%rcx,%rax,4), %ecx
jmp 0x27c6c8
xorl %ecx, %ecx
movq 0x60(%rsp), %r13
movq %r13, %rdi
pushq $0x59
popq %rsi
movl %ebx, %r8d
callq 0x24d51f
movl %eax, 0x4(%r15)
movq %r13, %rdi
pushq $0x32
popq %rsi
movl %ebx, %edx
callq 0x265d5c
testq %r14, %r14
je 0x27c701
movb $-0x53, 0x10(%r15)
movq 0x28(%rsp), %r13
movq (%rsp), %rdx
jmp 0x27c736
movq (%rsp), %rdx
movl %edx, (%r15)
movb 0x58(%rsp), %al
movb %al, 0x10(%r15)
movl 0x34(%rsp), %eax
testl %eax, %eax
movq 0x28(%rsp), %r13
jle 0x27c731
movl 0x50(%rsp), %ecx
movl %ecx, 0x8(%r15)
movl %eax, 0xc(%r15)
orb $0x4, 0x2a(%r12)
jmp 0x27c736
andl $0x0, 0xc(%r15)
addq $0x14, %r15
incq %r13
decq %r14
incl %ebx
jmp 0x27c669
andl $0x0, 0x40(%r14)
movq 0x18(%rsp), %rax
movq (%rax), %rdi
movq 0x10(%rsp), %rsi
callq 0x21f26b
movl 0x30(%rsp), %ebx
movq 0x68(%rsp), %r14
movq 0x70(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x27c834
movl %ebx, %eax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq