LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/sam.c
// Function: bam_auxB2i
int64_t bam_auxB2i(const uint8_t *s, uint32_t idx)
{
    uint32_t len = bam_auxB_len(s);
    if (idx >= len) {
        errno = ERANGE;
        return 0;
    }
    return get_int_aux_val(s[1], s + 6, idx);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
callq 0x26215
cmpl %ebx, %eax
jbe 0x2625d
movzbl 0x1(%r14), %edi
addq $0x6, %r14
movq %r14, %rsi
movl %ebx, %edx
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x26142
callq 0x4050
movl $0x22, (%rax)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/sam.c
// Function: bam_auxB2f
double bam_auxB2f(const uint8_t *s, uint32_t idx)
{
    uint32_t len = bam_auxB_len(s);
    if (idx >= len) {
        errno = ERANGE;
        return 0.0;
    }
    if (s[1] == 'f') return le_to_float(s + 6 + 4 * idx);
    else return get_int_aux_val(s[1], s + 6, idx);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
callq 0x26215
cmpl %ebx, %eax
jbe 0x2629b
movb 0x1(%r14), %al
addq $0x6, %r14
cmpb $0x66, %al
jne 0x262ac
shll $0x2, %ebx
cvtss2sd (%r14,%rbx), %xmm0
jmp 0x262be
callq 0x4050
movl $0x22, (%rax)
xorpd %xmm0, %xmm0
jmp 0x262be
movzbl %al, %edi
movq %r14, %rsi
movl %ebx, %edx
callq 0x26142
cvtsi2sd %rax, %xmm0
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/sam.c
// Function: sam_open_mode
int sam_open_mode(char *mode, const char *fn, const char *format)
{
    // TODO Parse "bam5" etc for compression level
    if (format == NULL) {
        // Try to pick a format based on the filename extension
        char extension[HTS_MAX_EXT_LEN];
        if (find_file_extension(fn, extension) < 0) return -1;
        return sam_open_mode(mode, fn, extension);
    }
    else if (strcasecmp(format, "bam") == 0) strcpy(mode, "b");
    else if (strcasecmp(format, "cram") == 0) strcpy(mode, "c");
    else if (strcasecmp(format, "sam") == 0) strcpy(mode, "");
    else if (strcasecmp(format, "sam.gz") == 0) strcpy(mode, "z");
    else if (strcasecmp(format, "fastq") == 0 ||
             strcasecmp(format, "fq") == 0) strcpy(mode, "f");
    else if (strcasecmp(format, "fastq.gz") == 0 ||
             strcasecmp(format, "fq.gz") == 0) strcpy(mode, "fz");
    else if (strcasecmp(format, "fasta") == 0 ||
             strcasecmp(format, "fa") == 0) strcpy(mode, "F");
    else if (strcasecmp(format, "fasta.gz") == 0 ||
             strcasecmp(format, "fa.gz") == 0) strcpy(mode, "Fz");
    else return -1;

    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
testq %rdx, %rdx
je 0x263f5
movq %rdx, %r14
leaq 0x51f51(%rip), %rsi     # 0x78236
movq %rdx, %rdi
callq 0x4520
testl %eax, %eax
je 0x2641b
leaq 0x522c7(%rip), %rsi     # 0x785c3
movq %r14, %rdi
callq 0x4520
testl %eax, %eax
je 0x26422
leaq 0x5434b(%rip), %rsi     # 0x7a65e
movq %r14, %rdi
callq 0x4520
testl %eax, %eax
je 0x2642e
leaq 0x51f05(%rip), %rsi     # 0x7822f
movq %r14, %rdi
callq 0x4520
testl %eax, %eax
je 0x2643a
leaq 0x51ef9(%rip), %rsi     # 0x7823a
movq %r14, %rdi
callq 0x4520
testl %eax, %eax
je 0x26433
leaq 0x51ee8(%rip), %rsi     # 0x78240
movq %r14, %rdi
callq 0x4520
testl %eax, %eax
je 0x26433
leaq 0x51ed4(%rip), %rsi     # 0x78243
movq %r14, %rdi
callq 0x4520
testl %eax, %eax
je 0x26441
leaq 0x51ec6(%rip), %rsi     # 0x7824c
movq %r14, %rdi
callq 0x4520
testl %eax, %eax
je 0x26441
leaq 0x51eb5(%rip), %rsi     # 0x78252
movq %r14, %rdi
callq 0x4520
testl %eax, %eax
je 0x2644c
leaq 0x51ea4(%rip), %rsi     # 0x78258
movq %r14, %rdi
callq 0x4520
testl %eax, %eax
je 0x2644c
leaq 0x51e90(%rip), %rsi     # 0x7825b
movq %r14, %rdi
callq 0x4520
testl %eax, %eax
je 0x263ea
leaq 0x51e86(%rip), %rsi     # 0x78264
movq %r14, %rdi
callq 0x4520
testl %eax, %eax
jne 0x26429
movb $0x0, 0x2(%rbx)
movw $0x7a46, (%rbx)         # imm = 0x7A46
jmp 0x26451
movq %rsi, %r15
leaq 0x7(%rsp), %rsi
movq %r15, %rdi
callq 0x2645d
testl %eax, %eax
js 0x26429
leaq 0x7(%rsp), %rdx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x262c6
jmp 0x26453
movw $0x62, (%rbx)
jmp 0x26451
movw $0x63, (%rbx)
jmp 0x26451
pushq $-0x1
popq %rax
jmp 0x26453
movb $0x0, (%rbx)
jmp 0x26451
movw $0x66, (%rbx)
jmp 0x26451
movw $0x7a, (%rbx)
jmp 0x26451
movb $0x0, 0x2(%rbx)
movw $0x7a66, (%rbx)         # imm = 0x7A66
jmp 0x26451
movw $0x46, (%rbx)
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/./hts_internal.h
// Function: find_file_extension
static inline int find_file_extension(const char *fn, char ext_out[static HTS_MAX_EXT_LEN])
{
    const char *delim = fn ? strstr(fn, HTS_IDX_DELIM) : NULL, *ext;
    if (!fn) return -1;
    if (!delim) delim = fn + strlen(fn);
    for (ext = delim; ext > fn && *ext != '.' && *ext != '/'; --ext) {}
    if (*ext == '.' && ext > fn &&
        ((delim - ext == 3 && ext[1] == 'g' && ext[2] == 'z') || // permit .sam.gz as a valid file extension
        (delim - ext == 4 && ext[1] == 'b' && ext[2] == 'g' && ext[3] == 'z'))) // permit .vcf.bgz as a valid file extension
    {
        for (ext--; ext > fn && *ext != '.' && *ext != '/'; --ext) {}
    }
    if (*ext != '.' || delim - ext > HTS_MAX_EXT_LEN || delim - ext < 3)
        return -1;
    memcpy(ext_out, ext + 1, delim - ext - 1);
    ext_out[delim - ext - 1] = '\0';
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
pushq $-0x1
popq %rbp
testq %rdi, %rdi
je 0x264eb
movq %rsi, %rbx
movq %rdi, %r15
leaq 0x51a58(%rip), %rsi     # 0x77ed1
callq 0x40e0
movq %rax, %r14
testq %rax, %rax
jne 0x26494
movq %r15, %rdi
callq 0x41d0
movq %rax, %r14
addq %r15, %r14
xorl %ecx, %ecx
movq %r14, %rsi
movb (%rsi), %al
cmpq %r15, %rsi
jbe 0x264c3
movl %eax, %edx
andb $-0x2, %dl
cmpb $0x2e, %dl
je 0x264b2
decq %rsi
incq %rcx
jmp 0x26499
cmpq %r15, %rsi
setbe %dl
cmpb $0x2e, %al
setne %dil
orb %dl, %dil
je 0x264f8
cmpb $0x2e, %al
jne 0x264eb
subq %rsi, %r14
leaq -0xa(%r14), %rax
cmpq $-0x7, %rax
jb 0x264eb
incq %rsi
leaq -0x1(%r14), %rdx
movq %rbx, %rdi
callq 0x43c0
movb $0x0, -0x1(%rbx,%r14)
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
cmpq $0x4, %rcx
je 0x26512
cmpq $0x3, %rcx
jne 0x264c7
cmpb $0x67, 0x1(%rsi)
jne 0x264c7
cmpb $0x7a, 0x2(%rsi)
jne 0x264c7
jmp 0x26524
cmpb $0x62, 0x1(%rsi)
jne 0x264c7
cmpb $0x67, 0x2(%rsi)
jne 0x264c7
cmpb $0x7a, 0x3(%rsi)
jne 0x264c7
decq %rsi
movq %rsi, %rcx
movb (%rsi), %al
decq %rsi
cmpq %r15, %rcx
jbe 0x2653e
movl %eax, %ecx
andb $-0x2, %cl
cmpb $0x2e, %cl
jne 0x26527
incq %rsi
jmp 0x264c3
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/sam.c
// Function: bam_plp_init
bam_plp_t bam_plp_init(bam_plp_auto_f func, void *data)
{
    bam_plp_t iter;
    iter = (bam_plp_t)calloc(1, sizeof(struct bam_plp_s));
    iter->mp = mp_init();
    iter->head = iter->tail = mp_alloc(iter->mp);
    iter->max_tid = iter->max_pos = -1;
    iter->maxcnt = 8000;
    if (func) {
        iter->func = func;
        iter->data = data;
        iter->b = bam_init1();
    }
    return iter;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r15
pushq $0x1
popq %r12
movl $0x80, %esi
movq %r12, %rdi
callq 0x4300
movq %rax, %r14
pushq $0x18
popq %rsi
movq %r12, %rdi
callq 0x4300
movq %rax, (%r14)
movq %rax, %rdi
callq 0x270a9
movq %rax, 0x10(%r14)
movq %rax, 0x8(%r14)
orq $-0x1, 0x28(%r14)
orl $-0x1, 0x1c(%r14)
movl $0x1f40, 0x3c(%r14)     # imm = 0x1F40
testq %r15, %r15
je 0x2709a
movq %r15, 0x58(%r14)
movq %rbx, 0x60(%r14)
callq 0x1dec4
movq %rax, 0x50(%r14)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/sam.c
// Function: bam_plp_destroy
void bam_plp_destroy(bam_plp_t iter)
{
    lbnode_t *p, *pnext;
    if ( iter->overlaps ) kh_destroy(olap_hash, iter->overlaps);
    for (p = iter->head; p != NULL; p = pnext) {
        if (iter->plp_destruct && p != iter->tail)
            iter->plp_destruct(iter->data, &p->b, &p->cd);
        pnext = p->next;
        mp_free(iter->mp, p);
    }
    mp_destroy(iter->mp);
    if (iter->b) bam_destroy1(iter->b);
    free(iter->plp);
    free(iter);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x68(%rdi), %r14
testq %r14, %r14
je 0x27125
movq 0x18(%r14), %rdi
callq 0x45c0
movq 0x10(%r14), %rdi
callq 0x45c0
movq 0x20(%r14), %rdi
callq 0x45c0
movq %r14, %rdi
callq 0x45c0
movq 0x8(%rbx), %r14
testq %r14, %r14
je 0x27161
movq 0x78(%rbx), %rax
testq %rax, %rax
je 0x2714d
cmpq 0x10(%rbx), %r14
je 0x2714d
movq 0x60(%rbx), %rdi
leaq 0x80(%r14), %rdx
movq %r14, %rsi
callq *%rax
movq 0x78(%r14), %r15
movq (%rbx), %rdi
movq %r14, %rsi
callq 0x271c4
movq %r15, %r14
jmp 0x27129
movq (%rbx), %r14
xorl %r15d, %r15d
movslq 0x4(%r14), %rax
movq 0x10(%r14), %rdi
cmpq %rax, %r15
jge 0x27193
movq (%rdi,%r15,8), %rax
movq 0x38(%rax), %rdi
callq 0x45c0
movq 0x10(%r14), %rax
movq (%rax,%r15,8), %rdi
callq 0x45c0
incq %r15
jmp 0x27167
callq 0x45c0
movq %r14, %rdi
callq 0x45c0
movq 0x50(%rbx), %rdi
testq %rdi, %rdi
je 0x271ae
callq 0x1df92
movq 0x48(%rbx), %rdi
callq 0x45c0
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x45c0
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/sam.c
// Function: mp_free
static inline void mp_free(mempool_t *mp, lbnode_t *p)
{
    --mp->cnt; p->next = 0; // clear lbnode_t::next here
    if (mp->n == mp->max) {
        mp->max = mp->max? mp->max<<1 : 256;
        mp->buf = (lbnode_t**)realloc(mp->buf, sizeof(lbnode_t*) * mp->max);
    }
    mp->buf[mp->n++] = p;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
decl (%rdi)
movq %rsi, %r14
andq $0x0, 0x78(%rsi)
movl 0x4(%rdi), %ecx
cmpl 0x8(%rdi), %ecx
jne 0x27206
leal (%rcx,%rcx), %eax
testl %ecx, %ecx
movl $0x100, %ecx            # imm = 0x100
cmovnel %eax, %ecx
movl %ecx, 0x8(%rbx)
movq 0x10(%rbx), %rdi
movslq %ecx, %rsi
shlq $0x3, %rsi
callq 0x4840
movq %rax, 0x10(%rbx)
movl 0x4(%rbx), %ecx
jmp 0x2720a
movq 0x10(%rbx), %rax
leal 0x1(%rcx), %edx
movl %edx, 0x4(%rbx)
movslq %ecx, %rcx
movq %r14, (%rax,%rcx,8)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/sam.c
// Function: overlap_remove
static void overlap_remove(bam_plp_t iter, const bam1_t *b)
{
    if ( !iter->overlaps ) return;

    khiter_t kitr;
    if ( b )
    {
        kitr = kh_get(olap_hash, iter->overlaps, bam_get_qname(b));
        if ( kitr!=kh_end(iter->overlaps) )
            kh_del(olap_hash, iter->overlaps, kitr);
    }
    else
    {
        // remove all
        for (kitr = kh_begin(iter->overlaps); kitr<kh_end(iter->overlaps); kitr++)
            if ( kh_exist(iter->overlaps, kitr) ) kh_del(olap_hash, iter->overlaps, kitr);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq 0x68(%rdi), %rbx
testq %rbx, %rbx
je 0x2789d
testq %rsi, %rsi
je 0x278a8
movq 0x38(%rsi), %rsi
movq %rbx, %rdi
callq 0x29bd1
cmpl (%rbx), %eax
jne 0x278e2
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rdi, %r14
xorl %r15d, %r15d
xorl %ebp, %ebp
cmpl (%rbx), %ebp
jae 0x2789d
movq 0x10(%rbx), %rax
movl %ebp, %ecx
shrl $0x4, %ecx
movl (%rax,%rcx,4), %eax
movl %r15d, %ecx
andb $0x1e, %cl
shrl %cl, %eax
testb $0x3, %al
jne 0x278da
movq %rbx, %rdi
movl %ebp, %esi
callq 0x29c92
movq 0x68(%r14), %rbx
incl %ebp
addl $0x2, %r15d
jmp 0x278b0
movq %rbx, %rdi
movl %eax, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x29c92
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/sam.c
// Function: bam_plp_next
const bam_pileup1_t *bam_plp_next(bam_plp_t iter, int *_tid, int *_pos, int *_n_plp)
{
    hts_pos_t pos64 = 0;
    const bam_pileup1_t *p = bam_plp64_next(iter, _tid, &pos64, _n_plp);
    if (pos64 < INT_MAX) {
        *_pos = pos64;
    } else {
        hts_log_error("Position %"PRId64" too large", pos64);
        *_pos = INT_MAX;
        iter->error = 1;
        *_n_plp = -1;
        return NULL;
    }
    return p;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rcx, %r14
movq %rdx, %rbx
movq %rdi, %r15
leaq 0x8(%rsp), %r13
andq $0x0, (%r13)
movq %r13, %rdx
callq 0x27229
movq (%r13), %rcx
cmpq $0x7ffffffe, %rcx       # imm = 0x7FFFFFFE
jg 0x27932
movq %rax, %r12
movl %ecx, (%rbx)
jmp 0x2795f
leaq 0x5252f(%rip), %rsi     # 0x79e68
leaq 0x50e51(%rip), %rdx     # 0x78791
xorl %r12d, %r12d
pushq $0x1
popq %rdi
xorl %eax, %eax
callq 0x110c6
movl $0x7fffffff, (%rbx)     # imm = 0x7FFFFFFF
movl $0x1, 0x38(%r15)
orl $-0x1, (%r14)
movq %r12, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/sam.c
// Function: bam_plp64_auto
const bam_pileup1_t *bam_plp64_auto(bam_plp_t iter, int *_tid, hts_pos_t *_pos, int *_n_plp)
{
    const bam_pileup1_t *plp;
    if (iter->func == 0 || iter->error) { *_n_plp = -1; return 0; }
    if ((plp = bam_plp64_next(iter, _tid, _pos, _n_plp)) != 0) return plp;
    else { // no pileup line can be obtained; read alignments
        *_n_plp = 0;
        if (iter->is_eof) return 0;
        int ret;
        while ( (ret=iter->func(iter->data, iter->b)) >= 0) {
            if (bam_plp_push(iter, iter->b) < 0) {
                *_n_plp = -1;
                return 0;
            }
            if ((plp = bam_plp64_next(iter, _tid, _pos, _n_plp)) != 0) return plp;
            // otherwise no pileup line can be returned; read the next alignment.
        }
        if ( ret < -1 ) { iter->error = ret; *_n_plp = -1; return 0; }
        if (bam_plp_push(iter, 0) < 0) {
            *_n_plp = -1;
            return 0;
        }
        if ((plp = bam_plp64_next(iter, _tid, _pos, _n_plp)) != 0) return plp;
        return 0;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
cmpq $0x0, 0x58(%rdi)
je 0x2834e
movq %rdi, %r15
cmpl $0x0, 0x38(%rdi)
je 0x2835f
orl $-0x1, (%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rdx, %r14
movq %rsi, %r12
movq %r15, %rdi
movq %rbx, %rcx
callq 0x27229
testq %rax, %rax
jne 0x28353
andl $0x0, (%rbx)
cmpl $0x0, 0x30(%r15)
jne 0x28351
jmp 0x283a7
movq 0x50(%r15), %rsi
movq %r15, %rdi
callq 0x27970
testl %eax, %eax
js 0x2834e
movq %r15, %rdi
movq %r12, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x27229
testq %rax, %rax
jne 0x28353
movq 0x50(%r15), %rsi
movq 0x60(%r15), %rdi
callq *0x58(%r15)
testl %eax, %eax
jns 0x28381
cmpl $-0x1, %eax
je 0x283c2
movl %eax, 0x38(%r15)
jmp 0x2834e
movq %r15, %rdi
xorl %esi, %esi
callq 0x27970
testl %eax, %eax
js 0x2834e
movq %r15, %rdi
movq %r12, %rsi
movq %r14, %rdx
movq %rbx, %rcx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x27229
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/sam.c
// Function: bam_plp_auto
const bam_pileup1_t *bam_plp_auto(bam_plp_t iter, int *_tid, int *_pos, int *_n_plp)
{
    hts_pos_t pos64 = 0;
    const bam_pileup1_t *p = bam_plp64_auto(iter, _tid, &pos64, _n_plp);
    if (pos64 < INT_MAX) {
        *_pos = pos64;
    } else {
        hts_log_error("Position %"PRId64" too large", pos64);
        *_pos = INT_MAX;
        iter->error = 1;
        *_n_plp = -1;
        return NULL;
    }
    return p;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rcx, %r14
movq %rdx, %rbx
movq %rdi, %r15
leaq 0x8(%rsp), %r13
andq $0x0, (%r13)
movq %r13, %rdx
callq 0x28333
movq (%r13), %rcx
cmpq $0x7ffffffe, %rcx       # imm = 0x7FFFFFFE
jg 0x2842c
movq %rax, %r12
movl %ecx, (%rbx)
jmp 0x28459
leaq 0x51aaf(%rip), %rsi     # 0x79ee2
leaq 0x50357(%rip), %rdx     # 0x78791
xorl %r12d, %r12d
pushq $0x1
popq %rdi
xorl %eax, %eax
callq 0x110c6
movl $0x7fffffff, (%rbx)     # imm = 0x7FFFFFFF
movl $0x1, 0x38(%r15)
orl $-0x1, (%r14)
movq %r12, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/sam.c
// Function: bam_plp_reset
void bam_plp_reset(bam_plp_t iter)
{
    overlap_remove(iter, NULL);
    iter->max_tid = iter->max_pos = -1;
    iter->tid = iter->pos = 0;
    iter->is_eof = 0;
    while (iter->head != iter->tail) {
        lbnode_t *p = iter->head;
        iter->head = p->next;
        mp_free(iter->mp, p);
    }
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
xorl %esi, %esi
callq 0x27878
orq $-0x1, 0x28(%rbx)
orl $-0x1, 0x1c(%rbx)
andq $0x0, 0x20(%rbx)
andl $0x0, 0x18(%rbx)
andl $0x0, 0x30(%rbx)
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x284a7
movq 0x78(%rsi), %rax
movq %rax, 0x8(%rbx)
movq (%rbx), %rdi
callq 0x271c4
jmp 0x2848b
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/sam.c
// Function: bam_mplp_init
bam_mplp_t bam_mplp_init(int n, bam_plp_auto_f func, void **data)
{
    int i;
    bam_mplp_t iter;
    iter = (bam_mplp_t)calloc(1, sizeof(struct bam_mplp_s));
    iter->pos = (hts_pos_t*)calloc(n, sizeof(hts_pos_t));
    iter->tid = (int32_t*)calloc(n, sizeof(int32_t));
    iter->n_plp = (int*)calloc(n, sizeof(int));
    iter->plp = (const bam_pileup1_t**)calloc(n, sizeof(bam_pileup1_t*));
    iter->iter = (bam_plp_t*)calloc(n, sizeof(bam_plp_t));
    iter->n = n;
    iter->min_pos = HTS_POS_MAX;
    iter->min_tid = (uint32_t)-1;
    for (i = 0; i < n; ++i) {
        iter->iter[i] = bam_plp_init(func, data[i]);
        iter->pos[i] = iter->min_pos;
        iter->tid[i] = iter->min_tid;
    }
    return iter;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movl %edi, %ebp
pushq $0x1
popq %rdi
pushq $0x38
popq %rsi
callq 0x4300
movq %rax, %rbx
movslq %ebp, %r12
pushq $0x8
popq %r14
movq %r12, %rdi
movq %r14, %rsi
callq 0x4300
movq %rax, %r13
movq %rax, 0x18(%rbx)
pushq $0x4
popq %r15
movq %r12, %rdi
movq %r15, %rsi
callq 0x4300
movq %rax, %rbp
movq %rax, 0x8(%rbx)
movq %r12, %rdi
movq %r15, %rsi
callq 0x4300
movq %rax, 0x28(%rbx)
movq %r12, %rdi
movq %r14, %rsi
callq 0x4300
movq %rax, 0x30(%rbx)
movq %r12, %rdi
movq %r14, %rsi
callq 0x4300
movq %rax, %r15
movq %rax, 0x20(%rbx)
movl %r12d, (%rbx)
movabsq $0x7fffffff7fffffff, %rax # imm = 0x7FFFFFFF7FFFFFFF
movq %rax, %r14
movq %rax, 0x10(%rbx)
movq %rbx, (%rsp)
orl $-0x1, 0x4(%rbx)
xorl %ebx, %ebx
testl %r12d, %r12d
cmovlel %ebx, %r12d
cmpq %rbx, %r12
je 0x28584
movq 0x10(%rsp), %rax
movq (%rax,%rbx,8), %rsi
movq 0x8(%rsp), %rdi
callq 0x27032
movq %rax, (%r15,%rbx,8)
movq %r14, (%r13,%rbx,8)
orl $-0x1, (%rbp,%rbx,4)
incq %rbx
jmp 0x28559
movq (%rsp), %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/sam.c
// Function: bam_mplp_init_overlaps
int bam_mplp_init_overlaps(bam_mplp_t iter)
{
    int i, r = 0;
    for (i = 0; i < iter->n; ++i)
        r |= bam_plp_init_overlaps(iter->iter[i]);
    return r == 0 ? 0 : -1;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
xorl %r14d, %r14d
xorl %ebp, %ebp
movslq (%rbx), %rax
cmpq %rax, %r14
jge 0x285bf
movq 0x20(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x270d2
orl %eax, %ebp
incq %r14
jmp 0x285a3
xorl %eax, %eax
negl %ebp
sbbl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/sam.c
// Function: bam_mplp_destroy
void bam_mplp_destroy(bam_mplp_t iter)
{
    int i;
    for (i = 0; i < iter->n; ++i) bam_plp_destroy(iter->iter[i]);
    free(iter->iter); free(iter->pos); free(iter->tid);
    free(iter->n_plp); free(iter->plp);
    free(iter);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r14d, %r14d
movslq (%rbx), %rax
movq 0x20(%rbx), %rdi
cmpq %rax, %r14
jge 0x28609
movq (%rdi,%r14,8), %rdi
callq 0x270f1
incq %r14
jmp 0x285ef
callq 0x45c0
movq 0x18(%rbx), %rdi
callq 0x45c0
movq 0x8(%rbx), %rdi
callq 0x45c0
movq 0x28(%rbx), %rdi
callq 0x45c0
movq 0x30(%rbx), %rdi
callq 0x45c0
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x45c0
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/sam.c
// Function: bam_mplp_auto
int bam_mplp_auto(bam_mplp_t iter, int *_tid, int *_pos, int *n_plp, const bam_pileup1_t **plp)
{
    hts_pos_t pos64 = 0;
    int ret = bam_mplp64_auto(iter, _tid, &pos64, n_plp, plp);
    if (ret >= 0) {
        if (pos64 < INT_MAX) {
            *_pos = pos64;
        } else {
            hts_log_error("Position %"PRId64" too large", pos64);
            *_pos = INT_MAX;
            return -1;
        }
    }
    return ret;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdx, %rbx
leaq 0x8(%rsp), %rdx
andq $0x0, (%rdx)
callq 0x28641
testl %eax, %eax
js 0x28817
movq 0x8(%rsp), %rcx
cmpq $0x7ffffffe, %rcx       # imm = 0x7FFFFFFE
jle 0x28815
leaq 0x516f3(%rip), %rsi     # 0x79eef
leaq 0x4ff8e(%rip), %rdx     # 0x78791
pushq $0x1
popq %rdi
xorl %eax, %eax
callq 0x110c6
pushq $-0x1
popq %rax
movl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
movl %ecx, (%rbx)
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/sam.c
// Function: bam_mplp_reset
void bam_mplp_reset(bam_mplp_t iter)
{
    int i;
    iter->min_pos = HTS_POS_MAX;
    iter->min_tid = (uint32_t)-1;
    for (i = 0; i < iter->n; ++i) {
        bam_plp_reset(iter->iter[i]);
        iter->pos[i] = HTS_POS_MAX;
        iter->tid[i] = (uint32_t)-1;
        iter->n_plp[i] = 0;
        iter->plp[i] = NULL;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movabsq $0x7fffffff7fffffff, %r14 # imm = 0x7FFFFFFF7FFFFFFF
movq %r14, 0x10(%rdi)
orl $-0x1, 0x4(%rdi)
xorl %r15d, %r15d
movslq (%rbx), %rax
cmpq %rax, %r15
jge 0x28877
movq 0x20(%rbx), %rax
movq (%rax,%r15,8), %rdi
callq 0x2846a
movq 0x18(%rbx), %rax
movq %r14, (%rax,%r15,8)
movq 0x8(%rbx), %rax
orl $-0x1, (%rax,%r15,4)
movq 0x28(%rbx), %rax
andl $0x0, (%rax,%r15,4)
movq 0x30(%rbx), %rax
andq $0x0, (%rax,%r15,8)
incq %r15
jmp 0x2883a
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/sam.c
// Function: warn_if_known_stderr
static void warn_if_known_stderr(const char *line) {
    if (strstr(line, "M::bwa_idx_load_from_disk") != NULL)
        known_stderr("bwa", "Use `bwa mem -o file.sam ...` or `bwa sampe -f file.sam ...` instead of `bwa ... > file.sam`");
    else if (strstr(line, "M::mem_pestat") != NULL)
        known_stderr("bwa", "Use `bwa mem -o file.sam ...` instead of `bwa mem ... > file.sam`");
    else if (strstr(line, "loaded/built the index") != NULL)
        known_stderr("minimap2", "Use `minimap2 -o file.sam ...` instead of `minimap2 ... > file.sam`");
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0x519d8(%rip), %rsi     # 0x7a298
callq 0x40e0
testq %rax, %rax
je 0x288da
leaq 0x519e1(%rip), %rdi     # 0x7a2b2
leaq 0x519de(%rip), %rsi     # 0x7a2b6
jmp 0x28920
leaq 0x51a32(%rip), %rsi     # 0x7a313
movq %rbx, %rdi
callq 0x40e0
testq %rax, %rax
je 0x288fe
leaq 0x519bd(%rip), %rdi     # 0x7a2b2
leaq 0x51a25(%rip), %rsi     # 0x7a321
jmp 0x28920
leaq 0x51a5e(%rip), %rsi     # 0x7a363
movq %rbx, %rdi
callq 0x40e0
testq %rax, %rax
je 0x28926
leaq 0x51a61(%rip), %rdi     # 0x7a37a
leaq 0x51a63(%rip), %rsi     # 0x7a383
popq %rbx
jmp 0x289ee
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/./htslib/kstring.h
// Function: kputll
static inline int kputll(long long c, kstring_t *s)
{
    // Worst case expansion.  One check reduces function size
    // and aids inlining chance.  Memory overhead is minimal.
    if (ks_resize(s, s->l + 23) < 0)
	return EOF;

    unsigned long long x = c;
    if (c < 0) {
	x = -x;
        s->s[s->l++] = '-';
    }

    if (x <= UINT32_MAX)
	return kputuw(x, s);

    static const char kputull_dig2r[] =
        "00010203040506070809"
        "10111213141516171819"
        "20212223242526272829"
        "30313233343536373839"
        "40414243444546474849"
        "50515253545556575859"
        "60616263646566676869"
        "70717273747576777879"
        "80818283848586878889"
        "90919293949596979899";
    unsigned int l, j;
    char *cp;

    // Find out how long the number is (could consider clzll)
    uint64_t m = 1;
    l = 0;
    if (sizeof(long long)==sizeof(uint64_t) && x >= 10000000000000000000ULL) {
	// avoids overflow below
	l = 20;
    } else {
	do {
	    l++;
	    m *= 10;
	} while (x >= m);
    }

    // Add digits two at a time
    j = l;
    cp = s->s + s->l;
    while (x >= 10) {
        const char *d = &kputull_dig2r[2*(x%100)];
        x /= 100;
        memcpy(&cp[j-=2], d, 2);
    }

    // Last one (if necessary).  We know that x < 10 by now.
    if (j == 1)
        cp[0] = x + '0';

    s->l += l;
    s->s[s->l] = 0;
    return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq (%rsi), %rsi
addq $0x17, %rsi
movq %rbx, %rdi
callq 0x24d14
testl %eax, %eax
js 0x2897a
testq %r14, %r14
jns 0x2895f
negq %r14
movq (%rbx), %rax
movq 0x10(%rbx), %rcx
leaq 0x1(%rax), %rdx
movq %rdx, (%rbx)
movb $0x2d, (%rcx,%rax)
movq %r14, %rax
shrq $0x20, %rax
jne 0x2897f
movl %r14d, %edi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x28a2f
pushq $-0x1
popq %rax
jmp 0x289e6
pushq $0x1
popq %rax
pushq $-0x2
popq %rcx
imulq $0xa, %rax, %rax
incl %ecx
cmpq %rax, %r14
jae 0x28985
movq 0x10(%rbx), %rsi
addq (%rbx), %rsi
leal 0x2(%rcx), %edi
leaq 0x4ddef(%rip), %r8      # 0x76790
pushq $0x64
popq %r9
cmpq $0xa, %r14
jb 0x289c8
movq %r14, %rax
xorl %edx, %edx
divq %r9
movl %ecx, %r10d
movzwl (%r8,%rdx,2), %edx
movw %dx, (%rsi,%r10)
addl $-0x2, %ecx
movq %rax, %r14
jmp 0x289a5
cmpl $-0x1, %ecx
jne 0x289d4
orb $0x30, %r14b
movb %r14b, (%rsi)
movl %edi, %eax
addq (%rbx), %rax
movq %rax, (%rbx)
movq 0x10(%rbx), %rcx
movb $0x0, (%rcx,%rax)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/sam.c
// Function: grow_B_array
static inline int64_t grow_B_array(bam1_t *b, uint32_t *n, size_t size) {
    // Avoid overflow on 32-bit platforms, but it breaks BAM anyway
    if (*n > INT32_MAX*0.666) {
        errno = ENOMEM;
        return -1;
    }

    size_t bytes = (size_t)size * (size_t)(*n>>1);
    if (possibly_expand_bam_data(b, bytes) < 0) {
        hts_log_error("Out of memory");
        return -1;
    }

    (*n)+=*n>>1;
    return 0;
}

// Assembly:
pushq %rbx
movq %rsi, %rbx
movl (%rsi), %esi
cmpq $0x553f7ced, %rsi       # imm = 0x553F7CED
jb 0x291be
callq 0x4050
movl $0xc, (%rax)
jmp 0x291f3
shrl %esi
imulq %rdx, %rsi
callq 0x2200f
testl %eax, %eax
js 0x291db
movl (%rbx), %eax
movl %eax, %ecx
shrl %ecx
addl %eax, %ecx
movl %ecx, (%rbx)
xorl %eax, %eax
jmp 0x291f6
leaq 0x513b7(%rip), %rsi     # 0x7a599
leaq 0x503fc(%rip), %rdx     # 0x795e5
pushq $0x1
popq %rdi
xorl %eax, %eax
callq 0x110c6
pushq $-0x1
popq %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/sam.c
// Function: sam_state_err
static void sam_state_err(SAM_state *fd, int errcode) {
    pthread_mutex_lock(&fd->command_m);
    if (!fd->errcode)
        fd->errcode = errcode;
    pthread_mutex_unlock(&fd->command_m);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movq %rdi, %r14
leaq 0x78(%rdi), %rbx
movq %rbx, %rdi
callq 0x4750
cmpl $0x0, 0xd4(%r14)
jne 0x29237
movl %ebp, 0xd4(%r14)
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x4340
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/./htslib/kstring.h
// Function: kputsn_
static inline int kputsn_(const void *p, size_t l, kstring_t *s)
{
	size_t new_sz = s->l + l;
	if (new_sz < s->l) { errno = EOVERFLOW; return EOF; }
	if (ks_resize(s, new_sz ? new_sz : 1) < 0) return EOF;
	memcpy(s->s + s->l, p, l);
	s->l += l;
	return l;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq (%rdx), %rsi
addq %rbx, %rsi
jae 0x29b7b
callq 0x4050
movl $0x4b, (%rax)
jmp 0x29bac
movq %rdx, %r14
movq %rdi, %r15
cmpq $0x1, %rsi
adcq $0x0, %rsi
movq %rdx, %rdi
callq 0x24d14
testl %eax, %eax
js 0x29bac
movq 0x10(%r14), %rdi
addq (%r14), %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x43c0
addq %rbx, (%r14)
jmp 0x29baf
pushq $-0x1
popq %rbx
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/sam.c
// Function: cigar_iref2iseq_set
static inline int cigar_iref2iseq_set(const uint32_t **cigar,
                                      const uint32_t *cigar_max,
                                      hts_pos_t *icig,
                                      hts_pos_t *iseq,
                                      hts_pos_t *iref)
{
    hts_pos_t pos = *iref;
    if ( pos < 0 ) return -1;
    *icig = 0;
    *iseq = 0;
    *iref = 0;
    while ( *cigar<cigar_max )
    {
        int cig  = (**cigar) & BAM_CIGAR_MASK;
        int ncig = (**cigar) >> BAM_CIGAR_SHIFT;

        if ( cig==BAM_CSOFT_CLIP ) { (*cigar)++; *iseq += ncig; *icig = 0; continue; }
        if ( cig==BAM_CHARD_CLIP || cig==BAM_CPAD ) { (*cigar)++; *icig = 0; continue; }
        if ( cig==BAM_CMATCH || cig==BAM_CEQUAL || cig==BAM_CDIFF )
        {
            pos -= ncig;
            if ( pos < 0 ) { *icig = ncig + pos; *iseq += *icig; *iref += *icig; return BAM_CMATCH; }
            (*cigar)++; *iseq += ncig; *icig = 0; *iref += ncig;
            continue;
        }
        if ( cig==BAM_CINS ) { (*cigar)++; *iseq += ncig; *icig = 0; continue; }
        if ( cig==BAM_CDEL || cig==BAM_CREF_SKIP )
        {
            pos -= ncig;
            if ( pos<0 ) pos = 0;
            (*cigar)++; *icig = 0; *iref += ncig;
            continue;
        }
        hts_log_error("Unexpected cigar %d", cig);
        return -2;
    }
    *iseq = -1;
    return -1;
}

// Assembly:
movq (%r8), %r10
pushq $-0x1
popq %rax
testq %r10, %r10
js 0x2a03e
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
andq $0x0, (%rdx)
andq $0x0, (%rcx)
andq $0x0, (%r8)
movq (%rdi), %r11
xorl %ebx, %ebx
cmpq %rsi, %r11
jae 0x2a030
movl (%r11), %ebp
movl %ebp, %r9d
andl $0xf, %r9d
movl %ebp, %r14d
shrl $0x4, %r14d
cmpl $0x4, %r9d
je 0x29fda
leal -0x5(%r9), %r15d
cmpl $0x1, %r15d
ja 0x29fc5
addq $0x4, %r11
movq %r11, (%rdi)
andq $0x0, (%rdx)
jmp 0x29f8e
movl %r14d, %r14d
testb $0x7, %bpl
je 0x29fea
cmpl $0x7, %r9d
je 0x29fea
cmpl $0x1, %r9d
jne 0x2a008
addq $0x4, %r11
movq %r11, (%rdi)
addq %r14, (%rcx)
andq $0x0, (%rdx)
jmp 0x29f8e
movq %r10, %r9
subq %r14, %r9
js 0x2a03f
addq $0x4, %r11
movq %r11, (%rdi)
addq %r14, (%rcx)
andq $0x0, (%rdx)
addq (%r8), %r14
movq %r9, %r10
jmp 0x2a028
andl $0xe, %ebp
cmpl $0x2, %ebp
jne 0x2a04f
subq %r14, %r10
testq %r10, %r10
cmovleq %rbx, %r10
addq $0x4, %r11
movq %r11, (%rdi)
andq $0x0, (%rdx)
addq (%r8), %r14
movq %r14, (%r8)
jmp 0x29f8e
orq $-0x1, (%rcx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %r10, (%rdx)
addq %r10, (%rcx)
movq (%rdx), %rax
addq %rax, (%r8)
xorl %eax, %eax
jmp 0x2a034
leaq 0x50816(%rip), %rsi     # 0x7a86c
leaq 0x50823(%rip), %rdx     # 0x7a880
pushq $0x1
popq %rdi
movl %r9d, %ecx
xorl %eax, %eax
callq 0x110c6
pushq $-0x2
popq %rax
jmp 0x2a034
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/sam.c
// Function: cigar_iref2iseq_next
static inline int cigar_iref2iseq_next(const uint32_t **cigar,
                                       const uint32_t *cigar_max,
                                       hts_pos_t *icig,
                                       hts_pos_t *iseq,
                                       hts_pos_t *iref)
{
    while ( *cigar < cigar_max )
    {
        int cig  = (**cigar) & BAM_CIGAR_MASK;
        int ncig = (**cigar) >> BAM_CIGAR_SHIFT;

        if ( cig==BAM_CMATCH || cig==BAM_CEQUAL || cig==BAM_CDIFF )
        {
            if ( *icig >= ncig - 1 ) { *icig = -1;  (*cigar)++; continue; }
            (*iseq)++; (*icig)++; (*iref)++;
            return BAM_CMATCH;
        }
        if ( cig==BAM_CDEL || cig==BAM_CREF_SKIP ) { (*cigar)++; (*iref) += ncig; *icig = -1; continue; }
        if ( cig==BAM_CINS ) { (*cigar)++; *iseq += ncig; *icig = -1; continue; }
        if ( cig==BAM_CSOFT_CLIP ) { (*cigar)++; *iseq += ncig; *icig = -1; continue; }
        if ( cig==BAM_CHARD_CLIP || cig==BAM_CPAD ) { (*cigar)++; *icig = -1; continue; }
        hts_log_error("Unexpected cigar %d", cig);
        return -2;
    }
    *iseq = -1;
    *iref = -1;
    return -1;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq (%rdi), %r9
cmpq %rsi, %r9
jae 0x2a10a
movl (%r9), %r11d
movl %r11d, %eax
andl $0xf, %eax
movl %r11d, %r10d
shrl $0x4, %r10d
cmpl $0x7, %eax
setne %bl
testb $0x7, %r11b
setne %bpl
testb %bl, %bpl
jne 0x2a0b9
decl %r10d
movslq %r10d, %rax
cmpq %rax, (%rdx)
jl 0x2a117
orq $-0x1, (%rdx)
addq $0x4, %r9
movq %r9, (%rdi)
jmp 0x2a075
andl $0xe, %r11d
cmpl $0x2, %r11d
jne 0x2a0d3
addq $0x4, %r9
movq %r9, (%rdi)
addq %r10, (%r8)
orq $-0x1, (%rdx)
jmp 0x2a075
movl %r10d, %r10d
cmpl $0x4, %eax
je 0x2a0e0
cmpl $0x1, %eax
jne 0x2a0f0
addq $0x4, %r9
movq %r9, (%rdi)
addq %r10, (%rcx)
orq $-0x1, (%rdx)
jmp 0x2a075
leal -0x5(%rax), %r10d
cmpl $0x1, %r10d
ja 0x2a129
addq $0x4, %r9
movq %r9, (%rdi)
orq $-0x1, (%rdx)
jmp 0x2a075
orq $-0x1, (%rcx)
orq $-0x1, (%r8)
pushq $-0x1
popq %rax
jmp 0x2a122
incq (%rcx)
incq (%rdx)
incq (%r8)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0x50764(%rip), %rsi     # 0x7a894
leaq 0x50749(%rip), %rdx     # 0x7a880
pushq $0x1
popq %rdi
movl %eax, %ecx
xorl %eax, %eax
callq 0x110c6
pushq $-0x2
jmp 0x2a114
nop
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/sam_mods.c
// Function: bam_mods_at_qpos
int bam_mods_at_qpos(const bam1_t *b, int qpos, hts_base_mod_state *state,
                    hts_base_mod *mods, int n_mods) {
    // FIXME: for now this is inefficient in implementation.
    int r = 0;
    while (state->seq_pos <= qpos)
        if ((r = bam_mods_at_next_pos(b, state, mods, n_mods)) < 0)
            break;

    return r;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %r8d, %ebx
movq %rcx, %r14
movq %rdx, %r15
movl %esi, %ebp
movq %rdi, %r12
xorl %eax, %eax
cmpl %ebp, 0x2d00(%r15)
jg 0x2add5
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
movl %ebx, %ecx
callq 0x2a79d
testl %eax, %eax
jns 0x2adb8
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/sam_mods.c
// Function: bam_mods_query_type
int bam_mods_query_type(hts_base_mod_state *state, int code,
                        int *strand, int *implicit, char *canonical) {
    // Find code entry
    int i;
    for (i = 0; i < state->nmods; i++) {
        if (state->type[i] == code)
            break;
    }
    if (i == state->nmods)
        return -1;

    // Return data
    if (strand)    *strand    = state->strand[i];
    if (implicit)  *implicit  = state->implicit[i];
    if (canonical) *canonical = "?AC?G???T??????N"[state->canonical[i]];

    return 0;
}

// Assembly:
movl 0x2d04(%rdi), %eax
xorl %r10d, %r10d
testl %eax, %eax
movl $0x0, %r9d
cmovgl %eax, %r9d
cmpq %r10, %r9
je 0x2ae12
cmpl %esi, (%rdi,%r10,4)
je 0x2ae0f
incq %r10
jmp 0x2adff
movl %r10d, %r9d
cmpl %eax, %r9d
jne 0x2ae1b
pushq $-0x1
popq %rax
retq
movl %r9d, %esi
testq %rdx, %rdx
je 0x2ae2d
movsbl 0x800(%rdi,%rsi), %eax
movl %eax, (%rdx)
testq %rcx, %rcx
je 0x2ae3b
movl 0x2900(%rdi,%rsi,4), %eax
movl %eax, (%rcx)
xorl %eax, %eax
testq %r8, %r8
je 0x2ae57
movslq 0x400(%rdi,%rsi,4), %rcx
leaq 0x4fc2c(%rip), %rdx     # 0x7aa7d
movb (%rcx,%rdx), %cl
movb %cl, (%r8)
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/sam_mods.c
// Function: bam_mods_queryi
int bam_mods_queryi(hts_base_mod_state *state, int i,
                    int *strand, int *implicit, char *canonical) {
    if (i < 0 || i >= state->nmods)
        return -1;

    // Return data
    if (strand)    *strand    = state->strand[i];
    if (implicit)  *implicit  = state->implicit[i];
    if (canonical) *canonical = "?AC?G???T??????N"[state->canonical[i]];

    return 0;
}

// Assembly:
pushq $-0x1
popq %rax
testl %esi, %esi
js 0x2aea2
cmpl %esi, 0x2d04(%rdi)
jle 0x2aea2
movl %esi, %esi
testq %rdx, %rdx
je 0x2ae78
movsbl 0x800(%rdi,%rsi), %eax
movl %eax, (%rdx)
testq %rcx, %rcx
je 0x2ae86
movl 0x2900(%rdi,%rsi,4), %eax
movl %eax, (%rcx)
xorl %eax, %eax
testq %r8, %r8
je 0x2aea2
movslq 0x400(%rdi,%rsi,4), %rcx
leaq 0x4fbe1(%rip), %rdx     # 0x7aa7d
movb (%rcx,%rdx), %cl
movb %cl, (%r8)
retq
nop
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/textutils.c
// Function: hts_decode_percent
int hts_decode_percent(char *dest, size_t *destlen, const char *s)
{
    char *d = dest;
    int hi, lo;

    while (*s) {
        if (*s == '%' && (hi = dehex(s[1])) >= 0 && (lo = dehex(s[2])) >= 0) {
            *d++ = (hi << 4) | lo;
            s += 3;
        }
        else *d++ = *s++;
    }

    *d = '\0';
    *destlen = d - dest;
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r15
xorl %r12d, %r12d
movzbl (%r14), %r13d
cmpl $0x25, %r13d
je 0x2afa8
testl %r13d, %r13d
jne 0x2afd5
jmp 0x2afe1
movsbl 0x1(%r14), %edi
callq 0x2affa
testl %eax, %eax
js 0x2afd5
movl %eax, %ebp
movsbl 0x2(%r14), %edi
callq 0x2affa
testl %eax, %eax
js 0x2afd5
shll $0x4, %ebp
orl %ebp, %eax
movb %al, (%r15,%r12)
addq $0x3, %r14
jmp 0x2afdc
incq %r14
movb %r13b, (%r15,%r12)
incq %r12
jmp 0x2af97
movb $0x0, (%r15,%r12)
movq %r12, (%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/textutils.c
// Function: hts_decode_base64
int hts_decode_base64(char *dest, size_t *destlen, const char *s)
{
    char *d = dest;
    int x0, x1, x2, x3;

    while (1) {
        x0 = debase64(*s++);
        x1 = (x0 >= 0)? debase64(*s++) : -1;
        x2 = (x1 >= 0)? debase64(*s++) : -1;
        x3 = (x2 >= 0)? debase64(*s++) : -1;
        if (x3 < 0) break;

        *d++ = (x0 << 2) | (x1 >> 4);
        *d++ = (x1 << 4) | (x2 >> 2);
        *d++ = (x2 << 6) | x3;
    }

    if (x1 >= 0) *d++ = (x0 << 2) | (x1 >> 4);
    if (x2 >= 0) *d++ = (x1 << 4) | (x2 >> 2);

    *destlen = d - dest;
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rsi, (%rsp)
movq %rdi, %r14
leaq 0x1(%rdi), %rbx
movsbl (%r15), %edi
callq 0x2b0ff
testl %eax, %eax
js 0x2b0bb
movl %eax, %r13d
movsbl 0x1(%r15), %edi
callq 0x2b0ff
testl %eax, %eax
js 0x2b0bb
movl %eax, %ebp
movsbl 0x2(%r15), %edi
callq 0x2b0ff
movl %eax, %r12d
testl %eax, %eax
js 0x2b0c0
movsbl 0x3(%r15), %edi
callq 0x2b0ff
testl %eax, %eax
js 0x2b0c0
shll $0x2, %r13d
movl %ebp, %ecx
shrl $0x4, %ecx
orl %r13d, %ecx
movb %cl, -0x1(%rbx)
shll $0x4, %ebp
movl %r12d, %ecx
shrl $0x2, %ecx
orl %ebp, %ecx
movb %cl, (%rbx)
shll $0x6, %r12d
orl %r12d, %eax
movb %al, 0x1(%rbx)
addq $0x3, %rbx
addq $0x4, %r15
jmp 0x2b04c
decq %rbx
jmp 0x2b0e4
shll $0x2, %r13d
movl %ebp, %eax
shrl $0x4, %eax
orl %r13d, %eax
movb %al, -0x1(%rbx)
testl %r12d, %r12d
js 0x2b0e4
shll $0x4, %ebp
shrl $0x2, %r12d
orl %ebp, %r12d
movb %r12b, (%rbx)
incq %rbx
subq %r14, %rbx
movq (%rsp), %rax
movq %rbx, (%rax)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/textutils.c
// Function: debase64
static int debase64(char c)
{
    if (c >= 'a' && c <= 'z') return c - 'a' + 26;
    else if (c >= 'A' && c <= 'Z') return c - 'A';
    else if (c >= '0' && c <= '9') return c - '0' + 52;
    else if (c == '/') return 63;
    else if (c == '+') return 62;
    else return -1;  // Hence debase64('\0') = -1
}

// Assembly:
movl %edi, %eax
leal -0x61(%rax), %ecx
cmpb $0x19, %cl
ja 0x2b10d
addl $-0x47, %eax
retq
leal -0x41(%rax), %ecx
cmpb $0x19, %cl
ja 0x2b119
addl $-0x41, %eax
retq
leal -0x30(%rax), %ecx
cmpb $0x9, %cl
ja 0x2b125
addl $0x4, %eax
retq
xorl %ecx, %ecx
cmpb $0x2b, %al
setne %cl
negl %ecx
orl $0x3e, %ecx
cmpb $0x2f, %al
pushq $0x3f
popq %rax
cmovnel %ecx, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/textutils.c
// Function: token_type
static char token_type(hts_json_token *token)
{
    const char *s = token->str;

    switch (*s) {
    case 'f':
        return (strcmp(s, "false") == 0)? 'b' : '?';
    case 'n':
        return (strcmp(s, "null") == 0)? '.' : '?';
    case 't':
        return (strcmp(s, "true") == 0)? 'b' : '?';
    case '-':
    case '0': case '1': case '2': case '3': case '4':
    case '5': case '6': case '7': case '8': case '9':
        return 'n';
    default:
        return '?';
    }
}

// Assembly:
pushq %rax
movq 0x8(%rdi), %rdi
movzbl (%rdi), %ecx
movb $0x6e, %al
leal -0x30(%rcx), %edx
cmpl $0xa, %edx
jb 0x2b3f9
cmpl $0x2d, %ecx
je 0x2b3f9
cmpl $0x74, %ecx
je 0x2b3cc
cmpl $0x6e, %ecx
je 0x2b3de
cmpl $0x66, %ecx
jne 0x2b3f7
leaq 0x4daf7(%rip), %rsi     # 0x78ec1
jmp 0x2b3d3
leaq 0x4f996(%rip), %rsi     # 0x7ad69
callq 0x46c0
testl %eax, %eax
pushq $0x62
jmp 0x2b3ee
leaq 0x4f97f(%rip), %rsi     # 0x7ad64
callq 0x46c0
testl %eax, %eax
pushq $0x2e
popq %rcx
pushq $0x3f
popq %rax
cmovel %ecx, %eax
jmp 0x2b3f9
movb $0x3f, %al
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/textutils.c
// Function: skip_value
static char skip_value(char type, hts_json_nextfn *next, void *arg1, void *arg2)
{
    hts_json_token token;
    int level;

    switch (type? type : next(arg1, arg2, &token)) {
    case '\0':
        return '\0';

    case '?':
    case '}':
    case ']':
        return '?';

    case '{':
    case '[':
        level = 1;
        break;

    default:
        return 'v';
    }

    while (level > 0)
        switch (next(arg1, arg2, &token)) {
        case '\0':
            return '\0';

        case '?':
            return '?';

        case '{':
        case '[':
            level++;
            break;

        case '}':
        case ']':
            --level;
            break;

        default:
            break;
        }

    return 'v';
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movl %edi, %eax
testb %al, %al
jne 0x2b771
movq %rsp, %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq *%r15
movzbl %al, %ecx
leal -0x3f(%rcx), %edx
cmpl $0x3e, %edx
ja 0x2b7de
movabsq $0x4000000040000001, %rsi # imm = 0x4000000040000001
btq %rdx, %rsi
jae 0x2b790
movb $0x3f, %al
jmp 0x2b7e4
movabsq $0x1000000010000000, %rsi # imm = 0x1000000010000000
btq %rdx, %rsi
jae 0x2b7de
pushq $0x1
popq %rbp
movq %rsp, %r12
testl %ebp, %ebp
jle 0x2b7e2
movq %r14, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq *%r15
testb %al, %al
je 0x2b7e4
movzbl %al, %ecx
cmpl $0x3f, %ecx
je 0x2b7e4
cmpl $0x5b, %ecx
je 0x2b7d6
cmpl $0x5d, %ecx
je 0x2b7da
cmpl $0x7d, %ecx
je 0x2b7da
cmpl $0x7b, %ecx
jne 0x2b7a6
incl %ebp
jmp 0x2b7a6
decl %ebp
jmp 0x2b7a6
testl %ecx, %ecx
je 0x2b7e4
movb $0x76, %al
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/textutils.c
// Function: hts_json_fskip_value
HTSLIB_EXPORT
char hts_json_fskip_value(struct hFILE *fp, char type)
{
    kstring_t str = { 0, 0, NULL };
    char ret = skip_value(type, fnext, fp, &str);
    free(str.s);
    return ret;
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0x18, %rsp
movl %esi, %eax
movq %rdi, %rdx
xorps %xmm0, %xmm0
movq %rsp, %rbx
movaps %xmm0, (%rbx)
andq $0x0, 0x10(%rbx)
leaq 0x1e(%rip), %rsi        # 0x2b834
movl %eax, %edi
movq %rbx, %rcx
callq 0x2b74a
movl %eax, %ebp
movq 0x10(%rbx), %rdi
callq 0x45c0
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/textutils.c
// Function: stringify_argv
char *stringify_argv(int argc, char *argv[]) {
    char *str, *cp;
    size_t nbytes = 1;
    int i, j;

    /* Allocate */
    for (i = 0; i < argc; i++) {
        if (i > 0) nbytes += 1;
        nbytes += strlen(argv[i]);
    }
    if (!(str = malloc(nbytes)))
        return NULL;

    /* Copy */
    cp = str;
    for (i = 0; i < argc; i++) {
        if (i > 0) *cp++ = ' ';
        j = 0;
        while (argv[i][j]) {
            if (argv[i][j] == '\t')
                *cp++ = ' ';
            else
                *cp++ = argv[i][j];
            j++;
        }
    }
    *cp++ = 0;

    return str;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edi, %r14d
xorl %r12d, %r12d
testl %edi, %edi
cmovlel %r12d, %r14d
pushq $0x1
popq %r15
cmpq %r12, %r14
je 0x2b87b
cmpq $0x1, %r12
sbbq $-0x1, %r15
movq (%rbx,%r12,8), %rdi
callq 0x41d0
addq %rax, %r15
incq %r12
jmp 0x2b85d
movq %r15, %rdi
callq 0x4680
testq %rax, %rax
je 0x2b8ca
xorl %ecx, %ecx
movq %rax, %rdx
cmpq %r14, %rcx
je 0x2b8c7
testq %rcx, %rcx
je 0x2b89d
movb $0x20, (%rdx)
incq %rdx
xorl %esi, %esi
movq (%rbx,%rcx,8), %rdi
movzbl (%rdi,%rsi), %edi
movb $0x20, %r8b
cmpl $0x9, %edi
je 0x2b8b6
testl %edi, %edi
je 0x2b8bf
movl %edi, %r8d
movb %r8b, (%rdx,%rsi)
incq %rsi
jmp 0x2b89f
incq %rcx
addq %rsi, %rdx
jmp 0x2b88d
movb $0x0, (%rdx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/textutils.c
// Function: encode_utf8
static char *encode_utf8(char *s, unsigned x)
{
    if (x >= 0x10000) {
        *s++ = 0xF0 | (x >> 18);
        *s++ = 0x80 | ((x >> 12) & 0x3F);
        *s++ = 0x80 | ((x >> 6) & 0x3F);
        *s++ = 0x80 | (x & 0x3F);
    }
    else if (x >= 0x800) {
        *s++ = 0xE0 | (x >> 12);
        *s++ = 0x80 | ((x >> 6) & 0x3F);
        *s++ = 0x80 | (x & 0x3F);
    }
    else if (x >= 0x80) {
        *s++ = 0xC0 | (x >> 6);
        *s++ = 0x80 | (x & 0x3F);
    }
    else *s++ = x;

    return s;
}

// Assembly:
movq %rdi, %rax
cmpl $0x10000, %esi          # imm = 0x10000
jb 0x2baa9
movl %esi, %ecx
shrl $0x12, %ecx
orb $-0x10, %cl
movb %cl, (%rax)
movl %esi, %ecx
shrl $0xc, %ecx
andb $0x3f, %cl
orb $-0x80, %cl
movb %cl, 0x1(%rax)
movl %esi, %ecx
shrl $0x6, %ecx
andb $0x3f, %cl
orb $-0x80, %cl
movb %cl, 0x2(%rax)
andb $0x3f, %sil
orb $-0x80, %sil
movb %sil, 0x3(%rax)
addq $0x4, %rax
retq
cmpl $0x800, %esi            # imm = 0x800
jb 0x2bada
movl %esi, %ecx
shrl $0xc, %ecx
orb $-0x20, %cl
movb %cl, (%rax)
movl %esi, %ecx
shrl $0x6, %ecx
andb $0x3f, %cl
orb $-0x80, %cl
movb %cl, 0x1(%rax)
andb $0x3f, %sil
orb $-0x80, %sil
movb %sil, 0x2(%rax)
addq $0x3, %rax
retq
cmpl $0x80, %esi
jb 0x2bafd
movl %esi, %ecx
shrl $0x6, %ecx
orb $-0x40, %cl
movb %cl, (%rax)
andb $0x3f, %sil
orb $-0x80, %sil
movb %sil, 0x1(%rax)
addq $0x2, %rax
retq
movb %sil, (%rax)
incq %rax
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/thread_pool.c
// Function: hts_tpool_worker_id
int hts_tpool_worker_id(hts_tpool *p) {
    if (!p)
        return -1;
    pthread_t s = pthread_self();
    int i;
    for (i = 0; i < p->tsize; i++) {
        if (pthread_equal(s, p->t[i].tid))
            return i;
    }
    return -1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
pushq $-0x1
popq %rbx
testq %rdi, %rdi
je 0x2bbb0
movq %rdi, %r14
callq 0x4400
movq %rax, %r15
movl 0x18(%r14), %r13d
xorl %r12d, %r12d
testl %r13d, %r13d
cmovlel %r12d, %r13d
pushq $0x10
popq %rbp
cmpq %r12, %r13
je 0x2bbb0
movq 0x20(%r14), %rax
movq (%rax,%rbp), %rsi
movq %r15, %rdi
callq 0x48d0
testl %eax, %eax
jne 0x2bbad
incq %r12
addq $0x48, %rbp
jmp 0x2bb8b
movl %r12d, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/thread_pool.c
// Function: hts_tpool_next_result
hts_tpool_result *hts_tpool_next_result(hts_tpool_process *q) {
    hts_tpool_result *r;

    DBG_OUT(stderr, "Requesting next result on queue %p\n", q);

    pthread_mutex_lock(&q->p->pool_m);
    r = hts_tpool_next_result_locked(q);
    pthread_mutex_unlock(&q->p->pool_m);

    DBG_OUT(stderr, "(q=%p) Found %p\n", q, r);

    return r;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rdi
addq $0x38, %rdi
callq 0x4750
movq %rbx, %rdi
callq 0x2bbf6
movq %rax, %r14
movq (%rbx), %rdi
addq $0x38, %rdi
callq 0x4340
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq