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: sqlite3_file_control
SQLITE_API int sqlite3_file_control(sqlite3 *db, const char *zDbName, int op, void *pArg){
  int rc = SQLITE_ERROR;
  Btree *pBtree;

#ifdef SQLITE_ENABLE_API_ARMOR
  if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
#endif
  sqlite3_mutex_enter(db->mutex);
  pBtree = sqlite3DbNameToBtree(db, zDbName);
  if( pBtree ){
    Pager *pPager;
    sqlite3_file *fd;
    sqlite3BtreeEnter(pBtree);
    pPager = sqlite3BtreePager(pBtree);
    assert( pPager!=0 );
    fd = sqlite3PagerFile(pPager);
    assert( fd!=0 );
    if( op==SQLITE_FCNTL_FILE_POINTER ){
      *(sqlite3_file**)pArg = fd;
      rc = SQLITE_OK;
    }else if( op==SQLITE_FCNTL_VFS_POINTER ){
      *(sqlite3_vfs**)pArg = sqlite3PagerVfs(pPager);
      rc = SQLITE_OK;
    }else if( op==SQLITE_FCNTL_JOURNAL_POINTER ){
      *(sqlite3_file**)pArg = sqlite3PagerJrnlFile(pPager);
      rc = SQLITE_OK;
    }else if( op==SQLITE_FCNTL_DATA_VERSION ){
      *(unsigned int*)pArg = sqlite3PagerDataVersion(pPager);
      rc = SQLITE_OK;
    }else if( op==SQLITE_FCNTL_RESERVE_BYTES ){
      int iNew = *(int*)pArg;
      *(int*)pArg = sqlite3BtreeGetRequestedReserve(pBtree);
      if( iNew>=0 && iNew<=255 ){
        sqlite3BtreeSetPageSize(pBtree, 0, iNew, 0);
      }
      rc = SQLITE_OK;
    }else{
      rc = sqlite3OsFileControl(fd, op, pArg);
    }
    sqlite3BtreeLeave(pBtree);
  }
  sqlite3_mutex_leave(db->mutex);
  return rc;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rcx, %rbx
movl %edx, %ebp
callq 0x22c234
testq %rax, %rax
je 0x22c1bd
movq %rax, %r14
movq (%rax), %rcx
movq 0x8(%rax), %rax
movq %rcx, 0x8(%rax)
cmpl $0x26, %ebp
je 0x22c208
movq (%rax), %rax
cmpl $0x1b, %ebp
je 0x22c1e2
cmpl $0x1c, %ebp
je 0x22c1cc
cmpl $0x23, %ebp
je 0x22c1c2
movq 0x48(%rax), %rdi
cmpl $0x7, %ebp
jne 0x22c1f1
movq %rdi, (%rbx)
jmp 0x22c1e8
pushq $0x1
popq %rbx
jmp 0x22c1ea
movl 0x84(%rax), %eax
movl %eax, (%rbx)
jmp 0x22c1e8
movq 0x120(%rax), %rcx
leaq 0x10(%rcx), %rdx
addq $0x50, %rax
testq %rcx, %rcx
cmovneq %rdx, %rax
movq (%rax), %rax
movq %rax, (%rbx)
xorl %ebx, %ebx
movl %ebx, %eax
popq %rbx
popq %r14
popq %rbp
retq
movq (%rdi), %rax
testq %rax, %rax
je 0x22c230
movq 0x50(%rax), %rax
movl %ebp, %esi
movq %rbx, %rdx
popq %rbx
popq %r14
popq %rbp
jmpq *%rax
movl (%rbx), %ebp
movq %r14, %rdi
callq 0x22c260
movl %eax, (%rbx)
xorl %ebx, %ebx
cmpl $0xff, %ebp
ja 0x22c1ea
xorl %ebx, %ebx
movq %r14, %rdi
xorl %esi, %esi
movl %ebp, %edx
xorl %ecx, %ecx
callq 0x22c27b
jmp 0x22c1ea
pushq $0xc
jmp 0x22c1bf
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: sqlite3BtreeGetRequestedReserve
SQLITE_PRIVATE int sqlite3BtreeGetRequestedReserve(Btree *p){
  int n1, n2;
  sqlite3BtreeEnter(p);
  n1 = (int)p->pBt->nReserveWanted;
  n2 = sqlite3BtreeGetReserveNoMutex(p);
  sqlite3BtreeLeave(p);
  return n1>n2 ? n1 : n2;
}

// Assembly:
movq (%rdi), %rax
movq 0x8(%rdi), %rcx
movq %rax, 0x8(%rcx)
movzbl 0x26(%rcx), %edx
movl 0x34(%rcx), %eax
subl 0x38(%rcx), %eax
cmpl %edx, %eax
cmovlel %edx, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: sqlite3BtreeSetPageSize
SQLITE_PRIVATE int sqlite3BtreeSetPageSize(Btree *p, int pageSize, int nReserve, int iFix){
  int rc = SQLITE_OK;
  int x;
  BtShared *pBt = p->pBt;
  assert( nReserve>=0 && nReserve<=255 );
  sqlite3BtreeEnter(p);
  pBt->nReserveWanted = nReserve;
  x = pBt->pageSize - pBt->usableSize;
  if( nReserve<x ) nReserve = x;
  if( pBt->btsFlags & BTS_PAGESIZE_FIXED ){
    sqlite3BtreeLeave(p);
    return SQLITE_READONLY;
  }
  assert( nReserve>=0 && nReserve<=255 );
  if( pageSize>=512 && pageSize<=SQLITE_MAX_PAGE_SIZE &&
        ((pageSize-1)&pageSize)==0 ){
    assert( (pageSize & 7)==0 );
    assert( !pBt->pCursor );
    pBt->pageSize = (u32)pageSize;
    freeTempSpace(pBt);
  }
  rc = sqlite3PagerSetPagesize(pBt->pPager, &pBt->pageSize, nReserve);
  pBt->usableSize = pBt->pageSize - (u16)nReserve;
  if( iFix ) pBt->btsFlags |= BTS_PAGESIZE_FIXED;
  sqlite3BtreeLeave(p);
  return rc;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq (%rdi), %rax
movq 0x8(%rdi), %r14
movq %rax, 0x8(%r14)
movb %dl, 0x26(%r14)
movl 0x34(%r14), %ebp
subl 0x38(%r14), %ebp
cmpl %edx, %ebp
cmovlel %edx, %ebp
testb $0x2, 0x28(%r14)
jne 0x22c2f3
movl %ecx, %ebx
leaq 0x34(%r14), %r15
leal -0x200(%rsi), %eax
cmpl $0xfe00, %eax           # imm = 0xFE00
ja 0x22c2ce
leal 0x1ffff(%rsi), %eax
testl %esi, %eax
jne 0x22c2ce
movl %esi, 0x34(%r14)
movq %r14, %rdi
callq 0x236457
movq (%r14), %rdi
movq %r15, %rsi
movl %ebp, %edx
callq 0x22fc5e
movl 0x34(%r14), %ecx
movzwl %bp, %edx
subl %edx, %ecx
movl %ecx, 0x38(%r14)
testl %ebx, %ebx
je 0x22c2f6
orb $0x2, 0x28(%r14)
jmp 0x22c2f6
pushq $0x8
popq %rax
addq $0x8, %rsp
popq %rbx
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: sqlite3_create_filename
SQLITE_API char *sqlite3_create_filename(
  const char *zDatabase,
  const char *zJournal,
  const char *zWal,
  int nParam,
  const char **azParam
){
  sqlite3_int64 nByte;
  int i;
  char *pResult, *p;
  nByte = strlen(zDatabase) + strlen(zJournal) + strlen(zWal) + 10;
  for(i=0; i<nParam*2; i++){
    nByte += strlen(azParam[i])+1;
  }
  pResult = p = sqlite3_malloc64( nByte );
  if( p==0 ) return 0;
  memset(p, 0, 4);
  p += 4;
  p = appendText(p, zDatabase);
  for(i=0; i<nParam*2; i++){
    p = appendText(p, azParam[i]);
  }
  *(p++) = 0;
  p = appendText(p, zJournal);
  p = appendText(p, zWal);
  *(p++) = 0;
  *(p++) = 0;
  assert( (sqlite3_int64)(p - pResult)==nByte );
  return pResult + 4;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, %r15
movl %ecx, %r12d
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r13
callq 0x172d0
movq %rax, %rbp
movq %rbx, 0x8(%rsp)
movq %rbx, %rdi
callq 0x172d0
movq %rax, %rbx
movq %r14, 0x10(%rsp)
movq %r14, %rdi
callq 0x172d0
addq %rbp, %rbx
leaq (%rax,%rbx), %rbp
addq $0xa, %rbp
addl %r12d, %r12d
xorl %ebx, %ebx
testl %r12d, %r12d
cmovlel %ebx, %r12d
cmpq %rbx, %r12
je 0x22cbd7
movq (%r15,%rbx,8), %rdi
callq 0x172d0
addq %rax, %rbp
incq %rbp
incq %rbx
jmp 0x22cbbe
movq %rbp, %rdi
callq 0x21f7df
testq %rax, %rax
je 0x22cc37
movq %rax, %rbp
andl $0x0, (%rax)
addq $0x4, %rbp
movq %rbp, %rdi
movq %r13, %rsi
callq 0x22cc4b
xorl %ebx, %ebx
cmpq %rbx, %r12
je 0x22cc11
movq (%r15,%rbx,8), %rsi
movq %rax, %rdi
callq 0x22cc4b
incq %rbx
jmp 0x22cbfb
movb $0x0, (%rax)
incq %rax
movq %rax, %rdi
movq 0x8(%rsp), %rsi
callq 0x22cc4b
movq %rax, %rdi
movq 0x10(%rsp), %rsi
callq 0x22cc4b
andw $0x0, (%rax)
jmp 0x22cc39
xorl %ebp, %ebp
movq %rbp, %rax
addq $0x18, %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: sqlite3_uri_key
SQLITE_API const char *sqlite3_uri_key(const char *zFilename, int N){
  if( zFilename==0 || N<0 ) return 0;
  zFilename = databaseName(zFilename);
  zFilename += sqlite3Strlen30(zFilename) + 1;
  while( zFilename[0] && (N--)>0 ){
    zFilename += sqlite3Strlen30(zFilename) + 1;
    zFilename += sqlite3Strlen30(zFilename) + 1;
  }
  return zFilename[0] ? zFilename : 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
sete %al
testl %esi, %esi
sets %cl
orb %al, %cl
je 0x22cd32
xorl %r14d, %r14d
jmp 0x22cd76
movl %esi, %ebx
callq 0x22cc93
movq %rax, %r14
movq %rax, %rdi
callq 0x2211ac
movl %eax, %eax
addq %rax, %r14
incq %r14
movb (%r14), %al
testb %al, %al
je 0x22cd6e
testl %ebx, %ebx
jle 0x22cd6e
decl %ebx
movq %r14, %rdi
callq 0x2211ac
movl %eax, %eax
addq %rax, %r14
incq %r14
movq %r14, %rdi
jmp 0x22cd3f
xorl %ecx, %ecx
testb %al, %al
cmoveq %rcx, %r14
movq %r14, %rax
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: sqlite3_uri_int64
SQLITE_API sqlite3_int64 sqlite3_uri_int64(
  const char *zFilename,    /* Filename as passed to xOpen */
  const char *zParam,       /* URI parameter sought */
  sqlite3_int64 bDflt       /* return if parameter is missing */
){
  const char *z = sqlite3_uri_parameter(zFilename, zParam);
  sqlite3_int64 v;
  if( z && sqlite3DecOrHexToI64(z, &v)==0 ){
    bDflt = v;
  }
  return bDflt;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdx, %rbx
callq 0x22ccb2
testq %rax, %rax
je 0x22cde6
leaq 0x8(%rsp), %rsi
movq %rax, %rdi
callq 0x22cdef
testl %eax, %eax
jne 0x22cde6
movq 0x8(%rsp), %rbx
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: sqlite3DecOrHexToI64
SQLITE_PRIVATE int sqlite3DecOrHexToI64(const char *z, i64 *pOut){
#ifndef SQLITE_OMIT_HEX_INTEGER
  if( z[0]=='0'
   && (z[1]=='x' || z[1]=='X')
  ){
    u64 u = 0;
    int i, k;
    for(i=2; z[i]=='0'; i++){}
    for(k=i; sqlite3Isxdigit(z[k]); k++){
      u = u*16 + sqlite3HexToInt(z[k]);
    }
    memcpy(pOut, &u, 8);
    return (z[k]==0 && k-i<=16) ? 0 : 2;
  }else
#endif /* SQLITE_OMIT_HEX_INTEGER */
  {
    return sqlite3Atoi64(z, pOut, sqlite3Strlen30(z), SQLITE_UTF8);
  }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
cmpb $0x30, (%rdi)
jne 0x22ce54
movzbl 0x1(%r14), %eax
orl $0x20, %eax
cmpl $0x78, %eax
jne 0x22ce54
addq $0x2, %r14
movb (%r14), %cl
incq %r14
cmpb $0x30, %cl
je 0x22ce0f
xorl %eax, %eax
leaq 0x144a2d(%rip), %rdx    # 0x371850
xorl %esi, %esi
movzbl %cl, %edi
testb $0x8, (%rdi,%rdx)
je 0x22ce73
shlq $0x4, %rsi
leal (%rcx,%rcx), %edi
sarb $0x7, %dil
andb $0x9, %dil
addb %cl, %dil
andb $0xf, %dil
movzbl %dil, %ecx
orq %rcx, %rsi
movb (%r14,%rax), %cl
incq %rax
jmp 0x22ce25
movq %r14, %rdi
callq 0x2211ac
pushq $0x1
popq %rcx
movq %r14, %rdi
movq %rbx, %rsi
movl %eax, %edx
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x23ad9d
movq %rsi, (%rbx)
cmpb $0x0, -0x1(%r14,%rax)
setne %cl
cmpl $0x11, %eax
setge %al
orb %cl, %al
movzbl %al, %eax
addl %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: sqlite3_filename_journal
SQLITE_API const char *sqlite3_filename_journal(const char *zFilename){
  zFilename = databaseName(zFilename);
  zFilename += sqlite3Strlen30(zFilename) + 1;
  while( zFilename[0] ){
    zFilename += sqlite3Strlen30(zFilename) + 1;
    zFilename += sqlite3Strlen30(zFilename) + 1;
  }
  return zFilename + 1;
}

// Assembly:
pushq %rbx
callq 0x22cc93
movq %rax, %rbx
movq %rax, %rdi
callq 0x2211ac
movl %eax, %eax
cmpb $0x0, 0x1(%rbx,%rax)
je 0x22cece
addq %rax, %rbx
incq %rbx
movq %rbx, %rdi
callq 0x2211ac
movl %eax, %eax
addq %rax, %rbx
incq %rbx
movq %rbx, %rdi
jmp 0x22cea5
addq %rax, %rbx
addq $0x2, %rbx
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: sqlite3_filename_wal
SQLITE_API const char *sqlite3_filename_wal(const char *zFilename){
#ifdef SQLITE_OMIT_WAL
  return 0;
#else
  zFilename = sqlite3_filename_journal(zFilename);
  zFilename += sqlite3Strlen30(zFilename) + 1;
  return zFilename;
#endif
}

// Assembly:
pushq %rbx
callq 0x22ce99
movq %rax, %rbx
movq %rax, %rdi
callq 0x2211ac
movl %eax, %eax
addq %rbx, %rax
incq %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: sqlite3_db_filename
SQLITE_API const char *sqlite3_db_filename(sqlite3 *db, const char *zDbName){
  Btree *pBt;
#ifdef SQLITE_ENABLE_API_ARMOR
  if( !sqlite3SafetyCheckOk(db) ){
    (void)SQLITE_MISUSE_BKPT;
    return 0;
  }
#endif
  pBt = sqlite3DbNameToBtree(db, zDbName);
  return pBt ? sqlite3BtreeGetFilename(pBt) : 0;
}

// Assembly:
pushq %rax
callq 0x22c234
testq %rax, %rax
je 0x22cf16
movq 0x8(%rax), %rax
movq (%rax), %rax
cmpb $0x0, 0x13(%rax)
je 0x22cf1a
leaq 0x144fd7(%rip), %rax    # 0x371eeb
jmp 0x22cf21
xorl %eax, %eax
jmp 0x22cf21
movq 0xd0(%rax), %rax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: sqlite3_db_readonly
SQLITE_API int sqlite3_db_readonly(sqlite3 *db, const char *zDbName){
  Btree *pBt;
#ifdef SQLITE_ENABLE_API_ARMOR
  if( !sqlite3SafetyCheckOk(db) ){
    (void)SQLITE_MISUSE_BKPT;
    return -1;
  }
#endif
  pBt = sqlite3DbNameToBtree(db, zDbName);
  return pBt ? sqlite3BtreeIsReadonly(pBt) : -1;
}

// Assembly:
pushq %rax
callq 0x22c234
testq %rax, %rax
je 0x22cf3b
movq 0x8(%rax), %rax
movzwl 0x28(%rax), %eax
andl $0x1, %eax
jmp 0x22cf3e
pushq $-0x1
popq %rax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: sqlite3_compileoption_used
SQLITE_API int sqlite3_compileoption_used(const char *zOptName){
  int i, n;
  int nOpt;
  const char **azCompileOpt;

#if SQLITE_ENABLE_API_ARMOR
  if( zOptName==0 ){
    (void)SQLITE_MISUSE_BKPT;
    return 0;
  }
#endif

  azCompileOpt = sqlite3CompileOptions(&nOpt);

  if( sqlite3StrNICmp(zOptName, "SQLITE_", 7)==0 ) zOptName += 7;
  n = sqlite3Strlen30(zOptName);

  /* Since nOpt is normally in single digits, a linear search is
  ** adequate. No need for a binary search. */
  for(i=0; i<nOpt; i++){
    if( sqlite3StrNICmp(zOptName, azCompileOpt[i], n)==0
     && sqlite3IsIdChar((unsigned char)azCompileOpt[i][n])==0
    ){
      return 1;
    }
  }
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
leaq 0x148ec9(%rip), %rsi    # 0x375e1e
pushq $0x7
popq %rdx
callq 0x2217ad
leaq 0x7(%r14), %rbx
testl %eax, %eax
cmovneq %r14, %rbx
movq %rbx, %rdi
callq 0x2211ac
movl %eax, %r15d
leaq 0x20a347(%rip), %r13    # 0x4372c0
leaq 0x1448d0(%rip), %rbp    # 0x371850
xorl %r14d, %r14d
cmpq $0x18, %r14
je 0x22cfb0
movq (%r14,%r13), %r12
movq %rbx, %rdi
movq %r12, %rsi
movl %r15d, %edx
callq 0x2217ad
testl %eax, %eax
jne 0x22cfaa
movzbl (%r12,%r15), %eax
testb $0x46, (%rax,%rbp)
je 0x22cfb4
addq $0x8, %r14
jmp 0x22cf83
xorl %eax, %eax
jmp 0x22cfb7
pushq $0x1
popq %rax
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: sqlite3_unlock_notify
SQLITE_API int sqlite3_unlock_notify(
  sqlite3 *db,
  void (*xNotify)(void **, int),
  void *pArg
){
  int rc = SQLITE_OK;

  sqlite3_mutex_enter(db->mutex);
  enterMutex();

  if( xNotify==0 ){
    removeFromBlockedList(db);
    db->pBlockingConnection = 0;
    db->pUnlockConnection = 0;
    db->xUnlockNotify = 0;
    db->pUnlockArg = 0;
  }else if( 0==db->pBlockingConnection ){
    /* The blocking transaction has been concluded. Or there never was a
    ** blocking transaction. In either case, invoke the notify callback
    ** immediately.
    */
    xNotify(&pArg, 1);
  }else{
    sqlite3 *p;

    for(p=db->pBlockingConnection; p && p!=db; p=p->pUnlockConnection){}
    if( p ){
      rc = SQLITE_LOCKED;              /* Deadlock detected. */
    }else{
      db->pUnlockConnection = db->pBlockingConnection;
      db->xUnlockNotify = xNotify;
      db->pUnlockArg = pArg;
      removeFromBlockedList(db);
      addToBlockedList(db);
    }
  }

  leaveMutex();
  assert( !db->mallocFailed );
  sqlite3ErrorWithMsg(db, rc, (rc?"database is deadlocked":0));
  sqlite3_mutex_leave(db->mutex);
  return rc;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq %rdx, (%rsp)
testq %rsi, %rsi
je 0x22d023
movq %rsi, %rax
movq 0x2d8(%rbx), %rcx
testq %rcx, %rcx
je 0x22d03e
movq %rcx, %rsi
testq %rsi, %rsi
je 0x22d011
cmpq %rbx, %rsi
je 0x22d011
movq 0x2e0(%rsi), %rsi
jmp 0x22cffe
testq %rsi, %rsi
je 0x22d048
leaq 0x148e09(%rip), %rdx    # 0x375e26
pushq $0x6
popq %r14
jmp 0x22d072
movq %rbx, %rdi
callq 0x22d08a
xorps %xmm0, %xmm0
movups %xmm0, 0x2e8(%rbx)
movups %xmm0, 0x2d8(%rbx)
jmp 0x22d06d
movq %rsp, %rdi
pushq $0x1
popq %rsi
callq *%rax
jmp 0x22d06d
movq %rcx, 0x2e0(%rbx)
movq %rax, 0x2f0(%rbx)
movq %rdx, 0x2e8(%rbx)
movq %rbx, %rdi
callq 0x22d08a
movq %rbx, %rdi
callq 0x22d0af
xorl %r14d, %r14d
xorl %edx, %edx
movq %rbx, %rdi
movl %r14d, %esi
xorl %eax, %eax
callq 0x2226f3
movl %r14d, %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: removeFromBlockedList
static void removeFromBlockedList(sqlite3 *db){
  sqlite3 **pp;
  assertMutexHeld();
  for(pp=&sqlite3BlockedList; *pp; pp = &(*pp)->pNextBlocked){
    if( *pp==db ){
      *pp = (*pp)->pNextBlocked;
      break;
    }
  }
}

// Assembly:
leaq 0x210d77(%rip), %rcx    # 0x43de08
movq (%rcx), %rdx
testq %rdx, %rdx
je 0x22d0ae
movq %rcx, %rax
leaq 0x2f8(%rdx), %rcx
cmpq %rdi, %rdx
jne 0x22d091
movq (%rcx), %rcx
movq %rcx, (%rax)
retq
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: addToBlockedList
static void addToBlockedList(sqlite3 *db){
  sqlite3 **pp;
  assertMutexHeld();
  for(
    pp=&sqlite3BlockedList;
    *pp && (*pp)->xUnlockNotify!=db->xUnlockNotify;
    pp=&(*pp)->pNextBlocked
  );
  db->pNextBlocked = *pp;
  *pp = db;
}

// Assembly:
leaq 0x210d52(%rip), %rax    # 0x43de08
movq (%rax), %rcx
testq %rcx, %rcx
je 0x22d0da
movq 0x2f0(%rcx), %rdx
cmpq 0x2f0(%rdi), %rdx
je 0x22d0da
addq $0x2f8, %rcx            # imm = 0x2F8
movq %rcx, %rax
jmp 0x22d0b6
movq %rcx, 0x2f8(%rdi)
movq %rdi, (%rax)
retq
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: countLookasideSlots
static u32 countLookasideSlots(LookasideSlot *p){
  u32 cnt = 0;
  while( p ){
    p = p->pNext;
    cnt++;
  }
  return cnt;
}

// Assembly:
xorl %eax, %eax
testq %rdi, %rdi
je 0x22d0fb
movq (%rdi), %rdi
incl %eax
jmp 0x22d0ef
retq
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: setStrAccumError
static void setStrAccumError(StrAccum *p, u8 eError){
  assert( eError==SQLITE_NOMEM || eError==SQLITE_TOOBIG );
  p->accError = eError;
  if( p->mxAlloc ) sqlite3_str_reset(p);
  if( eError==SQLITE_TOOBIG ) sqlite3ErrorToParser(p->db, eError);
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
movb %bpl, 0x1c(%rdi)
cmpl $0x0, 0x14(%rdi)
je 0x22d180
movq %rbx, %rdi
callq 0x22125c
cmpb $0x12, %bpl
jne 0x22d194
movq (%rbx), %rdi
pushq $0x12
popq %rsi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x22d19b
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: sqlite3ErrorToParser
SQLITE_PRIVATE int sqlite3ErrorToParser(sqlite3 *db, int errCode){
  Parse *pParse;
  if( db==0 || (pParse = db->pParse)==0 ) return errCode;
  pParse->rc = errCode;
  pParse->nErr++;
  return errCode;
}

// Assembly:
movl %esi, %eax
testq %rdi, %rdi
je 0x22d1b4
movq 0x130(%rdi), %rcx
testq %rcx, %rcx
je 0x22d1b4
movl %eax, 0x18(%rcx)
incl 0x30(%rcx)
retq
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: sqlite3DbRealloc
SQLITE_PRIVATE void *sqlite3DbRealloc(sqlite3 *db, void *p, u64 n){
  assert( db!=0 );
  if( p==0 ) return sqlite3DbMallocRawNN(db, n);
  assert( sqlite3_mutex_held(db->mutex) );
  if( ((uptr)p)<(uptr)db->lookaside.pEnd ){
#ifndef SQLITE_OMIT_TWOSIZE_LOOKASIDE
    if( ((uptr)p)>=(uptr)db->lookaside.pMiddle ){
      if( n<=LOOKASIDE_SMALL ) return p;
    }else
#endif
    if( ((uptr)p)>=(uptr)db->lookaside.pStart ){
      if( n<=db->lookaside.szTrue ) return p;
    }
  }
  return dbReallocFinish(db, p, n);
}

// Assembly:
testq %rsi, %rsi
je 0x22d1f1
cmpq %rsi, 0x1c0(%rdi)
jbe 0x22d2ab
cmpq %rsi, 0x1b0(%rdi)
jbe 0x22d1f6
cmpq %rsi, 0x1b8(%rdi)
ja 0x22d2ab
movzwl 0x176(%rdi), %eax
cmpq %rdx, %rax
jb 0x22d2ab
movq %rsi, %rax
retq
movq %rdx, %rsi
jmp 0x22d205
cmpq $0x81, %rdx
jae 0x22d2ab
jmp 0x22d1ed
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: dbReallocFinish
static SQLITE_NOINLINE void *dbReallocFinish(sqlite3 *db, void *p, u64 n){
  void *pNew = 0;
  assert( db!=0 );
  assert( p!=0 );
  if( db->mallocFailed==0 ){
    if( isLookaside(db, p) ){
      pNew = sqlite3DbMallocRawNN(db, n);
      if( pNew ){
        memcpy(pNew, p, lookasideMallocSize(db, p));
        sqlite3DbFree(db, p);
      }
    }else{
      assert( sqlite3MemdebugHasType(p, (MEMTYPE_LOOKASIDE|MEMTYPE_HEAP)) );
      assert( sqlite3MemdebugNoType(p, (u8)~(MEMTYPE_LOOKASIDE|MEMTYPE_HEAP)) );
      sqlite3MemdebugSetType(p, MEMTYPE_HEAP);
      pNew = sqlite3Realloc(p, n);
      if( !pNew ){
        sqlite3OomFault(db);
      }
      sqlite3MemdebugSetType(pNew,
            (db->lookaside.bDisable==0 ? MEMTYPE_LOOKASIDE : MEMTYPE_HEAP));
    }
  }
  return pNew;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
cmpb $0x0, 0x61(%rdi)
je 0x22d2c2
xorl %r14d, %r14d
movq %r14, %rax
popq %rbx
popq %r14
popq %r15
retq
movq %rsi, %r15
movq %rdi, %rbx
cmpq %rsi, 0x1b8(%rdi)
ja 0x22d31a
cmpq %r15, 0x1c0(%rbx)
jbe 0x22d31a
movq %rbx, %rdi
movq %rdx, %rsi
callq 0x22d205
testq %rax, %rax
je 0x22d2b6
movq %rax, %r14
movl $0x80, %edx
cmpq %r15, 0x1b0(%rbx)
jbe 0x22d302
movzwl 0x176(%rbx), %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x17630
movq %rbx, %rdi
movq %r15, %rsi
callq 0x21f26b
jmp 0x22d2b9
movq %r15, %rdi
movq %rdx, %rsi
callq 0x21f85c
movq %rax, %r14
testq %rax, %rax
jne 0x22d2b9
movq %rbx, %rdi
callq 0x224bb1
jmp 0x22d2b6
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: dbMallocRawFinish
static SQLITE_NOINLINE void *dbMallocRawFinish(sqlite3 *db, u64 n){
  void *p;
  assert( db!=0 );
  p = sqlite3Malloc(n);
  if( !p ) sqlite3OomFault(db);
  sqlite3MemdebugSetType(p,
         (db->lookaside.bDisable==0) ? MEMTYPE_LOOKASIDE : MEMTYPE_HEAP);
  return p;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x21f6df
movq %rax, %r14
testq %rax, %rax
jne 0x22d359
movq %rbx, %rdi
callq 0x224bb1
movq %r14, %rax
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: strAccumFinishRealloc
static SQLITE_NOINLINE char *strAccumFinishRealloc(StrAccum *p){
  char *zText;
  assert( p->mxAlloc>0 && !isMalloced(p) );
  zText = sqlite3DbMallocRaw(p->db, p->nChar+1 );
  if( zText ){
    memcpy(zText, p->zText, p->nChar+1);
    p->printfFlags |= SQLITE_PRINTF_MALLOCED;
  }else{
    setStrAccumError(p, SQLITE_NOMEM);
  }
  p->zText = zText;
  return zText;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rdi
movl 0x18(%rbx), %esi
incl %esi
callq 0x22809f
movq %rax, %r14
testq %rax, %rax
je 0x22d397
movq 0x8(%rbx), %rsi
movl 0x18(%rbx), %edx
incl %edx
movq %r14, %rdi
callq 0x17630
orb $0x4, 0x1d(%rbx)
jmp 0x22d3a2
pushq $0x7
popq %rsi
movq %rbx, %rdi
callq 0x22d166
movq %r14, 0x8(%rbx)
movq %r14, %rax
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: unixClose
static int unixClose(sqlite3_file *id){
  int rc = SQLITE_OK;
  unixFile *pFile = (unixFile *)id;
  unixInodeInfo *pInode = pFile->pInode;

  assert( pInode!=0 );
  verifyDbFile(pFile);
  unixUnlock(id, NO_LOCK);
  assert( unixFileMutexNotheld(pFile) );
  unixEnterMutex();

  /* unixFile.pInode is always valid here. Otherwise, a different close
  ** routine (e.g. nolockClose()) would be called instead.
  */
  assert( pFile->pInode->nLock>0 || pFile->pInode->bProcessLock==0 );
  sqlite3_mutex_enter(pInode->pLockMutex);
  if( pInode->nLock ){
    /* If there are outstanding locks, do not actually close the file just
    ** yet because that would clear those locks.  Instead, add the file
    ** descriptor to pInode->pUnused list.  It will be automatically closed
    ** when the last lock is cleared.
    */
    setPendingFd(pFile);
  }
  sqlite3_mutex_leave(pInode->pLockMutex);
  releaseInodeInfo(pFile);
  rc = closeUnixFile(id);
  unixLeaveMutex();
  return rc;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x10(%rdi), %r14
callq 0x22e474
movq %rbx, %rdi
xorl %esi, %esi
callq 0x22d989
cmpl $0x0, 0x1c(%r14)
movq 0x10(%rbx), %r14
je 0x22d3f9
movq 0x30(%rbx), %rax
movq 0x28(%r14), %rcx
movq %rcx, 0x8(%rax)
movq %rax, 0x28(%r14)
orl $-0x1, 0x18(%rbx)
andq $0x0, 0x30(%rbx)
jmp 0x22d3fe
testq %r14, %r14
je 0x22d43a
decl 0x30(%r14)
jne 0x22d43a
movq %rbx, %rdi
callq 0x22e78c
movq 0x40(%r14), %rax
movq 0x48(%r14), %rcx
leaq 0x40(%rcx), %rdx
testq %rcx, %rcx
leaq 0x21092e(%rip), %rsi    # 0x43dd50
cmovneq %rdx, %rsi
movq %rax, (%rsi)
testq %rax, %rax
je 0x22d432
movq %rcx, 0x48(%rax)
movq %r14, %rdi
callq 0x21f7f9
movq %rbx, %rdi
callq 0x22e4ea
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: unixFileSize
static int unixFileSize(sqlite3_file *id, i64 *pSize){
  int rc;
  struct stat buf;
  assert( id );
  rc = osFstat(((unixFile*)id)->h, &buf);
  SimulateIOError( rc=1 );
  if( rc!=0 ){
    storeLastErrno((unixFile*)id, errno);
    return SQLITE_IOERR_FSTAT;
  }
  *pSize = buf.st_size;

  /* When opening a zero-size database, the findInodeInfo() procedure
  ** writes a single byte into that file in order to work around a bug
  ** in the OS-X msdos filesystem.  In order to avoid problems with upper
  ** layers, we need to report this file size as zero even though it is
  ** really 1.   Ticket #3260.
  */
  if( *pSize==1 ) *pSize = 0;


  return SQLITE_OK;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x98, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movl 0x18(%rdi), %edi
leaq 0x8(%rsp), %rsi
callq *0x20d3fc(%rip)         # 0x43ab00
testl %eax, %eax
je 0x22d71a
callq 0x17060
movl (%rax), %eax
movl %eax, 0x20(%r14)
movl $0x70a, %eax            # imm = 0x70A
jmp 0x22d731
movq 0x38(%rsp), %rcx
xorl %eax, %eax
cmpq $0x1, %rcx
movl $0x0, %edx
cmovneq %rcx, %rdx
movq %rdx, (%rbx)
addq $0x98, %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: unixCheckReservedLock
static int unixCheckReservedLock(sqlite3_file *id, int *pResOut){
  int rc = SQLITE_OK;
  int reserved = 0;
  unixFile *pFile = (unixFile*)id;

  SimulateIOError( return SQLITE_IOERR_CHECKRESERVEDLOCK; );

  assert( pFile );
  assert( pFile->eFileLock<=SHARED_LOCK );
  sqlite3_mutex_enter(pFile->pInode->pLockMutex);

  /* Check if a thread in this process holds such a lock */
  if( pFile->pInode->eFileLock>SHARED_LOCK ){
    reserved = 1;
  }

  /* Otherwise see if some other process holds it.
  */
#ifndef __DJGPP__
  if( !reserved && !pFile->pInode->bProcessLock ){
    struct flock lock;
    lock.l_whence = SEEK_SET;
    lock.l_start = RESERVED_BYTE;
    lock.l_len = 1;
    lock.l_type = F_WRLCK;
    if( osFcntl(pFile->h, F_GETLK, &lock) ){
      rc = SQLITE_IOERR_CHECKRESERVEDLOCK;
      storeLastErrno(pFile, errno);
    } else if( lock.l_type!=F_UNLCK ){
      reserved = 1;
    }
  }
#endif

  sqlite3_mutex_leave(pFile->pInode->pLockMutex);
  OSTRACE(("TEST WR-LOCK %d %d %d (unix)\n", pFile->h, rc, reserved));

  *pResOut = reserved;
  return rc;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rsi, %rbx
movq 0x10(%rdi), %rax
cmpb $0x1, 0x20(%rax)
ja 0x22db19
xorl %ebp, %ebp
cmpb $0x0, 0x21(%rax)
movl $0x0, %eax
jne 0x22db1e
movq %rdi, %r14
movslq 0x20cf95(%rip), %rax    # 0x43aa70
incq %rax
movq %rsp, %rdx
movq %rax, 0x8(%rdx)
movq $0x1, 0x10(%rdx)
movl $0x1, (%rdx)
movl 0x18(%rdi), %edi
xorl %ebp, %ebp
pushq $0x5
popq %rsi
xorl %eax, %eax
callq *0x20d02d(%rip)         # 0x43ab30
testl %eax, %eax
je 0x22db29
callq 0x17060
movl (%rax), %eax
movl %eax, 0x20(%r14)
movl $0xe0a, %eax            # imm = 0xE0A
jmp 0x22db1e
xorl %eax, %eax
pushq $0x1
popq %rbp
movl %ebp, (%rbx)
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
xorl %ebp, %ebp
cmpw $0x2, (%rsp)
setne %bpl
xorl %eax, %eax
jmp 0x22db1e
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: verifyDbFile
static void verifyDbFile(unixFile *pFile){
  struct stat buf;
  int rc;

  /* These verifications occurs for the main database only */
  if( pFile->ctrlFlags & UNIXFILE_NOLOCK ) return;

  rc = osFstat(pFile->h, &buf);
  if( rc!=0 ){
    sqlite3_log(SQLITE_WARNING, "cannot fstat db file %s", pFile->zPath);
    return;
  }
  if( buf.st_nlink==0 ){
    sqlite3_log(SQLITE_WARNING, "file unlinked while open: %s", pFile->zPath);
    return;
  }
  if( buf.st_nlink>1 ){
    sqlite3_log(SQLITE_WARNING, "multiple links to file: %s", pFile->zPath);
    return;
  }
  if( fileHasMoved(pFile) ){
    sqlite3_log(SQLITE_WARNING, "file renamed while open: %s", pFile->zPath);
    return;
  }
}

// Assembly:
testb $-0x80, 0x1e(%rdi)
jne 0x22e4b2
pushq %rbx
subq $0x90, %rsp
movq %rdi, %rbx
movl 0x18(%rdi), %edi
movq %rsp, %rsi
callq *0x20c66f(%rip)         # 0x43ab00
testl %eax, %eax
je 0x22e4b3
leaq 0x1479f6(%rip), %rsi    # 0x375e92
movq 0x38(%rbx), %rdx
pushq $0x1c
popq %rdi
xorl %eax, %eax
callq 0x2214a3
addq $0x90, %rsp
popq %rbx
retq
movq 0x10(%rsp), %rax
testq %rax, %rax
je 0x22e4d8
cmpq $0x1, %rax
jne 0x22e4e1
movq %rbx, %rdi
callq 0x22e539
testl %eax, %eax
je 0x22e4aa
leaq 0x147a0c(%rip), %rsi    # 0x375ee2
jmp 0x22e49c
leaq 0x1479cb(%rip), %rsi    # 0x375eaa
jmp 0x22e49c
leaq 0x1479df(%rip), %rsi    # 0x375ec7
jmp 0x22e49c
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: fileHasMoved
static int fileHasMoved(unixFile *pFile){
#if OS_VXWORKS
  return pFile->pInode!=0 && pFile->pId!=pFile->pInode->fileId.pId;
#else
  struct stat buf;
  return pFile->pInode!=0 &&
      (osStat(pFile->zPath, &buf)!=0
         || (u64)buf.st_ino!=pFile->pInode->fileId.ino);
#endif
}

// Assembly:
cmpq $0x0, 0x10(%rdi)
je 0x22e561
pushq %rbx
subq $0x90, %rsp
movq %rdi, %rbx
movq 0x38(%rdi), %rdi
movq %rsp, %rsi
callq *0x20c590(%rip)         # 0x43aae8
testl %eax, %eax
je 0x22e564
pushq $0x1
popq %rax
jmp 0x22e576
xorl %eax, %eax
retq
movq 0x8(%rsp), %rcx
movq 0x10(%rbx), %rdx
xorl %eax, %eax
cmpq 0x8(%rdx), %rcx
setne %al
addq $0x90, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: openDirectory
static int openDirectory(const char *zFilename, int *pFd){
  int ii;
  int fd = -1;
  char zDirname[MAX_PATHNAME+1];

  sqlite3_snprintf(MAX_PATHNAME, zDirname, "%s", zFilename);
  for(ii=(int)strlen(zDirname); ii>0 && zDirname[ii]!='/'; ii--);
  if( ii>0 ){
    zDirname[ii] = '\0';
  }else{
    if( zDirname[0]!='/' ) zDirname[0] = '.';
    zDirname[1] = 0;
  }
  fd = robust_open(zDirname, O_RDONLY|O_BINARY, 0);
  if( fd>=0 ){
    OSTRACE(("OPENDIR %-3d %s\n", fd, zDirname));
  }
  *pFd = fd;
  if( fd>=0 ) return SQLITE_OK;
  return unixLogError(SQLITE_CANTOPEN_BKPT, "openDirectory", zDirname);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x210, %rsp            # imm = 0x210
movq %rsi, %rbx
movq %rdi, %rcx
leaq 0x13a90b(%rip), %rdx    # 0x368ea9
movq %rsp, %r14
movl $0x200, %edi            # imm = 0x200
movq %r14, %rsi
xorl %eax, %eax
callq 0x221418
movq %r14, %rdi
callq 0x172d0
testl %eax, %eax
jle 0x22e5cc
movl %eax, %ecx
decl %eax
cmpb $0x2f, (%rsp,%rcx)
jne 0x22e5b8
leaq (%rsp,%rcx), %rax
jmp 0x22e5db
cmpb $0x2f, (%rsp)
je 0x22e5d6
movb $0x2e, (%rsp)
leaq 0x1(%rsp), %rax
movb $0x0, (%rax)
movq %rsp, %rdi
xorl %ebp, %ebp
xorl %esi, %esi
xorl %edx, %edx
callq 0x22e62a
movl %eax, (%rbx)
testl %eax, %eax
jns 0x22e614
movl $0x917b, %edi           # imm = 0x917B
callq 0x22e760
movl %eax, %ebp
leaq 0x147946(%rip), %rsi    # 0x375f4b
movq %rsp, %rdx
movl %eax, %edi
movl $0x917b, %ecx           # imm = 0x917B
callq 0x22e701
movl %ebp, %eax
addq $0x210, %rsp            # imm = 0x210
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: seekAndWriteFd
static int seekAndWriteFd(
  int fd,                         /* File descriptor to write to */
  i64 iOff,                       /* File offset to begin writing at */
  const void *pBuf,               /* Copy data from this buffer to the file */
  int nBuf,                       /* Size of buffer pBuf in bytes */
  int *piErrno                    /* OUT: Error number if error occurs */
){
  int rc = 0;                     /* Value returned by system call */

  assert( nBuf==(nBuf&0x1ffff) );
  assert( fd>2 );
  assert( piErrno!=0 );
  nBuf &= 0x1ffff;
  TIMER_START;

#if defined(USE_PREAD)
  do{ rc = (int)osPwrite(fd, pBuf, nBuf, iOff); }while( rc<0 && errno==EINTR );
#elif defined(USE_PREAD64)
  do{ rc = (int)osPwrite64(fd, pBuf, nBuf, iOff);}while( rc<0 && errno==EINTR);
#else
  do{
    i64 iSeek = lseek(fd, iOff, SEEK_SET);
    SimulateIOError( iSeek = -1 );
    if( iSeek<0 ){
      rc = -1;
      break;
    }
    rc = osWrite(fd, pBuf, nBuf);
  }while( rc<0 && errno==EINTR );
#endif

  TIMER_END;
  OSTRACE(("WRITE   %-3d %5d %7lld %llu\n", fd, rc, iOff, TIMER_ELAPSED));

  if( rc<0 ) *piErrno = errno;
  return rc;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %rbx
movl %ecx, %r14d
movq %rdx, %r15
movq %rsi, %r12
movl %edi, %ebp
andl $0x1ffff, %r14d         # imm = 0x1FFFF
movl %ebp, %edi
movq %r12, %rsi
xorl %edx, %edx
callq 0x17680
testq %rax, %rax
js 0x22e89d
movl %ebp, %edi
movq %r15, %rsi
movq %r14, %rdx
callq *0x20c307(%rip)         # 0x43ab90
movq %rax, %r13
testl %r13d, %r13d
jns 0x22e8aa
callq 0x17060
cmpl $0x4, (%rax)
je 0x22e86a
jmp 0x22e8a6
pushq $-0x1
popq %r13
callq 0x17060
movl (%rax), %eax
movl %eax, (%rbx)
movl %r13d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: unixFileLock
static int unixFileLock(unixFile *pFile, struct flock *pLock){
  int rc;
  unixInodeInfo *pInode = pFile->pInode;
  assert( pInode!=0 );
  assert( sqlite3_mutex_held(pInode->pLockMutex) );
  if( (pFile->ctrlFlags & (UNIXFILE_EXCL|UNIXFILE_RDONLY))==UNIXFILE_EXCL ){
    if( pInode->bProcessLock==0 ){
      struct flock lock;
      assert( pInode->nLock==0 );
      lock.l_whence = SEEK_SET;
      lock.l_start = SHARED_FIRST;
      lock.l_len = SHARED_SIZE;
      lock.l_type = F_WRLCK;
      rc = osSetPosixAdvisoryLock(pFile->h, &lock, pFile);
      if( rc<0 ) return rc;
      pInode->bProcessLock = 1;
      pInode->nLock++;
    }else{
      rc = 0;
    }
  }else{
    rc = osSetPosixAdvisoryLock(pFile->h, pLock, pFile);
  }
  return rc;
}

// Assembly:
movzwl 0x1e(%rdi), %eax
andl $0x3, %eax
cmpw $0x1, %ax
jne 0x22e946
pushq %rbx
subq $0x20, %rsp
movq 0x10(%rdi), %rbx
xorl %eax, %eax
cmpb $0x0, 0x21(%rbx)
jne 0x22e940
movslq 0x20c162(%rip), %rax    # 0x43aa70
addq $0x2, %rax
movq %rsp, %rdx
movq %rax, 0x8(%rdx)
movq $0x1fe, 0x10(%rdx)      # imm = 0x1FE
movl $0x1, (%rdx)
movl 0x18(%rdi), %edi
pushq $0x6
popq %rsi
xorl %eax, %eax
callq *0x20c1fb(%rip)         # 0x43ab30
testl %eax, %eax
js 0x22e940
movb $0x1, 0x21(%rbx)
incl 0x1c(%rbx)
addq $0x20, %rsp
popq %rbx
retq
movq %rsi, %rdx
movq 0x20c1e0(%rip), %rcx    # 0x43ab30
movl 0x18(%rdi), %edi
pushq $0x6
popq %rsi
xorl %eax, %eax
jmpq *%rcx
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: unixGetTempname
static int unixGetTempname(int nBuf, char *zBuf){
  const char *zDir;
  int iLimit = 0;

  /* It's odd to simulate an io-error here, but really this is just
  ** using the io-error infrastructure to test that SQLite handles this
  ** function failing.
  */
  zBuf[0] = 0;
  SimulateIOError( return SQLITE_IOERR );

  zDir = unixTempFileDir();
  if( zDir==0 ) return SQLITE_IOERR_GETTEMPPATH;
  do{
    u64 r;
    sqlite3_randomness(sizeof(r), &r);
    assert( nBuf>2 );
    zBuf[nBuf-2] = 0;
    sqlite3_snprintf(nBuf, zBuf, "%s/"SQLITE_TEMP_FILE_PREFIX"%llx%c",
                     zDir, r, 0);
    if( zBuf[nBuf-2]!=0 || (iLimit++)>10 ) return SQLITE_ERROR;
  }while( osAccess(zBuf,0)==0 );
  return SQLITE_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rsi, %rbx
movl %edi, 0x4(%rsp)
movb $0x0, (%rsi)
leaq 0x20f2b0(%rip), %rax    # 0x43dc88
movq (%rax), %r14
cmpq $0x0, 0x20c35d(%rip)    # 0x43ad40
jne 0x22e9f8
leaq 0x147634(%rip), %rdi    # 0x376020
callq 0x17900
movq %rax, 0x20c348(%rip)    # 0x43ad40
cmpq $0x0, 0x20c348(%rip)    # 0x43ad48
jne 0x22ea15
leaq 0x14761e(%rip), %rdi    # 0x376027
callq 0x17900
movq %rax, 0x20c333(%rip)    # 0x43ad48
xorl %r13d, %r13d
leaq 0x20c321(%rip), %rbp    # 0x43ad40
leaq 0x8(%rsp), %r15
movl $0xf000, %r12d          # imm = 0xF000
testq %r14, %r14
je 0x22ea5d
movq %r14, %rdi
movq %r15, %rsi
callq *0x20c0ad(%rip)         # 0x43aae8
testl %eax, %eax
jne 0x22ea5d
movl 0x20(%rsp), %eax
andl %r12d, %eax
cmpl $0x4000, %eax           # imm = 0x4000
jne 0x22ea5d
movq %r14, %rdi
pushq $0x3
popq %rsi
callq *0x20c05f(%rip)         # 0x43aab8
testl %eax, %eax
je 0x22ea87
cmpq $0x30, %r13
je 0x22ea6e
movq (%r13,%rbp), %r14
addq $0x8, %r13
jmp 0x22ea2a
movl $0x190a, %ebp           # imm = 0x190A
movl %ebp, %eax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movslq 0x4(%rsp), %r15
leaq 0x14757c(%rip), %r13    # 0x37600f
xorl %r12d, %r12d
xorl %ebp, %ebp
pushq $0x8
popq %rdi
leaq 0x8(%rsp), %rsi
callq 0x221618
movb $0x0, -0x2(%rbx,%r15)
movq 0x8(%rsp), %r8
movl %r15d, %edi
movq %rbx, %rsi
movq %r13, %rdx
movq %r14, %rcx
xorl %r9d, %r9d
xorl %eax, %eax
callq 0x221418
cmpb $0x0, -0x2(%rbx,%r15)
jne 0x22eae8
cmpl $0xa, %r12d
ja 0x22eae8
incl %r12d
movq %rbx, %rdi
xorl %esi, %esi
callq *0x20bfd6(%rip)         # 0x43aab8
testl %eax, %eax
je 0x22ea98
jmp 0x22ea73
pushq $0x1
popq %rbp
jmp 0x22ea73
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: unixMapfile
static int unixMapfile(unixFile *pFd, i64 nMap){
  assert( nMap>=0 || pFd->nFetchOut==0 );
  assert( nMap>0 || (pFd->mmapSize==0 && pFd->pMapRegion==0) );
  if( pFd->nFetchOut>0 ) return SQLITE_OK;

  if( nMap<0 ){
    struct stat statbuf;          /* Low-level file information */
    if( osFstat(pFd->h, &statbuf) ){
      return SQLITE_IOERR_FSTAT;
    }
    nMap = statbuf.st_size;
  }
  if( nMap>pFd->mmapSizeMax ){
    nMap = pFd->mmapSizeMax;
  }

  assert( nMap>0 || (pFd->mmapSize==0 && pFd->pMapRegion==0) );
  if( nMap!=pFd->mmapSize ){
    unixRemapfile(pFd, nMap);
  }

  return SQLITE_OK;
}

// Assembly:
cmpl $0x0, 0x4c(%rdi)
jle 0x22eaf6
xorl %eax, %eax
retq
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rdi, %rbx
testq %rsi, %rsi
js 0x22eb80
movq 0x50(%rbx), %r12
movq 0x60(%rbx), %r14
cmpq %r14, %rsi
cmovlq %rsi, %r14
cmpq %r12, %r14
je 0x22ebfc
movl 0x18(%rbx), %ebp
movq 0x68(%rbx), %r13
testq %r13, %r13
je 0x22eba3
movq 0x58(%rbx), %rsi
subq %r12, %rsi
je 0x22eb46
leaq (%r12,%r13), %rdi
callq *0x20c16a(%rip)         # 0x43acb0
pushq $0x1
popq %rcx
movq %r13, %rdi
movq %r12, %rsi
movq %r14, %rdx
xorl %eax, %eax
callq *0x20c16e(%rip)         # 0x43acc8
movq %rax, %r15
incq %rax
cmpq $0x1, %rax
ja 0x22ebc5
movq %r13, %rdi
movq %r12, %rsi
callq *0x20c13e(%rip)         # 0x43acb0
leaq 0x1473ef(%rip), %r12    # 0x375f68
testq %r15, %r15
jne 0x22ebcc
jmp 0x22ebaa
movl 0x18(%rbx), %edi
leaq 0x8(%rsp), %rsi
callq *0x20bf72(%rip)         # 0x43ab00
movl %eax, %ecx
movl $0x70a, %eax            # imm = 0x70A
testl %ecx, %ecx
jne 0x22ebfe
movq 0x38(%rsp), %rsi
jmp 0x22eb0f
leaq 0xe5af5(%rip), %r12     # 0x31469f
pushq $0x1
popq %rcx
xorl %edi, %edi
movq %r14, %rsi
movl %ecx, %edx
movl %ebp, %r8d
xorl %r9d, %r9d
callq *0x20c0d8(%rip)         # 0x43ac98
movq %rax, %r15
jmp 0x22ebcc
leaq 0x14739c(%rip), %r12    # 0x375f68
cmpq $-0x1, %r15
jne 0x22ebf0
movq 0x38(%rbx), %rdx
xorl %r15d, %r15d
xorl %edi, %edi
movq %r12, %rsi
movl $0x96fd, %ecx           # imm = 0x96FD
callq 0x22e701
andq $0x0, 0x60(%rbx)
xorl %r14d, %r14d
movq %r15, 0x68(%rbx)
movq %r14, 0x58(%rbx)
movq %r14, 0x50(%rbx)
xorl %eax, %eax
addq $0x98, %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: unixShmPurge
static void unixShmPurge(unixFile *pFd){
  unixShmNode *p = pFd->pInode->pShmNode;
  assert( unixMutexHeld() );
  if( p && ALWAYS(p->nRef==0) ){
    int nShmPerMap = unixShmRegionPerMap();
    int i;
    assert( p->pInode==pFd->pInode );
    sqlite3_mutex_free(p->pShmMutex);
    for(i=0; i<p->nRegion; i+=nShmPerMap){
      if( p->hShm>=0 ){
        osMunmap(p->apRegion[i], p->szRegion);
      }else{
        sqlite3_free(p->apRegion[i]);
      }
    }
    sqlite3_free(p->apRegion);
    if( p->hShm>=0 ){
      robust_close(pFd, p->hShm, __LINE__);
      p->hShm = -1;
    }
    p->pInode->pShmNode = 0;
    sqlite3_free(p);
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq 0x10(%rdi), %rax
movq 0x38(%rax), %rbx
testq %rbx, %rbx
je 0x22ed1b
cmpl $0x0, 0x30(%rbx)
je 0x22ed27
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rdi, %r14
callq *0x20bfb0(%rip)         # 0x43ace0
movl %eax, %ecx
shrl $0xf, %ecx
cmpl $0x8000, %eax           # imm = 0x8000
pushq $0x1
popq %r15
cmovgel %ecx, %r15d
xorl %r12d, %r12d
movzwl 0x20(%rbx), %eax
cmpq %rax, %r12
jae 0x22ed7a
cmpl $0x0, 0x18(%rbx)
js 0x22ed68
movq 0x28(%rbx), %rax
movq (%rax,%r12,8), %rdi
movslq 0x1c(%rbx), %rsi
callq *0x20bf4a(%rip)         # 0x43acb0
jmp 0x22ed75
movq 0x28(%rbx), %rax
movq (%rax,%r12,8), %rdi
callq 0x21f7f9
addq %r15, %r12
jmp 0x22ed45
movq 0x28(%rbx), %rdi
callq 0x21f7f9
movl 0x18(%rbx), %esi
testl %esi, %esi
js 0x22ed9b
movq %r14, %rdi
movl $0x944a, %edx           # imm = 0x944A
callq 0x22e7d6
orl $-0x1, 0x18(%rbx)
movq (%rbx), %rax
andq $0x0, 0x38(%rax)
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x21f7f9
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: getFileMode
static int getFileMode(
  const char *zFile,              /* File name */
  mode_t *pMode,                  /* OUT: Permissions of zFile */
  uid_t *pUid,                    /* OUT: uid of zFile. */
  gid_t *pGid                     /* OUT: gid of zFile. */
){
  struct stat sStat;              /* Output of stat() on database file */
  int rc = SQLITE_OK;
  if( 0==osStat(zFile, &sStat) ){
    *pMode = sStat.st_mode & 0777;
    *pUid = sStat.st_uid;
    *pGid = sStat.st_gid;
  }else{
    rc = SQLITE_IOERR_FSTAT;
  }
  return rc;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x90, %rsp
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rsp, %rsi
callq *0x20bcc5(%rip)         # 0x43aae8
movl %eax, %ecx
movl $0x70a, %eax            # imm = 0x70A
testl %ecx, %ecx
jne 0x22ee49
movl $0x1ff, %eax            # imm = 0x1FF
andl 0x18(%rsp), %eax
movl %eax, (%r15)
movl 0x1c(%rsp), %eax
movl %eax, (%r14)
movl 0x20(%rsp), %eax
movl %eax, (%rbx)
xorl %eax, %eax
addq $0x90, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: dotlockClose
static int dotlockClose(sqlite3_file *id) {
  unixFile *pFile = (unixFile*)id;
  assert( id!=0 );
  dotlockUnlock(id, NO_LOCK);
  sqlite3_free(pFile->lockingContext);
  return closeUnixFile(id);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
xorl %esi, %esi
callq 0x22eef1
movq 0x28(%rbx), %rdi
callq 0x21f7f9
movq %rbx, %rdi
callq 0x22e4ea
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: dotlockCheckReservedLock
static int dotlockCheckReservedLock(sqlite3_file *id, int *pResOut) {
  int rc = SQLITE_OK;
  int reserved = 0;
  unixFile *pFile = (unixFile*)id;

  SimulateIOError( return SQLITE_IOERR_CHECKRESERVEDLOCK; );

  assert( pFile );
  reserved = osAccess((const char*)pFile->lockingContext, 0)==0;
  OSTRACE(("TEST WR-LOCK %d %d %d (dotlock)\n", pFile->h, rc, reserved));
  *pResOut = reserved;
  return rc;
}

// Assembly:
pushq %rbx
movq %rsi, %rbx
movq 0x28(%rdi), %rdi
xorl %esi, %esi
callq *0x20bb66(%rip)         # 0x43aab8
xorl %ecx, %ecx
testl %eax, %eax
sete %cl
movl %ecx, (%rbx)
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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:
cmpl $0xc0a, %esi            # imm = 0xC0A
sete %al
andl $0xfb, %esi
cmpl $0xa, %esi
setne %cl
orb %al, %cl
jne 0x22efa9
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
movq 0x80(%rdi), %rax
testq %rax, %rax
je 0x22efa3
xorl %esi, %esi
xorl %edx, %edx
callq *%rax
jmp 0x22efa5
xorl %eax, %eax
movl %eax, 0x58(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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 %r15
pushq %r14
pushq %rbx
subq $0x70, %rsp
movq %rdi, %rbx
movl 0x7c(%rdi), %eax
leaq 0x20(%rsp), %rcx
movq %rsp, %r15
movq %rcx, 0x8(%r15)
movq %rdi, (%r15)
movl $0x46, 0x10(%r15)
movl %eax, 0x14(%r15)
andl $0x0, 0x18(%r15)
movw $0x100, 0x1c(%r15)      # imm = 0x100
movq %r15, %rdi
callq 0x21f955
movq %r15, %rdi
callq 0x221200
movq %rax, %r14
cmpb $0x7, 0x1c(%r15)
jne 0x22f002
movq %rbx, %rdi
callq 0x224bb1
movq %r14, %rax
addq $0x70, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq (%rdi), %rbx
movq 0x20(%rbx), %rax
xorl %ebp, %ebp
cmpq $0x0, 0x28(%rax)
jne 0x22f0c1
movq %rdi, %r14
cmpb $0x0, 0x11b(%rdi)
jne 0x22f0c1
movq (%rbx), %rdi
leaq 0x8(%rsp), %rcx
xorl %esi, %esi
movq %rbx, %rdx
xorl %r8d, %r8d
movl $0x21e, %r9d            # imm = 0x21E
callq 0x22f0cc
testl %eax, %eax
je 0x22f096
movl %eax, %ebp
leaq 0x146ff1(%rip), %rsi    # 0x376077
movq %r14, %rdi
xorl %eax, %eax
callq 0x226dce
movl %ebp, 0x18(%r14)
jmp 0x22f0be
movq 0x8(%rsp), %rdi
movq 0x20(%rbx), %rax
movq %rdi, 0x28(%rax)
movl 0x6c(%rbx), %esi
xorl %ebp, %ebp
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x22c27b
cmpl $0x7, %eax
jne 0x22f0c1
movq %rbx, %rdi
callq 0x224bb1
pushq $0x1
popq %rbp
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq