LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3_column_value
SQLITE_API sqlite3_value *sqlite3_column_value(sqlite3_stmt *pStmt, int i){
  Mem *pOut = columnMem(pStmt, i);
  if( pOut->flags&MEM_Static ){
    pOut->flags &= ~MEM_Static;
    pOut->flags |= MEM_Ephem;
  }
  columnMallocFailure(pStmt);
  return (sqlite3_value *)pOut;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
callq 0xf53c
movq %rax, %r14
movl 0x24(%rax), %eax
btl $0xb, %eax
jae 0xf6df
andl $0xffffe7ff, %eax       # imm = 0xFFFFE7FF
orl $0x1000, %eax           # imm = 0x1000
movw %ax, 0x24(%r14)
movq %rbx, %rdi
callq 0xf58b
movq %r14, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: bindText
static int bindText(
  sqlite3_stmt *pStmt,   /* The statement to bind against */
  int i,                 /* Index of the parameter to bind */
  const void *zData,     /* Pointer to the data to be bound */
  int nData,             /* Number of bytes of data to be bound */
  void (*xDel)(void*),   /* Destructor for the data */
  u8 encoding            /* Encoding for the data */
){
  Vdbe *p = (Vdbe *)pStmt;
  Mem *pVar;
  int rc;

  rc = vdbeUnbind(p, i);
  if( rc==SQLITE_OK ){
    if( zData!=0 ){
      pVar = &p->aVar[i-1];
      rc = sqlite3VdbeMemSetStr(pVar, zData, nData, encoding, xDel);
      if( rc==SQLITE_OK && encoding!=0 ){
        rc = sqlite3VdbeChangeEncoding(pVar, ENC(p->db));
      }
      sqlite3Error(p->db, rc, 0);
      rc = sqlite3ApiExit(p->db, rc);
    }
    sqlite3_mutex_leave(p->db->mutex);
  }else if( xDel!=SQLITE_STATIC && xDel!=SQLITE_TRANSIENT ){
    xDel((void*)zData);
  }
  return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r9d, -0x30(%rbp)
movq %r8, %rbx
movl %ecx, -0x2c(%rbp)
movq %rdx, %r14
movl %esi, %r12d
movq %rdi, %r15
callq 0xf8ec
testl %eax, %eax
je 0xf80b
movl %eax, %r13d
leaq 0x1(%rbx), %rax
cmpq $0x2, %rax
jb 0xf890
movq %r14, %rdi
callq *%rbx
jmp 0xf890
movl -0x30(%rbp), %edi
movl -0x2c(%rbp), %edx
testq %r14, %r14
je 0xf88d
movq 0x78(%r15), %rax
movslq %r12d, %rcx
imulq $0x38, %rcx, %rcx
leaq (%rax,%rcx), %r13
addq $-0x38, %r13
movzbl %dil, %r12d
movq %r13, %rdi
movq %r14, %rsi
movl %r12d, %ecx
movq %rbx, %r8
callq 0xe1d3
movl %eax, %r14d
testb %r12b, %r12b
je 0xf865
testl %r14d, %r14d
jne 0xf865
movq (%r15), %rax
movq 0x20(%rax), %rax
movq 0x18(%rax), %rax
movzbl 0x71(%rax), %esi
movq %r13, %rdi
callq 0x2144b
movl %eax, %r14d
movq (%r15), %rdi
movl %r14d, %esi
xorl %edx, %edx
xorl %eax, %eax
callq 0xbdb1
movq (%r15), %rdi
movl %r14d, %esi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xdc59
xorl %r13d, %r13d
movl %r13d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3_bind_double
SQLITE_API int sqlite3_bind_double(sqlite3_stmt *pStmt, int i, double rValue){
  int rc;
  Vdbe *p = (Vdbe *)pStmt;
  rc = vdbeUnbind(p, i);
  if( rc==SQLITE_OK ){
    sqlite3VdbeMemSetDouble(&p->aVar[i-1], rValue);
    sqlite3_mutex_leave(p->db->mutex);
  }
  return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movsd %xmm0, -0x20(%rbp)
movl %esi, %r14d
movq %rdi, %r15
callq 0xf8ec
movl %eax, %ebx
testl %eax, %eax
jne 0xf8df
movq 0x78(%r15), %rax
movslq %r14d, %rcx
imulq $0x38, %rcx, %rcx
leaq (%rax,%rcx), %rdi
addq $-0x38, %rdi
movsd -0x20(%rbp), %xmm0
callq 0xe166
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: vdbeUnbind
static int vdbeUnbind(Vdbe *p, int i){
  Mem *pVar;
  if( vdbeSafetyNotNull(p) ){
    return SQLITE_MISUSE_BKPT;
  }
  sqlite3_mutex_enter(p->db->mutex);
  if( p->magic!=VDBE_MAGIC_RUN || p->pc>=0 ){
    sqlite3Error(p->db, SQLITE_MISUSE, 0);
    sqlite3_mutex_leave(p->db->mutex);
    sqlite3_log(SQLITE_MISUSE, 
        "bind on a busy prepared statement: [%s]", p->zSql);
    return SQLITE_MISUSE_BKPT;
  }
  if( i<1 || i>p->nVar ){
    sqlite3Error(p->db, SQLITE_RANGE, 0);
    sqlite3_mutex_leave(p->db->mutex);
    return SQLITE_RANGE;
  }
  i--;
  pVar = &p->aVar[i];
  sqlite3VdbeMemRelease(pVar);
  pVar->flags = MEM_Null;
  sqlite3Error(p->db, SQLITE_OK, 0);

  /* If the bit corresponding to this variable in Vdbe.expmask is set, then 
  ** binding a new value to this variable invalidates the current query plan.
  **
  ** IMPLEMENTATION-OF: R-48440-37595 If the specific value bound to host
  ** parameter in the WHERE clause might influence the choice of query plan
  ** for a statement, then the statement will be automatically recompiled,
  ** as if there had been a schema change, on the first sqlite3_step() call
  ** following any change to the bindings of that parameter.
  */
  if( p->isPrepareV2 &&
     ((i<32 && p->expmask & ((u32)1 << i)) || p->expmask==0xffffffff)
  ){
    p->expired = 1;
  }
  return SQLITE_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %r15d
movq %rdi, %rbx
callq 0xf150
testl %eax, %eax
je 0xf919
movl $0xfb2b, %edi           # imm = 0xFB2B
callq 0x9008
pushq $0x15
popq %r14
jmp 0xf960
cmpl $0xbdf20da3, 0x50(%rbx) # imm = 0xBDF20DA3
jne 0xf92b
cmpl $0x0, 0x90(%rbx)
js 0xf972
movq (%rbx), %rdi
pushq $0x15
popq %r14
movl %r14d, %esi
xorl %edx, %edx
xorl %eax, %eax
callq 0xbdb1
movq 0xe0(%rbx), %rdx
leaq 0x5d05d(%rip), %rsi     # 0x6c9a9
movl %r14d, %edi
xorl %eax, %eax
callq 0xaf99
movl $0xfb33, %edi           # imm = 0xFB33
callq 0x9008
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testl %r15d, %r15d
jle 0xf983
movswl 0x88(%rbx), %eax
cmpl %r15d, %eax
jge 0xf998
movq (%rbx), %rdi
pushq $0x19
popq %r14
movl %r14d, %esi
xorl %edx, %edx
xorl %eax, %eax
callq 0xbdb1
jmp 0xf960
leal -0x1(%r15), %r12d
movq 0x78(%rbx), %r14
imulq $0x38, %r12, %r13
leaq (%r14,%r13), %rdi
callq 0xde44
movw $0x1, 0x24(%r14,%r13)
movq (%rbx), %rdi
xorl %r14d, %r14d
xorl %esi, %esi
xorl %edx, %edx
xorl %eax, %eax
callq 0xbdb1
movzwl 0x9a(%rbx), %eax
btl $0xa, %eax
jae 0xf960
movl 0x104(%rbx), %ecx
cmpl $0x20, %r15d
ja 0xf9ea
btl %r12d, %ecx
jb 0xf9f3
jmp 0xf960
cmpl $-0x1, %ecx
jne 0xf960
orl $0x20, %eax
movw %ax, 0x9a(%rbx)
jmp 0xf960
// File: /workspace/github_c_makefile_star2_O2/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3_bind_int64
SQLITE_API int sqlite3_bind_int64(sqlite3_stmt *pStmt, int i, sqlite_int64 iValue){
  int rc;
  Vdbe *p = (Vdbe *)pStmt;
  rc = vdbeUnbind(p, i);
  if( rc==SQLITE_OK ){
    sqlite3VdbeMemSetInt64(&p->aVar[i-1], iValue);
    sqlite3_mutex_leave(p->db->mutex);
  }
  return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %rbx
movl %esi, %r15d
movq %rdi, %r12
callq 0xf8ec
movl %eax, %r14d
testl %eax, %eax
jne 0xfa4b
movq 0x78(%r12), %rax
movslq %r15d, %rcx
imulq $0x38, %rcx, %rcx
leaq (%rax,%rcx), %rdi
addq $-0x38, %rdi
movq %rbx, %rsi
callq 0xe3ff
movl %r14d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3_bind_value
SQLITE_API int sqlite3_bind_value(sqlite3_stmt *pStmt, int i, const sqlite3_value *pValue){
  int rc;
  switch( pValue->type ){
    case SQLITE_INTEGER: {
      rc = sqlite3_bind_int64(pStmt, i, pValue->u.i);
      break;
    }
    case SQLITE_FLOAT: {
      rc = sqlite3_bind_double(pStmt, i, pValue->r);
      break;
    }
    case SQLITE_BLOB: {
      if( pValue->flags & MEM_Zero ){
        rc = sqlite3_bind_zeroblob(pStmt, i, pValue->u.nZero);
      }else{
        rc = sqlite3_bind_blob(pStmt, i, pValue->z, pValue->n,SQLITE_TRANSIENT);
      }
      break;
    }
    case SQLITE_TEXT: {
      rc = bindText(pStmt,i,  pValue->z, pValue->n, SQLITE_TRANSIENT,
                              pValue->enc);
      break;
    }
    default: {
      rc = sqlite3_bind_null(pStmt, i);
      break;
    }
  }
  return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movzbl 0x26(%rdx), %eax
decl %eax
cmpl $0x3, %eax
ja 0xfaf4
leaq 0x57625(%rip), %rcx     # 0x670bc
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x18(%rdx), %rdx
popq %rbp
jmp 0xfa0f
movq 0x8(%rdx), %rax
movl 0x20(%rdx), %ecx
movzbl 0x27(%rdx), %r9d
movabsq $-0x1, %r8
movq %rax, %rdx
popq %rbp
jmp 0xf7c6
testb $0x40, 0x25(%rdx)
jne 0xfafa
movq 0x8(%rdx), %rax
movl 0x20(%rdx), %ecx
movabsq $-0x1, %r8
movq %rax, %rdx
popq %rbp
jmp 0xf7bc
movsd 0x10(%rdx), %xmm0
popq %rbp
jmp 0xf8a2
popq %rbp
jmp 0xf8ec
movl 0x18(%rdx), %edx
popq %rbp
jmp 0xfb03
// File: /workspace/github_c_makefile_star2_O2/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 0xf8ec
movl %eax, %r14d
testl %eax, %eax
jne 0xfb3d
movq 0x78(%r12), %rax
movslq %r15d, %rcx
imulq $0x38, %rcx, %rcx
leaq (%rax,%rcx), %rdi
addq $-0x38, %rdi
movl %ebx, %esi
callq 0xe558
movl %r14d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 %r15d, %r15d
orb %al, %cl
jne 0xfc2b
movq %rdi, %r14
movzwl 0x8a(%rdi), %eax
movslq %edx, %r12
xorl %ecx, %ecx
testw %ax, %ax
cmovlel %ecx, %eax
movzwl %ax, %ebx
xorl %r15d, %r15d
cmpq %r15, %rbx
je 0xfc28
movq 0x80(%r14), %rax
movq (%rax,%r15,8), %r13
testq %r13, %r13
je 0xfc23
movq %r13, %rdi
movq -0x30(%rbp), %rsi
movq %r12, %rdx
callq 0x8190
testl %eax, %eax
jne 0xfc23
cmpb $0x0, (%r13,%r12)
je 0xfc3d
incq %r15
jmp 0xfbf3
xorl %r15d, %r15d
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
incl %r15d
jmp 0xfc2b
// File: /workspace/github_c_makefile_star2_O2/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), %eax
cmpw 0x88(%rsi), %ax
jne 0xfc9f
movzwl 0x9a(%rsi), %eax
btl $0xa, %eax
jae 0xfc72
cmpl $0x0, 0x104(%rsi)
je 0xfc72
orl $0x20, %eax
movw %ax, 0x9a(%rsi)
movzwl 0x9a(%rdi), %eax
btl $0xa, %eax
jae 0xfc92
cmpl $0x0, 0x104(%rdi)
je 0xfc92
orl $0x20, %eax
movw %ax, 0x9a(%rdi)
pushq %rbp
movq %rsp, %rbp
callq 0xfca3
xorl %eax, %eax
popq %rbp
retq
pushq $0x1
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O2/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:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
xorl %r15d, %r15d
xorl %r12d, %r12d
movswq 0x88(%r14), %rax
cmpq %rax, %r12
jge 0xfce3
movq 0x78(%rbx), %rdi
addq %r15, %rdi
movq 0x78(%r14), %rsi
addq %r15, %rsi
callq 0x29949
incq %r12
addq $0x38, %r15
jmp 0xfcba
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0xfd71
andl $0x0, 0xac(%rdi,%rcx,4)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0xfd99
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0xfd9d
movq %rbx, %rdi
callq 0xfe30
movb 0x26(%rbx), %al
addq $0x8, %rsp
popq %rbx
popq %rbp
movzbl %al, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/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 0xfe21
testb $0x2, %r13b
je 0xfe21
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 0x20fe3
testl %eax, %eax
je 0xfe21
leaq -0x30(%rbp), %rsi
movq %r15, %rdi
movl %r14d, %edx
movl %r12d, %ecx
callq 0x15296
testl %eax, %eax
je 0xfe0b
movsd -0x38(%rbp), %xmm0
movsd %xmm0, 0x10(%rbx)
movw $0x8, %ax
jmp 0xfe17
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_O2/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 0xfe4e
testb $0x4, %al
jne 0xfe54
testb $0x8, %al
jne 0xfe5a
testb $0x2, %al
jne 0xfe60
movb $0x4, 0x26(%rdi)
jmp 0xfe64
movb $0x5, 0x26(%rdi)
jmp 0xfe64
movb $0x1, 0x26(%rdi)
jmp 0xfe64
movb $0x2, 0x26(%rdi)
jmp 0xfe64
movb $0x3, 0x26(%rdi)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
testq %rdi, %rdi
je 0x10425
cmpb $0x0, 0x50(%rbx)
jne 0x10442
cmpb $0x0, 0x152(%rbx)
je 0x10425
movzwl 0x150(%rbx), %ecx
movl $0x160, %eax            # imm = 0x160
cmpl %esi, %ecx
jl 0x10422
movq 0x168(%rbx), %rax
testq %rax, %rax
je 0x1041d
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 0x10444
movl %ecx, 0x158(%rbx)
jmp 0x10444
movl $0x164, %eax            # imm = 0x164
incl (%rbx,%rax)
testq %rbx, %rbx
sete %r14b
movl %esi, %edi
callq 0x9c40
testq %rax, %rax
setne %cl
orb %r14b, %cl
jne 0x10444
movb $0x1, 0x50(%rbx)
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x31240
testl %eax, %eax
je 0x1046d
xorl %eax, %eax
jmp 0x10480
movq (%rbx), %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x2eff6
testq %rax, %rax
je 0x10489
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
testl %r12d, %r12d
leaq 0x5c589(%rip), %rax     # 0x6ca1c
leaq 0x5c575(%rip), %rdx     # 0x6ca0f
cmoveq %rax, %rdx
testq %r15, %r15
je 0x104bc
leaq 0x5c580(%rip), %rsi     # 0x6ca2a
movq %rbx, %rdi
movq %r15, %rcx
movq %r14, %r8
xorl %eax, %eax
callq 0x104d6
jmp 0x104d0
leaq 0x5c571(%rip), %rsi     # 0x6ca34
movq %rbx, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x104d6
movb $0x1, 0x1d(%rbx)
jmp 0x10469
// File: /workspace/github_c_makefile_star2_O2/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 0x1052d
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 0x174b9
movq %rax, %r15
cmpb $0x0, 0x53(%r14)
je 0x1056c
movq %r14, %rdi
movq %r15, %rsi
callq 0x968b
jmp 0x10586
incl 0x50(%rbx)
movq 0x8(%rbx), %rsi
movq %r14, %rdi
callq 0x968b
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_O2/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 %rbx
pushq %rax
movq %rdi, %rbx
movl $0x128, %esi            # imm = 0x128
callq 0xf4ae
testq %rax, %rax
je 0x10647
movq %rbx, (%rax)
movq 0x8(%rbx), %rcx
testq %rcx, %rcx
je 0x10633
movq %rax, 0x60(%rcx)
movq %rcx, 0x68(%rax)
andq $0x0, 0x60(%rax)
movq %rax, 0x8(%rbx)
movl $0x26bceaa5, 0x50(%rax) # imm = 0x26BCEAA5
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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, %r14
movl %esi, %ebx
movq %rdi, %r15
movl 0x34(%rdi), %eax
leal (%rax,%rbx), %ecx
cmpl 0x38(%rdi), %ecx
jle 0x106c3
movq %r15, %rdi
callq 0x31024
movl %eax, %ecx
xorl %eax, %eax
testl %ecx, %ecx
jne 0x10742
movl 0x34(%r15), %eax
xorl %ecx, %ecx
testl %ebx, %ebx
movl $0x0, %edx
cmovgl %ebx, %edx
movslq %eax, %rsi
imulq $0x18, %rsi, %rsi
leaq 0x58253(%rip), %rdi     # 0x68930
xorl %r8d, %r8d
cmpq %r8, %rdx
je 0x1073e
movsbl 0x2(%r14,%r8,4), %r10d
movq 0x8(%r15), %r9
movzbl (%r14,%r8,4), %r11d
movb %r11b, (%r9,%rsi)
movsbl 0x1(%r14,%r8,4), %r12d
movl %r12d, 0x4(%r9,%rsi)
testl %r10d, %r10d
jns 0x10715
testb $0x1, (%r11,%rdi)
je 0x10715
notl %r10d
addl %eax, %r10d
movl %r10d, 0x8(%r9,%rsi)
movsbl 0x3(%r14,%r8,4), %r10d
movl %r10d, 0xc(%r9,%rsi)
movb %cl, 0x1(%r9,%rsi)
andq $0x0, 0x10(%r9,%rsi)
movb %cl, 0x3(%r9,%rsi)
incq %r8
addq $0x18, %rsi
jmp 0x106e0
addl %ebx, 0x34(%r15)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x10908
movslq %esi, %rax
imulq $0x18, %rax, %r14
movq (%rdi), %rdi
movsbl 0x1(%rbx,%r14), %esi
movq 0x10(%rbx,%r14), %rdx
callq 0x1fc08
xorps %xmm0, %xmm0
movups %xmm0, (%rbx,%r14)
andq $0x0, 0x10(%rbx,%r14)
movb $-0x6b, (%rbx,%r14)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x10e37
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 0xdbaa
movl %eax, %r15d
movq %r14, %rdi
movq %rbx, %rsi
callq 0x968b
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_O2/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 0x10e97
movq %rsi, %rax
movq %rdi, %r14
movq 0x20(%rdi), %rbx
movl %ecx, %esi
orl %edx, %esi
js 0x10e71
leal (%rcx,%rdx), %esi
cmpl 0x4(%r14), %esi
jle 0x10ead
pushq $0x1
popq %r15
movq %rbx, %rdi
movl %r15d, %esi
xorl %edx, %edx
xorl %eax, %eax
callq 0xbdb1
movq %rbx, %rdi
movl %r15d, %esi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0xdc59
movl $0x11a1c, %edi          # imm = 0x11A1C
callq 0x9008
pushq $0x15
popq %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0x18(%r14), %r12
pushq $0x4
popq %r15
testq %r12, %r12
je 0x10e84
movq 0x10(%r14), %rdi
addl 0x8(%r14), %ecx
movl %ecx, %esi
movq %rax, %rcx
callq *%r8
cmpl $0x4, %eax
jne 0x10ede
movq %r12, %rdi
callq 0xdc20
andq $0x0, 0x18(%r14)
jmp 0x10e84
movl %eax, 0x44(%rbx)
movl %eax, 0x94(%r12)
movl %eax, %r15d
jmp 0x10e84
// File: /workspace/github_c_makefile_star2_O2/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 0x10f38
movq %rcx, %rbx
movl %edx, %r14d
movl %esi, %r15d
movq %rdi, %r12
cmpb $0x3, %al
jb 0x10f1c
movq %r12, %rdi
callq 0x2b99e
testl %eax, %eax
jne 0x10f3b
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 0x1e723
pushq $0x4
popq %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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), %al
cmpb $0x3, %al
jb 0x10f84
movq %r12, %rdi
callq 0x2b99e
testl %eax, %eax
jne 0x10fc6
movb 0x77(%r12), %al
cmpb $0x1, %al
jne 0x10fbf
movq 0x8(%r12), %rdi
movl 0x30(%r12), %esi
movq %r12, %rdx
callq 0x1e0b8
cmpb $0x0, 0x74(%r12)
je 0x10fc3
pushq $0x1
popq %r8
movq %r12, %rdi
movl %r15d, %esi
movl %r14d, %edx
movq %rbx, %rcx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x1e723
pushq $0x4
jmp 0x10fc5
pushq $0x8
popq %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x1103f
movq 0x20(%rdi), %rbx
cmpq $0x0, 0x18(%rdi)
je 0x11057
leaq -0x20(%rbp), %rdx
callq 0x10cbf
movl %eax, %r14d
testl %eax, %eax
je 0x1105b
movq -0x20(%rbp), %r15
testq %r15, %r15
leaq 0x5a6db(%rip), %rdx     # 0x6b6f9
cmoveq %r15, %rdx
movq %rbx, %rdi
movl %r14d, %esi
movq %r15, %rcx
xorl %eax, %eax
callq 0xbdb1
movq %rbx, %rdi
movq %r15, %rsi
callq 0x968b
jmp 0x1105b
movl $0x11a67, %edi          # imm = 0x11A67
callq 0x9008
pushq $0x15
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
pushq $0x4
popq %r14
movq %rbx, %rdi
movl %r14d, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xdc59
// File: /workspace/github_c_makefile_star2_O2/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
testq %rdi, %rdi
je 0x11706
cmpl $0xa029a697, 0x5c(%rdi) # imm = 0xA029A697
jne 0x1170f
pushq $0x1
popq %rax
jmp 0x11726
leaq 0x5cd82(%rip), %rdi     # 0x6e48f
jmp 0x1171f
callq 0x13f8a
testl %eax, %eax
je 0x11724
leaq 0x5b3af(%rip), %rdi     # 0x6cace
callq 0x3193f
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 %r14
pushq %rbx
pushq $0x7
popq %rbx
testq %rdi, %rdi
je 0x11781
movq %rdi, %r14
callq 0x13f8a
testl %eax, %eax
je 0x11774
cmpb $0x0, 0x50(%r14)
jne 0x11781
movl 0x48(%r14), %ebx
andl 0x44(%r14), %ebx
jmp 0x11781
movl $0x1cb0e, %edi          # imm = 0x1CB0E
callq 0x9008
pushq $0x15
popq %rbx
movl %ebx, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
leaq 0x59fee(%rip), %r14     # 0x6b784
testq %rdi, %rdi
je 0x117de
movq %rdi, %rbx
callq 0x13f8a
testl %eax, %eax
je 0x117cd
cmpb $0x0, 0x50(%rbx)
jne 0x117de
movq 0x130(%rbx), %rdi
callq 0xdf1e
movq %rax, %r14
testq %rax, %rax
jne 0x117de
movl 0x44(%rbx), %edi
popq %rbx
popq %r14
popq %rbp
jmp 0xe5c3
movl $0x1cac9, %edi          # imm = 0x1CAC9
callq 0x9008
leaq 0x5da48(%rip), %r14     # 0x6f226
movq %r14, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 %r14
pushq %rbx
movq %rdi, %rbx
callq 0x9740
movl %eax, %r14d
testl %eax, %eax
jne 0x11860
movl 0x77676(%rip), %eax     # 0x88e78
movq 0x77677(%rip), %rdi     # 0x88e80
xorl %edx, %edx
testl %eax, %eax
movl $0x0, %ecx
cmovgl %eax, %ecx
cmpq %rdx, %rcx
je 0x11827
cmpq %rbx, (%rdi,%rdx,8)
je 0x11825
incq %rdx
jmp 0x11815
movl %edx, %ecx
xorl %r14d, %r14d
cmpl %eax, %ecx
jne 0x11860
leal 0x8(,%rax,8), %esi
callq 0x9ce9
testq %rax, %rax
je 0x1185c
movq %rax, 0x7763a(%rip)     # 0x88e80
movslq 0x7762b(%rip), %rcx     # 0x88e78
movq %rbx, (%rax,%rcx,8)
leal 0x1(%rcx), %eax
movl %eax, 0x7761e(%rip)     # 0x88e78
jmp 0x11860
pushq $0x7
popq %r14
movl %r14d, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x77606(%rip), %ecx     # 0x88e78
movq 0x77607(%rip), %rax     # 0x88e80
movq %rcx, %rsi
testl %esi, %esi
jle 0x118aa
leaq -0x1(%rsi), %rdx
cmpq %rdi, -0x8(%rax,%rsi,8)
movq %rdx, %rsi
jne 0x1187c
leal -0x1(%rcx), %esi
movl %esi, 0x775e1(%rip)     # 0x88e78
movslq %ecx, %rcx
movq -0x8(%rax,%rcx,8), %rcx
movq %rcx, (%rax,%rdx,8)
movl $0x1, %eax
jmp 0x118ac
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 $0x18, %rsp
movq %r9, %rbx
movq %r8, -0x38(%rbp)
movl %ecx, %r13d
movl %edx, %r12d
movq %rsi, -0x30(%rbp)
movq %rdi, %r14
movq 0x10(%rbp), %r15
andq $0x0, (%r9)
callq 0x116ef
testl %eax, %eax
je 0x1198b
movq %r14, %rdi
callq 0x933b
movq %r15, (%rsp)
movq %r14, %rdi
movq -0x30(%rbp), %rsi
movl %r12d, %r15d
movl %r12d, %edx
movl %r13d, %ecx
movq -0x38(%rbp), %r12
movq %r12, %r8
movq %rbx, %r9
callq 0x3195a
cmpl $0x11, %eax
jne 0x11998
movq (%rbx), %rdi
callq 0xdbaa
movq %r14, %rdi
movq -0x30(%rbp), %rsi
movl %r15d, %edx
movl %r13d, %ecx
movq %r12, %r8
movq %rbx, %r9
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3195a
movl $0x17814, %edi          # imm = 0x17814
callq 0x9008
pushq $0x15
popq %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x11e6a
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
leaq -0x8(%rdi), %r14
movslq -0x8(%rdi), %r15
pushq $0x1
popq %r12
cmpq %r15, %r12
jge 0x11e5a
movq -0x8(%rbx,%r12,8), %rdi
testq %rdi, %rdi
je 0x11e55
callq 0x9c7b
incq %r12
jmp 0x11e41
movq %r14, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x9c7b
retq
// File: /workspace/github_c_makefile_star2_O2/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, -0x38(%rbp)
movq %rcx, %r12
movq %rdx, -0x48(%rbp)
movq %rsi, %rbx
movq %rdi, %r15
movq %rsi, %rdi
callq 0x8f8e
movl %eax, %r14d
leaq 0x1a8(%r15), %r13
movq %r13, %rdi
movq %rbx, %rsi
movl %eax, %edx
callq 0x2eeba
testq %rax, %rax
je 0x11ecd
movl $0x19517, %edi          # imm = 0x19517
callq 0x9008
pushq $0x15
popq %rsi
jmp 0x11f54
movq %r13, -0x40(%rbp)
movq %r12, -0x30(%rbp)
leal 0x21(%r14), %esi
movq %r15, %rdi
callq 0x103b4
xorl %esi, %esi
testq %rax, %rax
je 0x11f50
movq %rax, %r12
movq %rax, %r13
addq $0x20, %r13
movl %r14d, %edx
incl %edx
movq %r13, %rdi
movq %rbx, %rsi
callq 0x82c0
movq %r13, 0x8(%r12)
movq -0x48(%rbp), %rax
movq %rax, (%r12)
movq -0x30(%rbp), %rax
movq %rax, 0x10(%r12)
movq -0x38(%rbp), %rax
movq %rax, 0x18(%r12)
movq -0x40(%rbp), %rdi
movq %r13, %rsi
movl %r14d, %edx
movq %r12, %rcx
callq 0x2f1a7
testq %rax, %rax
je 0x11f48
movb $0x1, 0x50(%r15)
movq %r15, %rdi
movq %rax, %rsi
callq 0x968b
movq -0x30(%rbp), %r12
xorl %esi, %esi
jmp 0x11f54
movq -0x30(%rbp), %r12
movq %r15, %rdi
callq 0xdc59
movl %eax, %ebx
testl %eax, %eax
sete %al
cmpq $0x0, -0x38(%rbp)
sete %cl
orb %al, %cl
jne 0x11f75
movq %r12, %rdi
callq *-0x38(%rbp)
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_O2/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 0x1258f
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, %edi          # imm = 0x19926
cmpl $0x1, %esi
jne 0x125dc
movq 0x1c0(%rbx), %rax
testq %rax, %rax
je 0x125d7
movl -0x30(%rbp), %edx
cmpq $0x28, %rdx
ja 0x125f6
movq %rdx, %rcx
addq -0x20(%rbp), %rcx
addl $0x8, %edx
movl %edx, -0x30(%rbp)
jmp 0x12602
movl $0x1991e, %edi          # imm = 0x1991E
callq 0x9008
pushq $0x15
popq %r14
movq %rbx, %rdi
movl %r14d, %esi
xorl %edx, %edx
xorl %eax, %eax
callq 0xbdb1
jmp 0x1260d
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_O2/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 0x9740
movl %eax, %r15d
testl %eax, %eax
jne 0x129f0
xorl %edi, %edi
callq 0x129fe
movq %rax, %rbx
pushq $-0x1
popq %rsi
pushq $0x2
popq %rcx
movq %rax, %rdi
movq %r14, %rdx
xorl %r8d, %r8d
callq 0x12a28
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0xe05a
testq %rax, %rax
je 0x129e4
movq %rax, %rdi
callq 0x1261c
movzbl %al, %r15d
jmp 0x129e8
pushq $0x7
popq %r15
movq %rbx, %rdi
callq 0x12a43
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3ValueNew
SQLITE_PRIVATE sqlite3_value *sqlite3ValueNew(sqlite3 *db){
  Mem *p = sqlite3DbMallocZero(db, sizeof(*p));
  if( p ){
    p->flags = MEM_Null;
    p->type = SQLITE_NULL;
    p->db = db;
  }
  return p;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
pushq $0x38
popq %rsi
callq 0xf4ae
testq %rax, %rax
je 0x12a21
movw $0x1, 0x24(%rax)
movb $0x5, 0x26(%rax)
movq %rbx, (%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq