LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/skeeto[P]flappy/sqlite3.c
// Function: robust_open
static int robust_open(const char *z, int f, mode_t m){
  int fd;
  mode_t m2 = m ? m : SQLITE_DEFAULT_FILE_PERMISSIONS;
  while(1){
#if defined(O_CLOEXEC)
    fd = osOpen(z,f|O_CLOEXEC,m2);
#else
    fd = osOpen(z,f,m2);
#endif
    if( fd<0 ){
      if( errno==EINTR ) continue;
      break;
    }
    if( fd>=SQLITE_MINIMUM_FILE_DESCRIPTOR ) break;
    osClose(fd);
    sqlite3_log(SQLITE_WARNING, 
                "attempt to open \"%s\" as file descriptor %d", z, fd);
    fd = -1;
    if( osOpen("/dev/null", f, m)<0 ) break;
  }
  if( fd>=0 ){
    if( m!=0 ){
      struct stat statbuf;
      if( osFstat(fd, &statbuf)==0 
       && statbuf.st_size==0
       && (statbuf.st_mode&0777)!=m 
      ){
        osFchmod(fd, m);
      }
    }
#if defined(FD_CLOEXEC) && (!defined(O_CLOEXEC) || O_CLOEXEC==0)
    osFcntl(fd, F_SETFD, osFcntl(fd, F_GETFD, 0) | FD_CLOEXEC);
#endif
  }
  return fd;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movl %edx, %ebx
movl %esi, %r14d
movq %rdi, %r15
testl %edx, %edx
movl $0x1a4, %r12d           # imm = 0x1A4
cmovnel %edx, %r12d
movl %esi, %r13d
orl $0x80000, %r13d         # imm = 0x80000
movq %r15, %rdi
movl %r13d, %esi
movl %r12d, %edx
callq *0x687d2(%rip)          # 0x80708
movl %eax, %ebp
testl %eax, %eax
js 0x17f77
cmpl $0x2, %ebp
ja 0x17f83
movl %ebp, %edi
callq *0x687d7(%rip)          # 0x80720
pushq $0x1c
popq %rdi
leaq 0x4b4c8(%rip), %rsi     # 0x6341b
movq %r15, %rdx
movl %ebp, %ecx
xorl %eax, %eax
callq 0xb48d
leaq 0x4b4e0(%rip), %rdi     # 0x63446
movl %r14d, %esi
movl %ebx, %edx
callq *0x68797(%rip)          # 0x80708
testl %eax, %eax
jns 0x17f27
jmp 0x17fb9
callq 0x7030
cmpl $0x4, (%rax)
je 0x17f27
jmp 0x17fbc
testl %ebx, %ebx
je 0x17fbc
leaq 0x8(%rsp), %rsi
movl %ebp, %edi
callq *0x687ec(%rip)          # 0x80780
testl %eax, %eax
jne 0x17fbc
cmpq $0x0, 0x38(%rsp)
jne 0x17fbc
movl $0x1ff, %eax            # imm = 0x1FF
andl 0x20(%rsp), %eax
cmpl %ebx, %eax
je 0x17fbc
movl %ebp, %edi
movl %ebx, %esi
callq *0x688a1(%rip)          # 0x80858
jmp 0x17fbc
pushq $-0x1
popq %rbp
movl %ebp, %eax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/skeeto[P]flappy/sqlite3.c
// Function: unixUnmapfile
static void unixUnmapfile(unixFile *pFd){
  assert( pFd->nFetchOut==0 );
  if( pFd->pMapRegion ){
    osMunmap(pFd->pMapRegion, pFd->mmapSizeActual);
    pFd->pMapRegion = 0;
    pFd->mmapSize = 0;
    pFd->mmapSizeActual = 0;
  }
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x68(%rdi), %rdi
testq %rdi, %rdi
je 0x180ea
movq 0x58(%rbx), %rsi
callq *0x6883a(%rip)          # 0x80918
andq $0x0, 0x68(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x50(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/skeeto[P]flappy/sqlite3.c
// Function: sqlite3BtreeSchema
SQLITE_PRIVATE void *sqlite3BtreeSchema(Btree *p, int nBytes, void(*xFree)(void *)){
  BtShared *pBt = p->pBt;
  sqlite3BtreeEnter(p);
  if( !pBt->pSchema && nBytes ){
    pBt->pSchema = sqlite3DbMallocZero(0, nBytes);
    pBt->xFreeSchema = xFree;
  }
  sqlite3BtreeLeave(p);
  return pBt->pSchema;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r14
movl %esi, %ebp
movq %rdi, %rbx
movq 0x8(%rdi), %r15
callq 0xca44
testl %ebp, %ebp
je 0x197ac
cmpq $0x0, 0x40(%r15)
jne 0x197ac
xorl %edi, %edi
movl %ebp, %esi
callq 0xfabf
movq %rax, 0x40(%r15)
movq %r14, 0x48(%r15)
movq %rbx, %rdi
callq 0xde91
movq 0x40(%r15), %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/skeeto[P]flappy/sqlite3.c
// Function: unlockBtreeMutex
static void unlockBtreeMutex(Btree *p){
  BtShared *pBt = p->pBt;
  assert( p->locked==1 );
  assert( sqlite3_mutex_held(pBt->mutex) );
  assert( sqlite3_mutex_held(p->db->mutex) );
  assert( p->db==pBt->db );

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

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rax
movq 0x50(%rax), %rdi
testq %rdi, %rdi
je 0x1e3c7
callq *0x61f71(%rip)          # 0x80338
movb $0x0, 0x12(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/skeeto[P]flappy/sqlite3.c
// Function: lockBtreeMutex
static void lockBtreeMutex(Btree *p){
  assert( p->locked==0 );
  assert( sqlite3_mutex_notheld(p->pBt->mutex) );
  assert( sqlite3_mutex_held(p->db->mutex) );

  sqlite3_mutex_enter(p->pBt->mutex);
  p->pBt->db = p->db;
  p->locked = 1;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rax
movq 0x50(%rax), %rdi
testq %rdi, %rdi
je 0x1e3e8
callq *0x61f44(%rip)          # 0x80328
movq 0x8(%rbx), %rax
movq (%rbx), %rcx
movq %rcx, 0x8(%rax)
movb $0x1, 0x12(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/skeeto[P]flappy/sqlite3.c
// Function: vdbeFreeOpArray
static void vdbeFreeOpArray(sqlite3 *db, Op *aOp, int nOp){
  if( aOp ){
    Op *pOp;
    for(pOp=aOp; pOp<&aOp[nOp]; pOp++){
      freeP4(db, pOp->p4type, pOp->p4.p);
#ifdef SQLITE_ENABLE_EXPLAIN_COMMENTS
      sqlite3DbFree(db, pOp->zComment);
#endif     
    }
  }
  sqlite3DbFree(db, aOp);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
testq %rsi, %rsi
je 0x20dc7
movslq %edx, %rax
imulq $0x18, %rax, %r15
addq %rbx, %r15
movq %rbx, %r12
cmpq %r15, %r12
jae 0x20dc7
movsbl 0x1(%r12), %esi
movq 0x10(%r12), %rdx
movq %r14, %rdi
callq 0x20ddd
addq $0x18, %r12
jmp 0x20da9
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x9805
// File: /workspace/github_c_makefile_star2_O2/skeeto[P]flappy/sqlite3.c
// Function: sqlite3VdbeEnter
SQLITE_PRIVATE void sqlite3VdbeEnter(Vdbe *p){
  int i;
  yDbMask mask;
  sqlite3 *db;
  Db *aDb;
  int nDb;
  if( p->lockMask==0 ) return;  /* The common case */
  db = p->db;
  aDb = db->aDb;
  nDb = db->nDb;
  for(i=0, mask=1; i<nDb; i++, mask += mask){
    if( i!=1 && (mask & p->lockMask)!=0 && ALWAYS(aDb[i].pBt!=0) ){
      sqlite3BtreeEnter(aDb[i].pBt);
    }
  }
}

// Assembly:
cmpl $0x0, 0xa4(%rdi)
je 0x21939
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rax
movq 0x20(%rax), %r14
movl 0x28(%rax), %r15d
xorl %r12d, %r12d
testl %r15d, %r15d
cmovlel %r12d, %r15d
shlq $0x5, %r15
pushq $0x1
popq %rbp
cmpq %r12, %r15
je 0x21931
cmpq $0x20, %r12
je 0x21929
testl %ebp, 0xa4(%rbx)
je 0x21929
movq 0x8(%r14,%r12), %rdi
testq %rdi, %rdi
je 0x21929
callq 0xca44
addl %ebp, %ebp
addq $0x20, %r12
jmp 0x21907
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/skeeto[P]flappy/sqlite3.c
// Function: sqlite3VdbeCheckFk
SQLITE_PRIVATE int sqlite3VdbeCheckFk(Vdbe *p, int deferred){
  sqlite3 *db = p->db;
  if( (deferred && (db->nDeferredCons+db->nDeferredImmCons)>0) 
   || (!deferred && p->nFkConstraint>0) 
  ){
    p->rc = SQLITE_CONSTRAINT_FOREIGNKEY;
    p->errorAction = OE_Abort;
    sqlite3SetString(&p->zErrMsg, db, "FOREIGN KEY constraint failed");
    return SQLITE_ERROR;
  }
  return SQLITE_OK;
}

// Assembly:
movl %esi, %eax
movq (%rdi), %rsi
testl %eax, %eax
je 0x21a9c
movq 0x310(%rsi), %rax
addq 0x308(%rsi), %rax
jle 0x21aa6
pushq %rax
movl $0x313, 0x94(%rdi)      # imm = 0x313
movb $0x2, 0x98(%rdi)
addq $0x58, %rdi
leaq 0x41b97(%rip), %rdx     # 0x63624
xorl %eax, %eax
callq 0x2208f
pushq $0x1
popq %rax
addq $0x8, %rsp
retq
cmpq $0x0, 0xd0(%rdi)
jg 0x21a70
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/skeeto[P]flappy/sqlite3.c
// Function: sqlite3VdbeLeave
SQLITE_PRIVATE void sqlite3VdbeLeave(Vdbe *p){
  int i;
  yDbMask mask;
  sqlite3 *db;
  Db *aDb;
  int nDb;
  if( p->lockMask==0 ) return;  /* The common case */
  db = p->db;
  aDb = db->aDb;
  nDb = db->nDb;
  for(i=0, mask=1; i<nDb; i++, mask += mask){
    if( i!=1 && (mask & p->lockMask)!=0 && ALWAYS(aDb[i].pBt!=0) ){
      sqlite3BtreeLeave(aDb[i].pBt);
    }
  }
}

// Assembly:
cmpl $0x0, 0xa4(%rdi)
je 0x21b0b
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rax
movq 0x20(%rax), %r14
movl 0x28(%rax), %r15d
xorl %r12d, %r12d
testl %r15d, %r15d
cmovlel %r12d, %r15d
shlq $0x5, %r15
pushq $0x1
popq %rbp
cmpq %r12, %r15
je 0x21b03
cmpq $0x20, %r12
je 0x21afb
testl %ebp, 0xa4(%rbx)
je 0x21afb
movq 0x8(%r14,%r12), %rdi
testq %rdi, %rdi
je 0x21afb
callq 0xde91
addl %ebp, %ebp
addq $0x20, %r12
jmp 0x21ad9
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/skeeto[P]flappy/sqlite3.c
// Function: sqlite3VdbeMemFromBtree
SQLITE_PRIVATE int sqlite3VdbeMemFromBtree(
  BtCursor *pCur,   /* Cursor pointing at record to retrieve. */
  u32 offset,       /* Offset from the start of data to return bytes from. */
  u32 amt,          /* Number of bytes to return. */
  int key,          /* If true, retrieve from the btree key, not data. */
  Mem *pMem         /* OUT: Return data in this Mem structure. */
){
  char *zData;        /* Data from the btree layer */
  u32 available = 0;  /* Number of bytes available on the local btree page */
  int rc = SQLITE_OK; /* Return code */

  assert( sqlite3BtreeCursorIsValid(pCur) );

  /* Note: the calls to BtreeKeyFetch() and DataFetch() below assert() 
  ** that both the BtShared and database handle mutexes are held. */
  assert( (pMem->flags & MEM_RowSet)==0 );
  if( key ){
    zData = (char *)sqlite3BtreeKeyFetch(pCur, &available);
  }else{
    zData = (char *)sqlite3BtreeDataFetch(pCur, &available);
  }
  assert( zData!=0 );

  if( offset+amt<=available ){
    sqlite3VdbeMemRelease(pMem);
    pMem->z = &zData[offset];
    pMem->flags = MEM_Blob|MEM_Ephem;
  }else if( SQLITE_OK==(rc = sqlite3VdbeMemGrow(pMem, amt+2, 0)) ){
    pMem->flags = MEM_Blob|MEM_Dyn|MEM_Term;
    pMem->enc = 0;
    pMem->type = SQLITE_BLOB;
    if( key ){
      rc = sqlite3BtreeKey(pCur, offset, amt, pMem->z);
    }else{
      rc = sqlite3BtreeData(pCur, offset, amt, pMem->z);
    }
    pMem->z[amt] = 0;
    pMem->z[amt+1] = 0;
    if( rc!=SQLITE_OK ){
      sqlite3VdbeMemRelease(pMem);
    }
  }
  pMem->n = (int)amt;

  return rc;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %rbx
movl %ecx, %ebp
movl %edx, %r14d
movl %esi, %r15d
movq %rdi, %r12
andl $0x0, 0x4(%rsp)
leaq 0x4(%rsp), %rsi
testl %ecx, %ecx
je 0x2ad10
callq 0x2ac81
jmp 0x2ad15
callq 0x2acd1
movq %rax, %r13
leal (%r14,%r15), %eax
cmpl 0x4(%rsp), %eax
jbe 0x2ad53
leal 0x2(%r14), %esi
movq %rbx, %rdi
xorl %edx, %edx
callq 0xf8ff
testl %eax, %eax
jne 0x2ad6d
movl $0x40610, 0x24(%rbx)    # imm = 0x40610
movq 0x8(%rbx), %rcx
movq %r12, %rdi
movl %r15d, %esi
movl %r14d, %edx
testl %ebp, %ebp
je 0x2ad80
callq 0x1f63e
jmp 0x2ad85
movq %rbx, %rdi
callq 0xe597
movl %r15d, %eax
addq %rax, %r13
movq %r13, 0x8(%rbx)
movw $0x1010, 0x24(%rbx)     # imm = 0x1010
xorl %eax, %eax
movl %r14d, 0x20(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x1158f
movl %eax, %ebp
movq 0x8(%rbx), %rcx
movl %r14d, %edx
xorl %eax, %eax
movb %al, (%rcx,%rdx)
movq 0x8(%rbx), %rcx
leal 0x1(%r14), %edx
movb %al, (%rcx,%rdx)
testl %ebp, %ebp
je 0x2ad6d
movq %rbx, %rdi
callq 0xe597
movl %ebp, %eax
jmp 0x2ad6d
// File: /workspace/github_c_makefile_star2_O2/skeeto[P]flappy/sqlite3.c
// Function: sqlite3AnalysisLoad
SQLITE_PRIVATE int sqlite3AnalysisLoad(sqlite3 *db, int iDb){
  analysisInfo sInfo;
  HashElem *i;
  char *zSql;
  int rc;

  assert( iDb>=0 && iDb<db->nDb );
  assert( db->aDb[iDb].pBt!=0 );

  /* Clear any prior statistics */
  assert( sqlite3SchemaMutexHeld(db, iDb, 0) );
  for(i=sqliteHashFirst(&db->aDb[iDb].pSchema->idxHash);i;i=sqliteHashNext(i)){
    Index *pIdx = sqliteHashData(i);
    sqlite3DefaultRowEst(pIdx);
#ifdef SQLITE_ENABLE_STAT3_OR_STAT4
    sqlite3DeleteIndexSamples(db, pIdx);
    pIdx->aSample = 0;
#endif
  }

  /* Check to make sure the sqlite_stat1 table exists */
  sInfo.db = db;
  sInfo.zDatabase = db->aDb[iDb].zName;
  if( sqlite3FindTable(db, "sqlite_stat1", sInfo.zDatabase)==0 ){
    return SQLITE_ERROR;
  }

  /* Load new statistics out of the sqlite_stat1 table */
  zSql = sqlite3MPrintf(db, 
      "SELECT tbl,idx,stat FROM %Q.sqlite_stat1", sInfo.zDatabase);
  if( zSql==0 ){
    rc = SQLITE_NOMEM;
  }else{
    rc = sqlite3_exec(db, zSql, analysisLoader, &sInfo, 0);
    sqlite3DbFree(db, zSql);
  }


  /* Load the statistics from the sqlite_stat4 table. */
#ifdef SQLITE_ENABLE_STAT3_OR_STAT4
  if( rc==SQLITE_OK ){
    int lookasideEnabled = db->lookaside.bEnabled;
    db->lookaside.bEnabled = 0;
    rc = loadStat4(db, sInfo.zDatabase);
    db->lookaside.bEnabled = lookasideEnabled;
  }
#endif

  if( rc==SQLITE_NOMEM ){
    db->mallocFailed = 1;
  }
  return rc;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movq 0x20(%rdi), %rax
movslq %esi, %r14
shlq $0x5, %r14
movq 0x18(%rax,%r14), %r15
addq $0x28, %r15
movq (%r15), %r15
testq %r15, %r15
je 0x2c586
movq 0x10(%r15), %rdi
callq 0x2fe69
jmp 0x2c573
movq %rbx, 0x8(%rsp)
movq 0x20(%rbx), %rax
movq (%rax,%r14), %r14
movq %r14, 0x10(%rsp)
leaq 0x378a6(%rip), %rsi     # 0x63e45
movq %rbx, %rdi
movq %r14, %rdx
callq 0x2fea7
testq %rax, %rax
je 0x2c5ff
leaq 0x37873(%rip), %rsi     # 0x63e29
movq %rbx, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x10c1b
testq %rax, %rax
je 0x2c5f7
movq %rax, %r14
leaq 0x3972(%rip), %rdx      # 0x2ff44
leaq 0x8(%rsp), %rcx
movq %rbx, %rdi
movq %rax, %rsi
xorl %r8d, %r8d
callq 0x11aca
movl %eax, %ebp
movq %rbx, %rdi
movq %r14, %rsi
callq 0x9805
cmpl $0x7, %ebp
jne 0x2c602
movb $0x1, 0x50(%rbx)
pushq $0x7
jmp 0x2c601
pushq $0x1
popq %rbp
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/skeeto[P]flappy/sqlite3.c
// Function: vdbeSorterCompare
static void vdbeSorterCompare(
  const VdbeCursor *pCsr,         /* Cursor object (for pKeyInfo) */
  int nIgnore,                    /* Ignore the last nIgnore fields */
  const void *pKey1, int nKey1,   /* Left side of comparison */
  const void *pKey2, int nKey2,   /* Right side of comparison */
  int *pRes                       /* OUT: Result of comparison */
){
  KeyInfo *pKeyInfo = pCsr->pKeyInfo;
  VdbeSorter *pSorter = pCsr->pSorter;
  UnpackedRecord *r2 = pSorter->pUnpacked;
  int i;

  if( pKey2 ){
    sqlite3VdbeRecordUnpack(pKeyInfo, nKey2, pKey2, r2);
  }

  if( nIgnore ){
    r2->nField = pKeyInfo->nField - nIgnore;
    assert( r2->nField>0 );
    for(i=0; i<r2->nField; i++){
      if( r2->aMem[i].flags & MEM_Null ){
        *pRes = -1;
        return;
      }
    }
    r2->flags |= UNPACKED_PREFIX_MATCH;
  }

  *pRes = sqlite3VdbeRecordCompare(nKey1, pKey1, r2);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebp
movq %rdx, %rbx
movl %esi, %r15d
movq 0x10(%rdi), %r12
movq 0x50(%rdi), %rax
movq 0x48(%rax), %r14
testq %r8, %r8
je 0x2f237
movq %r12, %rdi
movl %r9d, %esi
movq %r8, %rdx
movq %r14, %rcx
callq 0x2ba5c
movq 0x40(%rsp), %r13
testl %r15d, %r15d
je 0x2f27d
movzwl 0x6(%r12), %eax
subl %r15d, %eax
movw %ax, 0x8(%r14)
movzwl %ax, %eax
imulq $0x38, %rax, %rcx
addq $0x38, %rcx
xorl %edx, %edx
pushq $-0x1
popq %rax
leaq 0x38(%rdx), %rsi
cmpq %rsi, %rcx
je 0x2f278
movq 0x10(%r14), %rdi
testb $0x1, 0x24(%rdi,%rdx)
movq %rsi, %rdx
je 0x2f25f
jmp 0x2f28a
orb $0x2, 0xa(%r14)
movl %ebp, %edi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x2cd76
movl %eax, (%r13)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/skeeto[P]flappy/sqlite3.c
// Function: sqlite3DefaultRowEst
SQLITE_PRIVATE void sqlite3DefaultRowEst(Index *pIdx){
  tRowcnt *a = pIdx->aiRowEst;
  int i;
  tRowcnt n;
  assert( a!=0 );
  a[0] = pIdx->pTable->nRowEst;
  if( a[0]<10 ) a[0] = 10;
  n = 10;
  for(i=1; i<=pIdx->nKeyCol; i++){
    a[i] = n;
    if( n>5 ) n--;
  }
  if( pIdx->onError!=OE_None ){
    a[pIdx->nKeyCol] = 1;
  }
}

// Assembly:
movq 0x18(%rdi), %rax
movl 0x38(%rax), %ecx
cmpl $0xb, %ecx
pushq $0xa
popq %rdx
cmovbl %edx, %ecx
movq 0x10(%rdi), %rax
movl %ecx, (%rax)
movzwl 0x5e(%rdi), %ecx
xorl %esi, %esi
cmpq %rsi, %rcx
je 0x2fe99
movl %edx, 0x4(%rax,%rsi,4)
cmpl $0x6, %edx
adcl $-0x1, %edx
incq %rsi
jmp 0x2fe85
cmpb $0x0, 0x62(%rdi)
je 0x2fea6
movl $0x1, (%rax,%rcx,4)
retq
// File: /workspace/github_c_makefile_star2_O2/skeeto[P]flappy/sqlite3.c
// Function: analysisLoader
static int analysisLoader(void *pData, int argc, char **argv, char **NotUsed){
  analysisInfo *pInfo = (analysisInfo*)pData;
  Index *pIndex;
  Table *pTable;
  const char *z;

  assert( argc==3 );
  UNUSED_PARAMETER2(NotUsed, argc);

  if( argv==0 || argv[0]==0 || argv[2]==0 ){
    return 0;
  }
  pTable = sqlite3FindTable(pInfo->db, argv[0], pInfo->zDatabase);
  if( pTable==0 ){
    return 0;
  }
  if( argv[1]==0 ){
    pIndex = 0;
  }else if( sqlite3_stricmp(argv[0],argv[1])==0 ){
    pIndex = sqlite3PrimaryKeyIndex(pTable);
  }else{
    pIndex = sqlite3FindIndex(pInfo->db, argv[1], pInfo->zDatabase);
  }
  z = argv[2];

  if( pIndex ){
    decodeIntArray((char*)z, pIndex->nKeyCol+1, pIndex->aiRowEst, pIndex);
    if( pIndex->pPartIdxWhere==0 ) pTable->nRowEst = pIndex->aiRowEst[0];
  }else{
    Index fakeIdx;
    fakeIdx.szIdxRow = pTable->szTabRow;
    decodeIntArray((char*)z, 1, &pTable->nRowEst, &fakeIdx);
    pTable->szTabRow = fakeIdx.szIdxRow;
  }

  return 0;
}

// Assembly:
testq %rdx, %rdx
je 0x30030
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdx, %rbp
movq (%rdx), %r12
testq %r12, %r12
je 0x30022
movq 0x10(%rbp), %r14
testq %r14, %r14
je 0x30022
movq (%rdi), %r13
movq 0x8(%rdi), %r15
movq %r13, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x2fea7
testq %rax, %rax
je 0x30022
movq %rax, %rbx
movq 0x8(%rbp), %rbp
testq %rbp, %rbp
je 0x2fff8
movq %r12, %rdi
movq %rbp, %rsi
callq 0xb6e4
testl %eax, %eax
je 0x2ffc0
movq %r13, %rdi
movq %rbp, %rsi
movq %r15, %rdx
callq 0x2fbd0
jmp 0x2ffc8
movq %rbx, %rdi
callq 0x30033
movq %rax, %r15
testq %rax, %rax
je 0x2fff8
movzwl 0x5e(%r15), %esi
incl %esi
movq 0x10(%r15), %rdx
movq %r14, %rdi
movq %r15, %rcx
callq 0x30054
cmpq $0x0, 0x48(%r15)
jne 0x30022
movq 0x10(%r15), %rax
movl (%rax), %eax
movl %eax, 0x38(%rbx)
jmp 0x30022
movzwl 0x46(%rbx), %eax
movq %rsp, %r15
movw %ax, 0x5c(%r15)
movq %rbx, %rdx
addq $0x38, %rdx
pushq $0x1
popq %rsi
movq %r14, %rdi
movq %r15, %rcx
callq 0x30054
movzwl 0x5c(%r15), %eax
movw %ax, 0x46(%rbx)
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/skeeto[P]flappy/sqlite3.c
// Function: decodeIntArray
static void decodeIntArray(
  char *zIntArray,       /* String containing int array to decode */
  int nOut,              /* Number of slots in aOut[] */
  tRowcnt *aOut,         /* Store integers here */
  Index *pIndex          /* Handle extra flags for this index, if not NULL */
){
  char *z = zIntArray;
  int c;
  int i;
  tRowcnt v;

#ifdef SQLITE_ENABLE_STAT3_OR_STAT4
  if( z==0 ) z = "";
#else
  if( NEVER(z==0) ) z = "";
#endif
  for(i=0; *z && i<nOut; i++){
    v = 0;
    while( (c=z[0])>='0' && c<='9' ){
      v = v*10 + c - '0';
      z++;
    }
    aOut[i] = v;
    if( *z==' ' ) z++;
  }
#ifndef SQLITE_ENABLE_STAT3_OR_STAT4
  assert( pIndex!=0 );
#else
  if( pIndex )
#endif
  {
    if( strcmp(z, "unordered")==0 ){
      pIndex->bUnordered = 1;
    }else if( sqlite3_strglob("sz=[0-9]*", z)==0 ){
      int v32 = 0;
      sqlite3GetInt32(z+3, &v32);
      pIndex->szIdxRow = sqlite3LogEst(v32);
    }
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rcx, %rbx
testq %rdi, %rdi
leaq 0x35f9a(%rip), %r14     # 0x66004
cmovneq %rdi, %r14
movslq %esi, %rax
xorl %ecx, %ecx
movb (%r14), %sil
testb %sil, %sil
je 0x300b6
cmpq %rax, %rcx
jge 0x300b6
xorl %edi, %edi
leal -0x30(%rsi), %r8d
cmpb $0x9, %r8b
ja 0x300a1
movzbl %sil, %esi
imull $0xa, %edi, %edi
addl %esi, %edi
addl $-0x30, %edi
movb 0x1(%r14), %sil
incq %r14
jmp 0x30082
movl %edi, (%rdx,%rcx,4)
xorl %esi, %esi
cmpb $0x20, (%r14)
sete %sil
addq %rsi, %r14
incq %rcx
jmp 0x30073
leaq 0x33d95(%rip), %rsi     # 0x63e52
movq %r14, %rdi
callq 0x73f0
testl %eax, %eax
je 0x30102
leaq 0x33d8c(%rip), %rdi     # 0x63e5c
movq %r14, %rsi
callq 0x11781
testl %eax, %eax
jne 0x30106
leaq 0xc(%rsp), %r15
andl $0x0, (%r15)
addq $0x3, %r14
movq %r14, %rdi
movq %r15, %rsi
callq 0x2fc5d
movslq (%r15), %rdi
callq 0x30110
movw %ax, 0x5c(%rbx)
jmp 0x30106
orb $0x4, 0x63(%rbx)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/skeeto[P]flappy/sqlite3.c
// Function: sqlite3LogEst
SQLITE_PRIVATE LogEst sqlite3LogEst(u64 x){
  static LogEst a[] = { 0, 2, 3, 5, 6, 7, 8, 9 };
  LogEst y = 40;
  if( x<8 ){
    if( x<2 ) return 0;
    while( x<8 ){  y -= 10; x <<= 1; }
  }else{
    while( x>255 ){ y += 40; x >>= 4; }
    while( x>15 ){  y += 10; x >>= 1; }
  }
  return a[x&7] + y - 10;
}

// Assembly:
cmpq $0x8, %rdi
jae 0x3011f
cmpq $0x2, %rdi
jae 0x30153
xorl %eax, %eax
retq
movw $0x28, %ax
cmpq $0xff, %rdi
jbe 0x3013b
addl $0x28, %eax
shrq $0x4, %rdi
jmp 0x30123
addl $0xa, %eax
shrq %rdi
cmpq $0x10, %rdi
jae 0x30135
andl $0x7, %edi
leaq 0x32fe5(%rip), %rcx     # 0x63130
addw (%rcx,%rdi,2), %ax
addl $-0xa, %eax
retq
movw $0x28, %ax
cmpq $0x7, %rdi
ja 0x30141
addl $-0xa, %eax
addq %rdi, %rdi
jmp 0x30157
// File: /workspace/github_c_makefile_star2_O2/skeeto[P]flappy/sqlite3.c
// Function: freeIndex
static void freeIndex(sqlite3 *db, Index *p){
#ifndef SQLITE_OMIT_ANALYZE
  sqlite3DeleteIndexSamples(db, p);
#endif
  if( db==0 || db->pnBytesFreed==0 ) sqlite3KeyInfoUnref(p->pKeyInfo);
  sqlite3ExprDelete(db, p->pPartIdxWhere);
  sqlite3DbFree(db, p->zColAff);
  if( p->isResized ) sqlite3DbFree(db, p->azColl);
  sqlite3DbFree(db, p);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
testq %rdi, %rdi
je 0x3040a
cmpq $0x0, 0x318(%r14)
jne 0x30413
movq 0x50(%rbx), %rdi
callq 0x20e9a
movq 0x48(%rbx), %rsi
movq %r14, %rdi
callq 0x3044f
movq 0x20(%rbx), %rsi
movq %r14, %rdi
callq 0x9805
testb $0x10, 0x63(%rbx)
je 0x3043d
movq 0x40(%rbx), %rsi
movq %r14, %rdi
callq 0x9805
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x9805
// File: /workspace/github_c_makefile_star2_O2/skeeto[P]flappy/sqlite3.c
// Function: sqlite3ExprDelete
SQLITE_PRIVATE void sqlite3ExprDelete(sqlite3 *db, Expr *p){
  if( p==0 ) return;
  /* Sanity check: Assert that the IntValue is non-negative if it exists */
  assert( !ExprHasProperty(p, EP_IntValue) || p->u.iValue>=0 );
  if( !ExprHasProperty(p, EP_TokenOnly) ){
    /* The Expr.x union is never used at the same time as Expr.pRight */
    assert( p->x.pList==0 || p->pRight==0 );
    sqlite3ExprDelete(db, p->pLeft);
    sqlite3ExprDelete(db, p->pRight);
    if( ExprHasProperty(p, EP_MemToken) ) sqlite3DbFree(db, p->u.zToken);
    if( ExprHasProperty(p, EP_xIsSelect) ){
      sqlite3SelectDelete(db, p->x.pSelect);
    }else{
      sqlite3ExprListDelete(db, p->x.pList);
    }
  }
  if( !ExprHasProperty(p, EP_Static) ){
    sqlite3DbFree(db, p);
  }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rsi, %rsi
je 0x304c5
movq %rsi, %rbx
movq %rdi, %r14
testb $0x40, 0x5(%rsi)
jne 0x304ad
movq 0x10(%rbx), %rsi
movq %r14, %rdi
callq 0x3044f
movq 0x18(%rbx), %rsi
movq %r14, %rdi
callq 0x3044f
movl 0x4(%rbx), %eax
btl $0x10, %eax
jae 0x30494
movq 0x8(%rbx), %rsi
movq %r14, %rdi
callq 0x9805
movl 0x4(%rbx), %eax
btl $0xb, %eax
movq 0x20(%rbx), %rsi
movq %r14, %rdi
jb 0x304a8
callq 0x304f4
jmp 0x304ad
callq 0x304cd
testb $-0x80, 0x5(%rbx)
jne 0x304c5
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x9805
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/skeeto[P]flappy/sqlite3.c
// Function: sqlite3OpenTable
SQLITE_PRIVATE void sqlite3OpenTable(
  Parse *pParse,  /* Generate code into this VDBE */
  int iCur,       /* The cursor number of the table */
  int iDb,        /* The database index in sqlite3.aDb[] */
  Table *pTab,    /* The table to be opened */
  int opcode      /* OP_OpenRead or OP_OpenWrite */
){
  Vdbe *v;
  assert( !IsVirtual(pTab) );
  v = sqlite3GetVdbe(pParse);
  assert( opcode==OP_OpenWrite || opcode==OP_OpenRead );
  sqlite3TableLock(pParse, iDb, pTab->tnum, 
                   (opcode==OP_OpenWrite)?1:0, pTab->zName);
  if( HasRowid(pTab) ){
    sqlite3VdbeAddOp4Int(v, opcode, iCur, pTab->tnum, iDb, pTab->nCol);
    VdbeComment((v, "%s", pTab->zName));
  }else{
    Index *pPk = sqlite3PrimaryKeyIndex(pTab);
    assert( pPk!=0 );
    assert( pPk->tnum=pTab->tnum );
    sqlite3VdbeAddOp3(v, opcode, iCur, pPk->tnum, iDb);
    sqlite3VdbeSetP4KeyInfo(pParse, pPk);
    VdbeComment((v, "%s", pTab->zName));
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r8d, %ebp
movq %rcx, %r12
movl %edx, %ebx
movl %esi, %r14d
movq %rdi, %r15
callq 0x43f1b
movq %rax, %r13
movl 0x3c(%r12), %edx
xorl %ecx, %ecx
cmpl $0x33, %ebp
sete %cl
movq (%r12), %r8
movq %r15, %rdi
movl %ebx, %esi
callq 0x4410c
testb $0x20, 0x48(%r12)
jne 0x440d5
movl 0x3c(%r12), %ecx
movswl 0x42(%r12), %r9d
movq %r13, %rdi
movl %ebp, %esi
movl %r14d, %edx
movl %ebx, %r8d
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x441d6
movq %r12, %rdi
callq 0x30033
movq %rax, %r12
movl 0x58(%rax), %ecx
movq %r13, %rdi
movl %ebp, %esi
movl %r14d, %edx
movl %ebx, %r8d
callq 0x43f69
movq %r15, %rdi
movq %r12, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x441fe
// File: /workspace/github_c_makefile_star2_O2/skeeto[P]flappy/sqlite3.c
// Function: sqlite3VdbeSetP4KeyInfo
SQLITE_PRIVATE void sqlite3VdbeSetP4KeyInfo(Parse *pParse, Index *pIdx){
  Vdbe *v = pParse->pVdbe;
  assert( v!=0 );
  assert( pIdx!=0 );
  sqlite3VdbeChangeP4(v, -1, (char*)sqlite3KeyInfoOfIndex(pParse, pIdx),
                      P4_KEYINFO);
}

// Assembly:
pushq %rbx
movq 0x10(%rdi), %rbx
callq 0x4421a
pushq $-0x1
popq %rsi
pushq $-0x6
popq %rcx
movq %rbx, %rdi
movq %rax, %rdx
popq %rbx
jmp 0x10de3
// File: /workspace/github_c_makefile_star2_O2/skeeto[P]flappy/sqlite3.c
// Function: sqlite3KeyInfoOfIndex
SQLITE_PRIVATE KeyInfo *sqlite3KeyInfoOfIndex(Parse *pParse, Index *pIdx){
  if( pParse->nErr ) return 0;
#ifndef SQLITE_OMIT_SHARED_CACHE
  if( pIdx->pKeyInfo && pIdx->pKeyInfo->db!=pParse->db ){
    sqlite3KeyInfoUnref(pIdx->pKeyInfo);
    pIdx->pKeyInfo = 0;
  }
#endif
  if( pIdx->pKeyInfo==0 ){
    int i;
    int nCol = pIdx->nColumn;
    int nKey = pIdx->nKeyCol;
    KeyInfo *pKey;
    if( pIdx->uniqNotNull ){
      pKey = sqlite3KeyInfoAlloc(pParse->db, nKey, nCol-nKey);
    }else{
      pKey = sqlite3KeyInfoAlloc(pParse->db, nCol, 0);
    }
    if( pKey ){
      assert( sqlite3KeyInfoIsWriteable(pKey) );
      for(i=0; i<nCol; i++){
        char *zColl = pIdx->azColl[i];
        if( NEVER(zColl==0) ) zColl = "BINARY";
        pKey->aColl[i] = sqlite3LocateCollSeq(pParse, zColl);
        pKey->aSortOrder[i] = pIdx->aSortOrder[i];
      }
      if( pParse->nErr ){
        sqlite3KeyInfoUnref(pKey);
      }else{
        pIdx->pKeyInfo = pKey;
      }
    }
  }
  return sqlite3KeyInfoRef(pIdx->pKeyInfo);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
cmpl $0x0, 0x50(%rdi)
je 0x44233
xorl %r15d, %r15d
jmp 0x442ee
movq %rsi, %rbx
movq %rdi, %r14
movq 0x50(%rsi), %r15
testq %r15, %r15
je 0x4425c
movq 0x10(%r15), %rax
cmpq (%r14), %rax
je 0x442eb
movq %r15, %rdi
callq 0x20e9a
andq $0x0, 0x50(%rbx)
movzwl 0x60(%rbx), %ebp
testb $0x8, 0x63(%rbx)
jne 0x4426f
movq (%r14), %rdi
movl %ebp, %esi
xorl %edx, %edx
jmp 0x4427a
movzwl 0x5e(%rbx), %esi
movq (%r14), %rdi
movl %ebp, %edx
subl %esi, %edx
callq 0x44300
movq %rax, %r15
testq %rax, %rax
je 0x442d9
movl %ebp, %r12d
xorl %r13d, %r13d
leaq 0x1f86a(%rip), %rbp     # 0x63afe
cmpq %r13, %r12
je 0x442ca
movq 0x40(%rbx), %rax
movq (%rax,%r13,8), %rsi
testq %rsi, %rsi
cmoveq %rbp, %rsi
movq %r14, %rdi
callq 0x4436b
movq %rax, 0x20(%r15,%r13,8)
movq 0x38(%rbx), %rax
movb (%rax,%r13), %al
movq 0x18(%r15), %rcx
movb %al, (%rcx,%r13)
incq %r13
jmp 0x44294
cmpl $0x0, 0x50(%r14)
je 0x442e7
movq %r15, %rdi
callq 0x20e9a
movq 0x50(%rbx), %r15
testq %r15, %r15
jne 0x442eb
jmp 0x4422b
movq %r15, 0x50(%rbx)
incl (%r15)
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/skeeto[P]flappy/sqlite3.c
// Function: sqlite3KeyInfoAlloc
SQLITE_PRIVATE KeyInfo *sqlite3KeyInfoAlloc(sqlite3 *db, int N, int X){
  KeyInfo *p = sqlite3DbMallocZero(0, 
                   sizeof(KeyInfo) + (N+X)*(sizeof(CollSeq*)+1));
  if( p ){
    p->aSortOrder = (u8*)&p->aColl[N+X];
    p->nField = (u16)N;
    p->nXField = (u16)X;
    p->enc = ENC(db);
    p->db = db;
    p->nRef = 1;
  }else{
    db->mallocFailed = 1;
  }
  return p;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %r14d
movl %esi, %r15d
movq %rdi, %rbx
leal (%r14,%r15), %r12d
leal (%r12,%r12,8), %esi
addl $0x28, %esi
xorl %edi, %edi
callq 0xfabf
testq %rax, %rax
je 0x4435b
movslq %r12d, %rcx
leaq (%rax,%rcx,8), %rcx
addq $0x20, %rcx
movq %rcx, 0x18(%rax)
movw %r15w, 0x6(%rax)
movw %r14w, 0x8(%rax)
movq 0x20(%rbx), %rcx
movq 0x18(%rcx), %rcx
movb 0x71(%rcx), %cl
movb %cl, 0x4(%rax)
movq %rbx, 0x10(%rax)
movl $0x1, (%rax)
jmp 0x4435f
movb $0x1, 0x50(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/skeeto[P]flappy/sqlite3.c
// Function: sqlite3ExprCodeTemp
SQLITE_PRIVATE int sqlite3ExprCodeTemp(Parse *pParse, Expr *pExpr, int *pReg){
  int r2;
  pExpr = sqlite3ExprSkipCollate(pExpr);
  if( ConstFactorOk(pParse)
   && pExpr->op!=TK_REGISTER
   && sqlite3ExprIsConstantNotJoin(pExpr)
  ){
    ExprList *p = pParse->pConstExpr;
    int i;
    *pReg  = 0;
    if( p ){
      struct ExprList_item *pItem;
      for(pItem=p->a, i=p->nExpr; i>0; pItem++, i--){
        if( pItem->reusable && sqlite3ExprCompare(pItem->pExpr,pExpr,-1)==0 ){
          return pItem->u.iConstExprReg;
        }
      }
    }
    r2 = ++pParse->nMem;
    sqlite3ExprCodeAtInit(pParse, pExpr, r2, 1);
  }else{
    int r1 = sqlite3GetTempReg(pParse);
    r2 = sqlite3ExprCodeTarget(pParse, pExpr, r1);
    if( r2==r1 ){
      *pReg = r1;
    }else{
      sqlite3ReleaseTempReg(pParse, r1);
      *pReg = 0;
    }
  }
  return r2;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %r15
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x46b5d
movq %rax, %r14
cmpl $0x0, 0x178(%rbx)
jle 0x45873
movq (%rbx), %rax
testb $0x8, 0x4c(%rax)
jne 0x45873
cmpb $-0x7b, (%r14)
je 0x45873
movq %r14, %rdi
callq 0x46b88
testl %eax, %eax
je 0x45873
movq 0x168(%rbx), %rax
andl $0x0, (%r15)
testq %rax, %rax
je 0x458ae
movq 0x8(%rax), %r15
movl (%rax), %r12d
addq $0x1c, %r15
pushq $-0x1
popq %rbp
testl %r12d, %r12d
jle 0x458ae
testb $0x4, -0x3(%r15)
je 0x4586a
movq -0x1c(%r15), %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x46b90
testl %eax, %eax
je 0x458c8
decl %r12d
addq $0x20, %r15
jmp 0x4584c
movq %rbx, %rdi
callq 0x46316
movl %eax, %r12d
movq %rbx, %rdi
movq %r14, %rsi
movl %eax, %edx
callq 0x44641
movl %eax, %ebp
cmpl %r12d, %eax
je 0x458a0
movq %rbx, %rdi
movl %r12d, %esi
callq 0x46333
xorl %r12d, %r12d
movl %r12d, (%r15)
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl 0x58(%rbx), %ebp
incl %ebp
movl %ebp, 0x58(%rbx)
pushq $0x1
popq %rcx
movq %rbx, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x46d26
jmp 0x458a3
movl (%r15), %ebp
jmp 0x458a3
// File: /workspace/github_c_makefile_star2_O2/skeeto[P]flappy/sqlite3.c
// Function: sqlite3ExprCodeExprList
SQLITE_PRIVATE int sqlite3ExprCodeExprList(
  Parse *pParse,     /* Parsing context */
  ExprList *pList,   /* The expression list to be coded */
  int target,        /* Where to write results */
  u8 flags           /* SQLITE_ECEL_* flags */
){
  struct ExprList_item *pItem;
  int i, n;
  u8 copyOp = (flags & SQLITE_ECEL_DUP) ? OP_Copy : OP_SCopy;
  assert( pList!=0 );
  assert( target>0 );
  assert( pParse->pVdbe!=0 );  /* Never gets this far otherwise */
  n = pList->nExpr;
  if( !ConstFactorOk(pParse) ) flags &= ~SQLITE_ECEL_FACTOR;
  for(pItem=pList->a, i=0; i<n; i++, pItem++){
    Expr *pExpr = pItem->pExpr;
    if( (flags & SQLITE_ECEL_FACTOR)!=0 && sqlite3ExprIsConstant(pExpr) ){
      sqlite3ExprCodeAtInit(pParse, pExpr, target+i, 0);
    }else{
      int inReg = sqlite3ExprCodeTarget(pParse, pExpr, target+i);
      if( inReg!=target+i ){
        sqlite3VdbeAddOp2(pParse->pVdbe, copyOp, inReg, target+i);
      }
    }
  }
  return n;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebp
movl %edx, %ebx
movq %rdi, %r14
movl %ebp, %eax
andb $0x1, %al
xorb $0x1f, %al
movl (%rsi), %r13d
cmpl $0x0, 0x178(%rdi)
jle 0x45ba9
movq (%r14), %rcx
testb $0x8, 0x4c(%rcx)
je 0x45bab
xorl %ebp, %ebp
movq 0x8(%rsi), %r15
movzbl %al, %eax
movl %eax, 0x4(%rsp)
xorl %eax, %eax
testl %r13d, %r13d
cmovlel %eax, %r13d
subl $0x1, %r13d
jb 0x45c15
movq (%r15), %r12
testb $0x2, %bpl
je 0x45beb
movq %r12, %rdi
callq 0x45a3c
testl %eax, %eax
je 0x45beb
movq %r14, %rdi
movq %r12, %rsi
movl %ebx, %edx
xorl %ecx, %ecx
callq 0x46d26
jmp 0x45c0d
movq %r14, %rdi
movq %r12, %rsi
movl %ebx, %edx
callq 0x44641
cmpl %eax, %ebx
je 0x45c0d
movq 0x10(%r14), %rdi
movl 0x4(%rsp), %esi
movl %eax, %edx
movl %ebx, %ecx
callq 0x43f64
addq $0x20, %r15
incl %ebx
jmp 0x45bbf
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/skeeto[P]flappy/sqlite3.c
// Function: sqlite3HaltConstraint
SQLITE_PRIVATE void sqlite3HaltConstraint(
  Parse *pParse,    /* Parsing context */
  int errCode,      /* extended error code */
  int onError,      /* Constraint type */
  char *p4,         /* Error message */
  i8 p4type,        /* P4_STATIC or P4_TRANSIENT */
  u8 p5Errmsg       /* P5_ErrMsg type */
){
  Vdbe *v = sqlite3GetVdbe(pParse);
  assert( (errCode&0xff)==SQLITE_CONSTRAINT );
  if( onError==OE_Abort ){
    sqlite3MayAbort(pParse);
  }
  sqlite3VdbeAddOp4(v, OP_Halt, errCode, onError, 0, p4, p4type);
  if( p5Errmsg ) sqlite3VdbeChangeP5(v, p5Errmsg);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %r9d, 0x14(%rsp)
movl %r8d, %r13d
movq %rcx, %r15
movl %edx, %ebp
movl %esi, %r12d
movq %rdi, %rbx
callq 0x43f1b
movq %rax, %r14
cmpl $0x2, %ebp
jne 0x46622
movq 0x1e0(%rbx), %rax
testq %rax, %rax
cmoveq %rbx, %rax
movb $0x1, 0x24(%rax)
movsbl %r13b, %eax
movl %eax, (%rsp)
pushq $0x16
popq %rsi
movq %r14, %rdi
movl %r12d, %edx
movl %ebp, %ecx
xorl %r8d, %r8d
movq %r15, %r9
callq 0x43fe6
movl 0x14(%rsp), %edx
testb %dl, %dl
je 0x4665c
movq 0x8(%r14), %rax
testq %rax, %rax
je 0x4665c
movslq 0x34(%r14), %rcx
imulq $0x18, %rcx, %rcx
movb %dl, -0x15(%rax,%rcx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/skeeto[P]flappy/sqlite3.c
// Function: sqlite3ExprCodeGetColumnOfTable
SQLITE_PRIVATE void sqlite3ExprCodeGetColumnOfTable(
  Vdbe *v,        /* The VDBE under construction */
  Table *pTab,    /* The table containing the value */
  int iTabCur,    /* The table cursor.  Or the PK cursor for WITHOUT ROWID */
  int iCol,       /* Index of the column to extract */
  int regOut      /* Extract the value into this register */
){
  if( iCol<0 || iCol==pTab->iPKey ){
    sqlite3VdbeAddOp2(v, OP_Rowid, iTabCur, regOut);
  }else{
    int op = IsVirtual(pTab) ? OP_VColumn : OP_Column;
    int x = iCol;
    if( !HasRowid(pTab) ){
      x = sqlite3ColumnOfIndex(sqlite3PrimaryKeyIndex(pTab), iCol);
    }
    sqlite3VdbeAddOp3(v, op, iTabCur, x, regOut);
  }
  if( iCol>=0 ){
    sqlite3ColumnDefault(v, pTab, iCol, regOut);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r8d, %ebx
movl %ecx, %ebp
movl %edx, %r12d
movq %rsi, %r14
movq %rdi, %r15
testl %ecx, %ecx
js 0x46691
movswl 0x40(%r14), %eax
cmpl %ebp, %eax
jne 0x466b4
pushq $0x62
popq %rsi
movq %r15, %rdi
movl %r12d, %edx
movl %ebx, %ecx
callq 0x43f64
testl %ebp, %ebp
jns 0x466f5
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movzbl 0x48(%r14), %eax
testb $0x10, %al
pushq $0x2b
popq %rcx
movl $0x8c, %r13d
cmovel %ecx, %r13d
movl %ebp, %ecx
testb $0x20, %al
je 0x466e4
movq %r14, %rdi
callq 0x30033
movswl %bp, %esi
movq %rax, %rdi
callq 0x467ab
movswl %ax, %ecx
movq %r15, %rdi
movl %r13d, %esi
movl %r12d, %edx
movl %ebx, %r8d
callq 0x43f69
movq %r15, %rdi
movq %r14, %rsi
movl %ebp, %edx
movl %ebx, %ecx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x467ca
// File: /workspace/github_c_makefile_star2_O2/skeeto[P]flappy/sqlite3.c
// Function: sqlite3ColumnOfIndex
SQLITE_PRIVATE i16 sqlite3ColumnOfIndex(Index *pIdx, i16 iCol){
  int i;
  for(i=0; i<pIdx->nColumn; i++){
    if( iCol==pIdx->aiColumn[i] ) return i;
  }
  return -1;
}

// Assembly:
movzwl 0x60(%rdi), %ecx
xorl %eax, %eax
cmpq %rax, %rcx
je 0x467c5
movq 0x8(%rdi), %rdx
cmpw %si, (%rdx,%rax,2)
je 0x467c9
incq %rax
jmp 0x467b1
movw $0xffff, %ax            # imm = 0xFFFF
retq
// File: /workspace/github_c_makefile_star2_O2/skeeto[P]flappy/sqlite3.c
// Function: sqlite3ExprSkipCollate
SQLITE_PRIVATE Expr *sqlite3ExprSkipCollate(Expr *pExpr){
  while( pExpr && ExprHasProperty(pExpr, EP_Skip) ){
    if( ExprHasProperty(pExpr, EP_Unlikely) ){
      assert( !ExprHasProperty(pExpr, EP_xIsSelect) );
      assert( pExpr->x.pList->nExpr>0 );
      assert( pExpr->op==TK_FUNCTION );
      pExpr = pExpr->x.pList->a[0].pExpr;
    }else{
      assert( pExpr->op==TK_COLLATE || pExpr->op==TK_AS );
      pExpr = pExpr->pLeft;
    }
  }   
  return pExpr;
}

// Assembly:
movq %rdi, %rax
testq %rax, %rax
je 0x46b87
movl 0x4(%rax), %ecx
btl $0xc, %ecx
jae 0x46b87
btl $0x12, %ecx
jb 0x46b7a
addq $0x10, %rax
jmp 0x46b82
movq 0x20(%rax), %rax
movq 0x8(%rax), %rax
movq (%rax), %rax
jmp 0x46b60
retq
// File: /workspace/github_c_makefile_star2_O2/skeeto[P]flappy/sqlite3.c
// Function: sqlite3ExprCodeAtInit
SQLITE_PRIVATE void sqlite3ExprCodeAtInit(
  Parse *pParse,    /* Parsing context */
  Expr *pExpr,      /* The expression to code when the VDBE initializes */
  int regDest,      /* Store the value in this register */
  u8 reusable       /* True if this expression is reusable */
){
  ExprList *p;
  assert( ConstFactorOk(pParse) );
  p = pParse->pConstExpr;
  pExpr = sqlite3ExprDup(pParse->db, pExpr, 0);
  p = sqlite3ExprListAppend(pParse, p, pExpr);
  if( p ){
     struct ExprList_item *pItem = &p->a[p->nExpr-1];
     pItem->u.iConstExprReg = regDest;
     pItem->reusable = reusable;
  }
  pParse->pConstExpr = p;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %ecx, %ebp
movl %edx, %r14d
movq %rdi, %rbx
movq (%rdi), %rdi
movq 0x168(%rbx), %r15
xorl %edx, %edx
callq 0x47092
movq %rbx, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x3ca7d
testq %rax, %rax
je 0x46d82
movq 0x8(%rax), %rcx
movslq (%rax), %rdx
shlq $0x5, %rdx
movl %r14d, -0x4(%rcx,%rdx)
movb -0x7(%rcx,%rdx), %sil
shlb $0x2, %bpl
andb $0x4, %bpl
andb $-0x5, %sil
orb %bpl, %sil
movb %sil, -0x7(%rcx,%rdx)
movq %rax, 0x168(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/skeeto[P]flappy/sqlite3.c
// Function: exprCodeBetween
static void exprCodeBetween(
  Parse *pParse,    /* Parsing and code generating context */
  Expr *pExpr,      /* The BETWEEN expression */
  int dest,         /* Jump here if the jump is taken */
  int jumpIfTrue,   /* Take the jump if the BETWEEN is true */
  int jumpIfNull    /* Take the jump if the BETWEEN is NULL */
){
  Expr exprAnd;     /* The AND operator in  x>=y AND x<=z  */
  Expr compLeft;    /* The  x>=y  term */
  Expr compRight;   /* The  x<=z  term */
  Expr exprX;       /* The  x  subexpression */
  int regFree1 = 0; /* Temporary use register */

  assert( !ExprHasProperty(pExpr, EP_xIsSelect) );
  exprX = *pExpr->pLeft;
  exprAnd.op = TK_AND;
  exprAnd.pLeft = &compLeft;
  exprAnd.pRight = &compRight;
  compLeft.op = TK_GE;
  compLeft.pLeft = &exprX;
  compLeft.pRight = pExpr->x.pList->a[0].pExpr;
  compRight.op = TK_LE;
  compRight.pLeft = &exprX;
  compRight.pRight = pExpr->x.pList->a[1].pExpr;
  exprToRegister(&exprX, sqlite3ExprCodeTemp(pParse, &exprX, &regFree1));
  if( jumpIfTrue ){
    sqlite3ExprIfTrue(pParse, &exprAnd, dest, jumpIfNull);
  }else{
    sqlite3ExprIfFalse(pParse, &exprAnd, dest, jumpIfNull);
  }
  sqlite3ReleaseTempReg(pParse, regFree1);

  /* Ensure adequate test coverage */
  testcase( jumpIfTrue==0 && jumpIfNull==0 && regFree1==0 );
  testcase( jumpIfTrue==0 && jumpIfNull==0 && regFree1!=0 );
  testcase( jumpIfTrue==0 && jumpIfNull!=0 && regFree1==0 );
  testcase( jumpIfTrue==0 && jumpIfNull!=0 && regFree1!=0 );
  testcase( jumpIfTrue!=0 && jumpIfNull==0 && regFree1==0 );
  testcase( jumpIfTrue!=0 && jumpIfNull==0 && regFree1!=0 );
  testcase( jumpIfTrue!=0 && jumpIfNull!=0 && regFree1==0 );
  testcase( jumpIfTrue!=0 && jumpIfNull!=0 && regFree1!=0 );
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x130, %rsp            # imm = 0x130
movl %r8d, %ebp
movl %ecx, %r15d
movl %edx, %r14d
leaq 0xc(%rsp), %rdx
andl $0x0, (%rdx)
movq %rsi, %rax
movq %rdi, %rbx
movq 0x10(%rsi), %rsi
pushq $0x9
popq %rcx
leaq 0x58(%rsp), %r12
movq %r12, %rdi
rep  movsq (%rsi), %es:(%rdi)
movb $0x46, 0x10(%rsp)
leaq 0xe8(%rsp), %rcx
movq %rcx, 0x20(%rsp)
leaq 0xa0(%rsp), %rsi
movq %rsi, 0x28(%rsp)
movb $0x51, (%rcx)
movq %r12, 0x10(%rcx)
movq 0x20(%rax), %rax
movq 0x8(%rax), %rax
movq (%rax), %rdi
movq %rdi, 0x18(%rcx)
movb $0x4f, (%rsi)
movq %r12, 0x10(%rsi)
movq 0x20(%rax), %rax
movq %rax, 0x18(%rsi)
movq %rbx, %rdi
movq %r12, %rsi
callq 0x457f1
movb (%r12), %cl
movb %cl, 0x36(%r12)
movb $-0x7b, (%r12)
movl %eax, 0x2c(%r12)
andb $-0x11, 0x5(%r12)
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
movl %r14d, %edx
movl %ebp, %ecx
testl %r15d, %r15d
je 0x480ed
callq 0x47dc2
jmp 0x480f2
callq 0x4636b
movl 0xc(%rsp), %esi
movq %rbx, %rdi
callq 0x46333
addq $0x130, %rsp            # imm = 0x130
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/skeeto[P]flappy/sqlite3.c
// Function: sqlite3Dequote
SQLITE_PRIVATE int sqlite3Dequote(char *z){
  char quote;
  int i, j;
  if( z==0 ) return -1;
  quote = z[0];
  switch( quote ){
    case '\'':  break;
    case '"':   break;
    case '`':   break;                /* For MySQL compatibility */
    case '[':   quote = ']';  break;  /* For MS SqlServer compatibility */
    default:    return -1;
  }
  for(i=1, j=0;; i++){
    assert( z[i] );
    if( z[i]==quote ){
      if( z[i+1]==quote ){
        z[j++] = quote;
        i++;
      }else{
        break;
      }
    }else{
      z[j++] = z[i];
    }
  }
  z[j] = 0;
  return j;
}

// Assembly:
testq %rdi, %rdi
je 0x4820a
movzbl (%rdi), %eax
cmpl $0x22, %eax
je 0x481da
cmpl $0x27, %eax
je 0x481da
cmpl $0x60, %eax
je 0x481da
cmpl $0x5b, %eax
jne 0x4820a
movb $0x5d, %al
pushq $0x1
popq %rdx
xorl %ecx, %ecx
movslq %edx, %rsi
movb (%rdi,%rsi), %r8b
cmpb %al, %r8b
jne 0x481f9
cmpb %al, 0x1(%rdi,%rsi)
jne 0x48204
incq %rsi
movl %eax, %r8d
movl %esi, %edx
movb %r8b, (%rdi,%rcx)
incq %rcx
incl %edx
jmp 0x481df
movl %ecx, %eax
movb $0x0, (%rdi,%rax)
retq
// File: /workspace/github_c_makefile_star2_O2/skeeto[P]flappy/sqlite3.c
// Function: sqlite3OpenMasterTable
SQLITE_PRIVATE void sqlite3OpenMasterTable(Parse *p, int iDb){
  Vdbe *v = sqlite3GetVdbe(p);
  sqlite3TableLock(p, iDb, MASTER_ROOT, 1, SCHEMA_TABLE(iDb));
  sqlite3VdbeAddOp4Int(v, OP_OpenWrite, 0, MASTER_ROOT, iDb, 5);
  if( p->nTab==0 ){
    p->nTab = 1;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
callq 0x43f1b
movq %rax, %r14
cmpl $0x1, %ebp
leaq 0x1b9c6(%rip), %rax     # 0x63cee
leaq 0x1b9d2(%rip), %r8      # 0x63d01
cmoveq %rax, %r8
pushq $0x1
popq %r15
movq %rbx, %rdi
movl %ebp, %esi
movl %r15d, %edx
movl %r15d, %ecx
callq 0x4410c
pushq $0x33
popq %rsi
pushq $0x5
popq %r9
movq %r14, %rdi
xorl %edx, %edx
movl %r15d, %ecx
movl %ebp, %r8d
callq 0x441d6
cmpl $0x0, 0x54(%rbx)
jne 0x4836b
movl $0x1, 0x54(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/skeeto[P]flappy/sqlite3.c
// Function: estimateIndexWidth
static void estimateIndexWidth(Index *pIdx){
  unsigned wIndex = 0;
  int i;
  const Column *aCol = pIdx->pTable->aCol;
  for(i=0; i<pIdx->nColumn; i++){
    i16 x = pIdx->aiColumn[i];
    assert( x<pIdx->pTable->nCol );
    wIndex += x<0 ? 1 : aCol[pIdx->aiColumn[i]].szEst;
  }
  pIdx->szIdxRow = sqlite3LogEst(wIndex*4);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x18(%rdi), %rax
movq 0x8(%rax), %rax
movzwl 0x60(%rdi), %ecx
xorl %edx, %edx
pushq $0x1
popq %rsi
xorl %edi, %edi
cmpq %rdx, %rcx
je 0x484a0
movq 0x8(%rbx), %r8
movswq (%r8,%rdx,2), %r9
movl %esi, %r8d
testq %r9, %r9
js 0x48498
imulq $0x30, %r9, %r8
movzbl 0x2a(%rax,%r8), %r8d
addl %r8d, %edi
incq %rdx
jmp 0x48478
shll $0x2, %edi
callq 0x30110
movw %ax, 0x5c(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/skeeto[P]flappy/sqlite3.c
// Function: resizeIndexObject
static int resizeIndexObject(sqlite3 *db, Index *pIdx, int N){
  char *zExtra;
  int nByte;
  if( pIdx->nColumn>=N ) return SQLITE_OK;
  assert( pIdx->isResized==0 );
  nByte = (sizeof(char*) + sizeof(i16) + 1)*N;
  zExtra = sqlite3DbMallocZero(db, nByte);
  if( zExtra==0 ) return SQLITE_NOMEM;
  memcpy(zExtra, pIdx->azColl, sizeof(char*)*pIdx->nColumn);
  pIdx->azColl = (char**)zExtra;
  zExtra += sizeof(char*)*N;
  memcpy(zExtra, pIdx->aiColumn, sizeof(i16)*pIdx->nColumn);
  pIdx->aiColumn = (i16*)zExtra;
  zExtra += sizeof(i16)*N;
  memcpy(zExtra, pIdx->aSortOrder, pIdx->nColumn);
  pIdx->aSortOrder = (u8*)zExtra;
  pIdx->nColumn = N;
  pIdx->isResized = 1;
  return SQLITE_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movzwl 0x60(%rsi), %eax
xorl %ebx, %ebx
cmpl %edx, %eax
jge 0x48807
movl %edx, %ebp
movq %rsi, %r14
imull $0xb, %edx, %esi
callq 0xfabf
testq %rax, %rax
je 0x48804
movq %rax, %r15
movl %ebp, %r12d
movq 0x40(%r14), %rsi
movzwl 0x60(%r14), %edx
shll $0x3, %edx
movq %rax, %rdi
callq 0x7240
movq %r15, 0x40(%r14)
leaq (%r15,%r12,8), %r15
movq 0x8(%r14), %rsi
movzwl 0x60(%r14), %edx
addl %edx, %edx
movq %r15, %rdi
callq 0x7240
movq %r15, 0x8(%r14)
leaq (%r15,%r12,2), %r15
movq 0x38(%r14), %rsi
movzwl 0x60(%r14), %edx
movq %r15, %rdi
callq 0x7240
movq %r15, 0x38(%r14)
movw %bp, 0x60(%r14)
orb $0x10, 0x63(%r14)
jmp 0x48807
pushq $0x7
popq %rbx
movl %ebx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/skeeto[P]flappy/sqlite3.c
// Function: setJoinExpr
static void setJoinExpr(Expr *p, int iTable){
  while( p ){
    ExprSetProperty(p, EP_FromJoin);
    assert( !ExprHasProperty(p, EP_TokenOnly|EP_Reduced) );
    ExprSetVVAProperty(p, EP_NoReduce);
    p->iRightJoinTable = (i16)iTable;
    setJoinExpr(p->pLeft, iTable);
    p = p->pRight;
  } 
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
testq %r14, %r14
je 0x4b409
orb $0x1, 0x4(%r14)
movw %bx, 0x34(%r14)
movq 0x10(%r14), %rdi
movl %ebx, %esi
callq 0x4b3e0
movq 0x18(%r14), %r14
jmp 0x4b3e9
addq $0x8, %rsp
popq %rbx
popq %r14
retq