// File: /workspace/github_c_makefile_star2_O2/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: wherePathSatisfiesOrderBy
static i8 wherePathSatisfiesOrderBy(
  WhereInfo *pWInfo,    /* The WHERE clause */
  ExprList *pOrderBy,   /* ORDER BY or GROUP BY or DISTINCT clause to check */
  WherePath *pPath,     /* The WherePath to check */
  u16 wctrlFlags,       /* Might contain WHERE_GROUPBY or WHERE_DISTINCTBY */
  u16 nLoop,            /* Number of entries in pPath->aLoop[] */
  WhereLoop *pLast,     /* Add this WhereLoop to the end of pPath->aLoop[] */
  Bitmask *pRevMask     /* OUT: Mask of WhereLoops to run in reverse order */
){
  u8 revSet;            /* True if rev is known */
  u8 rev;               /* Composite sort order */
  u8 revIdx;            /* Index sort order */
  u8 isOrderDistinct;   /* All prior WhereLoops are order-distinct */
  u8 distinctColumns;   /* True if the loop has UNIQUE NOT NULL columns */
  u8 isMatch;           /* iColumn matches a term of the ORDER BY clause */
  u16 nKeyCol;          /* Number of key columns in pIndex */
  u16 nColumn;          /* Total number of ordered columns in the index */
  u16 nOrderBy;         /* Number terms in the ORDER BY clause */
  int iLoop;            /* Index of WhereLoop in pPath being processed */
  int i, j;             /* Loop counters */
  int iCur;             /* Cursor number for current WhereLoop */
  int iColumn;          /* A column number within table iCur */
  WhereLoop *pLoop = 0; /* Current WhereLoop being processed. */
  WhereTerm *pTerm;     /* A single term of the WHERE clause */
  Expr *pOBExpr;        /* An expression from the ORDER BY clause */
  CollSeq *pColl;       /* COLLATE function from an ORDER BY clause term */
  Index *pIndex;        /* The index associated with pLoop */
  sqlite3 *db = pWInfo->pParse->db;  /* Database connection */
  Bitmask obSat = 0;    /* Mask of ORDER BY terms satisfied so far */
  Bitmask obDone;       /* Mask of all ORDER BY terms */
  Bitmask orderDistinctMask;  /* Mask of all well-ordered loops */
  Bitmask ready;              /* Mask of inner loops */

  /*
  ** We say the WhereLoop is "one-row" if it generates no more than one
  ** row of output.  A WhereLoop is one-row if all of the following are true:
  **  (a) All index columns match with WHERE_COLUMN_EQ.
  **  (b) The index is unique
  ** Any WhereLoop with an WHERE_COLUMN_EQ constraint on the rowid is one-row.
  ** Every one-row WhereLoop will have the WHERE_ONEROW bit set in wsFlags.
  **
  ** We say the WhereLoop is "order-distinct" if the set of columns from
  ** that WhereLoop that are in the ORDER BY clause are different for every
  ** row of the WhereLoop.  Every one-row WhereLoop is automatically
  ** order-distinct.   A WhereLoop that has no columns in the ORDER BY clause
  ** is not order-distinct. To be order-distinct is not quite the same as being
  ** UNIQUE since a UNIQUE column or index can have multiple rows that 
  ** are NULL and NULL values are equivalent for the purpose of order-distinct.
  ** To be order-distinct, the columns must be UNIQUE and NOT NULL.
  **
  ** The rowid for a table is always UNIQUE and NOT NULL so whenever the
  ** rowid appears in the ORDER BY clause, the corresponding WhereLoop is
  ** automatically order-distinct.
  */

  assert( pOrderBy!=0 );
  if( nLoop && OptimizationDisabled(db, SQLITE_OrderByIdxJoin) ) return 0;

  nOrderBy = pOrderBy->nExpr;
  testcase( nOrderBy==BMS-1 );
  if( nOrderBy>BMS-1 ) return 0;  /* Cannot optimize overly large ORDER BYs */
  isOrderDistinct = 1;
  obDone = MASKBIT(nOrderBy)-1;
  orderDistinctMask = 0;
  ready = 0;
  for(iLoop=0; isOrderDistinct && obSat<obDone && iLoop<=nLoop; iLoop++){
    if( iLoop>0 ) ready |= pLoop->maskSelf;
    pLoop = iLoop<nLoop ? pPath->aLoop[iLoop] : pLast;
    if( pLoop->wsFlags & WHERE_VIRTUALTABLE ){
      if( pLoop->u.vtab.isOrdered ) obSat = obDone;
      break;
    }
    iCur = pWInfo->pTabList->a[pLoop->iTab].iCursor;

    /* Mark off any ORDER BY term X that is a column in the table of
    ** the current loop for which there is term in the WHERE
    ** clause of the form X IS NULL or X=? that reference only outer
    ** loops.
    */
    for(i=0; i<nOrderBy; i++){
      if( MASKBIT(i) & obSat ) continue;
      pOBExpr = sqlite3ExprSkipCollate(pOrderBy->a[i].pExpr);
      if( pOBExpr->op!=TK_COLUMN ) continue;
      if( pOBExpr->iTable!=iCur ) continue;
      pTerm = sqlite3WhereFindTerm(&pWInfo->sWC, iCur, pOBExpr->iColumn,
                       ~ready, WO_EQ|WO_ISNULL|WO_IS, 0);
      if( pTerm==0 ) continue;
      if( (pTerm->eOperator&(WO_EQ|WO_IS))!=0 && pOBExpr->iColumn>=0 ){
        const char *z1, *z2;
        pColl = sqlite3ExprCollSeq(pWInfo->pParse, pOrderBy->a[i].pExpr);
        if( !pColl ) pColl = db->pDfltColl;
        z1 = pColl->zName;
        pColl = sqlite3ExprCollSeq(pWInfo->pParse, pTerm->pExpr);
        if( !pColl ) pColl = db->pDfltColl;
        z2 = pColl->zName;
        if( sqlite3StrICmp(z1, z2)!=0 ) continue;
        testcase( pTerm->pExpr->op==TK_IS );
      }
      obSat |= MASKBIT(i);
    }

    if( (pLoop->wsFlags & WHERE_ONEROW)==0 ){
      if( pLoop->wsFlags & WHERE_IPK ){
        pIndex = 0;
        nKeyCol = 0;
        nColumn = 1;
      }else if( (pIndex = pLoop->u.btree.pIndex)==0 || pIndex->bUnordered ){
        return 0;
      }else{
        nKeyCol = pIndex->nKeyCol;
        nColumn = pIndex->nColumn;
        assert( nColumn==nKeyCol+1 || !HasRowid(pIndex->pTable) );
        assert( pIndex->aiColumn[nColumn-1]==XN_ROWID
                          || !HasRowid(pIndex->pTable));
        isOrderDistinct = IsUniqueIndex(pIndex);
      }

      /* Loop through all columns of the index and deal with the ones
      ** that are not constrained by == or IN.
      */
      rev = revSet = 0;
      distinctColumns = 0;
      for(j=0; j<nColumn; j++){
        u8 bOnce;   /* True to run the ORDER BY search loop */

        /* Skip over == and IS NULL terms */
        if( j<pLoop->u.btree.nEq
         && pLoop->nSkip==0
         && ((i = pLoop->aLTerm[j]->eOperator) & (WO_EQ|WO_ISNULL|WO_IS))!=0
        ){
          if( i & WO_ISNULL ){
            testcase( isOrderDistinct );
            isOrderDistinct = 0;
          }
          continue;  
        }

        /* Get the column number in the table (iColumn) and sort order
        ** (revIdx) for the j-th column of the index.
        */
        if( pIndex ){
          iColumn = pIndex->aiColumn[j];
          revIdx = pIndex->aSortOrder[j];
          if( iColumn==pIndex->pTable->iPKey ) iColumn = -1;
        }else{
          iColumn = XN_ROWID;
          revIdx = 0;
        }

        /* An unconstrained column that might be NULL means that this
        ** WhereLoop is not well-ordered
        */
        if( isOrderDistinct
         && iColumn>=0
         && j>=pLoop->u.btree.nEq
         && pIndex->pTable->aCol[iColumn].notNull==0
        ){
          isOrderDistinct = 0;
        }

        /* Find the ORDER BY term that corresponds to the j-th column
        ** of the index and mark that ORDER BY term off 
        */
        bOnce = 1;
        isMatch = 0;
        for(i=0; bOnce && i<nOrderBy; i++){
          if( MASKBIT(i) & obSat ) continue;
          pOBExpr = sqlite3ExprSkipCollate(pOrderBy->a[i].pExpr);
          testcase( wctrlFlags & WHERE_GROUPBY );
          testcase( wctrlFlags & WHERE_DISTINCTBY );
          if( (wctrlFlags & (WHERE_GROUPBY|WHERE_DISTINCTBY))==0 ) bOnce = 0;
          if( iColumn>=(-1) ){
            if( pOBExpr->op!=TK_COLUMN ) continue;
            if( pOBExpr->iTable!=iCur ) continue;
            if( pOBExpr->iColumn!=iColumn ) continue;
          }else{
            if( sqlite3ExprCompare(pOBExpr,pIndex->aColExpr->a[j].pExpr,iCur) ){
              continue;
            }
          }
          if( iColumn>=0 ){
            pColl = sqlite3ExprCollSeq(pWInfo->pParse, pOrderBy->a[i].pExpr);
            if( !pColl ) pColl = db->pDfltColl;
            if( sqlite3StrICmp(pColl->zName, pIndex->azColl[j])!=0 ) continue;
          }
          isMatch = 1;
          break;
        }
        if( isMatch && (wctrlFlags & WHERE_GROUPBY)==0 ){
          /* Make sure the sort order is compatible in an ORDER BY clause.
          ** Sort order is irrelevant for a GROUP BY clause. */
          if( revSet ){
            if( (rev ^ revIdx)!=pOrderBy->a[i].sortOrder ) isMatch = 0;
          }else{
            rev = revIdx ^ pOrderBy->a[i].sortOrder;
            if( rev ) *pRevMask |= MASKBIT(iLoop);
            revSet = 1;
          }
        }
        if( isMatch ){
          if( iColumn<0 ){
            testcase( distinctColumns==0 );
            distinctColumns = 1;
          }
          obSat |= MASKBIT(i);
        }else{
          /* No match found */
          if( j==0 || j<nKeyCol ){
            testcase( isOrderDistinct!=0 );
            isOrderDistinct = 0;
          }
          break;
        }
      } /* end Loop over all index columns */
      if( distinctColumns ){
        testcase( isOrderDistinct==0 );
        isOrderDistinct = 1;
      }
    } /* end-if not one-row */

    /* Mark off any other ORDER BY terms that reference pLoop */
    if( isOrderDistinct ){
      orderDistinctMask |= pLoop->maskSelf;
      for(i=0; i<nOrderBy; i++){
        Expr *p;
        Bitmask mTerm;
        if( MASKBIT(i) & obSat ) continue;
        p = pOrderBy->a[i].pExpr;
        mTerm = sqlite3WhereExprUsage(&pWInfo->sMaskSet,p);
        if( mTerm==0 && !sqlite3ExprIsConstant(p) ) continue;
        if( (mTerm&~orderDistinctMask)==0 ){
          obSat |= MASKBIT(i);
        }
      }
    }
  } /* End the loop over all WhereLoops from outer-most down to inner-most */
  if( obSat==obDone ) return (i8)nOrderBy;
  if( !isOrderDistinct ){
    for(i=nOrderBy-1; i>0; i--){
      Bitmask m = MASKBIT(i) - 1;
      if( (obSat&m)==m ) return i;
    }
    return 0;
  }
  return -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %r9, -0xf0(%rbp)
movl %ecx, %r10d
movq %rdx, -0xe8(%rbp)
movq %rsi, -0x58(%rbp)
movq (%rdi), %rax
movq (%rax), %rcx
testl %r8d, %r8d
je 0x5c527
testb $-0x80, 0x4c(%rcx)
jne 0x5cbf3
movq %rdi, -0x88(%rbp)
movq -0x58(%rbp), %rax
movzwl (%rax), %r9d
xorl %edx, %edx
cmpl $0x3f, %r9d
ja 0x5cbf5
movq %rcx, -0x98(%rbp)
pushq $-0x1
popq %rax
movl %r9d, %ecx
shlq %cl, %rax
notq %rax
movq %rax, -0xa0(%rbp)
movq -0x88(%rbp), %rax
leaq 0x158(%rax), %rcx
movq %rcx, -0xf8(%rbp)
addq $0x54, %rax
movq %rax, -0x100(%rbp)
movzwl %r8w, %eax
movq %rax, -0xd0(%rbp)
movb $0x1, %r11b
pushq $0x1
popq %rsi
movl %r10d, %eax
andl $0x300, %eax            # imm = 0x300
movl %eax, -0xb0(%rbp)
shrl $0x8, %r10d
andl $0x1, %r10d
movl %r10d, -0xac(%rbp)
xorl %edi, %edi
xorl %eax, %eax
xorl %r8d, %r8d
movq $0x0, -0xc8(%rbp)
movq $0x0, -0xa8(%rbp)
movq %r9, -0x38(%rbp)
testb %r11b, %r11b
je 0x5cbbc
movq %rax, %rdx
movq -0xa0(%rbp), %rax
cmpq %rax, %r8
jae 0x5cbc3
cmpq -0xd0(%rbp), %rdi
ja 0x5cbc3
testq %rdi, %rdi
je 0x5c60b
movq -0xa8(%rbp), %rcx
orq 0x8(%rdx), %rcx
movq %rcx, -0xa8(%rbp)
movq -0xf0(%rbp), %rcx
cmpq -0xd0(%rbp), %rdi
jae 0x5c631
movq -0xe8(%rbp), %rax
movq 0x18(%rax), %rax
movq (%rax,%rdi,8), %rcx
movq -0xa0(%rbp), %rax
testb $0x4, 0x29(%rcx)
jne 0x5cbb2
movl %r11d, -0x2c(%rbp)
movq %rdi, -0x68(%rbp)
movq -0x88(%rbp), %rax
movq 0x8(%rax), %rax
movq %rcx, -0x50(%rbp)
movzbl 0x10(%rcx), %ecx
imulq $0x70, %rcx, %rcx
movl 0x4c(%rax,%rcx), %eax
movl %eax, -0x70(%rbp)
movq -0xa8(%rbp), %rax
notq %rax
movq %rax, -0x40(%rbp)
xorl %r15d, %r15d
xorl %ebx, %ebx
cmpq %rbx, %r9
je 0x5c782
movq %rsi, %r14
movl %ebx, %ecx
shlq %cl, %r14
btq %rbx, %r8
jb 0x5c776
movq %r8, %r13
movq -0x58(%rbp), %rax
movq 0x8(%rax), %rax
movq (%rax,%r15), %rdi
callq 0x4cea1
cmpb $-0x68, (%rax)
jne 0x5c76c
movq %rax, %r12
movl -0x70(%rbp), %esi
cmpl %esi, 0x2c(%rax)
jne 0x5c76c
movswl 0x30(%r12), %edx
movq -0xf8(%rbp), %rdi
movq -0x40(%rbp), %rcx
movl $0x182, %r8d            # imm = 0x182
xorl %r9d, %r9d
callq 0x5a270
testq %rax, %rax
je 0x5c76c
testb $-0x7e, 0x1a(%rax)
movq -0x38(%rbp), %r9
movq %r13, %r8
je 0x5c767
cmpw $0x0, 0x30(%r12)
js 0x5c767
movq %rax, -0x48(%rbp)
movq -0x88(%rbp), %r12
movq (%r12), %rdi
movq -0x58(%rbp), %rax
movq 0x8(%rax), %rax
movq (%rax,%r15), %rsi
callq 0x4bb0b
testq %rax, %rax
jne 0x5c729
movq -0x98(%rbp), %rax
movq 0x10(%rax), %rax
movq (%rax), %rax
movq %rax, -0x78(%rbp)
movq (%r12), %rdi
movq -0x48(%rbp), %rax
movq (%rax), %rsi
callq 0x4bb0b
testq %rax, %rax
jne 0x5c750
movq -0x98(%rbp), %rax
movq 0x10(%rax), %rax
movq (%rax), %rsi
movq -0x78(%rbp), %rdi
callq 0xa4f0
testl %eax, %eax
movq -0x38(%rbp), %r9
movq %r13, %r8
jne 0x5c773
orq %r14, %r8
jmp 0x5c773
movq -0x38(%rbp), %r9
movq %r13, %r8
pushq $0x1
popq %rsi
incq %rbx
addq $0x20, %r15
jmp 0x5c674
movq -0x50(%rbp), %rax
movl 0x28(%rax), %eax
btl $0xc, %eax
jb 0x5c7d5
btl $0x8, %eax
movq -0x68(%rbp), %rdi
movl -0x2c(%rbp), %r10d
jb 0x5c7e2
movq -0x50(%rbp), %rax
movq 0x20(%rax), %r11
testq %r11, %r11
je 0x5cbf3
testb $0x4, 0x63(%r11)
jne 0x5cbf3
movzwl 0x5e(%r11), %ecx
movq %rcx, -0xc0(%rbp)
movzwl 0x60(%r11), %ebx
cmpb $0x0, 0x62(%r11)
setne %r10b
jmp 0x5c7f7
movq -0x68(%rbp), %rdi
movl -0x2c(%rbp), %r10d
jmp 0x5caf4
movq $0x0, -0xc0(%rbp)
movq %rsi, %rbx
xorl %r11d, %r11d
movq -0x50(%rbp), %rax
movq %rsi, %rdx
movl %edi, %ecx
shlq %cl, %rdx
movq %rdx, -0xd8(%rbp)
xorl %r15d, %r15d
xorl %r14d, %r14d
movq $0x0, -0xb8(%rbp)
movq $0x0, -0x90(%rbp)
movq %r11, -0x78(%rbp)
movq %rbx, -0xe0(%rbp)
cmpq %rbx, %r15
je 0x5caed
movzwl 0x18(%rax), %ecx
movq %rax, %rdx
movzbl %r10b, %eax
cmpq %rcx, %r15
jae 0x5c84d
cmpw $0x0, 0x2e(%rdx)
je 0x5c8c4
testq %r11, %r11
movl %r14d, -0x7c(%rbp)
movq %r15, -0x48(%rbp)
je 0x5c8aa
movq 0x8(%r11), %rsi
movq 0x18(%r11), %rdx
movzwl (%rsi,%r15,2), %esi
movq 0x38(%r11), %rdi
movb (%rdi,%r15), %r12b
cmpw 0x3c(%rdx), %si
movl $0xffff, %edi           # imm = 0xFFFF
cmovel %edi, %esi
movswl %si, %edi
movl %edi, -0x40(%rbp)
testw %di, %di
setns %dil
movl %edi, -0x60(%rbp)
testb %r10b, %r10b
movl %r12d, -0x5c(%rbp)
je 0x5c8a4
testw %si, %si
js 0x5c8a4
movb $0x1, %sil
movl %esi, -0x60(%rbp)
cmpq %rcx, %r15
jae 0x5c8ef
movl %r10d, -0x2c(%rbp)
jmp 0x5c90a
movl %r10d, -0x2c(%rbp)
movl $0x0, -0x60(%rbp)
movl $0x0, -0x5c(%rbp)
pushq $-0x1
popq %rax
movl %eax, -0x40(%rbp)
jmp 0x5c90a
movq 0x38(%rdx), %rdx
movq (%rdx,%r15,8), %rdx
movzwl 0x1a(%rdx), %edx
testw $0x182, %dx             # imm = 0x182
je 0x5c84d
btl $0x8, %edx
movl $0x0, %ecx
cmovbl %ecx, %eax
movl %eax, %r10d
jmp 0x5cab4
movq 0x8(%rdx), %rcx
movl -0x40(%rbp), %edx
imulq $0x30, %rdx, %rdx
cmpb $0x0, 0x28(%rcx,%rdx)
movl $0x0, %ecx
cmovel %ecx, %eax
movl %eax, -0x2c(%rbp)
movb $0x1, %r12b
xorl %r13d, %r13d
xorl %r15d, %r15d
testb %r12b, %r12b
je 0x5cac0
cmpq %r9, %r15
jae 0x5cac0
btq %r15, %r8
jae 0x5c934
incq %r15
addq $0x20, %r13
jmp 0x5c913
movq %r8, %r14
movq -0x58(%rbp), %rax
movq 0x8(%rax), %rax
movq (%rax,%r13), %rbx
movq %rbx, %rdi
callq 0x4cea1
movl -0xb0(%rbp), %ecx
testl %ecx, %ecx
movzbl %r12b, %r12d
cmovel %ecx, %r12d
cmpl $-0x1, -0x40(%rbp)
jl 0x5c984
cmpb $-0x68, (%rax)
jne 0x5ca07
movl -0x70(%rbp), %ecx
cmpl %ecx, 0x2c(%rax)
movq -0x38(%rbp), %r9
movq %r14, %r8
jne 0x5c92b
movswl 0x30(%rax), %eax
cmpl %eax, -0x40(%rbp)
jne 0x5c92b
jmp 0x5c9b6
movq -0x78(%rbp), %rcx
movq 0x50(%rcx), %rcx
movq 0x8(%rcx), %rcx
movq -0x48(%rbp), %rdx
shlq $0x5, %rdx
movq (%rcx,%rdx), %rsi
movq %rax, %rdi
movl -0x70(%rbp), %edx
callq 0x4cee2
testl %eax, %eax
movq -0x38(%rbp), %r9
movq %r14, %r8
jne 0x5c92b
cmpb $0x0, -0x60(%rbp)
je 0x5ca13
movq -0x88(%rbp), %rax
movq (%rax), %rdi
movq %rbx, %rsi
callq 0x4bb0b
testq %rax, %rax
jne 0x5c9de
movq -0x98(%rbp), %rax
movq 0x10(%rax), %rax
movq (%rax), %rdi
movq -0x78(%rbp), %rax
movq 0x40(%rax), %rax
movq -0x48(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
callq 0xa4f0
testl %eax, %eax
movq -0x38(%rbp), %r9
movq %r14, %r8
jne 0x5c92b
jmp 0x5ca13
movq -0x38(%rbp), %r9
movq %r14, %r8
jmp 0x5c92b
cmpq %r9, %r15
setae %al
orb -0xac(%rbp), %al
jne 0x5ca83
cmpb $0x0, -0x90(%rbp)
je 0x5ca4d
movl -0x5c(%rbp), %edx
xorb -0xb8(%rbp), %dl
movq -0x58(%rbp), %rax
movq 0x8(%rax), %rax
movb $0x1, %cl
movq %rcx, -0x90(%rbp)
cmpb 0x18(%rax,%r13), %dl
je 0x5ca83
jmp 0x5cac0
movq -0x58(%rbp), %rax
movq 0x8(%rax), %rax
movb 0x18(%rax,%r13), %al
movl %eax, %ecx
movl -0x5c(%rbp), %edx
xorb %dl, %cl
movq %rcx, -0xb8(%rbp)
movb $0x1, %cl
movq %rcx, -0x90(%rbp)
cmpb %dl, %al
je 0x5ca83
movq 0x10(%rbp), %rax
movq -0xd8(%rbp), %rcx
orq %rcx, (%rax)
cmpl $0x0, -0x40(%rbp)
movl -0x7c(%rbp), %r14d
movzbl %r14b, %r14d
pushq $0x1
popq %rax
cmovsl %eax, %r14d
btsq %r15, %r8
pushq $0x1
popq %rsi
movq -0x68(%rbp), %rdi
movl -0x2c(%rbp), %r10d
movq -0x78(%rbp), %r11
movq -0xe0(%rbp), %rbx
movq -0x48(%rbp), %r15
incq %r15
movq -0x50(%rbp), %rax
jmp 0x5c82d
movq -0x48(%rbp), %rcx
cmpl %ecx, -0xc0(%rbp)
movl -0x2c(%rbp), %r10d
movzbl %r10b, %r10d
movl $0x0, %eax
cmoval %eax, %r10d
testq %rcx, %rcx
cmovel %eax, %r10d
pushq $0x1
popq %rsi
movq -0x68(%rbp), %rdi
movl -0x7c(%rbp), %r14d
movb $0x1, %al
testb %r14b, %r14b
jne 0x5cb00
testb %r10b, %r10b
je 0x5cba3
movl %r10d, %eax
movl %eax, -0x48(%rbp)
movq -0xc8(%rbp), %rcx
movq -0x50(%rbp), %rax
orq 0x8(%rax), %rcx
movq %rcx, -0xc8(%rbp)
notq %rcx
movq %rcx, -0x40(%rbp)
xorl %r13d, %r13d
xorl %ebx, %ebx
cmpq %rbx, %r9
je 0x5cb99
movq %rsi, %r14
movl %ebx, %ecx
shlq %cl, %r14
btq %rbx, %r8
jb 0x5cb86
movq %r8, -0x70(%rbp)
movq -0x58(%rbp), %rax
movq 0x8(%rax), %rax
movq (%rax,%r13), %r12
movq -0x100(%rbp), %rdi
movq %r12, %rsi
callq 0x59f20
movq %rax, %r15
testq %rax, %rax
jne 0x5cb6b
movq %r12, %rdi
callq 0x4bafa
testl %eax, %eax
je 0x5cb8f
testq %r15, -0x40(%rbp)
movq -0x70(%rbp), %r8
je 0x5cb78
xorl %r14d, %r14d
orq %r14, %r8
movq -0x38(%rbp), %r9
pushq $0x1
popq %rsi
movq -0x68(%rbp), %rdi
incq %rbx
addq $0x20, %r13
jmp 0x5cb25
movq -0x38(%rbp), %r9
movq -0x70(%rbp), %r8
jmp 0x5cb7f
movq -0x50(%rbp), %rax
movl -0x48(%rbp), %r11d
jmp 0x5cbaa
xorl %r11d, %r11d
movq -0x50(%rbp), %rax
incq %rdi
jmp 0x5c5cb
cmpb $0x0, 0x1d(%rcx)
cmovneq %rax, %r8
jmp 0x5cbc3
movq -0xa0(%rbp), %rax
cmpq %rax, %r8
jne 0x5cbcd
movl %r9d, %edx
jmp 0x5cbf5
movb $-0x1, %dl
testb %r11b, %r11b
jne 0x5cbf5
movq %r9, %rdx
cmpq $0x2, %rdx
jl 0x5cbf3
decq %rdx
pushq $-0x1
popq %rax
movl %edx, %ecx
shlq %cl, %rax
orq %r8, %rax
cmpq $-0x1, %rax
jne 0x5cbd7
jmp 0x5cbf5
xorl %edx, %edx
movl %edx, %eax
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq