// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl %ecx, -0x24(%rbp)
movl %r8d, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x30(%rbp)
movl $0x0, -0x74(%rbp)
movl $0x0, -0x78(%rbp)
movl $0x0, -0x88(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x4609d4
movl $0x0, -0x4(%rbp)
jmp 0x46155f
movq -0x10(%rbp), %rax
cmpq $0x0, 0x190(%rax)
jne 0x4609ed
movq -0x20(%rbp), %rax
cmpq $0x0, 0x68(%rax)
je 0x4609f9
movl $0x0, -0x4(%rbp)
jmp 0x46155f
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x43e5c0
cmpq $0x0, %rax
je 0x460a18
movl $0x0, -0x4(%rbp)
jmp 0x46155f
movq -0x18(%rbp), %rax
cmpl $0x0, 0x54(%rax)
je 0x460a2e
movl $0x0, -0x4(%rbp)
jmp 0x46155f
cmpl $0xb, -0x24(%rbp)
jne 0x460a5b
movq -0x18(%rbp), %rax
movswl 0x44(%rax), %eax
cmpl $0x0, %eax
jl 0x460a4c
movq -0x18(%rbp), %rax
movzbl 0x4e(%rax), %eax
movl %eax, -0x24(%rbp)
cmpl $0xb, -0x24(%rbp)
jne 0x460a59
movl $0x2, -0x24(%rbp)
jmp 0x460a5b
movq -0x20(%rbp), %rax
movq 0x28(%rax), %rax
cmpl $0x1, (%rax)
je 0x460a74
movl $0x0, -0x4(%rbp)
jmp 0x46155f
movq -0x20(%rbp), %rax
movq 0x28(%rax), %rax
cmpq $0x0, 0x30(%rax)
je 0x460a8f
movl $0x0, -0x4(%rbp)
jmp 0x46155f
movq -0x20(%rbp), %rax
cmpq $0x0, 0x30(%rax)
je 0x460aa6
movl $0x0, -0x4(%rbp)
jmp 0x46155f
movq -0x20(%rbp), %rax
cmpq $0x0, 0x48(%rax)
je 0x460abd
movl $0x0, -0x4(%rbp)
jmp 0x46155f
movq -0x20(%rbp), %rax
cmpq $0x0, 0x38(%rax)
je 0x460ad4
movl $0x0, -0x4(%rbp)
jmp 0x46155f
movq -0x20(%rbp), %rax
cmpq $0x0, 0x60(%rax)
je 0x460aeb
movl $0x0, -0x4(%rbp)
jmp 0x46155f
movq -0x20(%rbp), %rax
cmpq $0x0, 0x50(%rax)
je 0x460b02
movl $0x0, -0x4(%rbp)
jmp 0x46155f
movq -0x20(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x460b1d
movl $0x0, -0x4(%rbp)
jmp 0x46155f
movq -0x20(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpl $0x1, (%rax)
je 0x460b3e
movl $0x0, -0x4(%rbp)
jmp 0x46155f
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rax
movzbl (%rax), %eax
cmpl $0xb1, %eax
je 0x460b5c
movl $0x0, -0x4(%rbp)
jmp 0x46155f
movq -0x20(%rbp), %rax
movq 0x28(%rax), %rax
addq $0x8, %rax
movq %rax, -0x58(%rbp)
movq -0x10(%rbp), %rdi
movq -0x58(%rbp), %rdx
xorl %esi, %esi
callq 0x43a500
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
jne 0x460b92
movl $0x0, -0x4(%rbp)
jmp 0x46155f
movq -0x40(%rbp), %rax
movl 0x38(%rax), %eax
movq -0x18(%rbp), %rcx
cmpl 0x38(%rcx), %eax
jne 0x460bc0
movq -0x40(%rbp), %rax
movq 0x70(%rax), %rax
movq -0x18(%rbp), %rcx
cmpq 0x70(%rcx), %rax
jne 0x460bc0
movl $0x0, -0x4(%rbp)
jmp 0x46155f
movq -0x18(%rbp), %rax
movl 0x40(%rax), %eax
andl $0x80, %eax
cmpl $0x0, %eax
sete %al
andb $0x1, %al
movzbl %al, %eax
movq -0x40(%rbp), %rcx
movl 0x40(%rcx), %ecx
andl $0x80, %ecx
cmpl $0x0, %ecx
sete %cl
andb $0x1, %cl
movzbl %cl, %ecx
cmpl %ecx, %eax
je 0x460c00
movl $0x0, -0x4(%rbp)
jmp 0x46155f
movq -0x40(%rbp), %rax
cmpl $0x0, 0x54(%rax)
je 0x460c16
movl $0x0, -0x4(%rbp)
jmp 0x46155f
movq -0x40(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x460c2d
movl $0x0, -0x4(%rbp)
jmp 0x46155f
movq -0x18(%rbp), %rax
movswl 0x46(%rax), %eax
movq -0x40(%rbp), %rcx
movswl 0x46(%rcx), %ecx
cmpl %ecx, %eax
je 0x460c4d
movl $0x0, -0x4(%rbp)
jmp 0x46155f
movq -0x18(%rbp), %rax
movswl 0x44(%rax), %eax
movq -0x40(%rbp), %rcx
movswl 0x44(%rcx), %ecx
cmpl %ecx, %eax
je 0x460c6d
movl $0x0, -0x4(%rbp)
jmp 0x46155f
movl $0x0, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
movq -0x18(%rbp), %rcx
movswl 0x46(%rcx), %ecx
cmpl %ecx, %eax
jge 0x460e46
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x5c(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, -0x98(%rbp)
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x5c(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, -0xa0(%rbp)
movq -0x98(%rbp), %rax
movzwl 0x1c(%rax), %eax
andl $0x60, %eax
movq -0xa0(%rbp), %rcx
movzwl 0x1c(%rcx), %ecx
andl $0x60, %ecx
cmpl %ecx, %eax
je 0x460ce7
movl $0x0, -0x4(%rbp)
jmp 0x46155f
movq -0x98(%rbp), %rax
movzwl 0x1c(%rax), %eax
andl $0x60, %eax
cmpl $0x0, %eax
je 0x460d31
movq -0xa0(%rbp), %rax
movq 0x8(%rax), %rsi
movq -0x98(%rbp), %rax
movq 0x8(%rax), %rdx
xorl %eax, %eax
movl %eax, %edi
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
callq 0x42fc30
cmpl $0x0, %eax
je 0x460d2f
movl $0x0, -0x4(%rbp)
jmp 0x46155f
jmp 0x460d31
movq -0x98(%rbp), %rax
movsbl 0x19(%rax), %eax
movq -0xa0(%rbp), %rcx
movsbl 0x19(%rcx), %ecx
cmpl %ecx, %eax
je 0x460d57
movl $0x0, -0x4(%rbp)
jmp 0x46155f
movq -0x98(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0xa0(%rbp), %rax
movq 0x10(%rax), %rsi
callq 0x3c3e00
cmpl $0x0, %eax
je 0x460d83
movl $0x0, -0x4(%rbp)
jmp 0x46155f
movq -0x98(%rbp), %rax
movzbl 0x18(%rax), %eax
cmpl $0x0, %eax
je 0x460dac
movq -0xa0(%rbp), %rax
cmpb $0x0, 0x18(%rax)
jne 0x460dac
movl $0x0, -0x4(%rbp)
jmp 0x46155f
movq -0x98(%rbp), %rax
movzwl 0x1c(%rax), %eax
andl $0x60, %eax
cmpl $0x0, %eax
jne 0x460e36
cmpl $0x0, -0x5c(%rbp)
jle 0x460e36
movq -0x98(%rbp), %rax
cmpq $0x0, 0x8(%rax)
sete %al
andb $0x1, %al
movzbl %al, %eax
movq -0xa0(%rbp), %rcx
cmpq $0x0, 0x8(%rcx)
sete %cl
andb $0x1, %cl
movzbl %cl, %ecx
cmpl %ecx, %eax
jne 0x460e28
movq -0x98(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x460e34
movq -0x98(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rdi
movq -0xa0(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rsi
callq 0x19980
cmpl $0x0, %eax
je 0x460e34
movl $0x0, -0x4(%rbp)
jmp 0x46155f
jmp 0x460e36
jmp 0x460e38
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0x460c74
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x50(%rbp)
cmpq $0x0, -0x50(%rbp)
je 0x460f0e
movq -0x50(%rbp), %rax
movzbl 0x62(%rax), %eax
cmpl $0x0, %eax
je 0x460e74
movl $0x1, -0x88(%rbp)
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x48(%rbp)
je 0x460eab
movq -0x50(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq 0x461c70
cmpl $0x0, %eax
je 0x460e9b
jmp 0x460eab
jmp 0x460e9d
movq -0x48(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x48(%rbp)
jmp 0x460e80
cmpq $0x0, -0x48(%rbp)
jne 0x460ebe
movl $0x0, -0x4(%rbp)
jmp 0x46155f
movq -0x48(%rbp), %rax
movl 0x58(%rax), %eax
movq -0x50(%rbp), %rcx
cmpl 0x58(%rcx), %eax
jne 0x460efb
movq -0x40(%rbp), %rax
movq 0x70(%rax), %rax
movq -0x18(%rbp), %rcx
cmpq 0x70(%rcx), %rax
jne 0x460efb
movl $0x19b, %edi            # imm = 0x19B
callq 0x3d5070
cmpl $0x0, %eax
jne 0x460efb
movl $0x0, -0x4(%rbp)
jmp 0x46155f
jmp 0x460efd
movq -0x50(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x50(%rbp)
jmp 0x460e52
movq -0x18(%rbp), %rax
cmpq $0x0, 0x30(%rax)
je 0x460f44
movq -0x40(%rbp), %rax
movq 0x30(%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x430350
cmpl $0x0, %eax
je 0x460f44
movl $0x0, -0x4(%rbp)
jmp 0x46155f
movq -0x30(%rbp), %rax
movq 0x30(%rax), %rax
andq $0x4000, %rax           # imm = 0x4000
cmpq $0x0, %rax
je 0x460f6f
movq -0x18(%rbp), %rax
cmpq $0x0, 0x20(%rax)
je 0x460f6f
movl $0x0, -0x4(%rbp)
jmp 0x46155f
movq -0x30(%rbp), %rcx
movabsq $0x100000000, %rax      # imm = 0x100000000
andq 0x30(%rcx), %rax
cmpq $0x0, %rax
je 0x460f93
movl $0x0, -0x4(%rbp)
jmp 0x46155f
movq -0x30(%rbp), %rdi
movq -0x40(%rbp), %rax
movq 0x70(%rax), %rsi
callq 0x3cb770
movl %eax, -0x60(%rbp)
movq -0x10(%rbp), %rdi
callq 0x4299d0
movq %rax, -0x80(%rbp)
movq -0x10(%rbp), %rdi
movl -0x60(%rbp), %esi
callq 0x431940
movq -0x10(%rbp), %rcx
movl 0x34(%rcx), %eax
movl %eax, %edx
addl $0x1, %edx
movl %edx, 0x34(%rcx)
movl %eax, -0x64(%rbp)
movq -0x10(%rbp), %rcx
movl 0x34(%rcx), %eax
movl %eax, %edx
addl $0x1, %edx
movl %edx, 0x34(%rcx)
movl %eax, -0x68(%rbp)
movq -0x10(%rbp), %rdi
movl -0x28(%rbp), %esi
movq -0x18(%rbp), %rdx
callq 0x461570
movl %eax, -0x84(%rbp)
movq -0x10(%rbp), %rdi
callq 0x42f190
movl %eax, -0x8c(%rbp)
movq -0x10(%rbp), %rdi
callq 0x42f190
movl %eax, -0x90(%rbp)
movq -0x10(%rbp), %rdi
movl -0x68(%rbp), %esi
movl -0x28(%rbp), %edx
movq -0x18(%rbp), %rcx
movl $0x61, %r8d
callq 0x429e70
movq -0x30(%rbp), %rax
movl 0x2c(%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
jne 0x4610a0
movq -0x18(%rbp), %rax
movswl 0x44(%rax), %eax
cmpl $0x0, %eax
jge 0x461058
movq -0x18(%rbp), %rax
cmpq $0x0, 0x10(%rax)
jne 0x46106d
cmpl $0x0, -0x88(%rbp)
jne 0x46106d
cmpl $0x2, -0x24(%rbp)
je 0x4610a0
cmpl $0x1, -0x24(%rbp)
je 0x4610a0
movq -0x80(%rbp), %rdi
movl -0x68(%rbp), %edx
movl $0x25, %esi
xorl %ecx, %ecx
callq 0x410100
movl %eax, -0x6c(%rbp)
movq -0x80(%rbp), %rdi
movl $0xb, %esi
callq 0x429a40
movl %eax, -0x74(%rbp)
movq -0x80(%rbp), %rdi
movl -0x6c(%rbp), %esi
callq 0x429a70
movq -0x40(%rbp), %rax
movl 0x40(%rax), %eax
andl $0x80, %eax
cmpl $0x0, %eax
jne 0x461272
movq -0x10(%rbp), %rdi
movl -0x64(%rbp), %esi
movl -0x60(%rbp), %edx
movq -0x40(%rbp), %rcx
movl $0x60, %r8d
callq 0x429e70
movq -0x80(%rbp), %rdi
movl -0x64(%rbp), %edx
movl $0x25, %esi
xorl %ecx, %ecx
callq 0x410100
movl %eax, -0x78(%rbp)
movq -0x18(%rbp), %rax
movswl 0x44(%rax), %eax
cmpl $0x0, %eax
jl 0x46115b
movq -0x80(%rbp), %rdi
movl -0x64(%rbp), %edx
movl -0x90(%rbp), %ecx
movl $0x7f, %esi
callq 0x410100
movl %eax, -0x6c(%rbp)
movq -0x80(%rbp), %rdi
movl -0x68(%rbp), %edx
movl -0x90(%rbp), %r8d
movl $0x20, %esi
xorl %ecx, %ecx
callq 0x410130
movl %eax, -0x70(%rbp)
movq -0x10(%rbp), %rdi
movl -0x24(%rbp), %esi
movq -0x18(%rbp), %rdx
callq 0x460670
movq -0x80(%rbp), %rdi
movl -0x70(%rbp), %esi
callq 0x429a70
movq -0x10(%rbp), %rdi
movl -0x84(%rbp), %esi
movl -0x90(%rbp), %edx
callq 0x461c10
jmp 0x4611ad
movq -0x18(%rbp), %rax
cmpq $0x0, 0x10(%rax)
jne 0x461191
movq -0x30(%rbp), %rax
movl 0x2c(%rax), %eax
andl $0x8, %eax
cmpl $0x0, %eax
jne 0x461191
movq -0x80(%rbp), %rdi
movl -0x68(%rbp), %edx
movl -0x90(%rbp), %ecx
movl $0x78, %esi
callq 0x410100
movl %eax, -0x6c(%rbp)
jmp 0x4611ab
movq -0x80(%rbp), %rdi
movl -0x64(%rbp), %edx
movl -0x90(%rbp), %ecx
movl $0x7f, %esi
callq 0x410100
movl %eax, -0x6c(%rbp)
jmp 0x4611ad
movq -0x30(%rbp), %rax
movl 0x2c(%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x4611d6
movq -0x80(%rbp), %rdi
movl -0x68(%rbp), %edx
movl $0x81, %esi
callq 0x42ba70
movb $0x18, -0xa1(%rbp)
jmp 0x4611dd
movb $0x29, -0xa1(%rbp)
movq -0x80(%rbp), %rdi
movl -0x64(%rbp), %edx
movl -0x8c(%rbp), %ecx
movl $0x7e, %esi
movl $0x1, %r8d
callq 0x410130
movq -0x80(%rbp), %rdi
movl -0x68(%rbp), %edx
movl -0x8c(%rbp), %ecx
movl -0x90(%rbp), %r8d
movq -0x18(%rbp), %r9
movl $0x79, %esi
movl $0xfffffffa, (%rsp)     # imm = 0xFFFFFFFA
callq 0x429aa0
movq -0x80(%rbp), %rdi
movzbl -0xa1(%rbp), %eax
movzwl %ax, %esi
callq 0x3cb9f0
movq -0x80(%rbp), %rdi
movl -0x64(%rbp), %edx
movl -0x6c(%rbp), %ecx
movl $0x5, %esi
callq 0x410100
movq -0x80(%rbp), %rdi
movl -0x64(%rbp), %edx
movl $0x74, %esi
xorl %ecx, %ecx
callq 0x410100
movq -0x80(%rbp), %rdi
movl -0x68(%rbp), %edx
movl $0x74, %esi
xorl %ecx, %ecx
callq 0x410100
jmp 0x4612ad
movq -0x10(%rbp), %rdi
movl -0x28(%rbp), %esi
movq -0x18(%rbp), %rax
movl 0x38(%rax), %edx
movq -0x18(%rbp), %rax
movq (%rax), %r8
movl $0x1, %ecx
callq 0x429f80
movq -0x10(%rbp), %rdi
movl -0x60(%rbp), %esi
movq -0x40(%rbp), %rax
movl 0x38(%rax), %edx
movq -0x40(%rbp), %rax
movq (%rax), %r8
xorl %ecx, %ecx
callq 0x429f80
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x50(%rbp)
cmpq $0x0, -0x50(%rbp)
je 0x4614df
movb $0x0, -0xa2(%rbp)
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x48(%rbp)
je 0x461302
movq -0x50(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq 0x461c70
cmpl $0x0, %eax
je 0x4612f2
jmp 0x461302
jmp 0x4612f4
movq -0x48(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x48(%rbp)
jmp 0x4612d7
movq -0x80(%rbp), %rdi
movl -0x64(%rbp), %edx
movq -0x48(%rbp), %rax
movl 0x58(%rax), %ecx
movl -0x60(%rbp), %r8d
movl $0x60, %esi
callq 0x410130
movq -0x10(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq 0x42a150
movq -0x80(%rbp), %rdi
movl -0x68(%rbp), %edx
movq -0x50(%rbp), %rax
movl 0x58(%rax), %ecx
movl -0x28(%rbp), %r8d
movl $0x61, %esi
callq 0x410130
movq -0x10(%rbp), %rdi
movq -0x50(%rbp), %rsi
callq 0x42a150
movq -0x80(%rbp), %rdi
movl $0x1, %esi
callq 0x3cb9f0
movq -0x80(%rbp), %rdi
movl -0x64(%rbp), %edx
movl $0x25, %esi
xorl %ecx, %ecx
callq 0x410100
movl %eax, -0x6c(%rbp)
movq -0x30(%rbp), %rax
movl 0x2c(%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x461404
movl $0x0, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
movq -0x48(%rbp), %rcx
movzwl 0x60(%rcx), %ecx
cmpl %ecx, %eax
jge 0x4613db
movq -0x48(%rbp), %rax
movq 0x40(%rax), %rax
movslq -0x5c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0xb0(%rbp)
movq -0xb0(%rbp), %rsi
leaq 0x145913(%rip), %rdi    # 0x5a6cd5
callq 0x3c3e00
cmpl $0x0, %eax
je 0x4613ce
jmp 0x4613db
jmp 0x4613d0
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0x46138e
movl -0x5c(%rbp), %eax
movq -0x48(%rbp), %rcx
movzwl 0x60(%rcx), %ecx
cmpl %ecx, %eax
jne 0x461402
movb $0x10, -0xa2(%rbp)
movq -0x80(%rbp), %rdi
movl -0x68(%rbp), %edx
movl $0x81, %esi
callq 0x42ba70
jmp 0x46143b
movq -0x40(%rbp), %rax
movl 0x40(%rax), %eax
andl $0x80, %eax
cmpl $0x0, %eax
je 0x461439
movq -0x50(%rbp), %rax
movw 0x63(%rax), %ax
andw $0x3, %ax
movzwl %ax, %eax
cmpl $0x2, %eax
jne 0x461439
movzbl -0xa2(%rbp), %eax
orl $0x1, %eax
movb %al, -0xa2(%rbp)
jmp 0x46143b
movq -0x80(%rbp), %rdi
movl -0x64(%rbp), %edx
movl -0x8c(%rbp), %ecx
movl $0x7e, %esi
movl $0x1, %r8d
callq 0x410130
movq -0x80(%rbp), %rdi
movl -0x68(%rbp), %edx
movl -0x8c(%rbp), %ecx
movl $0x82, %esi
callq 0x410100
movq -0x80(%rbp), %rdi
movzbl -0xa2(%rbp), %eax
orl $0x8, %eax
movzwl %ax, %esi
callq 0x3cb9f0
movq -0x80(%rbp), %rdi
movl -0x64(%rbp), %edx
movl -0x6c(%rbp), %ecx
addl $0x1, %ecx
movl $0x5, %esi
callq 0x410100
movq -0x80(%rbp), %rdi
movl -0x6c(%rbp), %esi
callq 0x429a70
movq -0x80(%rbp), %rdi
movl -0x64(%rbp), %edx
movl $0x74, %esi
xorl %ecx, %ecx
callq 0x410100
movq -0x80(%rbp), %rdi
movl -0x68(%rbp), %edx
movl $0x74, %esi
xorl %ecx, %ecx
callq 0x410100
movq -0x50(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x50(%rbp)
jmp 0x4612b9
cmpl $0x0, -0x78(%rbp)
je 0x4614f1
movq -0x80(%rbp), %rdi
movl -0x78(%rbp), %esi
callq 0x429a70
movq -0x10(%rbp), %rdi
movl -0x90(%rbp), %esi
callq 0x42e560
movq -0x10(%rbp), %rdi
movl -0x8c(%rbp), %esi
callq 0x42e560
cmpl $0x0, -0x74(%rbp)
je 0x461558
movq -0x10(%rbp), %rdi
callq 0x45ad60
movq -0x80(%rbp), %rdi
movl $0x44, %esi
xorl %ecx, %ecx
movl %ecx, %edx
callq 0x410100
movq -0x80(%rbp), %rdi
movl -0x74(%rbp), %esi
callq 0x429a70
movq -0x80(%rbp), %rdi
movl -0x68(%rbp), %edx
movl $0x74, %esi
xorl %ecx, %ecx
callq 0x410100
movl $0x0, -0x4(%rbp)
jmp 0x46155f
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xc0, %rsp
popq %rbp
retq
nopl (%rax,%rax)