LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3BtreeCloseCursor
SQLITE_PRIVATE int sqlite3BtreeCloseCursor(BtCursor *pCur){
  Btree *pBtree = pCur->pBtree;
  if( pBtree ){
    int i;
    BtShared *pBt = pCur->pBt;
    sqlite3BtreeEnter(pBtree);
    sqlite3BtreeClearCursor(pCur);
    if( pCur->pPrev ){
      pCur->pPrev->pNext = pCur->pNext;
    }else{
      pBt->pCursor = pCur->pNext;
    }
    if( pCur->pNext ){
      pCur->pNext->pPrev = pCur->pPrev;
    }
    for(i=0; i<=pCur->iPage; i++){
      releasePage(pCur->apPage[i]);
    }
    unlockBtreeIfUnused(pBt);
    invalidateOverflowCache(pCur);
    /* sqlite3_free(pCur); */
    sqlite3BtreeLeave(pBtree);
  }
  return SQLITE_OK;
}

// Assembly:
movq (%rdi), %rax
testq %rax, %rax
je 0x2457c
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x8(%rdi), %r14
movq (%rax), %rcx
movq 0x8(%rax), %rax
movq %rcx, 0x8(%rax)
movq 0x68(%rdi), %rdi
callq 0xa2e8
movq $0x0, 0x68(%rbx)
movb $0x0, 0x77(%rbx)
movq 0x18(%rbx), %rax
testq %rax, %rax
movq %rax, %rcx
cmoveq %r14, %rcx
movq 0x10(%rbx), %rdx
movq %rdx, 0x10(%rcx)
movq 0x10(%rbx), %rcx
testq %rcx, %rcx
je 0x2450f
movq %rax, 0x18(%rcx)
cmpw $0x0, 0x7a(%rbx)
js 0x24540
movq $-0x1, %r15
movq 0xb0(%rbx,%r15,8), %rax
testq %rax, %rax
je 0x24533
movq 0x68(%rax), %rdi
callq 0xdcd4
movswq 0x7a(%rbx), %rax
incq %r15
cmpq %rax, %r15
jl 0x2451d
cmpb $0x0, 0x24(%r14)
jne 0x24561
movq 0x18(%r14), %rax
testq %rax, %rax
je 0x24561
movq 0x68(%rax), %rdi
callq 0xdcd4
movq $0x0, 0x18(%r14)
movq 0x28(%rbx), %rdi
callq 0xa2e8
movq $0x0, 0x28(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: callFinaliser
static void callFinaliser(sqlite3 *db, int offset){
  int i;
  if( db->aVTrans ){
    for(i=0; i<db->nVTrans; i++){
      VTable *pVTab = db->aVTrans[i];
      sqlite3_vtab *p = pVTab->pVtab;
      if( p ){
        int (*x)(sqlite3_vtab *);
        x = *(int (**)(sqlite3_vtab *))((char *)p->pModule + offset);
        if( x ) x(p);
      }
      pVTab->iSavepoint = 0;
      sqlite3VtabUnlock(pVTab);
    }
    sqlite3DbFree(db, db->aVTrans);
    db->nVTrans = 0;
    db->aVTrans = 0;
  }
}

// Assembly:
cmpq $0x0, 0x1c8(%rdi)
je 0x24615
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
cmpl $0x0, 0x1a4(%rdi)
jle 0x245e9
movl %esi, %r15d
xorl %r12d, %r12d
movq 0x1c8(%rbx), %rax
movq (%rax,%r12,8), %r14
movq 0x10(%r14), %rdi
testq %rdi, %rdi
je 0x245ca
movq (%rdi), %rax
movq (%rax,%r15), %rax
testq %rax, %rax
je 0x245ca
callq *%rax
movl $0x0, 0x20(%r14)
movq %r14, %rdi
callq 0x23229
incq %r12
movslq 0x1a4(%rbx), %rax
cmpq %rax, %r12
jl 0x245a8
movq 0x1c8(%rbx), %rsi
movq %rbx, %rdi
callq 0x9c3a
movl $0x0, 0x1a4(%rbx)
movq $0x0, 0x1c8(%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3SetString
SQLITE_PRIVATE void sqlite3SetString(char **pz, sqlite3 *db, const char *zFormat, ...){
  va_list ap;
  char *z;

  va_start(ap, zFormat);
  z = sqlite3VMPrintf(db, zFormat, ap);
  va_end(ap);
  sqlite3DbFree(db, *pz);
  *pz = z;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0xc8, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq -0xe0(%rbp), %rsi
movq %rcx, 0x18(%rsi)
movq %r8, 0x20(%rsi)
movq %r9, 0x28(%rsi)
testb %al, %al
je 0x2466c
movaps %xmm0, -0xb0(%rbp)
movaps %xmm1, -0xa0(%rbp)
movaps %xmm2, -0x90(%rbp)
movaps %xmm3, -0x80(%rbp)
movaps %xmm4, -0x70(%rbp)
movaps %xmm5, -0x60(%rbp)
movaps %xmm6, -0x50(%rbp)
movaps %xmm7, -0x40(%rbp)
leaq -0x30(%rbp), %rax
movq %rsi, 0x10(%rax)
leaq 0x10(%rbp), %rcx
movq %rcx, 0x8(%rax)
movabsq $0x3000000018, %rcx     # imm = 0x3000000018
movq %rcx, (%rax)
movq %rbx, %rdi
movq %rdx, %rsi
movq %rax, %rdx
callq 0x19668
movq %rax, %r15
movq (%r14), %rsi
movq %rbx, %rdi
callq 0x9c3a
movq %r15, (%r14)
addq $0xc8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3OsOpenMalloc
SQLITE_PRIVATE int sqlite3OsOpenMalloc(
  sqlite3_vfs *pVfs, 
  const char *zFile, 
  sqlite3_file **ppFile, 
  int flags,
  int *pOutFlags
){
  int rc = SQLITE_NOMEM;
  sqlite3_file *pFile;
  pFile = (sqlite3_file *)sqlite3MallocZero(pVfs->szOsFile);
  if( pFile ){
    rc = sqlite3OsOpen(pVfs, zFile, pFile, flags, pOutFlags);
    if( rc!=SQLITE_OK ){
      sqlite3_free(pFile);
    }else{
      *ppFile = pFile;
    }
  }
  return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, -0x38(%rbp)
movl %ecx, %r13d
movq %rdx, -0x30(%rbp)
movq %rsi, %r15
movq %rdi, %rbx
movl 0x4(%rdi), %r12d
movl %r12d, %edi
callq 0xa2a2
testq %rax, %rax
je 0x24729
movq %rax, %r14
movslq %r12d, %rdx
xorl %r12d, %r12d
movq %rax, %rdi
xorl %esi, %esi
callq 0x8200
andl $0x87f7f, %r13d         # imm = 0x87F7F
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
movl %r13d, %ecx
movq -0x38(%rbp), %r8
callq *0x28(%rbx)
testl %eax, %eax
je 0x24731
movl %eax, %ebx
movq %r14, %rdi
callq 0xa2e8
movl %ebx, %r12d
jmp 0x24738
movl $0x7, %r12d
jmp 0x24738
movq -0x30(%rbp), %rax
movq %r14, (%rax)
movl %r12d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3VtabImportErrmsg
SQLITE_PRIVATE void sqlite3VtabImportErrmsg(Vdbe *p, sqlite3_vtab *pVtab){
  sqlite3 *db = p->db;
  sqlite3DbFree(db, p->zErrMsg);
  p->zErrMsg = sqlite3DbStrDup(db, pVtab->zErrMsg);
  sqlite3_free(pVtab->zErrMsg);
  pVtab->zErrMsg = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq (%rdi), %r15
movq 0x58(%rdi), %rsi
movq %r15, %rdi
callq 0x9c3a
movq 0x10(%rbx), %rsi
movq %r15, %rdi
callq 0x1010d
movq %rax, 0x58(%r14)
movq 0x10(%rbx), %rdi
callq 0xa2e8
movq $0x0, 0x10(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3BtreeSavepoint
SQLITE_PRIVATE int sqlite3BtreeSavepoint(Btree *p, int op, int iSavepoint){
  int rc = SQLITE_OK;
  if( p && p->inTrans==TRANS_WRITE ){
    BtShared *pBt = p->pBt;
    assert( op==SAVEPOINT_RELEASE || op==SAVEPOINT_ROLLBACK );
    assert( iSavepoint>=0 || (iSavepoint==-1 && op==SAVEPOINT_ROLLBACK) );
    sqlite3BtreeEnter(p);
    rc = sqlite3PagerSavepoint(pBt->pPager, op, iSavepoint);
    if( rc==SQLITE_OK ){
      if( iSavepoint<0 && (pBt->btsFlags & BTS_INITIALLY_EMPTY)!=0 ){
        pBt->nPage = 0;
      }
      rc = newDatabase(pBt);
      pBt->nPage = get4byte(28 + pBt->pPage1->aData);

      /* The database size was written into the offset 28 of the header
      ** when the transaction started, so we know that the value at offset
      ** 28 is nonzero. */
      assert( pBt->nPage>0 );
    }
    sqlite3BtreeLeave(p);
  }
  return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
xorl %eax, %eax
testq %rdi, %rdi
je 0x247ed
cmpb $0x2, 0x10(%rdi)
jne 0x247ed
movl %edx, %r14d
movq (%rdi), %rax
movq 0x8(%rdi), %rbx
movq %rax, 0x8(%rbx)
movq (%rbx), %rdi
callq 0x1e387
testl %eax, %eax
jne 0x247ed
testl %r14d, %r14d
jns 0x247d5
testb $0x8, 0x26(%rbx)
je 0x247d5
movl $0x0, 0x3c(%rbx)
movq %rbx, %rdi
callq 0x1fcda
movq 0x18(%rbx), %rcx
movq 0x50(%rcx), %rcx
movl 0x1c(%rcx), %ecx
bswapl %ecx
movl %ecx, 0x3c(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3VtabSavepoint
SQLITE_PRIVATE int sqlite3VtabSavepoint(sqlite3 *db, int op, int iSavepoint){
  int rc = SQLITE_OK;

  assert( op==SAVEPOINT_RELEASE||op==SAVEPOINT_ROLLBACK||op==SAVEPOINT_BEGIN );
  assert( iSavepoint>=0 );
  if( db->aVTrans ){
    int i;
    for(i=0; rc==SQLITE_OK && i<db->nVTrans; i++){
      VTable *pVTab = db->aVTrans[i];
      const sqlite3_module *pMod = pVTab->pMod->pModule;
      if( pVTab->pVtab && pMod->iVersion>=2 ){
        int (*xMethod)(sqlite3_vtab *, int);
        switch( op ){
          case SAVEPOINT_BEGIN:
            xMethod = pMod->xSavepoint;
            pVTab->iSavepoint = iSavepoint+1;
            break;
          case SAVEPOINT_ROLLBACK:
            xMethod = pMod->xRollbackTo;
            break;
          default:
            xMethod = pMod->xRelease;
            break;
        }
        if( xMethod && pVTab->iSavepoint>iSavepoint ){
          rc = xMethod(pVTab->pVtab, iSavepoint);
        }
      }
    }
  }
  return rc;
}

// Assembly:
xorl %eax, %eax
cmpq $0x0, 0x1c8(%rdi)
je 0x248a9
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r15
cmpl $0x0, 0x1a4(%rdi)
jle 0x2489b
movl %edx, %ebx
movl %esi, %r14d
leal 0x1(%rbx), %r12d
xorl %r13d, %r13d
movq 0x1c8(%r15), %rax
movq (%rax,%r13,8), %rcx
movq 0x10(%rcx), %rdi
movl $0x0, %eax
testq %rdi, %rdi
je 0x24888
movq 0x8(%rcx), %rax
movq (%rax), %rdx
cmpl $0x2, (%rdx)
movl $0x0, %eax
jl 0x24888
cmpl $0x2, %r14d
je 0x2486a
testl %r14d, %r14d
jne 0x24873
movq 0xa0(%rdx), %rdx
movl %r12d, 0x20(%rcx)
jmp 0x2487a
movq 0xb0(%rdx), %rdx
jmp 0x2487a
movq 0xa8(%rdx), %rdx
testq %rdx, %rdx
je 0x24888
cmpl %ebx, 0x20(%rcx)
jle 0x24888
movl %ebx, %esi
callq *%rdx
testl %eax, %eax
jne 0x2489b
incq %r13
movslq 0x1a4(%r15), %rcx
cmpq %rcx, %r13
jl 0x24828
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3VdbeMemMakeWriteable
SQLITE_PRIVATE int sqlite3VdbeMemMakeWriteable(Mem *pMem){
  int f;
  assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) );
  assert( (pMem->flags&MEM_RowSet)==0 );
  ExpandBlob(pMem);
  f = pMem->flags;
  if( (f&(MEM_Str|MEM_Blob)) && pMem->z!=pMem->zMalloc ){
    if( sqlite3VdbeMemGrow(pMem, pMem->n + 2, 1) ){
      return SQLITE_NOMEM;
    }
    pMem->z[pMem->n] = 0;
    pMem->z[pMem->n+1] = 0;
    pMem->flags |= MEM_Term;
#ifdef SQLITE_DEBUG
    pMem->pScopyFrom = 0;
#endif
  }

  return SQLITE_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
testb $0x40, 0x25(%rdi)
je 0x253ec
movq %rbx, %rdi
callq 0xecad
xorl %eax, %eax
testb $0x12, 0x24(%rbx)
je 0x25439
movq 0x8(%rbx), %rcx
cmpq 0x30(%rbx), %rcx
je 0x25439
movl 0x20(%rbx), %esi
addl $0x2, %esi
movq %rbx, %rdi
movl $0x1, %edx
callq 0x1025e
movl %eax, %ecx
movl $0x7, %eax
testl %ecx, %ecx
jne 0x25439
movq 0x8(%rbx), %rcx
movslq 0x20(%rbx), %rdx
xorl %eax, %eax
movb %al, (%rcx,%rdx)
movq 0x8(%rbx), %rcx
movslq 0x20(%rbx), %rdx
movb %al, 0x1(%rcx,%rdx)
orb $0x2, 0x25(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3VdbeMemNulTerminate
SQLITE_PRIVATE int sqlite3VdbeMemNulTerminate(Mem *pMem){
  assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) );
  if( (pMem->flags & MEM_Term)!=0 || (pMem->flags & MEM_Str)==0 ){
    return SQLITE_OK;   /* Nothing to do */
  }
  if( sqlite3VdbeMemGrow(pMem, pMem->n+2, 1) ){
    return SQLITE_NOMEM;
  }
  pMem->z[pMem->n] = 0;
  pMem->z[pMem->n+1] = 0;
  pMem->flags |= MEM_Term;
  return SQLITE_OK;
}

// Assembly:
movzwl 0x24(%rdi), %eax
andl $0x202, %eax            # imm = 0x202
cmpw $0x2, %ax
jne 0x2548f
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x20(%rdi), %esi
addl $0x2, %esi
movl $0x1, %edx
callq 0x1025e
testl %eax, %eax
jne 0x25489
movq 0x8(%rbx), %rax
movslq 0x20(%rbx), %rcx
xorl %edx, %edx
movb %dl, (%rax,%rcx)
movq 0x8(%rbx), %rax
movslq 0x20(%rbx), %rcx
movb %dl, 0x1(%rax,%rcx)
orb $0x2, 0x25(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3VdbeMemStringify
SQLITE_PRIVATE int sqlite3VdbeMemStringify(Mem *pMem, int enc){
  int rc = SQLITE_OK;
  int fg = pMem->flags;
  const int nByte = 32;

  assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) );
  assert( !(fg&MEM_Zero) );
  assert( !(fg&(MEM_Str|MEM_Blob)) );
  assert( fg&(MEM_Int|MEM_Real) );
  assert( (pMem->flags&MEM_RowSet)==0 );
  assert( EIGHT_BYTE_ALIGNMENT(pMem) );


  if( sqlite3VdbeMemGrow(pMem, nByte, 0) ){
    return SQLITE_NOMEM;
  }

  /* For a Real or Integer, use sqlite3_mprintf() to produce the UTF-8
  ** string representation of the value. Then, if the required encoding
  ** is UTF-16le or UTF-16be do a translation.
  ** 
  ** FIX ME: It would be better if sqlite3_snprintf() could do UTF-16.
  */
  if( fg & MEM_Int ){
    sqlite3_snprintf(nByte, pMem->z, "%lld", pMem->u.i);
  }else{
    assert( fg & MEM_Real );
    sqlite3_snprintf(nByte, pMem->z, "%!.15g", pMem->r);
  }
  pMem->n = sqlite3Strlen30(pMem->z);
  pMem->enc = SQLITE_UTF8;
  pMem->flags |= MEM_Str|MEM_Term;
  sqlite3VdbeChangeEncoding(pMem, enc);
  return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
movzwl 0x24(%rdi), %r12d
movl $0x20, %esi
xorl %edx, %edx
callq 0x1025e
movl $0x7, %r15d
testl %eax, %eax
jne 0x25537
movq 0x8(%r14), %rsi
testb $0x4, %r12b
jne 0x254e0
movsd 0x10(%r14), %xmm0
leaq 0x54410(%rip), %rdx     # 0x798e2
movl $0x20, %edi
movb $0x1, %al
callq 0xb859
jmp 0x254f7
movq 0x18(%r14), %rcx
leaq 0x554ff(%rip), %rdx     # 0x7a9ea
movl $0x20, %edi
xorl %eax, %eax
callq 0xb859
movq 0x8(%r14), %rcx
xorl %r15d, %r15d
movl $0x0, %eax
testq %rcx, %rcx
je 0x2551d
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
incl %eax
cmpb $0x0, (%rcx)
leaq 0x1(%rcx), %rcx
jne 0x2550d
andl $0x3fffffff, %eax       # imm = 0x3FFFFFFF
movl %eax, 0x20(%r14)
movb $0x1, 0x27(%r14)
orw $0x202, 0x24(%r14)      # imm = 0x202
movq %r14, %rdi
movl %ebx, %esi
callq 0x24e59
movl %r15d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3RowSetClear
SQLITE_PRIVATE void sqlite3RowSetClear(RowSet *p){
  struct RowSetChunk *pChunk, *pNextChunk;
  for(pChunk=p->pChunk; pChunk; pChunk = pNextChunk){
    pNextChunk = pChunk->pNextChunk;
    sqlite3DbFree(p->db, pChunk);
  }
  p->pChunk = 0;
  p->nFresh = 0;
  p->pEntry = 0;
  p->pLast = 0;
  p->pForest = 0;
  p->rsFlags = ROWSET_SORTED;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rsi
testq %rsi, %rsi
je 0x25569
movq (%rsi), %r14
movq 0x8(%rbx), %rdi
callq 0x9c3a
movq %r14, %rsi
testq %r14, %r14
jne 0x25555
xorl %eax, %eax
movq %rax, (%rbx)
movw $0x0, 0x30(%rbx)
movq %rax, 0x28(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rbx)
movb $0x1, 0x32(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3OsCurrentTimeInt64
SQLITE_PRIVATE int sqlite3OsCurrentTimeInt64(sqlite3_vfs *pVfs, sqlite3_int64 *pTimeOut){
  int rc;
  /* IMPLEMENTATION-OF: R-49045-42493 SQLite will use the xCurrentTimeInt64()
  ** method to get the current date and time if that method is available
  ** (if iVersion is 2 or greater and the function pointer is not NULL) and
  ** will fall back to xCurrentTime() if xCurrentTimeInt64() is
  ** unavailable.
  */
  if( pVfs->iVersion>=2 && pVfs->xCurrentTimeInt64 ){
    rc = pVfs->xCurrentTimeInt64(pVfs, pTimeOut);
  }else{
    double r;
    rc = pVfs->xCurrentTime(pVfs, &r);
    *pTimeOut = (sqlite3_int64)(r*86400000.0);
  }
  return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
cmpl $0x2, (%rdi)
jl 0x255b4
movq 0x88(%rdi), %rax
testq %rax, %rax
je 0x255b4
movq %rbx, %rsi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
jmpq *%rax
leaq -0x18(%rbp), %r14
movq %r14, %rsi
callq *0x78(%rdi)
movsd (%r14), %xmm0
mulsd 0x53cd5(%rip), %xmm0    # 0x792a0
cvttsd2si %xmm0, %rcx
movq %rcx, (%rbx)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3VdbeMemShallowCopy
SQLITE_PRIVATE void sqlite3VdbeMemShallowCopy(Mem *pTo, const Mem *pFrom, int srcType){
  assert( (pFrom->flags & MEM_RowSet)==0 );
  VdbeMemRelease(pTo);
  memcpy(pTo, pFrom, MEMCELLSIZE);
  pTo->xDel = 0;
  if( (pFrom->flags&MEM_Static)==0 ){
    pTo->flags &= ~(MEM_Dyn|MEM_Static|MEM_Ephem);
    assert( srcType==MEM_Ephem || srcType==MEM_Static );
    pTo->flags |= srcType;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %r14d
movq %rsi, %r15
movq %rdi, %rbx
movzwl 0x24(%rdi), %eax
testl $0x2460, %eax           # imm = 0x2460
je 0x2be45
movq %rbx, %rdi
callq 0x101e6
movups (%r15), %xmm0
movups 0x10(%r15), %xmm1
movups 0x20(%r15), %xmm2
movups %xmm2, 0x20(%rbx)
movups %xmm1, 0x10(%rbx)
movups %xmm0, (%rbx)
movq $0x0, 0x28(%rbx)
testb $0x8, 0x25(%r15)
jne 0x2be7c
movl $0xffffe3ff, %eax       # imm = 0xFFFFE3FF
andl 0x24(%rbx), %eax
orl %r14d, %eax
movw %ax, 0x24(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3SubInt64
SQLITE_PRIVATE int sqlite3SubInt64(i64 *pA, i64 iB){
  testcase( iB==SMALLEST_INT64+1 );
  if( iB==SMALLEST_INT64 ){
    testcase( (*pA)==(-1) ); testcase( (*pA)==0 );
    if( (*pA)>=0 ) return 1;
    *pA -= iB;
    return 0;
  }else{
    return sqlite3AddInt64(pA, -iB);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movabsq $0x7fffffffffffffff, %rdx # imm = 0x7FFFFFFFFFFFFFFF
leaq 0x1(%rdx), %rax
movq (%rdi), %rcx
cmpq %rax, %rsi
jne 0x2beb0
movl $0x1, %eax
testq %rcx, %rcx
jns 0x2bef6
andq %rdx, %rcx
jmp 0x2bef1
testq %rsi, %rsi
jle 0x2bed6
testq %rcx, %rcx
jns 0x2beee
subq %rcx, %rdx
addq $0x2, %rdx
movl $0x1, %r8d
subq %rsi, %r8
movl $0x1, %eax
cmpq %r8, %rdx
jle 0x2beee
jmp 0x2bef6
testq %rcx, %rcx
jle 0x2beee
movq %rsi, %r8
negq %r8
subq %rcx, %rdx
movl $0x1, %eax
cmpq %r8, %rdx
jl 0x2bef6
subq %rsi, %rcx
movq %rcx, (%rdi)
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3MulInt64
SQLITE_PRIVATE int sqlite3MulInt64(i64 *pA, i64 iB){
  i64 iA = *pA;
  i64 iA1, iA0, iB1, iB0, r;

  iA1 = iA/TWOPOWER32;
  iA0 = iA % TWOPOWER32;
  iB1 = iB/TWOPOWER32;
  iB0 = iB % TWOPOWER32;
  if( iA1*iB1 != 0 ) return 1;
  assert( iA1*iB0==0 || iA0*iB1==0 );
  r = iA1*iB0 + iA0*iB1;
  testcase( r==(-TWOPOWER31)-1 );
  testcase( r==(-TWOPOWER31) );
  testcase( r==TWOPOWER31 );
  testcase( r==TWOPOWER31-1 );
  if( r<(-TWOPOWER31) || r>=TWOPOWER31 ) return 1;
  r *= TWOPOWER32;
  if( sqlite3AddInt64(&r, iA0*iB0) ) return 1;
  *pA = r;
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
movq (%rdi), %rcx
movl $0xffffffff, %r9d       # imm = 0xFFFFFFFF
leaq (%rcx,%r9), %r10
testq %rcx, %rcx
cmovnsq %rcx, %r10
movq %r10, %rdx
sarq $0x20, %rdx
addq %rsi, %r9
testq %rsi, %rsi
cmovnsq %rsi, %r9
movq %r9, %r8
sarq $0x20, %r8
setne %r11b
testq %rdx, %rdx
setne %bl
movl $0x1, %eax
testb %r11b, %bl
jne 0x2bfcb
movabsq $-0x100000000, %r11     # imm = 0xFFFFFFFF00000000
andq %r11, %r10
subq %r10, %rcx
andq %r11, %r9
subq %r9, %rsi
imulq %rsi, %rdx
imulq %rcx, %r8
addq %rdx, %r8
movslq %r8d, %rdx
cmpq %r8, %rdx
jne 0x2bfcb
movq %r8, %rdx
shlq $0x20, %rdx
imulq %rsi, %rcx
testq %rcx, %rcx
js 0x2bf9e
testq %r8, %r8
setg %sil
movabsq $0x7fffffffffffffff, %r8 # imm = 0x7FFFFFFFFFFFFFFF
subq %rdx, %r8
cmpq %rcx, %r8
setl %r8b
testb %r8b, %sil
je 0x2bfbd
xorl %ecx, %ecx
jmp 0x2bfc2
testq %r8, %r8
jns 0x2bfbd
movabsq $0x7fffffffffffffff, %rsi # imm = 0x7FFFFFFFFFFFFFFF
subq %rdx, %rsi
addq $0x2, %rsi
leaq 0x1(%rcx), %r8
cmpq %r8, %rsi
jg 0x2bf9a
addq %rcx, %rdx
movb $0x1, %cl
testb %cl, %cl
je 0x2bfcb
movq %rdx, (%rdi)
xorl %eax, %eax
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: applyAffinity
static void applyAffinity(
  Mem *pRec,          /* The value to apply affinity to */
  char affinity,      /* The affinity to be applied */
  u8 enc              /* Use this text encoding */
){
  if( affinity==SQLITE_AFF_TEXT ){
    /* Only attempt the conversion to TEXT if there is an integer or real
    ** representation (blob and NULL do not get converted) but no string
    ** representation.
    */
    if( 0==(pRec->flags&MEM_Str) && (pRec->flags&(MEM_Real|MEM_Int)) ){
      sqlite3VdbeMemStringify(pRec, enc);
    }
    pRec->flags &= ~(MEM_Real|MEM_Int);
  }else if( affinity!=SQLITE_AFF_NONE ){
    assert( affinity==SQLITE_AFF_INTEGER || affinity==SQLITE_AFF_REAL
             || affinity==SQLITE_AFF_NUMERIC );
    applyNumericAffinity(pRec);
    if( pRec->flags & MEM_Real ){
      sqlite3VdbeIntegerAffinity(pRec);
    }
  }
}

// Assembly:
cmpl $0x62, %esi
je 0x2c073
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpl $0x61, %esi
jne 0x2c00a
movzwl 0x24(%rbx), %eax
movl %eax, %ecx
andl $0x2, %ecx
shrl %ecx
testb $0xc, %al
sete %al
orb %cl, %al
jne 0x2c004
movzbl %dl, %esi
movq %rbx, %rdi
callq 0x25490
andb $-0xd, 0x24(%rbx)
jmp 0x2c06d
movq %rbx, %rdi
callq 0x10f2e
movzwl 0x24(%rbx), %eax
testb $0x8, %al
je 0x2c06d
movsd 0x10(%rbx), %xmm0
movapd 0x4d359(%rip), %xmm1    # 0x79380
andpd %xmm0, %xmm1
ucomisd 0x4d275(%rip), %xmm1    # 0x792a8
cvttsd2si %xmm0, %rcx
movabsq $-0x8000000000000000, %rdx # imm = 0x8000000000000000
cmovaq %rdx, %rcx
movq %rcx, 0x18(%rbx)
xorps %xmm1, %xmm1
cvtsi2sd %rcx, %xmm1
ucomisd %xmm1, %xmm0
jne 0x2c06d
jp 0x2c06d
addq %rdx, %rcx
incq %rcx
cmpq $0x2, %rcx
jb 0x2c06d
orl $0x4, %eax
movw %ax, 0x24(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3VdbeMemNumerify
SQLITE_PRIVATE int sqlite3VdbeMemNumerify(Mem *pMem){
  if( (pMem->flags & (MEM_Int|MEM_Real|MEM_Null))==0 ){
    assert( (pMem->flags & (MEM_Blob|MEM_Str))!=0 );
    assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) );
    if( 0==sqlite3Atoi64(pMem->z, &pMem->u.i, pMem->n, pMem->enc) ){
      MemSetTypeFlag(pMem, MEM_Int);
    }else{
      pMem->r = sqlite3VdbeRealValue(pMem);
      MemSetTypeFlag(pMem, MEM_Real);
      sqlite3VdbeIntegerAffinity(pMem);
    }
  }
  assert( (pMem->flags & (MEM_Int|MEM_Real|MEM_Null))!=0 );
  pMem->flags &= ~(MEM_Str|MEM_Blob);
  return SQLITE_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
testb $0xd, 0x24(%rdi)
jne 0x2c117
movq 0x8(%rbx), %rdi
leaq 0x18(%rbx), %rsi
movl 0x20(%rbx), %edx
movzbl 0x27(%rbx), %ecx
callq 0x16f9b
testl %eax, %eax
je 0x2c108
movq %rbx, %rdi
callq 0xed72
movsd %xmm0, 0x10(%rbx)
movzwl 0x24(%rbx), %eax
andl $0xbe00, %eax           # imm = 0xBE00
leal 0x8(%rax), %ecx
movapd 0x4d2c0(%rip), %xmm1    # 0x79380
andpd %xmm0, %xmm1
ucomisd 0x4d1dc(%rip), %xmm1    # 0x792a8
movw %cx, 0x24(%rbx)
cvttsd2si %xmm0, %rcx
movabsq $-0x8000000000000000, %rdx # imm = 0x8000000000000000
cmovaq %rdx, %rcx
movq %rcx, 0x18(%rbx)
xorps %xmm1, %xmm1
cvtsi2sd %rcx, %xmm1
ucomisd %xmm1, %xmm0
jne 0x2c117
jp 0x2c117
addq %rdx, %rcx
incq %rcx
cmpq $0x2, %rcx
jb 0x2c117
orl $0xc, %eax
jmp 0x2c113
movl $0xffffbe00, %eax       # imm = 0xFFFFBE00
andl 0x24(%rbx), %eax
orl $0x4, %eax
movw %ax, 0x24(%rbx)
andb $-0x13, 0x24(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3VdbeCursorMoveto
SQLITE_PRIVATE int sqlite3VdbeCursorMoveto(VdbeCursor *p){
  if( p->deferredMoveto ){
    int res, rc;
#ifdef SQLITE_TEST
    extern int sqlite3_search_count;
#endif
    assert( p->isTable );
    rc = sqlite3BtreeMovetoUnpacked(p->pCursor, 0, p->movetoTarget, 0, &res);
    if( rc ) return rc;
    p->lastRowid = p->movetoTarget;
    if( res!=0 ) return SQLITE_CORRUPT_BKPT;
    p->rowidIsValid = 1;
#ifdef SQLITE_TEST
    sqlite3_search_count++;
#endif
    p->deferredMoveto = 0;
    p->cacheStatus = CACHE_STALE;
  }else if( ALWAYS(p->pCursor) ){
    int hasMoved;
    int rc = sqlite3BtreeCursorHasMoved(p->pCursor, &hasMoved);
    if( rc ) return rc;
    if( hasMoved ){
      p->cacheStatus = CACHE_STALE;
      p->nullRow = 1;
    }
  }
  return SQLITE_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpb $0x0, 0x29(%rdi)
je 0x2c363
movq (%rbx), %rdi
movq 0x48(%rbx), %rdx
xorl %r15d, %r15d
leaq -0x1c(%rbp), %r8
xorl %esi, %esi
xorl %ecx, %ecx
callq 0x2ced9
testl %eax, %eax
je 0x2c3b8
movl %eax, %r14d
jmp 0x2c402
movq (%rbx), %r15
testq %r15, %r15
je 0x2c407
xorl %r14d, %r14d
cmpb $0x3, 0x77(%r15)
jb 0x2c384
movq %r15, %rdi
callq 0x2fe4a
movl %eax, %r14d
xorl %eax, %eax
testl %r14d, %r14d
jne 0x2c39d
cmpb $0x1, 0x77(%r15)
jne 0x2c39a
cmpl $0x0, 0x70(%r15)
sete %al
xorl %r14d, %r14d
testl %r14d, %r14d
jne 0x2c3b1
testb %al, %al
jne 0x2c3b1
movl $0x0, 0x64(%rbx)
movb $0x1, 0x28(%rbx)
testl %r14d, %r14d
jne 0x2c40a
jmp 0x2c407
movq 0x48(%rbx), %rax
movq %rax, 0x50(%rbx)
cmpl $0x0, -0x1c(%rbp)
je 0x2c3f0
leaq 0x4d447(%rip), %rsi     # 0x79814
leaq 0x4d165(%rip), %rcx     # 0x79539
xorl %r15d, %r15d
movl $0xb, %r14d
movl $0xb, %edi
movl $0xf465, %edx           # imm = 0xF465
xorl %eax, %eax
callq 0xb8cc
jmp 0x2c402
movb $0x1, 0x25(%rbx)
movb $0x0, 0x29(%rbx)
movl $0x0, 0x64(%rbx)
movb $0x1, %r15b
testb %r15b, %r15b
je 0x2c40a
xorl %r14d, %r14d
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3BtreeDataSize
SQLITE_PRIVATE int sqlite3BtreeDataSize(BtCursor *pCur, u32 *pSize){
  assert( cursorHoldsMutex(pCur) );
  assert( pCur->eState==CURSOR_VALID );
  getCellInfo(pCur);
  *pSize = pCur->info.nData;
  return SQLITE_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
cmpw $0x0, 0x5e(%rdi)
jne 0x2c46c
leaq 0x40(%r14), %rdx
movswq 0x7a(%r14), %rax
movq 0xa8(%r14,%rax,8), %rdi
movzwl 0x7c(%r14,%rax,2), %eax
movzwl 0x12(%rdi), %ecx
movq 0x60(%rdi), %rsi
movzbl (%rsi,%rax,2), %r8d
shll $0x8, %r8d
movzbl 0x1(%rsi,%rax,2), %esi
orl %r8d, %esi
andl %ecx, %esi
addq 0x50(%rdi), %rsi
callq 0x21585
movb $0x1, 0x76(%r14)
movl 0x50(%r14), %eax
movl %eax, (%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3VdbeMemFromBtree
SQLITE_PRIVATE int sqlite3VdbeMemFromBtree(
  BtCursor *pCur,   /* Cursor pointing at record to retrieve. */
  int offset,       /* Offset from the start of data to return bytes from. */
  int amt,          /* Number of bytes to return. */
  int key,          /* If true, retrieve from the btree key, not data. */
  Mem *pMem         /* OUT: Return data in this Mem structure. */
){
  char *zData;        /* Data from the btree layer */
  int available = 0;  /* Number of bytes available on the local btree page */
  int rc = SQLITE_OK; /* Return code */

  assert( sqlite3BtreeCursorIsValid(pCur) );

  /* Note: the calls to BtreeKeyFetch() and DataFetch() below assert() 
  ** that both the BtShared and database handle mutexes are held. */
  assert( (pMem->flags & MEM_RowSet)==0 );
  if( key ){
    zData = (char *)sqlite3BtreeKeyFetch(pCur, &available);
  }else{
    zData = (char *)sqlite3BtreeDataFetch(pCur, &available);
  }
  assert( zData!=0 );

  if( offset+amt<=available && (pMem->flags&MEM_Dyn)==0 ){
    sqlite3VdbeMemRelease(pMem);
    pMem->z = &zData[offset];
    pMem->flags = MEM_Blob|MEM_Ephem;
  }else if( SQLITE_OK==(rc = sqlite3VdbeMemGrow(pMem, amt+2, 0)) ){
    pMem->flags = MEM_Blob|MEM_Dyn|MEM_Term;
    pMem->enc = 0;
    pMem->type = SQLITE_BLOB;
    if( key ){
      rc = sqlite3BtreeKey(pCur, offset, amt, pMem->z);
    }else{
      rc = sqlite3BtreeData(pCur, offset, amt, pMem->z);
    }
    pMem->z[amt] = 0;
    pMem->z[amt+1] = 0;
    if( rc!=SQLITE_OK ){
      sqlite3VdbeMemRelease(pMem);
    }
  }
  pMem->n = amt;

  return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %rbx
movl %edx, %r14d
movl %esi, %r15d
movq %rdi, %r12
movl $0x0, -0x2c(%rbp)
cmpb $0x1, 0x77(%rdi)
movl %ecx, -0x30(%rbp)
jne 0x2c4b9
xorl %edx, %edx
testl %ecx, %ecx
sete %dl
leaq -0x2c(%rbp), %rsi
movq %r12, %rdi
callq 0x2ff5f
movq %rax, %r13
jmp 0x2c4bc
xorl %r13d, %r13d
leal (%r14,%r15), %eax
cmpl -0x2c(%rbp), %eax
jg 0x2c4e7
testb $0x4, 0x25(%rbx)
jne 0x2c4e7
movq %rbx, %rdi
callq 0xec23
movslq %r15d, %rax
addq %rax, %r13
movq %r13, 0x8(%rbx)
movw $0x1010, 0x24(%rbx)     # imm = 0x1010
xorl %eax, %eax
jmp 0x2c552
leal 0x2(%r14), %esi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x1025e
testl %eax, %eax
jne 0x2c552
movl $0x40610, 0x24(%rbx)    # imm = 0x40610
movq 0x8(%rbx), %rcx
cmpl $0x0, -0x30(%rbp)
je 0x2c51d
movq %r12, %rdi
movl %r15d, %esi
movl %r14d, %edx
xorl %r8d, %r8d
callq 0x2186f
jmp 0x2c52b
movq %r12, %rdi
movl %r15d, %esi
movl %r14d, %edx
callq 0x121ff
movl %eax, %r15d
movq 0x8(%rbx), %rcx
movslq %r14d, %rdx
xorl %eax, %eax
movb %al, (%rcx,%rdx)
movq 0x8(%rbx), %rcx
movb %al, 0x1(%rcx,%rdx)
testl %r15d, %r15d
je 0x2c552
movq %rbx, %rdi
callq 0xec23
movl %r15d, %eax
movl %r14d, 0x20(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3VdbeSerialType
SQLITE_PRIVATE u32 sqlite3VdbeSerialType(Mem *pMem, int file_format){
  int flags = pMem->flags;
  int n;

  if( flags&MEM_Null ){
    return 0;
  }
  if( flags&MEM_Int ){
    /* Figure out whether to use 1, 2, 4, 6 or 8 bytes. */
#   define MAX_6BYTE ((((i64)0x00008000)<<32)-1)
    i64 i = pMem->u.i;
    u64 u;
    if( i<0 ){
      if( i<(-MAX_6BYTE) ) return 6;
      /* Previous test prevents:  u = -(-9223372036854775808) */
      u = -i;
    }else{
      u = i;
    }
    if( u<=127 ){
      return ((i&1)==i && file_format>=4) ? 8+(u32)u : 1;
    }
    if( u<=32767 ) return 2;
    if( u<=8388607 ) return 3;
    if( u<=2147483647 ) return 4;
    if( u<=MAX_6BYTE ) return 5;
    return 6;
  }
  if( flags&MEM_Real ){
    return 7;
  }
  assert( pMem->db->mallocFailed || flags&(MEM_Str|MEM_Blob) );
  n = pMem->n;
  if( flags & MEM_Zero ){
    n += pMem->u.nZero;
  }
  assert( n>=0 );
  return ((n*2) + 12 + ((flags&MEM_Str)!=0));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movzwl 0x24(%rdi), %ecx
xorl %eax, %eax
testb $0x1, %cl
jne 0x2c78f
testb $0x4, %cl
jne 0x2c710
movl $0x7, %eax
testb $0x8, %cl
jne 0x2c78f
movl 0x20(%rdi), %eax
btl $0xe, %ecx
jae 0x2c703
addl 0x18(%rdi), %eax
shrl %ecx
andl $0x1, %ecx
leal (%rcx,%rax,2), %eax
addl $0xc, %eax
jmp 0x2c78f
movq 0x18(%rdi), %rdx
movq %rdx, %rcx
testq %rdx, %rdx
jns 0x2c736
movl $0x6, %eax
movabsq $-0x7fffffffffff, %rcx  # imm = 0xFFFF800000000001
cmpq %rcx, %rdx
jl 0x2c78f
movq %rdx, %rcx
negq %rcx
cmpq $0x7f, %rcx
ja 0x2c755
addl $0x8, %ecx
cmpq $0x2, %rdx
movl $0x1, %eax
cmovael %eax, %ecx
cmpl $0x4, %esi
cmovll %eax, %ecx
movl %ecx, %eax
jmp 0x2c78f
movl $0x2, %eax
cmpq $0x8000, %rcx           # imm = 0x8000
jb 0x2c78f
movl $0x3, %eax
cmpq $0x800000, %rcx         # imm = 0x800000
jb 0x2c78f
movq %rcx, %rax
shrq $0x1f, %rax
movl $0x4, %eax
je 0x2c78f
shrq $0x2f, %rcx
cmpq $0x1, %rcx
movl $0x6, %eax
sbbl $0x0, %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3ResetOneSchema
SQLITE_PRIVATE void sqlite3ResetOneSchema(sqlite3 *db, int iDb){
  Db *pDb;
  assert( iDb<db->nDb );

  /* Case 1:  Reset the single schema identified by iDb */
  pDb = &db->aDb[iDb];
  assert( sqlite3SchemaMutexHeld(db, iDb, 0) );
  assert( pDb->pSchema!=0 );
  sqlite3SchemaClear(pDb->pSchema);

  /* If any database other than TEMP is reset, then also reset TEMP
  ** since TEMP might be holding triggers that reference tables in the
  ** other database.
  */
  if( iDb!=1 ){
    pDb = &db->aDb[1];
    assert( pDb->pSchema!=0 );
    sqlite3SchemaClear(pDb->pSchema);
  }
  return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x20(%rdi), %rax
movslq %esi, %r14
movq %r14, %rcx
shlq $0x5, %rcx
movq 0x18(%rax,%rcx), %rdi
callq 0x30334
cmpl $0x1, %r14d
jne 0x2c8c2
popq %rbx
popq %r14
popq %rbp
retq
movq 0x20(%rbx), %rax
movq 0x38(%rax), %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x30334
// File: /workspace/github_c_makefile_star2_O1/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3BtreeCursor
SQLITE_PRIVATE int sqlite3BtreeCursor(
  Btree *p,                                   /* The btree */
  int iTable,                                 /* Root page of table to open */
  int wrFlag,                                 /* 1 to write. 0 read-only */
  struct KeyInfo *pKeyInfo,                   /* First arg to xCompare() */
  BtCursor *pCur                              /* Write new cursor here */
){
  int rc;
  sqlite3BtreeEnter(p);
  rc = btreeCursor(p, iTable, wrFlag, pKeyInfo, pCur);
  sqlite3BtreeLeave(p);
  return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq (%rdi), %rax
movq 0x8(%rdi), %r9
movq %rax, 0x8(%r9)
testl %edx, %edx
je 0x2c9fe
movl $0x8, %eax
testb $0x1, 0x26(%r9)
jne 0x2ca4c
cmpl $0x1, %esi
jne 0x2ca0e
xorl %esi, %esi
cmpl $0x0, 0x3c(%r9)
setne %sil
movl %esi, 0x30(%r8)
movw $0xffff, 0x7a(%r8)      # imm = 0xFFFF
movq %rcx, 0x20(%r8)
movq %rdi, (%r8)
movq %r9, 0x8(%r8)
movb %dl, 0x74(%r8)
movq 0x10(%r9), %rax
movq %rax, 0x10(%r8)
testq %rax, %rax
je 0x2ca39
movq %r8, 0x18(%rax)
movq %r8, 0x10(%r9)
movb $0x0, 0x77(%r8)
movq $0x0, 0x38(%r8)
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3VdbeSorterInit
SQLITE_PRIVATE int sqlite3VdbeSorterInit(sqlite3 *db, VdbeCursor *pCsr){
  int pgsz;                       /* Page size of main database */
  int mxCache;                    /* Cache size */
  VdbeSorter *pSorter;            /* The new sorter */
  char *d;                        /* Dummy */

  assert( pCsr->pKeyInfo && pCsr->pBt==0 );
  pCsr->pSorter = pSorter = sqlite3DbMallocZero(db, sizeof(VdbeSorter));
  if( pSorter==0 ){
    return SQLITE_NOMEM;
  }
  
  pSorter->pUnpacked = sqlite3VdbeAllocUnpackedRecord(pCsr->pKeyInfo, 0, 0, &d);
  if( pSorter->pUnpacked==0 ) return SQLITE_NOMEM;
  assert( pSorter->pUnpacked==(UnpackedRecord *)d );

  if( !sqlite3TempInMemory(db) ){
    pgsz = sqlite3BtreeGetPageSize(db->aDb[0].pBt);
    pSorter->mnPmaSize = SORTER_MIN_WORKING * pgsz;
    mxCache = db->aDb[0].pSchema->cache_size;
    if( mxCache<SORTER_MIN_WORKING ) mxCache = SORTER_MIN_WORKING;
    pSorter->mxPmaSize = mxCache * pgsz;
  }

  return SQLITE_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %r15
movl $0x50, %esi
callq 0x115e9
movq %rax, %rbx
testq %rax, %rax
je 0x2ce31
xorps %xmm0, %xmm0
movups %xmm0, 0x40(%rbx)
movups %xmm0, 0x30(%rbx)
movups %xmm0, 0x20(%rbx)
movups %xmm0, 0x10(%rbx)
movups %xmm0, (%rbx)
movq %rbx, 0x58(%r14)
movq 0x10(%r14), %rdi
xorl %r14d, %r14d
leaq -0x20(%rbp), %rcx
xorl %esi, %esi
xorl %edx, %edx
callq 0x2d509
movq %rax, 0x48(%rbx)
testq %rax, %rax
je 0x2ce35
cmpb $0x2, 0x4f(%r15)
je 0x2ce3b
movq 0x20(%r15), %rax
movq 0x8(%rax), %rcx
movq 0x8(%rcx), %rcx
movl 0x30(%rcx), %ecx
leal (%rcx,%rcx), %edx
leal (%rdx,%rdx,4), %edx
movl %edx, 0x1c(%rbx)
movq 0x18(%rax), %rax
movl 0x74(%rax), %eax
cmpl $0xb, %eax
movl $0xa, %edx
cmovgel %eax, %edx
imull %ecx, %edx
movl %edx, 0x20(%rbx)
jmp 0x2ce3b
movq %rbx, 0x58(%r14)
movl $0x7, %r14d
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3BtreeFirst
SQLITE_PRIVATE int sqlite3BtreeFirst(BtCursor *pCur, int *pRes){
  int rc;

  assert( cursorHoldsMutex(pCur) );
  assert( sqlite3_mutex_held(pCur->pBtree->db->mutex) );
  rc = moveToRoot(pCur);
  if( rc==SQLITE_OK ){
    if( pCur->eState==CURSOR_INVALID ){
      assert( pCur->pgnoRoot==0 || pCur->apPage[pCur->iPage]->nCell==0 );
      *pRes = 1;
    }else{
      assert( pCur->apPage[pCur->iPage]->nCell>0 );
      *pRes = 0;
      rc = moveToLeftmost(pCur);
    }
  }
  return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
callq 0x3006b
testl %eax, %eax
je 0x2ce64
popq %rbx
popq %r14
popq %rbp
retq
cmpb $0x0, 0x77(%r14)
je 0x2ce7d
movl $0x0, (%rbx)
movq %r14, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x30458
movl $0x1, (%rbx)
xorl %eax, %eax
jmp 0x2ce5f
// File: /workspace/github_c_makefile_star2_O1/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3VdbeAllocUnpackedRecord
SQLITE_PRIVATE UnpackedRecord *sqlite3VdbeAllocUnpackedRecord(
  KeyInfo *pKeyInfo,              /* Description of the record */
  char *pSpace,                   /* Unaligned space available */
  int szSpace,                    /* Size of pSpace[] in bytes */
  char **ppFree                   /* OUT: Caller should free this pointer */
){
  UnpackedRecord *p;              /* Unpacked record to return */
  int nOff;                       /* Increment pSpace by nOff to align it */
  int nByte;                      /* Number of bytes required for *p */

  /* We want to shift the pointer pSpace up such that it is 8-byte aligned.
  ** Thus, we need to calculate a value, nOff, between 0 and 7, to shift 
  ** it by.  If pSpace is already 8-byte aligned, nOff should be zero.
  */
  nOff = (8 - (SQLITE_PTR_TO_INT(pSpace) & 7)) & 7;
  nByte = ROUND8(sizeof(UnpackedRecord)) + sizeof(Mem)*(pKeyInfo->nField+1);
  if( nByte>szSpace+nOff ){
    p = (UnpackedRecord *)sqlite3DbMallocRaw(pKeyInfo->db, nByte);
    *ppFree = (char *)p;
    if( !p ) return 0;
  }else{
    p = (UnpackedRecord*)&pSpace[nOff];
    *ppFree = 0;
  }

  p->aMem = (Mem*)&((char*)p)[ROUND8(sizeof(UnpackedRecord))];
  assert( pKeyInfo->aSortOrder!=0 );
  p->pKeyInfo = pKeyInfo;
  p->nField = pKeyInfo->nField + 1;
  return p;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rcx, %r14
movq %rsi, %rax
movq %rdi, %rbx
movl %eax, %ecx
negl %ecx
andl $0x7, %ecx
movzwl 0xa(%rdi), %esi
imull $0x38, %esi, %esi
addl $0x58, %esi
addl %ecx, %edx
cmpl %edx, %esi
jle 0x2d544
movq (%rbx), %rdi
callq 0x115e9
movq %rax, (%r14)
testq %rax, %rax
jne 0x2d550
xorl %eax, %eax
jmp 0x2d565
movl %ecx, %ecx
addq %rcx, %rax
movq $0x0, (%r14)
leaq 0x20(%rax), %rcx
movq %rcx, 0x18(%rax)
movq %rbx, (%rax)
movzwl 0xa(%rbx), %ecx
incl %ecx
movw %cx, 0x8(%rax)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3VdbeRecordUnpack
SQLITE_PRIVATE void sqlite3VdbeRecordUnpack(
  KeyInfo *pKeyInfo,     /* Information about the record format */
  int nKey,              /* Size of the binary record */
  const void *pKey,      /* The binary record */
  UnpackedRecord *p      /* Populate this structure before returning. */
){
  const unsigned char *aKey = (const unsigned char *)pKey;
  int d; 
  u32 idx;                        /* Offset in aKey[] to read from */
  u16 u;                          /* Unsigned loop counter */
  u32 szHdr;
  Mem *pMem = p->aMem;

  p->flags = 0;
  assert( EIGHT_BYTE_ALIGNMENT(pMem) );
  idx = getVarint32(aKey, szHdr);
  d = szHdr;
  u = 0;
  while( idx<szHdr && u<p->nField && d<=nKey ){
    u32 serial_type;

    idx += getVarint32(&aKey[idx], serial_type);
    pMem->enc = pKeyInfo->enc;
    pMem->db = pKeyInfo->db;
    /* pMem->flags = 0; // sqlite3VdbeSerialGet() will set this for us */
    pMem->zMalloc = 0;
    d += sqlite3VdbeSerialGet(&aKey[d], serial_type, pMem);
    pMem++;
    u++;
  }
  assert( u<=pKeyInfo->nField + 1 );
  p->nField = u;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %esi, -0x34(%rbp)
movq %rdi, -0x50(%rbp)
movq 0x18(%rcx), %r13
movq %rcx, -0x40(%rbp)
movb $0x0, 0xa(%rcx)
movsbl (%rdx), %eax
testl %eax, %eax
movq %rdx, -0x48(%rbp)
js 0x2d5a3
movl %eax, -0x30(%rbp)
movl $0x1, %ebx
jmp 0x2d5b2
leaq -0x30(%rbp), %rsi
movq %rdx, %rdi
callq 0x216ad
movzbl %al, %ebx
movl -0x30(%rbp), %r14d
xorl %r15d, %r15d
cmpl %r14d, %ebx
jae 0x2d639
movl %r14d, %r12d
movq -0x40(%rbp), %rax
cmpw 0x8(%rax), %r15w
jae 0x2d639
cmpl -0x34(%rbp), %r12d
jg 0x2d639
movl %ebx, %edi
movq -0x48(%rbp), %rdx
movsbl (%rdx,%rdi), %eax
testl %eax, %eax
js 0x2d5ea
movl %eax, -0x2c(%rbp)
movl $0x1, %eax
jmp 0x2d5fd
addq %rdx, %rdi
leaq -0x2c(%rbp), %rsi
callq 0x216ad
movq -0x48(%rbp), %rdx
movzbl %al, %eax
addl %eax, %ebx
movq -0x50(%rbp), %rcx
movb 0x8(%rcx), %al
movb %al, 0x27(%r13)
movq (%rcx), %rax
movq %rax, (%r13)
movq $0x0, 0x30(%r13)
movslq %r12d, %rdi
addq %rdx, %rdi
movl -0x2c(%rbp), %esi
movq %r13, %rdx
callq 0x2c565
addl %eax, %r12d
addq $0x38, %r13
incl %r15d
cmpl %r14d, %ebx
jb 0x2d5c1
movq -0x40(%rbp), %rax
movw %r15w, 0x8(%rax)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3VdbeSorterCompare
SQLITE_PRIVATE int sqlite3VdbeSorterCompare(
  const VdbeCursor *pCsr,         /* Sorter cursor */
  Mem *pVal,                      /* Value to compare to current sorter key */
  int *pRes                       /* OUT: Result of comparison */
){
  VdbeSorter *pSorter = pCsr->pSorter;
  void *pKey; int nKey;           /* Sorter key to compare pVal with */

  pKey = vdbeSorterRowkey(pSorter, &nKey);
  vdbeSorterCompare(pCsr, 1, pVal->z, pVal->n, pKey, nKey, pRes);
  return SQLITE_OK;
}

// Assembly:
movq 0x58(%rdi), %rax
movq 0x30(%rax), %rcx
testq %rcx, %rcx
je 0x2df02
movq 0x28(%rax), %rax
movslq 0x4(%rcx), %r8
shlq $0x6, %r8
leaq (%rax,%r8), %rcx
addq $0x14, %rcx
addq %r8, %rax
addq $0x28, %rax
jmp 0x2df0a
movq 0x40(%rax), %rax
leaq 0x8(%rax), %rcx
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl (%rcx), %r9d
movq (%rax), %r8
movq 0x8(%rsi), %rax
movl 0x20(%rsi), %ecx
movq %rdx, (%rsp)
movl $0x1, %esi
movq %rax, %rdx
callq 0x32cc8
addq $0x10, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3VdbeSorterRowkey
SQLITE_PRIVATE int sqlite3VdbeSorterRowkey(const VdbeCursor *pCsr, Mem *pOut){
  VdbeSorter *pSorter = pCsr->pSorter;
  void *pKey; int nKey;           /* Sorter key to copy into pOut */

  pKey = vdbeSorterRowkey(pSorter, &nKey);
  if( sqlite3VdbeMemGrow(pOut, nKey, 0) ){
    return SQLITE_NOMEM;
  }
  pOut->n = nKey;
  MemSetTypeFlag(pOut, MEM_Blob);
  memcpy(pOut->z, pKey, nKey);

  return SQLITE_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq 0x58(%rdi), %rax
movq 0x30(%rax), %rcx
testq %rcx, %rcx
je 0x2df6d
movq 0x28(%rax), %rax
movslq 0x4(%rcx), %rdx
shlq $0x6, %rdx
leaq (%rax,%rdx), %rcx
addq $0x14, %rcx
addq %rdx, %rax
addq $0x28, %rax
jmp 0x2df75
movq 0x40(%rax), %rax
leaq 0x8(%rax), %rcx
movl (%rcx), %r15d
movq (%rax), %r14
movq %rbx, %rdi
movl %r15d, %esi
xorl %edx, %edx
callq 0x1025e
movl %eax, %ecx
movl $0x7, %eax
testl %ecx, %ecx
jne 0x2dfb7
movl %r15d, 0x20(%rbx)
movl $0xffffbe00, %eax       # imm = 0xFFFFBE00
andl 0x24(%rbx), %eax
movslq %r15d, %rdx
orl $0x10, %eax
movw %ax, 0x24(%rbx)
movq 0x8(%rbx), %rdi
movq %r14, %rsi
callq 0x82f0
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3VdbeSorterNext
SQLITE_PRIVATE int sqlite3VdbeSorterNext(sqlite3 *db, const VdbeCursor *pCsr, int *pbEof){
  VdbeSorter *pSorter = pCsr->pSorter;
  int rc;                         /* Return code */

  if( pSorter->aTree ){
    int iPrev = pSorter->aTree[1];/* Index of iterator to advance */
    int i;                        /* Index of aTree[] to recalculate */

    rc = vdbeSorterIterNext(db, &pSorter->aIter[iPrev]);
    for(i=(pSorter->nTree+iPrev)/2; rc==SQLITE_OK && i>0; i=i/2){
      rc = vdbeSorterDoCompare(pCsr, i);
    }

    *pbEof = (pSorter->aIter[pSorter->aTree[1]].pFile==0);
  }else{
    SorterRecord *pFree = pSorter->pRecord;
    pSorter->pRecord = pFree->pNext;
    pFree->pNext = 0;
    vdbeSorterRecordFree(db, pFree);
    *pbEof = !pSorter->pRecord;
    rc = SQLITE_OK;
  }
  return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r12
movq 0x58(%rsi), %r13
movq 0x30(%r13), %rax
testq %rax, %rax
je 0x2e048
movq %rsi, %r15
movq %rdx, -0x30(%rbp)
movslq 0x4(%rax), %rbx
movq %rbx, %rsi
shlq $0x6, %rsi
addq 0x28(%r13), %rsi
movq %r12, %rdi
callq 0x33314
movl %eax, %r14d
testl %eax, %eax
jne 0x2e02a
addl 0x14(%r13), %ebx
cmpl $0x2, %ebx
jl 0x2e02a
movl %ebx, %r14d
shrl %r14d
movq %r15, %rdi
movl %r14d, %esi
callq 0x331ba
cmpl $0x3, %ebx
movl %r14d, %ebx
ja 0x2e011
xorl %r14d, %r14d
movq 0x28(%r13), %rax
movq 0x30(%r13), %rcx
movslq 0x4(%rcx), %rcx
shlq $0x6, %rcx
leaq (%rax,%rcx), %r15
addq $0x18, %r15
movq -0x30(%rbp), %rdx
jmp 0x2e082
leaq 0x40(%r13), %r15
movq 0x40(%r13), %rsi
movq 0x10(%rsi), %rax
movq %rax, 0x40(%r13)
movq $0x0, 0x10(%rsi)
xorl %r14d, %r14d
testq %rsi, %rsi
je 0x2e082
movq %rdx, %r13
movq 0x10(%rsi), %rbx
movq %r12, %rdi
callq 0x9c3a
movq %rbx, %rsi
testq %rbx, %rbx
jne 0x2e06b
movq %r13, %rdx
xorl %eax, %eax
cmpq $0x0, (%r15)
sete %al
movl %eax, (%rdx)
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq