// File: /workspace/github_c_makefile_star2_O1/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: xferOptimization
static int xferOptimization(
  Parse *pParse,        /* Parser context */
  Table *pDest,         /* The table we are inserting into */
  Select *pSelect,      /* A SELECT statement to use as the data source */
  int onError,          /* How to handle constraint errors */
  int iDbDest           /* The database of pDest */
){
  sqlite3 *db = pParse->db;
  ExprList *pEList;                /* The result set of the SELECT */
  Table *pSrc;                     /* The table in the FROM clause of SELECT */
  Index *pSrcIdx, *pDestIdx;       /* Source and destination indices */
  struct SrcList_item *pItem;      /* An element of pSelect->pSrc */
  int i;                           /* Loop counter */
  int iDbSrc;                      /* The database of pSrc */
  int iSrc, iDest;                 /* Cursors from source and destination */
  int addr1, addr2;                /* Loop addresses */
  int emptyDestTest = 0;           /* Address of test for empty pDest */
  int emptySrcTest = 0;            /* Address of test for empty pSrc */
  Vdbe *v;                         /* The VDBE we are building */
  int regAutoinc;                  /* Memory register used by AUTOINC */
  int destHasUniqueIdx = 0;        /* True if pDest has a UNIQUE index */
  int regData, regRowid;           /* Registers holding data and rowid */

  if( pSelect==0 ){
    return 0;   /* Must be of the form  INSERT INTO ... SELECT ... */
  }
  if( pParse->pWith || pSelect->pWith ){
    /* Do not attempt to process this query if there are an WITH clauses
    ** attached to it. Proceeding may generate a false "no such table: xxx"
    ** error if pSelect reads from a CTE named "xxx".  */
    return 0;
  }
  if( sqlite3TriggerList(pParse, pDest) ){
    return 0;   /* tab1 must not have triggers */
  }
#ifndef SQLITE_OMIT_VIRTUALTABLE
  if( pDest->tabFlags & TF_Virtual ){
    return 0;   /* tab1 must not be a virtual table */
  }
#endif
  if( onError==OE_Default ){
    if( pDest->iPKey>=0 ) onError = pDest->keyConf;
    if( onError==OE_Default ) onError = OE_Abort;
  }
  assert(pSelect->pSrc);   /* allocated even if there is no FROM clause */
  if( pSelect->pSrc->nSrc!=1 ){
    return 0;   /* FROM clause must have exactly one term */
  }
  if( pSelect->pSrc->a[0].pSelect ){
    return 0;   /* FROM clause cannot contain a subquery */
  }
  if( pSelect->pWhere ){
    return 0;   /* SELECT may not have a WHERE clause */
  }
  if( pSelect->pOrderBy ){
    return 0;   /* SELECT may not have an ORDER BY clause */
  }
  /* Do not need to test for a HAVING clause.  If HAVING is present but
  ** there is no ORDER BY, we will get an error. */
  if( pSelect->pGroupBy ){
    return 0;   /* SELECT may not have a GROUP BY clause */
  }
  if( pSelect->pLimit ){
    return 0;   /* SELECT may not have a LIMIT clause */
  }
  assert( pSelect->pOffset==0 );  /* Must be so if pLimit==0 */
  if( pSelect->pPrior ){
    return 0;   /* SELECT may not be a compound query */
  }
  if( pSelect->selFlags & SF_Distinct ){
    return 0;   /* SELECT may not be DISTINCT */
  }
  pEList = pSelect->pEList;
  assert( pEList!=0 );
  if( pEList->nExpr!=1 ){
    return 0;   /* The result set must have exactly one column */
  }
  assert( pEList->a[0].pExpr );
  if( pEList->a[0].pExpr->op!=TK_ASTERISK ){
    return 0;   /* The result set must be the special operator "*" */
  }

  /* At this point we have established that the statement is of the
  ** correct syntactic form to participate in this optimization.  Now
  ** we have to check the semantics.
  */
  pItem = pSelect->pSrc->a;
  pSrc = sqlite3LocateTableItem(pParse, 0, pItem);
  if( pSrc==0 ){
    return 0;   /* FROM clause does not contain a real table */
  }
  if( pSrc==pDest ){
    return 0;   /* tab1 and tab2 may not be the same table */
  }
  if( HasRowid(pDest)!=HasRowid(pSrc) ){
    return 0;   /* source and destination must both be WITHOUT ROWID or not */
  }
#ifndef SQLITE_OMIT_VIRTUALTABLE
  if( pSrc->tabFlags & TF_Virtual ){
    return 0;   /* tab2 must not be a virtual table */
  }
#endif
  if( pSrc->pSelect ){
    return 0;   /* tab2 may not be a view */
  }
  if( pDest->nCol!=pSrc->nCol ){
    return 0;   /* Number of columns must be the same in tab1 and tab2 */
  }
  if( pDest->iPKey!=pSrc->iPKey ){
    return 0;   /* Both tables must have the same INTEGER PRIMARY KEY */
  }
  for(i=0; i<pDest->nCol; i++){
    Column *pDestCol = &pDest->aCol[i];
    Column *pSrcCol = &pSrc->aCol[i];
#ifdef SQLITE_ENABLE_HIDDEN_COLUMNS
    if( (db->flags & SQLITE_Vacuum)==0 
     && (pDestCol->colFlags | pSrcCol->colFlags) & COLFLAG_HIDDEN 
    ){
      return 0;    /* Neither table may have __hidden__ columns */
    }
#endif
    if( pDestCol->affinity!=pSrcCol->affinity ){
      return 0;    /* Affinity must be the same on all columns */
    }
    if( sqlite3_stricmp(pDestCol->zColl, pSrcCol->zColl)!=0 ){
      return 0;    /* Collating sequence must be the same on all columns */
    }
    if( pDestCol->notNull && !pSrcCol->notNull ){
      return 0;    /* tab2 must be NOT NULL if tab1 is */
    }
    /* Default values for second and subsequent columns need to match. */
    if( i>0
     && ((pDestCol->zDflt==0)!=(pSrcCol->zDflt==0) 
         || (pDestCol->zDflt && strcmp(pDestCol->zDflt, pSrcCol->zDflt)!=0))
    ){
      return 0;    /* Default values must be the same for all columns */
    }
  }
  for(pDestIdx=pDest->pIndex; pDestIdx; pDestIdx=pDestIdx->pNext){
    if( IsUniqueIndex(pDestIdx) ){
      destHasUniqueIdx = 1;
    }
    for(pSrcIdx=pSrc->pIndex; pSrcIdx; pSrcIdx=pSrcIdx->pNext){
      if( xferCompatibleIndex(pDestIdx, pSrcIdx) ) break;
    }
    if( pSrcIdx==0 ){
      return 0;    /* pDestIdx has no corresponding index in pSrc */
    }
  }
#ifndef SQLITE_OMIT_CHECK
  if( pDest->pCheck && sqlite3ExprListCompare(pSrc->pCheck,pDest->pCheck,-1) ){
    return 0;   /* Tables have different CHECK constraints.  Ticket #2252 */
  }
#endif
#ifndef SQLITE_OMIT_FOREIGN_KEY
  /* Disallow the transfer optimization if the destination table constains
  ** any foreign key constraints.  This is more restrictive than necessary.
  ** But the main beneficiary of the transfer optimization is the VACUUM 
  ** command, and the VACUUM command disables foreign key constraints.  So
  ** the extra complication to make this rule less restrictive is probably
  ** not worth the effort.  Ticket [6284df89debdfa61db8073e062908af0c9b6118e]
  */
  if( (db->flags & SQLITE_ForeignKeys)!=0 && pDest->pFKey!=0 ){
    return 0;
  }
#endif
  if( (db->flags & SQLITE_CountRows)!=0 ){
    return 0;  /* xfer opt does not play well with PRAGMA count_changes */
  }

  /* If we get this far, it means that the xfer optimization is at
  ** least a possibility, though it might only work if the destination
  ** table (tab1) is initially empty.
  */
#ifdef SQLITE_TEST
  sqlite3_xferopt_count++;
#endif
  iDbSrc = sqlite3SchemaToIndex(db, pSrc->pSchema);
  v = sqlite3GetVdbe(pParse);
  sqlite3CodeVerifySchema(pParse, iDbSrc);
  iSrc = pParse->nTab++;
  iDest = pParse->nTab++;
  regAutoinc = autoIncBegin(pParse, iDbDest, pDest);
  regData = sqlite3GetTempReg(pParse);
  regRowid = sqlite3GetTempReg(pParse);
  sqlite3OpenTable(pParse, iDest, iDbDest, pDest, OP_OpenWrite);
  assert( HasRowid(pDest) || destHasUniqueIdx );
  if( (db->flags & SQLITE_Vacuum)==0 && (
      (pDest->iPKey<0 && pDest->pIndex!=0)          /* (1) */
   || destHasUniqueIdx                              /* (2) */
   || (onError!=OE_Abort && onError!=OE_Rollback)   /* (3) */
  )){
    /* In some circumstances, we are able to run the xfer optimization
    ** only if the destination table is initially empty. Unless the
    ** SQLITE_Vacuum flag is set, this block generates code to make
    ** that determination. If SQLITE_Vacuum is set, then the destination
    ** table is always empty.
    **
    ** Conditions under which the destination must be empty:
    **
    ** (1) There is no INTEGER PRIMARY KEY but there are indices.
    **     (If the destination is not initially empty, the rowid fields
    **     of index entries might need to change.)
    **
    ** (2) The destination has a unique index.  (The xfer optimization 
    **     is unable to test uniqueness.)
    **
    ** (3) onError is something other than OE_Abort and OE_Rollback.
    */
    addr1 = sqlite3VdbeAddOp2(v, OP_Rewind, iDest, 0); VdbeCoverage(v);
    emptyDestTest = sqlite3VdbeAddOp0(v, OP_Goto);
    sqlite3VdbeJumpHere(v, addr1);
  }
  if( HasRowid(pSrc) ){
    sqlite3OpenTable(pParse, iSrc, iDbSrc, pSrc, OP_OpenRead);
    emptySrcTest = sqlite3VdbeAddOp2(v, OP_Rewind, iSrc, 0); VdbeCoverage(v);
    if( pDest->iPKey>=0 ){
      addr1 = sqlite3VdbeAddOp2(v, OP_Rowid, iSrc, regRowid);
      addr2 = sqlite3VdbeAddOp3(v, OP_NotExists, iDest, 0, regRowid);
      VdbeCoverage(v);
      sqlite3RowidConstraint(pParse, onError, pDest);
      sqlite3VdbeJumpHere(v, addr2);
      autoIncStep(pParse, regAutoinc, regRowid);
    }else if( pDest->pIndex==0 ){
      addr1 = sqlite3VdbeAddOp2(v, OP_NewRowid, iDest, regRowid);
    }else{
      addr1 = sqlite3VdbeAddOp2(v, OP_Rowid, iSrc, regRowid);
      assert( (pDest->tabFlags & TF_Autoincrement)==0 );
    }
    sqlite3VdbeAddOp2(v, OP_RowData, iSrc, regData);
    sqlite3VdbeAddOp3(v, OP_Insert, iDest, regData, regRowid);
    sqlite3VdbeChangeP5(v, OPFLAG_NCHANGE|OPFLAG_LASTROWID|OPFLAG_APPEND);
    sqlite3VdbeChangeP4(v, -1, pDest->zName, 0);
    sqlite3VdbeAddOp2(v, OP_Next, iSrc, addr1); VdbeCoverage(v);
    sqlite3VdbeAddOp2(v, OP_Close, iSrc, 0);
    sqlite3VdbeAddOp2(v, OP_Close, iDest, 0);
  }else{
    sqlite3TableLock(pParse, iDbDest, pDest->tnum, 1, pDest->zName);
    sqlite3TableLock(pParse, iDbSrc, pSrc->tnum, 0, pSrc->zName);
  }
  for(pDestIdx=pDest->pIndex; pDestIdx; pDestIdx=pDestIdx->pNext){
    u8 idxInsFlags = 0;
    for(pSrcIdx=pSrc->pIndex; ALWAYS(pSrcIdx); pSrcIdx=pSrcIdx->pNext){
      if( xferCompatibleIndex(pDestIdx, pSrcIdx) ) break;
    }
    assert( pSrcIdx );
    sqlite3VdbeAddOp3(v, OP_OpenRead, iSrc, pSrcIdx->tnum, iDbSrc);
    sqlite3VdbeSetP4KeyInfo(pParse, pSrcIdx);
    VdbeComment((v, "%s", pSrcIdx->zName));
    sqlite3VdbeAddOp3(v, OP_OpenWrite, iDest, pDestIdx->tnum, iDbDest);
    sqlite3VdbeSetP4KeyInfo(pParse, pDestIdx);
    sqlite3VdbeChangeP5(v, OPFLAG_BULKCSR);
    VdbeComment((v, "%s", pDestIdx->zName));
    addr1 = sqlite3VdbeAddOp2(v, OP_Rewind, iSrc, 0); VdbeCoverage(v);
    sqlite3VdbeAddOp2(v, OP_RowKey, iSrc, regData);
    if( db->flags & SQLITE_Vacuum ){
      /* This INSERT command is part of a VACUUM operation, which guarantees
      ** that the destination table is empty. If all indexed columns use
      ** collation sequence BINARY, then it can also be assumed that the
      ** index will be populated by inserting keys in strictly sorted 
      ** order. In this case, instead of seeking within the b-tree as part
      ** of every OP_IdxInsert opcode, an OP_Last is added before the
      ** OP_IdxInsert to seek to the point within the b-tree where each key 
      ** should be inserted. This is faster.
      **
      ** If any of the indexed columns use a collation sequence other than
      ** BINARY, this optimization is disabled. This is because the user 
      ** might change the definition of a collation sequence and then run
      ** a VACUUM command. In that case keys may not be written in strictly
      ** sorted order.  */
      for(i=0; i<pSrcIdx->nColumn; i++){
        const char *zColl = pSrcIdx->azColl[i];
        assert( sqlite3_stricmp(sqlite3StrBINARY, zColl)!=0
                    || sqlite3StrBINARY==zColl );
        if( sqlite3_stricmp(sqlite3StrBINARY, zColl) ) break;
      }
      if( i==pSrcIdx->nColumn ){
        idxInsFlags = OPFLAG_USESEEKRESULT;
        sqlite3VdbeAddOp3(v, OP_Last, iDest, 0, -1);
      }
    }
    if( !HasRowid(pSrc) && pDestIdx->idxType==2 ){
      idxInsFlags |= OPFLAG_NCHANGE;
    }
    sqlite3VdbeAddOp3(v, OP_IdxInsert, iDest, regData, 1);
    sqlite3VdbeChangeP5(v, idxInsFlags);
    sqlite3VdbeAddOp2(v, OP_Next, iSrc, addr1+1); VdbeCoverage(v);
    sqlite3VdbeJumpHere(v, addr1);
    sqlite3VdbeAddOp2(v, OP_Close, iSrc, 0);
    sqlite3VdbeAddOp2(v, OP_Close, iDest, 0);
  }
  if( emptySrcTest ) sqlite3VdbeJumpHere(v, emptySrcTest);
  sqlite3ReleaseTempReg(pParse, regRowid);
  sqlite3ReleaseTempReg(pParse, regData);
  if( emptyDestTest ){
    sqlite3VdbeAddOp2(v, OP_Halt, SQLITE_OK, 0);
    sqlite3VdbeJumpHere(v, emptyDestTest);
    sqlite3VdbeAddOp2(v, OP_Close, iDest, 0);
    return 0;
  }else{
    return 1;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
xorl %r15d, %r15d
testq %rdx, %rdx
je 0x6f5a1
cmpq $0x0, 0x280(%rdi)
jne 0x6f5a1
movq %rdx, %r14
cmpq $0x0, 0x70(%rdx)
jne 0x6f5a1
movq %rcx, -0x50(%rbp)
movl %r8d, -0x6c(%rbp)
movq (%rdi), %r13
movq %rdi, %r12
movq %rsi, %rbx
callq 0x5c086
testq %rax, %rax
jne 0x6f5a1
movq %r12, -0x40(%rbp)
movq %r13, -0x88(%rbp)
testb $0x10, 0x46(%rbx)
jne 0x6f5a1
movq -0x50(%rbp), %r12
cmpl $0xa, %r12d
jne 0x6f34e
cmpw $0x0, 0x3c(%rbx)
js 0x6f33c
movzbl 0x47(%rbx), %eax
jmp 0x6f341
movl $0xa, %eax
cmpl $0xa, %eax
movl $0x2, %r12d
cmovnel %eax, %r12d
movq 0x28(%r14), %rdx
cmpl $0x1, (%rdx)
jne 0x6f5a1
cmpq $0x0, 0x30(%rdx)
jne 0x6f5a1
cmpq $0x0, 0x30(%r14)
jne 0x6f5a1
cmpq $0x0, 0x48(%r14)
jne 0x6f5a1
cmpq $0x0, 0x38(%r14)
jne 0x6f5a1
cmpq $0x0, 0x60(%r14)
jne 0x6f5a1
cmpq $0x0, 0x50(%r14)
jne 0x6f5a1
testb $0x1, 0xa(%r14)
jne 0x6f5a1
movq (%r14), %rax
cmpl $0x1, (%rax)
jne 0x6f5a1
movq 0x8(%rax), %rax
movq (%rax), %rax
cmpb $-0x62, (%rax)
jne 0x6f5a1
movq %rbx, %r13
addq $0x8, %rdx
xorl %r15d, %r15d
movq -0x40(%rbp), %rdi
xorl %esi, %esi
callq 0x5a1ca
testq %rax, %rax
sete %dl
movq %rax, -0x50(%rbp)
cmpq %rbx, %rax
sete %cl
orb %dl, %cl
jne 0x6f5a1
testb $0x20, 0x46(%r13)
sete %al
movq -0x50(%rbp), %rcx
movzbl 0x46(%rcx), %ecx
testb $0x10, %cl
jne 0x6f5a1
andl $0x20, %ecx
shrl $0x5, %ecx
xorb %cl, %al
je 0x6f5a1
movq -0x50(%rbp), %rax
cmpq $0x0, 0x18(%rax)
jne 0x6f5a1
movzwl 0x3e(%r13), %eax
movq -0x50(%rbp), %rcx
cmpw 0x3e(%rcx), %ax
jne 0x6f5a1
movzwl 0x3c(%r13), %ecx
movq -0x50(%rbp), %rdx
cmpw 0x3c(%rdx), %cx
jne 0x6f5a1
testw %ax, %ax
jle 0x6f505
movq 0x8(%r13), %rbx
movq -0x50(%rbp), %rcx
movq 0x8(%rcx), %rcx
movq %rcx, -0x30(%rbp)
shll $0x4, %eax
leaq (%rax,%rax,2), %rax
movq %rax, -0x60(%rbp)
xorl %r15d, %r15d
xorl %r14d, %r14d
movb 0x29(%rbx,%r14), %al
movq -0x30(%rbp), %rcx
cmpb 0x29(%rcx,%r14), %al
jne 0x6f5a1
movq 0x20(%rbx,%r14), %rdi
movq -0x30(%rbp), %rax
movq 0x20(%rax,%r14), %rsi
callq 0xa3f0
testl %eax, %eax
jne 0x6f5a1
cmpb $0x0, 0x28(%rbx,%r14)
je 0x6f4be
movq -0x30(%rbp), %rax
cmpb $0x0, 0x28(%rax,%r14)
je 0x6f5a1
testq %r14, %r14
je 0x6f4f7
movq 0x10(%rbx,%r14), %rdi
testq %rdi, %rdi
sete %al
movq -0x30(%rbp), %rcx
movq 0x10(%rcx,%r14), %rsi
testq %rsi, %rsi
setne %cl
cmpb %cl, %al
je 0x6f5a1
testq %rdi, %rdi
je 0x6f4f7
callq 0xa2b0
testl %eax, %eax
jne 0x6f5a1
addq $0x30, %r14
cmpq %r14, -0x60(%rbp)
jne 0x6f477
movq 0x10(%r13), %rbx
testq %rbx, %rbx
je 0x6f564
movq -0x50(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x30(%rbp)
testq %rax, %rax
je 0x6f59e
movl $0x0, -0x78(%rbp)
cmpb $0x0, 0x62(%rbx)
movl -0x78(%rbp), %eax
movl $0x1, %ecx
cmovnel %ecx, %eax
movl %eax, -0x78(%rbp)
movq -0x30(%rbp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x6ffb7
testl %eax, %eax
jne 0x6f559
movq 0x28(%r14), %r14
xorl %r15d, %r15d
testq %r14, %r14
jne 0x6f53c
jmp 0x6f5a1
movq 0x28(%rbx), %rbx
testq %rbx, %rbx
jne 0x6f526
jmp 0x6f56b
movl $0x0, -0x78(%rbp)
movq 0x30(%r13), %rsi
testq %rsi, %rsi
je 0x6f58a
movq -0x50(%rbp), %rax
movq 0x30(%rax), %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x549e9
testl %eax, %eax
jne 0x6f59e
movq -0x88(%rbp), %rax
movl 0x2c(%rax), %eax
btl $0x13, %eax
jb 0x6f5b3
testb %al, %al
jns 0x6f5c1
xorl %r15d, %r15d
movl %r15d, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %r15d, %r15d
testb %al, %al
js 0x6f5a1
cmpq $0x0, 0x20(%r13)
jne 0x6f5a1
movq -0x50(%rbp), %rax
movq 0x68(%rax), %rax
testq %rax, %rax
je 0x6f612
movq -0x88(%rbp), %rcx
movl 0x28(%rcx), %ecx
testl %ecx, %ecx
jle 0x6f61d
movq -0x88(%rbp), %rdx
movq 0x20(%rdx), %rdx
addq $0x18, %rdx
movq $0x0, -0x68(%rbp)
cmpq %rax, (%rdx)
je 0x6f625
movq -0x68(%rbp), %rdi
incq %rdi
addq $0x20, %rdx
movq %rdi, -0x68(%rbp)
cmpq %rdi, %rcx
jne 0x6f5f3
movq %rcx, -0x68(%rbp)
jmp 0x6f625
movl $0xfff0bdc0, %eax       # imm = 0xFFF0BDC0
movq %rax, -0x68(%rbp)
jmp 0x6f625
movq $0x0, -0x68(%rbp)
movq -0x40(%rbp), %rbx
movq %rbx, %rdi
callq 0x507bf
movq %rax, -0x30(%rbp)
movq %rbx, %rdi
movq -0x68(%rbp), %rsi
callq 0x55b4e
movl 0x50(%rbx), %eax
movq %rax, -0x60(%rbp)
addl $0x2, %eax
movl %eax, 0x50(%rbx)
movq %rbx, %rdi
movl -0x6c(%rbp), %esi
movq %r13, %rdx
callq 0x6fd59
movl %eax, -0x8c(%rbp)
movb 0x1f(%rbx), %al
testb %al, %al
je 0x6f67e
decb %al
movq -0x40(%rbp), %rcx
movb %al, 0x1f(%rcx)
movzbl %al, %eax
movl 0x24(%rcx,%rax,4), %eax
movl %eax, -0x54(%rbp)
jmp 0x6f68d
movq -0x40(%rbp), %rax
movl 0x54(%rax), %ecx
incl %ecx
movl %ecx, -0x54(%rbp)
movl %ecx, 0x54(%rax)
movq -0x60(%rbp), %rax
incl %eax
movl %eax, -0x34(%rbp)
movq -0x40(%rbp), %rax
movb 0x1f(%rax), %al
testb %al, %al
je 0x6f6b6
decb %al
movq -0x40(%rbp), %rcx
movb %al, 0x1f(%rcx)
movzbl %al, %eax
movl 0x24(%rcx,%rax,4), %eax
movl %eax, -0x44(%rbp)
jmp 0x6f6c5
movq -0x40(%rbp), %rax
movl 0x54(%rax), %ecx
incl %ecx
movl %ecx, -0x44(%rbp)
movl %ecx, 0x54(%rax)
movq -0x40(%rbp), %rdi
movl -0x34(%rbp), %esi
movl -0x6c(%rbp), %edx
movq %r13, %rcx
movl $0x38, %r8d
callq 0x50ae2
movl $0x0, -0x80(%rbp)
movq -0x88(%rbp), %rax
testb $0x8, 0x2f(%rax)
jne 0x6f784
cmpw $0x0, 0x3c(%r13)
jns 0x6f704
cmpq $0x0, 0x10(%r13)
jne 0x6f714
cmpl $0x0, -0x78(%rbp)
jne 0x6f714
leal -0x3(%r12), %eax
cmpl $-0x3, %eax
ja 0x6f784
movq -0x30(%rbp), %r15
movq %r15, %rdi
movl $0x6e, %esi
movl -0x34(%rbp), %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x3fa9e
movl %eax, %r14d
movq %r15, %rdi
movl $0xe, %esi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x3fa9e
movl %eax, -0x80(%rbp)
movl 0x3c(%r15), %eax
leal -0x1(%rax), %ecx
movq 0x30(%r15), %rdx
movl %ecx, 0x68(%rdx)
movq (%r15), %rdx
cmpb $0x0, 0x51(%rdx)
je 0x6f767
leaq 0x25d83(%rip), %rcx     # 0x954e8
jmp 0x6f781
testl %r14d, %r14d
cmovnsl %r14d, %ecx
movslq %ecx, %rcx
leaq (%rcx,%rcx,2), %rcx
shlq $0x3, %rcx
movq -0x30(%rbp), %rdx
addq 0x8(%rdx), %rcx
movl %eax, 0x8(%rcx)
movq -0x50(%rbp), %rax
testb $0x20, 0x46(%rax)
jne 0x6f83b
movq -0x40(%rbp), %rdi
movq -0x60(%rbp), %rbx
movl %ebx, %esi
movq -0x68(%rbp), %rdx
movq -0x50(%rbp), %rcx
movl $0x37, %r8d
callq 0x50ae2
movq -0x30(%rbp), %rdi
movl $0x6e, %esi
movl %ebx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x3fa9e
movl %eax, -0x7c(%rbp)
cmpw $0x0, 0x3c(%r13)
js 0x6f87b
movq -0x30(%rbp), %rbx
movq %rbx, %rdi
movl $0x69, %esi
movq -0x60(%rbp), %rdx
movl -0x44(%rbp), %r14d
movl %r14d, %ecx
xorl %r8d, %r8d
callq 0x3fa9e
movl %eax, %r15d
movq %rbx, %rdi
movl $0x4a, %esi
movl -0x34(%rbp), %edx
xorl %ecx, %ecx
movl %r14d, %r8d
callq 0x3fa9e
movl %eax, %r14d
movq -0x40(%rbp), %rdi
movl %r12d, %esi
movq %r13, %rdx
callq 0x6f244
movl 0x3c(%rbx), %eax
leal -0x1(%rax), %ecx
movq 0x30(%rbx), %rdx
movl %ecx, 0x68(%rdx)
movq (%rbx), %rdx
cmpb $0x0, 0x51(%rdx)
je 0x6f891
leaq 0x25caf(%rip), %rcx     # 0x954e8
jmp 0x6f8ab
movl 0x38(%r13), %edx
movq (%r13), %r8
movq -0x40(%rbp), %rbx
movq %rbx, %rdi
movl -0x6c(%rbp), %esi
movl $0x1, %ecx
callq 0x50be4
movq -0x50(%rbp), %rax
movl 0x38(%rax), %edx
movq (%rax), %r8
movl $0x0, -0x7c(%rbp)
movq %rbx, %rdi
movq -0x68(%rbp), %rsi
xorl %ecx, %ecx
callq 0x50be4
jmp 0x6f9ab
cmpq $0x0, 0x10(%r13)
je 0x6f8d7
movq -0x30(%rbp), %rdi
movl $0x69, %esi
movq -0x60(%rbp), %rdx
jmp 0x6f8e3
testl %r14d, %r14d
cmovnsl %r14d, %ecx
movslq %ecx, %rcx
leaq (%rcx,%rcx,2), %rcx
shlq $0x3, %rcx
movq -0x30(%rbp), %rdx
addq 0x8(%rdx), %rcx
movl %eax, 0x8(%rcx)
cmpl $0x0, -0x8c(%rbp)
jle 0x6f8f1
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rdi
movl $0x8a, %esi
movl -0x8c(%rbp), %edx
movl -0x44(%rbp), %ecx
xorl %r8d, %r8d
callq 0x3fa9e
jmp 0x6f8f1
movq -0x30(%rbp), %rdi
movl $0x54, %esi
movl -0x34(%rbp), %edx
movl -0x44(%rbp), %ecx
xorl %r8d, %r8d
callq 0x3fa9e
movl %eax, %r15d
movq -0x30(%rbp), %r14
movq %r14, %rdi
movl $0x68, %esi
movq -0x60(%rbp), %rdx
movl -0x54(%rbp), %ebx
movl %ebx, %ecx
xorl %r8d, %r8d
callq 0x3fa9e
movq %r14, %rdi
movl $0x5f, %esi
movl -0x34(%rbp), %edx
movl %ebx, %ecx
movl -0x44(%rbp), %r8d
callq 0x3fa9e
movq (%r14), %rax
cmpb $0x0, 0x51(%rax)
je 0x6f936
leaq 0x25bb4(%rip), %rax     # 0x954e8
jmp 0x6f94e
movq -0x30(%rbp), %rcx
movslq 0x3c(%rcx), %rax
movq 0x8(%rcx), %rcx
leaq (%rax,%rax,2), %rax
leaq (%rcx,%rax,8), %rax
addq $-0x18, %rax
movb $0xb, 0x3(%rax)
movq (%r13), %rdx
movq -0x30(%rbp), %r14
movq %r14, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %ecx, %ecx
callq 0x14ab9
movq %r14, %rdi
movl $0x8, %esi
movq -0x60(%rbp), %rbx
movl %ebx, %edx
movl %r15d, %ecx
xorl %r8d, %r8d
callq 0x3fa9e
movq %r14, %rdi
movl $0x3e, %esi
movl %ebx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x3fa9e
movq %r14, %rdi
movl $0x3e, %esi
movl -0x34(%rbp), %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x3fa9e
movq 0x10(%r13), %r15
testq %r15, %r15
je 0x6fbec
movq -0x50(%rbp), %rax
movq 0x10(%rax), %r12
testq %r12, %r12
je 0x6f9db
movq %r15, %rdi
movq %r12, %rsi
callq 0x6ffb7
testl %eax, %eax
jne 0x6f9db
movq 0x28(%r12), %r12
jmp 0x6f9c0
movl 0x58(%r12), %ecx
movq -0x30(%rbp), %r14
movq %r14, %rdi
movl $0x37, %esi
movq -0x60(%rbp), %rdx
movq -0x68(%rbp), %r8
callq 0x3fa9e
movq -0x40(%rbp), %rbx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x50cc1
movl 0x58(%r15), %ecx
movq %r14, %rdi
movl $0x38, %esi
movl -0x34(%rbp), %edx
movl -0x6c(%rbp), %r8d
callq 0x3fa9e
movq %rbx, %rdi
movq %r15, %rsi
callq 0x50cc1
movq (%r14), %rax
cmpb $0x0, 0x51(%rax)
leaq 0x25aaf(%rip), %rax     # 0x954e8
jne 0x6fa53
movq -0x30(%rbp), %rcx
movslq 0x3c(%rcx), %rax
movq 0x8(%rcx), %rcx
leaq (%rax,%rax,2), %rax
leaq (%rcx,%rax,8), %rax
addq $-0x18, %rax
movb $0x1, 0x3(%rax)
xorl %r14d, %r14d
movq -0x30(%rbp), %r13
movq %r13, %rdi
movl $0x6e, %esi
movq -0x60(%rbp), %rbx
movl %ebx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x3fa9e
movq %rax, -0x78(%rbp)
movq %r13, %rdi
movl $0x67, %esi
movl %ebx, %edx
movl -0x54(%rbp), %ecx
xorl %r8d, %r8d
callq 0x3fa9e
movq -0x88(%rbp), %rax
testb $0x8, 0x2f(%rax)
je 0x6faf6
movzwl 0x60(%r12), %ebx
testl %ebx, %ebx
je 0x6fad0
movq 0x40(%r12), %r12
movl %ebx, %r13d
xorl %r14d, %r14d
movq (%r12,%r14,8), %rsi
leaq 0xaca4(%rip), %rdi      # 0x7a760
callq 0xa3f0
testl %eax, %eax
jne 0x6fad0
incq %r14
cmpq %r14, %r13
jne 0x6fab1
movl %ebx, %r14d
cmpl %ebx, %r14d
jne 0x6faf3
movq -0x30(%rbp), %rdi
movl $0x6b, %esi
movl -0x34(%rbp), %edx
xorl %ecx, %ecx
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
callq 0x3fa9e
movb $0x10, %r14b
jmp 0x6faf6
xorl %r14d, %r14d
movq -0x50(%rbp), %rax
testb $0x20, 0x46(%rax)
je 0x6fb0e
movb 0x63(%r15), %al
andb $0x3, %al
cmpb $0x2, %al
sete %al
orb %al, %r14b
movq -0x30(%rbp), %r12
movq %r12, %rdi
movl $0x70, %esi
movl -0x34(%rbp), %edx
movl -0x54(%rbp), %ecx
movl $0x1, %r8d
callq 0x3fa9e
movq (%r12), %rax
cmpb $0x0, 0x51(%rax)
leaq 0x259ae(%rip), %rax     # 0x954e8
jne 0x6fb54
movq -0x30(%rbp), %rcx
movslq 0x3c(%rcx), %rax
movq 0x8(%rcx), %rcx
leaq (%rax,%rax,2), %rax
leaq (%rcx,%rax,8), %rax
addq $-0x18, %rax
movb %r14b, 0x3(%rax)
movq -0x78(%rbp), %rax
leal 0x1(%rax), %ecx
movq -0x30(%rbp), %r14
movq %r14, %rdi
movl $0x8, %esi
movq -0x60(%rbp), %rdx
xorl %r8d, %r8d
callq 0x3fa9e
movl 0x3c(%r14), %eax
leal -0x1(%rax), %ecx
movq 0x30(%r14), %rdx
movl %ecx, 0x68(%rdx)
movq (%r14), %rdx
cmpb $0x0, 0x51(%rdx)
leaq 0x25955(%rip), %rdx     # 0x954e8
jne 0x6fbb1
movq -0x78(%rbp), %rdx
testl %edx, %edx
cmovnsl %edx, %ecx
movslq %ecx, %rcx
leaq (%rcx,%rcx,2), %rdx
shlq $0x3, %rdx
movq -0x30(%rbp), %rcx
addq 0x8(%rcx), %rdx
movl %eax, 0x8(%rdx)
movq -0x30(%rbp), %r14
movq %r14, %rdi
movl $0x3e, %esi
movq -0x60(%rbp), %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x3fa9e
movq %r14, %rdi
movl $0x3e, %esi
movl -0x34(%rbp), %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x3fa9e
movq 0x28(%r15), %r15
jmp 0x6f9af
cmpl $0x0, -0x7c(%rbp)
je 0x6fc33
movq -0x30(%rbp), %rsi
movl 0x3c(%rsi), %eax
leal -0x1(%rax), %ecx
movq 0x30(%rsi), %rdx
movl %ecx, 0x68(%rdx)
movq (%rsi), %rdx
cmpb $0x0, 0x51(%rdx)
je 0x6fc15
leaq 0x258d5(%rip), %rcx     # 0x954e8
jmp 0x6fc30
movl -0x7c(%rbp), %edx
testl %edx, %edx
cmovnsl %edx, %ecx
movslq %ecx, %rcx
leaq (%rcx,%rcx,2), %rcx
shlq $0x3, %rcx
movq -0x30(%rbp), %rdx
addq 0x8(%rdx), %rcx
movl %eax, 0x8(%rcx)
cmpl $0x0, -0x44(%rbp)
je 0x6fc84
movq -0x40(%rbp), %rax
movzbl 0x1f(%rax), %eax
cmpq $0x7, %rax
ja 0x6fc84
xorl %ecx, %ecx
movq -0x40(%rbp), %rdx
movl -0x44(%rbp), %esi
cmpl %esi, 0x94(%rdx,%rcx)
je 0x6fc78
addq $0x14, %rcx
cmpl $0xc8, %ecx
jne 0x6fc50
leal 0x1(%rax), %ecx
movq -0x40(%rbp), %rdx
movb %cl, 0x1f(%rdx)
movl -0x44(%rbp), %ecx
movl %ecx, 0x24(%rdx,%rax,4)
jmp 0x6fc84
movq -0x40(%rbp), %rax
movb $0x1, 0x8e(%rax,%rcx)
cmpl $0x0, -0x54(%rbp)
je 0x6fcd5
movq -0x40(%rbp), %rax
movzbl 0x1f(%rax), %eax
cmpq $0x7, %rax
ja 0x6fcd5
xorl %ecx, %ecx
movq -0x40(%rbp), %rdx
movl -0x54(%rbp), %esi
cmpl %esi, 0x94(%rdx,%rcx)
je 0x6fcc9
addq $0x14, %rcx
cmpl $0xc8, %ecx
jne 0x6fca1
leal 0x1(%rax), %ecx
movq -0x40(%rbp), %rdx
movb %cl, 0x1f(%rdx)
movl -0x54(%rbp), %ecx
movl %ecx, 0x24(%rdx,%rax,4)
jmp 0x6fcd5
movq -0x40(%rbp), %rax
movb $0x1, 0x8e(%rax,%rcx)
cmpl $0x0, -0x80(%rbp)
je 0x6fd15
xorl %r15d, %r15d
movq -0x30(%rbp), %rbx
movq %rbx, %rdi
movl $0x16, %esi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x3fa9e
movl 0x3c(%rbx), %eax
leal -0x1(%rax), %ecx
movq 0x30(%rbx), %rdx
movl %ecx, 0x68(%rdx)
movq (%rbx), %rdx
cmpb $0x0, 0x51(%rdx)
je 0x6fd20
leaq 0x257d5(%rip), %rcx     # 0x954e8
jmp 0x6fd3b
movl $0x1, %r15d
jmp 0x6f5a1
movl -0x80(%rbp), %edx
testl %edx, %edx
cmovnsl %edx, %ecx
movslq %ecx, %rcx
leaq (%rcx,%rcx,2), %rcx
shlq $0x3, %rcx
movq -0x30(%rbp), %rdx
addq 0x8(%rdx), %rcx
movl %eax, 0x8(%rcx)
movq -0x30(%rbp), %rdi
movl $0x3e, %esi
movl -0x34(%rbp), %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x3fa9e
jmp 0x6f5a1