LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: setGetterMethod
static void setGetterMethod(Pager *pPager){
  if( pPager->errCode ){
    pPager->xGet = getPageError;
#if SQLITE_MAX_MMAP_SIZE>0
  }else if( USEFETCH(pPager) ){
    pPager->xGet = getPageMMap;
#endif /* SQLITE_MAX_MMAP_SIZE>0 */
  }else{
    pPager->xGet = getPageNormal;
  }
}

// Assembly:
cmpl $0x0, 0x2c(%rdi)
je 0x230008
leaq 0x2a79(%rip), %rax      # 0x232a7f
jmp 0x23001e
cmpb $0x0, 0x1a(%rdi)
je 0x230017
leaq 0x2a72(%rip), %rax      # 0x232a87
jmp 0x23001e
leaq 0x2c23(%rip), %rax      # 0x232c41
movq %rax, 0x108(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/sqlite-3.33.0/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_BKPT;
    sqlite3GlobalConfig.pcache2.xCachesize(pNew, numberOfCachePages(pCache));
    if( pCache->pCache ){
      sqlite3GlobalConfig.pcache2.xDestroy(pCache->pCache);
    }
    pCache->pCache = pNew;
    pCache->szPage = szPage;
    pcacheTrace(("%p.PAGESIZE %d\n",pCache,szPage));
  }
  return SQLITE_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
xorl %ebx, %ebx
cmpl $0x0, 0x24(%rdi)
je 0x2300b7
movl %esi, %ebp
movq %rdi, %r14
movl 0x28(%rdi), %esi
addl $0x48, %esi
movzbl 0x2c(%rdi), %edx
movl %ebp, %edi
callq *0x20a65c(%rip)         # 0x43a6d8
testq %rax, %rax
je 0x2300b4
movq %rax, %r15
movq 0x20a655(%rip), %r12    # 0x43a6e0
movq %r14, %rdi
callq 0x2300c2
movq %r15, %rdi
movl %eax, %esi
callq *%r12
movq 0x40(%r14), %rdi
testq %rdi, %rdi
je 0x2300aa
callq *0x20a666(%rip)         # 0x43a710
movq %r15, 0x40(%r14)
movl %ebp, 0x24(%r14)
jmp 0x2300b7
pushq $0x7
popq %rbx
movl %ebx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: subjournalPageIfRequired
static int subjournalPageIfRequired(PgHdr *pPg){
  if( subjRequiresPage(pPg) ){
    return subjournalPage(pPg);
  }else{
    return SQLITE_OK;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
movq 0x28(%rdi), %rbx
movl 0x30(%rdi), %ebp
movl 0x80(%rbx), %eax
xorl %r15d, %r15d
testl %eax, %eax
cmovlel %r15d, %eax
imulq $0x30, %rax, %r12
xorl %r13d, %r13d
cmpq %r13, %r12
je 0x2301d4
movq 0x78(%rbx), %rax
cmpl %ebp, 0x18(%rax,%r13)
jb 0x230133
movq 0x10(%rax,%r13), %rdi
movl %ebp, %esi
callq 0x230beb
testl %eax, %eax
je 0x230139
addq $0x30, %r13
jmp 0x23010f
movb 0x9(%rbx), %al
cmpb $0x2, %al
jne 0x23015b
incl 0x38(%rbx)
movq %rbx, %rdi
movl %ebp, %esi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x230c7c
movq 0x58(%rbx), %rdx
cmpq $0x0, (%rdx)
je 0x2301b0
movq 0x8(%r14), %r12
movl 0x38(%rbx), %eax
movslq 0xbc(%rbx), %r13
addq $0x4, %r13
imulq %rax, %r13
movq %rdx, %rdi
movq %r13, %rsi
movl %ebp, %edx
callq 0x230c64
testl %eax, %eax
jne 0x2301d1
movq 0x58(%rbx), %rdi
movl 0xbc(%rbx), %edx
addq $0x4, %r13
movq (%rdi), %rax
movq %r12, %rsi
movq %r13, %rcx
callq *0x18(%rax)
testl %eax, %eax
jne 0x2301d1
movl 0x30(%r14), %ebp
jmp 0x230140
cmpb $0x4, %al
je 0x2301ba
cmpb $0x0, 0x19(%rbx)
je 0x2301f3
pushq $-0x1
popq %r8
movq (%rbx), %rdi
xorl %esi, %esi
movl $0x201e, %ecx           # imm = 0x201E
callq 0x230cca
testl %eax, %eax
je 0x2301e6
movl %eax, %r15d
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x58(%rbx), %rdx
movl 0x30(%r14), %ebp
jmp 0x230165
movl 0x20a432(%rip), %r8d    # 0x43a62c
jmp 0x2301be
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: sqlite3PcacheMakeClean
SQLITE_PRIVATE void sqlite3PcacheMakeClean(PgHdr *p){
  assert( sqlite3PcachePageSanity(p) );
  assert( (p->flags & PGHDR_DIRTY)!=0 );
  assert( (p->flags & PGHDR_CLEAN)==0 );
  pcacheManageDirtyList(p, PCACHE_DIRTYLIST_REMOVE);
  p->flags &= ~(PGHDR_DIRTY|PGHDR_NEED_SYNC|PGHDR_WRITEABLE);
  p->flags |= PGHDR_CLEAN;
  pcacheTrace(("%p.CLEAN %d\n",p->pCache,p->pgno));
  assert( sqlite3PcachePageSanity(p) );
  if( p->nRef==0 ){
    pcacheUnpin(p);
  }
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
pushq $0x1
popq %rsi
callq 0x232965
movl 0x34(%rbx), %eax
andl $-0x10, %eax
incl %eax
movw %ax, 0x34(%rbx)
cmpw $0x0, 0x36(%rbx)
je 0x230bc2
popq %rbx
retq
movq %rbx, %rdi
popq %rbx
jmp 0x2329f0
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: sqlite3BitvecTestNotNull
SQLITE_PRIVATE int sqlite3BitvecTestNotNull(Bitvec *p, u32 i){
  assert( p!=0 );
  i--;
  if( i>=p->iSize ) return 0;
  while( p->iDivisor ){
    u32 bin = i/p->iDivisor;
    i = i%p->iDivisor;
    p = p->u.apSub[bin];
    if (!p) {
      return 0;
    }
  }
  if( p->iSize<=BITVEC_NBIT ){
    return (p->u.aBitmap[i/BITVEC_SZELEM] & (1<<(i&(BITVEC_SZELEM-1))))!=0;
  } else{
    u32 h = BITVEC_HASH(i++);
    while( p->u.aHash[h] ){
      if( p->u.aHash[h]==i ) return 1;
      h = (h+1) % BITVEC_NINT;
    }
    return 0;
  }
}

// Assembly:
movl %esi, %edx
decl %edx
xorl %ecx, %ecx
cmpl (%rdi), %edx
jae 0x230c61
movl 0x8(%rdi), %ecx
testl %ecx, %ecx
je 0x230c10
movl %edx, %eax
xorl %edx, %edx
divl %ecx
xorl %ecx, %ecx
movq 0x10(%rdi,%rax,8), %rdi
testq %rdi, %rdi
jne 0x230bf5
jmp 0x230c61
cmpl $0xf80, (%rdi)          # imm = 0xF80
ja 0x230c2f
movl %edx, %eax
shrl $0x3, %eax
movzbl 0x10(%rdi,%rax), %eax
andl $0x7, %edx
xorl %ecx, %ecx
btl %edx, %eax
setb %cl
jmp 0x230c61
movl %edx, %esi
incl %esi
xorl %ecx, %ecx
pushq $0x7c
popq %r8
movl %edx, %eax
xorl %edx, %edx
divl %r8d
pushq $0x1
popq %rax
movl %edx, %r8d
movl 0x10(%rdi,%r8,4), %r8d
testl %r8d, %r8d
je 0x230c61
cmpl %esi, %r8d
je 0x230c5f
incl %edx
cmpl $0x7c, %edx
cmovel %ecx, %edx
jmp 0x230c43
movl %eax, %ecx
movl %ecx, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: memjrnlRead
static int memjrnlRead(
  sqlite3_file *pJfd,    /* The journal file from which to read */
  void *zBuf,            /* Put the results here */
  int iAmt,              /* Number of bytes to read */
  sqlite_int64 iOfst     /* Begin reading at this offset */
){
  MemJournal *p = (MemJournal *)pJfd;
  u8 *zOut = zBuf;
  int nRead = iAmt;
  int iChunkOffset;
  FileChunk *pChunk;

  if( (iAmt+iOfst)>p->endpoint.iOffset ){
    return SQLITE_IOERR_SHORT_READ;
  }
  assert( p->readpoint.iOffset==0 || p->readpoint.pChunk!=0 );
  if( p->readpoint.iOffset!=iOfst || iOfst==0 ){
    sqlite3_int64 iOff = 0;
    for(pChunk=p->pFirst;
        ALWAYS(pChunk) && (iOff+p->nChunkSize)<=iOfst;
        pChunk=pChunk->pNext
    ){
      iOff += p->nChunkSize;
    }
  }else{
    pChunk = p->readpoint.pChunk;
    assert( pChunk!=0 );
  }

  iChunkOffset = (int)(iOfst%p->nChunkSize);
  do {
    int iSpace = p->nChunkSize - iChunkOffset;
    int nCopy = MIN(nRead, (p->nChunkSize - iChunkOffset));
    memcpy(zOut, (u8*)pChunk->zChunk + iChunkOffset, nCopy);
    zOut += nCopy;
    nRead -= iSpace;
    iChunkOffset = 0;
  } while( nRead>=0 && (pChunk=pChunk->pNext)!=0 && nRead>0 );
  p->readpoint.iOffset = pChunk ? iOfst+iAmt : 0;
  p->readpoint.pChunk = pChunk;

  return SQLITE_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebp
movslq %edx, %rdx
addq %rcx, %rdx
movl $0x20a, %eax            # imm = 0x20A
cmpq 0x20(%rdi), %rdx
jg 0x230de7
movq %rsi, %r14
movq %rdi, %rbx
testq %rcx, %rcx
movq %rdx, (%rsp)
je 0x230d68
cmpq %rcx, 0x30(%rbx)
jne 0x230d68
movq 0x38(%rbx), %r13
jmp 0x230d88
leaq 0x18(%rbx), %r13
xorl %eax, %eax
movq (%r13), %r13
testq %r13, %r13
je 0x230d85
movslq 0x8(%rbx), %rdx
addq %rdx, %rax
cmpq %rcx, %rax
jle 0x230d6e
jmp 0x230d88
xorl %r13d, %r13d
movslq 0x8(%rbx), %rsi
movq %rcx, %rax
cqto
idivq %rsi
movl 0x8(%rbx), %r12d
subl %edx, %r12d
cmpl %r12d, %ebp
movl %r12d, %eax
cmovll %ebp, %eax
movslq %edx, %rcx
leaq (%rcx,%r13), %rsi
addq $0x8, %rsi
movslq %eax, %r15
movq %r14, %rdi
movq %r15, %rdx
callq 0x17630
subl %r12d, %ebp
js 0x230dd2
movq (%r13), %r13
je 0x230dd2
addq %r15, %r14
xorl %edx, %edx
testq %r13, %r13
jne 0x230d94
testq %r13, %r13
movq (%rsp), %rax
cmoveq %r13, %rax
movq %rax, 0x30(%rbx)
movq %r13, 0x38(%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: memjrnlTruncate
static int memjrnlTruncate(sqlite3_file *pJfd, sqlite_int64 size){
  MemJournal *p = (MemJournal *)pJfd;
  if( ALWAYS(size==0) ){
    memjrnlFreeChunks(p);
    p->nSize = 0;
    p->endpoint.pChunk = 0;
    p->endpoint.iOffset = 0;
    p->readpoint.pChunk = 0;
    p->readpoint.iOffset = 0;
  }
  return SQLITE_OK;
}

// Assembly:
testq %rsi, %rsi
jne 0x230fe0
pushq %rbx
movq %rdi, %rbx
callq 0x230ff0
andl $0x0, 0x10(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rbx)
movups %xmm0, 0x30(%rbx)
popq %rbx
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: memjrnlFreeChunks
static void memjrnlFreeChunks(MemJournal *p){
  FileChunk *pIter;
  FileChunk *pNext;
  for(pIter=p->pFirst; pIter; pIter=pNext){
    pNext = pIter->pNext;
    sqlite3_free(pIter);
  }
  p->pFirst = 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
testq %rdi, %rdi
je 0x23100d
movq (%rdi), %r14
callq 0x21f7f9
movq %r14, %rdi
jmp 0x230ffb
andq $0x0, 0x18(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: walWriteOneFrame
static int walWriteOneFrame(
  WalWriter *p,               /* Where to write the frame */
  PgHdr *pPage,               /* The page of the frame to be written */
  int nTruncate,              /* The commit flag.  Usually 0.  >0 for commit */
  sqlite3_int64 iOffset       /* Byte offset at which to write */
){
  int rc;                         /* Result code from subfunctions */
  void *pData;                    /* Data actually written */
  u8 aFrame[WAL_FRAME_HDRSIZE];   /* Buffer to assemble frame-header in */
  pData = pPage->pData;
  walEncodeFrame(p->pWal, pPage->pgno, nTruncate, pData, aFrame);
  rc = walWriteToLog(p, aFrame, sizeof(aFrame), iOffset);
  if( rc ) return rc;
  /* Write the page data */
  rc = walWriteToLog(p, pData, p->szPage, iOffset+sizeof(aFrame));
  return rc;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %rbx
movq %rdi, %r15
movq 0x8(%rsi), %r14
movq (%rdi), %rdi
movl 0x30(%rsi), %esi
movq %rsp, %r12
movq %r14, %rcx
movq %r12, %r8
callq 0x232558
pushq $0x18
popq %rdx
movq %r15, %rdi
movq %r12, %rsi
movq %rbx, %rcx
callq 0x232603
testl %eax, %eax
jne 0x231385
movl 0x1c(%r15), %edx
addq $0x18, %rbx
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rcx
callq 0x232603
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: walIndexWriteHdr
static SQLITE_NO_TSAN void walIndexWriteHdr(Wal *pWal){
  volatile WalIndexHdr *aHdr = walIndexHdr(pWal);
  const int nCksum = offsetof(WalIndexHdr, aCksum);

  assert( pWal->writeLock );
  pWal->hdr.isInit = 1;
  pWal->hdr.iVersion = WALINDEX_MAX_VERSION;
  walChecksumBytes(1, (u8*)&pWal->hdr, nCksum, 0, pWal->hdr.aCksum);
  /* Possible TSAN false-positive.  See tag-20200519-1 */
  memcpy((void*)&aHdr[1], (const void*)&pWal->hdr, sizeof(WalIndexHdr));
  walShmBarrier(pWal);
  memcpy((void*)&aHdr[0], (const void*)&pWal->hdr, sizeof(WalIndexHdr));
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x30(%rdi), %rax
movq (%rax), %r14
leaq 0x48(%rdi), %rsi
movb $0x1, 0x54(%rdi)
movl $0x2de218, 0x48(%rdi)   # imm = 0x2DE218
leaq 0x70(%rdi), %r8
pushq $0x1
popq %rdi
pushq $0x28
popq %rdx
xorl %ecx, %ecx
callq 0x2311b9
movups 0x48(%rbx), %xmm0
movups 0x58(%rbx), %xmm1
movups 0x68(%rbx), %xmm2
movups %xmm2, 0x50(%r14)
movups %xmm1, 0x40(%r14)
movups %xmm0, 0x30(%r14)
movq %rbx, %rdi
callq 0x23210d
movups 0x48(%rbx), %xmm0
movups 0x58(%rbx), %xmm1
movups 0x68(%rbx), %xmm2
movups %xmm2, 0x20(%r14)
movups %xmm1, 0x10(%r14)
movups %xmm0, (%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: walRestartHdr
static void walRestartHdr(Wal *pWal, u32 salt1){
  volatile WalCkptInfo *pInfo = walCkptInfo(pWal);
  int i;                          /* Loop counter */
  u32 *aSalt = pWal->hdr.aSalt;   /* Big-endian salt values */
  pWal->nCkpt++;
  pWal->hdr.mxFrame = 0;
  sqlite3Put4byte((u8*)&aSalt[0], 1 + sqlite3Get4byte((u8*)&aSalt[0]));
  memcpy(&pWal->hdr.aSalt[1], &salt1, 4);
  walIndexWriteHdr(pWal);
  AtomicStore(&pInfo->nBackfill, 0);
  pInfo->nBackfillAttempted = 0;
  pInfo->aReadMark[1] = 0;
  for(i=2; i<WAL_NREADER; i++) pInfo->aReadMark[i] = READMARK_NOT_USED;
  assert( pInfo->aReadMark[0]==0 );
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movq %rdi, %rbx
movq 0x30(%rdi), %rax
movq (%rax), %r14
incl 0x88(%rdi)
addq $0x68, %rdi
andl $0x0, 0x58(%rbx)
callq 0x22fc59
incl %eax
movl %eax, %ecx
shrl $0x18, %ecx
movb %cl, 0x68(%rbx)
movl %eax, %ecx
shrl $0x10, %ecx
movb %cl, 0x69(%rbx)
movb %ah, 0x6a(%rbx)
movb %al, 0x6b(%rbx)
movl %ebp, 0x6c(%rbx)
movq %rbx, %rdi
callq 0x2314f6
movl $0x0, 0x60(%r14)
xorl %eax, %eax
movl %eax, 0x80(%r14)
movl %eax, 0x68(%r14)
cmpq $0x3, %rax
je 0x2315f1
movl $0xffffffff, 0x6c(%r14,%rax,4) # imm = 0xFFFFFFFF
incq %rax
jmp 0x2315dd
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: walIndexClose
static void walIndexClose(Wal *pWal, int isDelete){
  if( pWal->exclusiveMode==WAL_HEAPMEMORY_MODE || pWal->bShmUnreliable ){
    int i;
    for(i=0; i<pWal->nWiData; i++){
      sqlite3_free((void *)pWal->apWiData[i]);
      pWal->apWiData[i] = 0;
    }
  }
  if( pWal->exclusiveMode!=WAL_HEAPMEMORY_MODE ){
    sqlite3OsShmUnmap(pWal->pDbFd, isDelete);
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
cmpb $0x2, 0x3f(%rdi)
je 0x23226e
cmpb $0x0, 0x46(%r14)
je 0x2322a2
xorl %r15d, %r15d
movslq 0x28(%r14), %rax
cmpq %rax, %r15
jge 0x232295
movq 0x30(%r14), %rax
movq (%rax,%r15,8), %rdi
callq 0x21f7f9
movq 0x30(%r14), %rax
andq $0x0, (%rax,%r15,8)
incq %r15
jmp 0x232271
cmpb $0x2, 0x3f(%r14)
jne 0x2322a2
popq %rbx
popq %r14
popq %r15
retq
movq 0x8(%r14), %rdi
movq (%rdi), %rax
movq 0x80(%rax), %rax
movl %ebx, %esi
popq %rbx
popq %r14
popq %r15
jmpq *%rax
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: walDecodeFrame
static int walDecodeFrame(
  Wal *pWal,                      /* The write-ahead log */
  u32 *piPage,                    /* OUT: Database page number for frame */
  u32 *pnTruncate,                /* OUT: New db size (or 0 if not commit) */
  u8 *aData,                      /* Pointer to page data (for checksum) */
  u8 *aFrame                      /* Frame data */
){
  int nativeCksum;                /* True for native byte-order checksums */
  u32 *aCksum = pWal->hdr.aFrameCksum;
  u32 pgno;                       /* Page number of the frame */
  assert( WAL_FRAME_HDRSIZE==24 );

  /* A frame is only valid if the salt values in the frame-header
  ** match the salt values in the wal-header.
  */
  if( memcmp(&pWal->hdr.aSalt, &aFrame[8], 8)!=0 ){
    return 0;
  }

  /* A frame is only valid if the page number is creater than zero.
  */
  pgno = sqlite3Get4byte(&aFrame[0]);
  if( pgno==0 ){
    return 0;
  }

  /* A frame is only valid if a checksum of the WAL header,
  ** all prior frams, the first 16 bytes of this frame-header,
  ** and the frame-data matches the checksum in the last 8
  ** bytes of this frame-header.
  */
  nativeCksum = (pWal->hdr.bigEndCksum==SQLITE_BIGENDIAN);
  walChecksumBytes(nativeCksum, aFrame, 8, aCksum, aCksum);
  walChecksumBytes(nativeCksum, aData, pWal->szPage, aCksum, aCksum);
  if( aCksum[0]!=sqlite3Get4byte(&aFrame[16])
   || aCksum[1]!=sqlite3Get4byte(&aFrame[20])
  ){
    /* Checksum failed. */
    return 0;
  }

  /* If we reach this point, the frame is valid.  Return the page number
  ** and the new database size.
  */
  *piPage = pgno;
  *pnTruncate = sqlite3Get4byte(&aFrame[4]);
  return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq 0x68(%rdi), %rax
xorl %ebp, %ebp
cmpq 0x8(%r8), %rax
je 0x2323f9
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r8, %r14
movq %rcx, %r12
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r13
movq %r8, %rdi
callq 0x22fc59
testl %eax, %eax
je 0x2323e8
movl %eax, 0x4(%rsp)
movq %r15, 0x8(%rsp)
movq %rbx, 0x10(%rsp)
leaq 0x60(%r13), %rbx
xorl %r15d, %r15d
cmpb $0x0, 0x55(%r13)
sete %r15b
pushq $0x8
popq %rdx
movl %r15d, %edi
movq %r14, %rsi
movq %rbx, %rcx
movq %rbx, %r8
callq 0x2311b9
movl 0x38(%r13), %edx
movl %r15d, %edi
movq %r12, %rsi
movq %rbx, %rcx
movq %rbx, %r8
callq 0x2311b9
movl 0x60(%r13), %ebx
leaq 0x10(%r14), %rdi
callq 0x22fc59
cmpl %eax, %ebx
jne 0x2323e8
movl 0x64(%r13), %ebx
leaq 0x14(%r14), %rdi
callq 0x22fc59
cmpl %eax, %ebx
jne 0x2323e8
movq 0x8(%rsp), %rax
movl 0x4(%rsp), %ecx
movl %ecx, (%rax)
addq $0x4, %r14
movq %r14, %rdi
callq 0x22fc59
movq 0x10(%rsp), %rcx
movl %eax, (%rcx)
pushq $0x1
popq %rbp
jmp 0x2323e8
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: sqlite3WalEndWriteTransaction
SQLITE_PRIVATE int sqlite3WalEndWriteTransaction(Wal *pWal){
  if( pWal->writeLock ){
    walUnlockExclusive(pWal, WAL_WRITE_LOCK, 1);
    pWal->writeLock = 0;
    pWal->iReCksum = 0;
    pWal->truncateOnCommit = 0;
  }
  return SQLITE_OK;
}

// Assembly:
cmpb $0x0, 0x40(%rdi)
je 0x2324f9
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %ebp, %ebp
pushq $0x1
popq %rdx
xorl %esi, %esi
callq 0x2315f6
movb %bpl, 0x40(%rbx)
andl $0x0, 0x7c(%rbx)
movb %bpl, 0x43(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: walHashGet
static int walHashGet(
  Wal *pWal,                      /* WAL handle */
  int iHash,                      /* Find the iHash'th table */
  WalHashLoc *pLoc                /* OUT: Hash table location */
){
  int rc;                         /* Return code */

  rc = walIndexPage(pWal, iHash, &pLoc->aPgno);
  assert( rc==SQLITE_OK || iHash>0 );

  if( rc==SQLITE_OK ){
    pLoc->aHash = (volatile ht_slot *)&pLoc->aPgno[HASHTABLE_NPAGE];
    if( iHash==0 ){
      pLoc->aPgno = &pLoc->aPgno[WALINDEX_HDR_SIZE/sizeof(u32)];
      pLoc->iZero = 0;
    }else{
      pLoc->iZero = HASHTABLE_NPAGE_ONE + (iHash-1)*HASHTABLE_NPAGE;
    }
    pLoc->aPgno = &pLoc->aPgno[-1];
  }
  return rc;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdx, %rbx
movl %esi, %ebp
addq $0x8, %rdx
callq 0x23211e
testl %eax, %eax
jne 0x232540
movq 0x8(%rbx), %rcx
movl %ebp, %edx
shll $0xc, %edx
addl $-0x22, %edx
leaq 0x88(%rcx), %rsi
testl %ebp, %ebp
cmovneq %rcx, %rsi
leaq 0x4000(%rcx), %rcx
cmovel %ebp, %edx
movq %rcx, (%rbx)
movl %edx, 0x10(%rbx)
addq $-0x4, %rsi
movq %rsi, 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: walEncodeFrame
static void walEncodeFrame(
  Wal *pWal,                      /* The write-ahead log */
  u32 iPage,                      /* Database page number for frame */
  u32 nTruncate,                  /* New db size (or 0 for non-commit frames) */
  u8 *aData,                      /* Pointer to page data */
  u8 *aFrame                      /* OUT: Write encoded frame here */
){
  int nativeCksum;                /* True for native byte-order checksums */
  u32 *aCksum = pWal->hdr.aFrameCksum;
  assert( WAL_FRAME_HDRSIZE==24 );
  sqlite3Put4byte(&aFrame[0], iPage);
  sqlite3Put4byte(&aFrame[4], nTruncate);
  if( pWal->iReCksum==0 ){
    memcpy(&aFrame[8], pWal->hdr.aSalt, 8);

    nativeCksum = (pWal->hdr.bigEndCksum==SQLITE_BIGENDIAN);
    walChecksumBytes(nativeCksum, aFrame, 8, aCksum, aCksum);
    walChecksumBytes(nativeCksum, aData, pWal->szPage, aCksum, aCksum);

    sqlite3Put4byte(&aFrame[16], aCksum[0]);
    sqlite3Put4byte(&aFrame[20], aCksum[1]);
  }else{
    memset(&aFrame[8], 0, 16);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %r8, %rbx
movq %rcx, %r15
movl %esi, %eax
movl %esi, %ecx
shrl $0x18, %ecx
movb %cl, (%r8)
movl %esi, %ecx
shrl $0x10, %ecx
movb %cl, 0x1(%r8)
movb %ah, 0x2(%rbx)
movb %al, 0x3(%r8)
movl %edx, %eax
shrl $0x18, %eax
movb %al, 0x4(%r8)
movl %edx, %eax
shrl $0x10, %eax
movb %al, 0x5(%r8)
movb %dh, 0x6(%rbx)
movb %dl, 0x7(%r8)
cmpl $0x0, 0x7c(%rdi)
je 0x2325a8
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rbx)
jmp 0x2325fa
movq %rdi, %r14
leaq 0x60(%rdi), %r12
movq 0x68(%rdi), %rax
movq %rax, 0x8(%rbx)
xorl %ebp, %ebp
cmpb $0x0, 0x55(%rdi)
sete %bpl
pushq $0x8
popq %rdx
movl %ebp, %edi
movq %rbx, %rsi
movq %r12, %rcx
movq %r12, %r8
callq 0x2311b9
movl 0x38(%r14), %edx
movl %ebp, %edi
movq %r15, %rsi
movq %r12, %rcx
movq %r12, %r8
callq 0x2311b9
movl 0x60(%r14), %eax
bswapl %eax
movl %eax, 0x10(%rbx)
movl 0x64(%r14), %eax
bswapl %eax
movl %eax, 0x14(%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: backupUpdate
static SQLITE_NOINLINE void backupUpdate(
  sqlite3_backup *p,
  Pgno iPage,
  const u8 *aData
){
  assert( p!=0 );
  do{
    assert( sqlite3_mutex_held(p->pSrc->pBt->mutex) );
    if( !isFatalError(p->rc) && iPage<p->iNext ){
      /* The backup process p has already copied page iPage. But now it
      ** has been modified by a transaction on the source pager. Copy
      ** the new data into the backup.
      */
      int rc;
      assert( p->pDestDb );
      sqlite3_mutex_enter(p->pDestDb->mutex);
      rc = backupOnePage(p, iPage, aData, 1);
      sqlite3_mutex_leave(p->pDestDb->mutex);
      assert( rc!=SQLITE_BUSY && rc!=SQLITE_LOCKED );
      if( rc!=SQLITE_OK ){
        p->rc = rc;
      }
    }
  }while( (p = p->pNext)!=0 );
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r14
pushq $0x61
popq %r12
pushq $0x1
popq %r15
movl 0x30(%r14), %eax
cmpl $0x6, %eax
ja 0x232760
btl %eax, %r12d
jae 0x232760
cmpl %ebp, 0x18(%r14)
jbe 0x232760
movq %r14, %rdi
movl %ebp, %esi
movq %rbx, %rdx
movl %r15d, %ecx
callq 0x22344f
testl %eax, %eax
je 0x232760
movl %eax, 0x30(%r14)
movq 0x40(%r14), %r14
testq %r14, %r14
jne 0x232733
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: pager_wait_on_lock
static int pager_wait_on_lock(Pager *pPager, int locktype){
  int rc;                              /* Return code */

  /* Check that this is either a no-op (because the requested lock is
  ** already held), or one of the transitions that the busy-handler
  ** may be invoked during, according to the comment above
  ** sqlite3PagerSetBusyhandler().
  */
  assert( (pPager->eLock>=locktype)
       || (pPager->eLock==NO_LOCK && locktype==SHARED_LOCK)
       || (pPager->eLock==RESERVED_LOCK && locktype==EXCLUSIVE_LOCK)
  );

  do {
    rc = pagerLockDb(pPager, locktype);
  }while( rc==SQLITE_BUSY && pPager->xBusyHandler(pPager->pBusyHandlerArg) );
  return rc;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
movq %r14, %rdi
movl %ebx, %esi
callq 0x232911
movl %eax, %ebp
cmpl $0x5, %eax
jne 0x23290a
movq 0xe8(%r14), %rdi
callq *0xe0(%r14)
testl %eax, %eax
jne 0x2328e7
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: pagerLockDb
static int pagerLockDb(Pager *pPager, int eLock){
  int rc = SQLITE_OK;

  assert( eLock==SHARED_LOCK || eLock==RESERVED_LOCK || eLock==EXCLUSIVE_LOCK );
  if( pPager->eLock<eLock || pPager->eLock==UNKNOWN_LOCK ){
    rc = pPager->noLock ? SQLITE_OK : sqlite3OsLock(pPager->fd, eLock);
    if( rc==SQLITE_OK && (pPager->eLock!=UNKNOWN_LOCK||eLock==EXCLUSIVE_LOCK) ){
      pPager->eLock = (u8)eLock;
      IOTRACE(("LOCK %p %d\n", pPager, eLock))
    }
  }
  return rc;
}

// Assembly:
movzbl 0x15(%rdi), %eax
cmpl $0x5, %eax
setne %cl
cmpl %esi, %eax
setge %dl
testb %dl, %cl
jne 0x232944
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
cmpb $0x0, 0x11(%rdi)
je 0x232947
cmpl $0x4, %ebx
je 0x23293c
cmpb $0x5, %al
je 0x232940
movb %bl, 0x15(%r14)
xorl %eax, %eax
jmp 0x232957
xorl %eax, %eax
retq
movq 0x48(%r14), %rdi
movq (%rdi), %rax
movl %ebx, %esi
callq *0x38(%rax)
testl %eax, %eax
je 0x23295f
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movb 0x15(%r14), %al
jmp 0x232933
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: pcache1Free
static void pcache1Free(void *p){
  if( p==0 ) return;
  if( SQLITE_WITHIN(p, pcache1.pStart, pcache1.pEnd) ){
    PgFreeslot *pSlot;
    sqlite3_mutex_enter(pcache1.mutex);
    sqlite3StatusDown(SQLITE_STATUS_PAGECACHE_USED, 1);
    pSlot = (PgFreeslot*)p;
    pSlot->pNext = pcache1.pFree;
    pcache1.pFree = pSlot;
    pcache1.nFreeSlot++;
    pcache1.bUnderPressure = pcache1.nFreeSlot<pcache1.nReserve;
    assert( pcache1.nFreeSlot<=pcache1.nSlot );
    sqlite3_mutex_leave(pcache1.mutex);
  }else{
    assert( sqlite3MemdebugHasType(p, MEMTYPE_PCACHE) );
    sqlite3MemdebugSetType(p, MEMTYPE_HEAP);
#ifndef SQLITE_DISABLE_PAGECACHE_OVERFLOW_STATS
    {
      int nFreed = 0;
      nFreed = sqlite3MallocSize(p);
      sqlite3_mutex_enter(pcache1.mutex);
      sqlite3StatusDown(SQLITE_STATUS_PAGECACHE_OVERFLOW, nFreed);
      sqlite3_mutex_leave(pcache1.mutex);
    }
#endif
    sqlite3_free(p);
  }
}

// Assembly:
pushq %rbx
testq %rdi, %rdi
je 0x232a62
movq %rdi, %rbx
cmpq %rdi, 0x20b3a8(%rip)    # 0x43ddc8
ja 0x232a64
cmpq %rbx, 0x20b3a7(%rip)    # 0x43ddd0
jbe 0x232a64
decq 0x20b07e(%rip)          # 0x43dab0
movq 0x20b3a7(%rip), %rax    # 0x43dde0
movq %rax, (%rbx)
movq %rbx, 0x20b39d(%rip)    # 0x43dde0
movl 0x20b39f(%rip), %eax    # 0x43dde8
incl %eax
movl %eax, 0x20b397(%rip)    # 0x43dde8
xorl %ecx, %ecx
cmpl 0x20b36b(%rip), %eax    # 0x43ddc4
setl %cl
movl %ecx, 0x20b38a(%rip)    # 0x43ddec
popq %rbx
retq
movq %rbx, %rdi
callq *0x207bdb(%rip)         # 0x43a648
cltq
subq %rax, 0x20b042(%rip)    # 0x43dab8
movq %rbx, %rdi
popq %rbx
jmp 0x21f7f9
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: sqlite3PagerLookup
SQLITE_PRIVATE DbPage *sqlite3PagerLookup(Pager *pPager, Pgno pgno){
  sqlite3_pcache_page *pPage;
  assert( pPager!=0 );
  assert( pgno!=0 );
  assert( pPager->pPCache!=0 );
  pPage = sqlite3PcacheFetch(pPager->pPCache, pgno, 0);
  assert( pPage==0 || pPager->hasHeldSharedLock );
  if( pPage==0 ) return 0;
  return sqlite3PcacheFetchFinish(pPager->pPCache, pgno, pPage);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
movq 0x118(%rdi), %rax
movq 0x40(%rax), %rdi
xorl %edx, %edx
callq *0x207885(%rip)         # 0x43a6f0
testq %rax, %rax
je 0x232e85
movq 0x118(%r14), %rdi
movl %ebx, %esi
movq %rax, %rdx
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x232e8f
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: sqlite3PcacheDrop
SQLITE_PRIVATE void sqlite3PcacheDrop(PgHdr *p){
  assert( p->nRef==1 );
  assert( sqlite3PcachePageSanity(p) );
  if( p->flags&PGHDR_DIRTY ){
    pcacheManageDirtyList(p, PCACHE_DIRTYLIST_REMOVE);
  }
  p->pCache->nRefSum--;
  sqlite3GlobalConfig.pcache2.xUnpin(p->pCache->pCache, p->pPage, 1);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
testb $0x2, 0x34(%rdi)
je 0x232fcc
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x232965
movq 0x18(%rbx), %rax
decl 0x18(%rax)
movq 0x20771e(%rip), %rcx    # 0x43a6f8
movq 0x40(%rax), %rdi
movq (%rbx), %rsi
pushq $0x1
popq %rdx
popq %rbx
jmpq *%rcx
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: sqlite3PagerUnrefNotNull
SQLITE_PRIVATE void sqlite3PagerUnrefNotNull(DbPage *pPg){
  TESTONLY( Pager *pPager = pPg->pPager; )
  assert( pPg!=0 );
  if( pPg->flags & PGHDR_MMAP ){
    assert( pPg->pgno!=1 );  /* Page1 is never memory mapped */
    pagerReleaseMapPage(pPg);
  }else{
    sqlite3PcacheRelease(pPg);
  }
  /* Do not use this routine to release the last reference to page1 */
  assert( sqlite3PcacheRefCount(pPager->pPCache)>0 );
}

// Assembly:
testb $0x20, 0x34(%rdi)
je 0x2344b8
movq 0x28(%rdi), %rcx
decl 0x98(%rcx)
movq 0xa8(%rcx), %rax
movq %rax, 0x20(%rdi)
movq %rdi, 0xa8(%rcx)
movq 0x48(%rcx), %rax
movl 0x30(%rdi), %edx
decl %edx
movslq 0xbc(%rcx), %rsi
imulq %rdx, %rsi
movq 0x8(%rdi), %rdx
movq (%rax), %rcx
movq 0x90(%rcx), %rcx
movq %rax, %rdi
jmpq *%rcx
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/sqlite-3.33.0/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{
      pcacheManageDirtyList(p, PCACHE_DIRTYLIST_FRONT);
    }
  }
}

// Assembly:
movq 0x18(%rdi), %rax
decl 0x18(%rax)
decw 0x36(%rdi)
je 0x2344c6
retq
testb $0x1, 0x34(%rdi)
jne 0x2329f0
pushq $0x3
popq %rsi
jmp 0x232965
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: pcacheMergeDirtyList
static PgHdr *pcacheMergeDirtyList(PgHdr *pA, PgHdr *pB){
  PgHdr result, *pTail;
  pTail = &result;
  assert( pA!=0 && pB!=0 );
  for(;;){
    if( pA->pgno<pB->pgno ){
      pTail->pDirty = pA;
      pTail = pA;
      pA = pA->pDirty;
      if( pA==0 ){
        pTail->pDirty = pB;
        break;
      }
    }else{
      pTail->pDirty = pB;
      pTail = pB;
      pB = pB->pDirty;
      if( pB==0 ){
        pTail->pDirty = pA;
        break;
      }
    }
  }
  return result.pDirty;
}

// Assembly:
leaq -0x48(%rsp), %rax
movq %rax, %rcx
movq %rdi, %rax
movl 0x30(%rdi), %edx
movq %rsi, %rdi
movq %rdi, %rsi
cmpl 0x30(%rdi), %edx
jb 0x234503
movq %rsi, 0x20(%rcx)
movq 0x20(%rsi), %rdi
movq %rsi, %rcx
testq %rdi, %rdi
jne 0x2344e9
jmp 0x234515
movq %rax, 0x20(%rcx)
movq 0x20(%rax), %rdi
movq %rax, %rcx
testq %rdi, %rdi
jne 0x2344dd
jmp 0x23451b
movq %rsi, %rcx
movq %rax, %rsi
movq %rsi, 0x20(%rcx)
movq -0x28(%rsp), %rax
retq
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: sqlite3PcacheMakeDirty
SQLITE_PRIVATE void sqlite3PcacheMakeDirty(PgHdr *p){
  assert( p->nRef>0 );
  assert( sqlite3PcachePageSanity(p) );
  if( p->flags & (PGHDR_CLEAN|PGHDR_DONT_WRITE) ){    /*OPTIMIZATION-IF-FALSE*/
    p->flags &= ~PGHDR_DONT_WRITE;
    if( p->flags & PGHDR_CLEAN ){
      p->flags ^= (PGHDR_DIRTY|PGHDR_CLEAN);
      pcacheTrace(("%p.DIRTY %d\n",p->pCache,p->pgno));
      assert( (p->flags & (PGHDR_DIRTY|PGHDR_CLEAN))==PGHDR_DIRTY );
      pcacheManageDirtyList(p, PCACHE_DIRTYLIST_ADD);
    }
    assert( sqlite3PcachePageSanity(p) );
  }
}

// Assembly:
movzwl 0x34(%rdi), %eax
testb $0x11, %al
je 0x2345a9
movl %eax, %ecx
andl $0xffef, %ecx           # imm = 0xFFEF
movw %cx, 0x34(%rdi)
testb $0x1, %al
jne 0x2345aa
retq
xorl $0x3, %ecx
movw %cx, 0x34(%rdi)
pushq $0x2
popq %rsi
jmp 0x232965
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: readSuperJournal
static int readSuperJournal(sqlite3_file *pJrnl, char *zSuper, u32 nSuper){
  int rc;                    /* Return code */
  u32 len;                   /* Length in bytes of super-journal name */
  i64 szJ;                   /* Total size in bytes of journal file pJrnl */
  u32 cksum;                 /* MJ checksum value read from journal */
  u32 u;                     /* Unsigned loop counter */
  unsigned char aMagic[8];   /* A buffer to hold the magic header */
  zSuper[0] = '\0';

  if( SQLITE_OK!=(rc = sqlite3OsFileSize(pJrnl, &szJ))
   || szJ<16
   || SQLITE_OK!=(rc = read32bits(pJrnl, szJ-16, &len))
   || len>=nSuper
   || len>szJ-16
   || len==0
   || SQLITE_OK!=(rc = read32bits(pJrnl, szJ-12, &cksum))
   || SQLITE_OK!=(rc = sqlite3OsRead(pJrnl, aMagic, 8, szJ-8))
   || memcmp(aMagic, aJournalMagic, 8)
   || SQLITE_OK!=(rc = sqlite3OsRead(pJrnl, zSuper, len, szJ-16-len))
  ){
    return rc;
  }

  /* See if the checksum matches the super-journal name */
  for(u=0; u<len; u++){
    cksum -= zSuper[u];
  }
  if( cksum ){
    /* If the checksum doesn't add up, then one or more of the disk sectors
    ** containing the super-journal filename is corrupted. This means
    ** definitely roll back, so just return SQLITE_OK and report a (nul)
    ** super-journal filename.
    */
    len = 0;
  }
  zSuper[len] = '\0';
  zSuper[len+1] = '\0';

  return SQLITE_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movl %edx, %r12d
movq %rsi, %rbx
movq %rdi, %r15
movb $0x0, (%rsi)
movq (%rdi), %rax
leaq 0x8(%rsp), %r14
movq %r14, %rsi
callq *0x30(%rax)
movl %eax, %ebp
testl %eax, %eax
setne %al
movq (%r14), %rsi
cmpq $0x10, %rsi
setl %cl
orb %al, %cl
jne 0x234632
addq $-0x10, %rsi
leaq 0x14(%rsp), %rdx
movq %r15, %rdi
callq 0x234525
testl %eax, %eax
je 0x23460d
movl %eax, %ebp
jmp 0x234632
movl 0x14(%rsp), %r14d
xorl %ebp, %ebp
cmpl %r12d, %r14d
jae 0x234632
movq 0x8(%rsp), %rsi
leaq -0x10(%rsi), %rax
cmpq %r14, %rax
setl %al
testq %r14, %r14
sete %cl
orb %al, %cl
je 0x234641
movl %ebp, %eax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
addq $-0xc, %rsi
leaq 0x10(%rsp), %rdx
movq %r15, %rdi
callq 0x234525
testl %eax, %eax
jne 0x234609
movq 0x8(%rsp), %rcx
addq $-0x8, %rcx
movq (%r15), %rax
leaq 0x18(%rsp), %rsi
pushq $0x8
popq %rdx
movq %r15, %rdi
callq *0x10(%rax)
testl %eax, %eax
jne 0x234609
movabsq $-0x289c5edf06fa2a27, %rax # imm = 0xD763A120F905D5D9
cmpq %rax, 0x18(%rsp)
jne 0x234632
movq 0x8(%rsp), %rcx
subq %r14, %rcx
addq $-0x10, %rcx
movq (%r15), %rax
movq %r15, %rdi
movq %rbx, %rsi
movl %r14d, %edx
callq *0x10(%rax)
testl %eax, %eax
jne 0x234609
movl 0x10(%rsp), %eax
xorl %ecx, %ecx
cmpq %rcx, %r14
je 0x2346be
movsbl (%rbx,%rcx), %edx
subl %edx, %eax
incq %rcx
jmp 0x2346ae
xorl %ebp, %ebp
testl %eax, %eax
cmovnel %ebp, %r14d
movb %bpl, (%rbx,%r14)
incl %r14d
movb %bpl, (%rbx,%r14)
jmp 0x234632
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: sqlite3PcacheTruncate
SQLITE_PRIVATE void sqlite3PcacheTruncate(PCache *pCache, Pgno pgno){
  if( pCache->pCache ){
    PgHdr *p;
    PgHdr *pNext;
    pcacheTrace(("%p.TRUNCATE %d\n",pCache,pgno));
    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( 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 0x2347ea
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movq %rdi, %rbx
movq (%rdi), %r14
testq %r14, %r14
je 0x2347d1
movq %r14, %rdi
movq 0x38(%r14), %r14
cmpl %ebp, 0x30(%rdi)
jbe 0x2347b9
callq 0x230ba1
jmp 0x2347b9
testl %ebp, %ebp
je 0x2347eb
movq 0x205f2c(%rip), %rax    # 0x43a708
movq 0x40(%rbx), %rdi
incl %ebp
movl %ebp, %esi
popq %rbx
popq %r14
popq %rbp
jmpq *%rax
retq
cmpl $0x0, 0x18(%rbx)
je 0x23481e
movq 0x40(%rbx), %rdi
pushq $0x1
popq %r14
xorl %ebp, %ebp
movl %r14d, %esi
xorl %edx, %edx
callq *0x205eea(%rip)         # 0x43a6f0
testq %rax, %rax
je 0x2347d5
movq (%rax), %rdi
movslq 0x24(%rbx), %rdx
xorl %esi, %esi
callq 0x17380
movl %r14d, %ebp
jmp 0x2347d5
xorl %ebp, %ebp
jmp 0x2347d5
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: releaseAllSavepoints
static void releaseAllSavepoints(Pager *pPager){
  int ii;               /* Iterator for looping through Pager.aSavepoint */
  for(ii=0; ii<pPager->nSavepoint; ii++){
    sqlite3BitvecDestroy(pPager->aSavepoint[ii].pInSavepoint);
  }
  if( !pPager->exclusiveMode || sqlite3JournalIsInMemory(pPager->sjfd) ){
    sqlite3OsClose(pPager->sjfd);
  }
  sqlite3_free(pPager->aSavepoint);
  pPager->aSavepoint = 0;
  pPager->nSavepoint = 0;
  pPager->nSubRec = 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
pushq $0x10
popq %r14
xorl %r15d, %r15d
movslq 0x80(%rbx), %rax
cmpq %rax, %r15
jge 0x234853
movq 0x78(%rbx), %rax
movq (%rax,%r14), %rdi
callq 0x233e95
incq %r15
addq $0x30, %r14
jmp 0x234831
cmpb $0x0, 0x8(%rbx)
movq 0x58(%rbx), %r14
movq (%r14), %rax
je 0x234898
leaq 0x201299(%rip), %rcx    # 0x435b00
cmpq %rcx, %rax
movq %rcx, %rax
jne 0x234879
movq %r14, %rdi
callq *0x8(%rax)
andq $0x0, (%r14)
movq 0x78(%rbx), %rdi
callq 0x21f7f9
andq $0x0, 0x78(%rbx)
andl $0x0, 0x80(%rbx)
andl $0x0, 0x38(%rbx)
popq %rbx
popq %r14
popq %r15
retq
testq %rax, %rax
jne 0x23486f
jmp 0x234879
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: pagerFlushOnCommit
static int pagerFlushOnCommit(Pager *pPager, int bCommit){
  if( pPager->tempFile==0 ) return 1;
  if( !bCommit ) return 0;
  if( !isOpen(pPager->fd) ) return 0;
  return (sqlite3PCachePercentDirty(pPager->pPCache)>=25);
}

// Assembly:
cmpb $0x0, 0x10(%rdi)
je 0x2348db
xorl %eax, %eax
testl %esi, %esi
je 0x2348f7
movq 0x48(%rdi), %rcx
cmpq $0x0, (%rcx)
je 0x2348f7
pushq %rbx
movq 0x118(%rdi), %rbx
movq %rbx, %rdi
callq 0x2300c2
movl %eax, %ecx
xorl %eax, %eax
movq (%rbx), %rbx
testq %rbx, %rbx
je 0x2348df
addq $0x38, %rbx
addq $0x64, %rax
jmp 0x2348c9
pushq $0x1
popq %rax
retq
testl %ecx, %ecx
popq %rbx
je 0x2348f8
movslq %ecx, %rcx
cqto
idivq %rcx
movq %rax, %rcx
xorl %eax, %eax
cmpl $0x19, %ecx
setge %al
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: sqlite3PcacheCleanAll
SQLITE_PRIVATE void sqlite3PcacheCleanAll(PCache *pCache){
  PgHdr *p;
  pcacheTrace(("%p.CLEAN-ALL\n",pCache));
  while( (p = pCache->pDirty)!=0 ){
    sqlite3PcacheMakeClean(p);
  }
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x23490e
callq 0x230ba1
jmp 0x2348ff
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: pagerUnlockDb
static int pagerUnlockDb(Pager *pPager, int eLock){
  int rc = SQLITE_OK;

  assert( !pPager->exclusiveMode || pPager->eLock==eLock );
  assert( eLock==NO_LOCK || eLock==SHARED_LOCK );
  assert( eLock!=NO_LOCK || pagerUseWal(pPager)==0 );
  if( isOpen(pPager->fd) ){
    assert( pPager->eLock>=eLock );
    rc = pPager->noLock ? SQLITE_OK : sqlite3OsUnlock(pPager->fd, eLock);
    if( pPager->eLock!=UNKNOWN_LOCK ){
      pPager->eLock = (u8)eLock;
    }
    IOTRACE(("UNLOCK %p %d\n", pPager, eLock))
  }
  pPager->changeCountDone = pPager->tempFile; /* ticket fb3b3024ea238d5c */
  return rc;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x48(%rdi), %rdi
movq (%rdi), %rcx
testq %rcx, %rcx
je 0x23498f
movl %esi, %ebp
xorl %eax, %eax
cmpb $0x0, 0x11(%rbx)
jne 0x234983
movl %ebp, %esi
callq *0x40(%rcx)
cmpb $0x5, 0x15(%rbx)
je 0x234991
movb %bpl, 0x15(%rbx)
jmp 0x234991
xorl %eax, %eax
movb 0x10(%rbx), %cl
movb %cl, 0x16(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/sqlite-3.33.0/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-07291-35328 A value of 5 (0x05) means the page is an
    ** interior table b-tree page. */
    assert( (PTF_LEAFDATA|PTF_INTKEY)==5 );
    /* EVIDENCE-OF: R-26900-09176 A value of 13 (0x0d) 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->xParseCell = btreeParseCellPtr;
    }else{
      pPage->intKeyLeaf = 0;
      pPage->xCellSize = cellSizePtrNoPayload;
      pPage->xParseCell = btreeParseCellPtrNoPayload;
    }
    pPage->maxLocal = pBt->maxLeaf;
    pPage->minLocal = pBt->minLeaf;
  }else if( flagByte==PTF_ZERODATA ){
    /* EVIDENCE-OF: R-43316-37308 A value of 2 (0x02) means the page is an
    ** interior index b-tree page. */
    assert( (PTF_ZERODATA)==2 );
    /* EVIDENCE-OF: R-59615-42828 A value of 10 (0x0a) means the page is a
    ** leaf index b-tree page. */
    assert( (PTF_ZERODATA|PTF_LEAF)==10 );
    pPage->intKey = 0;
    pPage->intKeyLeaf = 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_PAGE(pPage);
  }
  pPage->max1bytePayload = pBt->max1bytePayload;
  return SQLITE_OK;
}

// Assembly:
movl %esi, %r8d
shrl $0x3, %r8d
movb %r8b, 0x8(%rdi)
andl $-0x9, %esi
movl %r8d, %eax
shll $0x2, %eax
movb $0x4, %cl
subb %al, %cl
movb %cl, 0xa(%rdi)
leaq 0x130(%rip), %rax       # 0x234bc3
movq %rax, 0x78(%rdi)
movq 0x48(%rdi), %rax
cmpl $0x2, %esi
je 0x234ac0
cmpl $0x5, %esi
jne 0x234ad3
movb $0x1, 0x2(%rdi)
pushq $0x30
popq %rcx
pushq $0x2e
popq %rdx
testb %r8b, %r8b
je 0x234add
leaq 0x1ae(%rip), %rsi       # 0x234c69
movb $0x1, %r8b
jmp 0x234af2
movb $0x0, 0x2(%rdi)
pushq $0x2c
popq %rcx
pushq $0x2a
popq %rdx
leaq 0x29a(%rip), %rsi       # 0x234d6b
jmp 0x234aef
movl $0x10325, %edi          # imm = 0x10325
jmp 0x232547
leaq 0x247(%rip), %rsi       # 0x234d2b
movq %rsi, 0x78(%rdi)
leaq 0x253(%rip), %rsi       # 0x234d42
xorl %r8d, %r8d
movb %r8b, 0x3(%rdi)
movq %rsi, 0x80(%rdi)
movzwl (%rax,%rdx), %edx
movw %dx, 0xe(%rdi)
movzwl (%rax,%rcx), %ecx
movw %cx, 0x10(%rdi)
movb 0x25(%rax), %al
movb %al, 0xb(%rdi)
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: btreeCellSizeCheck
static SQLITE_NOINLINE int btreeCellSizeCheck(MemPage *pPage){
  int iCellFirst;    /* First allowable cell or freeblock offset */
  int iCellLast;     /* Last possible cell or freeblock offset */
  int i;             /* Index into the cell pointer array */
  int sz;            /* Size of a cell */
  int pc;            /* Address of a freeblock within pPage->aData[] */
  u8 *data;          /* Equal to pPage->aData */
  int usableSize;    /* Maximum usable space on the page */
  int cellOffset;    /* Start of cell content area */

  iCellFirst = pPage->cellOffset + 2*pPage->nCell;
  usableSize = pPage->pBt->usableSize;
  iCellLast = usableSize - 4;
  data = pPage->aData;
  cellOffset = pPage->cellOffset;
  if( !pPage->leaf ) iCellLast--;
  for(i=0; i<pPage->nCell; i++){
    pc = get2byteAligned(&data[cellOffset+i*2]);
    testcase( pc==iCellFirst );
    testcase( pc==iCellLast );
    if( pc<iCellFirst || pc>iCellLast ){
      return SQLITE_CORRUPT_PAGE(pPage);
    }
    sz = pPage->xCellSize(pPage, &data[pc]);
    testcase( pc+sz==usableSize );
    if( pc+sz>usableSize ){
      return SQLITE_CORRUPT_PAGE(pPage);
    }
  }
  return SQLITE_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movzwl 0x12(%rdi), %eax
movzwl 0x18(%rdi), %ecx
leal (%rax,%rcx,2), %ecx
movl %ecx, 0x4(%rsp)
movq 0x48(%rdi), %rcx
cmpb $0x1, 0x8(%rdi)
movl 0x38(%rcx), %r15d
movl %r15d, (%rsp)
sbbl $0x0, %r15d
movq 0x50(%rdi), %r12
addl $-0x4, %r15d
leaq (%rax,%r12), %r13
incq %r13
xorl %ebp, %ebp
movzwl 0x18(%rbx), %eax
cmpq %rax, %rbp
jae 0x234bb2
movzwl -0x1(%r13,%rbp,2), %eax
rolw $0x8, %ax
movzwl %ax, %r14d
movl $0x10396, %edi          # imm = 0x10396
cmpl 0x4(%rsp), %r14d
jb 0x234b9f
cmpl %r15d, %r14d
jg 0x234b9f
movl %r14d, %esi
addq %r12, %rsi
movq %rbx, %rdi
callq *0x78(%rbx)
movzwl %ax, %eax
addl %r14d, %eax
incq %rbp
cmpl (%rsp), %eax
jle 0x234b58
movl $0x1039b, %edi          # imm = 0x1039B
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x232547
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq