// File: /workspace/github_c_makefile_star2_O1/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 0x2ef8e4
movq %rdi, %rbx
cmpq $0x0, 0x190(%rdi)
jne 0x2ef8e4
movq %rdx, %r14
cmpq $0x0, 0x68(%rdx)
jne 0x2ef8e4
movl %ecx, %r13d
movq %rsi, %r12
movl %r8d, 0x3c(%rsp)
movq (%rbx), %rbp
movq %rbx, %rdi
callq 0x2d4883
testq %rax, %rax
jne 0x2ef8e4
movq %rbp, 0x48(%rsp)
cmpl $0x0, 0x54(%r12)
jne 0x2ef8e4
cmpl $0xb, %r13d
jne 0x2ef5d1
cmpw $0x0, 0x44(%r12)
js 0x2ef5bf
movzbl 0x4e(%r12), %eax
jmp 0x2ef5c4
movl $0xb, %eax
cmpl $0xb, %eax
movl $0x2, %r13d
cmovnel %eax, %r13d
movq 0x28(%r14), %rdx
cmpl $0x1, (%rdx)
jne 0x2ef8e4
cmpq $0x0, 0x30(%rdx)
jne 0x2ef8e4
cmpq $0x0, 0x30(%r14)
jne 0x2ef8e4
cmpq $0x0, 0x48(%r14)
jne 0x2ef8e4
cmpq $0x0, 0x38(%r14)
jne 0x2ef8e4
cmpq $0x0, 0x60(%r14)
jne 0x2ef8e4
cmpq $0x0, 0x50(%r14)
jne 0x2ef8e4
testb $0x1, 0x4(%r14)
jne 0x2ef8e4
movq 0x20(%r14), %rax
cmpl $0x1, (%rax)
jne 0x2ef8e4
movq 0x8(%rax), %rax
cmpb $-0x4f, (%rax)
jne 0x2ef8e4
addq $0x8, %rdx
xorl %r15d, %r15d
movq %rbx, %rdi
xorl %esi, %esi
callq 0x2d1ce5
testq %rax, %rax
je 0x2ef8e4
movq %rax, %rbp
movl 0x38(%rax), %eax
cmpl 0x38(%r12), %eax
jne 0x2ef67b
movq 0x70(%rbp), %rax
cmpq 0x70(%r12), %rax
je 0x2ef8e4
movb 0x40(%rbp), %al
xorb 0x40(%r12), %al
js 0x2ef8e4
cmpl $0x0, 0x54(%rbp)
jne 0x2ef8e4
cmpq $0x0, 0x18(%rbp)
jne 0x2ef8e4
movzwl 0x46(%r12), %eax
cmpw 0x46(%rbp), %ax
jne 0x2ef8e4
movzwl 0x44(%r12), %eax
cmpw 0x44(%rbp), %ax
jne 0x2ef8e4
cmpw $0x0, 0x46(%r12)
jle 0x2ef807
xorl %r14d, %r14d
movq $0x0, 0x20(%rsp)
movq 0x8(%r12), %rax
movq 0x8(%rbp), %rcx
movq %rax, 0x8(%rsp)
movzwl 0x1c(%rax,%r14), %eax
andl $0x60, %eax
movq %rcx, 0x10(%rsp)
movzwl 0x1c(%rcx,%r14), %ecx
andl $0x60, %ecx
cmpw %cx, %ax
jne 0x2ef8e1
testw %ax, %ax
je 0x2ef735
movq 0x10(%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 0x2ca527
testl %eax, %eax
jne 0x2ef8e4
movq 0x8(%rsp), %rax
movb 0x19(%rax,%r14), %al
movq 0x10(%rsp), %rcx
cmpb 0x19(%rcx,%r14), %al
jne 0x2ef8e1
movq 0x8(%rsp), %rax
movq 0x10(%rax,%r14), %rdi
movq 0x10(%rsp), %rax
movq 0x10(%rax,%r14), %rsi
callq 0x27e905
testl %eax, %eax
jne 0x2ef8e1
movq 0x8(%rsp), %rax
cmpb $0x0, 0x18(%rax,%r14)
je 0x2ef78e
movq 0x10(%rsp), %rax
cmpb $0x0, 0x18(%rax,%r14)
je 0x2ef8e1
testq %r14, %r14
je 0x2ef7e7
movq 0x8(%rsp), %rax
movzwl 0x1c(%rax,%r14), %eax
andl $0x60, %eax
jne 0x2ef7e7
movq 0x8(%rsp), %rax
movq 0x8(%rax,%r14), %rax
testq %rax, %rax
sete %dl
movq 0x10(%rsp), %rcx
movq 0x8(%rcx,%r14), %rcx
testq %rcx, %rcx
setne %sil
cmpb %sil, %dl
je 0x2ef8e1
testq %rax, %rax
je 0x2ef7e7
movq 0x8(%rax), %rdi
movq 0x8(%rcx), %rsi
callq 0x17a40
testl %eax, %eax
jne 0x2ef8e1
movq 0x20(%rsp), %rdx
incq %rdx
movswq 0x46(%r12), %rax
addq $0x20, %r14
movq %rdx, 0x20(%rsp)
cmpq %rax, %rdx
jl 0x2ef6d7
movq 0x10(%r12), %rax
movq %rax, 0x8(%rsp)
testq %rax, %rax
je 0x2ef8a7
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 0x2ef8e4
movq 0x8(%rsp), %rdi
movq %r14, %rsi
callq 0x2f0488
testl %eax, %eax
jne 0x2ef862
movq 0x28(%r14), %r14
jmp 0x2ef842
movl 0x58(%r14), %eax
movq 0x8(%rsp), %rcx
cmpl 0x58(%rcx), %eax
jne 0x2ef892
movq 0x70(%rbp), %rax
cmpq 0x70(%r12), %rax
jne 0x2ef892
movq 0x1d6f66(%rip), %rax    # 0x4c67e8
testq %rax, %rax
je 0x2ef8e4
movl $0x19b, %edi            # imm = 0x19B
callq *%rax
testl %eax, %eax
je 0x2ef8e4
movq 0x8(%rsp), %rax
movq 0x28(%rax), %rax
movq %rax, 0x8(%rsp)
testq %rax, %rax
jne 0x2ef825
jmp 0x2ef8af
movl $0x0, 0x30(%rsp)
movq 0x30(%r12), %rsi
testq %rsi, %rsi
je 0x2ef8cb
movq 0x30(%rbp), %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2ca9c8
testl %eax, %eax
jne 0x2ef8e1
movq 0x48(%rsp), %rax
movq 0x30(%rax), %rax
btl $0xe, %eax
jb 0x2ef8f6
btq $0x20, %rax
jae 0x2ef908
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 0x2ef8e4
cmpq $0x0, 0x20(%r12)
jne 0x2ef8e4
movq 0x70(%rbp), %rax
testq %rax, %rax
je 0x2ef938
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 0x2ef926
jmp 0x2ef940
movl $0xffff8000, 0x2c(%rsp) # imm = 0xFFFF8000
movq %rbx, %rdi
callq 0x2c5ddf
movq %rax, 0x8(%rsp)
movq %rbx, %rdi
movl 0x2c(%rsp), %esi
callq 0x2cbe18
movl 0x34(%rbx), %eax
movq %rax, 0x10(%rsp)
addl $0x2, %eax
movl %eax, 0x34(%rbx)
movq %rbx, %rdi
movl 0x3c(%rsp), %esi
movq %r12, %rdx
callq 0x2f00a1
movl %eax, 0x54(%rsp)
movb 0x1f(%rbx), %al
testb %al, %al
je 0x2ef996
decb %al
movb %al, 0x1f(%rbx)
movzbl %al, %eax
movl 0xd4(%rbx,%rax,4), %eax
movl %eax, 0x38(%rsp)
jmp 0x2ef9a2
movl 0x38(%rbx), %eax
incl %eax
movl %eax, 0x38(%rsp)
movl %eax, 0x38(%rbx)
movq 0x10(%rsp), %rax
incl %eax
movl %eax, 0x20(%rsp)
movb 0x1f(%rbx), %al
testb %al, %al
je 0x2ef9c9
decb %al
movb %al, 0x1f(%rbx)
movzbl %al, %eax
movl 0xd4(%rbx,%rax,4), %eax
movl %eax, 0x1c(%rsp)
jmp 0x2ef9d5
movl 0x38(%rbx), %eax
incl %eax
movl %eax, 0x1c(%rsp)
movl %eax, 0x38(%rbx)
movq %rbx, %rdi
movl 0x20(%rsp), %esi
movl 0x3c(%rsp), %edx
movq %r12, %rcx
movl $0x61, %r8d
callq 0x2c5fdd
movl $0x0, 0x44(%rsp)
movq 0x48(%rsp), %rax
testb $0x4, 0x2c(%rax)
jne 0x2efa99
cmpw $0x0, 0x44(%r12)
jns 0x2efa16
cmpq $0x0, 0x10(%r12)
jne 0x2efa26
cmpl $0x0, 0x30(%rsp)
jne 0x2efa26
leal -0x3(%r13), %eax
cmpl $-0x3, %eax
ja 0x2efa99
movq 0x8(%rsp), %r15
movq %r15, %rdi
movl $0x25, %esi
movl 0x20(%rsp), %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x2b200c
movl %eax, %r14d
movq %r15, %rdi
movl $0xb, %esi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x2b200c
movl %eax, 0x44(%rsp)
movl 0x90(%r15), %eax
movq (%r15), %rcx
cmpb $0x0, 0x61(%rcx)
je 0x2efa75
leaq 0x1da415(%rip), %rcx    # 0x4c9e88
jmp 0x2efa96
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 0x2efb55
movq %rbx, %rdi
movq 0x10(%rsp), %r14
movl %r14d, %esi
movl 0x2c(%rsp), %edx
movq %rbp, %rcx
movl $0x60, %r8d
callq 0x2c5fdd
movq 0x8(%rsp), %rdi
movl $0x25, %esi
movl %r14d, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x2b200c
movl %eax, 0x40(%rsp)
cmpw $0x0, 0x44(%r12)
js 0x2efb91
movq 0x8(%rsp), %r15
movq %r15, %rdi
movl $0x7f, %esi
movq 0x10(%rsp), %rdx
movl 0x1c(%rsp), %r14d
movl %r14d, %ecx
xorl %r8d, %r8d
callq 0x2b200c
movl %eax, 0x30(%rsp)
movq %r15, %rdi
movl $0x20, %esi
movl 0x20(%rsp), %edx
xorl %ecx, %ecx
movl %r14d, %r8d
callq 0x2b200c
movl %eax, %r14d
movq %rbx, %rdi
movl %r13d, %esi
movq %r12, %rdx
callq 0x2ef21a
movl 0x90(%r15), %eax
movq (%r15), %rcx
cmpb $0x0, 0x61(%rcx)
je 0x2efbd5
leaq 0x1da338(%rip), %rcx    # 0x4c9e88
jmp 0x2efbf6
movl 0x38(%r12), %edx
movq (%r12), %r8
movq %rbx, %rdi
movl 0x3c(%rsp), %esi
movl $0x1, %ecx
callq 0x2c60e2
movl 0x38(%rbp), %edx
movq (%rbp), %r8
movl $0x0, 0x40(%rsp)
movq %rbx, %rdi
movl 0x2c(%rsp), %esi
xorl %ecx, %ecx
callq 0x2c60e2
jmp 0x2efd04
cmpq $0x0, 0x10(%r12)
jne 0x2efbb4
movq 0x48(%rsp), %rax
testb $0x8, 0x2c(%rax)
jne 0x2efbb4
movq 0x8(%rsp), %rdi
movl $0x78, %esi
movl 0x20(%rsp), %edx
jmp 0x2efbc3
movq 0x8(%rsp), %rdi
movl $0x7f, %esi
movq 0x10(%rsp), %rdx
movl 0x1c(%rsp), %ecx
xorl %r8d, %r8d
callq 0x2b200c
movl %eax, 0x30(%rsp)
jmp 0x2efc19
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 0x2efc19
movq 0x10(%rbx), %rdi
movl $0x97, %esi
movl 0x54(%rsp), %edx
movl 0x1c(%rsp), %ecx
xorl %r8d, %r8d
callq 0x2b200c
movw $0x29, %r14w
movq 0x48(%rsp), %rax
testb $0x4, 0x2c(%rax)
je 0x2efc46
movq 0x8(%rsp), %rdi
movl $0x81, %esi
movl 0x20(%rsp), %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x2b200c
movw $0x18, %r14w
movq 0x8(%rsp), %r15
movq %r15, %rdi
movl $0x7e, %esi
movq 0x10(%rsp), %rdx
movl 0x38(%rsp), %r13d
movl %r13d, %ecx
movl $0x1, %r8d
callq 0x2b200c
movq %r15, %rdi
movl $0x79, %esi
movl 0x20(%rsp), %edx
movl %r13d, %ecx
movl 0x1c(%rsp), %r8d
callq 0x2b200c
movq %r15, %rdi
movl %eax, %esi
movq %r12, %rdx
movl $0xfffffffa, %ecx       # imm = 0xFFFFFFFA
callq 0x285198
movslq 0x90(%r15), %rax
testq %rax, %rax
jle 0x2efcb8
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 0x10(%rsp), %r15
movl %r15d, %edx
movl 0x30(%rsp), %ecx
xorl %r8d, %r8d
callq 0x2b200c
movq %r14, %rdi
movl $0x74, %esi
movl %r15d, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x2b200c
movq %r14, %rdi
movl $0x74, %esi
movl 0x20(%rsp), %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x2b200c
movq 0x10(%r12), %r15
testq %r15, %r15
je 0x2eff78
movl 0x38(%rsp), %r12d
movq 0x10(%rbp), %r13
testq %r13, %r13
je 0x2efd35
movq %r15, %rdi
movq %r13, %rsi
callq 0x2f0488
testl %eax, %eax
jne 0x2efd35
movq 0x28(%r13), %r13
jmp 0x2efd1b
movl 0x58(%r13), %ecx
movq 0x8(%rsp), %r14
movq %r14, %rdi
movl $0x60, %esi
movq 0x10(%rsp), %rdx
movl 0x2c(%rsp), %r8d
callq 0x2b200c
movq %rbx, %rdi
movq %r13, %rsi
callq 0x2c61e4
movl 0x58(%r15), %ecx
movq %r14, %rdi
movl $0x61, %esi
movl 0x20(%rsp), %edx
movl 0x3c(%rsp), %r8d
callq 0x2b200c
movq %rbx, %rdi
movq %r15, %rsi
callq 0x2c61e4
movslq 0x90(%r14), %rax
testq %rax, %rax
jle 0x2efda8
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 0x10(%rsp), %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x2b200c
movq %rax, 0x30(%rsp)
movq 0x48(%rsp), %rax
testb $0x4, 0x2c(%rax)
jne 0x2efdfc
movw $0x8, %r13w
testb $-0x80, 0x40(%rbp)
je 0x2efe80
movzwl 0x63(%r15), %eax
andl $0x3, %eax
xorl %r13d, %r13d
cmpw $0x2, %ax
sete %r13b
orl $0x8, %r13d
jmp 0x2efe80
movzwl 0x60(%r13), %eax
testl %eax, %eax
je 0x2efe58
movq 0x40(%r13), %rdx
movl %eax, %esi
xorl %ecx, %ecx
movq (%rdx,%rcx,8), %rdi
testq %rdi, %rdi
je 0x2efe5a
xorl %r8d, %r8d
leaq 0xeb4c0(%rip), %r9      # 0x3db2e0
movzbl (%r8,%r9), %r9d
movzbl (%rdi,%r8), %r10d
cmpb %r10b, %r9b
jne 0x2efe36
testq %r9, %r9
jne 0x2efe47
jmp 0x2efe4c
leaq 0xeac23(%rip), %r11     # 0x3daa60
movb (%r9,%r11), %r9b
cmpb (%r10,%r11), %r9b
jne 0x2efe5a
incq %r8
jmp 0x2efe19
incq %rcx
cmpq %rsi, %rcx
jne 0x2efe0d
movl %eax, %ecx
jmp 0x2efe5a
xorl %ecx, %ecx
movw $0x8, %r13w
cmpl %eax, %ecx
jne 0x2efe80
movq 0x8(%rsp), %rdi
movl $0x81, %esi
movl 0x20(%rsp), %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x2b200c
movw $0x18, %r13w
movq 0x8(%rsp), %r14
movq %r14, %rdi
movl $0x7e, %esi
movq 0x10(%rsp), %rdx
movl %r12d, %ecx
movl $0x1, %r8d
callq 0x2b200c
movq %r14, %rdi
movl $0x82, %esi
movl 0x20(%rsp), %edx
movl %r12d, %ecx
xorl %r8d, %r8d
callq 0x2b200c
movslq 0x90(%r14), %rax
testq %rax, %rax
jle 0x2efed9
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 0x10(%rsp), %rdx
xorl %r8d, %r8d
callq 0x2b200c
movl 0x90(%r14), %eax
movq (%r14), %rcx
cmpb $0x0, 0x61(%rcx)
leaq 0x1d9f78(%rip), %rcx    # 0x4c9e88
jne 0x2eff36
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 0x10(%rsp), %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x2b200c
movq %r14, %rdi
movl $0x74, %esi
movl 0x20(%rsp), %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x2b200c
movq 0x28(%r15), %r15
testq %r15, %r15
jne 0x2efd17
cmpl $0x0, 0x40(%rsp)
je 0x2effc2
movq 0x8(%rsp), %rcx
movl 0x90(%rcx), %eax
movq (%rcx), %rcx
cmpb $0x0, 0x61(%rcx)
je 0x2eff9c
leaq 0x1d9eee(%rip), %rcx    # 0x4c9e88
jmp 0x2effbf
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, 0x1c(%rsp)
je 0x2effe4
movzbl 0x1f(%rbx), %eax
cmpq $0x7, %rax
ja 0x2effe4
leal 0x1(%rax), %ecx
movb %cl, 0x1f(%rbx)
movl 0x1c(%rsp), %ecx
movl %ecx, 0xd4(%rbx,%rax,4)
cmpl $0x0, 0x38(%rsp)
je 0x2f0006
movzbl 0x1f(%rbx), %eax
cmpq $0x7, %rax
ja 0x2f0006
leal 0x1(%rax), %ecx
movb %cl, 0x1f(%rbx)
movl 0x38(%rsp), %ecx
movl %ecx, 0xd4(%rbx,%rax,4)
cmpl $0x0, 0x44(%rsp)
je 0x2f0053
cmpq $0x0, 0x98(%rbx)
je 0x2f001f
movq %rbx, %rdi
callq 0x2ecd3e
xorl %r15d, %r15d
movq 0x8(%rsp), %rbx
movq %rbx, %rdi
movl $0x44, %esi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x2b200c
movl 0x90(%rbx), %eax
movq (%rbx), %rcx
cmpb $0x0, 0x61(%rcx)
je 0x2f005e
leaq 0x1d9e37(%rip), %rcx    # 0x4c9e88
jmp 0x2f0081
movl $0x1, %r15d
jmp 0x2ef8e4
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 0x2b200c
jmp 0x2ef8e4