// File: /workspace/github_c_makefile_star2_O1/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, %r13
movq %rsi, %r12
movq %rdi, %r14
movq (%rsi), %rbp
movzbl (%rbp), %eax
cmpl $0x35, %eax
je 0x2e6898
movq 0x10(%r14), %rdi
cmpl $0x32, %eax
je 0x2e68ad
cmpl $0x2d, %eax
jne 0x2e68c3
movq 0x18(%rbp), %rsi
movq %r14, %rdi
movl %ebx, %edx
callq 0x2c6416
movl %eax, %ebx
jmp 0x2e6d57
movl $0x48, %esi
xorl %edx, %edx
movl %ebx, %ecx
xorl %r8d, %r8d
callq 0x2b200c
jmp 0x2e6d57
movl %r8d, 0x38(%rsp)
movq 0x50(%r13), %r15
testb $0x4, 0x29(%r15)
movq %rdi, 0x60(%rsp)
jne 0x2e68fc
movq 0x20(%r15), %rax
testq %rax, %rax
je 0x2e68fc
movq 0x38(%rax), %rax
movslq %ecx, %rdx
cmpb $0x0, (%rax,%rdx)
je 0x2e68fc
xorl %eax, %eax
cmpl $0x0, 0x38(%rsp)
sete %al
movl %eax, 0x38(%rsp)
testl %ecx, %ecx
setg %r9b
jle 0x2e6940
movq 0x38(%r15), %rax
movl %ecx, %r8d
movq %r8, %rdx
negq %rdx
movl $0x1, %esi
movq -0x8(%rax,%rsi,8), %rdi
testq %rdi, %rdi
je 0x2e6929
cmpq %rbp, (%rdi)
je 0x2e69d1
cmpq %r8, %rsi
setb %r9b
leaq (%rdx,%rsi), %rdi
incq %rdi
incq %rsi
cmpq $0x1, %rdi
jne 0x2e6916
movb %r9b, 0xb(%rsp)
movl %ebx, 0x18(%rsp)
movzwl 0x2c(%r15), %eax
xorl %r9d, %r9d
cmpl %ecx, %eax
jle 0x2e6978
movq 0x38(%r15), %rdx
movslq %ecx, %rsi
xorl %r9d, %r9d
movq (%rdx,%rsi,8), %rdi
xorl %r8d, %r8d
cmpq %rbp, (%rdi)
sete %r8b
addl %r8d, %r9d
incq %rsi
cmpq %rsi, %rax
jne 0x2e695f
movl %ecx, 0x1c(%rsp)
movl $0x0, 0xc(%rsp)
testb $0x8, 0x5(%rbp)
movslq %r9d, %rbx
movq %r12, 0x58(%rsp)
movq %r14, 0x28(%rsp)
movq %r13, 0x50(%rsp)
je 0x2e69a9
movq 0x20(%rbp), %rax
movq 0x20(%rax), %rax
cmpl $0x1, (%rax)
jne 0x2e69e6
movq $0x0, 0x30(%rsp)
leaq 0xc(%rsp), %r9
movq %r14, %rdi
movq %rbp, %rsi
movl $0x4, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x2cb09f
jmp 0x2e6b65
movb %r9b, 0xb(%rsp)
movq %r13, %rdi
movq %r12, %rsi
callq 0x2e6f06
jmp 0x2e6d50
movq %rbx, 0x48(%rsp)
movq (%r14), %rbx
movq %rbx, %rdi
movq %rbp, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x2cbf97
movq %rax, 0x20(%rsp)
movq %rbx, 0x10(%rsp)
cmpb $0x0, 0x61(%rbx)
je 0x2e6a39
movq 0x10(%rsp), %rax
cmpb $0x0, 0x61(%rax)
movq 0x48(%rsp), %rbx
je 0x2e6b0a
movl $0x5, %eax
movq $0x0, 0x30(%rsp)
movq 0x20(%rsp), %r14
jmp 0x2e6b4b
movq 0x20(%rsp), %rcx
movq 0x10(%rcx), %rax
movq 0x20(%rcx), %rcx
movq 0x20(%rcx), %rsi
movq 0x20(%rax), %rdx
movzwl 0x2c(%r15), %eax
movl 0x1c(%rsp), %ecx
cmpl %ecx, %eax
movq %rdx, 0x70(%rsp)
movq %rsi, 0x68(%rsp)
jle 0x2e6d76
addq $0x8, %rsi
leaq 0x8(%rdx), %rax
movq %rax, 0x78(%rsp)
movslq %ecx, %r13
movq $0x0, 0x40(%rsp)
xorl %eax, %eax
movq %rsi, 0x80(%rsp)
movq 0x78(%rsp), %rbx
movq 0x38(%r15), %rcx
movq (%rcx,%r13,8), %rcx
cmpq %rbp, (%rcx)
jne 0x2e6af8
movslq 0x20(%rcx), %rcx
decq %rcx
leaq (%rcx,%rcx,2), %r12
movq (%rsi,%r12,8), %rdx
testq %rdx, %rdx
je 0x2e6af8
leaq (%rsi,%r12,8), %r14
movq 0x28(%rsp), %rdi
movq %rax, 0x30(%rsp)
movq 0x40(%rsp), %rsi
callq 0x2bb1a3
movq %rax, 0x40(%rsp)
xorl %eax, %eax
movq %rax, (%r14)
movq 0x28(%rsp), %r14
movq (%rbx,%r12,8), %rdx
movq %r14, %rdi
movq 0x30(%rsp), %rsi
callq 0x2bb1a3
movq 0x80(%rsp), %rsi
xorl %ecx, %ecx
movq %rcx, (%rbx,%r12,8)
incq %r13
movzwl 0x2c(%r15), %ecx
cmpq %rcx, %r13
jl 0x2e6a91
jmp 0x2e6d81
movq (%r14), %rdi
leaq (,%rbx,4), %rsi
callq 0x283569
leaq 0xc(%rsp), %rbp
movq %r14, %rdi
movq 0x20(%rsp), %r14
movq %r14, %rsi
movl $0x4, %edx
xorl %ecx, %ecx
movq %rax, %r8
movq %rax, 0x30(%rsp)
movq %rbp, %r9
callq 0x2cb09f
movl (%rbp), %edx
movq (%r12), %rcx
movl %edx, 0x2c(%rcx)
testq %r14, %r14
je 0x2e6b61
movq 0x10(%rsp), %rdi
movq %r14, %rsi
movl %eax, %ebp
callq 0x2afd54
movl %ebp, %eax
movq (%r12), %rbp
xorl %r14d, %r14d
movl 0x38(%rsp), %ecx
testl %ecx, %ecx
sete %r14b
movl %eax, 0x40(%rsp)
cmpl $0x4, %eax
cmovnel %ecx, %r14d
xorl %eax, %eax
testl %r14d, %r14d
sete %al
leal 0x21(,%rax,4), %esi
movl 0xc(%rsp), %edx
movq 0x60(%rsp), %rdi
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x2b200c
orb $0x8, 0x29(%r15)
cmpl $0x0, 0x40(%r13)
jne 0x2e6bbc
movq 0x28(%rsp), %rcx
movl 0x44(%rcx), %eax
decl %eax
movl %eax, 0x44(%rcx)
movl %eax, 0x10(%r13)
movslq 0x40(%r13), %r12
addq %r12, %rbx
movl %ebx, 0x40(%r13)
movq 0x28(%rsp), %rax
movq (%rax), %rdi
movq 0x48(%r13), %rsi
shlq $0x2, %rbx
leaq (%rbx,%rbx,4), %rdx
callq 0x29b6a6
movq %rax, 0x48(%r13)
testq %rax, %rax
je 0x2e6d23
movzwl 0x2c(%r15), %ecx
movl 0x1c(%rsp), %edx
cmpl %edx, %ecx
jle 0x2e6d2b
testl %r14d, %r14d
sete %sil
leaq (%r12,%r12,4), %rcx
leaq (%rax,%rcx,4), %r12
orb $0x4, %sil
movb %sil, 0x20(%rsp)
movslq %edx, %r13
movl 0x18(%rsp), %ebx
movl %ebx, %eax
subl %edx, %eax
movq %rax, 0x48(%rsp)
xorl %r14d, %r14d
movl $0x0, 0x10(%rsp)
movq %r15, 0x38(%rsp)
movq 0x38(%r15), %rax
movq (%rax,%r13,8), %rax
cmpq %rbp, (%rax)
jne 0x2e6d0b
cmpl $0x1, 0x40(%rsp)
jne 0x2e6c66
movl 0xc(%rsp), %edx
movq 0x60(%rsp), %r15
movq %r15, %rdi
movl $0x7f, %esi
movl %ebx, %ecx
xorl %r8d, %r8d
jmp 0x2e6c98
movq 0x30(%rsp), %rcx
testq %rcx, %rcx
je 0x2e6c82
movl 0x10(%rsp), %edx
movslq %edx, %rax
incl %edx
movl %edx, 0x10(%rsp)
movl (%rcx,%rax,4), %ecx
jmp 0x2e6c84
xorl %ecx, %ecx
movl 0xc(%rsp), %edx
movq 0x60(%rsp), %r15
movq %r15, %rdi
movl $0x59, %esi
movl %ebx, %r8d
callq 0x2b200c
movl %eax, 0x4(%r12)
movq %r15, %rdi
movl $0x32, %esi
movl %ebx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x2b200c
testq %r14, %r14
je 0x2e6cc8
movb $-0x53, 0x10(%r12)
movq 0x38(%rsp), %r15
jmp 0x2e6d07
movl 0xc(%rsp), %eax
movl %eax, (%r12)
movb 0x20(%rsp), %al
movb %al, 0x10(%r12)
cmpl $0x0, 0x1c(%rsp)
movq 0x38(%rsp), %r15
jle 0x2e6cfe
movq 0x48(%rsp), %rax
addl %r14d, %eax
movl %eax, 0x8(%r12)
movl %r13d, 0xc(%r12)
orb $0x4, 0x2a(%r15)
jmp 0x2e6d07
movl $0x0, 0xc(%r12)
addq $0x14, %r12
incq %r13
movzwl 0x2c(%r15), %eax
decq %r14
incl %ebx
cmpq %rax, %r13
jl 0x2e6c36
jmp 0x2e6d2b
movl $0x0, 0x40(%r13)
movq 0x30(%rsp), %rsi
testq %rsi, %rsi
je 0x2e6d42
movq 0x28(%rsp), %rax
movq (%rax), %rdi
callq 0x28c3e7
movl 0x18(%rsp), %ebx
movq 0x58(%rsp), %r12
movq 0x50(%rsp), %r13
testb $0x1, 0xb(%rsp)
jne 0x2e6d62
movq %r13, %rdi
movq %r12, %rsi
callq 0x2e6f06
movl %ebx, %eax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
movq $0x0, 0x40(%rsp)
movq %rax, %rbp
movq 0x68(%rsp), %rsi
testq %rsi, %rsi
je 0x2e6d98
movq 0x10(%rsp), %rdi
callq 0x2b0183
movq 0x70(%rsp), %rsi
testq %rsi, %rsi
movq 0x58(%rsp), %r12
movq 0x50(%rsp), %r13
movq 0x20(%rsp), %rbx
je 0x2e6dbb
movq 0x10(%rsp), %rdi
callq 0x2b0183
movq 0x10(%rbx), %rax
movq %rbp, 0x20(%rax)
movq 0x20(%rbx), %rax
movq 0x40(%rsp), %rcx
movq %rcx, 0x20(%rax)
testq %rbp, %rbp
je 0x2e6e03
cmpl $0x1, (%rbp)
jne 0x2e6e03
movq 0x8(%rbp), %r14
movq $0x0, 0x8(%rbp)
movq 0x10(%rbx), %rsi
testq %rsi, %rsi
je 0x2e6dfa
movq 0x10(%rsp), %rdi
callq 0x2afd54
movq %r14, 0x10(%rbx)
movq 0x28(%rsp), %r14
movq 0x20(%rbx), %rax
movq 0x48(%rax), %rax
testq %rax, %rax
je 0x2e6a0d
cmpl $0x0, (%rax)
jle 0x2e6a0d
leaq 0x1c(%rax), %rcx
xorl %edx, %edx
movw $0x0, (%rcx)
incq %rdx
movslq (%rax), %rsi
addq $0x18, %rcx
cmpq %rsi, %rdx
jl 0x2e6e23
jmp 0x2e6a0d