// File: /workspace/github_c_makefile_star2_O1/barabo[P]advanced-shell-history/src/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;               /* Address of test for empty pDest */
  int emptySrcTest;                /* Address of test for empty pSrc */
  Vdbe *v;                         /* The VDBE we are building */
  KeyInfo *pKey;                   /* Key information for an index */
  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 */
  }
#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);
  sqlite3OpenTable(pParse, iDest, iDbDest, pDest, OP_OpenWrite);
  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);
  }else{
    emptyDestTest = 0;
  }
  sqlite3OpenTable(pParse, iSrc, iDbSrc, pSrc, OP_OpenRead);
  emptySrcTest = sqlite3VdbeAddOp2(v, OP_Rewind, iSrc, 0);
  regData = sqlite3GetTempReg(pParse);
  regRowid = sqlite3GetTempReg(pParse);
  if( pDest->iPKey>=0 ){
    addr1 = sqlite3VdbeAddOp2(v, OP_Rowid, iSrc, regRowid);
    addr2 = sqlite3VdbeAddOp3(v, OP_NotExists, iDest, 0, regRowid);
    sqlite3HaltConstraint(pParse, SQLITE_CONSTRAINT_PRIMARYKEY,
        onError, "PRIMARY KEY must be unique", P4_STATIC);
    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);
  for(pDestIdx=pDest->pIndex; pDestIdx; pDestIdx=pDestIdx->pNext){
    for(pSrcIdx=pSrc->pIndex; ALWAYS(pSrcIdx); pSrcIdx=pSrcIdx->pNext){
      if( xferCompatibleIndex(pDestIdx, pSrcIdx) ) break;
    }
    assert( pSrcIdx );
    sqlite3VdbeAddOp2(v, OP_Close, iSrc, 0);
    sqlite3VdbeAddOp2(v, OP_Close, iDest, 0);
    pKey = sqlite3IndexKeyinfo(pParse, pSrcIdx);
    sqlite3VdbeAddOp4(v, OP_OpenRead, iSrc, pSrcIdx->tnum, iDbSrc,
                      (char*)pKey, P4_KEYINFO_HANDOFF);
    VdbeComment((v, "%s", pSrcIdx->zName));
    pKey = sqlite3IndexKeyinfo(pParse, pDestIdx);
    sqlite3VdbeAddOp4(v, OP_OpenWrite, iDest, pDestIdx->tnum, iDbDest,
                      (char*)pKey, P4_KEYINFO_HANDOFF);
    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);
  }
  sqlite3VdbeJumpHere(v, emptySrcTest);
  sqlite3ReleaseTempReg(pParse, regRowid);
  sqlite3ReleaseTempReg(pParse, regData);
  sqlite3VdbeAddOp2(v, OP_Close, iSrc, 0);
  sqlite3VdbeAddOp2(v, OP_Close, iDest, 0);
  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 $0x58, %rsp
xorl %r15d, %r15d
testq %rdx, %rdx
je 0x5febd
movl %ecx, %r12d
movq %rdx, %r14
movq %rsi, %r13
movq %rdi, %rbx
movl %r8d, -0x7c(%rbp)
callq 0x4fd20
testq %rax, %rax
jne 0x5febd
testb $0x10, 0x46(%r13)
jne 0x5febd
cmpl $0x63, %r12d
jne 0x5fca3
cmpw $0x0, 0x40(%r13)
js 0x5fc91
movzbl 0x47(%r13), %eax
jmp 0x5fc96
movl $0x63, %eax
cmpl $0x63, %eax
movl $0x2, %r12d
cmovnel %eax, %r12d
movq 0x28(%r14), %rdx
cmpb $0x1, (%rdx)
jne 0x5febd
cmpq $0x0, 0x30(%rdx)
jne 0x5febd
cmpq $0x0, 0x30(%r14)
jne 0x5febd
cmpq $0x0, 0x48(%r14)
jne 0x5febd
cmpq $0x0, 0x38(%r14)
jne 0x5febd
cmpq $0x0, 0x68(%r14)
jne 0x5febd
cmpq $0x0, 0x50(%r14)
jne 0x5febd
testb $0x1, 0xa(%r14)
jne 0x5febd
movq (%r14), %rax
cmpl $0x1, (%rax)
jne 0x5febd
movq 0x8(%rax), %rax
movq (%rax), %rax
cmpb $0x71, (%rax)
jne 0x5febd
addq $0x8, %rdx
xorl %r15d, %r15d
movq %rbx, %rdi
xorl %esi, %esi
callq 0x4a2cc
testq %rax, %rax
sete %dl
movq %rax, -0x68(%rbp)
cmpq %r13, %rax
sete %cl
orb %dl, %cl
jne 0x5febd
movq -0x68(%rbp), %rax
testb $0x10, 0x46(%rax)
jne 0x5febd
movq -0x68(%rbp), %rax
cmpq $0x0, 0x18(%rax)
jne 0x5febd
movzwl 0x42(%r13), %eax
movq -0x68(%rbp), %rcx
cmpw 0x42(%rcx), %ax
jne 0x5febd
movzwl 0x40(%r13), %ecx
movq -0x68(%rbp), %rdx
cmpw 0x40(%rdx), %cx
jne 0x5febd
testw %ax, %ax
jle 0x5fe10
movq 0x8(%r13), %rcx
movq %rcx, -0x40(%rbp)
movq -0x68(%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
movq -0x40(%rbp), %rax
movb 0x29(%rax,%r14), %al
movq -0x30(%rbp), %rcx
cmpb 0x29(%rcx,%r14), %al
jne 0x5febd
movq -0x40(%rbp), %rax
movq 0x20(%rax,%r14), %rdi
movq -0x30(%rbp), %rax
movq 0x20(%rax,%r14), %rsi
callq 0x6077a
testl %eax, %eax
je 0x5febd
movq -0x40(%rbp), %rax
cmpb $0x0, 0x28(%rax,%r14)
je 0x5fe06
movq -0x30(%rbp), %rax
cmpb $0x0, 0x28(%rax,%r14)
je 0x5febd
addq $0x30, %r14
cmpq %r14, -0x60(%rbp)
jne 0x5fdb3
movq 0x10(%r13), %rax
movq %rax, -0x40(%rbp)
testq %rax, %rax
je 0x5fe84
movq -0x68(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x30(%rbp)
testq %rax, %rax
je 0x5feba
movl $0x0, -0x50(%rbp)
movq -0x40(%rbp), %rax
cmpb $0x0, 0x56(%rax)
movl -0x50(%rbp), %eax
movl $0x1, %ecx
cmovnel %ecx, %eax
movl %eax, -0x50(%rbp)
movq -0x30(%rbp), %r14
movq -0x40(%rbp), %rdi
movq %r14, %rsi
callq 0x607e0
testl %eax, %eax
jne 0x5fe71
movq 0x28(%r14), %r14
xorl %r15d, %r15d
testq %r14, %r14
jne 0x5fe53
jmp 0x5febd
movq -0x40(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x40(%rbp)
testq %rax, %rax
jne 0x5fe39
jmp 0x5fe8b
movl $0x0, -0x50(%rbp)
movq 0x30(%r13), %rsi
testq %rsi, %rsi
je 0x5feaa
movq -0x68(%rbp), %rax
movq 0x30(%rax), %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x4b92b
testl %eax, %eax
jne 0x5feba
movq (%rbx), %rdx
movl 0x2c(%rdx), %eax
btl $0x13, %eax
jb 0x5fecf
testb %al, %al
jns 0x5fedd
xorl %r15d, %r15d
movl %r15d, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %r15d, %r15d
testb %al, %al
js 0x5febd
cmpq $0x0, 0x20(%r13)
jne 0x5febd
movq -0x68(%rbp), %rax
movq 0x68(%rax), %rax
testq %rax, %rax
je 0x5ff20
movl 0x28(%rdx), %ecx
testl %ecx, %ecx
jle 0x5ff2b
movq 0x20(%rdx), %rdx
addq $0x18, %rdx
movq $0x0, -0x70(%rbp)
cmpq %rax, (%rdx)
je 0x5ff33
movq -0x70(%rbp), %rdi
incq %rdi
addq $0x20, %rdx
movq %rdi, -0x70(%rbp)
cmpq %rdi, %rcx
jne 0x5ff01
movq %rcx, -0x70(%rbp)
jmp 0x5ff33
movl $0xfff0bdc0, %eax       # imm = 0xFFF0BDC0
movq %rax, -0x70(%rbp)
jmp 0x5ff33
movq $0x0, -0x70(%rbp)
movq %rbx, %rdi
callq 0x45b57
movq %rax, -0x30(%rbp)
movq %rbx, %rdi
movq -0x70(%rbp), %rsi
callq 0x45ff7
movl 0x54(%rbx), %eax
leal 0x1(%rax), %r15d
movq %rax, -0x60(%rbp)
addl $0x2, %eax
movl %eax, 0x54(%rbx)
movq %rbx, %rdi
movl -0x7c(%rbp), %r14d
movl %r14d, %esi
movq %r13, %rdx
callq 0x60479
movl %eax, -0x78(%rbp)
movq %rbx, %rdi
movl %r15d, -0x40(%rbp)
movl %r15d, %esi
movl %r14d, %edx
movq %r13, %rcx
movl $0x31, %r8d
callq 0x45c23
cmpw $0x0, 0x40(%r13)
jns 0x5ff9b
cmpq $0x0, 0x10(%r13)
jne 0x5ffb2
cmpl $0x0, -0x50(%rbp)
jne 0x5ffb2
leal -0x3(%r12), %eax
movl $0x0, -0x54(%rbp)
cmpl $-0x3, %eax
ja 0x60009
movq -0x30(%rbp), %r15
movq %r15, %rdi
movl $0x65, %esi
movl -0x40(%rbp), %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x45b9e
movl %eax, %r14d
movq %r15, %rdi
movl $0xe, %esi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x45b9e
movl %eax, -0x54(%rbp)
testl %r14d, %r14d
js 0x60009
movq -0x30(%rbp), %rax
movl 0x34(%rax), %eax
cmpl %r14d, %eax
jbe 0x60009
movq -0x30(%rbp), %rcx
movq 0x8(%rcx), %rcx
movl %r14d, %edx
leaq (%rdx,%rdx,2), %rdx
movl %eax, 0x8(%rcx,%rdx,8)
movq %rbx, %rdi
movq -0x60(%rbp), %r14
movl %r14d, %esi
movq -0x70(%rbp), %rdx
movq -0x68(%rbp), %rcx
movl $0x30, %r8d
callq 0x45c23
movq -0x30(%rbp), %rdi
movl $0x65, %esi
movl %r14d, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x45b9e
movl %eax, -0x74(%rbp)
movb 0x1f(%rbx), %al
testb %al, %al
je 0x60057
decb %al
movb %al, 0x1f(%rbx)
movzbl %al, %eax
movl 0x28(%rbx,%rax,4), %eax
movl %eax, -0x44(%rbp)
jmp 0x60062
movl 0x58(%rbx), %eax
incl %eax
movl %eax, -0x44(%rbp)
movl %eax, 0x58(%rbx)
movb 0x1f(%rbx), %al
testb %al, %al
je 0x6007a
decb %al
movb %al, 0x1f(%rbx)
movzbl %al, %eax
movl 0x28(%rbx,%rax,4), %eax
movl %eax, -0x34(%rbp)
jmp 0x60085
movl 0x58(%rbx), %eax
incl %eax
movl %eax, -0x34(%rbp)
movl %eax, 0x58(%rbx)
cmpw $0x0, 0x40(%r13)
js 0x6012b
movq -0x30(%rbp), %r14
movq %r14, %rdi
movl $0x60, %esi
movq -0x60(%rbp), %rdx
movl -0x34(%rbp), %r15d
movl %r15d, %ecx
xorl %r8d, %r8d
callq 0x45b9e
movl %eax, -0x50(%rbp)
movq %r14, %rdi
movl $0x3f, %esi
movl -0x40(%rbp), %edx
xorl %ecx, %ecx
movl %r15d, %r8d
callq 0x45b9e
movl %eax, %r14d
leaq 0x1bd53(%rip), %rcx     # 0x7be25
movq %rbx, %rdi
movl $0x613, %esi            # imm = 0x613
movl %r12d, %edx
movl $0xfffffffe, %r8d       # imm = 0xFFFFFFFE
callq 0x4c44d
testl %r14d, %r14d
js 0x6010c
movq -0x30(%rbp), %rax
movl 0x34(%rax), %eax
cmpl %r14d, %eax
jbe 0x6010c
movq -0x30(%rbp), %rcx
movq 0x8(%rcx), %rcx
movl %r14d, %edx
leaq (%rdx,%rdx,2), %rdx
movl %eax, 0x8(%rcx,%rdx,8)
cmpl $0x0, -0x78(%rbp)
jle 0x6015b
movq 0x10(%rbx), %rdi
movl $0x7d, %esi
movl -0x78(%rbp), %edx
movl -0x34(%rbp), %ecx
xorl %r8d, %r8d
callq 0x45b9e
jmp 0x6015b
cmpq $0x0, 0x10(%r13)
je 0x60141
movq -0x30(%rbp), %rdi
movl $0x60, %esi
movq -0x60(%rbp), %rdx
jmp 0x6014d
movq -0x30(%rbp), %rdi
movl $0x41, %esi
movl -0x40(%rbp), %edx
movl -0x34(%rbp), %ecx
xorl %r8d, %r8d
callq 0x45b9e
movl %eax, -0x50(%rbp)
movq -0x30(%rbp), %r14
movq %r14, %rdi
movl $0x5f, %esi
movq -0x60(%rbp), %rdx
movl -0x44(%rbp), %r12d
movl %r12d, %ecx
xorl %r8d, %r8d
callq 0x45b9e
movq %r14, %rdi
movl $0x42, %esi
movl -0x40(%rbp), %edx
movl %r12d, %ecx
movl -0x34(%rbp), %r8d
callq 0x45b9e
movq 0x8(%r14), %rax
testq %rax, %rax
je 0x601ab
movq -0x30(%rbp), %rcx
movslq 0x34(%rcx), %rcx
leaq (%rcx,%rcx,2), %rcx
movb $0xb, -0x15(%rax,%rcx,8)
movq (%r13), %rdx
movq -0x30(%rbp), %r14
movq %r14, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %ecx, %ecx
callq 0x11975
movq %r14, %rdi
movl $0x7, %esi
movq -0x60(%rbp), %rdx
movl -0x50(%rbp), %ecx
xorl %r8d, %r8d
callq 0x45b9e
movq 0x10(%r13), %r15
testq %r15, %r15
je 0x60340
movq -0x30(%rbp), %r13
movq -0x68(%rbp), %rax
movq 0x10(%rax), %r14
testq %r14, %r14
je 0x6020c
movq %r15, %rdi
movq %r14, %rsi
callq 0x607e0
testl %eax, %eax
jne 0x6020c
movq 0x28(%r14), %r14
jmp 0x601f2
movq %r13, %rdi
movl $0x36, %esi
movq -0x60(%rbp), %r12
movl %r12d, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x45b9e
movq %r13, %rdi
movl $0x36, %esi
movl -0x40(%rbp), %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x45b9e
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4c1d4
movq %rax, -0x50(%rbp)
movl 0x50(%r14), %ecx
movq %r13, %rdi
movl $0x30, %esi
movl %r12d, %edx
movq -0x70(%rbp), %r8
callq 0x45b9e
movq %r13, %rdi
movl %eax, %esi
movq -0x50(%rbp), %rdx
movl $0xfffffff0, %ecx       # imm = 0xFFFFFFF0
callq 0x11975
movq %rbx, %rdi
movq %r15, %rsi
callq 0x4c1d4
movq %rax, %r14
movl 0x50(%r15), %ecx
movq %r13, %rdi
movl $0x31, %esi
movl -0x40(%rbp), %edx
movl -0x7c(%rbp), %r8d
callq 0x45b9e
movq %r13, %rdi
movl %eax, %esi
movq %r14, %rdx
movl $0xfffffff0, %ecx       # imm = 0xFFFFFFF0
callq 0x11975
movq %r13, %rdi
movl $0x65, %esi
movl %r12d, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x45b9e
movl %eax, %r14d
movq %r13, %rdi
movl $0x5c, %esi
movl %r12d, %edx
movl -0x44(%rbp), %r12d
movl %r12d, %ecx
xorl %r8d, %r8d
callq 0x45b9e
movq %r13, %rdi
movl $0x67, %esi
movl -0x40(%rbp), %edx
movl %r12d, %ecx
movl $0x1, %r8d
callq 0x45b9e
leal 0x1(%r14), %ecx
movq %r13, %rdi
movl $0x7, %esi
movq -0x60(%rbp), %rdx
xorl %r8d, %r8d
callq 0x45b9e
testl %r14d, %r14d
js 0x60333
movq -0x30(%rbp), %rax
movl 0x34(%rax), %eax
cmpl %r14d, %eax
jbe 0x60333
movq -0x30(%rbp), %rcx
movq 0x8(%rcx), %rcx
movl %r14d, %edx
leaq (%rdx,%rdx,2), %rdx
movl %eax, 0x8(%rcx,%rdx,8)
movq 0x28(%r15), %r15
testq %r15, %r15
jne 0x601ea
cmpl $0x0, -0x74(%rbp)
js 0x60365
movq -0x30(%rbp), %rax
movl 0x34(%rax), %eax
cmpl -0x74(%rbp), %eax
jbe 0x60365
movq -0x30(%rbp), %rcx
movq 0x8(%rcx), %rcx
movl -0x74(%rbp), %edx
leaq (%rdx,%rdx,2), %rdx
movl %eax, 0x8(%rcx,%rdx,8)
cmpl $0x0, -0x34(%rbp)
je 0x603a3
movzbl 0x1f(%rbx), %eax
cmpq $0x7, %rax
ja 0x603a3
xorl %ecx, %ecx
movl -0x34(%rbp), %edx
cmpl %edx, 0x84(%rbx,%rcx)
je 0x6039e
addq $0x18, %rcx
cmpl $0xf0, %ecx
jne 0x6037a
leal 0x1(%rax), %ecx
movb %cl, 0x1f(%rbx)
movl -0x34(%rbp), %ecx
movl %ecx, 0x28(%rbx,%rax,4)
jmp 0x603a3
movb $0x1, 0x7c(%rbx,%rcx)
cmpl $0x0, -0x44(%rbp)
je 0x603e1
movzbl 0x1f(%rbx), %eax
cmpq $0x7, %rax
ja 0x603e1
xorl %ecx, %ecx
movl -0x44(%rbp), %edx
cmpl %edx, 0x84(%rbx,%rcx)
je 0x603dc
addq $0x18, %rcx
cmpl $0xf0, %ecx
jne 0x603b8
leal 0x1(%rax), %ecx
movb %cl, 0x1f(%rbx)
movl -0x44(%rbp), %ecx
movl %ecx, 0x28(%rbx,%rax,4)
jmp 0x603e1
movb $0x1, 0x7c(%rbx,%rcx)
movq -0x30(%rbp), %rbx
movq %rbx, %rdi
movl $0x36, %esi
movq -0x60(%rbp), %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x45b9e
movq %rbx, %rdi
movl $0x36, %esi
movl -0x40(%rbp), %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x45b9e
cmpl $0x0, -0x54(%rbp)
je 0x6046e
xorl %r15d, %r15d
movq -0x30(%rbp), %rdi
movl $0x14, %esi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x45b9e
cmpl $0x0, -0x54(%rbp)
js 0x60453
movq -0x30(%rbp), %rax
movl 0x34(%rax), %eax
cmpl -0x54(%rbp), %eax
jbe 0x60453
movq -0x30(%rbp), %rcx
movq 0x8(%rcx), %rcx
movl -0x54(%rbp), %edx
leaq (%rdx,%rdx,2), %rdx
movl %eax, 0x8(%rcx,%rdx,8)
movq -0x30(%rbp), %rdi
movl $0x36, %esi
movl -0x40(%rbp), %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x45b9e
jmp 0x5febd
movl $0x1, %r15d
jmp 0x5febd