// File: /workspace/github_c_makefile_star2_O3/ukontainer[P]sqlite-bench/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,       /* WHERE_GROUPBY or _DISTINCTBY or _ORDERBY_LIMIT */
  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 eqOpMask;         /* Allowed equality operators */
  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;
  eqOpMask = WO_EQ | WO_IS | WO_ISNULL;
  if( wctrlFlags & WHERE_ORDERBY_LIMIT ) eqOpMask |= WO_IN;
  for(iLoop=0; isOrderDistinct && obSat<obDone && iLoop<=nLoop; iLoop++){
    if( iLoop>0 ) ready |= pLoop->maskSelf;
    if( iLoop<nLoop ){
      pLoop = pPath->aLoop[iLoop];
      if( wctrlFlags & WHERE_ORDERBY_LIMIT ) continue;
    }else{
      pLoop = pLast;
    }
    if( pLoop->wsFlags & WHERE_VIRTUALTABLE ){
      if( pLoop->u.vtab.isOrdered ) obSat = obDone;
      break;
    }else{
      pLoop->u.btree.nIdxCol = 0;
    }
    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, eqOpMask, 0);
      if( pTerm==0 ) continue;
      if( pTerm->eOperator==WO_IN ){
        /* IN terms are only valid for sorting in the ORDER BY LIMIT 
        ** optimization, and then only if they are actually used
        ** by the query plan */
        assert( wctrlFlags & WHERE_ORDERBY_LIMIT );
        for(j=0; j<pLoop->nLTerm && pTerm!=pLoop->aLTerm[j]; j++){}
        if( j>=pLoop->nLTerm ) continue;
      }
      if( (pTerm->eOperator&(WO_EQ|WO_IS))!=0 && pOBExpr->iColumn>=0 ){
        if( sqlite3ExprCollSeqMatch(pWInfo->pParse, 
                  pOrderBy->a[i].pExpr, pTerm->pExpr)==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 = 1; /* True to run the ORDER BY search loop */

        assert( j>=pLoop->u.btree.nEq 
            || (pLoop->aLTerm[j]==0)==(j<pLoop->nSkip)
        );
        if( j<pLoop->u.btree.nEq && j>=pLoop->nSkip ){
          u16 eOp = pLoop->aLTerm[j]->eOperator;

          /* Skip over == and IS and ISNULL terms.  (Also skip IN terms when
          ** doing WHERE_ORDERBY_LIMIT processing). 
          **
          ** If the current term is a column of an ((?,?) IN (SELECT...)) 
          ** expression for which the SELECT returns more than one column,
          ** check that it is the only column used by this loop. Otherwise,
          ** if it is one of two or more, none of the columns can be
          ** considered to match an ORDER BY term.  */
          if( (eOp & eqOpMask)!=0 ){
            if( eOp & WO_ISNULL ){
              testcase( isOrderDistinct );
              isOrderDistinct = 0;
            }
            continue;  
          }else if( ALWAYS(eOp & WO_IN) ){
            /* ALWAYS() justification: eOp is an equality operator due to the
            ** j<pLoop->u.btree.nEq constraint above.  Any equality other
            ** than WO_IN is captured by the previous "if".  So this one
            ** always has to be WO_IN. */
            Expr *pX = pLoop->aLTerm[j]->pExpr;
            for(i=j+1; i<pLoop->u.btree.nEq; i++){
              if( pLoop->aLTerm[i]->pExpr==pX ){
                assert( (pLoop->aLTerm[i]->eOperator & WO_IN) );
                bOnce = 0;
                break;
              }
            }
          }
        }

        /* 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 = XN_ROWID;
        }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 
        */
        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>=XN_ROWID ){
            if( pOBExpr->op!=TK_COLUMN ) continue;
            if( pOBExpr->iTable!=iCur ) continue;
            if( pOBExpr->iColumn!=iColumn ) continue;
          }else{
            Expr *pIdxExpr = pIndex->aColExpr->a[j].pExpr;
            if( sqlite3ExprCompareSkip(pOBExpr, pIdxExpr, iCur) ){
              continue;
            }
          }
          if( iColumn!=XN_ROWID ){
            pColl = sqlite3ExprNNCollSeq(pWInfo->pParse, pOrderBy->a[i].pExpr);
            if( sqlite3StrICmp(pColl->zName, pIndex->azColl[j])!=0 ) continue;
          }
          pLoop->u.btree.nIdxCol = j+1;
          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==XN_ROWID ){
            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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movq %r9, 0x98(%rsp)
movl %ecx, %eax
movq %rdx, 0x90(%rsp)
movq %rsi, 0x10(%rsp)
testl %r8d, %r8d
je 0x46a994
movq (%rdi), %rcx
movq (%rcx), %rcx
testb $0x40, 0x5c(%rcx)
jne 0x46b08d
movq 0x10(%rsp), %rcx
movzwl (%rcx), %r10d
xorl %ebx, %ebx
cmpl $0x3f, %r10d
ja 0x46b08f
movq $-0x1, %rdx
movl %r10d, %ecx
shlq %cl, %rdx
movzwl %ax, %eax
movl %eax, 0x2c(%rsp)
btl $0xb, %eax
adcl $0x182, %ebx            # imm = 0x182
testl %r10d, %r10d
je 0x46b05f
notq %rdx
addq $0x8, 0x10(%rsp)
leaq 0x68(%rdi), %rax
movq %rax, 0xa8(%rsp)
leaq 0x290(%rdi), %rax
movq %rax, 0xb0(%rsp)
movzwl %r8w, %esi
xorl %r8d, %r8d
xorl %r14d, %r14d
movq $0x0, 0x68(%rsp)
xorl %r12d, %r12d
xorl %r11d, %r11d
movq %rbx, 0x70(%rsp)
movq %r10, 0x18(%rsp)
movq %rdi, 0x50(%rsp)
movq %rdx, 0x60(%rsp)
movq %rsi, 0x88(%rsp)
testq %r8, %r8
je 0x46aa32
orq 0x8(%r11), %r14
movq 0x98(%rsp), %r11
cmpq %rsi, %r8
jae 0x46aa5b
btl $0xb, 0x2c(%rsp)
movq 0x90(%rsp), %rax
movq 0x18(%rax), %rax
movq (%rax,%r8,8), %r11
jb 0x46b026
testb $0x4, 0x29(%r11)
jne 0x46b046
movq %r8, 0x48(%rsp)
movw $0x0, 0x1e(%r11)
movq 0x8(%rdi), %rax
movq %r11, 0x30(%rsp)
movzbl 0x10(%r11), %ecx
imulq $0x70, %rcx, %rcx
movl 0x48(%rax,%rcx), %r11d
movq %r14, 0xa0(%rsp)
notq %r14
xorl %r15d, %r15d
movl %r11d, 0x4(%rsp)
movl $0x1, %ebp
movl %r15d, %ecx
shlq %cl, %rbp
btq %r15, %r12
jb 0x46ab94
movq %r15, %r13
shlq $0x5, %r13
movq 0x10(%rsp), %rax
movq (%rax,%r13), %rbx
movl 0x4(%rbx), %eax
btl $0xc, %eax
jae 0x46aae3
btl $0x12, %eax
jb 0x46aad6
addq $0x10, %rbx
jmp 0x46aade
movq 0x20(%rbx), %rbx
addq $0x8, %rbx
movq (%rbx), %rbx
jmp 0x46aac1
cmpb $-0x62, (%rbx)
jne 0x46ab94
cmpl %r11d, 0x2c(%rbx)
jne 0x46ab94
movswl 0x30(%rbx), %edx
movq 0xa8(%rsp), %rdi
movl %r11d, %esi
movq %r14, %rcx
movq 0x70(%rsp), %r8
xorl %r9d, %r9d
callq 0x467d7f
testq %rax, %rax
je 0x46ab8a
movzwl 0x14(%rax), %ecx
cmpw $0x1, %cx
movq 0x18(%rsp), %r10
movl 0x4(%rsp), %r11d
jne 0x46ab52
movq 0x30(%rsp), %rsi
movzwl 0x2c(%rsi), %edx
testq %rdx, %rdx
je 0x46ab94
movq 0x38(%rsi), %rsi
xorl %edi, %edi
cmpq (%rsi,%rdi,8), %rax
je 0x46ab52
incq %rdi
cmpq %rdi, %rdx
jne 0x46ab42
jmp 0x46ab94
testb $-0x7e, %cl
je 0x46ab85
cmpw $0x0, 0x30(%rbx)
js 0x46ab85
addq 0x10(%rsp), %r13
movq 0x50(%rsp), %rcx
movq (%rcx), %rdi
movq (%r13), %rsi
movq (%rax), %rdx
callq 0x467d18
movl 0x4(%rsp), %r11d
movq 0x18(%rsp), %r10
testl %eax, %eax
je 0x46ab94
orq %rbp, %r12
jmp 0x46ab94
movq 0x18(%rsp), %r10
movl 0x4(%rsp), %r11d
incq %r15
cmpq %r10, %r15
jne 0x46aa9c
movq 0x30(%rsp), %r8
movl 0x28(%r8), %eax
btl $0xc, %eax
jb 0x46af38
btl $0x8, %eax
jb 0x46abf7
movq 0x20(%r8), %r13
testq %r13, %r13
movq 0x48(%rsp), %rcx
je 0x46b08d
testb $0x4, 0x63(%r13)
jne 0x46b08d
movzwl 0x60(%r13), %ebp
cmpb $0x0, 0x62(%r13)
setne %bl
testq %rbp, %rbp
je 0x46b03f
movzwl 0x5e(%r13), %eax
movl %eax, 0x3c(%rsp)
jmp 0x46ac0e
movl $0x1, %ebp
xorl %r13d, %r13d
movb $0x1, %bl
movl $0x0, 0x3c(%rsp)
movq 0x48(%rsp), %rcx
movl $0x1, %eax
shlq %cl, %rax
movq %rax, 0x78(%rsp)
xorl %esi, %esi
movq $0x0, 0x40(%rsp)
movq $0x0, 0x58(%rsp)
xorl %edx, %edx
movq %rbp, 0x80(%rsp)
movl %edx, 0x28(%rsp)
movzwl 0x18(%r8), %ecx
movb $0x1, %al
movb $0x1, %r15b
movq %rsi, 0x8(%rsp)
cmpq %rcx, %rsi
jae 0x46acbf
movzwl 0x2e(%r8), %edx
movb $0x1, %r15b
cmpq %rdx, 0x8(%rsp)
jb 0x46acbf
movq 0x38(%r8), %rdx
movq 0x8(%rsp), %rax
movq (%rdx,%rax,8), %rsi
movzwl 0x14(%rsi), %edi
testl %edi, 0x70(%rsp)
je 0x46ac8f
btl $0x8, %edi
movzbl %bl, %ebx
movl $0x0, %eax
cmovbl %eax, %ebx
movl 0x28(%rsp), %edx
jmp 0x46aeb8
movb $0x1, %al
testb $0x1, %dil
jne 0x46ac9c
movb $0x1, %r15b
jmp 0x46acbf
movq (%rsi), %rsi
leal -0x1(%rcx), %edi
movq 0x8(%rsp), %r8
cmpq %r8, %rdi
sete %al
je 0x46ac97
movq 0x8(%rdx,%r8,8), %r9
incq %r8
xorl %r15d, %r15d
cmpq %rsi, (%r9)
jne 0x46aca7
testq %r13, %r13
je 0x46ad20
movq 0x8(%r13), %rsi
movq 0x18(%r13), %rdx
movq 0x8(%rsp), %r8
movzwl (%rsi,%r8,2), %esi
cmpw 0x44(%rdx), %si
movl $0xffff, %edi           # imm = 0xFFFF
cmovel %edi, %esi
movq 0x38(%r13), %rdi
movb (%rdi,%r8), %dil
movl %edi, 0x24(%rsp)
movswl %si, %r9d
cmpq %rcx, %r8
jb 0x46ad1b
testb %bl, %bl
je 0x46ad1b
testw %si, %si
js 0x46ad1b
movq 0x8(%rdx), %rcx
movl %r9d, %edx
shlq $0x5, %rdx
cmpb $0x0, 0x18(%rcx,%rdx)
movzbl %bl, %ebx
movl $0x0, %ecx
cmovel %ecx, %ebx
movl %ebx, (%rsp)
jmp 0x46ad31
movl %ebx, (%rsp)
movl $0xffffffff, %r9d       # imm = 0xFFFFFFFF
movl $0x0, 0x24(%rsp)
testb %al, %al
je 0x46af09
xorl %ebp, %ebp
movl %r9d, %r14d
btq %rbp, %r12
jae 0x46ad5a
testb %r15b, %r15b
je 0x46af09
incq %rbp
cmpq %r10, %rbp
jb 0x46ad3e
jmp 0x46af09
movq %rbp, %rbx
shlq $0x5, %rbx
movq 0x10(%rsp), %rax
movq (%rax,%rbx), %rsi
testq %rsi, %rsi
je 0x46ad97
movq %rsi, %rdi
movl 0x4(%rdi), %eax
btl $0xc, %eax
jae 0x46ad99
btl $0x12, %eax
jb 0x46ad87
addq $0x10, %rdi
jmp 0x46ad8f
movq 0x20(%rdi), %rdi
addq $0x8, %rdi
movq (%rdi), %rdi
testq %rdi, %rdi
jne 0x46ad72
xorl %edi, %edi
movl 0x2c(%rsp), %eax
andl $0xc0, %eax
movzbl %r15b, %r15d
cmovel %eax, %r15d
cmpl $-0x1, %r9d
jl 0x46adcc
cmpb $-0x62, (%rdi)
jne 0x46ad44
cmpl %r11d, 0x2c(%rdi)
jne 0x46ad44
movswl 0x30(%rdi), %eax
cmpl %eax, %r9d
jne 0x46ad44
cmpl $-0x1, %r9d
jne 0x46ae04
jmp 0x46ae4a
movq 0x50(%r13), %rax
movq 0x8(%rsp), %rcx
shlq $0x5, %rcx
movq 0x8(%rax,%rcx), %rsi
movl %r11d, %edx
callq 0x467cb4
testl %eax, %eax
je 0x46adfc
movq 0x18(%rsp), %r10
movl 0x4(%rsp), %r11d
movl %r14d, %r9d
jmp 0x46ad44
addq 0x10(%rsp), %rbx
movq (%rbx), %rsi
movq 0x50(%rsp), %rax
movq (%rax), %rbx
movq %rbx, %rdi
callq 0x43b88c
testq %rax, %rax
jne 0x46ae20
movq (%rbx), %rax
movq 0x10(%rax), %rax
movq (%rax), %rdi
movq 0x40(%r13), %rax
movq 0x8(%rsp), %rcx
movq (%rax,%rcx,8), %rsi
callq 0x4079b2
testl %eax, %eax
movq 0x18(%rsp), %r10
movl 0x4(%rsp), %r11d
movl %r14d, %r9d
jne 0x46ad44
movq 0x8(%rsp), %rax
incl %eax
movq 0x30(%rsp), %rcx
movw %ax, 0x1e(%rcx)
testb $0x40, 0x2c(%rsp)
jne 0x46ae8f
cmpb $0x0, 0x40(%rsp)
je 0x46aecb
movl 0x24(%rsp), %esi
xorb 0x58(%rsp), %sil
movl %ebp, %eax
movq %rax, %rcx
shlq $0x5, %rcx
movb $0x1, %dl
movq %rdx, 0x40(%rsp)
movq 0x10(%rsp), %rdx
cmpb 0x18(%rdx,%rcx), %sil
je 0x46ae91
jmp 0x46af09
movl %ebp, %eax
cmpl $-0x1, %r9d
movl 0x28(%rsp), %edx
movzbl %dl, %edx
movl $0x1, %ecx
cmovel %ecx, %edx
btsq %rax, %r12
movq 0x30(%rsp), %r8
movl (%rsp), %ebx
movq 0x80(%rsp), %rbp
movq 0x8(%rsp), %rsi
incq %rsi
cmpq %rbp, %rsi
jne 0x46ac39
jmp 0x46af30
movl %ebp, %eax
movq %rax, %rcx
shlq $0x5, %rcx
movq 0x10(%rsp), %rdx
movb 0x18(%rdx,%rcx), %cl
movl %ecx, %edx
movl 0x24(%rsp), %esi
xorb %sil, %dl
movq %rdx, 0x58(%rsp)
movb $0x1, %dl
movq %rdx, 0x40(%rsp)
cmpb %sil, %cl
je 0x46ae91
movq 0x120(%rsp), %rcx
movq 0x78(%rsp), %rdx
orq %rdx, (%rcx)
jmp 0x46ae91
movq 0x8(%rsp), %r14
cmpl %r14d, 0x3c(%rsp)
movl (%rsp), %ebx
movzbl %bl, %ebx
movl $0x0, %eax
cmoval %eax, %ebx
testq %r14, %r14
cmovel %eax, %ebx
movq 0x30(%rsp), %r8
movl 0x28(%rsp), %edx
orb %bl, %dl
je 0x46b053
movq 0x68(%rsp), %r13
orq 0x8(%r8), %r13
movq %r13, 0x68(%rsp)
notq %r13
movq 0x10(%rsp), %rbp
xorl %ebx, %ebx
movl $0x1, %r14d
movl %ebx, %ecx
shlq %cl, %r14
btq %rbx, %r12
jb 0x46afe9
movq (%rbp), %r15
testq %r15, %r15
je 0x46afdc
movq 0xb0(%rsp), %rdi
movq %r15, %rsi
callq 0x467917
movq 0x18(%rsp), %r10
testq %rax, %rax
jne 0x46afde
movb $0x1, 0xdc(%rsp)
leaq -0x19423(%rip), %rax    # 0x451b74
movq %rax, 0xc0(%rsp)
leaq -0x19378(%rip), %rax    # 0x451c2e
movq %rax, 0xc8(%rsp)
movl $0x0, 0xe0(%rsp)
leaq 0xb8(%rsp), %rdi
movq %r15, %rsi
callq 0x451c38
cmpb $0x0, 0xdc(%rsp)
je 0x46affb
xorl %eax, %eax
movq 0x18(%rsp), %r10
jmp 0x46afde
xorl %eax, %eax
testq %r13, %rax
je 0x46afe6
xorl %r14d, %r14d
orq %r14, %r12
incq %rbx
addq $0x20, %rbp
cmpq %rbx, %r10
jne 0x46af50
jmp 0x46b002
movq 0x18(%rsp), %r10
jmp 0x46afe9
movq 0x50(%rsp), %rdi
movq 0x60(%rsp), %rdx
movq 0x88(%rsp), %rsi
movq 0x48(%rsp), %r8
movq 0xa0(%rsp), %r14
movq 0x30(%rsp), %r11
xorl %eax, %eax
cmpq %rdx, %r12
jae 0x46b05a
leaq 0x1(%r8), %rcx
cmpq %rsi, %r8
movq %rcx, %r8
jb 0x46aa29
jmp 0x46b05a
xorl %edx, %edx
jmp 0x46af30
cmpb $0x0, 0x1d(%r11)
cmovneq %rdx, %r12
xorl %eax, %eax
jmp 0x46b05a
movb $0x1, %al
movq 0x60(%rsp), %rdx
cmpq %rdx, %r12
jne 0x46b064
movl %r10d, %ebx
jmp 0x46b08f
movb $-0x1, %bl
testb %al, %al
je 0x46b08f
movq %r10, %rbx
cmpq $0x2, %rbx
jl 0x46b08d
decq %rbx
movq $-0x1, %rax
movl %ebx, %ecx
shlq %cl, %rax
orq %r12, %rax
cmpq $-0x1, %rax
jne 0x46b06d
jmp 0x46b08f
xorl %ebx, %ebx
movl %ebx, %eax
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq