LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/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 0x123d0
pushq %rbp
movq %rsp, %rbp
orb $0x20, 0x9a(%rax)
movq 0x68(%rax), %rax
testq %rax, %rax
jne 0x123bf
popq %rbp
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x12b59
movl $0x1, %ebx
cmpl $0xa029a697, 0x5c(%rdi) # imm = 0xA029A697
je 0x12b75
callq 0x15abc
testl %eax, %eax
je 0x12b7e
leaq 0x67f57(%rip), %rdx     # 0x7aaae
jmp 0x12b60
leaq 0x6990f(%rip), %rdx     # 0x7c46f
leaq 0x67f50(%rip), %rsi     # 0x7aab7
xorl %ebx, %ebx
movl $0x15, %edi
xorl %eax, %eax
callq 0xb8cc
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
xorl %ebx, %ebx
jmp 0x12b75
// File: /workspace/github_c_makefile_star2_O1/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
movl $0x7, %ebx
testq %rdi, %rdi
je 0x12bf6
movq %rdi, %r14
callq 0x15abc
testl %eax, %eax
je 0x12bd2
cmpb $0x0, 0x50(%r14)
jne 0x12bf6
movl 0x48(%r14), %ebx
andl 0x44(%r14), %ebx
jmp 0x12bf6
leaq 0x6a80b(%rip), %rsi     # 0x7d3e4
leaq 0x66959(%rip), %rcx     # 0x79539
movl $0x15, %ebx
movl $0x15, %edi
movl $0x1cb0e, %edx          # imm = 0x1CB0E
xorl %eax, %eax
callq 0xb8cc
movl %ebx, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x66b59(%rip), %rbx     # 0x79764
testq %rdi, %rdi
je 0x12c77
movq %rdi, %r14
callq 0x15abc
testl %eax, %eax
je 0x12c51
cmpb $0x0, 0x50(%r14)
jne 0x12c77
movq 0x130(%r14), %rdi
movl $0x1, %esi
callq 0xee49
movq %rax, %rbx
testq %rax, %rax
jne 0x12c77
movl 0x44(%r14), %eax
cmpq $0x204, %rax            # imm = 0x204
jne 0x12c7f
leaq 0x6a689(%rip), %rbx     # 0x7d2d8
jmp 0x12c77
leaq 0x6a78c(%rip), %rsi     # 0x7d3e4
leaq 0x668da(%rip), %rcx     # 0x79539
movl $0x15, %edi
movl $0x1cac9, %edx          # imm = 0x1CAC9
xorl %eax, %eax
callq 0xb8cc
leaq 0x6a58f(%rip), %rbx     # 0x7d206
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
movzbl %al, %eax
cmpl $0x1b, %eax
setae %cl
cmpq $0x2, %rax
sete %dl
orb %cl, %dl
je 0x12c9c
leaq 0x6a630(%rip), %rbx     # 0x7d2ca
jmp 0x12c77
leaq 0x80b5d(%rip), %rcx     # 0x93800
movq (%rcx,%rax,8), %rbx
jmp 0x12c77
// File: /workspace/github_c_makefile_star2_O1/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 %rbx
pushq %rax
movq %rdi, %rbx
callq 0x9d1f
testl %eax, %eax
jne 0x12d3e
movl 0x831b2(%rip), %r15d    # 0x95e78
xorl %eax, %eax
movl $0x0, %ecx
testl %r15d, %r15d
jle 0x12cec
movq 0x831a7(%rip), %rdx     # 0x95e80
xorl %ecx, %ecx
cmpq %rbx, (%rdx,%rcx,8)
je 0x12cec
incq %rcx
cmpq %rcx, %r15
jne 0x12cdb
movl %r15d, %ecx
cmpl %r15d, %ecx
jne 0x12d3e
movq 0x83188(%rip), %r14     # 0x95e80
callq 0x9d1f
testl %eax, %eax
je 0x12d05
xorl %eax, %eax
jmp 0x12d15
leal 0x8(,%r15,8), %esi
movq %r14, %rdi
callq 0xa37d
testq %rax, %rax
je 0x12d39
movq %rax, 0x8315f(%rip)     # 0x95e80
movslq 0x83150(%rip), %rcx     # 0x95e78
movq %rbx, (%rax,%rcx,8)
leal 0x1(%rcx), %eax
movl %eax, 0x83143(%rip)     # 0x95e78
xorl %eax, %eax
jmp 0x12d3e
movl $0x7, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x83125(%rip), %ecx     # 0x95e78
movq 0x83126(%rip), %rax     # 0x95e80
movq %rcx, %rsi
testl %esi, %esi
jle 0x12d8b
leaq -0x1(%rsi), %rdx
cmpq %rdi, -0x8(%rax,%rsi,8)
movq %rdx, %rsi
jne 0x12d5d
leal -0x1(%rcx), %esi
movl %esi, 0x83100(%rip)     # 0x95e78
movslq %ecx, %rcx
movq -0x8(%rax,%rcx,8), %rcx
movq %rcx, (%rax,%rdx,8)
movl $0x1, %eax
jmp 0x12d8d
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x12b2e
testl %eax, %eax
je 0x12eb4
movslq 0x28(%r14), %rax
testq %rax, %rax
movq -0x40(%rbp), %r10
movl %r12d, %ecx
jle 0x12e56
movq 0x20(%r14), %r8
shlq $0x5, %rax
xorl %edx, %edx
movq 0x8(%r8,%rdx), %r9
testq %r9, %r9
je 0x12e4d
movq (%r9), %rdi
movq 0x8(%r9), %r9
movq %rdi, 0x8(%r9)
addq $0x20, %rdx
cmpq %rdx, %rax
jne 0x12e38
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 0x3693f
movl %eax, %r15d
cmpl $0x11, %eax
jne 0x12ed9
movq (%rbx), %rdi
callq 0xe974
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 0x3693f
leaq 0x6a529(%rip), %rsi     # 0x7d3e4
leaq 0x66677(%rip), %rcx     # 0x79539
movl $0x15, %r15d
movl $0x15, %edi
movl $0x17814, %edx          # imm = 0x17814
xorl %eax, %eax
callq 0xb8cc
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_O1/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 0x1340c
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 0x133fc
andl $0x7fffffff, %r15d      # imm = 0x7FFFFFFF
decq %r15
xorl %r12d, %r12d
movq (%rbx,%r12,8), %rdi
testq %rdi, %rdi
je 0x133f4
callq 0xa2e8
incq %r12
cmpq %r12, %r15
jne 0x133e6
movq %r14, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0xa2e8
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x1345c
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
movq %r14, %rax
incl %r13d
cmpb $0x0, (%rax)
leaq 0x1(%rax), %rax
jne 0x13447
andl $0x3fffffff, %r13d      # imm = 0x3FFFFFFF
jmp 0x1345f
xorl %r13d, %r13d
leaq 0x1a8(%r12), %rbx
movq %rbx, %rdi
movq %r14, %rsi
movl %r13d, %edx
callq 0x3396f
testq %rax, %rax
je 0x134a7
leaq 0x69f63(%rip), %rsi     # 0x7d3e4
leaq 0x660b1(%rip), %rcx     # 0x79539
movl $0x15, %ebx
movl $0x15, %edi
movl $0x19517, %edx          # imm = 0x19517
xorl %eax, %eax
callq 0xb8cc
movq -0x30(%rbp), %r14
jmp 0x1353c
leal 0x21(%r13), %esi
movq %r12, -0x38(%rbp)
movq %r12, %rdi
callq 0x115e9
testq %rax, %rax
je 0x13532
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 0x33cea
testq %rax, %rax
je 0x1352f
movq -0x38(%rbp), %r12
movb $0x1, 0x50(%r12)
movq %r12, %rdi
movq %rax, %rsi
callq 0x9c3a
movq %r14, %r15
movq -0x30(%rbp), %r14
jmp 0x1353a
movq %r14, %r15
movq -0x30(%rbp), %r14
movq -0x38(%rbp), %r12
xorl %ebx, %ebx
movq %r12, %rdi
movl %ebx, %esi
callq 0xea22
movl %eax, %ebx
testl %eax, %eax
sete %al
testq %r15, %r15
sete %cl
orb %al, %cl
jne 0x1355d
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_O1/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 %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 0x13bed
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)
cmpl $0x1, %esi
jne 0x13c30
movq 0x1c0(%rbx), %rax
testq %rax, %rax
je 0x13c53
movl -0x30(%rbp), %edx
cmpq $0x28, %rdx
ja 0x13c7d
movq %rdx, %rcx
addq -0x20(%rbp), %rcx
addl $0x8, %edx
movl %edx, -0x30(%rbp)
jmp 0x13c89
leaq 0x697ad(%rip), %rsi     # 0x7d3e4
leaq 0x658fb(%rip), %rcx     # 0x79539
xorl %r15d, %r15d
movl $0x15, %r14d
movl $0x15, %edi
movl $0x19926, %edx          # imm = 0x19926
jmp 0x13c74
leaq 0x6978a(%rip), %rsi     # 0x7d3e4
leaq 0x658d8(%rip), %rcx     # 0x79539
xorl %r15d, %r15d
movl $0x15, %r14d
movl $0x15, %edi
movl $0x1991e, %edx          # imm = 0x1991E
xorl %eax, %eax
callq 0xb8cc
jmp 0x13c97
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
movb $0x1, %r15b
testb %r15b, %r15b
jne 0x13cab
movq %rbx, %rdi
movl %r14d, %esi
xorl %edx, %edx
xorl %eax, %eax
callq 0xc8f4
movl %r14d, %eax
addq $0xc8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x9d1f
movl %eax, %r15d
testl %eax, %eax
jne 0x14342
movl $0x38, %edi
callq 0xa2a2
movq %rax, %rbx
testq %rax, %rax
je 0x14314
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rbx)
movups %xmm0, (%rbx)
movups %xmm0, 0x10(%rbx)
xorl %eax, %eax
movq %rax, 0x30(%rbx)
movw $0x1, 0x24(%rbx)
movb $0x5, 0x26(%rbx)
movq %rax, (%rbx)
movq %rbx, %rdi
movq %r14, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl $0x2, %ecx
xorl %r8d, %r8d
callq 0xeff4
movq %rbx, %rdi
movl $0x1, %esi
callq 0xee49
testq %rax, %rax
je 0x14334
movq %rax, %rdi
callq 0x13cbc
movzbl %al, %r15d
jmp 0x1433a
movl $0x7, %r15d
movq %rbx, %rdi
callq 0x14350
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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, 0x801b3(%rip)     # 0x94560
je 0x143be
callq 0x12d8f
movl $0x0, 0x801a2(%rip)     # 0x94560
cmpl $0x0, 0x801ab(%rip)     # 0x94570
je 0x143e6
movq 0x800f2(%rip), %rax     # 0x944c0
testq %rax, %rax
je 0x143dc
movq 0x800d6(%rip), %rdi     # 0x944b0
callq *%rax
movl $0x0, 0x8018a(%rip)     # 0x94570
cmpl $0x0, 0x8017f(%rip)     # 0x9456c
je 0x1443d
movq 0x8005a(%rip), %rax     # 0x94450
testq %rax, %rax
je 0x14404
movq 0x80056(%rip), %rdi     # 0x94458
callq *%rax
xorps %xmm0, %xmm0
movups %xmm0, 0x8194a(%rip)    # 0x95d58
movups %xmm0, 0x81933(%rip)    # 0x95d48
movups %xmm0, 0x8191c(%rip)    # 0x95d38
xorl %eax, %eax
movq %rax, 0x81943(%rip)     # 0x95d68
movl $0x0, 0x8013d(%rip)     # 0x9456c
movq %rax, 0x81a5a(%rip)     # 0x95e90
movq %rax, 0x81a4b(%rip)     # 0x95e88
cmpl $0x0, 0x80124(%rip)     # 0x94568
je 0x14450
movl $0x0, 0x80118(%rip)     # 0x94568
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movslq 0x28(%rdi), %rax
testq %rax, %rax
jle 0x14a03
movq 0x20(%rbx), %rcx
shlq $0x5, %rax
xorl %edx, %edx
movq 0x8(%rcx,%rdx), %rsi
testq %rsi, %rsi
je 0x149fa
movq (%rsi), %rdi
movq 0x8(%rsi), %rsi
movq %rdi, 0x8(%rsi)
addq $0x20, %rdx
cmpq %rdx, %rax
jne 0x149e5
cmpl $0x0, 0x28(%rbx)
jle 0x14a4c
movl $0x8, %r14d
xorl %r15d, %r15d
movq 0x20(%rbx), %rax
movq (%rax,%r14), %rax
testq %rax, %rax
je 0x14a3c
movq 0x8(%rax), %rax
movq (%rax), %rax
movq 0x110(%rax), %rax
movq 0x40(%rax), %rdi
testq %rdi, %rdi
je 0x14a3c
callq *0x7facc(%rip)          # 0x94508
incq %r15
movslq 0x28(%rbx), %rax
addq $0x20, %r14
cmpq %rax, %r15
jl 0x14a12
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3_busy_timeout
SQLITE_API int sqlite3_busy_timeout(sqlite3 *db, int ms){
  if( ms>0 ){
    sqlite3_busy_handler(db, sqliteDefaultBusyCallback, (void*)db);
    db->busyTimeout = ms;
  }else{
    sqlite3_busy_handler(db, 0, 0);
  }
  return SQLITE_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
testl %esi, %esi
jle 0x14f79
leaq 0x3c(%rip), %rax        # 0x14f95
movq %rax, 0x2a8(%rdi)
movq %rdi, 0x2b0(%rdi)
movl $0x0, 0x2b8(%rdi)
movl %esi, 0x308(%rdi)
jmp 0x14f91
xorl %eax, %eax
movl %eax, 0x308(%rdi)
addq $0x2a8, %rdi            # imm = 0x2A8
movl %eax, 0x10(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3_create_function_v2
SQLITE_API int sqlite3_create_function_v2(
  sqlite3 *db,
  const char *zFunc,
  int nArg,
  int enc,
  void *p,
  void (*xFunc)(sqlite3_context*,int,sqlite3_value **),
  void (*xStep)(sqlite3_context*,int,sqlite3_value **),
  void (*xFinal)(sqlite3_context*),
  void (*xDestroy)(void *)
){
  int rc = SQLITE_ERROR;
  FuncDestructor *pArg = 0;
  sqlite3_mutex_enter(db->mutex);
  if( xDestroy ){
    pArg = (FuncDestructor *)sqlite3DbMallocZero(db, sizeof(FuncDestructor));
    if( !pArg ){
      xDestroy(p);
      goto out;
    }
    pArg->xDestroy = xDestroy;
    pArg->pUserData = p;
  }
  rc = sqlite3CreateFunc(db, zFunc, nArg, enc, p, xFunc, xStep, xFinal, pArg);
  if( pArg && pArg->nRef==0 ){
    assert( rc!=SQLITE_OK );
    xDestroy(p);
    sqlite3DbFree(db, pArg);
  }

 out:
  rc = sqlite3ApiExit(db, rc);
  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, %r14
movq %rsi, %r12
movq %rdi, %rbx
movq 0x20(%rbp), %r13
movq 0x18(%rbp), %r10
movq 0x10(%rbp), %rax
testq %r13, %r13
je 0x15077
movl %edx, -0x2c(%rbp)
movq %r10, -0x38(%rbp)
movq %rax, -0x40(%rbp)
movl %ecx, -0x30(%rbp)
movq %r9, -0x48(%rbp)
movq %rbx, %rdi
movl $0x18, %esi
callq 0x115e9
testq %rax, %rax
je 0x150b6
movq %rax, %r15
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq %r13, 0x8(%rax)
movq %r14, 0x10(%rax)
movq -0x48(%rbp), %r9
movl -0x30(%rbp), %ecx
movq -0x40(%rbp), %rax
movq -0x38(%rbp), %r10
movl -0x2c(%rbp), %edx
jmp 0x1507a
xorl %r15d, %r15d
subq $0x8, %rsp
movq %rbx, %rdi
movq %r12, %rsi
movq %r14, %r8
pushq %r15
pushq %r10
pushq %rax
callq 0x150db
addq $0x20, %rsp
movl %eax, %r12d
testq %r15, %r15
je 0x150c2
cmpl $0x0, (%r15)
jne 0x150c2
movq %r14, %rdi
callq *%r13
movq %rbx, %rdi
movq %r15, %rsi
callq 0x9c3a
jmp 0x150c2
movq %r14, %rdi
callq *%r13
movl $0x1, %r12d
movq %rbx, %rdi
movl %r12d, %esi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xea22
// File: /workspace/github_c_makefile_star2_O1/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3_create_function16
SQLITE_API int sqlite3_create_function16(
  sqlite3 *db,
  const void *zFunctionName,
  int nArg,
  int eTextRep,
  void *p,
  void (*xFunc)(sqlite3_context*,int,sqlite3_value**),
  void (*xStep)(sqlite3_context*,int,sqlite3_value**),
  void (*xFinal)(sqlite3_context*)
){
  int rc;
  char *zFunc8;
  sqlite3_mutex_enter(db->mutex);
  assert( !db->mallocFailed );
  zFunc8 = sqlite3Utf16to8(db, zFunctionName, -1, SQLITE_UTF16NATIVE);
  rc = sqlite3CreateFunc(db, zFunc8, nArg, eTextRep, p, xFunc, xStep, xFinal,0);
  sqlite3DbFree(db, zFunc8);
  rc = sqlite3ApiExit(db, rc);
  sqlite3_mutex_leave(db->mutex);
  return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %r9, -0x30(%rbp)
movq %r8, %r14
movl %ecx, %r15d
movl %edx, %r12d
movq %rdi, %r13
movaps 0x10(%rbp), %xmm0
movaps %xmm0, -0x40(%rbp)
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x1538d
movq %rax, %rbx
movaps -0x40(%rbp), %xmm0
movups %xmm0, (%rsp)
movq $0x0, 0x10(%rsp)
movq %r13, %rdi
movq %rax, %rsi
movl %r12d, %edx
movl %r15d, %ecx
movq %r14, %r8
movq -0x30(%rbp), %r9
callq 0x150db
movl %eax, %r14d
movq %r13, %rdi
movq %rbx, %rsi
callq 0x9c3a
movq %r13, %rdi
movl %r14d, %esi
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xea22
// File: /workspace/github_c_makefile_star2_O1/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3Utf16to8
SQLITE_PRIVATE char *sqlite3Utf16to8(sqlite3 *db, const void *z, int nByte, u8 enc){
  Mem m;
  memset(&m, 0, sizeof(m));
  m.db = db;
  sqlite3VdbeMemSetStr(&m, z, nByte, enc, SQLITE_STATIC);
  sqlite3VdbeChangeEncoding(&m, SQLITE_UTF8);
  if( db->mallocFailed ){
    sqlite3VdbeMemRelease(&m);
    m.z = 0;
  }
  assert( (m.flags & MEM_Term)!=0 || db->mallocFailed );
  assert( (m.flags & MEM_Str)!=0 || db->mallocFailed );
  assert( (m.flags & MEM_Dyn)!=0 || db->mallocFailed );
  assert( m.z || db->mallocFailed );
  return m.z;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x40, %rsp
movq %rdi, %rbx
xorps %xmm0, %xmm0
leaq -0x50(%rbp), %r14
movaps %xmm0, (%r14)
movaps %xmm0, 0x20(%r14)
movaps %xmm0, 0x10(%r14)
movq $0x0, 0x30(%r14)
movq %rdi, (%r14)
movq %r14, %rdi
movl $0x2, %ecx
xorl %r8d, %r8d
callq 0xeff4
movq %r14, %rdi
movl $0x1, %esi
callq 0x24e59
cmpb $0x0, 0x50(%rbx)
je 0x153f2
leaq -0x50(%rbp), %rbx
movq %rbx, %rdi
callq 0xec23
movq $0x0, 0x8(%rbx)
movq -0x48(%rbp), %rax
addq $0x40, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3_overload_function
SQLITE_API int sqlite3_overload_function(
  sqlite3 *db,
  const char *zName,
  int nArg
){
  int nName = sqlite3Strlen30(zName);
  int rc = SQLITE_OK;
  sqlite3_mutex_enter(db->mutex);
  if( sqlite3FindFunction(db, zName, nName, nArg, SQLITE_UTF8, 0)==0 ){
    rc = sqlite3CreateFunc(db, zName, nArg, SQLITE_UTF8,
                           0, sqlite3InvalidFunction, 0, 0, 0);
  }
  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
subq $0x20, %rsp
movl %edx, %r14d
movq %rsi, %r15
movq %rdi, %rbx
xorl %r12d, %r12d
movl $0x0, %edx
testq %rsi, %rsi
je 0x1543d
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movq %r15, %rax
incl %edx
cmpb $0x0, (%rax)
leaq 0x1(%rax), %rax
jne 0x1542c
andl $0x3fffffff, %edx       # imm = 0x3FFFFFFF
movq %rbx, %rdi
movq %r15, %rsi
movl %r14d, %ecx
movl $0x1, %r8d
xorl %r9d, %r9d
callq 0x154a0
testq %rax, %rax
jne 0x15489
xorps %xmm0, %xmm0
movups %xmm0, (%rsp)
movq $0x0, 0x10(%rsp)
leaq 0x1f7(%rip), %r9        # 0x15667
movq %rbx, %rdi
movq %r15, %rsi
movl %r14d, %edx
movl $0x1, %ecx
xorl %r8d, %r8d
callq 0x150db
movl %eax, %r12d
movq %rbx, %rdi
movl %r12d, %esi
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0xea22
// File: /workspace/github_c_makefile_star2_O1/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3InvalidFunction
SQLITE_PRIVATE void sqlite3InvalidFunction(
  sqlite3_context *context,  /* The function calling context */
  int NotUsed,               /* Number of arguments to the function */
  sqlite3_value **NotUsed2   /* Value of each argument */
){
  const char *zName = context->pFunc->zName;
  char *zErr;
  UNUSED_PARAMETER2(NotUsed, NotUsed2);
  zErr = sqlite3_mprintf(
      "unable to use function %s in the requested context", zName);
  sqlite3_result_error(context, zErr, -1);
  sqlite3_free(zErr);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rax
movq 0x30(%rax), %rsi
leaq 0x67cae(%rip), %rdi     # 0x7d32d
xorl %eax, %eax
callq 0xb76d
movq %rax, %r14
movl $0x1, 0x5c(%rbx)
movb $0x1, 0x61(%rbx)
addq $0x8, %rbx
movq %rbx, %rdi
movq %rax, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl $0x1, %ecx
movq $-0x1, %r8
callq 0xeff4
movq %r14, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0xa2e8
// File: /workspace/github_c_makefile_star2_O1/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3_wal_autocheckpoint
SQLITE_API int sqlite3_wal_autocheckpoint(sqlite3 *db, int nFrame){
#ifdef SQLITE_OMIT_WAL
  UNUSED_PARAMETER(db);
  UNUSED_PARAMETER(nFrame);
#else
  if( nFrame>0 ){
    sqlite3_wal_hook(db, sqlite3WalDefaultHook, SQLITE_INT_TO_PTR(nFrame));
  }else{
    sqlite3_wal_hook(db, 0, 0);
  }
#endif
  return SQLITE_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
testl %esi, %esi
jle 0x15768
movl %esi, %eax
leaq 0x39(%rip), %rcx        # 0x15791
movq %rcx, 0x108(%rdi)
movq %rax, 0x110(%rdi)
jmp 0x15772
xorps %xmm0, %xmm0
movups %xmm0, 0x108(%rdi)
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3WalDefaultHook
SQLITE_PRIVATE int sqlite3WalDefaultHook(
  void *pClientData,     /* Argument */
  sqlite3 *db,           /* Connection */
  const char *zDb,       /* Database */
  int nFrame             /* Size of WAL */
){
  if( nFrame>=SQLITE_PTR_TO_INT(pClientData) ){
    sqlite3BeginBenignMalloc();
    sqlite3_wal_checkpoint(db, zDb);
    sqlite3EndBenignMalloc();
  }
  return SQLITE_OK;
}

// Assembly:
cmpl %ecx, %edi
jg 0x157d4
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq 0x807b7(%rip), %rax     # 0x95f60
testq %rax, %rax
je 0x157b0
callq *%rax
movq %r14, %rdi
movq %rbx, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x157d7
movq 0x8079f(%rip), %rax     # 0x95f68
testq %rax, %rax
je 0x157d0
callq *%rax
popq %rbx
popq %r14
popq %rbp
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3_wal_checkpoint_v2
SQLITE_API int sqlite3_wal_checkpoint_v2(
  sqlite3 *db,                    /* Database handle */
  const char *zDb,                /* Name of attached database (or NULL) */
  int eMode,                      /* SQLITE_CHECKPOINT_* value */
  int *pnLog,                     /* OUT: Size of WAL log in frames */
  int *pnCkpt                     /* OUT: Total number of frames checkpointed */
){
#ifdef SQLITE_OMIT_WAL
  return SQLITE_OK;
#else
  int rc;                         /* Return code */
  int iDb = SQLITE_MAX_ATTACHED;  /* sqlite3.aDb[] index of db to checkpoint */

  /* Initialize the output variables to -1 in case an error occurs. */
  if( pnLog ) *pnLog = -1;
  if( pnCkpt ) *pnCkpt = -1;

  assert( SQLITE_CHECKPOINT_FULL>SQLITE_CHECKPOINT_PASSIVE );
  assert( SQLITE_CHECKPOINT_FULL<SQLITE_CHECKPOINT_RESTART );
  assert( SQLITE_CHECKPOINT_PASSIVE+2==SQLITE_CHECKPOINT_RESTART );
  if( eMode<SQLITE_CHECKPOINT_PASSIVE || eMode>SQLITE_CHECKPOINT_RESTART ){
    return SQLITE_MISUSE;
  }

  sqlite3_mutex_enter(db->mutex);
  if( zDb && zDb[0] ){
    iDb = sqlite3FindDbName(db, zDb);
  }
  if( iDb<0 ){
    rc = SQLITE_ERROR;
    sqlite3Error(db, SQLITE_ERROR, "unknown database: %s", zDb);
  }else{
    rc = sqlite3Checkpoint(db, iDb, eMode, pnLog, pnCkpt);
    sqlite3Error(db, rc, 0);
  }
  rc = sqlite3ApiExit(db, rc);
  sqlite3_mutex_leave(db->mutex);
  return rc;
#endif
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %r15
movq %rcx, %r12
movl %edx, %r13d
movq %rsi, %r14
movq %rdi, %rbx
testq %rcx, %rcx
je 0x15801
movl $0xffffffff, (%r12)     # imm = 0xFFFFFFFF
testq %r15, %r15
je 0x1580d
movl $0xffffffff, (%r15)     # imm = 0xFFFFFFFF
cmpl $0x2, %r13d
jbe 0x15827
movl $0x15, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0xa, %esi
testq %r14, %r14
je 0x15844
cmpb $0x0, (%r14)
je 0x15844
movq %rbx, %rdi
movq %r14, %rsi
callq 0x158a4
movl %eax, %esi
testl %esi, %esi
js 0x1586c
movq %rbx, %rdi
movl %r13d, %edx
movq %r12, %rcx
movq %r15, %r8
callq 0x15982
movl %eax, %r15d
movq %rbx, %rdi
movl %eax, %esi
xorl %edx, %edx
xorl %eax, %eax
callq 0xc8f4
jmp 0x1588b
leaq 0x63cef(%rip), %rdx     # 0x79562
movl $0x1, %r15d
movq %rbx, %rdi
movl $0x1, %esi
movq %r14, %rcx
xorl %eax, %eax
callq 0xc8f4
movq %rbx, %rdi
movl %r15d, %esi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xea22
// File: /workspace/github_c_makefile_star2_O1/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3FindDbName
SQLITE_PRIVATE int sqlite3FindDbName(sqlite3 *db, const char *zName){
  int i = -1;         /* Database number */
  if( zName ){
    Db *pDb;
    int n = sqlite3Strlen30(zName);
    for(i=(db->nDb-1), pDb=&db->aDb[i]; i>=0; i--, pDb--){
      if( (!OMIT_TEMPDB || i!=1 ) && n==sqlite3Strlen30(pDb->zName) && 
          0==sqlite3StrICmp(pDb->zName, zName) ){
        break;
      }
    }
  }
  return i;
}

// Assembly:
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testq %rsi, %rsi
je 0x1597a
xorl %ecx, %ecx
cmpb $0x0, (%rsi,%rcx)
leaq 0x1(%rcx), %rcx
jne 0x158b4
movslq 0x28(%rdi), %r8
leaq -0x1(%r8), %rdx
testq %r8, %r8
jle 0x15978
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
decl %ecx
andl $0x3fffffff, %ecx       # imm = 0x3FFFFFFF
movq %rdx, %r8
shlq $0x5, %r8
addq 0x20(%rdi), %r8
leaq 0x60770(%rip), %rdi     # 0x76060
movq (%r8), %r9
testq %r9, %r9
je 0x15917
movl $0xffffffff, %r10d      # imm = 0xFFFFFFFF
movq %r9, %r11
incl %r10d
cmpb $0x0, (%r11)
leaq 0x1(%r11), %r11
jne 0x15901
andl $0x3fffffff, %r10d      # imm = 0x3FFFFFFF
jmp 0x1591a
xorl %r10d, %r10d
cmpl %r10d, %ecx
jne 0x15963
movb (%r9), %r10b
testb %r10b, %r10b
je 0x1594e
incq %r9
movq %rsi, %r11
movzbl %r10b, %ebx
movb (%rbx,%rdi), %bl
movzbl (%r11), %r14d
cmpb (%r14,%rdi), %bl
jne 0x15951
incq %r11
movb (%r9), %r10b
incq %r9
testb %r10b, %r10b
jne 0x1592d
jmp 0x15951
movq %rsi, %r11
movzbl %r10b, %r9d
movb (%r9,%rdi), %r9b
movzbl (%r11), %r10d
cmpb (%r10,%rdi), %r9b
je 0x1597b
leal -0x1(%rdx), %r9d
addq $-0x20, %r8
testl %edx, %edx
movl %r9d, %edx
jg 0x158f0
jmp 0x1597d
movl %edx, %eax
retq
movl %edx, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3Checkpoint
SQLITE_PRIVATE int sqlite3Checkpoint(sqlite3 *db, int iDb, int eMode, int *pnLog, int *pnCkpt){
  int rc = SQLITE_OK;             /* Return code */
  int i;                          /* Used to iterate through attached dbs */
  int bBusy = 0;                  /* True if SQLITE_BUSY has been encountered */

  assert( sqlite3_mutex_held(db->mutex) );
  assert( !pnLog || *pnLog==-1 );
  assert( !pnCkpt || *pnCkpt==-1 );

  for(i=0; i<db->nDb && rc==SQLITE_OK; i++){
    if( i==iDb || iDb==SQLITE_MAX_ATTACHED ){
      rc = sqlite3BtreeCheckpoint(db->aDb[i].pBt, eMode, pnLog, pnCkpt);
      pnLog = 0;
      pnCkpt = 0;
      if( rc==SQLITE_BUSY ){
        bBusy = 1;
        rc = SQLITE_OK;
      }
    }
  }

  return (rc==SQLITE_OK && bBusy) ? SQLITE_BUSY : rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, -0x30(%rbp)
cmpl $0x0, 0x28(%rdi)
jle 0x15a98
movq %r8, %r10
movq %rdi, %r15
movl %esi, %r12d
shlq $0x5, %r12
movl $0x1, %ebx
movl $0x1, %r9d
xorl %r14d, %r14d
xorl %r13d, %r13d
movl %esi, -0x2c(%rbp)
cmpl $0xa, %esi
setne %al
cmpq %r14, %r12
setne %dl
testb %dl, %al
jne 0x15a68
movq 0x20(%r15), %rax
movq 0x8(%rax,%r14), %rdx
xorl %eax, %eax
testq %rdx, %rdx
je 0x15a52
movq %rcx, -0x38(%rbp)
movq (%rdx), %rax
movq 0x8(%rdx), %rcx
movq %rax, 0x8(%rcx)
movl $0x6, %eax
cmpb $0x0, 0x24(%rcx)
jne 0x15a52
movq (%rcx), %r11
movq 0x118(%r11), %rdi
movl $0x0, %eax
testq %rdi, %rdi
je 0x15a52
movq 0xe0(%r11), %rdx
movq 0xe8(%r11), %rcx
movzbl 0xd(%r11), %r8d
movl 0xbc(%r11), %r9d
subq $0x8, %rsp
movl -0x30(%rbp), %esi
pushq %r10
pushq -0x38(%rbp)
pushq 0x108(%r11)
callq 0x1d321
movl $0x1, %r9d
movl -0x2c(%rbp), %esi
addq $0x20, %rsp
cmpl $0x5, %eax
movl $0x0, %ecx
cmovel %ecx, %eax
cmovel %r9d, %r13d
xorl %ecx, %ecx
xorl %r10d, %r10d
jmp 0x15a6a
xorl %eax, %eax
testl %eax, %eax
jne 0x15a86
movslq 0x28(%r15), %rdi
addq $0x20, %r14
leaq 0x1(%rbx), %rdx
cmpq %rdi, %rbx
movq %rdx, %rbx
jl 0x159c1
testl %r13d, %r13d
movl $0x5, %ecx
cmovel %eax, %ecx
testl %eax, %eax
cmovnel %eax, %ecx
jmp 0x15a9a
xorl %ecx, %ecx
movl %ecx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3SafetyCheckSickOrOk
SQLITE_PRIVATE int sqlite3SafetyCheckSickOrOk(sqlite3 *db){
  u32 magic;
  magic = db->magic;
  if( magic!=SQLITE_MAGIC_SICK &&
      magic!=SQLITE_MAGIC_OPEN &&
      magic!=SQLITE_MAGIC_BUSY ){
    testcase( sqlite3GlobalConfig.xLog!=0 );
    logBadConnection("invalid");
    return 0;
  }else{
    return 1;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl 0x5c(%rdi), %eax
movl $0x1, %ebx
cmpl $0xa029a697, %eax       # imm = 0xA029A697
je 0x15afb
cmpl $0xf03b7906, %eax       # imm = 0xF03B7906
je 0x15afb
cmpl $0x4b771290, %eax       # imm = 0x4B771290
je 0x15afb
leaq 0x64fd1(%rip), %rsi     # 0x7aab7
leaq 0x67873(%rip), %rdx     # 0x7d360
xorl %ebx, %ebx
movl $0x15, %edi
xorl %eax, %eax
callq 0xb8cc
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3_errmsg16
SQLITE_API const void *sqlite3_errmsg16(sqlite3 *db){
  static const u16 outOfMem[] = {
    'o', 'u', 't', ' ', 'o', 'f', ' ', 'm', 'e', 'm', 'o', 'r', 'y', 0
  };
  static const u16 misuse[] = {
    'l', 'i', 'b', 'r', 'a', 'r', 'y', ' ', 
    'r', 'o', 'u', 't', 'i', 'n', 'e', ' ', 
    'c', 'a', 'l', 'l', 'e', 'd', ' ', 
    'o', 'u', 't', ' ', 
    'o', 'f', ' ', 
    's', 'e', 'q', 'u', 'e', 'n', 'c', 'e', 0
  };

  const void *z;
  if( !db ){
    return (void *)outOfMem;
  }
  if( !sqlite3SafetyCheckSickOrOk(db) ){
    return (void *)misuse;
  }
  sqlite3_mutex_enter(db->mutex);
  if( db->mallocFailed ){
    z = (void *)outOfMem;
  }else{
    z = sqlite3_value_text16(db->pErr);
    if( z==0 ){
      sqlite3ValueSetStr(db->pErr, -1, sqlite3ErrStr(db->errCode),
           SQLITE_UTF8, SQLITE_STATIC);
      z = sqlite3_value_text16(db->pErr);
    }
    /* A malloc() may have failed within the call to sqlite3_value_text16()
    ** above. If this is the case, then the db->mallocFailed flag needs to
    ** be cleared before returning. Do this directly, instead of via
    ** sqlite3ApiExit(), to avoid setting the database handle error message.
    */
    db->mallocFailed = 0;
  }
  sqlite3_mutex_leave(db->mutex);
  return z;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
leaq 0x606ce(%rip), %r14     # 0x761e0
testq %rdi, %rdi
je 0x15bc5
movq %rdi, %rbx
callq 0x15abc
testl %eax, %eax
je 0x15b65
cmpb $0x0, 0x50(%rbx)
jne 0x15bc5
movq 0x130(%rbx), %rdi
movl $0x2, %esi
callq 0xee49
movq %rax, %r14
testq %rax, %rax
jne 0x15bc1
movq 0x130(%rbx), %rdi
movl 0x44(%rbx), %eax
cmpq $0x204, %rax            # imm = 0x204
jne 0x15b6e
leaq 0x67775(%rip), %rsi     # 0x7d2d8
jmp 0x15b96
leaq 0x60694(%rip), %r14     # 0x76200
jmp 0x15bc5
movzbl %al, %eax
cmpl $0x1b, %eax
setae %cl
cmpq $0x2, %rax
sete %dl
orb %cl, %dl
je 0x15b8b
leaq 0x67741(%rip), %rsi     # 0x7d2ca
jmp 0x15b96
leaq 0x7dc6e(%rip), %rcx     # 0x93800
movq (%rcx,%rax,8), %rsi
testq %rdi, %rdi
je 0x15bad
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl $0x1, %ecx
xorl %r8d, %r8d
callq 0xeff4
movq 0x130(%rbx), %rdi
movl $0x2, %esi
callq 0xee49
movq %rax, %r14
movb $0x0, 0x50(%rbx)
movq %r14, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3_extended_errcode
SQLITE_API int sqlite3_extended_errcode(sqlite3 *db){
  if( db && !sqlite3SafetyCheckSickOrOk(db) ){
    return SQLITE_MISUSE_BKPT;
  }
  if( !db || db->mallocFailed ){
    return SQLITE_NOMEM;
  }
  return db->errCode;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl $0x7, %ebx
testq %rdi, %rdi
je 0x15c1b
movq %rdi, %r14
callq 0x15abc
testl %eax, %eax
je 0x15bf7
cmpb $0x0, 0x50(%r14)
jne 0x15c1b
movl 0x44(%r14), %ebx
jmp 0x15c1b
leaq 0x677e6(%rip), %rsi     # 0x7d3e4
leaq 0x63934(%rip), %rcx     # 0x79539
movl $0x15, %ebx
movl $0x15, %edi
movl $0x1cb17, %edx          # imm = 0x1CB17
xorl %eax, %eax
callq 0xb8cc
movl %ebx, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3_open16
SQLITE_API int sqlite3_open16(
  const void *zFilename, 
  sqlite3 **ppDb
){
  char const *zFilename8;   /* zFilename encoded in UTF-8 instead of UTF-16 */
  sqlite3_value *pVal;
  int rc;

  assert( zFilename );
  assert( ppDb );
  *ppDb = 0;
#ifndef SQLITE_OMIT_AUTOINIT
  rc = sqlite3_initialize();
  if( rc ) return rc;
#endif
  pVal = sqlite3ValueNew(0);
  sqlite3ValueSetStr(pVal, -1, zFilename, SQLITE_UTF16NATIVE, SQLITE_STATIC);
  zFilename8 = sqlite3ValueText(pVal, SQLITE_UTF8);
  if( zFilename8 ){
    rc = openDatabase(zFilename8, ppDb,
                      SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, 0);
    assert( *ppDb || rc==SQLITE_NOMEM );
    if( rc==SQLITE_OK && !DbHasProperty(*ppDb, 0, DB_SchemaLoaded) ){
      ENC(*ppDb) = SQLITE_UTF16NATIVE;
    }
  }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 %rsi, %r14
movq %rdi, %r15
movq $0x0, (%rsi)
callq 0x9d1f
testl %eax, %eax
jne 0x161af
movl $0x38, %edi
callq 0xa2a2
movq %rax, %rbx
testq %rax, %rax
je 0x16158
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rbx)
movups %xmm0, (%rbx)
movups %xmm0, 0x10(%rbx)
xorl %eax, %eax
movq %rax, 0x30(%rbx)
movw $0x1, 0x24(%rbx)
movb $0x5, 0x26(%rbx)
movq %rax, (%rbx)
movq %rbx, %rdi
movq %r15, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl $0x2, %ecx
xorl %r8d, %r8d
callq 0xeff4
movq %rbx, %rdi
movl $0x1, %esi
callq 0xee49
testq %rax, %rax
je 0x1619d
movq %rax, %rdi
movq %r14, %rsi
movl $0x6, %edx
xorl %ecx, %ecx
callq 0x15c9e
movl %eax, %r15d
testl %eax, %eax
jne 0x161a3
movq (%r14), %rax
movq 0x20(%rax), %rax
movq 0x18(%rax), %rax
testb $0x1, 0x72(%rax)
jne 0x16198
movb $0x2, 0x71(%rax)
xorl %r15d, %r15d
jmp 0x161a3
movl $0x7, %r15d
movq %rbx, %rdi
callq 0x14350
movzbl %r15b, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3_create_collation16
SQLITE_API int sqlite3_create_collation16(
  sqlite3* db, 
  const void *zName,
  int enc, 
  void* pCtx,
  int(*xCompare)(void*,int,const void*,int,const void*)
){
  int rc = SQLITE_OK;
  char *zName8;
  sqlite3_mutex_enter(db->mutex);
  assert( !db->mallocFailed );
  zName8 = sqlite3Utf16to8(db, zName, -1, SQLITE_UTF16NATIVE);
  if( zName8 ){
    rc = createCollation(db, zName8, (u8)enc, pCtx, xCompare, 0);
    sqlite3DbFree(db, zName8);
  }
  rc = sqlite3ApiExit(db, rc);
  sqlite3_mutex_leave(db->mutex);
  return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %r14
movq %rcx, %r15
movl %edx, %r13d
movq %rdi, %rbx
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x1538d
testq %rax, %rax
je 0x1640a
movq %rax, %r12
movzbl %r13b, %edx
movq %rbx, %rdi
movq %rax, %rsi
movq %r15, %rcx
movq %r14, %r8
xorl %r9d, %r9d
callq 0x161de
movl %eax, %r14d
movq %rbx, %rdi
movq %r12, %rsi
callq 0x9c3a
jmp 0x1640d
xorl %r14d, %r14d
movq %rbx, %rdi
movl %r14d, %esi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xea22
// File: /workspace/github_c_makefile_star2_O1/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3_sleep
SQLITE_API int sqlite3_sleep(int ms){
  sqlite3_vfs *pVfs;
  int rc;
  pVfs = sqlite3_vfs_find(0);
  if( pVfs==0 ) return 0;

  /* This function works in milliseconds, but the underlying OsSleep() 
  ** API uses microseconds. Hence the 1000's.
  */
  rc = (sqlite3OsSleep(pVfs, 1000*ms)/1000);
  return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl %edi, %ebx
callq 0x9d1f
testl %eax, %eax
setne %cl
movq 0x7f897(%rip), %rdi     # 0x95d30
testq %rdi, %rdi
sete %dl
xorl %eax, %eax
orb %cl, %dl
jne 0x164c4
imull $0x3e8, %ebx, %esi      # imm = 0x3E8
callq *0x70(%rdi)
cltq
imulq $0x10624dd3, %rax, %rax # imm = 0x10624DD3
movq %rax, %rcx
shrq $0x3f, %rcx
sarq $0x26, %rax
addl %ecx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3_file_control
SQLITE_API int sqlite3_file_control(sqlite3 *db, const char *zDbName, int op, void *pArg){
  int rc = SQLITE_ERROR;
  Btree *pBtree;

  sqlite3_mutex_enter(db->mutex);
  pBtree = sqlite3DbNameToBtree(db, zDbName);
  if( pBtree ){
    Pager *pPager;
    sqlite3_file *fd;
    sqlite3BtreeEnter(pBtree);
    pPager = sqlite3BtreePager(pBtree);
    assert( pPager!=0 );
    fd = sqlite3PagerFile(pPager);
    assert( fd!=0 );
    if( op==SQLITE_FCNTL_FILE_POINTER ){
      *(sqlite3_file**)pArg = fd;
      rc = SQLITE_OK;
    }else if( fd->pMethods ){
      rc = sqlite3OsFileControl(fd, op, pArg);
    }else{
      rc = SQLITE_NOTFOUND;
    }
    sqlite3BtreeLeave(pBtree);
  }
  sqlite3_mutex_leave(db->mutex);
  return rc;   
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rcx, %rbx
movl %edx, %r14d
callq 0x16540
testq %rax, %rax
je 0x16517
movq (%rax), %rcx
movq 0x8(%rax), %rax
movq %rcx, 0x8(%rax)
movq (%rax), %rax
movq 0x48(%rax), %rdi
cmpl $0x7, %r14d
jne 0x1651e
movq %rdi, (%rbx)
xorl %eax, %eax
jmp 0x1653b
movl $0x1, %eax
jmp 0x1653b
movq (%rdi), %rax
testq %rax, %rax
je 0x16536
movq 0x50(%rax), %rax
movl %r14d, %esi
movq %rbx, %rdx
popq %rbx
popq %r14
popq %rbp
jmpq *%rax
movl $0xc, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3DbNameToBtree
SQLITE_PRIVATE Btree *sqlite3DbNameToBtree(sqlite3 *db, const char *zDbName){
  int i;
  for(i=0; i<db->nDb; i++){
    if( db->aDb[i].pBt
     && (zDbName==0 || sqlite3StrICmp(zDbName, db->aDb[i].zName)==0)
    ){
      return db->aDb[i].pBt;
    }
  }
  return 0;
}

// Assembly:
movslq 0x28(%rdi), %rcx
testq %rcx, %rcx
jle 0x165c6
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq 0x20(%rdi), %rdx
leaq 0x1(%rsi), %rdi
xorl %eax, %eax
leaq 0x5fafb(%rip), %r8      # 0x76060
xorl %r9d, %r9d
movq %r9, %r10
shlq $0x5, %r10
cmpq $0x0, 0x8(%rdx,%r10)
je 0x165bc
testq %rsi, %rsi
je 0x165c9
leaq (%rdx,%r10), %r11
movq (%r11), %r11
movb (%rsi), %bl
testb %bl, %bl
je 0x165ab
movq %rdi, %r14
movzbl %bl, %r15d
movb (%r15,%r8), %r15b
movzbl (%r11), %r12d
cmpb (%r12,%r8), %r15b
jne 0x165ab
incq %r11
movb (%r14), %bl
incq %r14
testb %bl, %bl
jne 0x1658c
movzbl %bl, %ebx
movb (%rbx,%r8), %bl
movzbl (%r11), %r11d
cmpb (%r11,%r8), %bl
je 0x165c9
incq %r9
cmpq %rcx, %r9
jne 0x16568
jmp 0x165ce
xorl %eax, %eax
retq
movq 0x8(%rdx,%r10), %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq