// File: /workspace/github_c_makefile_star2_O1/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: sqlite3DeleteFrom
SQLITE_PRIVATE void sqlite3DeleteFrom(
  Parse *pParse,         /* The parser context */
  SrcList *pTabList,     /* The table from which we should delete things */
  Expr *pWhere           /* The WHERE clause.  May be null */
){
  Vdbe *v;               /* The virtual database engine */
  Table *pTab;           /* The table from which records will be deleted */
  const char *zDb;       /* Name of database holding pTab */
  int i;                 /* Loop counter */
  WhereInfo *pWInfo;     /* Information about the WHERE clause */
  Index *pIdx;           /* For looping over indices of the table */
  int iTabCur;           /* Cursor number for the table */
  int iDataCur = 0;      /* VDBE cursor for the canonical data source */
  int iIdxCur = 0;       /* Cursor number of the first index */
  int nIdx;              /* Number of indices */
  sqlite3 *db;           /* Main database structure */
  AuthContext sContext;  /* Authorization context */
  NameContext sNC;       /* Name context to resolve expressions in */
  int iDb;               /* Database number */
  int memCnt = -1;       /* Memory cell used for change counting */
  int rcauth;            /* Value returned by authorization callback */
  int eOnePass;          /* ONEPASS_OFF or _SINGLE or _MULTI */
  int aiCurOnePass[2];   /* The write cursors opened by WHERE_ONEPASS */
  u8 *aToOpen = 0;       /* Open cursor iTabCur+j if aToOpen[j] is true */
  Index *pPk;            /* The PRIMARY KEY index on the table */
  int iPk = 0;           /* First of nPk registers holding PRIMARY KEY value */
  i16 nPk = 1;           /* Number of columns in the PRIMARY KEY */
  int iKey;              /* Memory cell holding key of row to be deleted */
  i16 nKey;              /* Number of memory cells in the row key */
  int iEphCur = 0;       /* Ephemeral table holding all primary key values */
  int iRowSet = 0;       /* Register for rowset of rows to delete */
  int addrBypass = 0;    /* Address of jump over the delete logic */
  int addrLoop = 0;      /* Top of the delete loop */
  int addrEphOpen = 0;   /* Instruction to open the Ephemeral table */
 
#ifndef SQLITE_OMIT_TRIGGER
  int isView;                  /* True if attempting to delete from a view */
  Trigger *pTrigger;           /* List of table triggers, if required */
  int bComplex;                /* True if there are either triggers or FKs */
#endif

  memset(&sContext, 0, sizeof(sContext));
  db = pParse->db;
  if( pParse->nErr || db->mallocFailed ){
    goto delete_from_cleanup;
  }
  assert( pTabList->nSrc==1 );

  /* Locate the table which we want to delete.  This table has to be
  ** put in an SrcList structure because some of the subroutines we
  ** will be calling are designed to work with multiple tables and expect
  ** an SrcList* parameter instead of just a Table* parameter.
  */
  pTab = sqlite3SrcListLookup(pParse, pTabList);
  if( pTab==0 )  goto delete_from_cleanup;

  /* Figure out if we have any triggers and if the table being
  ** deleted from is a view
  */
#ifndef SQLITE_OMIT_TRIGGER
  pTrigger = sqlite3TriggersExist(pParse, pTab, TK_DELETE, 0, 0);
  isView = pTab->pSelect!=0;
  bComplex = pTrigger || sqlite3FkRequired(pParse, pTab, 0, 0);
#else
# define pTrigger 0
# define isView 0
# define bComplex 0
#endif
#ifdef SQLITE_OMIT_VIEW
# undef isView
# define isView 0
#endif

  /* If pTab is really a view, make sure it has been initialized.
  */
  if( sqlite3ViewGetColumnNames(pParse, pTab) ){
    goto delete_from_cleanup;
  }

  if( sqlite3IsReadOnly(pParse, pTab, (pTrigger?1:0)) ){
    goto delete_from_cleanup;
  }
  iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
  assert( iDb<db->nDb );
  zDb = db->aDb[iDb].zName;
  rcauth = sqlite3AuthCheck(pParse, SQLITE_DELETE, pTab->zName, 0, zDb);
  assert( rcauth==SQLITE_OK || rcauth==SQLITE_DENY || rcauth==SQLITE_IGNORE );
  if( rcauth==SQLITE_DENY ){
    goto delete_from_cleanup;
  }
  assert(!isView || pTrigger);

  /* Assign cursor numbers to the table and all its indices.
  */
  assert( pTabList->nSrc==1 );
  iTabCur = pTabList->a[0].iCursor = pParse->nTab++;
  for(nIdx=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, nIdx++){
    pParse->nTab++;
  }

  /* Start the view context
  */
  if( isView ){
    sqlite3AuthContextPush(pParse, &sContext, pTab->zName);
  }

  /* Begin generating code.
  */
  v = sqlite3GetVdbe(pParse);
  if( v==0 ){
    goto delete_from_cleanup;
  }
  if( pParse->nested==0 ) sqlite3VdbeCountChanges(v);
  sqlite3BeginWriteOperation(pParse, 1, iDb);

  /* If we are trying to delete from a view, realize that view into
  ** an ephemeral table.
  */
#if !defined(SQLITE_OMIT_VIEW) && !defined(SQLITE_OMIT_TRIGGER)
  if( isView ){
    sqlite3MaterializeView(pParse, pTab, pWhere, iTabCur);
    iDataCur = iIdxCur = iTabCur;
  }
#endif

  /* Resolve the column names in the WHERE clause.
  */
  memset(&sNC, 0, sizeof(sNC));
  sNC.pParse = pParse;
  sNC.pSrcList = pTabList;
  if( sqlite3ResolveExprNames(&sNC, pWhere) ){
    goto delete_from_cleanup;
  }

  /* Initialize the counter of the number of rows deleted, if
  ** we are counting rows.
  */
  if( db->flags & SQLITE_CountRows ){
    memCnt = ++pParse->nMem;
    sqlite3VdbeAddOp2(v, OP_Integer, 0, memCnt);
  }

#ifndef SQLITE_OMIT_TRUNCATE_OPTIMIZATION
  /* Special case: A DELETE without a WHERE clause deletes everything.
  ** It is easier just to erase the whole table. Prior to version 3.6.5,
  ** this optimization caused the row change count (the value returned by 
  ** API function sqlite3_count_changes) to be set incorrectly.  */
  if( rcauth==SQLITE_OK
   && pWhere==0
   && !bComplex
   && !IsVirtual(pTab)
  ){
    assert( !isView );
    sqlite3TableLock(pParse, iDb, pTab->tnum, 1, pTab->zName);
    if( HasRowid(pTab) ){
      sqlite3VdbeAddOp4(v, OP_Clear, pTab->tnum, iDb, memCnt,
                        pTab->zName, P4_STATIC);
    }
    for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){
      assert( pIdx->pSchema==pTab->pSchema );
      sqlite3VdbeAddOp2(v, OP_Clear, pIdx->tnum, iDb);
    }
  }else
#endif /* SQLITE_OMIT_TRUNCATE_OPTIMIZATION */
  {
    u16 wcf = WHERE_ONEPASS_DESIRED|WHERE_DUPLICATES_OK;
    wcf |= (bComplex ? 0 : WHERE_ONEPASS_MULTIROW);
    if( HasRowid(pTab) ){
      /* For a rowid table, initialize the RowSet to an empty set */
      pPk = 0;
      nPk = 1;
      iRowSet = ++pParse->nMem;
      sqlite3VdbeAddOp2(v, OP_Null, 0, iRowSet);
    }else{
      /* For a WITHOUT ROWID table, create an ephemeral table used to
      ** hold all primary keys for rows to be deleted. */
      pPk = sqlite3PrimaryKeyIndex(pTab);
      assert( pPk!=0 );
      nPk = pPk->nKeyCol;
      iPk = pParse->nMem+1;
      pParse->nMem += nPk;
      iEphCur = pParse->nTab++;
      addrEphOpen = sqlite3VdbeAddOp2(v, OP_OpenEphemeral, iEphCur, nPk);
      sqlite3VdbeSetP4KeyInfo(pParse, pPk);
    }
  
    /* Construct a query to find the rowid or primary key for every row
    ** to be deleted, based on the WHERE clause. Set variable eOnePass
    ** to indicate the strategy used to implement this delete:
    **
    **  ONEPASS_OFF:    Two-pass approach - use a FIFO for rowids/PK values.
    **  ONEPASS_SINGLE: One-pass approach - at most one row deleted.
    **  ONEPASS_MULTI:  One-pass approach - any number of rows may be deleted.
    */
    pWInfo = sqlite3WhereBegin(pParse, pTabList, pWhere, 0, 0, wcf, iTabCur+1);
    if( pWInfo==0 ) goto delete_from_cleanup;
    eOnePass = sqlite3WhereOkOnePass(pWInfo, aiCurOnePass);
    assert( IsVirtual(pTab)==0 || eOnePass!=ONEPASS_MULTI );
    assert( IsVirtual(pTab) || bComplex || eOnePass!=ONEPASS_OFF );
  
    /* Keep track of the number of rows to be deleted */
    if( db->flags & SQLITE_CountRows ){
      sqlite3VdbeAddOp2(v, OP_AddImm, memCnt, 1);
    }
  
    /* Extract the rowid or primary key for the current row */
    if( pPk ){
      for(i=0; i<nPk; i++){
        assert( pPk->aiColumn[i]>=0 );
        sqlite3ExprCodeGetColumnOfTable(v, pTab, iTabCur,
                                        pPk->aiColumn[i], iPk+i);
      }
      iKey = iPk;
    }else{
      iKey = pParse->nMem + 1;
      iKey = sqlite3ExprCodeGetColumn(pParse, pTab, -1, iTabCur, iKey, 0);
      if( iKey>pParse->nMem ) pParse->nMem = iKey;
    }
  
    if( eOnePass!=ONEPASS_OFF ){
      /* For ONEPASS, no need to store the rowid/primary-key. There is only
      ** one, so just keep it in its register(s) and fall through to the
      ** delete code.  */
      nKey = nPk; /* OP_Found will use an unpacked key */
      aToOpen = sqlite3DbMallocRaw(db, nIdx+2);
      if( aToOpen==0 ){
        sqlite3WhereEnd(pWInfo);
        goto delete_from_cleanup;
      }
      memset(aToOpen, 1, nIdx+1);
      aToOpen[nIdx+1] = 0;
      if( aiCurOnePass[0]>=0 ) aToOpen[aiCurOnePass[0]-iTabCur] = 0;
      if( aiCurOnePass[1]>=0 ) aToOpen[aiCurOnePass[1]-iTabCur] = 0;
      if( addrEphOpen ) sqlite3VdbeChangeToNoop(v, addrEphOpen);
    }else{
      if( pPk ){
        /* Add the PK key for this row to the temporary table */
        iKey = ++pParse->nMem;
        nKey = 0;   /* Zero tells OP_Found to use a composite key */
        sqlite3VdbeAddOp4(v, OP_MakeRecord, iPk, nPk, iKey,
            sqlite3IndexAffinityStr(pParse->db, pPk), nPk);
        sqlite3VdbeAddOp2(v, OP_IdxInsert, iEphCur, iKey);
      }else{
        /* Add the rowid of the row to be deleted to the RowSet */
        nKey = 1;  /* OP_Seek always uses a single rowid */
        sqlite3VdbeAddOp2(v, OP_RowSetAdd, iRowSet, iKey);
      }
    }
  
    /* If this DELETE cannot use the ONEPASS strategy, this is the 
    ** end of the WHERE loop */
    if( eOnePass!=ONEPASS_OFF ){
      addrBypass = sqlite3VdbeMakeLabel(v);
    }else{
      sqlite3WhereEnd(pWInfo);
    }
  
    /* Unless this is a view, open cursors for the table we are 
    ** deleting from and all its indices. If this is a view, then the
    ** only effect this statement has is to fire the INSTEAD OF 
    ** triggers.
    */
    if( !isView ){
      int iAddrOnce = 0;
      u8 p5 = (eOnePass==ONEPASS_OFF ? 0 : OPFLAG_FORDELETE);
      if( eOnePass==ONEPASS_MULTI ){
        iAddrOnce = sqlite3CodeOnce(pParse); VdbeCoverage(v);
      }
      testcase( IsVirtual(pTab) );
      sqlite3OpenTableAndIndices(pParse, pTab, OP_OpenWrite, p5, iTabCur, 
                                 aToOpen, &iDataCur, &iIdxCur);
      assert( pPk || IsVirtual(pTab) || iDataCur==iTabCur );
      assert( pPk || IsVirtual(pTab) || iIdxCur==iDataCur+1 );
      if( eOnePass==ONEPASS_MULTI ) sqlite3VdbeJumpHere(v, iAddrOnce);
    }
  
    /* Set up a loop over the rowids/primary-keys that were found in the
    ** where-clause loop above.
    */
    if( eOnePass!=ONEPASS_OFF ){
      assert( nKey==nPk );  /* OP_Found will use an unpacked key */
      if( !IsVirtual(pTab) && aToOpen[iDataCur-iTabCur] ){
        assert( pPk!=0 || pTab->pSelect!=0 );
        sqlite3VdbeAddOp4Int(v, OP_NotFound, iDataCur, addrBypass, iKey, nKey);
        VdbeCoverage(v);
      }
    }else if( pPk ){
      addrLoop = sqlite3VdbeAddOp1(v, OP_Rewind, iEphCur); VdbeCoverage(v);
      sqlite3VdbeAddOp2(v, OP_RowKey, iEphCur, iKey);
      assert( nKey==0 );  /* OP_Found will use a composite key */
    }else{
      addrLoop = sqlite3VdbeAddOp3(v, OP_RowSetRead, iRowSet, 0, iKey);
      VdbeCoverage(v);
      assert( nKey==1 );
    }  
  
    /* Delete the row */
#ifndef SQLITE_OMIT_VIRTUALTABLE
    if( IsVirtual(pTab) ){
      const char *pVTab = (const char *)sqlite3GetVTable(db, pTab);
      sqlite3VtabMakeWritable(pParse, pTab);
      sqlite3VdbeAddOp4(v, OP_VUpdate, 0, 1, iKey, pVTab, P4_VTAB);
      sqlite3VdbeChangeP5(v, OE_Abort);
      assert( eOnePass==ONEPASS_OFF || eOnePass==ONEPASS_SINGLE );
      sqlite3MayAbort(pParse);
      if( eOnePass==ONEPASS_SINGLE && sqlite3IsToplevel(pParse) ){
        pParse->isMultiWrite = 0;
      }
    }else
#endif
    {
      int count = (pParse->nested==0);    /* True to count changes */
      int iIdxNoSeek = -1;
      if( bComplex==0 && aiCurOnePass[1]!=iDataCur ){
        iIdxNoSeek = aiCurOnePass[1];
      }
      sqlite3GenerateRowDelete(pParse, pTab, pTrigger, iDataCur, iIdxCur,
          iKey, nKey, count, OE_Default, eOnePass, iIdxNoSeek);
    }
  
    /* End of the loop over all rowids/primary-keys. */
    if( eOnePass!=ONEPASS_OFF ){
      sqlite3VdbeResolveLabel(v, addrBypass);
      sqlite3WhereEnd(pWInfo);
    }else if( pPk ){
      sqlite3VdbeAddOp2(v, OP_Next, iEphCur, addrLoop+1); VdbeCoverage(v);
      sqlite3VdbeJumpHere(v, addrLoop);
    }else{
      sqlite3VdbeGoto(v, addrLoop);
      sqlite3VdbeJumpHere(v, addrLoop);
    }     
  
    /* Close the cursors open on the table and its indexes. */
    if( !isView && !IsVirtual(pTab) ){
      if( !pPk ) sqlite3VdbeAddOp1(v, OP_Close, iDataCur);
      for(i=0, pIdx=pTab->pIndex; pIdx; i++, pIdx=pIdx->pNext){
        sqlite3VdbeAddOp1(v, OP_Close, iIdxCur + i);
      }
    }
  } /* End non-truncate path */

  /* Update the sqlite_sequence table by storing the content of the
  ** maximum rowid counter values recorded while inserting into
  ** autoincrement tables.
  */
  if( pParse->nested==0 && pParse->pTriggerTab==0 ){
    sqlite3AutoincrementEnd(pParse);
  }

  /* Return the number of rows that were deleted. If this routine is 
  ** generating code because of a call to sqlite3NestedParse(), do not
  ** invoke the callback function.
  */
  if( (db->flags&SQLITE_CountRows) && !pParse->nested && !pParse->pTriggerTab ){
    sqlite3VdbeAddOp2(v, OP_ResultRow, memCnt, 1);
    sqlite3VdbeSetNumCols(v, 1);
    sqlite3VdbeSetColName(v, 0, COLNAME_NAME, "rows deleted", SQLITE_STATIC);
  }

