// File: /workspace/github_c_makefile_star2_O3/skeeto[P]flappy/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;          /* VDBE cursor for the canonical data source */
  int iIdxCur;           /* 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 okOnePass;         /* True for one-pass algorithm without the FIFO */
  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 addrDelete = 0;    /* Jump directly to the delete logic */
  int addrEphOpen = 0;   /* Instruction to open the Ephermeral table */
 
#ifndef SQLITE_OMIT_TRIGGER
  int isView;                  /* True if attempting to delete from a view */
  Trigger *pTrigger;           /* List of table triggers, if required */
#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;
#else
# define pTrigger 0
# define isView 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
  ** a 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 && !pTrigger && !IsVirtual(pTab) 
   && 0==sqlite3FkRequired(pParse, pTab, 0, 0)
  ){
    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 */
  {
    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 ephermeral 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.
    */
    pWInfo = sqlite3WhereBegin(pParse, pTabList, pWhere, 0, 0, 
                               WHERE_ONEPASS_DESIRED|WHERE_DUPLICATES_OK,
                               iTabCur+1);
    if( pWInfo==0 ) goto delete_from_cleanup;
    okOnePass = sqlite3WhereOkOnePass(pWInfo, aiCurOnePass);
  
    /* 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++){
        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( okOnePass ){
      /* 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);
      addrDelete = sqlite3VdbeAddOp0(v, OP_Goto); /* Jump to DELETE logic */
    }else if( pPk ){
      /* Construct a composite key for the row to be deleted and remember it */
      iKey = ++pParse->nMem;
      nKey = 0;   /* Zero tells OP_Found to use a composite key */
      sqlite3VdbeAddOp4(v, OP_MakeRecord, iPk, nPk, iKey,
                        sqlite3IndexAffinityStr(v, pPk), P4_TRANSIENT);
      sqlite3VdbeAddOp2(v, OP_IdxInsert, iEphCur, iKey);
    }else{
      /* Get the rowid of the row to be deleted and remember it in the RowSet */
      nKey = 1;  /* OP_Seek always uses a single rowid */
      sqlite3VdbeAddOp2(v, OP_RowSetAdd, iRowSet, iKey);
    }
  
    /* End of the WHERE loop */
    sqlite3WhereEnd(pWInfo);
    if( okOnePass ){
      /* Bypass the delete logic below if the WHERE loop found zero rows */
      addrBypass = sqlite3VdbeMakeLabel(v);
      sqlite3VdbeAddOp2(v, OP_Goto, 0, addrBypass);
      sqlite3VdbeJumpHere(v, addrDelete);
    }
  
    /* 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 ){
      sqlite3OpenTableAndIndices(pParse, pTab, OP_OpenWrite, iTabCur, aToOpen,
                                 &iDataCur, &iIdxCur);
      assert( pPk || iDataCur==iTabCur );
      assert( pPk || iIdxCur==iDataCur+1 );
    }
  
    /* Set up a loop over the rowids/primary-keys that were found in the
    ** where-clause loop above.
    */
    if( okOnePass ){
      /* Just one row.  Hence the top-of-loop is a no-op */
      assert( nKey==nPk ); /* OP_Found will use an unpacked key */
      if( aToOpen[iDataCur-iTabCur] ){
        assert( pPk!=0 );
        sqlite3VdbeAddOp4Int(v, OP_NotFound, iDataCur, addrBypass, iKey, nKey);
      }
    }else if( pPk ){
      addrLoop = sqlite3VdbeAddOp1(v, OP_Rewind, iEphCur);
      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);
      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);
      sqlite3MayAbort(pParse);
    }else
#endif
    {
      int count = (pParse->nested==0);    /* True to count changes */
      sqlite3GenerateRowDelete(pParse, pTab, pTrigger, iDataCur, iIdxCur,
                               iKey, nKey, count, OE_Default, okOnePass);
    }
  
    /* End of the loop over all rowids/primary-keys. */
    if( okOnePass ){
      sqlite3VdbeResolveLabel(v, addrBypass);
    }else if( pPk ){
      sqlite3VdbeAddOp2(v, OP_Next, iEphCur, addrLoop+1);
      sqlite3VdbeJumpHere(v, addrLoop);
    }else{
      sqlite3VdbeAddOp2(v, OP_Goto, 0, 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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %rdx, 0x70(%rsp)
movq %rsi, %r15
movq (%rdi), %rbx
cmpl $0x0, 0x50(%rdi)
jne 0x3fcbd
cmpb $0x0, 0x50(%rbx)
je 0x3fcf4
xorl %ebp, %ebp
movq %rbx, %rdi
movq %r15, %rsi
callq 0x35d57
movq %rbx, %rdi
movq 0x70(%rsp), %rsi
callq 0x35bca
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x9b42
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rdi, %r12
movq %r15, %rsi
callq 0x51f24
testq %rax, %rax
je 0x3fcbd
movq %rax, %r14
xorl %ebp, %ebp
movq %r12, %rdi
movq %rax, %rsi
movl $0x6b, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x5f8ca
movq %rax, %r13
movq 0x18(%r14), %rax
movq %rax, 0x58(%rsp)
movq %r12, %rdi
movq %r14, %rsi
callq 0x51114
testl %eax, %eax
jne 0x3fcbf
xorl %edx, %edx
testq %r13, %r13
setne %dl
movq %r12, %rdi
movq %r14, %rsi
callq 0x5f963
testl %eax, %eax
jne 0x3fcbd
movq 0x70(%r14), %rax
testq %rax, %rax
movq %r13, 0x90(%rsp)
je 0x3fd8d
movl 0x28(%rbx), %ecx
testl %ecx, %ecx
jle 0x3fd95
movq 0x20(%rbx), %rdx
addq $0x18, %rdx
xorl %r13d, %r13d
cmpq %rax, (%rdx)
je 0x3fd98
incq %r13
addq $0x20, %rdx
cmpq %r13, %rcx
jne 0x3fd77
movl %ecx, %r13d
jmp 0x3fd98
movl $0xfff0bdc0, %r13d      # imm = 0xFFF0BDC0
jmp 0x3fd98
xorl %r13d, %r13d
movq 0x20(%rbx), %rax
movslq %r13d, %rcx
shlq $0x5, %rcx
movq (%rax,%rcx), %r8
movq (%r14), %rdx
movq %r14, 0x20(%rsp)
xorl %r14d, %r14d
movq %r12, %rdi
movl $0x9, %esi
xorl %ecx, %ecx
callq 0x4d23f
movl $0x0, %ebp
cmpl $0x1, %eax
je 0x3fcbf
movl %eax, 0x48(%rsp)
movl 0x54(%r12), %eax
leal 0x1(%rax), %ecx
movl %ecx, 0x54(%r12)
movq %rax, 0x28(%rsp)
movl %eax, 0x44(%r15)
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rax
testq %rax, %rax
movq 0x70(%rsp), %rbp
je 0x3fe14
xorl %r14d, %r14d
incl %r14d
movq 0x28(%rax), %rax
testq %rax, %rax
jne 0x3fdff
leal (%rcx,%r14), %eax
movl %eax, 0x54(%r12)
movq %rcx, 0x30(%rsp)
cmpq $0x0, 0x58(%rsp)
je 0x3fe4b
movq 0x20(%rsp), %rax
movq (%rax), %rax
movq 0x250(%r12), %rcx
movq %rcx, 0x80(%rsp)
movq %rax, 0x250(%r12)
movq %r12, 0x88(%rsp)
jmp 0x3fe63
movq $0x0, 0x88(%rsp)
movq $0x0, 0x80(%rsp)
movq %r12, %rdi
callq 0x48791
testq %rax, %rax
je 0x3feee
cmpb $0x0, 0x1e(%r12)
jne 0x3fe7f
orb $0x10, 0x9a(%rax)
movq %rax, 0x8(%rsp)
movq %r12, %rdi
movl $0x1, %esi
movl %r13d, %edx
callq 0x4d45c
cmpq $0x0, 0x58(%rsp)
je 0x3fec0
movq %r12, %rdi
movq 0x20(%rsp), %rsi
movq %rbp, %rdx
movq 0x28(%rsp), %rbp
movl %ebp, %ecx
callq 0x5f9d0
movl %ebp, 0x54(%rsp)
movl %ebp, 0x3c(%rsp)
movq 0x70(%rsp), %rbp
xorps %xmm0, %xmm0
leaq 0xa0(%rsp), %rdi
movups %xmm0, 0x20(%rdi)
movups %xmm0, 0x10(%rdi)
movq $0x0, 0x30(%rdi)
movq %r12, (%rdi)
movq %r15, 0x8(%rdi)
movq %rbp, %rsi
callq 0x4df86
testl %eax, %eax
je 0x3ff15
xorl %ebp, %ebp
movq 0x88(%rsp), %rax
testq %rax, %rax
je 0x3fcbf
movq 0x80(%rsp), %rcx
movq %rcx, 0x250(%rax)
jmp 0x3fcbf
movl $0xffffffff, 0x38(%rsp) # imm = 0xFFFFFFFF
testb $-0x80, 0x2c(%rbx)
je 0x3ff47
movl 0x58(%r12), %ecx
incl %ecx
movl %ecx, 0x58(%r12)
movq 0x8(%rsp), %rdi
movl $0x17, %esi
xorl %edx, %edx
movl %ecx, 0x38(%rsp)
xorl %r8d, %r8d
callq 0x487d8
cmpq $0x0, 0x90(%rsp)
setne %al
cmpl $0x0, 0x48(%rsp)
setne %cl
testq %rbp, %rbp
setne %dl
orb %cl, %dl
orb %al, %dl
movq 0x20(%rsp), %rax
movb 0x48(%rax), %bpl
movl %ebp, %eax
andb $0x10, %al
shrb $0x4, %al
orb %dl, %al
jne 0x40035
movq (%r12), %rax
testb $0x8, 0x2e(%rax)
jne 0x40016
movq 0x20(%rsp), %r14
movl 0x3c(%r14), %edx
movq (%r14), %r8
movq %r12, %rdi
movl %r13d, %esi
movl $0x1, %ecx
callq 0x48985
testb $0x20, 0x48(%r14)
jne 0x3ffe8
movl 0x3c(%r14), %edx
movq (%r14), %rax
movq %rax, 0x58(%rsp)
movq 0x8(%rsp), %rbp
movq %rbp, %rdi
movl $0x6f, %esi
movl %r13d, %ecx
movl 0x38(%rsp), %r8d
callq 0x487d8
movq %rbp, %rdi
movl %eax, %esi
movq 0x58(%rsp), %rdx
movl $0xfffffffe, %ecx       # imm = 0xFFFFFFFE
callq 0x12044
movq 0x10(%r14), %r14
xorl %ebp, %ebp
testq %r14, %r14
je 0x406c2
movl 0x58(%r14), %edx
movq 0x8(%rsp), %rdi
movl $0x6f, %esi
movl %r13d, %ecx
xorl %r8d, %r8d
callq 0x487d8
movq 0x28(%r14), %r14
jmp 0x3ffee
movq 0x20(%rsp), %rdi
callq 0x52fb1
testq %rax, %rax
jne 0x40035
movq 0x20(%rsp), %rax
cmpq $0x0, 0x20(%rax)
je 0x3ff8b
testb $0x20, %bpl
jne 0x40086
movl 0x58(%r12), %ecx
incl %ecx
movl %ecx, 0x58(%r12)
xorl %r13d, %r13d
movq 0x8(%rsp), %rdi
movl $0x1a, %esi
xorl %edx, %edx
movq %rcx, 0x78(%rsp)
xorl %r8d, %r8d
callq 0x487d8
movw $0x1, %ax
movl %eax, 0x1c(%rsp)
movl $0x0, 0x18(%rsp)
movq $0x0, 0x68(%rsp)
movl $0x0, 0x64(%rsp)
jmp 0x40102
movq 0x20(%rsp), %rax
movq 0x10(%rax), %r13
movq $0x0, 0x78(%rsp)
testq %r13, %r13
je 0x400ad
movb 0x63(%r13), %al
andb $0x3, %al
cmpb $0x2, %al
je 0x400b0
movq 0x28(%r13), %r13
jmp 0x40098
xorl %r13d, %r13d
movzwl 0x5e(%r13), %esi
movl 0x54(%r12), %edx
movl 0x58(%r12), %eax
leal 0x1(%rax), %ecx
movl %ecx, 0x18(%rsp)
movl %esi, 0x1c(%rsp)
movswl %si, %ecx
addl %ecx, %eax
movl %eax, 0x58(%r12)
leal 0x1(%rdx), %eax
movl %eax, 0x54(%r12)
movq 0x8(%rsp), %rdi
movl $0x35, %esi
movq %rdx, 0x68(%rsp)
xorl %r8d, %r8d
callq 0x487d8
movl %eax, 0x64(%rsp)
movq %r12, %rdi
movq %r13, %rsi
callq 0x48a79
subq $0x8, %rsp
xorl %ebp, %ebp
movq %r12, %rdi
movq %r15, %rsi
movq 0x78(%rsp), %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
movl $0xc, %r9d
pushq 0x38(%rsp)
callq 0x55114
addq $0x10, %rsp
testq %rax, %rax
je 0x3fef0
movq 0x4c(%rax), %rcx
movq %rcx, 0x98(%rsp)
movq %rax, 0x40(%rsp)
movb 0x35(%rax), %bpl
testb $-0x80, 0x2c(%rbx)
je 0x4016a
movq 0x8(%rsp), %rdi
movl $0x22, %esi
movl 0x38(%rsp), %edx
movl $0x1, %ecx
xorl %r8d, %r8d
callq 0x487d8
testq %r13, %r13
movb %bpl, 0x17(%rsp)
movq %r13, 0x48(%rsp)
je 0x401dc
movl 0x1c(%rsp), %ecx
testw %cx, %cx
jle 0x4024b
movl 0x18(%rsp), %eax
movzwl %cx, %ecx
movq %rcx, 0x30(%rsp)
xorl %r13d, %r13d
movq 0x48(%rsp), %rcx
movq 0x8(%rcx), %rcx
movswl (%rcx,%r13,2), %ecx
movq %rax, %rbp
leal (%rax,%r13), %r8d
movq 0x8(%rsp), %rdi
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
callq 0x4b5de
movq %rbp, %rax
incq %r13
cmpq %r13, 0x30(%rsp)
jne 0x40195
movq 0x8(%rsp), %rdi
movq 0x48(%rsp), %r13
movb 0x17(%rsp), %bpl
jmp 0x4020f
movl 0x58(%r12), %r8d
incl %r8d
movq %r12, %rdi
movq 0x20(%rsp), %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movq 0x28(%rsp), %rcx
xorl %r9d, %r9d
callq 0x49e6b
cmpl 0x58(%r12), %eax
jle 0x4020a
movl %eax, 0x58(%r12)
movq 0x8(%rsp), %rdi
testb %bpl, %bpl
je 0x4021a
movl %eax, 0x18(%rsp)
jmp 0x40259
testq %r13, %r13
movl 0x1c(%rsp), %ecx
jne 0x4034e
movl $0x78, %esi
movq 0x78(%rsp), %rdx
movl %eax, %ecx
movq %rax, %r14
xorl %r8d, %r8d
callq 0x487d8
movw $0x1, %ax
movl %eax, 0x1c(%rsp)
jmp 0x403bb
testb %bpl, %bpl
movq 0x8(%rsp), %rdi
je 0x4034e
leal 0x2(%r14), %esi
movq %rbx, %rdi
callq 0x11c9d
testq %rax, %rax
je 0x40499
movq %rax, %rbp
movl %r14d, %r14d
leaq 0x1(%r14), %rdx
movq %rax, %rdi
movl $0x1, %esi
callq 0x7180
movb $0x0, 0x1(%rbp,%r14)
movq 0x98(%rsp), %rdx
testl %edx, %edx
movq 0x28(%rsp), %rcx
js 0x402a7
movl %edx, %eax
subl %ecx, %eax
cltq
movb $0x0, (%rbp,%rax)
testq %rdx, %rdx
js 0x402ba
shrq $0x20, %rdx
subl %ecx, %edx
movslq %edx, %rax
movb $0x0, (%rbp,%rax)
movl 0x64(%rsp), %esi
testl %esi, %esi
je 0x402cc
movq 0x8(%rsp), %rdi
callq 0x12171
movl $0x0, 0x30(%rsp)
movq 0x8(%rsp), %r14
movq %r14, %rdi
movl $0x10, %esi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x487d8
movl %eax, %r13d
movq 0x40(%rsp), %rdi
callq 0x5823e
movq %r14, %rdi
callq 0x4a501
movq %r14, %rdi
movl $0x10, %esi
xorl %edx, %edx
movl %eax, 0x40(%rsp)
movl %eax, %ecx
xorl %r8d, %r8d
callq 0x487d8
testl %r13d, %r13d
js 0x40344
movl 0x34(%r14), %eax
cmpl %r13d, %eax
jbe 0x4033c
movq 0x8(%rsp), %rcx
movq 0x8(%rcx), %rcx
movl %r13d, %edx
leaq (%rdx,%rdx,2), %rdx
movl %eax, 0x8(%rcx,%rdx,8)
movl $0x0, 0x30(%rsp)
movq 0x48(%rsp), %r13
jmp 0x403da
movl 0x58(%r12), %r14d
incl %r14d
movl %r14d, 0x58(%r12)
movswl %cx, %eax
movl %eax, 0x1c(%rsp)
movq %r13, %rsi
movq %rdi, %rbp
callq 0x52a33
movq %rax, 0x30(%rsp)
movq %rbp, %rdi
movl $0x2d, %esi
movl 0x18(%rsp), %edx
movl 0x1c(%rsp), %ecx
movl %r14d, %r8d
callq 0x487d8
movl $0x0, 0x1c(%rsp)
movq %rbp, %rdi
movl %eax, %esi
movq 0x30(%rsp), %rdx
xorl %ecx, %ecx
callq 0x12044
movq %rbp, %rdi
movl $0x69, %esi
movq 0x68(%rsp), %rdx
movl %r14d, %ecx
xorl %r8d, %r8d
callq 0x487d8
movq 0x40(%rsp), %rdi
callq 0x5823e
xorl %ebp, %ebp
movb $0x1, %al
movl %eax, 0x30(%rsp)
movl %r14d, 0x18(%rsp)
movl $0x0, 0x40(%rsp)
movq 0x28(%rsp), %r14
cmpq $0x0, 0x58(%rsp)
jne 0x40412
subq $0x8, %rsp
leaq 0x5c(%rsp), %rax
leaq 0x44(%rsp), %r9
movq %r12, %rdi
movq 0x28(%rsp), %rsi
movl $0x33, %edx
movl %r14d, %ecx
movq %rbp, %r8
pushq %rax
callq 0x5fbfc
addq $0x10, %rsp
cmpb $0x0, 0x30(%rsp)
je 0x4045e
testq %r13, %r13
movq 0x8(%rsp), %rdi
je 0x404a8
movl $0x67, %esi
movq 0x68(%rsp), %r14
movl %r14d, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x487d8
movq %rax, 0x28(%rsp)
movq 0x8(%rsp), %rdi
movl $0x60, %esi
movl %r14d, %edx
movl 0x18(%rsp), %ecx
xorl %r8d, %r8d
callq 0x487d8
jmp 0x404c3
movl 0x3c(%rsp), %edx
movl %edx, %eax
subl %r14d, %eax
cltq
movq $0x0, 0x28(%rsp)
cmpb $0x0, (%rbp,%rax)
je 0x404c3
movswl 0x1c(%rsp), %r9d
movq 0x8(%rsp), %rdi
movl $0x3f, %esi
movl 0x40(%rsp), %ecx
movl 0x18(%rsp), %r8d
callq 0x48a4f
jmp 0x404c3
movq 0x40(%rsp), %rdi
callq 0x5823e
jmp 0x3feee
movl $0x79, %esi
movq 0x78(%rsp), %rdx
xorl %ecx, %ecx
movl 0x18(%rsp), %r8d
callq 0x487d8
movq %rax, 0x28(%rsp)
movq 0x20(%rsp), %rsi
testb $0x10, 0x48(%rsi)
jne 0x40513
xorl %eax, %eax
cmpb $0x0, 0x1e(%r12)
sete %al
movl 0x3c(%rsp), %ecx
movl 0x54(%rsp), %r8d
movzbl 0x17(%rsp), %r10d
movswl 0x1c(%rsp), %r11d
movq %r12, %rdi
movq 0x90(%rsp), %rdx
movl 0x18(%rsp), %r9d
pushq %r10
pushq $0xa
pushq %rax
pushq %r11
callq 0x5fe4c
addq $0x20, %rsp
jmp 0x4059b
movq 0x60(%rsi), %r13
testq %r13, %r13
je 0x40528
cmpq %rbx, (%r13)
je 0x4052b
movq 0x28(%r13), %r13
jmp 0x40517
xorl %r13d, %r13d
movq %r12, %rdi
movq 0x20(%rsp), %rsi
callq 0x5fdc1
movq 0x8(%rsp), %r14
movq %r14, %rdi
movl $0xf, %esi
xorl %edx, %edx
movl $0x1, %ecx
movl 0x18(%rsp), %r8d
callq 0x487d8
movq %r14, %rdi
movl %eax, %esi
movq %r13, %rdx
movl $0xfffffff6, %ecx       # imm = 0xFFFFFFF6
callq 0x12044
movq 0x8(%r14), %rax
testq %rax, %rax
je 0x40583
movq 0x8(%rsp), %rcx
movslq 0x34(%rcx), %rcx
leaq (%rcx,%rcx,2), %rcx
movb $0x2, -0x15(%rax,%rcx,8)
movq 0x1e0(%r12), %rax
testq %rax, %rax
cmoveq %r12, %rax
movb $0x1, 0x24(%rax)
movq 0x48(%rsp), %r13
cmpb $0x0, 0x30(%rsp)
je 0x405f0
testq %r13, %r13
movq 0x8(%rsp), %rdi
je 0x4061f
movq 0x28(%rsp), %r14
leal 0x1(%r14), %ecx
movl $0x9, %esi
movq 0x68(%rsp), %rdx
xorl %r8d, %r8d
callq 0x487d8
movq %r14, %rdx
testl %edx, %edx
movq 0x20(%rsp), %rsi
js 0x40661
movq 0x8(%rsp), %rax
movl 0x34(%rax), %eax
cmpl %edx, %eax
jbe 0x40661
movq 0x8(%rsp), %rcx
movq 0x8(%rcx), %rcx
movl %edx, %edx
jmp 0x40659
cmpl $0x0, 0x40(%rsp)
movq 0x20(%rsp), %rsi
jns 0x40661
movq 0x8(%rsp), %rax
movq 0x40(%rax), %rax
testq %rax, %rax
je 0x40661
movl 0x40(%rsp), %edx
notl %edx
movq 0x8(%rsp), %rcx
movl 0x34(%rcx), %ecx
movl %edx, %edx
movl %ecx, (%rax,%rdx,4)
jmp 0x40661
movl $0x10, %esi
xorl %edx, %edx
movq 0x28(%rsp), %r14
movl %r14d, %ecx
xorl %r8d, %r8d
callq 0x487d8
testl %r14d, %r14d
movq 0x20(%rsp), %rsi
js 0x40661
movq 0x8(%rsp), %rax
movl 0x34(%rax), %eax
cmpl %r14d, %eax
jbe 0x40661
movq 0x8(%rsp), %rcx
movq 0x8(%rcx), %rcx
movl %r14d, %edx
leaq (%rdx,%rdx,2), %rdx
movl %eax, 0x8(%rcx,%rdx,8)
cmpq $0x0, 0x58(%rsp)
jne 0x406c2
testb $0x10, 0x48(%rsi)
jne 0x406c2
movq %rsi, %r14
testq %r13, %r13
jne 0x4068f
movl 0x3c(%rsp), %edx
movq 0x8(%rsp), %rdi
movl $0x38, %esi
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x487d8
movq 0x10(%r14), %r14
testq %r14, %r14
je 0x406c2
xorl %r13d, %r13d
movl 0x54(%rsp), %edx
addl %r13d, %edx
movq 0x8(%rsp), %rdi
movl $0x38, %esi
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x487d8
incl %r13d
movq 0x28(%r14), %r14
testq %r14, %r14
jne 0x4069b
cmpb $0x0, 0x1e(%r12)
jne 0x406dd
cmpq $0x0, 0x1e8(%r12)
jne 0x406dd
movq %r12, %rdi
callq 0x6013d
testb $-0x80, 0x2c(%rbx)
je 0x3fef0
cmpb $0x0, 0x1e(%r12)
jne 0x3fef0
cmpq $0x0, 0x1e8(%r12)
jne 0x3fef0
movq 0x8(%rsp), %r14
movq %r14, %rdi
movl $0x20, %esi
movl 0x38(%rsp), %edx
movl $0x1, %ecx
xorl %r8d, %r8d
callq 0x487d8
movq %r14, %rdi
movl $0x1, %esi
callq 0x3897c
movq (%r14), %rax
cmpb $0x0, 0x50(%rax)
jne 0x3fef0
movq 0x8(%rsp), %rax
movq 0x20(%rax), %rdi
leaq 0x335a3(%rip), %rsi     # 0x73ced
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl $0x1, %ecx
xorl %r8d, %r8d
callq 0xf552
jmp 0x3fef0