// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/external/sqlite-3.33.0/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( IsVirtual(pDest) ){
    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 */
  }
  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->tnum==pDest->tnum && pSrc->pSchema==pDest->pSchema ){
    testcase( pSrc!=pDest ); /* Possible due to bad sqlite_schema.rootpage */
    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( IsVirtual(pSrc) ){
    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->mDbFlags & DBFLAG_Vacuum)==0
     && (pDestCol->colFlags | pSrcCol->colFlags) & COLFLAG_HIDDEN
    ){
      return 0;    /* Neither table may have __hidden__ columns */
    }
#endif
#ifndef SQLITE_OMIT_GENERATED_COLUMNS
    /* Even if tables t1 and t2 have identical schemas, if they contain
    ** generated columns, then this statement is semantically incorrect:
    **
    **     INSERT INTO t2 SELECT * FROM t1;
    **
    ** The reason is that generated column values are returned by the
    ** the SELECT statement on the right but the INSERT statement on the
    ** left wants them to be omitted.
    **
    ** Nevertheless, this is a useful notational shorthand to tell SQLite
    ** to do a bulk transfer all of the content from t1 over to t2.
    **
    ** We could, in theory, disable this (except for internal use by the
    ** VACUUM command where it is actually needed).  But why do that?  It
    ** seems harmless enough, and provides a useful service.
    */
    if( (pDestCol->colFlags & COLFLAG_GENERATED) !=
        (pSrcCol->colFlags & COLFLAG_GENERATED) ){
      return 0;    /* Both columns have the same generated-column type */
    }
    /* But the transfer is only allowed if both the source and destination
    ** tables have the exact same expressions for generated columns.
    ** This requirement could be relaxed for VIRTUAL columns, I suppose.
    */
    if( (pDestCol->colFlags & COLFLAG_GENERATED)!=0 ){
      if( sqlite3ExprCompare(0, pSrcCol->pDflt, pDestCol->pDflt, -1)!=0 ){
        testcase( pDestCol->colFlags & COLFLAG_VIRTUAL );
        testcase( pDestCol->colFlags & COLFLAG_STORED );
        return 0;  /* Different generator expressions */
      }
    }
#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( (pDestCol->colFlags & COLFLAG_GENERATED)==0 && i>0 ){
      assert( pDestCol->pDflt==0 || pDestCol->pDflt->op==TK_SPAN );
      assert( pSrcCol->pDflt==0 || pSrcCol->pDflt->op==TK_SPAN );
      if( (pDestCol->pDflt==0)!=(pSrcCol->pDflt==0)
       || (pDestCol->pDflt && strcmp(pDestCol->pDflt->u.zToken,
                                       pSrcCol->pDflt->u.zToken)!=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 */
    }
    if( pSrcIdx->tnum==pDestIdx->tnum && pSrc->pSchema==pDest->pSchema
         && sqlite3FaultSim(411)==SQLITE_OK ){
      /* The sqlite3FaultSim() call allows this corruption test to be
      ** bypassed during testing, in order to exercise other corruption tests
      ** further downstream. */
      return 0;   /* Corrupt schema - two indexes on the same btree */
    }
  }
