LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: mkFullPathname
static int mkFullPathname(
  const char *zPath,              /* Input path */
  char *zOut,                     /* Output buffer */
  int nOut                        /* Allocated size of buffer zOut */
){
  int nPath = sqlite3Strlen30(zPath);
  int iOff = 0;
  if( zPath[0]!='/' ){
    if( osGetcwd(zOut, nOut-2)==0 ){
      return unixLogError(SQLITE_CANTOPEN_BKPT, "getcwd", zPath);
    }
    iOff = sqlite3Strlen30(zOut);
    zOut[iOff++] = '/';
  }
  if( (iOff+nPath+1)>nOut ){
    /* SQLite assumes that xFullPathname() nul-terminates the output buffer
    ** even if it returns an error.  */
    zOut[iOff] = '\0';
    return SQLITE_CANTOPEN_BKPT;
  }
  sqlite3_snprintf(nOut-iOff, &zOut[iOff], "%s", zPath);
  return SQLITE_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq -0x10(%rbp), %rdi
callq 0x3c3400
movl %eax, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2f, %eax
je 0x3da0a6
movq 0x265cc7(%rip), %rax    # 0x63fd10
movq -0x18(%rbp), %rdi
movl -0x1c(%rbp), %ecx
subl $0x2, %ecx
movslq %ecx, %rsi
callq *%rax
cmpq $0x0, %rax
jne 0x3da084
movl $0x9bb6, %edi           # imm = 0x9BB6
callq 0x3d80e0
movl %eax, %edi
movq -0x10(%rbp), %rdx
leaq 0x1d0ee8(%rip), %rsi    # 0x5aaf5d
movl $0x9bb6, %ecx           # imm = 0x9BB6
callq 0x3d8070
movl %eax, -0x4(%rbp)
jmp 0x3da0f9
movq -0x18(%rbp), %rdi
callq 0x3c3400
movl %eax, -0x24(%rbp)
movq -0x18(%rbp), %rax
movl -0x24(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x24(%rbp)
movslq %ecx, %rcx
movb $0x2f, (%rax,%rcx)
movl -0x24(%rbp), %eax
addl -0x20(%rbp), %eax
addl $0x1, %eax
cmpl -0x1c(%rbp), %eax
jle 0x3da0cf
movq -0x18(%rbp), %rax
movslq -0x24(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movl $0x9bbf, %edi           # imm = 0x9BBF
callq 0x3d80e0
movl %eax, -0x4(%rbp)
jmp 0x3da0f9
movl -0x1c(%rbp), %edi
subl -0x24(%rbp), %edi
movq -0x18(%rbp), %rsi
movslq -0x24(%rbp), %rax
addq %rax, %rsi
movq -0x10(%rbp), %rcx
leaq 0x1c1f36(%rip), %rdx    # 0x59c021
movb $0x0, %al
callq 0x3c38c0
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: sqlite3SystemError
SQLITE_PRIVATE void sqlite3SystemError(sqlite3 *db, int rc){
  if( rc==SQLITE_IOERR_NOMEM ) return;
  rc &= 0xff;
  if( rc==SQLITE_CANTOPEN || rc==SQLITE_IOERR ){
    db->iSysErrno = sqlite3OsGetLastError(db->pVfs);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
cmpl $0xc0a, -0xc(%rbp)      # imm = 0xC0A
jne 0x3da19a
jmp 0x3da1c6
movl -0xc(%rbp), %eax
andl $0xff, %eax
movl %eax, -0xc(%rbp)
cmpl $0xe, -0xc(%rbp)
je 0x3da1b1
cmpl $0xa, -0xc(%rbp)
jne 0x3da1c6
movq -0x8(%rbp), %rax
movq (%rax), %rdi
callq 0x3da250
movl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x58(%rax)
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/external/sqlite-3.33.0/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]);
  acc.printfFlags = SQLITE_PRINTF_INTERNAL;
  sqlite3_str_vappendf(&acc, zFormat, ap);
  z = sqlite3StrAccumFinish(&acc);
  if( acc.accError==SQLITE_NOMEM ){
    sqlite3OomFault(db);
  }
  return z;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rsi
leaq -0x70(%rbp), %rdx
movq -0x8(%rbp), %rax
movl 0x7c(%rax), %r8d
leaq -0x90(%rbp), %rdi
movl $0x46, %ecx
callq 0x3c36a0
movb $0x1, -0x73(%rbp)
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
leaq -0x90(%rbp), %rdi
callq 0x3c0a90
leaq -0x90(%rbp), %rdi
callq 0x3c3490
movq %rax, -0x20(%rbp)
movzbl -0x74(%rbp), %eax
cmpl $0x7, %eax
jne 0x3da242
movq -0x8(%rbp), %rdi
callq 0x3c8ba0
movq -0x20(%rbp), %rax
addq $0x90, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: sqlite3OpenTempDatabase
SQLITE_PRIVATE int sqlite3OpenTempDatabase(Parse *pParse){
  sqlite3 *db = pParse->db;
  if( db->aDb[1].pBt==0 && !pParse->explain ){
    int rc;
    Btree *pBt;
    static const int flags =
          SQLITE_OPEN_READWRITE |
          SQLITE_OPEN_CREATE |
          SQLITE_OPEN_EXCLUSIVE |
          SQLITE_OPEN_DELETEONCLOSE |
          SQLITE_OPEN_TEMP_DB;

    rc = sqlite3BtreeOpen(db->pVfs, 0, db, &pBt, 0, flags);
    if( rc!=SQLITE_OK ){
      sqlite3ErrorMsg(pParse, "unable to open a temporary database "
        "file for storing temporary tables");
      pParse->rc = rc;
      return 1;
    }
    db->aDb[1].pBt = pBt;
    assert( db->aDb[1].pSchema );
    if( SQLITE_NOMEM==sqlite3BtreeSetPageSize(pBt, db->nextPagesize, 0, 0) ){
      sqlite3OomFault(db);
      return 1;
    }
  }
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
cmpq $0x0, 0x28(%rax)
jne 0x3da3cd
movq -0x10(%rbp), %rax
cmpb $0x0, 0x11b(%rax)
jne 0x3da3cd
movq -0x18(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rdx
xorl %eax, %eax
movl %eax, %esi
leaq -0x28(%rbp), %rcx
xorl %r8d, %r8d
movl $0x21e, %r9d            # imm = 0x21E
callq 0x3da3e0
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x3da38a
movq -0x10(%rbp), %rdi
leaq 0x1d0d66(%rip), %rsi    # 0x5ab0d6
movb $0x0, %al
callq 0x3cb660
movl -0x1c(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x18(%rax)
movl $0x1, -0x4(%rbp)
jmp 0x3da3d4
movq -0x28(%rbp), %rcx
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movq %rcx, 0x28(%rax)
movq -0x28(%rbp), %rdi
movq -0x18(%rbp), %rax
movl 0x6c(%rax), %esi
xorl %ecx, %ecx
movl %ecx, %edx
callq 0x3d4030
movl %eax, %ecx
movl $0x7, %eax
cmpl %ecx, %eax
jne 0x3da3cb
movq -0x18(%rbp), %rdi
callq 0x3c8ba0
movl $0x1, -0x4(%rbp)
jmp 0x3da3d4
jmp 0x3da3cd
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: sqlite3PagerSetBusyHandler
SQLITE_PRIVATE void sqlite3PagerSetBusyHandler(
  Pager *pPager,                       /* Pager object */
  int (*xBusyHandler)(void *),         /* Pointer to busy-handler function */
  void *pBusyHandlerArg                /* Argument to pass to xBusyHandler */
){
  void **ap;
  pPager->xBusyHandler = xBusyHandler;
  pPager->pBusyHandlerArg = pBusyHandlerArg;
  ap = (void **)&pPager->xBusyHandler;
  assert( ((int(*)(void *))(ap[0]))==xBusyHandler );
  assert( ap[1]==pBusyHandlerArg );
  sqlite3OsFileControlHint(pPager->fd, SQLITE_FCNTL_BUSYHANDLER, (void *)ap);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0xe0(%rax)
movq -0x18(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0xe8(%rax)
movq -0x8(%rbp), %rax
addq $0xe0, %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x20(%rbp), %rdx
movl $0xf, %esi
callq 0x3dbb10
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: sqlite3PcacheOpen
SQLITE_PRIVATE int sqlite3PcacheOpen(
  int szPage,                  /* Size of every page */
  int szExtra,                 /* Extra space associated with each page */
  int bPurgeable,              /* True if pages are on backing store */
  int (*xStress)(void*,PgHdr*),/* Call to try to make pages clean */
  void *pStress,               /* Argument to xStress */
  PCache *p                    /* Preallocated space for the PCache */
){
  memset(p, 0, sizeof(PCache));
  p->szPage = 1;
  p->szExtra = szExtra;
  assert( szExtra>=8 );  /* First 8 bytes will be zeroed */
  p->bPurgeable = bPurgeable;
  p->eCreate = 2;
  p->xStress = xStress;
  p->pStress = pStress;
  p->szCache = 100;
  p->szSpill = 1;
  pcacheTrace(("%p.OPEN szPage %d bPurgeable %d\n",p,szPage,bPurgeable));
  return sqlite3PcacheSetPageSize(p, szPage);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movl %edx, -0xc(%rbp)
movq %rcx, -0x18(%rbp)
movq %r8, -0x20(%rbp)
movq %r9, -0x28(%rbp)
movq -0x28(%rbp), %rdi
xorl %esi, %esi
movl $0x48, %edx
callq 0x19360
movq -0x28(%rbp), %rax
movl $0x1, 0x24(%rax)
movl -0x8(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x28(%rax)
movl -0xc(%rbp), %eax
movb %al, %cl
movq -0x28(%rbp), %rax
movb %cl, 0x2c(%rax)
movq -0x28(%rbp), %rax
movb $0x2, 0x2d(%rax)
movq -0x18(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x38(%rax)
movq -0x28(%rbp), %rax
movl $0x64, 0x1c(%rax)
movq -0x28(%rbp), %rax
movl $0x1, 0x20(%rax)
movq -0x28(%rbp), %rdi
movl -0x4(%rbp), %esi
callq 0x3dbfa0
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x0, 0x2c(%rax)
je 0x3dbec6
movq -0x8(%rbp), %rax
leaq 0x4bf3(%rip), %rcx      # 0x3e0ab0
movq %rcx, 0x108(%rax)
jmp 0x3dbef8
movq -0x8(%rbp), %rax
cmpb $0x0, 0x1a(%rax)
je 0x3dbee4
movq -0x8(%rbp), %rax
leaq 0x4c05(%rip), %rcx      # 0x3e0ae0
movq %rcx, 0x108(%rax)
jmp 0x3dbef6
movq -0x8(%rbp), %rax
leaq 0x4e01(%rip), %rcx      # 0x3e0cf0
movq %rcx, 0x108(%rax)
jmp 0x3dbef8
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x24(%rax)
je 0x3dc04d
movq 0x263954(%rip), %rax    # 0x63f918
movl -0x14(%rbp), %edi
movq -0x10(%rbp), %rcx
movslq 0x28(%rcx), %rcx
addq $0x48, %rcx
movl %ecx, %esi
movq -0x10(%rbp), %rcx
movzbl 0x2c(%rcx), %edx
callq *%rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x3dbff3
movl $0x7, -0x4(%rbp)
jmp 0x3dc054
movq 0x263926(%rip), %rax    # 0x63f920
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rdi
callq 0x3dc060
movq -0x30(%rbp), %rdi
movl %eax, %esi
movq -0x28(%rbp), %rax
callq *%rax
movq -0x10(%rbp), %rax
cmpq $0x0, 0x40(%rax)
je 0x3dc037
movq 0x263923(%rip), %rax    # 0x63f950
movq -0x10(%rbp), %rcx
movq 0x40(%rcx), %rdi
callq *%rax
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x40(%rax)
movl -0x14(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x24(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: numberOfCachePages
static int numberOfCachePages(PCache *p){
  if( p->szCache>=0 ){
    /* IMPLEMENTATION-OF: R-42059-47211 If the argument N is positive then the
    ** suggested cache size is set to N. */
    return p->szCache;
  }else{
    /* IMPLEMANTATION-OF: R-59858-46238 If the argument N is negative, then the
    ** number of cache pages is adjusted to be a number of pages that would
    ** use approximately abs(N*1024) bytes of memory based on the current
    ** page size. */
    return (int)((-1024*(i64)p->szCache)/(p->szPage+p->szExtra));
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x1c(%rax)
jl 0x3dc07e
movq -0x10(%rbp), %rax
movl 0x1c(%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x3dc0a6
movq -0x10(%rbp), %rax
movslq 0x1c(%rax), %rax
imulq $-0x400, %rax, %rax     # imm = 0xFC00
movq -0x10(%rbp), %rcx
movl 0x24(%rcx), %ecx
movq -0x10(%rbp), %rdx
addl 0x28(%rdx), %ecx
movslq %ecx, %rcx
cqto
idivq %rcx
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x3dc740
cmpl $0x0, %eax
je 0x3dc0d8
movq -0x10(%rbp), %rdi
callq 0x3dc7e0
movl %eax, -0x4(%rbp)
jmp 0x3dc0df
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x3e0850
movq -0x8(%rbp), %rax
movzwl 0x34(%rax), %ecx
andl $-0xf, %ecx
movw %cx, 0x34(%rax)
movq -0x8(%rbp), %rax
movzwl 0x34(%rax), %ecx
orl $0x1, %ecx
movw %cx, 0x34(%rax)
movq -0x8(%rbp), %rax
movswl 0x36(%rax), %eax
cmpl $0x0, %eax
jne 0x3dc6de
movq -0x8(%rbp), %rdi
callq 0x3e09b0
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: subjRequiresPage
static int subjRequiresPage(PgHdr *pPg){
  Pager *pPager = pPg->pPager;
  PagerSavepoint *p;
  Pgno pgno = pPg->pgno;
  int i;
  for(i=0; i<pPager->nSavepoint; i++){
    p = &pPager->aSavepoint[i];
    if( p->nOrig>=pgno && 0==sqlite3BitvecTestNotNull(p->pInSavepoint, pgno) ){
      return 1;
    }
  }
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movl 0x30(%rax), %eax
movl %eax, -0x24(%rbp)
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl 0x80(%rcx), %eax
jge 0x3dc7c9
movq -0x18(%rbp), %rax
movq 0x78(%rax), %rax
movslq -0x28(%rbp), %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movl 0x18(%rax), %eax
cmpl -0x24(%rbp), %eax
jb 0x3dc7bc
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rdi
movl -0x24(%rbp), %esi
callq 0x3dc8d0
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0x3dc7bc
movl $0x1, -0x4(%rbp)
jmp 0x3dc7d0
jmp 0x3dc7be
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x3dc769
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: subjournalPage
static int subjournalPage(PgHdr *pPg){
  int rc = SQLITE_OK;
  Pager *pPager = pPg->pPager;
  if( pPager->journalMode!=PAGER_JOURNALMODE_OFF ){

    /* Open the sub-journal, if it has not already been opened */
    assert( pPager->useJournal );
    assert( isOpen(pPager->jfd) || pagerUseWal(pPager) );
    assert( isOpen(pPager->sjfd) || pPager->nSubRec==0 );
    assert( pagerUseWal(pPager)
         || pageInJournal(pPager, pPg)
         || pPg->pgno>pPager->dbOrigSize
    );
    rc = openSubJournal(pPager);

    /* If the sub-journal was opened successfully (or was already open),
    ** write the journal record into the file.  */
    if( rc==SQLITE_OK ){
      void *pData = pPg->pData;
      i64 offset = (i64)pPager->nSubRec*(4+pPager->pageSize);
      char *pData2;
      pData2 = pData;
      PAGERTRACE(("STMT-JOURNAL %d page %d\n", PAGERID(pPager), pPg->pgno));
      rc = write32bits(pPager->sjfd, offset, pPg->pgno);
      if( rc==SQLITE_OK ){
        rc = sqlite3OsWrite(pPager->sjfd, pData2, pPager->pageSize, offset+4);
      }
    }
  }
  if( rc==SQLITE_OK ){
    pPager->nSubRec++;
    assert( pPager->nSavepoint>0 );
    rc = addToSavepointBitvecs(pPager, pPg->pgno);
  }
  return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl $0x0, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movzbl 0x9(%rax), %eax
cmpl $0x2, %eax
je 0x3dc8a0
movq -0x18(%rbp), %rdi
callq 0x3dca00
movl %eax, -0xc(%rbp)
cmpl $0x0, -0xc(%rbp)
jne 0x3dc89e
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movl 0x38(%rax), %eax
movq -0x18(%rbp), %rcx
movl 0xbc(%rcx), %ecx
addl $0x4, %ecx
movslq %ecx, %rcx
imulq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rax
movq 0x58(%rax), %rdi
movq -0x28(%rbp), %rsi
movq -0x8(%rbp), %rax
movl 0x30(%rax), %edx
callq 0x3dca80
movl %eax, -0xc(%rbp)
cmpl $0x0, -0xc(%rbp)
jne 0x3dc89c
movq -0x18(%rbp), %rax
movq 0x58(%rax), %rdi
movq -0x30(%rbp), %rsi
movq -0x18(%rbp), %rax
movl 0xbc(%rax), %edx
movq -0x28(%rbp), %rcx
addq $0x4, %rcx
callq 0x3c6930
movl %eax, -0xc(%rbp)
jmp 0x3dc89e
jmp 0x3dc8a0
cmpl $0x0, -0xc(%rbp)
jne 0x3dc8c6
movq -0x18(%rbp), %rax
movl 0x38(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x38(%rax)
movq -0x18(%rbp), %rdi
movq -0x8(%rbp), %rax
movl 0x30(%rax), %esi
callq 0x3dcac0
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl -0x14(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl (%rcx), %eax
jb 0x3dc8fb
movl $0x0, -0x4(%rbp)
jmp 0x3dc9f0
jmp 0x3dc8fd
movq -0x10(%rbp), %rax
cmpl $0x0, 0x8(%rax)
je 0x3dc94a
movl -0x14(%rbp), %eax
movq -0x10(%rbp), %rcx
xorl %edx, %edx
divl 0x8(%rcx)
movl %eax, -0x18(%rbp)
movl -0x14(%rbp), %eax
movq -0x10(%rbp), %rcx
xorl %edx, %edx
divl 0x8(%rcx)
movl %edx, -0x14(%rbp)
movq -0x10(%rbp), %rax
movl -0x18(%rbp), %ecx
movq 0x10(%rax,%rcx,8), %rax
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x3dc948
movl $0x0, -0x4(%rbp)
jmp 0x3dc9f0
jmp 0x3dc8fd
movq -0x10(%rbp), %rax
movl (%rax), %eax
cmpq $0xf80, %rax            # imm = 0xF80
ja 0x3dc98a
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
shrl $0x3, %ecx
movl %ecx, %ecx
movzbl 0x10(%rax,%rcx), %eax
movl -0x14(%rbp), %ecx
andl $0x7, %ecx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
andl %ecx, %eax
cmpl $0x0, %eax
setne %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x4(%rbp)
jmp 0x3dc9f0
movl -0x14(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0x14(%rbp)
shll $0x0, %eax
movl %eax, %eax
movl $0x7c, %ecx
xorl %edx, %edx
divq %rcx
movl %edx, %eax
movl %eax, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movl -0x1c(%rbp), %ecx
cmpl $0x0, 0x10(%rax,%rcx,4)
je 0x3dc9e9
movq -0x10(%rbp), %rax
movl -0x1c(%rbp), %ecx
movl 0x10(%rax,%rcx,4), %eax
cmpl -0x14(%rbp), %eax
jne 0x3dc9d0
movl $0x1, -0x4(%rbp)
jmp 0x3dc9f0
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, %eax
movl $0x7c, %ecx
xorl %edx, %edx
divq %rcx
movl %edx, %eax
movl %eax, -0x1c(%rbp)
jmp 0x3dc9a9
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: openSubJournal
static int openSubJournal(Pager *pPager){
  int rc = SQLITE_OK;
  if( !isOpen(pPager->sjfd) ){
    const int flags =  SQLITE_OPEN_SUBJOURNAL | SQLITE_OPEN_READWRITE
      | SQLITE_OPEN_CREATE | SQLITE_OPEN_EXCLUSIVE
      | SQLITE_OPEN_DELETEONCLOSE;
    int nStmtSpill = sqlite3Config.nStmtSpill;
    if( pPager->journalMode==PAGER_JOURNALMODE_MEMORY || pPager->subjInMemory ){
      nStmtSpill = -1;
    }
    rc = sqlite3JournalOpen(pPager->pVfs, 0, pPager->sjfd, flags, nStmtSpill);
  }
  return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl $0x0, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
cmpq $0x0, (%rax)
jne 0x3dca76
movl $0x201e, -0x10(%rbp)    # imm = 0x201E
movl 0x262e3e(%rip), %eax    # 0x63f86c
movl %eax, -0x14(%rbp)
movq -0x8(%rbp), %rax
movzbl 0x9(%rax), %eax
cmpl $0x4, %eax
je 0x3dca4b
movq -0x8(%rbp), %rax
movzbl 0x19(%rax), %eax
cmpl $0x0, %eax
je 0x3dca52
movl $0xffffffff, -0x14(%rbp) # imm = 0xFFFFFFFF
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rdx
movl -0x14(%rbp), %r8d
xorl %eax, %eax
movl %eax, %esi
movl $0x201e, %ecx           # imm = 0x201E
callq 0x3dcb40
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: sqlite3JournalOpen
SQLITE_PRIVATE int sqlite3JournalOpen(
  sqlite3_vfs *pVfs,         /* The VFS to use for actual file I/O */
  const char *zName,         /* Name of the journal file */
  sqlite3_file *pJfd,        /* Preallocated, blank file handle */
  int flags,                 /* Opening flags */
  int nSpill                 /* Bytes buffered before opening the file */
){
  MemJournal *p = (MemJournal*)pJfd;

  /* Zero the file-handle object. If nSpill was passed zero, initialize
  ** it using the sqlite3OsOpen() function of the underlying VFS. In this
  ** case none of the code in this module is executed as a result of calls
  ** made on the journal file-handle.  */
  memset(p, 0, sizeof(MemJournal));
  if( nSpill==0 ){
    return sqlite3OsOpen(pVfs, zName, pJfd, flags, 0);
  }

  if( nSpill>0 ){
    p->nChunkSize = nSpill;
  }else{
    p->nChunkSize = 8 + MEMJOURNAL_DFLT_FILECHUNKSIZE - sizeof(FileChunk);
    assert( MEMJOURNAL_DFLT_FILECHUNKSIZE==fileChunkSize(p->nChunkSize) );
  }

  pJfd->pMethods = (const sqlite3_io_methods*)&MemJournalMethods;
  p->nSpill = nSpill;
  p->flags = flags;
  p->zJournal = zName;
  p->pVfs = pVfs;
  return SQLITE_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl %ecx, -0x24(%rbp)
movl %r8d, -0x28(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
xorl %esi, %esi
movl $0x58, %edx
callq 0x19360
cmpl $0x0, -0x28(%rbp)
jne 0x3dcb97
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movl -0x24(%rbp), %ecx
xorl %eax, %eax
movl %eax, %r8d
callq 0x3dbb90
movl %eax, -0x4(%rbp)
jmp 0x3dcbf5
cmpl $0x0, -0x28(%rbp)
jle 0x3dcba9
movl -0x28(%rbp), %ecx
movq -0x30(%rbp), %rax
movl %ecx, 0x8(%rax)
jmp 0x3dcbb4
movq -0x30(%rbp), %rax
movl $0x3f8, 0x8(%rax)       # imm = 0x3F8
movq -0x20(%rbp), %rax
leaq 0x25ca31(%rip), %rcx    # 0x6395f0
movq %rcx, (%rax)
movl -0x28(%rbp), %ecx
movq -0x30(%rbp), %rax
movl %ecx, 0xc(%rax)
movl -0x24(%rbp), %ecx
movq -0x30(%rbp), %rax
movl %ecx, 0x40(%rax)
movq -0x18(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x50(%rax)
movq -0x10(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x48(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x3dd033
movq -0x18(%rbp), %rdi
callq 0x3dd080
movq -0x18(%rbp), %rax
movl $0x0, 0x10(%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x28(%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x20(%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x38(%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x30(%rax)
xorl %eax, %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x3dd0bd
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x3c0800
movq -0x18(%rbp), %rax
movq %rax, -0x10(%rbp)
jmp 0x3dd098
movq -0x8(%rbp), %rax
movq $0x0, 0x18(%rax)
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: memjrnlCreateFile
static int memjrnlCreateFile(MemJournal *p){
  int rc;
  sqlite3_file *pReal = (sqlite3_file*)p;
  MemJournal copy = *p;

  memset(p, 0, sizeof(MemJournal));
  rc = sqlite3OsOpen(copy.pVfs, copy.zJournal, pReal, copy.flags, 0);
  if( rc==SQLITE_OK ){
    int nChunk = copy.nChunkSize;
    i64 iOff = 0;
    FileChunk *pIter;
    for(pIter=copy.pFirst; pIter; pIter=pIter->pNext){
      if( iOff + nChunk > copy.endpoint.iOffset ){
        nChunk = copy.endpoint.iOffset - iOff;
      }
      rc = sqlite3OsWrite(pReal, (u8*)pIter->zChunk, nChunk, iOff);
      if( rc ) break;
      iOff += nChunk;
    }
    if( rc==SQLITE_OK ){
      /* No error has occurred. Free the in-memory buffers. */
      memjrnlFreeChunks(&copy);
    }
  }
  if( rc!=SQLITE_OK ){
    /* If an error occurred while creating or writing to the file, restore
    ** the original before returning. This way, SQLite uses the in-memory
    ** journal data to roll back changes made to the internal page-cache
    ** before this function was called.  */
    sqlite3OsClose(pReal);
    *p = copy;
  }
  return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rsi
leaq -0x70(%rbp), %rdi
movl $0x58, %edx
callq 0x19610
movq -0x8(%rbp), %rdi
xorl %esi, %esi
movl $0x58, %edx
callq 0x19360
movq -0x28(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x18(%rbp), %rdx
movl -0x30(%rbp), %ecx
xorl %eax, %eax
movl %eax, %r8d
callq 0x3dbb90
movl %eax, -0xc(%rbp)
cmpl $0x0, -0xc(%rbp)
jne 0x3dd1c4
movl -0x68(%rbp), %eax
movl %eax, -0x74(%rbp)
movq $0x0, -0x80(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0x88(%rbp)
cmpq $0x0, -0x88(%rbp)
je 0x3dd1b3
movq -0x80(%rbp), %rax
movslq -0x74(%rbp), %rcx
addq %rcx, %rax
cmpq -0x50(%rbp), %rax
jle 0x3dd16e
movq -0x50(%rbp), %rax
subq -0x80(%rbp), %rax
movl %eax, -0x74(%rbp)
movq -0x18(%rbp), %rdi
movq -0x88(%rbp), %rsi
addq $0x8, %rsi
movl -0x74(%rbp), %edx
movq -0x80(%rbp), %rcx
callq 0x3c6930
movl %eax, -0xc(%rbp)
cmpl $0x0, -0xc(%rbp)
je 0x3dd194
jmp 0x3dd1b3
movslq -0x74(%rbp), %rax
addq -0x80(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x88(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x88(%rbp)
jmp 0x3dd148
cmpl $0x0, -0xc(%rbp)
jne 0x3dd1c2
leaq -0x70(%rbp), %rdi
callq 0x3dd080
jmp 0x3dd1c4
cmpl $0x0, -0xc(%rbp)
je 0x3dd1e5
movq -0x18(%rbp), %rdi
callq 0x3dbe40
movq -0x8(%rbp), %rdi
leaq -0x70(%rbp), %rsi
movl $0x58, %edx
callq 0x19610
movl -0xc(%rbp), %eax
addq $0x90, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: walRestartLog
static int walRestartLog(Wal *pWal){
  int rc = SQLITE_OK;
  int cnt;

  if( pWal->readLock==0 ){
    volatile WalCkptInfo *pInfo = walCkptInfo(pWal);
    assert( pInfo->nBackfill==pWal->hdr.mxFrame );
    if( pInfo->nBackfill>0 ){
      u32 salt1;
      sqlite3_randomness(4, &salt1);
      rc = walLockExclusive(pWal, WAL_READ_LOCK(1), WAL_NREADER-1);
      if( rc==SQLITE_OK ){
        /* If all readers are using WAL_READ_LOCK(0) (in other words if no
        ** readers are currently using the WAL), then the transactions
        ** frames will overwrite the start of the existing log. Update the
        ** wal-index header to reflect this.
        **
        ** In theory it would be Ok to update the cache of the header only
        ** at this point. But updating the actual wal-index header is also
        ** safe and means there is no special case for sqlite3WalUndo()
        ** to handle if this transaction is rolled back.  */
        walRestartHdr(pWal, salt1);
        walUnlockExclusive(pWal, WAL_READ_LOCK(1), WAL_NREADER-1);
      }else if( rc!=SQLITE_BUSY ){
        return rc;
      }
    }
    walUnlockShared(pWal, WAL_READ_LOCK(0));
    pWal->readLock = -1;
    cnt = 0;
    do{
      int notUsed;
      rc = walTryBeginRead(pWal, &notUsed, 1, ++cnt);
    }while( rc==WAL_RETRY );
    assert( (rc&0xff)!=SQLITE_BUSY ); /* BUSY not possible when useWal==1 */
    testcase( (rc&0xff)==SQLITE_IOERR );
    testcase( rc==SQLITE_PROTOCOL );
    testcase( rc==SQLITE_OK );
  }
  return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movq -0x10(%rbp), %rax
movswl 0x3c(%rax), %eax
cmpl $0x0, %eax
jne 0x3ddde8
movq -0x10(%rbp), %rdi
callq 0x3de5c0
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movl (%rax), %eax
cmpl $0x0, %eax
jbe 0x3ddda3
movl $0x4, %edi
leaq -0x24(%rbp), %rsi
callq 0x3c3b60
movq -0x10(%rbp), %rdi
movl $0x4, %edx
movl %edx, %esi
callq 0x3de5e0
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jne 0x3ddd91
movq -0x10(%rbp), %rdi
movl -0x24(%rbp), %esi
callq 0x3de630
movq -0x10(%rbp), %rdi
movl $0x4, %edx
movl %edx, %esi
callq 0x3de700
jmp 0x3ddda1
cmpl $0x5, -0x14(%rbp)
je 0x3ddd9f
movl -0x14(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x3dddee
jmp 0x3ddda1
jmp 0x3ddda3
movq -0x10(%rbp), %rdi
movl $0x3, %esi
callq 0x3de740
movq -0x10(%rbp), %rax
movw $0xffff, 0x3c(%rax)     # imm = 0xFFFF
movl $0x0, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movl -0x18(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, -0x18(%rbp)
leaq -0x28(%rbp), %rsi
movl $0x1, %edx
callq 0x3de780
movl %eax, -0x14(%rbp)
cmpl $-0x1, -0x14(%rbp)
je 0x3dddc2
jmp 0x3ddde8
movl -0x14(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rax
movl 0x30(%rax), %esi
movl -0x1c(%rbp), %edx
movq -0x38(%rbp), %rcx
leaq -0x50(%rbp), %r8
callq 0x3dffd0
movq -0x10(%rbp), %rdi
leaq -0x50(%rbp), %rsi
movq -0x28(%rbp), %rcx
movl $0x18, %edx
callq 0x3e00d0
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
je 0x3de188
movl -0x2c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x3de1ad
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x10(%rbp), %rax
movl 0x1c(%rax), %edx
movq -0x28(%rbp), %rcx
addq $0x18, %rcx
callq 0x3e00d0
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x3ddcf0
movq %rax, -0x10(%rbp)
movl $0x28, -0x14(%rbp)
movq -0x8(%rbp), %rax
movb $0x1, 0x54(%rax)
movq -0x8(%rbp), %rax
movl $0x2de218, 0x48(%rax)   # imm = 0x2DE218
movq -0x8(%rbp), %rsi
addq $0x48, %rsi
movq -0x8(%rbp), %r8
addq $0x48, %r8
addq $0x28, %r8
movl $0x1, %edi
movl $0x28, %edx
xorl %eax, %eax
movl %eax, %ecx
callq 0x3dde00
movq -0x10(%rbp), %rdi
addq $0x30, %rdi
movq -0x8(%rbp), %rsi
addq $0x48, %rsi
movl $0x30, %edx
callq 0x19610
movq -0x8(%rbp), %rdi
callq 0x3df0c0
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
addq $0x48, %rsi
movl $0x30, %edx
callq 0x19610
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rdi
callq 0x3de5c0
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
addq $0x68, %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movl 0x88(%rax), %ecx
incl %ecx
movl %ecx, 0x88(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x58(%rax)
movq -0x28(%rbp), %rdi
movq %rdi, -0x38(%rbp)
callq 0x3db720
movq -0x38(%rbp), %rdi
movl %eax, %esi
incl %esi
callq 0x3dd200
movq -0x8(%rbp), %rax
movl -0xc(%rbp), %ecx
movl %ecx, 0x6c(%rax)
movq -0x8(%rbp), %rdi
callq 0x3de520
movq -0x18(%rbp), %rax
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %ecx
movl %ecx, (%rax)
movq -0x18(%rbp), %rax
movl $0x0, 0x20(%rax)
movq -0x18(%rbp), %rax
movl $0x0, 0x8(%rax)
movl $0x2, -0x1c(%rbp)
cmpl $0x5, -0x1c(%rbp)
jge 0x3de6f0
movq -0x18(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movl $0xffffffff, 0x4(%rax,%rcx,4) # imm = 0xFFFFFFFF
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x3de6cf
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movzbl 0x3f(%rax), %eax
cmpl $0x2, %eax
je 0x3df969
movq -0x8(%rbp), %rax
movzbl 0x46(%rax), %eax
cmpl $0x0, %eax
je 0x3df9b2
movl $0x0, -0x10(%rbp)
movl -0x10(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x28(%rcx), %eax
jge 0x3df9b0
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rax
movslq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x3c0800
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rax
movslq -0x10(%rbp), %rcx
movq $0x0, (%rax,%rcx,8)
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x3df970
jmp 0x3df9b2
movq -0x8(%rbp), %rax
movzbl 0x3f(%rax), %eax
cmpl $0x2, %eax
je 0x3df9cf
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
movl -0xc(%rbp), %esi
callq 0x3dfdb0
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpb $0x0, 0x40(%rax)
je 0x3dfe71
movq -0x8(%rbp), %rdi
xorl %esi, %esi
movl $0x1, %edx
callq 0x3de700
movq -0x8(%rbp), %rax
movb $0x0, 0x40(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x7c(%rax)
movq -0x8(%rbp), %rax
movb $0x0, 0x43(%rax)
xorl %eax, %eax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movq -0x18(%rbp), %rdx
addq $0x8, %rdx
callq 0x3df0f0
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
jne 0x3dff4e
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rcx
addq $0x4000, %rcx           # imm = 0x4000
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
cmpl $0x0, -0xc(%rbp)
jne 0x3dff20
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rcx
addq $0x88, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rax
movl $0x0, 0x10(%rax)
jmp 0x3dff3a
movl -0xc(%rbp), %eax
subl $0x1, %eax
shll $0xc, %eax
cltq
addq $0xfde, %rax            # imm = 0xFDE
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x10(%rax)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rcx
addq $-0x4, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movl -0x1c(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq %rcx, -0x18(%rbp)
movq %r8, -0x20(%rbp)
movq -0x8(%rbp), %rax
addq $0x48, %rax
addq $0x18, %rax
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0x3dd200
movq -0x20(%rbp), %rdi
addq $0x4, %rdi
movl -0x10(%rbp), %esi
callq 0x3dd200
movq -0x8(%rbp), %rax
cmpl $0x0, 0x7c(%rax)
jne 0x3e00a7
movq -0x20(%rbp), %rax
movq -0x8(%rbp), %rcx
movq 0x68(%rcx), %rcx
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rax
movzbl 0x55(%rax), %eax
cmpl $0x0, %eax
sete %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %edi
movq -0x20(%rbp), %rsi
movq -0x30(%rbp), %rcx
movq -0x30(%rbp), %r8
movl $0x8, %edx
callq 0x3dde00
movl -0x24(%rbp), %edi
movq -0x18(%rbp), %rsi
movq -0x8(%rbp), %rax
movl 0x38(%rax), %edx
movq -0x30(%rbp), %rcx
movq -0x30(%rbp), %r8
callq 0x3dde00
movq -0x20(%rbp), %rdi
addq $0x10, %rdi
movq -0x30(%rbp), %rax
movl (%rax), %esi
callq 0x3dd200
movq -0x20(%rbp), %rdi
addq $0x14, %rdi
movq -0x30(%rbp), %rax
movl 0x4(%rax), %esi
callq 0x3dd200
jmp 0x3e00bb
movq -0x20(%rbp), %rdi
addq $0x8, %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x19360
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movl 0x30(%rax), %edi
callq 0x3c5ac0
cmpl $0x0, %eax
jne 0x3e038a
movl -0xc(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x18(%rcx), %eax
jae 0x3e038a
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movq -0x18(%rbp), %rdx
movl $0x1, %ecx
callq 0x3c6060
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x3e0388
movl -0x1c(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x30(%rax)
jmp 0x3e038a
jmp 0x3e038c
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq %rax, -0x8(%rbp)
cmpq $0x0, %rax
jne 0x3e0343
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: sqlite3PagerExclusiveLock
SQLITE_PRIVATE int sqlite3PagerExclusiveLock(Pager *pPager){
  int rc = pPager->errCode;
  assert( assert_pager_state(pPager) );
  if( rc==SQLITE_OK ){
    assert( pPager->eState==PAGER_WRITER_CACHEMOD
         || pPager->eState==PAGER_WRITER_DBMOD
         || pPager->eState==PAGER_WRITER_LOCKED
    );
    assert( assert_pager_state(pPager) );
    if( 0==pagerUseWal(pPager) ){
      rc = pager_wait_on_lock(pPager, EXCLUSIVE_LOCK);
    }
  }
  return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl 0x2c(%rax), %eax
movl %eax, -0xc(%rbp)
cmpl $0x0, -0xc(%rbp)
jne 0x3e03f9
movq -0x8(%rbp), %rax
cmpq $0x0, 0x120(%rax)
setne %al
andb $0x1, %al
movzbl %al, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0x3e03f7
movq -0x8(%rbp), %rdi
movl $0x4, %esi
callq 0x3e06e0
movl %eax, -0xc(%rbp)
jmp 0x3e03f9
movl -0xc(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0x3e0740
movl %eax, -0x10(%rbp)
xorl %eax, %eax
cmpl $0x5, -0x10(%rbp)
movb %al, -0x11(%rbp)
jne 0x3e072a
movq -0x8(%rbp), %rax
movq 0xe0(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0xe8(%rcx), %rdi
callq *%rax
cmpl $0x0, %eax
setne %al
movb %al, -0x11(%rbp)
movb -0x11(%rbp), %al
testb $0x1, %al
jne 0x3e06ef
movl -0x10(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)