// File: /workspace/github_c_makefile_star2_O1/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: wherePathSolver
static int wherePathSolver(WhereInfo *pWInfo, LogEst nRowEst){
  int mxChoice;             /* Maximum number of simultaneous paths tracked */
  int nLoop;                /* Number of terms in the join */
  Parse *pParse;            /* Parsing context */
  sqlite3 *db;              /* The database connection */
  int iLoop;                /* Loop counter over the terms of the join */
  int ii, jj;               /* Loop counters */
  int mxI = 0;              /* Index of next entry to replace */
  int nOrderBy;             /* Number of ORDER BY clause terms */
  LogEst mxCost = 0;        /* Maximum cost of a set of paths */
  LogEst mxUnsorted = 0;    /* Maximum unsorted cost of a set of path */
  int nTo, nFrom;           /* Number of valid entries in aTo[] and aFrom[] */
  WherePath *aFrom;         /* All nFrom paths at the previous level */
  WherePath *aTo;           /* The nTo best paths at the current level */
  WherePath *pFrom;         /* An element of aFrom[] that we are working on */
  WherePath *pTo;           /* An element of aTo[] that we are working on */
  WhereLoop *pWLoop;        /* One of the WhereLoop objects */
  WhereLoop **pX;           /* Used to divy up the pSpace memory */
  LogEst *aSortCost = 0;    /* Sorting and partial sorting costs */
  char *pSpace;             /* Temporary memory used by this routine */
  int nSpace;               /* Bytes of space allocated at pSpace */

  pParse = pWInfo->pParse;
  db = pParse->db;
  nLoop = pWInfo->nLevel;
  /* TUNING: For simple queries, only the best path is tracked.
  ** For 2-way joins, the 5 best paths are followed.
  ** For joins of 3 or more tables, track the 10 best paths */
  mxChoice = (nLoop<=1) ? 1 : (nLoop==2 ? 5 : 10);
  assert( nLoop<=pWInfo->pTabList->nSrc );
  WHERETRACE(0x002, ("---- begin solver.  (nRowEst=%d)\n", nRowEst));

  /* If nRowEst is zero and there is an ORDER BY clause, ignore it. In this
  ** case the purpose of this call is to estimate the number of rows returned
  ** by the overall query. Once this estimate has been obtained, the caller
  ** will invoke this function a second time, passing the estimate as the
  ** nRowEst parameter.  */
  if( pWInfo->pOrderBy==0 || nRowEst==0 ){
    nOrderBy = 0;
  }else{
    nOrderBy = pWInfo->pOrderBy->nExpr;
  }

  /* Allocate and initialize space for aTo, aFrom and aSortCost[] */
  nSpace = (sizeof(WherePath)+sizeof(WhereLoop*)*nLoop)*mxChoice*2;
  nSpace += sizeof(LogEst) * nOrderBy;
  pSpace = sqlite3DbMallocRaw(db, nSpace);
  if( pSpace==0 ) return SQLITE_NOMEM;
  aTo = (WherePath*)pSpace;
  aFrom = aTo+mxChoice;
  memset(aFrom, 0, sizeof(aFrom[0]));
  pX = (WhereLoop**)(aFrom+mxChoice);
  for(ii=mxChoice*2, pFrom=aTo; ii>0; ii--, pFrom++, pX += nLoop){
    pFrom->aLoop = pX;
  }
  if( nOrderBy ){
    /* If there is an ORDER BY clause and it is not being ignored, set up
    ** space for the aSortCost[] array. Each element of the aSortCost array
    ** is either zero - meaning it has not yet been initialized - or the
    ** cost of sorting nRowEst rows of data where the first X terms of
    ** the ORDER BY clause are already in order, where X is the array 
    ** index.  */
    aSortCost = (LogEst*)pX;
    memset(aSortCost, 0, sizeof(LogEst) * nOrderBy);
  }
  assert( aSortCost==0 || &pSpace[nSpace]==(char*)&aSortCost[nOrderBy] );
  assert( aSortCost!=0 || &pSpace[nSpace]==(char*)pX );

  /* Seed the search with a single WherePath containing zero WhereLoops.
  **
  ** TUNING: Do not let the number of iterations go above 28.  If the cost
  ** of computing an automatic index is not paid back within the first 28
  ** rows, then do not use the automatic index. */
  aFrom[0].nRow = MIN(pParse->nQueryLoop, 48);  assert( 48==sqlite3LogEst(28) );
  nFrom = 1;
  assert( aFrom[0].isOrdered==0 );
  if( nOrderBy ){
    /* If nLoop is zero, then there are no FROM terms in the query. Since
    ** in this case the query may return a maximum of one row, the results
    ** are already in the requested order. Set isOrdered to nOrderBy to
    ** indicate this. Or, if nLoop is greater than zero, set isOrdered to
    ** -1, indicating that the result set may or may not be ordered, 
    ** depending on the loops added to the current plan.  */
    aFrom[0].isOrdered = nLoop>0 ? -1 : nOrderBy;
  }

  /* Compute successively longer WherePaths using the previous generation
  ** of WherePaths as the basis for the next.  Keep track of the mxChoice
  ** best paths at each generation */
  for(iLoop=0; iLoop<nLoop; iLoop++){
    nTo = 0;
    for(ii=0, pFrom=aFrom; ii<nFrom; ii++, pFrom++){
      for(pWLoop=pWInfo->pLoops; pWLoop; pWLoop=pWLoop->pNextLoop){
        LogEst nOut;                      /* Rows visited by (pFrom+pWLoop) */
        LogEst rCost;                     /* Cost of path (pFrom+pWLoop) */
        LogEst rUnsorted;                 /* Unsorted cost of (pFrom+pWLoop) */
        i8 isOrdered = pFrom->isOrdered;  /* isOrdered for (pFrom+pWLoop) */
        Bitmask maskNew;                  /* Mask of src visited by (..) */
        Bitmask revMask = 0;              /* Mask of rev-order loops for (..) */

        if( (pWLoop->prereq & ~pFrom->maskLoop)!=0 ) continue;
        if( (pWLoop->maskSelf & pFrom->maskLoop)!=0 ) continue;
        /* At this point, pWLoop is a candidate to be the next loop. 
        ** Compute its cost */
        rUnsorted = sqlite3LogEstAdd(pWLoop->rSetup,pWLoop->rRun + pFrom->nRow);
        rUnsorted = sqlite3LogEstAdd(rUnsorted, pFrom->rUnsorted);
        nOut = pFrom->nRow + pWLoop->nOut;
        maskNew = pFrom->maskLoop | pWLoop->maskSelf;
        if( isOrdered<0 ){
          isOrdered = wherePathSatisfiesOrderBy(pWInfo,
                       pWInfo->pOrderBy, pFrom, pWInfo->wctrlFlags,
                       iLoop, pWLoop, &revMask);
        }else{
          revMask = pFrom->revLoop;
        }
        if( isOrdered>=0 && isOrdered<nOrderBy ){
          if( aSortCost[isOrdered]==0 ){
            aSortCost[isOrdered] = whereSortingCost(
                pWInfo, nRowEst, nOrderBy, isOrdered
            );
          }
          rCost = sqlite3LogEstAdd(rUnsorted, aSortCost[isOrdered]);

          WHERETRACE(0x002,
              ("---- sort cost=%-3d (%d/%d) increases cost %3d to %-3d\n",
               aSortCost[isOrdered], (nOrderBy-isOrdered), nOrderBy, 
               rUnsorted, rCost));
        }else{
          rCost = rUnsorted;
        }

        /* Check to see if pWLoop should be added to the set of
        ** mxChoice best-so-far paths.
        **
        ** First look for an existing path among best-so-far paths
        ** that covers the same set of loops and has the same isOrdered
        ** setting as the current path candidate.
        **
        ** The term "((pTo->isOrdered^isOrdered)&0x80)==0" is equivalent
        ** to (pTo->isOrdered==(-1))==(isOrdered==(-1))" for the range
        ** of legal values for isOrdered, -1..64.
        */
        for(jj=0, pTo=aTo; jj<nTo; jj++, pTo++){
          if( pTo->maskLoop==maskNew
           && ((pTo->isOrdered^isOrdered)&0x80)==0
          ){
            testcase( jj==nTo-1 );
            break;
          }
        }
        if( jj>=nTo ){
          /* None of the existing best-so-far paths match the candidate. */
          if( nTo>=mxChoice
           && (rCost>mxCost || (rCost==mxCost && rUnsorted>=mxUnsorted))
          ){
            /* The current candidate is no better than any of the mxChoice
            ** paths currently in the best-so-far buffer.  So discard
            ** this candidate as not viable. */
#ifdef WHERETRACE_ENABLED /* 0x4 */
            if( sqlite3WhereTrace&0x4 ){
              sqlite3DebugPrintf("Skip   %s cost=%-3d,%3d order=%c\n",
                  wherePathName(pFrom, iLoop, pWLoop), rCost, nOut,
                  isOrdered>=0 ? isOrdered+'0' : '?');
            }
#endif
            continue;
          }
          /* If we reach this points it means that the new candidate path
          ** needs to be added to the set of best-so-far paths. */
          if( nTo<mxChoice ){
            /* Increase the size of the aTo set by one */
            jj = nTo++;
          }else{
            /* New path replaces the prior worst to keep count below mxChoice */
            jj = mxI;
          }
          pTo = &aTo[jj];
#ifdef WHERETRACE_ENABLED /* 0x4 */
          if( sqlite3WhereTrace&0x4 ){
            sqlite3DebugPrintf("New    %s cost=%-3d,%3d order=%c\n",
                wherePathName(pFrom, iLoop, pWLoop), rCost, nOut,
                isOrdered>=0 ? isOrdered+'0' : '?');
          }
#endif
        }else{
          /* Control reaches here if best-so-far path pTo=aTo[jj] covers the
          ** same set of loops and has the sam isOrdered setting as the
          ** candidate path.  Check to see if the candidate should replace
          ** pTo or if the candidate should be skipped */
          if( pTo->rCost<rCost || (pTo->rCost==rCost && pTo->nRow<=nOut) ){
#ifdef WHERETRACE_ENABLED /* 0x4 */
            if( sqlite3WhereTrace&0x4 ){
              sqlite3DebugPrintf(
                  "Skip   %s cost=%-3d,%3d order=%c",
                  wherePathName(pFrom, iLoop, pWLoop), rCost, nOut,
                  isOrdered>=0 ? isOrdered+'0' : '?');
              sqlite3DebugPrintf("   vs %s cost=%-3d,%d order=%c\n",
                  wherePathName(pTo, iLoop+1, 0), pTo->rCost, pTo->nRow,
                  pTo->isOrdered>=0 ? pTo->isOrdered+'0' : '?');
            }
#endif
            /* Discard the candidate path from further consideration */
            testcase( pTo->rCost==rCost );
            continue;
          }
          testcase( pTo->rCost==rCost+1 );
          /* Control reaches here if the candidate path is better than the
          ** pTo path.  Replace pTo with the candidate. */
#ifdef WHERETRACE_ENABLED /* 0x4 */
          if( sqlite3WhereTrace&0x4 ){
            sqlite3DebugPrintf(
                "Update %s cost=%-3d,%3d order=%c",
                wherePathName(pFrom, iLoop, pWLoop), rCost, nOut,
                isOrdered>=0 ? isOrdered+'0' : '?');
            sqlite3DebugPrintf("  was %s cost=%-3d,%3d order=%c\n",
                wherePathName(pTo, iLoop+1, 0), pTo->rCost, pTo->nRow,
                pTo->isOrdered>=0 ? pTo->isOrdered+'0' : '?');
          }
#endif
        }
        /* pWLoop is a winner.  Add it to the set of best so far */
        pTo->maskLoop = pFrom->maskLoop | pWLoop->maskSelf;
        pTo->revLoop = revMask;
        pTo->nRow = nOut;
        pTo->rCost = rCost;
        pTo->rUnsorted = rUnsorted;
        pTo->isOrdered = isOrdered;
        memcpy(pTo->aLoop, pFrom->aLoop, sizeof(WhereLoop*)*iLoop);
        pTo->aLoop[iLoop] = pWLoop;
        if( nTo>=mxChoice ){
          mxI = 0;
          mxCost = aTo[0].rCost;
          mxUnsorted = aTo[0].nRow;
          for(jj=1, pTo=&aTo[1]; jj<mxChoice; jj++, pTo++){
            if( pTo->rCost>mxCost 
             || (pTo->rCost==mxCost && pTo->rUnsorted>mxUnsorted) 
            ){
              mxCost = pTo->rCost;
              mxUnsorted = pTo->rUnsorted;
              mxI = jj;
            }
          }
        }
      }
    }

#ifdef WHERETRACE_ENABLED  /* >=2 */
    if( sqlite3WhereTrace & 0x02 ){
      sqlite3DebugPrintf("---- after round %d ----\n", iLoop);
      for(ii=0, pTo=aTo; ii<nTo; ii++, pTo++){
        sqlite3DebugPrintf(" %s cost=%-3d nrow=%-3d order=%c",
           wherePathName(pTo, iLoop+1, 0), pTo->rCost, pTo->nRow,
           pTo->isOrdered>=0 ? (pTo->isOrdered+'0') : '?');
        if( pTo->isOrdered>0 ){
          sqlite3DebugPrintf(" rev=0x%llx\n", pTo->revLoop);
        }else{
          sqlite3DebugPrintf("\n");
        }
      }
    }
#endif

    /* Swap the roles of aFrom and aTo for the next generation */
    pFrom = aTo;
    aTo = aFrom;
    aFrom = pFrom;
    nFrom = nTo;
  }

  if( nFrom==0 ){
    sqlite3ErrorMsg(pParse, "no query solution");
    sqlite3DbFree(db, pSpace);
    return SQLITE_ERROR;
  }
  
  /* Find the lowest cost path.  pFrom will be left pointing to that path */
  pFrom = aFrom;
  for(ii=1; ii<nFrom; ii++){
    if( pFrom->rCost>aFrom[ii].rCost ) pFrom = &aFrom[ii];
  }
  assert( pWInfo->nLevel==nLoop );
  /* Load the lowest cost path into pWInfo */
  for(iLoop=0; iLoop<nLoop; iLoop++){
    WhereLevel *pLevel = pWInfo->a + iLoop;
    pLevel->pWLoop = pWLoop = pFrom->aLoop[iLoop];
    pLevel->iFrom = pWLoop->iTab;
    pLevel->iTabCur = pWInfo->pTabList->a[pLevel->iFrom].iCursor;
  }
  if( (pWInfo->wctrlFlags & WHERE_WANT_DISTINCT)!=0
   && (pWInfo->wctrlFlags & WHERE_DISTINCTBY)==0
   && pWInfo->eDistinct==WHERE_DISTINCT_NOOP
   && nRowEst
  ){
    Bitmask notUsed;
    int rc = wherePathSatisfiesOrderBy(pWInfo, pWInfo->pResultSet, pFrom,
                 WHERE_DISTINCTBY, nLoop-1, pFrom->aLoop[nLoop-1], &notUsed);
    if( rc==pWInfo->pResultSet->nExpr ){
      pWInfo->eDistinct = WHERE_DISTINCT_ORDERED;
    }
  }
  if( pWInfo->pOrderBy ){
    if( pWInfo->wctrlFlags & WHERE_DISTINCTBY ){
      if( pFrom->isOrdered==pWInfo->pOrderBy->nExpr ){
        pWInfo->eDistinct = WHERE_DISTINCT_ORDERED;
      }
    }else{
      pWInfo->nOBSat = pFrom->isOrdered;
      if( pWInfo->nOBSat<0 ) pWInfo->nOBSat = 0;
      pWInfo->revMask = pFrom->revLoop;
    }
    if( (pWInfo->wctrlFlags & WHERE_SORTBYGROUP)
        && pWInfo->nOBSat==pWInfo->pOrderBy->nExpr && nLoop>0
    ){
      Bitmask revMask = 0;
      int nOrder = wherePathSatisfiesOrderBy(pWInfo, pWInfo->pOrderBy, 
          pFrom, 0, nLoop-1, pFrom->aLoop[nLoop-1], &revMask
      );
      assert( pWInfo->sorted==0 );
      if( nOrder==pWInfo->pOrderBy->nExpr ){
        pWInfo->sorted = 1;
        pWInfo->revMask = revMask;
      }
    }
  }


  pWInfo->nRowOut = pFrom->nRow;

  /* Free temporary memory and return success */
  sqlite3DbFree(db, pSpace);
  return SQLITE_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movq %rdi, %r15
movq (%rdi), %rcx
movq 0x10(%rdi), %rax
movq %rcx, -0xc0(%rbp)
movq (%rcx), %rdi
movzbl 0x39(%r15), %r12d
xorl %ecx, %ecx
cmpl $0x2, %r12d
setne %cl
leal 0x5(%rcx,%rcx,4), %ecx
movl $0x1, %ebx
cmovael %ecx, %ebx
testq %rax, %rax
sete %cl
movq %rsi, -0x70(%rbp)
testw %si, %si
sete %dl
xorl %esi, %esi
orb %cl, %dl
jne 0x62424
movl (%rax), %esi
leal 0x20(,%r12,8), %eax
imull %ebx, %eax
movl %esi, -0x34(%rbp)
movslq %esi, %r14
addq %r14, %r14
leal (%r14,%rax,2), %eax
movslq %eax, %rsi
movq %rdi, -0xb8(%rbp)
callq 0x144ee
testq %rax, %rax
je 0x624b6
movq %rax, %r13
movl %ebx, %edi
shll $0x5, %edi
addq %rdi, %rax
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%r13,%rdi)
movups %xmm0, (%r13,%rdi)
movq %rax, -0x40(%rbp)
addq %rax, %rdi
leal 0x1(,%rbx,2), %eax
leal (,%r12,8), %ecx
movq %r13, %rdx
addq $0x18, %rdx
movq %rdi, (%rdx)
decl %eax
addq %rcx, %rdi
addq $0x20, %rdx
cmpl $0x1, %eax
jg 0x62487
cmpl $0x0, -0x34(%rbp)
movq %rbx, -0x68(%rbp)
je 0x624c8
movq %rdi, -0x80(%rbp)
xorl %esi, %esi
movq %r14, %rdx
callq 0xa210
movq -0x68(%rbp), %rbx
jmp 0x624d0
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq $0x0, -0x80(%rbp)
movq -0xc0(%rbp), %rax
movl 0x1d4(%rax), %eax
cmpl $0x30, %eax
movl $0x30, %ecx
cmovbl %eax, %ecx
movq -0x40(%rbp), %rdi
movw %cx, 0x10(%rdi)
movl -0x34(%rbp), %edx
testl %edx, %edx
je 0x62506
xorl %eax, %eax
movq %r12, %rcx
negq %rcx
sbbl %eax, %eax
orb %dl, %al
movb %al, 0x16(%rdi)
testq %r12, %r12
movq %r13, -0xb0(%rbp)
je 0x62934
movq -0x70(%rbp), %rax
movzwl %ax, %ecx
movq %rcx, -0xd8(%rbp)
addl $-0x42, %eax
movl %eax, -0x9c(%rbp)
cmpl $0x3, %ebx
movl $0x2, %eax
cmovael %ebx, %eax
movl %eax, -0x94(%rbp)
movq $0x0, -0x60(%rbp)
movl $0x0, -0x30(%rbp)
movq $0x0, -0x88(%rbp)
movq %r13, %rax
movl $0x1, %r8d
movq -0x40(%rbp), %rdi
movq $0x0, -0x78(%rbp)
movq %r15, -0x90(%rbp)
movq %r12, -0xc8(%rbp)
testl %r8d, %r8d
movq %rax, -0x40(%rbp)
movq %rdi, -0xd0(%rbp)
jg 0x62593
xorl %r10d, %r10d
jmp 0x62906
movq -0x60(%rbp), %rcx
leaq (,%rcx,8), %rdx
movq %rdx, -0xe8(%rbp)
addq $0x34, %rax
movq %rax, -0xe0(%rbp)
xorl %eax, %eax
movzwl %cx, %ecx
movl %ecx, -0xa4(%rbp)
movq %rdi, %r12
xorl %r10d, %r10d
movl %r8d, -0xa0(%rbp)
movl %eax, -0xa8(%rbp)
movq 0x20(%r15), %r13
testq %r13, %r13
je 0x628e3
movb 0x16(%r12), %cl
movq $0x0, -0x50(%rbp)
movq (%r12), %r14
movq %r14, %rax
notq %rax
testq %rax, (%r13)
jne 0x62602
movq 0x8(%r13), %rbx
testq %r14, %rbx
je 0x62608
movq 0x40(%r13), %r13
jmp 0x625d3
movl %r10d, -0x54(%rbp)
movswl 0x12(%r13), %edi
movq %r12, %r15
movzwl 0x10(%r12), %r12d
movzwl 0x14(%r13), %eax
addw %r12w, %ax
movswl %ax, %esi
movb %cl, -0x29(%rbp)
callq 0x68bba
movswl 0x14(%r15), %esi
movswl %ax, %edi
callq 0x68bba
movb -0x29(%rbp), %r8b
movl %eax, %r9d
addw 0x16(%r13), %r12w
movw %r12w, -0x2c(%rbp)
testb %r8b, %r8b
js 0x6265b
movq 0x8(%r15), %rax
movq %rax, -0x50(%rbp)
jmp 0x6268d
movq -0x90(%rbp), %rdi
movq 0x10(%rdi), %rsi
movzwl 0x32(%rdi), %ecx
leaq -0x50(%rbp), %rax
movq %rax, (%rsp)
movq %r15, %rdx
movl -0xa4(%rbp), %r8d
movl %r9d, %r12d
movq %r13, %r9
callq 0x69588
movl %r12d, %r9d
movl %eax, %r8d
movq %r15, %r12
movsbl %r8b, %eax
testb %al, %al
sets %dl
movl -0x34(%rbp), %ecx
subl %eax, %ecx
setle %al
orb %dl, %al
movl %r9d, %eax
movl -0x54(%rbp), %r10d
jne 0x62748
movb %r8b, -0x29(%rbp)
movzbl %r8b, %r15d
movq -0x80(%rbp), %rdx
cmpw $0x0, (%rdx,%r15,2)
jne 0x6272c
movw %r9w, -0x42(%rbp)
imull $0x64, %ecx, %eax
cltd
idivl -0x34(%rbp)
movslq %eax, %rdi
callq 0x3d559
movl %eax, %edx
cmpw $0xb, -0x70(%rbp)
jge 0x626e5
xorl %eax, %eax
jmp 0x62700
movq -0xd8(%rbp), %rdi
movl %edx, -0x98(%rbp)
callq 0x3d559
movl -0x98(%rbp), %edx
addl $-0x21, %eax
movq -0x90(%rbp), %rcx
movzwl 0x32(%rcx), %ecx
shrl $0x6, %ecx
andl $0x10, %ecx
addl -0x9c(%rbp), %eax
addl %edx, %eax
addl %ecx, %eax
addl $0x10, %eax
movq -0x80(%rbp), %rdx
movw %ax, (%rdx,%r15,2)
movzwl -0x42(%rbp), %r9d
movswl (%rdx,%r15,2), %esi
movswl %r9w, %edi
movl %r9d, %r15d
callq 0x68bba
movl %r15d, %r9d
movl -0x54(%rbp), %r10d
movb -0x29(%rbp), %r8b
testl %r10d, %r10d
setg %cl
jle 0x627b2
orq %r14, %rbx
movl %r10d, %edx
negl %edx
movl $0x1, %esi
movq -0x40(%rbp), %r14
cmpq %rbx, (%r14)
jne 0x6276f
movb 0x16(%r14), %dil
xorb %r8b, %dil
jns 0x62787
addq $0x20, %r14
cmpl %r10d, %esi
setl %cl
leal (%rdx,%rsi), %edi
incl %edi
incl %esi
cmpl $0x1, %edi
jne 0x62761
jmp 0x627b2
testb $0x1, %cl
je 0x627b2
cmpw %ax, 0x12(%r14)
jl 0x62602
jne 0x628da
movzwl -0x2c(%rbp), %ecx
cmpw %cx, 0x10(%r14)
movq -0x68(%rbp), %rbx
jle 0x62602
jmp 0x627db
movl %r10d, %ecx
movq -0x68(%rbp), %rsi
cmpl %esi, %r10d
jge 0x6289a
xorl %edx, %edx
cmpl %esi, %r10d
setl %dl
addl %edx, %r10d
movslq %ecx, %r14
shlq $0x5, %r14
addq -0x40(%rbp), %r14
movq %rsi, %rbx
movq 0x8(%r13), %rcx
orq (%r12), %rcx
movq %rcx, (%r14)
movq -0x50(%rbp), %rcx
movq %rcx, 0x8(%r14)
movzwl -0x2c(%rbp), %ecx
movw %cx, 0x10(%r14)
movw %ax, 0x12(%r14)
movw %r9w, 0x14(%r14)
movb %r8b, 0x16(%r14)
movq 0x18(%r14), %rdi
movq 0x18(%r12), %rsi
movq -0xe8(%rbp), %rdx
movl %r10d, %r15d
callq 0xa310
movl %r15d, %r10d
movq 0x18(%r14), %rax
movq -0x60(%rbp), %rcx
movq %r13, (%rax,%rcx,8)
cmpl %ebx, %r15d
jl 0x62602
movq -0x40(%rbp), %rax
movzwl 0x10(%rax), %r9d
movzwl 0x12(%rax), %r8d
cmpb $0x2, -0xc8(%rbp)
jb 0x628c3
xorl %edi, %edi
movl $0x1, %eax
movq -0xe0(%rbp), %rcx
movl -0x94(%rbp), %esi
movzwl -0x2(%rcx), %edx
cmpw %r8w, %dx
jle 0x62875
movzwl (%rcx), %r9d
movl %edx, %r8d
movl %eax, %edi
jmp 0x6287d
jne 0x6287d
cmpw %r9w, (%rcx)
jg 0x6286a
incl %eax
addq $0x20, %rcx
cmpl %eax, %esi
jne 0x62860
movq %r9, -0x78(%rbp)
movq %r8, -0x88(%rbp)
movl %edi, -0x30(%rbp)
jmp 0x62602
cmpw -0x88(%rbp), %ax
jg 0x62602
movl -0x30(%rbp), %ecx
jne 0x627c2
movl -0x30(%rbp), %ecx
cmpw -0x78(%rbp), %r9w
jge 0x62602
jmp 0x627c2
movq %r9, -0x78(%rbp)
movq %r8, -0x88(%rbp)
movl $0x0, -0x30(%rbp)
jmp 0x62602
movq -0x68(%rbp), %rbx
jmp 0x627db
movl -0xa8(%rbp), %eax
incl %eax
addq $0x20, %r12
movl -0xa0(%rbp), %r8d
cmpl %r8d, %eax
movq -0x90(%rbp), %r15
jne 0x625c9
movq -0x60(%rbp), %rsi
incq %rsi
movq -0xd0(%rbp), %rax
movq -0x40(%rbp), %rcx
movq %rcx, %rdi
movl %r10d, %r8d
movq -0xc8(%rbp), %r12
movq %rsi, -0x60(%rbp)
cmpq %r12, %rsi
jne 0x6257b
jmp 0x6293e
movl $0x1, %r10d
movq -0x40(%rbp), %rcx
testl %r10d, %r10d
je 0x62982
cmpl $0x2, %r10d
movq -0xb8(%rbp), %r14
movq -0xb0(%rbp), %r13
jl 0x629aa
movl %r10d, %eax
movq %rcx, %rsi
addq $0x20, %rcx
decq %rax
movzwl 0x12(%rsi), %edx
movq %rcx, %rbx
cmpw 0x12(%rcx), %dx
jg 0x62974
movq %rsi, %rbx
addq $0x20, %rcx
movq %rbx, %rsi
decq %rax
jne 0x62964
jmp 0x629ad
leaq 0x1d0df(%rip), %rsi     # 0x7fa68
movq -0xc0(%rbp), %rdi
xorl %eax, %eax
callq 0x14804
movq -0xb8(%rbp), %r14
movq -0xb0(%rbp), %r13
jmp 0x62a95
movq %rcx, %rbx
testq %r12, %r12
je 0x629f3
movq 0x18(%rbx), %rax
movq 0x8(%r15), %rcx
addq $0x8, %rcx
movl %r12d, %edx
leaq 0x388(%r15), %rsi
xorl %edi, %edi
movq (%rax,%rdi,8), %r8
movq %r8, (%rsi)
movzbl 0x10(%r8), %r8d
movb %r8b, -0x1c(%rsi)
imulq $0x70, %r8, %r8
movl 0x44(%rcx,%r8), %r8d
movl %r8d, -0x44(%rsi)
incq %rdi
addq $0x58, %rsi
cmpq %rdi, %rdx
jne 0x629ca
movzwl 0x32(%r15), %eax
andl $0x600, %eax            # imm = 0x600
cmpl $0x400, %eax            # imm = 0x400
jne 0x62a50
cmpw $0x0, -0x70(%rbp)
je 0x62a50
cmpb $0x0, 0x38(%r15)
jne 0x62a50
movq 0x18(%r15), %rsi
leaq -0x1(%r12), %rax
movq 0x18(%rbx), %rcx
movq -0x8(%rcx,%r12,8), %r9
leaq -0x50(%rbp), %rcx
movq %rcx, (%rsp)
movzwl %ax, %r8d
movq %r15, %rdi
movq %rbx, %rdx
movl $0x200, %ecx            # imm = 0x200
callq 0x69588
movsbl %al, %eax
movq 0x18(%r15), %rcx
cmpl %eax, (%rcx)
jne 0x62a50
movb $0x2, 0x38(%r15)
movq 0x10(%r15), %rsi
testq %rsi, %rsi
je 0x62a8c
movzwl 0x32(%r15), %eax
btl $0x9, %eax
movsbl 0x16(%rbx), %ecx
jb 0x62a7d
xorl %edx, %edx
testb %cl, %cl
cmovgl %ecx, %edx
movb %dl, 0x34(%r15)
movq 0x8(%rbx), %rcx
movq %rcx, 0x28(%r15)
jmp 0x62a86
cmpl %ecx, (%rsi)
jne 0x62a86
movb $0x2, 0x38(%r15)
btl $0xb, %eax
jb 0x62ab1
movzwl 0x10(%rbx), %eax
movw %ax, 0x30(%r15)
movq %r14, %rdi
movq %r13, %rsi
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xb6df
testq %r12, %r12
je 0x62a8c
movsbl 0x34(%r15), %eax
cmpl %eax, (%rsi)
jne 0x62a8c
leaq -0x50(%rbp), %rax
movq $0x0, (%rax)
decl %r12d
movq 0x18(%rbx), %rcx
movq (%rcx,%r12,8), %r9
movq %rax, (%rsp)
movzwl %r12w, %r8d
movq %r15, %rdi
movq %rbx, %rdx
xorl %ecx, %ecx
callq 0x69588
movsbl %al, %eax
movq 0x10(%r15), %rcx
cmpl %eax, (%rcx)
jne 0x62a8c
movb $0x1, 0x35(%r15)
movq -0x50(%rbp), %rax
movq %rax, 0x28(%r15)
jmp 0x62a8c