LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3BitvecTest
SQLITE_PRIVATE int sqlite3BitvecTest(Bitvec *p, u32 i){
  if( p==0 ) return 0;
  if( i>p->iSize || i==0 ) return 0;
  i--;
  while( p->iDivisor ){
    u32 bin = i/p->iDivisor;
    i = i%p->iDivisor;
    p = p->u.apSub[bin];
    if (!p) {
      return 0;
    }
  }
  if( p->iSize<=BITVEC_NBIT ){
    return (p->u.aBitmap[i/BITVEC_SZELEM] & (1<<(i&(BITVEC_SZELEM-1))))!=0;
  } else{
    u32 h = BITVEC_HASH(i++);
    while( p->u.aHash[h] ){
      if( p->u.aHash[h]==i ) return 1;
      h = (h+1) % BITVEC_NINT;
    }
    return 0;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x219be
movl $0x0, -0x4(%rbp)
jmp 0x21ad7
movl -0x14(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl (%rcx), %eax
ja 0x219cf
cmpl $0x0, -0x14(%rbp)
jne 0x219db
movl $0x0, -0x4(%rbp)
jmp 0x21ad7
movl -0x14(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x14(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x8(%rax)
je 0x21a31
movl -0x14(%rbp), %eax
movq -0x10(%rbp), %rcx
xorl %edx, %edx
divl 0x8(%rcx)
movl %eax, -0x18(%rbp)
movl -0x14(%rbp), %eax
movq -0x10(%rbp), %rcx
xorl %edx, %edx
divl 0x8(%rcx)
movl %edx, -0x14(%rbp)
movq -0x10(%rbp), %rax
movl -0x18(%rbp), %ecx
movq 0x10(%rax,%rcx,8), %rax
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x21a2f
movl $0x0, -0x4(%rbp)
jmp 0x21ad7
jmp 0x219e4
movq -0x10(%rbp), %rax
movl (%rax), %eax
cmpq $0xf80, %rax            # imm = 0xF80
ja 0x21a71
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
shrl $0x3, %ecx
movl %ecx, %ecx
movzbl 0x10(%rax,%rcx), %eax
movl -0x14(%rbp), %ecx
andl $0x7, %ecx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
andl %ecx, %eax
cmpl $0x0, %eax
setne %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x4(%rbp)
jmp 0x21ad7
movl -0x14(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0x14(%rbp)
shll $0x0, %eax
movl %eax, %eax
movl $0x7c, %ecx
xorl %edx, %edx
divq %rcx
movl %edx, %eax
movl %eax, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movl -0x1c(%rbp), %ecx
cmpl $0x0, 0x10(%rax,%rcx,4)
je 0x21ad0
movq -0x10(%rbp), %rax
movl -0x1c(%rbp), %ecx
movl 0x10(%rax,%rcx,4), %eax
cmpl -0x14(%rbp), %eax
jne 0x21ab7
movl $0x1, -0x4(%rbp)
jmp 0x21ad7
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, %eax
movl $0x7c, %ecx
xorl %edx, %edx
divq %rcx
movl %edx, %eax
movl %eax, -0x1c(%rbp)
jmp 0x21a90
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: openSubJournal
static int openSubJournal(Pager *pPager){
  int rc = SQLITE_OK;
  if( !isOpen(pPager->sjfd) ){
    if( pPager->journalMode==PAGER_JOURNALMODE_MEMORY || pPager->subjInMemory ){
      sqlite3MemJournalOpen(pPager->sjfd);
    }else{
      rc = pagerOpentemp(pPager, pPager->sjfd, SQLITE_OPEN_SUBJOURNAL);
    }
  }
  return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl $0x0, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
cmpq $0x0, (%rax)
jne 0x21b45
movq -0x8(%rbp), %rax
movzbl 0x9(%rax), %eax
cmpl $0x4, %eax
je 0x21b1b
movq -0x8(%rbp), %rax
movzbl 0x18(%rax), %eax
cmpl $0x0, %eax
je 0x21b2a
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rdi
callq 0x21c10
jmp 0x21b43
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rsi
movl $0x2000, %edx           # imm = 0x2000
callq 0x21c60
movl %eax, -0xc(%rbp)
jmp 0x21b45
movl -0xc(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: addToSavepointBitvecs
static int addToSavepointBitvecs(Pager *pPager, Pgno pgno){
  int ii;                   /* Loop counter */
  int rc = SQLITE_OK;       /* Result code */

  for(ii=0; ii<pPager->nSavepoint; ii++){
    PagerSavepoint *p = &pPager->aSavepoint[ii];
    if( pgno<=p->nOrig ){
      rc |= sqlite3BitvecSet(p->pInSavepoint, pgno);
      testcase( rc==SQLITE_NOMEM );
      assert( rc==SQLITE_OK || rc==SQLITE_NOMEM );
    }
  }
  return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl $0x0, -0x14(%rbp)
movl $0x0, -0x10(%rbp)
movl -0x10(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x80(%rcx), %eax
jge 0x21c02
movq -0x8(%rbp), %rax
movq 0x78(%rax), %rax
movslq -0x10(%rbp), %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movl -0xc(%rbp), %eax
movq -0x20(%rbp), %rcx
cmpl 0x18(%rcx), %eax
ja 0x21bf5
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rdi
movl -0xc(%rbp), %esi
callq 0x220b0
orl -0x14(%rbp), %eax
movl %eax, -0x14(%rbp)
jmp 0x21bf7
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x21bad
movl -0x14(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3MemJournalOpen
SQLITE_PRIVATE void sqlite3MemJournalOpen(sqlite3_file *pJfd){
  MemJournal *p = (MemJournal *)pJfd;
  assert( EIGHT_BYTE_ALIGNMENT(p) );
  memset(p, 0, sqlite3MemJournalSize());
  p->pMethod = (sqlite3_io_methods*)&MemJournalMethods;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
callq 0x20de0
movq -0x18(%rbp), %rdi
movslq %eax, %rdx
xorl %esi, %esi
callq 0x8200
movq -0x10(%rbp), %rax
leaq 0xad266(%rip), %rcx     # 0xceeb0
movq %rcx, (%rax)
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: memjrnlTruncate
static int memjrnlTruncate(sqlite3_file *pJfd, sqlite_int64 size){
  MemJournal *p = (MemJournal *)pJfd;
  FileChunk *pChunk;
  assert(size==0);
  UNUSED_PARAMETER(size);
  pChunk = p->pFirst;
  while( pChunk ){
    FileChunk *pTmp = pChunk;
    pChunk = pChunk->pNext;
    sqlite3_free(pTmp);
  }
  sqlite3MemJournalOpen(pJfd);
  return SQLITE_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x22009
movq -0x20(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x28(%rbp), %rdi
callq 0xa420
jmp 0x21fe4
movq -0x8(%rbp), %rdi
callq 0x21c10
xorl %eax, %eax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3BitvecCreate
SQLITE_PRIVATE Bitvec *sqlite3BitvecCreate(u32 iSize){
  Bitvec *p;
  assert( sizeof(*p)==BITVEC_SZ );
  p = sqlite3MallocZero( sizeof(*p) );
  if( p ){
    p->iSize = iSize;
  }
  return p;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
movl $0x200, %edi            # imm = 0x200
callq 0xd860
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x22389
movl -0x4(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, (%rax)
movq -0x10(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: pager_write_changecounter
static void pager_write_changecounter(PgHdr *pPg){
  u32 change_counter;

  /* Increment the value just read and write it back to byte 24. */
  change_counter = sqlite3Get4byte((u8*)pPg->pPager->dbFileVers)+1;
  put32bits(((char*)pPg->pData)+24, change_counter);

  /* Also store the SQLite version number in bytes 96..99 and in
  ** bytes 92..95 store the change counter for which the version number
  ** is valid. */
  put32bits(((char*)pPg->pData)+92, change_counter);
  put32bits(((char*)pPg->pData)+96, SQLITE_VERSION_NUMBER);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rdi
addq $0x84, %rdi
callq 0x20a50
addl $0x1, %eax
movl %eax, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
addq $0x18, %rdi
movl -0xc(%rbp), %esi
callq 0x22060
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
addq $0x5c, %rdi
movl -0xc(%rbp), %esi
callq 0x22060
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
addq $0x60, %rdi
movl $0x2de600, %esi         # imm = 0x2DE600
callq 0x22060
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3BackupUpdate
SQLITE_PRIVATE void sqlite3BackupUpdate(sqlite3_backup *pBackup, Pgno iPage, const u8 *aData){
  sqlite3_backup *p;                   /* Iterator variable */
  for(p=pBackup; p; p=p->pNext){
    assert( sqlite3_mutex_held(p->pSrc->pBt->mutex) );
    if( !isFatalError(p->rc) && iPage<p->iNext ){
      /* The backup process p has already copied page iPage. But now it
      ** has been modified by a transaction on the source pager. Copy
      ** the new data into the backup.
      */
      int rc;
      assert( p->pDestDb );
      sqlite3_mutex_enter(p->pDestDb->mutex);
      rc = backupOnePage(p, iPage, aData, 1);
      sqlite3_mutex_leave(p->pDestDb->mutex);
      assert( rc!=SQLITE_BUSY && rc!=SQLITE_LOCKED );
      if( rc!=SQLITE_OK ){
        p->rc = rc;
      }
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x229e9
movq -0x20(%rbp), %rax
movl 0x30(%rax), %edi
callq 0xe110
cmpl $0x0, %eax
jne 0x229d9
movl -0xc(%rbp), %eax
movq -0x20(%rbp), %rcx
cmpl 0x18(%rcx), %eax
jae 0x229d9
movq -0x20(%rbp), %rdi
movl -0xc(%rbp), %esi
movq -0x18(%rbp), %rdx
movl $0x1, %ecx
callq 0xe9e0
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
je 0x229d7
movl -0x24(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x30(%rax)
jmp 0x229d9
jmp 0x229db
movq -0x20(%rbp), %rax
movq 0x40(%rax), %rax
movq %rax, -0x20(%rbp)
jmp 0x2298b
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: walWriteOneFrame
static int walWriteOneFrame(
  WalWriter *p,               /* Where to write the frame */
  PgHdr *pPage,               /* The page of the frame to be written */
  int nTruncate,              /* The commit flag.  Usually 0.  >0 for commit */
  sqlite3_int64 iOffset       /* Byte offset at which to write */
){
  int rc;                         /* Result code from subfunctions */
  void *pData;                    /* Data actually written */
  u8 aFrame[WAL_FRAME_HDRSIZE];   /* Buffer to assemble frame-header in */
#if defined(SQLITE_HAS_CODEC)
  if( (pData = sqlite3PagerCodec(pPage))==0 ) return SQLITE_NOMEM;
#else
  pData = pPage->pData;
#endif
  walEncodeFrame(p->pWal, pPage->pgno, nTruncate, pData, aFrame);
  rc = walWriteToLog(p, aFrame, sizeof(aFrame), iOffset);
  if( rc ) return rc;
  /* Write the page data */
  rc = walWriteToLog(p, pData, p->szPage, iOffset+sizeof(aFrame));
  return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rax
movl 0x28(%rax), %esi
movl -0x1c(%rbp), %edx
movq -0x38(%rbp), %rcx
leaq -0x50(%rbp), %r8
callq 0x23fe0
movq -0x10(%rbp), %rdi
leaq -0x50(%rbp), %rsi
movq -0x28(%rbp), %rcx
movl $0x18, %edx
callq 0x240b0
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
je 0x22d78
movl -0x2c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x22d9d
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x10(%rbp), %rax
movl 0x1c(%rax), %edx
movq -0x28(%rbp), %rcx
addq $0x18, %rcx
callq 0x240b0
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: walLimitSize
static void walLimitSize(Wal *pWal, i64 nMax){
  i64 sz;
  int rx;
  sqlite3BeginBenignMalloc();
  rx = sqlite3OsFileSize(pWal->pWalFd, &sz);
  if( rx==SQLITE_OK && (sz > nMax ) ){
    rx = sqlite3OsTruncate(pWal->pWalFd, nMax);
  }
  sqlite3EndBenignMalloc();
  if( rx ){
    sqlite3_log(rx, "cannot limit WAL size: %s", pWal->zWalName);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
callq 0x241b0
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
leaq -0x18(%rbp), %rsi
callq 0x23e00
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
jne 0x22dfd
movq -0x18(%rbp), %rax
cmpq -0x10(%rbp), %rax
jle 0x22dfd
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x10(%rbp), %rsi
callq 0x241d0
movl %eax, -0x1c(%rbp)
callq 0x24200
cmpl $0x0, -0x1c(%rbp)
je 0x22e21
movl -0x1c(%rbp), %edi
movq -0x8(%rbp), %rax
movq 0x78(%rax), %rdx
leaq 0x8b4d7(%rip), %rsi     # 0xae2f1
movb $0x0, %al
callq 0xc5f0
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: walIndexWriteHdr
static void walIndexWriteHdr(Wal *pWal){
  volatile WalIndexHdr *aHdr = walIndexHdr(pWal);
  const int nCksum = offsetof(WalIndexHdr, aCksum);

  assert( pWal->writeLock );
  pWal->hdr.isInit = 1;
  pWal->hdr.iVersion = WALINDEX_MAX_VERSION;
  walChecksumBytes(1, (u8*)&pWal->hdr, nCksum, 0, pWal->hdr.aCksum);
  memcpy((void *)&aHdr[1], (void *)&pWal->hdr, sizeof(WalIndexHdr));
  walShmBarrier(pWal);
  memcpy((void *)&aHdr[0], (void *)&pWal->hdr, sizeof(WalIndexHdr));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x23680
movq %rax, -0x10(%rbp)
movl $0x28, -0x14(%rbp)
movq -0x8(%rbp), %rax
movb $0x1, 0x54(%rax)
movq -0x8(%rbp), %rax
movl $0x2de218, 0x48(%rax)   # imm = 0x2DE218
movq -0x8(%rbp), %rsi
addq $0x48, %rsi
movq -0x8(%rbp), %r8
addq $0x48, %r8
addq $0x28, %r8
movl $0x1, %edi
movl $0x28, %edx
xorl %eax, %eax
movl %eax, %ecx
callq 0x22b70
movq -0x10(%rbp), %rdi
addq $0x30, %rdi
movq -0x8(%rbp), %rsi
addq $0x48, %rsi
movl $0x30, %edx
callq 0x82f0
movq -0x8(%rbp), %rdi
callq 0x23650
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
addq $0x48, %rsi
movl $0x30, %edx
callq 0x82f0
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: walLockExclusive
static int walLockExclusive(Wal *pWal, int lockIdx, int n){
  int rc;
  if( pWal->exclusiveMode ) return SQLITE_OK;
  rc = sqlite3OsShmLock(pWal->pDbFd, lockIdx, n,
                        SQLITE_SHM_LOCK | SQLITE_SHM_EXCLUSIVE);
  WALTRACE(("WAL%p: acquire EXCLUSIVE-%s cnt=%d %s\n", pWal,
            walLockName(lockIdx), n, rc ? "failed" : "ok"));
  VVA_ONLY( pWal->lockError = (u8)(rc!=SQLITE_OK && rc!=SQLITE_BUSY); )
  return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movq -0x10(%rbp), %rax
cmpb $0x0, 0x3f(%rax)
je 0x23045
movl $0x0, -0x4(%rbp)
jmp 0x23066
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movl -0x14(%rbp), %esi
movl -0x18(%rbp), %edx
movl $0xa, %ecx
callq 0x23460
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: walLockShared
static int walLockShared(Wal *pWal, int lockIdx){
  int rc;
  if( pWal->exclusiveMode ) return SQLITE_OK;
  rc = sqlite3OsShmLock(pWal->pDbFd, lockIdx, 1,
                        SQLITE_SHM_LOCK | SQLITE_SHM_SHARED);
  WALTRACE(("WAL%p: acquire SHARED-%s %s\n", pWal,
            walLockName(lockIdx), rc ? "failed" : "ok"));
  VVA_ONLY( pWal->lockError = (u8)(rc!=SQLITE_OK && rc!=SQLITE_BUSY); )
  return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq -0x10(%rbp), %rax
cmpb $0x0, 0x3f(%rax)
je 0x23622
movl $0x0, -0x4(%rbp)
jmp 0x23645
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movl -0x14(%rbp), %esi
movl $0x1, %edx
movl $0x6, %ecx
callq 0x23460
movl %eax, -0x18(%rbp)
movl -0x18(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: walEncodeFrame
static void walEncodeFrame(
  Wal *pWal,                      /* The write-ahead log */
  u32 iPage,                      /* Database page number for frame */
  u32 nTruncate,                  /* New db size (or 0 for non-commit frames) */
  u8 *aData,                      /* Pointer to page data */
  u8 *aFrame                      /* OUT: Write encoded frame here */
){
  int nativeCksum;                /* True for native byte-order checksums */
  u32 *aCksum = pWal->hdr.aFrameCksum;
  assert( WAL_FRAME_HDRSIZE==24 );
  sqlite3Put4byte(&aFrame[0], iPage);
  sqlite3Put4byte(&aFrame[4], nTruncate);
  memcpy(&aFrame[8], pWal->hdr.aSalt, 8);

  nativeCksum = (pWal->hdr.bigEndCksum==SQLITE_BIGENDIAN);
  walChecksumBytes(nativeCksum, aFrame, 8, aCksum, aCksum);
  walChecksumBytes(nativeCksum, aData, pWal->szPage, aCksum, aCksum);

  sqlite3Put4byte(&aFrame[16], aCksum[0]);
  sqlite3Put4byte(&aFrame[20], aCksum[1]);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq %rcx, -0x18(%rbp)
movq %r8, -0x20(%rbp)
movq -0x8(%rbp), %rax
addq $0x48, %rax
addq $0x18, %rax
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0x22060
movq -0x20(%rbp), %rdi
addq $0x4, %rdi
movl -0x10(%rbp), %esi
callq 0x22060
movq -0x20(%rbp), %rax
movq -0x8(%rbp), %rcx
movq 0x68(%rcx), %rcx
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rax
movzbl 0x55(%rax), %eax
cmpl $0x0, %eax
sete %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %edi
movq -0x20(%rbp), %rsi
movq -0x30(%rbp), %rcx
movq -0x30(%rbp), %r8
movl $0x8, %edx
callq 0x22b70
movl -0x24(%rbp), %edi
movq -0x18(%rbp), %rsi
movq -0x8(%rbp), %rax
movl 0x38(%rax), %edx
movq -0x30(%rbp), %rcx
movq -0x30(%rbp), %r8
callq 0x22b70
movq -0x20(%rbp), %rdi
addq $0x10, %rdi
movq -0x30(%rbp), %rax
movl (%rax), %esi
callq 0x22060
movq -0x20(%rbp), %rdi
addq $0x14, %rdi
movq -0x30(%rbp), %rax
movl 0x4(%rax), %esi
callq 0x22060
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: walWriteToLog
static int walWriteToLog(
  WalWriter *p,              /* WAL to write to */
  void *pContent,            /* Content to be written */
  int iAmt,                  /* Number of bytes to write */
  sqlite3_int64 iOffset      /* Start writing at this offset */
){
  int rc;
  if( iOffset<p->iSyncPoint && iOffset+iAmt>=p->iSyncPoint ){
    int iFirstAmt = (int)(p->iSyncPoint - iOffset);
    rc = sqlite3OsWrite(p->pFd, pContent, iFirstAmt, iOffset);
    if( rc ) return rc;
    iOffset += iFirstAmt;
    iAmt -= iFirstAmt;
    pContent = (void*)(iFirstAmt + (char*)pContent);
    assert( p->syncFlags & (SQLITE_SYNC_NORMAL|SQLITE_SYNC_FULL) );
    rc = sqlite3OsSync(p->pFd, p->syncFlags);
    if( iAmt==0 || rc ) return rc;
  }
  rc = sqlite3OsWrite(p->pFd, pContent, iAmt, iOffset);
  return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jge 0x2417f
movq -0x28(%rbp), %rax
movslq -0x1c(%rbp), %rcx
addq %rcx, %rax
movq -0x10(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jl 0x2417f
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
subq -0x28(%rbp), %rax
movl %eax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x18(%rbp), %rsi
movl -0x30(%rbp), %edx
movq -0x28(%rbp), %rcx
callq 0xf430
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
je 0x2412a
movl -0x2c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x241a0
movslq -0x30(%rbp), %rax
addq -0x28(%rbp), %rax
movq %rax, -0x28(%rbp)
movl -0x30(%rbp), %ecx
movl -0x1c(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x1c(%rbp)
movl -0x30(%rbp), %ecx
movq -0x18(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x10(%rbp), %rax
movl 0x18(%rax), %esi
callq 0x22ce0
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x24175
cmpl $0x0, -0x2c(%rbp)
je 0x2417d
movl -0x2c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x241a0
jmp 0x2417f
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x18(%rbp), %rsi
movl -0x1c(%rbp), %edx
movq -0x28(%rbp), %rcx
callq 0xf430
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: walHashGet
static int walHashGet(
  Wal *pWal,                      /* WAL handle */
  int iHash,                      /* Find the iHash'th table */
  volatile ht_slot **paHash,      /* OUT: Pointer to hash index */
  volatile u32 **paPgno,          /* OUT: Pointer to page number array */
  u32 *piZero                     /* OUT: Frame associated with *paPgno[0] */
){
  int rc;                         /* Return code */
  volatile u32 *aPgno;

  rc = walIndexPage(pWal, iHash, &aPgno);
  assert( rc==SQLITE_OK || iHash>0 );

  if( rc==SQLITE_OK ){
    u32 iZero;
    volatile ht_slot *aHash;

    aHash = (volatile ht_slot *)&aPgno[HASHTABLE_NPAGE];
    if( iHash==0 ){
      aPgno = &aPgno[WALINDEX_HDR_SIZE/sizeof(u32)];
      iZero = 0;
    }else{
      iZero = HASHTABLE_NPAGE_ONE + (iHash-1)*HASHTABLE_NPAGE;
    }
  
    *paPgno = &aPgno[-1];
    *paHash = aHash;
    *piZero = iZero;
  }
  return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
leaq -0x38(%rbp), %rdx
callq 0x236a0
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
jne 0x242b6
movq -0x38(%rbp), %rax
addq $0x4000, %rax           # imm = 0x4000
movq %rax, -0x48(%rbp)
cmpl $0x0, -0xc(%rbp)
jne 0x2427f
movq -0x38(%rbp), %rax
addq $0x88, %rax
movq %rax, -0x38(%rbp)
movl $0x0, -0x3c(%rbp)
jmp 0x24293
movl -0xc(%rbp), %eax
subl $0x1, %eax
shll $0xc, %eax
cltq
addq $0xfde, %rax            # imm = 0xFDE
movl %eax, -0x3c(%rbp)
movq -0x38(%rbp), %rcx
addq $-0x4, %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movq -0x48(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movl -0x3c(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
movl -0x2c(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3CorruptError
SQLITE_PRIVATE int sqlite3CorruptError(int lineno){
  testcase( sqlite3GlobalConfig.xLog!=0 );
  sqlite3_log(SQLITE_CORRUPT,
              "database corruption at line %d of [%.10s]",
              lineno, 20+sqlite3_sourceid());
  return SQLITE_CORRUPT;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
movl -0x4(%rbp), %eax
movl %eax, -0x8(%rbp)
callq 0x17070
movl -0x8(%rbp), %edx
movq %rax, %rcx
addq $0x14, %rcx
movl $0xb, %edi
leaq 0x89ecf(%rip), %rsi     # 0xae30b
movb $0x0, %al
callq 0xc5f0
movl $0xb, %eax
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3PagerExclusiveLock
SQLITE_PRIVATE int sqlite3PagerExclusiveLock(Pager *pPager){
  int rc = SQLITE_OK;
  assert( pPager->eState==PAGER_WRITER_CACHEMOD 
       || pPager->eState==PAGER_WRITER_DBMOD 
       || pPager->eState==PAGER_WRITER_LOCKED 
  );
  assert( assert_pager_state(pPager) );
  if( 0==pagerUseWal(pPager) ){
    rc = pager_wait_on_lock(pPager, EXCLUSIVE_LOCK);
  }
  return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl $0x0, -0xc(%rbp)
movq -0x8(%rbp), %rdi
callq 0x211a0
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0x244a5
movq -0x8(%rbp), %rdi
movl $0x4, %esi
callq 0x24780
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: journalHdrOffset
static i64 journalHdrOffset(Pager *pPager){
  i64 offset = 0;
  i64 c = pPager->journalOff;
  if( c ){
    offset = ((c-1)/JOURNAL_HDR_SZ(pPager) + 1) * JOURNAL_HDR_SZ(pPager);
  }
  assert( offset%JOURNAL_HDR_SZ(pPager)==0 );
  assert( offset>=c );
  assert( (offset-c)<JOURNAL_HDR_SZ(pPager) );
  return offset;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq $0x0, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x60(%rax), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x24500
movq -0x18(%rbp), %rax
subq $0x1, %rax
movq -0x8(%rbp), %rcx
movl 0xb8(%rcx), %ecx
cqto
idivq %rcx
addq $0x1, %rax
movq -0x8(%rbp), %rcx
movl 0xb8(%rcx), %ecx
imulq %rcx, %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3PcacheClearSyncFlags
SQLITE_PRIVATE void sqlite3PcacheClearSyncFlags(PCache *pCache){
  PgHdr *p;
  for(p=pCache->pDirty; p; p=p->pDirtyNext){
    p->flags &= ~PGHDR_NEED_SYNC;
  }
  pCache->pSynced = pCache->pDirtyTail;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x24767
movq -0x10(%rbp), %rax
movzwl 0x2c(%rax), %ecx
andl $-0x5, %ecx
movw %cx, 0x2c(%rax)
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x10(%rbp)
jmp 0x24743
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x10(%rax)
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: pager_wait_on_lock
static int pager_wait_on_lock(Pager *pPager, int locktype){
  int rc;                              /* Return code */

  /* Check that this is either a no-op (because the requested lock is 
  ** already held, or one of the transistions that the busy-handler
  ** may be invoked during, according to the comment above
  ** sqlite3PagerSetBusyhandler().
  */
  assert( (pPager->eLock>=locktype)
       || (pPager->eLock==NO_LOCK && locktype==SHARED_LOCK)
       || (pPager->eLock==RESERVED_LOCK && locktype==EXCLUSIVE_LOCK)
  );

  do {
    rc = pagerLockDb(pPager, locktype);
  }while( rc==SQLITE_BUSY && pPager->xBusyHandler(pPager->pBusyHandlerArg) );
  return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0x247e0
movl %eax, -0x10(%rbp)
xorl %eax, %eax
cmpl $0x5, -0x10(%rbp)
movb %al, -0x11(%rbp)
jne 0x247ca
movq -0x8(%rbp), %rax
movq 0xe0(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0xe8(%rcx), %rdi
callq *%rax
cmpl $0x0, %eax
setne %al
movb %al, -0x11(%rbp)
movb -0x11(%rbp), %al
testb $0x1, %al
jne 0x2478f
movl -0x10(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: pagerLockDb
static int pagerLockDb(Pager *pPager, int eLock){
  int rc = SQLITE_OK;

  assert( eLock==SHARED_LOCK || eLock==RESERVED_LOCK || eLock==EXCLUSIVE_LOCK );
  if( pPager->eLock<eLock || pPager->eLock==UNKNOWN_LOCK ){
    rc = sqlite3OsLock(pPager->fd, eLock);
    if( rc==SQLITE_OK && (pPager->eLock!=UNKNOWN_LOCK||eLock==EXCLUSIVE_LOCK) ){
      pPager->eLock = (u8)eLock;
      IOTRACE(("LOCK %p %d\n", pPager, eLock))
    }
  }
  return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl $0x0, -0x10(%rbp)
movq -0x8(%rbp), %rax
movzbl 0x14(%rax), %eax
cmpl -0xc(%rbp), %eax
jl 0x24810
movq -0x8(%rbp), %rax
movzbl 0x14(%rax), %eax
cmpl $0x5, %eax
jne 0x2484a
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rdi
movl -0xc(%rbp), %esi
callq 0x24860
movl %eax, -0x10(%rbp)
cmpl $0x0, -0x10(%rbp)
jne 0x24848
movq -0x8(%rbp), %rax
movzbl 0x14(%rax), %eax
cmpl $0x5, %eax
jne 0x2483c
cmpl $0x4, -0xc(%rbp)
jne 0x24848
movl -0xc(%rbp), %eax
movb %al, %cl
movq -0x8(%rbp), %rax
movb %cl, 0x14(%rax)
jmp 0x2484a
movl -0x10(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: pcacheRemoveFromDirtyList
static void pcacheRemoveFromDirtyList(PgHdr *pPage){
  PCache *p = pPage->pCache;

  assert( pPage->pDirtyNext || pPage==p->pDirtyTail );
  assert( pPage->pDirtyPrev || pPage==p->pDirty );

  /* Update the PCache1.pSynced variable if necessary. */
  if( p->pSynced==pPage ){
    PgHdr *pSynced = pPage->pDirtyPrev;
    while( pSynced && (pSynced->flags&PGHDR_NEED_SYNC) ){
      pSynced = pSynced->pDirtyPrev;
    }
    p->pSynced = pSynced;
  }

  if( pPage->pDirtyNext ){
    pPage->pDirtyNext->pDirtyPrev = pPage->pDirtyPrev;
  }else{
    assert( pPage==p->pDirtyTail );
    p->pDirtyTail = pPage->pDirtyPrev;
  }
  if( pPage->pDirtyPrev ){
    pPage->pDirtyPrev->pDirtyNext = pPage->pDirtyNext;
  }else{
    assert( pPage==p->pDirty );
    p->pDirty = pPage->pDirtyNext;
  }
  pPage->pDirtyNext = 0;
  pPage->pDirtyPrev = 0;

  expensive_assert( pcacheCheckSynced(p) );
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
cmpq -0x8(%rbp), %rax
jne 0x24941
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq %rax, -0x18(%rbp)
xorl %eax, %eax
cmpq $0x0, -0x18(%rbp)
movb %al, -0x19(%rbp)
je 0x2491e
movq -0x18(%rbp), %rax
movzwl 0x2c(%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
setne %al
movb %al, -0x19(%rbp)
movb -0x19(%rbp), %al
testb $0x1, %al
jne 0x24927
jmp 0x24935
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0x248fe
movq -0x18(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x38(%rax)
je 0x24962
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rcx
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
movq %rcx, 0x40(%rax)
jmp 0x24972
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x40(%rax)
je 0x24993
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rcx
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq %rcx, 0x38(%rax)
jmp 0x249a2
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x38(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x40(%rax)
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: pcacheUnpin
static void pcacheUnpin(PgHdr *p){
  PCache *pCache = p->pCache;
  if( pCache->bPurgeable ){
    if( p->pgno==1 ){
      pCache->pPage1 = 0;
    }
    sqlite3GlobalConfig.pcache2.xUnpin(pCache->pCache, p->pPage, 0);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x28(%rax)
je 0x24a12
movq -0x8(%rbp), %rax
cmpl $0x1, 0x28(%rax)
jne 0x249f8
movq -0x10(%rbp), %rax
movq $0x0, 0x48(%rax)
movq 0xabb79(%rip), %rax     # 0xd0578
movq -0x10(%rbp), %rcx
movq 0x40(%rcx), %rdi
movq -0x8(%rbp), %rcx
movq (%rcx), %rsi
xorl %edx, %edx
callq *%rax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: decodeFlags
static int decodeFlags(MemPage *pPage, int flagByte){
  BtShared *pBt;     /* A copy of pPage->pBt */

  assert( pPage->hdrOffset==(pPage->pgno==1 ? 100 : 0) );
  assert( sqlite3_mutex_held(pPage->pBt->mutex) );
  pPage->leaf = (u8)(flagByte>>3);  assert( PTF_LEAF == 1<<3 );
  flagByte &= ~PTF_LEAF;
  pPage->childPtrSize = 4-4*pPage->leaf;
  pBt = pPage->pBt;
  if( flagByte==(PTF_LEAFDATA | PTF_INTKEY) ){
    pPage->intKey = 1;
    pPage->hasData = pPage->leaf;
    pPage->maxLocal = pBt->maxLeaf;
    pPage->minLocal = pBt->minLeaf;
  }else if( flagByte==PTF_ZERODATA ){
    pPage->intKey = 0;
    pPage->hasData = 0;
    pPage->maxLocal = pBt->maxLocal;
    pPage->minLocal = pBt->minLocal;
  }else{
    return SQLITE_CORRUPT_BKPT;
  }
  pPage->max1bytePayload = pBt->max1bytePayload;
  return SQLITE_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl -0x14(%rbp), %eax
sarl $0x3, %eax
movb %al, %cl
movq -0x10(%rbp), %rax
movb %cl, 0x3(%rax)
movl -0x14(%rbp), %eax
andl $-0x9, %eax
movl %eax, -0x14(%rbp)
movq -0x10(%rbp), %rax
movzbl 0x3(%rax), %ecx
shll $0x2, %ecx
movl $0x4, %eax
subl %ecx, %eax
movb %al, %cl
movq -0x10(%rbp), %rax
movb %cl, 0x6(%rax)
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
movq %rax, -0x20(%rbp)
cmpl $0x5, -0x14(%rbp)
jne 0x24e0c
movq -0x10(%rbp), %rax
movb $0x1, 0x2(%rax)
movq -0x10(%rbp), %rax
movb 0x3(%rax), %cl
movq -0x10(%rbp), %rax
movb %cl, 0x4(%rax)
movq -0x20(%rbp), %rax
movw 0x2c(%rax), %cx
movq -0x10(%rbp), %rax
movw %cx, 0x8(%rax)
movq -0x20(%rbp), %rax
movw 0x2e(%rax), %cx
movq -0x10(%rbp), %rax
movw %cx, 0xa(%rax)
jmp 0x24e55
cmpl $0x2, -0x14(%rbp)
jne 0x24e44
movq -0x10(%rbp), %rax
movb $0x0, 0x2(%rax)
movq -0x10(%rbp), %rax
movb $0x0, 0x4(%rax)
movq -0x20(%rbp), %rax
movw 0x28(%rax), %cx
movq -0x10(%rbp), %rax
movw %cx, 0x8(%rax)
movq -0x20(%rbp), %rax
movw 0x2a(%rax), %cx
movq -0x10(%rbp), %rax
movw %cx, 0xa(%rax)
jmp 0x24e53
movl $0xc723, %edi           # imm = 0xC723
callq 0x24410
movl %eax, -0x4(%rbp)
jmp 0x24e6a
jmp 0x24e55
movq -0x20(%rbp), %rax
movb 0x25(%rax), %cl
movq -0x10(%rbp), %rax
movb %cl, 0x7(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: pagerFixMaplimit
static void pagerFixMaplimit(Pager *pPager){
#if SQLITE_MAX_MMAP_SIZE>0
  sqlite3_file *fd = pPager->fd;
  if( isOpen(fd) && fd->pMethods->iVersion>=3 ){
    sqlite3_int64 sz;
    sz = pPager->szMmap;
    pPager->bUseFetch = (sz>0);
    sqlite3OsFileControlHint(pPager->fd, SQLITE_FCNTL_MMAP_SIZE, &sz);
  }
#endif
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, (%rax)
je 0x24eec
movq -0x10(%rbp), %rax
movq (%rax), %rax
cmpl $0x3, (%rax)
jl 0x24eec
movq -0x8(%rbp), %rax
movq 0xa0(%rax), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
setg %al
andb $0x1, %al
movzbl %al, %eax
movb %al, %cl
movq -0x8(%rbp), %rax
movb %cl, 0x94(%rax)
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rdi
movl $0x12, %esi
leaq -0x18(%rbp), %rdx
callq 0x24890
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3InvokeBusyHandler
SQLITE_PRIVATE int sqlite3InvokeBusyHandler(BusyHandler *p){
  int rc;
  if( NEVER(p==0) || p->xFunc==0 || p->nBusy<0 ) return 0;
  rc = p->xFunc(p->pArg, p->nBusy);
  if( rc==0 ){
    p->nBusy = -1;
  }else{
    p->nBusy++;
  }
  return rc; 
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x24f27
movq -0x10(%rbp), %rax
cmpq $0x0, (%rax)
je 0x24f27
movq -0x10(%rbp), %rax
cmpl $0x0, 0x10(%rax)
jge 0x24f30
movl $0x0, -0x4(%rbp)
jmp 0x24f71
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x8(%rcx), %rdi
movq -0x10(%rbp), %rcx
movl 0x10(%rcx), %esi
callq *%rax
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jne 0x24f5e
movq -0x10(%rbp), %rax
movl $0xffffffff, 0x10(%rax) # imm = 0xFFFFFFFF
jmp 0x24f6b
movq -0x10(%rbp), %rax
movl 0x10(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x10(%rax)
movl -0x14(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3PcacheSetPageSize
SQLITE_PRIVATE void sqlite3PcacheSetPageSize(PCache *pCache, int szPage){
  assert( pCache->nRef==0 && pCache->pDirty==0 );
  if( pCache->pCache ){
    sqlite3GlobalConfig.pcache2.xDestroy(pCache->pCache);
    pCache->pCache = 0;
    pCache->pPage1 = 0;
  }
  pCache->szPage = szPage;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x40(%rax)
je 0x25053
movq 0xab55f(%rip), %rax     # 0xd0590
movq -0x8(%rbp), %rcx
movq 0x40(%rcx), %rdi
callq *%rax
movq -0x8(%rbp), %rax
movq $0x0, 0x40(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x48(%rax)
movl -0xc(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x20(%rax)
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: pcache1Alloc
static void *pcache1Alloc(int nByte){
  void *p = 0;
  assert( sqlite3_mutex_notheld(pcache1.grp.mutex) );
  sqlite3StatusSet(SQLITE_STATUS_PAGECACHE_SIZE, nByte);
  if( nByte<=pcache1.szSlot ){
    sqlite3_mutex_enter(pcache1.mutex);
    p = (PgHdr1 *)pcache1.pFree;
    if( p ){
      pcache1.pFree = pcache1.pFree->pNext;
      pcache1.nFreeSlot--;
      pcache1.bUnderPressure = pcache1.nFreeSlot<pcache1.nReserve;
      assert( pcache1.nFreeSlot>=0 );
      sqlite3StatusAdd(SQLITE_STATUS_PAGECACHE_USED, 1);
    }
    sqlite3_mutex_leave(pcache1.mutex);
  }
  if( p==0 ){
    /* Memory is not available in the SQLITE_CONFIG_PAGECACHE pool.  Get
    ** it from sqlite3Malloc instead.
    */
    p = sqlite3Malloc(nByte);
#ifndef SQLITE_DISABLE_PAGECACHE_OVERFLOW_STATS
    if( p ){
      int sz = sqlite3MallocSize(p);
      sqlite3_mutex_enter(pcache1.mutex);
      sqlite3StatusAdd(SQLITE_STATUS_PAGECACHE_OVERFLOW, sz);
      sqlite3_mutex_leave(pcache1.mutex);
    }
#endif
    sqlite3MemdebugSetType(p, MEMTYPE_PCACHE);
  }
  return p;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x4(%rbp)
movq $0x0, -0x10(%rbp)
movl -0x4(%rbp), %esi
movl $0x7, %edi
callq 0x1b9e0
movl -0x4(%rbp), %eax
cmpl 0xad023(%rip), %eax     # 0xd20bc
jg 0x250f5
movq 0xad03e(%rip), %rax     # 0xd20e0
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x250f3
movq 0xad02c(%rip), %rax     # 0xd20e0
movq (%rax), %rax
movq %rax, 0xad022(%rip)     # 0xd20e0
movl 0xad024(%rip), %eax     # 0xd20e8
addl $-0x1, %eax
movl %eax, 0xad01b(%rip)     # 0xd20e8
movl 0xad015(%rip), %eax     # 0xd20e8
cmpl 0xacfeb(%rip), %eax     # 0xd20c4
setl %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, 0xad005(%rip)     # 0xd20ec
movl $0x1, %esi
movl %esi, %edi
callq 0xa490
jmp 0x250f5
cmpq $0x0, -0x10(%rbp)
jne 0x2512a
movl -0x4(%rbp), %edi
callq 0xa3c0
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x25128
movq -0x10(%rbp), %rdi
callq 0x9990
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %esi
movl $0x2, %edi
callq 0xa490
jmp 0x2512a
movq -0x10(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3BackupRestart
SQLITE_PRIVATE void sqlite3BackupRestart(sqlite3_backup *pBackup){
  sqlite3_backup *p;                   /* Iterator variable */
  for(p=pBackup; p; p=p->pNext){
    assert( sqlite3_mutex_held(p->pSrc->pBt->mutex) );
    p->iNext = 1;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x25170
movq -0x10(%rbp), %rax
movl $0x1, 0x18(%rax)
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movq %rax, -0x10(%rbp)
jmp 0x25150
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3PcacheTruncate
SQLITE_PRIVATE void sqlite3PcacheTruncate(PCache *pCache, Pgno pgno){
  if( pCache->pCache ){
    PgHdr *p;
    PgHdr *pNext;
    for(p=pCache->pDirty; p; p=pNext){
      pNext = p->pDirtyNext;
      /* This routine never gets call with a positive pgno except right
      ** after sqlite3PcacheCleanAll().  So if there are dirty pages,
      ** it must be that pgno==0.
      */
      assert( p->pgno>0 );
      if( ALWAYS(p->pgno>pgno) ){
        assert( p->flags&PGHDR_DIRTY );
        sqlite3PcacheMakeClean(p);
      }
    }
    if( pgno==0 && pCache->pPage1 ){
      memset(pCache->pPage1->pData, 0, pCache->szPage);
      pgno = 1;
    }
    sqlite3GlobalConfig.pcache2.xTruncate(pCache->pCache, pgno+1);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x40(%rax)
je 0x25247
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x251fd
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movl 0x28(%rax), %eax
cmpl -0xc(%rbp), %eax
jbe 0x251f1
movq -0x18(%rbp), %rdi
callq 0x21900
jmp 0x251f3
movq -0x20(%rbp), %rax
movq %rax, -0x18(%rbp)
jmp 0x251c9
cmpl $0x0, -0xc(%rbp)
jne 0x25230
movq -0x8(%rbp), %rax
cmpq $0x0, 0x48(%rax)
je 0x25230
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rax
movq 0x8(%rax), %rdi
movq -0x8(%rbp), %rax
movslq 0x20(%rax), %rdx
xorl %esi, %esi
callq 0x8200
movl $0x1, -0xc(%rbp)
movq 0xab351(%rip), %rax     # 0xd0588
movq -0x8(%rbp), %rcx
movq 0x40(%rcx), %rdi
movl -0xc(%rbp), %esi
addl $0x1, %esi
callq *%rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: pcache1Free
static int pcache1Free(void *p){
  int nFreed = 0;
  if( p==0 ) return 0;
  if( p>=pcache1.pStart && p<pcache1.pEnd ){
    PgFreeslot *pSlot;
    sqlite3_mutex_enter(pcache1.mutex);
    sqlite3StatusAdd(SQLITE_STATUS_PAGECACHE_USED, -1);
    pSlot = (PgFreeslot*)p;
    pSlot->pNext = pcache1.pFree;
    pcache1.pFree = pSlot;
    pcache1.nFreeSlot++;
    pcache1.bUnderPressure = pcache1.nFreeSlot<pcache1.nReserve;
    assert( pcache1.nFreeSlot<=pcache1.nSlot );
    sqlite3_mutex_leave(pcache1.mutex);
  }else{
    assert( sqlite3MemdebugHasType(p, MEMTYPE_PCACHE) );
    sqlite3MemdebugSetType(p, MEMTYPE_HEAP);
    nFreed = sqlite3MallocSize(p);
#ifndef SQLITE_DISABLE_PAGECACHE_OVERFLOW_STATS
    sqlite3_mutex_enter(pcache1.mutex);
    sqlite3StatusAdd(SQLITE_STATUS_PAGECACHE_OVERFLOW, -nFreed);
    sqlite3_mutex_leave(pcache1.mutex);
#endif
    sqlite3_free(p);
  }
  return nFreed;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x25276
movl $0x0, -0x4(%rbp)
jmp 0x25315
movq -0x10(%rbp), %rax
cmpq 0xace47(%rip), %rax     # 0xd20c8
jb 0x252eb
movq -0x10(%rbp), %rax
cmpq 0xace42(%rip), %rax     # 0xd20d0
jae 0x252eb
movl $0x1, %edi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xa490
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movq 0xace32(%rip), %rcx     # 0xd20e0
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movq -0x20(%rbp), %rax
movq %rax, 0xace20(%rip)     # 0xd20e0
movl 0xace22(%rip), %eax     # 0xd20e8
addl $0x1, %eax
movl %eax, 0xace19(%rip)     # 0xd20e8
movl 0xace13(%rip), %eax     # 0xd20e8
cmpl 0xacde9(%rip), %eax     # 0xd20c4
setl %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, 0xace03(%rip)     # 0xd20ec
jmp 0x2530f
movq -0x10(%rbp), %rdi
callq 0x9990
movl %eax, -0x14(%rbp)
xorl %esi, %esi
subl -0x14(%rbp), %esi
movl $0x2, %edi
callq 0xa490
movq -0x10(%rbp), %rdi
callq 0xa420
movl -0x14(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: pagerFreeMapHdrs
static void pagerFreeMapHdrs(Pager *pPager){
  PgHdr *p;
  PgHdr *pNext;
  for(p=pPager->pMmapFreelist; p; p=pNext){
    pNext = p->pDirty;
    sqlite3_free(p);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0xa8(%rax), %rax
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x25361
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0xa420
movq -0x18(%rbp), %rax
movq %rax, -0x10(%rbp)
jmp 0x2533b
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: pagerSyncHotJournal
static int pagerSyncHotJournal(Pager *pPager){
  int rc = SQLITE_OK;
  if( !pPager->noSync ){
    rc = sqlite3OsSync(pPager->jfd, SQLITE_SYNC_NORMAL);
  }
  if( rc==SQLITE_OK ){
    rc = sqlite3OsFileSize(pPager->jfd, &pPager->journalHdr);
  }
  return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl $0x0, -0xc(%rbp)
movq -0x8(%rbp), %rax
cmpb $0x0, 0xb(%rax)
jne 0x25672
movq -0x8(%rbp), %rax
movq 0x50(%rax), %rdi
movl $0x2, %esi
callq 0x22ce0
movl %eax, -0xc(%rbp)
cmpl $0x0, -0xc(%rbp)
jne 0x25690
movq -0x8(%rbp), %rax
movq 0x50(%rax), %rdi
movq -0x8(%rbp), %rsi
addq $0x68, %rsi
callq 0x23e00
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: pagerUnlockAndRollback
static void pagerUnlockAndRollback(Pager *pPager){
  if( pPager->eState!=PAGER_ERROR && pPager->eState!=PAGER_OPEN ){
    assert( assert_pager_state(pPager) );
    if( pPager->eState>=PAGER_WRITER_LOCKED ){
      sqlite3BeginBenignMalloc();
      sqlite3PagerRollback(pPager);
      sqlite3EndBenignMalloc();
    }else if( !pPager->exclusiveMode ){
      assert( pPager->eState==PAGER_READER );
      pager_end_transaction(pPager, 0, 0);
    }
  }
  pager_unlock(pPager);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movzbl 0x13(%rax), %eax
cmpl $0x6, %eax
je 0x25703
movq -0x8(%rbp), %rax
movzbl 0x13(%rax), %eax
cmpl $0x0, %eax
je 0x25703
movq -0x8(%rbp), %rax
movzbl 0x13(%rax), %eax
cmpl $0x2, %eax
jl 0x256e8
callq 0x241b0
movq -0x8(%rbp), %rdi
callq 0x26840
callq 0x24200
jmp 0x25701
movq -0x8(%rbp), %rax
cmpb $0x0, 0x8(%rax)
jne 0x256ff
movq -0x8(%rbp), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x26960
jmp 0x25701
jmp 0x25703
movq -0x8(%rbp), %rdi
callq 0x254c0
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: walIndexClose
static void walIndexClose(Wal *pWal, int isDelete){
  if( pWal->exclusiveMode==WAL_HEAPMEMORY_MODE ){
    int i;
    for(i=0; i<pWal->nWiData; i++){
      sqlite3_free((void *)pWal->apWiData[i]);
      pWal->apWiData[i] = 0;
    }
  }else{
    sqlite3OsShmUnmap(pWal->pDbFd, isDelete);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movzbl 0x3f(%rax), %eax
cmpl $0x2, %eax
jne 0x259b5
movl $0x0, -0x10(%rbp)
movl -0x10(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x28(%rcx), %eax
jge 0x259b3
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rax
movslq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0xa420
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rax
movslq -0x10(%rbp), %rcx
movq $0x0, (%rax,%rcx,8)
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x25973
jmp 0x259c5
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
movl -0xc(%rbp), %esi
callq 0x26600
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)