// File: /workspace/github_c_makefile_star2_O0/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: wherePathSolver
static int wherePathSolver(WhereInfo *pWInfo, WhereCost 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 */
  WhereCost rCost;             /* Cost of a path */
  WhereCost mxCost = 0;        /* Maximum cost of a set of paths */
  WhereCost rSortCost;         /* Cost to do a sort */
  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 */
  char *pSpace;             /* Temporary memory used by this routine */

  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\n"));

  /* Allocate and initialize space for aTo and aFrom */
  ii = (sizeof(WherePath)+sizeof(WhereLoop*)*nLoop)*mxChoice*2;
  pSpace = sqlite3DbMallocRaw(db, ii);
  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;
  }

  /* Seed the search with a single WherePath containing zero WhereLoops.
  **
  ** TUNING: Do not let the number of iterations go above 25.  If the cost
  ** of computing an automatic index is not paid back within the first 25
  ** rows, then do not use the automatic index. */
  aFrom[0].nRow = MIN(pParse->nQueryLoop, 46);  assert( 46==whereCost(25) );
  nFrom = 1;

  /* Precompute the cost of sorting the final result set, if the caller
  ** to sqlite3WhereBegin() was concerned about sorting */
  rSortCost = 0;
  if( pWInfo->pOrderBy==0 || nRowEst==0 ){
    aFrom[0].isOrderedValid = 1;
  }else{
    /* TUNING: Estimated cost of sorting is N*log2(N) where N is the
    ** number of output rows. */
    rSortCost = nRowEst + estLog(nRowEst);
    WHERETRACE(0x002,("---- sort cost=%-3d\n", rSortCost));
  }

  /* 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){
        Bitmask maskNew;
        Bitmask revMask = 0;
        u8 isOrderedValid = pFrom->isOrderedValid;
        u8 isOrdered = pFrom->isOrdered;
        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 */
        rCost = whereCostAdd(pWLoop->rSetup,pWLoop->rRun + pFrom->nRow);
        rCost = whereCostAdd(rCost, pFrom->rCost);
        maskNew = pFrom->maskLoop | pWLoop->maskSelf;
        if( !isOrderedValid ){
          switch( wherePathSatisfiesOrderBy(pWInfo,
                       pWInfo->pOrderBy, pFrom, pWInfo->wctrlFlags,
                       iLoop, pWLoop, &revMask) ){
            case 1:  /* Yes.  pFrom+pWLoop does satisfy the ORDER BY clause */
              isOrdered = 1;
              isOrderedValid = 1;
              break;
            case 0:  /* No.  pFrom+pWLoop will require a separate sort */
              isOrdered = 0;
              isOrderedValid = 1;
              rCost = whereCostAdd(rCost, rSortCost);
              break;
            default: /* Cannot tell yet.  Try again on the next iteration */
              break;
          }
        }else{
          revMask = pFrom->revLoop;
        }
        /* Check to see if pWLoop should be added to the mxChoice best so far */
        for(jj=0, pTo=aTo; jj<nTo; jj++, pTo++){
          if( pTo->maskLoop==maskNew && pTo->isOrderedValid==isOrderedValid ){
            testcase( jj==nTo-1 );
            break;
          }
        }
        if( jj>=nTo ){
          if( nTo>=mxChoice && rCost>=mxCost ){
#ifdef WHERETRACE_ENABLED
            if( sqlite3WhereTrace&0x4 ){
              sqlite3DebugPrintf("Skip   %s cost=%3d order=%c\n",
                  wherePathName(pFrom, iLoop, pWLoop), rCost,
                  isOrderedValid ? (isOrdered ? 'Y' : 'N') : '?');
            }
#endif
            continue;
          }
          /* Add a new Path to the aTo[] set */
          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 */
            for(jj=nTo-1; aTo[jj].rCost<mxCost; jj--){ assert(jj>0); }
          }
          pTo = &aTo[jj];
#ifdef WHERETRACE_ENABLED
          if( sqlite3WhereTrace&0x4 ){
            sqlite3DebugPrintf("New    %s cost=%-3d order=%c\n",
                wherePathName(pFrom, iLoop, pWLoop), rCost,
                isOrderedValid ? (isOrdered ? 'Y' : 'N') : '?');
          }
