LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/regidx.c
// Function: regitr_overlap
int regitr_overlap(regitr_t *regitr)
{
    if ( !regitr || !regitr->seq || !regitr->itr ) return 0;

    itr_t_ *itr = (itr_t_*) regitr->itr;
    if ( !itr->active )
    {
        // is this the first call after regidx_overlap?
        itr->active = 1;
        itr->ireg++;
        return 1;
    }

    reglist_t *list = itr->list;

    int i;
    for (i=itr->ireg; i<list->nreg; i++)
    {
        if ( list->reg[i].beg > itr->end ) return 0;   // no match, past the query region
        if ( list->reg[i].end >= itr->beg && list->reg[i].beg <= itr->end ) break; // found
    }

    if ( i >= list->nreg ) return 0;   // no match

    itr->ireg = i + 1;
    regitr->seq = list->seq;
    regitr->beg = list->reg[i].beg;
    regitr->end = list->reg[i].end;
    if ( itr->ridx->payload_size )
        regitr->payload = (char *)list->dat + itr->ridx->payload_size*i;

    return 1;
}

// Assembly:
xorl %eax, %eax
testq %rdi, %rdi
je 0x21294
cmpq $0x0, 0x18(%rdi)
je 0x21294
movq 0x20(%rdi), %rcx
testq %rcx, %rcx
je 0x21294
pushq %r15
pushq %r14
pushq %rbx
cmpl $0x0, 0x28(%rcx)
je 0x21280
movq 0x20(%rcx), %rdx
movl 0x10(%rcx), %esi
movl 0xc(%rdx), %r10d
cmpl %r10d, %esi
jae 0x2128f
movslq %esi, %rbx
movq 0x18(%rdx), %r8
movq 0x8(%rcx), %r11
movq %rbx, %r9
shlq $0x20, %r9
shlq $0x4, %rbx
addq %r8, %rbx
addq $0x8, %rbx
movabsq $0x100000000, %r14      # imm = 0x100000000
cmpq %r11, -0x8(%rbx)
jg 0x2128f
movq (%rbx), %r15
cmpq (%rcx), %r15
jge 0x21295
addq %r14, %r9
incl %esi
addq $0x10, %rbx
cmpl %esi, %r10d
ja 0x21262
jmp 0x2128f
movl $0x1, 0x28(%rcx)
incl 0x10(%rcx)
movl $0x1, %eax
popq %rbx
popq %r14
popq %r15
retq
leal 0x1(%rsi), %eax
movl %eax, 0x10(%rcx)
movq 0x28(%rdx), %rax
movq %rax, 0x18(%rdi)
sarq $0x1c, %r9
movups (%r8,%r9), %xmm0
movups %xmm0, (%rdi)
movq 0x18(%rcx), %rax
movl 0x38(%rax), %ecx
movl $0x1, %eax
testl %ecx, %ecx
je 0x2128f
imull %esi, %ecx
movslq %ecx, %rcx
addq 0x20(%rdx), %rcx
movq %rcx, 0x10(%rdi)
jmp 0x2128f
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/regidx.c
// Function: regitr_loop
int regitr_loop(regitr_t *regitr)
{
    if ( !regitr || !regitr->itr ) return 0;

    itr_t_ *itr = (itr_t_*) regitr->itr;
    regidx_t *regidx = itr->ridx;

    if ( !itr->list )    // first time here
    {
        itr->list = regidx->seq;
        itr->ireg = 0;
    }

    size_t iseq = itr->list - regidx->seq;
    if ( iseq >= regidx->nseq ) return 0;

    if ( itr->ireg >= itr->list->nreg )
    {
        iseq++;
        if ( iseq >= regidx->nseq ) return 0; // no more sequences, done
        itr->ireg = 0;
        itr->list = &regidx->seq[iseq];
    }

    regitr->seq = itr->list->seq;
    regitr->beg = itr->list->reg[itr->ireg].beg;
    regitr->end = itr->list->reg[itr->ireg].end;
    if ( regidx->payload_size )
        regitr->payload = (char *)itr->list->dat + regidx->payload_size*itr->ireg;
    itr->ireg++;

    return 1;
}

// Assembly:
xorl %eax, %eax
testq %rdi, %rdi
je 0x21383
movq 0x20(%rdi), %rcx
testq %rcx, %rcx
je 0x21383
movq 0x18(%rcx), %rdx
movq 0x20(%rcx), %rsi
movq 0x8(%rdx), %r8
testq %rsi, %rsi
jne 0x21306
movq %r8, 0x20(%rcx)
movl $0x0, 0x10(%rcx)
movq %r8, %rsi
movq %rsi, %r9
subq %r8, %r9
sarq $0x3, %r9
movabsq $0x6db6db6db6db6db7, %r10 # imm = 0x6DB6DB6DB6DB6DB7
imulq %r9, %r10
movslq (%rdx), %r11
cmpq %r11, %r10
jae 0x21383
movl 0x10(%rcx), %r9d
cmpl 0xc(%rsi), %r9d
jb 0x21349
incq %r10
cmpq %r11, %r10
jae 0x21383
imulq $0x38, %r10, %rax
addq %rax, %r8
movq %r8, 0x20(%rcx)
xorl %r9d, %r9d
movq %r8, %rsi
movq 0x28(%rsi), %rax
movq %rax, 0x18(%rdi)
movq 0x18(%rsi), %rax
movl %r9d, %r8d
shlq $0x4, %r8
movups (%rax,%r8), %xmm0
movups %xmm0, (%rdi)
movl 0x38(%rdx), %eax
testl %eax, %eax
je 0x21377
imull %r9d, %eax
addq 0x20(%rsi), %rax
movq %rax, 0x10(%rdi)
incl %r9d
movl %r9d, 0x10(%rcx)
movl $0x1, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/regidx.c
// Function: cmp_reg_ptrs
static inline int cmp_regs(reg_t *a, reg_t *b)
{
    if ( a->beg < b->beg ) return -1;
    if ( a->beg > b->beg ) return 1;
    if ( a->end < b->end ) return 1;    // longer intervals come first
    if ( a->end > b->end ) return -1;
    if ( a < b ) return -1; // this is are just for qsort reproducibility across platforms
    if ( a > b ) return 1;
    return 0;
}

