// File: /workspace/github_c_makefile_star2_O0/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
subq $0xf0, %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, -0x58(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq (%rax), %rax
movq %rax, -0x80(%rbp)
movq $0x0, -0x88(%rbp)
movzwl -0x24(%rbp), %eax
cmpl $0x0, %eax
je 0x8d480
movq -0x80(%rbp), %rax
movzwl 0x4c(%rax), %eax
andl $0x80, %eax
cmpl $0x0, %eax
je 0x8d480
movb $0x0, -0x1(%rbp)
jmp 0x8dd00
movq -0x18(%rbp), %rax
movl (%rax), %eax
movw %ax, -0x3c(%rbp)
movzwl -0x3c(%rbp), %eax
cmpl $0x3f, %eax
jle 0x8d49c
movb $0x0, -0x1(%rbp)
jmp 0x8dd00
movb $0x1, -0x34(%rbp)
movzwl -0x3c(%rbp), %eax
movl %eax, %eax
movl %eax, %ecx
movl $0x1, %eax
shlq %cl, %rax
subq $0x1, %rax
movq %rax, -0x90(%rbp)
movq $0x0, -0x98(%rbp)
movq $0x0, -0xa0(%rbp)
movl $0x0, -0x40(%rbp)
movzbl -0x34(%rbp), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0xd1(%rbp)
je 0x8d513
movq -0x88(%rbp), %rcx
xorl %eax, %eax
cmpq -0x90(%rbp), %rcx
movb %al, -0xd1(%rbp)
jae 0x8d513
movl -0x40(%rbp), %eax
movzwl -0x24(%rbp), %ecx
cmpl %ecx, %eax
setle %al
movb %al, -0xd1(%rbp)
movb -0xd1(%rbp), %al
testb $0x1, %al
jne 0x8d522
jmp 0x8dc83
cmpl $0x0, -0x40(%rbp)
jle 0x8d53e
movq -0x58(%rbp), %rax
movq 0x8(%rax), %rax
orq -0xa0(%rbp), %rax
movq %rax, -0xa0(%rbp)
movl -0x40(%rbp), %eax
movzwl -0x24(%rbp), %ecx
cmpl %ecx, %eax
jge 0x8d562
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0xe0(%rbp)
jmp 0x8d56d
movq -0x30(%rbp), %rax
movq %rax, -0xe0(%rbp)
movq -0xe0(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
movl 0x28(%rax), %eax
andl $0x400, %eax            # imm = 0x400
cmpl $0x0, %eax
je 0x8d5a6
movq -0x58(%rbp), %rax
cmpb $0x0, 0x1d(%rax)
je 0x8d5a1
movq -0x90(%rbp), %rax
movq %rax, -0x88(%rbp)
jmp 0x8dc83
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
addq $0x8, %rax
movq -0x58(%rbp), %rcx
movzbl 0x10(%rcx), %ecx
imulq $0x70, %rcx, %rcx
addq %rcx, %rax
movl 0x44(%rax), %eax
movl %eax, -0x4c(%rbp)
movl $0x0, -0x44(%rbp)
movl -0x44(%rbp), %eax
movzwl -0x3c(%rbp), %ecx
cmpl %ecx, %eax
jge 0x8d76b
movl -0x44(%rbp), %eax
movl %eax, %ecx
movl $0x1, %eax
shlq %cl, %rax
andq -0x88(%rbp), %rax
cmpq $0x0, %rax
je 0x8d5fc
jmp 0x8d75d
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x44(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq (%rax), %rdi
callq 0x70830
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x98, %eax
je 0x8d62e
jmp 0x8d75d
movq -0x68(%rbp), %rax
movl 0x2c(%rax), %eax
cmpl -0x4c(%rbp), %eax
je 0x8d63f
jmp 0x8d75d
movq -0x10(%rbp), %rdi
addq $0x158, %rdi            # imm = 0x158
movl -0x4c(%rbp), %esi
movq -0x68(%rbp), %rax
movswl 0x30(%rax), %edx
movq -0xa0(%rbp), %rcx
xorq $-0x1, %rcx
movl $0x182, %r8d            # imm = 0x182
xorl %eax, %eax
movl %eax, %r9d
callq 0x89410
movq %rax, -0x60(%rbp)
cmpq $0x0, -0x60(%rbp)
jne 0x8d680
jmp 0x8d75d
movq -0x60(%rbp), %rax
movzwl 0x1a(%rax), %eax
andl $0x82, %eax
cmpl $0x0, %eax
je 0x8d742
movq -0x68(%rbp), %rax
movswl 0x30(%rax), %eax
cmpl $0x0, %eax
jl 0x8d742
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x44(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq (%rax), %rsi
callq 0x6e810
movq %rax, -0x70(%rbp)
cmpq $0x0, -0x70(%rbp)
jne 0x8d6e0
movq -0x80(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rax
movq (%rax), %rax
movq %rax, -0xa8(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x60(%rbp), %rax
movq (%rax), %rsi
callq 0x6e810
movq %rax, -0x70(%rbp)
cmpq $0x0, -0x70(%rbp)
jne 0x8d718
movq -0x80(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rax
movq (%rax), %rax
movq %rax, -0xb0(%rbp)
movq -0xa8(%rbp), %rdi
movq -0xb0(%rbp), %rsi
callq 0xb5c0
cmpl $0x0, %eax
je 0x8d740
jmp 0x8d75d
jmp 0x8d742
movl -0x44(%rbp), %eax
movl %eax, %ecx
movl $0x1, %eax
shlq %cl, %rax
orq -0x88(%rbp), %rax
movq %rax, -0x88(%rbp)
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x8d5ce
movq -0x58(%rbp), %rax
movl 0x28(%rax), %eax
andl $0x1000, %eax           # imm = 0x1000
cmpl $0x0, %eax
jne 0x8db81
movq -0x58(%rbp), %rax
movl 0x28(%rax), %eax
andl $0x100, %eax            # imm = 0x100
cmpl $0x0, %eax
je 0x8d7a7
movq $0x0, -0x78(%rbp)
movw $0x0, -0x38(%rbp)
movw $0x1, -0x3a(%rbp)
jmp 0x8d806
movq -0x58(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x78(%rbp)
cmpq $0x0, %rax
je 0x8d7cd
movq -0x78(%rbp), %rax
movb 0x63(%rax), %al
shrb $0x2, %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
je 0x8d7d6
movb $0x0, -0x1(%rbp)
jmp 0x8dd00
movq -0x78(%rbp), %rax
movw 0x5e(%rax), %ax
movw %ax, -0x38(%rbp)
movq -0x78(%rbp), %rax
movw 0x60(%rax), %ax
movw %ax, -0x3a(%rbp)
movq -0x78(%rbp), %rax
movzbl 0x62(%rax), %eax
cmpl $0x0, %eax
setne %al
andb $0x1, %al
movzbl %al, %eax
movb %al, -0x34(%rbp)
jmp 0x8d806
movb $0x0, -0x31(%rbp)
movb $0x0, -0x32(%rbp)
movb $0x0, -0x35(%rbp)
movl $0x0, -0x48(%rbp)
movl -0x48(%rbp), %eax
movzwl -0x3a(%rbp), %ecx
cmpl %ecx, %eax
jge 0x8db75
movl -0x48(%rbp), %eax
movq -0x58(%rbp), %rcx
movzwl 0x18(%rcx), %ecx
cmpl %ecx, %eax
jge 0x8d87b
movq -0x58(%rbp), %rax
movzwl 0x2e(%rax), %eax
cmpl $0x0, %eax
jne 0x8d87b
movq -0x58(%rbp), %rax
movq 0x38(%rax), %rax
movslq -0x48(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movzwl 0x1a(%rax), %eax
movl %eax, -0x44(%rbp)
andl $0x182, %eax            # imm = 0x182
cmpl $0x0, %eax
je 0x8d87b
movl -0x44(%rbp), %eax
andl $0x100, %eax            # imm = 0x100
cmpl $0x0, %eax
je 0x8d876
movb $0x0, -0x34(%rbp)
jmp 0x8db67
cmpq $0x0, -0x78(%rbp)
je 0x8d8c3
movq -0x78(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x48(%rbp), %rcx
movswl (%rax,%rcx,2), %eax
movl %eax, -0x50(%rbp)
movq -0x78(%rbp), %rax
movq 0x38(%rax), %rax
movslq -0x48(%rbp), %rcx
movb (%rax,%rcx), %al
movb %al, -0x33(%rbp)
movl -0x50(%rbp), %eax
movq -0x78(%rbp), %rcx
movq 0x18(%rcx), %rcx
movswl 0x3c(%rcx), %ecx
cmpl %ecx, %eax
jne 0x8d8c1
movl $0xffffffff, -0x50(%rbp) # imm = 0xFFFFFFFF
jmp 0x8d8ce
movl $0xffffffff, -0x50(%rbp) # imm = 0xFFFFFFFF
movb $0x0, -0x33(%rbp)
movzbl -0x34(%rbp), %eax
cmpl $0x0, %eax
je 0x8d910
cmpl $0x0, -0x50(%rbp)
jl 0x8d910
movl -0x48(%rbp), %eax
movq -0x58(%rbp), %rcx
movzwl 0x18(%rcx), %ecx
cmpl %ecx, %eax
jl 0x8d910
movq -0x78(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x8(%rax), %rax
movslq -0x50(%rbp), %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movzbl 0x28(%rax), %eax
cmpl $0x0, %eax
jne 0x8d910
movb $0x0, -0x34(%rbp)
movb $0x1, -0xb1(%rbp)
movb $0x0, -0x36(%rbp)
movl $0x0, -0x44(%rbp)
movzbl -0xb1(%rbp), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0xe1(%rbp)
je 0x8d948
movl -0x44(%rbp), %eax
movzwl -0x3c(%rbp), %ecx
cmpl %ecx, %eax
setl %al
movb %al, -0xe1(%rbp)
movb -0xe1(%rbp), %al
testb $0x1, %al
jne 0x8d957
jmp 0x8da8f
movl -0x44(%rbp), %eax
movl %eax, %ecx
movl $0x1, %eax
shlq %cl, %rax
andq -0x88(%rbp), %rax
cmpq $0x0, %rax
je 0x8d976
jmp 0x8da81
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x44(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq (%rax), %rdi
callq 0x70830
movq %rax, -0x68(%rbp)
movzwl -0x22(%rbp), %eax
andl $0x300, %eax            # imm = 0x300
cmpl $0x0, %eax
jne 0x8d9aa
movb $0x0, -0xb1(%rbp)
cmpl $-0x1, -0x50(%rbp)
jl 0x8d9e8
movq -0x68(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x98, %eax
je 0x8d9c3
jmp 0x8da81
movq -0x68(%rbp), %rax
movl 0x2c(%rax), %eax
cmpl -0x4c(%rbp), %eax
je 0x8d9d4
jmp 0x8da81
movq -0x68(%rbp), %rax
movswl 0x30(%rax), %eax
cmpl -0x50(%rbp), %eax
je 0x8d9e6
jmp 0x8da81
jmp 0x8da17
movq -0x68(%rbp), %rdi
movq -0x78(%rbp), %rax
movq 0x50(%rax), %rax
movq 0x8(%rax), %rax
movslq -0x48(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq (%rax), %rsi
movl -0x4c(%rbp), %edx
callq 0x708d0
cmpl $0x0, %eax
je 0x8da15
jmp 0x8da81
jmp 0x8da17
cmpl $0x0, -0x50(%rbp)
jl 0x8da7b
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x44(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq (%rax), %rsi
callq 0x6e810
movq %rax, -0x70(%rbp)
cmpq $0x0, -0x70(%rbp)
jne 0x8da56
movq -0x80(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rax
movq (%rax), %rdi
movq -0x78(%rbp), %rax
movq 0x40(%rax), %rax
movslq -0x48(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
callq 0xb5c0
cmpl $0x0, %eax
je 0x8da79
jmp 0x8da81
jmp 0x8da7b
movb $0x1, -0x36(%rbp)
jmp 0x8da8f
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x8d922
movzbl -0x36(%rbp), %eax
cmpl $0x0, %eax
je 0x8db21
movzwl -0x22(%rbp), %eax
andl $0x100, %eax            # imm = 0x100
cmpl $0x0, %eax
jne 0x8db21
cmpb $0x0, -0x31(%rbp)
je 0x8dadb
movzbl -0x32(%rbp), %eax
movzbl -0x33(%rbp), %ecx
xorl %ecx, %eax
movq -0x18(%rbp), %rcx
movq 0x8(%rcx), %rcx
movslq -0x44(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rcx
movzbl 0x18(%rcx), %ecx
cmpl %ecx, %eax
je 0x8dad9
movb $0x0, -0x36(%rbp)
jmp 0x8db1f
movzbl -0x33(%rbp), %eax
movq -0x18(%rbp), %rcx
movq 0x8(%rcx), %rcx
movslq -0x44(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rcx
movzbl 0x18(%rcx), %ecx
xorl %ecx, %eax
movb %al, -0x32(%rbp)
cmpb $0x0, -0x32(%rbp)
je 0x8db1b
movl -0x40(%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 0x8db21
cmpb $0x0, -0x36(%rbp)
je 0x8db4e
cmpl $0x0, -0x50(%rbp)
jge 0x8db31
movb $0x1, -0x35(%rbp)
movl -0x44(%rbp), %eax
movl %eax, %ecx
movl $0x1, %eax
shlq %cl, %rax
orq -0x88(%rbp), %rax
movq %rax, -0x88(%rbp)
jmp 0x8db65
cmpl $0x0, -0x48(%rbp)
je 0x8db5f
movl -0x48(%rbp), %eax
movzwl -0x38(%rbp), %ecx
cmpl %ecx, %eax
jge 0x8db63
movb $0x0, -0x34(%rbp)
jmp 0x8db75
jmp 0x8db67
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0x8d819
cmpb $0x0, -0x35(%rbp)
je 0x8db7f
movb $0x1, -0x34(%rbp)
jmp 0x8db81
cmpb $0x0, -0x34(%rbp)
je 0x8dc73
movq -0x58(%rbp), %rax
movq 0x8(%rax), %rax
orq -0x98(%rbp), %rax
movq %rax, -0x98(%rbp)
movl $0x0, -0x44(%rbp)
movl -0x44(%rbp), %eax
movzwl -0x3c(%rbp), %ecx
cmpl %ecx, %eax
jge 0x8dc71
movl -0x44(%rbp), %eax
movl %eax, %ecx
movl $0x1, %eax
shlq %cl, %rax
andq -0x88(%rbp), %rax
cmpq $0x0, %rax
je 0x8dbd6
jmp 0x8dc63
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x44(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq %rax, -0xc0(%rbp)
movq -0x10(%rbp), %rdi
addq $0x54, %rdi
movq -0xc0(%rbp), %rsi
callq 0x87b60
movq %rax, -0xc8(%rbp)
cmpq $0x0, -0xc8(%rbp)
jne 0x8dc2b
movq -0xc0(%rbp), %rdi
callq 0x6e7e0
cmpl $0x0, %eax
jne 0x8dc2b
jmp 0x8dc63
movq -0xc8(%rbp), %rax
movq -0x98(%rbp), %rcx
xorq $-0x1, %rcx
andq %rcx, %rax
cmpq $0x0, %rax
jne 0x8dc61
movl -0x44(%rbp), %eax
movl %eax, %ecx
movl $0x1, %eax
shlq %cl, %rax
orq -0x88(%rbp), %rax
movq %rax, -0x88(%rbp)
jmp 0x8dc63
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x8dba8
jmp 0x8dc73
jmp 0x8dc75
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x8d4d8
movq -0x88(%rbp), %rax
cmpq -0x90(%rbp), %rax
jne 0x8dc9c
movw -0x3c(%rbp), %ax
movb %al, -0x1(%rbp)
jmp 0x8dd00
cmpb $0x0, -0x34(%rbp)
jne 0x8dcfc
movzwl -0x3c(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x44(%rbp)
cmpl $0x0, -0x44(%rbp)
jle 0x8dcf6
movl -0x44(%rbp), %eax
movl %eax, %ecx
movl $0x1, %eax
shlq %cl, %rax
subq $0x1, %rax
movq %rax, -0xd0(%rbp)
movq -0x88(%rbp), %rax
andq -0xd0(%rbp), %rax
cmpq -0xd0(%rbp), %rax
jne 0x8dce9
movl -0x44(%rbp), %eax
movb %al, -0x1(%rbp)
jmp 0x8dd00
jmp 0x8dceb
movl -0x44(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x8dcac
movb $0x0, -0x1(%rbp)
jmp 0x8dd00
movb $-0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
addq $0xf0, %rsp
popq %rbp
retq
nopl (%rax)