delete_from_cleanup:
  sqlite3AuthContextPop(&sContext);
  sqlite3SrcListDelete(db, pTabList);
  sqlite3ExprDelete(db, pWhere);
  sqlite3DbFree(db, aToOpen);
  return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xf8, %rsp
xorl %r12d, %r12d
movl %r12d, -0x64(%rbp)
movl %r12d, -0x88(%rbp)
movq (%rdi), %r14
cmpl %r12d, 0x4c(%rdi)
movq %rdx, -0xb8(%rbp)
jne 0x47ad0
cmpb $0x0, 0x51(%r14)
je 0x47b16
xorl %r12d, %r12d
xorl %edi, %edi
xorl %r13d, %r13d
testq %r12, %r12
je 0x47ae2
movq %rdi, 0x230(%r12)
movq %r14, %rdi
callq 0x3da9a
movq %r14, %rdi
movq -0xb8(%rbp), %rsi
callq 0x3d8f7
movq %r14, %rdi
movq %r13, %rsi
callq 0xb6df
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rdi, %r15
movq %rsi, -0x40(%rbp)
callq 0x5af8a
testq %rax, %rax
je 0x47b97
movq %rax, %r12
movq %r15, %rdi
movq %rax, %rsi
movl $0x6d, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x6ad68
movq 0x18(%r12), %rbx
movb $0x1, %cl
movq %rax, -0x98(%rbp)
testq %rax, %rax
jne 0x47b66
movq %r15, %rdi
movq %r12, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x6adf9
testl %eax, %eax
setne %cl
movb %cl, -0xc8(%rbp)
movq %r15, %rdi
movq %r12, %rsi
callq 0x5a224
testl %eax, %eax
jne 0x47b97
xorl %edx, %edx
cmpq $0x0, -0x98(%rbp)
setne %dl
movq %r15, %rdi
movq %r12, %rsi
callq 0x6af09
testl %eax, %eax
je 0x47ba8
xorl %r12d, %r12d
xorl %edi, %edi
xorl %r13d, %r13d
movq -0x40(%rbp), %rsi
jmp 0x47ad5
movq 0x68(%r12), %rax
testq %rax, %rax
movq %rbx, -0x90(%rbp)
je 0x47be0
movl 0x28(%r14), %ecx
testl %ecx, %ecx
jle 0x47be7
movq 0x20(%r14), %rdx
addq $0x18, %rdx
xorl %ebx, %ebx
cmpq %rax, (%rdx)
je 0x47be9
incq %rbx
addq $0x20, %rdx
cmpq %rbx, %rcx
jne 0x47bcb
movl %ecx, %ebx
jmp 0x47be9
movl $0xfff0bdc0, %ebx       # imm = 0xFFF0BDC0
jmp 0x47be9
xorl %ebx, %ebx
movq 0x20(%r14), %rax
movslq %ebx, %rcx
shlq $0x5, %rcx
movq (%rax,%rcx), %r8
movq (%r12), %rdx
movq $0x0, -0x78(%rbp)
movq %r15, %rdi
movl $0x9, %esi
xorl %ecx, %ecx
callq 0x5605b
movq %r12, %rdx
movl $0x0, %r12d
movl $0x0, %edi
movl $0x0, %r13d
cmpl $0x1, %eax
movq -0x40(%rbp), %rsi
je 0x47ad5
movl %eax, -0x70(%rbp)
movl 0x50(%r15), %edi
leal 0x1(%rdi), %r13d
movl %r13d, 0x50(%r15)
movl %edi, 0x4c(%rsi)
movq 0x10(%rdx), %rax
testq %rax, %rax
je 0x47c6a
movl 0x50(%r15), %ecx
xorl %esi, %esi
incl %esi
movq 0x28(%rax), %rax
testq %rax, %rax
jne 0x47c55
movq %rsi, -0x78(%rbp)
addl %esi, %ecx
movl %ecx, 0x50(%r15)
movq %rdi, -0xa0(%rbp)
cmpq $0x0, -0x90(%rbp)
movq %rdx, -0x60(%rbp)
je 0x47c99
movq (%rdx), %rax
movq 0x230(%r15), %rcx
movq %rcx, -0x58(%rbp)
movq %rax, 0x230(%r15)
movq %r15, %r12
jmp 0x47ca4
xorl %r12d, %r12d
movq $0x0, -0x58(%rbp)
movq %r15, %rdi
callq 0x507bf
testq %rax, %rax
je 0x47d4e
cmpb $0x0, 0x1e(%r15)
jne 0x47cc3
orb $0x4, 0x8c(%rax)
movq %rax, -0x38(%rbp)
movq %r15, %rdi
movl $0x1, %esi
movl %ebx, %edx
callq 0x5626d
cmpq $0x0, -0x90(%rbp)
movq -0xb8(%rbp), %rcx
movq %r13, -0x50(%rbp)
je 0x47d1a
movq %r15, %rdi
movq -0x60(%rbp), %rsi
movq -0xb8(%rbp), %rdx
movq -0xa0(%rbp), %r13
movl %r13d, %ecx
callq 0x6af80
movq -0xb8(%rbp), %rcx
movl %r13d, -0x88(%rbp)
movl %r13d, -0x64(%rbp)
xorps %xmm0, %xmm0
leaq -0x120(%rbp), %rdi
movaps %xmm0, (%rdi)
movaps %xmm0, 0x20(%rdi)
movaps %xmm0, 0x10(%rdi)
movq $0x0, 0x30(%rdi)
movq %r15, (%rdi)
movq -0x40(%rbp), %rax
movq %rax, 0x8(%rdi)
movq %rcx, %rsi
callq 0x56cd9
testl %eax, %eax
je 0x47d5e
xorl %r13d, %r13d
movq -0x40(%rbp), %rsi
movq -0x58(%rbp), %rdi
jmp 0x47ad5
movl $0xffffffff, -0x84(%rbp) # imm = 0xFFFFFFFF
testb $-0x80, 0x2c(%r14)
je 0x47d92
movl 0x54(%r15), %ecx
incl %ecx
movl %ecx, 0x54(%r15)
movq -0x38(%rbp), %rdi
movl $0x17, %esi
xorl %edx, %edx
movl %ecx, -0x84(%rbp)
xorl %r8d, %r8d
callq 0x3fa9e
cmpl $0x0, -0x70(%rbp)
setne %al
cmpq $0x0, -0xb8(%rbp)
setne %cl
orb %al, %cl
movb -0xc8(%rbp), %dl
orb %dl, %cl
testb $0x1, %cl
movq -0x38(%rbp), %rdi
jne 0x47e62
movq -0x60(%rbp), %rax
testb $0x10, 0x46(%rax)
jne 0x47e62
movq -0x60(%rbp), %r13
movl 0x38(%r13), %edx
movq (%r13), %r8
movq %r15, %rdi
movl %ebx, %esi
movl $0x1, %ecx
callq 0x50be4
testb $0x20, 0x46(%r13)
jne 0x47e28
movl 0x38(%r13), %edx
movq (%r13), %rax
movq %rax, -0x98(%rbp)
movq -0x38(%rbp), %rdi
movl $0x78, %esi
movl %ebx, %ecx
movl -0x84(%rbp), %r8d
callq 0x3fa9e
movq -0x38(%rbp), %rdi
movl %eax, %esi
movq -0x98(%rbp), %rdx
movl $0xfffffffe, %ecx       # imm = 0xFFFFFFFE
callq 0x14ab9
movq 0x10(%r13), %rax
xorl %r13d, %r13d
testq %rax, %rax
je 0x48033
movq %rax, -0x98(%rbp)
movl 0x58(%rax), %edx
movq -0x38(%rbp), %rdi
movl $0x78, %esi
movl %ebx, %ecx
xorl %r8d, %r8d
callq 0x3fa9e
movq -0x98(%rbp), %rax
movq 0x28(%rax), %rax
jmp 0x47e2f
movl %edx, %eax
xorb $0x1, %al
movzbl %al, %ebx
shll $0xd, %ebx
orl $0xc, %ebx
movq -0x60(%rbp), %rax
testb $0x20, 0x46(%rax)
jne 0x47ec7
movl 0x54(%r15), %ecx
incl %ecx
movl %ecx, 0x54(%r15)
movq $0x0, -0x48(%rbp)
movl $0x1a, %esi
xorl %edx, %edx
movl %ecx, -0xa4(%rbp)
xorl %r8d, %r8d
callq 0x3fa9e
movw $0x1, %ax
movq %rax, -0x80(%rbp)
movq $0x0, -0xb0(%rbp)
movl $0x0, -0xbc(%rbp)
movq $0x0, -0x70(%rbp)
jmp 0x47f3b
movq 0x10(%rax), %r13
testq %r13, %r13
je 0x47ee0
movb 0x63(%r13), %al
andb $0x3, %al
cmpb $0x2, %al
je 0x47ee0
movq 0x28(%r13), %r13
jmp 0x47ecb
movzwl 0x5e(%r13), %ecx
movl 0x50(%r15), %edx
movl 0x54(%r15), %eax
leal 0x1(%rax), %esi
movq %rsi, -0x48(%rbp)
movq %rcx, -0x80(%rbp)
movswl %cx, %ecx
addl %ecx, %eax
movl %eax, 0x54(%r15)
leal 0x1(%rdx), %eax
movl %eax, 0x50(%r15)
movl $0x0, -0xa4(%rbp)
movl $0x3a, %esi
movq %rdx, -0xb0(%rbp)
xorl %r8d, %r8d
callq 0x3fa9e
movl %eax, -0xbc(%rbp)
movq %r15, %rdi
movq %r13, -0x70(%rbp)
movq %r13, %rsi
callq 0x50cc1
subq $0x8, %rsp
movzwl %bx, %r9d
xorl %r13d, %r13d
movq %r15, %rdi
movq -0x40(%rbp), %rsi
movq -0xb8(%rbp), %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
pushq -0x50(%rbp)
callq 0x5e598
addq $0x10, %rsp
testq %rax, %rax
je 0x48197
movq %rax, %rbx
movl -0x48(%rbp), %esi
movq 0x4c(%rax), %rcx
movb 0x36(%rax), %dl
testb $-0x80, 0x2c(%r14)
movb %dl, -0x29(%rbp)
movq %rsi, -0x50(%rbp)
je 0x47fb2
movq -0x38(%rbp), %rdi
movl $0x26, %esi
movl -0x84(%rbp), %edx
movq %rcx, %r13
movl $0x1, %ecx
xorl %r8d, %r8d
callq 0x3fa9e
movq -0x50(%rbp), %rsi
movq %r13, %rcx
movb -0x29(%rbp), %dl
movq %rcx, -0xe0(%rbp)
shrq $0x20, %rcx
movq %rcx, -0xd8(%rbp)
movq -0x70(%rbp), %r13
testq %r13, %r13
movq %rbx, -0xd0(%rbp)
je 0x48040
movq -0x80(%rbp), %rcx
testw %cx, %cx
jle 0x48075
movzwl %cx, %eax
movq %rax, -0x48(%rbp)
movq %r13, -0x70(%rbp)
xorl %r13d, %r13d
movq -0x60(%rbp), %rbx
movq -0x70(%rbp), %rax
movq 0x8(%rax), %rax
movswl (%rax,%r13,2), %ecx
leal (%rsi,%r13), %r8d
movq -0x38(%rbp), %rdi
movq %rbx, %rsi
movq -0xa0(%rbp), %rdx
callq 0x53de0
movq -0x50(%rbp), %rsi
incq %r13
cmpq %r13, -0x48(%rbp)
jne 0x47ff3
movl %esi, %eax
movq -0x70(%rbp), %r13
movq -0xd0(%rbp), %rbx
jmp 0x4806c
movq -0x40(%rbp), %rsi
movq -0x58(%rbp), %rdi
jmp 0x485ce
movl 0x54(%r15), %r8d
incl %r8d
movq %r15, %rdi
movq -0x60(%rbp), %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movq -0xa0(%rbp), %rcx
xorl %r9d, %r9d
callq 0x521d6
cmpl 0x54(%r15), %eax
jle 0x4806c
movl %eax, 0x54(%r15)
movb -0x29(%rbp), %dl
movq -0x80(%rbp), %rcx
jmp 0x48077
movl %esi, %eax
testb %dl, %dl
je 0x4810f
movl %eax, -0x50(%rbp)
movq -0x78(%rbp), %rax
leal 0x2(%rax), %esi
movq %r14, %rdi
callq 0x144ee
testq %rax, %rax
je 0x4818c
movq %rax, %r13
movl -0x78(%rbp), %ebx
leaq 0x1(%rbx), %rdx
movq %rax, %rdi
movl $0x1, %esi
callq 0xa210
movb $0x0, 0x1(%r13,%rbx)
movq -0xe0(%rbp), %rcx
testl %ecx, %ecx
js 0x480d2
movl %ecx, %eax
subl -0xa0(%rbp), %eax
cltq
movb $0x0, (%r13,%rax)
testq %rcx, %rcx
movq -0x38(%rbp), %rdi
movq -0x90(%rbp), %rbx
js 0x480f7
movq -0xd8(%rbp), %rax
subl -0xa0(%rbp), %eax
cltq
movb $0x0, (%r13,%rax)
movl -0xbc(%rbp), %esi
testl %esi, %esi
je 0x481d4
callq 0x14be2
jmp 0x481d4
testq %r13, %r13
je 0x481a6
movl 0x54(%r15), %ebx
incl %ebx
movl %ebx, 0x54(%r15)
movswl %cx, %eax
movl %eax, -0x78(%rbp)
movq (%r15), %rdi
movq %r13, %rsi
callq 0x6a284
movq %rax, -0x48(%rbp)
movq -0x38(%rbp), %r13
movq %r13, %rdi
movl $0x32, %esi
movq -0x50(%rbp), %rdx
movl -0x78(%rbp), %ecx
movl %ebx, %r8d
callq 0x3fa9e
movq %r13, %rdi
movl %eax, %esi
movq -0x48(%rbp), %rdx
movl -0x78(%rbp), %ecx
callq 0x14ab9
movq $0x0, -0x80(%rbp)
movq %r13, %rdi
movl $0x70, %esi
movq -0xb0(%rbp), %rdx
movl %ebx, -0x50(%rbp)
movl %ebx, %ecx
xorl %r8d, %r8d
callq 0x3fa9e
xorl %r13d, %r13d
jmp 0x481cd
movq %rbx, %rdi
callq 0x60262
xorl %r13d, %r13d
xorl %edx, %edx
movq -0x40(%rbp), %rsi
movq -0x58(%rbp), %rdi
jmp 0x485c6
xorl %r13d, %r13d
movq -0x38(%rbp), %rdi
movl $0x82, %esi
movl -0xa4(%rbp), %edx
movl %eax, -0x50(%rbp)
movl %eax, %ecx
xorl %r8d, %r8d
callq 0x3fa9e
movw $0x1, %ax
movq %rax, -0x80(%rbp)
movq -0x90(%rbp), %rbx
cmpb $0x0, -0x29(%rbp)
je 0x481e8
movq -0x38(%rbp), %rdi
callq 0x528c8
movl %eax, -0x78(%rbp)
jmp 0x481fb
movq -0xd0(%rbp), %rdi
callq 0x60262
movl $0x0, -0x78(%rbp)
testq %rbx, %rbx
movq -0x38(%rbp), %rbx
movb -0x29(%rbp), %al
jne 0x482a0
testb %al, %al
setne %bl
shlb $0x3, %bl
movl $0x0, -0x48(%rbp)
cmpb $0x2, %al
jne 0x48229
movq %r15, %rdi
callq 0x5543a
movl %eax, -0x48(%rbp)
leaq -0x88(%rbp), %rax
leaq -0x64(%rbp), %r10
movzbl %bl, %ecx
movq %r15, %rdi
movq -0x60(%rbp), %rsi
movl $0x38, %edx
movq -0xa0(%rbp), %r8
movq %r13, %r9
pushq %rax
pushq %r10
callq 0x6b09d
addq $0x10, %rsp
movb -0x29(%rbp), %al
cmpb $0x2, %al
movq -0x38(%rbp), %rbx
jne 0x482a0
movl 0x3c(%rbx), %eax
leal -0x1(%rax), %ecx
movq 0x30(%rbx), %rdx
movl %ecx, 0x68(%rdx)
movq (%rbx), %rdx
cmpb $0x0, 0x51(%rdx)
je 0x48283
leaq 0x4d267(%rip), %rcx     # 0x954e8
jmp 0x4829a
movl -0x48(%rbp), %edx
testl %edx, %edx
cmovnsl %edx, %ecx
movslq %ecx, %rcx
leaq (%rcx,%rcx,2), %rcx
shlq $0x3, %rcx
addq 0x8(%rbx), %rcx
movl %eax, 0x8(%rcx)
movb -0x29(%rbp), %al
testb %al, %al
je 0x482ea
movq $0x0, -0x48(%rbp)
movq -0x60(%rbp), %rax
testb $0x10, 0x46(%rax)
jne 0x4834e
movl -0x64(%rbp), %edx
movl %edx, %eax
subl -0xa0(%rbp), %eax
cltq
cmpb $0x0, (%r13,%rax)
je 0x4834e
movswl -0x80(%rbp), %r9d
movq %rbx, %rdi
movl $0x46, %esi
movl -0x78(%rbp), %ecx
movl -0x50(%rbp), %r8d
callq 0x149ac
jmp 0x4834e
cmpq $0x0, -0x70(%rbp)
je 0x48331
movq %rbx, %rdi
movl $0x6e, %esi
movq -0xb0(%rbp), %rdx
movq %rdx, -0xb0(%rbp)
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x3fa9e
movq %rax, -0x48(%rbp)
movq %rbx, %rdi
movl $0x67, %esi
movq -0xb0(%rbp), %rdx
movl -0x50(%rbp), %ecx
xorl %r8d, %r8d
callq 0x3fa9e
jmp 0x4834e
movq %rbx, %rdi
movl $0x83, %esi
movl -0xa4(%rbp), %edx
xorl %ecx, %ecx
movl -0x50(%rbp), %r8d
callq 0x3fa9e
movq %rax, -0x48(%rbp)
movq -0x60(%rbp), %rsi
testb $0x10, 0x46(%rsi)
movq -0x98(%rbp), %rdx
jne 0x483cf
xorl %eax, %eax
cmpb $0x0, 0x1e(%r15)
sete %al
movl -0x64(%rbp), %ecx
movq -0xd8(%rbp), %r11
cmpl %r11d, %ecx
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
cmovel %edi, %r11d
cmpb $0x0, -0xc8(%rbp)
cmovnel %edi, %r11d
movl -0x88(%rbp), %r8d
subq $0x8, %rsp
movb -0x29(%rbp), %bl
movzbl %bl, %r10d
movswl -0x80(%rbp), %edi
movq %rdi, -0xc8(%rbp)
movq %r15, %rdi
movl -0x50(%rbp), %r9d
pushq %r11
pushq %r10
pushq $0xa
pushq %rax
pushq -0xc8(%rbp)
callq 0x6b32a
movl %ebx, %edx
addq $0x30, %rsp
movq -0x38(%rbp), %rbx
jmp 0x48470
movq 0x58(%rsi), %rbx
testq %rbx, %rbx
je 0x483e3
cmpq %r14, (%rbx)
je 0x483e3
movq 0x28(%rbx), %rbx
jmp 0x483d3
movq %r15, %rdi
movq -0x60(%rbp), %rsi
callq 0x6b291
movq -0x38(%rbp), %rdi
movl $0xd, %esi
xorl %edx, %edx
movl $0x1, %ecx
movl -0x50(%rbp), %r8d
callq 0x3fa9e
movq -0x38(%rbp), %rdi
movl %eax, %esi
movq %rbx, %rdx
movl $0xfffffff6, %ecx       # imm = 0xFFFFFFF6
callq 0x14ab9
movq -0x38(%rbp), %rbx
movq (%rbx), %rax
cmpb $0x0, 0x51(%rax)
je 0x48431
leaq 0x4d0b9(%rip), %rax     # 0x954e8
jmp 0x48445
movslq 0x3c(%rbx), %rax
movq 0x8(%rbx), %rcx
leaq (%rax,%rax,2), %rax
leaq (%rcx,%rax,8), %rax
addq $-0x18, %rax
movb -0x29(%rbp), %dl
movb $0x2, 0x3(%rax)
movq 0x1c0(%r15), %rax
testq %rax, %rax
setne %cl
cmoveq %r15, %rax
movb $0x1, 0x21(%rax)
cmpb $0x1, %dl
setne %al
orb %cl, %al
jne 0x48470
movb $0x0, 0x20(%r15)
testb %dl, %dl
je 0x484ab
movq 0x30(%rbx), %rax
movq 0x80(%rax), %rcx
testq %rcx, %rcx
je 0x48492
movl -0x78(%rbp), %esi
notl %esi
movl 0x3c(%rbx), %edx
movslq %esi, %rsi
movl %edx, (%rcx,%rsi,4)
movl 0x3c(%rbx), %ecx
decl %ecx
movl %ecx, 0x68(%rax)
movq -0xd0(%rbp), %rdi
callq 0x60262
jmp 0x4853b
cmpq $0x0, -0x70(%rbp)
je 0x48501
movq -0x48(%rbp), %rbx
leal 0x1(%rbx), %ecx
movq -0x38(%rbp), %rdi
movl $0x8, %esi
movq -0xb0(%rbp), %rdx
xorl %r8d, %r8d
callq 0x3fa9e
movq -0x38(%rbp), %rsi
movl 0x3c(%rsi), %eax
leal -0x1(%rax), %ecx
movq 0x30(%rsi), %rdx
movl %ecx, 0x68(%rdx)
movq (%rsi), %rdx
cmpb $0x0, 0x51(%rdx)
jne 0x48531
testl %ebx, %ebx
cmovnsl %ebx, %ecx
movslq %ecx, %rcx
leaq (%rcx,%rcx,2), %rcx
shlq $0x3, %rcx
addq 0x8(%rsi), %rcx
jmp 0x48538
movq %rbx, %rdi
movl $0xe, %esi
xorl %edx, %edx
movq -0x48(%rbp), %rcx
xorl %r8d, %r8d
callq 0x3fa9e
movl 0x3c(%rbx), %eax
leal -0x1(%rax), %ecx
movq 0x30(%rbx), %rdx
movl %ecx, 0x68(%rdx)
movq (%rbx), %rdx
cmpb $0x0, 0x51(%rdx)
je 0x48672
leaq 0x4cfb0(%rip), %rcx     # 0x954e8
movl %eax, 0x8(%rcx)
movq -0x40(%rbp), %rsi
movq -0x90(%rbp), %rax
movb $0x1, %dl
testq %rax, %rax
movq -0x58(%rbp), %rdi
jne 0x485c6
movq -0x60(%rbp), %rcx
testb $0x10, 0x46(%rcx)
jne 0x485c6
cmpq $0x0, -0x70(%rbp)
jne 0x48578
movl -0x64(%rbp), %edx
movq -0x38(%rbp), %rdi
movl $0x3e, %esi
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x3fa9e
movq -0x60(%rbp), %rax
movq 0x10(%rax), %rax
testq %rax, %rax
je 0x485bc
movq %rax, %rbx
xorl %eax, %eax
movl %eax, -0x98(%rbp)
movl -0x88(%rbp), %edx
addl %eax, %edx
movq -0x38(%rbp), %rdi
movl $0x3e, %esi
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x3fa9e
movl -0x98(%rbp), %eax
incl %eax
movq 0x28(%rbx), %rbx
testq %rbx, %rbx
jne 0x4858a
movq -0x40(%rbp), %rsi
movq -0x58(%rbp), %rdi
movb $0x1, %dl
testb %dl, %dl
je 0x47ad5
cmpb $0x0, 0x1e(%r15)
jne 0x485ef
cmpq $0x0, 0x1c8(%r15)
jne 0x485ef
movq %r15, %rdi
callq 0x6b632
movq -0x58(%rbp), %rdi
movq -0x40(%rbp), %rsi
testb $-0x80, 0x2c(%r14)
je 0x47ad5
cmpb $0x0, 0x1e(%r15)
jne 0x47ad5
cmpq $0x0, 0x1c8(%r15)
jne 0x47ad5
movq -0x38(%rbp), %rbx
movq %rbx, %rdi
movl $0x22, %esi
movl -0x84(%rbp), %edx
movl $0x1, %ecx
xorl %r8d, %r8d
callq 0x3fa9e
movq %rbx, %rdi
movl $0x1, %esi
callq 0x406ed
movq (%rbx), %rax
cmpb $0x0, 0x51(%rax)
jne 0x47d51
movq -0x38(%rbp), %rax
movq 0x20(%rax), %rdi
leaq 0x37656(%rip), %rsi     # 0x7fcb1
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl $0x1, %ecx
xorl %r8d, %r8d
callq 0x11b32
jmp 0x47d51
movq -0x48(%rbp), %rdx
testl %edx, %edx
cmovnsl %edx, %ecx
movslq %ecx, %rcx
leaq (%rcx,%rcx,2), %rcx
shlq $0x3, %rcx
movq -0x38(%rbp), %rdx
addq 0x8(%rdx), %rcx
jmp 0x48538