#endif
        }else{
          if( pTo->rCost<=rCost ){
#ifdef WHERETRACE_ENABLED
            if( sqlite3WhereTrace&0x4 ){
              sqlite3DebugPrintf(
                  "Skip   %s cost=%-3d order=%c",
                  wherePathName(pFrom, iLoop, pWLoop), rCost,
                  isOrderedValid ? (isOrdered ? 'Y' : 'N') : '?');
              sqlite3DebugPrintf("   vs %s cost=%-3d order=%c\n",
                  wherePathName(pTo, iLoop+1, 0), pTo->rCost,
                  pTo->isOrderedValid ? (pTo->isOrdered ? 'Y' : 'N') : '?');
            }
#endif
            testcase( pTo->rCost==rCost );
            continue;
          }
          testcase( pTo->rCost==rCost+1 );
          /* A new and better score for a previously created equivalent path */
#ifdef WHERETRACE_ENABLED
          if( sqlite3WhereTrace&0x4 ){
            sqlite3DebugPrintf(
                "Update %s cost=%-3d order=%c",
                wherePathName(pFrom, iLoop, pWLoop), rCost,
                isOrderedValid ? (isOrdered ? 'Y' : 'N') : '?');
            sqlite3DebugPrintf("  was %s cost=%-3d order=%c\n",
                wherePathName(pTo, iLoop+1, 0), pTo->rCost,
                pTo->isOrderedValid ? (pTo->isOrdered ? 'Y' : 'N') : '?');
          }
#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 = pFrom->nRow + pWLoop->nOut;
        pTo->rCost = rCost;
        pTo->isOrderedValid = isOrderedValid;
        pTo->isOrdered = isOrdered;
        memcpy(pTo->aLoop, pFrom->aLoop, sizeof(WhereLoop*)*iLoop);
        pTo->aLoop[iLoop] = pWLoop;
        if( nTo>=mxChoice ){
          mxCost = aTo[0].rCost;
          for(jj=1, pTo=&aTo[1]; jj<mxChoice; jj++, pTo++){
            if( pTo->rCost>mxCost ) mxCost = pTo->rCost;
          }
        }
      }
    }

#ifdef WHERETRACE_ENABLED
    if( sqlite3WhereTrace>=2 ){
      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->isOrderedValid ? (pTo->isOrdered ? 'Y' : 'N') : '?');
        if( pTo->isOrderedValid && pTo->isOrdered ){
          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;
  assert( nFrom==1 );
#if 0 /* The following is needed if nFrom is ever more than 1 */
  for(ii=1; ii<nFrom; ii++){
    if( pFrom->rCost>aFrom[ii].rCost ) pFrom = &aFrom[ii];
  }
#endif
  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==1 ) pWInfo->eDistinct = WHERE_DISTINCT_ORDERED;
  }
  if( pFrom->isOrdered ){
    if( pWInfo->wctrlFlags & WHERE_DISTINCTBY ){
      pWInfo->eDistinct = WHERE_DISTINCT_ORDERED;
    }else{
      pWInfo->bOBSat = 1;
      pWInfo->revMask = pFrom->revLoop;
    }
  }
  pWInfo->nRowOut = pFrom->nRow;

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movw %si, %ax
movq %rdi, -0x10(%rbp)
movw %ax, -0x12(%rbp)
movw $0x0, -0x40(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movzbl 0x38(%rax), %eax
movl %eax, -0x1c(%rbp)
cmpl $0x1, -0x1c(%rbp)
jne 0x72490
movl $0x1, %eax
movl %eax, -0xb8(%rbp)
jmp 0x724a9
movl -0x1c(%rbp), %edx
movl $0xa, %eax
movl $0x5, %ecx
cmpl $0x2, %edx
cmovel %ecx, %eax
movl %eax, -0xb8(%rbp)
movl -0xb8(%rbp), %eax
movl %eax, -0x18(%rbp)
movslq -0x1c(%rbp), %rax
shlq $0x3, %rax
addq $0x20, %rax
movslq -0x18(%rbp), %rcx
imulq %rcx, %rax
shlq %rax
movl %eax, -0x38(%rbp)
movq -0x30(%rbp), %rdi
movl -0x38(%rbp), %esi
callq 0x134e0
movq %rax, -0x88(%rbp)
cmpq $0x0, -0x88(%rbp)
jne 0x724f5
movl $0x7, -0x4(%rbp)
jmp 0x72bca
movq -0x88(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
movslq -0x18(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rdi
xorl %esi, %esi
movl $0x20, %edx
callq 0x8200
movq -0x58(%rbp), %rax
movslq -0x18(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, -0x80(%rbp)
movl -0x18(%rbp), %eax
shll %eax
movl %eax, -0x38(%rbp)
movq -0x60(%rbp), %rax
movq %rax, -0x68(%rbp)
cmpl $0x0, -0x38(%rbp)
jle 0x72584
movq -0x80(%rbp), %rcx
movq -0x68(%rbp), %rax
movq %rcx, 0x18(%rax)
movl -0x38(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x38(%rbp)
movq -0x68(%rbp), %rax
addq $0x20, %rax
movq %rax, -0x68(%rbp)
movl -0x1c(%rbp), %ecx
movq -0x80(%rbp), %rax
movslq %ecx, %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x80(%rbp)
jmp 0x72546
movq -0x28(%rbp), %rax
cmpl $0x2e, 0x1e8(%rax)
jae 0x725a3
movq -0x28(%rbp), %rax
movl 0x1e8(%rax), %eax
movl %eax, -0xbc(%rbp)
jmp 0x725b0
movl $0x2e, %eax
movl %eax, -0xbc(%rbp)
jmp 0x725b0
movl -0xbc(%rbp), %eax
movw %ax, %cx
movq -0x58(%rbp), %rax
movw %cx, 0x10(%rax)
movl $0x1, -0x4c(%rbp)
movw $0x0, -0x42(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x725e2
movzwl -0x12(%rbp), %eax
cmpl $0x0, %eax
jne 0x725ec
movq -0x58(%rbp), %rax
movb $0x1, 0x15(%rax)
jmp 0x72611
movzwl -0x12(%rbp), %eax
movl %eax, -0xc0(%rbp)
movzwl -0x12(%rbp), %edi
callq 0x798f0
movw %ax, %cx
movl -0xc0(%rbp), %eax
movzwl %cx, %ecx
addl %ecx, %eax
movw %ax, -0x42(%rbp)
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0x729f0
movl $0x0, -0x48(%rbp)
movl $0x0, -0x38(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0x68(%rbp)
movl -0x38(%rbp), %eax
cmpl -0x4c(%rbp), %eax
jge 0x729c4
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x78(%rbp)
cmpq $0x0, -0x78(%rbp)
je 0x729a8
movq $0x0, -0x98(%rbp)
movq -0x68(%rbp), %rax
movb 0x15(%rax), %al
movb %al, -0x99(%rbp)
movq -0x68(%rbp), %rax
movb 0x14(%rax), %al
movb %al, -0x9a(%rbp)
movq -0x78(%rbp), %rax
movq (%rax), %rax
movq -0x68(%rbp), %rcx
movq (%rcx), %rcx
xorq $-0x1, %rcx
andq %rcx, %rax
cmpq $0x0, %rax
je 0x726a2
jmp 0x72997
movq -0x78(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x68(%rbp), %rcx
andq (%rcx), %rax
cmpq $0x0, %rax
je 0x726bc
jmp 0x72997
movq -0x78(%rbp), %rax
movw 0x12(%rax), %cx
movq -0x78(%rbp), %rax
movzwl 0x14(%rax), %eax
movq -0x68(%rbp), %rdx
movzwl 0x10(%rdx), %edx
addl %edx, %eax
movzwl %cx, %edi
movzwl %ax, %esi
callq 0x79a10
movw %ax, -0x3e(%rbp)
movw -0x3e(%rbp), %cx
movq -0x68(%rbp), %rax
movzwl %cx, %edi
movzwl 0x12(%rax), %esi
callq 0x79a10
movw %ax, -0x3e(%rbp)
movq -0x68(%rbp), %rax
movq (%rax), %rax
movq -0x78(%rbp), %rcx
orq 0x8(%rcx), %rax
movq %rax, -0x90(%rbp)
cmpb $0x0, -0x99(%rbp)
jne 0x7279a
movq -0x10(%rbp), %rdi
movq 0x10(%rdi), %rsi
movq -0x68(%rbp), %rdx
movzwl 0x32(%rdi), %ecx
movzwl -0x34(%rbp), %r8d
movq -0x78(%rbp), %r9
movq %rsp, %rax
leaq -0x98(%rbp), %r10
movq %r10, (%rax)
callq 0x7a5c0
movl %eax, %ecx
movl %ecx, -0xc4(%rbp)
testl %eax, %eax
je 0x72772
jmp 0x72755
movl -0xc4(%rbp), %eax
subl $0x1, %eax
jne 0x72796
jmp 0x72762
movb $0x1, -0x9a(%rbp)
movb $0x1, -0x99(%rbp)
jmp 0x72798
movb $0x0, -0x9a(%rbp)
movb $0x1, -0x99(%rbp)
movw -0x3e(%rbp), %ax
movzwl %ax, %edi
movzwl -0x42(%rbp), %esi
callq 0x79a10
movw %ax, -0x3e(%rbp)
jmp 0x72798
jmp 0x72798
jmp 0x727a9
movq -0x68(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x98(%rbp)
movl $0x0, -0x3c(%rbp)
movq -0x60(%rbp), %rax
movq %rax, -0x70(%rbp)
movl -0x3c(%rbp), %eax
cmpl -0x48(%rbp), %eax
jge 0x727fe
movq -0x70(%rbp), %rax
movq (%rax), %rax
cmpq -0x90(%rbp), %rax
jne 0x727e5
movq -0x70(%rbp), %rax
movzbl 0x15(%rax), %eax
movzbl -0x99(%rbp), %ecx
cmpl %ecx, %eax
jne 0x727e5
jmp 0x727fe
jmp 0x727e7
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
movq -0x70(%rbp), %rax
addq $0x20, %rax
movq %rax, -0x70(%rbp)
jmp 0x727b8
movl -0x3c(%rbp), %eax
cmpl -0x48(%rbp), %eax
jl 0x7287f
movl -0x48(%rbp), %eax
cmpl -0x18(%rbp), %eax
jl 0x7281f
movzwl -0x3e(%rbp), %eax
movzwl -0x40(%rbp), %ecx
cmpl %ecx, %eax
jl 0x7281f
jmp 0x72997
movl -0x48(%rbp), %eax
cmpl -0x18(%rbp), %eax
jge 0x72837
movl -0x48(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0x48(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x7286a
movl -0x48(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x3c(%rbp)
movq -0x60(%rbp), %rax
movslq -0x3c(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movzwl 0x12(%rax), %eax
movzwl -0x40(%rbp), %ecx
cmpl %ecx, %eax
jge 0x72868
jmp 0x7285d
movl -0x3c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x72840
jmp 0x7286a
movq -0x60(%rbp), %rax
movslq -0x3c(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, -0x70(%rbp)
jmp 0x72896
movq -0x70(%rbp), %rax
movzwl 0x12(%rax), %eax
movzwl -0x3e(%rbp), %ecx
cmpl %ecx, %eax
jg 0x72894
jmp 0x72997
jmp 0x72896
movq -0x68(%rbp), %rax
movq (%rax), %rcx
movq -0x78(%rbp), %rax
orq 0x8(%rax), %rcx
movq -0x70(%rbp), %rax
movq %rcx, (%rax)
movq -0x98(%rbp), %rcx
movq -0x70(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x68(%rbp), %rax
movzwl 0x10(%rax), %eax
movq -0x78(%rbp), %rcx
movzwl 0x16(%rcx), %ecx
addl %ecx, %eax
movw %ax, %cx
movq -0x70(%rbp), %rax
movw %cx, 0x10(%rax)
movw -0x3e(%rbp), %cx
movq -0x70(%rbp), %rax
movw %cx, 0x12(%rax)
movb -0x99(%rbp), %cl
movq -0x70(%rbp), %rax
movb %cl, 0x15(%rax)
movb -0x9a(%rbp), %cl
movq -0x70(%rbp), %rax
movb %cl, 0x14(%rax)
movq -0x70(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x68(%rbp), %rax
movq 0x18(%rax), %rsi
movslq -0x34(%rbp), %rdx
shlq $0x3, %rdx
callq 0x82f0
movq -0x78(%rbp), %rdx
movq -0x70(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x34(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x48(%rbp), %eax
cmpl -0x18(%rbp), %eax
jl 0x72995
movq -0x60(%rbp), %rax
movw 0x12(%rax), %ax
movw %ax, -0x40(%rbp)
movl $0x1, -0x3c(%rbp)
movq -0x60(%rbp), %rax
addq $0x20, %rax
movq %rax, -0x70(%rbp)
movl -0x3c(%rbp), %eax
cmpl -0x18(%rbp), %eax
jge 0x72993
movq -0x70(%rbp), %rax
movzwl 0x12(%rax), %eax
movzwl -0x40(%rbp), %ecx
cmpl %ecx, %eax
jle 0x7297a
movq -0x70(%rbp), %rax
movw 0x12(%rax), %ax
movw %ax, -0x40(%rbp)
jmp 0x7297c
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
movq -0x70(%rbp), %rax
addq $0x20, %rax
movq %rax, -0x70(%rbp)
jmp 0x72956
jmp 0x72995
jmp 0x72997
movq -0x78(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x78(%rbp)
jmp 0x72652
jmp 0x729aa
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
movq -0x68(%rbp), %rax
addq $0x20, %rax
movq %rax, -0x68(%rbp)
jmp 0x7263a
movq -0x60(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x68(%rbp), %rax
movq %rax, -0x58(%rbp)
movl -0x48(%rbp), %eax
movl %eax, -0x4c(%rbp)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x72618
cmpl $0x0, -0x4c(%rbp)
jne 0x72a24
movq -0x28(%rbp), %rdi
leaq 0x3dc02(%rip), %rsi     # 0xb0603
movb $0x0, %al
callq 0x136f0
movq -0x30(%rbp), %rdi
movq -0x88(%rbp), %rsi
callq 0x9cd0
movl $0x1, -0x4(%rbp)
jmp 0x72bca
movq -0x58(%rbp), %rax
movq %rax, -0x68(%rbp)
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0x72ac4
movq -0x10(%rbp), %rax
addq $0x338, %rax            # imm = 0x338
movslq -0x34(%rbp), %rcx
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0xa8(%rbp)
movq -0x68(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x34(%rbp), %rcx
movq (%rax,%rcx,8), %rcx
movq %rcx, -0x78(%rbp)
movq -0xa8(%rbp), %rax
movq %rcx, 0x40(%rax)
movq -0x78(%rbp), %rax
movb 0x10(%rax), %cl
movq -0xa8(%rbp), %rax
movb %cl, 0x20(%rax)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
addq $0x8, %rax
movq -0xa8(%rbp), %rcx
movzbl 0x20(%rcx), %ecx
imulq $0x68, %rcx, %rcx
addq %rcx, %rax
movl 0x3c(%rax), %ecx
movq -0xa8(%rbp), %rax
movl %ecx, 0x4(%rax)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x72a33
movq -0x10(%rbp), %rax
movzwl 0x32(%rax), %eax
andl $0x400, %eax            # imm = 0x400
cmpl $0x0, %eax
je 0x72b63
movq -0x10(%rbp), %rax
movzwl 0x32(%rax), %eax
andl $0x200, %eax            # imm = 0x200
cmpl $0x0, %eax
jne 0x72b63
movq -0x10(%rbp), %rax
movzbl 0x37(%rax), %eax
cmpl $0x0, %eax
jne 0x72b63
movzwl -0x12(%rbp), %eax
cmpl $0x0, %eax
je 0x72b63
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rsi
movq -0x68(%rbp), %rdx
movl -0x1c(%rbp), %eax
subl $0x1, %eax
movw %ax, %r8w
movq -0x68(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x1c(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %r9
movl $0x200, %ecx            # imm = 0x200
leaq -0xb0(%rbp), %rax
movzwl %r8w, %r8d
movq %rax, (%rsp)
callq 0x7a5c0
movl %eax, -0xb4(%rbp)
cmpl $0x1, -0xb4(%rbp)
jne 0x72b61
movq -0x10(%rbp), %rax
movb $0x2, 0x37(%rax)
jmp 0x72b63
movq -0x68(%rbp), %rax
cmpb $0x0, 0x14(%rax)
je 0x72ba3
movq -0x10(%rbp), %rax
movzwl 0x32(%rax), %eax
andl $0x200, %eax            # imm = 0x200
cmpl $0x0, %eax
je 0x72b89
movq -0x10(%rbp), %rax
movb $0x2, 0x37(%rax)
jmp 0x72ba1
movq -0x10(%rbp), %rax
movb $0x1, 0x34(%rax)
movq -0x68(%rbp), %rax
movq 0x8(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x28(%rax)
jmp 0x72ba3
movq -0x68(%rbp), %rax
movw 0x10(%rax), %cx
movq -0x10(%rbp), %rax
movw %cx, 0x30(%rax)
movq -0x30(%rbp), %rdi
movq -0x88(%rbp), %rsi
callq 0x9cd0
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xd0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)