LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: releaseMemArray
static void releaseMemArray(Mem *p, int N){
  if( p && N ){
    Mem *pEnd;
    sqlite3 *db = p->db;
    u8 malloc_failed = db->mallocFailed;
    if( db->pnBytesFreed ){
      for(pEnd=&p[N]; p<pEnd; p++){
        sqlite3DbFree(db, p->zMalloc);
      }
      return;
    }
    for(pEnd=&p[N]; p<pEnd; p++){
      assert( (&p[1])==pEnd || p[0].db==p[1].db );

      /* This block is really an inlined version of sqlite3VdbeMemRelease()
      ** that takes advantage of the fact that the memory cell value is 
      ** being set to NULL after releasing any dynamic resources.
      **
      ** The justification for duplicating code is that according to 
      ** callgrind, this causes a certain test case to hit the CPU 4.7 
      ** percent less (x86 linux, gcc version 4.1.2, -O6) than if 
      ** sqlite3MemRelease() were called from here. With -O2, this jumps
      ** to 6.6 percent. The test case is inserting 1000 rows into a table 
      ** with no indexes using a single prepared INSERT statement, bind() 
      ** and reset(). Inserts are grouped into a transaction.
      */
      if( p->flags&(MEM_Agg|MEM_Dyn|MEM_Frame|MEM_RowSet) ){
        sqlite3VdbeMemRelease(p);
      }else if( p->zMalloc ){
        sqlite3DbFree(db, p->zMalloc);
        p->zMalloc = 0;
      }

      p->flags = MEM_Invalid;
    }
    db->mallocFailed = malloc_failed;
  }
}

// Assembly:
testq %rdi, %rdi
sete %al
testl %esi, %esi
sete %cl
orb %al, %cl
jne 0x22cd7
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %r14
movslq %esi, %rax
imulq $0x38, %rax, %r15
addq %rdi, %r15
cmpq $0x0, 0x328(%r14)
je 0x22c86
testl %esi, %esi
jle 0x22ccf
movq 0x30(%rbx), %rsi
movq %r14, %rdi
callq 0x9ca4
addq $0x38, %rbx
cmpq %r15, %rbx
jb 0x22c6f
jmp 0x22ccf
movb 0x50(%r14), %r12b
testl %esi, %esi
jle 0x22ccb
movzwl 0x24(%rbx), %eax
testl $0x2460, %eax           # imm = 0x2460
je 0x22ca3
movq %rbx, %rdi
callq 0xecfd
jmp 0x22cbc
movq 0x30(%rbx), %rsi
testq %rsi, %rsi
je 0x22cbc
movq %r14, %rdi
callq 0x9ca4
movq $0x0, 0x30(%rbx)
movw $0x80, 0x24(%rbx)
addq $0x38, %rbx
cmpq %r15, %rbx
jb 0x22c8e
movb %r12b, 0x50(%r14)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: vdbeFreeOpArray
static void vdbeFreeOpArray(sqlite3 *db, Op *aOp, int nOp){
  if( aOp ){
    Op *pOp;
    for(pOp=aOp; pOp<&aOp[nOp]; pOp++){
      freeP4(db, pOp->p4type, pOp->p4.p);
#ifdef SQLITE_DEBUG
      sqlite3DbFree(db, pOp->zComment);
#endif     
    }
  }
  sqlite3DbFree(db, aOp);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
testq %rsi, %rsi
je 0x22d24
movq %rsi, %r14
testl %edx, %edx
jle 0x22d1c
movslq %edx, %rax
leaq (%rax,%rax,2), %rax
leaq (%r14,%rax,8), %r15
movq %r14, %r12
movsbl 0x1(%r12), %esi
movq 0x10(%r12), %rdx
movq %rbx, %rdi
callq 0x22d36
addq $0x18, %r12
cmpq %r15, %r12
jb 0x22d00
movq %rbx, %rdi
movq %r14, %rsi
jmp 0x22d29
movq %rbx, %rdi
xorl %esi, %esi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x9ca4
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: freeP4
static void freeP4(sqlite3 *db, int p4type, void *p4){
  if( p4 ){
    assert( db );
    switch( p4type ){
      case P4_REAL:
      case P4_INT64:
      case P4_DYNAMIC:
      case P4_KEYINFO:
      case P4_INTARRAY:
      case P4_KEYINFO_HANDOFF: {
        sqlite3DbFree(db, p4);
        break;
      }
      case P4_MPRINTF: {
        if( db->pnBytesFreed==0 ) sqlite3_free(p4);
        break;
      }
      case P4_FUNCDEF: {
        freeEphemeralFunction(db, (FuncDef*)p4);
        break;
      }
      case P4_MEM: {
        if( db->pnBytesFreed==0 ){
          sqlite3ValueFree((sqlite3_value*)p4);
        }else{
          Mem *p = (Mem*)p4;
          sqlite3DbFree(db, p->zMalloc);
          sqlite3DbFree(db, p);
        }
        break;
      }
      case P4_VTAB : {
        if( db->pnBytesFreed==0 ) sqlite3VtabUnlock((VTable *)p4);
        break;
      }
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
testq %rdx, %rdx
je 0x22d9e
addl $0x10, %esi
cmpl $0xf, %esi
ja 0x22d9e
movq %rdx, %rbx
movq %rdi, %r14
leaq 0x52485(%rip), %rax     # 0x751dc
movslq (%rax,%rsi,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %rbp
jmp 0x9ca4
cmpq $0x0, 0x328(%r14)
jne 0x22d9e
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0xa3c7
cmpq $0x0, 0x328(%r14)
jne 0x22d9e
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x22dc8
testb $0x4, 0x3(%rbx)
jne 0x22d60
popq %rbx
popq %r14
popq %rbp
retq
cmpq $0x0, 0x328(%r14)
je 0x22dbb
movq 0x30(%rbx), %rsi
movq %r14, %rdi
callq 0x9ca4
jmp 0x22d60
movq %rbx, %rdi
callq 0xecfd
movq (%rbx), %rdi
jmp 0x22d63
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3VtabUnlock
SQLITE_PRIVATE void sqlite3VtabUnlock(VTable *pVTab){
  sqlite3 *db = pVTab->db;

  assert( db );
  assert( pVTab->nRef>0 );
  assert( db->magic==SQLITE_MAGIC_OPEN || db->magic==SQLITE_MAGIC_ZOMBIE );

  pVTab->nRef--;
  if( pVTab->nRef==0 ){
    sqlite3_vtab *p = pVTab->pVtab;
    if( p ){
      p->pModule->xDisconnect(p);
    }
    sqlite3DbFree(db, pVTab);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq (%rdi), %r14
decl 0x18(%rdi)
je 0x22ddc
popq %rbx
popq %r14
popq %rbp
retq
movq %rdi, %rbx
movq 0x10(%rdi), %rdi
testq %rdi, %rdi
je 0x22dee
movq (%rdi), %rax
callq *0x20(%rax)
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %rbp
jmp 0x9ca4
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3VdbeDelete
SQLITE_PRIVATE void sqlite3VdbeDelete(Vdbe *p){
  sqlite3 *db;

  if( NEVER(p==0) ) return;
  db = p->db;
  assert( sqlite3_mutex_held(db->mutex) );
  sqlite3VdbeClearObject(db, p);
  if( p->pPrev ){
    p->pPrev->pNext = p->pNext;
  }else{
    assert( db->pVdbe==p );
    db->pVdbe = p->pNext;
  }
  if( p->pNext ){
    p->pNext->pPrev = p->pPrev;
  }
  p->magic = VDBE_MAGIC_DEAD;
  p->db = 0;
  sqlite3DbFree(db, p);
}

// Assembly:
testq %rdi, %rdi
je 0x22e5a
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x9bc9
movq 0x60(%rbx), %rax
movq 0x68(%rbx), %rcx
leaq 0x8(%r14), %rdx
leaq 0x68(%rax), %rsi
testq %rax, %rax
cmoveq %rdx, %rsi
movq %rcx, (%rsi)
testq %rcx, %rcx
je 0x22e3d
movq %rax, 0x60(%rcx)
movl $0xb606c3c8, 0x50(%rbx) # imm = 0xB606C3C8
movq $0x0, (%rbx)
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %rbp
jmp 0x9ca4
retq
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3VdbeTransferError
SQLITE_PRIVATE int sqlite3VdbeTransferError(Vdbe *p){
  sqlite3 *db = p->db;
  int rc = p->rc;
  if( p->zErrMsg ){
    u8 mallocFailed = db->mallocFailed;
    sqlite3BeginBenignMalloc();
    sqlite3ValueSetStr(db->pErr, -1, p->zErrMsg, SQLITE_UTF8, SQLITE_TRANSIENT);
    sqlite3EndBenignMalloc();
    db->mallocFailed = mallocFailed;
    db->errCode = rc;
  }else{
    sqlite3Error(db, rc, 0);
  }
  return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq (%rdi), %r14
movl 0x94(%rdi), %ebx
cmpq $0x0, 0x58(%rdi)
je 0x23359
movq %rdi, %r15
movb 0x50(%r14), %r12b
movq 0x72c4c(%rip), %rax     # 0x95f60
testq %rax, %rax
je 0x2331b
callq *%rax
movq 0x130(%r14), %rdi
testq %rdi, %rdi
je 0x23341
movq 0x58(%r15), %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl $0x1, %ecx
movq $-0x1, %r8
callq 0xf0d7
movq 0x72c20(%rip), %rax     # 0x95f68
testq %rax, %rax
je 0x2334f
callq *%rax
movb %r12b, 0x50(%r14)
movl %ebx, 0x44(%r14)
jmp 0x23367
movq %r14, %rdi
movl %ebx, %esi
xorl %edx, %edx
xorl %eax, %eax
callq 0xca2d
movl %ebx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3RollbackAll
SQLITE_PRIVATE void sqlite3RollbackAll(sqlite3 *db, int tripCode){
  int i;
  int inTrans = 0;
  assert( sqlite3_mutex_held(db->mutex) );
  sqlite3BeginBenignMalloc();

  /* Obtain all b-tree mutexes before making any calls to BtreeRollback(). 
  ** This is important in case the transaction being rolled back has
  ** modified the database schema. If the b-tree mutexes are not taken
  ** here, then another shared-cache connection might sneak in between
  ** the database rollback and schema reset, which can cause false
  ** corruption reports in some cases.  */
  sqlite3BtreeEnterAll(db);

  for(i=0; i<db->nDb; i++){
    Btree *p = db->aDb[i].pBt;
    if( p ){
      if( sqlite3BtreeIsInTrans(p) ){
        inTrans = 1;
      }
      sqlite3BtreeRollback(p, tripCode);
    }
  }
  sqlite3VtabRollback(db);
  sqlite3EndBenignMalloc();

  if( (db->flags&SQLITE_InternChanges)!=0 && db->init.busy==0 ){
    sqlite3ExpirePreparedStatements(db);
    sqlite3ResetAllSchemasOfConnection(db);
  }
  sqlite3BtreeLeaveAll(db);

  /* Any deferred constraint violations have now been resolved. */
  db->nDeferredCons = 0;
  db->nDeferredImmCons = 0;
  db->flags &= ~SQLITE_DeferFKs;

  /* If one has been configured, invoke the rollback-hook callback */
  if( db->xRollbackCallback && (inTrans || !db->autoCommit) ){
    db->xRollbackCallback(db->pRollbackArg);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %r14d
movq %rdi, %rbx
movq 0x72bd3(%rip), %rax     # 0x95f60
testq %rax, %rax
je 0x23394
callq *%rax
movslq 0x28(%rbx), %rax
movb $0x1, %r15b
testq %rax, %rax
jle 0x23416
movq 0x20(%rbx), %rcx
movq %rax, %rdx
shlq $0x5, %rdx
xorl %esi, %esi
movq 0x8(%rcx,%rsi), %rdi
testq %rdi, %rdi
je 0x233c2
movq (%rdi), %r8
movq 0x8(%rdi), %rdi
movq %r8, 0x8(%rdi)
addq $0x20, %rsi
cmpq %rsi, %rdx
jne 0x233ad
testl %eax, %eax
jle 0x23416
xorl %r15d, %r15d
movl $0x8, %r12d
xorl %r13d, %r13d
movq 0x20(%rbx), %rcx
movq (%rcx,%r12), %rdi
testq %rdi, %rdi
je 0x23400
cmpb $0x2, 0x10(%rdi)
movl $0x1, %eax
cmovel %eax, %r13d
movl %r14d, %esi
callq 0xe75d
movl 0x28(%rbx), %eax
incq %r15
movslq %eax, %rcx
addq $0x20, %r12
cmpq %rcx, %r15
jl 0x233db
testl %r13d, %r13d
sete %r15b
movq %rbx, %rdi
movl $0x88, %esi
callq 0x2408c
movq 0x72b3e(%rip), %rax     # 0x95f68
testq %rax, %rax
je 0x23431
callq *%rax
movl 0x2c(%rbx), %eax
testb $0x2, %al
je 0x23462
cmpb $0x0, 0x99(%rbx)
jne 0x23462
movq 0x8(%rbx), %rax
testq %rax, %rax
je 0x23457
orb $0x20, 0x9a(%rax)
movq 0x68(%rax), %rax
jmp 0x23445
movq %rbx, %rdi
callq 0xdea0
movl 0x2c(%rbx), %eax
andl $0xfeffffff, %eax       # imm = 0xFEFFFFFF
xorps %xmm0, %xmm0
movups %xmm0, 0x318(%rbx)
movl %eax, 0x2c(%rbx)
movq 0xf0(%rbx), %rax
testq %rax, %rax
je 0x2348b
testb %r15b, %r15b
je 0x2349a
cmpb $0x0, 0x4e(%rbx)
je 0x2349a
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xe8(%rbx), %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmpq *%rax
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3CloseSavepoints
SQLITE_PRIVATE void sqlite3CloseSavepoints(sqlite3 *db){
  while( db->pSavepoint ){
    Savepoint *pTmp = db->pSavepoint;
    db->pSavepoint = pTmp->pNext;
    sqlite3DbFree(db, pTmp);
  }
  db->nSavepoint = 0;
  db->nStatement = 0;
  db->isTransactionSavepoint = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x300(%rdi), %rsi
testq %rsi, %rsi
je 0x234e2
movq 0x18(%rsi), %rax
movq %rax, 0x300(%rbx)
movq %rbx, %rdi
callq 0x9ca4
movq 0x300(%rbx), %rsi
jmp 0x234c1
movq $0x0, 0x30c(%rbx)
movb $0x0, 0x55(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3VdbeCheckFk
SQLITE_PRIVATE int sqlite3VdbeCheckFk(Vdbe *p, int deferred){
  sqlite3 *db = p->db;
  if( (deferred && (db->nDeferredCons+db->nDeferredImmCons)>0) 
   || (!deferred && p->nFkConstraint>0) 
  ){
    p->rc = SQLITE_CONSTRAINT_FOREIGNKEY;
    p->errorAction = OE_Abort;
    sqlite3SetString(&p->zErrMsg, db, "foreign key constraint failed");
    return SQLITE_ERROR;
  }
  return SQLITE_OK;
}

// Assembly:
movl %esi, %eax
movq (%rdi), %rsi
testl %eax, %eax
je 0x2353f
movq 0x320(%rsi), %rax
addq 0x318(%rsi), %rax
jle 0x23549
pushq %rbp
movq %rsp, %rbp
movl $0x313, 0x94(%rdi)      # imm = 0x313
movb $0x2, 0x98(%rdi)
addq $0x58, %rdi
leaq 0x56359(%rip), %rdx     # 0x7988a
xorl %eax, %eax
callq 0x24129
movl $0x1, %eax
popq %rbp
retq
cmpq $0x0, 0xc8(%rdi)
jg 0x23511
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3VdbeFreeCursor
SQLITE_PRIVATE void sqlite3VdbeFreeCursor(Vdbe *p, VdbeCursor *pCx){
  if( pCx==0 ){
    return;
  }
  sqlite3VdbeSorterClose(p->db, pCx);
  if( pCx->pBt ){
    sqlite3BtreeClose(pCx->pBt);
    /* The pCx->pCursor will be close automatically, if it exists, by
    ** the call above. */
  }else if( pCx->pCursor ){
    sqlite3BtreeCloseCursor(pCx->pCursor);
  }
#ifndef SQLITE_OMIT_VIRTUALTABLE
  if( pCx->pVtabCursor ){
    sqlite3_vtab_cursor *pVtabCursor = pCx->pVtabCursor;
    const sqlite3_module *pModule = pCx->pModule;
    p->inVtabMethod = 1;
    pModule->xClose(pVtabCursor);
    p->inVtabMethod = 0;
  }
#endif
}

// Assembly:
testq %rsi, %rsi
je 0x23e3b
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq 0x58(%rsi), %r15
testq %r15, %r15
je 0x23de2
movq %rbx, -0x38(%rbp)
movq (%r14), %r12
movq 0x28(%r15), %rsi
testq %rsi, %rsi
je 0x23d7a
cmpl $0x0, 0x14(%r15)
jle 0x23d72
movq %r14, -0x30(%rbp)
movl $0x30, %r13d
xorl %ebx, %ebx
movq 0x28(%r15), %r14
movq -0x10(%r14,%r13), %rsi
movq %r12, %rdi
callq 0x9ca4
movq (%r14,%r13), %rsi
movq %r12, %rdi
callq 0x9ca4
xorps %xmm0, %xmm0
movups %xmm0, (%r14,%r13)
movups %xmm0, -0x10(%r14,%r13)
movups %xmm0, -0x20(%r14,%r13)
movups %xmm0, -0x30(%r14,%r13)
incq %rbx
movslq 0x14(%r15), %rax
addq $0x40, %r13
cmpq %rax, %rbx
jl 0x23d23
movq 0x28(%r15), %rsi
movq -0x30(%rbp), %r14
movq %r12, %rdi
callq 0x9ca4
movq 0x38(%r15), %r13
testq %r13, %r13
je 0x23da2
movq (%r13), %rax
testq %rax, %rax
je 0x23d9a
movq %r13, %rdi
callq *0x8(%rax)
movq $0x0, (%r13)
movq %r13, %rdi
callq 0xa3c7
movq 0x40(%r15), %rsi
testq %rsi, %rsi
je 0x23dbf
movq 0x10(%rsi), %rbx
movq %r12, %rdi
callq 0x9ca4
movq %rbx, %rsi
testq %rbx, %rbx
jne 0x23dab
movq 0x48(%r15), %rsi
movq %r12, %rdi
callq 0x9ca4
movq %r12, %rdi
movq %r15, %rsi
callq 0x9ca4
movq -0x38(%rbp), %rbx
movq $0x0, 0x58(%rbx)
movq 0x8(%rbx), %rdi
testq %rdi, %rdi
je 0x23df2
callq 0x23ec5
jmp 0x23dff
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x23dff
callq 0x23fbd
movq 0x30(%rbx), %rdi
testq %rdi, %rdi
je 0x23e2d
movq 0x38(%rbx), %rax
movzwl 0x9a(%r14), %ecx
andl $-0xd, %ecx
orl $0x4, %ecx
movw %cx, 0x9a(%r14)
callq *0x38(%rax)
andb $-0xd, 0x9a(%r14)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3VdbeDeleteAuxData
SQLITE_PRIVATE void sqlite3VdbeDeleteAuxData(Vdbe *pVdbe, int iOp, int mask){
  AuxData **pp = &pVdbe->pAuxData;
  while( *pp ){
    AuxData *pAux = *pp;
    if( (iOp<0)
     || (pAux->iOp==iOp && (pAux->iArg>31 || !(mask & ((u32)1<<pAux->iArg))))
    ){
      if( pAux->xDelete ){
        pAux->xDelete(pAux->pAux);
      }
      *pp = pAux->pNext;
      sqlite3DbFree(pVdbe->db, pAux);
    }else{
      pp= &pAux->pNext;
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq 0x120(%rdi), %r12
testq %r12, %r12
je 0x23eb6
movl %edx, %ebx
movl %esi, %r14d
movq %rdi, %r15
leaq 0x120(%rdi), %r13
testl %r14d, %r14d
js 0x23e88
cmpl %r14d, (%r12)
jne 0x23e7f
movl 0x4(%r12), %eax
cmpl $0x1f, %eax
jg 0x23e88
btl %eax, %ebx
jae 0x23e88
addq $0x18, %r12
movq %r12, %r13
jmp 0x23ead
movq 0x10(%r12), %rax
testq %rax, %rax
je 0x23e99
movq 0x8(%r12), %rdi
callq *%rax
movq 0x18(%r12), %rax
movq %rax, (%r13)
movq (%r15), %rdi
movq %r12, %rsi
callq 0x9ca4
movq (%r13), %r12
testq %r12, %r12
jne 0x23e65
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3BtreeClose
SQLITE_PRIVATE int sqlite3BtreeClose(Btree *p){
  BtShared *pBt = p->pBt;
  BtCursor *pCur;

  /* Close all cursors opened via this handle.  */
  assert( sqlite3_mutex_held(p->db->mutex) );
  sqlite3BtreeEnter(p);
  pCur = pBt->pCursor;
  while( pCur ){
    BtCursor *pTmp = pCur;
    pCur = pCur->pNext;
    if( pTmp->pBtree==p ){
      sqlite3BtreeCloseCursor(pTmp);
    }
  }

  /* Rollback any active transaction and free the handle structure.
  ** The call to sqlite3BtreeRollback() drops any table-locks held by
  ** this handle.
  */
  sqlite3BtreeRollback(p, SQLITE_OK);
  sqlite3BtreeLeave(p);

  /* If there are still other outstanding references to the shared-btree
  ** structure, return now. The remainder of this procedure cleans 
  ** up the shared-btree.
  */
  assert( p->wantToLock==0 && p->locked==0 );
  if( !p->sharable || removeFromSharingList(pBt) ){
    /* The pBt is no longer on the sharing list, so we can access
    ** it without having to hold the mutex.
    **
    ** Clean out and delete the BtShared object.
    */
    assert( !pBt->pCursor );
    sqlite3PagerClose(pBt->pPager);
    if( pBt->xFreeSchema && pBt->pSchema ){
      pBt->xFreeSchema(pBt->pSchema);
    }
    sqlite3DbFree(0, pBt->pSchema);
    freeTempSpace(pBt);
    sqlite3_free(pBt);
  }

#ifndef SQLITE_OMIT_SHARED_CACHE
  assert( p->wantToLock==0 );
  assert( p->locked==0 );
  if( p->pPrev ) p->pPrev->pNext = p->pNext;
  if( p->pNext ) p->pNext->pPrev = p->pPrev;
#endif

  sqlite3_free(p);
  return SQLITE_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rax
movq 0x8(%rdi), %r14
movq %rax, 0x8(%r14)
movq 0x10(%r14), %rdi
testq %rdi, %rdi
je 0x23efc
movq 0x10(%rdi), %r15
cmpq %rbx, (%rdi)
jne 0x23ef4
callq 0x23fbd
movq %r15, %rdi
testq %r15, %r15
jne 0x23ee6
movq %rbx, %rdi
xorl %esi, %esi
callq 0xe75d
cmpb $0x0, 0x11(%rbx)
je 0x23f4d
movl 0x60(%r14), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x60(%r14)
cmpl $0x1, %eax
jg 0x23f91
movq 0x72035(%rip), %rcx     # 0x95f58
cmpq %r14, %rcx
je 0x23f3f
testq %rcx, %rcx
je 0x23f4d
movq %rcx, %rax
movq 0x68(%rcx), %rcx
cmpq %r14, %rcx
jne 0x23f28
addq $0x68, %rax
jmp 0x23f46
leaq 0x72012(%rip), %rax     # 0x95f58
movq 0x68(%r14), %rcx
movq %rcx, (%rax)
movq (%r14), %rdi
callq 0x1a3c3
movq 0x48(%r14), %rax
testq %rax, %rax
je 0x23f69
movq 0x40(%r14), %rdi
testq %rdi, %rdi
je 0x23f69
callq *%rax
movq 0x40(%r14), %rdi
callq 0xa3c7
movq 0x80(%r14), %rdi
callq 0x1cdc9
movq $0x0, 0x80(%r14)
movq %r14, %rdi
callq 0xa3c7
movq 0x20(%rbx), %rax
movq 0x28(%rbx), %rcx
testq %rcx, %rcx
je 0x23fa2
movq %rax, 0x20(%rcx)
testq %rax, %rax
je 0x23fab
movq %rcx, 0x28(%rax)
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xa3c7
// File: /workspace/github_c_makefile_star2_O3/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 0x2408b
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 0xa3c7
movq $0x0, 0x68(%rbx)
movb $0x0, 0x77(%rbx)
movq 0x10(%rbx), %rax
movq 0x18(%rbx), %rcx
testq %rcx, %rcx
movq %rcx, %rdx
cmoveq %r14, %rdx
movq %rax, 0x10(%rdx)
testq %rax, %rax
je 0x24019
movq %rcx, 0x18(%rax)
movzwl 0x7a(%rbx), %eax
testw %ax, %ax
js 0x2404f
movq $-0x1, %r15
movq 0xb0(%rbx,%r15,8), %rcx
testq %rcx, %rcx
je 0x24043
movq 0x68(%rcx), %rdi
callq 0xddd3
movzwl 0x7a(%rbx), %eax
movswq %ax, %rcx
incq %r15
cmpq %rcx, %r15
jl 0x24029
cmpb $0x0, 0x24(%r14)
jne 0x24070
movq 0x18(%r14), %rax
testq %rax, %rax
je 0x24070
movq 0x68(%rax), %rdi
callq 0xddd3
movq $0x0, 0x18(%r14)
movq 0x28(%rbx), %rdi
callq 0xa3c7
movq $0x0, 0x28(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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:
movl %esi, %eax
movq 0x1c8(%rdi), %rsi
testq %rsi, %rsi
je 0x24128
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
cmpl $0x0, 0x1a4(%rdi)
jle 0x24103
movl %eax, %r15d
xorl %r12d, %r12d
movq 0x1c8(%rbx), %rax
movq (%rax,%r12,8), %r14
movq 0x10(%r14), %rdi
testq %rdi, %rdi
je 0x240dd
movq (%rdi), %rax
movq (%rax,%r15), %rax
testq %rax, %rax
je 0x240dd
callq *%rax
movl $0x0, 0x20(%r14)
movq %r14, %rdi
callq 0x22dc8
incq %r12
movslq 0x1a4(%rbx), %rax
cmpq %rax, %r12
jl 0x240bb
movq 0x1c8(%rbx), %rsi
movq %rbx, %rdi
callq 0x9ca4
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_O3/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 0xa38c
testq %rax, %rax
je 0x2423c
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 0x24244
movl %eax, %ebx
movq %r14, %rdi
callq 0xa3c7
movl %ebx, %r12d
jmp 0x2424b
movl $0x7, %r12d
jmp 0x2424b
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_O3/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 0x9ca4
movq 0x10(%rbx), %rsi
movq %r15, %rdi
callq 0x101fc
movq %rax, 0x58(%r14)
movq 0x10(%rbx), %rdi
callq 0xa3c7
movq $0x0, 0x10(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x24300
cmpb $0x2, 0x10(%rdi)
jne 0x24300
movl %edx, %r14d
movq (%rdi), %rax
movq 0x8(%rdi), %rbx
movq %rax, 0x8(%rbx)
movq (%rbx), %rdi
callq 0x1e17d
testl %eax, %eax
jne 0x24300
testl %r14d, %r14d
jns 0x242e8
testb $0x8, 0x26(%rbx)
je 0x242e8
movl $0x0, 0x3c(%rbx)
movq %rbx, %rdi
callq 0x1fa9f
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_O3/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:
cmpq $0x0, 0x1c8(%rdi)
je 0x2439d
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movl %esi, %r14d
movq %rdi, %r15
leal 0x1(%rbx), %r12d
xorl %r13d, %r13d
movslq 0x1a4(%r15), %rax
cmpq %rax, %r13
jge 0x243a0
movq 0x1c8(%r15), %rax
movq (%rax,%r13,8), %rcx
movq 0x10(%rcx), %rdi
xorl %eax, %eax
testq %rdi, %rdi
je 0x24394
movq 0x8(%rcx), %rdx
movq (%rdx), %rdx
cmpl $0x2, (%rdx)
jl 0x24394
cmpl $0x2, %r14d
je 0x24376
testl %r14d, %r14d
jne 0x2437f
movq 0xa0(%rdx), %rdx
movl %r12d, 0x20(%rcx)
jmp 0x24386
movq 0xb0(%rdx), %rdx
jmp 0x24386
movq 0xa8(%rdx), %rdx
testq %rdx, %rdx
je 0x24394
cmpl %ebx, 0x20(%rcx)
jle 0x24394
movl %ebx, %esi
callq *%rdx
incq %r13
testl %eax, %eax
je 0x24330
jmp 0x243a2
xorl %eax, %eax
retq
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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
movl 0x24(%rdi), %ecx
btl $0xe, %ecx
jae 0x24ecf
movq %rbx, %rdi
callq 0xed87
movzwl 0x24(%rbx), %ecx
xorl %eax, %eax
testb $0x12, %cl
je 0x24f1b
movq 0x8(%rbx), %rcx
cmpq 0x30(%rbx), %rcx
je 0x24f1b
movl 0x20(%rbx), %esi
addl $0x2, %esi
movq %rbx, %rdi
movl $0x1, %edx
callq 0x1034d
movl %eax, %ecx
movl $0x7, %eax
testl %ecx, %ecx
jne 0x24f1b
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_O3/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 0x24f71
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x20(%rdi), %esi
addl $0x2, %esi
movl $0x1, %edx
callq 0x1034d
testl %eax, %eax
jne 0x24f6b
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_O3/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 0x1034d
movl $0x7, %r15d
testl %eax, %eax
jne 0x25019
movq 0x8(%r14), %rsi
testb $0x4, %r12b
jne 0x24fc2
movsd 0x10(%r14), %xmm0
leaq 0x5492e(%rip), %rdx     # 0x798e2
movl $0x20, %edi
movb $0x1, %al
callq 0xb954
jmp 0x24fd9
movq 0x18(%r14), %rcx
leaq 0x55a1d(%rip), %rdx     # 0x7a9ea
movl $0x20, %edi
xorl %eax, %eax
callq 0xb954
movq 0x8(%r14), %rcx
xorl %r15d, %r15d
movl $0x0, %eax
testq %rcx, %rcx
je 0x24fff
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
incl %eax
cmpb $0x0, (%rcx)
leaq 0x1(%rcx), %rcx
jne 0x24fef
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 0x24930
movl %r15d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x2504b
movq (%rsi), %r14
movq 0x8(%rbx), %rdi
callq 0x9ca4
movq %r14, %rsi
testq %r14, %r14
jne 0x25037
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_O3/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 0x25096
movq 0x88(%rdi), %rax
testq %rax, %rax
je 0x25096
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 0x541f3(%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_O3/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 0x2c757
movq %rbx, %rdi
callq 0x102d5
movq 0x20(%r15), %rax
movq %rax, 0x20(%rbx)
movups (%r15), %xmm0
movups 0x10(%r15), %xmm1
movups %xmm1, 0x10(%rbx)
movups %xmm0, (%rbx)
movq $0x0, 0x28(%rbx)
testb $0x8, 0x25(%r15)
jne 0x2c78d
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_O3/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 0x2c7c1
movl $0x1, %eax
testq %rcx, %rcx
jns 0x2c807
andq %rdx, %rcx
jmp 0x2c802
testq %rsi, %rsi
jle 0x2c7e7
testq %rcx, %rcx
jns 0x2c7ff
subq %rcx, %rdx
addq $0x2, %rdx
movl $0x1, %r8d
subq %rsi, %r8
movl $0x1, %eax
cmpq %r8, %rdx
jle 0x2c7ff
jmp 0x2c807
testq %rcx, %rcx
jle 0x2c7ff
movq %rsi, %r8
negq %r8
subq %rcx, %rdx
movl $0x1, %eax
cmpq %r8, %rdx
jb 0x2c807
subq %rsi, %rcx
movq %rcx, (%rdi)
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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, %r8
sarq $0x20, %r8
addq %rsi, %r9
testq %rsi, %rsi
cmovnsq %rsi, %r9
movq %r9, %rdx
sarq $0x20, %rdx
setne %r11b
testq %r8, %r8
setne %bl
movl $0x1, %eax
testb %r11b, %bl
jne 0x2c8d3
movabsq $-0x100000000, %r11     # imm = 0xFFFFFFFF00000000
andq %r11, %r10
subq %r10, %rcx
andq %r11, %r9
subq %r9, %rsi
imulq %rsi, %r8
imulq %rcx, %rdx
addq %r8, %rdx
movslq %edx, %r8
cmpq %rdx, %r8
jne 0x2c8d3
movq %rdx, %r8
shlq $0x20, %r8
imulq %rsi, %rcx
testq %rcx, %rcx
js 0x2c8ac
testq %rdx, %rdx
setg %dl
movabsq $0x7fffffffffffffff, %rsi # imm = 0x7FFFFFFFFFFFFFFF
subq %r8, %rsi
cmpq %rcx, %rsi
setb %sil
testb %sil, %dl
je 0x2c8cb
jmp 0x2c8d3
testq %rdx, %rdx
jns 0x2c8cb
movabsq $0x7fffffffffffffff, %rdx # imm = 0x7FFFFFFFFFFFFFFF
subq %r8, %rdx
addq $0x2, %rdx
leaq 0x1(%rcx), %rsi
cmpq %rsi, %rdx
jg 0x2c8d3
addq %rcx, %r8
movq %r8, (%rdi)
xorl %eax, %eax
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x2c92f
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpl $0x61, %esi
jne 0x2c919
movzwl 0x24(%rbx), %eax
movl %eax, %ecx
andl $0x2, %ecx
shrl %ecx
testb $0xc, %al
sete %sil
orb %cl, %sil
jne 0x2c90e
movzbl %dl, %esi
movq %rbx, %rdi
callq 0x24f72
movzwl 0x24(%rbx), %eax
andl $0xfff3, %eax           # imm = 0xFFF3
movw %ax, 0x24(%rbx)
jmp 0x2c929
movq %rbx, %rdi
callq 0x11022
movzwl 0x24(%rbx), %eax
testb $0x8, %al
jne 0x2c930
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movsd 0x10(%rbx), %xmm0
movapd 0x4ca43(%rip), %xmm1    # 0x79380
andpd %xmm0, %xmm1
ucomisd 0x4c95f(%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 0x2c929
jp 0x2c929
addq %rdx, %rcx
incq %rcx
cmpq $0x2, %rcx
jb 0x2c929
orl $0x4, %eax
jmp 0x2c913
// File: /workspace/github_c_makefile_star2_O3/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
movzwl 0x24(%rdi), %eax
testb $0xd, %al
jne 0x2ca2b
movq 0x8(%rbx), %rdi
leaq 0x18(%rbx), %rsi
movl 0x20(%rbx), %edx
movzbl 0x27(%rbx), %ecx
callq 0x16fda
testl %eax, %eax
je 0x2ca20
movq %rbx, %rdi
callq 0xee52
movsd %xmm0, 0x10(%rbx)
movl $0xffffbe00, %eax       # imm = 0xFFFFBE00
andl 0x24(%rbx), %eax
movapd 0x4c9b5(%rip), %xmm1    # 0x79380
andpd %xmm0, %xmm1
ucomisd 0x4c8d1(%rip), %xmm1    # 0x792a8
cvttsd2si %xmm0, %rcx
movabsq $-0x8000000000000000, %rdx # imm = 0x8000000000000000
cmovaq %rdx, %rcx
xorps %xmm1, %xmm1
cvtsi2sd %rcx, %xmm1
movq %rcx, 0x18(%rbx)
ucomisd %xmm1, %xmm0
setnp %sil
sete %dil
andb %sil, %dil
addq %rdx, %rcx
incq %rcx
cmpq $0x2, %rcx
setae %cl
andb %dil, %cl
movzbl %cl, %ecx
leal (%rax,%rcx,4), %eax
addl $0x8, %eax
jmp 0x2ca2b
movl $0xffffbe00, %eax       # imm = 0xFFFFBE00
andl 0x24(%rbx), %eax
orl $0x4, %eax
andl $0xffed, %eax           # imm = 0xFFED
movw %ax, 0x24(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x2ccab
movq (%rbx), %rdi
movq 0x48(%rbx), %rdx
leaq -0x1c(%rbp), %r8
xorl %esi, %esi
xorl %ecx, %ecx
callq 0x2d79a
movl %eax, %r14d
testl %eax, %eax
jne 0x2ccf8
movq 0x48(%rbx), %rax
movq %rax, 0x50(%rbx)
cmpl $0x0, -0x1c(%rbp)
je 0x2cce6
leaq 0x4cb89(%rip), %rsi     # 0x79814
leaq 0x4c8a7(%rip), %rcx     # 0x79539
movl $0xb, %r14d
movl $0xb, %edi
movl $0xf465, %edx           # imm = 0xF465
xorl %eax, %eax
callq 0xb9c7
jmp 0x2ccf8
movq (%rbx), %r15
testq %r15, %r15
je 0x2ccf5
movb 0x77(%r15), %al
cmpb $0x3, %al
jb 0x2ccce
movq %r15, %rdi
callq 0x30735
movl %eax, %r14d
testl %eax, %eax
jne 0x2ccf8
movb 0x77(%r15), %al
cmpb $0x1, %al
jne 0x2ccd9
cmpl $0x0, 0x70(%r15)
je 0x2ccf5
movl $0x0, 0x64(%rbx)
movb $0x1, 0x28(%rbx)
jmp 0x2ccf5
movb $0x1, 0x25(%rbx)
movb $0x0, 0x29(%rbx)
movl $0x0, 0x64(%rbx)
xorl %r14d, %r14d
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x2cd5a
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 0x2121e
movb $0x1, 0x76(%r14)
movl 0x50(%r14), %eax
movl %eax, (%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x2cda7
xorl %edx, %edx
testl %ecx, %ecx
sete %dl
leaq -0x2c(%rbp), %rsi
movq %r12, %rdi
callq 0x30863
movq %rax, %r13
jmp 0x2cdaa
xorl %r13d, %r13d
leal (%r14,%r15), %eax
cmpl -0x2c(%rbp), %eax
jg 0x2cdd5
testb $0x4, 0x25(%rbx)
jne 0x2cdd5
movq %rbx, %rdi
callq 0xecfd
movslq %r15d, %rax
addq %rax, %r13
movq %r13, 0x8(%rbx)
movw $0x1010, 0x24(%rbx)     # imm = 0x1010
xorl %eax, %eax
jmp 0x2ce40
leal 0x2(%r14), %esi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x1034d
testl %eax, %eax
jne 0x2ce40
movl $0x40610, 0x24(%rbx)    # imm = 0x40610
movq 0x8(%rbx), %rcx
cmpl $0x0, -0x30(%rbp)
je 0x2ce0b
movq %r12, %rdi
movl %r15d, %esi
movl %r14d, %edx
xorl %r8d, %r8d
callq 0x21511
jmp 0x2ce19
movq %r12, %rdi
movl %r15d, %esi
movl %r14d, %edx
callq 0x122fe
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 0x2ce40
movq %rbx, %rdi
callq 0xecfd
movl %r15d, %eax
movl %r14d, 0x20(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq