LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: sqlite3_vtab_config
SQLITE_CDECL sqlite3_vtab_config(sqlite3 *db, int op, ...){
  va_list ap;
  int rc = SQLITE_OK;

#ifdef SQLITE_ENABLE_API_ARMOR
  if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
#endif
  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);
  sqlite3_mutex_leave(db->mutex);
  return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0xd0, %rsp
movl %esi, %r14d
movq %rdi, %rbx
movq %rdx, -0xd0(%rbp)
movq %rcx, -0xc8(%rbp)
movq %r8, -0xc0(%rbp)
movq %r9, -0xb8(%rbp)
testb %al, %al
je 0x15cdd
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 0x18(%rdi), %rdi
testq %rdi, %rdi
je 0x15cec
callq *0x6d7bc(%rip)          # 0x834a8
leaq -0xe0(%rbp), %rax
movq %rax, -0x20(%rbp)
leaq 0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, -0x30(%rbp)
movl $0x1d0d8, %edi          # imm = 0x1D0D8
cmpl $0x1, %r14d
jne 0x15d41
movq 0x1c0(%rbx), %rax
testq %rax, %rax
je 0x15d3c
movl -0x30(%rbp), %edx
cmpq $0x28, %rdx
ja 0x15d57
movq %rdx, %rcx
addq -0x20(%rbp), %rcx
addl $0x8, %edx
movl %edx, -0x30(%rbp)
jmp 0x15d63
movl $0x1d0d0, %edi          # imm = 0x1D0D0
callq 0xb14d
pushq $0x15
popq %r14
movq %rbx, %rdi
movl %r14d, %esi
callq 0xe9aa
jmp 0x15d6e
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
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x15d7d
callq *0x6d73b(%rip)          # 0x834b8
movl %r14d, %eax
addq $0xd0, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: sqlite3_busy_handler
SQLITE_STDCALL sqlite3_busy_handler(
  sqlite3 *db,
  int (*xBusy)(void*,int),
  void *pArg
){
#ifdef SQLITE_ENABLE_API_ARMOR
  if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
#endif
  sqlite3_mutex_enter(db->mutex);
  db->busyHandler.xFunc = xBusy;
  db->busyHandler.pArg = pArg;
  db->busyHandler.nBusy = 0;
  db->busyTimeout = 0;
  sqlite3_mutex_leave(db->mutex);
  return SQLITE_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
testq %rdi, %rdi
je 0x16f47
callq *0x6c567(%rip)          # 0x834a8
movq 0x18(%rbx), %rdi
jmp 0x16f49
xorl %edi, %edi
movq %r15, 0x2a8(%rbx)
movq %r14, 0x2b0(%rbx)
andl $0x0, 0x2b8(%rbx)
andl $0x0, 0x308(%rbx)
testq %rdi, %rdi
je 0x16f70
callq *0x6c548(%rip)          # 0x834b8
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: sqlite3_progress_handler
SQLITE_STDCALL sqlite3_progress_handler(
  sqlite3 *db, 
  int nOps,
  int (*xProgress)(void*), 
  void *pArg
){
#ifdef SQLITE_ENABLE_API_ARMOR
  if( !sqlite3SafetyCheckOk(db) ){
    (void)SQLITE_MISUSE_BKPT;
    return;
  }
#endif
  sqlite3_mutex_enter(db->mutex);
  if( nOps>0 ){
    db->xProgress = xProgress;
    db->nProgressOps = (unsigned)nOps;
    db->pProgressArg = pArg;
  }else{
    db->xProgress = 0;
    db->nProgressOps = 0;
    db->pProgressArg = 0;
  }
  sqlite3_mutex_leave(db->mutex);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rcx, %rbx
movq %rdx, %r15
movl %esi, %r12d
movq %rdi, %r14
movq 0x18(%rdi), %rdi
testq %rdi, %rdi
je 0x16fa3
callq *0x6c505(%rip)          # 0x834a8
xorl %eax, %eax
testl %r12d, %r12d
cmovleq %rax, %r15
movl $0x0, %ecx
cmovgl %r12d, %ecx
cmovleq %rax, %rbx
movq %r15, 0x190(%r14)
movl %ecx, 0x1a0(%r14)
movq %rbx, 0x198(%r14)
movq 0x18(%r14), %rdi
testq %rdi, %rdi
je 0x16fe5
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmpq *0x6c4d3(%rip)          # 0x834b8
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: sqlite3_busy_timeout
SQLITE_STDCALL sqlite3_busy_timeout(sqlite3 *db, int ms){
#ifdef SQLITE_ENABLE_API_ARMOR
  if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
#endif
  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
pushq %r14
pushq %rbx
movq %rdi, %rbx
testl %esi, %esi
jle 0x1701a
movl %esi, %r14d
leaq 0x27(%rip), %rsi        # 0x1702d
movq %rbx, %rdi
movq %rbx, %rdx
callq 0xa250
movl %r14d, 0x308(%rbx)
jmp 0x17026
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0xa250
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: sqlite3_create_function_v2
SQLITE_STDCALL 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;

#ifdef SQLITE_ENABLE_API_ARMOR
  if( !sqlite3SafetyCheckOk(db) ){
    return SQLITE_MISUSE_BKPT;
  }
#endif
  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 $0x18, %rsp
movq %r9, -0x38(%rbp)
movq %r8, %r14
movl %ecx, -0x2c(%rbp)
movl %edx, %r13d
movq %rsi, %r12
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
testq %rdi, %rdi
je 0x170bb
callq *0x6c3ed(%rip)          # 0x834a8
cmpq $0x0, 0x20(%rbp)
je 0x170e3
pushq $0x18
popq %rsi
movq %rbx, %rdi
callq 0x12153
testq %rax, %rax
je 0x1712f
movq %rax, %r15
movq 0x20(%rbp), %rax
movq %rax, 0x8(%r15)
movq %r14, 0x10(%r15)
jmp 0x170e6
xorl %r15d, %r15d
subq $0x8, %rsp
movq %rbx, %rdi
movq %r12, %rsi
movl %r13d, %edx
movl -0x2c(%rbp), %ecx
movq %r14, %r8
movq -0x38(%rbp), %r9
pushq %r15
pushq 0x18(%rbp)
pushq 0x10(%rbp)
callq 0x17168
addq $0x20, %rsp
movl %eax, %r12d
testq %r15, %r15
je 0x17139
cmpl $0x0, (%r15)
jne 0x17139
movq %r14, %rdi
callq *0x20(%rbp)
movq %rbx, %rdi
movq %r15, %rsi
callq 0xb856
jmp 0x17139
movq %r14, %rdi
callq *0x20(%rbp)
pushq $0x1
popq %r12
movq %rbx, %rdi
movl %r12d, %esi
callq 0x108ce
movl %eax, %r14d
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x17156
callq *0x6c362(%rip)          # 0x834b8
movl %r14d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: sqlite3_overload_function
SQLITE_STDCALL sqlite3_overload_function(
  sqlite3 *db,
  const char *zName,
  int nArg
){
  int nName = sqlite3Strlen30(zName);
  int rc = SQLITE_OK;

#ifdef SQLITE_ENABLE_API_ARMOR
  if( !sqlite3SafetyCheckOk(db) || zName==0 || nArg<-2 ){
    return SQLITE_MISUSE_BKPT;
  }
#endif
  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 %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, %r14d
movq %rsi, %r15
movq %rdi, %rbx
movq %rsi, %rdi
callq 0xb080
movl %eax, %r13d
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x174a4
callq *0x6c004(%rip)          # 0x834a8
pushq $0x1
popq %r8
xorl %r12d, %r12d
movq %rbx, %rdi
movq %r15, %rsi
movl %r13d, %edx
movl %r14d, %ecx
xorl %r9d, %r9d
callq 0x1751e
testq %rax, %rax
jne 0x174ef
xorps %xmm0, %xmm0
movups %xmm0, (%rsp)
andq $0x0, 0x10(%rsp)
leaq 0x1bb(%rip), %r9        # 0x17693
pushq $0x1
popq %rcx
movq %rbx, %rdi
movq %r15, %rsi
movl %r14d, %edx
xorl %r8d, %r8d
callq 0x17168
movl %eax, %r12d
movq %rbx, %rdi
movl %r12d, %esi
callq 0x108ce
movl %eax, %r14d
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x1750c
callq *0x6bfac(%rip)          # 0x834b8
movl %r14d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: sqlite3_trace
SQLITE_API void *SQLITE_STDCALL sqlite3_trace(sqlite3 *db, void (*xTrace)(void*,const char*), void *pArg){
  void *pOld;

#ifdef SQLITE_ENABLE_API_ARMOR
  if( !sqlite3SafetyCheckOk(db) ){
    (void)SQLITE_MISUSE_BKPT;
    return 0;
  }
#endif
  sqlite3_mutex_enter(db->mutex);
  pOld = db->pTraceArg;
  db->xTrace = xTrace;
  db->pTraceArg = pArg;
  sqlite3_mutex_leave(db->mutex);
  return pOld;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
movq 0x18(%rdi), %rdi
testq %rdi, %rdi
je 0x176f9
callq *0x6bdb5(%rip)          # 0x834a8
movq 0x18(%r14), %rdi
jmp 0x176fb
xorl %edi, %edi
movq 0xd0(%r14), %r12
movq %r15, 0xc8(%r14)
movq %rbx, 0xd0(%r14)
testq %rdi, %rdi
je 0x1771b
callq *0x6bd9d(%rip)          # 0x834b8
movq %r12, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: sqlite3_profile
SQLITE_API void *SQLITE_STDCALL sqlite3_profile(
  sqlite3 *db,
  void (*xProfile)(void*,const char*,sqlite_uint64),
  void *pArg
){
  void *pOld;

#ifdef SQLITE_ENABLE_API_ARMOR
  if( !sqlite3SafetyCheckOk(db) ){
    (void)SQLITE_MISUSE_BKPT;
    return 0;
  }
#endif
  sqlite3_mutex_enter(db->mutex);
  pOld = db->pProfileArg;
  db->xProfile = xProfile;
  db->pProfileArg = pArg;
  sqlite3_mutex_leave(db->mutex);
  return pOld;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
movq 0x18(%rdi), %rdi
testq %rdi, %rdi
je 0x17750
callq *0x6bd5e(%rip)          # 0x834a8
movq 0x18(%r14), %rdi
jmp 0x17752
xorl %edi, %edi
movq 0xe0(%r14), %r12
movq %r15, 0xd8(%r14)
movq %rbx, 0xe0(%r14)
testq %rdi, %rdi
je 0x17772
callq *0x6bd46(%rip)          # 0x834b8
movq %r12, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: sqlite3_commit_hook
SQLITE_API void *SQLITE_STDCALL sqlite3_commit_hook(
  sqlite3 *db,              /* Attach the hook to this database */
  int (*xCallback)(void*),  /* Function to invoke on each commit */
  void *pArg                /* Argument to the function */
){
  void *pOld;

#ifdef SQLITE_ENABLE_API_ARMOR
  if( !sqlite3SafetyCheckOk(db) ){
    (void)SQLITE_MISUSE_BKPT;
    return 0;
  }
#endif
  sqlite3_mutex_enter(db->mutex);
  pOld = db->pCommitArg;
  db->xCommitCallback = xCallback;
  db->pCommitArg = pArg;
  sqlite3_mutex_leave(db->mutex);
  return pOld;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
movq 0x18(%rdi), %rdi
testq %rdi, %rdi
je 0x177a7
callq *0x6bd07(%rip)          # 0x834a8
movq 0x18(%r14), %rdi
jmp 0x177a9
xorl %edi, %edi
movq 0xe8(%r14), %r12
movq %r15, 0xf0(%r14)
movq %rbx, 0xe8(%r14)
testq %rdi, %rdi
je 0x177c9
callq *0x6bcef(%rip)          # 0x834b8
movq %r12, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: sqlite3_update_hook
SQLITE_API void *SQLITE_STDCALL sqlite3_update_hook(
  sqlite3 *db,              /* Attach the hook to this database */
  void (*xCallback)(void*,int,char const *,char const *,sqlite_int64),
  void *pArg                /* Argument to the function */
){
  void *pRet;

#ifdef SQLITE_ENABLE_API_ARMOR
  if( !sqlite3SafetyCheckOk(db) ){
    (void)SQLITE_MISUSE_BKPT;
    return 0;
  }
#endif
  sqlite3_mutex_enter(db->mutex);
  pRet = db->pUpdateArg;
  db->xUpdateCallback = xCallback;
  db->pUpdateArg = pArg;
  sqlite3_mutex_leave(db->mutex);
  return pRet;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
movq 0x18(%rdi), %rdi
testq %rdi, %rdi
je 0x177fe
callq *0x6bcb0(%rip)          # 0x834a8
movq 0x18(%r14), %rdi
jmp 0x17800
xorl %edi, %edi
movq 0x108(%r14), %r12
movq %r15, 0x110(%r14)
movq %rbx, 0x108(%r14)
testq %rdi, %rdi
je 0x17820
callq *0x6bc98(%rip)          # 0x834b8
movq %r12, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: sqlite3_rollback_hook
SQLITE_API void *SQLITE_STDCALL sqlite3_rollback_hook(
  sqlite3 *db,              /* Attach the hook to this database */
  void (*xCallback)(void*), /* Callback function */
  void *pArg                /* Argument to the function */
){
  void *pRet;

#ifdef SQLITE_ENABLE_API_ARMOR
  if( !sqlite3SafetyCheckOk(db) ){
    (void)SQLITE_MISUSE_BKPT;
    return 0;
  }
#endif
  sqlite3_mutex_enter(db->mutex);
  pRet = db->pRollbackArg;
  db->xRollbackCallback = xCallback;
  db->pRollbackArg = pArg;
  sqlite3_mutex_leave(db->mutex);
  return pRet;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
movq 0x18(%rdi), %rdi
testq %rdi, %rdi
je 0x17855
callq *0x6bc59(%rip)          # 0x834a8
movq 0x18(%r14), %rdi
jmp 0x17857
xorl %edi, %edi
movq 0xf8(%r14), %r12
movq %r15, 0x100(%r14)
movq %rbx, 0xf8(%r14)
testq %rdi, %rdi
je 0x17877
callq *0x6bc41(%rip)          # 0x834b8
movq %r12, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: sqlite3_wal_hook
SQLITE_API void *SQLITE_STDCALL sqlite3_wal_hook(
  sqlite3 *db,                    /* Attach the hook to this db handle */
  int(*xCallback)(void *, sqlite3*, const char*, int),
  void *pArg                      /* First argument passed to xCallback() */
){
#ifndef SQLITE_OMIT_WAL
  void *pRet;
#ifdef SQLITE_ENABLE_API_ARMOR
  if( !sqlite3SafetyCheckOk(db) ){
    (void)SQLITE_MISUSE_BKPT;
    return 0;
  }
#endif
  sqlite3_mutex_enter(db->mutex);
  pRet = db->pWalArg;
  db->xWalCallback = xCallback;
  db->pWalArg = pArg;
  sqlite3_mutex_leave(db->mutex);
  return pRet;
#else
  return 0;
#endif
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
movq 0x18(%rdi), %rdi
testq %rdi, %rdi
je 0x178cc
callq *0x6bbe2(%rip)          # 0x834a8
movq 0x18(%r14), %rdi
jmp 0x178ce
xorl %edi, %edi
movq 0x120(%r14), %r12
movq %r15, 0x118(%r14)
movq %rbx, 0x120(%r14)
testq %rdi, %rdi
je 0x178ee
callq *0x6bbca(%rip)          # 0x834b8
movq %r12, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: sqlite3_wal_checkpoint_v2
SQLITE_STDCALL 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 */

#ifdef SQLITE_ENABLE_API_ARMOR
  if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
#endif

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

  assert( SQLITE_CHECKPOINT_PASSIVE==0 );
  assert( SQLITE_CHECKPOINT_FULL==1 );
  assert( SQLITE_CHECKPOINT_RESTART==2 );
  assert( SQLITE_CHECKPOINT_TRUNCATE==3 );
  if( eMode<SQLITE_CHECKPOINT_PASSIVE || eMode>SQLITE_CHECKPOINT_TRUNCATE ){
    /* EVIDENCE-OF: R-03996-12088 The M parameter must be a valid checkpoint
    ** mode: */
    return SQLITE_MISUSE;
  }

  sqlite3_mutex_enter(db->mutex);
  if( zDb && zDb[0] ){
    iDb = sqlite3FindDbName(db, zDb);
  }
  if( iDb<0 ){
    rc = SQLITE_ERROR;
    sqlite3ErrorWithMsg(db, SQLITE_ERROR, "unknown database: %s", zDb);
  }else{
    db->busyHandler.nBusy = 0;
    rc = sqlite3Checkpoint(db, iDb, eMode, pnLog, pnCkpt);
    sqlite3Error(db, rc);
  }
  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, %r14
movq %rcx, %r15
movl %edx, %r12d
movq %rsi, %r13
movq %rdi, %rbx
testq %rcx, %rcx
je 0x1795f
orl $-0x1, (%r15)
testq %r14, %r14
je 0x17968
orl $-0x1, (%r14)
cmpl $0x3, %r12d
jbe 0x17974
pushq $0x15
popq %r14
jmp 0x179e5
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x17983
callq *0x6bb25(%rip)          # 0x834a8
pushq $0xa
popq %rsi
testq %r13, %r13
je 0x179a3
cmpb $0x0, (%r13)
je 0x179a3
movq %rbx, %rdi
movq %r13, %rsi
callq 0x17a14
movl %eax, %esi
testl %eax, %eax
js 0x179f7
andl $0x0, 0x2b8(%rbx)
movq %rbx, %rdi
movl %r12d, %edx
movq %r15, %rcx
movq %r14, %r8
callq 0x17aa3
movl %eax, %r14d
movq %rbx, %rdi
movl %eax, %esi
callq 0xe9aa
movq %rbx, %rdi
movl %r14d, %esi
callq 0x108ce
movl %eax, %r14d
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x179e5
callq *0x6bad3(%rip)          # 0x834b8
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x547a8(%rip), %rdx     # 0x6c1a6
pushq $0x1
popq %r14
movq %rbx, %rdi
movl %r14d, %esi
movq %r13, %rcx
xorl %eax, %eax
callq 0xe89d
jmp 0x179c8
// File: /workspace/github_c_makefile_star2_O2/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: sqlite3_create_collation_v2
SQLITE_STDCALL sqlite3_create_collation_v2(
  sqlite3* db, 
  const char *zName, 
  int enc, 
  void* pCtx,
  int(*xCompare)(void*,int,const void*,int,const void*),
  void(*xDel)(void*)
){
  int rc;

#ifdef SQLITE_ENABLE_API_ARMOR
  if( !sqlite3SafetyCheckOk(db) || zName==0 ) return SQLITE_MISUSE_BKPT;
#endif
  sqlite3_mutex_enter(db->mutex);
  assert( !db->mallocFailed );
  rc = createCollation(db, zName, (u8)enc, pCtx, xCompare, xDel);
  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
movl %edx, %r14d
movq %rsi, %r13
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
testq %rdi, %rdi
je 0x183c3
movq %r9, %r15
movq %r8, %r12
movq %rcx, -0x30(%rbp)
callq *0x6b0ef(%rip)          # 0x834a8
movq -0x30(%rbp), %rcx
movq %r12, %r8
movq %r15, %r9
movzbl %r14b, %edx
movq %rbx, %rdi
movq %r13, %rsi
callq 0x18400
movq %rbx, %rdi
movl %eax, %esi
callq 0x108ce
movl %eax, %r14d
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x183ee
callq *0x6b0ca(%rip)          # 0x834b8
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: sqlite3_collation_needed
SQLITE_STDCALL sqlite3_collation_needed(
  sqlite3 *db, 
  void *pCollNeededArg, 
  void(*xCollNeeded)(void*,sqlite3*,int eTextRep,const char*)
){
#ifdef SQLITE_ENABLE_API_ARMOR
  if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
#endif
  sqlite3_mutex_enter(db->mutex);
  db->xCollNeeded = xCollNeeded;
  db->xCollNeeded16 = 0;
  db->pCollNeededArg = pCollNeededArg;
  sqlite3_mutex_leave(db->mutex);
  return SQLITE_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
movq 0x18(%rdi), %rdi
testq %rdi, %rdi
je 0x1861c
callq *0x6ae92(%rip)          # 0x834a8
movq 0x18(%r14), %rdi
jmp 0x1861e
xorl %edi, %edi
movq %r15, 0x128(%r14)
andq $0x0, 0x130(%r14)
movq %rbx, 0x138(%r14)
testq %rdi, %rdi
je 0x1863f
callq *0x6ae79(%rip)          # 0x834b8
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: sqlite3_collation_needed16
SQLITE_STDCALL sqlite3_collation_needed16(
  sqlite3 *db, 
  void *pCollNeededArg, 
  void(*xCollNeeded16)(void*,sqlite3*,int eTextRep,const void*)
){
#ifdef SQLITE_ENABLE_API_ARMOR
  if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
#endif
  sqlite3_mutex_enter(db->mutex);
  db->xCollNeeded = 0;
  db->xCollNeeded16 = xCollNeeded16;
  db->pCollNeededArg = pCollNeededArg;
  sqlite3_mutex_leave(db->mutex);
  return SQLITE_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r15
movq 0x18(%rdi), %rdi
testq %rdi, %rdi
je 0x18674
callq *0x6ae3a(%rip)          # 0x834a8
movq 0x18(%r15), %rdi
jmp 0x18676
xorl %edi, %edi
andq $0x0, 0x128(%r15)
movq %r14, 0x130(%r15)
movq %rbx, 0x138(%r15)
testq %rdi, %rdi
je 0x18697
callq *0x6ae21(%rip)          # 0x834b8
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: sqlite3Init
SQLITE_PRIVATE int sqlite3Init(sqlite3 *db, char **pzErrMsg){
  int i, rc;
  int commit_internal = !(db->flags&SQLITE_InternChanges);
  
  assert( sqlite3_mutex_held(db->mutex) );
  assert( sqlite3BtreeHoldsMutex(db->aDb[0].pBt) );
  assert( db->init.busy==0 );
  rc = SQLITE_OK;
  db->init.busy = 1;
  ENC(db) = SCHEMA_ENC(db);
  for(i=0; rc==SQLITE_OK && i<db->nDb; i++){
    if( DbHasProperty(db, i, DB_SchemaLoaded) || i==1 ) continue;
    rc = sqlite3InitOne(db, i, pzErrMsg);
    if( rc ){
      sqlite3ResetOneSchema(db, i);
    }
  }

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

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

  return rc; 
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, -0x38(%rbp)
movq %rdi, %rbx
movl 0x2c(%rdi), %eax
movl %eax, -0x2c(%rbp)
movb $0x1, 0xa1(%rdi)
movq 0x20(%rdi), %rax
movq 0x18(%rax), %rax
movb 0x71(%rax), %al
movb %al, 0x4e(%rdi)
xorl %r12d, %r12d
pushq $0x18
popq %r14
xorl %r15d, %r15d
testl %r15d, %r15d
jne 0x18a24
movslq 0x28(%rbx), %rcx
movq 0x20(%rbx), %rax
cmpq %rcx, %r12
jge 0x189f9
movq (%rax,%r14), %rax
cmpq $0x1, %r12
sete %cl
orb 0x72(%rax), %cl
xorl %r15d, %r15d
testb $0x1, %cl
jne 0x189f0
movq %rbx, %rdi
movl %r12d, %esi
movq -0x38(%rbp), %rdx
callq 0x67204
testl %eax, %eax
je 0x189f0
movl %eax, %r13d
movq %rbx, %rdi
movl %r12d, %esi
callq 0x2f10d
movl %r13d, %r15d
incq %r12
addq $0x20, %r14
jmp 0x189a4
movq 0x38(%rax), %rax
testb $0x1, 0x72(%rax)
jne 0x18a2d
pushq $0x1
popq %rsi
movq %rbx, %rdi
movq -0x38(%rbp), %rdx
callq 0x67204
testl %eax, %eax
je 0x18a2d
movl %eax, %r15d
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x2f10d
movb $0x0, 0xa1(%rbx)
jmp 0x18a41
xorl %r15d, %r15d
movb $0x0, 0xa1(%rbx)
testb $0x2, -0x2c(%rbp)
jne 0x18a41
andb $-0x3, 0x2c(%rbx)
movl %r15d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: sqlite3FindTable
SQLITE_PRIVATE Table *sqlite3FindTable(sqlite3 *db, const char *zName, const char *zDatabase){
  Table *p = 0;
  int i;

  /* All mutexes are required for schema access.  Make sure we hold them. */
  assert( zDatabase!=0 || sqlite3BtreeHoldsAllMutexes(db) );
#if SQLITE_USER_AUTHENTICATION
  /* Only the admin user is allowed to know that the sqlite_user table
  ** exists */
  if( db->auth.authLevel<UAUTH_Admin && sqlite3UserAuthTable(zName)!=0 ){
    return 0;
  }
#endif
  for(i=OMIT_TEMPDB; i<db->nDb; i++){
    int j = (i<2) ? i^1 : i;   /* Search TEMP before MAIN */
    if( zDatabase!=0 && sqlite3StrICmp(zDatabase, db->aDb[j].zName) ) continue;
    assert( sqlite3SchemaMutexHeld(db, j, 0) );
    p = sqlite3HashFind(&db->aDb[j].pSchema->tblHash, zName);
    if( p ) break;
  }
  return p;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, -0x30(%rbp)
movq %rdi, %r12
xorl %r13d, %r13d
cmpl 0x28(%r12), %r13d
jge 0x18ac2
xorl %ebx, %ebx
cmpl $0x2, %r13d
setb %bl
xorl %r13d, %ebx
movq 0x20(%r12), %r15
testq %r14, %r14
je 0x18aa2
movq %rbx, %rax
shlq $0x5, %rax
movq (%r15,%rax), %rsi
movq %r14, %rdi
callq 0xa4f0
testl %eax, %eax
jne 0x18abd
shlq $0x5, %rbx
movq 0x18(%r15,%rbx), %rdi
addq $0x8, %rdi
movq -0x30(%rbp), %rsi
callq 0x3616f
testq %rax, %rax
jne 0x18ac4
incl %r13d
jmp 0x18a6e
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: sqlite3_extended_result_codes
SQLITE_STDCALL sqlite3_extended_result_codes(sqlite3 *db, int onoff){
#ifdef SQLITE_ENABLE_API_ARMOR
  if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
#endif
  sqlite3_mutex_enter(db->mutex);
  db->errMask = onoff ? 0xffffffff : 0xff;
  sqlite3_mutex_leave(db->mutex);
  return SQLITE_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %r14d
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
xorl %r15d, %r15d
testq %rdi, %rdi
je 0x18b82
callq *0x6a92c(%rip)          # 0x834a8
movq 0x18(%rbx), %rdi
jmp 0x18b84
xorl %edi, %edi
negl %r14d
sbbl %r15d, %r15d
orl $0xff, %r15d
movl %r15d, 0x48(%rbx)
testq %rdi, %rdi
je 0x18ba0
callq *0x6a918(%rip)          # 0x834b8
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: sqlite3_file_control
SQLITE_STDCALL sqlite3_file_control(sqlite3 *db, const char *zDbName, int op, void *pArg){
  int rc = SQLITE_ERROR;
  Btree *pBtree;

#ifdef SQLITE_ENABLE_API_ARMOR
  if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
#endif
  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( op==SQLITE_FCNTL_VFS_POINTER ){
      *(sqlite3_vfs**)pArg = sqlite3PagerVfs(pPager);
      rc = SQLITE_OK;
    }else if( op==SQLITE_FCNTL_JOURNAL_POINTER ){
      *(sqlite3_file**)pArg = sqlite3PagerJrnlFile(pPager);
      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 %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rcx, %r15
movl %edx, %r12d
movq %rsi, %r14
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
testq %rdi, %rdi
je 0x18bd3
callq *0x6a8d5(%rip)          # 0x834a8
movq %rbx, %rdi
movq %r14, %rsi
callq 0x18c74
testq %rax, %rax
je 0x18c10
movq %rax, %r14
movq %rax, %rdi
callq 0xf01a
movq 0x8(%r14), %rax
movq (%rax), %rax
cmpl $0x1c, %r12d
je 0x18c16
cmpl $0x1b, %r12d
je 0x18c2c
movq 0x48(%rax), %rdi
cmpl $0x7, %r12d
jne 0x18c58
movq %rdi, (%r15)
jmp 0x18c32
pushq $0x1
popq %r15
jmp 0x18c3d
movq 0x118(%rax), %rcx
leaq 0x10(%rcx), %rdx
addq $0x50, %rax
testq %rcx, %rcx
cmovneq %rdx, %rax
movq (%rax), %rax
movq %rax, (%r15)
xorl %r15d, %r15d
movq %r14, %rdi
callq 0x1034d
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x18c4c
callq *0x6a86c(%rip)          # 0x834b8
movl %r15d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq (%rdi), %rax
testq %rax, %rax
je 0x18c6e
movl %r12d, %esi
movq %r15, %rdx
callq *0x50(%rax)
movl %eax, %r15d
jmp 0x18c35
pushq $0xc
popq %r15
jmp 0x18c35
// File: /workspace/github_c_makefile_star2_O2/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: sqlite3BtreeSetPageSize
SQLITE_PRIVATE int sqlite3BtreeSetPageSize(Btree *p, int pageSize, int nReserve, int iFix){
  int rc = SQLITE_OK;
  BtShared *pBt = p->pBt;
  assert( nReserve>=-1 && nReserve<=255 );
  sqlite3BtreeEnter(p);
#if SQLITE_HAS_CODEC
  if( nReserve>pBt->optimalReserve ) pBt->optimalReserve = (u8)nReserve;
#endif
  if( pBt->btsFlags & BTS_PAGESIZE_FIXED ){
    sqlite3BtreeLeave(p);
    return SQLITE_READONLY;
  }
  if( nReserve<0 ){
    nReserve = pBt->pageSize - pBt->usableSize;
  }
  assert( nReserve>=0 && nReserve<=255 );
  if( pageSize>=512 && pageSize<=SQLITE_MAX_PAGE_SIZE &&
        ((pageSize-1)&pageSize)==0 ){
    assert( (pageSize & 7)==0 );
    assert( !pBt->pCursor );
    pBt->pageSize = (u32)pageSize;
    freeTempSpace(pBt);
  }
  rc = sqlite3PagerSetPagesize(pBt->pPager, &pBt->pageSize, nReserve);
  pBt->usableSize = pBt->pageSize - (u16)nReserve;
  if( iFix ) pBt->btsFlags |= BTS_PAGESIZE_FIXED;
  sqlite3BtreeLeave(p);
  return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %r14d
movl %edx, %r12d
movl %esi, %r13d
movq %rdi, %rbx
movq 0x8(%rdi), %r15
callq 0xf01a
testb $0x2, 0x26(%r15)
jne 0x19595
testl %r12d, %r12d
jns 0x19543
movl 0x30(%r15), %r12d
subl 0x34(%r15), %r12d
leal -0x200(%r13), %eax
cmpl $0xfe00, %eax           # imm = 0xFE00
ja 0x19569
leal 0x1ffff(%r13), %eax
testl %r13d, %eax
jne 0x19569
movl %r13d, 0x30(%r15)
movq %r15, %rdi
callq 0x22902
movq (%r15), %rdi
leaq 0x30(%r15), %rsi
movl %r12d, %edx
callq 0x1c9ee
movl %eax, %r13d
movl 0x30(%r15), %eax
movzwl %r12w, %ecx
subl %ecx, %eax
movl %eax, 0x34(%r15)
testl %r14d, %r14d
je 0x19599
orb $0x2, 0x26(%r15)
jmp 0x19599
pushq $0x8
popq %r13
movq %rbx, %rdi
callq 0x1034d
movl %r13d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: sqlite3ScratchMalloc
SQLITE_PRIVATE void *sqlite3ScratchMalloc(int n){
  void *p;
  assert( n>0 );

  sqlite3_mutex_enter(mem0.mutex);
  sqlite3StatusHighwater(SQLITE_STATUS_SCRATCH_SIZE, n);
  if( mem0.nScratchFree && sqlite3GlobalConfig.szScratch>=n ){
    p = mem0.pScratchFree;
    mem0.pScratchFree = mem0.pScratchFree->pNext;
    mem0.nScratchFree--;
    sqlite3StatusUp(SQLITE_STATUS_SCRATCH_USED, 1);
    sqlite3_mutex_leave(mem0.mutex);
  }else{
    sqlite3_mutex_leave(mem0.mutex);
    p = sqlite3Malloc(n);
    if( sqlite3GlobalConfig.bMemstat && p ){
      sqlite3_mutex_enter(mem0.mutex);
      sqlite3StatusUp(SQLITE_STATUS_SCRATCH_OVERFLOW, sqlite3MallocSize(p));
      sqlite3_mutex_leave(mem0.mutex);
    }
    sqlite3MemdebugSetType(p, MEMTYPE_SCRATCH);
  }
  assert( sqlite3_mutex_notheld(mem0.mutex) );


#if SQLITE_THREADSAFE==0 && !defined(NDEBUG)
  /* EVIDENCE-OF: R-12970-05880 SQLite will not use more than one scratch
  ** buffers per thread.
  **
  ** This can only be checked in single-threaded mode.
  */
  assert( scratchAllocOut==0 );
  if( p ) scratchAllocOut++;
#endif

  return p;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl %edi, %r14d
movq 0x6bb63(%rip), %rdi     # 0x85148
testq %rdi, %rdi
je 0x195f0
callq *0x69eb8(%rip)          # 0x834a8
movslq %r14d, %rbx
cmpq %rbx, 0x6bb36(%rip)     # 0x85130
jge 0x19603
movq %rbx, 0x6bb2d(%rip)     # 0x85130
movl 0x6bb5f(%rip), %eax     # 0x85168
testl %eax, %eax
je 0x19653
cmpl %r14d, 0x69f54(%rip)    # 0x83568
jl 0x19653
movq 0x6bb43(%rip), %rbx     # 0x85160
movq (%rbx), %rcx
movq %rcx, 0x6bb39(%rip)     # 0x85160
decl %eax
movl %eax, 0x6bb39(%rip)     # 0x85168
movq 0x6ba82(%rip), %rcx     # 0x850b8
leaq 0x1(%rcx), %rax
movq %rax, 0x6ba77(%rip)     # 0x850b8
cmpq 0x6bac0(%rip), %rcx     # 0x85108
jl 0x196c2
movq %rax, 0x6bab7(%rip)     # 0x85108
jmp 0x196c2
movq 0x6baee(%rip), %rdi     # 0x85148
testq %rdi, %rdi
je 0x19665
callq *0x69e53(%rip)          # 0x834b8
movq %rbx, %rdi
callq 0xc13f
movq %rax, %rbx
cmpl $0x0, 0x69da9(%rip)     # 0x83420
setne %al
testq %rbx, %rbx
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x196d4
movq 0x6baba(%rip), %rdi     # 0x85148
testq %rdi, %rdi
je 0x19699
callq *0x69e0f(%rip)          # 0x834a8
movq %rbx, %rdi
callq *0x69dbe(%rip)          # 0x83460
cltq
addq 0x6ba15(%rip), %rax     # 0x850c0
movq %rax, 0x6ba0e(%rip)     # 0x850c0
cmpq 0x6ba57(%rip), %rax     # 0x85110
jle 0x196c2
movq %rax, 0x6ba4e(%rip)     # 0x85110
movq 0x6ba7f(%rip), %rdi     # 0x85148
testq %rdi, %rdi
je 0x196d4
callq *0x69de4(%rip)          # 0x834b8
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: sqlite3ScratchFree
SQLITE_PRIVATE void sqlite3ScratchFree(void *p){
  if( p ){

#if SQLITE_THREADSAFE==0 && !defined(NDEBUG)
    /* Verify that no more than two scratch allocation per thread
    ** is outstanding at one time.  (This is only checked in the
    ** single-threaded case since checking in the multi-threaded case
    ** would be much more complicated.) */
    assert( scratchAllocOut>=1 && scratchAllocOut<=2 );
    scratchAllocOut--;
#endif

    if( SQLITE_WITHIN(p, sqlite3GlobalConfig.pScratch, mem0.pScratchEnd) ){
      /* Release memory from the SQLITE_CONFIG_SCRATCH allocation */
      ScratchFreeslot *pSlot;
      pSlot = (ScratchFreeslot*)p;
      sqlite3_mutex_enter(mem0.mutex);
      pSlot->pNext = mem0.pScratchFree;
      mem0.pScratchFree = pSlot;
      mem0.nScratchFree++;
      assert( mem0.nScratchFree <= (u32)sqlite3GlobalConfig.nScratch );
      sqlite3StatusDown(SQLITE_STATUS_SCRATCH_USED, 1);
      sqlite3_mutex_leave(mem0.mutex);
    }else{
      /* Release memory back to the heap */
      assert( sqlite3MemdebugHasType(p, MEMTYPE_SCRATCH) );
      assert( sqlite3MemdebugNoType(p, (u8)~MEMTYPE_SCRATCH) );
      sqlite3MemdebugSetType(p, MEMTYPE_HEAP);
      if( sqlite3GlobalConfig.bMemstat ){
        int iSize = sqlite3MallocSize(p);
        sqlite3_mutex_enter(mem0.mutex);
        sqlite3StatusDown(SQLITE_STATUS_SCRATCH_OVERFLOW, iSize);
        sqlite3StatusDown(SQLITE_STATUS_MEMORY_USED, iSize);
        sqlite3StatusDown(SQLITE_STATUS_MALLOC_COUNT, 1);
        sqlite3GlobalConfig.m.xFree(p);
        sqlite3_mutex_leave(mem0.mutex);
      }else{
        sqlite3GlobalConfig.m.xFree(p);
      }
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
testq %rdi, %rdi
je 0x197ab
movq %rdi, %rbx
cmpq %rdi, 0x69e6a(%rip)     # 0x83560
ja 0x1971c
cmpq %rbx, 0x6ba59(%rip)     # 0x85158
jbe 0x1971c
movq 0x6ba40(%rip), %rdi     # 0x85148
testq %rdi, %rdi
je 0x19779
callq *0x69d95(%rip)          # 0x834a8
movq 0x6ba2e(%rip), %rdi     # 0x85148
jmp 0x1977b
cmpl $0x0, 0x69cfd(%rip)     # 0x83420
je 0x1976d
movq %rbx, %rdi
callq *0x69d32(%rip)          # 0x83460
movl %eax, %r14d
movq 0x6ba10(%rip), %rdi     # 0x85148
testq %rdi, %rdi
je 0x19743
callq *0x69d65(%rip)          # 0x834a8
movslq %r14d, %rax
subq %rax, 0x6b973(%rip)     # 0x850c0
subq %rax, 0x6b94c(%rip)     # 0x850a0
decq 0x6b98d(%rip)           # 0x850e8
movq %rbx, %rdi
callq *0x69cec(%rip)          # 0x83450
movq 0x6b9dd(%rip), %rdi     # 0x85148
jmp 0x19799
leaq 0x69cdc(%rip), %rax     # 0x83450
movq %rbx, %rdi
jmp 0x197a5
xorl %edi, %edi
movq 0x6b9de(%rip), %rax     # 0x85160
movq %rax, (%rbx)
movq %rbx, 0x6b9d4(%rip)     # 0x85160
incl 0x6b9d6(%rip)           # 0x85168
decq 0x6b91f(%rip)           # 0x850b8
testq %rdi, %rdi
je 0x197ab
leaq 0x69d13(%rip), %rax     # 0x834b8
popq %rbx
popq %r14
popq %rbp
jmpq *(%rax)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: sqlite3_uri_parameter
SQLITE_API const char *SQLITE_STDCALL sqlite3_uri_parameter(const char *zFilename, const char *zParam){
  if( zFilename==0 || zParam==0 ) return 0;
  zFilename += sqlite3Strlen30(zFilename) + 1;
  while( zFilename[0] ){
    int x = strcmp(zFilename, zParam);
    zFilename += sqlite3Strlen30(zFilename) + 1;
    if( x==0 ) return zFilename;
    zFilename += sqlite3Strlen30(zFilename) + 1;
  }
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
je 0x197cf
xorl %r14d, %r14d
jmp 0x19810
movq %rsi, %rbx
movq %rdi, %r14
movq %r14, %rdi
callq 0xb080
movl %eax, %eax
cmpb $0x0, 0x1(%r14,%rax)
je 0x197ca
addq %rax, %r14
incq %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0xa330
movl %eax, %r15d
movq %r14, %rdi
callq 0xb080
movl %eax, %eax
addq %rax, %r14
incq %r14
testl %r15d, %r15d
jne 0x197d5
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: sqlite3_uri_int64
SQLITE_STDCALL sqlite3_uri_int64(
  const char *zFilename,    /* Filename as passed to xOpen */
  const char *zParam,       /* URI parameter sought */
  sqlite3_int64 bDflt       /* return if parameter is missing */
){
  const char *z = sqlite3_uri_parameter(zFilename, zParam);
  sqlite3_int64 v;
  if( z && sqlite3DecOrHexToI64(z, &v)==SQLITE_OK ){
    bDflt = v;
  }
  return bDflt;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdx, %rbx
callq 0xa3a0
testq %rax, %rax
je 0x1988f
leaq -0x10(%rbp), %rsi
movq %rax, %rdi
callq 0x19899
testl %eax, %eax
jne 0x1988f
movq -0x10(%rbp), %rbx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: sqlite3_db_filename
SQLITE_API const char *SQLITE_STDCALL sqlite3_db_filename(sqlite3 *db, const char *zDbName){
  Btree *pBt;
#ifdef SQLITE_ENABLE_API_ARMOR
  if( !sqlite3SafetyCheckOk(db) ){
    (void)SQLITE_MISUSE_BKPT;
    return 0;
  }
#endif
  pBt = sqlite3DbNameToBtree(db, zDbName);
  return pBt ? sqlite3BtreeGetFilename(pBt) : 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
callq 0x18c74
testq %rax, %rax
je 0x19968
movq 0x8(%rax), %rax
movq (%rax), %rax
cmpb $0x0, 0x13(%rax)
je 0x1996c
leaq 0x5572b(%rip), %rax     # 0x6f091
jmp 0x19973
xorl %eax, %eax
jmp 0x19973
movq 0xd0(%rax), %rax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: sqlite3MallocAlarm
static void sqlite3MallocAlarm(int nByte){
  if( mem0.alarmThreshold<=0 ) return;
  sqlite3_mutex_leave(mem0.mutex);
  sqlite3_release_memory(nByte);
  sqlite3_mutex_enter(mem0.mutex);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
cmpq $0x0, 0x6b690(%rip)     # 0x85150
jle 0x19ae7
movq 0x6b67f(%rip), %rdi     # 0x85148
testq %rdi, %rdi
je 0x19ae7
callq *0x699e4(%rip)          # 0x834b8
movq 0x6b66d(%rip), %rdi     # 0x85148
testq %rdi, %rdi
je 0x19ae7
popq %rbp
jmpq *0x699c1(%rip)          # 0x834a8
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: sqlite3StrAccumAppend
SQLITE_PRIVATE void sqlite3StrAccumAppend(StrAccum *p, const char *z, int N){
  assert( z!=0 || N==0 );
  assert( p->zText!=0 || p->nChar==0 || p->accError );
  assert( N>=0 );
  assert( p->accError==0 || p->nAlloc==0 );
  if( p->nChar+N >= p->nAlloc ){
    enlargeAndAppend(p,z,N);
  }else{
    assert( p->zText );
    p->nChar += N;
    memcpy(&p->zText[p->nChar-N], z, N);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl 0x18(%rdi), %eax
leal (%rax,%rdx), %ecx
cmpl 0x1c(%rdi), %ecx
jae 0x19b57
movl %ecx, 0x18(%rdi)
addq 0x10(%rdi), %rax
movslq %edx, %rdx
movq %rax, %rdi
popq %rbp
jmp 0xa3b0
popq %rbp
jmp 0x19c3c
// File: /workspace/github_c_makefile_star2_O2/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: enlargeAndAppend
static void SQLITE_NOINLINE enlargeAndAppend(StrAccum *p, const char *z, int N){
  N = sqlite3StrAccumEnlarge(p, N);
  if( N>0 ){
    memcpy(&p->zText[p->nChar], z, N);
    p->nChar += N;
  }
  assert( (p->zText==0 || p->zText==p->zBase)==(p->bMalloced==0) );
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movl %edx, %esi
callq 0x19c7a
testl %eax, %eax
jle 0x19c6f
movl %eax, %r15d
movl 0x18(%rbx), %edi
addq 0x10(%rbx), %rdi
movl %eax, %edx
movq %r14, %rsi
callq 0xa3b0
addl %r15d, 0x18(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: sqlite3StrAccumEnlarge
static int sqlite3StrAccumEnlarge(StrAccum *p, int N){
  char *zNew;
  assert( p->nChar+(i64)N >= p->nAlloc ); /* Only called if really needed */
  if( p->accError ){
    testcase(p->accError==STRACCUM_TOOBIG);
    testcase(p->accError==STRACCUM_NOMEM);
    return 0;
  }
  if( p->mxAlloc==0 ){
    N = p->nAlloc - p->nChar - 1;
    setStrAccumError(p, STRACCUM_TOOBIG);
    return N;
  }else{
    char *zOld = p->bMalloced ? p->zText : 0;
    i64 szNew = p->nChar;
    assert( (p->zText==0 || p->zText==p->zBase)==(p->bMalloced==0) );
    szNew += N + 1;
    if( szNew+p->nChar<=p->mxAlloc ){
      /* Force exponential buffer size growth as long as it does not overflow,
      ** to avoid having to call this routine too often */
      szNew += p->nChar;
    }
    if( szNew > p->mxAlloc ){
      sqlite3StrAccumReset(p);
      setStrAccumError(p, STRACCUM_TOOBIG);
      return 0;
    }else{
      p->nAlloc = (int)szNew;
    }
    if( p->db ){
      zNew = sqlite3DbRealloc(p->db, zOld, p->nAlloc);
    }else{
      zNew = sqlite3_realloc64(zOld, p->nAlloc);
    }
    if( zNew ){
      assert( p->zText!=0 || p->nChar==0 );
      if( !p->bMalloced && p->nChar>0 ) memcpy(zNew, p->zText, p->nChar);
      p->zText = zNew;
      p->nAlloc = sqlite3DbMallocSize(p->db, zNew);
      p->bMalloced = 1;
    }else{
      sqlite3StrAccumReset(p);
      setStrAccumError(p, STRACCUM_NOMEM);
      return 0;
    }
  }
  return N;
}

// Assembly:
xorl %eax, %eax
cmpb $0x0, 0x24(%rdi)
je 0x19c83
retq
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x20(%rdi), %eax
testq %rax, %rax
je 0x19ca7
movl %esi, %r14d
cmpb $0x0, 0x25(%rbx)
je 0x19cbc
movq 0x10(%rbx), %rsi
jmp 0x19cbe
movl 0x18(%rbx), %eax
notl %eax
addl 0x1c(%rbx), %eax
movb $0x2, 0x24(%rbx)
andl $0x0, 0x1c(%rbx)
jmp 0x19d5c
xorl %esi, %esi
movl 0x18(%rbx), %edx
movslq %r14d, %rdi
leaq (%rdi,%rdx), %rcx
incq %rcx
addq %rdx, %rdi
addq %rdi, %rdx
incq %rdx
cmpq %rax, %rdx
cmovleq %rdx, %rcx
cmpq %rax, %rcx
jle 0x19cee
movq %rbx, %rdi
callq 0x19d67
movb $0x2, 0x24(%rbx)
jmp 0x19d56
movl %ecx, 0x1c(%rbx)
movq (%rbx), %rdi
movl %ecx, %edx
testq %rdi, %rdi
je 0x19d02
callq 0x19d92
jmp 0x19d0d
movq %rsi, %rdi
movq %rdx, %rsi
callq 0xa7e0
movq %rax, %r15
testq %rax, %rax
je 0x19d4a
cmpb $0x0, 0x25(%rbx)
jne 0x19d2f
movl 0x18(%rbx), %edx
testq %rdx, %rdx
je 0x19d2f
movq 0x10(%rbx), %rsi
movq %r15, %rdi
callq 0xa3b0
movq %r15, 0x10(%rbx)
movq (%rbx), %rdi
movq %r15, %rsi
callq 0x19b07
movl %eax, 0x1c(%rbx)
movb $0x1, 0x25(%rbx)
movl %r14d, %eax
jmp 0x19d5c
movq %rbx, %rdi
callq 0x19d67
movb $0x1, 0x24(%rbx)
andl $0x0, 0x1c(%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: sqlite3StrAccumReset
SQLITE_PRIVATE void sqlite3StrAccumReset(StrAccum *p){
  assert( (p->zText==0 || p->zText==p->zBase)==(p->bMalloced==0) );
  if( p->bMalloced ){
    sqlite3DbFree(p->db, p->zText);
    p->bMalloced = 0;
  }
  p->zText = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpb $0x0, 0x25(%rdi)
je 0x19d86
movq (%rbx), %rdi
movq 0x10(%rbx), %rsi
callq 0xb856
movb $0x0, 0x25(%rbx)
andq $0x0, 0x10(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: sqlite3DbRealloc
SQLITE_PRIVATE void *sqlite3DbRealloc(sqlite3 *db, void *p, u64 n){
  void *pNew = 0;
  assert( db!=0 );
  assert( sqlite3_mutex_held(db->mutex) );
  if( db->mallocFailed==0 ){
    if( p==0 ){
      return sqlite3DbMallocRaw(db, n);
    }
    if( isLookaside(db, p) ){
      if( n<=db->lookaside.sz ){
        return p;
      }
      pNew = sqlite3DbMallocRaw(db, n);
      if( pNew ){
        memcpy(pNew, p, db->lookaside.sz);
        sqlite3DbFree(db, p);
      }
    }else{
      assert( sqlite3MemdebugHasType(p, (MEMTYPE_LOOKASIDE|MEMTYPE_HEAP)) );
      assert( sqlite3MemdebugNoType(p, (u8)~(MEMTYPE_LOOKASIDE|MEMTYPE_HEAP)) );
      sqlite3MemdebugSetType(p, MEMTYPE_HEAP);
      pNew = sqlite3_realloc64(p, n);
      if( !pNew ){
        db->mallocFailed = 1;
      }
      sqlite3MemdebugSetType(pNew,
            (db->lookaside.bEnabled ? MEMTYPE_LOOKASIDE : MEMTYPE_HEAP));
    }
  }
  return pNew;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
cmpb $0x0, 0x51(%rdi)
je 0x19db2
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rsi, %rbx
movq %rdi, %r14
testq %rsi, %rsi
je 0x19e33
cmpq %rbx, 0x170(%r14)
ja 0x19e12
cmpq %rbx, 0x178(%r14)
jbe 0x19e12
movzwl 0x150(%r14), %eax
cmpq %rdx, %rax
jae 0x19da4
movq %r14, %rdi
movq %rdx, %rsi
callq 0x132c5
testq %rax, %rax
je 0x19da2
movq %rax, %r15
movzwl 0x150(%r14), %edx
movq %rax, %rdi
movq %rbx, %rsi
callq 0xa3b0
movq %r14, %rdi
movq %rbx, %rsi
callq 0xb856
movq %r15, %rbx
jmp 0x19da4
movq %rbx, %rdi
movq %rdx, %rsi
callq 0xa7e0
movq %rax, %rbx
testq %rax, %rax
jne 0x19da4
movb $0x1, 0x51(%r14)
jmp 0x19da2
movq %r14, %rdi
movq %rdx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x132c5