// File: /workspace/github_c_makefile_star2_O1/skeeto[P]flappy/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 regStat4 = iMem++;       /* Register to hold Stat4Accum object */
  int regChng = iMem++;        /* Index of changed index field */
#ifdef SQLITE_ENABLE_STAT3_OR_STAT4
  int regRowid = iMem++;       /* Rowid argument passed to stat_push() */
#endif
  int regTemp = iMem++;        /* 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) */

  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_strnicmp(pTab->zName, "sqlite_", 7)==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].zName ) ){
    return;
  }
#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);
  sqlite3VdbeAddOp4(v, OP_String8, 0, regTabname, 0, pTab->zName, 0);

  for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){
    int nCol;                     /* Number of columns indexed by pIdx */
    int *aGotoChng;               /* Array of jump instruction addresses */
    int addrRewind;               /* Address of "OP_Rewind iIdxCur" */
    int addrGotoChng0;            /* Address of "Goto addr_chng_0" */
    int addrNextRow;              /* Address of "next_row:" */
    const char *zIdxName;         /* Name of the index */

    if( pOnlyIdx && pOnlyIdx!=pIdx ) continue;
    if( pIdx->pPartIdxWhere==0 ) needTableCnt = 0;
    VdbeNoopComment((v, "Begin analysis of %s", pIdx->zName));
    nCol = pIdx->nKeyCol;
    aGotoChng = sqlite3DbMallocRaw(db, sizeof(int)*(nCol+1));
    if( aGotoChng==0 ) continue;

    /* Populate the register containing the index name. */
    if( pIdx->autoIndex==2 && !HasRowid(pTab) ){
      zIdxName = pTab->zName;
    }else{
      zIdxName = pIdx->zName;
    }
    sqlite3VdbeAddOp4(v, OP_String8, 0, regIdxname, 0, zIdxName, 0);

    /*
    ** 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)
    **  ...
    **
    **  chng_addr_N:
    **   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+nCol);

    /* 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,
    **    (2) the number of rows in the index,
    **
    ** The second argument is only used for STAT3 and STAT4
    */
#ifdef SQLITE_ENABLE_STAT3_OR_STAT4
    sqlite3VdbeAddOp2(v, OP_Count, iIdxCur, regStat4+2);
#endif
    sqlite3VdbeAddOp2(v, OP_Integer, nCol+1, regStat4+1);
    sqlite3VdbeAddOp3(v, OP_Function, 0, regStat4+1, regStat4);
    sqlite3VdbeChangeP4(v, -1, (char*)&statInitFuncdef, P4_FUNCDEF);
    sqlite3VdbeChangeP5(v, 1+IsStat34);

    /* Implementation of the following:
    **
    **   Rewind csr
    **   if eof(csr) goto end_of_scan;
    **   regChng = 0
    **   goto next_push_0;
    **
    */
    addrRewind = sqlite3VdbeAddOp1(v, OP_Rewind, iIdxCur);
    sqlite3VdbeAddOp2(v, OP_Integer, 0, regChng);
    addrGotoChng0 = sqlite3VdbeAddOp0(v, OP_Goto);

    /*
    **  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
    */
    addrNextRow = sqlite3VdbeCurrentAddr(v);
    for(i=0; i<nCol; i++){
      char *pColl = (char*)sqlite3LocateCollSeq(pParse, pIdx->azColl[i]);
      sqlite3VdbeAddOp2(v, OP_Integer, i, regChng);
      sqlite3VdbeAddOp3(v, OP_Column, iIdxCur, i, regTemp);
      aGotoChng[i] = 
      sqlite3VdbeAddOp4(v, OP_Ne, regTemp, 0, regPrev+i, pColl, P4_COLLSEQ);
      sqlite3VdbeChangeP5(v, SQLITE_NULLEQ);
    }
    sqlite3VdbeAddOp2(v, OP_Integer, nCol, regChng);
    aGotoChng[nCol] = sqlite3VdbeAddOp0(v, OP_Goto);

    /*
    **  chng_addr_0:
    **   regPrev(0) = idx(0)
    **  chng_addr_1:
    **   regPrev(1) = idx(1)
    **  ...
    */
    sqlite3VdbeJumpHere(v, addrGotoChng0);
    for(i=0; i<nCol; i++){
      sqlite3VdbeJumpHere(v, aGotoChng[i]);
      sqlite3VdbeAddOp3(v, OP_Column, iIdxCur, i, regPrev+i);
    }

    /*
    **  chng_addr_N:
    **   regRowid = idx(rowid)            // STAT34 only
    **   stat_push(P, regChng, regRowid)  // 3rd parameter STAT34 only
    **   Next csr
    **   if !eof(csr) goto next_row;
    */
    sqlite3VdbeJumpHere(v, aGotoChng[nCol]);
#ifdef SQLITE_ENABLE_STAT3_OR_STAT4
    assert( regRowid==(regStat4+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 = sqlite3ColumnOfIndex(pIdx, pPk->aiColumn[j]);
        sqlite3VdbeAddOp3(v, OP_Column, iIdxCur, k, regKey+j);
        VdbeComment((v, "%s", pTab->aCol[pPk->aiColumn[j]].zName));
      }
      sqlite3VdbeAddOp3(v, OP_MakeRecord, regKey, pPk->nKeyCol, regRowid);
      sqlite3ReleaseTempRange(pParse, regKey, pPk->nKeyCol);
    }
#endif
    assert( regChng==(regStat4+1) );
    sqlite3VdbeAddOp3(v, OP_Function, 1, regStat4, regTemp);
    sqlite3VdbeChangeP4(v, -1, (char*)&statPushFuncdef, P4_FUNCDEF);
    sqlite3VdbeChangeP5(v, 2+IsStat34);
    sqlite3VdbeAddOp2(v, OP_Next, iIdxCur, addrNextRow);

    /* Add the entry to the stat1 table. */
    callStatGet(v, regStat4, STAT_GET_STAT1, regStat1);
    sqlite3VdbeAddOp4(v, OP_MakeRecord, regTabname, 3, regTemp, "aaa", 0);
    sqlite3VdbeAddOp2(v, OP_NewRowid, iStatCur, regNewRowid);
    sqlite3VdbeAddOp3(v, OP_Insert, iStatCur, regTemp, regNewRowid);
    sqlite3VdbeChangeP5(v, OPFLAG_APPEND);

    /* Add the entries to the stat3 or stat4 table. */
#ifdef SQLITE_ENABLE_STAT3_OR_STAT4
    {
      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+1);

      addrNext = sqlite3VdbeCurrentAddr(v);
      callStatGet(v, regStat4, STAT_GET_ROWID, regSampleRowid);
      addrIsNull = sqlite3VdbeAddOp1(v, OP_IsNull, regSampleRowid);
      callStatGet(v, regStat4, STAT_GET_NEQ, regEq);
      callStatGet(v, regStat4, STAT_GET_NLT, regLt);
      callStatGet(v, regStat4, STAT_GET_NDLT, regDLt);
      sqlite3VdbeAddOp4Int(v, seekOp, iTabCur, addrNext, regSampleRowid, 0);
#ifdef SQLITE_ENABLE_STAT3
      sqlite3ExprCodeGetColumnOfTable(v, pTab, iTabCur, 
                                      pIdx->aiColumn[0], regSample);
#else
      for(i=0; i<nCol; i++){
        i16 iCol = pIdx->aiColumn[i];
        sqlite3ExprCodeGetColumnOfTable(v, pTab, iTabCur, iCol, regCol+i);
      }
      sqlite3VdbeAddOp3(v, OP_MakeRecord, regCol, nCol+1, regSample);
#endif
      sqlite3VdbeAddOp4(v, OP_MakeRecord, regTabname, 6, regTemp, "bbbbbb", 0);
      sqlite3VdbeAddOp2(v, OP_NewRowid, iStatCur+1, regNewRowid);
      sqlite3VdbeAddOp3(v, OP_Insert, iStatCur+1, regTemp, regNewRowid);
      sqlite3VdbeAddOp2(v, OP_Goto, 0, addrNext);
      sqlite3VdbeJumpHere(v, addrIsNull);
    }
