LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3_bind_zeroblob
SQLITE_API int sqlite3_bind_zeroblob(sqlite3_stmt *pStmt, int i, int n){
  int rc;
  Vdbe *p = (Vdbe *)pStmt;
  rc = vdbeUnbind(p, i);
  if( rc==SQLITE_OK ){
    sqlite3VdbeMemSetZeroBlob(&p->aVar[i-1], n);
    sqlite3_mutex_leave(p->db->mutex);
  }
  return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %ebx
movl %esi, %r15d
movq %rdi, %r12
callq 0x10ab1
movl %eax, %r14d
testl %eax, %eax
jne 0x10d72
movq 0x78(%r12), %rax
movslq %r15d, %rcx
imulq $0x38, %rcx, %rcx
leaq (%rax,%rcx), %r15
addq $-0x38, %r15
movq %r15, %rdi
callq 0xecfd
movabsq $0x104401000000000, %rax # imm = 0x104401000000000
movq %rax, 0x20(%r15)
xorl %eax, %eax
testl %ebx, %ebx
cmovgl %ebx, %eax
movl %eax, 0x18(%r15)
movl %r14d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3_bind_parameter_index
SQLITE_PRIVATE int sqlite3Strlen30(const char *z){
  const char *z2 = z;
  if( z==0 ) return 0;
  while( *z2 ){ z2++; }
  return 0x3fffffff & (int)(z2 - z);
}

// Assembly:
testq %rsi, %rsi
je 0x10dea
pushq %rbp
movq %rsp, %rbp
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movq %rsi, %rax
incl %edx
cmpb $0x0, (%rax)
leaq 0x1(%rax), %rax
jne 0x10dd6
andl $0x3fffffff, %edx       # imm = 0x3FFFFFFF
popq %rbp
jmp 0x10dee
xorl %edx, %edx
jmp 0x10dee
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3VdbeParameterIndex
SQLITE_PRIVATE int sqlite3VdbeParameterIndex(Vdbe *p, const char *zName, int nName){
  int i;
  if( p==0 ){
    return 0;
  }
  if( zName ){
    for(i=0; i<p->nzVar; i++){
      const char *z = p->azVar[i];
      if( z && strncmp(z,zName,nName)==0 && z[nName]==0 ){
        return i+1;
      }
    }
  }
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rdi, %rdi
sete %al
movq %rsi, -0x30(%rbp)
testq %rsi, %rsi
sete %cl
xorl %ebx, %ebx
orb %al, %cl
jne 0x10e58
movswq 0x8a(%rdi), %r13
testq %r13, %r13
jle 0x10e58
movq 0x80(%rdi), %r14
movslq %edx, %r15
xorl %ebx, %ebx
movq (%r14,%rbx,8), %r12
testq %r12, %r12
je 0x10e4e
movq %r12, %rdi
movq -0x30(%rbp), %rsi
movq %r15, %rdx
callq 0x81b0
testl %eax, %eax
jne 0x10e4e
cmpb $0x0, (%r12,%r15)
je 0x10e69
incq %rbx
cmpq %rbx, %r13
jne 0x10e2b
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
incl %ebx
jmp 0x10e58
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3_transfer_bindings
SQLITE_API int sqlite3_transfer_bindings(sqlite3_stmt *pFromStmt, sqlite3_stmt *pToStmt){
  Vdbe *pFrom = (Vdbe*)pFromStmt;
  Vdbe *pTo = (Vdbe*)pToStmt;
  if( pFrom->nVar!=pTo->nVar ){
    return SQLITE_ERROR;
  }
  if( pTo->isPrepareV2 && pTo->expmask ){
    pTo->expired = 1;
  }
  if( pFrom->isPrepareV2 && pFrom->expmask ){
    pFrom->expired = 1;
  }
  return sqlite3TransferBindings(pFromStmt, pToStmt);
}

// Assembly:
movzwl 0x88(%rdi), %ecx
movl $0x1, %eax
cmpw 0x88(%rsi), %cx
jne 0x10ece
movzwl 0x9a(%rsi), %eax
btl $0xa, %eax
jae 0x10ea2
cmpl $0x0, 0x104(%rsi)
je 0x10ea2
orl $0x20, %eax
movw %ax, 0x9a(%rsi)
movzwl 0x9a(%rdi), %eax
btl $0xa, %eax
jae 0x10ec2
cmpl $0x0, 0x104(%rdi)
je 0x10ec2
orl $0x20, %eax
movw %ax, 0x9a(%rdi)
pushq %rbp
movq %rsp, %rbp
callq 0x10ecf
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3TransferBindings
SQLITE_PRIVATE int sqlite3TransferBindings(sqlite3_stmt *pFromStmt, sqlite3_stmt *pToStmt){
  Vdbe *pFrom = (Vdbe*)pFromStmt;
  Vdbe *pTo = (Vdbe*)pToStmt;
  int i;
  assert( pTo->db==pFrom->db );
  assert( pTo->nVar==pFrom->nVar );
  sqlite3_mutex_enter(pTo->db->mutex);
  for(i=0; i<pFrom->nVar; i++){
    sqlite3VdbeMemMove(&pTo->aVar[i], &pFrom->aVar[i]);
  }
  sqlite3_mutex_leave(pTo->db->mutex);
  return SQLITE_OK;
}

// Assembly:
cmpw $0x0, 0x88(%rdi)
jle 0x10f6d
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
xorl %r15d, %r15d
xorl %r12d, %r12d
movq %rsi, -0x30(%rbp)
movq 0x78(%rsi), %r13
leaq (%r15,%r13), %rdi
movq 0x78(%r14), %rbx
callq 0xecfd
movq -0x30(%rbp), %rsi
movq 0x30(%rbx,%r15), %rax
movq %rax, 0x30(%r13,%r15)
movups (%rbx,%r15), %xmm0
movups 0x10(%rbx,%r15), %xmm1
movups 0x20(%rbx,%r15), %xmm2
movups %xmm2, 0x20(%r13,%r15)
movups %xmm1, 0x10(%r13,%r15)
movups %xmm0, (%r13,%r15)
movw $0x1, 0x24(%rbx,%r15)
xorps %xmm0, %xmm0
movups %xmm0, 0x28(%rbx,%r15)
incq %r12
movswq 0x88(%r14), %rax
addq $0x38, %r15
cmpq %rax, %r12
jl 0x10ef8
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: sqlite3_stmt_status
SQLITE_API int sqlite3_stmt_status(sqlite3_stmt *pStmt, int op, int resetFlag){
  Vdbe *pVdbe = (Vdbe*)pStmt;
  u32 v = pVdbe->aCounter[op];
  if( resetFlag ) pVdbe->aCounter[op] = 0;
  return (int)v;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movslq %esi, %rcx
movl 0xac(%rdi,%rcx,4), %eax
testl %edx, %edx
je 0x10ff6
movl $0x0, 0xac(%rdi,%rcx,4)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3_value_numeric_type
SQLITE_API int sqlite3_value_numeric_type(sqlite3_value *pVal){
  Mem *pMem = (Mem*)pVal;
  if( pMem->type==SQLITE_TEXT ){
    applyNumericAffinity(pMem);
    sqlite3VdbeMemStoreType(pMem);
  }
  return pMem->type;
}

// Assembly:
movb 0x26(%rdi), %al
cmpb $0x3, %al
jne 0x1101e
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x11022
movq %rbx, %rdi
callq 0x110b5
movb 0x26(%rbx), %al
addq $0x8, %rsp
popq %rbx
popq %rbp
movzbl %al, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: applyNumericAffinity
static void applyNumericAffinity(Mem *pRec){
  if( (pRec->flags & (MEM_Real|MEM_Int))==0 ){
    double rValue;
    i64 iValue;
    u8 enc = pRec->enc;
    if( (pRec->flags&MEM_Str)==0 ) return;
    if( sqlite3AtoF(pRec->z, &rValue, pRec->n, enc)==0 ) return;
    if( 0==sqlite3Atoi64(pRec->z, &iValue, pRec->n, enc) ){
      pRec->u.i = iValue;
      pRec->flags |= MEM_Int;
    }else{
      pRec->r = rValue;
      pRec->flags |= MEM_Real;
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movzwl 0x24(%rdi), %r13d
testb $0xc, %r13b
jne 0x110a6
testb $0x2, %r13b
je 0x110a6
movq %rdi, %rbx
movq 0x8(%rdi), %r15
movl 0x20(%rdi), %r14d
movzbl 0x27(%rdi), %r12d
leaq -0x38(%rbp), %rsi
movq %r15, %rdi
movl %r14d, %edx
movl %r12d, %ecx
callq 0x243b1
testl %eax, %eax
je 0x110a6
leaq -0x30(%rbp), %rsi
movq %r15, %rdi
movl %r14d, %edx
movl %r12d, %ecx
callq 0x16fda
testl %eax, %eax
je 0x11090
movsd -0x38(%rbp), %xmm0
movsd %xmm0, 0x10(%rbx)
movw $0x8, %ax
jmp 0x1109c
movq -0x30(%rbp), %rax
movq %rax, 0x18(%rbx)
movw $0x4, %ax
movzwl %ax, %eax
orl %r13d, %eax
movw %ax, 0x24(%rbx)
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: sqlite3VdbeMemStoreType
SQLITE_PRIVATE void sqlite3VdbeMemStoreType(Mem *pMem){
  int flags = pMem->flags;
  if( flags & MEM_Null ){
    pMem->type = SQLITE_NULL;
  }
  else if( flags & MEM_Int ){
    pMem->type = SQLITE_INTEGER;
  }
  else if( flags & MEM_Real ){
    pMem->type = SQLITE_FLOAT;
  }
  else if( flags & MEM_Str ){
    pMem->type = SQLITE_TEXT;
  }else{
    pMem->type = SQLITE_BLOB;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movzwl 0x24(%rdi), %eax
testb $0x1, %al
jne 0x110d3
testb $0x4, %al
jne 0x110d9
testb $0x8, %al
jne 0x110df
testb $0x2, %al
jne 0x110e5
movb $0x4, 0x26(%rdi)
jmp 0x110e9
movb $0x5, 0x26(%rdi)
jmp 0x110e9
movb $0x1, 0x26(%rdi)
jmp 0x110e9
movb $0x2, 0x26(%rdi)
jmp 0x110e9
movb $0x3, 0x26(%rdi)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3DbMallocRaw
SQLITE_PRIVATE void *sqlite3DbMallocRaw(sqlite3 *db, int n){
  void *p;
  assert( db==0 || sqlite3_mutex_held(db->mutex) );
  assert( db==0 || db->pnBytesFreed==0 );
#ifndef SQLITE_OMIT_LOOKASIDE
  if( db ){
    LookasideSlot *pBuf;
    if( db->mallocFailed ){
      return 0;
    }
    if( db->lookaside.bEnabled ){
      if( n>db->lookaside.sz ){
        db->lookaside.anStat[1]++;
      }else if( (pBuf = db->lookaside.pFree)==0 ){
        db->lookaside.anStat[2]++;
      }else{
        db->lookaside.pFree = pBuf->pNext;
        db->lookaside.nOut++;
        db->lookaside.anStat[0]++;
        if( db->lookaside.nOut>db->lookaside.mxOut ){
          db->lookaside.mxOut = db->lookaside.nOut;
        }
        return (void*)pBuf;
      }
    }
  }
#else
  if( db && db->mallocFailed ){
    return 0;
  }
#endif
  p = sqlite3Malloc(n);
  if( !p && db ){
    db->mallocFailed = 1;
  }
  sqlite3MemdebugSetType(p, MEMTYPE_DB |
         ((db && db->lookaside.bEnabled) ? MEMTYPE_LOOKASIDE : MEMTYPE_HEAP));
  return p;
}

// Assembly:
testq %rdi, %rdi
je 0x11739
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpb $0x0, 0x50(%rdi)
je 0x11740
xorl %eax, %eax
jmp 0x117a8
movl %esi, %edi
jmp 0xa38c
cmpb $0x0, 0x152(%rbx)
je 0x1179c
movzwl 0x150(%rbx), %ecx
movl $0x160, %eax            # imm = 0x160
cmpl %esi, %ecx
jl 0x11799
movq 0x168(%rbx), %rax
testq %rax, %rax
je 0x11794
movq (%rax), %rcx
movq %rcx, 0x168(%rbx)
movl 0x154(%rbx), %edx
leal 0x1(%rdx), %ecx
movl %ecx, 0x154(%rbx)
incl 0x15c(%rbx)
cmpl 0x158(%rbx), %edx
jl 0x117a8
movl %ecx, 0x158(%rbx)
jmp 0x117a8
movl $0x164, %eax            # imm = 0x164
incl (%rbx,%rax)
movl %esi, %edi
callq 0xa38c
testq %rax, %rax
je 0x117af
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movb $0x1, 0x50(%rbx)
jmp 0x11735
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3LocateTable
SQLITE_PRIVATE Table *sqlite3LocateTable(
  Parse *pParse,         /* context in which to report errors */
  int isView,            /* True if looking for a VIEW rather than a TABLE */
  const char *zName,     /* Name of the table we are looking for */
  const char *zDbase     /* Name of the database.  Might be NULL */
){
  Table *p;

  /* Read the database schema. If an error occurs, leave an error message
  ** and code in pParse and return NULL. */
  if( SQLITE_OK!=sqlite3ReadSchema(pParse) ){
    return 0;
  }

  p = sqlite3FindTable(pParse->db, zName, zDbase);
  if( p==0 ){
    const char *zMsg = isView ? "no such view" : "no such table";
    if( zDbase ){
      sqlite3ErrorMsg(pParse, "%s: %s.%s", zMsg, zDbase, zName);
    }else{
      sqlite3ErrorMsg(pParse, "%s: %s", zMsg, zName);
    }
    pParse->checkSchema = 1;
  }
  return p;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rcx, %r15
movq %rdx, %r14
movl %esi, %r12d
movq %rdi, %rbx
callq 0x36884
testl %eax, %eax
je 0x117d9
xorl %eax, %eax
jmp 0x117ec
movq (%rbx), %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x341ce
testq %rax, %rax
je 0x117f5
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
testl %r12d, %r12d
leaq 0x691fd(%rip), %rax     # 0x7a9fc
leaq 0x691e9(%rip), %rdx     # 0x7a9ef
cmoveq %rax, %rdx
testq %r15, %r15
je 0x11828
leaq 0x691f4(%rip), %rsi     # 0x7aa0a
movq %rbx, %rdi
movq %r15, %rcx
movq %r14, %r8
xorl %eax, %eax
callq 0x11842
jmp 0x1183c
leaq 0x691e5(%rip), %rsi     # 0x7aa14
movq %rbx, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x11842
movb $0x1, 0x1d(%rbx)
jmp 0x117d5
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3ErrorMsg
SQLITE_PRIVATE void sqlite3ErrorMsg(Parse *pParse, const char *zFormat, ...){
  char *zMsg;
  va_list ap;
  sqlite3 *db = pParse->db;
  va_start(ap, zFormat);
  zMsg = sqlite3VMPrintf(db, zFormat, ap);
  va_end(ap);
  if( db->suppressErr ){
    sqlite3DbFree(db, zMsg);
  }else{
    pParse->nErr++;
    sqlite3DbFree(db, pParse->zErrMsg);
    pParse->zErrMsg = zMsg;
    pParse->rc = SQLITE_ERROR;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0xc8, %rsp
movq %rdi, %rbx
leaq -0xe0(%rbp), %rdi
movq %rdx, 0x10(%rdi)
movq %rcx, 0x18(%rdi)
movq %r8, 0x20(%rdi)
movq %r9, 0x28(%rdi)
testb %al, %al
je 0x11899
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)
movq (%rbx), %r14
leaq -0x30(%rbp), %rdx
movq %rdi, 0x10(%rdx)
leaq 0x10(%rbp), %rax
movq %rax, 0x8(%rdx)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rdx)
movq %r14, %rdi
callq 0x194ed
movq %rax, %r15
cmpb $0x0, 0x53(%r14)
je 0x118d8
movq %r14, %rdi
movq %r15, %rsi
callq 0x9ca4
jmp 0x118f2
incl 0x50(%rbx)
movq 0x8(%rbx), %rsi
movq %r14, %rdi
callq 0x9ca4
movq %r15, 0x8(%rbx)
movl $0x1, 0x18(%rbx)
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: sqlite3VdbeCreate
SQLITE_PRIVATE Vdbe *sqlite3VdbeCreate(sqlite3 *db){
  Vdbe *p;
  p = sqlite3DbMallocZero(db, sizeof(Vdbe) );
  if( p==0 ) return 0;
  p->db = db;
  if( db->pVdbe ){
    db->pVdbe->pPrev = p;
  }
  p->pNext = db->pVdbe;
  p->pPrev = 0;
  db->pVdbe = p;
  p->magic = VDBE_MAGIC_INIT;
  return p;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl $0x128, %esi            # imm = 0x128
callq 0x11721
movq %rax, %r14
testq %rax, %rax
je 0x119ce
movq %r14, %rdi
addq $0x8, %rdi
movl $0x120, %edx            # imm = 0x120
xorl %esi, %esi
callq 0x8200
movq %rbx, (%r14)
movq 0x8(%rbx), %rax
testq %rax, %rax
je 0x119b6
movq %r14, 0x60(%rax)
movq %rax, 0x68(%r14)
movq $0x0, 0x60(%r14)
movq %r14, 0x8(%rbx)
movl $0x26bceaa5, 0x50(%r14) # imm = 0x26BCEAA5
movq %r14, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3VdbeAddOpList
SQLITE_PRIVATE int sqlite3VdbeAddOpList(Vdbe *p, int nOp, VdbeOpList const *aOp){
  int addr;
  assert( p->magic==VDBE_MAGIC_INIT );
  if( p->nOp + nOp > p->nOpAlloc && growOpArray(p) ){
    return 0;
  }
  addr = p->nOp;
  if( ALWAYS(nOp>0) ){
    int i;
    VdbeOpList const *pIn = aOp;
    for(i=0; i<nOp; i++, pIn++){
      int p2 = pIn->p2;
      VdbeOp *pOut = &p->aOp[i+addr];
      pOut->opcode = pIn->opcode;
      pOut->p1 = pIn->p1;
      if( p2<0 && (sqlite3OpcodeProperty[pOut->opcode] & OPFLG_JUMP)!=0 ){
        pOut->p2 = addr + ADDR(p2);
      }else{
        pOut->p2 = p2;
      }
      pOut->p3 = pIn->p3;
      pOut->p4type = P4_NOTUSED;
      pOut->p4.p = 0;
      pOut->p5 = 0;
#ifdef SQLITE_DEBUG
      pOut->zComment = 0;
      if( p->db->flags & SQLITE_VdbeAddopTrace ){
        sqlite3VdbePrintOp(0, i+addr, &p->aOp[i+addr]);
      }
#endif
    }
    p->nOp += nOp;
  }
  return addr;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %r15
movl %esi, %r14d
movq %rdi, %rbx
movl 0x34(%rdi), %eax
leal (%rax,%r14), %ecx
cmpl 0x38(%rdi), %ecx
jle 0x11a0d
movq %rbx, %rdi
callq 0x36657
movl %eax, %ecx
xorl %eax, %eax
testl %ecx, %ecx
jne 0x11a96
movl 0x34(%rbx), %eax
movl %eax, %ecx
testl %r14d, %r14d
jle 0x11a90
movslq %eax, %rdx
movl %r14d, %ecx
shlq $0x3, %rdx
leaq (%rdx,%rdx,2), %rdx
xorl %esi, %esi
leaq 0x64f45(%rip), %rdi     # 0x76970
xorl %r8d, %r8d
movsbl 0x2(%r15,%r8,4), %r10d
movq 0x8(%rbx), %r9
movzbl (%r15,%r8,4), %r11d
movb %r11b, (%r9,%rdx)
movsbl 0x1(%r15,%r8,4), %r12d
movl %r12d, 0x4(%r9,%rdx)
testl %r10d, %r10d
jns 0x11a5e
testb $0x1, (%r11,%rdi)
je 0x11a5e
notl %r10d
addl %eax, %r10d
movl %r10d, 0x8(%r9,%rdx)
movsbl 0x3(%r15,%r8,4), %r10d
movl %r10d, 0xc(%r9,%rdx)
movb %sil, 0x1(%r9,%rdx)
movq $0x0, 0x10(%r9,%rdx)
movb %sil, 0x3(%r9,%rdx)
incq %r8
addq $0x18, %rdx
cmpq %r8, %rcx
jne 0x11a2e
movl 0x34(%rbx), %ecx
addl %r14d, %ecx
movl %ecx, 0x34(%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3VdbeChangeToNoop
SQLITE_PRIVATE void sqlite3VdbeChangeToNoop(Vdbe *p, int addr){
  if( p->aOp ){
    VdbeOp *pOp = &p->aOp[addr];
    sqlite3 *db = p->db;
    freeP4(db, pOp->p4type, pOp->p4.p);
    memset(pOp, 0, sizeof(pOp[0]));
    pOp->opcode = OP_Noop;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq 0x8(%rdi), %rbx
testq %rbx, %rbx
je 0x11c7f
movslq %esi, %rax
leaq (%rax,%rax,2), %r14
movq (%rdi), %rdi
movsbl 0x1(%rbx,%r14,8), %esi
movq 0x10(%rbx,%r14,8), %rdx
callq 0x22d36
xorps %xmm0, %xmm0
movups %xmm0, (%rbx,%r14,8)
movq $0x0, 0x10(%rbx,%r14,8)
movb $-0x6b, (%rbx,%r14,8)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3_blob_close
SQLITE_API int sqlite3_blob_close(sqlite3_blob *pBlob){
  Incrblob *p = (Incrblob *)pBlob;
  int rc;
  sqlite3 *db;

  if( p ){
    db = p->db;
    sqlite3_mutex_enter(db->mutex);
    rc = sqlite3_finalize(p->pStmt);
    sqlite3DbFree(db, p);
    sqlite3_mutex_leave(db->mutex);
  }else{
    rc = SQLITE_OK;
  }
  return rc;
}

// Assembly:
testq %rdi, %rdi
je 0x12224
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
movq 0x20(%rbx), %r14
callq 0xea51
movl %eax, %r15d
movq %r14, %rdi
movq %rbx, %rsi
callq 0x9ca4
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: blobReadWrite
static int blobReadWrite(
  sqlite3_blob *pBlob, 
  void *z, 
  int n, 
  int iOffset, 
  int (*xCall)(BtCursor*, u32, u32, void*)
){
  int rc;
  Incrblob *p = (Incrblob *)pBlob;
  Vdbe *v;
  sqlite3 *db;

  if( p==0 ) return SQLITE_MISUSE_BKPT;
  db = p->db;
  sqlite3_mutex_enter(db->mutex);
  v = (Vdbe*)p->pStmt;

  if( n<0 || iOffset<0 || (iOffset+n)>p->nByte ){
    /* Request is out of range. Return a transient error. */
    rc = SQLITE_ERROR;
    sqlite3Error(db, SQLITE_ERROR, 0);
  }else if( v==0 ){
    /* If there is no statement handle, then the blob-handle has
    ** already been invalidated. Return SQLITE_ABORT in this case.
    */
    rc = SQLITE_ABORT;
  }else{
    /* Call either BtreeData() or BtreePutData(). If SQLITE_ABORT is
    ** returned, clean-up the statement handle.
    */
    assert( db == v->db );
    sqlite3BtreeEnterCursor(p->pCsr);
    rc = xCall(p->pCsr, iOffset+p->iOffset, n, z);
    sqlite3BtreeLeaveCursor(p->pCsr);
    if( rc==SQLITE_ABORT ){
      sqlite3VdbeFinalize(v);
      p->pStmt = 0;
    }else{
      db->errCode = rc;
      v->rc = rc;
    }
  }
  rc = sqlite3ApiExit(db, rc);
  sqlite3_mutex_leave(db->mutex);
  return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
testq %rdi, %rdi
je 0x12288
movq %rsi, %rax
movq %rdi, %r14
movq 0x20(%rdi), %rbx
movl %ecx, %esi
orl %edx, %esi
js 0x1225e
leal (%rcx,%rdx), %esi
cmpl 0x4(%r14), %esi
jle 0x122b5
movl $0x1, %r15d
movq %rbx, %rdi
movl $0x1, %esi
xorl %edx, %edx
xorl %eax, %eax
callq 0xca2d
movq %rbx, %rdi
movl %r15d, %esi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0xeaff
leaq 0x6b155(%rip), %rsi     # 0x7d3e4
leaq 0x672a3(%rip), %rcx     # 0x79539
movl $0x15, %edi
movl $0x11a1c, %edx          # imm = 0x11A1C
xorl %eax, %eax
callq 0xb9c7
movl $0x15, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0x18(%r14), %r12
movl $0x4, %r15d
testq %r12, %r12
je 0x12275
movq 0x10(%r14), %rdi
addl 0x8(%r14), %ecx
movl %ecx, %esi
movq %rax, %rcx
callq *%r8
cmpl $0x4, %eax
jne 0x122eb
movq %r12, %rdi
callq 0xeac6
movq $0x0, 0x18(%r14)
jmp 0x12275
movl %eax, 0x44(%rbx)
movl %eax, 0x94(%r12)
movl %eax, %r15d
jmp 0x12275
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3BtreeData
SQLITE_PRIVATE int sqlite3BtreeData(BtCursor *pCur, u32 offset, u32 amt, void *pBuf){
  int rc;

#ifndef SQLITE_OMIT_INCRBLOB
  if ( pCur->eState==CURSOR_INVALID ){
    return SQLITE_ABORT;
  }
#endif

  assert( cursorHoldsMutex(pCur) );
  rc = restoreCursorPosition(pCur);
  if( rc==SQLITE_OK ){
    assert( pCur->eState==CURSOR_VALID );
    assert( pCur->iPage>=0 && pCur->apPage[pCur->iPage] );
    assert( pCur->aiIdx[pCur->iPage]<pCur->apPage[pCur->iPage]->nCell );
    rc = accessPayload(pCur, offset, amt, pBuf, 0);
  }
  return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movb 0x77(%rdi), %al
testb %al, %al
je 0x12348
movq %rcx, %rbx
movl %edx, %r14d
movl %esi, %r15d
movq %rdi, %r12
cmpb $0x3, %al
jb 0x1232c
movq %r12, %rdi
callq 0x30735
testl %eax, %eax
jne 0x1234d
movq %r12, %rdi
movl %r15d, %esi
movl %r14d, %edx
movq %rbx, %rcx
xorl %r8d, %r8d
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x21511
movl $0x4, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3BtreePutData
SQLITE_PRIVATE int sqlite3BtreePutData(BtCursor *pCsr, u32 offset, u32 amt, void *z){
  int rc;
  assert( cursorHoldsMutex(pCsr) );
  assert( sqlite3_mutex_held(pCsr->pBtree->db->mutex) );
  assert( pCsr->isIncrblobHandle );

  rc = restoreCursorPosition(pCsr);
  if( rc!=SQLITE_OK ){
    return rc;
  }
  assert( pCsr->eState!=CURSOR_REQUIRESEEK );
  if( pCsr->eState!=CURSOR_VALID ){
    return SQLITE_ABORT;
  }

  /* Save the positions of all other cursors open on this table. This is
  ** required in case any of them are holding references to an xFetch
  ** version of the b-tree page modified by the accessPayload call below.
  **
  ** Note that pCsr must be open on a BTREE_INTKEY table and saveCursorPosition()
  ** and hence saveAllCursors() cannot fail on a BTREE_INTKEY table, hence
  ** saveAllCursors can only return SQLITE_OK.
  */
  VVA_ONLY(rc =) saveAllCursors(pCsr->pBt, pCsr->pgnoRoot, pCsr);
  assert( rc==SQLITE_OK );

  /* Check some assumptions: 
  **   (a) the cursor is open for writing,
  **   (b) there is a read/write transaction open,
  **   (c) the connection holds a write-lock on the table (if required),
  **   (d) there are no conflicting read-locks, and
  **   (e) the cursor points at a valid row of an intKey table.
  */
  if( !pCsr->wrFlag ){
    return SQLITE_READONLY;
  }
  assert( (pCsr->pBt->btsFlags & BTS_READ_ONLY)==0
              && pCsr->pBt->inTransaction==TRANS_WRITE );
  assert( hasSharedCacheTableLock(pCsr->pBtree, pCsr->pgnoRoot, 0, 2) );
  assert( !hasReadConflicts(pCsr->pBtree, pCsr->pgnoRoot) );
  assert( pCsr->apPage[pCsr->iPage]->intKey );

  return accessPayload(pCsr, offset, amt, (unsigned char *)z, 1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rcx, %rbx
movl %edx, %r14d
movl %esi, %r15d
movq %rdi, %r12
movb 0x77(%rdi), %cl
cmpb $0x3, %cl
jb 0x12397
movq %r12, %rdi
callq 0x30735
testl %eax, %eax
jne 0x123df
movb 0x77(%r12), %cl
movl $0x4, %eax
cmpb $0x1, %cl
jne 0x123df
movq 0x8(%r12), %rdi
movl 0x30(%r12), %esi
movq %r12, %rdx
callq 0x20df0
cmpb $0x0, 0x74(%r12)
je 0x123da
movq %r12, %rdi
movl %r15d, %esi
movl %r14d, %edx
movq %rbx, %rcx
movl $0x1, %r8d
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x21511
movl $0x8, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3_blob_reopen
SQLITE_API int sqlite3_blob_reopen(sqlite3_blob *pBlob, sqlite3_int64 iRow){
  int rc;
  Incrblob *p = (Incrblob *)pBlob;
  sqlite3 *db;

  if( p==0 ) return SQLITE_MISUSE_BKPT;
  db = p->db;
  sqlite3_mutex_enter(db->mutex);

  if( p->pStmt==0 ){
    /* If there is no statement handle, then the blob-handle has
    ** already been invalidated. Return SQLITE_ABORT in this case.
    */
    rc = SQLITE_ABORT;
  }else{
    char *zErr;
    rc = blobSeekToRow(p, iRow, &zErr);
    if( rc!=SQLITE_OK ){
      sqlite3Error(db, rc, (zErr ? "%s" : 0), zErr);
      sqlite3DbFree(db, zErr);
    }
    assert( rc!=SQLITE_SCHEMA );
  }

  rc = sqlite3ApiExit(db, rc);
  assert( rc==SQLITE_OK || p->pStmt==0 );
  sqlite3_mutex_leave(db->mutex);
  return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x12458
movq 0x20(%rdi), %rbx
cmpq $0x0, 0x18(%rdi)
je 0x12487
leaq -0x20(%rbp), %rdx
callq 0x1209b
movl %eax, %r14d
testl %eax, %eax
je 0x1248d
movq -0x20(%rbp), %r15
testq %r15, %r15
leaq 0x672a2(%rip), %rdx     # 0x796d9
cmoveq %r15, %rdx
movq %rbx, %rdi
movl %r14d, %esi
movq %r15, %rcx
xorl %eax, %eax
callq 0xca2d
movq %rbx, %rdi
movq %r15, %rsi
callq 0x9ca4
jmp 0x1248d
leaq 0x6af85(%rip), %rsi     # 0x7d3e4
leaq 0x670d3(%rip), %rcx     # 0x79539
movl $0x15, %edi
movl $0x11a67, %edx          # imm = 0x11A67
xorl %eax, %eax
callq 0xb9c7
movl $0x15, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl $0x4, %r14d
movq %rbx, %rdi
movl %r14d, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xeaff
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3_set_authorizer
SQLITE_API int sqlite3_set_authorizer(
  sqlite3 *db,
  int (*xAuth)(void*,int,const char*,const char*,const char*,const char*),
  void *pArg
){
  sqlite3_mutex_enter(db->mutex);
  db->xAuth = xAuth;
  db->pAuthArg = pArg;
  sqlite3ExpirePreparedStatements(db);
  sqlite3_mutex_leave(db->mutex);
  return SQLITE_OK;
}

// Assembly:
movq %rsi, 0x180(%rdi)
movq %rdx, 0x188(%rdi)
movq 0x8(%rdi), %rax
testq %rax, %rax
je 0x124ce
pushq %rbp
movq %rsp, %rbp
orb $0x20, 0x9a(%rax)
movq 0x68(%rax), %rax
testq %rax, %rax
jne 0x124bd
popq %rbp
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3SafetyCheckOk
SQLITE_PRIVATE int sqlite3SafetyCheckOk(sqlite3 *db){
  u32 magic;
  if( db==0 ){
    logBadConnection("NULL");
    return 0;
  }
  magic = db->magic;
  if( magic!=SQLITE_MAGIC_OPEN ){
    if( sqlite3SafetyCheckSickOrOk(db) ){
      testcase( sqlite3GlobalConfig.xLog!=0 );
      logBadConnection("unopened");
    }
    return 0;
  }else{
    return 1;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x12bf2
movl 0x5c(%rdi), %eax
cmpl $0xa029a697, %eax       # imm = 0xA029A697
je 0x12bfb
cmpl $0x4b771290, %eax       # imm = 0x4B771290
je 0x12be9
cmpl $0xf03b7906, %eax       # imm = 0xF03B7906
jne 0x12c02
leaq 0x67ebe(%rip), %rdx     # 0x7aaae
jmp 0x12c09
leaq 0x69876(%rip), %rdx     # 0x7c46f
jmp 0x12c09
movl $0x1, %ebx
jmp 0x12c1e
leaq 0x6a757(%rip), %rdx     # 0x7d360
leaq 0x67ea7(%rip), %rsi     # 0x7aab7
xorl %ebx, %ebx
movl $0x15, %edi
xorl %eax, %eax
callq 0xb9c7
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3_errcode
SQLITE_API int sqlite3_errcode(sqlite3 *db){
  if( db && !sqlite3SafetyCheckSickOrOk(db) ){
    return SQLITE_MISUSE_BKPT;
  }
  if( !db || db->mallocFailed ){
    return SQLITE_NOMEM;
  }
  return db->errCode & db->errMask;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl $0x7, %ebx
testq %rdi, %rdi
je 0x12cbd
movl 0x5c(%rdi), %eax
cmpl $0xa029a697, %eax       # imm = 0xA029A697
je 0x12c71
cmpl $0xf03b7906, %eax       # imm = 0xF03B7906
je 0x12c71
cmpl $0x4b771290, %eax       # imm = 0x4B771290
jne 0x12c7f
cmpb $0x0, 0x50(%rdi)
jne 0x12cbd
movl 0x48(%rdi), %ebx
andl 0x44(%rdi), %ebx
jmp 0x12cbd
leaq 0x67e31(%rip), %rsi     # 0x7aab7
leaq 0x6a6d3(%rip), %rdx     # 0x7d360
movl $0x15, %ebx
movl $0x15, %edi
xorl %eax, %eax
callq 0xb9c7
leaq 0x6a73f(%rip), %rsi     # 0x7d3e4
leaq 0x6688d(%rip), %rcx     # 0x79539
movl $0x15, %edi
movl $0x1cb0e, %edx          # imm = 0x1CB0E
xorl %eax, %eax
callq 0xb9c7
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3_errmsg
SQLITE_API const char *sqlite3_errmsg(sqlite3 *db){
  const char *z;
  if( !db ){
    return sqlite3ErrStr(SQLITE_NOMEM);
  }
  if( !sqlite3SafetyCheckSickOrOk(db) ){
    return sqlite3ErrStr(SQLITE_MISUSE_BKPT);
  }
  sqlite3_mutex_enter(db->mutex);
  if( db->mallocFailed ){
    z = sqlite3ErrStr(SQLITE_NOMEM);
  }else{
    z = (char*)sqlite3_value_text(db->pErr);
    assert( !db->mallocFailed );
    if( z==0 ){
      z = sqlite3ErrStr(db->errCode);
    }
  }
  sqlite3_mutex_leave(db->mutex);
  return z;
}

// Assembly:
leaq 0x66a97(%rip), %rax     # 0x79764
testq %rdi, %rdi
je 0x12d70
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x5c(%rdi), %ecx
cmpl $0xa029a697, %ecx       # imm = 0xA029A697
je 0x12cfa
cmpl $0xf03b7906, %ecx       # imm = 0xF03B7906
je 0x12cfa
cmpl $0x4b771290, %ecx       # imm = 0x4B771290
jne 0x12d2a
cmpb $0x0, 0x50(%rbx)
jne 0x12d6a
movq 0x130(%rbx), %rdi
movl $0x1, %esi
callq 0xef29
testq %rax, %rax
jne 0x12d6a
movl 0x44(%rbx), %eax
cmpq $0x204, %rax            # imm = 0x204
jne 0x12d71
leaq 0x6a5b0(%rip), %rax     # 0x7d2d8
jmp 0x12d6a
leaq 0x67d86(%rip), %rsi     # 0x7aab7
leaq 0x6a628(%rip), %rdx     # 0x7d360
movl $0x15, %edi
xorl %eax, %eax
callq 0xb9c7
leaq 0x6a699(%rip), %rsi     # 0x7d3e4
leaq 0x667e7(%rip), %rcx     # 0x79539
movl $0x15, %edi
movl $0x1cac9, %edx          # imm = 0x1CAC9
xorl %eax, %eax
callq 0xb9c7
leaq 0x6a49c(%rip), %rax     # 0x7d206
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movzbl %al, %eax
cmpl $0x1b, %eax
setae %cl
cmpq $0x2, %rax
sete %dl
orb %cl, %dl
je 0x12d8e
leaq 0x6a53e(%rip), %rax     # 0x7d2ca
jmp 0x12d6a
leaq 0x80a6b(%rip), %rcx     # 0x93800
movq (%rcx,%rax,8), %rax
jmp 0x12d6a
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3_auto_extension
SQLITE_API int sqlite3_auto_extension(void (*xInit)(void)){
  int rc = SQLITE_OK;
#ifndef SQLITE_OMIT_AUTOINIT
  rc = sqlite3_initialize();
  if( rc ){
    return rc;
  }else
#endif
  {
    int i;
#if SQLITE_THREADSAFE
    sqlite3_mutex *mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER);
#endif
    wsdAutoextInit;
    sqlite3_mutex_enter(mutex);
    for(i=0; i<wsdAutoext.nExt; i++){
      if( wsdAutoext.aExt[i]==xInit ) break;
    }
    if( i==wsdAutoext.nExt ){
      int nByte = (wsdAutoext.nExt+1)*sizeof(wsdAutoext.aExt[0]);
      void (**aNew)(void);
      aNew = sqlite3_realloc(wsdAutoext.aExt, nByte);
      if( aNew==0 ){
        rc = SQLITE_NOMEM;
      }else{
        wsdAutoext.aExt = aNew;
        wsdAutoext.aExt[wsdAutoext.nExt] = xInit;
        wsdAutoext.nExt++;
      }
    }
    sqlite3_mutex_leave(mutex);
    assert( (rc&0xff)==rc );
    return rc;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
callq 0x9d86
movl %eax, %r14d
testl %eax, %eax
je 0x12dc1
movl %r14d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movslq 0x830b0(%rip), %r12     # 0x95e78
xorl %r14d, %r14d
movl $0x0, %eax
testq %r12, %r12
jle 0x12dee
movq 0x830a4(%rip), %rcx     # 0x95e80
xorl %eax, %eax
cmpq %rbx, (%rcx,%rax,8)
je 0x12dee
incq %rax
cmpq %rax, %r12
jne 0x12dde
jmp 0x12df3
cmpl %r12d, %eax
jne 0x12db5
movq 0x83086(%rip), %r15     # 0x95e80
callq 0x9d86
movl $0x7, %r14d
testl %eax, %eax
jne 0x12db5
leal 0x8(,%r12,8), %esi
movq %r15, %rdi
callq 0xa45c
testq %rax, %rax
je 0x12db5
movq %rax, 0x8305b(%rip)     # 0x95e80
movslq 0x8304c(%rip), %rcx     # 0x95e78
movq %rbx, (%rax,%rcx,8)
leal 0x1(%rcx), %eax
movl %eax, 0x8303f(%rip)     # 0x95e78
xorl %r14d, %r14d
jmp 0x12db5
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3_cancel_auto_extension
SQLITE_API int sqlite3_cancel_auto_extension(void (*xInit)(void)){
#if SQLITE_THREADSAFE
  sqlite3_mutex *mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER);
#endif
  int i;
  int n = 0;
  wsdAutoextInit;
  sqlite3_mutex_enter(mutex);
  for(i=wsdAutoext.nExt-1; i>=0; i--){
    if( wsdAutoext.aExt[i]==xInit ){
      wsdAutoext.nExt--;
      wsdAutoext.aExt[i] = wsdAutoext.aExt[wsdAutoext.nExt];
      n++;
      break;
    }
  }
  sqlite3_mutex_leave(mutex);
  return n;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl 0x8302d(%rip), %ecx     # 0x95e78
movq 0x8302e(%rip), %rax     # 0x95e80
movq %rcx, %rsi
testl %esi, %esi
jle 0x12e83
leaq -0x1(%rsi), %rdx
cmpq %rdi, -0x8(%rax,%rsi,8)
movq %rdx, %rsi
jne 0x12e55
leal -0x1(%rcx), %esi
movl %esi, 0x83008(%rip)     # 0x95e78
movslq %ecx, %rcx
movq -0x8(%rax,%rcx,8), %rcx
movq %rcx, (%rax,%rdx,8)
movl $0x1, %eax
jmp 0x12e85
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3LockAndPrepare
static int sqlite3LockAndPrepare(
  sqlite3 *db,              /* Database handle. */
  const char *zSql,         /* UTF-8 encoded SQL statement. */
  int nBytes,               /* Length of zSql in bytes. */
  int saveSqlFlag,          /* True to copy SQL text into the sqlite3_stmt */
  Vdbe *pOld,               /* VM being reprepared */
  sqlite3_stmt **ppStmt,    /* OUT: A pointer to the prepared statement */
  const char **pzTail       /* OUT: End of parsed string */
){
  int rc;
  assert( ppStmt!=0 );
  *ppStmt = 0;
  if( !sqlite3SafetyCheckOk(db) ){
    return SQLITE_MISUSE_BKPT;
  }
  sqlite3_mutex_enter(db->mutex);
  sqlite3BtreeEnterAll(db);
  rc = sqlite3Prepare(db, zSql, nBytes, saveSqlFlag, pOld, ppStmt, pzTail);
  if( rc==SQLITE_SCHEMA ){
    sqlite3_finalize(*ppStmt);
    rc = sqlite3Prepare(db, zSql, nBytes, saveSqlFlag, pOld, ppStmt, pzTail);
  }
  sqlite3BtreeLeaveAll(db);
  sqlite3_mutex_leave(db->mutex);
  assert( rc==SQLITE_OK || *ppStmt==0 );
  return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r8, -0x40(%rbp)
movl %ecx, %r12d
movl %edx, %r13d
movq %rsi, %r15
movq %rdi, %r14
movq 0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
movq %r9, %rbx
movq $0x0, (%r9)
callq 0x12bc6
testl %eax, %eax
je 0x12fac
movslq 0x28(%r14), %rax
testq %rax, %rax
movq -0x40(%rbp), %r10
movl %r12d, %ecx
jle 0x12f4e
movq 0x20(%r14), %r8
shlq $0x5, %rax
xorl %edx, %edx
movq 0x8(%r8,%rdx), %r9
testq %r9, %r9
je 0x12f45
movq (%r9), %rdi
movq 0x8(%r9), %r9
movq %rdi, 0x8(%r9)
addq $0x20, %rdx
cmpq %rdx, %rax
jne 0x12f30
movq -0x30(%rbp), %rax
movq %rax, (%rsp)
movq %r14, %rdi
movq %r15, %rsi
movl %r13d, %edx
movq %r10, %r12
movl %ecx, -0x30(%rbp)
movq %r10, %r8
movl %r13d, -0x34(%rbp)
movq %r15, %r13
movq %rbx, %r9
callq 0x37042
movl %eax, %r15d
cmpl $0x11, %eax
jne 0x12fd1
movq (%rbx), %rdi
callq 0xea51
movq %r14, %rdi
movq %r13, %rsi
movl -0x34(%rbp), %edx
movl -0x30(%rbp), %ecx
movq %r12, %r8
movq %rbx, %r9
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x37042
leaq 0x6a431(%rip), %rsi     # 0x7d3e4
leaq 0x6657f(%rip), %rcx     # 0x79539
movl $0x15, %r15d
movl $0x15, %edi
movl $0x17814, %edx          # imm = 0x17814
xorl %eax, %eax
callq 0xb9c7
movl %r15d, %eax
addq $0x28, %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: sqlite3_free_table
SQLITE_API void sqlite3_free_table(
  char **azResult            /* Result returned from from sqlite3_get_table() */
){
  if( azResult ){
    int i, n;
    azResult--;
    assert( azResult!=0 );
    n = SQLITE_PTR_TO_INT(azResult[0]);
    for(i=1; i<n; i++){ if( azResult[i] ) sqlite3_free(azResult[i]); }
    sqlite3_free(azResult);
  }
}

// Assembly:
testq %rdi, %rdi
je 0x1350a
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
leaq -0x8(%rdi), %r14
movq -0x8(%rdi), %r15
cmpl $0x2, %r15d
jl 0x134fa
andl $0x7fffffff, %r15d      # imm = 0x7FFFFFFF
decq %r15
xorl %r12d, %r12d
movq (%rbx,%r12,8), %rdi
testq %rdi, %rdi
je 0x134f2
callq 0xa3c7
incq %r12
cmpq %r12, %r15
jne 0x134e4
movq %r14, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0xa3c7
retq
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: createModule
static int createModule(
  sqlite3 *db,                    /* Database in which module is registered */
  const char *zName,              /* Name assigned to this module */
  const sqlite3_module *pModule,  /* The definition of the module */
  void *pAux,                     /* Context pointer for xCreate/xConnect */
  void (*xDestroy)(void *)        /* Module destructor function */
){
  int rc = SQLITE_OK;
  int nName;

  sqlite3_mutex_enter(db->mutex);
  nName = sqlite3Strlen30(zName);
  if( sqlite3HashFind(&db->aModule, zName, nName) ){
    rc = SQLITE_MISUSE_BKPT;
  }else{
    Module *pMod;
    pMod = (Module *)sqlite3DbMallocRaw(db, sizeof(Module) + nName + 1);
    if( pMod ){
      Module *pDel;
      char *zCopy = (char *)(&pMod[1]);
      memcpy(zCopy, zName, nName+1);
      pMod->zName = zCopy;
      pMod->pModule = pModule;
      pMod->pAux = pAux;
      pMod->xDestroy = xDestroy;
      pDel = (Module *)sqlite3HashInsert(&db->aModule,zCopy,nName,(void*)pMod);
      assert( pDel==0 || pDel==pMod );
      if( pDel ){
        db->mallocFailed = 1;
        sqlite3DbFree(db, pDel);
      }
    }
  }
  rc = sqlite3ApiExit(db, rc);
  if( rc!=SQLITE_OK && xDestroy ) xDestroy(pAux);

  sqlite3_mutex_leave(db->mutex);
  return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r8, %r15
movq %rcx, -0x30(%rbp)
movq %rdx, -0x48(%rbp)
movq %rsi, %r14
movq %rdi, %r12
testq %rsi, %rsi
je 0x1355a
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
movq %r14, %rax
incl %r13d
cmpb $0x0, (%rax)
leaq 0x1(%rax), %rax
jne 0x13545
andl $0x3fffffff, %r13d      # imm = 0x3FFFFFFF
jmp 0x1355d
xorl %r13d, %r13d
leaq 0x1a8(%r12), %rbx
movq %rbx, %rdi
movq %r14, %rsi
movl %r13d, %edx
callq 0x3406c
testq %rax, %rax
je 0x135a5
leaq 0x69e65(%rip), %rsi     # 0x7d3e4
leaq 0x65fb3(%rip), %rcx     # 0x79539
movl $0x15, %ebx
movl $0x15, %edi
movl $0x19517, %edx          # imm = 0x19517
xorl %eax, %eax
callq 0xb9c7
movq -0x30(%rbp), %r14
jmp 0x1363a
leal 0x21(%r13), %esi
movq %r12, -0x38(%rbp)
movq %r12, %rdi
callq 0x11721
testq %rax, %rax
je 0x13630
movq %rax, %r12
movq %r15, -0x40(%rbp)
movq %rax, %r15
addq $0x20, %r15
leal 0x1(%r13), %edx
movq %r15, %rdi
movq %r14, %rsi
callq 0x82f0
movq %r15, 0x8(%r12)
movq -0x48(%rbp), %rax
movq %rax, (%r12)
movq -0x30(%rbp), %rax
movq %rax, 0x10(%r12)
movq -0x40(%rbp), %rax
movq %rax, %r14
movq %rax, 0x18(%r12)
movq %rbx, %rdi
movq %r15, %rsi
movl %r13d, %edx
movq %r12, %rcx
callq 0x34400
testq %rax, %rax
je 0x1362d
movq -0x38(%rbp), %r12
movb $0x1, 0x50(%r12)
movq %r12, %rdi
movq %rax, %rsi
callq 0x9ca4
movq %r14, %r15
movq -0x30(%rbp), %r14
jmp 0x13638
movq %r14, %r15
movq -0x30(%rbp), %r14
movq -0x38(%rbp), %r12
xorl %ebx, %ebx
movq %r12, %rdi
movl %ebx, %esi
callq 0xeaff
movl %eax, %ebx
testl %eax, %eax
sete %al
testq %r15, %r15
sete %cl
orb %al, %cl
jne 0x1365b
movq %r14, %rdi
callq *%r15
movl %ebx, %eax
addq $0x28, %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: sqlite3_vtab_config
SQLITE_API int sqlite3_vtab_config(sqlite3 *db, int op, ...){
  va_list ap;
  int rc = SQLITE_OK;

  sqlite3_mutex_enter(db->mutex);

  va_start(ap, op);
  switch( op ){
    case SQLITE_VTAB_CONSTRAINT_SUPPORT: {
      VtabCtx *p = db->pVtabCtx;
      if( !p ){
        rc = SQLITE_MISUSE_BKPT;
      }else{
        assert( p->pTab==0 || (p->pTab->tabFlags & TF_Virtual)!=0 );
        p->pVTable->bConstraint = (u8)va_arg(ap, int);
      }
      break;
    }
    default:
      rc = SQLITE_MISUSE_BKPT;
      break;
  }
  va_end(ap);

  if( rc!=SQLITE_OK ) sqlite3Error(db, rc, 0);
  sqlite3_mutex_leave(db->mutex);
  return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0xd0, %rsp
movq %rdi, %rbx
leaq -0xe0(%rbp), %rdi
movq %rdx, 0x10(%rdi)
movq %rcx, 0x18(%rdi)
movq %r8, 0x20(%rdi)
movq %r9, 0x28(%rdi)
testb %al, %al
je 0x13d1c
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)
movq %rdi, -0x20(%rbp)
leaq 0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, -0x30(%rbp)
movl $0x19926, %edx          # imm = 0x19926
cmpl $0x1, %esi
jne 0x13d69
movq 0x1c0(%rbx), %rax
testq %rax, %rax
je 0x13d64
movl -0x30(%rbp), %edx
cmpq $0x28, %rdx
ja 0x13d9c
movq %rdx, %rcx
addq -0x20(%rbp), %rcx
addl $0x8, %edx
movl %edx, -0x30(%rbp)
jmp 0x13da8
movl $0x1991e, %edx          # imm = 0x1991E
leaq 0x69674(%rip), %rsi     # 0x7d3e4
leaq 0x657c2(%rip), %rcx     # 0x79539
movl $0x15, %r14d
movl $0x15, %edi
xorl %eax, %eax
callq 0xb9c7
movq %rbx, %rdi
movl $0x15, %esi
xorl %edx, %edx
xorl %eax, %eax
callq 0xca2d
jmp 0x13db3
movq -0x28(%rbp), %rcx
leaq 0x8(%rcx), %rdx
movq %rdx, -0x28(%rbp)
movb (%rcx), %cl
movq (%rax), %rax
movb %cl, 0x1c(%rax)
xorl %r14d, %r14d
movl %r14d, %eax
addq $0xd0, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3_complete16
SQLITE_API int sqlite3_complete16(const void *zSql){
  sqlite3_value *pVal;
  char const *zSql8;
  int rc = SQLITE_NOMEM;

#ifndef SQLITE_OMIT_AUTOINIT
  rc = sqlite3_initialize();
  if( rc ) return rc;
#endif
  pVal = sqlite3ValueNew(0);
  sqlite3ValueSetStr(pVal, -1, zSql, SQLITE_UTF16NATIVE, SQLITE_STATIC);
  zSql8 = sqlite3ValueText(pVal, SQLITE_UTF8);
  if( zSql8 ){
    rc = sqlite3_complete(zSql8);
  }else{
    rc = SQLITE_NOMEM;
  }
  sqlite3ValueFree(pVal);
  return sqlite3ApiExit(0, rc);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
callq 0x9d86
movl %eax, %r15d
testl %eax, %eax
jne 0x142e4
cmpl $0x0, 0x801ad(%rip)     # 0x94400
je 0x1426b
leaq -0x20(%rbp), %rbx
movl $0x38, %edi
movq %rbx, %rsi
callq 0x171f8
movq (%rbx), %rbx
jmp 0x14279
movl $0x38, %edi
callq *0x801aa(%rip)          # 0x94420
movq %rax, %rbx
testq %rbx, %rbx
je 0x142b6
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rbx)
movups %xmm0, 0x28(%rbx)
movups %xmm0, 0x8(%rbx)
movw $0x1, 0x24(%rbx)
movb $0x5, 0x26(%rbx)
movq $0x0, (%rbx)
movq %rbx, %rdi
movq %r14, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl $0x2, %ecx
xorl %r8d, %r8d
callq 0xf0d7
movq %rbx, %rdi
movl $0x1, %esi
callq 0xef29
testq %rax, %rax
je 0x142d6
movq %rax, %rdi
callq 0x13dc2
movzbl %al, %r15d
jmp 0x142dc
movl $0x7, %r15d
movq %rbx, %rdi
callq 0x142f2
movl %r15d, %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: sqlite3_shutdown
SQLITE_API int sqlite3_shutdown(void){
  if( sqlite3GlobalConfig.isInit ){
#ifdef SQLITE_EXTRA_SHUTDOWN
    void SQLITE_EXTRA_SHUTDOWN(void);
    SQLITE_EXTRA_SHUTDOWN();
#endif
    sqlite3_os_end();
    sqlite3_reset_auto_extension();
    sqlite3GlobalConfig.isInit = 0;
  }
  if( sqlite3GlobalConfig.isPCacheInit ){
    sqlite3PcacheShutdown();
    sqlite3GlobalConfig.isPCacheInit = 0;
  }
  if( sqlite3GlobalConfig.isMallocInit ){
    sqlite3MallocEnd();
    sqlite3GlobalConfig.isMallocInit = 0;

#ifndef SQLITE_OMIT_SHUTDOWN_DIRECTORIES
    /* The heap subsystem has now been shutdown and these values are supposed
    ** to be NULL or point to memory that was obtained from sqlite3_malloc(),
    ** which would rely on that heap subsystem; therefore, make sure these
    ** values cannot refer to heap memory that was just invalidated when the
    ** heap subsystem was shutdown.  This is only done if the current call to
    ** this function resulted in the heap subsystem actually being shutdown.
    */
    sqlite3_data_directory = 0;
    sqlite3_temp_directory = 0;
#endif
  }
  if( sqlite3GlobalConfig.isMutexInit ){
    sqlite3MutexEnd();
    sqlite3GlobalConfig.isMutexInit = 0;
  }

  return SQLITE_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
cmpl $0x0, 0x80211(%rip)     # 0x94560
je 0x14360
callq 0x12e87
movl $0x0, 0x80200(%rip)     # 0x94560
cmpl $0x0, 0x80209(%rip)     # 0x94570
je 0x14388
movq 0x80150(%rip), %rax     # 0x944c0
testq %rax, %rax
je 0x1437e
movq 0x80134(%rip), %rdi     # 0x944b0
callq *%rax
movl $0x0, 0x801e8(%rip)     # 0x94570
cmpl $0x0, 0x801dd(%rip)     # 0x9456c
je 0x143df
movq 0x800b8(%rip), %rax     # 0x94450
testq %rax, %rax
je 0x143a6
movq 0x800b4(%rip), %rdi     # 0x94458
callq *%rax
xorps %xmm0, %xmm0
movups %xmm0, 0x819a8(%rip)    # 0x95d58
movups %xmm0, 0x81991(%rip)    # 0x95d48
movups %xmm0, 0x8197a(%rip)    # 0x95d38
xorl %eax, %eax
movq %rax, 0x819a1(%rip)     # 0x95d68
movl $0x0, 0x8019b(%rip)     # 0x9456c
movq %rax, 0x81ab8(%rip)     # 0x95e90
movq %rax, 0x81aa9(%rip)     # 0x95e88
cmpl $0x0, 0x80182(%rip)     # 0x94568
je 0x143f2
movl $0x0, 0x80176(%rip)     # 0x94568
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3_db_release_memory
SQLITE_API int sqlite3_db_release_memory(sqlite3 *db){
  int i;
  sqlite3_mutex_enter(db->mutex);
  sqlite3BtreeEnterAll(db);
  for(i=0; i<db->nDb; i++){
    Btree *pBt = db->aDb[i].pBt;
    if( pBt ){
      Pager *pPager = sqlite3BtreePager(pBt);
      sqlite3PagerShrink(pPager);
    }
  }
  sqlite3BtreeLeaveAll(db);
  sqlite3_mutex_leave(db->mutex);
  return SQLITE_OK;
}

// Assembly:
movslq 0x28(%rdi), %rax
testq %rax, %rax
jle 0x14a23
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x20(%rdi), %rcx
movq %rax, %rdx
shlq $0x5, %rdx
xorl %esi, %esi
movq 0x8(%rcx,%rsi), %rdi
testq %rdi, %rdi
je 0x149c7
movq (%rdi), %r8
movq 0x8(%rdi), %rdi
movq %r8, 0x8(%rdi)
addq $0x20, %rsi
cmpq %rsi, %rdx
jne 0x149b2
testl %eax, %eax
jle 0x14a19
movl $0x8, %r14d
xorl %r15d, %r15d
movq 0x20(%rbx), %rcx
movq (%rcx,%r14), %rcx
testq %rcx, %rcx
je 0x14a0a
movq 0x8(%rcx), %rcx
movq (%rcx), %rcx
movq 0x110(%rcx), %rcx
movq 0x40(%rcx), %rdi
testq %rdi, %rdi
je 0x14a0a
callq *0x7fb01(%rip)          # 0x94508
movl 0x28(%rbx), %eax
incq %r15
movslq %eax, %rcx
addq $0x20, %r14
cmpq %rcx, %r15
jl 0x149dd
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
xorl %eax, %eax
retq