// File: /workspace/github_c_makefile_star2_O2/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, %r12
movl %ecx, 0x14(%rsp)
cmpb $0x4, (%rdi)
jne 0x243486
movl 0x4(%r12), %r14d
jmp 0x2436df
movl %ecx, %ebp
movl %edx, %ebx
movq %rsi, %r13
movq 0x8(%r12), %r15
movq 0x8(%r15), %rdi
testb $0x20, 0x1(%r12)
movq %rdi, 0x68(%rsp)
je 0x2434bc
movl 0x50(%r12), %esi
movq %r12, %rdx
callq 0x236e12
movl %eax, 0x10(%rsp)
testl %eax, %eax
jne 0x2436dc
movq 0x80(%r12), %rax
testq %rax, %rax
je 0x243516
movl %ebx, %ecx
andl $0x2, %ecx
orl %ebp, %ecx
je 0x2435fe
testl %ebp, %ebp
jne 0x243578
movq %r12, %rdi
callq 0x23718f
movq 0x30(%r12), %rax
cmpq 0x8(%r13), %rax
jne 0x243578
movq (%r13), %rcx
leaq 0x78(%rsp), %rsi
movq %rcx, 0x10(%rsi)
movl %eax, 0x24(%rsi)
andl $0x0, 0x28(%rsi)
movq %r12, %rdi
callq 0x246793
jmp 0x2436dc
movl 0x50(%r12), %esi
movq 0x8(%r13), %rdx
movq %r15, %rdi
xorl %ecx, %ecx
callq 0x2457cd
testb $0x2, 0x1(%r12)
je 0x243570
movq 0x8(%r13), %rax
cmpq 0x30(%r12), %rax
jne 0x243570
cmpw $0x0, 0x46(%r12)
je 0x243578
movl 0x28(%r13), %eax
addl 0x24(%r13), %eax
cmpl %eax, 0x40(%r12)
jne 0x243578
movq %r12, %rdi
movq %r13, %rsi
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x246793
testl %ebp, %ebp
je 0x2436b6
movq 0x88(%r12), %r15
cmpl $0x0, 0x14(%r15)
js 0x2435e4
movl %ebx, 0x30(%rsp)
movq 0x68(%rsp), %rax
movq 0x88(%rax), %rax
movq %rax, 0x20(%rsp)
movzbl 0xa(%r15), %edx
movq %r15, 0x60(%rsp)
cmpb $0x0, 0x2(%r15)
movq %r13, 0x58(%rsp)
je 0x243643
movslq 0x24(%r13), %rbp
movq %r13, %rax
movslq 0x28(%r13), %r13
addq %rbp, %r13
movq 0x10(%rax), %r15
cmpl $0x7f, %r13d
ja 0x243667
pushq $0x1
popq %r14
movq 0x20(%rsp), %rbx
movb %r13b, (%rbx,%rdx)
jmp 0x243682
cmpb $0x2, (%r12)
jb 0x2436a1
movl $0x11e2f, %edi          # imm = 0x11E2F
callq 0x232547
jmp 0x2436dc
movzwl 0x20(%r13), %ecx
testw %cx, %cx
je 0x2436f4
leaq 0x78(%rsp), %rsi
movq %rax, (%rsi)
movq 0x18(%r13), %rax
movq %rax, 0x8(%rsi)
movw %cx, 0x10(%rsi)
xorl %ecx, %ecx
testl %ebx, %ebx
setne %cl
andl $0x0, 0x12(%rsi)
movb $0x0, 0x16(%rsi)
leaq 0x14(%rsp), %r8
movq %r12, %rdi
xorl %edx, %edx
callq 0x242e02
jmp 0x243710
movq (%r13), %r15
movq 0x8(%r13), %rbp
cmpl $0x7f, %ebp
ja 0x243724
movl %edx, %eax
movq 0x20(%rsp), %rcx
movb %bpl, (%rcx,%rax)
pushq $0x1
popq %rcx
jmp 0x24373e
movq 0x20(%rsp), %rbx
leaq (%rbx,%rdx), %rdi
movq %r13, %rsi
movq %rdx, %r14
callq 0x2428b1
movq %r14, %rdx
movzbl %al, %r14d
addl %edx, %r14d
leaq (%rbx,%r14), %rdi
movq 0x58(%rsp), %rax
movq 0x8(%rax), %rsi
callq 0x2428b1
movl %eax, %ecx
addl %r14d, %ecx
jmp 0x243748
movq %r15, %rdi
callq 0x2468e4
movl %eax, 0x10(%rsp)
testl %eax, %eax
jne 0x2436dc
jmp 0x243587
movq 0x8(%r13), %rdx
xorl %ecx, %ecx
testl %ebx, %ebx
setne %cl
leaq 0x14(%rsp), %r8
movq %r12, %rdi
xorl %esi, %esi
callq 0x242e02
movl %eax, 0x10(%rsp)
testl %eax, %eax
je 0x243578
movl %eax, %r14d
movl %r14d, %eax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%r13), %rsi
movq 0x8(%r13), %rdx
xorl %ecx, %ecx
testl %ebx, %ebx
setne %cl
leaq 0x14(%rsp), %r8
movq %r12, %rdi
callq 0x245348
movl %eax, %r14d
movl %eax, 0x10(%rsp)
testl %eax, %eax
jne 0x2436df
movl 0x14(%rsp), %ebp
jmp 0x2434d6
movq 0x20(%rsp), %rax
leaq (%rax,%rdx), %rdi
movslq %ebp, %rsi
movq %rdx, %rbx
callq 0x2428b1
movq %rbx, %rdx
movzbl %al, %ecx
addl %edx, %ecx
movl %ebp, %r13d
movq 0x20(%rsp), %rbx
movslq %ecx, %r14
addq %rbx, %r14
movq 0x60(%rsp), %rdx
movzwl 0xe(%rdx), %esi
pushq $0x4
popq %rax
cmpl %esi, %r13d
jle 0x24391f
movq %r12, 0x70(%rsp)
movzwl 0x10(%rdx), %edi
movl %r13d, %eax
subl %edi, %eax
movq 0x48(%rdx), %rdx
movq %rdx, 0x50(%rsp)
movl 0x38(%rdx), %r8d
addl $-0x4, %r8d
movq $0x0, 0x38(%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, 0x1c(%rsp)
leaq 0x18(%rsp), %rcx
andl $0x0, (%rcx)
cltq
addq %rbx, %rax
movq %rax, 0x48(%rsp)
cmpl %r12d, %r13d
movl %r12d, %ebx
cmovll %r13d, %ebx
movslq %ebx, %rdx
cmpl %ebx, %ebp
jge 0x2437e3
testl %ebp, %ebp
jle 0x2437f0
movl %ebp, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x17630
movl %ebp, %ebx
jmp 0x2437fa
movq %r14, %rdi
movq %r15, %rsi
callq 0x17630
jmp 0x2437fa
movq %r14, %rdi
xorl %esi, %esi
callq 0x17380
subl %ebx, %r13d
jle 0x243952
movslq %ebx, %rax
addq %rax, %r14
addq %rax, %r15
subl %ebx, %ebp
subl %ebx, %r12d
jne 0x2437bd
andq $0x0, 0x78(%rsp)
movl 0x18(%rsp), %eax
movq 0x50(%rsp), %r12
cmpb $0x0, 0x21(%r12)
movl %eax, 0x2c(%rsp)
movl %eax, %r14d
je 0x24386c
movl 0x1f7239(%rip), %eax    # 0x43aa70
movl %eax, 0x44(%rsp)
movl 0x2c(%rsp), %ebx
movl %ebx, %r14d
leal 0x1(%r14), %ebx
movq %r12, %rdi
movl %ebx, %esi
callq 0x236d49
cmpl %eax, %ebx
je 0x24383f
movl 0x44(%rsp), %eax
xorl %edx, %edx
divl 0x34(%r12)
cmpl %eax, %r14d
je 0x24383f
incl %r14d
movl %r14d, 0x18(%rsp)
movq %r12, %rdi
leaq 0x78(%rsp), %rsi
leaq 0x18(%rsp), %rdx
movl %r14d, %ecx
xorl %r8d, %r8d
callq 0x2376d5
movl %eax, %r14d
movl %eax, 0x34(%rsp)
cmpb $0x0, 0x21(%r12)
je 0x2438cc
testl %r14d, %r14d
jne 0x2438cc
movl 0x18(%rsp), %ebx
movl 0x2c(%rsp), %ecx
cmpl $0x1, %ecx
pushq $0x4
popq %rdx
sbbl $0x0, %edx
movq %r12, %rdi
movl %ebx, %esi
leaq 0x34(%rsp), %r8
callq 0x238312
movl 0x34(%rsp), %r14d
testl %r14d, %r14d
movq 0x38(%rsp), %r12
je 0x2438de
jmp 0x243b5e
testl %r14d, %r14d
movq 0x38(%rsp), %r12
jne 0x243b68
movl 0x18(%rsp), %ebx
bswapl %ebx
movq 0x48(%rsp), %rax
movl %ebx, (%rax)
movq %r12, %rdi
callq 0x2376c6
movq 0x78(%rsp), %rcx
movq 0x50(%rcx), %rax
movq %rax, 0x48(%rsp)
andl $0x0, (%rax)
movq %rcx, 0x38(%rsp)
movq 0x50(%rcx), %r14
addq $0x4, %r14
movq 0x50(%rsp), %rax
movl 0x38(%rax), %r12d
addl $-0x4, %r12d
jmp 0x2437bd
addl %r13d, %ecx
cmpl $0x5, %ecx
cmovgel %ecx, %eax
movslq %ebp, %rbx
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
movl %eax, %ebp
callq 0x17630
addq %rbx, %r14
subl %ebx, %r13d
movslq %r13d, %rdx
movq %r14, %rdi
xorl %esi, %esi
callq 0x17380
movl %ebp, %ecx
jmp 0x243965
movq 0x38(%rsp), %rdi
callq 0x2376c6
movq 0x70(%rsp), %r12
movl 0x1c(%rsp), %ecx
andl $0x0, 0x10(%rsp)
movzwl 0x56(%r12), %r15d
cmpl $0x0, 0x14(%rsp)
movq 0x58(%rsp), %r13
movl 0x30(%rsp), %ebx
movq 0x60(%rsp), %rbp
je 0x2439ae
jns 0x243a8c
cmpw $0x0, 0x18(%rbp)
je 0x243a8c
incl %r15d
movw %r15w, 0x56(%r12)
movzwl %r15w, %r15d
andb $-0x3, 0x1(%r12)
jmp 0x243a8c
movl %ecx, 0x1c(%rsp)
movq 0x70(%rbp), %rdi
callq 0x2236f2
movl %eax, %r14d
testl %eax, %eax
jne 0x2436df
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 0x2439f6
movl (%r14), %eax
movq 0x20(%rsp), %rcx
movl %eax, (%rcx)
leaq 0x78(%rsp), %rbx
movq %rbp, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x245990
movl %eax, 0x10(%rsp)
andb $-0x5, 0x1(%r12)
movzwl 0x16(%rbx), %edx
movl 0x1c(%rsp), %esi
cmpl %edx, %esi
jne 0x243a65
movzwl 0x8c(%rsp), %eax
cmpl %eax, 0x88(%rsp)
jne 0x243a65
movq 0x68(%rsp), %rax
cmpb $0x0, 0x21(%rax)
je 0x243a43
movzwl 0x10(%rbp), %eax
cmpl %eax, %esi
jae 0x243a65
movq 0x50(%rbp), %rax
movzbl 0x9(%rbp), %ecx
addq %rcx, %rax
addq $0xa, %rax
cmpq %rax, %r14
jae 0x243b48
movl $0x11e5d, %edi          # imm = 0x11E5D
jmp 0x2435f4
leaq 0x10(%rsp), %rbx
movq %rbp, %rdi
movl %r15d, %esi
movq %rbx, %rcx
callq 0x2469c7
movl (%rbx), %r14d
testl %r14d, %r14d
movl 0x30(%rsp), %ebx
jne 0x2436df
movl 0x1c(%rsp), %ecx
leaq 0x10(%rsp), %rax
movq %rax, (%rsp)
movq %rbp, %rdi
movl %r15d, %esi
movq 0x20(%rsp), %rdx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x246aba
andw $0x0, 0x46(%r12)
cmpb $0x0, 0xc(%rbp)
je 0x243b27
andb $-0x3, 0x1(%r12)
movq %r12, %rdi
callq 0x246d33
movl %eax, %r14d
movq 0x88(%r12), %rax
movb $0x0, 0xc(%rax)
movb $0x1, (%r12)
shrb %bl
testl %r14d, %r14d
sete %al
andb %bl, %al
cmpb $0x1, %al
jne 0x2436df
movq %r12, %rdi
callq 0x237099
xorl %r14d, %r14d
cmpq $0x0, 0x80(%r12)
je 0x243b35
movq 0x8(%r13), %rdi
callq 0x21f6df
movq %rax, 0x18(%r12)
testq %rax, %rax
je 0x243b31
movq (%r13), %rsi
movq 0x8(%r13), %rdx
movq %rax, %rdi
callq 0x17630
jmp 0x243b35
movl 0x10(%rsp), %r14d
jmp 0x2436df
pushq $0x7
popq %r14
movb $0x3, (%r12)
movq 0x8(%r13), %rax
movq %rax, 0x48(%r12)
jmp 0x2436df
movl %esi, %edx
leaq (%r14,%rdx), %rax
cmpq 0x58(%rbp), %rax
jbe 0x243b75
movl $0x11e60, %edi          # imm = 0x11E60
jmp 0x2435f4
movq 0x78(%rsp), %rdi
callq 0x2376c6
movq %r12, %rdi
callq 0x2376c6
jmp 0x2436df
movq %r14, %rdi
movq 0x20(%rsp), %rsi
callq 0x17630
xorl %r14d, %r14d
jmp 0x2436df