#endif /* SQLITE_ENABLE_STAT3_OR_STAT4 */

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


  /* 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);
    sqlite3VdbeAddOp2(v, OP_Null, 0, regIdxname);
    sqlite3VdbeAddOp4(v, OP_MakeRecord, regTabname, 3, regTemp, "aaa", 0);
    sqlite3VdbeAddOp2(v, OP_NewRowid, iStatCur, regNewRowid);
    sqlite3VdbeAddOp3(v, OP_Insert, iStatCur, regTemp, regNewRowid);
    sqlite3VdbeChangeP5(v, OPFLAG_APPEND);
    sqlite3VdbeJumpHere(v, jZeroRows);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movl %r9d, %r13d
movl %r8d, %r12d
movl %ecx, %ebp
movq %rdx, 0x40(%rsp)
movq %rsi, %rbx
movq (%rdi), %rax
movq %rax, 0x28(%rsp)
leal 0x7(%r12), %ecx
movl 0x58(%rdi), %eax
cmpl %ecx, %eax
movq %rcx, 0x70(%rsp)
cmovlel %ecx, %eax
movl %eax, 0x58(%rdi)
movq %rdi, 0x48(%rsp)
callq 0x47f6a
movq %rax, %r14
testq %rax, %rax
sete %al
testq %rbx, %rbx
sete %cl
orb %al, %cl
jne 0x661f4
cmpl $0x0, 0x3c(%rbx)
je 0x661f4
leal 0x1(%r12), %eax
movl %eax, 0x24(%rsp)
leal 0x2(%r12), %eax
movl %eax, 0xc(%rsp)
leal 0x3(%r12), %eax
movl %eax, 0x8(%rsp)
leal 0x4(%r12), %eax
movl %eax, 0x20(%rsp)
leal 0x5(%r12), %eax
movl %eax, 0x34(%rsp)
leal 0x6(%r12), %eax
movl %eax, 0x30(%rsp)
movq %rbx, 0x38(%rsp)
movq (%rbx), %rdx
leaq 0x7(%rdx), %r9
movl $0x7, %ecx
leaq 0xbbfa(%rip), %r8       # 0x71d21
xorl %r10d, %r10d
leaq 0x725f(%rip), %rax      # 0x6d390
leaq 0xbbf0(%rip), %rdi      # 0x71d28
movq %r8, %r11
movq %rdx, %rsi
movzbl (%rsi), %ebx
testq %rbx, %rbx
je 0x66168
movb (%rbx,%rax), %bl
movzbl (%r11), %r15d
cmpb (%r15,%rax), %bl
jne 0x66170
incq %rsi
incq %r10
incq %r11
decq %rcx
jne 0x6613e
xorl %ecx, %ecx
movq %r9, %rsi
jmp 0x66173
addq %r10, %r8
movq %r8, %rdi
jmp 0x66173
movq %r11, %rdi
movq 0x38(%rsp), %rbx
testl %ecx, %ecx
jle 0x661f4
movzbl (%rsi), %ecx
movb (%rcx,%rax), %cl
movzbl (%rdi), %esi
cmpb (%rsi,%rax), %cl
je 0x661f4
movq 0x70(%rbx), %rax
testq %rax, %rax
je 0x661c0
movq 0x28(%rsp), %rdi
movl 0x28(%rdi), %ecx
testl %ecx, %ecx
jle 0x661cd
movq 0x20(%rdi), %rsi
addq $0x18, %rsi
xorl %r15d, %r15d
cmpq %rax, (%rsi)
je 0x661d0
incq %r15
addq $0x20, %rsi
cmpq %r15, %rcx
jne 0x661aa
movl %ecx, %r15d
jmp 0x661d0
movl $0xfff0bdc0, %r15d      # imm = 0xFFF0BDC0
movq 0x28(%rsp), %rdi
jmp 0x661d0
xorl %r15d, %r15d
movq 0x20(%rdi), %rax
movslq %r15d, %rcx
shlq $0x5, %rcx
movq (%rax,%rcx), %r8
movq 0x48(%rsp), %rdi
movl $0x1c, %esi
xorl %ecx, %ecx
callq 0x4cb27
testl %eax, %eax
je 0x66206
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl 0x3c(%rbx), %edx
movq (%rbx), %r8
movq %r15, %rsi
movq %r15, 0x60(%rsp)
movq 0x48(%rsp), %r15
movq %r15, %rdi
xorl %ecx, %ecx
callq 0x4814a
leal 0x2(%r13), %eax
movl 0x54(%r15), %ecx
cmpl %eax, %ecx
cmovgl %ecx, %eax
movl %eax, 0x54(%r15)
movq %r15, %rdi
movl %r13d, %esi
movq 0x60(%rsp), %rdx
movq %rbx, %rcx
movl $0x32, %r8d
callq 0x48081
movq %rbx, %r15
movq (%rbx), %rbx
movq %r14, %rdi
movl $0x5f, %esi
xorl %edx, %edx
movl 0x20(%rsp), %ecx
xorl %r8d, %r8d
callq 0x47fb1
movq %r14, %rdi
movl %eax, %esi
movq %rbx, %rdx
xorl %ecx, %ecx
callq 0x11ea3
movq 0x10(%r15), %rbx
testq %rbx, %rbx
je 0x6674b
leal 0x1(%r13), %eax
movl %eax, 0x4(%rsp)
movl 0x70(%rsp), %eax
movq %rax, 0x78(%rsp)
movb $0x1, %r15b
movq 0x40(%rsp), %rdx
movq 0x28(%rsp), %rdi
movq %r12, 0x80(%rsp)
movl %ebp, 0x50(%rsp)
movq %r13, 0x68(%rsp)
testq %rdx, %rdx
setne %al
cmpq %rdx, %rbx
setne %cl
testb %cl, %al
jne 0x66736
cmpq $0x0, 0x48(%rbx)
movzbl %r15b, %r15d
movl $0x0, %eax
cmovel %eax, %r15d
movzwl 0x5e(%rbx), %eax
movq %rax, 0x10(%rsp)
leal 0x4(,%rax,4), %esi
callq 0x11af4
testq %rax, %rax
je 0x66727
movq %rax, %r13
movl %r15d, 0x5c(%rsp)
movb 0x63(%rbx), %al
andb $0x3, %al
cmpb $0x2, %al
jne 0x66314
movq 0x38(%rsp), %rax
testb $0x20, 0x48(%rax)
jne 0x66317
movq %rbx, %rax
movq 0x10(%rsp), %rbp
leal 0x1(%rbp), %ecx
movl %ecx, 0x1c(%rsp)
movq (%rax), %r12
movq %r14, %rdi
movl $0x5f, %esi
xorl %edx, %edx
movl 0x34(%rsp), %ecx
xorl %r8d, %r8d
callq 0x47fb1
movq %r14, %rdi
movl %eax, %esi
movq %r12, %rdx
xorl %ecx, %ecx
callq 0x11ea3
movq 0x48(%rsp), %r15
movl 0x58(%r15), %eax
movq 0x70(%rsp), %rcx
addl %ebp, %ecx
cmpl %ecx, %eax
cmovgl %eax, %ecx
movl %ecx, 0x58(%r15)
movl 0x58(%rbx), %ecx
movq %r14, %rdi
movl $0x32, %esi
movl 0x4(%rsp), %edx
movq 0x60(%rsp), %r8
callq 0x47fb1
movq 0x10(%r15), %r12
movq %r15, %rdi
movq %rbx, %rsi
callq 0x48266
movq %r12, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movq %rax, %rdx
movl $0xfffffffa, %ecx       # imm = 0xFFFFFFFA
callq 0x11ea3
movq %r14, %rdi
movl $0x17, %esi
movl 0x1c(%rsp), %edx
movl 0xc(%rsp), %ebp
movl %ebp, %ecx
xorl %r8d, %r8d
callq 0x47fb1
movq %r14, %rdi
movl $0x1, %esi
xorl %edx, %edx
movl %ebp, %ecx
movl 0x24(%rsp), %r8d
callq 0x47fb1
movq %r14, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
leaq 0x22680(%rip), %rdx     # 0x88a60
movl $0xfffffffb, %ecx       # imm = 0xFFFFFFFB
callq 0x11ea3
movq 0x8(%r14), %rax
testq %rax, %rax
je 0x66400
movslq 0x34(%r14), %rcx
leaq (%rcx,%rcx,2), %rcx
movb $0x1, -0x15(%rax,%rcx,8)
movq %r14, %rdi
movl $0x67, %esi
movl 0x4(%rsp), %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x47fb1
movl %eax, 0x1c(%rsp)
movq %r14, %rdi
movl $0x17, %esi
xorl %edx, %edx
movl 0xc(%rsp), %ecx
xorl %r8d, %r8d
callq 0x47fb1
movq %r14, %rdi
movl $0x10, %esi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x47fb1
movl %eax, 0x54(%rsp)
movl 0x34(%r14), %eax
movl %eax, 0x58(%rsp)
cmpq $0x0, 0x10(%rsp)
je 0x664fd
xorl %ebp, %ebp
movq 0x40(%rbx), %rax
movq (%rax,%rbp,8), %rsi
movq 0x48(%rsp), %rdi
callq 0x483de
movq %rax, %r12
movq %r14, %rdi
movl $0x17, %esi
movl %ebp, %edx
movl 0xc(%rsp), %ecx
xorl %r8d, %r8d
callq 0x47fb1
movq %r14, %rdi
movl $0x2b, %esi
movl 0x4(%rsp), %edx
movl %ebp, %ecx
movl 0x8(%rsp), %r15d
movl %r15d, %r8d
callq 0x47fb1
movq 0x78(%rsp), %rax
leal (%rax,%rbp), %r8d
movq %r14, %rdi
movl $0x4c, %esi
movl %r15d, %edx
xorl %ecx, %ecx
callq 0x47fb1
movl %eax, %r15d
movq %r14, %rdi
movl %eax, %esi
movq %r12, %rdx
movl $0xfffffffc, %ecx       # imm = 0xFFFFFFFC
callq 0x11ea3
movl %r15d, (%r13,%rbp,4)
movq 0x8(%r14), %rax
testq %rax, %rax
je 0x664ef
movslq 0x34(%r14), %rcx
leaq (%rcx,%rcx,2), %rcx
movb $-0x80, -0x15(%rax,%rcx,8)
incq %rbp
cmpq %rbp, 0x10(%rsp)
jne 0x6645e
movq %r14, %rdi
movl $0x17, %esi
movq 0x10(%rsp), %r15
movl %r15d, %edx
movl 0xc(%rsp), %ecx
xorl %r8d, %r8d
callq 0x47fb1
movq %r14, %rdi
movl $0x10, %esi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x47fb1
movl %eax, (%r13,%r15,4)
movl 0x54(%rsp), %edx
testl %edx, %edx
js 0x66550
movl 0x34(%r14), %eax
cmpl %edx, %eax
jbe 0x66550
movq 0x8(%r14), %rcx
movl %edx, %edx
leaq (%rdx,%rdx,2), %rdx
movl %eax, 0x8(%rcx,%rdx,8)
cmpq $0x0, 0x10(%rsp)
movq 0x80(%rsp), %r12
je 0x665a9
movl 0x10(%rsp), %r15d
xorl %ebp, %ebp
movslq (%r13,%rbp,4), %rax
testq %rax, %rax
js 0x66585
movl 0x34(%r14), %ecx
cmpl %eax, %ecx
jbe 0x66585
movq 0x8(%r14), %rdx
leaq (%rax,%rax,2), %rax
movl %ecx, 0x8(%rdx,%rax,8)
movq 0x78(%rsp), %rax
leal (%rax,%rbp), %r8d
movq %r14, %rdi
movl $0x2b, %esi
movl 0x4(%rsp), %edx
movl %ebp, %ecx
callq 0x47fb1
incq %rbp
cmpq %rbp, %r15
jne 0x66567
movq 0x10(%rsp), %rax
movslq (%r13,%rax,4), %rax
testq %rax, %rax
js 0x665cc
movl 0x34(%r14), %ecx
cmpl %eax, %ecx
jbe 0x665cc
movq 0x8(%r14), %rdx
leaq (%rax,%rax,2), %rax
movl %ecx, 0x8(%rdx,%rax,8)
movq %r14, %rdi
movl $0x1, %esi
movl $0x1, %edx
movl 0x24(%rsp), %ecx
movl 0x8(%rsp), %r8d
callq 0x47fb1
movq %r14, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
leaq 0x224b2(%rip), %rdx     # 0x88aa8
movl $0xfffffffb, %ecx       # imm = 0xFFFFFFFB
callq 0x11ea3
movq 0x8(%r14), %rax
testq %rax, %rax
movl 0x50(%rsp), %ebp
je 0x6661a
movslq 0x34(%r14), %rcx
leaq (%rcx,%rcx,2), %rcx
movb $0x2, -0x15(%rax,%rcx,8)
movq %r14, %rdi
movl $0x9, %esi
movl 0x4(%rsp), %edx
movl 0x58(%rsp), %ecx
xorl %r8d, %r8d
callq 0x47fb1
movq %r14, %rdi
movl $0x1, %esi
xorl %edx, %edx
movl 0x24(%rsp), %ecx
movl 0x30(%rsp), %r8d
callq 0x47fb1
movq %r14, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
leaq 0x22497(%rip), %rdx     # 0x88af0
movl $0xfffffffb, %ecx       # imm = 0xFFFFFFFB
callq 0x11ea3
movq 0x8(%r14), %rax
testq %rax, %rax
je 0x66679
movslq 0x34(%r14), %rcx
leaq (%rcx,%rcx,2), %rcx
movb $0x1, -0x15(%rax,%rcx,8)
movq %r14, %rdi
movl $0x2d, %esi
movl 0x20(%rsp), %edx
movl $0x3, %ecx
movl 0x8(%rsp), %r15d
movl %r15d, %r8d
callq 0x47fb1
movq %r14, %rdi
movl %eax, %esi
leaq 0xd0d4(%rip), %rdx      # 0x73777
xorl %ecx, %ecx
callq 0x11ea3
movq %r14, %rdi
movl $0x43, %esi
movl %ebp, %edx
movl %r12d, %ecx
xorl %r8d, %r8d
callq 0x47fb1
movq %r14, %rdi
movl $0x44, %esi
movl %ebp, %edx
movl %r15d, %ecx
movl %r12d, %r8d
callq 0x47fb1
movq 0x8(%r14), %rax
testq %rax, %rax
je 0x666ea
movslq 0x34(%r14), %rcx
leaq (%rcx,%rcx,2), %rcx
movb $0x8, -0x15(%rax,%rcx,8)
movl 0x1c(%rsp), %edx
testl %edx, %edx
movl 0x5c(%rsp), %r15d
js 0x66709
movl 0x34(%r14), %ecx
cmpl %edx, %ecx
jbe 0x66709
movl %edx, %edx
leaq (%rdx,%rdx,2), %rdx
movl %ecx, 0x8(%rax,%rdx,8)
movq 0x28(%rsp), %rdi
movq %r13, %rsi
callq 0x9b58
movq 0x28(%rsp), %rdi
movq 0x68(%rsp), %r13
movq 0x40(%rsp), %rdx
jmp 0x66736
movq 0x68(%rsp), %r13
movq 0x40(%rsp), %rdx
movq 0x28(%rsp), %rdi
movq 0x28(%rbx), %rbx
testq %rbx, %rbx
jne 0x662b4
testb %r15b, %r15b
setne %al
jmp 0x66752
movb $0x1, %al
movq 0x40(%rsp), %rdx
testq %rdx, %rdx
jne 0x661f4
testb %al, %al
je 0x661f4
movq %r14, %rdi
movl $0x2e, %esi
movl %r13d, %edx
movl 0x30(%rsp), %ebx
movl %ebx, %ecx
xorl %r8d, %r8d
callq 0x47fb1
movq %r14, %rdi
movl $0x2a, %esi
movl %ebx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x47fb1
movl %eax, %ebx
movq %r14, %rdi
movl $0x1a, %esi
xorl %edx, %edx
movl 0x34(%rsp), %ecx
xorl %r8d, %r8d
callq 0x47fb1
movq %r14, %rdi
movl $0x2d, %esi
movl 0x20(%rsp), %edx
movl $0x3, %ecx
movl 0x8(%rsp), %r15d
movl %r15d, %r8d
callq 0x47fb1
leaq 0xcfaa(%rip), %rdx      # 0x73777
movq %r14, %rdi
movl %eax, %esi
xorl %ecx, %ecx
callq 0x11ea3
movq %r14, %rdi
movl $0x43, %esi
movl %ebp, %edx
movl %r12d, %ecx
xorl %r8d, %r8d
callq 0x47fb1
movq %r14, %rdi
movl $0x44, %esi
movl %ebp, %edx
movl %r15d, %ecx
movl %r12d, %r8d
callq 0x47fb1
movq 0x8(%r14), %rax
testq %rax, %rax
je 0x66819
movslq 0x34(%r14), %rcx
leaq (%rcx,%rcx,2), %rcx
movb $0x8, -0x15(%rax,%rcx,8)
testl %ebx, %ebx
js 0x661f4
movl 0x34(%r14), %ecx
cmpl %ebx, %ecx
jbe 0x661f4
movl %ebx, %edx
leaq (%rdx,%rdx,2), %rdx
movl %ecx, 0x8(%rax,%rdx,8)
jmp 0x661f4