// File: /workspace/github_c_makefile_star2_O3/skeeto[P]flappy/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 */
){
  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( 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_ALL ){
    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++){
    if( pDest->aCol[i].affinity!=pSrc->aCol[i].affinity ){
      return 0;    /* Affinity must be the same on all columns */
    }
    if( !xferCompatibleCollation(pDest->aCol[i].zColl, pSrc->aCol[i].zColl) ){
      return 0;    /* Collating sequence must be the same on all columns */
    }
    if( pDest->aCol[i].notNull && !pSrc->aCol[i].notNull ){
      return 0;    /* tab2 must be NOT NULL if tab1 is */
    }
  }
  for(pDestIdx=pDest->pIndex; pDestIdx; pDestIdx=pDestIdx->pNext){
    if( pDestIdx->onError!=OE_None ){
      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( (pParse->db->flags & SQLITE_ForeignKeys)!=0 && pDest->pFKey!=0 ){
    return 0;
  }
#endif
  if( (pParse->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(pParse->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( (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.  This code makes
    ** that determination.  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);
    emptyDestTest = sqlite3VdbeAddOp2(v, OP_Goto, 0, 0);
    sqlite3VdbeJumpHere(v, addr1);
  }
  if( HasRowid(pSrc) ){
    sqlite3OpenTable(pParse, iSrc, iDbSrc, pSrc, OP_OpenRead);
    emptySrcTest = sqlite3VdbeAddOp2(v, OP_Rewind, iSrc, 0);
    if( pDest->iPKey>=0 ){
      addr1 = sqlite3VdbeAddOp2(v, OP_Rowid, iSrc, regRowid);
      addr2 = sqlite3VdbeAddOp3(v, OP_NotExists, iDest, 0, regRowid);
      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);
    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){
    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);
    sqlite3VdbeAddOp2(v, OP_RowKey, iSrc, regData);
    sqlite3VdbeAddOp3(v, OP_IdxInsert, iDest, regData, 1);
    sqlite3VdbeAddOp2(v, OP_Next, iSrc, addr1+1);
    sqlite3VdbeJumpHere(v, addr1);
    sqlite3VdbeAddOp2(v, OP_Close, iSrc, 0);
    sqlite3VdbeAddOp2(v, OP_Close, iDest, 0);
  }
  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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
xorl %r12d, %r12d
testq %rdx, %rdx
je 0x64002
movl %r8d, %ebp
movl %ecx, %r13d
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq (%rdi), %rax
movq 0x20(%rax), %rax
movq 0x38(%rax), %rdi
movzbl 0x206(%rbx), %esi
movq %r15, %rdx
callq 0x52fe3
testq %rax, %rax
jne 0x64002
testb $0x10, 0x48(%r15)
jne 0x64002
cmpl $0xa, %r13d
jne 0x63dbb
cmpw $0x0, 0x40(%r15)
js 0x63daf
movb 0x49(%r15), %al
cmpb $0xa, %al
jne 0x63db7
movl $0x2, %r13d
jmp 0x63dbb
movzbl %al, %r13d
movq 0x28(%r14), %rdx
cmpb $0x1, (%rdx)
jne 0x64002
cmpq $0x0, 0x30(%rdx)
jne 0x64002
cmpq $0x0, 0x30(%r14)
jne 0x64002
cmpq $0x0, 0x48(%r14)
jne 0x64002
cmpq $0x0, 0x38(%r14)
jne 0x64002
cmpq $0x0, 0x68(%r14)
jne 0x64002
cmpq $0x0, 0x50(%r14)
jne 0x64002
testb $0x1, 0xa(%r14)
jne 0x64002
movq (%r14), %rax
cmpl $0x1, (%rax)
jne 0x64002
movq 0x8(%rax), %rax
movq (%rax), %rax
cmpb $0x72, (%rax)
jne 0x64002
addq $0x8, %rdx
xorl %r12d, %r12d
movq %rbx, %rdi
xorl %esi, %esi
callq 0x510c0
testq %rax, %rax
sete %dl
movq %rax, 0x28(%rsp)
cmpq %r15, %rax
sete %cl
orb %dl, %cl
jne 0x64002
testb $0x20, 0x48(%r15)
sete %al
movq 0x28(%rsp), %rcx
movzbl 0x48(%rcx), %ecx
testb $0x10, %cl
jne 0x64002
andl $0x20, %ecx
shrl $0x5, %ecx
xorb %cl, %al
je 0x64002
movq 0x28(%rsp), %rax
cmpq $0x0, 0x18(%rax)
jne 0x64002
movzwl 0x42(%r15), %eax
movq 0x28(%rsp), %rcx
cmpw 0x42(%rcx), %ax
jne 0x64002
movzwl 0x40(%r15), %ecx
movq 0x28(%rsp), %rdx
cmpw 0x40(%rdx), %cx
jne 0x64002
testw %ax, %ax
jle 0x63f4d
movq 0x8(%r15), %rcx
movq %rcx, (%rsp)
movq 0x28(%rsp), %rcx
movq 0x8(%rcx), %rcx
movq %rcx, 0x10(%rsp)
shll $0x4, %eax
leaq (%rax,%rax,2), %rax
movq %rax, 0x20(%rsp)
xorl %r12d, %r12d
xorl %r14d, %r14d
movq (%rsp), %rax
movb 0x29(%rax,%r14), %al
movq 0x10(%rsp), %rcx
cmpb 0x29(%rcx,%r14), %al
jne 0x64002
movq (%rsp), %rax
movq 0x20(%rax,%r14), %rdi
movq 0x10(%rsp), %rax
movq 0x20(%rax,%r14), %rsi
callq 0x648f2
testl %eax, %eax
je 0x64002
movq (%rsp), %rax
cmpb $0x0, 0x28(%rax,%r14)
je 0x63f42
movq 0x10(%rsp), %rax
cmpb $0x0, 0x28(%rax,%r14)
je 0x64002
addq $0x30, %r14
cmpq %r14, 0x20(%rsp)
jne 0x63eec
movq 0x10(%r15), %rax
movq %rax, (%rsp)
testq %rax, %rax
je 0x63fc7
movq 0x28(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
testq %rax, %rax
je 0x63fff
movl $0x0, 0x8(%rsp)
movq (%rsp), %rax
cmpb $0x0, 0x62(%rax)
movl 0x8(%rsp), %eax
movl $0x1, %ecx
cmovnel %ecx, %eax
movl %eax, 0x8(%rsp)
movq 0x10(%rsp), %r14
movq (%rsp), %rdi
movq %r14, %rsi
callq 0x6495c
testl %eax, %eax
jne 0x63fb4
movq 0x28(%r14), %r14
xorl %r12d, %r12d
testq %r14, %r14
jne 0x63f96
jmp 0x64002
movq (%rsp), %rax
movq 0x28(%rax), %rax
movq %rax, (%rsp)
testq %rax, %rax
jne 0x63f79
jmp 0x63fcf
movl $0x0, 0x8(%rsp)
movq 0x30(%r15), %rsi
testq %rsi, %rsi
je 0x63fef
movq 0x28(%rsp), %rax
movq 0x30(%rax), %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x4bfd6
testl %eax, %eax
jne 0x63fff
movq (%rbx), %rdx
movl 0x2c(%rdx), %eax
btl $0x13, %eax
jb 0x64014
testb %al, %al
jns 0x64022
xorl %r12d, %r12d
movl %r12d, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %r12d, %r12d
testb %al, %al
js 0x64002
cmpq $0x0, 0x20(%r15)
jne 0x64002
movq 0x28(%rsp), %rax
movq 0x70(%rax), %rax
testq %rax, %rax
je 0x6406a
movl 0x28(%rdx), %ecx
testl %ecx, %ecx
jle 0x64076
movq 0x20(%rdx), %rdx
addq $0x18, %rdx
movq $0x0, 0x30(%rsp)
cmpq %rax, (%rdx)
je 0x6407f
movq 0x30(%rsp), %rdi
incq %rdi
addq $0x20, %rdx
movq %rdi, 0x30(%rsp)
cmpq %rdi, %rcx
jne 0x64048
movq %rcx, 0x30(%rsp)
jmp 0x6407f
movl $0xfff0bdc0, %eax       # imm = 0xFFF0BDC0
movq %rax, 0x30(%rsp)
jmp 0x6407f
movq $0x0, 0x30(%rsp)
movq %rbx, %rdi
callq 0x48791
movq %rax, (%rsp)
movq %rbx, %rdi
movq 0x30(%rsp), %rsi
callq 0x4cdbf
movl 0x54(%rbx), %ecx
leal 0x1(%rcx), %eax
movl %eax, 0x20(%rsp)
movq %rcx, 0x10(%rsp)
leal 0x2(%rcx), %eax
movl %eax, 0x54(%rbx)
movq %rbx, %rdi
movl %ebp, %esi
movq %r15, %rdx
callq 0x6462c
movl %eax, 0x44(%rsp)
movb 0x1f(%rbx), %al
testb %al, %al
je 0x640ec
leal -0x1(%rax), %ecx
movb %cl, 0x1f(%rbx)
movzbl %cl, %ecx
movl 0x28(%rbx,%rcx,4), %edx
movl %edx, 0x1c(%rsp)
testb %cl, %cl
je 0x640f8
addb $-0x2, %al
movb %al, 0x1f(%rbx)
movzbl %al, %eax
movl 0x28(%rbx,%rax,4), %eax
movl %eax, 0xc(%rsp)
jmp 0x64104
movl 0x58(%rbx), %eax
incl %eax
movl %eax, 0x1c(%rsp)
movl %eax, 0x58(%rbx)
movl 0x58(%rbx), %eax
incl %eax
movl %eax, 0xc(%rsp)
movl %eax, 0x58(%rbx)
movq %rbx, %rdi
movl 0x20(%rsp), %esi
movl %ebp, %edx
movq %r15, %rcx
movl $0x33, %r8d
callq 0x488b9
cmpw $0x0, 0x40(%r15)
jns 0x6412a
cmpq $0x0, 0x10(%r15)
jne 0x64142
cmpl $0x0, 0x8(%rsp)
jne 0x64142
leal -0x3(%r13), %eax
movl $0x0, 0x8(%rsp)
cmpl $-0x3, %eax
ja 0x6419b
movq (%rsp), %r12
movq %r12, %rdi
movl $0x67, %esi
movl 0x20(%rsp), %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x487d8
movl %eax, %r14d
movq %r12, %rdi
movl $0x10, %esi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x487d8
movl %eax, 0x8(%rsp)
testl %r14d, %r14d
js 0x6419b
movq (%rsp), %rax
movl 0x34(%rax), %eax
cmpl %r14d, %eax
jbe 0x6419b
movq (%rsp), %rcx
movq 0x8(%rcx), %rcx
movl %r14d, %edx
leaq (%rdx,%rdx,2), %rdx
movl %eax, 0x8(%rcx,%rdx,8)
movq 0x28(%rsp), %rax
testb $0x20, 0x48(%rax)
jne 0x64286
movq %rbx, %rdi
movq 0x10(%rsp), %r14
movl %r14d, %esi
movq 0x30(%rsp), %rdx
movq 0x28(%rsp), %rcx
movl $0x32, %r8d
callq 0x488b9
movq (%rsp), %rdi
movl $0x67, %esi
movl %r14d, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x487d8
movl %eax, 0x3c(%rsp)
cmpw $0x0, 0x40(%r15)
js 0x642c3
movq (%rsp), %r12
movq %r12, %rdi
movl $0x62, %esi
movq 0x10(%rsp), %rdx
movl 0xc(%rsp), %r14d
movl %r14d, %ecx
xorl %r8d, %r8d
callq 0x487d8
movl %eax, 0x40(%rsp)
movq %r12, %rdi
movl $0x41, %esi
movl 0x20(%rsp), %edx
xorl %ecx, %ecx
movl %r14d, %r8d
callq 0x487d8
movl %eax, %r12d
movq %rbx, %rdi
movl %r13d, %esi
movq %r15, %rdx
callq 0x63ccb
testl %r12d, %r12d
js 0x64260
movq (%rsp), %rax
movl 0x34(%rax), %eax
cmpl %r12d, %eax
jbe 0x64260
movq (%rsp), %rcx
movq 0x8(%rcx), %rcx
movl %r12d, %edx
leaq (%rdx,%rdx,2), %rdx
movl %eax, 0x8(%rcx,%rdx,8)
cmpl $0x0, 0x44(%rsp)
jle 0x642f7
movq 0x10(%rbx), %rdi
movl $0x7f, %esi
movl 0x44(%rsp), %edx
movl 0xc(%rsp), %ecx
xorl %r8d, %r8d
callq 0x487d8
jmp 0x642f7
movl 0x3c(%r15), %edx
movq (%r15), %r8
movq %rbx, %rdi
movl %ebp, %esi
movl $0x1, %ecx
callq 0x48985
movq 0x28(%rsp), %rax
movl 0x3c(%rax), %edx
movq (%rax), %r8
movl $0x0, 0x3c(%rsp)
movq %rbx, %rdi
movq 0x30(%rsp), %rsi
xorl %ecx, %ecx
callq 0x48985
jmp 0x643a9
cmpq $0x0, 0x10(%r15)
je 0x642da
movq (%rsp), %rdi
movl $0x62, %esi
movq 0x10(%rsp), %rdx
jmp 0x642e7
movq (%rsp), %rdi
movl $0x43, %esi
movl 0x20(%rsp), %edx
movl 0xc(%rsp), %ecx
xorl %r8d, %r8d
callq 0x487d8
movl %eax, 0x40(%rsp)
movq (%rsp), %r12
movq %r12, %rdi
movl $0x61, %esi
movq 0x10(%rsp), %rdx
movl 0x1c(%rsp), %r13d
movl %r13d, %ecx
xorl %r8d, %r8d
callq 0x487d8
movq %r12, %rdi
movl $0x44, %esi
movl 0x20(%rsp), %edx
movl %r13d, %ecx
movl 0xc(%rsp), %r8d
callq 0x487d8
movq 0x8(%r12), %rax
testq %rax, %rax
je 0x6434c
movq (%rsp), %rcx
movslq 0x34(%rcx), %rcx
leaq (%rcx,%rcx,2), %rcx
movb $0xb, -0x15(%rax,%rcx,8)
movq (%r15), %rdx
movq (%rsp), %r12
movq %r12, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %ecx, %ecx
callq 0x12044
movq %r12, %rdi
movl $0x9, %esi
movq 0x10(%rsp), %r14
movl %r14d, %edx
movl 0x40(%rsp), %ecx
xorl %r8d, %r8d
callq 0x487d8
movq %r12, %rdi
movl $0x38, %esi
movl %r14d, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x487d8
movq %r12, %rdi
movl $0x38, %esi
movl 0x20(%rsp), %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x487d8
movq 0x10(%r15), %r15
testq %r15, %r15
je 0x64514
movq 0x28(%rsp), %rax
movq 0x10(%rax), %r12
testq %r12, %r12
je 0x643da
movq %r15, %rdi
movq %r12, %rsi
callq 0x6495c
testl %eax, %eax
jne 0x643dd
movq 0x28(%r12), %r12
jmp 0x643bf
xorl %r12d, %r12d
movl 0x58(%r12), %ecx
movq (%rsp), %r13
movq %r13, %rdi
movl $0x32, %esi
movq 0x10(%rsp), %rdx
movq 0x30(%rsp), %r8
callq 0x487d8
movq %rbx, %rdi
movq %r12, %rsi
callq 0x48a79
movl 0x58(%r15), %ecx
movq %r13, %rdi
movl $0x33, %esi
movl 0x20(%rsp), %edx
movl %ebp, %r8d
callq 0x487d8
movq %rbx, %rdi
movq %r15, %rsi
callq 0x48a79
movq 0x8(%r13), %rax
testq %rax, %rax
je 0x64445
movq (%rsp), %rcx
movslq 0x34(%rcx), %rcx
leaq (%rcx,%rcx,2), %rcx
movb $0x1, -0x15(%rax,%rcx,8)
movq (%rsp), %r13
movq %r13, %rdi
movl $0x67, %esi
movq 0x10(%rsp), %r14
movl %r14d, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x487d8
movl %eax, %r12d
movq %r13, %rdi
movl $0x60, %esi
movl %r14d, %edx
movl 0x1c(%rsp), %r14d
movl %r14d, %ecx
xorl %r8d, %r8d
callq 0x487d8
movq %r13, %rdi
movl $0x69, %esi
movl 0x20(%rsp), %edx
movl %r14d, %ecx
movl $0x1, %r8d
callq 0x487d8
leal 0x1(%r12), %ecx
movq %r13, %rdi
movl $0x9, %esi
movq 0x10(%rsp), %rdx
xorl %r8d, %r8d
callq 0x487d8
testl %r12d, %r12d
js 0x644da
movq %r12, %rdx
movq (%rsp), %rax
movl 0x34(%rax), %eax
cmpl %edx, %eax
jbe 0x644da
movq (%rsp), %rcx
movq 0x8(%rcx), %rcx
movl %edx, %edx
leaq (%rdx,%rdx,2), %rdx
movl %eax, 0x8(%rcx,%rdx,8)
movq (%rsp), %r12
movq %r12, %rdi
movl $0x38, %esi
movq 0x10(%rsp), %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x487d8
movq %r12, %rdi
movl $0x38, %esi
movl 0x20(%rsp), %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x487d8
movq 0x28(%r15), %r15
jmp 0x643ad
cmpl $0x0, 0x3c(%rsp)
js 0x6453c
movq (%rsp), %rax
movl 0x34(%rax), %eax
cmpl 0x3c(%rsp), %eax
jbe 0x6453c
movq (%rsp), %rcx
movq 0x8(%rcx), %rcx
movl 0x3c(%rsp), %edx
leaq (%rdx,%rdx,2), %rdx
movl %eax, 0x8(%rcx,%rdx,8)
cmpl $0x0, 0xc(%rsp)
je 0x6457d
movzbl 0x1f(%rbx), %eax
cmpq $0x7, %rax
ja 0x6457d
xorl %ecx, %ecx
movl 0xc(%rsp), %edx
cmpl %edx, 0x84(%rbx,%rcx)
je 0x64578
addq $0x18, %rcx
cmpl $0xf0, %ecx
jne 0x64553
leal 0x1(%rax), %ecx
movb %cl, 0x1f(%rbx)
movl 0xc(%rsp), %ecx
movl %ecx, 0x28(%rbx,%rax,4)
jmp 0x6457d
movb $0x1, 0x7c(%rbx,%rcx)
cmpl $0x0, 0x1c(%rsp)
je 0x645be
movzbl 0x1f(%rbx), %eax
cmpq $0x7, %rax
ja 0x645be
xorl %ecx, %ecx
movl 0x1c(%rsp), %edx
cmpl %edx, 0x84(%rbx,%rcx)
je 0x645b9
addq $0x18, %rcx
cmpl $0xf0, %ecx
jne 0x64594
leal 0x1(%rax), %ecx
movb %cl, 0x1f(%rbx)
movl 0x1c(%rsp), %ecx
movl %ecx, 0x28(%rbx,%rax,4)
jmp 0x645be
movb $0x1, 0x7c(%rbx,%rcx)
cmpl $0x0, 0x8(%rsp)
je 0x64621
xorl %r12d, %r12d
movq (%rsp), %rdi
movl $0x16, %esi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x487d8
cmpl $0x0, 0x8(%rsp)
js 0x64605
movq (%rsp), %rax
movl 0x34(%rax), %eax
cmpl 0x8(%rsp), %eax
jbe 0x64605
movq (%rsp), %rcx
movq 0x8(%rcx), %rcx
movl 0x8(%rsp), %edx
leaq (%rdx,%rdx,2), %rdx
movl %eax, 0x8(%rcx,%rdx,8)
movq (%rsp), %rdi
movl $0x38, %esi
movl 0x20(%rsp), %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x487d8
jmp 0x64002
movl $0x1, %r12d
jmp 0x64002