LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x2e53e
cmpl $0x0, -0xc(%rbp)
je 0x2e53e
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movb 0x50(%rax), %al
movb %al, -0x21(%rbp)
movq -0x20(%rbp), %rax
cmpq $0x0, 0x328(%rax)
je 0x2e4b8
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
cmpq -0x18(%rbp), %rax
jae 0x2e4b3
movq -0x20(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rsi
callq 0x9cd0
movq -0x8(%rbp), %rax
addq $0x38, %rax
movq %rax, -0x8(%rbp)
jmp 0x2e48a
jmp 0x2e53e
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
cmpq -0x18(%rbp), %rax
jae 0x2e534
movq -0x8(%rbp), %rax
movzwl 0x24(%rax), %eax
andl $0x2460, %eax           # imm = 0x2460
cmpl $0x0, %eax
je 0x2e4f2
movq -0x8(%rbp), %rdi
callq 0x10190
jmp 0x2e51c
movq -0x8(%rbp), %rax
cmpq $0x0, 0x30(%rax)
je 0x2e51a
movq -0x20(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rsi
callq 0x9cd0
movq -0x8(%rbp), %rax
movq $0x0, 0x30(%rax)
jmp 0x2e51c
movq -0x8(%rbp), %rax
movw $0x80, 0x24(%rax)
movq -0x8(%rbp), %rax
addq $0x38, %rax
movq %rax, -0x8(%rbp)
jmp 0x2e4cb
movb -0x21(%rbp), %cl
movq -0x20(%rbp), %rax
movb %cl, 0x50(%rax)
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x2e5b3
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
movslq -0x14(%rbp), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
cmpq %rcx, %rax
jae 0x2e5b1
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movsbl 0x1(%rax), %esi
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rdx
callq 0x2e5d0
movq -0x20(%rbp), %rax
addq $0x18, %rax
movq %rax, -0x20(%rbp)
jmp 0x2e572
jmp 0x2e5b3
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x9cd0
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: 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
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x2e6ad
movl -0xc(%rbp), %eax
addl $0x10, %eax
movl %eax, %ecx
movq %rcx, -0x28(%rbp)
subl $0xf, %eax
ja 0x2e6ab
movq -0x28(%rbp), %rax
leaq 0x7aebe(%rip), %rcx     # 0xa94cc
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x9cd0
jmp 0x2e6ab
movq -0x8(%rbp), %rax
cmpq $0x0, 0x328(%rax)
jne 0x2e640
movq -0x18(%rbp), %rdi
callq 0xa420
jmp 0x2e6ab
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x2e6c0
jmp 0x2e6ab
movq -0x8(%rbp), %rax
cmpq $0x0, 0x328(%rax)
jne 0x2e66a
movq -0x18(%rbp), %rdi
callq 0x17020
jmp 0x2e690
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x30(%rax), %rsi
callq 0x9cd0
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x9cd0
jmp 0x2e6ab
movq -0x8(%rbp), %rax
cmpq $0x0, 0x328(%rax)
jne 0x2e6a9
movq -0x18(%rbp), %rdi
callq 0x2e700
jmp 0x2e6ab
jmp 0x2e6ad
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movl 0x18(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x18(%rax)
movq -0x8(%rbp), %rax
cmpl $0x0, 0x18(%rax)
jne 0x2e75f
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x2e752
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq 0x20(%rax), %rax
movq -0x18(%rbp), %rdi
callq *%rax
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
callq 0x9cd0
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: 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:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
jne 0x2e788
jmp 0x2e813
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
callq 0x9b90
movq -0x8(%rbp), %rax
cmpq $0x0, 0x60(%rax)
je 0x2e7c1
movq -0x8(%rbp), %rax
movq 0x68(%rax), %rcx
movq -0x8(%rbp), %rax
movq 0x60(%rax), %rax
movq %rcx, 0x68(%rax)
jmp 0x2e7d1
movq -0x8(%rbp), %rax
movq 0x68(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x68(%rax)
je 0x2e7f0
movq -0x8(%rbp), %rax
movq 0x60(%rax), %rcx
movq -0x8(%rbp), %rax
movq 0x68(%rax), %rax
movq %rcx, 0x60(%rax)
movq -0x8(%rbp), %rax
movl $0xb606c3c8, 0x50(%rax) # imm = 0xB606C3C8
movq -0x8(%rbp), %rax
movq $0x0, (%rax)
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
callq 0x9cd0
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movl 0x94(%rax), %eax
movl %eax, -0x14(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x58(%rax)
je 0x2ede2
movq -0x10(%rbp), %rax
movb 0x50(%rax), %al
movb %al, -0x15(%rbp)
callq 0x241b0
movq -0x10(%rbp), %rax
movq 0x130(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rdx
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movl $0x1, %ecx
movq $-0x1, %r8
callq 0x16fd0
callq 0x24200
movb -0x15(%rbp), %cl
movq -0x10(%rbp), %rax
movb %cl, 0x50(%rax)
movl -0x14(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x44(%rax)
jmp 0x2edf4
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
xorl %eax, %eax
movl %eax, %edx
movb $0x0, %al
callq 0xd720
movl -0x14(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: Cleanup
static void Cleanup(Vdbe *p){
  sqlite3 *db = p->db;

#ifdef SQLITE_DEBUG
  /* Execute assert() statements to ensure that the Vdbe.apCsr[] and 
  ** Vdbe.aMem[] arrays have already been cleaned up.  */
  int i;
  if( p->apCsr ) for(i=0; i<p->nCursor; i++) assert( p->apCsr[i]==0 );
  if( p->aMem ){
    for(i=1; i<=p->nMem; i++) assert( p->aMem[i].flags==MEM_Invalid );
  }
#endif

  sqlite3DbFree(db, p->zErrMsg);
  p->zErrMsg = 0;
  p->pResultSet = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rsi
callq 0x9cd0
movq -0x8(%rbp), %rax
movq $0x0, 0x58(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x28(%rax)
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: closeAllCursors
static void closeAllCursors(Vdbe *p){
  if( p->pFrame ){
    VdbeFrame *pFrame;
    for(pFrame=p->pFrame; pFrame->pParent; pFrame=pFrame->pParent);
    sqlite3VdbeFrameRestore(pFrame);
  }
  p->pFrame = 0;
  p->nFrame = 0;

  if( p->apCsr ){
    int i;
    for(i=0; i<p->nCursor; i++){
      VdbeCursor *pC = p->apCsr[i];
      if( pC ){
        sqlite3VdbeFreeCursor(p, pC);
        p->apCsr[i] = 0;
      }
    }
  }
  if( p->aMem ){
    releaseMemArray(&p->aMem[1], p->nMem);
  }
  while( p->pDelFrame ){
    VdbeFrame *pDel = p->pDelFrame;
    p->pDelFrame = pDel->pParent;
    sqlite3VdbeFrameDelete(pDel);
  }

  /* Delete any auxdata allocations made by the VM */
  sqlite3VdbeDeleteAuxData(p, -1, 0);
  assert( p->pAuxData==0 );
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, 0xf0(%rax)
je 0x2ee9d
movq -0x8(%rbp), %rax
movq 0xf0(%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x2ee94
jmp 0x2ee86
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x10(%rbp)
jmp 0x2ee79
movq -0x10(%rbp), %rdi
callq 0x2fab0
movq -0x8(%rbp), %rax
movq $0x0, 0xf0(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x100(%rax)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x70(%rax)
je 0x2ef23
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x4c(%rcx), %eax
jge 0x2ef21
movq -0x8(%rbp), %rax
movq 0x70(%rax), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x2ef14
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x2fb70
movq -0x8(%rbp), %rax
movq 0x70(%rax), %rax
movslq -0x14(%rbp), %rcx
movq $0x0, (%rax,%rcx,8)
jmp 0x2ef16
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x2eecc
jmp 0x2ef23
movq -0x8(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x2ef46
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
addq $0x38, %rdi
movq -0x8(%rbp), %rax
movl 0x30(%rax), %esi
callq 0x2e430
jmp 0x2ef48
movq -0x8(%rbp), %rax
cmpq $0x0, 0xf8(%rax)
je 0x2ef83
movq -0x8(%rbp), %rax
movq 0xf8(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0xf8(%rax)
movq -0x28(%rbp), %rdi
callq 0x2fc40
jmp 0x2ef48
movq -0x8(%rbp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x2fcd0
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl $0x0, -0x14(%rbp)
callq 0x241b0
movq -0x8(%rbp), %rdi
callq 0x9890
movl $0x0, -0x10(%rbp)
movl -0x10(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x28(%rcx), %eax
jge 0x2f027
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x10(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x2f01a
movq -0x20(%rbp), %rdi
callq 0x30220
cmpl $0x0, %eax
je 0x2f00e
movl $0x1, -0x14(%rbp)
movq -0x20(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0xf800
jmp 0x2f01c
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x2efcb
movq -0x8(%rbp), %rdi
callq 0x30250
callq 0x24200
movq -0x8(%rbp), %rax
movl 0x2c(%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x2f066
movq -0x8(%rbp), %rax
movzbl 0x99(%rax), %eax
cmpl $0x0, %eax
jne 0x2f066
movq -0x8(%rbp), %rdi
callq 0x14a20
movq -0x8(%rbp), %rdi
callq 0xedb0
movq -0x8(%rbp), %rax
movq $0x0, 0x318(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x320(%rax)
movq -0x8(%rbp), %rax
movl 0x2c(%rax), %ecx
andl $0xfeffffff, %ecx       # imm = 0xFEFFFFFF
movl %ecx, 0x2c(%rax)
movq -0x8(%rbp), %rax
cmpq $0x0, 0xf0(%rax)
je 0x2f0ca
cmpl $0x0, -0x14(%rbp)
jne 0x2f0b2
movq -0x8(%rbp), %rax
cmpb $0x0, 0x4e(%rax)
jne 0x2f0ca
movq -0x8(%rbp), %rax
movq 0xf0(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0xe8(%rcx), %rdi
callq *%rax
addq $0x20, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x300(%rax)
je 0x2f11b
movq -0x8(%rbp), %rax
movq 0x300(%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x300(%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x9cd0
jmp 0x2f0dc
movq -0x8(%rbp), %rax
movl $0x0, 0x30c(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x310(%rax)
movq -0x8(%rbp), %rax
movb $0x0, 0x55(%rax)
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: 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:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
cmpl $0x0, -0x14(%rbp)
je 0x2f18c
movq -0x20(%rbp), %rax
movq 0x318(%rax), %rax
movq -0x20(%rbp), %rcx
addq 0x320(%rcx), %rax
cmpq $0x0, %rax
jg 0x2f1a0
cmpl $0x0, -0x14(%rbp)
jne 0x2f1dc
movq -0x10(%rbp), %rax
cmpq $0x0, 0xc8(%rax)
jle 0x2f1dc
movq -0x10(%rbp), %rax
movl $0x313, 0x94(%rax)      # imm = 0x313
movq -0x10(%rbp), %rax
movb $0x2, 0x98(%rax)
movq -0x10(%rbp), %rdi
addq $0x58, %rdi
movq -0x20(%rbp), %rsi
leaq 0x7f1b5(%rip), %rdx     # 0xae381
movb $0x0, %al
callq 0x30360
movl $0x1, -0x4(%rbp)
jmp 0x2f1e3
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3VdbeFrameRestore
SQLITE_PRIVATE int sqlite3VdbeFrameRestore(VdbeFrame *pFrame){
  Vdbe *v = pFrame->v;
  v->aOnceFlag = pFrame->aOnceFlag;
  v->nOnceFlag = pFrame->nOnceFlag;
  v->aOp = pFrame->aOp;
  v->nOp = pFrame->nOp;
  v->aMem = pFrame->aMem;
  v->nMem = pFrame->nMem;
  v->apCsr = pFrame->apCsr;
  v->nCursor = pFrame->nCursor;
  v->db->lastRowid = pFrame->lastRowid;
  v->nChange = pFrame->nChange;
  return pFrame->pc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x118(%rax)
movq -0x8(%rbp), %rax
movl 0x50(%rax), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x110(%rax)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rax
movl 0x48(%rax), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x34(%rax)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x8(%rbp), %rax
movl 0x4c(%rax), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x30(%rax)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x70(%rax)
movq -0x8(%rbp), %rax
movl 0x40(%rax), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x4c(%rax)
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rcx
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rcx, 0x30(%rax)
movq -0x8(%rbp), %rax
movl 0x5c(%rax), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x9c(%rax)
movq -0x8(%rbp), %rax
movl 0x44(%rax), %eax
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x2fb8c
jmp 0x2fc33
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rsi
callq 0x2fda0
movq -0x10(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x2fbb6
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x2fe80
jmp 0x2fbce
movq -0x10(%rbp), %rax
cmpq $0x0, (%rax)
je 0x2fbcc
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x2ffb0
jmp 0x2fbce
movq -0x10(%rbp), %rax
cmpq $0x0, 0x30(%rax)
je 0x2fc33
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movw 0x9a(%rax), %cx
andw $-0xd, %cx
orw $0x4, %cx
movw %cx, 0x9a(%rax)
movq -0x20(%rbp), %rax
movq 0x38(%rax), %rax
movq -0x18(%rbp), %rdi
callq *%rax
movq -0x8(%rbp), %rax
movw 0x9a(%rax), %cx
andw $-0xd, %cx
orw $0x0, %cx
movw %cx, 0x9a(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3VdbeFrameDelete
SQLITE_PRIVATE void sqlite3VdbeFrameDelete(VdbeFrame *p){
  int i;
  Mem *aMem = VdbeFrameMem(p);
  VdbeCursor **apCsr = (VdbeCursor **)&aMem[p->nChildMem];
  for(i=0; i<p->nChildCsr; i++){
    sqlite3VdbeFreeCursor(p->v, apCsr[i]);
  }
  releaseMemArray(aMem, p->nChildMem);
  sqlite3DbFree(p->v->db, p);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x60, %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq -0x8(%rbp), %rcx
movslq 0x54(%rcx), %rcx
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movl $0x0, -0xc(%rbp)
movl -0xc(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x58(%rcx), %eax
jge 0x2fca5
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq -0x20(%rbp), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
callq 0x2fb70
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x2fc76
movq -0x18(%rbp), %rdi
movq -0x8(%rbp), %rax
movl 0x54(%rax), %esi
callq 0x2e430
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq (%rax), %rdi
movq -0x8(%rbp), %rsi
callq 0x9cd0
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq -0x8(%rbp), %rax
addq $0x120, %rax            # imm = 0x120
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
cmpq $0x0, (%rax)
je 0x2fd8d
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
cmpl $0x0, -0xc(%rbp)
jl 0x2fd3e
movq -0x20(%rbp), %rax
movl (%rax), %eax
cmpl -0xc(%rbp), %eax
jne 0x2fd7c
movq -0x20(%rbp), %rax
cmpl $0x1f, 0x4(%rax)
jg 0x2fd3e
movl -0x10(%rbp), %eax
movq -0x20(%rbp), %rcx
movl 0x4(%rcx), %ecx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
andl %ecx, %eax
cmpl $0x0, %eax
jne 0x2fd7c
movq -0x20(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x2fd5b
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x20(%rbp), %rcx
movq 0x8(%rcx), %rdi
callq *%rax
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq -0x20(%rbp), %rsi
callq 0x9cd0
jmp 0x2fd88
movq -0x20(%rbp), %rax
addq $0x18, %rax
movq %rax, -0x18(%rbp)
jmp 0x2fcf0
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3VdbeSorterClose
SQLITE_PRIVATE void sqlite3VdbeSorterClose(sqlite3 *db, VdbeCursor *pCsr){
  VdbeSorter *pSorter = pCsr->pSorter;
  if( pSorter ){
    if( pSorter->aIter ){
      int i;
      for(i=0; i<pSorter->nTree; i++){
        vdbeSorterIterZero(db, &pSorter->aIter[i]);
      }
      sqlite3DbFree(db, pSorter->aIter);
    }
    if( pSorter->pTemp1 ){
      sqlite3OsCloseFree(pSorter->pTemp1);
    }
    vdbeSorterRecordFree(db, pSorter->pRecord);
    sqlite3DbFree(db, pSorter->pUnpacked);
    sqlite3DbFree(db, pSorter);
    pCsr->pSorter = 0;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x2fe70
movq -0x18(%rbp), %rax
cmpq $0x0, 0x28(%rax)
je 0x2fe1d
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl 0x14(%rcx), %eax
jge 0x2fe0c
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rsi
movslq -0x1c(%rbp), %rax
shlq $0x6, %rax
addq %rax, %rsi
callq 0x30090
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x2fdd9
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rsi
callq 0x9cd0
movq -0x18(%rbp), %rax
cmpq $0x0, 0x38(%rax)
je 0x2fe35
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rdi
callq 0x300e0
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rsi
callq 0x30120
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rsi
callq 0x9cd0
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x9cd0
movq -0x10(%rbp), %rax
movq $0x0, 0x58(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: 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
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0xe0f0
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x2fee0
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x20(%rbp), %rax
movq (%rax), %rax
cmpq -0x8(%rbp), %rax
jne 0x2fede
movq -0x20(%rbp), %rdi
callq 0x2ffb0
jmp 0x2fead
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0xf800
movq -0x8(%rbp), %rax
cmpb $0x0, 0x11(%rax)
je 0x2ff03
movq -0x10(%rbp), %rdi
callq 0x30170
cmpl $0x0, %eax
je 0x2ff5a
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x20c30
movq -0x10(%rbp), %rax
cmpq $0x0, 0x48(%rax)
je 0x2ff37
movq -0x10(%rbp), %rax
cmpq $0x0, 0x40(%rax)
je 0x2ff37
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x40(%rcx), %rdi
callq *%rax
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rsi
xorl %eax, %eax
movl %eax, %edi
callq 0x9cd0
movq -0x10(%rbp), %rdi
callq 0x2a000
movq -0x10(%rbp), %rdi
callq 0xa420
movq -0x8(%rbp), %rax
cmpq $0x0, 0x28(%rax)
je 0x2ff79
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rcx
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movq %rcx, 0x20(%rax)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x20(%rax)
je 0x2ff98
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rcx
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movq %rcx, 0x28(%rax)
movq -0x8(%rbp), %rdi
callq 0xa420
xorl %eax, %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x30088
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rdi
callq 0xe0f0
movq -0x8(%rbp), %rdi
callq 0x2e3f0
movq -0x8(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x30011
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rcx
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq %rcx, 0x10(%rax)
jmp 0x30021
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x30040
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rcx
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq %rcx, 0x18(%rax)
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
movq -0x8(%rbp), %rcx
movswl 0x7a(%rcx), %ecx
cmpl %ecx, %eax
jg 0x30076
movq -0x8(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq 0xa8(%rax,%rcx,8), %rdi
callq 0x29fd0
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x30047
movq -0x20(%rbp), %rdi
callq 0x29920
movq -0x8(%rbp), %rdi
callq 0x2bdd0
xorl %eax, %eax
addq $0x20, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3OsCloseFree
SQLITE_PRIVATE int sqlite3OsCloseFree(sqlite3_file *pFile){
  int rc = SQLITE_OK;
  assert( pFile );
  rc = sqlite3OsClose(pFile);
  sqlite3_free(pFile);
  return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl $0x0, -0xc(%rbp)
movq -0x8(%rbp), %rdi
callq 0x20ea0
movl %eax, -0xc(%rbp)
movq -0x8(%rbp), %rdi
callq 0xa420
movl -0xc(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: vdbeSorterRecordFree
static void vdbeSorterRecordFree(sqlite3 *db, SorterRecord *pRecord){
  SorterRecord *p;
  SorterRecord *pNext;
  for(p=pRecord; p; p=pNext){
    pNext = p->pNext;
    sqlite3DbFree(db, p);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x30162
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x9cd0
movq -0x20(%rbp), %rax
movq %rax, -0x18(%rbp)
jmp 0x30138
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: removeFromSharingList
static int removeFromSharingList(BtShared *pBt){
#ifndef SQLITE_OMIT_SHARED_CACHE
  MUTEX_LOGIC( sqlite3_mutex *pMaster; )
  BtShared *pList;
  int removed = 0;

  assert( sqlite3_mutex_notheld(pBt->mutex) );
  MUTEX_LOGIC( pMaster = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER); )
  sqlite3_mutex_enter(pMaster);
  pBt->nRef--;
  if( pBt->nRef<=0 ){
    if( GLOBAL(BtShared*,sqlite3SharedCacheList)==pBt ){
      GLOBAL(BtShared*,sqlite3SharedCacheList) = pBt->pNext;
    }else{
      pList = GLOBAL(BtShared*,sqlite3SharedCacheList);
      while( ALWAYS(pList) && pList->pNext!=pBt ){
        pList=pList->pNext;
      }
      if( ALWAYS(pList) ){
        pList->pNext = pBt->pNext;
      }
    }
    if( SQLITE_THREADSAFE ){
      sqlite3_mutex_free(pBt->mutex);
    }
    removed = 1;
  }
  sqlite3_mutex_leave(pMaster);
  return removed;
#else
  return 1;
#endif
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movl $0x0, -0x14(%rbp)
movq -0x8(%rbp), %rax
movl 0x60(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x60(%rax)
movq -0x8(%rbp), %rax
cmpl $0x0, 0x60(%rax)
jg 0x30214
movq 0xa1edb(%rip), %rax     # 0xd2078
cmpq -0x8(%rbp), %rax
jne 0x301b4
movq -0x8(%rbp), %rax
movq 0x68(%rax), %rax
movq %rax, 0xa1ec6(%rip)     # 0xd2078
jmp 0x3020d
movq 0xa1ebd(%rip), %rax     # 0xd2078
movq %rax, -0x10(%rbp)
xorl %eax, %eax
cmpq $0x0, -0x10(%rbp)
movb %al, -0x15(%rbp)
je 0x301dd
movq -0x10(%rbp), %rax
movq 0x68(%rax), %rax
cmpq -0x8(%rbp), %rax
setne %al
movb %al, -0x15(%rbp)
movb -0x15(%rbp), %al
testb $0x1, %al
jne 0x301e6
jmp 0x301f4
movq -0x10(%rbp), %rax
movq 0x68(%rax), %rax
movq %rax, -0x10(%rbp)
jmp 0x301bf
cmpq $0x0, -0x10(%rbp)
je 0x3020b
movq -0x8(%rbp), %rax
movq 0x68(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x68(%rax)
jmp 0x3020d
movl $0x1, -0x14(%rbp)
movl -0x14(%rbp), %eax
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x1c8(%rax)
je 0x30357
movl $0x0, -0x10(%rbp)
movl -0x10(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x1a4(%rcx), %eax
jge 0x30326
movq -0x8(%rbp), %rax
movq 0x1c8(%rax), %rax
movslq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x30307
movq -0x20(%rbp), %rax
movq (%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x30305
movq -0x28(%rbp), %rax
movq -0x20(%rbp), %rdi
callq *%rax
jmp 0x30307
movq -0x18(%rbp), %rax
movl $0x0, 0x20(%rax)
movq -0x18(%rbp), %rdi
callq 0x2e700
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x302a8
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x1c8(%rax), %rsi
callq 0x9cd0
movq -0x8(%rbp), %rax
movl $0x0, 0x1a4(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x1c8(%rax)
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0xf0, %rsp
testb %al, %al
je 0x3039b
movaps %xmm0, -0xc0(%rbp)
movaps %xmm1, -0xb0(%rbp)
movaps %xmm2, -0xa0(%rbp)
movaps %xmm3, -0x90(%rbp)
movaps %xmm4, -0x80(%rbp)
movaps %xmm5, -0x70(%rbp)
movaps %xmm6, -0x60(%rbp)
movaps %xmm7, -0x50(%rbp)
movq %r9, -0xc8(%rbp)
movq %r8, -0xd0(%rbp)
movq %rcx, -0xd8(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
leaq -0xf0(%rbp), %rax
movq %rax, -0x20(%rbp)
leaq 0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
movl $0x30, -0x2c(%rbp)
movl $0x18, -0x30(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
leaq -0x30(%rbp), %rdx
callq 0x1f730
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rax
movq (%rax), %rsi
callq 0x9cd0
movq -0x38(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
addq $0xf0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3VtabSync
SQLITE_PRIVATE int sqlite3VtabSync(sqlite3 *db, Vdbe *p){
  int i;
  int rc = SQLITE_OK;
  VTable **aVTrans = db->aVTrans;

  db->aVTrans = 0;
  for(i=0; rc==SQLITE_OK && i<db->nVTrans; i++){
    int (*x)(sqlite3_vtab *);
    sqlite3_vtab *pVtab = aVTrans[i]->pVtab;
    if( pVtab && (x = pVtab->pModule->xSync)!=0 ){
      rc = x(pVtab);
      sqlite3VtabImportErrmsg(p, pVtab);
    }
  }
  db->aVTrans = aVTrans;
  return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x1c8(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq $0x0, 0x1c8(%rax)
movl $0x0, -0x14(%rbp)
xorl %eax, %eax
cmpl $0x0, -0x18(%rbp)
movb %al, -0x31(%rbp)
jne 0x3047a
movl -0x14(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x1a4(%rcx), %eax
setl %al
movb %al, -0x31(%rbp)
movb -0x31(%rbp), %al
testb $0x1, %al
jne 0x30483
jmp 0x304da
movq -0x20(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x10(%rax), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x304cd
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq 0x78(%rax), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, %rax
je 0x304cd
movq -0x28(%rbp), %rax
movq -0x30(%rbp), %rdi
callq *%rax
movl %eax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x30620
jmp 0x304cf
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x3045c
movq -0x20(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x1c8(%rax)
movl -0x18(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq %r8, -0x28(%rbp)
movl $0x7, -0x2c(%rbp)
movq -0x8(%rbp), %rax
movl 0x4(%rax), %edi
callq 0xd860
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
je 0x305a2
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x38(%rbp), %rdx
movl -0x1c(%rbp), %ecx
movq -0x28(%rbp), %r8
callq 0x20df0
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
je 0x30595
movq -0x38(%rbp), %rdi
callq 0xa420
jmp 0x305a0
movq -0x38(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
jmp 0x305a2
movl -0x2c(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3BtreeSyncDisabled
SQLITE_PRIVATE int sqlite3BtreeSyncDisabled(Btree *p){
  BtShared *pBt = p->pBt;
  int rc;
  assert( sqlite3_mutex_held(p->db->mutex) );  
  sqlite3BtreeEnter(p);
  assert( pBt && pBt->pPager );
  rc = sqlite3PagerNosync(pBt->pPager);
  sqlite3BtreeLeave(p);
  return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0xe0f0
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x306b0
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rsi
callq 0x9cd0
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rsi
callq 0x11720
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x58(%rax)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0xa420
movq -0x10(%rbp), %rax
movq $0x0, 0x10(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: 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
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x3077e
movq -0x8(%rbp), %rax
movzbl 0x10(%rax), %eax
cmpl $0x2, %eax
jne 0x3077e
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
callq 0xe0f0
movq -0x20(%rbp), %rax
movq (%rax), %rdi
movl -0xc(%rbp), %esi
movl -0x10(%rbp), %edx
callq 0x26bf0
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jne 0x3077c
cmpl $0x0, -0x10(%rbp)
jge 0x30752
movq -0x20(%rbp), %rax
movzwl 0x26(%rax), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0x30752
movq -0x20(%rbp), %rax
movl $0x0, 0x3c(%rax)
movq -0x20(%rbp), %rdi
callq 0x297b0
movl %eax, -0x14(%rbp)
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x50(%rax), %rdi
addq $0x1c, %rdi
callq 0x20a50
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x3c(%rax)
jmp 0x3077e
movl -0x14(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: 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:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x1c8(%rax)
je 0x308b9
movl $0x0, -0x18(%rbp)
xorl %eax, %eax
cmpl $0x0, -0x14(%rbp)
movb %al, -0x31(%rbp)
jne 0x307e0
movl -0x18(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x1a4(%rcx), %eax
setl %al
movb %al, -0x31(%rbp)
movb -0x31(%rbp), %al
testb $0x1, %al
jne 0x307ec
jmp 0x308b7
movq -0x8(%rbp), %rax
movq 0x1c8(%rax), %rax
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x308a7
movq -0x28(%rbp), %rax
cmpl $0x2, (%rax)
jl 0x308a7
movl -0xc(%rbp), %eax
movl %eax, -0x38(%rbp)
testl %eax, %eax
je 0x30840
jmp 0x30836
movl -0x38(%rbp), %eax
subl $0x2, %eax
je 0x3085e
jmp 0x3086f
movq -0x28(%rbp), %rax
movq 0xa0(%rax), %rax
movq %rax, -0x30(%rbp)
movl -0x10(%rbp), %ecx
addl $0x1, %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x20(%rax)
jmp 0x3087e
movq -0x28(%rbp), %rax
movq 0xb0(%rax), %rax
movq %rax, -0x30(%rbp)
jmp 0x3087e
movq -0x28(%rbp), %rax
movq 0xa8(%rax), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x308a5
movq -0x20(%rbp), %rax
movl 0x20(%rax), %eax
cmpl -0x10(%rbp), %eax
jle 0x308a5
movq -0x30(%rbp), %rax
movq -0x20(%rbp), %rcx
movq 0x10(%rcx), %rdi
movl -0x10(%rbp), %esi
callq *%rax
movl %eax, -0x14(%rbp)
jmp 0x308a7
jmp 0x308a9
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x307c2
jmp 0x308b9
movl -0x14(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3VdbeChangeEncoding
SQLITE_PRIVATE int sqlite3VdbeChangeEncoding(Mem *pMem, int desiredEnc){
#ifndef SQLITE_OMIT_UTF16
  int rc;
#endif
  assert( (pMem->flags&MEM_RowSet)==0 );
  assert( desiredEnc==SQLITE_UTF8 || desiredEnc==SQLITE_UTF16LE
           || desiredEnc==SQLITE_UTF16BE );
  if( !(pMem->flags&MEM_Str) || pMem->enc==desiredEnc ){
    return SQLITE_OK;
  }
  assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) );
#ifdef SQLITE_OMIT_UTF16
  return SQLITE_ERROR;
#else

  /* MemTranslate() may return SQLITE_OK or SQLITE_NOMEM. If NOMEM is returned,
  ** then the encoding of the value may not have changed.
  */
  rc = sqlite3VdbeMemTranslate(pMem, (u8)desiredEnc);
  assert(rc==SQLITE_OK    || rc==SQLITE_NOMEM);
  assert(rc==SQLITE_OK    || pMem->enc!=desiredEnc);
  assert(rc==SQLITE_NOMEM || pMem->enc==desiredEnc);
  return rc;
#endif
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq -0x10(%rbp), %rax
movzwl 0x24(%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x312cc
movq -0x10(%rbp), %rax
movzbl 0x27(%rax), %eax
cmpl -0x14(%rbp), %eax
jne 0x312d5
movl $0x0, -0x4(%rbp)
jmp 0x312ed
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %eax
movzbl %al, %esi
callq 0x31570
movl %eax, -0x18(%rbp)
movl -0x18(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)