#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->mDbFlags & DBFLAG_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
    ** DBFLAG_Vacuum flag is set, this block generates code to make
    ** that determination. If DBFLAG_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) ){
    u8 insFlags;
    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);
      sqlite3VdbeVerifyAbortable(v, onError);
      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 && !(db->mDbFlags & DBFLAG_VacuumInto) ){
      addr1 = sqlite3VdbeAddOp2(v, OP_NewRowid, iDest, regRowid);
    }else{
      addr1 = sqlite3VdbeAddOp2(v, OP_Rowid, iSrc, regRowid);
      assert( (pDest->tabFlags & TF_Autoincrement)==0 );
    }
    if( db->mDbFlags & DBFLAG_Vacuum ){
      sqlite3VdbeAddOp1(v, OP_SeekEnd, iDest);
      insFlags = OPFLAG_APPEND|OPFLAG_USESEEKRESULT;
    }else{
      insFlags = OPFLAG_NCHANGE|OPFLAG_LASTROWID|OPFLAG_APPEND;
    }
    sqlite3VdbeAddOp3(v, OP_RowData, iSrc, regData, 1);
    sqlite3VdbeAddOp4(v, OP_Insert, iDest, regData, regRowid,
                      (char*)pDest, P4_TABLE);
    sqlite3VdbeChangeP5(v, insFlags);
    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);
    if( db->mDbFlags & DBFLAG_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_SeekEnd 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];
        if( sqlite3_stricmp(sqlite3StrBINARY, zColl) ) break;
      }
      if( i==pSrcIdx->nColumn ){
        idxInsFlags = OPFLAG_USESEEKRESULT;
        sqlite3VdbeAddOp1(v, OP_SeekEnd, iDest);
      }
    }else if( !HasRowid(pSrc) && pDestIdx->idxType==SQLITE_IDXTYPE_PRIMARYKEY ){
      idxInsFlags |= OPFLAG_NCHANGE;
    }
    sqlite3VdbeAddOp3(v, OP_RowData, iSrc, regData, 1);
    sqlite3VdbeAddOp2(v, OP_IdxInsert, iDest, regData);
    sqlite3VdbeChangeP5(v, idxInsFlags|OPFLAG_APPEND);
    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 ){
    sqlite3AutoincrementEnd(pParse);
    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 $0x58, %rsp
xorl %r15d, %r15d
testq %rdx, %rdx
je 0x2e668e
movq %rdi, %rbx
cmpq $0x0, 0x190(%rdi)
jne 0x2e668e
movq %rdx, %r14
cmpq $0x0, 0x68(%rdx)
jne 0x2e668e
movl %ecx, %r12d
movq %rsi, %r13
movl %r8d, 0x3c(%rsp)
movq (%rbx), %rbp
movq 0x20(%rbp), %rax
movq 0x38(%rax), %rdi
movzbl 0xd2(%rbx), %esi
movq %r13, %rdx
callq 0x2cafa3
testq %rax, %rax
jne 0x2e668e
movq %rbp, 0x48(%rsp)
cmpl $0x0, 0x54(%r13)
jne 0x2e668e
cmpl $0xb, %r12d
jne 0x2e6389
cmpw $0x0, 0x44(%r13)
js 0x2e637d
movb 0x4e(%r13), %al
cmpb $0xb, %al
jne 0x2e6385
movl $0x2, %r12d
jmp 0x2e6389
movzbl %al, %r12d
movq 0x28(%r14), %rdx
cmpl $0x1, (%rdx)
jne 0x2e668e
cmpq $0x0, 0x30(%rdx)
jne 0x2e668e
cmpq $0x0, 0x30(%r14)
jne 0x2e668e
cmpq $0x0, 0x48(%r14)
jne 0x2e668e
cmpq $0x0, 0x38(%r14)
jne 0x2e668e
cmpq $0x0, 0x60(%r14)
jne 0x2e668e
cmpq $0x0, 0x50(%r14)
jne 0x2e668e
testb $0x1, 0x4(%r14)
jne 0x2e668e
movq 0x20(%r14), %rax
cmpl $0x1, (%rax)
jne 0x2e668e
movq 0x8(%rax), %rax
cmpb $-0x4f, (%rax)
jne 0x2e668e
addq $0x8, %rdx
xorl %r15d, %r15d
movq %rbx, %rdi
xorl %esi, %esi
callq 0x2c84c3
testq %rax, %rax
je 0x2e668e
movq %rax, %rbp
movl 0x38(%rax), %eax
cmpl 0x38(%r13), %eax
jne 0x2e6431
movq 0x70(%rbp), %rax
cmpq 0x70(%r13), %rax
je 0x2e668e
movb 0x40(%rbp), %al
xorb 0x40(%r13), %al
js 0x2e668e
cmpl $0x0, 0x54(%rbp)
jne 0x2e668e
cmpq $0x0, 0x18(%rbp)
jne 0x2e668e
movzwl 0x46(%r13), %eax
cmpw 0x46(%rbp), %ax
jne 0x2e668e
movzwl 0x44(%r13), %ecx
cmpw 0x44(%rbp), %cx
jne 0x2e668e
testw %ax, %ax
jle 0x2e65b4
xorl %r14d, %r14d
movq $0x0, 0x20(%rsp)
movq 0x8(%r13), %rax
movq 0x8(%rbp), %rcx
movq %rax, 0x8(%rsp)
movzwl 0x1c(%rax,%r14), %eax
andl $0x60, %eax
movq %rcx, 0x18(%rsp)
movzwl 0x1c(%rcx,%r14), %ecx
andl $0x60, %ecx
cmpw %cx, %ax
jne 0x2e668b
testw %ax, %ax
je 0x2e64e3
movq 0x18(%rsp), %rax
movq 0x8(%rax,%r14), %rsi
movq 0x8(%rsp), %rax
movq 0x8(%rax,%r14), %rdx
xorl %r15d, %r15d
xorl %edi, %edi
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
callq 0x2c0d98
testl %eax, %eax
jne 0x2e668e
movq 0x8(%rsp), %rax
movb 0x19(%rax,%r14), %al
movq 0x18(%rsp), %rcx
cmpb 0x19(%rcx,%r14), %al
jne 0x2e668b
movq 0x8(%rsp), %rax
movq 0x10(%rax,%r14), %rdi
movq 0x18(%rsp), %rax
movq 0x10(%rax,%r14), %rsi
callq 0x274fe7
testl %eax, %eax
jne 0x2e668b
movq 0x8(%rsp), %rax
cmpb $0x0, 0x18(%rax,%r14)
je 0x2e653c
movq 0x18(%rsp), %rax
cmpb $0x0, 0x18(%rax,%r14)
je 0x2e668b
testq %r14, %r14
je 0x2e6595
movq 0x8(%rsp), %rax
movzwl 0x1c(%rax,%r14), %eax
andl $0x60, %eax
jne 0x2e6595
movq 0x8(%rsp), %rax
movq 0x8(%rax,%r14), %rax
testq %rax, %rax
sete %dl
movq 0x18(%rsp), %rcx
movq 0x8(%rcx,%r14), %rcx
testq %rcx, %rcx
setne %sil
cmpb %sil, %dl
je 0x2e668b
testq %rax, %rax
je 0x2e6595
movq 0x8(%rax), %rdi
movq 0x8(%rcx), %rsi
callq 0x17a40
testl %eax, %eax
jne 0x2e668b
movq 0x20(%rsp), %rdx
incq %rdx
movswq 0x46(%r13), %rax
addq $0x20, %r14
movq %rdx, 0x20(%rsp)
cmpq %rax, %rdx
jl 0x2e6486
movq 0x10(%r13), %rax
movq %rax, 0x8(%rsp)
testq %rax, %rax
je 0x2e6652
xorl %r15d, %r15d
movl $0x0, 0x30(%rsp)
movq 0x8(%rsp), %rax
cmpb $0x0, 0x62(%rax)
movl 0x30(%rsp), %eax
movl $0x1, %ecx
cmovnel %ecx, %eax
movl %eax, 0x30(%rsp)
movq 0x10(%rbp), %r14
testq %r14, %r14
je 0x2e668e
movq 0x8(%rsp), %rdi
movq %r14, %rsi
callq 0x2e71c5
testl %eax, %eax
jne 0x2e660e
movq 0x28(%r14), %r14
jmp 0x2e65ee
movl 0x58(%r14), %eax
movq 0x8(%rsp), %rcx
cmpl 0x58(%rcx), %eax
jne 0x2e663d
movq 0x70(%rbp), %rax
cmpq 0x70(%r13), %rax
jne 0x2e663d
movq 0x1d51bb(%rip), %rax    # 0x4bb7e8
testq %rax, %rax
je 0x2e668e
movl $0x19b, %edi            # imm = 0x19B
callq *%rax
testl %eax, %eax
je 0x2e668e
movq 0x8(%rsp), %rax
movq 0x28(%rax), %rax
movq %rax, 0x8(%rsp)
testq %rax, %rax
jne 0x2e65d1
jmp 0x2e665a
movl $0x0, 0x30(%rsp)
movq 0x30(%r13), %rsi
testq %rsi, %rsi
je 0x2e6675
movq 0x30(%rbp), %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2c128a
testl %eax, %eax
jne 0x2e668b
movq 0x48(%rsp), %rax
movq 0x30(%rax), %rax
btl $0xe, %eax
jb 0x2e66a0
btq $0x20, %rax
jae 0x2e66b1
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
btq $0x20, %rax
jb 0x2e668e
cmpq $0x0, 0x20(%r13)
jne 0x2e668e
movq 0x70(%rbp), %rax
testq %rax, %rax
je 0x2e66e1
movq 0x48(%rsp), %rcx
movq 0x20(%rcx), %rcx
addq $0x18, %rcx
movl $0xffffffff, 0x2c(%rsp) # imm = 0xFFFFFFFF
incl 0x2c(%rsp)
leaq 0x20(%rcx), %rdx
cmpq %rax, (%rcx)
movq %rdx, %rcx
jne 0x2e66cf
jmp 0x2e66e9
movl $0xffff8000, 0x2c(%rsp) # imm = 0xFFFF8000
movq %rbx, %rdi
callq 0x2bc630
movq %rax, 0x8(%rsp)
movq %rbx, %rdi
movl 0x2c(%rsp), %esi
callq 0x2c26e5
movl 0x34(%rbx), %ecx
leal 0x1(%rcx), %eax
movl %eax, 0x20(%rsp)
movq %rcx, 0x18(%rsp)
leal 0x2(%rcx), %eax
movl %eax, 0x34(%rbx)
movq %rbx, %rdi
movl 0x3c(%rsp), %esi
movq %r13, %rdx
callq 0x2e6e3e
movl %eax, 0x54(%rsp)
movb 0x1f(%rbx), %al
testb %al, %al
je 0x2e675e
leal -0x1(%rax), %ecx
movb %cl, 0x1f(%rbx)
movzbl %cl, %ecx
movl 0xd4(%rbx,%rcx,4), %edx
movl %edx, 0x38(%rsp)
testb %cl, %cl
je 0x2e676a
addb $-0x2, %al
movb %al, 0x1f(%rbx)
movzbl %al, %eax
movl 0xd4(%rbx,%rax,4), %eax
movl %eax, 0x14(%rsp)
jmp 0x2e6776
movl 0x38(%rbx), %eax
incl %eax
movl %eax, 0x38(%rsp)
movl %eax, 0x38(%rbx)
movl 0x38(%rbx), %eax
incl %eax
movl %eax, 0x14(%rsp)
movl %eax, 0x38(%rbx)
movq %rbx, %rdi
movl 0x20(%rsp), %esi
movl 0x3c(%rsp), %edx
movq %r13, %rcx
movl $0x61, %r8d
callq 0x2bc82f
movl $0x0, 0x44(%rsp)
movq 0x48(%rsp), %rax
testb $0x4, 0x2c(%rax)
jne 0x2e6839
cmpw $0x0, 0x44(%r13)
jns 0x2e67b5
cmpq $0x0, 0x10(%r13)
jne 0x2e67c6
cmpl $0x0, 0x30(%rsp)
jne 0x2e67c6
leal -0x3(%r12), %eax
cmpl $-0x3, %eax
ja 0x2e6839
movq 0x8(%rsp), %r15
movq %r15, %rdi
movl $0x25, %esi
movl 0x20(%rsp), %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x2a83e1
movl %eax, %r14d
movq %r15, %rdi
movl $0xb, %esi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x2a83e1
movl %eax, 0x44(%rsp)
movl 0x90(%r15), %eax
movq (%r15), %rcx
cmpb $0x0, 0x61(%rcx)
je 0x2e6815
leaq 0x1d8675(%rip), %rcx    # 0x4bee88
jmp 0x2e6836
leal -0x1(%rax), %ecx
testl %r14d, %r14d
cmovnsl %r14d, %ecx
movslq %ecx, %rcx
leaq (%rcx,%rcx,2), %rcx
shlq $0x3, %rcx
movq 0x8(%rsp), %rdx
addq 0x88(%rdx), %rcx
movl %eax, 0x8(%rcx)
testb $-0x80, 0x40(%rbp)
jne 0x2e68f4
movq %rbx, %rdi
movq 0x18(%rsp), %r14
movl %r14d, %esi
movl 0x2c(%rsp), %edx
movq %rbp, %rcx
movl $0x60, %r8d
callq 0x2bc82f
movq 0x8(%rsp), %rdi
movl $0x25, %esi
movl %r14d, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x2a83e1
movl %eax, 0x40(%rsp)
cmpw $0x0, 0x44(%r13)
js 0x2e692f
movq 0x8(%rsp), %r15
movq %r15, %rdi
movl $0x7f, %esi
movq 0x18(%rsp), %rdx
movl 0x14(%rsp), %r14d
movl %r14d, %ecx
xorl %r8d, %r8d
callq 0x2a83e1
movl %eax, 0x30(%rsp)
movq %r15, %rdi
movl $0x20, %esi
movl 0x20(%rsp), %edx
xorl %ecx, %ecx
movl %r14d, %r8d
callq 0x2a83e1
movl %eax, %r14d
movq %rbx, %rdi
movl %r12d, %esi
movq %r13, %rdx
callq 0x2e5fc6
movl 0x90(%r15), %eax
movq (%r15), %rcx
cmpb $0x0, 0x61(%rcx)
je 0x2e6972
leaq 0x1d8599(%rip), %rcx    # 0x4bee88
jmp 0x2e6993
movl 0x38(%r13), %edx
movq (%r13), %r8
movq %rbx, %rdi
movl 0x3c(%rsp), %esi
movl $0x1, %ecx
callq 0x2bc937
movl 0x38(%rbp), %edx
movq (%rbp), %r8
movl $0x0, 0x40(%rsp)
movq %rbx, %rdi
movl 0x2c(%rsp), %esi
xorl %ecx, %ecx
callq 0x2bc937
jmp 0x2e6aa1
cmpq $0x0, 0x10(%r13)
jne 0x2e6951
movq 0x48(%rsp), %rax
testb $0x8, 0x2c(%rax)
jne 0x2e6951
movq 0x8(%rsp), %rdi
movl $0x78, %esi
movl 0x20(%rsp), %edx
jmp 0x2e6960
movq 0x8(%rsp), %rdi
movl $0x7f, %esi
movq 0x18(%rsp), %rdx
movl 0x14(%rsp), %ecx
xorl %r8d, %r8d
callq 0x2a83e1
movl %eax, 0x30(%rsp)
jmp 0x2e69b6
leal -0x1(%rax), %ecx
testl %r14d, %r14d
cmovnsl %r14d, %ecx
movslq %ecx, %rcx
leaq (%rcx,%rcx,2), %rcx
shlq $0x3, %rcx
movq 0x8(%rsp), %rdx
addq 0x88(%rdx), %rcx
movl %eax, 0x8(%rcx)
cmpl $0x0, 0x54(%rsp)
jle 0x2e69b6
movq 0x10(%rbx), %rdi
movl $0x97, %esi
movl 0x54(%rsp), %edx
movl 0x14(%rsp), %ecx
xorl %r8d, %r8d
callq 0x2a83e1
movw $0x29, %r14w
movq 0x48(%rsp), %rax
testb $0x4, 0x2c(%rax)
je 0x2e69e3
movq 0x8(%rsp), %rdi
movl $0x81, %esi
movl 0x20(%rsp), %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x2a83e1
movw $0x18, %r14w
movq 0x8(%rsp), %r15
movq %r15, %rdi
movl $0x7e, %esi
movq 0x18(%rsp), %rdx
movl 0x38(%rsp), %r12d
movl %r12d, %ecx
movl $0x1, %r8d
callq 0x2a83e1
movq %r15, %rdi
movl $0x79, %esi
movl 0x20(%rsp), %edx
movl %r12d, %ecx
movl 0x14(%rsp), %r8d
callq 0x2a83e1
movq %r15, %rdi
movl %eax, %esi
movq %r13, %rdx
movl $0xfffffffa, %ecx       # imm = 0xFFFFFFFA
callq 0x27b778
movslq 0x90(%r15), %rax
testq %rax, %rax
jle 0x2e6a55
movq 0x8(%rsp), %rcx
movq 0x88(%rcx), %rcx
leaq (%rax,%rax,2), %rax
movw %r14w, -0x16(%rcx,%rax,8)
movq 0x8(%rsp), %r14
movq %r14, %rdi
movl $0x5, %esi
movq 0x18(%rsp), %r15
movl %r15d, %edx
movl 0x30(%rsp), %ecx
xorl %r8d, %r8d
callq 0x2a83e1
movq %r14, %rdi
movl $0x74, %esi
movl %r15d, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x2a83e1
movq %r14, %rdi
movl $0x74, %esi
movl 0x20(%rsp), %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x2a83e1
movq 0x10(%r13), %r15
testq %r15, %r15
je 0x2e6d15
movl 0x38(%rsp), %r12d
movq 0x10(%rbp), %r13
testq %r13, %r13
je 0x2e6ad1
movq %r15, %rdi
movq %r13, %rsi
callq 0x2e71c5
testl %eax, %eax
jne 0x2e6ad4
movq 0x28(%r13), %r13
jmp 0x2e6ab7
xorl %r13d, %r13d
movl 0x58(%r13), %ecx
movq 0x8(%rsp), %r14
movq %r14, %rdi
movl $0x60, %esi
movq 0x18(%rsp), %rdx
movl 0x2c(%rsp), %r8d
callq 0x2a83e1
movq %rbx, %rdi
movq %r13, %rsi
callq 0x2bca31
movl 0x58(%r15), %ecx
movq %r14, %rdi
movl $0x61, %esi
movl 0x20(%rsp), %edx
movl 0x3c(%rsp), %r8d
callq 0x2a83e1
movq %rbx, %rdi
movq %r15, %rsi
callq 0x2bca31
movslq 0x90(%r14), %rax
testq %rax, %rax
jle 0x2e6b47
movq 0x8(%rsp), %rcx
movq 0x88(%rcx), %rcx
leaq (%rax,%rax,2), %rax
movw $0x1, -0x16(%rcx,%rax,8)
movq 0x8(%rsp), %rdi
movl $0x25, %esi
movq 0x18(%rsp), %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x2a83e1
movq %rax, 0x30(%rsp)
movq 0x48(%rsp), %rax
testb $0x4, 0x2c(%rax)
jne 0x2e6b9b
movw $0x8, %r13w
testb $-0x80, 0x40(%rbp)
je 0x2e6c1d
movzwl 0x63(%r15), %eax
andl $0x3, %eax
xorl %r13d, %r13d
cmpw $0x2, %ax
sete %r13b
orl $0x8, %r13d
jmp 0x2e6c1d
movzwl 0x60(%r13), %eax
testl %eax, %eax
je 0x2e6bf5
movq 0x40(%r13), %rdx
movl %eax, %esi
xorl %ecx, %ecx
movq (%rdx,%rcx,8), %rdi
testq %rdi, %rdi
je 0x2e6bf7
xorl %r8d, %r8d
leaq 0xeafa1(%rip), %r9      # 0x3d1b60
movzbl (%r8,%r9), %r9d
movzbl (%rdi,%r8), %r10d
cmpb %r10b, %r9b
jne 0x2e6bd5
testq %r9, %r9
jne 0x2e6be6
jmp 0x2e6beb
leaq 0xea704(%rip), %r11     # 0x3d12e0
movb (%r9,%r11), %r9b
cmpb (%r10,%r11), %r9b
jne 0x2e6bf7
incq %r8
jmp 0x2e6bb8
incq %rcx
cmpq %rsi, %rcx
jne 0x2e6bac
jmp 0x2e6c00
xorl %ecx, %ecx
movw $0x8, %r13w
cmpl %eax, %ecx
jne 0x2e6c1d
movq 0x8(%rsp), %rdi
movl $0x81, %esi
movl 0x20(%rsp), %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x2a83e1
movw $0x18, %r13w
movq 0x8(%rsp), %r14
movq %r14, %rdi
movl $0x7e, %esi
movq 0x18(%rsp), %rdx
movl %r12d, %ecx
movl $0x1, %r8d
callq 0x2a83e1
movq %r14, %rdi
movl $0x82, %esi
movl 0x20(%rsp), %edx
movl %r12d, %ecx
xorl %r8d, %r8d
callq 0x2a83e1
movslq 0x90(%r14), %rax
testq %rax, %rax
jle 0x2e6c76
movq 0x8(%rsp), %rcx
movq 0x88(%rcx), %rcx
leaq (%rax,%rax,2), %rax
movw %r13w, -0x16(%rcx,%rax,8)
movq 0x30(%rsp), %rax
leal 0x1(%rax), %ecx
movq 0x8(%rsp), %r14
movq %r14, %rdi
movl $0x5, %esi
movq 0x18(%rsp), %rdx
xorl %r8d, %r8d
callq 0x2a83e1
movl 0x90(%r14), %eax
movq (%r14), %rcx
cmpb $0x0, 0x61(%rcx)
leaq 0x1d81db(%rip), %rcx    # 0x4bee88
jne 0x2e6cd3
leal -0x1(%rax), %ecx
movq 0x30(%rsp), %rdx
testl %edx, %edx
cmovnsl %edx, %ecx
movslq %ecx, %rcx
leaq (%rcx,%rcx,2), %rcx
shlq $0x3, %rcx
movq 0x8(%rsp), %rdx
addq 0x88(%rdx), %rcx
movl %eax, 0x8(%rcx)
movq 0x8(%rsp), %r14
movq %r14, %rdi
movl $0x74, %esi
movq 0x18(%rsp), %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x2a83e1
movq %r14, %rdi
movl $0x74, %esi
movl 0x20(%rsp), %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x2a83e1
movq 0x28(%r15), %r15
testq %r15, %r15
jne 0x2e6ab3
cmpl $0x0, 0x40(%rsp)
je 0x2e6d5f
movq 0x8(%rsp), %rcx
movl 0x90(%rcx), %eax
movq (%rcx), %rcx
cmpb $0x0, 0x61(%rcx)
je 0x2e6d39
leaq 0x1d8151(%rip), %rcx    # 0x4bee88
jmp 0x2e6d5c
leal -0x1(%rax), %ecx
movl 0x40(%rsp), %edx
testl %edx, %edx
cmovnsl %edx, %ecx
movslq %ecx, %rcx
leaq (%rcx,%rcx,2), %rcx
shlq $0x3, %rcx
movq 0x8(%rsp), %rdx
addq 0x88(%rdx), %rcx
movl %eax, 0x8(%rcx)
cmpl $0x0, 0x14(%rsp)
je 0x2e6d81
movzbl 0x1f(%rbx), %eax
cmpq $0x7, %rax
ja 0x2e6d81
leal 0x1(%rax), %ecx
movb %cl, 0x1f(%rbx)
movl 0x14(%rsp), %ecx
movl %ecx, 0xd4(%rbx,%rax,4)
cmpl $0x0, 0x38(%rsp)
je 0x2e6da3
movzbl 0x1f(%rbx), %eax
cmpq $0x7, %rax
ja 0x2e6da3
leal 0x1(%rax), %ecx
movb %cl, 0x1f(%rbx)
movl 0x38(%rsp), %ecx
movl %ecx, 0xd4(%rbx,%rax,4)
cmpl $0x0, 0x44(%rsp)
je 0x2e6df0
cmpq $0x0, 0x98(%rbx)
je 0x2e6dbc
movq %rbx, %rdi
callq 0x2e3a7e
xorl %r15d, %r15d
movq 0x8(%rsp), %rbx
movq %rbx, %rdi
movl $0x44, %esi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x2a83e1
movl 0x90(%rbx), %eax
movq (%rbx), %rcx
cmpb $0x0, 0x61(%rcx)
je 0x2e6dfb
leaq 0x1d809a(%rip), %rcx    # 0x4bee88
jmp 0x2e6e1e
movl $0x1, %r15d
jmp 0x2e668e
leal -0x1(%rax), %ecx
movl 0x44(%rsp), %edx
testl %edx, %edx
cmovnsl %edx, %ecx
movslq %ecx, %rcx
leaq (%rcx,%rcx,2), %rcx
shlq $0x3, %rcx
movq 0x8(%rsp), %rdx
addq 0x88(%rdx), %rcx
movl %eax, 0x8(%rcx)
movq 0x8(%rsp), %rdi
movl $0x74, %esi
movl 0x20(%rsp), %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x2a83e1
jmp 0x2e668e