LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: btreeMoveto
static int btreeMoveto(
  BtCursor *pCur,     /* Cursor open on the btree to be searched */
  const void *pKey,   /* Packed key if the btree is an index */
  i64 nKey,           /* Integer key for tables.  Size of pKey for indices */
  int bias,           /* Bias search to the high end */
  int *pRes           /* Write search results here */
){
  int rc;                    /* Status code */
  UnpackedRecord *pIdxKey;   /* Unpacked index key */

  if( pKey ){
    KeyInfo *pKeyInfo = pCur->pKeyInfo;
    assert( nKey==(i64)(int)nKey );
    pIdxKey = sqlite3VdbeAllocUnpackedRecord(pKeyInfo);
    if( pIdxKey==0 ) return SQLITE_NOMEM_BKPT;
    sqlite3VdbeRecordUnpack(pKeyInfo, (int)nKey, pKey, pIdxKey);
    if( pIdxKey->nField==0 || pIdxKey->nField>pKeyInfo->nAllField ){
      rc = SQLITE_CORRUPT_BKPT;
      goto moveto_done;
    }
  }else{
    pIdxKey = 0;
  }
  rc = sqlite3BtreeMovetoUnpacked(pCur, pIdxKey, nKey, bias, pRes);
moveto_done:
  if( pIdxKey ){
    sqlite3DbFree(pCur->pKeyInfo->db, pIdxKey);
  }
  return rc;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebp
movq %rdx, %r12
movq %rdi, %rbx
testq %rsi, %rsi
je 0x29f09f
movq %rsi, %r15
movq %r8, (%rsp)
movq 0x80(%rbx), %r13
movq %r13, %rdi
callq 0x29c6eb
testq %rax, %rax
je 0x29f0bc
movq %rax, %r14
movq %r13, %rdi
movl %r12d, %esi
movq %r15, %rdx
movq %rax, %rcx
callq 0x29c72f
movzwl 0x10(%r14), %eax
testw %ax, %ax
je 0x29f072
cmpw 0x8(%r13), %ax
jbe 0x29f0c3
leaq 0x136b52(%rip), %rsi    # 0x3d5bcb
leaq 0x136c5c(%rip), %rdx    # 0x3d5cdc
leaq 0x1369aa(%rip), %r8     # 0x3d5a31
movl $0xb, %ebp
movl $0xb, %edi
movl $0xff15, %ecx           # imm = 0xFF15
xorl %eax, %eax
callq 0x274d08
jmp 0x29f0d9
movq %rbx, %rdi
xorl %esi, %esi
movq %r12, %rdx
movl %ebp, %ecx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x29c0b4
movl $0x7, %ebp
jmp 0x29f0ec
movq %rbx, %rdi
movq %r14, %rsi
movq %r12, %rdx
movl %ebp, %ecx
movq (%rsp), %r8
callq 0x29c0b4
movl %eax, %ebp
movq 0x80(%rbx), %rax
movq 0x10(%rax), %rdi
movq %r14, %rsi
callq 0x282904
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: moveToChild
static int moveToChild(BtCursor *pCur, u32 newPgno){
  BtShared *pBt = pCur->pBt;

  assert( cursorOwnsBtShared(pCur) );
  assert( pCur->eState==CURSOR_VALID );
  assert( pCur->iPage<BTCURSOR_MAX_DEPTH );
  assert( pCur->iPage>=0 );
  if( pCur->iPage>=(BTCURSOR_MAX_DEPTH-1) ){
    return SQLITE_CORRUPT_BKPT;
  }
  pCur->info.nSize = 0;
  pCur->curFlags &= ~(BTCF_ValidNKey|BTCF_ValidOvfl);
  pCur->aiIdx[pCur->iPage] = pCur->ix;
  pCur->apPage[pCur->iPage] = pCur->pPage;
  pCur->ix = 0;
  pCur->iPage++;
  return getAndInitPage(pBt, newPgno, &pCur->pPage, pCur, pCur->curPagerFlags);
}

// Assembly:
movsbq 0x54(%rdi), %rax
cmpq $0x13, %rax
jl 0x29f35b
pushq %rax
leaq 0x136896(%rip), %rsi    # 0x3d5bcb
leaq 0x1369a0(%rip), %rdx    # 0x3d5cdc
leaq 0x1366ee(%rip), %r8     # 0x3d5a31
movl $0xb, %edi
movl $0x10fd1, %ecx          # imm = 0x10FD1
xorl %eax, %eax
callq 0x274d08
movl $0xb, %eax
popq %rcx
retq
movq %rdi, %rcx
movq 0x20(%rdi), %rdi
xorl %r8d, %r8d
movw %r8w, 0x46(%rcx)
andb $-0x7, 0x1(%rcx)
movzwl 0x56(%rcx), %edx
movw %dx, 0x58(%rcx,%rax,2)
leaq 0x88(%rcx), %rdx
movq 0x88(%rcx), %r9
movq %r9, 0x90(%rcx,%rax,8)
movw %r8w, 0x56(%rcx)
incl %eax
movb %al, 0x54(%rcx)
movzbl 0x2(%rcx), %r8d
jmp 0x29f39e
// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: invalidateIncrblobCursors
static void invalidateIncrblobCursors(
  Btree *pBtree,          /* The database file to check */
  Pgno pgnoRoot,          /* The table that might be changing */
  i64 iRow,               /* The rowid that might be changing */
  int isClearTable        /* True if all rows are being deleted */
){
  BtCursor *p;
  if( pBtree->hasIncrblobCur==0 ) return;
  assert( sqlite3BtreeHoldsMutex(pBtree) );
  pBtree->hasIncrblobCur = 0;
  for(p=pBtree->pBt->pCursor; p; p=p->pNext){
    if( (p->curFlags & BTCF_Incrblob)!=0 ){
      pBtree->hasIncrblobCur = 1;
      if( p->pgnoRoot==pgnoRoot && (isClearTable || p->info.nKey==iRow) ){
        p->eState = CURSOR_INVALID;
      }
    }
  }
}

// Assembly:
cmpb $0x0, 0x13(%rdi)
je 0x29f611
movb $0x0, 0x13(%rdi)
movq 0x8(%rdi), %rax
movq 0x10(%rax), %rax
testq %rax, %rax
je 0x29f611
testb $0x10, 0x1(%rax)
je 0x29f60b
movb $0x1, 0x13(%rdi)
cmpl %esi, 0x50(%rax)
jne 0x29f60b
testl %ecx, %ecx
jne 0x29f608
cmpq %rdx, 0x30(%rax)
jne 0x29f60b
movb $0x1, (%rax)
movq 0x28(%rax), %rax
jmp 0x29f5ea
retq
// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: btreeSetHasContent
static int btreeSetHasContent(BtShared *pBt, Pgno pgno){
  int rc = SQLITE_OK;
  if( !pBt->pHasContent ){
    assert( pgno<=pBt->nPage );
    pBt->pHasContent = sqlite3BitvecCreate(pBt->nPage);
    if( !pBt->pHasContent ){
      rc = SQLITE_NOMEM_BKPT;
    }
  }
  if( rc==SQLITE_OK && pgno<=sqlite3BitvecSize(pBt->pHasContent) ){
    rc = sqlite3BitvecSet(pBt->pHasContent, pgno);
  }
  return rc;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq 0x60(%rdi), %r14
testq %r14, %r14
je 0x29fcef
movl (%r14), %ebp
jmp 0x29fd21
movq %rdi, %r15
movl 0x40(%rdi), %ebp
movl $0x200, %edi            # imm = 0x200
callq 0x272ae6
testq %rax, %rax
je 0x29fd3b
movq %rax, %r14
movq %rax, %rdi
addq $0x4, %rdi
movl $0x1fc, %edx            # imm = 0x1FC
xorl %esi, %esi
callq 0x173a0
movl %ebp, (%r14)
movq %r14, 0x60(%r15)
xorl %eax, %eax
cmpl %ebx, %ebp
jb 0x29fd48
movq %r14, %rdi
movl %ebx, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x286fa5
movq $0x0, 0x60(%r15)
movl $0x7, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: moveToRightmost
static int moveToRightmost(BtCursor *pCur){
  Pgno pgno;
  int rc = SQLITE_OK;
  MemPage *pPage = 0;

  assert( cursorOwnsBtShared(pCur) );
  assert( pCur->eState==CURSOR_VALID );
  while( !(pPage = pCur->pPage)->leaf ){
    pgno = get4byte(&pPage->aData[pPage->hdrOffset+8]);
    pCur->ix = pPage->nCell;
    rc = moveToChild(pCur, pgno);
    if( rc ) return rc;
  }
  pCur->ix = pPage->nCell-1;
  assert( pCur->info.nSize==0 );
  assert( (pCur->curFlags & BTCF_ValidNKey)==0 );
  return SQLITE_OK;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x88(%rbx), %rax
cmpb $0x0, 0x8(%rax)
jne 0x29fd88
movq 0x50(%rax), %rcx
movzbl 0x9(%rax), %edx
movl 0x8(%rcx,%rdx), %esi
bswapl %esi
movzwl 0x18(%rax), %eax
movw %ax, 0x56(%rbx)
movq %rbx, %rdi
callq 0x29f322
testl %eax, %eax
je 0x29fd57
jmp 0x29fd93
movl 0x18(%rax), %eax
decl %eax
movw %ax, 0x56(%rbx)
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: vdbeRecordCompareString
static int vdbeRecordCompareString(
  int nKey1, const void *pKey1, /* Left key */
  UnpackedRecord *pPKey2        /* Right key */
){
  const u8 *aKey1 = (const u8*)pKey1;
  int serial_type;
  int res;

  assert( pPKey2->aMem[0].flags & MEM_Str );
  vdbeAssertFieldCountWithinLimits(nKey1, pKey1, pPKey2->pKeyInfo);
  serial_type = (u8)(aKey1[1]);
  if( serial_type >= 0x80 ){
    sqlite3GetVarint32(&aKey1[1], (u32*)&serial_type);
  }
  if( serial_type<12 ){
    res = pPKey2->r1;      /* (pKey1/nKey1) is a number or a null */
  }else if( !(serial_type & 0x01) ){
    res = pPKey2->r2;      /* (pKey1/nKey1) is a blob */
  }else{
    int nCmp;
    int nStr;
    int szHdr = aKey1[0];

    nStr = (serial_type-12) / 2;
    if( (szHdr + nStr) > nKey1 ){
      pPKey2->errCode = (u8)SQLITE_CORRUPT_BKPT;
      return 0;    /* Corruption */
    }
    nCmp = MIN( pPKey2->aMem[0].n, nStr );
    res = memcmp(&aKey1[szHdr], pPKey2->aMem[0].z, nCmp);

    if( res>0 ){
      res = pPKey2->r2;
    }else if( res<0 ){
      res = pPKey2->r1;
    }else{
      res = nStr - pPKey2->aMem[0].n;
      if( res==0 ){
        if( pPKey2->nField>1 ){
          res = sqlite3VdbeRecordCompareWithSkip(nKey1, pKey1, pPKey2, 1);
        }else{
          res = pPKey2->default_rc;
          pPKey2->eqSeen = 1;
        }
      }else if( res>0 ){
        res = pPKey2->r2;
      }else{
        res = pPKey2->r1;
      }
    }
  }

  assert( vdbeRecordCompareDebug(nKey1, pKey1, pPKey2, res)
       || CORRUPT_DB
       || pPKey2->pKeyInfo->db->mallocFailed
  );
  return res;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movl %edi, %ebp
movzbl 0x1(%rsi), %r15d
movl %r15d, 0xc(%rsp)
testb %r15b, %r15b
jns 0x29febd
leaq 0x1(%r14), %rdi
leaq 0xc(%rsp), %r15
movq %r15, %rsi
callq 0x29b609
movl (%r15), %r15d
cmpl $0xb, %r15d
jg 0x29fec9
movsbl 0x14(%rbx), %ebp
jmp 0x29ff14
testb $0x1, %r15b
jne 0x29fed5
movsbl 0x15(%rbx), %ebp
jmp 0x29ff14
movzbl (%r14), %edi
addl $-0xc, %r15d
shrl %r15d
leal (%r15,%rdi), %eax
cmpl %ebp, %eax
jle 0x29ff23
leaq 0x135cdc(%rip), %rsi    # 0x3d5bcb
leaq 0x135de6(%rip), %rdx    # 0x3d5cdc
leaq 0x135b34(%rip), %r8     # 0x3d5a31
xorl %ebp, %ebp
movl $0xb, %edi
movl $0x14275, %ecx          # imm = 0x14275
xorl %eax, %eax
callq 0x274d08
movb $0xb, 0x13(%rbx)
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0x8(%rbx), %rax
movl 0xc(%rax), %r12d
cmpl %r15d, %r12d
movl %r15d, %ecx
cmovll %r12d, %ecx
addq %r14, %rdi
movq 0x10(%rax), %rsi
movslq %ecx, %rdx
callq 0x17300
testl %eax, %eax
jg 0x29fecf
js 0x29fec3
cmpl %r12d, %r15d
jne 0x29ff75
cmpw $0x2, 0x10(%rbx)
jb 0x29ff80
movl %ebp, %edi
movq %r14, %rsi
movq %rbx, %rdx
movl $0x1, %ecx
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x29ff8a
jle 0x29fec3
jmp 0x29fecf
movsbl 0x12(%rbx), %ebp
movb $0x1, 0x16(%rbx)
jmp 0x29ff14
// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: moveToLeftmost
static int moveToLeftmost(BtCursor *pCur){
  Pgno pgno;
  int rc = SQLITE_OK;
  MemPage *pPage;

  assert( cursorOwnsBtShared(pCur) );
  assert( pCur->eState==CURSOR_VALID );
  while( rc==SQLITE_OK && !(pPage = pCur->pPage)->leaf ){
    assert( pCur->ix<pPage->nCell );
    pgno = get4byte(findCell(pPage, pCur->ix));
    rc = moveToChild(pCur, pgno);
  }
  return rc;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x88(%rbx), %rax
cmpb $0x0, 0x8(%rax)
jne 0x2a06fb
movzwl 0x1a(%rax), %ecx
movq 0x50(%rax), %rdx
movq 0x60(%rax), %rax
movzwl 0x56(%rbx), %esi
movzbl (%rax,%rsi,2), %edi
shll $0x8, %edi
movzbl 0x1(%rax,%rsi,2), %eax
orl %edi, %eax
andl %ecx, %eax
movl (%rdx,%rax), %esi
bswapl %esi
movq %rbx, %rdi
callq 0x29f322
testl %eax, %eax
je 0x2a06bb
jmp 0x2a06fd
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: btreePrevious
static SQLITE_NOINLINE int btreePrevious(BtCursor *pCur){
  int rc;
  MemPage *pPage;

  assert( cursorOwnsBtShared(pCur) );
  assert( (pCur->curFlags & (BTCF_AtLast|BTCF_ValidOvfl|BTCF_ValidNKey))==0 );
  assert( pCur->info.nSize==0 );
  if( pCur->eState!=CURSOR_VALID ){
    rc = restoreCursorPosition(pCur);
    if( rc!=SQLITE_OK ){
      return rc;
    }
    if( CURSOR_INVALID==pCur->eState ){
      return SQLITE_DONE;
    }
    if( CURSOR_SKIPNEXT==pCur->eState ){
      pCur->eState = CURSOR_VALID;
      if( pCur->skipNext<0 ) return SQLITE_OK;
    }
  }

  pPage = pCur->pPage;
  assert( pPage->isInit );
  if( !pPage->leaf ){
    int idx = pCur->ix;
    rc = moveToChild(pCur, get4byte(findCell(pPage, idx)));
    if( rc ) return rc;
    rc = moveToRightmost(pCur);
  }else{
    while( pCur->ix==0 ){
      if( pCur->iPage==0 ){
        pCur->eState = CURSOR_INVALID;
        return SQLITE_DONE;
      }
      moveToParent(pCur);
    }
    assert( pCur->info.nSize==0 );
    assert( (pCur->curFlags & (BTCF_ValidOvfl))==0 );

    pCur->ix--;
    pPage = pCur->pPage;
    if( pPage->intKey && !pPage->leaf ){
      rc = sqlite3BtreePrevious(pCur, 0);
    }else{
      rc = SQLITE_OK;
    }
  }
  return rc;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movb (%rdi), %al
testb %al, %al
je 0x2a0738
cmpb $0x3, %al
jb 0x2a071f
movq %rbx, %rdi
callq 0x29ef8c
testl %eax, %eax
jne 0x2a07d0
movb (%rbx), %al
cmpb $0x1, %al
je 0x2a076a
movzbl %al, %eax
cmpl $0x2, %eax
jne 0x2a0738
movb $0x0, (%rbx)
cmpl $0x0, 0x4(%rbx)
js 0x2a07ce
movq 0x88(%rbx), %rcx
cmpb $0x0, 0x8(%rcx)
movzwl 0x56(%rbx), %eax
je 0x2a0771
testw %ax, %ax
jne 0x2a07b1
jmp 0x2a0761
movq %rbx, %rdi
callq 0x29f2e2
movzwl 0x56(%rbx), %eax
testw %ax, %ax
jne 0x2a07aa
cmpb $0x0, 0x54(%rbx)
jne 0x2a0750
movb $0x1, (%rbx)
movl $0x65, %eax
jmp 0x2a07d0
movzwl %ax, %eax
movzwl 0x1a(%rcx), %edx
movq 0x50(%rcx), %rsi
movq 0x60(%rcx), %rcx
movzbl (%rcx,%rax,2), %edi
shll $0x8, %edi
movzbl 0x1(%rcx,%rax,2), %eax
orl %edi, %eax
andl %edx, %eax
movl (%rsi,%rax), %esi
bswapl %esi
movq %rbx, %rdi
callq 0x29f322
testl %eax, %eax
jne 0x2a07d0
movq %rbx, %rdi
popq %rbx
jmp 0x29fd53
movq 0x88(%rbx), %rcx
decl %eax
movw %ax, 0x56(%rbx)
xorl %eax, %eax
cmpb $0x0, 0x2(%rcx)
je 0x2a07d0
cmpb $0x0, 0x8(%rcx)
jne 0x2a07d0
movq %rbx, %rdi
popq %rbx
jmp 0x29c6b1
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: dropCell
static void dropCell(MemPage *pPage, int idx, int sz, int *pRC){
  u32 pc;         /* Offset to cell content of cell being deleted */
  u8 *data;       /* pPage->aData */
  u8 *ptr;        /* Used to move bytes around within data[] */
  int rc;         /* The return code */
  int hdr;        /* Beginning of the header.  0 most pages.  100 page 1 */

  if( *pRC ) return;
  assert( idx>=0 && idx<pPage->nCell );
  assert( CORRUPT_DB || sz==cellSize(pPage, idx) );
  assert( sqlite3PagerIswriteable(pPage->pDbPage) );
  assert( sqlite3_mutex_held(pPage->pBt->mutex) );
  assert( pPage->nFree>=0 );
  data = pPage->aData;
  ptr = &pPage->aCellIdx[2*idx];
  pc = get2byte(ptr);
  hdr = pPage->hdrOffset;
  testcase( pc==get2byte(&data[hdr+5]) );
  testcase( pc+sz==pPage->pBt->usableSize );
  if( pc+sz > pPage->pBt->usableSize ){
    *pRC = SQLITE_CORRUPT_BKPT;
    return;
  }
  rc = freeSpace(pPage, pc, sz);
  if( rc ){
    *pRC = rc;
    return;
  }
  pPage->nCell--;
  if( pPage->nCell==0 ){
    memset(&data[hdr+1], 0, 4);
    data[hdr+7] = 0;
    put2byte(&data[hdr+5], pPage->pBt->usableSize);
    pPage->nFree = pPage->pBt->usableSize - pPage->hdrOffset
                       - pPage->childPtrSize - 8;
  }else{
    memmove(ptr, ptr+2, 2*(pPage->nCell - idx));
    put2byte(&data[hdr+3], pPage->nCell);
    pPage->nFree += 2;
  }
}

// Assembly:
cmpl $0x0, (%rcx)
je 0x2a0aeb
retq
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r14
movq %rdi, %rbx
movq 0x48(%rdi), %rax
movq 0x60(%rdi), %rbp
movslq %esi, %r13
movzwl (%rbp,%r13,2), %ecx
rolw $0x8, %cx
movzwl %cx, %esi
leal (%rsi,%rdx), %ecx
cmpl 0x38(%rax), %ecx
jbe 0x2a0b4e
leaq 0x1350a8(%rip), %rsi    # 0x3d5bcb
leaq 0x1351b2(%rip), %rdx    # 0x3d5cdc
leaq 0x134f00(%rip), %r8     # 0x3d5a31
movl $0xb, %edi
movl $0x115f2, %ecx          # imm = 0x115F2
xorl %eax, %eax
callq 0x274d08
movl $0xb, (%r14)
jmp 0x2a0bf2
movq 0x50(%rbx), %r15
movzbl 0x9(%rbx), %r12d
movzwl %dx, %edx
movq %rbx, %rdi
callq 0x2a2ac5
testl %eax, %eax
je 0x2a0b6e
movl %eax, (%r14)
jmp 0x2a0bf2
movzwl 0x18(%rbx), %eax
decw %ax
movw %ax, 0x18(%rbx)
je 0x2a0bb0
leaq (,%r13,2), %rdi
addq %rbp, %rdi
movzwl %ax, %eax
leaq 0x2(%rdi), %rsi
subl %r13d, %eax
addl %eax, %eax
movslq %eax, %rdx
callq 0x17cd0
movb 0x19(%rbx), %al
movb %al, 0x3(%r15,%r12)
movb 0x18(%rbx), %al
movb %al, 0x4(%r15,%r12)
addl $0x2, 0x14(%rbx)
jmp 0x2a0bf2
movl $0x0, 0x1(%r15,%r12)
movb $0x0, 0x7(%r15,%r12)
movq 0x48(%rbx), %rax
movb 0x39(%rax), %al
movb %al, 0x5(%r15,%r12)
movq 0x48(%rbx), %rax
movb 0x38(%rax), %al
movb %al, 0x6(%r15,%r12)
movq 0x48(%rbx), %rax
movl 0x38(%rax), %eax
movzbl 0x9(%rbx), %ecx
movzbl 0xa(%rbx), %edx
addl %ecx, %edx
negl %edx
addl %edx, %eax
addl $-0x8, %eax
movl %eax, 0x14(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: btreeOverwriteContent
static int btreeOverwriteContent(
  MemPage *pPage,           /* MemPage on which writing will occur */
  u8 *pDest,                /* Pointer to the place to start writing */
  const BtreePayload *pX,   /* Source of data to write */
  int iOffset,              /* Offset of first byte to write */
  int iAmt                  /* Number of bytes to be written */
){
  int nData = pX->nData - iOffset;
  if( nData<=0 ){
    /* Overwritting with zeros */
    int i;
    for(i=0; i<iAmt && pDest[i]==0; i++){}
    if( i<iAmt ){
      int rc = sqlite3PagerWrite(pPage->pDbPage);
      if( rc ) return rc;
      memset(pDest + i, 0, iAmt - i);
    }
  }else{
    if( nData<iAmt ){
      /* Mixed read data and zeros at the end.  Make a recursive call
      ** to write the zeros then fall through to write the real data */
      int rc = btreeOverwriteContent(pPage, pDest+nData, pX, iOffset+nData,
                                 iAmt-nData);
      if( rc ) return rc;
      iAmt = nData;
    }
    if( memcmp(pDest, ((u8*)pX->pData) + iOffset, iAmt)!=0 ){
      int rc = sqlite3PagerWrite(pPage->pDbPage);
      if( rc ) return rc;
      /* In a corrupt database, it is possible for the source and destination
      ** buffers to overlap.  This is harmless since the database is already
      ** corrupt but it does cause valgrind and ASAN warnings.  So use
      ** memmove(). */
      memmove(pDest, ((u8*)pX->pData) + iOffset, iAmt);
    }
  }
  return SQLITE_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r8d, %r14d
movl %ecx, %r13d
movq %rsi, %rbx
movl 0x24(%rdx), %ecx
movl %ecx, %r12d
subl %r13d, %r12d
jle 0x2a2a70
movq %rdx, %r15
movl %r14d, %r8d
subl %r12d, %r8d
jle 0x2a2a29
movl %r12d, %esi
addq %rbx, %rsi
movq %rdi, %r14
movq %r15, %rdx
callq 0x2a29e4
movq %r14, %rdi
movl %r12d, %r14d
testl %eax, %eax
jne 0x2a2a9b
movq %rdi, (%rsp)
movslq %r13d, %r13
movq 0x10(%r15), %rsi
addq %r13, %rsi
movslq %r14d, %r12
movq %rbx, %rdi
movq %r12, %rdx
callq 0x17830
xorl %ebp, %ebp
testl %eax, %eax
je 0x2a2a9d
movq (%rsp), %rax
movq 0x70(%rax), %rdi
callq 0x2774a1
testl %eax, %eax
jne 0x2a2a9b
addq 0x10(%r15), %r13
movq %rbx, %rdi
movq %r13, %rsi
movq %r12, %rdx
callq 0x17cd0
jmp 0x2a2a9d
testl %r14d, %r14d
jle 0x2a2a8a
movl %r14d, %eax
xorl %r15d, %r15d
cmpb $0x0, (%rbx,%r15)
jne 0x2a2a8e
incq %r15
cmpq %r15, %rax
jne 0x2a2a7b
xorl %ebp, %ebp
jmp 0x2a2a9d
movq 0x70(%rdi), %rdi
callq 0x2774a1
testl %eax, %eax
je 0x2a2aae
movl %eax, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
addq %r15, %rbx
movslq %r14d, %rdx
subq %r15, %rdx
xorl %ebp, %ebp
movq %rbx, %rdi
xorl %esi, %esi
callq 0x173a0
jmp 0x2a2a9d
// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: pageFreeArray
static int pageFreeArray(
  MemPage *pPg,                   /* Page to edit */
  int iFirst,                     /* First cell to delete */
  int nCell,                      /* Cells to delete */
  CellArray *pCArray              /* Array of cells */
){
  u8 * const aData = pPg->aData;
  u8 * const pEnd = &aData[pPg->pBt->usableSize];
  u8 * const pStart = &aData[pPg->hdrOffset + 8 + pPg->childPtrSize];
  int nRet = 0;
  int i;
  int iEnd = iFirst + nCell;
  u8 *pFree = 0;
  int szFree = 0;

  for(i=iFirst; i<iEnd; i++){
    u8 *pCell = pCArray->apCell[i];
    if( SQLITE_WITHIN(pCell, pStart, pEnd) ){
      int sz;
      /* No need to use cachedCellSize() here.  The sizes of all cells that
      ** are to be freed have already been computing while deciding which
      ** cells need freeing */
      sz = pCArray->szCell[i];  assert( sz>0 );
      if( pFree!=(pCell + sz) ){
        if( pFree ){
          assert( pFree>aData && (pFree - aData)<65536 );
          freeSpace(pPg, (u16)(pFree - aData), szFree);
        }
        pFree = pCell;
        szFree = sz;
        if( pFree+sz>pEnd ) return 0;
      }else{
        pFree = pCell;
        szFree += sz;
      }
      nRet++;
    }
  }
  if( pFree ){
    assert( pFree>aData && (pFree - aData)<65536 );
    freeSpace(pPg, (u16)(pFree - aData), szFree);
  }
  return nRet;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
testl %edx, %edx
jle 0x2a3ada
movq 0x48(%rdi), %rax
movq 0x50(%rdi), %r10
movl 0x38(%rax), %r11d
addq %r10, %r11
movzbl 0x9(%rdi), %eax
movzbl 0xa(%rdi), %r8d
movq %r10, (%rsp)
addq %r10, %rax
addq %rax, %r8
addq $0x8, %r8
addl %esi, %edx
movslq %esi, %r12
movslq %edx, %r15
xorl %r13d, %r13d
xorl %edx, %edx
xorl %esi, %esi
movq %r11, 0x18(%rsp)
movq %r8, 0x10(%rsp)
movq %rcx, 0x8(%rsp)
movq 0x10(%rcx), %rax
movq (%rax,%r12,8), %r14
cmpq %r8, %r14
jb 0x2a3aba
cmpq %r11, %r14
jae 0x2a3aba
movq 0x18(%rcx), %rax
movzwl (%rax,%r12,2), %ebx
movq %rbx, %rbp
addq %r14, %rbp
cmpq %rbp, %rsi
je 0x2a3aae
testq %rsi, %rsi
je 0x2a3aa7
subl (%rsp), %esi
movl $0xffff, %eax           # imm = 0xFFFF
andl %eax, %edx
andl %eax, %esi
movq %r13, 0x20(%rsp)
movq %rdi, %r13
callq 0x2a2ac5
movq 0x10(%rsp), %r8
movq 0x18(%rsp), %r11
movq 0x8(%rsp), %rcx
movq %r13, %rdi
movq 0x20(%rsp), %r13
cmpq %r11, %rbp
jbe 0x2a3ab2
jmp 0x2a3ada
addl %ebx, %edx
movl %edx, %ebx
incl %r13d
movq %r14, %rsi
movl %ebx, %edx
incq %r12
cmpq %r15, %r12
jl 0x2a3a4c
testq %rsi, %rsi
je 0x2a3add
subl (%rsp), %esi
movl $0xffff, %eax           # imm = 0xFFFF
andl %eax, %edx
andl %eax, %esi
callq 0x2a2ac5
jmp 0x2a3add
xorl %r13d, %r13d
movl %r13d, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: vdbeSorterSort
static int vdbeSorterSort(SortSubtask *pTask, SorterList *pList){
  int i;
  SorterRecord *p;
  int rc;
  SorterRecord *aSlot[64];

  rc = vdbeSortAllocUnpacked(pTask);
  if( rc!=SQLITE_OK ) return rc;

  p = pList->pList;
  pTask->xCompare = vdbeSorterGetCompare(pTask->pSorter);
  memset(aSlot, 0, sizeof(aSlot));

  while( p ){
    SorterRecord *pNext;
    if( pList->aMemory ){
      if( (u8*)p==pList->aMemory ){
        pNext = 0;
      }else{
        assert( p->u.iNext<sqlite3MallocSize(pList->aMemory) );
        pNext = (SorterRecord*)&pList->aMemory[p->u.iNext];
      }
    }else{
      pNext = p->u.pNext;
    }

    p->u.pNext = 0;
    for(i=0; aSlot[i]; i++){
      p = vdbeSorterMerge(pTask, p, aSlot[i]);
      aSlot[i] = 0;
    }
    aSlot[i] = p;
    p = pNext;
  }

  p = 0;
  for(i=0; i<ArraySize(aSlot); i++){
    if( aSlot[i]==0 ) continue;
    p = p ? vdbeSorterMerge(pTask, p, aSlot[i]) : aSlot[i];
  }
  pList->pList = p;

  assert( pTask->pUnpacked->errCode==SQLITE_OK
       || pTask->pUnpacked->errCode==SQLITE_NOMEM
  );
  return pTask->pUnpacked->errCode;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x208, %rsp            # imm = 0x208
movq %rsi, %r14
movq %rdi, %rbx
cmpq $0x0, 0x18(%rdi)
movq 0x10(%rdi), %rcx
jne 0x2a3cb2
movq 0x28(%rcx), %rdi
callq 0x29c6eb
movq %rax, 0x18(%rbx)
testq %rax, %rax
je 0x2a3d9d
movq 0x10(%rbx), %rcx
movq 0x28(%rcx), %rdx
movzwl 0x6(%rdx), %edx
movw %dx, 0x10(%rax)
movb $0x0, 0x13(%rax)
movq (%r14), %r15
movb 0x5c(%rcx), %al
cmpb $0x2, %al
leaq 0x455(%rip), %rcx       # 0x2a4116
leaq 0x546(%rip), %rdx       # 0x2a420e
cmoveq %rcx, %rdx
cmpb $0x1, %al
leaq 0x330(%rip), %rax       # 0x2a4005
cmovneq %rdx, %rax
movq %rax, 0x40(%rbx)
movq %rsp, %r12
movl $0x200, %edx            # imm = 0x200
movq %r12, %rdi
xorl %esi, %esi
callq 0x173a0
testq %r15, %r15
je 0x2a3d54
movq 0x8(%r14), %r13
testq %r13, %r13
je 0x2a3d0b
cmpq %r13, %r15
je 0x2a3d11
movslq 0x8(%r15), %rax
addq %rax, %r13
jmp 0x2a3d14
movq 0x8(%r15), %r13
jmp 0x2a3d14
xorl %r13d, %r13d
movq $0x0, 0x8(%r15)
movq (%rsp), %rdx
movq %r12, %rbp
testq %rdx, %rdx
je 0x2a3d48
movq %rbx, %rdi
movq %r15, %rsi
callq 0x2a3f60
movq %rax, %r15
movq $0x0, (%rbp)
movq 0x8(%rbp), %rdx
addq $0x8, %rbp
jmp 0x2a3d23
movq %r15, (%rbp)
movq %r13, %r15
testq %r13, %r13
jne 0x2a3cf4
xorl %r15d, %r15d
xorl %eax, %eax
movq (%rsp,%r15,8), %rdx
testq %rdx, %rdx
je 0x2a3d77
testq %rax, %rax
je 0x2a3d74
movq %rbx, %rdi
movq %rax, %rsi
callq 0x2a3f60
jmp 0x2a3d77
movq %rdx, %rax
incq %r15
cmpq $0x40, %r15
jne 0x2a3d59
movq %rax, (%r14)
movq 0x18(%rbx), %rax
movzbl 0x13(%rax), %eax
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x7, %eax
jmp 0x2a3d8b
// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: vdbeSorterMerge
static SorterRecord *vdbeSorterMerge(
  SortSubtask *pTask,             /* Calling thread context */
  SorterRecord *p1,               /* First list to merge */
  SorterRecord *p2                /* Second list to merge */
){
  SorterRecord *pFinal = 0;
  SorterRecord **pp = &pFinal;
  int bCached = 0;

  assert( p1!=0 && p2!=0 );
  for(;;){
    int res;
    res = pTask->xCompare(
        pTask, &bCached, SRVAL(p1), p1->nVal, SRVAL(p2), p2->nVal
    );

    if( res<=0 ){
      *pp = p1;
      pp = &p1->u.pNext;
      p1 = p1->u.pNext;
      if( p1==0 ){
        *pp = p2;
        break;
      }
    }else{
      *pp = p2;
      pp = &p2->u.pNext;
      p2 = p2->u.pNext;
      bCached = 0;
      if( p2==0 ){
        *pp = p1;
        break;
      }
    }
  }
  return pFinal;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x10(%rsp), %rbp
movq $0x0, (%rbp)
leaq 0xc(%rsp), %r12
movl $0x0, (%r12)
leaq 0x10(%r14), %r13
leaq 0x10(%r15), %rdx
movl (%r15), %ecx
movl (%r14), %r9d
movq %rbx, %rdi
movq %r12, %rsi
movq %r13, %r8
callq *0x40(%rbx)
testl %eax, %eax
jg 0x2a3fc8
movq %r15, (%rbp)
movq %r15, %rbp
movq 0x8(%r15), %rax
addq $0x8, %rbp
movq %rax, %r15
testq %rax, %rax
jne 0x2a3f95
jmp 0x2a3fed
movq %r14, (%rbp)
movq %r14, %rbp
movq 0x8(%r14), %rax
addq $0x8, %rbp
movl $0x0, 0xc(%rsp)
movq %rax, %r14
testq %rax, %rax
jne 0x2a3f91
movq %r15, (%rbp)
jmp 0x2a3ff1
movq %r14, (%rbp)
movq 0x10(%rsp), %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: vdbeSorterCompareText
static int vdbeSorterCompareText(
  SortSubtask *pTask,             /* Subtask context (for pKeyInfo) */
  int *pbKey2Cached,              /* True if pTask->pUnpacked is pKey2 */
  const void *pKey1, int nKey1,   /* Left side of comparison */
  const void *pKey2, int nKey2    /* Right side of comparison */
){
  const u8 * const p1 = (const u8 * const)pKey1;
  const u8 * const p2 = (const u8 * const)pKey2;
  const u8 * const v1 = &p1[ p1[0] ];   /* Pointer to value 1 */
  const u8 * const v2 = &p2[ p2[0] ];   /* Pointer to value 2 */

  int n1;
  int n2;
  int res;

  getVarint32NR(&p1[1], n1);
  getVarint32NR(&p2[1], n2);
  res = memcmp(v1, v2, (MIN(n1, n2) - 13)/2);
  if( res==0 ){
    res = n1 - n2;
  }

  if( res==0 ){
    if( pTask->pSorter->pKeyInfo->nKeyField>1 ){
      res = vdbeSorterCompareTail(
          pTask, pbKey2Cached, pKey1, nKey1, pKey2, nKey2
      );
    }
  }else{
    assert( !(pTask->pSorter->pKeyInfo->aSortFlags[0]&KEYINFO_ORDER_BIGNULL) );
    if( pTask->pSorter->pKeyInfo->aSortFlags[0] ){
      res = res * -1;
    }
  }

  return res;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %r9d, 0x8(%rsp)
movq %r8, %r14
movl %ecx, 0x4(%rsp)
movq %rdx, %r15
movq %rsi, 0x10(%rsp)
movq %rdi, %r13
movzbl (%rdx), %ebx
movzbl (%r8), %ebp
movzbl 0x1(%rdx), %eax
movl %eax, (%rsp)
testb %al, %al
jns 0x2a4159
leaq 0x1(%r15), %rdi
movq %rsp, %rsi
callq 0x29b609
addq %r15, %rbx
addq %r14, %rbp
movzbl 0x1(%r14), %eax
movl %eax, 0xc(%rsp)
testb %al, %al
jns 0x2a4181
leaq 0x1(%r14), %rdi
leaq 0xc(%rsp), %r12
movq %r12, %rsi
callq 0x29b609
movl (%r12), %eax
movl (%rsp), %ecx
movl %ecx, %r12d
subl %eax, %r12d
cmovll %ecx, %eax
movl %eax, %ecx
addl $-0xd, %ecx
shrl $0x1f, %ecx
addl %ecx, %eax
addl $-0xd, %eax
sarl %eax
movslq %eax, %rdx
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x17300
testl %eax, %eax
cmovnel %eax, %r12d
movq 0x10(%r13), %rax
movq 0x28(%rax), %rcx
testl %r12d, %r12d
je 0x2a41cf
movq 0x18(%rcx), %rcx
movl %r12d, %eax
negl %eax
cmpb $0x0, (%rcx)
cmovel %r12d, %eax
jmp 0x2a41ff
xorl %eax, %eax
cmpw $0x2, 0x6(%rcx)
jb 0x2a41ff
movq %r13, %rdi
movq 0x10(%rsp), %rsi
movq %r15, %rdx
movl 0x4(%rsp), %ecx
movq %r14, %r8
movl 0x8(%rsp), %r9d
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2a425c
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: vdbeSorterCompare
static int vdbeSorterCompare(
  SortSubtask *pTask,             /* Subtask context (for pKeyInfo) */
  int *pbKey2Cached,              /* True if pTask->pUnpacked is pKey2 */
  const void *pKey1, int nKey1,   /* Left side of comparison */
  const void *pKey2, int nKey2    /* Right side of comparison */
){
  UnpackedRecord *r2 = pTask->pUnpacked;
  if( !*pbKey2Cached ){
    sqlite3VdbeRecordUnpack(pTask->pSorter->pKeyInfo, nKey2, pKey2, r2);
    *pbKey2Cached = 1;
  }
  return sqlite3VdbeRecordCompare(nKey1, pKey1, r2);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %ecx, %ebp
movq %rdx, %rbx
movq 0x18(%rdi), %r14
cmpl $0x0, (%rsi)
jne 0x2a4243
movq %rsi, %r15
movq 0x10(%rdi), %rax
movq 0x28(%rax), %rdi
movl %r9d, %esi
movq %r8, %rdx
movq %r14, %rcx
callq 0x29c72f
movl $0x1, (%r15)
movl %ebp, %edi
movq %rbx, %rsi
movq %r14, %rdx
xorl %ecx, %ecx
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x29ff8a
// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: vdbeSorterOpenTempFile
static int vdbeSorterOpenTempFile(
  sqlite3 *db,                    /* Database handle doing sort */
  i64 nExtend,                    /* Attempt to extend file to this size */
  sqlite3_file **ppFd
){
  int rc;
  if( sqlite3FaultSim(202) ) return SQLITE_IOERR_ACCESS;
  rc = sqlite3OsOpenMalloc(db->pVfs, 0, ppFd,
      SQLITE_OPEN_TEMP_JOURNAL |
      SQLITE_OPEN_READWRITE    | SQLITE_OPEN_CREATE |
      SQLITE_OPEN_EXCLUSIVE    | SQLITE_OPEN_DELETEONCLOSE, &rc
  );
  if( rc==SQLITE_OK ){
    i64 max = SQLITE_MAX_MMAP_SIZE;
    sqlite3OsFileControlHint(*ppFd, SQLITE_FCNTL_MMAP_SIZE, (void*)&max);
    if( nExtend>0 ){
      vdbeSorterExtendFile(db, *ppFd, nExtend);
    }
  }
  return rc;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r15
movq 0x217520(%rip), %rax    # 0x4bb7e8
testq %rax, %rax
je 0x2a42df
movl $0xca, %edi
callq *%rax
movl %eax, %ecx
movl $0xd0a, %eax            # imm = 0xD0A
testl %ecx, %ecx
jne 0x2a433d
movq (%r15), %rdi
leaq 0xc(%rsp), %r12
xorl %esi, %esi
movq %r14, %rdx
movl $0x101e, %ecx           # imm = 0x101E
movq %r12, %r8
callq 0x291412
movl %eax, (%r12)
testl %eax, %eax
jne 0x2a433d
movq $0x7fff0000, 0x10(%rsp) # imm = 0x7FFF0000
movq (%r14), %rdi
movq (%rdi), %rax
testq %rax, %rax
je 0x2a4322
leaq 0x10(%rsp), %rdx
movl $0x12, %esi
callq *0x50(%rax)
testq %rbx, %rbx
jle 0x2a4339
movq (%r14), %rsi
movl 0xac(%r15), %edi
movq %rbx, %rdx
callq 0x2a4349
movl 0xc(%rsp), %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: vdbeSorterExtendFile
static void vdbeSorterExtendFile(sqlite3 *db, sqlite3_file *pFd, i64 nByte){
  if( nByte<=(i64)(db->nMaxSorterMmap) && pFd->pMethods->iVersion>=3 ){
    void *p = 0;
    int chunksize = 4*1024;
    sqlite3OsFileControlHint(pFd, SQLITE_FCNTL_CHUNK_SIZE, &chunksize);
    sqlite3OsFileControlHint(pFd, SQLITE_FCNTL_SIZE_HINT, &nByte);
    sqlite3OsFetch(pFd, 0, (int)nByte, &p);
    sqlite3OsUnfetch(pFd, 0, p);
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rdx, 0x8(%rsp)
movslq %edi, %rax
cmpq %rdx, %rax
jl 0x2a43c7
movq %rsi, %rbx
movq (%rsi), %rax
cmpl $0x3, (%rax)
jl 0x2a43c7
leaq 0x18(%rsp), %r14
movq $0x0, (%r14)
leaq 0x14(%rsp), %rdx
movl $0x1000, (%rdx)         # imm = 0x1000
movq %rbx, %rdi
movl $0x6, %esi
callq *0x50(%rax)
movq (%rbx), %rax
leaq 0x8(%rsp), %r15
movq %rbx, %rdi
movl $0x5, %esi
movq %r15, %rdx
callq *0x50(%rax)
movl (%r15), %edx
movq (%rbx), %rax
movq %rbx, %rdi
xorl %esi, %esi
movq %r14, %rcx
callq *0x88(%rax)
movq (%r14), %rdx
movq (%rbx), %rax
movq %rbx, %rdi
xorl %esi, %esi
callq *0x90(%rax)
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: vdbePmaWriteBlob
static void vdbePmaWriteBlob(PmaWriter *p, u8 *pData, int nData){
  int nRem = nData;
  while( nRem>0 && p->eFWErr==0 ){
    int nCopy = nRem;
    if( nCopy>(p->nBuffer - p->iBufEnd) ){
      nCopy = p->nBuffer - p->iBufEnd;
    }

    memcpy(&p->aBuffer[p->iBufEnd], &pData[nData-nRem], nCopy);
    p->iBufEnd += nCopy;
    if( p->iBufEnd==p->nBuffer ){
      p->eFWErr = sqlite3OsWrite(p->pFd,
          &p->aBuffer[p->iBufStart], p->iBufEnd - p->iBufStart,
          p->iWriteOff + p->iBufStart
      );
      p->iBufStart = p->iBufEnd = 0;
      p->iWriteOff += p->nBuffer;
    }
    assert( p->iBufEnd<p->nBuffer );

    nRem -= nCopy;
  }
}

// Assembly:
testl %edx, %edx
jle 0x2a4472
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
movl %edx, %ebp
cmpl $0x0, (%r15)
jne 0x2a4464
movl 0x10(%r15), %r13d
movslq 0x18(%r15), %rdi
subl %edi, %r13d
cmpl %r13d, %ebp
cmovll %ebp, %r13d
addq 0x8(%r15), %rdi
movl %ebx, %eax
subl %ebp, %eax
movslq %eax, %rsi
addq %r14, %rsi
movslq %r13d, %r12
movq %r12, %rdx
callq 0x17660
addl 0x18(%r15), %r12d
movl %r12d, 0x18(%r15)
cmpl 0x10(%r15), %r12d
jne 0x2a445f
movq 0x28(%r15), %rdi
movslq 0x14(%r15), %rcx
movq 0x8(%r15), %rsi
addq %rcx, %rsi
subl %ecx, %r12d
addq 0x20(%r15), %rcx
movq (%rdi), %rax
movl %r12d, %edx
callq *0x18(%rax)
movl %eax, (%r15)
movq $0x0, 0x14(%r15)
movslq 0x10(%r15), %rax
addq %rax, 0x20(%r15)
subl %r13d, %ebp
jg 0x2a43ee
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: vdbePmaWriterFinish
static int vdbePmaWriterFinish(PmaWriter *p, i64 *piEof){
  int rc;
  if( p->eFWErr==0 && ALWAYS(p->aBuffer) && p->iBufEnd>p->iBufStart ){
    p->eFWErr = sqlite3OsWrite(p->pFd,
        &p->aBuffer[p->iBufStart], p->iBufEnd - p->iBufStart,
        p->iWriteOff + p->iBufStart
    );
  }
  *piEof = (p->iWriteOff + p->iBufEnd);
  sqlite3_free(p->aBuffer);
  rc = p->eFWErr;
  memset(p, 0, sizeof(PmaWriter));
  return rc;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
cmpl $0x0, (%rdi)
je 0x2a44ae
movslq 0x18(%rbx), %rax
addq 0x20(%rbx), %rax
movq %rax, (%r14)
movq 0x8(%rbx), %rdi
callq 0x272c00
movl (%rbx), %eax
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rbx)
movups %xmm0, 0x20(%rbx)
movups %xmm0, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq 0x8(%rbx), %rsi
testq %rsi, %rsi
je 0x2a4482
movl 0x18(%rbx), %edx
movslq 0x14(%rbx), %rcx
cmpl %ecx, %edx
jle 0x2a4482
movq 0x28(%rbx), %rdi
addq %rcx, %rsi
subl %ecx, %edx
addq 0x20(%rbx), %rcx
movq (%rdi), %rax
callq *0x18(%rax)
movl %eax, (%rbx)
jmp 0x2a4482
// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: vdbeMergeEngineLevel0
static int vdbeMergeEngineLevel0(
  SortSubtask *pTask,             /* Sorter task to read from */
  int nPMA,                       /* Number of PMAs to read */
  i64 *piOffset,                  /* IN/OUT: Readr offset in pTask->file */
  MergeEngine **ppOut             /* OUT: New merge-engine */
){
  MergeEngine *pNew;              /* Merge engine to return */
  i64 iOff = *piOffset;
  int i;
  int rc = SQLITE_OK;

  *ppOut = pNew = vdbeMergeEngineNew(nPMA);
  if( pNew==0 ) rc = SQLITE_NOMEM_BKPT;

  for(i=0; i<nPMA && rc==SQLITE_OK; i++){
    i64 nDummy = 0;
    PmaReader *pReadr = &pNew->aReadr[i];
    rc = vdbePmaReaderInit(pTask, &pTask->file, iOff, pReadr, &nDummy);
    iOff = pReadr->iEof;
  }

  if( rc!=SQLITE_OK ){
    vdbeMergeEngineFree(pNew);
    *ppOut = 0;
  }
  *piOffset = iOff;
  return rc;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rcx, %r14
movl %esi, %ebx
movq %rdi, %r15
movq %rdx, 0x18(%rsp)
movq (%rdx), %r12
movl %esi, %edi
callq 0x2a47bb
movq %r14, 0x10(%rsp)
movq %rax, (%r14)
xorl %ecx, %ecx
movq %rax, (%rsp)
testq %rax, %rax
setne %al
movl $0x7, %ebp
cmovnel %ecx, %ebp
testl %ebx, %ebx
setg %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x2a4780
movq %r15, 0x30(%rsp)
leaq 0x48(%r15), %rax
movq %rax, 0x28(%rsp)
movl %ebx, %eax
movq %rax, 0x20(%rsp)
movl $0x1, %r15d
xorl %r13d, %r13d
movq (%rsp), %rax
movq 0x18(%rax), %r14
leaq (%r14,%r13), %rbx
movq 0x30(%rsp), %rdi
movq %rbx, %rsi
movq 0x28(%rsp), %rdx
movq %r12, %rcx
callq 0x2a484e
testl %eax, %eax
jne 0x2a4786
movq $0x0, 0x8(%rsp)
movq %rbx, %rdi
leaq 0x8(%rsp), %rsi
callq 0x2a4989
movl %eax, %ebp
movq 0x8(%rsp), %rax
addq (%r14,%r13), %rax
movq %rax, 0x8(%r14,%r13)
testl %ebp, %ebp
jne 0x2a4788
movq %rbx, %rdi
callq 0x2a4a33
movl %eax, %ebp
movq 0x8(%r14,%r13), %r12
testl %eax, %eax
sete %al
cmpq 0x20(%rsp), %r15
jae 0x2a4780
addq $0x50, %r13
incq %r15
testl %ebp, %ebp
je 0x2a470b
testb %al, %al
je 0x2a478d
jmp 0x2a47a2
movl %eax, %ebp
movq 0x8(%r14,%r13), %r12
movq (%rsp), %rdi
callq 0x2911da
movq 0x10(%rsp), %rax
movq $0x0, (%rax)
movq 0x18(%rsp), %rax
movq %r12, (%rax)
movl %ebp, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: vdbeMergeEngineNew
static MergeEngine *vdbeMergeEngineNew(int nReader){
  int N = 2;                      /* Smallest power of two >= nReader */
  int nByte;                      /* Total bytes of space to allocate */
  MergeEngine *pNew;              /* Pointer to allocated object to return */

  assert( nReader<=SORTER_MAX_MERGE_COUNT );

  while( N<nReader ) N += N;
  nByte = sizeof(MergeEngine) + N * (sizeof(int) + sizeof(PmaReader));

  pNew = sqlite3FaultSim(100) ? 0 : (MergeEngine*)sqlite3MallocZero(nByte);
  if( pNew ){
    pNew->nTree = N;
    pNew->pTask = 0;
    pNew->aReadr = (PmaReader*)&pNew[1];
    pNew->aTree = (int*)&pNew->aReadr[N];
  }
  return pNew;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl $0x2, %eax
movl %eax, %r15d
leal (%r15,%r15), %eax
cmpl %edi, %r15d
jl 0x2a47c8
movq 0x21700d(%rip), %rax    # 0x4bb7e8
testq %rax, %rax
je 0x2a47eb
movl $0x64, %edi
callq *%rax
testl %eax, %eax
jne 0x2a483d
imull $0x54, %r15d, %eax
addl $0x20, %eax
movslq %eax, %r14
movq %r14, %rdi
callq 0x272ae6
testq %rax, %rax
je 0x2a483d
movq %rax, %rbx
movslq %r15d, %r12
movq %rax, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x173a0
movl %r15d, (%rbx)
movq $0x0, 0x8(%rbx)
leaq 0x20(%rbx), %rax
movq %rax, 0x18(%rbx)
leaq (%r12,%r12,4), %rax
shlq $0x4, %rax
addq %rbx, %rax
addq $0x20, %rax
movq %rax, 0x10(%rbx)
jmp 0x2a483f
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: vdbePmaReaderSeek
static int vdbePmaReaderSeek(
  SortSubtask *pTask,             /* Task context */
  PmaReader *pReadr,              /* Reader whose cursor is to be moved */
  SorterFile *pFile,              /* Sorter file to read from */
  i64 iOff                        /* Offset in pFile */
){
  int rc = SQLITE_OK;

  assert( pReadr->pIncr==0 || pReadr->pIncr->bEof==0 );

  if( sqlite3FaultSim(201) ) return SQLITE_IOERR_READ;
  if( pReadr->aMap ){
    sqlite3OsUnfetch(pReadr->pFd, 0, pReadr->aMap);
    pReadr->aMap = 0;
  }
  pReadr->iReadOff = iOff;
  pReadr->iEof = pFile->iEof;
  pReadr->pFd = pFile->pFd;

  rc = vdbeSorterMapFile(pTask, pFile, &pReadr->aMap);
  if( rc==SQLITE_OK && pReadr->aMap==0 ){
    int pgsz = pTask->pSorter->pgsz;
    int iBuf = pReadr->iReadOff % pgsz;
    if( pReadr->aBuffer==0 ){
      pReadr->aBuffer = (u8*)sqlite3Malloc(pgsz);
      if( pReadr->aBuffer==0 ) rc = SQLITE_NOMEM_BKPT;
      pReadr->nBuffer = pgsz;
    }
    if( rc==SQLITE_OK && iBuf ){
      int nRead = pgsz - iBuf;
      if( (pReadr->iReadOff + nRead) > pReadr->iEof ){
        nRead = (int)(pReadr->iEof - pReadr->iReadOff);
      }
      rc = sqlite3OsRead(
          pReadr->pFd, &pReadr->aBuffer[iBuf], nRead, pReadr->iReadOff
      );
      testcase( rc!=SQLITE_OK );
    }
  }

  return rc;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rcx, %r12
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
movq 0x216f7f(%rip), %rax    # 0x4bb7e8
testq %rax, %rax
je 0x2a4884
movl $0xc9, %edi
callq *%rax
movl %eax, %ecx
movl $0x10a, %eax            # imm = 0x10A
testl %ecx, %ecx
jne 0x2a4980
movq 0x40(%rbx), %rdx
testq %rdx, %rdx
je 0x2a48a4
movq 0x18(%rbx), %rdi
movq (%rdi), %rax
xorl %esi, %esi
callq *0x90(%rax)
movq $0x0, 0x40(%rbx)
movq %r12, (%rbx)
movq 0x8(%r15), %rdx
movq %rdx, 0x8(%rbx)
movq (%r15), %rdi
movq %rdi, 0x18(%rbx)
movq 0x10(%r14), %rax
movq 0x20(%rax), %rax
movslq 0xac(%rax), %rax
cmpq %rax, %rdx
jg 0x2a48f8
movq (%rdi), %rax
cmpl $0x3, (%rax)
jl 0x2a48f8
leaq 0x40(%rbx), %r15
xorl %esi, %esi
movq %r15, %rcx
callq *0x88(%rax)
testl %eax, %eax
jne 0x2a4980
cmpq $0x0, (%r15)
movl $0x0, %eax
jne 0x2a4980
movq 0x10(%r14), %rax
movl 0xc(%rax), %ebp
movslq %ebp, %r15
movq (%rbx), %rax
movq 0x30(%rbx), %rsi
cqto
idivq %r15
movq %rdx, %r14
xorl %eax, %eax
testq %rsi, %rsi
jne 0x2a4938
movq %r15, %rdi
callq 0x272ae6
movq %rax, %rsi
movq %rax, 0x30(%rbx)
xorl %ecx, %ecx
testq %rax, %rax
movl $0x7, %eax
cmovnel %ecx, %eax
movl %r15d, 0x38(%rbx)
testl %eax, %eax
sete %cl
testq %r14, %r14
setne %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x2a4980
subl %r14d, %ebp
movslq %ebp, %rdx
movq (%rbx), %rcx
movq 0x8(%rbx), %rax
leaq (%rcx,%rdx), %rdi
movl %eax, %r8d
subl %ecx, %r8d
cmpq %rax, %rdi
cmovgl %r8d, %edx
movq 0x18(%rbx), %rdi
addq %r14, %rsi
movq (%rdi), %rax
movq 0x10(%rax), %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmpq *%rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: vdbePmaReadVarint
static int vdbePmaReadVarint(PmaReader *p, u64 *pnOut){
  int iBuf;

  if( p->aMap ){
    p->iReadOff += sqlite3GetVarint(&p->aMap[p->iReadOff], pnOut);
  }else{
    iBuf = p->iReadOff % p->nBuffer;
    if( iBuf && (p->nBuffer-iBuf)>=9 ){
      p->iReadOff += sqlite3GetVarint(&p->aBuffer[iBuf], pnOut);
    }else{
      u8 aVarint[16], *a;
      int i = 0, rc;
      do{
        rc = vdbePmaReadBlob(p, 1, &a);
        if( rc ) return rc;
        aVarint[(i++)&0xf] = a[0];
      }while( (a[0]&0x80)!=0 );
      sqlite3GetVarint(aVarint, pnOut);
    }
  }

  return SQLITE_OK;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq (%rdi), %rax
movq 0x40(%rdi), %rdi
testq %rdi, %rdi
je 0x2a49ab
addq %rax, %rdi
jmp 0x2a49d0
movslq 0x38(%rbx), %rcx
cqto
idivq %rcx
testq %rdx, %rdx
setne %al
subl %edx, %ecx
cmpl $0x9, %ecx
setge %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x2a49ec
addq 0x30(%rbx), %rdx
movq %rdx, %rdi
movq %r14, %rsi
callq 0x28b524
movzbl %al, %eax
addq %rax, (%rbx)
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
xorl %r12d, %r12d
leaq 0x8(%rsp), %r15
movq %rbx, %rdi
movl $0x1, %esi
movq %r15, %rdx
callq 0x2a4c62
testl %eax, %eax
jne 0x2a49e0
movq 0x8(%rsp), %rax
movb (%rax), %al
leal 0x1(%r12), %ecx
andl $0xf, %r12d
movb %al, 0x10(%rsp,%r12)
movl %ecx, %r12d
testb %al, %al
js 0x2a49f4
leaq 0x10(%rsp), %rdi
movq %r14, %rsi
callq 0x28b524
jmp 0x2a49de
// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: vdbeIncrMergerNew
static int vdbeIncrMergerNew(
  SortSubtask *pTask,     /* The thread that will be using the new IncrMerger */
  MergeEngine *pMerger,   /* The MergeEngine that the IncrMerger will control */
  IncrMerger **ppOut      /* Write the new IncrMerger here */
){
  int rc = SQLITE_OK;
  IncrMerger *pIncr = *ppOut = (IncrMerger*)
       (sqlite3FaultSim(100) ? 0 : sqlite3MallocZero(sizeof(*pIncr)));
  if( pIncr ){
    pIncr->pMerger = pMerger;
    pIncr->pTask = pTask;
    pIncr->mxSz = MAX(pTask->pSorter->mxKeysize+9,pTask->pSorter->mxPmaSize/2);
    pTask->file2.iEof += pIncr->mxSz;
  }else{
    vdbeMergeEngineFree(pMerger);
    rc = SQLITE_NOMEM_BKPT;
  }
  return rc;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
movq 0x216868(%rip), %rax    # 0x4bb7e8
testq %rax, %rax
je 0x2a4f90
movl $0x64, %edi
callq *%rax
testl %eax, %eax
jne 0x2a4fe9
movl $0x48, %edi
callq 0x272ae6
testq %rax, %rax
je 0x2a4fe9
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%rax)
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x10(%rax)
movq $0x0, 0x40(%rax)
movq %rax, (%r15)
movq %r14, 0x8(%rax)
movq %rbx, (%rax)
movq 0x10(%rbx), %rcx
movl 0x4(%rcx), %edx
movl 0x8(%rcx), %ecx
addl $0x9, %ecx
movl %edx, %esi
shrl $0x1f, %esi
addl %edx, %esi
sarl %esi
cmpl %esi, %ecx
cmovgl %ecx, %esi
movl %esi, 0x18(%rax)
movslq %esi, %rax
addq %rax, 0x60(%rbx)
xorl %eax, %eax
jmp 0x2a4ffd
movq $0x0, (%r15)
movq %r14, %rdi
callq 0x2911da
movl $0x7, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/external/sqlite-3.33.0/sqlite3.c
// Function: sqlite3FindCollSeq
SQLITE_PRIVATE CollSeq *sqlite3FindCollSeq(
  sqlite3 *db,          /* Database connection to search */
  u8 enc,               /* Desired text encoding */
  const char *zName,    /* Name of the collating sequence.  Might be NULL */
  int create            /* True to create CollSeq if doesn't already exist */
){
  CollSeq *pColl;
  assert( SQLITE_UTF8==1 && SQLITE_UTF16LE==2 && SQLITE_UTF16BE==3 );
  assert( enc>=SQLITE_UTF8 && enc<=SQLITE_UTF16BE );
  if( zName ){
    pColl = findCollSeqEntry(db, zName, create);
    if( pColl ) pColl += enc-1;
  }else{
    pColl = db->pDfltColl;
  }
  return pColl;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
testq %rdx, %rdx
je 0x2a51e2
movl %ecx, %r13d
movq %rdx, %r14
movl %esi, %ebp
leaq 0x238(%rbx), %r15
movq %r15, %rdi
movq %rdx, %rsi
xorl %edx, %edx
callq 0x2a547e
movq 0x10(%rax), %r12
testq %r12, %r12
setne %al
testl %r13d, %r13d
sete %cl
orb %al, %cl
jne 0x2a51e8
movq %r14, %rdi
callq 0x172f0
movq %rax, %r13
andl $0x3fffffff, %r13d      # imm = 0x3FFFFFFF
leaq 0x79(%r13), %rsi
movq %rbx, %rdi
callq 0x279b27
testq %rax, %rax
je 0x2a51ff
movq %rax, %r12
incq %r13
movl %ebp, 0x4(%rsp)
movq %rax, %rbp
addq $0x78, %rbp
movq %rbp, (%rax)
movb $0x1, 0x8(%rax)
movq %rbp, 0x28(%rax)
movb $0x2, 0x30(%rax)
movq %rbp, 0x50(%rax)
movb $0x3, 0x58(%rax)
movq %rbp, %rdi
movq %r14, %rsi
movq %r13, %rdx
callq 0x17660
movq %r15, %rdi
movq %rbp, %rsi
movl 0x4(%rsp), %ebp
movq %r12, %rdx
callq 0x2a5210
testq %rax, %rax
je 0x2a51ed
movq %rax, %r14
movq %rbx, %rdi
callq 0x278b1c
movq %rbx, %rdi
movq %r14, %rsi
callq 0x282904
jmp 0x2a51ff
movq 0x10(%rbx), %rax
jmp 0x2a5201
testq %r12, %r12
je 0x2a51ff
movzbl %bpl, %eax
leaq (%rax,%rax,4), %rax
leaq (%r12,%rax,8), %rax
addq $-0x28, %rax
jmp 0x2a5201
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq