// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: analyzeOneTable
static void analyzeOneTable(
  Parse *pParse,   /* Parser context */
  Table *pTab,     /* Table whose indices are to be analyzed */
  Index *pOnlyIdx, /* If not NULL, only analyze this one index */
  int iStatCur,    /* Index of VdbeCursor that writes the sqlite_stat1 table */
  int iMem,        /* Available memory locations begin here */
  int iTab         /* Next available cursor */
){
  sqlite3 *db = pParse->db;    /* Database handle */
  Index *pIdx;                 /* An index to being analyzed */
  int iIdxCur;                 /* Cursor open on index being analyzed */
  int iTabCur;                 /* Table cursor */
  Vdbe *v;                     /* The virtual machine being built up */
  int i;                       /* Loop counter */
  int jZeroRows = -1;          /* Jump from here if number of rows is zero */
  int iDb;                     /* Index of database containing pTab */
  u8 needTableCnt = 1;         /* True to count the table */
  int regNewRowid = iMem++;    /* Rowid for the inserted record */
  int regStat = iMem++;        /* Register to hold StatAccum object */
  int regChng = iMem++;        /* Index of changed index field */
  int regRowid = iMem++;       /* Rowid argument passed to stat_push() */
  int regTemp = iMem++;        /* Temporary use register */
  int regTemp2 = iMem++;       /* Second temporary use register */
  int regTabname = iMem++;     /* Register containing table name */
  int regIdxname = iMem++;     /* Register containing index name */
  int regStat1 = iMem++;       /* Value for the stat column of sqlite_stat1 */
  int regPrev = iMem;          /* MUST BE LAST (see below) */
#ifdef SQLITE_ENABLE_PREUPDATE_HOOK
  Table *pStat1 = 0;
#endif

  pParse->nMem = MAX(pParse->nMem, iMem);
  v = sqlite3GetVdbe(pParse);
  if( v==0 || NEVER(pTab==0) ){
    return;
  }
  if( pTab->tnum==0 ){
    /* Do not gather statistics on views or virtual tables */
    return;
  }
  if( sqlite3_strlike("sqlite\\_%", pTab->zName, '\\')==0 ){
    /* Do not gather statistics on system tables */
    return;
  }
  assert( sqlite3BtreeHoldsAllMutexes(db) );
  iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
  assert( iDb>=0 );
  assert( sqlite3SchemaMutexHeld(db, iDb, 0) );
#ifndef SQLITE_OMIT_AUTHORIZATION
  if( sqlite3AuthCheck(pParse, SQLITE_ANALYZE, pTab->zName, 0,
      db->aDb[iDb].zDbSName ) ){
    return;
  }
#endif

#ifdef SQLITE_ENABLE_PREUPDATE_HOOK
  if( db->xPreUpdateCallback ){
    pStat1 = (Table*)sqlite3DbMallocZero(db, sizeof(Table) + 13);
    if( pStat1==0 ) return;
    pStat1->zName = (char*)&pStat1[1];
    memcpy(pStat1->zName, "sqlite_stat1", 13);
    pStat1->nCol = 3;
    pStat1->iPKey = -1;
    sqlite3VdbeAddOp4(pParse->pVdbe, OP_Noop, 0, 0, 0,(char*)pStat1,P4_DYNBLOB);
  }
#endif

  /* Establish a read-lock on the table at the shared-cache level.
  ** Open a read-only cursor on the table. Also allocate a cursor number
  ** to use for scanning indexes (iIdxCur). No index cursor is opened at
  ** this time though.  */
  sqlite3TableLock(pParse, iDb, pTab->tnum, 0, pTab->zName);
  iTabCur = iTab++;
  iIdxCur = iTab++;
  pParse->nTab = MAX(pParse->nTab, iTab);
  sqlite3OpenTable(pParse, iTabCur, iDb, pTab, OP_OpenRead);
  sqlite3VdbeLoadString(v, regTabname, pTab->zName);

  for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){
    int nCol;                     /* Number of columns in pIdx. "N" */
    int addrRewind;               /* Address of "OP_Rewind iIdxCur" */
    int addrNextRow;              /* Address of "next_row:" */
    const char *zIdxName;         /* Name of the index */
    int nColTest;                 /* Number of columns to test for changes */

    if( pOnlyIdx && pOnlyIdx!=pIdx ) continue;
    if( pIdx->pPartIdxWhere==0 ) needTableCnt = 0;
    if( !HasRowid(pTab) && IsPrimaryKeyIndex(pIdx) ){
      nCol = pIdx->nKeyCol;
      zIdxName = pTab->zName;
      nColTest = nCol - 1;
    }else{
      nCol = pIdx->nColumn;
      zIdxName = pIdx->zName;
      nColTest = pIdx->uniqNotNull ? pIdx->nKeyCol-1 : nCol-1;
    }

    /* Populate the register containing the index name. */
    sqlite3VdbeLoadString(v, regIdxname, zIdxName);
    VdbeComment((v, "Analysis for %s.%s", pTab->zName, zIdxName));

    /*
    ** Pseudo-code for loop that calls stat_push():
    **
    **   Rewind csr
    **   if eof(csr) goto end_of_scan;
    **   regChng = 0
    **   goto chng_addr_0;
    **
    **  next_row:
    **   regChng = 0
    **   if( idx(0) != regPrev(0) ) goto chng_addr_0
    **   regChng = 1
    **   if( idx(1) != regPrev(1) ) goto chng_addr_1
    **   ...
    **   regChng = N
    **   goto chng_addr_N
    **
    **  chng_addr_0:
    **   regPrev(0) = idx(0)
    **  chng_addr_1:
    **   regPrev(1) = idx(1)
    **  ...
    **
    **  endDistinctTest:
    **   regRowid = idx(rowid)
    **   stat_push(P, regChng, regRowid)
    **   Next csr
    **   if !eof(csr) goto next_row;
    **
    **  end_of_scan:
    */

    /* Make sure there are enough memory cells allocated to accommodate
    ** the regPrev array and a trailing rowid (the rowid slot is required
    ** when building a record to insert into the sample column of
    ** the sqlite_stat4 table.  */
    pParse->nMem = MAX(pParse->nMem, regPrev+nColTest);

    /* Open a read-only cursor on the index being analyzed. */
    assert( iDb==sqlite3SchemaToIndex(db, pIdx->pSchema) );
    sqlite3VdbeAddOp3(v, OP_OpenRead, iIdxCur, pIdx->tnum, iDb);
    sqlite3VdbeSetP4KeyInfo(pParse, pIdx);
    VdbeComment((v, "%s", pIdx->zName));

    /* Invoke the stat_init() function. The arguments are:
    **
    **    (1) the number of columns in the index including the rowid
    **        (or for a WITHOUT ROWID table, the number of PK columns),
    **    (2) the number of columns in the key without the rowid/pk
    **    (3) estimated number of rows in the index,
    */
    sqlite3VdbeAddOp2(v, OP_Integer, nCol, regStat+1);
    assert( regRowid==regStat+2 );
    sqlite3VdbeAddOp2(v, OP_Integer, pIdx->nKeyCol, regRowid);
#ifdef SQLITE_ENABLE_STAT4
    if( OptimizationEnabled(db, SQLITE_Stat4) ){
      sqlite3VdbeAddOp2(v, OP_Count, iIdxCur, regTemp);
      addrRewind = sqlite3VdbeAddOp1(v, OP_Rewind, iIdxCur);
      VdbeCoverage(v);
    }else
#endif
    {
      addrRewind = sqlite3VdbeAddOp1(v, OP_Rewind, iIdxCur);
      VdbeCoverage(v);
      sqlite3VdbeAddOp3(v, OP_Count, iIdxCur, regTemp, 1);
    }
    assert( regTemp2==regStat+4 );
    sqlite3VdbeAddOp2(v, OP_Integer, db->nAnalysisLimit, regTemp2);
    sqlite3VdbeAddFunctionCall(pParse, 0, regStat+1, regStat, 4,
                               &statInitFuncdef, 0);

    /* Implementation of the following:
    **
    **   Rewind csr
    **   if eof(csr) goto end_of_scan;
    **   regChng = 0
    **   goto next_push_0;
    **
    */
    sqlite3VdbeAddOp2(v, OP_Integer, 0, regChng);
    addrNextRow = sqlite3VdbeCurrentAddr(v);

    if( nColTest>0 ){
      int endDistinctTest = sqlite3VdbeMakeLabel(pParse);
      int *aGotoChng;               /* Array of jump instruction addresses */
      aGotoChng = sqlite3DbMallocRawNN(db, sizeof(int)*nColTest);
      if( aGotoChng==0 ) continue;

      /*
      **  next_row:
      **   regChng = 0
      **   if( idx(0) != regPrev(0) ) goto chng_addr_0
      **   regChng = 1
      **   if( idx(1) != regPrev(1) ) goto chng_addr_1
      **   ...
      **   regChng = N
      **   goto endDistinctTest
      */
      sqlite3VdbeAddOp0(v, OP_Goto);
      addrNextRow = sqlite3VdbeCurrentAddr(v);
      if( nColTest==1 && pIdx->nKeyCol==1 && IsUniqueIndex(pIdx) ){
        /* For a single-column UNIQUE index, once we have found a non-NULL
        ** row, we know that all the rest will be distinct, so skip
        ** subsequent distinctness tests. */
        sqlite3VdbeAddOp2(v, OP_NotNull, regPrev, endDistinctTest);
        VdbeCoverage(v);
      }
      for(i=0; i<nColTest; i++){
        char *pColl = (char*)sqlite3LocateCollSeq(pParse, pIdx->azColl[i]);
        sqlite3VdbeAddOp2(v, OP_Integer, i, regChng);
        sqlite3VdbeAddOp3(v, OP_Column, iIdxCur, i, regTemp);
        analyzeVdbeCommentIndexWithColumnName(v,pIdx,i);
        aGotoChng[i] =
        sqlite3VdbeAddOp4(v, OP_Ne, regTemp, 0, regPrev+i, pColl, P4_COLLSEQ);
        sqlite3VdbeChangeP5(v, SQLITE_NULLEQ);
        VdbeCoverage(v);
      }
      sqlite3VdbeAddOp2(v, OP_Integer, nColTest, regChng);
      sqlite3VdbeGoto(v, endDistinctTest);


      /*
      **  chng_addr_0:
      **   regPrev(0) = idx(0)
      **  chng_addr_1:
      **   regPrev(1) = idx(1)
      **  ...
      */
      sqlite3VdbeJumpHere(v, addrNextRow-1);
      for(i=0; i<nColTest; i++){
        sqlite3VdbeJumpHere(v, aGotoChng[i]);
        sqlite3VdbeAddOp3(v, OP_Column, iIdxCur, i, regPrev+i);
        analyzeVdbeCommentIndexWithColumnName(v,pIdx,i);
      }
      sqlite3VdbeResolveLabel(v, endDistinctTest);
      sqlite3DbFree(db, aGotoChng);
    }

    /*
    **  chng_addr_N:
    **   regRowid = idx(rowid)            // STAT4 only
    **   stat_push(P, regChng, regRowid)  // 3rd parameter STAT4 only
    **   Next csr
    **   if !eof(csr) goto next_row;
    */
#ifdef SQLITE_ENABLE_STAT4
    if( OptimizationEnabled(db, SQLITE_Stat4) ){
      assert( regRowid==(regStat+2) );
      if( HasRowid(pTab) ){
        sqlite3VdbeAddOp2(v, OP_IdxRowid, iIdxCur, regRowid);
      }else{
        Index *pPk = sqlite3PrimaryKeyIndex(pIdx->pTable);
        int j, k, regKey;
        regKey = sqlite3GetTempRange(pParse, pPk->nKeyCol);
        for(j=0; j<pPk->nKeyCol; j++){
          k = sqlite3TableColumnToIndex(pIdx, pPk->aiColumn[j]);
          assert( k>=0 && k<pIdx->nColumn );
          sqlite3VdbeAddOp3(v, OP_Column, iIdxCur, k, regKey+j);
          analyzeVdbeCommentIndexWithColumnName(v,pIdx,k);
        }
        sqlite3VdbeAddOp3(v, OP_MakeRecord, regKey, pPk->nKeyCol, regRowid);
        sqlite3ReleaseTempRange(pParse, regKey, pPk->nKeyCol);
      }
    }
#endif
    assert( regChng==(regStat+1) );
    {
      sqlite3VdbeAddFunctionCall(pParse, 1, regStat, regTemp, 2+IsStat4,
                                 &statPushFuncdef, 0);
      if( db->nAnalysisLimit ){
        int j1, j2, j3;
        j1 = sqlite3VdbeAddOp1(v, OP_IsNull, regTemp); VdbeCoverage(v);
        j2 = sqlite3VdbeAddOp1(v, OP_If, regTemp); VdbeCoverage(v);
        j3 = sqlite3VdbeAddOp4Int(v, OP_SeekGT, iIdxCur, 0, regPrev, 1);
        VdbeCoverage(v);
        sqlite3VdbeJumpHere(v, j1);
        sqlite3VdbeAddOp2(v, OP_Next, iIdxCur, addrNextRow); VdbeCoverage(v);
        sqlite3VdbeJumpHere(v, j2);
        sqlite3VdbeJumpHere(v, j3);
      }else{
        sqlite3VdbeAddOp2(v, OP_Next, iIdxCur, addrNextRow); VdbeCoverage(v);
      }
    }

    /* Add the entry to the stat1 table. */
    callStatGet(pParse, regStat, STAT_GET_STAT1, regStat1);
    assert( "BBB"[0]==SQLITE_AFF_TEXT );
    sqlite3VdbeAddOp4(v, OP_MakeRecord, regTabname, 3, regTemp, "BBB", 0);
    sqlite3VdbeAddOp2(v, OP_NewRowid, iStatCur, regNewRowid);
    sqlite3VdbeAddOp3(v, OP_Insert, iStatCur, regTemp, regNewRowid);
#ifdef SQLITE_ENABLE_PREUPDATE_HOOK
    sqlite3VdbeChangeP4(v, -1, (char*)pStat1, P4_TABLE);
#endif
    sqlite3VdbeChangeP5(v, OPFLAG_APPEND);

    /* Add the entries to the stat4 table. */
#ifdef SQLITE_ENABLE_STAT4
    if( OptimizationEnabled(db, SQLITE_Stat4) && db->nAnalysisLimit==0 ){
      int regEq = regStat1;
      int regLt = regStat1+1;
      int regDLt = regStat1+2;
      int regSample = regStat1+3;
      int regCol = regStat1+4;
      int regSampleRowid = regCol + nCol;
      int addrNext;
      int addrIsNull;
      u8 seekOp = HasRowid(pTab) ? OP_NotExists : OP_NotFound;

      pParse->nMem = MAX(pParse->nMem, regCol+nCol);

      addrNext = sqlite3VdbeCurrentAddr(v);
      callStatGet(pParse, regStat, STAT_GET_ROWID, regSampleRowid);
      addrIsNull = sqlite3VdbeAddOp1(v, OP_IsNull, regSampleRowid);
      VdbeCoverage(v);
      callStatGet(pParse, regStat, STAT_GET_NEQ, regEq);
      callStatGet(pParse, regStat, STAT_GET_NLT, regLt);
      callStatGet(pParse, regStat, STAT_GET_NDLT, regDLt);
      sqlite3VdbeAddOp4Int(v, seekOp, iTabCur, addrNext, regSampleRowid, 0);
      VdbeCoverage(v);
      for(i=0; i<nCol; i++){
        sqlite3ExprCodeLoadIndexColumn(pParse, pIdx, iTabCur, i, regCol+i);
      }
      sqlite3VdbeAddOp3(v, OP_MakeRecord, regCol, nCol, regSample);
      sqlite3VdbeAddOp3(v, OP_MakeRecord, regTabname, 6, regTemp);
      sqlite3VdbeAddOp2(v, OP_NewRowid, iStatCur+1, regNewRowid);
      sqlite3VdbeAddOp3(v, OP_Insert, iStatCur+1, regTemp, regNewRowid);
      sqlite3VdbeAddOp2(v, OP_Goto, 1, addrNext); /* P1==1 for end-of-loop */
      sqlite3VdbeJumpHere(v, addrIsNull);
    }
#endif /* SQLITE_ENABLE_STAT4 */

    /* End of analysis */
    sqlite3VdbeJumpHere(v, addrRewind);
  }


  /* Create a single sqlite_stat1 entry containing NULL as the index
  ** name and the row count as the content.
  */
  if( pOnlyIdx==0 && needTableCnt ){
    VdbeComment((v, "%s", pTab->zName));
    sqlite3VdbeAddOp2(v, OP_Count, iTabCur, regStat1);
    jZeroRows = sqlite3VdbeAddOp1(v, OP_IfNot, regStat1); VdbeCoverage(v);
    sqlite3VdbeAddOp2(v, OP_Null, 0, regIdxname);
    assert( "BBB"[0]==SQLITE_AFF_TEXT );
    sqlite3VdbeAddOp4(v, OP_MakeRecord, regTabname, 3, regTemp, "BBB", 0);
    sqlite3VdbeAddOp2(v, OP_NewRowid, iStatCur, regNewRowid);
    sqlite3VdbeAddOp3(v, OP_Insert, iStatCur, regTemp, regNewRowid);
    sqlite3VdbeChangeP5(v, OPFLAG_APPEND);
#ifdef SQLITE_ENABLE_PREUPDATE_HOOK
    sqlite3VdbeChangeP4(v, -1, (char*)pStat1, P4_TABLE);
#endif
    sqlite3VdbeJumpHere(v, jZeroRows);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movl %r9d, %r13d
movl %ecx, %r12d
movq %rdx, %r15
movq %rsi, %rbx
movq (%rdi), %rax
movq %rax, 0x58(%rsp)
movq %r8, 0x50(%rsp)
leal 0x9(%r8), %edx
movl 0x38(%rdi), %eax
cmpl %edx, %eax
movq %rdx, 0x70(%rsp)
cmovlel %edx, %eax
movl %eax, 0x38(%rdi)
movq %rdi, 0x28(%rsp)
callq 0x2c5ddf
movq %rbx, %rsi
movq %rax, %rbx
testq %rax, %rax
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
jne 0x2f2e84
cmpl $0x0, 0x38(%rsi)
je 0x2f2e84
movq (%rsi), %r14
leaq 0xf07d3(%rip), %rdi     # 0x3e2d24
leaq 0xe8664(%rip), %rdx     # 0x3dabbc
movq %rsi, 0x20(%rsp)
movq %r14, %rsi
movl $0x5c, %ecx
callq 0x285aed
movq 0x20(%rsp), %rcx
testl %eax, %eax
je 0x2f2e84
movq 0x70(%rcx), %rax
testq %rax, %rax
je 0x2f25a2
movq 0x58(%rsp), %rcx
movq 0x20(%rcx), %rcx
addq $0x18, %rcx
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
incl %ebp
leaq 0x20(%rcx), %rdx
cmpq %rax, (%rcx)
movq %rdx, %rcx
jne 0x2f2592
jmp 0x2f25a7
movl $0xffff8000, %ebp       # imm = 0xFFFF8000
movq 0x58(%rsp), %rax
movq 0x20(%rax), %rax
movslq %ebp, %rcx
shlq $0x5, %rcx
movq (%rax,%rcx), %r8
movq 0x28(%rsp), %rdi
movl $0x1c, %esi
movq %r14, %rdx
xorl %ecx, %ecx
callq 0x2cceea
testl %eax, %eax
movq 0x20(%rsp), %rax
jne 0x2f2e84
movq %r13, 0x48(%rsp)
movq 0x50(%rsp), %r13
leal 0x4(%r13), %ecx
movl %ecx, 0x18(%rsp)
leal 0x6(%r13), %ecx
movl %ecx, 0x34(%rsp)
leal 0x7(%r13), %ecx
movl %ecx, 0x68(%rsp)
leal 0x8(%r13), %ecx
movl %ecx, 0x64(%rsp)
movl 0x38(%rax), %edx
movq (%rax), %r8
movq 0x28(%rsp), %r14
movq %r14, %rdi
movl %ebp, %esi
xorl %ecx, %ecx
callq 0x2c60e2
movq 0x48(%rsp), %rsi
leal 0x2(%rsi), %eax
movl 0x34(%r14), %ecx
cmpl %eax, %ecx
cmovgl %ecx, %eax
movl %eax, 0x34(%r14)
movq %r14, %rdi
movl %ebp, 0x90(%rsp)
movl %ebp, %edx
movq 0x20(%rsp), %rcx
movl $0x60, %r8d
callq 0x2c5fdd
movq 0x20(%rsp), %rax
movq (%rax), %r14
movq %rbx, %rdi
movl $0x73, %esi
xorl %edx, %edx
movl 0x34(%rsp), %ecx
xorl %r8d, %r8d
callq 0x2b200c
movq %rbx, %rdi
movl %eax, %esi
movq %r14, %rdx
xorl %ecx, %ecx
callq 0x285198
movq 0x20(%rsp), %r8
movq 0x10(%r8), %rbp
testq %rbp, %rbp
je 0x2f2d7b
leal 0x1(%r13), %eax
movl %eax, 0x40(%rsp)
leal 0x2(%r13), %eax
movl %eax, 0x44(%rsp)
leal 0x3(%r13), %eax
movl %eax, 0x8c(%rsp)
leal 0x5(%r13), %eax
movl %eax, 0x88(%rsp)
movq 0x48(%rsp), %rdx
leal 0x1(%rdx), %eax
movl %eax, 0x14(%rsp)
movl 0x70(%rsp), %eax
movq %rax, 0xa0(%rsp)
movb $0x1, %sil
movl %r12d, 0x3c(%rsp)
movq %r15, 0x98(%rsp)
testq %r15, %r15
setne %al
cmpq %r15, %rbp
setne %cl
testb %cl, %al
jne 0x2f2d66
cmpq $0x0, 0x48(%rbp)
movzbl %sil, %esi
movl $0x0, %eax
cmovel %eax, %esi
testb $-0x80, 0x40(%r8)
movl %esi, 0x6c(%rsp)
je 0x2f2722
movzwl 0x63(%rbp), %eax
andl $0x3, %eax
cmpw $0x2, %ax
jne 0x2f2722
movzwl 0x5e(%rbp), %r15d
movq (%r8), %r14
jmp 0x2f2731
movzwl 0x60(%rbp), %r15d
movq (%rbp), %r14
testb $0x8, 0x63(%rbp)
jne 0x2f2736
movl %r15d, %r12d
jmp 0x2f273b
movzwl 0x5e(%rbp), %r12d
movq %r12, 0x80(%rsp)
movq %rbx, %rdi
movl $0x73, %esi
xorl %edx, %edx
movl 0x68(%rsp), %ecx
xorl %r8d, %r8d
callq 0x2b200c
movq %rbx, %rdi
movl %eax, %esi
movq %r14, %rdx
xorl %ecx, %ecx
callq 0x285198
movq 0x28(%rsp), %r14
movl 0x38(%r14), %eax
movq 0x70(%rsp), %rcx
addl %r12d, %ecx
decl %ecx
cmpl %ecx, %eax
cmovgl %eax, %ecx
movl %ecx, 0x38(%r14)
movl 0x58(%rbp), %ecx
movq %rbx, %rdi
movl $0x60, %esi
movl 0x14(%rsp), %r12d
movl %r12d, %edx
movl 0x90(%rsp), %r8d
callq 0x2b200c
movq %r14, %rdi
movq %rbp, %rsi
callq 0x2c61e4
movq %rbx, %rdi
movl $0x45, %esi
movl %r15d, %edx
movl 0x44(%rsp), %r13d
movl %r13d, %ecx
xorl %r8d, %r8d
callq 0x2b200c
movzwl 0x5e(%rbp), %edx
movq %rbx, %rdi
movl $0x45, %esi
movl 0x8c(%rsp), %ecx
xorl %r8d, %r8d
callq 0x2b200c
movq %rbx, %rdi
movl $0x25, %esi
movl %r12d, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x2b200c
movl %eax, 0x94(%rsp)
movq %rbx, %rdi
movl $0x5c, %esi
movl %r12d, %edx
movl 0x18(%rsp), %ecx
movl $0x1, %r8d
callq 0x2b200c
movq 0x58(%rsp), %r15
movl 0x2b0(%r15), %edx
movq %rbx, %rdi
movl $0x45, %esi
movl 0x88(%rsp), %ecx
xorl %r8d, %r8d
callq 0x2b200c
movl $0x0, (%rsp)
movq %r14, %rdi
xorl %esi, %esi
movl %r13d, %edx
movl 0x40(%rsp), %ecx
movl $0x4, %r8d
leaq 0x1d0742(%rip), %r9     # 0x4c2fa0
callq 0x2c85ae
movq %rbx, %rdi
movl $0x45, %esi
xorl %edx, %edx
movl %r13d, %ecx
movq 0x80(%rsp), %r13
xorl %r8d, %r8d
callq 0x2b200c
movl 0x90(%rbx), %eax
movl %eax, 0x1c(%rsp)
cmpl $0x2, %r13d
jb 0x2f2af2
decl %r13d
movl 0x44(%r14), %eax
decl %eax
movl %eax, 0x38(%rsp)
movl %eax, 0x44(%r14)
movl %r13d, %esi
shlq $0x2, %rsi
movq %r15, %rdi
callq 0x28c518
movq %rax, %r15
testq %rax, %rax
movl 0x3c(%rsp), %r12d
je 0x2f2acd
movq %rbx, %rdi
movl $0xb, %esi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x2b200c
movl 0x90(%rbx), %eax
movl %eax, 0x1c(%rsp)
cmpl $0x1, %r13d
jne 0x2f290f
cmpw $0x1, 0x5e(%rbp)
jne 0x2f290f
cmpb $0x0, 0x62(%rbp)
je 0x2f290f
movq %rbx, %rdi
movl $0x33, %esi
movq 0x70(%rsp), %rdx
movl 0x38(%rsp), %ecx
xorl %r8d, %r8d
callq 0x2b200c
movq %rbp, 0x78(%rsp)
cmpl $0x2, %r13d
movl $0x1, %ebp
movq %r13, 0x80(%rsp)
cmovgel %r13d, %ebp
xorl %r14d, %r14d
movq 0x78(%rsp), %rax
movq 0x40(%rax), %rax
movq (%rax,%r14,8), %rsi
movq 0x28(%rsp), %rdi
callq 0x2c63b7
movq %rax, %r13
movq %rbx, %rdi
movl $0x45, %esi
movl %r14d, %edx
movl 0x44(%rsp), %ecx
xorl %r8d, %r8d
callq 0x2b200c
movq %rbx, %rdi
movl $0x59, %esi
movl 0x14(%rsp), %edx
movl %r14d, %ecx
movl 0x18(%rsp), %r12d
movl %r12d, %r8d
callq 0x2b200c
movq 0xa0(%rsp), %rax
leal (%rax,%r14), %r8d
movq %rbx, %rdi
movl $0x34, %esi
movl %r12d, %edx
xorl %ecx, %ecx
callq 0x2b200c
movl %eax, %r12d
movq %rbx, %rdi
movl %eax, %esi
movq %r13, %rdx
movl $0xfffffffe, %ecx       # imm = 0xFFFFFFFE
callq 0x285198
movl %r12d, (%r15,%r14,4)
movslq 0x90(%rbx), %rax
testq %rax, %rax
jle 0x2f29ce
movq 0x88(%rbx), %rcx
leaq (%rax,%rax,2), %rax
movw $0x80, -0x16(%rcx,%rax,8)
incq %r14
cmpq %r14, %rbp
jne 0x2f292c
movq %rbx, %rdi
movl $0x45, %esi
movq 0x80(%rsp), %rdx
movl 0x44(%rsp), %ecx
xorl %r8d, %r8d
callq 0x2b200c
movq %rbx, %rdi
movl $0xb, %esi
xorl %edx, %edx
movl 0x38(%rsp), %ecx
xorl %r8d, %r8d
callq 0x2b200c
movl 0x90(%rbx), %eax
movq (%rbx), %rcx
cmpb $0x0, 0x61(%rcx)
leaq 0x1d7468(%rip), %r13    # 0x4c9e88
movq %r13, %rcx
jne 0x2f2a44
movl 0x1c(%rsp), %ecx
testl %ecx, %ecx
cmovlel %eax, %ecx
movq 0x88(%rbx), %rdx
movslq %ecx, %rcx
leaq (%rcx,%rcx,2), %rcx
leaq (%rdx,%rcx,8), %rcx
addq $-0x18, %rcx
movl %eax, 0x8(%rcx)
xorl %r14d, %r14d
movl 0x3c(%rsp), %r12d
movl 0x90(%rbx), %eax
movq (%rbx), %rcx
cmpb $0x0, 0x61(%rcx)
movq %r13, %rcx
jne 0x2f2a7f
movl (%r15,%r14,4), %ecx
leal -0x1(%rax), %edx
testl %ecx, %ecx
cmovnsl %ecx, %edx
movslq %edx, %rcx
leaq (%rcx,%rcx,2), %rcx
shlq $0x3, %rcx
addq 0x88(%rbx), %rcx
movl %eax, 0x8(%rcx)
movq 0xa0(%rsp), %rax
leal (%rax,%r14), %r8d
movq %rbx, %rdi
movl $0x59, %esi
movl 0x14(%rsp), %edx
movl %r14d, %ecx
callq 0x2b200c
incq %r14
cmpq %r14, %rbp
jne 0x2f2a4f
movq %rbx, %rdi
movl 0x38(%rsp), %esi
callq 0x2c91a7
movq 0x58(%rsp), %rdi
movq %r15, %rsi
callq 0x28c3e7
movq 0x28(%rsp), %r14
movq 0x78(%rsp), %rbp
testq %r15, %r15
movq 0x58(%rsp), %r15
jne 0x2f2af7
movq 0x98(%rsp), %r15
movq 0x20(%rsp), %r8
movl 0x6c(%rsp), %esi
movq 0x48(%rsp), %rdx
jmp 0x2f2d66
movl 0x3c(%rsp), %r12d
movq %rbp, %r13
movl $0x0, (%rsp)
movq %r14, %rdi
movl $0x1, %esi
movl 0x40(%rsp), %edx
movl 0x18(%rsp), %ebp
movl %ebp, %ecx
movl $0x2, %r8d
leaq 0x1d04c8(%rip), %r9     # 0x4c2fe8
callq 0x2c85ae
cmpl $0x0, 0x2b0(%r15)
je 0x2f2c11
movq %rbx, %rdi
movl $0x32, %esi
movl %ebp, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x2b200c
movl %eax, 0x78(%rsp)
movq %rbx, %rdi
movl $0x12, %esi
movl %ebp, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x2b200c
movl %eax, %r15d
movq %rbx, %rdi
movl $0x19, %esi
movl 0x14(%rsp), %edx
xorl %ecx, %ecx
movq 0x70(%rsp), %r8
callq 0x2b200c
movl %eax, %r14d
movq (%rbx), %rax
cmpb $0x0, 0x61(%rax)
jne 0x2f2ba1
movq 0x88(%rbx), %rax
movslq %r14d, %rcx
leaq (%rcx,%rcx,2), %rcx
movb $-0x3, 0x1(%rax,%rcx,8)
movl $0x1, 0x10(%rax,%rcx,8)
movl 0x90(%rbx), %eax
movq (%rbx), %rcx
cmpb $0x0, 0x61(%rcx)
leaq 0x1d72d3(%rip), %rcx    # 0x4c9e88
movq %r13, %rbp
jne 0x2f2bd8
leal -0x1(%rax), %ecx
movl 0x78(%rsp), %edx
testl %edx, %edx
cmovnsl %edx, %ecx
movslq %ecx, %rcx
leaq (%rcx,%rcx,2), %rcx
shlq $0x3, %rcx
addq 0x88(%rbx), %rcx
movl %eax, 0x8(%rcx)
movq %rbx, %rdi
movl $0x5, %esi
movl 0x14(%rsp), %edx
movl 0x1c(%rsp), %ecx
xorl %r8d, %r8d
callq 0x2b200c
movl 0x90(%rbx), %eax
movq (%rbx), %rcx
cmpb $0x0, 0x61(%rcx)
je 0x2f2c33
movl %eax, 0x1d7288(%rip)    # 0x4c9e90
leaq 0x1d7279(%rip), %rcx    # 0x4c9e88
jmp 0x2f2c68
movq %rbx, %rdi
movl $0x5, %esi
movl 0x14(%rsp), %edx
movl 0x1c(%rsp), %ecx
xorl %r8d, %r8d
callq 0x2b200c
movq %r13, %rbp
movq 0x50(%rsp), %r13
jmp 0x2f2c75
leal -0x1(%rax), %ecx
testl %r15d, %r15d
cmovsl %ecx, %r15d
movq 0x88(%rbx), %rdx
movslq %r15d, %rsi
leaq (%rsi,%rsi,2), %rsi
movl %eax, 0x8(%rdx,%rsi,8)
testl %r14d, %r14d
cmovsl %ecx, %r14d
movslq %r14d, %rcx
leaq (%rcx,%rcx,2), %rcx
shlq $0x3, %rcx
addq 0x88(%rbx), %rcx
movq 0x28(%rsp), %r14
movq 0x50(%rsp), %r13
movl %eax, 0x8(%rcx)
movl $0x0, (%rsp)
movq %r14, %rdi
xorl %esi, %esi
movl 0x40(%rsp), %edx
movl 0x64(%rsp), %ecx
movl $0x1, %r8d
leaq 0x1d039a(%rip), %r9     # 0x4c3030
callq 0x2c85ae
movq %rbx, %rdi
movl $0x5b, %esi
movl 0x34(%rsp), %edx
movl $0x3, %ecx
movl 0x18(%rsp), %r15d
movl %r15d, %r8d
callq 0x2b200c
movq %rbx, %rdi
movl %eax, %esi
leaq 0xf0069(%rip), %rdx     # 0x3e2d2e
xorl %ecx, %ecx
callq 0x285198
movq %rbx, %rdi
movl $0x78, %esi
movl %r12d, %edx
movl %r13d, %ecx
xorl %r8d, %r8d
callq 0x2b200c
movq %rbx, %rdi
movl $0x79, %esi
movl %r12d, %r14d
movl %r12d, %edx
movl %r15d, %ecx
movl %r13d, %r8d
callq 0x2b200c
movslq 0x90(%rbx), %rax
testq %rax, %rax
jle 0x2f2d19
movq 0x88(%rbx), %rcx
leaq (%rax,%rax,2), %rdx
movw $0x8, -0x16(%rcx,%rdx,8)
movq (%rbx), %rcx
cmpb $0x0, 0x61(%rcx)
leaq 0x1d7161(%rip), %rcx    # 0x4c9e88
movq 0x20(%rsp), %r8
movl 0x6c(%rsp), %esi
movq 0x48(%rsp), %rdx
jne 0x2f2d58
leal -0x1(%rax), %ecx
movl 0x94(%rsp), %edi
testl %edi, %edi
cmovnsl %edi, %ecx
movslq %ecx, %rcx
leaq (%rcx,%rcx,2), %rcx
shlq $0x3, %rcx
addq 0x88(%rbx), %rcx
movl %eax, 0x8(%rcx)
movl %r14d, %r12d
movq 0x98(%rsp), %r15
movq 0x28(%rbp), %rbp
testq %rbp, %rbp
jne 0x2f26db
testb %sil, %sil
setne %al
jmp 0x2f2d82
movb $0x1, %al
movq 0x48(%rsp), %rdx
testq %r15, %r15
jne 0x2f2e84
testb %al, %al
je 0x2f2e84
movq %rbx, %rdi
movl $0x5c, %esi
movl 0x64(%rsp), %ebp
movl %ebp, %ecx
xorl %r8d, %r8d
callq 0x2b200c
movq %rbx, %rdi
movl $0x14, %esi
movl %ebp, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x2b200c
movl %eax, %ebp
movq %rbx, %rdi
movl $0x48, %esi
xorl %edx, %edx
movl 0x68(%rsp), %ecx
xorl %r8d, %r8d
callq 0x2b200c
movq %rbx, %rdi
movl $0x5b, %esi
movl 0x34(%rsp), %edx
movl $0x3, %ecx
movl 0x18(%rsp), %r14d
movl %r14d, %r8d
callq 0x2b200c
leaq 0xeff34(%rip), %rdx     # 0x3e2d2e
movq %rbx, %rdi
movl %eax, %esi
xorl %ecx, %ecx
callq 0x285198
movq %rbx, %rdi
movl $0x78, %esi
movl %r12d, %edx
movq 0x50(%rsp), %r15
movl %r15d, %ecx
xorl %r8d, %r8d
callq 0x2b200c
movq %rbx, %rdi
movl $0x79, %esi
movl %r12d, %edx
movl %r14d, %ecx
movl %r15d, %r8d
callq 0x2b200c
movslq 0x90(%rbx), %rax
testq %rax, %rax
jle 0x2f2e55
movq 0x88(%rbx), %rcx
leaq (%rax,%rax,2), %rdx
movw $0x8, -0x16(%rcx,%rdx,8)
movq (%rbx), %rcx
cmpb $0x0, 0x61(%rcx)
je 0x2f2e67
leaq 0x1d7023(%rip), %rcx    # 0x4c9e88
jmp 0x2f2e81
leal -0x1(%rax), %ecx
testl %ebp, %ebp
cmovnsl %ebp, %ecx
movslq %ecx, %rcx
leaq (%rcx,%rcx,2), %rcx
shlq $0x3, %rcx
addq 0x88(%rbx), %rcx
movl %eax, 0x8(%rcx)
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq