// File: /workspace/github_c_makefile_star2_O0/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: whereScanNext
static WhereTerm *whereScanNext(WhereScan *pScan){
  int iCur;            /* The cursor on the LHS of the term */
  i16 iColumn;         /* The column on the LHS of the term.  -1 for IPK */
  Expr *pX;            /* An expression being tested */
  WhereClause *pWC;    /* Shorthand for pScan->pWC */
  WhereTerm *pTerm;    /* The term being tested */
  int k = pScan->k;    /* Where to start scanning */

  while( pScan->iEquiv<=pScan->nEquiv ){
    iCur = pScan->aiCur[pScan->iEquiv-1];
    iColumn = pScan->aiColumn[pScan->iEquiv-1];
    if( iColumn==XN_EXPR && pScan->pIdxExpr==0 ) return 0;
    while( (pWC = pScan->pWC)!=0 ){
      for(pTerm=pWC->a+k; k<pWC->nTerm; k++, pTerm++){
        if( pTerm->leftCursor==iCur
         && pTerm->u.leftColumn==iColumn
         && (iColumn!=XN_EXPR
             || sqlite3ExprCompare(pTerm->pExpr->pLeft,pScan->pIdxExpr,iCur)==0)
         && (pScan->iEquiv<=1 || !ExprHasProperty(pTerm->pExpr, EP_FromJoin))
        ){
          if( (pTerm->eOperator & WO_EQUIV)!=0
           && pScan->nEquiv<ArraySize(pScan->aiCur)
           && (pX = sqlite3ExprSkipCollate(pTerm->pExpr->pRight))->op==TK_COLUMN
          ){
            int j;
            for(j=0; j<pScan->nEquiv; j++){
              if( pScan->aiCur[j]==pX->iTable
               && pScan->aiColumn[j]==pX->iColumn ){
                  break;
              }
            }
            if( j==pScan->nEquiv ){
              pScan->aiCur[j] = pX->iTable;
              pScan->aiColumn[j] = pX->iColumn;
              pScan->nEquiv++;
            }
          }
          if( (pTerm->eOperator & pScan->opMask)!=0 ){
            /* Verify the affinity and collating sequence match */
            if( pScan->zCollName && (pTerm->eOperator & WO_ISNULL)==0 ){
              CollSeq *pColl;
              Parse *pParse = pWC->pWInfo->pParse;
              pX = pTerm->pExpr;
              if( !sqlite3IndexAffinityOk(pX, pScan->idxaff) ){
                continue;
              }
              assert(pX->pLeft);
              pColl = sqlite3BinaryCompareCollSeq(pParse,
                                                  pX->pLeft, pX->pRight);
              if( pColl==0 ) pColl = pParse->db->pDfltColl;
              if( sqlite3StrICmp(pColl->zName, pScan->zCollName) ){
                continue;
              }
            }
            if( (pTerm->eOperator & (WO_EQ|WO_IS))!=0
             && (pX = pTerm->pExpr->pRight)->op==TK_COLUMN
             && pX->iTable==pScan->aiCur[0]
             && pX->iColumn==pScan->aiColumn[0]
            ){
              testcase( pTerm->eOperator & WO_IS );
              continue;
            }
            pScan->k = k+1;
            return pTerm;
          }
        }
      }
      pScan->pWC = pScan->pWC->pOuter;
      k = 0;
    }
    pScan->pWC = pScan->pOrigWC;
    k = 0;
    pScan->iEquiv++;
  }
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl 0x28(%rax), %eax
movl %eax, -0x34(%rbp)
movq -0x10(%rbp), %rax
movzbl 0x22(%rax), %eax
movq -0x10(%rbp), %rcx
movzbl 0x21(%rcx), %ecx
cmpl %ecx, %eax
jg 0x89b36
movq -0x10(%rbp), %rax
movq -0x10(%rbp), %rcx
movzbl 0x22(%rcx), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movl 0x2c(%rax,%rcx,4), %eax
movl %eax, -0x14(%rbp)
movq -0x10(%rbp), %rax
movq -0x10(%rbp), %rcx
movzbl 0x22(%rcx), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movw 0x58(%rax,%rcx,2), %ax
movw %ax, -0x16(%rbp)
movswl -0x16(%rbp), %eax
cmpl $-0x2, %eax
jne 0x89813
movq -0x10(%rbp), %rax
cmpq $0x0, 0x18(%rax)
jne 0x89813
movq $0x0, -0x8(%rbp)
jmp 0x89b3e
jmp 0x89815
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, %rax
je 0x89b0e
movq -0x28(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x34(%rbp), %rcx
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movl -0x34(%rbp), %eax
movq -0x28(%rbp), %rcx
cmpl 0x14(%rcx), %eax
jge 0x89aee
movq -0x30(%rbp), %rax
movl 0xc(%rax), %eax
cmpl -0x14(%rbp), %eax
jne 0x89ad2
movq -0x30(%rbp), %rax
movl 0x10(%rax), %eax
movswl -0x16(%rbp), %ecx
cmpl %ecx, %eax
jne 0x89ad2
movswl -0x16(%rbp), %eax
cmpl $-0x2, %eax
jne 0x898a2
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rsi
movl -0x14(%rbp), %edx
callq 0x708d0
cmpl $0x0, %eax
jne 0x89ad2
movq -0x10(%rbp), %rax
movzbl 0x22(%rax), %eax
cmpl $0x1, %eax
jle 0x898c5
movq -0x30(%rbp), %rax
movq (%rax), %rax
movl 0x4(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x89ad2
movq -0x30(%rbp), %rax
movzwl 0x1a(%rax), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
je 0x899a7
movq -0x10(%rbp), %rax
movzbl 0x21(%rax), %eax
cmpl $0xb, %eax
jge 0x899a7
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq 0x18(%rax), %rdi
callq 0x70830
movq %rax, -0x20(%rbp)
movzbl (%rax), %eax
cmpl $0x98, %eax
jne 0x899a7
movl $0x0, -0x38(%rbp)
movl -0x38(%rbp), %eax
movq -0x10(%rbp), %rcx
movzbl 0x21(%rcx), %ecx
cmpl %ecx, %eax
jge 0x89961
movq -0x10(%rbp), %rax
movslq -0x38(%rbp), %rcx
movl 0x2c(%rax,%rcx,4), %eax
movq -0x20(%rbp), %rcx
cmpl 0x2c(%rcx), %eax
jne 0x89954
movq -0x10(%rbp), %rax
movslq -0x38(%rbp), %rcx
movswl 0x58(%rax,%rcx,2), %eax
movq -0x20(%rbp), %rcx
movswl 0x30(%rcx), %ecx
cmpl %ecx, %eax
jne 0x89954
jmp 0x89961
jmp 0x89956
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x89915
movl -0x38(%rbp), %eax
movq -0x10(%rbp), %rcx
movzbl 0x21(%rcx), %ecx
cmpl %ecx, %eax
jne 0x899a5
movq -0x20(%rbp), %rax
movl 0x2c(%rax), %edx
movq -0x10(%rbp), %rax
movslq -0x38(%rbp), %rcx
movl %edx, 0x2c(%rax,%rcx,4)
movq -0x20(%rbp), %rax
movw 0x30(%rax), %dx
movq -0x10(%rbp), %rax
movslq -0x38(%rbp), %rcx
movw %dx, 0x58(%rax,%rcx,2)
movq -0x10(%rbp), %rax
movb 0x21(%rax), %cl
addb $0x1, %cl
movb %cl, 0x21(%rax)
jmp 0x899a7
movq -0x30(%rbp), %rax
movzwl 0x1a(%rax), %eax
movq -0x10(%rbp), %rcx
andl 0x24(%rcx), %eax
cmpl $0x0, %eax
je 0x89ad0
movq -0x10(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x89a68
movq -0x30(%rbp), %rax
movzwl 0x1a(%rax), %eax
andl $0x100, %eax            # imm = 0x100
cmpl $0x0, %eax
jne 0x89a68
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq (%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rax
movsbl 0x20(%rax), %esi
callq 0x72e50
cmpl $0x0, %eax
jne 0x89a18
jmp 0x89ad4
movq -0x48(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rsi
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rdx
callq 0x721b0
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
jne 0x89a4b
movq -0x48(%rbp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rsi
callq 0xb5c0
cmpl $0x0, %eax
je 0x89a66
jmp 0x89ad4
jmp 0x89a68
movq -0x30(%rbp), %rax
movzwl 0x1a(%rax), %eax
andl $0x82, %eax
cmpl $0x0, %eax
je 0x89ab9
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq 0x18(%rax), %rax
movq %rax, -0x20(%rbp)
movzbl (%rax), %eax
cmpl $0x98, %eax
jne 0x89ab9
movq -0x20(%rbp), %rax
movl 0x2c(%rax), %eax
movq -0x10(%rbp), %rcx
cmpl 0x2c(%rcx), %eax
jne 0x89ab9
movq -0x20(%rbp), %rax
movswl 0x30(%rax), %eax
movq -0x10(%rbp), %rcx
movswl 0x58(%rcx), %ecx
cmpl %ecx, %eax
jne 0x89ab9
jmp 0x89ad4
movl -0x34(%rbp), %ecx
addl $0x1, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x28(%rax)
movq -0x30(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x89b3e
jmp 0x89ad2
jmp 0x89ad4
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
movq -0x30(%rbp), %rax
addq $0x38, %rax
movq %rax, -0x30(%rbp)
jmp 0x89842
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movl $0x0, -0x34(%rbp)
jmp 0x89815
movq -0x10(%rbp), %rax
movq (%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movl $0x0, -0x34(%rbp)
movq -0x10(%rbp), %rax
movb 0x22(%rax), %cl
addb $0x1, %cl
movb %cl, 0x22(%rax)
jmp 0x897a6
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax,%rax)