LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: sqlite3PcacheMakeDirty
SQLITE_PRIVATE void sqlite3PcacheMakeDirty(PgHdr *p){
  assert( p->nRef>0 );
  if( p->flags & (PGHDR_CLEAN|PGHDR_DONT_WRITE) ){
    p->flags &= ~PGHDR_DONT_WRITE;
    if( p->flags & PGHDR_CLEAN ){
      p->flags ^= (PGHDR_DIRTY|PGHDR_CLEAN);
      assert( (p->flags & (PGHDR_DIRTY|PGHDR_CLEAN))==PGHDR_DIRTY );
      pcacheManageDirtyList(p, PCACHE_DIRTYLIST_ADD);
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movzwl 0x2c(%rdi), %eax
testb $0x21, %al
je 0x2523d
movl %eax, %ecx
andl $0xffdf, %ecx           # imm = 0xFFDF
movw %cx, 0x2c(%rdi)
testb $0x1, %al
jne 0x2523f
popq %rbp
retq
xorl $0x3, %ecx
movw %cx, 0x2c(%rdi)
movl $0x2, %esi
popq %rbp
jmp 0x21c64
// File: /workspace/github_c_makefile_star2_O1/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: btreeLockCarefully
static void SQLITE_NOINLINE btreeLockCarefully(Btree *p){
  Btree *pLater;

  /* In most cases, we should be able to acquire the lock we
  ** want without having to go through the ascending lock
  ** procedure that follows.  Just be sure not to block.
  */
  if( sqlite3_mutex_try(p->pBt->mutex)==SQLITE_OK ){
    p->pBt->db = p->db;
    p->locked = 1;
    return;
  }

  /* To avoid deadlock, first release all locks with a larger
  ** BtShared address.  Then acquire our lock.  Then reacquire
  ** the other BtShared locks that we used to hold in ascending
  ** order.
  */
  for(pLater=p->pNext; pLater; pLater=pLater->pNext){
    assert( pLater->sharable );
    assert( pLater->pNext==0 || pLater->pNext->pBt>pLater->pBt );
    assert( !pLater->locked || pLater->wantToLock>0 );
    if( pLater->locked ){
      unlockBtreeMutex(pLater);
    }
  }
  lockBtreeMutex(p);
  for(pLater=p->pNext; pLater; pLater=pLater->pNext){
    if( pLater->wantToLock ){
      lockBtreeMutex(pLater);
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rax
movq 0x50(%rax), %rdi
testq %rdi, %rdi
je 0x25492
callq *0x6df73(%rip)          # 0x933b0
testl %eax, %eax
je 0x25492
movq 0x20(%rbx), %r14
testq %r14, %r14
je 0x2545f
cmpb $0x0, 0x12(%r14)
je 0x25459
movq %r14, %rdi
callq 0x254a6
movq 0x20(%r14), %r14
jmp 0x25445
movq 0x8(%rbx), %rax
movq 0x50(%rax), %rdi
testq %rdi, %rdi
je 0x25472
callq *0x6df36(%rip)          # 0x933a8
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
movq %rax, 0x8(%rcx)
movb $0x1, 0x12(%rbx)
movq 0x20(%rbx), %rbx
testq %rbx, %rbx
je 0x254a1
cmpl $0x0, 0x14(%rbx)
jne 0x2545f
jmp 0x25481
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
movq %rax, 0x8(%rcx)
movb $0x1, 0x12(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: unlockBtreeMutex
static void SQLITE_NOINLINE unlockBtreeMutex(Btree *p){
  BtShared *pBt = p->pBt;
  assert( p->locked==1 );
  assert( sqlite3_mutex_held(pBt->mutex) );
  assert( sqlite3_mutex_held(p->db->mutex) );
  assert( p->db==pBt->db );

  sqlite3_mutex_leave(pBt->mutex);
  p->locked = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x8(%rdi), %rax
movq 0x50(%rax), %rdi
testq %rdi, %rdi
je 0x254c2
callq *0x6def6(%rip)          # 0x933b8
movb $0x0, 0x12(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: pagerPagecount
static int pagerPagecount(Pager *pPager, Pgno *pnPage){
  Pgno nPage;                     /* Value to return via *pnPage */

  /* Query the WAL sub-system for the database size. The WalDbsize()
  ** function returns zero if the WAL is not open (i.e. Pager.pWal==0), or
  ** if the database size is not available. The database size is not
  ** available from the WAL sub-system if the log file is empty or
  ** contains no valid committed transactions.
  */
  assert( pPager->eState==PAGER_OPEN );
  assert( pPager->eLock>=SHARED_LOCK );
  nPage = sqlite3WalDbsize(pPager->pWal);

  /* If the number of pages in the database is not available from the
  ** WAL sub-system, determine the page counte based on the size of
  ** the database file.  If the size of the database file is not an
  ** integer multiple of the page-size, round up the result.
  */
  if( nPage==0 ){
    i64 n = 0;                    /* Size of db file in bytes */
    assert( isOpen(pPager->fd) || pPager->tempFile );
    if( isOpen(pPager->fd) ){
      int rc = sqlite3OsFileSize(pPager->fd, &n);
      if( rc!=SQLITE_OK ){
        return rc;
      }
    }
    nPage = (Pgno)((n+pPager->pageSize-1) / pPager->pageSize);
  }

  /* If the current number of pages in the file is greater than the
  ** configured maximum pager number, increase the allowed limit so
  ** that the file can be read.
  */
  if( nPage>pPager->mxPgno ){
    pPager->mxPgno = (Pgno)nPage;
  }

  *pnPage = nPage;
  return SQLITE_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq 0x118(%rdi), %rcx
xorl %eax, %eax
testq %rcx, %rcx
je 0x25c78
cmpw $0x0, 0x3c(%rcx)
js 0x25c78
movl 0x5c(%rcx), %eax
testl %eax, %eax
jne 0x25cc2
movq $0x0, -0x18(%rbp)
movq 0x48(%r14), %rdi
movq (%rdi), %rax
testq %rax, %rax
je 0x25ca6
leaq -0x18(%rbp), %rsi
callq *0x30(%rax)
movl %eax, %ecx
xorl %eax, %eax
movl $0x0, %edx
testl %ecx, %ecx
jne 0x25cbe
jmp 0x25ca6
movq -0x18(%rbp), %rax
movslq 0xbc(%r14), %rsi
addq %rsi, %rax
decq %rax
cqto
idivq %rsi
movb $0x1, %dl
testb %dl, %dl
je 0x25cd6
cmpl 0xc0(%r14), %eax
jbe 0x25cd2
movl %eax, 0xc0(%r14)
movl %eax, (%rbx)
xorl %ecx, %ecx
movl %ecx, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: saveCursorKey
static int saveCursorKey(BtCursor *pCur){
  int rc;
  assert( CURSOR_VALID==pCur->eState );
  assert( 0==pCur->pKey );
  assert( cursorHoldsMutex(pCur) );

  rc = sqlite3BtreeKeySize(pCur, &pCur->nKey);
  assert( rc==SQLITE_OK );  /* KeySize() cannot fail */

  /* If this is an intKey table, then the above call to BtreeKeySize()
  ** stores the integer key in pCur->nKey. In this case this value is
  ** all that is required. Otherwise, if pCur is not open on an intKey
  ** table, then malloc space for and store the pCur->nKey bytes of key 
  ** data.  */
  if( 0==pCur->curIntKey ){
    void *pKey = sqlite3Malloc( pCur->nKey );
    if( pKey ){
      rc = sqlite3BtreeKey(pCur, 0, (int)pCur->nKey, pKey);
      if( rc==SQLITE_OK ){
        pCur->pKey = pKey;
      }else{
        sqlite3_free(pKey);
      }
    }else{
      rc = SQLITE_NOMEM;
    }
  }
  assert( !pCur->curIntKey || !pCur->pKey );
  return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
callq 0x26e9f
movq 0x20(%rbx), %rdi
movq %rdi, 0x38(%rbx)
xorl %r14d, %r14d
cmpb $0x0, 0x59(%rbx)
je 0x26e5a
movl %r14d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
callq 0xbf9b
testq %rax, %rax
je 0x26e91
movq %rax, %r15
movl 0x38(%rbx), %edx
xorl %r14d, %r14d
movq %rbx, %rdi
xorl %esi, %esi
movq %rax, %rcx
xorl %r8d, %r8d
callq 0x26ef2
testl %eax, %eax
je 0x26e99
movl %eax, %r12d
movq %r15, %rdi
callq 0xa620
movl %r12d, %r14d
jmp 0x26e4e
movl $0x7, %r14d
jmp 0x26e4e
movq %r15, 0x40(%rbx)
jmp 0x26e4e
// File: /workspace/github_c_makefile_star2_O1/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: getCellInfo
static SQLITE_NOINLINE void getCellInfo(BtCursor *pCur){
  if( pCur->info.nSize==0 ){
    int iPage = pCur->iPage;
    pCur->curFlags |= BTCF_ValidNKey;
    btreeParseCell(pCur->apPage[iPage],pCur->aiIdx[iPage],&pCur->info);
  }else{
    assertCellInfo(pCur);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
cmpw $0x0, 0x36(%rdi)
je 0x26eac
popq %rbp
retq
movsbq 0x58(%rdi), %rcx
orb $0x2, 0x54(%rdi)
leaq 0x20(%rdi), %rdx
movq 0x98(%rdi,%rcx,8), %rax
movzwl 0x70(%rdi,%rcx,2), %ecx
movq 0x60(%rax), %rsi
movzwl 0x14(%rax), %edi
movzbl (%rsi,%rcx,2), %r8d
shll $0x8, %r8d
movzbl 0x1(%rsi,%rcx,2), %esi
orl %r8d, %esi
andl %edi, %esi
addq 0x50(%rax), %rsi
movq 0x80(%rax), %rcx
movq %rax, %rdi
popq %rbp
jmpq *%rcx
// File: /workspace/github_c_makefile_star2_O1/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: sqlite3PcacheMove
SQLITE_PRIVATE void sqlite3PcacheMove(PgHdr *p, Pgno newPgno){
  PCache *pCache = p->pCache;
  assert( p->nRef>0 );
  assert( newPgno>0 );
  sqlite3GlobalConfig.pcache2.xRekey(pCache->pCache, p->pPage, p->pgno,newPgno);
  p->pgno = newPgno;
  if( (p->flags&PGHDR_DIRTY) && (p->flags&PGHDR_NEED_SYNC) ){
    pcacheManageDirtyList(p, PCACHE_DIRTYLIST_FRONT);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl %esi, %r14d
movq %rdi, %rbx
movq 0x30(%rdi), %rax
movq 0x40(%rax), %rdi
movq (%rbx), %rsi
movl 0x28(%rbx), %edx
movl %r14d, %ecx
callq *0x6aec2(%rip)          # 0x93418
movl %r14d, 0x28(%rbx)
movl 0x2c(%rbx), %eax
notl %eax
testb $0xa, %al
jne 0x28574
movq %rbx, %rdi
movl $0x3, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0x21c64
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: ptrmapPutOvflPtr
static void ptrmapPutOvflPtr(MemPage *pPage, u8 *pCell, int *pRC){
  CellInfo info;
  if( *pRC ) return;
  assert( pCell!=0 );
  pPage->xParseCell(pPage, pCell, &info);
  if( info.nLocal<info.nPayload ){
    Pgno ovfl = get4byte(&pCell[info.nSize-4]);
    ptrmapPut(pPage->pBt, ovfl, PTRMAP_OVERFLOW1, pPage->pgno, pRC);
  }
}

// Assembly:
cmpl $0x0, (%rdx)
je 0x28677
retq
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
leaq -0x38(%rbp), %r12
movq %r12, %rdx
callq *0x80(%rdi)
movzwl 0x14(%r12), %eax
cmpl %eax, 0x10(%r12)
jbe 0x286cc
movzwl -0x22(%rbp), %eax
movl -0x4(%r15,%rax), %esi
bswapl %esi
movq 0x48(%r14), %rdi
movl 0x88(%r14), %ecx
movl $0x3, %edx
movq %rbx, %r8
callq 0x281b2
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: sqlite3BtreeTripAllCursors
SQLITE_PRIVATE int sqlite3BtreeTripAllCursors(Btree *pBtree, int errCode, int writeOnly){
  BtCursor *p;
  int rc = SQLITE_OK;

  assert( (writeOnly==0 || writeOnly==1) && BTCF_WriteFlag==1 );
  if( pBtree ){
    sqlite3BtreeEnter(pBtree);
    for(p=pBtree->pBt->pCursor; p; p=p->pNext){
      int i;
      if( writeOnly && (p->curFlags & BTCF_WriteFlag)==0 ){
        if( p->eState==CURSOR_VALID || p->eState==CURSOR_SKIPNEXT ){
          rc = saveCursorPosition(p);
          if( rc!=SQLITE_OK ){
            (void)sqlite3BtreeTripAllCursors(pBtree, rc, 0);
            break;
          }
        }
      }else{
        sqlite3BtreeClearCursor(p);
        p->eState = CURSOR_FAULT;
        p->skipNext = errCode;
      }
      for(i=0; i<=p->iPage; i++){
        releasePage(p->apPage[i]);
        p->apPage[i] = 0;
      }
    }
    sqlite3BtreeLeave(pBtree);
  }
  return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
testq %rdi, %rdi
je 0x287ea
movl %edx, %r14d
movl %esi, %r12d
movq %rdi, %rbx
cmpb $0x0, 0x11(%rdi)
je 0x28713
incl 0x14(%rbx)
cmpb $0x0, 0x12(%rbx)
jne 0x28713
movq %rbx, %rdi
callq 0x25420
movq %rbx, -0x38(%rbp)
movq 0x8(%rbx), %r13
movl $0x0, -0x2c(%rbp)
movq 0x10(%r13), %r13
testq %r13, %r13
je 0x287d1
testl %r14d, %r14d
je 0x28765
testb $0x1, 0x54(%r13)
jne 0x28765
movb 0x56(%r13), %al
decb %al
cmpb $0x1, %al
ja 0x2877f
movq %r13, %rdi
callq 0x26d97
testl %eax, %eax
je 0x287c8
xorl %ebx, %ebx
movq -0x38(%rbp), %rdi
movl %eax, -0x2c(%rbp)
movl %eax, %esi
xorl %edx, %edx
callq 0x286d9
jmp 0x287be
movq 0x40(%r13), %rdi
callq 0xa620
movq $0x0, 0x40(%r13)
movb $0x4, 0x56(%r13)
movl %r12d, 0x50(%r13)
movb $0x1, %bl
cmpb $0x0, 0x58(%r13)
js 0x287be
movq $-0x1, %r15
movq 0xa0(%r13,%r15,8), %rax
testq %rax, %rax
je 0x287a5
movq 0x70(%rax), %rdi
callq 0x25020
movq $0x0, 0xa0(%r13,%r15,8)
movsbq 0x58(%r13), %rax
incq %r15
cmpq %rax, %r15
jl 0x2878f
testb %bl, %bl
jne 0x28722
jmp 0x287d1
movl $0x0, -0x2c(%rbp)
jmp 0x2877f
movq -0x38(%rbp), %rdi
cmpb $0x0, 0x11(%rdi)
je 0x287ee
decl 0x14(%rdi)
movl -0x2c(%rbp), %ebx
jne 0x287f1
callq 0x254a6
jmp 0x287f1
xorl %ebx, %ebx
jmp 0x287f1
movl -0x2c(%rbp), %ebx
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: freeP4
static void freeP4(sqlite3 *db, int p4type, void *p4){
  if( p4 ){
    assert( db );
    switch( p4type ){
      case P4_FUNCCTX: {
        freeEphemeralFunction(db, ((sqlite3_context*)p4)->pFunc);
        /* Fall through into the next case */
      }
      case P4_REAL:
      case P4_INT64:
      case P4_DYNAMIC:
      case P4_INTARRAY: {
        sqlite3DbFree(db, p4);
        break;
      }
      case P4_KEYINFO: {
        if( db->pnBytesFreed==0 ) sqlite3KeyInfoUnref((KeyInfo*)p4);
        break;
      }
#ifdef SQLITE_ENABLE_CURSOR_HINTS
      case P4_EXPR: {
        sqlite3ExprDelete(db, (Expr*)p4);
        break;
      }
#endif
      case P4_MPRINTF: {
        if( db->pnBytesFreed==0 ) sqlite3_free(p4);
        break;
      }
      case P4_FUNCDEF: {
        freeEphemeralFunction(db, (FuncDef*)p4);
        break;
      }
      case P4_MEM: {
        if( db->pnBytesFreed==0 ){
          sqlite3ValueFree((sqlite3_value*)p4);
        }else{
          Mem *p = (Mem*)p4;
          if( p->szMalloc ) sqlite3DbFree(db, p->zMalloc);
          sqlite3DbFree(db, p);
        }
        break;
      }
      case P4_VTAB : {
        if( db->pnBytesFreed==0 ) sqlite3VtabUnlock((VTable *)p4);
        break;
      }
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
testq %rdx, %rdx
je 0x289ac
addl $0x14, %esi
cmpl $0x13, %esi
ja 0x289ac
movq %rdx, %rbx
movq %rdi, %r14
leaq 0x50ace(%rip), %rax     # 0x793f4
movslq (%rax,%rsi,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %rbp
jmp 0xb6df
cmpq $0x0, 0x328(%r14)
jne 0x289ac
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x289bd
cmpq $0x0, 0x328(%r14)
je 0x289b1
cmpl $0x0, 0x20(%rbx)
je 0x2892f
movq 0x18(%rbx), %rsi
jmp 0x28976
movq 0x8(%rbx), %rsi
testq %rsi, %rsi
je 0x2892f
testb $0x10, 0x2(%rsi)
je 0x2892f
movq %r14, %rdi
callq 0xb6df
jmp 0x2892f
testb $0x10, 0x2(%rbx)
jne 0x2892f
jmp 0x289ac
cmpq $0x0, 0x328(%r14)
jne 0x289ac
decl (%rbx)
jne 0x289ac
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0xa620
cmpq $0x0, 0x328(%r14)
je 0x28996
popq %rbx
popq %r14
popq %rbp
retq
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x1199c
// File: /workspace/github_c_makefile_star2_O1/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: sqlite3VdbeTransferError
SQLITE_PRIVATE int sqlite3VdbeTransferError(Vdbe *p){
  sqlite3 *db = p->db;
  int rc = p->rc;
  if( p->zErrMsg ){
    u8 mallocFailed = db->mallocFailed;
    sqlite3BeginBenignMalloc();
    if( db->pErr==0 ) db->pErr = sqlite3ValueNew(db);
    sqlite3ValueSetStr(db->pErr, -1, p->zErrMsg, SQLITE_UTF8, SQLITE_TRANSIENT);
    sqlite3EndBenignMalloc();
    db->mallocFailed = mallocFailed;
    db->errCode = rc;
  }else{
    sqlite3Error(db, rc);
  }
  return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq (%rdi), %r14
movl 0x84(%rdi), %ebx
cmpq $0x0, 0x48(%rdi)
je 0x29037
movq %rdi, %r15
movb 0x51(%r14), %r12b
movq 0x6c532(%rip), %rax     # 0x954d8
testq %rax, %rax
je 0x28fad
callq *%rax
cmpq $0x0, 0x140(%r14)
jne 0x28ff0
movl $0x38, %esi
movq %r14, %rdi
callq 0x144ee
testq %rax, %rax
je 0x28fe9
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x10(%rax)
movq $0x0, 0x30(%rax)
movw $0x1, 0x8(%rax)
movq %r14, 0x28(%rax)
movq %rax, 0x140(%r14)
movq 0x140(%r14), %rdi
testq %rdi, %rdi
je 0x29016
movq 0x48(%r15), %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl $0x1, %ecx
movq $-0x1, %r8
callq 0x11b32
movq 0x6c4c3(%rip), %rax     # 0x954e0
testq %rax, %rax
je 0x29024
callq *%rax
movb %r12b, 0x51(%r14)
movl %ebx, 0x44(%r14)
movl %ebx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl %ebx, 0x44(%r14)
movq 0x140(%r14), %rdi
testq %rdi, %rdi
je 0x2902c
movzwl 0x8(%rdi), %eax
testl $0x2460, %eax           # imm = 0x2460
je 0x29059
callq 0x2a646
jmp 0x2902c
movw $0x1, 0x8(%rdi)
jmp 0x2902c
// File: /workspace/github_c_makefile_star2_O1/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: sqlite3VdbeFrameRestore
SQLITE_PRIVATE int sqlite3VdbeFrameRestore(VdbeFrame *pFrame){
  Vdbe *v = pFrame->v;
  closeCursorsInFrame(v);
#ifdef SQLITE_ENABLE_STMT_SCANSTATUS
  v->anExec = pFrame->anExec;
#endif
  v->aOnceFlag = pFrame->aOnceFlag;
  v->nOnceFlag = pFrame->nOnceFlag;
  v->aOp = pFrame->aOp;
  v->nOp = pFrame->nOp;
  v->aMem = pFrame->aMem;
  v->nMem = pFrame->nMem;
  v->apCsr = pFrame->apCsr;
  v->nCursor = pFrame->nCursor;
  v->db->lastRowid = pFrame->lastRowid;
  v->nChange = pFrame->nChange;
  v->db->nChange = pFrame->nDbChange;
  return pFrame->pc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %r14
movq %r14, %rdi
callq 0x29afa
movq 0x28(%rbx), %rax
movq %rax, 0x118(%r14)
movl 0x58(%rbx), %eax
movl %eax, 0x110(%r14)
movq 0x10(%rbx), %rax
movq %rax, 0x8(%r14)
movl 0x50(%rbx), %eax
movl %eax, 0x3c(%r14)
movq 0x20(%rbx), %rax
movq %rax, 0x10(%r14)
movl 0x54(%rbx), %eax
movl %eax, 0x38(%r14)
movq 0x30(%rbx), %rax
movq %rax, 0x60(%r14)
movl 0x48(%rbx), %eax
movl %eax, 0x40(%r14)
movq 0x40(%rbx), %rax
movq (%r14), %rcx
movq %rax, 0x30(%rcx)
movl 0x64(%rbx), %eax
movl %eax, 0x90(%r14)
movl 0x68(%rbx), %eax
movl %eax, 0x60(%rcx)
movl 0x4c(%rbx), %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: sqlite3VdbeDeleteAuxData
SQLITE_PRIVATE void sqlite3VdbeDeleteAuxData(Vdbe *pVdbe, int iOp, int mask){
  AuxData **pp = &pVdbe->pAuxData;
  while( *pp ){
    AuxData *pAux = *pp;
    if( (iOp<0)
     || (pAux->iOp==iOp && (pAux->iArg>31 || !(mask & MASKBIT32(pAux->iArg))))
    ){
      testcase( pAux->iArg==31 );
      if( pAux->xDelete ){
        pAux->xDelete(pAux->pAux);
      }
      *pp = pAux->pNext;
      sqlite3DbFree(pVdbe->db, pAux);
    }else{
      pp= &pAux->pNext;
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq 0x120(%rdi), %r12
testq %r12, %r12
je 0x29bc0
movl %edx, %ebx
movl %esi, %r14d
movq %rdi, %r15
leaq 0x120(%rdi), %r13
testl %r14d, %r14d
js 0x29b92
cmpl %r14d, (%r12)
jne 0x29b89
movl 0x4(%r12), %eax
cmpl $0x1f, %eax
jg 0x29b92
btl %eax, %ebx
jae 0x29b92
addq $0x18, %r12
movq %r12, %r13
jmp 0x29bb7
movq 0x10(%r12), %rax
testq %rax, %rax
je 0x29ba3
movq 0x8(%r12), %rdi
callq *%rax
movq 0x18(%r12), %rax
movq %rax, (%r13)
movq (%r15), %rdi
movq %r12, %rsi
callq 0xb6df
movq (%r13), %r12
testq %r12, %r12
jne 0x29b6f
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: sqlite3VdbeFreeCursor
SQLITE_PRIVATE void sqlite3VdbeFreeCursor(Vdbe *p, VdbeCursor *pCx){
  if( pCx==0 ){
    return;
  }
  assert( pCx->pBt==0 || pCx->eCurType==CURTYPE_BTREE );
  switch( pCx->eCurType ){
    case CURTYPE_SORTER: {
      sqlite3VdbeSorterClose(p->db, pCx);
      break;
    }
    case CURTYPE_BTREE: {
      if( pCx->pBt ){
        sqlite3BtreeClose(pCx->pBt);
        /* The pCx->pCursor will be close automatically, if it exists, by
        ** the call above. */
      }else{
        assert( pCx->uc.pCursor!=0 );
        sqlite3BtreeCloseCursor(pCx->uc.pCursor);
      }
      break;
    }
#ifndef SQLITE_OMIT_VIRTUALTABLE
    case CURTYPE_VTAB: {
      sqlite3_vtab_cursor *pVCur = pCx->uc.pVCur;
      const sqlite3_module *pModule = pVCur->pVtab->pModule;
      assert( pVCur->pVtab->nRef>0 );
      pVCur->pVtab->nRef--;
      pModule->xClose(pVCur);
      break;
    }
#endif
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testq %rsi, %rsi
je 0x29c25
movq %rsi, %rbx
movzbl (%rsi), %eax
testl %eax, %eax
je 0x29c4a
cmpl $0x2, %eax
je 0x29c30
cmpl $0x1, %eax
jne 0x29c25
movq 0x10(%rbx), %r14
testq %r14, %r14
je 0x29c25
movq (%rdi), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x29ef2
movq 0x40(%r14), %rdi
callq 0xa620
movq %r15, %rdi
movq %r14, %rsi
callq 0xb6df
movq $0x0, 0x10(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x10(%rbx), %rdi
movq (%rdi), %rax
movq (%rax), %rcx
decl 0x8(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmpq *0x38(%rcx)
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x29c5f
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x29c72
movq 0x10(%rbx), %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x29dfb
// File: /workspace/github_c_makefile_star2_O1/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: sqlite3BtreeCloseCursor
SQLITE_PRIVATE int sqlite3BtreeCloseCursor(BtCursor *pCur){
  Btree *pBtree = pCur->pBtree;
  if( pBtree ){
    int i;
    BtShared *pBt = pCur->pBt;
    sqlite3BtreeEnter(pBtree);
    sqlite3BtreeClearCursor(pCur);
    assert( pBt->pCursor!=0 );
    if( pBt->pCursor==pCur ){
      pBt->pCursor = pCur->pNext;
    }else{
      BtCursor *pPrev = pBt->pCursor;
      do{
        if( pPrev->pNext==pCur ){
          pPrev->pNext = pCur->pNext;
          break;
        }
        pPrev = pPrev->pNext;
      }while( ALWAYS(pPrev) );
    }
    for(i=0; i<=pCur->iPage; i++){
      releasePage(pCur->apPage[i]);
    }
    unlockBtreeIfUnused(pBt);
    sqlite3_free(pCur->aOverflow);
    /* sqlite3_free(pCur); */
    sqlite3BtreeLeave(pBtree);
  }
  return SQLITE_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq (%rdi), %rbx
testq %rbx, %rbx
je 0x29ed9
movq %rdi, %r14
movq 0x8(%rdi), %r15
cmpb $0x0, 0x11(%rbx)
je 0x29e30
incl 0x14(%rbx)
cmpb $0x0, 0x12(%rbx)
jne 0x29e30
movq %rbx, %rdi
callq 0x25420
movq 0x40(%r14), %rdi
callq 0xa620
movq $0x0, 0x40(%r14)
movb $0x0, 0x56(%r14)
movq 0x10(%r15), %rax
cmpq %r14, %rax
je 0x29e62
movq 0x10(%rax), %rcx
cmpq %r14, %rcx
je 0x29e68
movq %rcx, %rax
testq %rcx, %rcx
jne 0x29e4f
jmp 0x29e73
leaq 0x10(%r15), %rax
jmp 0x29e6c
addq $0x10, %rax
movq 0x10(%r14), %rcx
movq %rcx, (%rax)
cmpb $0x0, 0x58(%r14)
js 0x29ea4
movq $-0x1, %r12
movq 0xa0(%r14,%r12,8), %rax
testq %rax, %rax
je 0x29e97
movq 0x70(%rax), %rdi
callq 0x25020
movsbq 0x58(%r14), %rax
incq %r12
cmpq %rax, %r12
jl 0x29e81
cmpb $0x0, 0x24(%r15)
jne 0x29ec5
movq 0x18(%r15), %rax
testq %rax, %rax
je 0x29ec5
movq $0x0, 0x18(%r15)
movq 0x70(%rax), %rdi
callq 0x25020
movq 0x18(%r14), %rdi
callq 0xa620
cmpb $0x0, 0x11(%rbx)
je 0x29ed9
decl 0x14(%rbx)
je 0x29ee2
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x254a6
// File: /workspace/github_c_makefile_star2_O1/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: vdbeSorterJoinThread
static int vdbeSorterJoinThread(SortSubtask *pTask){
  int rc = SQLITE_OK;
  if( pTask->pThread ){
#ifdef SQLITE_DEBUG_SORTER_THREADS
    int bDone = pTask->bDone;
#endif
    void *pRet = SQLITE_INT_TO_PTR(SQLITE_ERROR);
    vdbeSorterBlockDebug(pTask, !bDone, "enter");
    (void)sqlite3ThreadJoin(pTask->pThread, &pRet);
    vdbeSorterBlockDebug(pTask, !bDone, "exit");
    rc = SQLITE_PTR_TO_INT(pRet);
    assert( pTask->bDone==1 );
    pTask->bDone = 0;
    pTask->pThread = 0;
  }
  return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq (%rdi), %r14
testq %r14, %r14
je 0x2a16d
movq %rdi, %rbx
movq $0x1, -0x18(%rbp)
cmpl $0x0, 0x8(%r14)
je 0x2a171
movq 0x10(%r14), %rax
movq %rax, -0x18(%rbp)
jmp 0x2a17d
xorl %eax, %eax
jmp 0x2a196
movq (%r14), %rdi
leaq -0x18(%rbp), %rsi
callq 0xa550
movq %r14, %rdi
callq 0xa620
movl -0x18(%rbp), %eax
movl $0x0, 0x8(%rbx)
movq $0x0, (%rbx)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: vdbeIncrFree
static void vdbeIncrFree(IncrMerger *pIncr){
  if( pIncr ){
#if SQLITE_MAX_WORKER_THREADS>0
    if( pIncr->bUseThread ){
      vdbeSorterJoinThread(pIncr->pTask);
      if( pIncr->aFile[0].pFd ) sqlite3OsCloseFree(pIncr->aFile[0].pFd);
      if( pIncr->aFile[1].pFd ) sqlite3OsCloseFree(pIncr->aFile[1].pFd);
    }
#endif
    vdbeMergeEngineFree(pIncr->pMerger);
    sqlite3_free(pIncr);
  }
}

// Assembly:
testq %rdi, %rdi
je 0x2a21d
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
cmpl $0x0, 0x20(%rdi)
je 0x2a208
movq (%rbx), %rdi
callq 0x2a13e
movq 0x28(%rbx), %r14
testq %r14, %r14
je 0x2a1e2
movq (%r14), %rax
testq %rax, %rax
je 0x2a1da
movq %r14, %rdi
callq *0x8(%rax)
movq $0x0, (%r14)
movq %r14, %rdi
callq 0xa620
movq 0x38(%rbx), %r14
testq %r14, %r14
je 0x2a208
movq (%r14), %rax
testq %rax, %rax
je 0x2a200
movq %r14, %rdi
callq *0x8(%rax)
movq $0x0, (%r14)
movq %r14, %rdi
callq 0xa620
movq 0x8(%rbx), %rdi
callq 0x2a0f4
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0xa620
retq
// File: /workspace/github_c_makefile_star2_O1/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: vdbeLeave
static SQLITE_NOINLINE void vdbeLeave(Vdbe *p){
  int i;
  sqlite3 *db;
  Db *aDb;
  int nDb;
  db = p->db;
  aDb = db->aDb;
  nDb = db->nDb;
  for(i=0; i<nDb; i++){
    if( i!=1 && DbMaskTest(p->lockMask,i) && ALWAYS(aDb[i].pBt!=0) ){
      sqlite3BtreeLeave(aDb[i].pBt);
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq (%rdi), %rax
movslq 0x28(%rax), %r14
testq %r14, %r14
jle 0x2a3ae
movq %rdi, %rbx
movq 0x20(%rax), %r15
addq $0x8, %r15
xorl %r12d, %r12d
cmpq $0x1, %r12
je 0x2a3a2
movl 0x98(%rbx), %eax
btl %r12d, %eax
jae 0x2a3a2
movq (%r15), %rdi
testq %rdi, %rdi
je 0x2a3a2
cmpb $0x0, 0x11(%rdi)
je 0x2a3a2
decl 0x14(%rdi)
jne 0x2a3a2
callq 0x254a6
incq %r12
addq $0x20, %r15
cmpq %r12, %r14
jne 0x2a378
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: vdbeMemClear
static SQLITE_NOINLINE void vdbeMemClear(Mem *p){
  if( VdbeMemDynamic(p) ){
    vdbeMemClearExternAndSetNull(p);
  }
  if( p->szMalloc ){
    sqlite3DbFree(p->db, p->zMalloc);
    p->szMalloc = 0;
  }
  p->z = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movzwl 0x8(%rdi), %eax
testl $0x2460, %eax           # imm = 0x2460
je 0x2a61d
movq %rbx, %rdi
callq 0x2a646
cmpl $0x0, 0x20(%rbx)
je 0x2a637
movq 0x18(%rbx), %rsi
movq 0x28(%rbx), %rdi
callq 0xb6df
movl $0x0, 0x20(%rbx)
movq $0x0, 0x10(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: vdbeMemClearExternAndSetNull
static SQLITE_NOINLINE void vdbeMemClearExternAndSetNull(Mem *p){
  assert( p->db==0 || sqlite3_mutex_held(p->db->mutex) );
  assert( VdbeMemDynamic(p) );
  if( p->flags&MEM_Agg ){
    sqlite3VdbeMemFinalize(p, p->u.pDef);
    assert( (p->flags & MEM_Agg)==0 );
    testcase( p->flags & MEM_Dyn );
  }
  if( p->flags&MEM_Dyn ){
    assert( (p->flags&MEM_RowSet)==0 );
    assert( p->xDel!=SQLITE_DYNAMIC && p->xDel!=0 );
    p->xDel((void *)p->z);
  }else if( p->flags&MEM_RowSet ){
    sqlite3RowSetClear(p->u.pRowSet);
  }else if( p->flags&MEM_Frame ){
    VdbeFrame *pFrame = p->u.pFrame;
    pFrame->pParent = pFrame->v->pDelFrame;
    pFrame->v->pDelFrame = pFrame;
  }
  p->flags = MEM_Null;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
testb $0x20, 0x9(%rdi)
je 0x2a660
movq (%rbx), %rsi
movq %rbx, %rdi
callq 0x2a6aa
movzwl 0x8(%rbx), %eax
btl $0xa, %eax
jb 0x2a68c
testb $0x20, %al
jne 0x2a695
testb $0x40, %al
je 0x2a69d
movq (%rbx), %rax
movq (%rax), %rcx
movq 0xf8(%rcx), %rdx
movq %rdx, 0x8(%rax)
movq %rax, 0xf8(%rcx)
jmp 0x2a69d
movq 0x10(%rbx), %rdi
callq *0x30(%rbx)
jmp 0x2a69d
movq (%rbx), %rdi
callq 0x2a750
movw $0x1, 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: sqlite3VdbeMemFinalize
SQLITE_PRIVATE int sqlite3VdbeMemFinalize(Mem *pMem, FuncDef *pFunc){
  int rc = SQLITE_OK;
  if( ALWAYS(pFunc && pFunc->xFinalize) ){
    sqlite3_context ctx;
    Mem t;
    assert( (pMem->flags & MEM_Null)!=0 || pFunc==pMem->u.pDef );
    assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) );
    memset(&ctx, 0, sizeof(ctx));
    memset(&t, 0, sizeof(t));
    t.flags = MEM_Null;
    t.db = pMem->db;
    ctx.pOut = &t;
    ctx.pMem = pMem;
    ctx.pFunc = pFunc;
    pFunc->xFinalize(&ctx); /* IMP: R-24505-23230 */
    assert( (pMem->flags & MEM_Dyn)==0 );
    if( pMem->szMalloc>0 ) sqlite3DbFree(pMem->db, pMem->zMalloc);
    memcpy(pMem, &t, sizeof(t));
    rc = ctx.isError;
  }
  return rc;
}

// Assembly:
xorl %eax, %eax
testq %rsi, %rsi
je 0x2a74f
movq 0x28(%rsi), %rcx
testq %rcx, %rcx
je 0x2a74f
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x78, %rsp
movq %rdi, %rbx
xorps %xmm0, %xmm0
leaq -0x80(%rbp), %rdi
movaps %xmm0, (%rdi)
movaps %xmm0, 0x10(%rdi)
movaps %xmm0, 0x20(%rdi)
xorl %eax, %eax
movq %rax, 0x30(%rdi)
leaq -0x40(%rbp), %rdx
movaps %xmm0, (%rdx)
movaps %xmm0, 0x10(%rdx)
movaps %xmm0, 0x20(%rdx)
movq %rax, 0x30(%rdx)
movw $0x1, 0x8(%rdx)
movq 0x28(%rbx), %rax
movq %rax, 0x28(%rdx)
movq %rdx, (%rdi)
movq %rbx, 0x10(%rdi)
movq %rsi, 0x8(%rdi)
callq *%rcx
cmpl $0x0, 0x20(%rbx)
jle 0x2a727
movq 0x18(%rbx), %rsi
movq 0x28(%rbx), %rdi
callq 0xb6df
movq -0x10(%rbp), %rax
movq %rax, 0x30(%rbx)
movaps -0x40(%rbp), %xmm0
movaps -0x30(%rbp), %xmm1
movaps -0x20(%rbp), %xmm2
movups %xmm2, 0x20(%rbx)
movups %xmm1, 0x10(%rbx)
movups %xmm0, (%rbx)
movl -0x5c(%rbp), %eax
addq $0x78, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: sqlite3VdbeMemGrow
int sqlite3VdbeMemGrow(Mem *pMem, int n, int bPreserve){
  assert( sqlite3VdbeCheckMemInvariants(pMem) );
  assert( (pMem->flags&MEM_RowSet)==0 );

  /* If the bPreserve flag is set to true, then the memory cell must already
  ** contain a valid string or blob value.  */
  assert( bPreserve==0 || pMem->flags&(MEM_Blob|MEM_Str) );
  testcase( bPreserve && pMem->z==0 );

  assert( pMem->szMalloc==0
       || pMem->szMalloc==sqlite3DbMallocSize(pMem->db, pMem->zMalloc) );
  if( pMem->szMalloc<n ){
    if( n<32 ) n = 32;
    if( bPreserve && pMem->szMalloc>0 && pMem->z==pMem->zMalloc ){
      pMem->z = pMem->zMalloc = sqlite3DbReallocOrFree(pMem->db, pMem->z, n);
      bPreserve = 0;
    }else{
      if( pMem->szMalloc>0 ) sqlite3DbFree(pMem->db, pMem->zMalloc);
      pMem->zMalloc = sqlite3DbMallocRaw(pMem->db, n);
    }
    if( pMem->zMalloc==0 ){
      sqlite3VdbeMemSetNull(pMem);
      pMem->z = 0;
      pMem->szMalloc = 0;
      return SQLITE_NOMEM;
    }else{
      pMem->szMalloc = sqlite3DbMallocSize(pMem->db, pMem->zMalloc);
    }
  }

  if( bPreserve && pMem->z && pMem->z!=pMem->zMalloc ){
    memcpy(pMem->zMalloc, pMem->z, pMem->n);
  }
  if( (pMem->flags&MEM_Dyn)!=0 ){
    assert( pMem->xDel!=0 && pMem->xDel!=SQLITE_DYNAMIC );
    pMem->xDel((void *)(pMem->z));
  }

  pMem->z = pMem->zMalloc;
  pMem->flags &= ~(MEM_Dyn|MEM_Ephem|MEM_Static);
  return SQLITE_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %r14d
movq %rdi, %rbx
movl 0x20(%rdi), %eax
cmpl %esi, %eax
jge 0x2a82e
cmpl $0x21, %esi
movl $0x20, %r15d
cmovgel %esi, %r15d
testl %r14d, %r14d
sete %cl
testl %eax, %eax
setle %dl
orb %cl, %dl
jne 0x2a7d7
movq 0x10(%rbx), %rsi
cmpq 0x18(%rbx), %rsi
je 0x2a889
testl %eax, %eax
jle 0x2a7e8
movq 0x18(%rbx), %rsi
movq 0x28(%rbx), %rdi
callq 0xb6df
movq 0x28(%rbx), %rdi
movl %r15d, %esi
callq 0x144ee
movq %rax, 0x18(%rbx)
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x2a874
movq 0x28(%rbx), %rax
testq %rax, %rax
je 0x2a825
cmpq %rdi, 0x170(%rax)
ja 0x2a825
cmpq %rdi, 0x178(%rax)
jbe 0x2a825
movzwl 0x150(%rax), %eax
jmp 0x2a82b
callq *0x68b35(%rip)          # 0x93360
movl %eax, 0x20(%rbx)
testl %r14d, %r14d
je 0x2a84e
movq 0x10(%rbx), %rsi
testq %rsi, %rsi
je 0x2a84e
movq 0x18(%rbx), %rdi
cmpq %rdi, %rsi
je 0x2a84e
movslq 0xc(%rbx), %rdx
callq 0xa310
testb $0x4, 0x9(%rbx)
je 0x2a85b
movq 0x10(%rbx), %rdi
callq *0x30(%rbx)
movq 0x18(%rbx), %rax
movq %rax, 0x10(%rbx)
andb $-0x1d, 0x9(%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movzwl 0x8(%rbx), %eax
testl $0x2460, %eax           # imm = 0x2460
je 0x2a8a5
movq %rbx, %rdi
callq 0x2a646
jmp 0x2a8ab
movq 0x28(%rbx), %rdi
movl %r15d, %edx
callq 0x2a8c1
movq %rax, 0x18(%rbx)
movq %rax, 0x10(%rbx)
xorl %r14d, %r14d
jmp 0x2a7f8
movw $0x1, 0x8(%rbx)
movq $0x0, 0x10(%rbx)
movl $0x0, 0x20(%rbx)
movl $0x7, %eax
jmp 0x2a869
// File: /workspace/github_c_makefile_star2_O1/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: valueToText
static SQLITE_NOINLINE const void *valueToText(sqlite3_value* pVal, u8 enc){
  assert( pVal!=0 );
  assert( pVal->db==0 || sqlite3_mutex_held(pVal->db->mutex) );
  assert( (enc&3)==(enc&~SQLITE_UTF16_ALIGNED) );
  assert( (pVal->flags & MEM_RowSet)==0 );
  assert( (pVal->flags & (MEM_Null))==0 );
  if( pVal->flags & (MEM_Blob|MEM_Str) ){
    pVal->flags |= MEM_Str;
    if( pVal->flags & MEM_Zero ){
      sqlite3VdbeMemExpandBlob(pVal);
    }
    if( pVal->enc != (enc & ~SQLITE_UTF16_ALIGNED) ){
      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{
    sqlite3VdbeMemStringify(pVal, enc, 0);
    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:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl %esi, %r14d
movq %rdi, %rbx
movzwl 0x8(%rdi), %eax
testb $0x12, %al
je 0x2a992
movl %eax, %ecx
orl $0x2, %ecx
movw %cx, 0x8(%rbx)
btl $0xe, %eax
jae 0x2a944
movq %rbx, %rdi
callq 0x11679
movzbl 0xa(%rbx), %eax
movzbl %r14b, %esi
andl $-0x9, %esi
cmpl %eax, %esi
je 0x2a961
testb $0x2, 0x8(%rbx)
je 0x2a961
movq %rbx, %rdi
callq 0x2aaa0
testb $0x8, %r14b
je 0x2a979
testb $0x1, 0x10(%rbx)
je 0x2a979
movq %rbx, %rdi
callq 0x11927
testl %eax, %eax
jne 0x2a9b0
movzwl 0x8(%rbx), %eax
andl $0x202, %eax            # imm = 0x202
cmpw $0x2, %ax
jne 0x2a9a0
movq %rbx, %rdi
callq 0x2b04b
jmp 0x2a9a0
movzbl %r14b, %esi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x2a9b7
andb $-0x9, %r14b
cmpb %r14b, 0xa(%rbx)
jne 0x2a9b0
movq 0x10(%rbx), %rax
jmp 0x2a9b2
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: sqlite3VdbeMemStringify
SQLITE_PRIVATE int sqlite3VdbeMemStringify(Mem *pMem, u8 enc, u8 bForce){
  int fg = pMem->flags;
  const int nByte = 32;

  assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) );
  assert( !(fg&MEM_Zero) );
  assert( !(fg&(MEM_Str|MEM_Blob)) );
  assert( fg&(MEM_Int|MEM_Real) );
  assert( (pMem->flags&MEM_RowSet)==0 );
  assert( EIGHT_BYTE_ALIGNMENT(pMem) );


  if( sqlite3VdbeMemClearAndResize(pMem, nByte) ){
    return SQLITE_NOMEM;
  }

  /* For a Real or Integer, use sqlite3_snprintf() to produce the UTF-8
  ** string representation of the value. Then, if the required encoding
  ** is UTF-16le or UTF-16be do a translation.
  ** 
  ** FIX ME: It would be better if sqlite3_snprintf() could do UTF-16.
  */
  if( fg & MEM_Int ){
    sqlite3_snprintf(nByte, pMem->z, "%lld", pMem->u.i);
  }else{
    assert( fg & MEM_Real );
    sqlite3_snprintf(nByte, pMem->z, "%!.15g", pMem->u.r);
  }
  pMem->n = sqlite3Strlen30(pMem->z);
  pMem->enc = SQLITE_UTF8;
  pMem->flags |= MEM_Str|MEM_Term;
  if( bForce ) pMem->flags &= ~(MEM_Int|MEM_Real);
  sqlite3VdbeChangeEncoding(pMem, enc);
  return SQLITE_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %r15d
movl %esi, %r14d
movq %rdi, %rbx
movzwl 0x8(%rdi), %r13d
cmpl $0x1f, 0x20(%rdi)
jg 0x2a9f8
movq %rbx, %rdi
movl $0x20, %esi
xorl %edx, %edx
callq 0x2a792
movl $0x7, %r12d
testl %eax, %eax
jne 0x2aa8e
jmp 0x2aa0a
movq 0x18(%rbx), %rax
movq %rax, 0x10(%rbx)
movl %r13d, %eax
andl $0xd, %eax
movw %ax, 0x8(%rbx)
movq 0x10(%rbx), %rsi
testb $0x4, %r13b
jne 0x2aa2d
movsd (%rbx), %xmm0
leaq 0x52ba6(%rip), %rdx     # 0x7d5c5
movl $0x20, %edi
movb $0x1, %al
callq 0xa340
jmp 0x2aa43
movq (%rbx), %rcx
leaq 0x53cab(%rip), %rdx     # 0x7e6e2
movl $0x20, %edi
xorl %eax, %eax
callq 0xa340
movq 0x10(%rbx), %rdi
xorl %r12d, %r12d
movl $0x0, %eax
testq %rdi, %rdi
je 0x2aa5e
callq 0xa190
andl $0x3fffffff, %eax       # imm = 0x3FFFFFFF
movl %eax, 0xc(%rbx)
movb $0x1, 0xa(%rbx)
movl $0x202, %eax            # imm = 0x202
orl 0x8(%rbx), %eax
movl %eax, %ecx
andl $-0xd, %ecx
testb %r15b, %r15b
cmovel %eax, %ecx
movw %cx, 0x8(%rbx)
cmpb $0x1, %r14b
je 0x2aa8e
movzbl %r14b, %esi
movq %rbx, %rdi
callq 0x2aaa0
movl %r12d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: vdbeMemAddTerminator
static SQLITE_NOINLINE int vdbeMemAddTerminator(Mem *pMem){
  if( sqlite3VdbeMemGrow(pMem, pMem->n+2, 1) ){
    return SQLITE_NOMEM;
  }
  pMem->z[pMem->n] = 0;
  pMem->z[pMem->n+1] = 0;
  pMem->flags |= MEM_Term;
  return SQLITE_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0xc(%rdi), %esi
addl $0x2, %esi
movl $0x1, %edx
callq 0x2a792
testl %eax, %eax
jne 0x2b085
movq 0x10(%rbx), %rax
movslq 0xc(%rbx), %rcx
xorl %edx, %edx
movb %dl, (%rax,%rcx)
movq 0x10(%rbx), %rax
movslq 0xc(%rbx), %rcx
movb %dl, 0x1(%rax,%rcx)
orb $0x2, 0x9(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: sqlite3VdbeMemClearAndResize
SQLITE_PRIVATE int sqlite3VdbeMemClearAndResize(Mem *pMem, int szNew){
  assert( szNew>0 );
  assert( (pMem->flags & MEM_Dyn)==0 || pMem->szMalloc==0 );
  if( pMem->szMalloc<szNew ){
    return sqlite3VdbeMemGrow(pMem, szNew, 0);
  }
  assert( (pMem->flags & MEM_Dyn)==0 );
  pMem->z = pMem->zMalloc;
  pMem->flags &= (MEM_Null|MEM_Int|MEM_Real);
  return SQLITE_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
cmpl %esi, 0x20(%rdi)
jge 0x2b09d
xorl %edx, %edx
popq %rbp
jmp 0x2a792
movq 0x18(%rdi), %rax
movq %rax, 0x10(%rdi)
andw $0xd, 0x8(%rdi)
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: sqlite3VdbeMemShallowCopy
SQLITE_PRIVATE void sqlite3VdbeMemShallowCopy(Mem *pTo, const Mem *pFrom, int srcType){
  assert( (pFrom->flags & MEM_RowSet)==0 );
  assert( pTo->db==pFrom->db );
  if( VdbeMemDynamic(pTo) ){ vdbeClrCopy(pTo,pFrom,srcType); return; }
  memcpy(pTo, pFrom, MEMCELLSIZE);
  if( (pFrom->flags&MEM_Static)==0 ){
    pTo->flags &= ~(MEM_Dyn|MEM_Static|MEM_Ephem);
    assert( srcType==MEM_Ephem || srcType==MEM_Static );
    pTo->flags |= srcType;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movzwl 0x8(%rdi), %eax
testl $0x2460, %eax           # imm = 0x2460
je 0x328e6
popq %rbp
jmp 0x36d2d
movq 0x10(%rsi), %rax
movq %rax, 0x10(%rdi)
movups (%rsi), %xmm0
movups %xmm0, (%rdi)
testb $0x8, 0x9(%rsi)
jne 0x32908
movl $0xffffe3ff, %eax       # imm = 0xFFFFE3FF
andl 0x8(%rdi), %eax
orl %edx, %eax
movw %ax, 0x8(%rdi)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: sqlite3MulInt64
SQLITE_PRIVATE int sqlite3MulInt64(i64 *pA, i64 iB){
  i64 iA = *pA;
  i64 iA1, iA0, iB1, iB0, r;

  iA1 = iA/TWOPOWER32;
  iA0 = iA % TWOPOWER32;
  iB1 = iB/TWOPOWER32;
  iB0 = iB % TWOPOWER32;
  if( iA1==0 ){
    if( iB1==0 ){
      *pA *= iB;
      return 0;
    }
    r = iA0*iB1;
  }else if( iB1==0 ){
    r = iA1*iB0;
  }else{
    /* If both iA1 and iB1 are non-zero, overflow will result */
    return 1;
  }
  testcase( r==(-TWOPOWER31)-1 );
  testcase( r==(-TWOPOWER31) );
  testcase( r==TWOPOWER31 );
  testcase( r==TWOPOWER31-1 );
  if( r<(-TWOPOWER31) || r>=TWOPOWER31 ) return 1;
  r *= TWOPOWER32;
  if( sqlite3AddInt64(&r, iA0*iB0) ) return 1;
  *pA = r;
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movabsq $0x1ffffffff, %r11      # imm = 0x1FFFFFFFF
movq (%rdi), %rcx
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
leaq (%rcx,%rbx), %rax
testq %rcx, %rcx
movq %rcx, %r10
cmovsq %rax, %r10
movabsq $-0x100000000, %r14     # imm = 0xFFFFFFFF00000000
movq %r10, %r8
andq %r14, %r8
movq %rcx, %rdx
subq %r8, %rdx
addq %rsi, %rbx
testq %rsi, %rsi
movq %rsi, %r9
cmovsq %rbx, %r9
andq %r9, %r14
movq %rsi, %r8
subq %r14, %r8
cmpq %r11, %rax
jae 0x329e1
cmpq %r11, %rbx
jae 0x329fc
imulq %rsi, %rcx
jmp 0x32a6d
movl $0x1, %eax
cmpq %r11, %rbx
jae 0x32a72
sarq $0x20, %r10
imulq %r8, %r10
movq %r10, %r9
jmp 0x32a04
sarq $0x20, %r9
imulq %rdx, %r9
movslq %r9d, %rcx
movl $0x1, %eax
cmpq %r9, %rcx
jne 0x32a72
movq %r9, %rcx
shlq $0x20, %rcx
imulq %r8, %rdx
testq %rdx, %rdx
js 0x32a45
testq %r9, %r9
setg %sil
movabsq $0x7fffffffffffffff, %r8 # imm = 0x7FFFFFFFFFFFFFFF
subq %rcx, %r8
cmpq %rdx, %r8
setl %r8b
testb %r8b, %sil
je 0x32a64
xorl %edx, %edx
jmp 0x32a69
testq %r9, %r9
jns 0x32a64
movabsq $0x7fffffffffffffff, %rsi # imm = 0x7FFFFFFFFFFFFFFF
subq %rcx, %rsi
addq $0x2, %rsi
leaq 0x1(%rdx), %r8
cmpq %r8, %rsi
jg 0x32a41
addq %rdx, %rcx
movb $0x1, %dl
testb %dl, %dl
je 0x32a72
movq %rcx, (%rdi)
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: applyAffinity
static void applyAffinity(
  Mem *pRec,          /* The value to apply affinity to */
  char affinity,      /* The affinity to be applied */
  u8 enc              /* Use this text encoding */
){
  if( affinity>=SQLITE_AFF_NUMERIC ){
    assert( affinity==SQLITE_AFF_INTEGER || affinity==SQLITE_AFF_REAL
             || affinity==SQLITE_AFF_NUMERIC );
    if( (pRec->flags & MEM_Int)==0 ){
      if( (pRec->flags & MEM_Real)==0 ){
        if( pRec->flags & MEM_Str ) applyNumericAffinity(pRec,1);
      }else{
        sqlite3VdbeIntegerAffinity(pRec);
      }
    }
  }else if( affinity==SQLITE_AFF_TEXT ){
    /* Only attempt the conversion to TEXT if there is an integer or real
    ** representation (blob and NULL do not get converted) but no string
    ** representation.
    */
    if( 0==(pRec->flags&MEM_Str) && (pRec->flags&(MEM_Real|MEM_Int)) ){
      sqlite3VdbeMemStringify(pRec, enc, 1);
    }
    pRec->flags &= ~(MEM_Real|MEM_Int);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpb $0x43, %sil
jl 0x32b1a
movzwl 0x8(%rbx), %eax
testb $0x4, %al
jne 0x32b48
testb $0x8, %al
jne 0x32b4f
testb $0x2, %al
je 0x32b48
movq %rbx, %rdi
movl $0x1, %esi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x13dc7
cmpb $0x42, %sil
jne 0x32b48
movzwl 0x8(%rbx), %eax
movl %eax, %ecx
andl $0x2, %ecx
shrl %ecx
testb $0xc, %al
sete %al
orb %cl, %al
jne 0x32b44
movzbl %dl, %esi
movq %rbx, %rdi
movl $0x1, %edx
callq 0x2a9b7
andb $-0xd, 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x32a77
// File: /workspace/github_c_makefile_star2_O1/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: sqlite3VdbeMemCast
SQLITE_PRIVATE void sqlite3VdbeMemCast(Mem *pMem, u8 aff, u8 encoding){
  if( pMem->flags & MEM_Null ) return;
  switch( aff ){
    case SQLITE_AFF_BLOB: {   /* Really a cast to BLOB */
      if( (pMem->flags & MEM_Blob)==0 ){
        sqlite3ValueApplyAffinity(pMem, SQLITE_AFF_TEXT, encoding);
        assert( pMem->flags & MEM_Str || pMem->db->mallocFailed );
        MemSetTypeFlag(pMem, MEM_Blob);
      }else{
        pMem->flags &= ~(MEM_TypeMask&~MEM_Blob);
      }
      break;
    }
    case SQLITE_AFF_NUMERIC: {
      sqlite3VdbeMemNumerify(pMem);
      break;
    }
    case SQLITE_AFF_INTEGER: {
      sqlite3VdbeMemIntegerify(pMem);
      break;
    }
    case SQLITE_AFF_REAL: {
      sqlite3VdbeMemRealify(pMem);
      break;
    }
    default: {
      assert( aff==SQLITE_AFF_TEXT );
      assert( MEM_Str==(MEM_Blob>>3) );
      pMem->flags |= (pMem->flags&MEM_Blob)>>3;
      sqlite3ValueApplyAffinity(pMem, SQLITE_AFF_TEXT, encoding);
      assert( pMem->flags & MEM_Str || pMem->db->mallocFailed );
      pMem->flags &= ~(MEM_Int|MEM_Real|MEM_Blob|MEM_Zero);
      break;
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movzwl 0x8(%rdi), %eax
testb $0x1, %al
jne 0x32c21
movq %rdi, %rbx
movzbl %sil, %ecx
addl $-0x41, %ecx
cmpl $0x4, %ecx
ja 0x32bf2
leaq 0x46b6f(%rip), %rsi     # 0x796f4
movslq (%rsi,%rcx,4), %rcx
addq %rsi, %rcx
jmpq *%rcx
testb $0x10, %al
jne 0x32c18
movzbl %dl, %edx
movq %rbx, %rdi
movl $0x42, %esi
callq 0x32ae8
movl $0xffffbe00, %eax       # imm = 0xFFFFBE00
andl 0x8(%rbx), %eax
orl $0x10, %eax
jmp 0x32c1d
movq %rbx, %rdi
callq 0x11797
movq %rax, (%rbx)
movl $0xffffbe00, %eax       # imm = 0xFFFFBE00
andl 0x8(%rbx), %eax
orl $0x4, %eax
jmp 0x32c1d
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x36da7
movq %rbx, %rdi
callq 0x1173f
movsd %xmm0, (%rbx)
movl $0xffffbe00, %eax       # imm = 0xFFFFBE00
andl 0x8(%rbx), %eax
orl $0x8, %eax
jmp 0x32c1d
movl %eax, %ecx
shrl $0x3, %ecx
andl $0x2, %ecx
orl %eax, %ecx
movw %cx, 0x8(%rbx)
movzbl %dl, %edx
movq %rbx, %rdi
movl $0x42, %esi
callq 0x32ae8
andw $0xbfe3, 0x8(%rbx)      # imm = 0xBFE3
jmp 0x32c21
andl $0xfe10, %eax           # imm = 0xFE10
movw %ax, 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: sqlite3VdbeCursorMoveto
SQLITE_PRIVATE int sqlite3VdbeCursorMoveto(VdbeCursor *p){
  if( p->eCurType==CURTYPE_BTREE ){
    if( p->deferredMoveto ){
      return handleDeferredMoveto(p);
    }
    if( sqlite3BtreeCursorHasMoved(p->uc.pCursor) ){
      return handleMovedCursor(p);
    }
  }
  return SQLITE_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
cmpb $0x0, (%rdi)
je 0x32d45
xorl %eax, %eax
popq %rbp
retq
cmpb $0x0, 0x3(%rdi)
je 0x32d51
popq %rbp
jmp 0x36f96
movq 0x10(%rdi), %rax
cmpb $0x1, 0x56(%rax)
je 0x32d41
popq %rbp
jmp 0x37007