// File: /workspace/github_c_makefile_star2_O3/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 0x6e011
movq %rdi, %r12
cmpq $0x0, 0x280(%rdi)
jne 0x6e011
movq %rdx, %r14
cmpq $0x0, 0x70(%rdx)
jne 0x6e011
movq %rsi, %rbx
movq %rcx, -0x50(%rbp)
movl %r8d, -0x74(%rbp)
movq (%r12), %r13
movq 0x20(%r13), %rax
movq 0x38(%rax), %rdi
movzbl 0x1e2(%r12), %esi
movq %rbx, %rdx
callq 0x5abd6
testq %rax, %rax
jne 0x6e011
movq %r12, -0x40(%rbp)
movq %r13, -0x88(%rbp)
testb $0x10, 0x46(%rbx)
jne 0x6e011
movq -0x50(%rbp), %r12
cmpl $0xa, %r12d
jne 0x6ddbe
cmpw $0x0, 0x3c(%rbx)
js 0x6ddb2
movb 0x47(%rbx), %al
cmpb $0xa, %al
jne 0x6ddba
movl $0x2, %r12d
jmp 0x6ddbe
movzbl %al, %r12d
movq 0x28(%r14), %rdx
cmpl $0x1, (%rdx)
jne 0x6e011
cmpq $0x0, 0x30(%rdx)
jne 0x6e011
cmpq $0x0, 0x30(%r14)
jne 0x6e011
cmpq $0x0, 0x48(%r14)
jne 0x6e011
cmpq $0x0, 0x38(%r14)
jne 0x6e011
cmpq $0x0, 0x60(%r14)
jne 0x6e011
cmpq $0x0, 0x50(%r14)
jne 0x6e011
testb $0x1, 0xa(%r14)
jne 0x6e011
movq (%r14), %rax
cmpl $0x1, (%rax)
jne 0x6e011
movq 0x8(%rax), %rax
movq (%rax), %rax
cmpb $-0x62, (%rax)
jne 0x6e011
movq %rbx, %r13
addq $0x8, %rdx
xorl %r15d, %r15d
movq -0x40(%rbp), %rdi
xorl %esi, %esi
callq 0x58d7f
testq %rax, %rax
sete %dl
movq %rax, -0x50(%rbp)
cmpq %rbx, %rax
sete %cl
orb %dl, %cl
jne 0x6e011
testb $0x20, 0x46(%r13)
sete %al
movq -0x50(%rbp), %rcx
movzbl 0x46(%rcx), %ecx
testb $0x10, %cl
jne 0x6e011
andl $0x20, %ecx
shrl $0x5, %ecx
xorb %cl, %al
je 0x6e011
movq -0x50(%rbp), %rax
cmpq $0x0, 0x18(%rax)
jne 0x6e011
movzwl 0x3e(%r13), %eax
movq -0x50(%rbp), %rcx
cmpw 0x3e(%rcx), %ax
jne 0x6e011
movzwl 0x3c(%r13), %ecx
movq -0x50(%rbp), %rdx
cmpw 0x3c(%rdx), %cx
jne 0x6e011
testw %ax, %ax
jle 0x6df75
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, -0x68(%rbp)
xorl %r15d, %r15d
xorl %r14d, %r14d
movb 0x29(%rbx,%r14), %al
movq -0x30(%rbp), %rcx
cmpb 0x29(%rcx,%r14), %al
jne 0x6e011
movq 0x20(%rbx,%r14), %rdi
movq -0x30(%rbp), %rax
movq 0x20(%rax,%r14), %rsi
callq 0xa400
testl %eax, %eax
jne 0x6e011
cmpb $0x0, 0x28(%rbx,%r14)
je 0x6df2e
movq -0x30(%rbp), %rax
cmpb $0x0, 0x28(%rax,%r14)
je 0x6e011
testq %r14, %r14
je 0x6df67
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 0x6e011
testq %rdi, %rdi
je 0x6df67
callq 0xa2c0
testl %eax, %eax
jne 0x6e011
addq $0x30, %r14
cmpq %r14, -0x68(%rbp)
jne 0x6dee7
movq 0x10(%r13), %rbx
testq %rbx, %rbx
je 0x6dfd4
movq -0x50(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x30(%rbp)
testq %rax, %rax
je 0x6e00e
movl $0x0, -0x60(%rbp)
cmpb $0x0, 0x62(%rbx)
movl -0x60(%rbp), %eax
movl $0x1, %ecx
cmovnel %ecx, %eax
movl %eax, -0x60(%rbp)
movq -0x30(%rbp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x6ea00
testl %eax, %eax
jne 0x6dfc9
movq 0x28(%r14), %r14
xorl %r15d, %r15d
testq %r14, %r14
jne 0x6dfac
jmp 0x6e011
movq 0x28(%rbx), %rbx
testq %rbx, %rbx
jne 0x6df96
jmp 0x6dfdb
movl $0x0, -0x60(%rbp)
movq 0x30(%r13), %rsi
testq %rsi, %rsi
je 0x6dffa
movq -0x50(%rbp), %rax
movq 0x30(%rax), %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x53807
testl %eax, %eax
jne 0x6e00e
movq -0x88(%rbp), %rax
movl 0x2c(%rax), %eax
btl $0x13, %eax
jb 0x6e023
testb %al, %al
jns 0x6e031
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 0x6e011
cmpq $0x0, 0x20(%r13)
jne 0x6e011
movq -0x50(%rbp), %rax
movq 0x68(%rax), %rax
testq %rax, %rax
je 0x6e082
movq -0x88(%rbp), %rcx
movl 0x28(%rcx), %ecx
testl %ecx, %ecx
jle 0x6e08d
movq -0x88(%rbp), %rdx
movq 0x20(%rdx), %rdx
addq $0x18, %rdx
movq $0x0, -0x70(%rbp)
cmpq %rax, (%rdx)
je 0x6e095
movq -0x70(%rbp), %rdi
incq %rdi
addq $0x20, %rdx
movq %rdi, -0x70(%rbp)
cmpq %rdi, %rcx
jne 0x6e063
movq %rcx, -0x70(%rbp)
jmp 0x6e095
movl $0xfff0bdc0, %eax       # imm = 0xFFF0BDC0
movq %rax, -0x70(%rbp)
jmp 0x6e095
movq $0x0, -0x70(%rbp)
movq -0x40(%rbp), %rbx
movq %rbx, %rdi
callq 0x4f63b
movq %rax, -0x30(%rbp)
movq %rbx, %rdi
movq -0x70(%rbp), %rsi
callq 0x548c0
movl 0x50(%rbx), %ecx
leal 0x1(%rcx), %eax
movl %eax, -0x34(%rbp)
movq %rcx, -0x68(%rbp)
leal 0x2(%rcx), %eax
movl %eax, 0x50(%rbx)
movq %rbx, %rdi
movl -0x74(%rbp), %esi
movq %r13, %rdx
callq 0x6e7bf
movl %eax, -0x8c(%rbp)
movb 0x1f(%rbx), %al
testb %al, %al
je 0x6e10c
leal -0x1(%rax), %ecx
movq -0x40(%rbp), %rdx
movb %cl, 0x1f(%rdx)
movzbl %cl, %ecx
movl 0x24(%rdx,%rcx,4), %edx
movl %edx, -0x54(%rbp)
testb %cl, %cl
je 0x6e11b
addb $-0x2, %al
movq -0x40(%rbp), %rcx
movb %al, 0x1f(%rcx)
movzbl %al, %eax
movl 0x24(%rcx,%rax,4), %eax
movl %eax, -0x44(%rbp)
jmp 0x6e12a
movq -0x40(%rbp), %rax
movl 0x54(%rax), %ecx
incl %ecx
movl %ecx, -0x54(%rbp)
movl %ecx, 0x54(%rax)
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 -0x74(%rbp), %edx
movq %r13, %rcx
movl $0x38, %r8d
callq 0x4f965
movl $0x0, -0x7c(%rbp)
movq -0x88(%rbp), %rax
testb $0x8, 0x2f(%rax)
jne 0x6e1e9
cmpw $0x0, 0x3c(%r13)
jns 0x6e169
cmpq $0x0, 0x10(%r13)
jne 0x6e179
cmpl $0x0, -0x60(%rbp)
jne 0x6e179
leal -0x3(%r12), %eax
cmpl $-0x3, %eax
ja 0x6e1e9
movq -0x30(%rbp), %r15
movq %r15, %rdi
movl $0x6e, %esi
movl -0x34(%rbp), %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x3ea9f
movl %eax, %r14d
movq %r15, %rdi
movl $0xe, %esi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x3ea9f
movl %eax, -0x7c(%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 0x6e1cc
leaq 0x2532e(%rip), %rcx     # 0x934f8
jmp 0x6e1e6
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 0x6e29f
movq -0x40(%rbp), %rdi
movq -0x68(%rbp), %rbx
movl %ebx, %esi
movq -0x70(%rbp), %rdx
movq -0x50(%rbp), %rcx
movl $0x37, %r8d
callq 0x4f965
movq -0x30(%rbp), %rdi
movl $0x6e, %esi
movl %ebx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x3ea9f
movl %eax, -0x78(%rbp)
cmpw $0x0, 0x3c(%r13)
js 0x6e2df
movq -0x30(%rbp), %r15
movq %r15, %rdi
movl $0x69, %esi
movq -0x68(%rbp), %rdx
movl -0x44(%rbp), %ebx
movl %ebx, %ecx
xorl %r8d, %r8d
callq 0x3ea9f
movl %eax, -0x60(%rbp)
movq %r15, %rdi
movl $0x4a, %esi
movl -0x34(%rbp), %edx
xorl %ecx, %ecx
movl %ebx, %r8d
callq 0x3ea9f
movl %eax, %r14d
movq -0x40(%rbp), %rdi
movl %r12d, %esi
movq %r13, %rdx
callq 0x6dca1
movl 0x3c(%r15), %eax
leal -0x1(%rax), %ecx
movq 0x30(%r15), %rdx
movl %ecx, 0x68(%rdx)
movq (%r15), %rdx
cmpb $0x0, 0x51(%rdx)
je 0x6e2f5
leaq 0x2525b(%rip), %rcx     # 0x934f8
jmp 0x6e30f
movl 0x38(%r13), %edx
movq (%r13), %r8
movq -0x40(%rbp), %rbx
movq %rbx, %rdi
movl -0x74(%rbp), %esi
movl $0x1, %ecx
callq 0x4fa6d
movq -0x50(%rbp), %rax
movl 0x38(%rax), %edx
movq (%rax), %r8
movl $0x0, -0x78(%rbp)
movq %rbx, %rdi
movq -0x70(%rbp), %rsi
xorl %ecx, %ecx
callq 0x4fa6d
jmp 0x6e40f
cmpq $0x0, 0x10(%r13)
je 0x6e33b
movq -0x30(%rbp), %rdi
movl $0x69, %esi
movq -0x68(%rbp), %rdx
jmp 0x6e347
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 0x6e355
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rdi
movl $0x8a, %esi
movl -0x8c(%rbp), %edx
movl -0x44(%rbp), %ecx
xorl %r8d, %r8d
callq 0x3ea9f
jmp 0x6e355
movq -0x30(%rbp), %rdi
movl $0x54, %esi
movl -0x34(%rbp), %edx
movl -0x44(%rbp), %ecx
xorl %r8d, %r8d
callq 0x3ea9f
movl %eax, -0x60(%rbp)
movq -0x30(%rbp), %r14
movq %r14, %rdi
movl $0x68, %esi
movq -0x68(%rbp), %rdx
movl -0x54(%rbp), %ebx
movl %ebx, %ecx
xorl %r8d, %r8d
callq 0x3ea9f
movq %r14, %rdi
movl $0x5f, %esi
movl -0x34(%rbp), %edx
movl %ebx, %ecx
movl -0x44(%rbp), %r8d
callq 0x3ea9f
movq (%r14), %rax
cmpb $0x0, 0x51(%rax)
je 0x6e39a
leaq 0x25160(%rip), %rax     # 0x934f8
jmp 0x6e3b2
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 0x14b4f
movq %r14, %rdi
movl $0x8, %esi
movq -0x68(%rbp), %rbx
movl %ebx, %edx
movl -0x60(%rbp), %ecx
xorl %r8d, %r8d
callq 0x3ea9f
movq %r14, %rdi
movl $0x3e, %esi
movl %ebx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x3ea9f
movq %r14, %rdi
movl $0x3e, %esi
movl -0x34(%rbp), %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x3ea9f
movq 0x10(%r13), %r15
testq %r15, %r15
je 0x6e652
movq -0x50(%rbp), %rax
movq 0x10(%rax), %r12
testq %r12, %r12
je 0x6e43f
movq %r15, %rdi
movq %r12, %rsi
callq 0x6ea00
testl %eax, %eax
jne 0x6e442
movq 0x28(%r12), %r12
jmp 0x6e424
xorl %r12d, %r12d
movl 0x58(%r12), %ecx
movq -0x30(%rbp), %r14
movq %r14, %rdi
movl $0x37, %esi
movq -0x68(%rbp), %rdx
movq -0x70(%rbp), %r8
callq 0x3ea9f
movq -0x40(%rbp), %rbx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x4fb43
movl 0x58(%r15), %ecx
movq %r14, %rdi
movl $0x38, %esi
movl -0x34(%rbp), %edx
movl -0x74(%rbp), %r8d
callq 0x3ea9f
movq %rbx, %rdi
movq %r15, %rsi
callq 0x4fb43
movq (%r14), %rax
cmpb $0x0, 0x51(%rax)
leaq 0x25058(%rip), %rax     # 0x934f8
jne 0x6e4ba
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 -0x68(%rbp), %rbx
movl %ebx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x3ea9f
movq %rax, -0x60(%rbp)
movq %r13, %rdi
movl $0x67, %esi
movl %ebx, %edx
movl -0x54(%rbp), %ecx
xorl %r8d, %r8d
callq 0x3ea9f
movq -0x88(%rbp), %rax
testb $0x8, 0x2f(%rax)
je 0x6e55c
movzwl 0x60(%r12), %ebx
testl %ebx, %ebx
je 0x6e536
movq 0x40(%r12), %r12
movl %ebx, %r13d
xorl %r14d, %r14d
movq (%r12,%r14,8), %rsi
leaq 0xa28d(%rip), %rdi      # 0x787b0
callq 0xa400
testl %eax, %eax
jne 0x6e536
incq %r14
cmpq %r14, %r13
jne 0x6e518
jmp 0x6e53b
cmpl %ebx, %r14d
jne 0x6e559
movq -0x30(%rbp), %rdi
movl $0x6b, %esi
movl -0x34(%rbp), %edx
xorl %ecx, %ecx
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
callq 0x3ea9f
movb $0x10, %r14b
jmp 0x6e55c
xorl %r14d, %r14d
movq -0x50(%rbp), %rax
testb $0x20, 0x46(%rax)
je 0x6e574
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 0x3ea9f
movq (%r12), %rax
cmpb $0x0, 0x51(%rax)
leaq 0x24f58(%rip), %rax     # 0x934f8
jne 0x6e5ba
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 -0x60(%rbp), %rax
leal 0x1(%rax), %ecx
movq -0x30(%rbp), %r14
movq %r14, %rdi
movl $0x8, %esi
movq -0x68(%rbp), %rdx
xorl %r8d, %r8d
callq 0x3ea9f
movl 0x3c(%r14), %eax
leal -0x1(%rax), %ecx
movq 0x30(%r14), %rdx
movl %ecx, 0x68(%rdx)
movq (%r14), %rdx
cmpb $0x0, 0x51(%rdx)
leaq 0x24eff(%rip), %rdx     # 0x934f8
jne 0x6e617
movq -0x60(%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 -0x68(%rbp), %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x3ea9f
movq %r14, %rdi
movl $0x3e, %esi
movl -0x34(%rbp), %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x3ea9f
movq 0x28(%r15), %r15
jmp 0x6e413
cmpl $0x0, -0x78(%rbp)
je 0x6e699
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 0x6e67b
leaq 0x24e7f(%rip), %rcx     # 0x934f8
jmp 0x6e696
movl -0x78(%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 0x6e6ea
movq -0x40(%rbp), %rax
movzbl 0x1f(%rax), %eax
cmpq $0x7, %rax
ja 0x6e6ea
xorl %ecx, %ecx
movq -0x40(%rbp), %rdx
movl -0x44(%rbp), %esi
cmpl %esi, 0x94(%rdx,%rcx)
je 0x6e6de
addq $0x14, %rcx
cmpl $0xc8, %ecx
jne 0x6e6b6
leal 0x1(%rax), %ecx
movq -0x40(%rbp), %rdx
movb %cl, 0x1f(%rdx)
movl -0x44(%rbp), %ecx
movl %ecx, 0x24(%rdx,%rax,4)
jmp 0x6e6ea
movq -0x40(%rbp), %rax
movb $0x1, 0x8e(%rax,%rcx)
cmpl $0x0, -0x54(%rbp)
je 0x6e73b
movq -0x40(%rbp), %rax
movzbl 0x1f(%rax), %eax
cmpq $0x7, %rax
ja 0x6e73b
xorl %ecx, %ecx
movq -0x40(%rbp), %rdx
movl -0x54(%rbp), %esi
cmpl %esi, 0x94(%rdx,%rcx)
je 0x6e72f
addq $0x14, %rcx
cmpl $0xc8, %ecx
jne 0x6e707
leal 0x1(%rax), %ecx
movq -0x40(%rbp), %rdx
movb %cl, 0x1f(%rdx)
movl -0x54(%rbp), %ecx
movl %ecx, 0x24(%rdx,%rax,4)
jmp 0x6e73b
movq -0x40(%rbp), %rax
movb $0x1, 0x8e(%rax,%rcx)
cmpl $0x0, -0x7c(%rbp)
je 0x6e77b
xorl %r15d, %r15d
movq -0x30(%rbp), %rbx
movq %rbx, %rdi
movl $0x16, %esi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x3ea9f
movl 0x3c(%rbx), %eax
leal -0x1(%rax), %ecx
movq 0x30(%rbx), %rdx
movl %ecx, 0x68(%rdx)
movq (%rbx), %rdx
cmpb $0x0, 0x51(%rdx)
je 0x6e786
leaq 0x24d7f(%rip), %rcx     # 0x934f8
jmp 0x6e7a1
movl $0x1, %r15d
jmp 0x6e011
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)
movq -0x30(%rbp), %rdi
movl $0x3e, %esi
movl -0x34(%rbp), %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x3ea9f
jmp 0x6e011