// Assembly:
movq (%rsi), %rcx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq %rcx, (%rdi)
jl 0x21695
movl $0x1, %eax
jg 0x21695
movq 0x8(%rsi), %rcx
cmpq %rcx, 0x8(%rdi)
jl 0x21695
setg %al
cmpq %rsi, %rdi
setb %cl
orb %al, %cl
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jne 0x21695
xorl %eax, %eax
cmpq %rsi, %rdi
seta %al
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/region.c
// Function: reg_destroy
static void reg_destroy(reghash_t *h) {

    khint_t k;

    if (!h)
        return;

    for (k = 0; k < kh_end(h); ++k) {
        if (kh_exist(h, k)) {
            free(kh_val(h, k).a);
        }
    }
    kh_destroy(reg, h);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl (%rdi), %eax
testl %eax, %eax
je 0x21d62
movl $0x4, %r14d
xorl %r15d, %r15d
xorl %r12d, %r12d
movq 0x10(%rbx), %rcx
movq %r12, %rdx
shrq $0x4, %rdx
movl (%rcx,%rdx,4), %edx
movl %r15d, %ecx
andb $0x1e, %cl
shrl %cl, %edx
testb $0x3, %dl
jne 0x21d50
movq 0x20(%rbx), %rax
movq (%rax,%r14,2), %rdi
callq 0x45c0
movl (%rbx), %eax
incq %r12
movl %eax, %ecx
addq $0xc, %r14
addl $0x2, %r15d
cmpq %rcx, %r12
jb 0x21d26
movq 0x18(%rbx), %rdi
callq 0x45c0
movq 0x10(%rbx), %rdi
callq 0x45c0
movq 0x20(%rbx), %rdi
callq 0x45c0
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x45c0
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/region.c
// Function: hts_reglist_free
void hts_reglist_free(hts_reglist_t *reglist, int count) {

    int i;
    if(reglist) {
        for (i = 0; i < count; i++) {
            if (reglist[i].intervals)
                free(reglist[i].intervals);
        }
        free(reglist);
    }
}

// Assembly:
testq %rdi, %rdi
je 0x21dd3
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
testl %esi, %esi
jle 0x21dc6
movl %esi, %eax
shlq $0x3, %rax
leaq (%rax,%rax,4), %r14
xorl %r15d, %r15d
movq 0x8(%rbx,%r15), %rdi
testq %rdi, %rdi
je 0x21dbd
callq 0x45c0
addq $0x28, %r15
cmpq %r15, %r14
jne 0x21dae
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x45c0
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/sam.c
// Function: sam_hdr_destroy
void sam_hdr_destroy(sam_hdr_t *bh)
{
    int32_t i;

    if (bh == NULL) return;

    if (bh->ref_count > 0) {
        --bh->ref_count;
        return;
    }

    if (bh->target_name) {
        for (i = 0; i < bh->n_targets; ++i)
            free(bh->target_name[i]);
        free(bh->target_name);
        free(bh->target_len);
    }
    free(bh->text);
    if (bh->hrecs)
        sam_hrecs_free(bh->hrecs);
    if (bh->sdict)
        kh_destroy(s2i, (khash_t(s2i) *) bh->sdict);
    free(bh);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x2211a
movq %rdi, %rbx
movl 0x40(%rdi), %eax
testl %eax, %eax
je 0x22122
decl %eax
movl %eax, 0x40(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq 0x20(%rbx), %rdi
testq %rdi, %rdi
je 0x2215d
cmpl $0x0, (%rbx)
jle 0x2214f
xorl %r14d, %r14d
movq 0x20(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x45c0
incq %r14
movslq (%rbx), %rax
cmpq %rax, %r14
jl 0x22133
movq 0x20(%rbx), %rdi
callq 0x45c0
movq 0x10(%rbx), %rdi
callq 0x45c0
movq 0x28(%rbx), %rdi
callq 0x45c0
movq 0x38(%rbx), %rdi
testq %rdi, %rdi
je 0x22174
callq 0x84763
movq 0x30(%rbx), %rdi
testq %rdi, %rdi
je 0x22182
callq 0x10dcf
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x45c0
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/sam.c
// Function: sam_hdr_dup_sdict
int sam_hdr_dup_sdict(const sam_hdr_t *h0, sam_hdr_t *h)
{
    const khash_t(s2i) *src_long_refs = (khash_t(s2i) *) h0->sdict;
    khash_t(s2i) *dest_long_refs = kh_init(s2i);
    int i;
    if (!dest_long_refs) return -1;

    for (i = 0; i < h->n_targets; i++) {
        int ret;
        khiter_t ksrc, kdest;
        if (h->target_len[i] < UINT32_MAX) continue;
        ksrc = kh_get(s2i, src_long_refs, h->target_name[i]);
        if (ksrc == kh_end(src_long_refs)) continue;
        kdest = kh_put(s2i, dest_long_refs, h->target_name[i], &ret);
        if (ret < 0) {
            kh_destroy(s2i, dest_long_refs);
            return -1;
        }
        kh_val(dest_long_refs, kdest) = kh_val(src_long_refs, ksrc);
    }

    h->sdict = dest_long_refs;
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq 0x30(%rdi), %r15
callq 0x10dc0
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testq %rax, %rax
je 0x22222
movq %rax, %r12
cmpl $0x0, (%r14)
jle 0x2221c
xorl %r13d, %r13d
movq 0x10(%r14), %rax
cmpl $-0x1, (%rax,%r13,4)
jne 0x22211
movq 0x20(%r14), %rax
movq (%rax,%r13,8), %rsi
movq %r15, %rdi
callq 0x10e38
cmpl (%r15), %eax
je 0x22211
movl %eax, %ebp
movq 0x20(%r14), %rax
movq (%rax,%r13,8), %rsi
movq %r12, %rdi
leaq 0x4(%rsp), %rdx
callq 0x111c4
cmpl $0x0, 0x4(%rsp)
js 0x22233
movq 0x20(%r15), %rcx
movl %ebp, %edx
movq (%rcx,%rdx,8), %rcx
movq 0x20(%r12), %rdx
movl %eax, %eax
movq %rcx, (%rdx,%rax,8)
incq %r13
movslq (%r14), %rax
cmpq %rax, %r13
jl 0x221be
movq %r12, 0x30(%r14)
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r12, %rdi
callq 0x10dcf
jmp 0x22222
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/sam.c
// Function: sam_realloc_bam_data
int sam_realloc_bam_data(bam1_t *b, size_t desired)
{
    uint32_t new_m_data;
    uint8_t *new_data;
    new_m_data = desired;
    kroundup32(new_m_data); // next power of 2
    new_m_data += 32; // reduces malloc arena migrations?
    if (new_m_data < desired) {
        errno = ENOMEM; // Not strictly true but we can't store the size
        return -1;
    }
#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
    if (new_m_data > FUZZ_ALLOC_LIMIT) {
        errno = ENOMEM;
        return -1;
    }
#endif
    if ((bam_get_mempolicy(b) & BAM_USER_OWNS_DATA) == 0) {
        new_data = realloc(b->data, new_m_data);
    } else {
        if ((new_data = malloc(new_m_data)) != NULL) {
            if (b->l_data > 0)
                memcpy(new_data, b->data,
                       b->l_data < b->m_data ? b->l_data : b->m_data);
            bam_set_mempolicy(b, bam_get_mempolicy(b) & (~BAM_USER_OWNS_DATA));
        }
    }
    if (!new_data) return -1;
    b->data = new_data;
    b->m_data = new_m_data;
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
testl %esi, %esi
je 0x22aa6
leal -0x1(%rsi), %eax
movl %eax, %ecx
shrl %ecx
orl %eax, %ecx
movl %ecx, %eax
shrl $0x2, %eax
orl %ecx, %eax
movl %eax, %ecx
shrl $0x4, %ecx
orl %eax, %ecx
movl %ecx, %eax
shrl $0x8, %eax
orl %ecx, %eax
movl %eax, %ecx
shrl $0x10, %ecx
orl %eax, %ecx
movl %esi, %eax
negl %eax
shrl $0x1f, %eax
leal (%rcx,%rax), %ebp
addl $0x20, %ebp
jmp 0x22aab
movl $0x20, %ebp
movl %ebp, %eax
cmpq %rsi, %rax
jae 0x22ac4
callq 0x4050
movl $0xc, (%rax)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x22b20
movl 0x48(%rbx), %r15d
testb $0x2, %r15b
jne 0x22ae4
movq 0x38(%rbx), %rdi
movq %rax, %rsi
callq 0x4840
movq %rax, %r14
testq %rax, %rax
jne 0x22b17
jmp 0x22abd
movq %rax, %rdi
callq 0x4680
testq %rax, %rax
je 0x22abd
movq %rax, %r14
movl 0x40(%rbx), %eax
testl %eax, %eax
jle 0x22b0f
movq 0x38(%rbx), %rsi
movl 0x44(%rbx), %edx
cmpl %edx, %eax
cmovbl %eax, %edx
movq %r14, %rdi
callq 0x43c0
andl $-0x3, %r15d
movl %r15d, 0x48(%rbx)
movq %r14, 0x38(%rbx)
movl %ebp, 0x44(%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/sam.c
// Function: bam_destroy1
void bam_destroy1(bam1_t *b)
{
    if (b == 0) return;
    if ((bam_get_mempolicy(b) & BAM_USER_OWNS_DATA) == 0) {
        free(b->data);
        if ((bam_get_mempolicy(b) & BAM_USER_OWNS_STRUCT) != 0) {
            // In case of reuse
            b->data = NULL;
            b->m_data = 0;
            b->l_data = 0;
        }
    }

    if ((bam_get_mempolicy(b) & BAM_USER_OWNS_STRUCT) == 0)
        free(b);
}

// Assembly:
pushq %rbx
testq %rdi, %rdi
je 0x22b62
movq %rdi, %rbx
movl 0x48(%rdi), %eax
testb $0x2, %al
jne 0x22b55
movq 0x38(%rbx), %rdi
callq 0x45c0
movl 0x48(%rbx), %eax
testb $0x1, %al
je 0x22b55
leaq 0x38(%rbx), %rcx
xorps %xmm0, %xmm0
movups %xmm0, (%rcx)
testb $0x1, %al
jne 0x22b62
movq %rbx, %rdi
popq %rbx
jmp 0x45c0
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/sam.c
// Function: bam_copy1
bam1_t *bam_copy1(bam1_t *bdst, const bam1_t *bsrc)
{
    if (realloc_bam_data(bdst, bsrc->l_data) < 0) return NULL;
    memcpy(bdst->data, bsrc->data, bsrc->l_data); // copy var-len data
    memcpy(&bdst->core, &bsrc->core, sizeof(bsrc->core)); // copy the rest
    bdst->l_data = bsrc->l_data;
    bdst->id = bsrc->id;
    return bdst;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movslq 0x40(%rsi), %rdx
movl 0x44(%rdi), %eax
cmpq %rdx, %rax
jae 0x22b8d
movq %rbx, %rdi
movq %rdx, %rsi
callq 0x22a64
testl %eax, %eax
js 0x22bcd
movslq 0x40(%r14), %rdx
movq 0x38(%rbx), %rdi
movq 0x38(%r14), %rsi
callq 0x43c0
movups (%r14), %xmm0
movups 0x10(%r14), %xmm1
movups 0x20(%r14), %xmm2
movups %xmm0, (%rbx)
movups %xmm1, 0x10(%rbx)
movups %xmm2, 0x20(%rbx)
movl 0x40(%r14), %eax
movl %eax, 0x40(%rbx)
movq 0x30(%r14), %rax
movq %rax, 0x30(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
xorl %ebx, %ebx
jmp 0x22bc2
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/sam.c
// Function: bam_dup1
bam1_t *bam_dup1(const bam1_t *bsrc)
{
    if (bsrc == NULL) return NULL;
    bam1_t *bdst = bam_init1();
    if (bdst == NULL) return NULL;
    if (bam_copy1(bdst, bsrc) == NULL) {
        bam_destroy1(bdst);
        return NULL;
    }
    return bdst;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x22c0c
movq %rdi, %r14
movl $0x1, %edi
movl $0x50, %esi
callq 0x4300
testq %rax, %rax
je 0x22c0c
movq %rax, %rbx
movq %rax, %rdi
movq %r14, %rsi
callq 0x22b64
testq %rax, %rax
jne 0x22c0e
movq %rbx, %rdi
callq 0x22b2b
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/sam.c
// Function: bam_cigar2qlen
hts_pos_t bam_cigar2qlen(int n_cigar, const uint32_t *cigar)
{
    int k;
    hts_pos_t l;
    for (k = l = 0; k < n_cigar; ++k)
        if (bam_cigar_type(bam_cigar_op(cigar[k]))&1)
            l += bam_cigar_oplen(cigar[k]);
    return l;
}

// Assembly:
xorl %eax, %eax
testl %edi, %edi
jle 0x230ca
movl %edi, %ecx
movl $0x3c1a7, %edx          # imm = 0x3C1A7
xorl %edi, %edi
movl (%rsi,%rdi,4), %r8d
leal (%r8,%r8), %r9d
btl %r9d, %edx
movl $0x0, %r9d
sbbl %r9d, %r9d
shrl $0x4, %r8d
andl %r9d, %r8d
addq %r8, %rax
incq %rdi
cmpq %rdi, %rcx
jne 0x230a3
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/sam.c
// Function: bam_cigar2rlen
hts_pos_t bam_cigar2rlen(int n_cigar, const uint32_t *cigar)
{
    int k;
    hts_pos_t l;
    for (k = l = 0; k < n_cigar; ++k)
        if (bam_cigar_type(bam_cigar_op(cigar[k]))&2)
            l += bam_cigar_oplen(cigar[k]);
    return l;
}

// Assembly:
testl %edi, %edi
jle 0x23101
movl %edi, %edx
xorl %edi, %edi
xorl %eax, %eax
movl (%rsi,%rdi,4), %r8d
leal (%r8,%r8), %ecx
movl $0x3c1a7, %r9d          # imm = 0x3C1A7
shrl %cl, %r9d
shll $0x1e, %r9d
sarl $0x1f, %r9d
shrl $0x4, %r8d
andl %r9d, %r8d
addq %r8, %rax
incq %rdi
cmpq %rdi, %rdx
jne 0x230d5
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/./htslib/bgzf.h
// Function: bgzf_read_small
static inline ssize_t bgzf_read_small(BGZF *fp, void *data, size_t length) {
    // A block length of 0 implies current block isn't loaded (see
    // bgzf_seek_common).  That gives negative available so careful on types
    if ((ssize_t)length < fp->block_length - fp->block_offset) {
        // Short cut the common and easy mode
        memcpy((uint8_t *)data,
               (uint8_t *)fp->uncompressed_block + fp->block_offset,
               length);
        fp->block_offset += length;
        fp->uncompressed_address += length;
        return length;
    } else {
        return bgzf_read(fp, data, length);
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rdi, %r14
movslq 0x8(%rdi), %rcx
movslq 0x10(%rdi), %rax
subq %rax, %rcx
cmpq %rdx, %rcx
jle 0x2354a
addq 0x28(%r14), %rax
movq %rsi, %rdi
movq %rax, %rsi
movq %rbx, %rdx
callq 0x43c0
addl %ebx, 0x10(%r14)
addq %rbx, 0x20(%r14)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %r14, %rdi
movq %rbx, %rdx
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xbefc
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/sam.c
// Function: fixup_missing_qname_nul
static int fixup_missing_qname_nul(bam1_t *b) {
    bam1_core_t *c = &b->core;

    // Note this is called before c->l_extranul is added to c->l_qname
    if (c->l_extranul > 0) {
        b->data[c->l_qname++] = '\0';
        c->l_extranul--;
    } else {
        if (b->l_data > INT_MAX - 4) return -1;
        if (realloc_bam_data(b, b->l_data + 4) < 0) return -1;
        b->l_data += 4;
        b->data[c->l_qname++] = '\0';
        c->l_extranul = 3;
    }
    return 0;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpb $0x0, 0xf(%rdi)
je 0x2358e
movq 0x38(%rbx), %rax
movzwl 0x12(%rbx), %ecx
leal 0x1(%rcx), %edx
movw %dx, 0x12(%rbx)
movb $0x0, (%rax,%rcx)
movb 0xf(%rbx), %al
decb %al
movb %al, 0xf(%rbx)
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movslq 0x40(%rbx), %rsi
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpq $0x7ffffffb, %rsi       # imm = 0x7FFFFFFB
jg 0x23585
addq $0x4, %rsi
movl 0x44(%rbx), %eax
cmpq %rsi, %rax
jae 0x235be
movq %rbx, %rdi
callq 0x22a64
testl %eax, %eax
js 0x23585
movl 0x40(%rbx), %esi
addl $0x4, %esi
movl %esi, 0x40(%rbx)
movq 0x38(%rbx), %rax
movzwl 0x12(%rbx), %ecx
leal 0x1(%rcx), %edx
movw %dx, 0x12(%rbx)
movb $0x0, (%rax,%rcx)
movb $0x3, %al
jmp 0x23580
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/./htslib/bgzf.h
// Function: bgzf_write_small
static inline
ssize_t bgzf_write_small(BGZF *fp, const void *data, size_t length) {
    if (fp->is_compressed
        && (size_t) (BGZF_BLOCK_SIZE - fp->block_offset) > length) {
        // Short cut the common and easy mode
        memcpy((uint8_t *)fp->uncompressed_block + fp->block_offset,
               data, length);
        fp->block_offset += length;
        return length;
    } else {
        return bgzf_write(fp, data, length);
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rdi, %r14
testb $0x40, 0x3(%rdi)
je 0x23c88
movslq 0x10(%r14), %rdi
movl $0xff00, %eax           # imm = 0xFF00
subq %rdi, %rax
cmpq %rbx, %rax
jbe 0x23c88
addq 0x28(%r14), %rdi
movq %rbx, %rdx
callq 0x43c0
addl %ebx, 0x10(%r14)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %r14, %rdi
movq %rbx, %rdx
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xd005
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/sam.c
// Function: bam_set_qname
int bam_set_qname(bam1_t *rec, const char *qname)
{
    if (!rec) return -1;
    if (!qname || !*qname) return -1;

    size_t old_len = rec->core.l_qname;
    size_t new_len = strlen(qname) + 1;
    if (new_len < 1 || new_len > 255) return -1;

    int extranul = (new_len%4 != 0) ? (4 - new_len%4) : 0;

    size_t new_data_len = rec->l_data - old_len + new_len + extranul;
    if (realloc_bam_data(rec, new_data_len) < 0) return -1;

    // Make room
    if (new_len + extranul != rec->core.l_qname)
        memmove(rec->data + new_len + extranul, rec->data + rec->core.l_qname, rec->l_data - rec->core.l_qname);
    // Copy in new name and pad if needed
    memcpy(rec->data, qname, new_len);
    int n;
    for (n = 0; n < extranul; n++) rec->data[new_len + n] = '\0';

    rec->l_data = new_data_len;
    rec->core.l_qname = new_len + extranul;
    rec->core.l_extranul = extranul;

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jne 0x23dc7
movq %rsi, %r15
cmpb $0x0, (%rsi)
je 0x23dc7
movq %rdi, %rbx
movq %r15, %rdi
callq 0x41d0
cmpq $0xfe, %rax
ja 0x23dc7
movq %rax, %r14
leaq 0x1(%rax), %r8
movzwl 0x12(%rbx), %eax
movl %r8d, %r13d
andl $0x3, %r13d
movl $0x4, %ecx
subl %r13d, %ecx
xorl %edx, %edx
testq %r13, %r13
movl %ecx, 0xc(%rsp)
cmovnel %ecx, %edx
movzwl %ax, %esi
movslq 0x40(%rbx), %rcx
movq %rdx, 0x18(%rsp)
addq %r8, %rdx
movq %rdx, %r12
subq %rsi, %r12
addq %rcx, %r12
movl 0x44(%rbx), %ecx
cmpq %rcx, %r12
movq %rdx, 0x10(%rsp)
jbe 0x23d58
movq %r8, 0x20(%rsp)
movq %rbx, %rdi
movq %r12, %rsi
callq 0x22a64
testl %eax, %eax
js 0x23dc7
movzwl 0x12(%rbx), %eax
movzwl %ax, %esi
movq 0x10(%rsp), %rdx
movq 0x20(%rsp), %r8
cmpq %rsi, %rdx
movq 0x18(%rsp), %rbp
je 0x23d8a
movq 0x38(%rbx), %rcx
leaq (%rcx,%r8), %rdi
addq %rbp, %rdi
addq %rcx, %rsi
movslq 0x40(%rbx), %rdx
movzwl %ax, %eax
subq %rax, %rdx
movq %r8, %rbp
callq 0x4830
movq %rbp, %r8
movq 0x18(%rsp), %rbp
movq 0x38(%rbx), %rdi
movq %r15, %rsi
movq %r8, %rdx
callq 0x43c0
testq %r13, %r13
je 0x23db4
movl 0xc(%rsp), %eax
movq 0x38(%rbx), %rcx
movb $0x0, 0x1(%rcx,%r14)
incq %r14
decq %rax
jne 0x23da2
movl %r12d, 0x40(%rbx)
movq 0x10(%rsp), %rax
movw %ax, 0x12(%rbx)
movb %bpl, 0xf(%rbx)
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/sam.c
// Function: sam_idx_init
int sam_idx_init(htsFile *fp, sam_hdr_t *h, int min_shift, const char *fnidx) {
    fp->fnidx = fnidx;
    if (fp->format.format == bam || fp->format.format == bcf ||
        (fp->format.format == sam && fp->format.compression == bgzf)) {
        int n_lvls, fmt = HTS_FMT_CSI;
        if (min_shift > 0) {
            int64_t max_len = 0, s;
            int i;
            for (i = 0; i < h->n_targets; ++i)
                if (max_len < h->target_len[i]) max_len = h->target_len[i];
            max_len += 256;
            for (n_lvls = 0, s = 1<<min_shift; max_len > s; ++n_lvls, s <<= 3);

        } else min_shift = 14, n_lvls = 5, fmt = HTS_FMT_BAI;

        fp->idx = hts_idx_init(h->n_targets, fmt, bgzf_tell(fp->fp.bgzf), min_shift, n_lvls);
        return fp->idx ? 0 : -1;
    }

    if (fp->format.format == cram) {
        fp->fp.cram->idxfp = bgzf_open(fnidx, "wg");
        return fp->fp.cram->idxfp ? 0 : -1;
    }

    return -1;
}

// Assembly:
movl %edx, %r9d
movq %rcx, 0x70(%rdi)
movl 0x4c(%rdi), %edx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addl $-0x3, %edx
cmpl $0x6, %edx
ja 0x241e0
pushq %rbx
movq %rdi, %rbx
leaq 0x73046(%rip), %rdi     # 0x97150
movslq (%rdi,%rdx,4), %rdx
addq %rdi, %rdx
jmpq *%rdx
cmpl $0x2, 0x54(%rbx)
jne 0x241df
movl (%rsi), %edi
testl %r9d, %r9d
jle 0x24177
testl %edi, %edi
jle 0x2418a
movq 0x10(%rsi), %rcx
xorl %edx, %edx
xorl %eax, %eax
movq %rax, %rsi
movl (%rcx,%rdx,4), %eax
cmpq %rax, %rsi
cmovgq %rsi, %rax
incq %rdx
cmpq %rdx, %rdi
jne 0x24130
addq $0x100, %rax            # imm = 0x100
jmp 0x2418f
leaq 0x6f3df(%rip), %rsi     # 0x93533
movq %rcx, %rdi
callq 0xa550
movq 0x38(%rbx), %rcx
movq %rax, 0x8988(%rcx)
movq 0x38(%rbx), %rcx
xorl %eax, %eax
cmpq $0x1, 0x8988(%rcx)
jmp 0x241dd
movl $0x1, %esi
movl $0x5, %r8d
movl $0xe, %r9d
jmp 0x241b5
movl $0x100, %eax            # imm = 0x100
movl $0x1, %edx
movl %r9d, %ecx
shll %cl, %edx
movslq %edx, %rcx
xorl %r8d, %r8d
xorl %esi, %esi
cmpq %rcx, %rax
jle 0x241b5
xorl %r8d, %r8d
incl %r8d
shlq $0x3, %rcx
cmpq %rcx, %rax
jg 0x241a9
movq 0x38(%rbx), %rax
movq 0x18(%rax), %rcx
shlq $0x10, %rcx
movzwl 0x10(%rax), %edx
orq %rcx, %rdx
movl %r9d, %ecx
callq 0x15fba
movq %rax, %rcx
movq %rax, 0x68(%rbx)
xorl %eax, %eax
cmpq $0x1, %rcx
sbbl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/sam.c
// Function: sam_idx_save
int sam_idx_save(htsFile *fp) {
    if (fp->format.format == bam || fp->format.format == bcf ||
        fp->format.format == vcf || fp->format.format == sam) {
        int ret;
        if ((ret = sam_state_destroy(fp)) < 0) {
            errno = -ret;
            return -1;
        }
        if (!fp->is_bgzf || bgzf_flush(fp->fp.bgzf) < 0)
            return -1;
        hts_idx_amend_last(fp->idx, bgzf_tell(fp->fp.bgzf));

        if (hts_idx_finish(fp->idx, bgzf_tell(fp->fp.bgzf)) < 0)
            return -1;

        return hts_idx_save_but_not_close(fp->idx, fp->fnidx, hts_idx_fmt(fp->idx));

    } else if (fp->format.format == cram) {
        // flushed and closed by cram_close
    }

    return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl 0x4c(%rdi), %eax
xorl %ebp, %ebp
cmpl $0x9, %eax
ja 0x24291
movl $0x318, %ecx            # imm = 0x318
btl %eax, %ecx
jae 0x24291
movq %rdi, %rbx
callq 0x24298
testl %eax, %eax
js 0x24281
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testb $0x10, (%rbx)
je 0x24291
movq 0x38(%rbx), %rdi
callq 0xcb85
testl %eax, %eax
js 0x24291
movq 0x38(%rbx), %rax
movq 0x68(%rbx), %rdi
movq 0x18(%rax), %rcx
shlq $0x10, %rcx
movzwl 0x10(%rax), %esi
orq %rcx, %rsi
callq 0x16eb2
movq 0x38(%rbx), %rax
movq 0x68(%rbx), %rdi
movq 0x18(%rax), %rcx
shlq $0x10, %rcx
movzwl 0x10(%rax), %esi
orq %rcx, %rsi
callq 0x160ae
testl %eax, %eax
js 0x24291
movq 0x68(%rbx), %r14
movq 0x70(%rbx), %rbx
movq %r14, %rdi
callq 0x16eb7
movq %r14, %rdi
movq %rbx, %rsi
movl %eax, %edx
popq %rbx
popq %r14
popq %rbp
jmp 0x1747c
movl %eax, %ebp
negl %ebp
callq 0x4050
movl %ebp, (%rax)
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/sam.c
// Function: sam_passes_filter
int sam_passes_filter(const sam_hdr_t *h, const bam1_t *b, hts_filter_t *filt)
{
    hb_pair hb = {h, b};
    hts_expr_val_t res = HTS_EXPR_VAL_INIT;
    if (hts_filter_eval2(filt, &hb, bam_sym_lookup, &res)) {
        hts_log_error("Couldn't process filter expression");
        hts_expr_val_free(&res);
        return -1;
    }

    int t = res.is_true;
    hts_expr_val_free(&res);

    return t;
}

// Assembly:
pushq %rbx
subq $0x40, %rsp
movq %rdx, %r8
leaq 0x30(%rsp), %rax
movq %rdi, (%rax)
movq %rsi, 0x8(%rax)
xorps %xmm0, %xmm0
movq %rsp, %rcx
movaps %xmm0, 0x10(%rcx)
movaps %xmm0, (%rcx)
movq $0x0, 0x20(%rcx)
leaq 0x47(%rip), %rdx        # 0x24610
movq %r8, %rdi
movq %rax, %rsi
callq 0x1cca9
testl %eax, %eax
je 0x245f9
leaq 0x73350(%rip), %rsi     # 0x9792f
leaq 0x7335b(%rip), %rdx     # 0x97941
movl $0x1, %edi
xorl %eax, %eax
callq 0x13de5
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jmp 0x245fe
movsbl 0x1(%rsp), %ebx
movq 0x18(%rsp), %rdi
callq 0x45c0
movl %ebx, %eax
addq $0x40, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/sam.c
// Function: index_load
static hts_idx_t *index_load(htsFile *fp, const char *fn, const char *fnidx, int flags)
{
    switch (fp->format.format) {
    case bam:
    case sam:
        return hts_idx_load3(fn, fnidx, HTS_FMT_BAI, flags);

    case cram: {
        if (cram_index_load(fp->fp.cram, fn, fnidx) < 0) return NULL;

        // Cons up a fake "index" just pointing at the associated cram_fd:
        hts_cram_idx_t *idx = malloc(sizeof (hts_cram_idx_t));
        if (idx == NULL) return NULL;
        idx->fmt = HTS_FMT_CRAI;
        idx->cram = fp->fp.cram;
        return (hts_idx_t *) idx;
        }

    default:
        return NULL; // TODO Would use tbx_index_load if it returned hts_idx_t
    }
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl 0x4c(%rdi), %eax
leal -0x3(%rax), %edi
cmpl $0x2, %edi
jae 0x2527a
movq %rsi, %rdi
movq %rdx, %rsi
movl $0x1, %edx
popq %rbx
jmp 0x1b449
cmpl $0x6, %eax
jne 0x252ab
movq 0x38(%rbx), %rdi
callq 0x493f4
testl %eax, %eax
js 0x252ab
movl $0x10, %edi
callq 0x4680
testq %rax, %rax
je 0x252ab
movl $0x3, (%rax)
movq 0x38(%rbx), %rcx
movq %rcx, 0x8(%rax)
jmp 0x252ad
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/sam.c
// Function: sam_itr_queryi
hts_itr_t *sam_itr_queryi(const hts_idx_t *idx, int tid, hts_pos_t beg, hts_pos_t end)
{
    const hts_cram_idx_t *cidx = (const hts_cram_idx_t *) idx;
    if (idx == NULL)
        return hts_itr_query(NULL, tid, beg, end, sam_readrec_rest);
    else if (cidx->fmt == HTS_FMT_CRAI)
        return cram_itr_query(idx, tid, beg, end, sam_readrec);
    else
        return hts_itr_query(idx, tid, beg, end, sam_readrec);
}

// Assembly:
testq %rdi, %rdi
je 0x252d2
cmpl $0x3, (%rdi)
jne 0x252e0
leaq 0x10c(%rip), %r8        # 0x253dc
jmp 0x25300
leaq 0x13(%rip), %r8         # 0x252ec
xorl %edi, %edi
jmp 0x17971
leaq 0xf5(%rip), %r8         # 0x253dc
jmp 0x17971
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/sam.c
// Function: cram_itr_query
static hts_itr_t *cram_itr_query(const hts_idx_t *idx, int tid, hts_pos_t beg, hts_pos_t end, hts_readrec_func *readrec)
{
    const hts_cram_idx_t *cidx = (const hts_cram_idx_t *) idx;
    hts_itr_t *iter = (hts_itr_t *) calloc(1, sizeof(hts_itr_t));
    if (iter == NULL) return NULL;

    // Cons up a dummy iterator for which hts_itr_next() will simply invoke
    // the readrec function:
    iter->is_cram = 1;
    iter->read_rest = 1;
    iter->off = NULL;
    iter->bins.a = NULL;
    iter->readrec = readrec;

    if (tid >= 0 || tid == HTS_IDX_NOCOOR || tid == HTS_IDX_START) {
        cram_range r = { tid, beg+1, end };
        int ret = cram_set_option(cidx->cram, CRAM_OPT_RANGE, &r);

        iter->curr_off = 0;
        // The following fields are not required by hts_itr_next(), but are
        // filled in in case user code wants to look at them.
        iter->tid = tid;
        iter->beg = beg;
        iter->end = end;

        switch (ret) {
        case 0:
            break;

        case -2:
            // No data vs this ref, so mark iterator as completed.
            // Same as HTS_IDX_NONE.
            iter->finished = 1;
            break;

        default:
            free(iter);
            return NULL;
        }
    }
    else switch (tid) {
    case HTS_IDX_REST:
        iter->curr_off = 0;
        break;
    case HTS_IDX_NONE:
        iter->curr_off = 0;
        iter->finished = 1;
        break;
    default:
        hts_log_error("Query with tid=%d not implemented for CRAM files", tid);
        abort();
        break;
    }

    return iter;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, %rbp
movq %rcx, %r15
movq %rdx, %r12
movl %esi, %r14d
movq %rdi, %r13
movl $0x1, %edi
movl $0x90, %esi
callq 0x4300
testq %rax, %rax
je 0x25392
movq %rax, %rbx
movl $0x5, (%rax)
movq %rbp, 0x68(%rax)
testl %r14d, %r14d
sets %al
leal 0x3(%r14), %ecx
cmpl $0x2, %ecx
setae %cl
testb %cl, %al
jne 0x25396
movq %rsp, %rdx
movl %r14d, (%rdx)
leaq 0x1(%r12), %rax
movq %rax, 0x8(%rdx)
movq %r15, 0x10(%rdx)
movq 0x8(%r13), %rdi
movl $0x5, %esi
xorl %eax, %eax
callq 0x5348c
movl %r14d, 0x4(%rbx)
movq %r12, 0x18(%rbx)
movq %r15, 0x20(%rbx)
testl %eax, %eax
je 0x253a8
cmpl $-0x2, %eax
je 0x253a2
movq %rbx, %rdi
callq 0x45c0
xorl %ebx, %ebx
jmp 0x253a8
cmpl $-0x4, %r14d
je 0x253a8
cmpl $-0x5, %r14d
jne 0x253ba
movl $0x7, (%rbx)
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x72d40(%rip), %rsi     # 0x98101
leaq 0x7127a(%rip), %rdx     # 0x96642
movl $0x1, %edi
movl %r14d, %ecx
xorl %eax, %eax
callq 0x13de5
callq 0x4270
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/sam.c
// Function: sam_readrec
static int sam_readrec(BGZF *ignored, void *fpv, void *bv, int *tid, hts_pos_t *beg, hts_pos_t *end)
{
    htsFile *fp = (htsFile *)fpv;
    bam1_t *b = bv;
    fp->line.l = 0;
    int ret = sam_read1(fp, fp->bam_header, b);
    if (ret >= 0) {
        *tid = b->core.tid;
        *beg = b->core.pos;
        *end = bam_endpos(b);
    }
    return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %r9, %rbx
movq %r8, %r15
movq %rcx, %r12
movq %rdx, %r14
movq %rsi, %rdi
movq $0x0, 0x10(%rsi)
movq 0x78(%rsi), %rsi
callq 0x297ef
movl %eax, %ebp
testl %eax, %eax
js 0x25423
movl 0x8(%r14), %eax
movl %eax, (%r12)
movq (%r14), %rax
movq %rax, (%r15)
movq %r14, %rdi
callq 0x23104
movq %rax, (%rbx)
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/sam.c
// Function: sam_itr_regarray
hts_itr_t *sam_itr_regarray(const hts_idx_t *idx, sam_hdr_t *hdr, char **regarray, unsigned int regcount)
{
    const hts_cram_idx_t *cidx = (const hts_cram_idx_t *) idx;
    hts_reglist_t *r_list = NULL;
    int r_count = 0;

    if (!cidx || !hdr)
        return NULL;

    hts_itr_t *itr = NULL;
    if (cidx->fmt == HTS_FMT_CRAI) {
        r_list = hts_reglist_create(regarray, regcount, &r_count, cidx->cram, cram_name2id);
        if (!r_list)
            return NULL;
        itr = hts_itr_regions(idx, r_list, r_count, cram_name2id, cidx->cram,
                   hts_itr_multi_cram, cram_readrec, cram_pseek, cram_ptell);
    } else {
        r_list = hts_reglist_create(regarray, regcount, &r_count, hdr, (hts_name2id_f)(bam_name2id));
        if (!r_list)
            return NULL;
        itr = hts_itr_regions(idx, r_list, r_count, (hts_name2id_f)(bam_name2id), hdr,
                   hts_itr_multi_bam, sam_readrec, bam_pseek, bam_ptell);
    }

    if (!itr)
        hts_reglist_free(r_list, r_count);

    return itr;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r15
movl $0x0, 0xc(%rsp)
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %sil
orb %al, %sil
jne 0x2556b
movq %rdi, %r14
cmpl $0x3, (%rdi)
jne 0x254f4
movq 0x8(%r14), %rax
leaq 0xdb(%rip), %r8         # 0x25577
leaq 0xc(%rsp), %r9
movq %rdx, %rdi
movl %ecx, %esi
movq %r9, %rdx
movq %rax, %rcx
callq 0x216d8
testq %rax, %rax
je 0x2556b
movq %rax, %rbx
movl 0xc(%rsp), %edx
movq 0x8(%r14), %r8
subq $0x8, %rsp
leaq 0x1f6(%rip), %rax       # 0x256c6
leaq 0x171(%rip), %r10       # 0x25648
leaq 0xa2(%rip), %r11        # 0x25580
leaq 0x92(%rip), %rcx        # 0x25577
leaq -0xbf14(%rip), %r9      # 0x195d8
movq %r14, %rdi
movq %rbx, %rsi
jmp 0x2554c
leaq -0x2aab(%rip), %r8      # 0x22a50
leaq 0xc(%rsp), %rax
movq %rdx, %rdi
movl %ecx, %esi
movq %rax, %rdx
movq %r15, %rcx
callq 0x216d8
testq %rax, %rax
je 0x2556b
movq %rax, %rbx
movl 0xc(%rsp), %edx
subq $0x8, %rsp
leaq 0x1f7(%rip), %rax       # 0x2571e
leaq 0x1eb(%rip), %r10       # 0x25719
leaq -0x159(%rip), %r11      # 0x253dc
leaq -0x2aec(%rip), %rcx     # 0x22a50
leaq -0xcaa2(%rip), %r9      # 0x18aa1
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %r8
pushq %rax
pushq %r10
pushq %r11
callq 0x1a489
addq $0x20, %rsp
testq %rax, %rax
jne 0x2556d
movl 0xc(%rsp), %esi
movq %rbx, %rdi
callq 0x21d90
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/sam.c
// Function: cram_readrec
static int cram_readrec(BGZF *ignored, void *fpv, void *bv, int *tid, hts_pos_t *beg, hts_pos_t *end)
{
    htsFile *fp = fpv;
    bam1_t *b = bv;
    int pass_filter, ret;

    do {
        ret = cram_get_bam_seq(fp->fp.cram, &b);
        if (ret < 0)
            return cram_eof(fp->fp.cram) ? -1 : -2;

        if (bam_tag2cigar(b, 1, 1) < 0)
            return -2;

        *tid = b->core.tid;
        *beg = b->core.pos;
        *end = bam_endpos(b);

        if (fp->filter) {
            pass_filter = sam_passes_filter(fp->bam_header, b, fp->filter);
            if (pass_filter < 0)
                return -2;
        } else {
            pass_filter = 1;
        }
    } while (pass_filter == 0);

    return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, 0x10(%rsp)
movq %r8, %r14
movq %rcx, %r15
movq %rsi, %r12
leaq 0x8(%rsp), %rax
movq %rdx, (%rax)
movq 0x38(%r12), %rdi
leaq 0x8(%rsp), %rsi
callq 0x3e19e
testl %eax, %eax
js 0x2561d
movl %eax, %r13d
movq 0x8(%rsp), %rdi
movl $0x1, %esi
movl $0x1, %edx
callq 0x235d8
movl $0xfffffffe, %ebp       # imm = 0xFFFFFFFE
testl %eax, %eax
js 0x25637
movq 0x8(%rsp), %rbx
movl 0x8(%rbx), %eax
movl %eax, (%r15)
movq (%rbx), %rax
movq %rax, (%r14)
movq %rbx, %rdi
callq 0x23104
movq 0x10(%rsp), %rcx
movq %rax, (%rcx)
movq 0x80(%r12), %rdx
testq %rdx, %rdx
je 0x25634
movq 0x78(%r12), %rdi
movq %rbx, %rsi
callq 0x24599
testl %eax, %eax
js 0x25637
movl %r13d, %ebp
je 0x255a4
jmp 0x25637
movq 0x38(%r12), %rdi
callq 0x53485
cmpl $0x1, %eax
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
sbbl $0x0, %ebp
jmp 0x25637
movl %r13d, %ebp
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/sam.c
// Function: cram_pseek
static int cram_pseek(void *fp, int64_t offset, int whence)
{
    cram_fd *fd =  (cram_fd *)fp;

    if ((0 != cram_seek(fd, offset, SEEK_SET))
     && (0 != cram_seek(fd, offset - fd->first_container, SEEK_CUR)))
        return -1;

    fd->curr_position = offset;

    if (fd->ctr) {
        cram_free_container(fd->ctr);
        if (fd->ctr_mt && fd->ctr_mt != fd->ctr)
            cram_free_container(fd->ctr_mt);

        fd->ctr = NULL;
        fd->ctr_mt = NULL;
        fd->ooc = 0;
    }

    return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
xorl %edx, %edx
callq 0x53001
testl %eax, %eax
je 0x2567f
movq %r14, %rsi
subq 0x8880(%rbx), %rsi
movq %rbx, %rdi
movl $0x1, %edx
callq 0x53001
movl %eax, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testl %ecx, %ecx
jne 0x256be
movq %r14, 0x8888(%rbx)
movq 0x38(%rbx), %rdi
testq %rdi, %rdi
je 0x256bc
leaq 0x38(%rbx), %r14
callq 0x4fe2e
movq 0x40(%rbx), %rdi
testq %rdi, %rdi
je 0x256ab
cmpq (%r14), %rdi
je 0x256ab
callq 0x4fe2e
movl $0x0, 0x8978(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, (%r14)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/sam.c
// Function: cram_ptell
static int64_t cram_ptell(void *fp)
{
    cram_fd *fd = (cram_fd *)fp;
    cram_container *c;
    cram_slice *s;
    int64_t ret = -1L;

    if (fd) {
        if ((c = fd->ctr) != NULL) {
            if ((s = c->slice) != NULL && s->max_rec) {
                if ((c->curr_slice + s->curr_rec/s->max_rec) >= (c->max_slice + 1))
                    fd->curr_position += c->offset + c->length;
            }
        }
        ret = fd->curr_position;
    }

    return ret;
}

// Assembly:
testq %rdi, %rdi
je 0x25711
movq 0x38(%rdi), %rcx
testq %rcx, %rcx
je 0x25709
movq 0x90(%rcx), %rax
testq %rax, %rax
je 0x25709
movl 0xe0(%rax), %esi
testl %esi, %esi
je 0x25709
movl 0xe4(%rax), %eax
cltd
idivl %esi
addl 0x5c(%rcx), %eax
cmpl 0x58(%rcx), %eax
jle 0x25709
movslq (%rcx), %rax
addq 0x40(%rcx), %rax
addq %rax, 0x8888(%rdi)
movq 0x8888(%rdi), %rax
retq
movq $-0x1, %rax
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/sam.c
// Function: sam_itr_regions
hts_itr_t *sam_itr_regions(const hts_idx_t *idx, sam_hdr_t *hdr, hts_reglist_t *reglist, unsigned int regcount)
{
    const hts_cram_idx_t *cidx = (const hts_cram_idx_t *) idx;

    if(!cidx || !hdr || !reglist)
        return NULL;

    if (cidx->fmt == HTS_FMT_CRAI)
        return hts_itr_regions(idx, reglist, regcount, cram_name2id, cidx->cram,
                   hts_itr_multi_cram, cram_readrec, cram_pseek, cram_ptell);
    else
        return hts_itr_regions(idx, reglist, regcount, (hts_name2id_f)(bam_name2id), hdr,
                   hts_itr_multi_bam, sam_readrec, bam_pseek, bam_ptell);
}

// Assembly:
pushq %rbx
movq %rsi, %r8
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %sil
orb %al, %sil
testq %rdx, %rdx
sete %al
orb %sil, %al
jne 0x2578c
cmpl $0x3, (%rdi)
jne 0x25790
movq 0x8(%rdi), %r8
subq $0x8, %rsp
leaq -0xa8(%rip), %r10       # 0x256c6
leaq -0x12d(%rip), %r11      # 0x25648
leaq -0x1fc(%rip), %rbx      # 0x25580
leaq -0x20c(%rip), %rax      # 0x25577
leaq -0xc1b2(%rip), %r9      # 0x195d8
jmp 0x257b7
xorl %eax, %eax
jmp 0x257cd
subq $0x8, %rsp
leaq -0x7d(%rip), %r10       # 0x2571e
leaq -0x89(%rip), %r11       # 0x25719
leaq -0x3cd(%rip), %rbx      # 0x253dc
leaq -0x2d60(%rip), %rax     # 0x22a50
leaq -0xcd16(%rip), %r9      # 0x18aa1
movq %rdx, %rsi
movl %ecx, %edx
movq %rax, %rcx
pushq %r10
pushq %r11
pushq %rbx
callq 0x1a489
addq $0x20, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/sam.c
// Function: sam_hdr_parse
sam_hdr_t *sam_hdr_parse(size_t l_text, const char *text)
{
    sam_hdr_t *bh = sam_hdr_init();
    if (!bh) return NULL;

    if (sam_hdr_add_lines(bh, text, l_text) != 0) {
        sam_hdr_destroy(bh);
        return NULL;
    }

    return bh;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r15
movq %rdi, %r14
movl $0x1, %edi
movl $0x48, %esi
callq 0x4300
testq %rax, %rax
je 0x25816
movq %rax, %rbx
leaq 0x71c18(%rip), %rax     # 0x97410
movq %rax, 0x18(%rbx)
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x85354
testl %eax, %eax
je 0x25818
movq %rbx, %rdi
callq 0x22102
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/./htslib/kstring.h
// Function: kputsn
static inline int kputsn(const char *p, size_t l, kstring_t *s)
{
	size_t new_sz = s->l + l + 2;
	if (new_sz <= s->l) { errno = EOVERFLOW; return EOF; }
	if (ks_resize(s, new_sz) < 0) return EOF;
	memcpy(s->s + s->l, p, l);
	s->l += l;
	s->s[s->l] = 0;
	return l;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r15
movq (%rdx), %rdi
leaq (%rsi,%rdi), %rax
addq $0x2, %rax
cmpq %rdi, %rax
jbe 0x270cd
movq %rdx, %r14
movq %rsi, %rbx
cmpq %rax, 0x8(%rdx)
jae 0x270df
movq %rax, %rcx
shrq $0x3e, %rcx
movq %rax, %rdx
shrq %rdx
xorl %r12d, %r12d
testq %rcx, %rcx
cmoveq %rdx, %r12
addq %rax, %r12
movq 0x10(%r14), %rdi
movq %r12, %rsi
callq 0x4840
testq %rax, %rax
je 0x270d8
movq %rax, 0x10(%r14)
movq %r12, 0x8(%r14)
movq (%r14), %rdi
jmp 0x270e3
callq 0x4050
movl $0x4b, (%rax)
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jmp 0x27102
movq 0x10(%r14), %rax
addq %rax, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x43c0
movq (%r14), %rax
addq %rbx, %rax
movq %rax, (%r14)
movq 0x10(%r14), %rcx
movb $0x0, (%rcx,%rax)
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/./htslib/kstring.h
// Function: kputc
static inline int kputc(int c, kstring_t *s)
{
	if (ks_resize(s, s->l + 2) < 0)
		return EOF;
	s->s[s->l++] = c;
	s->s[s->l] = 0;
	return (unsigned char)c;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movl %edi, %ebx
movq (%rsi), %rcx
leaq 0x2(%rcx), %rax
cmpq %rax, 0x8(%rsi)
jae 0x27217
movq %rax, %rcx
shrq $0x3e, %rcx
movq %rax, %rdx
shrq %rdx
xorl %r15d, %r15d
testq %rcx, %rcx
cmoveq %rdx, %r15
addq %rax, %r15
movq 0x10(%r14), %rdi
movq %r15, %rsi
callq 0x4840
testq %rax, %rax
je 0x27239
movq %rax, 0x10(%r14)
movq %r15, 0x8(%r14)
movq (%r14), %rcx
jmp 0x2721b
movq 0x10(%r14), %rax
leaq 0x1(%rcx), %rdx
movq %rdx, (%r14)
movb %bl, (%rax,%rcx)
movq (%r14), %rax
movq 0x10(%r14), %rcx
movb $0x0, (%rcx,%rax)
movzbl %bl, %eax
popq %rbx
popq %r14
popq %r15
retq
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x27233
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/./sam_internal.h
// Function: possibly_expand_bam_data
static inline int possibly_expand_bam_data(bam1_t *b, size_t bytes) {
    size_t new_len = (size_t) b->l_data + bytes;

    if (new_len > INT32_MAX || new_len < bytes) { // Too big or overflow
        errno = ENOMEM;
        return -1;
    }
    if (new_len <= b->m_data) return 0;
    return sam_realloc_bam_data(b, new_len);
}

// Assembly:
movq %rsi, %rax
movslq 0x40(%rdi), %rsi
addq %rax, %rsi
setae %al
testq $-0x80000000, %rsi      # imm = 0x80000000
sete %cl
testb %al, %cl
jne 0x27fac
pushq %rax
callq 0x4050
movl $0xc, (%rax)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
retq
movl 0x44(%rdi), %ecx
xorl %eax, %eax
cmpq %rcx, %rsi
ja 0x22a64
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/./textutils_internal.h
// Function: hts_str2uint
static inline uint64_t hts_str2uint(const char *in, char **end, int bits,
                                    int *failed) {
    uint64_t n = 0, limit = (bits < 64 ? (1ULL << bits) : 0) - 1;
    const unsigned char *v = (const unsigned char *) in;
    const unsigned int ascii_zero = '0'; // Prevents conversion to signed
    uint32_t fast = bits * 1000 / 3322 + 1; // log(10)/log(2) ~= 3.322
    unsigned int d;

    if (*v == '+')
        v++;

    while (--fast && *v>='0' && *v<='9')
        n = n*10 + *v++ - ascii_zero;

    if ((unsigned)(*v - ascii_zero) < 10 && !fast) {
        uint64_t limit_d_10 = limit / 10;
        uint64_t limit_m_10 = limit - 10 * limit_d_10;
        while ((d = *v - ascii_zero) < 10) {
            if (n < limit_d_10 || (n == limit_d_10 && d <= limit_m_10)) {
                n = n*10 + d;
                v++;
            } else {
                do { v++; } while (*v - ascii_zero < 10);
                n = limit;
                *failed = 1;
                break;
            }
        }
    }

    *end = (char *)v;
    return n;
}

// Assembly:
movq %rcx, %r8
movl %edx, %ecx
movq $-0x1, %r9
shlq %cl, %r9
xorl %edx, %edx
cmpb $0x2b, (%rdi)
sete %dl
leaq (%rdi,%rdx), %r10
cmpl $0x4, %ecx
jae 0x27fdf
xorl %ecx, %ecx
jmp 0x28029
imull $0x3e8, %ecx, %ecx      # imm = 0x3E8
movl $0x9dd2b003, %eax       # imm = 0x9DD2B003
imulq %rcx, %rax
shrq $0x2b, %rax
leal -0x1(%rax), %ecx
addq %rdx, %rdi
leaq (%rcx,%rdi), %rdx
incq %rdx
xorl %ecx, %ecx
movzbl (%r10), %edi
leal -0x30(%rdi), %r11d
cmpb $0x9, %r11b
ja 0x2809f
leaq (%rcx,%rcx,4), %rcx
incq %r10
leaq (%rdi,%rcx,2), %rcx
addq $-0x30, %rcx
decl %eax
jne 0x28001
movq %rdx, %r10
movzbl (%r10), %edi
leal -0x3a(%rdi), %eax
cmpl $-0xa, %eax
jb 0x2809f
notq %r9
movabsq $0x6666666666666667, %rdx # imm = 0x6666666666666667
movq %r9, %rax
mulq %rdx
shrq $0x2, %rdx
leaq (%rdx,%rdx), %rax
leaq (%rax,%rax,4), %r11
movq %r9, %rax
subq %r11, %rax
addl $-0x30, %edi
movl %edi, %edi
cmpq %rdx, %rcx
jb 0x2806b
jne 0x28085
cmpq %rdi, %rax
jb 0x28085
leaq (%rcx,%rcx,4), %rcx
leaq (%rdi,%rcx,2), %rcx
movzbl 0x1(%r10), %edi
incq %r10
addl $-0x30, %edi
cmpl $0xa, %edi
jb 0x2805d
jmp 0x2809f
movzbl 0x1(%r10), %eax
incq %r10
addl $-0x30, %eax
cmpl $0xa, %eax
jb 0x28085
movl $0x1, (%r8)
movq %r9, %rcx
movq %r10, (%rsi)
movq %rcx, %rax
retq