LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: unixUnlock
static int unixUnlock(sqlite3_file *id, int eFileLock){
#if SQLITE_MAX_MMAP_SIZE>0
  assert( eFileLock==SHARED_LOCK || ((unixFile *)id)->nFetchOut==0 );
#endif
  return posixUnlock(id, eFileLock, 0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movzbl 0x1c(%rdi), %eax
xorl %r15d, %r15d
cmpl %esi, %eax
jle 0x1a5a0
movl %esi, %ebx
movq %rdi, %r14
leaq 0x1c(%rdi), %r12
callq 0x1b179
movq 0x10(%r14), %r13
cmpb $0x2, 0x1c(%r14)
jb 0x1a52f
cmpl $0x1, %ebx
jne 0x1a4ee
leaq -0x48(%rbp), %rsi
andl $0x0, (%rsi)
movslq 0x693b4(%rip), %rax     # 0x83870
addq $0x2, %rax
movq %rax, 0x8(%rsi)
movq $0x1fe, 0x10(%rsi)      # imm = 0x1FE
movq %r14, %rdi
callq 0x1b632
testl %eax, %eax
je 0x1a4ee
callq 0xa0b0
movl (%rax), %eax
movl %eax, 0x20(%r14)
movl $0x90a, %r15d           # imm = 0x90A
jmp 0x1a58f
leaq -0x48(%rbp), %rsi
movl $0x2, (%rsi)
movslq 0x69371(%rip), %rax     # 0x83870
movq %rax, 0x8(%rsi)
movq $0x2, 0x10(%rsi)
movq %r14, %rdi
callq 0x1b632
testl %eax, %eax
je 0x1a52a
callq 0xa0b0
movl (%rax), %eax
movl %eax, 0x20(%r14)
movl $0x80a, %r15d           # imm = 0x80A
jmp 0x1a58f
movb $0x1, 0x14(%r13)
xorl %r15d, %r15d
testl %ebx, %ebx
jne 0x1a58f
xorl %r15d, %r15d
decl 0x10(%r13)
jne 0x1a581
leaq -0x48(%rbp), %rsi
movl $0x2, (%rsi)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rsi)
movq %r14, %rdi
callq 0x1b632
testl %eax, %eax
je 0x1a577
callq 0xa0b0
movl (%rax), %eax
movl %eax, 0x20(%r14)
movb $0x0, 0x14(%r13)
movl $0x80a, %r15d           # imm = 0x80A
movq %r12, %rax
jmp 0x1a57e
leaq 0x14(%r13), %rax
xorl %r15d, %r15d
movb $0x0, (%rax)
decl 0x28(%r13)
jne 0x1a58f
movq %r14, %rdi
callq 0x1b4b3
callq 0x1b1f4
testl %r15d, %r15d
jne 0x1a5a0
movb %bl, (%r12)
xorl %r15d, %r15d
movl %r15d, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: verifyDbFile
static void verifyDbFile(unixFile *pFile){
  struct stat buf;
  int rc;
  rc = osFstat(pFile->h, &buf);
  if( rc!=0 ){
    sqlite3_log(SQLITE_WARNING, "cannot fstat db file %s", pFile->zPath);
    return;
  }
  if( buf.st_nlink==0 && (pFile->ctrlFlags & UNIXFILE_DELETE)==0 ){
    sqlite3_log(SQLITE_WARNING, "file unlinked while open: %s", pFile->zPath);
    return;
  }
  if( buf.st_nlink>1 ){
    sqlite3_log(SQLITE_WARNING, "multiple links to file: %s", pFile->zPath);
    return;
  }
  if( fileHasMoved(pFile) ){
    sqlite3_log(SQLITE_WARNING, "file renamed while open: %s", pFile->zPath);
    return;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x98, %rsp
movq %rdi, %rbx
movl 0x18(%rdi), %edi
leaq -0x98(%rbp), %rsi
callq *0x687e9(%rip)          # 0x83900
testl %eax, %eax
je 0x1b13a
leaq 0x510ee(%rip), %rsi     # 0x6c210
movq 0x38(%rbx), %rdx
pushq $0x1c
popq %rdi
xorl %eax, %eax
callq 0xa630
addq $0x98, %rsp
popq %rbx
popq %rbp
retq
movq -0x88(%rbp), %rax
cmpq $0x1, %rax
je 0x1b15b
testq %rax, %rax
jne 0x1b170
testb $0x20, 0x1e(%rbx)
jne 0x1b15b
leaq 0x510cf(%rip), %rsi     # 0x6c228
jmp 0x1b122
movq %rbx, %rdi
callq 0x1b21b
testl %eax, %eax
je 0x1b130
leaq 0x510f2(%rip), %rsi     # 0x6c260
jmp 0x1b122
leaq 0x510ce(%rip), %rsi     # 0x6c245
jmp 0x1b122
// File: /workspace/github_c_makefile_star2_O2/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: unixFileLock
static int unixFileLock(unixFile *pFile, struct flock *pLock){
  int rc;
  unixInodeInfo *pInode = pFile->pInode;
  assert( unixMutexHeld() );
  assert( pInode!=0 );
  if( (pFile->ctrlFlags & (UNIXFILE_EXCL|UNIXFILE_RDONLY))==UNIXFILE_EXCL ){
    if( pInode->bProcessLock==0 ){
      struct flock lock;
      assert( pInode->nLock==0 );
      lock.l_whence = SEEK_SET;
      lock.l_start = SHARED_FIRST;
      lock.l_len = SHARED_SIZE;
      lock.l_type = F_WRLCK;
      rc = osFcntl(pFile->h, F_SETLK, &lock);
      if( rc<0 ) return rc;
      pInode->bProcessLock = 1;
      pInode->nLock++;
    }else{
      rc = 0;
    }
  }else{
    rc = osFcntl(pFile->h, F_SETLK, pLock);
  }
  return rc;
}

// Assembly:
movzwl 0x1e(%rdi), %eax
andl $0x3, %eax
cmpw $0x1, %ax
jne 0x1b695
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x28, %rsp
movq 0x10(%rdi), %rbx
xorl %eax, %eax
cmpb $0x0, 0x15(%rbx)
jne 0x1b68e
movslq 0x68215(%rip), %rax     # 0x83870
addq $0x2, %rax
leaq -0x28(%rbp), %rdx
movq %rax, 0x8(%rdx)
movq $0x1fe, 0x10(%rdx)      # imm = 0x1FE
movl $0x1, (%rdx)
movl 0x18(%rdi), %edi
pushq $0x6
popq %rsi
xorl %eax, %eax
callq *0x682ad(%rip)          # 0x83930
testl %eax, %eax
js 0x1b68e
movb $0x1, 0x15(%rbx)
incl 0x28(%rbx)
addq $0x28, %rsp
popq %rbx
popq %rbp
retq
movq %rsi, %rdx
movq 0x68291(%rip), %rcx     # 0x83930
movl 0x18(%rdi), %edi
pushq $0x6
popq %rsi
xorl %eax, %eax
jmpq *%rcx
// File: /workspace/github_c_makefile_star2_O2/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: unixShmPurge
static void unixShmPurge(unixFile *pFd){
  unixShmNode *p = pFd->pInode->pShmNode;
  assert( unixMutexHeld() );
  if( p && ALWAYS(p->nRef==0) ){
    int nShmPerMap = unixShmRegionPerMap();
    int i;
    assert( p->pInode==pFd->pInode );
    sqlite3_mutex_free(p->mutex);
    for(i=0; i<p->nRegion; i+=nShmPerMap){
      if( p->h>=0 ){
        osMunmap(p->apRegion[i], p->szRegion);
      }else{
        sqlite3_free(p->apRegion[i]);
      }
    }
    sqlite3_free(p->apRegion);
    if( p->h>=0 ){
      robust_close(pFd, p->h, __LINE__);
      p->h = -1;
    }
    p->pInode->pShmNode = 0;
    sqlite3_free(p);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq 0x10(%rdi), %rax
movq 0x20(%rax), %rbx
testq %rbx, %rbx
je 0x1b9f0
cmpl $0x0, 0x30(%rbx)
je 0x1b9f9
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rdi, %r14
callq *0x680de(%rip)          # 0x83ae0
movl %eax, %ecx
shrl $0xf, %ecx
cmpl $0x8000, %eax           # imm = 0x8000
pushq $0x1
popq %r15
cmovgel %ecx, %r15d
movq 0x8(%rbx), %rdi
testq %rdi, %rdi
je 0x1ba23
callq *0x67a7d(%rip)          # 0x834a0
movl %r15d, %r15d
xorl %r12d, %r12d
movzwl 0x20(%rbx), %eax
cmpq %rax, %r12
jae 0x1ba5e
cmpl $0x0, 0x18(%rbx)
js 0x1ba4c
movq 0x28(%rbx), %rax
movq (%rax,%r12,8), %rdi
movslq 0x1c(%rbx), %rsi
callq *0x68066(%rip)          # 0x83ab0
jmp 0x1ba59
movq 0x28(%rbx), %rax
movq (%rax,%r12,8), %rdi
callq 0xa828
addq %r15, %r12
jmp 0x1ba29
movq 0x28(%rbx), %rdi
callq 0xa828
movl 0x18(%rbx), %esi
testl %esi, %esi
js 0x1ba7f
movq %r14, %rdi
movl $0x79e1, %edx           # imm = 0x79E1
callq 0x1b4fd
orl $-0x1, 0x18(%rbx)
movq (%rbx), %rax
andq $0x0, 0x20(%rax)
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0xa828
// File: /workspace/github_c_makefile_star2_O2/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: sqlite3VMPrintf
SQLITE_PRIVATE char *sqlite3VMPrintf(sqlite3 *db, const char *zFormat, va_list ap){
  char *z;
  char zBase[SQLITE_PRINT_BUF_SIZE];
  StrAccum acc;
  assert( db!=0 );
  sqlite3StrAccumInit(&acc, db, zBase, sizeof(zBase),
                      db->aLimit[SQLITE_LIMIT_LENGTH]);
  sqlite3VXPrintf(&acc, SQLITE_PRINTF_INTERNAL, zFormat, ap);
  z = sqlite3StrAccumFinish(&acc);
  if( acc.accError==STRACCUM_NOMEM ){
    db->mallocFailed = 1;
  }
  return z;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x70, %rsp
movq %rdx, %rcx
movq %rsi, %rdx
movq %rdi, %rbx
movl 0x68(%rdi), %eax
leaq -0x80(%rbp), %rsi
leaq -0x38(%rbp), %r14
movq %rsi, 0x8(%r14)
movq %rsi, 0x10(%r14)
movq %rdi, (%r14)
movabsq $0x4600000000, %rsi     # imm = 0x4600000000
movq %rsi, 0x18(%r14)
movl %eax, 0x20(%r14)
andw $0x0, 0x24(%r14)
pushq $0x1
popq %rsi
movq %r14, %rdi
callq 0xc52a
movq %r14, %rdi
callq 0xd700
cmpb $0x1, 0x24(%r14)
jne 0x1bc51
movb $0x1, 0x51(%rbx)
addq $0x70, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: sqlite3PcacheSetPageSize
SQLITE_PRIVATE int sqlite3PcacheSetPageSize(PCache *pCache, int szPage){
  assert( pCache->nRefSum==0 && pCache->pDirty==0 );
  if( pCache->szPage ){
    sqlite3_pcache *pNew;
    pNew = sqlite3GlobalConfig.pcache2.xCreate(
                szPage, pCache->szExtra + ROUND8(sizeof(PgHdr)),
                pCache->bPurgeable
    );
    if( pNew==0 ) return SQLITE_NOMEM;
    sqlite3GlobalConfig.pcache2.xCachesize(pNew, numberOfCachePages(pCache));
    if( pCache->pCache ){
      sqlite3GlobalConfig.pcache2.xDestroy(pCache->pCache);
    }
    pCache->pCache = pNew;
    pCache->szPage = szPage;
  }
  return SQLITE_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
xorl %ebx, %ebx
cmpl $0x0, 0x24(%rdi)
je 0x1ce2a
movl %esi, %r14d
movq %rdi, %r15
movl 0x28(%rdi), %esi
addl $0x48, %esi
movzbl 0x2c(%rdi), %edx
movl %r14d, %edi
callq *0x66701(%rip)          # 0x834f0
testq %rax, %rax
je 0x1ce27
movq %rax, %r12
movq 0x666fa(%rip), %r13     # 0x834f8
movq %r15, %rdi
callq 0x1ce3b
movq %r12, %rdi
movl %eax, %esi
callq *%r13
movq 0x40(%r15), %rdi
testq %rdi, %rdi
je 0x1ce1d
callq *0x6670b(%rip)          # 0x83528
movq %r12, 0x40(%r15)
movl %r14d, 0x24(%r15)
jmp 0x1ce2a
pushq $0x7
popq %rbx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: sqlite3PcacheMakeClean
SQLITE_PRIVATE void sqlite3PcacheMakeClean(PgHdr *p){
  if( (p->flags & PGHDR_DIRTY) ){
    assert( (p->flags & PGHDR_CLEAN)==0 );
    pcacheManageDirtyList(p, PCACHE_DIRTYLIST_REMOVE);
    p->flags &= ~(PGHDR_DIRTY|PGHDR_NEED_SYNC|PGHDR_WRITEABLE);
    p->flags |= PGHDR_CLEAN;
    if( p->nRef==0 ){
      pcacheUnpin(p);
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
testb $0x2, 0x2c(%rdi)
je 0x1d76c
movq %rdi, %rbx
pushq $0x1
popq %rsi
callq 0x1eed7
movl 0x2c(%rbx), %eax
andl $-0x10, %eax
incl %eax
movw %ax, 0x2c(%rbx)
cmpw $0x0, 0x2e(%rbx)
je 0x1d773
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x1ef7c
// File: /workspace/github_c_makefile_star2_O2/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: pcacheManageDirtyList
static void pcacheManageDirtyList(PgHdr *pPage, u8 addRemove){
  PCache *p = pPage->pCache;

  if( addRemove & PCACHE_DIRTYLIST_REMOVE ){
    assert( pPage->pDirtyNext || pPage==p->pDirtyTail );
    assert( pPage->pDirtyPrev || pPage==p->pDirty );
  
    /* Update the PCache1.pSynced variable if necessary. */
    if( p->pSynced==pPage ){
      PgHdr *pSynced = pPage->pDirtyPrev;
      while( pSynced && (pSynced->flags&PGHDR_NEED_SYNC) ){
        pSynced = pSynced->pDirtyPrev;
      }
      p->pSynced = pSynced;
    }
  
    if( pPage->pDirtyNext ){
      pPage->pDirtyNext->pDirtyPrev = pPage->pDirtyPrev;
    }else{
      assert( pPage==p->pDirtyTail );
      p->pDirtyTail = pPage->pDirtyPrev;
    }
    if( pPage->pDirtyPrev ){
      pPage->pDirtyPrev->pDirtyNext = pPage->pDirtyNext;
    }else{
      assert( pPage==p->pDirty );
      p->pDirty = pPage->pDirtyNext;
      if( p->pDirty==0 && p->bPurgeable ){
        assert( p->eCreate==1 );
        p->eCreate = 2;
      }
    }
    pPage->pDirtyNext = 0;
    pPage->pDirtyPrev = 0;
  }
  if( addRemove & PCACHE_DIRTYLIST_ADD ){
    assert( pPage->pDirtyNext==0 && pPage->pDirtyPrev==0 && p->pDirty!=pPage );
  
    pPage->pDirtyNext = p->pDirty;
    if( pPage->pDirtyNext ){
      assert( pPage->pDirtyNext->pDirtyPrev==0 );
      pPage->pDirtyNext->pDirtyPrev = pPage;
    }else{
      p->pDirtyTail = pPage;
      if( p->bPurgeable ){
        assert( p->eCreate==2 );
        p->eCreate = 1;
      }
    }
    p->pDirty = pPage;
    if( !p->pSynced && 0==(pPage->flags&PGHDR_NEED_SYNC) ){
      p->pSynced = pPage;
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq 0x30(%rdi), %rax
testb $0x1, %sil
je 0x1ef30
cmpq %rdi, 0x10(%rax)
jne 0x1ef01
movq %rdi, %rcx
movq 0x40(%rcx), %rcx
testq %rcx, %rcx
je 0x1eefd
testb $0x8, 0x2c(%rcx)
jne 0x1eeee
movq %rcx, 0x10(%rax)
movq 0x38(%rdi), %rcx
movq 0x40(%rdi), %rdx
testq %rcx, %rcx
je 0x1ef1c
movq %rdx, 0x40(%rcx)
testq %rdx, %rdx
jne 0x1ef25
movq %rcx, (%rax)
jmp 0x1ef29
movq %rdx, 0x8(%rax)
testq %rdx, %rdx
je 0x1ef6c
movq %rcx, 0x38(%rdx)
xorps %xmm0, %xmm0
movups %xmm0, 0x38(%rdi)
testb $0x2, %sil
je 0x1ef6a
movq (%rax), %rcx
movq %rcx, 0x38(%rdi)
testq %rcx, %rcx
je 0x1ef48
movq %rdi, 0x40(%rcx)
jmp 0x1ef56
movq %rdi, 0x8(%rax)
cmpb $0x0, 0x2c(%rax)
je 0x1ef56
movb $0x1, 0x2d(%rax)
movq %rdi, (%rax)
cmpq $0x0, 0x10(%rax)
jne 0x1ef6a
testb $0x8, 0x2c(%rdi)
jne 0x1ef6a
movq %rdi, 0x10(%rax)
popq %rbp
retq
andq $0x0, (%rax)
cmpb $0x0, 0x2c(%rax)
je 0x1ef29
movb $0x2, 0x2d(%rax)
jmp 0x1ef29
// File: /workspace/github_c_makefile_star2_O2/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: decodeFlags
static int decodeFlags(MemPage *pPage, int flagByte){
  BtShared *pBt;     /* A copy of pPage->pBt */

  assert( pPage->hdrOffset==(pPage->pgno==1 ? 100 : 0) );
  assert( sqlite3_mutex_held(pPage->pBt->mutex) );
  pPage->leaf = (u8)(flagByte>>3);  assert( PTF_LEAF == 1<<3 );
  flagByte &= ~PTF_LEAF;
  pPage->childPtrSize = 4-4*pPage->leaf;
  pPage->xCellSize = cellSizePtr;
  pBt = pPage->pBt;
  if( flagByte==(PTF_LEAFDATA | PTF_INTKEY) ){
    /* EVIDENCE-OF: R-03640-13415 A value of 5 means the page is an interior
    ** table b-tree page. */
    assert( (PTF_LEAFDATA|PTF_INTKEY)==5 );
    /* EVIDENCE-OF: R-20501-61796 A value of 13 means the page is a leaf
    ** table b-tree page. */
    assert( (PTF_LEAFDATA|PTF_INTKEY|PTF_LEAF)==13 );
    pPage->intKey = 1;
    if( pPage->leaf ){
      pPage->intKeyLeaf = 1;
      pPage->noPayload = 0;
      pPage->xParseCell = btreeParseCellPtr;
    }else{
      pPage->intKeyLeaf = 0;
      pPage->noPayload = 1;
      pPage->xCellSize = cellSizePtrNoPayload;
      pPage->xParseCell = btreeParseCellPtrNoPayload;
    }
    pPage->maxLocal = pBt->maxLeaf;
    pPage->minLocal = pBt->minLeaf;
  }else if( flagByte==PTF_ZERODATA ){
    /* EVIDENCE-OF: R-27225-53936 A value of 2 means the page is an interior
    ** index b-tree page. */
    assert( (PTF_ZERODATA)==2 );
    /* EVIDENCE-OF: R-16571-11615 A value of 10 means the page is a leaf
    ** index b-tree page. */
    assert( (PTF_ZERODATA|PTF_LEAF)==10 );
    pPage->intKey = 0;
    pPage->intKeyLeaf = 0;
    pPage->noPayload = 0;
    pPage->xParseCell = btreeParseCellPtrIndex;
    pPage->maxLocal = pBt->maxLocal;
    pPage->minLocal = pBt->minLocal;
  }else{
    /* EVIDENCE-OF: R-47608-56469 Any other value for the b-tree page type is
    ** an error. */
    return SQLITE_CORRUPT_BKPT;
  }
  pPage->max1bytePayload = pBt->max1bytePayload;
  return SQLITE_OK;
}

// Assembly:
movl %esi, %r8d
shrl $0x3, %r8d
movb %r8b, 0x5(%rdi)
andl $-0x9, %esi
movl %r8d, %eax
shll $0x2, %eax
movb $0x4, %cl
subb %al, %cl
movb %cl, 0x7(%rdi)
leaq 0x99(%rip), %rax        # 0x1f35e
movq %rax, 0x78(%rdi)
movq 0x48(%rdi), %rax
cmpl $0x2, %esi
je 0x1f2f2
cmpl $0x5, %esi
jne 0x1f331
movb $0x1, 0x2(%rdi)
pushq $0x2e
popq %rcx
pushq $0x2c
popq %rdx
testb %r8b, %r8b
je 0x1f344
leaq 0x125(%rip), %rsi       # 0x1f412
movb $0x1, %r8b
jmp 0x1f306
movb $0x0, 0x2(%rdi)
pushq $0x2a
popq %rcx
pushq $0x28
popq %rdx
leaq 0x22e(%rip), %rsi       # 0x1f531
xorl %r8d, %r8d
xorl %r9d, %r9d
movb %r8b, 0x3(%rdi)
movb %r9b, 0x4(%rdi)
movq %rsi, 0x80(%rdi)
movzwl (%rax,%rdx), %edx
movw %dx, 0xa(%rdi)
movzwl (%rax,%rcx), %ecx
movw %cx, 0xc(%rdi)
movb 0x25(%rax), %al
movb %al, 0x8(%rdi)
xorl %eax, %eax
retq
pushq %rbp
movq %rsp, %rbp
movl $0xde05, %edi           # imm = 0xDE05
callq 0x1ec07
pushq $0xb
popq %rax
popq %rbp
retq
leaq 0x190(%rip), %rsi       # 0x1f4db
movq %rsi, 0x78(%rdi)
leaq 0x1a8(%rip), %rsi       # 0x1f4fe
movb $0x1, %r9b
xorl %r8d, %r8d
jmp 0x1f309
// File: /workspace/github_c_makefile_star2_O2/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: btreeParseCellPtrNoPayload
static void btreeParseCellPtrNoPayload(
  MemPage *pPage,         /* Page containing the cell */
  u8 *pCell,              /* Pointer to the cell text. */
  CellInfo *pInfo         /* Fill in this structure */
){
  assert( sqlite3_mutex_held(pPage->pBt->mutex) );
  assert( pPage->leaf==0 );
  assert( pPage->noPayload );
  assert( pPage->childPtrSize==4 );
#ifndef SQLITE_DEBUG
  UNUSED_PARAMETER(pPage);
#endif
  pInfo->nSize = 4 + getVarint(&pCell[4], (u64*)&pInfo->nKey);
  pInfo->nPayload = 0;
  pInfo->nLocal = 0;
  pInfo->pPayload = 0;
  return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdx, %rbx
leaq 0x4(%rsi), %rdi
movq %rdx, %rsi
callq 0x1f5ed
addb $0x4, %al
movzbl %al, %eax
movw %ax, 0x16(%rbx)
andl $0x0, 0x10(%rbx)
andw $0x0, 0x14(%rbx)
andq $0x0, 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: sqlite3PcacheTruncate
SQLITE_PRIVATE void sqlite3PcacheTruncate(PCache *pCache, Pgno pgno){
  if( pCache->pCache ){
    PgHdr *p;
    PgHdr *pNext;
    for(p=pCache->pDirty; p; p=pNext){
      pNext = p->pDirtyNext;
      /* This routine never gets call with a positive pgno except right
      ** after sqlite3PcacheCleanAll().  So if there are dirty pages,
      ** it must be that pgno==0.
      */
      assert( p->pgno>0 );
      if( ALWAYS(p->pgno>pgno) ){
        assert( p->flags&PGHDR_DIRTY );
        sqlite3PcacheMakeClean(p);
      }
    }
    if( pgno==0 && pCache->nRefSum ){
      sqlite3_pcache_page *pPage1;
      pPage1 = sqlite3GlobalConfig.pcache2.xFetch(pCache->pCache,1,0);
      if( ALWAYS(pPage1) ){  /* Page 1 is always available in cache, because
                             ** pCache->nRefSum>0 */
        memset(pPage1->pBuf, 0, pCache->szPage);
        pgno = 1;
      }
    }
    sqlite3GlobalConfig.pcache2.xTruncate(pCache->pCache, pgno+1);
  }
}

// Assembly:
cmpq $0x0, 0x40(%rdi)
je 0x1f943
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %r14d
movq %rdi, %rbx
movq (%rdi), %r15
testq %r15, %r15
je 0x1f921
movq %r15, %rdi
movq 0x38(%r15), %r15
cmpl %r14d, 0x28(%rdi)
jbe 0x1f908
callq 0x1d742
jmp 0x1f908
testl %r14d, %r14d
je 0x1f944
movq 0x63bf3(%rip), %rax     # 0x83520
movq 0x40(%rbx), %rdi
incl %r14d
movl %r14d, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmpq *%rax
retq
cmpl $0x0, 0x18(%rbx)
je 0x1f978
movq 0x40(%rbx), %rdi
pushq $0x1
popq %r15
xorl %r14d, %r14d
movl %r15d, %esi
xorl %edx, %edx
callq *0x63ba8(%rip)          # 0x83508
testq %rax, %rax
je 0x1f926
movq (%rax), %rdi
movslq 0x24(%rbx), %rdx
xorl %esi, %esi
callq 0xa270
movl %r15d, %r14d
jmp 0x1f926
xorl %r14d, %r14d
jmp 0x1f926
// File: /workspace/github_c_makefile_star2_O2/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: sqlite3PcacheDrop
SQLITE_PRIVATE void sqlite3PcacheDrop(PgHdr *p){
  assert( p->nRef==1 );
  if( p->flags&PGHDR_DIRTY ){
    pcacheManageDirtyList(p, PCACHE_DIRTYLIST_REMOVE);
  }
  p->pCache->nRefSum--;
  sqlite3GlobalConfig.pcache2.xUnpin(p->pCache->pCache, p->pPage, 1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
testb $0x2, 0x2c(%rdi)
je 0x21ac4
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x1eed7
movq 0x30(%rbx), %rax
decl 0x18(%rax)
movq 0x61a3e(%rip), %rcx     # 0x83510
movq 0x40(%rax), %rdi
movq (%rbx), %rsi
pushq $0x1
popq %rdx
addq $0x8, %rsp
popq %rbx
popq %rbp
jmpq *%rcx
// File: /workspace/github_c_makefile_star2_O2/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: sqlite3PagerUnrefNotNull
SQLITE_PRIVATE void sqlite3PagerUnrefNotNull(DbPage *pPg){
  Pager *pPager;
  assert( pPg!=0 );
  pPager = pPg->pPager;
  if( pPg->flags & PGHDR_MMAP ){
    pagerReleaseMapPage(pPg);
  }else{
    sqlite3PcacheRelease(pPg);
  }
  pagerUnlockIfUnused(pPager);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq 0x20(%rdi), %rbx
testb $0x40, 0x2c(%rdi)
jne 0x21cc8
callq 0x21da8
jmp 0x21d04
decl 0x98(%rbx)
movq 0xa8(%rbx), %rax
movq %rax, 0x18(%rdi)
movq %rdi, 0xa8(%rbx)
movq 0x48(%rbx), %rax
movl 0x28(%rdi), %ecx
decl %ecx
movslq 0xbc(%rbx), %rsi
imulq %rcx, %rsi
movq 0x8(%rdi), %rdx
movq (%rax), %rcx
movq %rax, %rdi
callq *0x90(%rcx)
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x21dd9
// File: /workspace/github_c_makefile_star2_O2/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: pcacheFetchFinishWithInit
static SQLITE_NOINLINE PgHdr *pcacheFetchFinishWithInit(
  PCache *pCache,             /* Obtain the page from this cache */
  Pgno pgno,                  /* Page number obtained */
  sqlite3_pcache_page *pPage  /* Page obtained by prior PcacheFetch() call */
){
  PgHdr *pPgHdr;
  assert( pPage!=0 );
  pPgHdr = (PgHdr*)pPage->pExtra;
  assert( pPgHdr->pPage==0 );
  memset(pPgHdr, 0, sizeof(PgHdr));
  pPgHdr->pPage = pPage;
  pPgHdr->pData = pPage->pBuf;
  pPgHdr->pExtra = (void *)&pPgHdr[1];
  memset(pPgHdr->pExtra, 0, pCache->szExtra);
  pPgHdr->pCache = pCache;
  pPgHdr->pgno = pgno;
  pPgHdr->flags = PGHDR_CLEAN;
  return sqlite3PcacheFetchFinish(pCache,pgno,pPage);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %rbx
movl %esi, %r14d
movq %rdi, %r15
movq 0x8(%rdx), %r12
xorps %xmm0, %xmm0
movups %xmm0, 0x38(%r12)
movups %xmm0, 0x28(%r12)
movups %xmm0, 0x18(%r12)
movups %xmm0, 0x8(%r12)
movq %rdx, (%r12)
movq (%rdx), %rax
movq %rax, 0x8(%r12)
leaq 0x48(%r12), %rdi
movq %rdi, 0x10(%r12)
movslq 0x28(%r15), %rdx
xorl %esi, %esi
callq 0xa270
movq %r15, 0x30(%r12)
movl %r14d, 0x28(%r12)
movw $0x1, 0x2c(%r12)
movq %r15, %rdi
movl %r14d, %esi
movq %rbx, %rdx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x21d12
// File: /workspace/github_c_makefile_star2_O2/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: sqlite3PcacheRelease
SQLITE_NOINLINE sqlite3PcacheRelease(PgHdr *p){
  assert( p->nRef>0 );
  p->pCache->nRefSum--;
  if( (--p->nRef)==0 ){
    if( p->flags&PGHDR_CLEAN ){
      pcacheUnpin(p);
    }else if( p->pDirtyPrev!=0 ){
      /* Move the page to the head of the dirty list. */
      pcacheManageDirtyList(p, PCACHE_DIRTYLIST_FRONT);
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq 0x30(%rdi), %rax
decl 0x18(%rax)
decw 0x2e(%rdi)
je 0x21dbb
popq %rbp
retq
testb $0x1, 0x2c(%rdi)
jne 0x21dd3
cmpq $0x0, 0x40(%rdi)
je 0x21db9
movl $0x3, %esi
popq %rbp
jmp 0x1eed7
popq %rbp
jmp 0x1ef7c
// File: /workspace/github_c_makefile_star2_O2/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 0x21ed0
movl %eax, %ecx
andl $0xffdf, %ecx           # imm = 0xFFDF
movw %cx, 0x2c(%rdi)
testb $0x1, %al
jne 0x21ed2
popq %rbp
retq
xorl $0x3, %ecx
movw %cx, 0x2c(%rdi)
movl $0x2, %esi
popq %rbp
jmp 0x1eed7
// File: /workspace/github_c_makefile_star2_O2/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 %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x8(%rdi), %rax
movq 0x50(%rax), %rdi
testq %rdi, %rdi
je 0x2218b
callq *0x61376(%rip)          # 0x834b0
testl %eax, %eax
je 0x22187
leaq 0x20(%rbx), %r14
movq %r14, %r15
movq (%r15), %r15
testq %r15, %r15
je 0x22162
cmpb $0x0, 0x12(%r15)
je 0x2215c
movq %r15, %rdi
callq 0x221a1
addq $0x20, %r15
jmp 0x22145
movq %rbx, %rdi
callq 0x221c8
movq (%r14), %r14
testq %r14, %r14
je 0x22196
cmpl $0x0, 0x14(%r14)
je 0x22181
movq %r14, %rdi
callq 0x221c8
addq $0x20, %r14
jmp 0x2216a
movq 0x8(%rbx), %rax
movq (%rbx), %rcx
movq %rcx, 0x8(%rax)
movb $0x1, 0x12(%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: unlockBtreeIfUnused
static void unlockBtreeIfUnused(BtShared *pBt){
  assert( sqlite3_mutex_held(pBt->mutex) );
  assert( countValidCursors(pBt,0)==0 || pBt->inTransaction>TRANS_NONE );
  if( pBt->inTransaction==TRANS_NONE && pBt->pPage1!=0 ){
    MemPage *pPage1 = pBt->pPage1;
    assert( pPage1->aData );
    assert( sqlite3PagerRefcount(pBt->pPager)==1 );
    pBt->pPage1 = 0;
    releasePageNotNull(pPage1);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
cmpb $0x0, 0x24(%rdi)
je 0x22328
popq %rbp
retq
movq 0x18(%rdi), %rax
testq %rax, %rax
je 0x22326
andq $0x0, 0x18(%rdi)
movq %rax, %rdi
popq %rbp
jmp 0x22b9c
// File: /workspace/github_c_makefile_star2_O2/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), %rax
testq %rax, %rax
je 0x22961
cmpw $0x0, 0x3c(%rax)
js 0x22961
movl 0x5c(%rax), %eax
testl %eax, %eax
jne 0x22998
andq $0x0, -0x18(%rbp)
movq 0x48(%r14), %rdi
movq (%rdi), %rax
testq %rax, %rax
je 0x22986
leaq -0x18(%rbp), %rsi
callq *0x30(%rax)
testl %eax, %eax
jne 0x229ac
movq -0x18(%rbp), %rax
decq %rax
jmp 0x22989
pushq $-0x1
popq %rax
movslq 0xbc(%r14), %rcx
addq %rcx, %rax
cqto
idivq %rcx
cmpl 0xc0(%r14), %eax
jbe 0x229a8
movl %eax, 0xc0(%r14)
movl %eax, (%rbx)
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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
leaq 0x38(%rdi), %r15
movq %r15, %rsi
callq 0x2368c
xorl %r14d, %r14d
cmpb $0x0, 0x59(%rbx)
je 0x23649
movl %r14d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq (%r15), %rdi
callq 0xc13f
testq %rax, %rax
je 0x23680
movq %rax, %r15
movl 0x38(%rbx), %edx
xorl %r14d, %r14d
movq %rbx, %rdi
xorl %esi, %esi
movq %rax, %rcx
callq 0x236aa
testl %eax, %eax
je 0x23686
movl %eax, %r12d
movq %r15, %rdi
callq 0xa828
movl %r12d, %r14d
jmp 0x2363d
pushq $0x7
popq %r14
jmp 0x2363d
movq %r15, 0x40(%rbx)
jmp 0x2363d
// File: /workspace/github_c_makefile_star2_O2/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: sqlite3BtreeKeySize
SQLITE_PRIVATE int sqlite3BtreeKeySize(BtCursor *pCur, i64 *pSize){
  assert( cursorHoldsMutex(pCur) );
  assert( pCur->eState==CURSOR_VALID );
  getCellInfo(pCur);
  *pSize = pCur->info.nKey;
  return SQLITE_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
callq 0x236b4
movq 0x20(%r14), %rax
movq %rax, (%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 *0x5ec13(%rip)          # 0x83518
movl %r14d, 0x28(%rbx)
movl 0x2c(%rbx), %eax
notl %eax
testb $0xa, %al
jne 0x24921
pushq $0x3
popq %rsi
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x1eed7
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x24a08
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 0x24a63
movzwl -0x22(%rbp), %eax
leaq (%r15,%rax), %rdi
addq $-0x4, %rdi
callq 0x1c9e4
movq 0x48(%r14), %rdi
movl 0x88(%r14), %ecx
pushq $0x3
popq %rdx
movl %eax, %esi
movq %rbx, %r8
callq 0x247e7
addq $0x20, %rsp
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: 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
pushq %rax
testq %rdi, %rdi
je 0x24b0c
movl %edx, %r15d
movl %esi, %r12d
movq %rdi, %rbx
callq 0xf01a
movq 0x8(%rbx), %r13
movq 0x10(%r13), %r13
testq %r13, %r13
je 0x24aff
testl %r15d, %r15d
je 0x24ac6
testb $0x1, 0x54(%r13)
jne 0x24ac6
movb 0x56(%r13), %al
decb %al
cmpb $0x1, %al
ja 0x24ad7
movq %r13, %rdi
callq 0x2359e
testl %eax, %eax
je 0x24ad7
jmp 0x24b21
movq %r13, %rdi
callq 0x24b32
movb $0x4, 0x56(%r13)
movl %r12d, 0x50(%r13)
xorl %r14d, %r14d
movsbq 0x58(%r13), %rax
cmpq %rax, %r14
jg 0x24a99
movq 0x98(%r13,%r14,8), %rdi
callq 0x228f1
andq $0x0, 0x98(%r13,%r14,8)
incq %r14
jmp 0x24ada
xorl %r14d, %r14d
movq %rbx, %rdi
callq 0x1034d
jmp 0x24b0f
xorl %r14d, %r14d
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %eax, %r14d
movq %rbx, %rdi
movl %eax, %esi
xorl %edx, %edx
callq 0x24a70
jmp 0x24b02
// File: /workspace/github_c_makefile_star2_O2/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 0x24cf4
addl $0x14, %esi
cmpl $0x13, %esi
ja 0x24cf4
movq %rdx, %rbx
movq %rdi, %r14
leaq 0x43773(%rip), %rax     # 0x683e4
movslq (%rax,%rsi,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %rbp
jmp 0xb856
cmpq $0x0, 0x328(%r14)
jne 0x24cf4
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x24d3d
cmpq $0x0, 0x328(%r14)
je 0x24cf9
cmpl $0x0, 0x20(%rbx)
je 0x24c7a
movq 0x18(%rbx), %rsi
movq %r14, %rdi
callq 0xb856
jmp 0x24c7a
movq 0x8(%rbx), %rsi
movq %r14, %rdi
callq 0x24d11
jmp 0x24c7a
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %rbp
jmp 0x24d11
cmpq $0x0, 0x328(%r14)
jne 0x24cf4
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x24d28
cmpq $0x0, 0x328(%r14)
je 0x24d05
popq %rbx
popq %r14
popq %rbp
retq
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x10e69
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0xa828
// File: /workspace/github_c_makefile_star2_O2/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: sqlite3KeyInfoUnref
SQLITE_PRIVATE void sqlite3KeyInfoUnref(KeyInfo *p){
  if( p ){
    assert( p->nRef>0 );
    p->nRef--;
    if( p->nRef==0 ) sqlite3DbFree(0, p);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
testq %rdi, %rdi
je 0x24d35
decl (%rdi)
je 0x24d37
popq %rbp
retq
popq %rbp
jmp 0xa828
// File: /workspace/github_c_makefile_star2_O2/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 0x2583e
movq %rdi, %r15
movb 0x51(%r14), %r12b
movq 0x5fde6(%rip), %rax     # 0x855d8
testq %rax, %rax
je 0x257f9
callq *%rax
movq 0x140(%r14), %rdi
testq %rdi, %rdi
jne 0x25817
movq %r14, %rdi
callq 0x1616a
movq %rax, %rdi
movq %rax, 0x140(%r14)
movq 0x48(%r15), %rsi
pushq $0x1
popq %rdx
pushq $-0x1
popq %rcx
callq 0x16191
movq 0x5fdb3(%rip), %rax     # 0x855e0
testq %rax, %rax
je 0x25834
callq *%rax
movb %r12b, 0x51(%r14)
movl %ebx, 0x44(%r14)
jmp 0x25848
movq %r14, %rdi
movl %ebx, %esi
callq 0xe9aa
movl %ebx, %eax
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: 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
movl %edx, %ebx
movl %esi, %r14d
movq %rdi, %r15
leaq 0x120(%rdi), %r13
movq (%r13), %r12
testq %r12, %r12
je 0x25ca9
testl %r14d, %r14d
js 0x25c79
cmpl %r14d, (%r12)
jne 0x25ca0
movl 0x4(%r12), %eax
cmpl $0x1f, %eax
jg 0x25c79
btl %eax, %ebx
jb 0x25ca0
movq 0x10(%r12), %rax
testq %rax, %rax
je 0x25c8a
movq 0x8(%r12), %rdi
callq *%rax
movq 0x18(%r12), %rax
movq %rax, (%r13)
movq (%r15), %rdi
movq %r12, %rsi
callq 0xb856
jmp 0x25c56
addq $0x18, %r12
movq %r12, %r13
jmp 0x25c56
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: 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 0x25d0b
movq %rsi, %rbx
movzbl (%rsi), %eax
testl %eax, %eax
je 0x25d30
cmpl $0x2, %eax
je 0x25d16
cmpl $0x1, %eax
jne 0x25d0b
movq 0x10(%rbx), %r14
testq %r14, %r14
je 0x25d0b
movq (%rdi), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x25f47
movq 0x40(%r14), %rdi
callq 0xa828
movq %r15, %rdi
movq %r14, %rsi
callq 0xb856
andq $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 0x25d45
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x25d58
movq 0x10(%rbx), %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x25ea7
// File: /workspace/github_c_makefile_star2_O2/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 0x25eed
movq %rdi, %r14
movq 0x8(%rdi), %r15
movq %rbx, %rdi
callq 0xf01a
movq %r14, %rdi
callq 0x24b32
movq 0x10(%r15), %rax
cmpq %r14, %rax
je 0x25ef6
movq 0x10(%rax), %rcx
cmpq %r14, %rcx
je 0x25efc
movq %rcx, %rax
testq %rcx, %rcx
jne 0x25eda
jmp 0x25f07
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x10(%r15), %rax
jmp 0x25f00
addq $0x10, %rax
movq 0x10(%r14), %rcx
movq %rcx, (%rax)
xorl %r12d, %r12d
movsbq 0x58(%r14), %rax
cmpq %rax, %r12
jg 0x25f26
movq 0x98(%r14,%r12,8), %rdi
callq 0x228f1
incq %r12
jmp 0x25f0a
movq %r15, %rdi
callq 0x2231c
movq 0x18(%r14), %rdi
callq 0xa828
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x1034d
// File: /workspace/github_c_makefile_star2_O2/shifengbin[P]bishe/Output/../Persistence/sqlite3.c
// Function: vdbeSorterJoinAll
static int vdbeSorterJoinAll(VdbeSorter *pSorter, int rcin){
  int rc = rcin;
  int i;

  /* This function is always called by the main user thread.
  **
  ** If this function is being called after SorterRewind() has been called, 
  ** it is possible that thread pSorter->aTask[pSorter->nTask-1].pThread
  ** is currently attempt to join one of the other threads. To avoid a race
  ** condition where this thread also attempts to join the same object, join 
  ** thread pSorter->aTask[pSorter->nTask-1].pThread first. */
  for(i=pSorter->nTask-1; i>=0; i--){
    SortSubtask *pTask = &pSorter->aTask[i];
    int rc2 = vdbeSorterJoinThread(pTask);
    if( rc==SQLITE_OK ) rc = rc2;
  }
  return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movzbl 0x5b(%rdi), %r15d
imulq $0x68, %r15, %rax
leaq (%rax,%rdi), %r14
addq $-0x8, %r14
testq %r15, %r15
jle 0x2608d
decq %r15
movq %r14, %rdi
callq 0x2615f
testl %ebx, %ebx
cmovel %eax, %ebx
addq $-0x68, %r14
jmp 0x26072
movl %ebx, %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: 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 0x2618e
movq %rdi, %rbx
movq $0x1, -0x18(%rbp)
cmpl $0x0, 0x8(%r14)
je 0x26192
movq 0x10(%r14), %rax
movq %rax, -0x18(%rbp)
jmp 0x2619e
xorl %eax, %eax
jmp 0x261b1
movq (%r14), %rdi
leaq -0x18(%rbp), %rsi
callq 0xa720
movq %r14, %rdi
callq 0xa828
movl -0x18(%rbp), %eax
andl $0x0, 0x8(%rbx)
andq $0x0, (%rbx)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x26209
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpl $0x0, 0x20(%rdi)
je 0x261f2
movq (%rbx), %rdi
callq 0x2615f
movq 0x28(%rbx), %rdi
testq %rdi, %rdi
je 0x261e4
callq 0x2620a
movq 0x38(%rbx), %rdi
testq %rdi, %rdi
je 0x261f2
callq 0x2620a
movq 0x8(%rbx), %rdi
callq 0x260f3
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0xa828
retq
// File: /workspace/github_c_makefile_star2_O2/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, %rbx
movq (%rdi), %rax
movq 0x20(%rax), %r14
movl 0x28(%rax), %r15d
xorl %r12d, %r12d
testl %r15d, %r15d
cmovlel %r12d, %r15d
addq $0x8, %r14
cmpq %r12, %r15
je 0x263b8
cmpq $0x1, %r12
je 0x263af
movl 0x98(%rbx), %eax
btl %r12d, %eax
jae 0x263af
movq (%r14), %rdi
testq %rdi, %rdi
je 0x263af
callq 0x1034d
incq %r12
addq $0x20, %r14
jmp 0x2638b
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: 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
testw $0x2460, %ax            # imm = 0x2460
je 0x265ee
movq %rbx, %rdi
callq 0x26611
cmpl $0x0, 0x20(%rbx)
je 0x26605
movq 0x18(%rbx), %rsi
movq 0x28(%rbx), %rdi
callq 0xb856
andl $0x0, 0x20(%rbx)
andq $0x0, 0x10(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq