// File: /workspace/github_c_makefile_star2_O3/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 $0x98, %rsp
movq %rdi, %rbx
movl %ecx, 0x14(%rsp)
cmpb $0x4, (%rdi)
jne 0x29c866
movl 0x4(%rbx), %r14d
jmp 0x29c893
movl %ecx, %ebp
movl %edx, %r13d
movq %rsi, %r12
movq 0x8(%rbx), %r15
movq 0x8(%r15), %rdi
testb $0x20, 0x1(%rbx)
movq %rdi, 0x60(%rsp)
je 0x29c8a8
movl 0x50(%rbx), %esi
movq %rbx, %rdx
callq 0x28dd69
testl %eax, %eax
je 0x29c8a8
movl %eax, %r14d
movl %r14d, %eax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x80(%rbx), %rax
testq %rax, %rax
je 0x29c8fe
movl %r13d, %ecx
andl $0x2, %ecx
orl %ebp, %ecx
je 0x29ca01
testl %ebp, %ebp
jne 0x29c95b
movq %rbx, %rdi
callq 0x28e1b0
movq 0x30(%rbx), %rax
cmpq 0x8(%r12), %rax
jne 0x29c95b
movq (%r12), %rcx
leaq 0x68(%rsp), %rsi
movq %rcx, 0x10(%rsi)
movl %eax, 0x24(%rsi)
movl $0x0, 0x28(%rsi)
movq %rbx, %rdi
callq 0x2a07d2
jmp 0x29c890
movl 0x50(%rbx), %esi
movq 0x8(%r12), %rdx
movq %r15, %rdi
xorl %ecx, %ecx
callq 0x29f5d8
testb $0x2, 0x1(%rbx)
je 0x29c953
movq 0x8(%r12), %rax
cmpq 0x30(%rbx), %rax
jne 0x29c953
cmpw $0x0, 0x46(%rbx)
je 0x29c95b
movl 0x28(%r12), %eax
addl 0x24(%r12), %eax
cmpl %eax, 0x40(%rbx)
jne 0x29c95b
movq %rbx, %rdi
movq %r12, %rsi
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2a07d2
testl %ebp, %ebp
je 0x29cac4
movq 0x88(%rbx), %rbp
cmpl $0x0, 0x14(%rbp)
js 0x29c9c7
movl %r13d, 0x1c(%rsp)
movq %rbx, 0x40(%rsp)
movq 0x60(%rsp), %rax
movq 0x88(%rax), %rcx
movzbl 0xa(%rbp), %r14d
cmpb $0x0, 0x2(%rbp)
movq %rcx, 0x28(%rsp)
movq %r12, 0x38(%rsp)
je 0x29ca4c
movslq 0x24(%r12), %rbx
movslq 0x28(%r12), %r15
addq %rbx, %r15
movq 0x10(%r12), %r13
cmpl $0x7f, %r15d
ja 0x29ca6e
movq 0x28(%rsp), %rcx
movb %r15b, (%rcx,%r14)
movl $0x1, %r12d
jmp 0x29ca86
cmpb $0x2, (%rbx)
jb 0x29caab
leaq 0x1391f4(%rip), %rsi    # 0x3d5bcb
leaq 0x1392fe(%rip), %rdx    # 0x3d5cdc
leaq 0x13904c(%rip), %r8     # 0x3d5a31
movl $0xb, %r14d
movl $0xb, %edi
movl $0x11e2f, %ecx          # imm = 0x11E2F
xorl %eax, %eax
callq 0x274d08
jmp 0x29c893
movzwl 0x20(%r12), %ecx
testw %cx, %cx
je 0x29caed
leaq 0x68(%rsp), %rsi
movq %rax, (%rsi)
movq 0x18(%r12), %rax
movq %rax, 0x8(%rsi)
movw %cx, 0x10(%rsi)
xorl %ecx, %ecx
testl %r13d, %r13d
setne %cl
movl $0x0, 0x12(%rsi)
movb $0x0, 0x16(%rsi)
leaq 0x14(%rsp), %r8
movq %rbx, %rdi
xorl %edx, %edx
callq 0x29c0b4
jmp 0x29cb0b
movq (%r12), %r13
movq 0x8(%r12), %rbx
cmpl $0x7f, %ebx
ja 0x29cb23
movl %r14d, %eax
movb %bl, (%rcx,%rax)
movl $0x1, %ecx
jmp 0x29cb32
movq 0x28(%rsp), %r12
leaq (%r12,%r14), %rdi
movq %r15, %rsi
callq 0x29b924
movq %r12, %rcx
movzbl %al, %r12d
addl %r14d, %r12d
leaq (%rcx,%r12), %rdi
movq 0x38(%rsp), %rax
movq 0x8(%rax), %rsi
movq %rcx, %r14
callq 0x29b924
movq %r14, %r9
movl %eax, %ecx
addl %r12d, %ecx
jmp 0x29cb3d
movq %rbp, %rdi
callq 0x2a0957
movl %eax, 0xc(%rsp)
testl %eax, %eax
jne 0x29c890
jmp 0x29c968
movq 0x8(%r12), %rdx
xorl %ecx, %ecx
testl %r13d, %r13d
setne %cl
leaq 0x14(%rsp), %r8
movq %rbx, %rdi
xorl %esi, %esi
callq 0x29c0b4
testl %eax, %eax
jne 0x29c890
jmp 0x29c95b
movq (%r12), %rsi
movq 0x8(%r12), %rdx
xorl %ecx, %ecx
testl %r13d, %r13d
setne %cl
leaq 0x14(%rsp), %r8
movq %rbx, %rdi
callq 0x29f01a
movl %eax, %r14d
movl %eax, 0xc(%rsp)
testl %eax, %eax
jne 0x29c893
movl 0x14(%rsp), %ebp
jmp 0x29c8c2
leaq (%rcx,%r14), %rdi
movslq %ebx, %rsi
callq 0x29b924
movzbl %al, %ecx
addl %r14d, %ecx
movl %ebx, %r15d
movq 0x28(%rsp), %r9
movslq %ecx, %r14
addq %r9, %r14
movzwl 0xe(%rbp), %esi
cmpl %esi, %r15d
movq %rbp, 0x48(%rsp)
jle 0x29cd5d
movzwl 0x10(%rbp), %edi
movl %r15d, %eax
subl %edi, %eax
movq 0x48(%rbp), %rdx
movq %rdx, 0x58(%rsp)
movl 0x38(%rdx), %r8d
addl $-0x4, %r8d
movq $0x0, 0x20(%rsp)
xorl %edx, %edx
divl %r8d
movl %edx, %r12d
addl %edi, %r12d
cmpl %esi, %r12d
cmovgl %edi, %r12d
leal (%r12,%rcx), %eax
addl %r12d, %ecx
addl $0x4, %ecx
movl %ecx, 0x10(%rsp)
cltq
addq %r9, %rax
movq %rax, 0x50(%rsp)
leaq 0x18(%rsp), %rax
movl $0x0, (%rax)
cmpl %r12d, %r15d
movl %r12d, %ebp
cmovll %r15d, %ebp
cmpl %ebp, %ebx
jge 0x29cbd0
testl %ebx, %ebx
jle 0x29cbe0
movl %ebx, %edx
movq %r14, %rdi
movq %r13, %rsi
callq 0x17660
movl %ebx, %ebp
jmp 0x29cbed
movslq %ebp, %rdx
movq %r14, %rdi
movq %r13, %rsi
callq 0x17660
jmp 0x29cbed
movslq %ebp, %rdx
movq %r14, %rdi
xorl %esi, %esi
callq 0x173a0
subl %ebp, %r15d
jle 0x29cd95
movslq %ebp, %rax
addq %rax, %r14
addq %rax, %r13
subl %ebp, %ebx
subl %ebp, %r12d
jne 0x29cbad
movq $0x0, 0x68(%rsp)
movl 0x18(%rsp), %r11d
movq 0x58(%rsp), %r12
cmpb $0x0, 0x21(%r12)
movl %r11d, %ecx
movq 0x20(%rsp), %rbp
je 0x29cc97
movl 0x21ee91(%rip), %esi    # 0x4bbac0
movl %r11d, %r8d
movl $0xcccccccd, %r10d      # imm = 0xCCCCCCCD
movl %r8d, %ecx
leal 0x1(%rcx), %r8d
xorl %eax, %eax
cmpl $0x2, %r8d
jb 0x29cc7f
movl 0x38(%r12), %r9d
imulq %r10, %r9
shrq $0x22, %r9
incl %r9d
leal -0x1(%rcx), %edi
movl %edi, %eax
xorl %edx, %edx
divl %r9d
subl %edx, %edi
movl %esi, %eax
xorl %edx, %edx
divl 0x34(%r12)
leal 0x1(%rdi), %edx
xorl %r9d, %r9d
cmpl %eax, %edx
sete %r9b
leal (%rdi,%r9), %eax
addl $0x2, %eax
cmpl %eax, %r8d
je 0x29cc38
movl %esi, %eax
xorl %edx, %edx
divl 0x34(%r12)
cmpl %eax, %ecx
je 0x29cc38
incl %ecx
movl %ecx, 0x18(%rsp)
movq %rbp, 0x20(%rsp)
movl %r11d, %ebp
movq %r12, %rdi
leaq 0x68(%rsp), %rsi
leaq 0x18(%rsp), %rdx
xorl %r8d, %r8d
callq 0x28e798
movl %eax, %r14d
movl %eax, 0x34(%rsp)
cmpb $0x0, 0x21(%r12)
je 0x29ccfe
testl %r14d, %r14d
jne 0x29ccfe
movq %r12, %rdi
movl 0x18(%rsp), %r12d
cmpl $0x1, %ebp
movl $0x4, %edx
sbbl $0x0, %edx
movl %r12d, %esi
movl %ebp, %ecx
leaq 0x34(%rsp), %r8
callq 0x28f455
movl 0x34(%rsp), %r14d
testl %r14d, %r14d
movq 0x20(%rsp), %rbp
je 0x29cd11
jmp 0x29cff1
testl %r14d, %r14d
jne 0x29cfea
movl 0x18(%rsp), %r12d
movq 0x20(%rsp), %rbp
bswapl %r12d
movq 0x50(%rsp), %rax
movl %r12d, (%rax)
testq %rbp, %rbp
je 0x29cd2a
movq 0x70(%rbp), %rdi
callq 0x28ab87
movq 0x68(%rsp), %rcx
movq 0x50(%rcx), %rax
movq %rax, 0x50(%rsp)
movl $0x0, (%rax)
movq %rcx, 0x20(%rsp)
movq 0x50(%rcx), %r14
addq $0x4, %r14
movq 0x58(%rsp), %rax
movl 0x38(%rax), %r12d
addl $-0x4, %r12d
jmp 0x29cbad
addl %r15d, %ecx
cmpl $0x5, %ecx
movl $0x4, %eax
cmovgel %ecx, %eax
movl %eax, 0x10(%rsp)
movslq %ebx, %r12
movq %r14, %rdi
movq %r13, %rsi
movq %r12, %rdx
callq 0x17660
addq %r12, %r14
subl %r12d, %r15d
movslq %r15d, %rdx
movq %r14, %rdi
xorl %esi, %esi
callq 0x173a0
jmp 0x29cda8
movq 0x20(%rsp), %rax
testq %rax, %rax
je 0x29cda8
movq 0x70(%rax), %rdi
callq 0x28ab87
movq 0x40(%rsp), %rbx
movq 0x38(%rsp), %r12
movl 0x1c(%rsp), %ebp
movl $0x0, 0xc(%rsp)
movzwl 0x56(%rbx), %r15d
cmpl $0x0, 0x14(%rsp)
je 0x29cdf5
jns 0x29cef0
movq 0x48(%rsp), %rax
cmpw $0x0, 0x18(%rax)
je 0x29cef0
incl %r15d
movw %r15w, 0x56(%rbx)
movzwl %r15w, %r15d
andb $-0x3, 0x1(%rbx)
jmp 0x29cef0
movq 0x48(%rsp), %rbp
movq 0x70(%rbp), %rdi
callq 0x2774a1
movl %eax, %r14d
testl %eax, %eax
jne 0x29c893
movq %r12, %r13
movzwl 0x1a(%rbp), %eax
movq 0x60(%rbp), %rcx
movzbl (%rcx,%r15,2), %edx
shll $0x8, %edx
movzbl 0x1(%rcx,%r15,2), %r14d
orl %edx, %r14d
andl %eax, %r14d
addq 0x50(%rbp), %r14
cmpb $0x0, 0x8(%rbp)
jne 0x29ce41
movl (%r14), %eax
movq 0x28(%rsp), %rcx
movl %eax, (%rcx)
leaq 0x68(%rsp), %r12
movq %rbp, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x29f7c7
movl %eax, 0xc(%rsp)
andb $-0x5, 0x1(%rbx)
movzwl 0x16(%r12), %edx
cmpl %edx, 0x10(%rsp)
jne 0x29ceca
movzwl 0x7c(%rsp), %eax
cmpl %eax, 0x78(%rsp)
jne 0x29ceca
movq 0x60(%rsp), %rax
cmpb $0x0, 0x21(%rax)
je 0x29ce88
movzwl 0x10(%rbp), %eax
cmpl %eax, 0x10(%rsp)
jae 0x29ceca
movq 0x50(%rbp), %rax
movzbl 0x9(%rbp), %ecx
addq %rcx, %rax
addq $0xa, %rax
cmpq %rax, %r14
jae 0x29cfb2
leaq 0x138d24(%rip), %rsi    # 0x3d5bcb
leaq 0x138e2e(%rip), %rdx    # 0x3d5cdc
leaq 0x138b7c(%rip), %r8     # 0x3d5a31
movl $0xb, %r14d
movl $0xb, %edi
movl $0x11e5d, %ecx          # imm = 0x11E5D
jmp 0x29c9f5
leaq 0xc(%rsp), %r14
movq %rbp, %rdi
movl %r15d, %esi
movq %r14, %rcx
callq 0x2a0ae5
movl (%r14), %r14d
testl %r14d, %r14d
movl 0x1c(%rsp), %ebp
jne 0x29c893
movq %r13, %r12
leaq 0xc(%rsp), %rax
movq %rax, (%rsp)
movq 0x48(%rsp), %r14
movq %r14, %rdi
movl %r15d, %esi
movq 0x28(%rsp), %rdx
movl 0x10(%rsp), %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x2a0c01
movw $0x0, 0x46(%rbx)
cmpb $0x0, 0xc(%r14)
je 0x29cf91
andb $-0x3, 0x1(%rbx)
movq %rbx, %rdi
callq 0x2a0ea8
movl %eax, %r14d
movq 0x88(%rbx), %rax
movb $0x0, 0xc(%rax)
movb $0x1, (%rbx)
shrb %bpl
testl %r14d, %r14d
sete %al
andb %bpl, %al
cmpb $0x1, %al
jne 0x29c893
movq %rbx, %rdi
callq 0x28e0af
xorl %r14d, %r14d
cmpq $0x0, 0x80(%rbx)
je 0x29cfa1
movq 0x8(%r12), %rdi
callq 0x272ae6
movq %rax, 0x18(%rbx)
testq %rax, %rax
je 0x29cf9b
movq (%r12), %rsi
movq 0x8(%r12), %rdx
movq %rax, %rdi
callq 0x17660
jmp 0x29cfa1
movl 0xc(%rsp), %r14d
jmp 0x29c893
movl $0x7, %r14d
movb $0x3, (%rbx)
movq 0x8(%r12), %rax
movq %rax, 0x48(%rbx)
jmp 0x29c893
movl 0x10(%rsp), %edx
leaq (%r14,%rdx), %rax
cmpq 0x58(%rbp), %rax
jbe 0x29d01b
leaq 0x138c04(%rip), %rsi    # 0x3d5bcb
leaq 0x138d0e(%rip), %rdx    # 0x3d5cdc
leaq 0x138a5c(%rip), %r8     # 0x3d5a31
movl $0xb, %r14d
movl $0xb, %edi
movl $0x11e60, %ecx          # imm = 0x11E60
jmp 0x29c9f5
movq 0x20(%rsp), %rbp
jmp 0x29d004
movq 0x68(%rsp), %rax
testq %rax, %rax
je 0x29d004
movq 0x70(%rax), %rdi
callq 0x28ab87
testq %rbp, %rbp
je 0x29c893
movq 0x70(%rbp), %rdi
callq 0x28ab87
jmp 0x29c893
movq %r14, %rdi
movq 0x28(%rsp), %rsi
callq 0x17660
xorl %r14d, %r14d
jmp 0x29c893