LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: unixDelete
static int unixDelete(
  sqlite3_vfs *NotUsed,     /* VFS containing this as the xDelete method */
  const char *zPath,        /* Name of file to be deleted */
  int dirSync               /* If true, fsync() directory after deleting file */
){
  int rc = SQLITE_OK;
  UNUSED_PARAMETER(NotUsed);
  SimulateIOError(return SQLITE_IOERR_DELETE);
  if( osUnlink(zPath)==(-1) ){
    if( errno==ENOENT ){
      rc = SQLITE_IOERR_DELETE_NOENT;
    }else{
      rc = unixLogError(SQLITE_IOERR_DELETE, "unlink", zPath);
    }
    return rc;
  }
#ifndef SQLITE_DISABLE_DIRSYNC
  if( (dirSync & 1)!=0 ){
    int fd;
    rc = osOpenDirectory(zPath, &fd);
    if( rc==SQLITE_OK ){
#if OS_VXWORKS
      if( fsync(fd)==-1 )
#else
      if( fsync(fd) )
#endif
      {
        rc = unixLogError(SQLITE_IOERR_DIR_FSYNC, "fsync", zPath);
      }
      robust_close(0, fd, __LINE__);
    }else if( rc==SQLITE_CANTOPEN ){
      rc = SQLITE_OK;
    }
  }
#endif
  return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %r15d
movq %rsi, %r14
movq %rsi, %rdi
callq *0x88748(%rip)          # 0x949d8
cmpl $-0x1, %eax
je 0xc2bc
xorl %ebx, %ebx
testb $0x1, %r15b
je 0xc339
leaq -0x1c(%rbp), %rsi
movq %r14, %rdi
callq *0x88742(%rip)          # 0x949f0
testl %eax, %eax
je 0xc2e6
xorl %ebx, %ebx
cmpl $0xe, %eax
cmovnel %eax, %ebx
jmp 0xc339
callq 0x8060
movl $0x170a, %ebx           # imm = 0x170A
cmpl $0x2, (%rax)
je 0xc339
leaq 0x6d3b0(%rip), %rsi     # 0x79682
movl $0xa0a, %ebx            # imm = 0xA0A
movl $0xa0a, %edi            # imm = 0xA0A
movq %r14, %rdx
movl $0x70b9, %ecx           # imm = 0x70B9
jmp 0xc334
movl -0x1c(%rbp), %edi
callq 0x8330
testl %eax, %eax
je 0xc312
leaq 0x6d40f(%rip), %rsi     # 0x79708
movl $0x50a, %ebx            # imm = 0x50A
movl $0x50a, %edi            # imm = 0x50A
movq %r14, %rdx
movl $0x70c8, %ecx           # imm = 0x70C8
callq 0x18ea3
jmp 0xc314
xorl %ebx, %ebx
movl -0x1c(%rbp), %edi
callq *0x88553(%rip)          # 0x94870
testl %eax, %eax
je 0xc339
leaq 0x6d301(%rip), %rsi     # 0x79629
movl $0x100a, %edi           # imm = 0x100A
xorl %edx, %edx
movl $0x70ca, %ecx           # imm = 0x70CA
callq 0x18ea3
movl %ebx, %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: unixAccess
static int unixAccess(
  sqlite3_vfs *NotUsed,   /* The VFS containing this xAccess method */
  const char *zPath,      /* Path of the file to examine */
  int flags,              /* What do we want to learn about the zPath file? */
  int *pResOut            /* Write result boolean here */
){
  int amode = 0;
  UNUSED_PARAMETER(NotUsed);
  SimulateIOError( return SQLITE_IOERR_ACCESS; );
  switch( flags ){
    case SQLITE_ACCESS_EXISTS:
      amode = F_OK;
      break;
    case SQLITE_ACCESS_READWRITE:
      amode = W_OK|R_OK;
      break;
    case SQLITE_ACCESS_READ:
      amode = R_OK;
      break;

    default:
      assert(!"Invalid flags argument");
  }
  *pResOut = (osAccess(zPath, amode)==0);
  if( flags==SQLITE_ACCESS_EXISTS && *pResOut ){
    struct stat buf;
    if( 0==osStat(zPath, &buf) && buf.st_size==0 ){
      *pResOut = 0;
    }
  }
  return SQLITE_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x98, %rsp
movq %rcx, %rbx
movl %edx, %r15d
movq %rsi, %r14
xorl %eax, %eax
cmpl $0x1, %edx
movl $0x6, %ecx
cmovnel %eax, %ecx
cmpl $0x2, %edx
movl $0x4, %esi
cmovnel %ecx, %esi
movq %r14, %rdi
callq *0x88508(%rip)          # 0x94888
xorl %ecx, %ecx
testl %eax, %eax
sete %cl
movl %ecx, (%rbx)
orl %eax, %r15d
jne 0xc3af
leaq -0xa8(%rbp), %rsi
movq %r14, %rdi
callq *0x8851a(%rip)          # 0x948b8
testl %eax, %eax
jne 0xc3af
cmpq $0x0, -0x78(%rbp)
jne 0xc3af
movl $0x0, (%rbx)
xorl %eax, %eax
addq $0x98, %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: unixFullPathname
static int unixFullPathname(
  sqlite3_vfs *pVfs,            /* Pointer to vfs object */
  const char *zPath,            /* Possibly relative input path */
  int nOut,                     /* Size of output buffer in bytes */
  char *zOut                    /* Output buffer */
){

  /* It's odd to simulate an io-error here, but really this is just
  ** using the io-error infrastructure to test that SQLite handles this
  ** function failing. This function could fail if, for example, the
  ** current working directory has been unlinked.
  */
  SimulateIOError( return SQLITE_ERROR );

  assert( pVfs->mxPathname==MAX_PATHNAME );
  UNUSED_PARAMETER(pVfs);

  zOut[nOut-1] = '\0';
  if( zPath[0]=='/' ){
    sqlite3_snprintf(nOut, zOut, "%s", zPath);
  }else{
    int nCwd;
    if( osGetcwd(zOut, nOut-1)==0 ){
      return unixLogError(SQLITE_CANTOPEN_BKPT, "getcwd", zPath);
    }
    nCwd = (int)strlen(zOut);
    sqlite3_snprintf(nOut-nCwd, &zOut[nCwd], "/%s", zPath);
  }
  return SQLITE_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rcx, %r12
movl %edx, %r15d
movq %rsi, %rbx
movslq %edx, %rsi
movb $0x0, -0x1(%rcx,%rsi)
cmpb $0x2f, (%rbx)
jne 0xc3f9
leaq 0x6d2f2(%rip), %rdx     # 0x796d9
movl %r15d, %edi
movq %r12, %rsi
movq %rbx, %rcx
xorl %eax, %eax
callq 0xb859
jmp 0xc471
decq %rsi
movq %r12, %rdi
callq *0x8849b(%rip)          # 0x948a0
movq %rax, %r14
testq %rax, %rax
je 0xc434
movq %r12, %rdi
callq 0x8190
subl %eax, %r15d
movslq %eax, %rsi
addq %r12, %rsi
leaq 0x6d32e(%rip), %rdx     # 0x79753
movl %r15d, %edi
movq %rbx, %rcx
xorl %eax, %eax
callq 0xb859
jmp 0xc46c
leaq 0x6d2a1(%rip), %rsi     # 0x796dc
leaq 0x6d0f7(%rip), %rcx     # 0x79539
movl $0xe, %edi
movl $0x711f, %edx           # imm = 0x711F
xorl %eax, %eax
callq 0xb8cc
leaq 0x6d1dc(%rip), %rsi     # 0x79636
movl $0xe, %edi
movq %rbx, %rdx
movl $0x711f, %ecx           # imm = 0x711F
callq 0x18ea3
testq %r14, %r14
je 0xc47c
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl $0xe, %eax
jmp 0xc473
// File: /workspace/github_c_makefile_star2_O1/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: unixRandomness
static int unixRandomness(sqlite3_vfs *NotUsed, int nBuf, char *zBuf){
  UNUSED_PARAMETER(NotUsed);
  assert((size_t)nBuf>=(sizeof(time_t)+sizeof(int)));

  /* We have to initialize zBuf to prevent valgrind from reporting
  ** errors.  The reports issued by valgrind are incorrect - we would
  ** prefer that the randomness be increased by making use of the
  ** uninitialized space in zBuf - but valgrind errors tend to worry
  ** some users.  Rather than argue, it seems easier just to initialize
  ** the whole array and silence valgrind, even if that means less randomness
  ** in the random seed.
  **
  ** When testing, initializing zBuf[] to zero is all we do.  That means
  ** that we always use the same random number sequence.  This makes the
  ** tests repeatable.
  */
  memset(zBuf, 0, nBuf);
#if !defined(SQLITE_TEST)
  {
    int pid, fd, got;
    fd = robust_open("/dev/urandom", O_RDONLY, 0);
    if( fd<0 ){
      time_t t;
      time(&t);
      memcpy(zBuf, &t, sizeof(t));
      pid = getpid();
      memcpy(&zBuf[sizeof(t)], &pid, sizeof(pid));
      assert( sizeof(t)+sizeof(pid)<=(size_t)nBuf );
      nBuf = sizeof(t) + sizeof(pid);
    }else{
      do{ got = osRead(fd, zBuf, nBuf); }while( got<0 && errno==EINTR );
      robust_close(0, fd, __LINE__);
    }
  }
#endif
  return nBuf;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movl %esi, %ebx
movslq %esi, %r15
movq %rdx, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x8200
leaq 0x6d2aa(%rip), %r13     # 0x79757
movq %r13, %rdi
movl $0x80000, %esi          # imm = 0x80000
movl $0x1a4, %edx            # imm = 0x1A4
callq *0x88398(%rip)          # 0x94858
movl %eax, %r12d
testl %eax, %eax
jns 0xc4d6
callq 0x8060
cmpl $0x4, (%rax)
je 0xc4ad
testl %r12d, %r12d
js 0xc51a
movl %r12d, %edi
movq %r14, %rsi
movq %r15, %rdx
callq *0x88433(%rip)          # 0x94918
testl %eax, %eax
jns 0xc4f3
callq 0x8060
cmpl $0x4, (%rax)
je 0xc4d6
movl %r12d, %edi
callq *0x88374(%rip)          # 0x94870
testl %eax, %eax
je 0xc53a
leaq 0x6d122(%rip), %rsi     # 0x79629
movl $0x100a, %edi           # imm = 0x100A
xorl %edx, %edx
movl $0x7188, %ecx           # imm = 0x7188
callq 0x18ea3
jmp 0xc53a
leaq -0x30(%rbp), %rbx
movq %rbx, %rdi
callq 0x8370
movq (%rbx), %rax
movq %rax, (%r14)
callq 0x8590
movl %eax, 0x8(%r14)
movl $0xc, %ebx
movl %ebx, %eax
addq $0x8, %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: unixCurrentTime
static int unixCurrentTime(sqlite3_vfs *NotUsed, double *prNow){
  sqlite3_int64 i = 0;
  int rc;
  UNUSED_PARAMETER(NotUsed);
  rc = unixCurrentTimeInt64(0, &i);
  *prNow = i/86400000.0;
  return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
xorl %r14d, %r14d
leaq -0x20(%rbp), %rdi
xorl %esi, %esi
callq 0x8640
testl %eax, %eax
je 0xc5ae
movl $0x1, %r14d
xorpd %xmm0, %xmm0
jmp 0xc5e7
movabsq $0x20c49ba5e353f7cf, %rax # imm = 0x20C49BA5E353F7CF
imulq -0x18(%rbp)
imulq $0x3e8, -0x20(%rbp), %rax # imm = 0x3E8
movq %rdx, %rcx
shrq $0x3f, %rcx
sarq $0x7, %rdx
addq %rcx, %rdx
addq %rax, %rdx
movabsq $0xbfc83e532200, %rax   # imm = 0xBFC83E532200
addq %rdx, %rax
cvtsi2sd %rax, %xmm0
divsd 0x6ccb1(%rip), %xmm0    # 0x792a0
movsd %xmm0, (%rbx)
movl %r14d, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: unixCurrentTimeInt64
static int unixCurrentTimeInt64(sqlite3_vfs *NotUsed, sqlite3_int64 *piNow){
  static const sqlite3_int64 unixEpoch = 24405875*(sqlite3_int64)8640000;
  int rc = SQLITE_OK;
#if defined(NO_GETTOD)
  time_t t;
  time(&t);
  *piNow = ((sqlite3_int64)t)*1000 + unixEpoch;
#elif OS_VXWORKS
  struct timespec sNow;
  clock_gettime(CLOCK_REALTIME, &sNow);
  *piNow = unixEpoch + 1000*(sqlite3_int64)sNow.tv_sec + sNow.tv_nsec/1000000;
#else
  struct timeval sNow;
  if( gettimeofday(&sNow, 0)==0 ){
    *piNow = unixEpoch + 1000*(sqlite3_int64)sNow.tv_sec + sNow.tv_usec/1000;
  }else{
    rc = SQLITE_ERROR;
  }
#endif

#ifdef SQLITE_TEST
  if( sqlite3_current_time ){
    *piNow = 1000*(sqlite3_int64)sqlite3_current_time + unixEpoch;
  }
#endif
  UNUSED_PARAMETER(NotUsed);
  return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
leaq -0x18(%rbp), %rdi
xorl %esi, %esi
callq 0x8640
movl %eax, %ecx
movl $0x1, %eax
testl %ecx, %ecx
jne 0xc662
movabsq $0x20c49ba5e353f7cf, %rax # imm = 0x20C49BA5E353F7CF
imulq -0x10(%rbp)
imulq $0x3e8, -0x18(%rbp), %rax # imm = 0x3E8
movq %rdx, %rcx
shrq $0x3f, %rcx
sarq $0x7, %rdx
addq %rcx, %rdx
addq %rax, %rdx
movabsq $0xbfc83e532200, %rax   # imm = 0xBFC83E532200
addq %rdx, %rax
movq %rax, (%rbx)
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: unixSetSystemCall
static int unixSetSystemCall(
  sqlite3_vfs *pNotUsed,        /* The VFS pointer.  Not used */
  const char *zName,            /* Name of system call to override */
  sqlite3_syscall_ptr pNewFunc  /* Pointer to new system call value */
){
  unsigned int i;
  int rc = SQLITE_NOTFOUND;

  UNUSED_PARAMETER(pNotUsed);
  if( zName==0 ){
    /* If no zName is given, restore all system calls to their default
    ** settings and return NULL
    */
    rc = SQLITE_OK;
    for(i=0; i<sizeof(aSyscall)/sizeof(aSyscall[0]); i++){
      if( aSyscall[i].pDefault ){
        aSyscall[i].pCurrent = aSyscall[i].pDefault;
      }
    }
  }else{
    /* If zName is specified, operate on only the one system call
    ** specified.
    */
    for(i=0; i<sizeof(aSyscall)/sizeof(aSyscall[0]); i++){
      if( strcmp(zName, aSyscall[i].zName)==0 ){
        if( aSyscall[i].pDefault==0 ){
          aSyscall[i].pDefault = aSyscall[i].pCurrent;
        }
        rc = SQLITE_OK;
        if( pNewFunc==0 ) pNewFunc = aSyscall[i].pDefault;
        aSyscall[i].pCurrent = pNewFunc;
        break;
      }
    }
  }
  return rc;
}

// Assembly:
testq %rsi, %rsi
je 0xc6b1
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movl $0x10, %r15d
leaq 0x881c4(%rip), %r12     # 0x94850
movq -0x10(%r15,%r12), %rsi
movq %r14, %rdi
callq 0x8530
testl %eax, %eax
je 0xc6da
addq $0x18, %r15
cmpq $0x250, %r15            # imm = 0x250
jne 0xc68c
movl $0xc, %eax
jmp 0xc6fa
movl $0x10, %eax
leaq 0x88193(%rip), %rcx     # 0x94850
movq (%rax,%rcx), %rdx
testq %rdx, %rdx
je 0xc6cb
movq %rdx, -0x8(%rax,%rcx)
addq $0x18, %rax
cmpq $0x250, %rax            # imm = 0x250
jne 0xc6bd
xorl %eax, %eax
retq
cmpq $0x0, (%r15,%r12)
jne 0xc6ea
movq -0x8(%r15,%r12), %rax
movq %rax, (%r15,%r12)
testq %rbx, %rbx
jne 0xc6f3
movq (%r15,%r12), %rbx
movq %rbx, -0x8(%r15,%r12)
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: unixNextSystemCall
static const char *unixNextSystemCall(sqlite3_vfs *p, const char *zName){
  int i = -1;

  UNUSED_PARAMETER(p);
  if( zName ){
    for(i=0; i<ArraySize(aSyscall)-1; i++){
      if( strcmp(zName, aSyscall[i].zName)==0 ) break;
    }
  }
  for(i++; i<ArraySize(aSyscall); i++){
    if( aSyscall[i].pCurrent!=0 ) return aSyscall[i].zName;
  }
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testq %rsi, %rsi
je 0xc793
movq %rsi, %rbx
leaq 0x880e7(%rip), %r15     # 0x94850
xorl %r14d, %r14d
movq (%r15), %rsi
movq %rbx, %rdi
callq 0x8530
testl %eax, %eax
je 0xc78e
incq %r14
addq $0x18, %r15
cmpq $0x17, %r14
jne 0xc76c
movl $0x17, %r14d
movslq %r14d, %rcx
jmp 0xc79a
movq $-0x1, %rcx
leaq (%rcx,%rcx,2), %rax
addq $-0x18, %rcx
leaq 0x880a7(%rip), %rdx     # 0x94850
leaq (%rdx,%rax,8), %rdx
addq $0x20, %rdx
xorl %eax, %eax
incq %rcx
je 0xc7c9
leaq 0x18(%rdx), %rsi
cmpq $0x0, (%rdx)
movq %rsi, %rdx
je 0xc7b3
movq -0x20(%rsi), %rax
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: sqlite3Error
SQLITE_PRIVATE void sqlite3Error(sqlite3 *db, int err_code, const char *zFormat, ...){
  if( db && (db->pErr || (db->pErr = sqlite3ValueNew(db))!=0) ){
    db->errCode = err_code;
    if( zFormat ){
      char *z;
      va_list ap;
      va_start(ap, zFormat);
      z = sqlite3VMPrintf(db, zFormat, ap);
      va_end(ap);
      sqlite3ValueSetStr(db->pErr, -1, z, SQLITE_UTF8, SQLITE_DYNAMIC);
    }else{
      sqlite3ValueSetStr(db->pErr, 0, 0, SQLITE_UTF8, SQLITE_STATIC);
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0xc8, %rsp
movq %rcx, -0xc8(%rbp)
movq %r8, -0xc0(%rbp)
movq %r9, -0xb8(%rbp)
testb %al, %al
je 0xc946
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)
testq %rdi, %rdi
je 0xca26
movq %rdx, %r14
movl %esi, %r15d
movq %rdi, %rbx
cmpq $0x0, 0x130(%rdi)
jne 0xc9a2
movq %rbx, %rdi
movl $0x38, %esi
callq 0x115e9
testq %rax, %rax
je 0xca1f
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rax)
movups %xmm0, (%rax)
movups %xmm0, 0x10(%rax)
movq $0x0, 0x30(%rax)
movw $0x1, 0x24(%rax)
movb $0x5, 0x26(%rax)
movq %rbx, (%rax)
movq %rax, 0x130(%rbx)
movl %r15d, 0x44(%rbx)
testq %r14, %r14
je 0xca01
leaq -0xe0(%rbp), %rax
leaq -0x30(%rbp), %rdx
movq %rax, 0x10(%rdx)
leaq 0x10(%rbp), %rax
movq %rax, 0x8(%rdx)
movabsq $0x3000000018, %rax     # imm = 0x3000000018
movq %rax, (%rdx)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x19668
movq 0x130(%rbx), %rdi
testq %rdi, %rdi
je 0xca26
leaq -0x3119(%rip), %r8      # 0x98d4
movq %rax, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl $0x1, %ecx
callq 0xeff4
jmp 0xca26
movq 0x130(%rbx), %rdi
testq %rdi, %rdi
je 0xca26
addq $0xc8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xf2d0
movq %rax, 0x130(%rbx)
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: findBtree
static Btree *findBtree(sqlite3 *pErrorDb, sqlite3 *pDb, const char *zDb){
  int i = sqlite3FindDbName(pDb, zDb);

  if( i==1 ){
    Parse *pParse;
    int rc = 0;
    pParse = sqlite3StackAllocZero(pErrorDb, sizeof(*pParse));
    if( pParse==0 ){
      sqlite3Error(pErrorDb, SQLITE_NOMEM, "out of memory");
      rc = SQLITE_NOMEM;
    }else{
      pParse->db = pDb;
      if( sqlite3OpenTempDatabase(pParse) ){
        sqlite3Error(pErrorDb, pParse->rc, "%s", pParse->zErrMsg);
        rc = SQLITE_ERROR;
      }
      sqlite3DbFree(pErrorDb, pParse->zErrMsg);
      sqlite3StackFree(pErrorDb, pParse);
    }
    if( rc ){
      return 0;
    }
  }

  if( i<0 ){
    sqlite3Error(pErrorDb, SQLITE_ERROR, "unknown database %s", zDb);
    return 0;
  }

  return pDb->aDb[i].pBt;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq %rsi, %rdi
movq %rdx, %rsi
callq 0x158a4
movl %eax, %r13d
cmpl $0x1, %eax
jne 0xcb01
movq %rbx, %rdi
movl $0x298, %esi            # imm = 0x298
callq 0x115e9
testq %rax, %rax
je 0xcace
movq %rax, %r12
movl $0x298, %edx            # imm = 0x298
movq %rax, %rdi
xorl %esi, %esi
callq 0x8200
movq %r15, (%r12)
movq %r12, %rdi
callq 0x196d4
testl %eax, %eax
je 0xcae9
movl 0x18(%r12), %esi
movq 0x8(%r12), %rcx
leaq 0x6cc32(%rip), %rdx     # 0x796d9
xorl %r15d, %r15d
movq %rbx, %rdi
xorl %eax, %eax
callq 0xc8f4
movq 0x8(%r12), %rsi
movq %rbx, %rdi
callq 0x9c3a
movq %rbx, %rdi
movq %r12, %rsi
callq 0x9c3a
jmp 0xcb34
leaq 0x6cc8f(%rip), %rdx     # 0x79764
xorl %r15d, %r15d
movq %rbx, %rdi
movl $0x7, %esi
xorl %eax, %eax
callq 0xc8f4
jmp 0xcb34
movq 0x8(%r12), %rsi
movq %rbx, %rdi
callq 0x9c3a
movq %rbx, %rdi
movq %r12, %rsi
callq 0x9c3a
testl %r13d, %r13d
js 0xcb18
movq 0x20(%r15), %rax
movl %r13d, %ecx
shlq $0x5, %rcx
movq 0x8(%rax,%rcx), %r15
jmp 0xcb34
leaq 0x6cc53(%rip), %rdx     # 0x79772
xorl %r15d, %r15d
movq %rbx, %rdi
movl $0x1, %esi
movq %r14, %rcx
xorl %eax, %eax
callq 0xc8f4
movq %r15, %rax
addq $0x8, %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: sqlite3PagerUnref
SQLITE_PRIVATE void sqlite3PagerUnref(DbPage *pPg){
  if( pPg ){
    Pager *pPager = pPg->pPager;
    if( pPg->flags & PGHDR_MMAP ){
      pagerReleaseMapPage(pPg);
    }else{
      sqlite3PcacheRelease(pPg);
    }
    pagerUnlockIfUnused(pPager);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0xdd42
movq 0x20(%rdi), %rbx
testb $0x40, 0x2c(%rdi)
jne 0xdcf0
callq 0x1f9a5
jmp 0xdd2c
decl 0x98(%rbx)
movq 0xa8(%rbx), %rax
movq %rax, 0x18(%rdi)
movq %rdi, 0xa8(%rbx)
movq 0x48(%rbx), %rax
movl 0x28(%rdi), %ecx
decl %ecx
movslq 0xbc(%rbx), %rsi
imulq %rcx, %rsi
movq 0x8(%rdi), %rdx
movq (%rax), %rcx
movq %rax, %rdi
callq *0x90(%rcx)
cmpl $0x0, 0x98(%rbx)
jne 0xdd42
movq 0x110(%rbx), %rax
cmpl $0x0, 0x18(%rax)
je 0xdd49
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x1d2c0
// File: /workspace/github_c_makefile_star2_O1/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3BtreeUpdateMeta
SQLITE_PRIVATE int sqlite3BtreeUpdateMeta(Btree *p, int idx, u32 iMeta){
  BtShared *pBt = p->pBt;
  unsigned char *pP1;
  int rc;
  assert( idx>=1 && idx<=15 );
  sqlite3BtreeEnter(p);
  assert( p->inTrans==TRANS_WRITE );
  assert( pBt->pPage1!=0 );
  pP1 = pBt->pPage1->aData;
  rc = sqlite3PagerWrite(pBt->pPage1->pDbPage);
  if( rc==SQLITE_OK ){
    put4byte(&pP1[36 + idx*4], iMeta);
#ifndef SQLITE_OMIT_AUTOVACUUM
    if( idx==BTREE_INCR_VACUUM ){
      assert( pBt->autoVacuum || iMeta==0 );
      assert( iMeta==0 || iMeta==1 );
      pBt->incrVacuum = (u8)iMeta;
    }
#endif
  }
  sqlite3BtreeLeave(p);
  return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %ebx
movl %esi, %r14d
movq (%rdi), %rax
movq 0x8(%rdi), %r15
movq %rax, 0x8(%r15)
movq 0x18(%r15), %rax
movq 0x50(%rax), %r12
movq 0x68(%rax), %rdi
callq 0xdebf
testl %eax, %eax
jne 0xdd9c
movslq %r14d, %rcx
movl %ebx, %edx
bswapl %edx
movl %edx, 0x24(%r12,%rcx,4)
cmpl $0x7, %ecx
jne 0xdd9c
movb %bl, 0x22(%r15)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3ResetAllSchemasOfConnection
SQLITE_PRIVATE void sqlite3ResetAllSchemasOfConnection(sqlite3 *db){
  int i;
  sqlite3BtreeEnterAll(db);
  for(i=0; i<db->nDb; i++){
    Db *pDb = &db->aDb[i];
    if( pDb->pSchema ){
      sqlite3SchemaClear(pDb->pSchema);
    }
  }
  db->flags &= ~SQLITE_InternChanges;
  sqlite3VtabUnlockList(db);
  sqlite3BtreeLeaveAll(db);
  sqlite3CollapseDatabaseArray(db);
}

// 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 0xdde3
movq 0x20(%rbx), %rcx
shlq $0x5, %rax
xorl %edx, %edx
movq 0x8(%rcx,%rdx), %rsi
testq %rsi, %rsi
je 0xddda
movq (%rsi), %rdi
movq 0x8(%rsi), %rsi
movq %rdi, 0x8(%rsi)
addq $0x20, %rdx
cmpq %rdx, %rax
jne 0xddc5
cmpl $0x0, 0x28(%rbx)
jle 0xde14
movl $0x18, %r14d
xorl %r15d, %r15d
movq 0x20(%rbx), %rax
movq (%rax,%r14), %rdi
testq %rdi, %rdi
je 0xde04
callq 0x30334
incq %r15
movslq 0x28(%rbx), %rax
addq $0x20, %r14
cmpq %rax, %r15
jl 0xddf2
andb $-0x3, 0x2c(%rbx)
movq %rbx, %rdi
callq 0x3668e
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x366dc
// File: /workspace/github_c_makefile_star2_O1/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3BtreeSetVersion
SQLITE_PRIVATE int sqlite3BtreeSetVersion(Btree *pBtree, int iVersion){
  BtShared *pBt = pBtree->pBt;
  int rc;                         /* Return code */
 
  assert( iVersion==1 || iVersion==2 );

  /* If setting the version fields to 1, do not automatically open the
  ** WAL connection, even if the version fields are currently set to 2.
  */
  pBt->btsFlags &= ~BTS_NO_WAL;
  if( iVersion==1 ) pBt->btsFlags |= BTS_NO_WAL;

  rc = sqlite3BtreeBeginTrans(pBtree, 0);
  if( rc==SQLITE_OK ){
    u8 *aData = pBt->pPage1->aData;
    if( aData[18]!=(u8)iVersion || aData[19]!=(u8)iVersion ){
      rc = sqlite3BtreeBeginTrans(pBtree, 2);
      if( rc==SQLITE_OK ){
        rc = sqlite3PagerWrite(pBt->pPage1->pDbPage);
        if( rc==SQLITE_OK ){
          aData[18] = (u8)iVersion;
          aData[19] = (u8)iVersion;
        }
      }
    }
  }

  pBt->btsFlags &= ~BTS_NO_WAL;
  return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
movq 0x8(%rdi), %r15
movzwl 0x26(%r15), %eax
andl $-0x11, %eax
xorl %ecx, %ecx
cmpl $0x1, %esi
sete %cl
shll $0x4, %ecx
orl %eax, %ecx
movw %cx, 0x26(%r15)
xorl %esi, %esi
callq 0xd067
testl %eax, %eax
jne 0xdeb1
movq 0x18(%r15), %rax
movq 0x50(%rax), %r12
cmpb %bl, 0x12(%r12)
jne 0xde83
xorl %eax, %eax
cmpb %bl, 0x13(%r12)
je 0xdeb1
movq %r14, %rdi
movl $0x2, %esi
callq 0xd067
testl %eax, %eax
jne 0xdeb1
movq 0x18(%r15), %rax
movq 0x68(%rax), %rdi
callq 0xdebf
testl %eax, %eax
jne 0xdeb1
movb %bl, 0x12(%r12)
movb %bl, 0x13(%r12)
xorl %eax, %eax
andb $-0x11, 0x26(%r15)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3PagerSync
SQLITE_PRIVATE int sqlite3PagerSync(Pager *pPager){
  int rc = SQLITE_OK;
  if( !pPager->noSync ){
    assert( !MEMDB );
    rc = sqlite3OsSync(pPager->fd, pPager->syncFlags);
  }else if( isOpen(pPager->fd) ){
    assert( !MEMDB );
    rc = sqlite3OsFileControl(pPager->fd, SQLITE_FCNTL_SYNC_OMITTED, 0);
    if( rc==SQLITE_NOTFOUND ){
      rc = SQLITE_OK;
    }
  }
  return rc;
}

// Assembly:
movq %rdi, %rax
cmpb $0x0, 0xb(%rdi)
movq 0x48(%rdi), %rdi
je 0xe2c0
movq (%rdi), %rax
testq %rax, %rax
je 0xe2cd
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
xorl %ebx, %ebx
movl $0x8, %esi
xorl %edx, %edx
callq *0x50(%rax)
cmpl $0xc, %eax
cmovel %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movzbl 0xf(%rax), %esi
movq (%rdi), %rax
movq 0x28(%rax), %rax
jmpq *%rax
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3BtreeCommitPhaseTwo
SQLITE_PRIVATE int sqlite3BtreeCommitPhaseTwo(Btree *p, int bCleanup){

  if( p->inTrans==TRANS_NONE ) return SQLITE_OK;
  sqlite3BtreeEnter(p);
  btreeIntegrity(p);

  /* If the handle has a write-transaction open, commit the shared-btrees 
  ** transaction and set the shared state to TRANS_READ.
  */
  if( p->inTrans==TRANS_WRITE ){
    int rc;
    BtShared *pBt = p->pBt;
    assert( pBt->inTransaction==TRANS_WRITE );
    assert( pBt->nTransaction>0 );
    rc = sqlite3PagerCommitPhaseTwo(pBt->pPager);
    if( rc!=SQLITE_OK && bCleanup==0 ){
      sqlite3BtreeLeave(p);
      return rc;
    }
    pBt->inTransaction = TRANS_READ;
    btreeClearHasContent(pBt);
  }

  btreeEndTransaction(p);
  sqlite3BtreeLeave(p);
  return SQLITE_OK;
}

// Assembly:
movb 0x10(%rdi), %cl
xorl %eax, %eax
testb %cl, %cl
je 0xe382
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rax
movq 0x8(%rdi), %r12
movq %rax, 0x8(%r12)
cmpb $0x2, %cl
jne 0xe370
movl %esi, %r14d
movq (%r12), %r15
movl 0x2c(%r15), %eax
testl %eax, %eax
jne 0xe34e
cmpb $0x2, 0x13(%r15)
jne 0xe326
cmpb $0x0, 0x8(%r15)
je 0xe326
cmpb $0x1, 0x9(%r15)
jne 0xe326
xorl %eax, %eax
movb $0x1, %cl
jmp 0xe34a
movzbl 0x16(%r15), %esi
movq %r15, %rdi
movl $0x1, %edx
callq 0x1e0fd
cmpb $0xd, %al
je 0xe344
movzbl %al, %ecx
cmpl $0xa, %ecx
jne 0xe34e
movl %eax, 0x2c(%r15)
movb $0x6, %cl
movb %cl, 0x13(%r15)
testl %r14d, %r14d
jne 0xe357
testl %eax, %eax
jne 0xe37a
movb $0x1, 0x24(%r12)
movq 0x58(%r12), %rdi
callq 0x1df1e
movq $0x0, 0x58(%r12)
movq %rbx, %rdi
callq 0x20f55
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3_backup_finish
SQLITE_API int sqlite3_backup_finish(sqlite3_backup *p){
  sqlite3_backup **pp;                 /* Ptr to head of pagers backup list */
  sqlite3 *pSrcDb;                     /* Source database connection */
  int rc;                              /* Value to return */

  /* Enter the mutexes */
  if( p==0 ) return SQLITE_OK;
  pSrcDb = p->pSrcDb;
  sqlite3_mutex_enter(pSrcDb->mutex);
  sqlite3BtreeEnter(p->pSrc);
  if( p->pDestDb ){
    sqlite3_mutex_enter(p->pDestDb->mutex);
  }

  /* Detach this backup from the source pager. */
  if( p->pDestDb ){
    p->pSrc->nBackup--;
  }
  if( p->isAttached ){
    pp = sqlite3PagerBackupPtr(sqlite3BtreePager(p->pSrc));
    while( *pp!=p ){
      pp = &(*pp)->pNext;
    }
    *pp = p->pNext;
  }

  /* If a transaction is still open on the Btree, roll it back. */
  sqlite3BtreeRollback(p->pDest, SQLITE_OK);

  /* Set the error code of the destination database handle. */
  rc = (p->rc==SQLITE_DONE) ? SQLITE_OK : p->rc;
  sqlite3Error(p->pDestDb, rc, 0);

  /* Exit the mutexes and free the backup context structure. */
  if( p->pDestDb ){
    sqlite3LeaveMutexAndCloseZombie(p->pDestDb);
  }
  sqlite3BtreeLeave(p->pSrc);
  if( p->pDestDb ){
    /* EVIDENCE-OF: R-64852-21591 The sqlite3_backup object is created by a
    ** call to sqlite3_backup_init() and is destroyed by a call to
    ** sqlite3_backup_finish(). */
    sqlite3_free(p);
  }
  sqlite3LeaveMutexAndCloseZombie(pSrcDb);
  return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
testq %rdi, %rdi
je 0xe66d
movq %rdi, %r14
movq 0x20(%rdi), %rbx
movq 0x28(%rdi), %rcx
movq (%rcx), %rdx
movq 0x8(%rcx), %rax
movq %rdx, 0x8(%rax)
cmpq $0x0, (%rdi)
je 0xe5fb
decl 0x18(%rcx)
cmpl $0x0, 0x3c(%r14)
je 0xe61f
movq (%rax), %rax
addq $0x70, %rax
movq %rax, %rcx
movq (%rax), %rdx
leaq 0x40(%rdx), %rax
cmpq %r14, %rdx
jne 0xe609
movq 0x40(%r14), %rax
movq %rax, (%rcx)
movq 0x8(%r14), %rdi
xorl %r12d, %r12d
xorl %esi, %esi
callq 0xe67c
movl 0x30(%r14), %r15d
cmpl $0x65, %r15d
cmovel %r12d, %r15d
movq (%r14), %rdi
movl %r15d, %esi
xorl %edx, %edx
xorl %eax, %eax
callq 0xc8f4
movq (%r14), %rdi
testq %rdi, %rdi
je 0xe655
callq 0xe727
cmpq $0x0, (%r14)
je 0xe663
movq %r14, %rdi
callq 0xa2e8
movq %rbx, %rdi
callq 0xe727
jmp 0xe670
xorl %r15d, %r15d
movl %r15d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3BtreeRollback
SQLITE_PRIVATE int sqlite3BtreeRollback(Btree *p, int tripCode){
  int rc;
  BtShared *pBt = p->pBt;
  MemPage *pPage1;

  sqlite3BtreeEnter(p);
  if( tripCode==SQLITE_OK ){
    rc = tripCode = saveAllCursors(pBt, 0, 0);
  }else{
    rc = SQLITE_OK;
  }
  if( tripCode ){
    sqlite3BtreeTripAllCursors(p, tripCode);
  }
  btreeIntegrity(p);

  if( p->inTrans==TRANS_WRITE ){
    int rc2;

    assert( TRANS_WRITE==pBt->inTransaction );
    rc2 = sqlite3PagerRollback(pBt->pPager);
    if( rc2!=SQLITE_OK ){
      rc = rc2;
    }

    /* The rollback may have destroyed the pPage1->aData value.  So
    ** call btreeGetPage() on page 1 again to make
    ** sure pPage1->aData is set correctly. */
    if( btreeGetPage(pBt, 1, &pPage1, 0)==SQLITE_OK ){
      int nPage = get4byte(28+(u8*)pPage1->aData);
      testcase( nPage==0 );
      if( nPage==0 ) sqlite3PagerPagecount(pBt->pPager, &nPage);
      testcase( pBt->nPage!=nPage );
      pBt->nPage = nPage;
      releasePage(pPage1);
    }
    assert( countValidCursors(pBt, 1)==0 );
    pBt->inTransaction = TRANS_READ;
    btreeClearHasContent(pBt);
  }

  btreeEndTransaction(p);
  sqlite3BtreeLeave(p);
  return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movq 0x8(%rdi), %r14
movq (%rdi), %rax
movq %rax, 0x8(%r14)
testl %esi, %esi
jne 0xe6a7
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x21124
movl %eax, %esi
testl %esi, %esi
je 0xe6b3
movq %rbx, %rdi
callq 0x23006
cmpb $0x2, 0x10(%rbx)
jne 0xe717
movq (%r14), %rdi
callq 0x1e053
leaq -0x18(%rbp), %rdx
movq %r14, %rdi
movl $0x1, %esi
xorl %ecx, %ecx
callq 0x2035c
testl %eax, %eax
jne 0xe701
movq -0x18(%rbp), %rax
movq 0x50(%rax), %rcx
movl 0x1c(%rcx), %ecx
bswapl %ecx
testl %ecx, %ecx
jne 0xe6ef
movq (%r14), %rcx
movl 0x1c(%rcx), %ecx
movl %ecx, 0x3c(%r14)
testq %rax, %rax
je 0xe701
movq 0x68(%rax), %rdi
callq 0xdcd4
movb $0x1, 0x24(%r14)
movq 0x58(%r14), %rdi
callq 0x1df1e
movq $0x0, 0x58(%r14)
movq %rbx, %rdi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x20f55
// File: /workspace/github_c_makefile_star2_O1/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3_finalize
SQLITE_API int sqlite3_finalize(sqlite3_stmt *pStmt){
  int rc;
  if( pStmt==0 ){
    /* IMPLEMENTATION-OF: R-57228-12904 Invoking sqlite3_finalize() on a NULL
    ** pointer is a harmless no-op. */
    rc = SQLITE_OK;
  }else{
    Vdbe *v = (Vdbe*)pStmt;
    sqlite3 *db = v->db;
    if( vdbeSafety(v) ) return SQLITE_MISUSE_BKPT;
    sqlite3_mutex_enter(db->mutex);
    rc = sqlite3VdbeFinalize(v);
    rc = sqlite3ApiExit(db, rc);
    sqlite3LeaveMutexAndCloseZombie(db);
  }
  return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
testq %rdi, %rdi
je 0xe9a7
movq (%rdi), %rbx
testq %rbx, %rbx
je 0xe9ab
callq 0xe9e9
movq %rbx, %rdi
movl %eax, %esi
callq 0xea22
movl %eax, %r14d
movq %rbx, %rdi
callq 0xe727
movl %r14d, %eax
jmp 0xe9e4
xorl %ebx, %ebx
jmp 0xe9e2
leaq 0x6aeab(%rip), %rsi     # 0x7985d
movl $0x15, %ebx
movl $0x15, %edi
xorl %eax, %eax
callq 0xb8cc
leaq 0x6ea1a(%rip), %rsi     # 0x7d3e4
leaq 0x6ab68(%rip), %rcx     # 0x79539
movl $0x15, %edi
movl $0xf7a0, %edx           # imm = 0xF7A0
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: sqlite3VdbeFinalize
SQLITE_PRIVATE int sqlite3VdbeFinalize(Vdbe *p){
  int rc = SQLITE_OK;
  if( p->magic==VDBE_MAGIC_RUN || p->magic==VDBE_MAGIC_HALT ){
    rc = sqlite3VdbeReset(p);
    assert( (rc & p->db->errMask)==rc );
  }
  sqlite3VdbeDelete(p);
  return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl 0x50(%rdi), %eax
cmpl $0x519c2973, %eax       # imm = 0x519C2973
je 0xea07
xorl %r14d, %r14d
cmpl $0xbdf20da3, %eax       # imm = 0xBDF20DA3
jne 0xea12
movq %rbx, %rdi
callq 0xeada
movl %eax, %r14d
movq %rbx, %rdi
callq 0x2325e
movl %r14d, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3ApiExit
SQLITE_PRIVATE int sqlite3ApiExit(sqlite3* db, int rc){
  /* If the db handle is not NULL, then we must hold the connection handle
  ** mutex here. Otherwise the read (and possible write) of db->mallocFailed 
  ** is unsafe, as is the call to sqlite3Error().
  */
  assert( !db || sqlite3_mutex_held(db->mutex) );
  if( db && (db->mallocFailed || rc==SQLITE_IOERR_NOMEM) ){
    sqlite3Error(db, SQLITE_NOMEM, 0);
    db->mallocFailed = 0;
    rc = SQLITE_NOMEM;
  }
  return rc & (db ? db->errMask : 0xff);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
testq %rdi, %rdi
je 0xea5d
cmpl $0xc0a, %ebx            # imm = 0xC0A
je 0xea42
cmpb $0x0, 0x50(%r14)
je 0xea5d
movl $0x7, %ebx
movq %r14, %rdi
movl $0x7, %esi
xorl %edx, %edx
xorl %eax, %eax
callq 0xc8f4
movb $0x0, 0x50(%r14)
testq %r14, %r14
je 0xea68
movl 0x48(%r14), %eax
jmp 0xea6d
movl $0xff, %eax
andl %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_reset
SQLITE_API int sqlite3_reset(sqlite3_stmt *pStmt){
  int rc;
  if( pStmt==0 ){
    rc = SQLITE_OK;
  }else{
    Vdbe *v = (Vdbe*)pStmt;
    sqlite3_mutex_enter(v->db->mutex);
    rc = sqlite3VdbeReset(v);
    sqlite3VdbeRewind(v);
    assert( (rc & (v->db->errMask))==rc );
    rc = sqlite3ApiExit(v->db, rc);
    sqlite3_mutex_leave(v->db->mutex);
  }
  return rc;
}

// Assembly:
testq %rdi, %rdi
je 0xead7
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0xeada
movl $0xbdf20da3, 0x50(%rbx) # imm = 0xBDF20DA3
xorl %ecx, %ecx
movl %ecx, 0x94(%rbx)
movw $0xff02, 0x98(%rbx)     # imm = 0xFF02
movl %ecx, 0x9c(%rbx)
movabsq $-0xffffffff, %rdx      # imm = 0xFFFFFFFF00000001
movq %rdx, 0x8c(%rbx)
movl %ecx, 0xa8(%rbx)
movq $0x0, 0xc8(%rbx)
movq (%rbx), %rdi
movl %eax, %esi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0xea22
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3_clear_bindings
SQLITE_API int sqlite3_clear_bindings(sqlite3_stmt *pStmt){
  int i;
  int rc = SQLITE_OK;
  Vdbe *p = (Vdbe*)pStmt;
#if SQLITE_THREADSAFE
  sqlite3_mutex *mutex = ((Vdbe*)pStmt)->db->mutex;
#endif
  sqlite3_mutex_enter(mutex);
  for(i=0; i<p->nVar; i++){
    sqlite3VdbeMemRelease(&p->aVar[i]);
    p->aVar[i].flags = MEM_Null;
  }
  if( p->isPrepareV2 && p->expmask ){
    p->expired = 1;
  }
  sqlite3_mutex_leave(mutex);
  return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpw $0x0, 0x88(%rdi)
jle 0xebf6
xorl %r14d, %r14d
xorl %r15d, %r15d
movq 0x78(%rbx), %rdi
addq %r14, %rdi
callq 0xec23
movq 0x78(%rbx), %rax
movw $0x1, 0x24(%rax,%r14)
incq %r15
movswq 0x88(%rbx), %rax
addq $0x38, %r14
cmpq %rax, %r15
jl 0xebca
movzwl 0x9a(%rbx), %eax
btl $0xa, %eax
jae 0xec16
cmpl $0x0, 0x104(%rbx)
je 0xec16
orl $0x20, %eax
movw %ax, 0x9a(%rbx)
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: sqlite3VdbeMemRelease
SQLITE_PRIVATE void sqlite3VdbeMemRelease(Mem *p){
  VdbeMemRelease(p);
  sqlite3DbFree(p->db, p->zMalloc);
  p->z = 0;
  p->zMalloc = 0;
  p->xDel = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movzwl 0x24(%rdi), %eax
testl $0x2460, %eax           # imm = 0x2460
je 0xec3f
movq %rbx, %rdi
callq 0x101e6
movq (%rbx), %rdi
movq 0x30(%rbx), %rsi
callq 0x9c3a
movq $0x0, 0x8(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x28(%rbx)
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_value_blob
SQLITE_API const void *sqlite3_value_blob(sqlite3_value *pVal){
  Mem *p = (Mem*)pVal;
  if( p->flags & (MEM_Blob|MEM_Str) ){
    sqlite3VdbeMemExpandBlob(p);
    p->flags &= ~MEM_Str;
    p->flags |= MEM_Blob;
    return p->n ? p->z : 0;
  }else{
    return sqlite3_value_text(pVal);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
testb $0x12, 0x24(%rdi)
je 0xec91
movq %rbx, %rdi
callq 0xecad
movl 0x24(%rbx), %eax
andl $-0x13, %eax
orl $0x10, %eax
movw %ax, 0x24(%rbx)
cmpl $0x0, 0x20(%rbx)
je 0xeca4
movq 0x8(%rbx), %rax
jmp 0xeca6
movq %rbx, %rdi
movl $0x1, %esi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0xee49
xorl %eax, %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: sqlite3VdbeMemExpandBlob
SQLITE_PRIVATE int sqlite3VdbeMemExpandBlob(Mem *pMem){
  if( pMem->flags & MEM_Zero ){
    int nByte;
    assert( pMem->flags&MEM_Blob );
    assert( (pMem->flags&MEM_RowSet)==0 );
    assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) );

    /* Set nByte to the number of bytes required to store the expanded blob. */
    nByte = pMem->n + pMem->u.nZero;
    if( nByte<=0 ){
      nByte = 1;
    }
    if( sqlite3VdbeMemGrow(pMem, nByte, 1) ){
      return SQLITE_NOMEM;
    }

    memset(&pMem->z[pMem->n], 0, pMem->u.nZero);
    pMem->n += pMem->u.nZero;
    pMem->flags &= ~(MEM_Zero|MEM_Term);
  }
  return SQLITE_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
xorl %r14d, %r14d
testb $0x40, 0x25(%rdi)
je 0xed05
movq %rdi, %rbx
movl 0x18(%rdi), %esi
addl 0x20(%rdi), %esi
cmpl $0x2, %esi
movl $0x1, %eax
cmovll %eax, %esi
movl $0x1, %edx
callq 0x1025e
movl $0x7, %r14d
testl %eax, %eax
jne 0xed05
movslq 0x20(%rbx), %rdi
addq 0x8(%rbx), %rdi
movslq 0x18(%rbx), %rdx
xorl %r14d, %r14d
xorl %esi, %esi
callq 0x8200
movl 0x18(%rbx), %eax
addl %eax, 0x20(%rbx)
andb $-0x43, 0x25(%rbx)
movl %r14d, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3ValueBytes
SQLITE_PRIVATE int sqlite3ValueBytes(sqlite3_value *pVal, u8 enc){
  Mem *p = (Mem*)pVal;
  if( (p->flags & MEM_Blob)!=0 || sqlite3ValueText(pVal, enc) ){
    if( p->flags & MEM_Zero ){
      return p->n + p->u.nZero;
    }else{
      return p->n;
    }
  }
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
testb $0x10, 0x24(%rdi)
jne 0xed48
movzbl %sil, %esi
movq %rbx, %rdi
callq 0xee49
testq %rax, %rax
je 0xed56
testb $0x40, 0x25(%rbx)
movl 0x20(%rbx), %eax
je 0xed58
addl 0x18(%rbx), %eax
jmp 0xed58
xorl %eax, %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: sqlite3VdbeRealValue
SQLITE_PRIVATE double sqlite3VdbeRealValue(Mem *pMem){
  assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) );
  assert( EIGHT_BYTE_ALIGNMENT(pMem) );
  if( pMem->flags & MEM_Real ){
    return pMem->r;
  }else if( pMem->flags & MEM_Int ){
    return (double)pMem->u.i;
  }else if( pMem->flags & (MEM_Str|MEM_Blob) ){
    /* (double)0 In case of SQLITE_OMIT_FLOATING_POINT... */
    double val = (double)0;
    sqlite3AtoF(pMem->z, &val, pMem->n, pMem->enc);
    return val;
  }else{
    /* (double)0 In case of SQLITE_OMIT_FLOATING_POINT... */
    return (double)0;
  }
}

// Assembly:
movzwl 0x24(%rdi), %eax
testb $0x8, %al
jne 0xedb4
testb $0x4, %al
jne 0xedba
testb $0x12, %al
je 0xedc1
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq -0x10(%rbp), %rbx
movq $0x0, (%rbx)
movq 0x8(%rdi), %rax
movl 0x20(%rdi), %edx
movzbl 0x27(%rdi), %ecx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x248aa
movsd (%rbx), %xmm0
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movsd 0x10(%rdi), %xmm0
retq
cvtsi2sdq 0x18(%rdi), %xmm0
retq
xorps %xmm0, %xmm0
retq
// File: /workspace/github_c_makefile_star2_O1/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3VdbeIntValue
SQLITE_PRIVATE i64 sqlite3VdbeIntValue(Mem *pMem){
  int flags;
  assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) );
  assert( EIGHT_BYTE_ALIGNMENT(pMem) );
  flags = pMem->flags;
  if( flags & MEM_Int ){
    return pMem->u.i;
  }else if( flags & MEM_Real ){
    return doubleToInt64(pMem->r);
  }else if( flags & (MEM_Str|MEM_Blob) ){
    i64 value = 0;
    assert( pMem->z || pMem->n==0 );
    testcase( pMem->z==0 );
    sqlite3Atoi64(pMem->z, &value, pMem->n, pMem->enc);
    return value;
  }else{
    return 0;
  }
}

// Assembly:
movzwl 0x24(%rdi), %eax
testb $0x4, %al
jne 0xee0d
testb $0x8, %al
jne 0xee12
testb $0x12, %al
je 0xee3f
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq -0x10(%rbp), %rbx
movq $0x0, (%rbx)
movq 0x8(%rdi), %rax
movl 0x20(%rdi), %edx
movzbl 0x27(%rdi), %ecx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x16f9b
movq (%rbx), %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movq 0x18(%rdi), %rax
retq
movsd 0x10(%rdi), %xmm0
movapd 0x6a561(%rip), %xmm1    # 0x79380
andpd %xmm0, %xmm1
ucomisd 0x6a47d(%rip), %xmm1    # 0x792a8
cvttsd2si %xmm0, %rcx
movabsq $-0x8000000000000000, %rax # imm = 0x8000000000000000
cmovbeq %rcx, %rax
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3ValueText
SQLITE_PRIVATE const void *sqlite3ValueText(sqlite3_value* pVal, u8 enc){
  if( !pVal ) return 0;

  assert( pVal->db==0 || sqlite3_mutex_held(pVal->db->mutex) );
  assert( (enc&3)==(enc&~SQLITE_UTF16_ALIGNED) );
  assert( (pVal->flags & MEM_RowSet)==0 );

  if( pVal->flags&MEM_Null ){
    return 0;
  }
  assert( (MEM_Blob>>3) == MEM_Str );
  pVal->flags |= (pVal->flags & MEM_Blob)>>3;
  ExpandBlob(pVal);
  if( pVal->flags&MEM_Str ){
    sqlite3VdbeChangeEncoding(pVal, enc & ~SQLITE_UTF16_ALIGNED);
    if( (enc & SQLITE_UTF16_ALIGNED)!=0 && 1==(1&SQLITE_PTR_TO_INT(pVal->z)) ){
      assert( (pVal->flags & (MEM_Ephem|MEM_Static))!=0 );
      if( sqlite3VdbeMemMakeWriteable(pVal)!=SQLITE_OK ){
        return 0;
      }
    }
    sqlite3VdbeMemNulTerminate(pVal); /* IMP: R-31275-44060 */
  }else{
    assert( (pVal->flags&MEM_Blob)==0 );
    sqlite3VdbeMemStringify(pVal, enc);
    assert( 0==(1&SQLITE_PTR_TO_INT(pVal->z)) );
  }
  assert(pVal->enc==(enc & ~SQLITE_UTF16_ALIGNED) || pVal->db==0
              || pVal->db->mallocFailed );
  if( pVal->enc==(enc & ~SQLITE_UTF16_ALIGNED) ){
    return pVal->z;
  }else{
    return 0;
  }
}

// Assembly:
testq %rdi, %rdi
je 0xee93
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movzwl 0x24(%rdi), %eax
testb $0x1, %al
jne 0xeed1
movl %esi, %r14d
movl %eax, %ecx
shrl $0x3, %ecx
andl $0x2, %ecx
orl %eax, %ecx
movw %cx, 0x24(%rbx)
btl $0xe, %eax
jae 0xee7f
movq %rbx, %rdi
callq 0xecad
testb $0x2, 0x24(%rbx)
movzbl %r14b, %esi
jne 0xee96
movq %rbx, %rdi
callq 0x25490
jmp 0xeec1
xorl %eax, %eax
retq
andl $-0x9, %esi
movq %rbx, %rdi
callq 0x24e59
testb $0x8, %r14b
je 0xeeb9
testb $0x1, 0x8(%rbx)
je 0xeeb9
movq %rbx, %rdi
callq 0x253d5
testl %eax, %eax
jne 0xeed1
movq %rbx, %rdi
callq 0x25440
andb $-0x9, %r14b
cmpb %r14b, 0x27(%rbx)
jne 0xeed1
movq 0x8(%rbx), %rax
jmp 0xeed3
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3VdbeMemSetDouble
SQLITE_PRIVATE void sqlite3VdbeMemSetDouble(Mem *pMem, double val){
  if( sqlite3IsNaN(val) ){
    sqlite3VdbeMemSetNull(pMem);
  }else{
    sqlite3VdbeMemRelease(pMem);
    pMem->r = val;
    pMem->flags = MEM_Real;
    pMem->type = SQLITE_FLOAT;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movsd %xmm0, -0x10(%rbp)
movsd -0x10(%rbp), %xmm1
movsd %xmm1, -0x20(%rbp)
movsd -0x10(%rbp), %xmm1
ucomisd -0x20(%rbp), %xmm1
jne 0xefc4
jp 0xefc4
movq %rbx, %rdi
movsd %xmm0, -0x18(%rbp)
callq 0xec23
movsd -0x18(%rbp), %xmm0
movsd %xmm0, 0x10(%rbx)
movw $0x8, 0x24(%rbx)
movb $0x2, 0x26(%rbx)
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
movq %rbx, %rdi
addq $0x18, %rsp
popq %rbx
popq %rbp
jmp 0xf2d0
// File: /workspace/github_c_makefile_star2_O1/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3_result_error
SQLITE_API void sqlite3_result_error(sqlite3_context *pCtx, const char *z, int n){
  assert( sqlite3_mutex_held(pCtx->s.db->mutex) );
  pCtx->isError = SQLITE_ERROR;
  pCtx->fErrorOrAux = 1;
  sqlite3VdbeMemSetStr(&pCtx->s, z, n, SQLITE_UTF8, SQLITE_TRANSIENT);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl $0x1, 0x5c(%rdi)
movb $0x1, 0x61(%rdi)
addq $0x8, %rdi
movl $0x1, %ecx
movq $-0x1, %r8
popq %rbp
jmp 0xeff4
// File: /workspace/github_c_makefile_star2_O1/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3_result_error16
SQLITE_API void sqlite3_result_error16(sqlite3_context *pCtx, const void *z, int n){
  assert( sqlite3_mutex_held(pCtx->s.db->mutex) );
  pCtx->isError = SQLITE_ERROR;
  pCtx->fErrorOrAux = 1;
  sqlite3VdbeMemSetStr(&pCtx->s, z, n, SQLITE_UTF16NATIVE, SQLITE_TRANSIENT);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl $0x1, 0x5c(%rdi)
movb $0x1, 0x61(%rdi)
addq $0x8, %rdi
movl $0x2, %ecx
movq $-0x1, %r8
popq %rbp
jmp 0xeff4
// File: /workspace/github_c_makefile_star2_O1/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3VdbeMemSetNull
SQLITE_PRIVATE void sqlite3VdbeMemSetNull(Mem *pMem){
  if( pMem->flags & MEM_Frame ){
    VdbeFrame *pFrame = pMem->u.pFrame;
    pFrame->pParent = pFrame->v->pDelFrame;
    pFrame->v->pDelFrame = pFrame;
  }
  if( pMem->flags & MEM_RowSet ){
    sqlite3RowSetClear(pMem->u.pRowSet);
  }
  MemSetTypeFlag(pMem, MEM_Null);
  pMem->type = SQLITE_NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movzwl 0x24(%rdi), %eax
testb $0x40, %al
je 0xf2fa
movq 0x18(%rbx), %rcx
movq (%rcx), %rdx
movq 0xf8(%rdx), %rsi
movq %rsi, 0x8(%rcx)
movq %rcx, 0xf8(%rdx)
testb $0x20, %al
je 0xf307
movq 0x18(%rbx), %rdi
callq 0x25543
movl $0xffffbe00, %eax       # imm = 0xFFFFBE00
andl 0x24(%rbx), %eax
incl %eax
movw %ax, 0x24(%rbx)
movb $0x5, 0x26(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3VdbeMemCopy
SQLITE_PRIVATE int sqlite3VdbeMemCopy(Mem *pTo, const Mem *pFrom){
  int rc = SQLITE_OK;

  assert( (pFrom->flags & MEM_RowSet)==0 );
  VdbeMemRelease(pTo);
  memcpy(pTo, pFrom, MEMCELLSIZE);
  pTo->flags &= ~MEM_Dyn;

  if( pTo->flags&(MEM_Str|MEM_Blob) ){
    if( 0==(pFrom->flags&MEM_Static) ){
      pTo->flags |= MEM_Ephem;
      rc = sqlite3VdbeMemMakeWriteable(pTo);
    }
  }

  return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movzwl 0x24(%rdi), %eax
testl $0x2460, %eax           # imm = 0x2460
je 0xf393
movq %rbx, %rdi
callq 0x101e6
movups (%r14), %xmm0
movups 0x10(%r14), %xmm1
movups 0x20(%r14), %xmm2
movups %xmm2, 0x20(%rbx)
movups %xmm1, 0x10(%rbx)
movups %xmm0, (%rbx)
movzwl 0x24(%rbx), %ecx
movl %ecx, %eax
andl $0xfbff, %eax           # imm = 0xFBFF
movw %ax, 0x24(%rbx)
testb $0x12, %cl
je 0xf3dc
testb $0x8, 0x25(%r14)
jne 0xf3dc
orl $0x1000, %eax           # imm = 0x1000
movw %ax, 0x24(%rbx)
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x253d5
popq %rbx
popq %r14
popq %rbp
retq