LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3GetInt32
SQLITE_PRIVATE int sqlite3GetInt32(const char *zNum, int *pValue){
  sqlite_int64 v = 0;
  int i, c;
  int neg = 0;
  if( zNum[0]=='-' ){
    neg = 1;
    zNum++;
  }else if( zNum[0]=='+' ){
    zNum++;
  }
  while( zNum[0]=='0' ) zNum++;
  for(i=0; i<11 && (c = zNum[i] - '0')>=0 && c<=9; i++){
    v = v*10 + c;
  }

  /* The longest decimal representation of a 32 bit integer is 10 digits:
  **
  **             1234567890
  **     2^31 -> 2147483648
  */
  testcase( i==10 );
  if( i>10 ){
    return 0;
  }
  testcase( v-neg==2147483647 );
  if( v-neg>2147483647 ){
    return 0;
  }
  if( neg ){
    v = -v;
  }
  *pValue = (int)v;
  return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movb (%rdi), %al
leal -0x2b(%rax), %ecx
andb $-0x3, %cl
cmpb $0x1, %cl
adcq $0x0, %rdi
cmpb $0x30, (%rdi)
leaq 0x1(%rdi), %rdi
je 0x33f6e
xorl %ecx, %ecx
cmpb $0x2d, %al
sete %cl
negq %rcx
movq $-0xb, %r8
xorl %edx, %edx
movzbl 0xa(%rdi,%r8), %r9d
leal -0x30(%r9), %r10d
cmpb $0x9, %r10b
ja 0x33fad
leaq (%rdx,%rdx,4), %rdx
andl $0xf, %r9d
leaq (%r9,%rdx,2), %rdx
incq %r8
jne 0x33f8a
jmp 0x33fb9
addq %rdx, %rcx
cmpq $0x7fffffff, %rcx       # imm = 0x7FFFFFFF
jle 0x33fbd
xorl %eax, %eax
jmp 0x33fcd
movl %edx, %ecx
negl %ecx
cmpb $0x2d, %al
cmovnel %edx, %ecx
movl %ecx, (%rsi)
movl $0x1, %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3MAppendf
SQLITE_PRIVATE char *sqlite3MAppendf(sqlite3 *db, char *zStr, const char *zFormat, ...){
  va_list ap;
  char *z;
  va_start(ap, zFormat);
  z = sqlite3VMPrintf(db, zFormat, ap);
  va_end(ap);
  sqlite3DbFree(db, zStr);
  return z;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0xc8, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq -0xe0(%rbp), %rsi
movq %rcx, 0x18(%rsi)
movq %r8, 0x20(%rsi)
movq %r9, 0x28(%rsi)
testb %al, %al
je 0x34025
movaps %xmm0, -0xb0(%rbp)
movaps %xmm1, -0xa0(%rbp)
movaps %xmm2, -0x90(%rbp)
movaps %xmm3, -0x80(%rbp)
movaps %xmm4, -0x70(%rbp)
movaps %xmm5, -0x60(%rbp)
movaps %xmm6, -0x50(%rbp)
movaps %xmm7, -0x40(%rbp)
leaq -0x30(%rbp), %rax
movq %rsi, 0x10(%rax)
leaq 0x10(%rbp), %rcx
movq %rcx, 0x8(%rax)
movabsq $0x3000000018, %rcx     # imm = 0x3000000018
movq %rcx, (%rax)
movq %rdx, %rsi
movq %rax, %rdx
callq 0x194ed
movq %rax, %r15
movq %r14, %rdi
movq %rbx, %rsi
callq 0x9ca4
movq %r15, %rax
addq $0xc8, %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: sqlite3HashFind
SQLITE_PRIVATE void *sqlite3HashFind(const Hash *pH, const char *pKey, int nKey){
  HashElem *elem;    /* The element that matches key */
  unsigned int h;    /* A hash on key */

  assert( pH!=0 );
  assert( pKey!=0 );
  assert( nKey>=0 );
  if( pH->ht ){
    h = strHash(pKey, nKey) % pH->htsize;
  }else{
    h = 0;
  }
  elem = findElementGivenHash(pH, pKey, nKey, h);
  return elem ? elem->data : 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edx, %r8d
cmpq $0x0, 0x10(%rdi)
je 0x340b6
testl %r8d, %r8d
jle 0x340ba
leal 0x1(%r8), %ecx
xorl %r10d, %r10d
leaq 0x42023(%rip), %rdx     # 0x760b0
movq %rsi, %r9
leal (,%r10,8), %eax
movzbl (%r9), %r11d
incq %r9
movzbl (%r11,%rdx), %r11d
xorl %r10d, %eax
xorl %r11d, %eax
decl %ecx
movl %eax, %r10d
cmpl $0x1, %ecx
ja 0x34090
jmp 0x340bc
xorl %ecx, %ecx
jmp 0x340c2
xorl %eax, %eax
xorl %edx, %edx
divl (%rdi)
movl %edx, %ecx
movl %r8d, %edx
callq 0x340d9
testq %rax, %rax
je 0x340d5
movq 0x10(%rax), %rax
jmp 0x340d7
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: findElementGivenHash
static HashElem *findElementGivenHash(
  const Hash *pH,     /* The pH to be searched */
  const char *pKey,   /* The key we are searching for */
  int nKey,           /* Bytes in key (not counting zero terminator) */
  unsigned int h      /* The hash for this key. */
){
  HashElem *elem;                /* Used to loop thru the element list */
  int count;                     /* Number of elements left to test */

  if( pH->ht ){
    struct _ht *pEntry = &pH->ht[h];
    elem = pEntry->chain;
    count = pEntry->count;
  }else{
    elem = pH->first;
    count = pH->count;
  }
  while( count-- && ALWAYS(elem) ){
    if( elem->nKey==nKey && sqlite3StrNICmp(elem->pKey,pKey,nKey)==0 ){ 
      return elem;
    }
    elem = elem->next;
  }
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
movq 0x10(%rdi), %rax
movl %ecx, %ecx
shlq $0x4, %rcx
addq %rax, %rcx
leaq 0x4(%rdi), %r8
testq %rax, %rax
cmovneq %rcx, %rdi
cmovneq %rcx, %r8
movl (%r8), %ecx
xorl %eax, %eax
testl %ecx, %ecx
je 0x3417f
movq 0x8(%rdi), %rdi
testq %rdi, %rdi
je 0x3417f
leal 0x1(%rdx), %r8d
xorl %eax, %eax
leaq 0x41f93(%rip), %r9      # 0x760b0
cmpl %edx, 0x20(%rdi)
jne 0x3416e
testl %edx, %edx
jle 0x3417c
movq 0x18(%rdi), %r10
xorl %r11d, %r11d
movl %r8d, %ebx
movzbl (%r10,%r11), %r14d
testq %r14, %r14
je 0x34159
movzbl (%r14,%r9), %r14d
movzbl (%rsi,%r11), %r15d
movb (%r15,%r9), %r15b
cmpb %r15b, %r14b
jne 0x34165
decl %ebx
incq %r11
cmpl $0x1, %ebx
ja 0x34130
jmp 0x3417c
movzbl (%rsi,%r11), %r10d
movb (%r10,%r9), %r15b
xorl %r14d, %r14d
movzbl %r15b, %r10d
cmpl %r10d, %r14d
je 0x3417c
decl %ecx
je 0x3417f
movq (%rdi), %rdi
testq %rdi, %rdi
jne 0x3411d
jmp 0x3417f
movq %rdi, %rax
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: sqlite3DefaultRowEst
SQLITE_PRIVATE void sqlite3DefaultRowEst(Index *pIdx){
  tRowcnt *a = pIdx->aiRowEst;
  int i;
  tRowcnt n;
  assert( a!=0 );
  a[0] = pIdx->pTable->nRowEst;
  if( a[0]<10 ) a[0] = 10;
  n = 10;
  for(i=1; i<=pIdx->nColumn; i++){
    a[i] = n;
    if( n>5 ) n--;
  }
  if( pIdx->onError!=OE_None ){
    a[pIdx->nColumn] = 1;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq 0x18(%rdi), %rax
movl 0x38(%rax), %ecx
cmpl $0xb, %ecx
movl $0xa, %edx
cmovbl %edx, %ecx
movq 0x10(%rdi), %rax
movl %ecx, (%rax)
movzwl 0x54(%rdi), %ecx
testq %rcx, %rcx
je 0x341bf
xorl %esi, %esi
movl %edx, 0x4(%rax,%rsi,4)
cmpl $0x6, %edx
adcl $-0x1, %edx
incq %rsi
cmpq %rsi, %rcx
jne 0x341ad
cmpb $0x0, 0x56(%rdi)
je 0x341cc
movl $0x1, (%rax,%rcx,4)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3FindTable
SQLITE_PRIVATE Table *sqlite3FindTable(sqlite3 *db, const char *zName, const char *zDatabase){
  Table *p = 0;
  int i;
  int nName;
  assert( zName!=0 );
  nName = sqlite3Strlen30(zName);
  /* All mutexes are required for schema access.  Make sure we hold them. */
  assert( zDatabase!=0 || sqlite3BtreeHoldsAllMutexes(db) );
  for(i=OMIT_TEMPDB; i<db->nDb; i++){
    int j = (i<2) ? i^1 : i;   /* Search TEMP before MAIN */
    if( zDatabase!=0 && sqlite3StrICmp(zDatabase, db->aDb[j].zName) ) continue;
    assert( sqlite3SchemaMutexHeld(db, j, 0) );
    p = sqlite3HashFind(&db->aDb[j].pSchema->tblHash, zName, nName);
    if( p ) break;
  }
  return p;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %rbx
movq %rsi, %r12
testq %rsi, %rsi
je 0x34208
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
movq %r12, %rax
incl %r15d
cmpb $0x0, (%rax)
leaq 0x1(%rax), %rax
jne 0x341f3
andl $0x3fffffff, %r15d      # imm = 0x3FFFFFFF
jmp 0x3420b
xorl %r15d, %r15d
movl 0x28(%rdi), %ecx
xorl %eax, %eax
movl %ecx, -0x2c(%rbp)
testl %ecx, %ecx
jle 0x342c1
movq 0x20(%rdi), %rax
movq %rax, -0x38(%rbp)
leaq 0x1(%rbx), %rax
movq %rax, -0x40(%rbp)
leaq 0x41e7e(%rip), %r14     # 0x760b0
xorl %r13d, %r13d
xorl %eax, %eax
cmpl $0x2, %r13d
setb %al
xorl %r13d, %eax
testq %rbx, %rbx
je 0x34291
movq %rax, %rcx
shlq $0x5, %rcx
movq -0x38(%rbp), %rdx
movq (%rdx,%rcx), %rcx
movb (%rbx), %dil
testb %dil, %dil
je 0x34281
movq -0x40(%rbp), %rdx
movzbl %dil, %r9d
movb (%r9,%r14), %dil
movzbl (%rcx), %r8d
cmpb (%r8,%r14), %dil
jne 0x34284
incq %rcx
movb (%rdx), %dil
incq %rdx
testb %dil, %dil
jne 0x34261
xorl %r9d, %r9d
movb (%r9,%r14), %dl
movzbl (%rcx), %ecx
cmpb (%rcx,%r14), %dl
jne 0x342b2
shlq $0x5, %rax
movq -0x38(%rbp), %rcx
movq 0x18(%rcx,%rax), %rdi
addq $0x8, %rdi
movq %r12, %rsi
movl %r15d, %edx
callq 0x3406c
testq %rax, %rax
jne 0x342c1
incl %r13d
cmpl -0x2c(%rbp), %r13d
jne 0x34235
xorl %eax, %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: analysisLoader
static int analysisLoader(void *pData, int argc, char **argv, char **NotUsed){
  analysisInfo *pInfo = (analysisInfo*)pData;
  Index *pIndex;
  Table *pTable;
  int i, c, n;
  tRowcnt v;
  const char *z;

  assert( argc==3 );
  UNUSED_PARAMETER2(NotUsed, argc);

  if( argv==0 || argv[0]==0 || argv[2]==0 ){
    return 0;
  }
  pTable = sqlite3FindTable(pInfo->db, argv[0], pInfo->zDatabase);
  if( pTable==0 ){
    return 0;
  }
  if( argv[1] ){
    pIndex = sqlite3FindIndex(pInfo->db, argv[1], pInfo->zDatabase);
  }else{
    pIndex = 0;
  }
  n = pIndex ? pIndex->nColumn : 0;
  z = argv[2];
  for(i=0; *z && i<=n; i++){
    v = 0;
    while( (c=z[0])>='0' && c<='9' ){
      v = v*10 + c - '0';
      z++;
    }
    if( i==0 && (pIndex==0 || pIndex->pPartIdxWhere==0) ){
      if( v>0 ) pTable->nRowEst = v;
      if( pIndex==0 ) break;
    }
    pIndex->aiRowEst[i] = v;
    if( *z==' ' ) z++;
    if( strcmp(z, "unordered")==0 ){
      pIndex->bUnordered = 1;
      break;
    }
  }
  return 0;
}

// Assembly:
testq %rdx, %rdx
je 0x343fd
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq (%rdx), %rsi
testq %rsi, %rsi
je 0x343ef
movq 0x10(%r14), %r15
testq %r15, %r15
je 0x343ef
movq (%rdi), %r13
movq 0x8(%rdi), %r12
movq %r13, %rdi
movq %r12, %rdx
callq 0x341ce
movq %rax, -0x30(%rbp)
testq %rax, %rax
je 0x343ef
movq 0x8(%r14), %rsi
movb $0x1, %bl
testq %rsi, %rsi
je 0x34349
movq %r13, %rdi
movq %r12, %rdx
callq 0x33e69
testq %rax, %rax
je 0x34349
movq %rax, %r14
movzwl 0x54(%rax), %r13d
xorl %ebx, %ebx
jmp 0x3434f
xorl %r14d, %r14d
xorl %r13d, %r13d
movb (%r15), %cl
testb %cl, %cl
je 0x343ef
xorl %r12d, %r12d
leal -0x30(%rcx), %eax
xorl %edx, %edx
cmpb $0x9, %al
ja 0x34386
movq %r15, %rax
movzbl %cl, %ecx
leal (%rdx,%rdx,4), %edx
leal (%rcx,%rdx,2), %edx
addl $-0x30, %edx
movb 0x1(%rax), %cl
incq %rax
leal -0x30(%rcx), %esi
cmpb $0xa, %sil
jb 0x34369
jmp 0x34389
movq %r15, %rax
testq %r12, %r12
jne 0x343a8
testb %bl, %bl
jne 0x34399
cmpq $0x0, 0x48(%r14)
jne 0x343a8
testl %edx, %edx
je 0x343a4
movq -0x30(%rbp), %rcx
movl %edx, 0x38(%rcx)
testb %bl, %bl
jne 0x343ef
movq 0x10(%r14), %rcx
movl %edx, (%rcx,%r12,4)
xorl %r15d, %r15d
cmpb $0x20, (%rax)
sete %r15b
addq %rax, %r15
movq %r15, %rdi
leaq 0x45cb6(%rip), %rsi     # 0x7a07d
callq 0x8530
testl %eax, %eax
je 0x343ea
movb (%r15), %cl
testb %cl, %cl
je 0x343ef
leaq 0x1(%r12), %rax
cmpq %r13, %r12
movq %rax, %r12
jb 0x3435d
jmp 0x343ef
orb $0x4, 0x57(%r14)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: insertElement
static void insertElement(
  Hash *pH,              /* The complete hash table */
  struct _ht *pEntry,    /* The entry into which pNew is inserted */
  HashElem *pNew         /* The element to be inserted */
){
  HashElem *pHead;       /* First element already in pEntry */
  if( pEntry ){
    pHead = pEntry->count ? pEntry->chain : 0;
    pEntry->count++;
    pEntry->chain = pNew;
  }else{
    pHead = 0;
  }
  if( pHead ){
    pNew->next = pHead;
    pNew->prev = pHead->prev;
    if( pHead->prev ){ pHead->prev->next = pNew; }
    else             { pH->first = pNew; }
    pHead->prev = pNew;
  }else{
    pNew->next = pH->first;
    if( pH->first ){ pH->first->prev = pNew; }
    pNew->prev = 0;
    pH->first = pNew;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
testq %rsi, %rsi
je 0x3474b
movl (%rsi), %ecx
testl %ecx, %ecx
je 0x34741
movq 0x8(%rsi), %rax
incl %ecx
movl %ecx, (%rsi)
movq %rdx, 0x8(%rsi)
testq %rax, %rax
je 0x3474b
movq %rax, (%rdx)
movq 0x8(%rax), %rcx
addq $0x8, %rax
movq %rcx, 0x8(%rdx)
addq $0x8, %rdi
testq %rcx, %rcx
cmovneq %rcx, %rdi
movq %rdx, (%rdi)
movq %rax, %rdi
jmp 0x34767
movl $0x1, (%rsi)
movq %rdx, 0x8(%rsi)
movq 0x8(%rdi), %rax
movq %rax, (%rdx)
testq %rax, %rax
je 0x3475b
movq %rdx, 0x8(%rax)
addq $0x8, %rdi
movq $0x0, 0x8(%rdx)
movq %rdx, (%rdi)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: freeIndex
static void freeIndex(sqlite3 *db, Index *p){
#ifndef SQLITE_OMIT_ANALYZE
  sqlite3DeleteIndexSamples(db, p);
#endif
  sqlite3ExprDelete(db, p->pPartIdxWhere);
  sqlite3DbFree(db, p->zColAff);
  sqlite3DbFree(db, p);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq 0x48(%rsi), %rsi
callq 0x3479d
movq 0x20(%rbx), %rsi
movq %r14, %rdi
callq 0x9ca4
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: sqlite3ExprDelete
SQLITE_PRIVATE void sqlite3ExprDelete(sqlite3 *db, Expr *p){
  if( p==0 ) return;
  /* Sanity check: Assert that the IntValue is non-negative if it exists */
  assert( !ExprHasProperty(p, EP_IntValue) || p->u.iValue>=0 );
  if( !ExprHasAnyProperty(p, EP_TokenOnly) ){
    sqlite3ExprDelete(db, p->pLeft);
    sqlite3ExprDelete(db, p->pRight);
    if( !ExprHasProperty(p, EP_Reduced) && (p->flags2 & EP2_MallocedToken)!=0 ){
      sqlite3DbFree(db, p->u.zToken);
    }
    if( ExprHasProperty(p, EP_xIsSelect) ){
      sqlite3SelectDelete(db, p->x.pSelect);
    }else{
      sqlite3ExprListDelete(db, p->x.pList);
    }
  }
  if( !ExprHasProperty(p, EP_Static) ){
    sqlite3DbFree(db, p);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
testq %rsi, %rsi
je 0x34822
movq %rsi, %rbx
movq %rdi, %r14
movzwl 0x2(%rsi), %eax
btl $0xe, %eax
jb 0x3480e
movq 0x10(%rbx), %rsi
movq %r14, %rdi
callq 0x3479d
movq 0x18(%rbx), %rsi
movq %r14, %rdi
callq 0x3479d
movzwl 0x2(%rbx), %eax
btl $0xd, %eax
jb 0x347f1
testb $0x1, 0x36(%rbx)
je 0x347f1
movq 0x8(%rbx), %rsi
movq %r14, %rdi
callq 0x9ca4
movzwl 0x2(%rbx), %eax
btl $0xb, %eax
movq 0x20(%rbx), %rsi
movq %r14, %rdi
jb 0x34805
callq 0x3484e
jmp 0x3480a
callq 0x34827
movzwl 0x2(%rbx), %eax
testw %ax, %ax
js 0x34822
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %rbp
jmp 0x9ca4
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3ExprListDelete
SQLITE_PRIVATE void sqlite3ExprListDelete(sqlite3 *db, ExprList *pList){
  int i;
  struct ExprList_item *pItem;
  if( pList==0 ) return;
  assert( pList->a!=0 || pList->nExpr==0 );
  for(pItem=pList->a, i=0; i<pList->nExpr; i++, pItem++){
    sqlite3ExprDelete(db, pItem->pExpr);
    sqlite3DbFree(db, pItem->zName);
    sqlite3DbFree(db, pItem->zSpan);
  }
  sqlite3DbFree(db, pList->a);
  sqlite3DbFree(db, pList);
}

// Assembly:
testq %rsi, %rsi
je 0x348c1
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq 0x8(%rsi), %r15
cmpl $0x0, (%rsi)
jle 0x348a3
xorl %r12d, %r12d
movq (%r15), %rsi
movq %r14, %rdi
callq 0x3479d
movq 0x8(%r15), %rsi
movq %r14, %rdi
callq 0x9ca4
movq 0x10(%r15), %rsi
movq %r14, %rdi
callq 0x9ca4
incl %r12d
addq $0x20, %r15
cmpl (%rbx), %r12d
jl 0x34870
movq 0x8(%rbx), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x9ca4
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x9ca4
retq
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: clearSelect
static void clearSelect(sqlite3 *db, Select *p){
  sqlite3ExprListDelete(db, p->pEList);
  sqlite3SrcListDelete(db, p->pSrc);
  sqlite3ExprDelete(db, p->pWhere);
  sqlite3ExprListDelete(db, p->pGroupBy);
  sqlite3ExprDelete(db, p->pHaving);
  sqlite3ExprListDelete(db, p->pOrderBy);
  sqlite3SelectDelete(db, p->pPrior);
  sqlite3ExprDelete(db, p->pLimit);
  sqlite3ExprDelete(db, p->pOffset);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq (%rsi), %rsi
callq 0x3484e
movq 0x28(%r14), %rsi
movq %rbx, %rdi
callq 0x3493b
movq 0x30(%r14), %rsi
movq %rbx, %rdi
callq 0x3479d
movq 0x38(%r14), %rsi
movq %rbx, %rdi
callq 0x3484e
movq 0x40(%r14), %rsi
movq %rbx, %rdi
callq 0x3479d
movq 0x48(%r14), %rsi
movq %rbx, %rdi
callq 0x3484e
movq 0x50(%r14), %rsi
movq %rbx, %rdi
callq 0x34827
movq 0x68(%r14), %rsi
movq %rbx, %rdi
callq 0x3479d
movq 0x70(%r14), %rsi
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x3479d
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3SrcListDelete
SQLITE_PRIVATE void sqlite3SrcListDelete(sqlite3 *db, SrcList *pList){
  int i;
  struct SrcList_item *pItem;
  if( pList==0 ) return;
  for(pItem=pList->a, i=0; i<pList->nSrc; i++, pItem++){
    sqlite3DbFree(db, pItem->zDatabase);
    sqlite3DbFree(db, pItem->zName);
    sqlite3DbFree(db, pItem->zAlias);
    sqlite3DbFree(db, pItem->zIndex);
    sqlite3DeleteTable(db, pItem->pTab);
    sqlite3SelectDelete(db, pItem->pSelect);
    sqlite3ExprDelete(db, pItem->pOn);
    sqlite3IdListDelete(db, pItem->pUsing);
  }
  sqlite3DbFree(db, pList);
}

// Assembly:
testq %rsi, %rsi
je 0x349e2
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
cmpb $0x0, (%rsi)
je 0x349cf
leaq 0x10(%rbx), %r15
xorl %r12d, %r12d
movq (%r15), %rsi
movq %r14, %rdi
callq 0x9ca4
movq 0x8(%r15), %rsi
movq %r14, %rdi
callq 0x9ca4
movq 0x10(%r15), %rsi
movq %r14, %rdi
callq 0x9ca4
movq 0x50(%r15), %rsi
movq %r14, %rdi
callq 0x9ca4
movq 0x18(%r15), %rsi
movq %r14, %rdi
callq 0x9975
movq 0x20(%r15), %rsi
movq %r14, %rdi
callq 0x34827
movq 0x38(%r15), %rsi
movq %r14, %rdi
callq 0x3479d
movq 0x40(%r15), %rsi
movq %r14, %rdi
callq 0x349e3
incl %r12d
movzbl (%rbx), %eax
addq $0x68, %r15
cmpl %eax, %r12d
jb 0x34961
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x9ca4
retq
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3IdListDelete
SQLITE_PRIVATE void sqlite3IdListDelete(sqlite3 *db, IdList *pList){
  int i;
  if( pList==0 ) return;
  for(i=0; i<pList->nId; i++){
    sqlite3DbFree(db, pList->a[i].zName);
  }
  sqlite3DbFree(db, pList->a);
  sqlite3DbFree(db, pList);
}

// Assembly:
testq %rsi, %rsi
je 0x34a42
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
cmpl $0x0, 0x8(%rsi)
jle 0x34a24
xorl %r15d, %r15d
xorl %r12d, %r12d
movq (%rbx), %rax
movq (%rax,%r15), %rsi
movq %r14, %rdi
callq 0x9ca4
incq %r12
movslq 0x8(%rbx), %rax
addq $0x10, %r15
cmpq %rax, %r12
jl 0x34a05
movq (%rbx), %rsi
movq %r14, %rdi
callq 0x9ca4
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x9ca4
retq
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: checkPtrmap
static void checkPtrmap(
  IntegrityCk *pCheck,   /* Integrity check context */
  Pgno iChild,           /* Child page number */
  u8 eType,              /* Expected pointer map type */
  Pgno iParent,          /* Expected pointer map parent page number */
  char *zContext         /* Context description (used for error msg) */
){
  int rc;
  u8 ePtrmapType;
  Pgno iPtrmapParent;

  rc = ptrmapGet(pCheck->pBt, iChild, &ePtrmapType, &iPtrmapParent);
  if( rc!=SQLITE_OK ){
    if( rc==SQLITE_NOMEM || rc==SQLITE_IOERR_NOMEM ) pCheck->mallocFailed = 1;
    checkAppendMsg(pCheck, zContext, "Failed to read ptrmap key=%d", iChild);
    return;
  }

  if( ePtrmapType!=eType || iPtrmapParent!=iParent ){
    checkAppendMsg(pCheck, zContext, 
      "Bad ptr map entry key=%d expected=(%d,%d) got=(%d,%d)", 
      iChild, eType, iParent, ePtrmapType, iPtrmapParent);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %r14
movl %ecx, %r12d
movl %edx, %r13d
movl %esi, %ebx
movq %rdi, %r15
movq (%rdi), %rdi
leaq -0x29(%rbp), %rdx
leaq -0x30(%rbp), %rcx
callq 0x21a08
testl %eax, %eax
je 0x34d33
cmpl $0xc0a, %eax            # imm = 0xC0A
je 0x34d06
cmpl $0x7, %eax
jne 0x34d0e
movl $0x1, 0x24(%r15)
leaq 0x454b4(%rip), %rdx     # 0x7a1c9
movq %r15, %rdi
movq %r14, %rsi
movl %ebx, %ecx
xorl %eax, %eax
callq 0x3542e
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movzbl -0x29(%rbp), %r10d
cmpb %r13b, %r10b
sete %al
movl -0x30(%rbp), %r11d
cmpl %r12d, %r11d
sete %cl
testb %cl, %al
jne 0x34d24
movzbl %r13b, %r8d
leaq 0x4548f(%rip), %rdx     # 0x7a1e6
movq %r15, %rdi
movq %r14, %rsi
movl %ebx, %ecx
movl %r12d, %r9d
xorl %eax, %eax
pushq %r11
pushq %r10
callq 0x3542e
addq $0x10, %rsp
jmp 0x34d24
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: checkAppendMsg
static void checkAppendMsg(
  IntegrityCk *pCheck,
  char *zMsg1,
  const char *zFormat,
  ...
){
  va_list ap;
  if( !pCheck->mxErr ) return;
  pCheck->mxErr--;
  pCheck->nErr++;
  va_start(ap, zFormat);
  if( pCheck->errMsg.nChar ){
    sqlite3StrAccumAppend(&pCheck->errMsg, "\n", 1);
  }
  if( zMsg1 ){
    sqlite3StrAccumAppend(&pCheck->errMsg, zMsg1, -1);
  }
  sqlite3VXPrintf(&pCheck->errMsg, 1, zFormat, ap);
  va_end(ap);
  if( pCheck->errMsg.accError==STRACCUM_NOMEM ){
    pCheck->mallocFailed = 1;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xd0, %rsp
movq %rcx, -0xd8(%rbp)
movq %r8, -0xd0(%rbp)
movq %r9, -0xc8(%rbp)
testb %al, %al
je 0x35485
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)
movl 0x1c(%rdi), %eax
testl %eax, %eax
je 0x35516
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
decl %eax
movl %eax, 0x1c(%rdi)
incl 0x20(%rdi)
leaq -0xf0(%rbp), %rax
movq %rax, -0x30(%rbp)
leaq 0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
movabsq $0x3000000018, %rax     # imm = 0x3000000018
movq %rax, -0x40(%rbp)
leaq 0x28(%rdi), %r12
cmpl $0x0, 0x40(%rdi)
je 0x354e0
leaq 0x48edc(%rip), %rsi     # 0x7e3af
movq %r12, %rdi
movl $0x1, %edx
callq 0x172f3
testq %r15, %r15
je 0x354f5
movq %r12, %rdi
movq %r15, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x172f3
leaq -0x40(%rbp), %rcx
movq %r12, %rdi
movl $0x1, %esi
movq %r14, %rdx
callq 0xa684
cmpb $0x1, 0x4d(%rbx)
jne 0x35516
movl $0x1, 0x24(%rbx)
addq $0xd0, %rsp
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: checkRef
static int checkRef(IntegrityCk *pCheck, Pgno iPage, char *zContext){
  if( iPage==0 ) return 1;
  if( iPage>pCheck->nPage ){
    checkAppendMsg(pCheck, zContext, "invalid page number %d", iPage);
    return 1;
  }
  if( getPageReferenced(pCheck, iPage) ){
    checkAppendMsg(pCheck, zContext, "2nd reference to page %d", iPage);
    return 1;
  }
  setPageReferenced(pCheck, iPage);
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl $0x1, %ebx
testl %esi, %esi
je 0x35584
movl %esi, %eax
cmpl %esi, 0x18(%rdi)
jae 0x35545
leaq 0x44c56(%rip), %rcx     # 0x7a199
jmp 0x35575
movq 0x10(%rdi), %rsi
movl %eax, %r8d
shrl $0x3, %r8d
movzbl (%rsi,%r8), %r9d
movl %eax, %ecx
andb $0x7, %cl
movl $0x1, %r10d
shll %cl, %r10d
movl %eax, %ecx
andl $0x7, %ecx
btl %ecx, %r9d
jae 0x3558d
leaq 0x44c3b(%rip), %rcx     # 0x7a1b0
movq %rdx, %rsi
movq %rcx, %rdx
movl %eax, %ecx
xorl %eax, %eax
callq 0x3542e
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
orb %r9b, %r10b
movb %r10b, (%rsi,%r8)
xorl %ebx, %ebx
jmp 0x35584
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: rowSetEntryAlloc
static struct RowSetEntry *rowSetEntryAlloc(RowSet *p){
  assert( p!=0 );
  if( p->nFresh==0 ){
    struct RowSetChunk *pNew;
    pNew = sqlite3DbMallocRaw(p->db, sizeof(*pNew));
    if( pNew==0 ){
      return 0;
    }
    pNew->pNextChunk = p->pChunk;
    p->pChunk = pNew;
    p->pFresh = pNew->aEntry;
    p->nFresh = ROWSET_ENTRY_PER_CHUNK;
  }
  p->nFresh--;
  return p->pFresh++;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movzwl 0x30(%rdi), %ecx
testw %cx, %cx
je 0x355b2
movq 0x20(%rbx), %rax
decl %ecx
jmp 0x355d6
movq 0x8(%rbx), %rdi
movl $0x3f8, %esi            # imm = 0x3F8
callq 0x11721
testq %rax, %rax
je 0x355e9
movq (%rbx), %rcx
movq %rcx, (%rax)
movq %rax, (%rbx)
addq $0x8, %rax
movw $0x29, %cx
movw %cx, 0x30(%rbx)
leaq 0x18(%rax), %rcx
movq %rcx, 0x20(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
xorl %eax, %eax
jmp 0x355e2
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: rowSetEntrySort
static struct RowSetEntry *rowSetEntrySort(struct RowSetEntry *pIn){
  unsigned int i;
  struct RowSetEntry *pNext, *aBucket[40];

  memset(aBucket, 0, sizeof(aBucket));
  while( pIn ){
    pNext = pIn->pRight;
    pIn->pRight = 0;
    for(i=0; aBucket[i]; i++){
      pIn = rowSetEntryMerge(aBucket[i], pIn);
      aBucket[i] = 0;
    }
    aBucket[i] = pIn;
    pIn = pNext;
  }
  pIn = 0;
  for(i=0; i<sizeof(aBucket)/sizeof(aBucket[0]); i++){
    pIn = rowSetEntryMerge(pIn, aBucket[i]);
  }
  return pIn;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x148, %rsp            # imm = 0x148
movq %rdi, %r14
leaq -0x170(%rbp), %rbx
movl $0x140, %edx            # imm = 0x140
movq %rbx, %rdi
xorl %esi, %esi
callq 0x8200
testq %r14, %r14
je 0x35682
xorl %edi, %edi
movq 0x8(%r14), %r15
movq $0x0, 0x8(%r14)
testq %rdi, %rdi
je 0x3566a
movl $0x1, %r12d
movq %rbx, %r13
movq %r14, %rsi
callq 0x356b1
movq %rax, %r14
movq $0x0, (%r13)
movl %r12d, %eax
leaq -0x170(,%rax,8), %r13
addq %rbp, %r13
movq (%r13), %rdi
incl %r12d
testq %rdi, %rdi
jne 0x3563b
jmp 0x3566d
movq %rbx, %r13
movq %r14, (%r13)
testq %r15, %r15
je 0x35682
movq -0x170(%rbp), %rdi
movq %r15, %r14
jmp 0x35621
xorl %ebx, %ebx
xorl %eax, %eax
movq -0x170(%rbp,%rbx,8), %rsi
movq %rax, %rdi
callq 0x356b1
incq %rbx
cmpq $0x28, %rbx
jne 0x35686
addq $0x148, %rsp            # imm = 0x148
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: rowSetEntryMerge
static struct RowSetEntry *rowSetEntryMerge(
  struct RowSetEntry *pA,    /* First sorted list to be merged */
  struct RowSetEntry *pB     /* Second sorted list to be merged */
){
  struct RowSetEntry head;
  struct RowSetEntry *pTail;

  pTail = &head;
  while( pA && pB ){
    assert( pA->pRight==0 || pA->v<=pA->pRight->v );
    assert( pB->pRight==0 || pB->v<=pB->pRight->v );
    if( pA->v<pB->v ){
      pTail->pRight = pA;
      pA = pA->pRight;
      pTail = pTail->pRight;
    }else if( pB->v<pA->v ){
      pTail->pRight = pB;
      pB = pB->pRight;
      pTail = pTail->pRight;
    }else{
      pA = pA->pRight;
    }
  }
  if( pA ){
    assert( pA->pRight==0 || pA->v<=pA->pRight->v );
    pTail->pRight = pA;
  }else{
    assert( pB==0 || pB->pRight==0 || pB->v<=pB->pRight->v );
    pTail->pRight = pB;
  }
  return head.pRight;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
testq %rdi, %rdi
setne %cl
sete %al
testq %rsi, %rsi
sete %dl
orb %al, %dl
jne 0x3571b
leaq -0x18(%rbp), %rax
movq %rsi, %rdx
movq %rdi, %r8
movq (%r8), %rcx
movq (%rdx), %rsi
cmpq %rsi, %rcx
jge 0x356ed
movq %r8, 0x8(%rax)
movq 0x8(%r8), %rdi
movq %rdx, %rsi
movq %r8, %rax
jmp 0x35706
jle 0x356ff
movq %rdx, 0x8(%rax)
movq 0x8(%rdx), %rsi
movq %r8, %rdi
movq %rdx, %rax
jmp 0x35706
movq 0x8(%r8), %rdi
movq %rdx, %rsi
testq %rdi, %rdi
setne %cl
je 0x3571f
movq %rsi, %rdx
movq %rdi, %r8
testq %rsi, %rsi
jne 0x356d2
jmp 0x3571f
leaq -0x18(%rbp), %rax
testb %cl, %cl
cmoveq %rsi, %rdi
movq %rdi, 0x8(%rax)
movq -0x10(%rbp), %rax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: rowSetListToTree
static struct RowSetEntry *rowSetListToTree(struct RowSetEntry *pList){
  int iDepth;           /* Depth of the tree so far */
  struct RowSetEntry *p;       /* Current tree root */
  struct RowSetEntry *pLeft;   /* Left subtree */

  assert( pList!=0 );
  p = pList;
  pList = p->pRight;
  p->pLeft = p->pRight = 0;
  for(iDepth=1; pList; iDepth++){
    pLeft = p;
    p = pList;
    pList = p->pRight;
    p->pLeft = pLeft;
    p->pRight = rowSetNDeepTree(&pList, iDepth);
  }
  return p;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq 0x8(%rdi), %rax
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rdi)
testq %rax, %rax
je 0x3577f
movl $0x1, %ebx
leaq -0x20(%rbp), %r14
movq %rax, %r15
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
movq %rdi, 0x10(%r15)
movq %r14, %rdi
movl %ebx, %esi
callq 0x357dd
movq %rax, 0x8(%r15)
incl %ebx
movq -0x20(%rbp), %rax
movq %r15, %rdi
testq %rax, %rax
jne 0x35752
jmp 0x35782
movq %rdi, %r15
movq %r15, %rax
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: rowSetTreeToList
static void rowSetTreeToList(
  struct RowSetEntry *pIn,         /* Root of the input tree */
  struct RowSetEntry **ppFirst,    /* Write head of the output list here */
  struct RowSetEntry **ppLast      /* Write tail of the output list here */
){
  assert( pIn!=0 );
  if( pIn->pLeft ){
    struct RowSetEntry *p;
    rowSetTreeToList(pIn->pLeft, ppFirst, &p);
    p->pRight = pIn;
  }else{
    *ppFirst = pIn;
  }
  if( pIn->pRight ){
    rowSetTreeToList(pIn->pRight, &pIn->pRight, ppLast);
  }else{
    *ppLast = pIn;
  }
  assert( (*ppLast)->pRight==0 );
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
leaq -0x20(%rbp), %r14
movq %rdi, %r15
movq 0x10(%rdi), %rdi
testq %rdi, %rdi
je 0x357bf
movq %r14, %rdx
callq 0x35790
movq -0x20(%rbp), %rax
movq %r15, 0x8(%rax)
jmp 0x357c2
movq %r15, (%rsi)
leaq 0x8(%r15), %rsi
movq 0x8(%r15), %rdi
testq %rdi, %rdi
jne 0x357a1
movq %r15, (%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: rowSetNDeepTree
static struct RowSetEntry *rowSetNDeepTree(
  struct RowSetEntry **ppList,
  int iDepth
){
  struct RowSetEntry *p;         /* Root of the new tree */
  struct RowSetEntry *pLeft;     /* Left subtree */
  if( *ppList==0 ){
    return 0;
  }
  if( iDepth==1 ){
    p = *ppList;
    *ppList = p->pRight;
    p->pLeft = p->pRight = 0;
    return p;
  }
  pLeft = rowSetNDeepTree(ppList, iDepth-1);
  p = *ppList;
  if( p==0 ){
    return pLeft;
  }
  p->pLeft = pLeft;
  *ppList = p->pRight;
  p->pRight = rowSetNDeepTree(ppList, iDepth-1);
  return p;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq (%rdi), %rbx
testq %rbx, %rbx
je 0x3580a
movl %esi, %r15d
movq %rdi, %r14
cmpl $0x1, %esi
jne 0x3580e
movq 0x8(%rbx), %rax
movq %rax, (%r14)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rbx)
jmp 0x35843
xorl %ebx, %ebx
jmp 0x35843
decl %r15d
movq %r14, %rdi
movl %r15d, %esi
callq 0x357dd
movq (%r14), %rbx
testq %rbx, %rbx
je 0x35840
movq %rax, 0x10(%rbx)
movq 0x8(%rbx), %rax
movq %rax, (%r14)
movq %r14, %rdi
movl %r15d, %esi
callq 0x357dd
movq %rax, 0x8(%rbx)
jmp 0x35843
movq %rax, %rbx
movq %rbx, %rax
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: execSql
static int execSql(sqlite3 *db, char **pzErrMsg, const char *zSql){
  sqlite3_stmt *pStmt;
  VVA_ONLY( int rc; )
  if( !zSql ){
    return SQLITE_NOMEM;
  }
  if( SQLITE_OK!=sqlite3_prepare(db, zSql, -1, &pStmt, 0) ){
    sqlite3SetString(pzErrMsg, db, sqlite3_errmsg(db));
    return sqlite3_errcode(db);
  }
  VVA_ONLY( rc = ) sqlite3_step(pStmt);
  assert( rc!=SQLITE_ROW || (db->flags&SQLITE_CountRows) );
  return vacuumFinalize(db, pStmt, pzErrMsg);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
testq %rdx, %rdx
je 0x358b5
movq %rsi, %r14
movq %rdi, %rbx
movq $0x0, (%rsp)
leaq -0x20(%rbp), %r9
movq %rdx, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x12ed6
testl %eax, %eax
je 0x358c5
movq %rbx, %rdi
callq 0x12cc6
movq %r14, %rdi
movq %rbx, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0x24129
movq %rbx, %rdi
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x12c49
movl $0x7, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq -0x20(%rbp), %r15
movq %r15, %rdi
callq 0xf576
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x35ad0
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3BtreeCommit
SQLITE_PRIVATE int sqlite3BtreeCommit(Btree *p){
  int rc;
  sqlite3BtreeEnter(p);
  rc = sqlite3BtreeCommitPhaseOne(p, 0);
  if( rc==SQLITE_OK ){
    rc = sqlite3BtreeCommitPhaseTwo(p, 0);
  }
  sqlite3BtreeLeave(p);
  return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rax
movq 0x8(%rdi), %rcx
movq %rax, 0x8(%rcx)
xorl %esi, %esi
callq 0xe473
testl %eax, %eax
je 0x3590f
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movq %rbx, %rdi
xorl %esi, %esi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0xe3c0
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: execExecSql
static int execExecSql(sqlite3 *db, char **pzErrMsg, const char *zSql){
  sqlite3_stmt *pStmt;
  int rc;

  rc = sqlite3_prepare(db, zSql, -1, &pStmt, 0);
  if( rc!=SQLITE_OK ) return rc;

  while( SQLITE_ROW==sqlite3_step(pStmt) ){
    rc = execSql(db, pzErrMsg, (char*)sqlite3_column_text(pStmt, 0));
    if( rc!=SQLITE_OK ){
      vacuumFinalize(db, pStmt, pzErrMsg);
      return rc;
    }
  }

  return vacuumFinalize(db, pStmt, pzErrMsg);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq $0x0, (%rsp)
leaq -0x28(%rbp), %r9
movq %rdx, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x12ed6
movl %eax, %r12d
testl %eax, %eax
jne 0x35998
movq -0x28(%rbp), %r15
movq %r15, %rdi
callq 0xf576
cmpl $0x64, %eax
jne 0x359a8
movq %r15, %rdi
xorl %esi, %esi
callq 0x10789
movq %r14, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x35851
testl %eax, %eax
je 0x3595d
movl %eax, %r12d
movq -0x28(%rbp), %rsi
movq %r14, %rdi
movq %rbx, %rdx
callq 0x35ad0
movl %r12d, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x35ad0
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: vacuumFinalize
static int vacuumFinalize(sqlite3 *db, sqlite3_stmt *pStmt, char **pzErrMsg){
  int rc;
  rc = sqlite3VdbeFinalize((Vdbe*)pStmt);
  if( rc ){
    sqlite3SetString(pzErrMsg, db, sqlite3_errmsg(db));
  }
  return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rdi, %r15
movq %rsi, %rdi
callq 0xeac6
movl %eax, %ebx
testl %eax, %eax
je 0x35b06
movq %r15, %rdi
callq 0x12cc6
movq %r14, %rdi
movq %r15, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0x24129
movl %ebx, %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: growVTrans
static int growVTrans(sqlite3 *db){
  const int ARRAY_INCR = 5;

  /* Grow the sqlite3.aVTrans array if required */
  if( (db->nVTrans%ARRAY_INCR)==0 ){
    VTable **aVTrans;
    int nBytes = sizeof(sqlite3_vtab *) * (db->nVTrans + ARRAY_INCR);
    aVTrans = sqlite3DbRealloc(db, (void *)db->aVTrans, nBytes);
    if( !aVTrans ){
      return SQLITE_NOMEM;
    }
    memset(&aVTrans[db->nVTrans], 0, sizeof(sqlite3_vtab *)*ARRAY_INCR);
    db->aVTrans = aVTrans;
  }

  return SQLITE_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl 0x1a4(%rdi), %eax
imull $0xcccccccd, %eax, %ecx # imm = 0xCCCCCCCD
addl $0x19999999, %ecx       # imm = 0x19999999
xorl %ebx, %ebx
cmpl $0x33333332, %ecx       # imm = 0x33333332
ja 0x35b7b
movq %rdi, %r14
leal 0x28(,%rax,8), %edx
movq 0x1c8(%rdi), %rsi
callq 0x174d6
testq %rax, %rax
je 0x35b76
movslq 0x1a4(%r14), %rcx
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax,%rcx,8)
movups %xmm0, (%rax,%rcx,8)
movq $0x0, 0x20(%rax,%rcx,8)
movq %rax, 0x1c8(%r14)
jmp 0x35b7b
movl $0x7, %ebx
movl %ebx, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: growOpArray
static int growOpArray(Vdbe *p){
  VdbeOp *pNew;
  int nNew = (p->nOpAlloc ? p->nOpAlloc*2 : (int)(1024/sizeof(Op)));
  pNew = sqlite3DbRealloc(p->db, p->aOp, nNew*sizeof(Op));
  if( pNew ){
    p->nOpAlloc = sqlite3DbMallocSize(p->db, pNew)/sizeof(Op);
    p->aOp = pNew;
  }
  return (pNew ? SQLITE_OK : SQLITE_NOMEM);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl 0x38(%rdi), %eax
movl %eax, %ecx
shll $0x4, %ecx
testl %eax, %eax
leal (%rcx,%rcx,2), %eax
movl $0x3f0, %edx            # imm = 0x3F0
cmovnel %eax, %edx
movq (%rdi), %rdi
movq 0x8(%rbx), %rsi
callq 0x174d6
testq %rax, %rax
je 0x366d4
movq %rax, %r14
movq (%rbx), %rax
testq %rax, %rax
je 0x366ad
cmpq %r14, 0x170(%rax)
ja 0x366ad
cmpq %r14, 0x178(%rax)
jbe 0x366ad
movzwl 0x150(%rax), %eax
jmp 0x366b6
movq %r14, %rdi
callq *0x5dd82(%rip)          # 0x94438
cltq
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
mulq %rcx
shrq $0x4, %rdx
movl %edx, 0x38(%rbx)
movq %r14, 0x8(%rbx)
xorl %eax, %eax
jmp 0x366d9
movl $0x7, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3ReadSchema
SQLITE_PRIVATE int sqlite3ReadSchema(Parse *pParse){
  int rc = SQLITE_OK;
  sqlite3 *db = pParse->db;
  assert( sqlite3_mutex_held(db->mutex) );
  if( !db->init.busy ){
    rc = sqlite3Init(db, &pParse->zErrMsg);
  }
  if( rc!=SQLITE_OK ){
    pParse->rc = rc;
    pParse->nErr++;
  }
  return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %r14
movq (%rdi), %rdi
xorl %ebx, %ebx
cmpb $0x0, 0x99(%rdi)
jne 0x368b3
leaq 0x8(%r14), %rsi
callq 0x368ba
testl %eax, %eax
je 0x368b3
movl %eax, 0x18(%r14)
incl 0x50(%r14)
movl %eax, %ebx
movl %ebx, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3Init
SQLITE_PRIVATE int sqlite3Init(sqlite3 *db, char **pzErrMsg){
  int i, rc;
  int commit_internal = !(db->flags&SQLITE_InternChanges);
  
  assert( sqlite3_mutex_held(db->mutex) );
  rc = SQLITE_OK;
  db->init.busy = 1;
  for(i=0; rc==SQLITE_OK && i<db->nDb; i++){
    if( DbHasProperty(db, i, DB_SchemaLoaded) || i==1 ) continue;
    rc = sqlite3InitOne(db, i, pzErrMsg);
    if( rc ){
      sqlite3ResetOneSchema(db, i);
    }
  }

  /* Once all the other databases have been initialized, load the schema
  ** for the TEMP database. This is loaded last, as the TEMP database
  ** schema may contain references to objects in other databases.
  */
#ifndef SQLITE_OMIT_TEMPDB
  if( rc==SQLITE_OK && ALWAYS(db->nDb>1)
                    && !DbHasProperty(db, 1, DB_SchemaLoaded) ){
    rc = sqlite3InitOne(db, 1, pzErrMsg);
    if( rc ){
      sqlite3ResetOneSchema(db, 1);
    }
  }
#endif

  db->init.busy = 0;
  if( rc==SQLITE_OK && commit_internal ){
    sqlite3CommitInternalChanges(db);
  }

  return rc; 
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x2c(%rdi), %r12d
movb $0x1, 0x99(%rdi)
cmpl $0x0, 0x28(%rdi)
jle 0x36966
movq %rsi, %r14
movl %r12d, -0x2c(%rbp)
movl $0x18, %r13d
xorl %r12d, %r12d
movq 0x20(%rbx), %rax
movq (%rax,%r13), %rax
cmpq $0x1, %r12
sete %cl
orb 0x72(%rax), %cl
testb $0x1, %cl
jne 0x36919
movq %rbx, %rdi
movl %r12d, %esi
movq %r14, %rdx
callq 0x369a3
testl %eax, %eax
jne 0x3697c
incq %r12
movslq 0x28(%rbx), %rax
addq $0x20, %r13
cmpq %rax, %r12
jl 0x368f0
cmpl $0x2, %eax
movl -0x2c(%rbp), %r12d
jl 0x36966
movq 0x20(%rbx), %rax
movq 0x38(%rax), %rax
testb $0x1, 0x72(%rax)
jne 0x36966
movq %rbx, %rdi
movl $0x1, %esi
movq %r14, %rdx
callq 0x369a3
testl %eax, %eax
je 0x36966
movl %eax, %r15d
movq 0x20(%rbx), %rax
movq 0x38(%rax), %rdi
callq 0x30c3e
jmp 0x3698a
xorl %r15d, %r15d
movb $0x0, 0x99(%rbx)
testb $0x2, %r12b
jne 0x36991
andb $-0x3, 0x2c(%rbx)
jmp 0x36991
movl %eax, %r15d
movq %rbx, %rdi
movl %r12d, %esi
callq 0x2d19c
movb $0x0, 0x99(%rbx)
movl %r15d, %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: sqlite3BtreeSetCacheSize
SQLITE_PRIVATE int sqlite3BtreeSetCacheSize(Btree *p, int mxPage){
  BtShared *pBt = p->pBt;
  assert( sqlite3_mutex_held(p->db->mutex) );
  sqlite3BtreeEnter(p);
  sqlite3PagerSetCachesize(pBt->pPager, mxPage);
  sqlite3BtreeLeave(p);
  return SQLITE_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, 0x8(%rsi)
movq (%rsi), %rax
movq 0x110(%rax), %rsi
movl %edx, 0x1c(%rsi)
movq 0x40(%rsi), %rdi
testq %rdi, %rdi
je 0x36d90
movq 0x5d766(%rip), %rcx     # 0x944d0
testl %edx, %edx
jns 0x36d8b
movslq %edx, %rax
shlq $0xa, %rax
negq %rax
movslq 0x20(%rsi), %rdx
movslq 0x24(%rsi), %rsi
addq %rdx, %rsi
cqto
idivq %rsi
movq %rax, %rdx
movl %edx, %esi
popq %rbp
jmpq *%rcx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3VtabUnlockList
SQLITE_PRIVATE void sqlite3VtabUnlockList(sqlite3 *db){
  VTable *p = db->pDisconnect;
  db->pDisconnect = 0;

  assert( sqlite3BtreeHoldsAllMutexes(db) );
  assert( sqlite3_mutex_held(db->mutex) );

  if( p ){
    sqlite3ExpirePreparedStatements(db);
    do {
      VTable *pNext = p->pNext;
      sqlite3VtabUnlock(p);
      p = pNext;
    }while( p );
  }
}

// Assembly:
movq %rdi, %rax
movq 0x1d0(%rdi), %rdi
movq $0x0, 0x1d0(%rax)
testq %rdi, %rdi
je 0x36ddf
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq 0x8(%rax), %rax
testq %rax, %rax
je 0x36dc8
orb $0x20, 0x9a(%rax)
movq 0x68(%rax), %rax
jmp 0x36db6
movq 0x28(%rdi), %rbx
callq 0x22dc8
movq %rbx, %rdi
testq %rbx, %rbx
jne 0x36dc8
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3CollapseDatabaseArray
SQLITE_PRIVATE void sqlite3CollapseDatabaseArray(sqlite3 *db){
  int i, j;
  for(i=j=2; i<db->nDb; i++){
    struct Db *pDb = &db->aDb[i];
    if( pDb->pBt==0 ){
      sqlite3DbFree(db, pDb->zName);
      pDb->zName = 0;
      continue;
    }
    if( j<i ){
      db->aDb[j] = db->aDb[i];
    }
    j++;
  }
  memset(&db->aDb[j], 0, (db->nDb-j)*sizeof(db->aDb[j]));
  db->nDb = j;
  if( db->nDb<=2 && db->aDb!=db->aDbStatic ){
    memcpy(db->aDbStatic, db->aDb, 2*sizeof(db->aDb[0]));
    sqlite3DbFree(db, db->aDb);
    db->aDb = db->aDbStatic;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x28(%rdi), %eax
movl $0x2, %r14d
cmpl $0x3, %eax
jl 0x36e63
movl $0x2, %r15d
movl $0x40, %r12d
movq 0x20(%rbx), %rax
leaq (%rax,%r12), %r13
cmpq $0x0, 0x8(%rax,%r12)
je 0x36e3f
movslq %r14d, %rcx
cmpq %rcx, %r15
jle 0x36e3a
shlq $0x5, %rcx
movups (%r13), %xmm0
movups 0x10(%r13), %xmm1
movups %xmm1, 0x10(%rax,%rcx)
movups %xmm0, (%rax,%rcx)
incl %r14d
jmp 0x36e53
movq (%r13), %rsi
movq %rbx, %rdi
callq 0x9ca4
movq $0x0, (%r13)
incq %r15
movslq 0x28(%rbx), %rax
addq $0x20, %r12
cmpq %rax, %r15
jl 0x36e0b
movslq %r14d, %r14
movq %r14, %rdi
shlq $0x5, %rdi
addq 0x20(%rbx), %rdi
subl %r14d, %eax
movslq %eax, %rdx
shlq $0x5, %rdx
xorl %esi, %esi
callq 0x8200
movl %r14d, 0x28(%rbx)
cmpl $0x2, %r14d
jg 0x36eca
movq 0x20(%rbx), %rsi
leaq 0x2c0(%rbx), %r14
cmpq %r14, %rsi
je 0x36eca
movups (%rsi), %xmm0
movups 0x10(%rsi), %xmm1
movups 0x20(%rsi), %xmm2
movups 0x30(%rsi), %xmm3
movups %xmm3, 0x30(%r14)
movups %xmm2, 0x20(%r14)
movups %xmm1, 0x10(%r14)
movups %xmm0, (%r14)
movq %rbx, %rdi
callq 0x9ca4
movq %r14, 0x20(%rbx)
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: sqliteDeleteColumnNames
static void sqliteDeleteColumnNames(sqlite3 *db, Table *pTable){
  int i;
  Column *pCol;
  assert( pTable!=0 );
  if( (pCol = pTable->aCol)!=0 ){
    for(i=0; i<pTable->nCol; i++, pCol++){
      sqlite3DbFree(db, pCol->zName);
      sqlite3ExprDelete(db, pCol->pDflt);
      sqlite3DbFree(db, pCol->zDflt);
      sqlite3DbFree(db, pCol->zType);
      sqlite3DbFree(db, pCol->zColl);
    }
    sqlite3DbFree(db, pTable->aCol);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq 0x8(%rsi), %r14
testq %r14, %r14
je 0x36f60
movq %rsi, %r15
movq %rdi, %rbx
cmpw $0x0, 0x42(%rsi)
jle 0x36f4d
xorl %r12d, %r12d
movq (%r14), %rsi
movq %rbx, %rdi
callq 0x9ca4
movq 0x8(%r14), %rsi
movq %rbx, %rdi
callq 0x3479d
movq 0x10(%r14), %rsi
movq %rbx, %rdi
callq 0x9ca4
movq 0x18(%r14), %rsi
movq %rbx, %rdi
callq 0x9ca4
movq 0x20(%r14), %rsi
movq %rbx, %rdi
callq 0x9ca4
incl %r12d
addq $0x30, %r14
movswl 0x42(%r15), %eax
cmpl %eax, %r12d
jl 0x36efd
movq 0x8(%r15), %r14
movq %rbx, %rdi
movq %r14, %rsi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x9ca4
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: fkTriggerDelete
static void fkTriggerDelete(sqlite3 *dbMem, Trigger *p){
  if( p ){
    TriggerStep *pStep = p->step_list;
    sqlite3ExprDelete(dbMem, pStep->pWhere);
    sqlite3ExprListDelete(dbMem, pStep->pExprList);
    sqlite3SelectDelete(dbMem, pStep->pSelect);
    sqlite3ExprDelete(dbMem, p->pWhen);
    sqlite3DbFree(dbMem, p);
  }
}

// Assembly:
testq %rsi, %rsi
je 0x36fc4
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x38(%rsi), %r15
movq 0x28(%r15), %rsi
callq 0x3479d
movq 0x30(%r15), %rsi
movq %r14, %rdi
callq 0x3484e
movq 0x10(%r15), %rsi
movq %r14, %rdi
callq 0x34827
movq 0x18(%rbx), %rsi
movq %r14, %rdi
callq 0x3479d
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x9ca4
retq