// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: sqlite3BtreeInsert
SQLITE_PRIVATE int sqlite3BtreeInsert(
  BtCursor *pCur,                /* Insert data into the table of this cursor */
  const BtreePayload *pX,        /* Content of the row to be inserted */
  int flags,                     /* True if this is likely an append */
  int seekResult                 /* Result of prior MovetoUnpacked() call */
){
  int rc;
  int loc = seekResult;          /* -1: before desired location  +1: after */
  int szNew = 0;
  int idx;
  MemPage *pPage;
  Btree *p = pCur->pBtree;
  BtShared *pBt = p->pBt;
  unsigned char *oldCell;
  unsigned char *newCell = 0;

  assert( (flags & (BTREE_SAVEPOSITION|BTREE_APPEND))==flags );

  if( pCur->eState==CURSOR_FAULT ){
    assert( pCur->skipNext!=SQLITE_OK );
    return pCur->skipNext;
  }

  assert( cursorOwnsBtShared(pCur) );
  assert( (pCur->curFlags & BTCF_WriteFlag)!=0
              && pBt->inTransaction==TRANS_WRITE
              && (pBt->btsFlags & BTS_READ_ONLY)==0 );
  assert( hasSharedCacheTableLock(p, pCur->pgnoRoot, pCur->pKeyInfo!=0, 2) );

  /* Assert that the caller has been consistent. If this cursor was opened
  ** expecting an index b-tree, then the caller should be inserting blob
  ** keys with no associated data. If the cursor was opened expecting an
  ** intkey table, the caller should be inserting integer keys with a
  ** blob of associated data.  */
  assert( (pX->pKey==0)==(pCur->pKeyInfo==0) );

  /* Save the positions of any other cursors open on this table.
  **
  ** In some cases, the call to btreeMoveto() below is a no-op. For
  ** example, when inserting data into a table with auto-generated integer
  ** keys, the VDBE layer invokes sqlite3BtreeLast() to figure out the
  ** integer key to use. It then calls this function to actually insert the
  ** data into the intkey B-Tree. In this case btreeMoveto() recognizes
  ** that the cursor is already where it needs to be and returns without
  ** doing any work. To avoid thwarting these optimizations, it is important
  ** not to clear the cursor here.
  */
  if( pCur->curFlags & BTCF_Multiple ){
    rc = saveAllCursors(pBt, pCur->pgnoRoot, pCur);
    if( rc ) return rc;
  }

  if( pCur->pKeyInfo==0 ){
    assert( pX->pKey==0 );
    /* If this is an insert into a table b-tree, invalidate any incrblob
    ** cursors open on the row being replaced */
    invalidateIncrblobCursors(p, pCur->pgnoRoot, pX->nKey, 0);

    /* If BTREE_SAVEPOSITION is set, the cursor must already be pointing
    ** to a row with the same key as the new entry being inserted.
    */
#ifdef SQLITE_DEBUG
    if( flags & BTREE_SAVEPOSITION ){
      assert( pCur->curFlags & BTCF_ValidNKey );
      assert( pX->nKey==pCur->info.nKey );
      assert( loc==0 );
    }
#endif

    /* On the other hand, BTREE_SAVEPOSITION==0 does not imply
    ** that the cursor is not pointing to a row to be overwritten.
    ** So do a complete check.
    */
    if( (pCur->curFlags&BTCF_ValidNKey)!=0 && pX->nKey==pCur->info.nKey ){
      /* The cursor is pointing to the entry that is to be
      ** overwritten */
      assert( pX->nData>=0 && pX->nZero>=0 );
      if( pCur->info.nSize!=0
       && pCur->info.nPayload==(u32)pX->nData+pX->nZero
      ){
        /* New entry is the same size as the old.  Do an overwrite */
        return btreeOverwriteCell(pCur, pX);
      }
      assert( loc==0 );
    }else if( loc==0 ){
      /* The cursor is *not* pointing to the cell to be overwritten, nor
      ** to an adjacent cell.  Move the cursor so that it is pointing either
      ** to the cell to be overwritten or an adjacent cell.
      */
      rc = sqlite3BtreeMovetoUnpacked(pCur, 0, pX->nKey, flags!=0, &loc);
      if( rc ) return rc;
    }
  }else{
    /* This is an index or a WITHOUT ROWID table */

    /* If BTREE_SAVEPOSITION is set, the cursor must already be pointing
    ** to a row with the same key as the new entry being inserted.
    */
    assert( (flags & BTREE_SAVEPOSITION)==0 || loc==0 );

    /* If the cursor is not already pointing either to the cell to be
    ** overwritten, or if a new cell is being inserted, if the cursor is
    ** not pointing to an immediately adjacent cell, then move the cursor
    ** so that it does.
    */
    if( loc==0 && (flags & BTREE_SAVEPOSITION)==0 ){
      if( pX->nMem ){
        UnpackedRecord r;
        r.pKeyInfo = pCur->pKeyInfo;
        r.aMem = pX->aMem;
        r.nField = pX->nMem;
        r.default_rc = 0;
        r.errCode = 0;
        r.r1 = 0;
        r.r2 = 0;
        r.eqSeen = 0;
        rc = sqlite3BtreeMovetoUnpacked(pCur, &r, 0, flags!=0, &loc);
      }else{
        rc = btreeMoveto(pCur, pX->pKey, pX->nKey, flags!=0, &loc);
      }
      if( rc ) return rc;
    }

    /* If the cursor is currently pointing to an entry to be overwritten
    ** and the new content is the same as as the old, then use the
    ** overwrite optimization.
    */
    if( loc==0 ){
      getCellInfo(pCur);
      if( pCur->info.nKey==pX->nKey ){
        BtreePayload x2;
        x2.pData = pX->pKey;
        x2.nData = pX->nKey;
        x2.nZero = 0;
        return btreeOverwriteCell(pCur, &x2);
      }
    }

  }
  assert( pCur->eState==CURSOR_VALID
       || (pCur->eState==CURSOR_INVALID && loc)
       || CORRUPT_DB );

  pPage = pCur->pPage;
  assert( pPage->intKey || pX->nKey>=0 );
  assert( pPage->leaf || !pPage->intKey );
  if( pPage->nFree<0 ){
    if( pCur->eState>CURSOR_INVALID ){
      rc = SQLITE_CORRUPT_BKPT;
    }else{
      rc = btreeComputeFreeSpace(pPage);
    }
    if( rc ) return rc;
  }

  TRACE(("INSERT: table=%d nkey=%lld ndata=%d page=%d %s\n",
          pCur->pgnoRoot, pX->nKey, pX->nData, pPage->pgno,
          loc==0 ? "overwrite" : "new entry"));
  assert( pPage->isInit );
  newCell = pBt->pTmpSpace;
  assert( newCell!=0 );
  rc = fillInCell(pPage, newCell, pX, &szNew);
  if( rc ) goto end_insert;
  assert( szNew==pPage->xCellSize(pPage, newCell) );
  assert( szNew <= MX_CELL_SIZE(pBt) );
  idx = pCur->ix;
  if( loc==0 ){
    CellInfo info;
    assert( idx<pPage->nCell );
    rc = sqlite3PagerWrite(pPage->pDbPage);
    if( rc ){
      goto end_insert;
    }
    oldCell = findCell(pPage, idx);
    if( !pPage->leaf ){
      memcpy(newCell, oldCell, 4);
    }
    rc = clearCell(pPage, oldCell, &info);
    testcase( pCur->curFlags & BTCF_ValidOvfl );
    invalidateOverflowCache(pCur);
    if( info.nSize==szNew && info.nLocal==info.nPayload
     && (!ISAUTOVACUUM || szNew<pPage->minLocal)
    ){
      /* Overwrite the old cell with the new if they are the same size.
      ** We could also try to do this if the old cell is smaller, then add
      ** the leftover space to the free list.  But experiments show that
      ** doing that is no faster then skipping this optimization and just
      ** calling dropCell() and insertCell().
      **
      ** This optimization cannot be used on an autovacuum database if the
      ** new entry uses overflow pages, as the insertCell() call below is
      ** necessary to add the PTRMAP_OVERFLOW1 pointer-map entry.  */
      assert( rc==SQLITE_OK ); /* clearCell never fails when nLocal==nPayload */
      if( oldCell < pPage->aData+pPage->hdrOffset+10 ){
        return SQLITE_CORRUPT_BKPT;
      }
      if( oldCell+szNew > pPage->aDataEnd ){
        return SQLITE_CORRUPT_BKPT;
      }
      memcpy(oldCell, newCell, szNew);
      return SQLITE_OK;
    }
    dropCell(pPage, idx, info.nSize, &rc);
    if( rc ) goto end_insert;
  }else if( loc<0 && pPage->nCell>0 ){
    assert( pPage->leaf );
    idx = ++pCur->ix;
    pCur->curFlags &= ~BTCF_ValidNKey;
  }else{
    assert( pPage->leaf );
  }
  insertCell(pPage, idx, newCell, szNew, 0, 0, &rc);
  assert( pPage->nOverflow==0 || rc==SQLITE_OK );
  assert( rc!=SQLITE_OK || pPage->nCell>0 || pPage->nOverflow>0 );

  /* If no error has occurred and pPage has an overflow cell, call balance()
  ** to redistribute the cells within the tree. Since balance() may move
  ** the cursor, zero the BtCursor.info.nSize and BTCF_ValidNKey
  ** variables.
  **
  ** Previous versions of SQLite called moveToRoot() to move the cursor
  ** back to the root page as balance() used to invalidate the contents
  ** of BtCursor.apPage[] and BtCursor.aiIdx[]. Instead of doing that,
  ** set the cursor state to "invalid". This makes common insert operations
  ** slightly faster.
  **
  ** There is a subtle but important optimization here too. When inserting
  ** multiple records into an intkey b-tree using a single cursor (as can
  ** happen while processing an "INSERT INTO ... SELECT" statement), it
  ** is advantageous to leave the cursor pointing to the last entry in
  ** the b-tree if possible. If the cursor is left pointing to the last
  ** entry in the table, and the next row inserted has an integer key
  ** larger than the largest existing key, it is possible to insert the
  ** row without seeking the cursor. This can be a big performance boost.
  */
  pCur->info.nSize = 0;
  if( pPage->nOverflow ){
    assert( rc==SQLITE_OK );
    pCur->curFlags &= ~(BTCF_ValidNKey);
    rc = balance(pCur);

    /* Must make sure nOverflow is reset to zero even if the balance()
    ** fails. Internal data structure corruption will result otherwise.
    ** Also, set the cursor state to invalid. This stops saveCursorPosition()
    ** from trying to save the current position of the cursor.  */
    pCur->pPage->nOverflow = 0;
    pCur->eState = CURSOR_INVALID;
    if( (flags & BTREE_SAVEPOSITION) && rc==SQLITE_OK ){
      btreeReleaseAllCursorPages(pCur);
      if( pCur->pKeyInfo ){
        assert( pCur->pKey==0 );
        pCur->pKey = sqlite3Malloc( pX->nKey );
        if( pCur->pKey==0 ){
          rc = SQLITE_NOMEM;
        }else{
          memcpy(pCur->pKey, pX->pKey, pX->nKey);
        }
      }
      pCur->eState = CURSOR_REQUIRESEEK;
      pCur->nKey = pX->nKey;
    }
  }
  assert( pCur->iPage<0 || pCur->pPage->nOverflow==0 );

end_insert:
  return rc;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rdi, %rbx
movl %ecx, 0x1c(%rsp)
cmpb $0x4, (%rdi)
jne 0x2a5bb9
movl 0x4(%rbx), %ebp
jmp 0x2a6191
movl %ecx, %r14d
movl %edx, %r13d
movq %rsi, %r12
movq 0x8(%rbx), %r15
movq 0x8(%r15), %rdi
testb $0x20, 0x1(%rbx)
movq %rdi, 0x68(%rsp)
je 0x2a5bef
movl 0x50(%rbx), %esi
movq %rbx, %rdx
callq 0x2979a1
movl %eax, 0x10(%rsp)
testl %eax, %eax
je 0x2a5bef
movl %eax, %ebp
jmp 0x2a6191
movq 0x80(%rbx), %rax
testq %rax, %rax
movl %r13d, 0x28(%rsp)
je 0x2a5c4c
andl $0x2, %r13d
orl %r14d, %r13d
je 0x2a5d4b
cmpl $0x0, 0x1c(%rsp)
jne 0x2a5caa
movq %rbx, %rdi
callq 0x297df9
movq 0x8(%r12), %rax
cmpq %rax, 0x30(%rbx)
jne 0x2a5caa
movq (%r12), %rcx
leaq 0x78(%rsp), %rsi
movq %rcx, 0x10(%rsi)
movl %eax, 0x24(%rsi)
movl $0x0, 0x28(%rsi)
movq %rbx, %rdi
callq 0x2aa1c1
jmp 0x2a5be8
movl 0x50(%rbx), %esi
movq 0x8(%r12), %rdx
movq %r15, %rdi
xorl %ecx, %ecx
callq 0x2a8e26
testb $0x2, 0x1(%rbx)
je 0x2a5ca1
movq 0x8(%r12), %rax
cmpq 0x30(%rbx), %rax
jne 0x2a5ca1
cmpw $0x0, 0x46(%rbx)
je 0x2a5caa
movl 0x28(%r12), %eax
addl 0x24(%r12), %eax
cmpl %eax, 0x40(%rbx)
jne 0x2a5caa
movq %rbx, %rdi
movq %r12, %rsi
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2aa1c1
testl %r14d, %r14d
je 0x2a5e0c
movq 0x88(%rbx), %rdi
cmpl $0x0, 0x14(%rdi)
movq %rdi, 0x20(%rsp)
js 0x2a5d12
movq %rbx, 0x48(%rsp)
movq 0x68(%rsp), %rax
movq 0x88(%rax), %rbp
movzbl 0xa(%rdi), %r14d
cmpb $0x0, 0x2(%rdi)
movq %rbp, 0x50(%rsp)
movq %r12, 0x30(%rsp)
je 0x2a5d98
movslq 0x24(%r12), %rbx
movslq 0x28(%r12), %r15
addq %rbx, %r15
movq 0x10(%r12), %r13
cmpl $0x7f, %r15d
ja 0x2a5dbb
movb %r15b, (%rbp,%r14)
movl $0x1, %r12d
jmp 0x2a5dcb
cmpb $0x2, (%rbx)
jb 0x2a5def
leaq 0x1395fd(%rip), %rsi    # 0x3df31f
leaq 0x139707(%rip), %rdx    # 0x3df430
leaq 0x139455(%rip), %r8     # 0x3df185
movl $0xb, %ebp
movl $0xb, %edi
movl $0x11e2f, %ecx          # imm = 0x11E2F
xorl %eax, %eax
callq 0x27e637
jmp 0x2a5df6
movzwl 0x20(%r12), %ecx
testw %cx, %cx
je 0x2a6161
leaq 0x78(%rsp), %rsi
movq %rax, (%rsi)
movq 0x18(%r12), %rax
movq %rax, 0x8(%rsi)
movw %cx, 0x10(%rsi)
xorl %ecx, %ecx
cmpl $0x0, 0x28(%rsp)
setne %cl
movl $0x0, 0x12(%rsi)
movb $0x0, 0x16(%rsi)
leaq 0x1c(%rsp), %r8
movq %rbx, %rdi
xorl %edx, %edx
callq 0x2a533d
jmp 0x2a6181
movq (%r12), %r13
movq 0x8(%r12), %rbx
cmpl $0x7f, %ebx
ja 0x2a5e3b
movl %r14d, %eax
movb %bl, (%rbp,%rax)
movl $0x1, %ecx
jmp 0x2a5e4f
leaq (%r14,%rbp), %rdi
movq %r15, %rsi
callq 0x2a4a2b
movzbl %al, %r12d
addl %r14d, %r12d
leaq (%r12,%rbp), %rdi
movq 0x30(%rsp), %rax
movq 0x8(%rax), %rsi
callq 0x2a4a2b
movl %eax, %ecx
addl %r12d, %ecx
movq 0x20(%rsp), %rdi
movq %rbp, %r10
jmp 0x2a5e5a
callq 0x2aa346
movl %eax, %ebp
movl %ebp, 0x10(%rsp)
testl %ebp, %ebp
movq 0x20(%rsp), %rdi
jne 0x2a6191
jmp 0x2a5cbc
movq 0x8(%r12), %rdx
xorl %ecx, %ecx
cmpl $0x0, 0x28(%rsp)
setne %cl
leaq 0x1c(%rsp), %r8
movq %rbx, %rdi
xorl %esi, %esi
callq 0x2a533d
movl %eax, 0x10(%rsp)
testl %eax, %eax
jne 0x2a5be8
jmp 0x2a5caa
leaq (%r14,%rbp), %rdi
movslq %ebx, %rsi
callq 0x2a4a2b
movq 0x20(%rsp), %rdi
movzbl %al, %ecx
addl %r14d, %ecx
movl %ebx, %r15d
movq 0x50(%rsp), %r10
movslq %ecx, %rbp
addq %r10, %rbp
movzwl 0xe(%rdi), %esi
cmpl %esi, %r15d
jle 0x2a60af
movzwl 0x10(%rdi), %r9d
movl %r15d, %eax
subl %r9d, %eax
movq 0x48(%rdi), %r12
movl 0x38(%r12), %r8d
addl $-0x4, %r8d
movq $0x0, 0x40(%rsp)
xorl %edx, %edx
divl %r8d
movl %edx, %r14d
addl %r9d, %r14d
cmpl %esi, %r14d
cmovgl %r9d, %r14d
leal (%r14,%rcx), %eax
addl %r14d, %ecx
addl $0x4, %ecx
movl %ecx, 0x18(%rsp)
cltq
addq %r10, %rax
movq %rax, 0x60(%rsp)
leaq 0x14(%rsp), %rax
movl $0x0, (%rax)
movq %r12, 0x70(%rsp)
cmpl %r14d, %r15d
movl %r14d, %r12d
cmovll %r15d, %r12d
cmpl %r12d, %ebx
jge 0x2a5eed
testl %ebx, %ebx
jle 0x2a5efd
movl %ebx, %edx
movq %rbp, %rdi
movq %r13, %rsi
callq 0x17660
movl %ebx, %r12d
jmp 0x2a5f0a
movslq %r12d, %rdx
movq %rbp, %rdi
movq %r13, %rsi
callq 0x17660
jmp 0x2a5f0a
movslq %r12d, %rdx
movq %rbp, %rdi
xorl %esi, %esi
callq 0x173a0
subl %r12d, %r15d
jle 0x2a60f9
movslq %r12d, %rax
addq %rax, %rbp
addq %rax, %r13
subl %r12d, %ebx
subl %r12d, %r14d
jne 0x2a5ec8
movq $0x0, 0x78(%rsp)
movl 0x14(%rsp), %r14d
movq 0x70(%rsp), %r12
cmpb $0x0, 0x21(%r12)
je 0x2a5fac
movl 0x220b7b(%rip), %ecx    # 0x4c6ac0
movl %r14d, %r8d
movl %r8d, %edi
leal 0x1(%rdi), %r8d
xorl %eax, %eax
cmpl $0x2, %r8d
jb 0x2a5f94
movl 0x38(%r12), %r9d
movl $0xcccccccd, %eax       # imm = 0xCCCCCCCD
imulq %rax, %r9
shrq $0x22, %r9
incl %r9d
leal -0x1(%rdi), %esi
movl %esi, %eax
xorl %edx, %edx
divl %r9d
subl %edx, %esi
movl %ecx, %eax
xorl %edx, %edx
divl 0x34(%r12)
leal 0x1(%rsi), %edx
xorl %r9d, %r9d
cmpl %eax, %edx
sete %r9b
leal (%rsi,%r9), %eax
addl $0x2, %eax
cmpl %eax, %r8d
je 0x2a5f48
movl %ecx, %eax
xorl %edx, %edx
divl 0x34(%r12)
cmpl %eax, %edi
je 0x2a5f48
incl %edi
movl %edi, 0x14(%rsp)
movl 0x14(%rsp), %ecx
movq %r12, %rdi
leaq 0x78(%rsp), %rsi
leaq 0x14(%rsp), %rdx
xorl %r8d, %r8d
callq 0x298417
movl %eax, 0x2c(%rsp)
cmpb $0x0, 0x21(%r12)
setne %cl
testl %eax, %eax
sete %al
andb %cl, %al
cmpb $0x1, %al
jne 0x2a6017
movl 0x14(%rsp), %esi
cmpl $0x1, %r14d
movl $0x4, %edx
sbbl $0x0, %edx
movq %r12, %rdi
movl %r14d, %ecx
leaq 0x2c(%rsp), %r8
callq 0x2991c1
cmpl $0x0, 0x2c(%rsp)
je 0x2a6017
movq 0x78(%rsp), %rax
testq %rax, %rax
je 0x2a6017
movq 0x70(%rax), %rdi
callq 0x2949b7
movl 0x2c(%rsp), %edx
testl %edx, %edx
je 0x2a6043
xorl %r14d, %r14d
movq 0x40(%rsp), %rax
testq %rax, %rax
je 0x2a603d
movq 0x70(%rax), %rdi
movl %edx, 0x5c(%rsp)
callq 0x2949b7
movl 0x5c(%rsp), %edx
movl %edx, 0x3c(%rsp)
jmp 0x2a6091
movl 0x14(%rsp), %eax
bswapl %eax
movq 0x60(%rsp), %rcx
movl %eax, (%rcx)
movq 0x40(%rsp), %rax
testq %rax, %rax
je 0x2a6067
movq 0x70(%rax), %rdi
movl %edx, %ebp
callq 0x2949b7
movl %ebp, %edx
movq 0x78(%rsp), %rcx
movq 0x50(%rcx), %rax
movq %rax, 0x60(%rsp)
movl $0x0, (%rax)
movq %rcx, 0x40(%rsp)
movq 0x50(%rcx), %rbp
addq $0x4, %rbp
movl 0x38(%r12), %r14d
addl $-0x4, %r14d
testl %edx, %edx
je 0x2a5ec8
movq 0x48(%rsp), %rbx
movq 0x30(%rsp), %r13
movq 0x20(%rsp), %r8
movl 0x3c(%rsp), %r14d
jmp 0x2a611e
addl %r15d, %ecx
cmpl $0x5, %ecx
movl $0x4, %eax
cmovgel %ecx, %eax
movl %eax, 0x18(%rsp)
movslq %ebx, %r14
movq %rbp, %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x17660
addq %r14, %rbp
subl %r14d, %r15d
movslq %r15d, %rdx
xorl %r14d, %r14d
movq %rbp, %rdi
xorl %esi, %esi
callq 0x173a0
movq 0x20(%rsp), %r8
movq 0x48(%rsp), %rbx
movq 0x30(%rsp), %r13
jmp 0x2a611e
xorl %r14d, %r14d
movq 0x40(%rsp), %rax
testq %rax, %rax
je 0x2a610f
movq 0x70(%rax), %rdi
callq 0x2949b7
movq 0x48(%rsp), %rbx
movq 0x30(%rsp), %r13
movq 0x20(%rsp), %r8
movl %r14d, 0x10(%rsp)
testl %r14d, %r14d
je 0x2a612e
movl 0x10(%rsp), %ebp
jmp 0x2a6191
movzwl 0x56(%rbx), %r15d
cmpl $0x0, 0x1c(%rsp)
je 0x2a61a5
jns 0x2a62bf
cmpw $0x0, 0x18(%r8)
je 0x2a62bf
incl %r15d
movw %r15w, 0x56(%rbx)
movzwl %r15w, %r15d
andb $-0x3, 0x1(%rbx)
jmp 0x2a62bf
movq (%r12), %rsi
movq 0x8(%r12), %rdx
xorl %ecx, %ecx
cmpl $0x0, 0x28(%rsp)
setne %cl
leaq 0x1c(%rsp), %r8
movq %rbx, %rdi
callq 0x2a8848
movl %eax, 0x10(%rsp)
movl 0x10(%rsp), %ebp
testl %ebp, %ebp
je 0x2a5c0d
movl %ebp, %eax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x70(%r8), %rdi
movq %r8, %r12
callq 0x280e3a
movl %eax, 0x10(%rsp)
testl %eax, %eax
je 0x2a61c3
movl $0x2, %eax
jmp 0x2a62a8
movzwl 0x1a(%r12), %eax
movq 0x60(%r12), %rcx
movzbl (%rcx,%r15,2), %edx
shll $0x8, %edx
movzbl 0x1(%rcx,%r15,2), %r14d
orl %edx, %r14d
andl %eax, %r14d
addq 0x50(%r12), %r14
cmpb $0x0, 0x8(%r12)
movq %r12, %rdi
movq 0x50(%rsp), %rbp
jne 0x2a61fd
movl (%r14), %eax
movl %eax, (%rbp)
leaq 0x78(%rsp), %r12
movq %r14, %rsi
movq %r12, %rdx
callq 0x2a9035
movq 0x20(%rsp), %rdi
movl %eax, 0x10(%rsp)
andb $-0x5, 0x1(%rbx)
movzwl 0x16(%r12), %edx
cmpl %edx, 0x18(%rsp)
jne 0x2a628d
movzwl 0x8c(%rsp), %eax
cmpl %eax, 0x88(%rsp)
jne 0x2a628d
movq 0x68(%rsp), %rax
cmpb $0x0, 0x21(%rax)
je 0x2a624c
movzwl 0x10(%rdi), %eax
cmpl %eax, 0x18(%rsp)
jge 0x2a628d
movq 0x50(%rdi), %rax
movzbl 0x9(%rdi), %ecx
addq %rcx, %rax
addq $0xa, %rax
cmpq %rax, %r14
jae 0x2a6377
leaq 0x1390b4(%rip), %rsi    # 0x3df31f
leaq 0x1391be(%rip), %rdx    # 0x3df430
leaq 0x138f0c(%rip), %r8     # 0x3df185
movl $0xb, %ebp
movl $0xb, %edi
movl $0x11e5d, %ecx          # imm = 0x11E5D
jmp 0x2a63aa
leaq 0x10(%rsp), %r14
movl %r15d, %esi
movq %r14, %rcx
callq 0x2aa492
xorl %eax, %eax
cmpl $0x0, (%r14)
setne %al
addl %eax, %eax
testl %eax, %eax
movq 0x20(%rsp), %r8
je 0x2a62bf
cmpl $0x2, %eax
je 0x2a6128
jmp 0x2a6191
leaq 0x10(%rsp), %rax
movq %rax, (%rsp)
movq %r8, %rdi
movl %r15d, %esi
movq 0x50(%rsp), %rdx
movl 0x18(%rsp), %ecx
movq %r8, %r14
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x2aa5ae
movw $0x0, 0x46(%rbx)
cmpb $0x0, 0xc(%r14)
je 0x2a6128
andb $-0x3, 0x1(%rbx)
movq %rbx, %rdi
callq 0x2aa8d7
movl %eax, 0x10(%rsp)
movq 0x88(%rbx), %rcx
movb $0x0, 0xc(%rcx)
movb $0x1, (%rbx)
movl 0x28(%rsp), %ecx
shrb %cl
testl %eax, %eax
sete %al
andb %cl, %al
cmpb $0x1, %al
jne 0x2a6128
movq %rbx, %rdi
callq 0x297d1a
cmpq $0x0, 0x80(%rbx)
je 0x2a6367
movq 0x8(%r13), %rdi
callq 0x27c381
movq %rax, 0x18(%rbx)
testq %rax, %rax
je 0x2a635f
movq (%r13), %rsi
movq 0x8(%r13), %rdx
movq %rax, %rdi
callq 0x17660
jmp 0x2a6367
movl $0x7, 0x10(%rsp)
movb $0x3, (%rbx)
movq 0x8(%r13), %rax
movq %rax, 0x48(%rbx)
jmp 0x2a6128
movslq 0x18(%rsp), %rdx
leaq (%r14,%rdx), %rax
cmpq 0x58(%rdi), %rax
jbe 0x2a63bb
leaq 0x138f92(%rip), %rsi    # 0x3df31f
leaq 0x13909c(%rip), %rdx    # 0x3df430
leaq 0x138dea(%rip), %r8     # 0x3df185
movl $0xb, %ebp
movl $0xb, %edi
movl $0x11e60, %ecx          # imm = 0x11E60
xorl %eax, %eax
callq 0x27e637
movl $0x1, %eax
jmp 0x2a62a8
movq %r14, %rdi
movq %rbp, %rsi
callq 0x17660
movl $0x1, %eax
xorl %ebp, %ebp
jmp 0x2a62a8