// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0xe0, %rsp
movw %r8w, %ax
movq 0x10(%rbp), %r8
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movw %cx, -0x22(%rbp)
movw %ax, -0x24(%rbp)
movq %r9, -0x30(%rbp)
movq $0x0, -0x60(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq (%rax), %rax
movq %rax, -0x88(%rbp)
movq $0x0, -0x90(%rbp)
movzwl -0x24(%rbp), %eax
cmpl $0x0, %eax
je 0x491ed4
movq -0x88(%rbp), %rax
movzwl 0x5c(%rax), %eax
andl $0x40, %eax
cmpl $0x0, %eax
je 0x491ed4
movb $0x0, -0x1(%rbp)
jmp 0x492822
movq -0x18(%rbp), %rax
movl (%rax), %eax
movw %ax, -0x3e(%rbp)
movzwl -0x3e(%rbp), %eax
cmpl $0x3f, %eax
jle 0x491ef0
movb $0x0, -0x1(%rbp)
jmp 0x492822
movb $0x1, -0x34(%rbp)
movzwl -0x3e(%rbp), %eax
movl %eax, %eax
movl %eax, %ecx
movl $0x1, %eax
shlq %cl, %rax
subq $0x1, %rax
movq %rax, -0x98(%rbp)
movq $0x0, -0xa0(%rbp)
movq $0x0, -0xa8(%rbp)
movw $0x182, -0x38(%rbp)     # imm = 0x182
movzwl -0x22(%rbp), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
je 0x491f44
movzwl -0x38(%rbp), %eax
orl $0x1, %eax
movw %ax, -0x38(%rbp)
movl $0x0, -0x44(%rbp)
movzbl -0x34(%rbp), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0xd9(%rbp)
je 0x491f86
movq -0x90(%rbp), %rcx
xorl %eax, %eax
cmpq -0x98(%rbp), %rcx
movb %al, -0xd9(%rbp)
jae 0x491f86
movl -0x44(%rbp), %eax
movzwl -0x24(%rbp), %ecx
cmpl %ecx, %eax
setle %al
movb %al, -0xd9(%rbp)
movb -0xd9(%rbp), %al
testb $0x1, %al
jne 0x491f95
jmp 0x4927a5
cmpl $0x0, -0x44(%rbp)
jle 0x491fb1
movq -0x60(%rbp), %rax
movq 0x8(%rax), %rax
orq -0xa8(%rbp), %rax
movq %rax, -0xa8(%rbp)
movl -0x44(%rbp), %eax
movzwl -0x24(%rbp), %ecx
cmpl %ecx, %eax
jge 0x491fe5
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x44(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x60(%rbp)
movzwl -0x22(%rbp), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
je 0x491fe3
jmp 0x492797
jmp 0x491fed
movq -0x30(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
movl 0x28(%rax), %eax
andl $0x400, %eax            # imm = 0x400
cmpl $0x0, %eax
je 0x49201b
movq -0x60(%rbp), %rax
cmpb $0x0, 0x1d(%rax)
je 0x492016
movq -0x98(%rbp), %rax
movq %rax, -0x90(%rbp)
jmp 0x4927a5
movq -0x60(%rbp), %rax
movw $0x0, 0x1e(%rax)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
addq $0x8, %rax
movq -0x60(%rbp), %rcx
movzbl 0x10(%rcx), %ecx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movl 0x40(%rax), %eax
movl %eax, -0x50(%rbp)
movl $0x0, -0x48(%rbp)
movl -0x48(%rbp), %eax
movzwl -0x3e(%rbp), %ecx
cmpl %ecx, %eax
jge 0x4921e9
movl -0x48(%rbp), %eax
movl %eax, %ecx
movl $0x1, %eax
shlq %cl, %rax
andq -0x90(%rbp), %rax
cmpq $0x0, %rax
je 0x49207b
jmp 0x4921db
movq -0x18(%rbp), %rax
addq $0x8, %rax
movslq -0x48(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq (%rax), %rdi
callq 0x470a60
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x9e, %eax
je 0x4920ad
jmp 0x4921db
movq -0x70(%rbp), %rax
movl 0x2c(%rax), %eax
cmpl -0x50(%rbp), %eax
je 0x4920be
jmp 0x4921db
movq -0x10(%rbp), %rdi
addq $0x68, %rdi
movl -0x50(%rbp), %esi
movq -0x70(%rbp), %rax
movswl 0x30(%rax), %edx
movq -0xa8(%rbp), %rcx
xorq $-0x1, %rcx
movzwl -0x38(%rbp), %r8d
xorl %eax, %eax
movl %eax, %r9d
callq 0x48d3e0
movq %rax, -0x68(%rbp)
cmpq $0x0, -0x68(%rbp)
jne 0x4920fb
jmp 0x4921db
movq -0x68(%rbp), %rax
movzwl 0x14(%rax), %eax
cmpl $0x1, %eax
jne 0x49216f
movl $0x0, -0x4c(%rbp)
movl -0x4c(%rbp), %ecx
movq -0x60(%rbp), %rax
movzwl 0x2c(%rax), %edx
xorl %eax, %eax
cmpl %edx, %ecx
movb %al, -0xda(%rbp)
jge 0x492143
movq -0x68(%rbp), %rax
movq -0x60(%rbp), %rcx
movq 0x38(%rcx), %rcx
movslq -0x4c(%rbp), %rdx
cmpq (%rcx,%rdx,8), %rax
setne %al
movb %al, -0xda(%rbp)
movb -0xda(%rbp), %al
testb $0x1, %al
jne 0x49214f
jmp 0x49215c
jmp 0x492151
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x49210f
movl -0x4c(%rbp), %eax
movq -0x60(%rbp), %rcx
movzwl 0x2c(%rcx), %ecx
cmpl %ecx, %eax
jl 0x49216d
jmp 0x4921db
jmp 0x49216f
movq -0x68(%rbp), %rax
movzwl 0x14(%rax), %eax
andl $0x82, %eax
cmpl $0x0, %eax
je 0x4921c0
movq -0x70(%rbp), %rax
movswl 0x30(%rax), %eax
cmpl $0x0, %eax
jl 0x4921c0
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rax
addq $0x8, %rax
movslq -0x48(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq (%rax), %rsi
movq -0x68(%rbp), %rax
movq (%rax), %rdx
callq 0x48cfc0
cmpl $0x0, %eax
jne 0x4921be
jmp 0x4921db
jmp 0x4921c0
movl -0x48(%rbp), %eax
movl %eax, %ecx
movl $0x1, %eax
shlq %cl, %rax
orq -0x90(%rbp), %rax
movq %rax, -0x90(%rbp)
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0x49204d
movq -0x60(%rbp), %rax
movl 0x28(%rax), %eax
andl $0x1000, %eax           # imm = 0x1000
cmpl $0x0, %eax
jne 0x4926a0
movq -0x60(%rbp), %rax
movl 0x28(%rax), %eax
andl $0x100, %eax            # imm = 0x100
cmpl $0x0, %eax
je 0x492225
movq $0x0, -0x80(%rbp)
movw $0x0, -0x3a(%rbp)
movw $0x1, -0x3c(%rbp)
jmp 0x492288
movq -0x60(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x80(%rbp)
cmpq $0x0, %rax
je 0x49224f
movq -0x80(%rbp), %rax
movw 0x63(%rax), %ax
shrw $0x2, %ax
andw $0x1, %ax
movzwl %ax, %eax
cmpl $0x0, %eax
je 0x492258
movb $0x0, -0x1(%rbp)
jmp 0x492822
movq -0x80(%rbp), %rax
movw 0x5e(%rax), %ax
movw %ax, -0x3a(%rbp)
movq -0x80(%rbp), %rax
movw 0x60(%rax), %ax
movw %ax, -0x3c(%rbp)
movq -0x80(%rbp), %rax
movzbl 0x62(%rax), %eax
cmpl $0x0, %eax
setne %al
andb $0x1, %al
movzbl %al, %eax
movb %al, -0x34(%rbp)
jmp 0x492288
movb $0x0, -0x31(%rbp)
movb $0x0, -0x32(%rbp)
movb $0x0, -0x35(%rbp)
movl $0x0, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
movzwl -0x3c(%rbp), %ecx
cmpl %ecx, %eax
jge 0x492694
movb $0x1, -0xa9(%rbp)
movl -0x4c(%rbp), %eax
movq -0x60(%rbp), %rcx
movzwl 0x18(%rcx), %ecx
cmpl %ecx, %eax
jge 0x492397
movl -0x4c(%rbp), %eax
movq -0x60(%rbp), %rcx
movzwl 0x2e(%rcx), %ecx
cmpl %ecx, %eax
jl 0x492397
movq -0x60(%rbp), %rax
movq 0x38(%rax), %rax
movslq -0x4c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movw 0x14(%rax), %ax
movw %ax, -0xac(%rbp)
movzwl -0xac(%rbp), %eax
movzwl -0x38(%rbp), %ecx
andl %ecx, %eax
cmpl $0x0, %eax
je 0x49231e
movzwl -0xac(%rbp), %eax
andl $0x100, %eax            # imm = 0x100
cmpl $0x0, %eax
je 0x492319
movb $0x0, -0x34(%rbp)
jmp 0x492686
movzwl -0xac(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x492393
movq -0x60(%rbp), %rax
movq 0x38(%rax), %rax
movslq -0x4c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax), %rax
movq %rax, -0xb8(%rbp)
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
movl -0x48(%rbp), %eax
movq -0x60(%rbp), %rcx
movzwl 0x18(%rcx), %ecx
cmpl %ecx, %eax
jge 0x492391
movq -0x60(%rbp), %rax
movq 0x38(%rax), %rax
movslq -0x48(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax), %rax
cmpq -0xb8(%rbp), %rax
jne 0x492384
movb $0x0, -0xa9(%rbp)
jmp 0x492391
jmp 0x492386
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0x492350
jmp 0x492393
jmp 0x492395
jmp 0x492397
cmpq $0x0, -0x80(%rbp)
je 0x4923df
movq -0x80(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x4c(%rbp), %rcx
movswl (%rax,%rcx,2), %eax
movl %eax, -0x54(%rbp)
movq -0x80(%rbp), %rax
movq 0x38(%rax), %rax
movslq -0x4c(%rbp), %rcx
movb (%rax,%rcx), %al
movb %al, -0x33(%rbp)
movl -0x54(%rbp), %eax
movq -0x80(%rbp), %rcx
movq 0x18(%rcx), %rcx
movswl 0x44(%rcx), %ecx
cmpl %ecx, %eax
jne 0x4923dd
movl $0xffffffff, -0x54(%rbp) # imm = 0xFFFFFFFF
jmp 0x4923ea
movl $0xffffffff, -0x54(%rbp) # imm = 0xFFFFFFFF
movb $0x0, -0x33(%rbp)
movzbl -0x34(%rbp), %eax
cmpl $0x0, %eax
je 0x49242c
cmpl $0x0, -0x54(%rbp)
jl 0x49242c
movl -0x4c(%rbp), %eax
movq -0x60(%rbp), %rcx
movzwl 0x18(%rcx), %ecx
cmpl %ecx, %eax
jl 0x49242c
movq -0x80(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x8(%rax), %rax
movslq -0x54(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movzbl 0x18(%rax), %eax
cmpl $0x0, %eax
jne 0x49242c
movb $0x0, -0x34(%rbp)
movb $0x0, -0x36(%rbp)
movl $0x0, -0x48(%rbp)
movzbl -0xa9(%rbp), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0xdb(%rbp)
je 0x49245d
movl -0x48(%rbp), %eax
movzwl -0x3e(%rbp), %ecx
cmpl %ecx, %eax
setl %al
movb %al, -0xdb(%rbp)
movb -0xdb(%rbp), %al
testb $0x1, %al
jne 0x49246c
jmp 0x4925b0
movl -0x48(%rbp), %eax
movl %eax, %ecx
movl $0x1, %eax
shlq %cl, %rax
andq -0x90(%rbp), %rax
cmpq $0x0, %rax
je 0x49248b
jmp 0x4925a2
movq -0x18(%rbp), %rax
addq $0x8, %rax
movslq -0x48(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq (%rax), %rdi
callq 0x470a60
movq %rax, -0x70(%rbp)
movzwl -0x22(%rbp), %eax
andl $0xc0, %eax
cmpl $0x0, %eax
jne 0x4924bf
movb $0x0, -0xa9(%rbp)
cmpl $-0x1, -0x54(%rbp)
jl 0x4924fd
movq -0x70(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x9e, %eax
je 0x4924d8
jmp 0x4925a2
movq -0x70(%rbp), %rax
movl 0x2c(%rax), %eax
cmpl -0x50(%rbp), %eax
je 0x4924e9
jmp 0x4925a2
movq -0x70(%rbp), %rax
movswl 0x30(%rax), %eax
cmpl -0x54(%rbp), %eax
je 0x4924fb
jmp 0x4925a2
jmp 0x49253a
movq -0x80(%rbp), %rax
movq 0x50(%rax), %rax
addq $0x8, %rax
movslq -0x4c(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq %rax, -0xc0(%rbp)
movq -0x70(%rbp), %rdi
movq -0xc0(%rbp), %rsi
movl -0x50(%rbp), %edx
callq 0x48cf70
cmpl $0x0, %eax
je 0x492538
jmp 0x4925a2
jmp 0x49253a
cmpl $-0x1, -0x54(%rbp)
je 0x49258b
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rax
addq $0x8, %rax
movslq -0x48(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq (%rax), %rsi
callq 0x485c70
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rax
movq (%rax), %rdi
movq -0x80(%rbp), %rax
movq 0x40(%rax), %rax
movslq -0x4c(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
callq 0x409750
cmpl $0x0, %eax
je 0x492589
jmp 0x4925a2
jmp 0x49258b
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movw %ax, %cx
movq -0x60(%rbp), %rax
movw %cx, 0x1e(%rax)
movb $0x1, -0x36(%rbp)
jmp 0x4925b0
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0x492437
movzbl -0x36(%rbp), %eax
cmpl $0x0, %eax
je 0x492640
movzwl -0x22(%rbp), %eax
andl $0x40, %eax
cmpl $0x0, %eax
jne 0x492640
cmpb $0x0, -0x31(%rbp)
je 0x4925fa
movzbl -0x32(%rbp), %eax
movzbl -0x33(%rbp), %ecx
xorl %ecx, %eax
movq -0x18(%rbp), %rcx
addq $0x8, %rcx
movslq -0x48(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rcx
movzbl 0x18(%rcx), %ecx
cmpl %ecx, %eax
je 0x4925f8
movb $0x0, -0x36(%rbp)
jmp 0x49263e
movzbl -0x33(%rbp), %eax
movq -0x18(%rbp), %rcx
addq $0x8, %rcx
movslq -0x48(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rcx
movzbl 0x18(%rcx), %ecx
xorl %ecx, %eax
movb %al, -0x32(%rbp)
cmpb $0x0, -0x32(%rbp)
je 0x49263a
movl -0x44(%rbp), %eax
movl %eax, %ecx
movl $0x1, %eax
shlq %cl, %rax
movq %rax, %rcx
movq 0x10(%rbp), %rax
orq (%rax), %rcx
movq %rcx, (%rax)
movb $0x1, -0x31(%rbp)
jmp 0x492640
cmpb $0x0, -0x36(%rbp)
je 0x49266d
cmpl $-0x1, -0x54(%rbp)
jne 0x492650
movb $0x1, -0x35(%rbp)
movl -0x48(%rbp), %eax
movl %eax, %ecx
movl $0x1, %eax
shlq %cl, %rax
orq -0x90(%rbp), %rax
movq %rax, -0x90(%rbp)
jmp 0x492684
cmpl $0x0, -0x4c(%rbp)
je 0x49267e
movl -0x4c(%rbp), %eax
movzwl -0x3a(%rbp), %ecx
cmpl %ecx, %eax
jge 0x492682
movb $0x0, -0x34(%rbp)
jmp 0x492694
jmp 0x492686
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x49229b
cmpb $0x0, -0x35(%rbp)
je 0x49269e
movb $0x1, -0x34(%rbp)
jmp 0x4926a0
cmpb $0x0, -0x34(%rbp)
je 0x492795
movq -0x60(%rbp), %rax
movq 0x8(%rax), %rax
orq -0xa0(%rbp), %rax
movq %rax, -0xa0(%rbp)
movl $0x0, -0x48(%rbp)
movl -0x48(%rbp), %eax
movzwl -0x3e(%rbp), %ecx
cmpl %ecx, %eax
jge 0x492793
movl -0x48(%rbp), %eax
movl %eax, %ecx
movl $0x1, %eax
shlq %cl, %rax
andq -0x90(%rbp), %rax
cmpq $0x0, %rax
je 0x4926f5
jmp 0x492785
movq -0x18(%rbp), %rax
addq $0x8, %rax
movslq -0x48(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq %rax, -0xc8(%rbp)
movq -0x10(%rbp), %rdi
addq $0x290, %rdi            # imm = 0x290
movq -0xc8(%rbp), %rsi
callq 0x48b580
movq %rax, -0xd0(%rbp)
cmpq $0x0, -0xd0(%rbp)
jne 0x49274d
movq -0xc8(%rbp), %rdi
callq 0x46e580
cmpl $0x0, %eax
jne 0x49274d
jmp 0x492785
movq -0xd0(%rbp), %rax
movq -0xa0(%rbp), %rcx
xorq $-0x1, %rcx
andq %rcx, %rax
cmpq $0x0, %rax
jne 0x492783
movl -0x48(%rbp), %eax
movl %eax, %ecx
movl $0x1, %eax
shlq %cl, %rax
orq -0x90(%rbp), %rax
movq %rax, -0x90(%rbp)
jmp 0x492785
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0x4926c7
jmp 0x492795
jmp 0x492797
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x491f4b
movq -0x90(%rbp), %rax
cmpq -0x98(%rbp), %rax
jne 0x4927be
movw -0x3e(%rbp), %ax
movb %al, -0x1(%rbp)
jmp 0x492822
cmpb $0x0, -0x34(%rbp)
jne 0x49281e
movzwl -0x3e(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x48(%rbp)
cmpl $0x0, -0x48(%rbp)
jle 0x492818
movl -0x48(%rbp), %eax
movl %eax, %ecx
movl $0x1, %eax
shlq %cl, %rax
subq $0x1, %rax
movq %rax, -0xd8(%rbp)
movq -0x90(%rbp), %rax
andq -0xd8(%rbp), %rax
cmpq -0xd8(%rbp), %rax
jne 0x49280b
movl -0x48(%rbp), %eax
movb %al, -0x1(%rbp)
jmp 0x492822
jmp 0x49280d
movl -0x48(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0x4927ce
movb $0x0, -0x1(%rbp)
jmp 0x492822
movb $-0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
addq $0xe0, %rsp
popq %rbp
retq
nop