LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/hts.c
// Function: hts_idx_save
int hts_idx_save(const hts_idx_t *idx, const char *fn, int fmt)
{
    int ret, save;
    if (idx == NULL || fn == NULL) { errno = EINVAL; return -1; }
    char *fnidx = (char*)calloc(1, strlen(fn) + 5);
    if (fnidx == NULL) return -1;

    strcpy(fnidx, fn);
    switch (fmt) {
    case HTS_FMT_BAI: strcat(fnidx, ".bai"); break;
    case HTS_FMT_CSI: strcat(fnidx, ".csi"); break;
    case HTS_FMT_TBI: strcat(fnidx, ".tbi"); break;
    default: abort();
    }

    ret = hts_idx_save_as(idx, fn, fnidx, fmt);
    save = errno;
    free(fnidx);
    errno = save;
    return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
testq %rdi, %rdi
setne %al
testq %rsi, %rsi
setne %cl
testb %cl, %al
jne 0x17410
callq 0x4050
movl $0x16, (%rax)
jmp 0x17461
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
movq %rsi, %rdi
callq 0x41d0
leaq 0x5(%rax), %rsi
movl $0x1, %edi
callq 0x4300
testq %rax, %rax
je 0x17461
movq %rax, %r12
movq %rax, %rdi
movq %r14, %rsi
callq 0x4460
testl %ebx, %ebx
je 0x1747a
cmpl $0x2, %ebx
je 0x17468
cmpl $0x1, %ebx
jne 0x174c2
movq %r12, %rdi
callq 0x41d0
movl $0x6961622e, (%r12,%rax) # imm = 0x6961622E
jmp 0x1748a
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x174b9
movq %r12, %rdi
callq 0x41d0
movl $0x6962742e, (%r12,%rax) # imm = 0x6962742E
jmp 0x1748a
movq %r12, %rdi
callq 0x41d0
movl $0x6973632e, (%r12,%rax) # imm = 0x6973632E
movb $0x0, 0x4(%r12,%rax)
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rdx
movl %ebx, %ecx
callq 0x174c7
movl %eax, %ebx
callq 0x4050
movq %rax, %r14
movl (%rax), %ebp
movq %r12, %rdi
callq 0x45c0
movl %ebp, (%r14)
movl %ebx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
callq 0x4270
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/hts.c
// Function: hts_idx_save_as
int hts_idx_save_as(const hts_idx_t *idx, const char *fn, const char *fnidx, int fmt)
{
    BGZF *fp;

    if (fnidx == NULL)
        return hts_idx_save(idx, fn, fmt);

    fp = bgzf_open(fnidx, (fmt == HTS_FMT_BAI)? "wu" : "w");
    if (fp == NULL) return -1;

    if (hts_idx_write_out(idx, fp, fmt) < 0) {
        int save_errno = errno;
        bgzf_close(fp);
        errno = save_errno;
        return -1;
    }

    return bgzf_close(fp);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %ecx, %ebx
movq %rdi, %r15
testq %rdx, %rdx
je 0x17520
cmpl $0x1, %ebx
leaq 0x7f054(%rip), %rax     # 0x96536
leaq 0x832f8(%rip), %rsi     # 0x9a7e1
cmoveq %rax, %rsi
movq %rdx, %rdi
callq 0xa4a5
testq %rax, %rax
je 0x17548
movq %rax, %r14
movq %r15, %rdi
movq %rax, %rsi
movl %ebx, %edx
callq 0x17558
testl %eax, %eax
js 0x17534
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xd4a4
movq %r15, %rdi
movl %ebx, %edx
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x173eb
callq 0x4050
movq %rax, %rbx
movl (%rax), %ebp
movq %r14, %rdi
callq 0xd4a4
movl %ebp, (%rbx)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/hts.c
// Function: hts_idx_save_but_not_close
int hts_idx_save_but_not_close(hts_idx_t *idx, const char *fnidx, int fmt)
{
    idx->otf_fp = bgzf_open(fnidx, (fmt == HTS_FMT_BAI)? "wu" : "w");
    if (idx->otf_fp == NULL) return -1;

    if (hts_idx_write_out(idx, idx->otf_fp, fmt) < 0) {
        int save_errno = errno;
        bgzf_close(idx->otf_fp);
        idx->otf_fp = NULL;
        errno = save_errno;
        return -1;
    }

    return bgzf_flush(idx->otf_fp);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ebp
movq %rsi, %rax
movq %rdi, %rbx
cmpl $0x1, %edx
leaq 0x7eb92(%rip), %rcx     # 0x96536
leaq 0x82e36(%rip), %rsi     # 0x9a7e1
cmoveq %rcx, %rsi
movq %rax, %rdi
callq 0xa4a5
movq %rax, 0x98(%rbx)
testq %rax, %rax
je 0x17a08
movq %rbx, %rdi
movq %rax, %rsi
movl %ebp, %edx
callq 0x17558
testl %eax, %eax
js 0x179e4
movq 0x98(%rbx), %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0xcc29
callq 0x4050
movq %rax, %r14
movl (%rax), %ebp
movq 0x98(%rbx), %rdi
callq 0xd4a4
movq $0x0, 0x98(%rbx)
movl %ebp, (%r14)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/hts.c
// Function: hts_idx_set_meta
int hts_idx_set_meta(hts_idx_t *idx, uint32_t l_meta, uint8_t *meta,
                      int is_copy)
{
    uint8_t *new_meta = meta;
    if (is_copy) {
        size_t l = l_meta;
        if (l > SIZE_MAX - 1) {
            errno = ENOMEM;
            return -1;
        }
        new_meta = malloc(l + 1);
        if (!new_meta) return -1;
        memcpy(new_meta, meta, l);
        // Prevent possible strlen past the end in tbx_index_load2
        new_meta[l] = '\0';
    }
    if (idx->meta) free(idx->meta);
    idx->l_meta = l_meta;
    idx->meta = new_meta;
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %r14
movl %esi, %ebp
movq %rdi, %rbx
testl %ecx, %ecx
je 0x17a5b
movl %ebp, %r12d
leaq 0x1(%r12), %rdi
callq 0x4680
movq %rax, %r15
testq %rax, %rax
je 0x17a53
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x43c0
movb $0x0, (%r15,%r12)
movq %r15, %r14
jmp 0x17a56
xorl %r14d, %r14d
testq %r15, %r15
je 0x17a74
movq 0x38(%rbx), %rdi
testq %rdi, %rdi
je 0x17a69
callq 0x45c0
movl %ebp, 0x10(%rbx)
movq %r14, 0x38(%rbx)
xorl %eax, %eax
jmp 0x17a79
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/hts.c
// Function: hts_idx_seqnames
const char **hts_idx_seqnames(const hts_idx_t *idx, int *n, hts_id2name_f getid, void *hdr)
{
    if ( !idx || !idx->n )
    {
        *n = 0;
        return NULL;
    }

    int tid = 0, i;
    const char **names = (const char**) calloc(idx->n,sizeof(const char*));
    for (i=0; i<idx->n; i++)
    {
        bidx_t *bidx = idx->bidx[i];
        if ( !bidx ) continue;
        names[tid++] = getid(hdr,i);
    }
    *n = tid;
    return names;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbp
testq %rdi, %rdi
je 0x17b01
movq %rdi, %r12
movslq 0x14(%rdi), %rdi
xorl %ebx, %ebx
testq %rdi, %rdi
je 0x17b03
movq %rcx, %r14
movq %rdx, %r15
movl $0x8, %esi
callq 0x4300
movq %rax, %r13
cmpl $0x0, 0x14(%r12)
jle 0x17b06
movq %rbp, (%rsp)
xorl %ebp, %ebp
xorl %ebx, %ebx
movq 0x28(%r12), %rax
cmpq $0x0, (%rax,%rbp,8)
je 0x17aee
movq %r14, %rdi
movl %ebp, %esi
callq *%r15
movslq %ebx, %rcx
incl %ebx
movq %rax, (%r13,%rcx,8)
incq %rbp
movslq 0x14(%r12), %rax
cmpq %rax, %rbp
jl 0x17ad0
movq (%rsp), %rbp
jmp 0x17b06
xorl %ebx, %ebx
xorl %r13d, %r13d
movl %ebx, (%rbp)
movq %r13, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/hts.c
// Function: hts_idx_get_stat
int hts_idx_get_stat(const hts_idx_t* idx, int tid, uint64_t* mapped, uint64_t* unmapped)
{
    if (!idx) return -1;
    if ( idx->fmt == HTS_FMT_CRAI ) {
        *mapped = 0; *unmapped = 0;
        return -1;
    }

    bidx_t *h = idx->bidx[tid];
    if (!h) return -1;
    khint_t k = kh_get(bin, h, META_BIN(idx));
    if (k != kh_end(h)) {
        *mapped = kh_val(h, k).list[1].u;
        *unmapped = kh_val(h, k).list[1].v;
        return 0;
    } else {
        *mapped = 0; *unmapped = 0;
        return -1;
    }
}

// Assembly:
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testq %rdi, %rdi
je 0x17bec
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rcx, %r8
cmpl $0x3, (%rdi)
je 0x17bd3
movq 0x28(%rdi), %rcx
movslq %esi, %rsi
movq (%rcx,%rsi,8), %rsi
testq %rsi, %rsi
je 0x17be4
movl (%rsi), %eax
testl %eax, %eax
je 0x17bcd
movl 0xc(%rdi), %r9d
incl %r9d
leal -0x1(%rax), %r10d
movl %r10d, %r11d
andl %r9d, %r11d
movq 0x10(%rsi), %rbx
movl $0x1, %ebp
movl %r11d, %edi
movl %edi, %ecx
shrl $0x4, %ecx
movl (%rbx,%rcx,4), %r14d
leal (%rdi,%rdi), %ecx
andl $0x1e, %ecx
movl %r14d, %r15d
shrl %cl, %r15d
testb $0x2, %r15b
jne 0x17bc1
testb $0x1, %r15b
jne 0x17bb1
movq 0x18(%rsi), %r15
movl %edi, %r12d
cmpl %r9d, (%r15,%r12,4)
je 0x17bc1
addl %ebp, %edi
andl %r10d, %edi
incl %ebp
cmpl %r11d, %edi
jne 0x17b83
movl %eax, %edi
jmp 0x17bcf
shrl %cl, %r14d
testb $0x3, %r14b
cmovnel %eax, %edi
jmp 0x17bcf
xorl %edi, %edi
cmpl %eax, %edi
jne 0x17bed
movq $0x0, (%rdx)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
xorl %ecx, %ecx
movq %rcx, (%r8)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0x20(%rsi), %rax
movl %edi, %ecx
leaq (%rcx,%rcx,2), %rcx
movq 0x10(%rax,%rcx,8), %rax
movq 0x10(%rax), %rcx
movq %rcx, (%rdx)
movq 0x18(%rax), %rcx
xorl %eax, %eax
jmp 0x17be1
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/hts.c
// Function: hts_itr_destroy
void hts_itr_destroy(hts_itr_t *iter)
{
    if (iter) {
        if (iter->multi) {
            hts_reglist_free(iter->reg_list, iter->n_reg);
        } else {
            free(iter->bins.a);
        }

        if (iter->off)
            free(iter->off);
        free(iter);
    }
}

// Assembly:
testq %rdi, %rdi
je 0x18a6f
pushq %rbx
movq %rdi, %rbx
testb $0x10, (%rdi)
jne 0x18a70
movq 0x88(%rbx), %rdi
callq 0x45c0
jmp 0x18a7c
retq
movq 0x28(%rbx), %rdi
movl 0x10(%rbx), %esi
callq 0x2272c
movq 0x60(%rbx), %rdi
testq %rdi, %rdi
je 0x18a8a
callq 0x45c0
movq %rbx, %rdi
popq %rbx
jmp 0x45c0
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/hts.c
// Function: hts_parse_reg64
const char *hts_parse_reg64(const char *s, hts_pos_t *beg, hts_pos_t *end)
{
    char *hyphen;
    const char *colon = strrchr(s, ':');
    if (colon == NULL) {
        *beg = 0; *end = HTS_POS_MAX;
        return s + strlen(s);
    }

    *beg = hts_parse_decimal(colon+1, &hyphen, HTS_PARSE_THOUSANDS_SEP) - 1;
    if (*beg < 0) *beg = 0;

    if (*hyphen == '\0') *end = HTS_POS_MAX;
    else if (*hyphen == '-') *end = hts_parse_decimal(hyphen+1, NULL, HTS_PARSE_THOUSANDS_SEP);
    else return NULL;

    if (*beg >= *end) return NULL;
    return colon;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r13
movabsq $0x7fffffff7fffffff, %r12 # imm = 0x7FFFFFFF7FFFFFFF
movl $0x3a, %esi
callq 0x4530
testq %rax, %rax
je 0x1a85e
movq %rax, %r15
leaq 0x1(%rax), %rdi
leaq 0x8(%rsp), %r13
movq %r13, %rsi
movl $0x1, %edx
callq 0x19e86
movq %rax, %rcx
leaq -0x1(%rax), %rdx
xorl %eax, %eax
testq %rcx, %rcx
cmovleq %rax, %rdx
movq %rdx, (%rbx)
movq (%r13), %rdi
movzbl (%rdi), %ecx
testl %ecx, %ecx
je 0x1a850
cmpl $0x2d, %ecx
jne 0x1a873
incq %rdi
xorl %esi, %esi
movl $0x1, %edx
callq 0x19e86
movq %rax, %r12
movq %r12, (%r14)
xorl %eax, %eax
cmpq %r12, (%rbx)
cmovlq %r15, %rax
jmp 0x1a873
movq $0x0, (%rbx)
movq %r12, (%r14)
movq %r13, %rdi
callq 0x41d0
addq %r13, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/hts.c
// Function: hts_parse_reg
const char *hts_parse_reg(const char *s, int *beg, int *end)
{
    hts_pos_t beg64 = 0, end64 = 0;
    const char *colon = hts_parse_reg64(s, &beg64, &end64);
    if (beg64 > INT_MAX) {
        hts_log_error("Position %"PRId64" too large", beg64);
        return NULL;
    }
    if (end64 > INT_MAX) {
        if (end64 == HTS_POS_MAX) {
            end64 = INT_MAX;
        } else {
            hts_log_error("Position %"PRId64" too large", end64);
            return NULL;
        }
    }
    *beg = beg64;
    *end = end64;
    return colon;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r14
movq %rsi, %r15
xorl %eax, %eax
leaq 0x10(%rsp), %r12
movq %rax, (%r12)
leaq 0x8(%rsp), %rdx
movq %rax, (%rdx)
movq %r12, %rsi
callq 0x1a7d3
movq (%r12), %rcx
movl $0x80000000, %edx       # imm = 0x80000000
cmpq %rdx, %rcx
jl 0x1a8d9
leaq 0x7ee30(%rip), %rsi     # 0x996f2
leaq 0x7ee37(%rip), %rdx     # 0x99700
xorl %ebx, %ebx
movl $0x1, %edi
xorl %eax, %eax
callq 0x14378
jmp 0x1a908
movq %rax, %rbx
movq 0x8(%rsp), %rax
cmpq %rdx, %rax
jl 0x1a8fe
movabsq $0x7fffffff7fffffff, %rdx # imm = 0x7FFFFFFF7FFFFFFF
cmpq %rdx, %rax
jne 0x1a917
movq $0x7fffffff, 0x8(%rsp)  # imm = 0x7FFFFFFF
movl %ecx, (%r15)
movl 0x8(%rsp), %eax
movl %eax, (%r14)
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x7edd4(%rip), %rsi     # 0x996f2
leaq 0x7eddb(%rip), %rdx     # 0x99700
xorl %ebx, %ebx
movl $0x1, %edi
movq %rax, %rcx
jmp 0x1a8d0
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/hts.c
// Function: hts_itr_querys
hts_itr_t *hts_itr_querys(const hts_idx_t *idx, const char *reg, hts_name2id_f getid, void *hdr, hts_itr_query_func *itr_query, hts_readrec_func *readrec)
{
    int tid;
    hts_pos_t beg, end;

    if (strcmp(reg, ".") == 0)
        return itr_query(idx, HTS_IDX_START, 0, 0, readrec);
    else if (strcmp(reg, "*") == 0)
        return itr_query(idx, HTS_IDX_NOCOOR, 0, 0, readrec);

    if (!hts_parse_region(reg, &tid, &beg, &end, getid, hdr, HTS_PARSE_THOUSANDS_SEP))
        return NULL;

    return itr_query(idx, tid, beg, end, readrec);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r9, %rbx
movq %r8, %rbp
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %r14
leaq 0x7d704(%rip), %rsi     # 0x9805c
movq %r13, %rdi
callq 0x46c0
testl %eax, %eax
je 0x1a9b8
leaq 0x80e25(%rip), %rsi     # 0x9b790
movq %r13, %rdi
callq 0x46c0
testl %eax, %eax
je 0x1a9c2
movl $0x1, (%rsp)
leaq 0x14(%rsp), %rsi
leaq 0x20(%rsp), %rdx
leaq 0x18(%rsp), %rcx
movq %r13, %rdi
movq %r12, %r8
movq %r15, %r9
callq 0x1a16d
testq %rax, %rax
je 0x1a9e4
movl 0x14(%rsp), %esi
movq 0x20(%rsp), %rdx
movq 0x18(%rsp), %rcx
movq %r14, %rdi
movq %rbx, %r8
callq *%rbp
jmp 0x1a9e6
movq %r14, %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
jmp 0x1a9ca
movq %r14, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
xorl %edx, %edx
xorl %ecx, %ecx
movq %rbx, %r8
movq %rbp, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmpq *%rax
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/hts.c
// Function: compare_regions
static int compare_regions(const void *r1, const void *r2) {
    hts_reglist_t *reg1 = (hts_reglist_t *)r1;
    hts_reglist_t *reg2 = (hts_reglist_t *)r2;

    if (reg1->tid < 0 && reg2->tid >= 0)
        return 1;
    else if (reg1->tid >= 0 && reg2->tid < 0)
        return -1;
    else
        return reg1->tid - reg2->tid;
}

// Assembly:
movl 0x10(%rdi), %ecx
testl %ecx, %ecx
js 0x1aba8
testl %ecx, %ecx
js 0x1aba2
cmpl $0x0, 0x10(%rsi)
js 0x1abb4
subl 0x10(%rsi), %ecx
movl %ecx, %eax
retq
movl $0x1, %eax
cmpl $0x0, 0x10(%rsi)
js 0x1ab98
retq
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/hts.c
// Function: idx_filename
static char *idx_filename(const char *fn, const char *ext, int download) {
    int ret, local_len;
    char *fnidx;
    const char *local_fn = NULL;
    kstring_t buffer = KS_INITIALIZE;

    // First try : append `ext` to `fn`
    if (!(fnidx = haddextension(&buffer, fn, 0, ext))) {
        free(buffer.s);
        return NULL;
    }
    if ((ret = idx_test_and_fetch(fnidx, &local_fn, &local_len, download)) == -1) {
        // Second try : replace suffix of `fn` with `ext`
        if (!(fnidx = haddextension(&buffer, fn, 1, ext))) {
            free(buffer.s);
            return NULL;
        }
        ret = idx_test_and_fetch(fnidx, &local_fn, &local_len, download);
    }

    if (ret < 0) {
        free(buffer.s);
        return NULL;
    }

    memmove(fnidx, local_fn, local_len);
    fnidx[local_len] = 0;
    return fnidx;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %r15
xorl %eax, %eax
movq %rax, 0x8(%rsp)
leaq 0x10(%rsp), %rdi
movq %rax, 0x10(%rdi)
xorps %xmm0, %xmm0
movaps %xmm0, (%rdi)
movq %r15, %rsi
xorl %edx, %edx
movq %r14, %rcx
callq 0x103e6
testq %rax, %rax
je 0x1b7c5
movq %rax, %rbx
leaq 0x8(%rsp), %rsi
leaq 0x4(%rsp), %rdx
movq %rax, %rdi
movl %ebp, %ecx
callq 0x1bb3b
cmpl $-0x1, %eax
jne 0x1b7a5
leaq 0x10(%rsp), %rdi
movq %r15, %rsi
movl $0x1, %edx
movq %r14, %rcx
callq 0x103e6
testq %rax, %rax
je 0x1b7c5
movq %rax, %rbx
leaq 0x8(%rsp), %rsi
leaq 0x4(%rsp), %rdx
movq %rax, %rdi
movl %ebp, %ecx
callq 0x1bb3b
testl %eax, %eax
js 0x1b7c5
movq 0x8(%rsp), %rsi
movslq 0x4(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rdx
callq 0x4830
movb $0x0, (%rbx,%r14)
jmp 0x1b7d1
movq 0x20(%rsp), %rdi
callq 0x45c0
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/hts.c
// Function: hts_idx_load3
hts_idx_t *hts_idx_load3(const char *fn, const char *fnidx, int fmt, int flags)
{
    const char *local_fn = NULL;
    char *local_fnidx = NULL;
    int local_len;
    if (!fnidx)
        return idx_find_and_load(fn, fmt, flags);

    // Check that the index file is up to date, the main file might have changed
    struct stat stat_idx,stat_main;
    int remote_fn = hisremote(fn), remote_fnidx = hisremote(fnidx);
    if ( !remote_fn && !remote_fnidx
         && !stat(fn, &stat_main) && !stat(fnidx, &stat_idx) )
    {
        if ( stat_idx.st_mtime < stat_main.st_mtime )
            hts_log_warning("The index file is older than the data file: %s", fnidx);
    }

    if (remote_fnidx && (flags & HTS_IDX_SAVE_REMOTE))
    {
        int ret = idx_test_and_fetch(fnidx, &local_fn, &local_len, 1);
        if (ret == 0) {
            local_fnidx = strdup(local_fn);
            if (local_fnidx) {
                local_fnidx[local_len] = '\0';
                fnidx = local_fnidx;
            }
        }
    }

    hts_idx_t *idx = idx_read(fnidx);
    if (!idx && !(flags & HTS_IDX_SILENT_FAIL))
        hts_log_error("Could not load local index file '%s'%s%s", fnidx,
                      errno ? " : " : "", errno ? strerror(errno) : "");


    free(local_fnidx);

    return idx;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x130, %rsp            # imm = 0x130
movl %ecx, %ebp
movq %rdi, %r15
movq $0x0, 0x8(%rsp)
testq %rsi, %rsi
je 0x1baf8
movq %rsi, %rbx
movq %r15, %rdi
callq 0x103cd
movl %eax, %r12d
movq %rbx, %rdi
callq 0x103cd
movl %eax, %r14d
orl %eax, %r12d
jne 0x1ba4f
leaq 0x10(%rsp), %rsi
movq %r15, %rdi
callq 0x4420
testl %eax, %eax
jne 0x1ba4f
leaq 0xa0(%rsp), %rsi
movq %rbx, %rdi
callq 0x4420
testl %eax, %eax
jne 0x1ba4f
movq 0xf8(%rsp), %rax
cmpq 0x68(%rsp), %rax
jge 0x1ba4f
leaq 0x7deae(%rip), %rsi     # 0x998e7
leaq 0x7deb5(%rip), %rdx     # 0x998f5
movl $0x3, %edi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x14378
testl %r14d, %r14d
sete %al
testb $0x1, %bpl
sete %cl
orb %al, %cl
jne 0x1ba7f
leaq 0x8(%rsp), %rsi
leaq 0x4(%rsp), %rdx
movq %rbx, %rdi
movl $0x1, %ecx
callq 0x1bb3b
testl %eax, %eax
je 0x1bb13
xorl %r14d, %r14d
movq %rbx, %rdi
callq 0x1c17e
movq %rax, %r15
testb $0x2, %bpl
jne 0x1badd
testq %r15, %r15
jne 0x1badd
callq 0x4050
movl (%rax), %edi
leaq 0x7d227(%rip), %r9      # 0x98ccd
leaq 0x7d3c8(%rip), %r12     # 0x98e75
testl %edi, %edi
cmoveq %r9, %r12
je 0x1babd
callq 0x4150
movq %rax, %r9
leaq 0x7de23(%rip), %rsi     # 0x998e7
leaq 0x7de59(%rip), %rdx     # 0x99924
movl $0x1, %edi
movq %rbx, %rcx
movq %r12, %r8
xorl %eax, %eax
callq 0x14378
movq %r14, %rdi
callq 0x45c0
movq %r15, %rax
addq $0x130, %rsp            # imm = 0x130
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %r15, %rdi
movl %edx, %esi
movl %ebp, %edx
addq $0x130, %rsp            # imm = 0x130
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x1b7ed
movq 0x8(%rsp), %rdi
callq 0x4930
testq %rax, %rax
je 0x1ba7f
movq %rax, %r14
movslq 0x4(%rsp), %rax
movb $0x0, (%r14,%rax)
movq %r14, %rbx
jmp 0x1ba82
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/hts.c
// Function: hts_realloc_or_die
HTSLIB_EXPORT
size_t hts_realloc_or_die(size_t n, size_t m, size_t m_sz, size_t size,
                          int clear, void **ptr, const char *func) {
    /* If new_m and size are both below this limit, multiplying them
       together can't overflow */
    const size_t safe = (size_t) 1 << (sizeof(size_t) * 4);
    void *new_ptr;
    size_t bytes, new_m;

    new_m = n;
    kroundup_size_t(new_m);

    bytes = size * new_m;

    /* Check for overflow.  Both ensure that new_m will fit in m (we make the
       pessimistic assumption that m is signed), and that bytes has not
       wrapped around. */
    if (new_m > (((size_t) 1 << (m_sz * 8 - 1)) - 1)
        || ((size > safe || new_m > safe)
            && bytes / new_m != size)) {
        errno = ENOMEM;
        goto die;
    }

    new_ptr = realloc(*ptr, bytes);
    if (new_ptr == NULL) goto die;

    if (clear) {
        if (new_m > m) {
            memset((char *) new_ptr + m * size, 0, (new_m - m) * size);
        }
    }

    *ptr = new_ptr;

    return new_m;

 die:
    hts_log_error("%s", strerror(errno));
    exit(1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %rbx
movl %r8d, %ebp
movq %rcx, %r15
movq %rdx, %rcx
movq %rsi, %r12
testq %rdi, %rdi
je 0x1c4ad
movq %rdi, %r14
leaq -0x1(%rdi), %rax
movq %rax, %rdx
shrq %rdx
orq %rax, %rdx
movq %rdx, %rax
shrq $0x2, %rax
orq %rdx, %rax
movq %rax, %rdx
shrq $0x4, %rdx
orq %rax, %rdx
movq %rdx, %rax
shrq $0x8, %rax
orq %rdx, %rax
movq %rax, %rdx
shrq $0x10, %rdx
orq %rax, %rdx
movq %rdx, %rax
shrq $0x20, %rax
orq %rdx, %rax
negq %r14
shrq $0x3f, %r14
addq %rax, %r14
jmp 0x1c4b0
xorl %r14d, %r14d
movq %r14, %rax
mulq %r15
seto %dl
shll $0x3, %ecx
decb %cl
movq %r14, %rsi
shrq %cl, %rsi
testq %rsi, %rsi
jne 0x1c533
movabsq $0x100000000, %rcx      # imm = 0x100000000
cmpq %rcx, %r15
seta %sil
cmpq %rcx, %r14
seta %cl
orb %sil, %cl
andb %dl, %cl
cmpb $0x1, %cl
je 0x1c533
movq (%rbx), %rdi
movq %rax, %rsi
callq 0x4840
testq %rax, %rax
je 0x1c53e
movq %rax, %r13
testl %ebp, %ebp
je 0x1c51e
movq %r14, %rdx
subq %r12, %rdx
jbe 0x1c51e
imulq %r15, %r12
movq %r13, %rdi
addq %r12, %rdi
imulq %r15, %rdx
xorl %esi, %esi
callq 0x4260
movq %r13, (%rbx)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x4050
movl $0xc, (%rax)
callq 0x4050
movl (%rax), %edi
callq 0x4150
leaq 0x7d3fc(%rip), %rsi     # 0x9994d
leaq 0x7ef6f(%rip), %rdx     # 0x9b4c7
movl $0x1, %edi
movq %rax, %rcx
xorl %eax, %eax
callq 0x14378
movl $0x1, %edi
callq 0x45e0
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/hts_expr.c
// Function: hts_filter_init
hts_filter_t *hts_filter_init(const char *str) {
    hts_filter_t *f = calloc(1, sizeof(*f));
    if (!f) return NULL;

    // Oversize to permit faster comparisons with memcmp over strcmp
    size_t len = strlen(str)+100;
    if (!(f->str = malloc(len))) {
        free(f);
        return NULL;
    }
    strcpy(f->str, str);
    return f;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movl $0x1, %edi
movl $0x298, %esi            # imm = 0x298
callq 0x4300
testq %rax, %rax
je 0x1d130
movq %rax, %rbx
movq %r14, %rdi
callq 0x41d0
leaq 0x64(%rax), %rdi
callq 0x4680
movq %rax, (%rbx)
testq %rax, %rax
je 0x1d128
movq %rax, %rdi
movq %r14, %rsi
callq 0x4460
jmp 0x1d132
movq %rbx, %rdi
callq 0x45c0
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/hts_expr.c
// Function: hts_filter_free
void hts_filter_free(hts_filter_t *filt) {
    if (!filt)
        return;

    int i;
    for (i = 0; i < filt->max_regex; i++)
        regfree(&filt->preg[i]);

    free(filt->str);
    free(filt);
}

// Assembly:
testq %rdi, %rdi
je 0x1d184
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
cmpl $0x0, 0x10(%rdi)
jle 0x1d16f
leaq 0x18(%rbx), %r14
xorl %r15d, %r15d
movq %r14, %rdi
callq 0x44c0
incq %r15
movslq 0x10(%rbx), %rax
addq $0x40, %r14
cmpq %rax, %r15
jl 0x1d157
movq (%rbx), %rdi
callq 0x45c0
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x45c0
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/hts_expr.c
// Function: hts_filter_eval
int hts_filter_eval(hts_filter_t *filt,
                    void *data, hts_expr_sym_func *fn,
                    hts_expr_val_t *res) {
    if (res->s.l != 0 || res->s.m != 0 || res->s.s != NULL) {
        // As *res is cleared below, it's not safe to call this function
        // with res->s.s set, as memory would be leaked.  It's also not
        // possible to know is res was initialised correctly, so in
        // either case we fail.
        hts_log_error("Results structure must be cleared before calling this function");
        return -1;
    }

    memset(res, 0, sizeof(*res));

    return hts_filter_eval_(filt, data, fn, res);
}

// Assembly:
cmpq $0x0, 0x8(%rcx)
jne 0x1d19a
cmpq $0x0, 0x10(%rcx)
jne 0x1d19a
cmpq $0x0, 0x18(%rcx)
je 0x1d1bc
pushq %rax
leaq 0x7cb2e(%rip), %rsi     # 0x99cd0
leaq 0x7cb37(%rip), %rdx     # 0x99ce0
movl $0x1, %edi
xorl %eax, %eax
callq 0x14378
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
popq %rcx
retq
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rcx)
movups %xmm0, (%rcx)
movq $0x0, 0x20(%rcx)
jmp 0x1d1d0
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/hts_expr.c
// Function: hts_filter_eval_
static int hts_filter_eval_(hts_filter_t *filt,
                            void *data, hts_expr_sym_func *fn,
                            hts_expr_val_t *res) {
    char *end = NULL;

    filt->curr_regex = 0;
    if (expression(filt, data, fn, filt->str, &end, res))
        return -1;

    if (end && *ws(end)) {
        fprintf(stderr, "Unable to parse expression at %s\n", filt->str);
        return -1;
    }

    // Strings evaluate to true.  An empty string is also true, but an
    // absent (null) string is false, unless overriden by is_true.  An
    // empty string has kstring length of zero, but a pointer as it's
    // nul-terminated.
    if (res->is_str) {
        res->is_true |= res->s.s != NULL;
        res->d = res->is_true;
    } else if (hts_expr_val_exists(res)) {
        res->is_true |= res->d != 0;
    }

    return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rcx, %rbx
movq %rdi, %r14
leaq 0x8(%rsp), %r8
movq $0x0, (%r8)
movl $0x0, 0xc(%rdi)
movq (%rdi), %rcx
movq %rbx, %r9
callq 0x1d2c9
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testl %eax, %eax
jne 0x1d269
movq 0x8(%rsp), %rax
testq %rax, %rax
je 0x1d225
movzbl (%rax), %ecx
cmpl $0x9, %ecx
je 0x1d21c
cmpl $0x20, %ecx
jne 0x1d221
incq %rax
jmp 0x1d20f
testl %ecx, %ecx
jne 0x1d274
cmpb $0x0, (%rbx)
je 0x1d248
cmpq $0x0, 0x18(%rbx)
setne %al
orb 0x1(%rbx), %al
movb %al, 0x1(%rbx)
movsbl %al, %eax
cvtsi2sd %eax, %xmm0
movsd %xmm0, 0x20(%rbx)
xorl %ebp, %ebp
jmp 0x1d269
movsd 0x20(%rbx), %xmm0
xorl %ebp, %ebp
ucomisd %xmm0, %xmm0
jp 0x1d269
xorpd %xmm0, %xmm0
ucomisd 0x20(%rbx), %xmm0
setp %al
setne %cl
orb %al, %cl
orb %cl, 0x1(%rbx)
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq %r14, %rdi
callq 0x49e0
jmp 0x1d269
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/hts_expr.c
// Function: bitxor_expr
static int bitxor_expr(hts_filter_t *filt, void *data, hts_expr_sym_func *fn,
                       char *str, char **end, hts_expr_val_t *res) {
    if (bitand_expr(filt, data, fn, str, end, res)) return -1;

    hts_expr_val_t val = HTS_EXPR_VAL_INIT;
    int undef = 0;
    for (;;) {
        str = ws(*end);
        if (*str == '^') {
            if (bitand_expr(filt, data, fn, str+1, end, &val)) return -1;
            if (!hts_expr_val_exists(&val) || !hts_expr_val_exists(res)) {
                undef = 1;
            } else if (res->is_str || val.is_str) {
                hts_expr_val_free(&val);
                return -1;
            } else {
                res->is_true =
                    (res->d = ((int64_t)res->d ^ (int64_t)val.d)) != 0;
            }
        } else {
            break;
        }
    }
    hts_expr_val_free(&val);
    if (undef)
        hts_expr_val_undef(res);

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %r9, %rbx
movq %r8, %r14
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r13
callq 0x1e419
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
testl %eax, %eax
jne 0x1e3e4
xorpd %xmm0, %xmm0
leaq 0x10(%rsp), %r9
movapd %xmm0, 0x10(%r9)
movapd %xmm0, (%r9)
movq $0x0, 0x20(%r9)
movb $0x1, %cl
movl %ecx, %ebp
movq (%r14), %rcx
incq %rcx
movzbl -0x1(%rcx), %eax
cmpl $0x9, %eax
je 0x1e2a9
cmpl $0x20, %eax
je 0x1e2a9
cmpl $0x5e, %eax
jne 0x1e3a4
movb %bpl, 0xf(%rsp)
movq %rbx, %rbp
movq %r14, %r8
movq %r13, %rbx
movq %r13, %rdi
movq %r12, %r13
movq %r12, %rsi
movq %r15, %r12
movq %r15, %rdx
movq %r9, %r15
callq 0x1e419
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
testl %eax, %eax
jne 0x1e3e4
movzbl 0x10(%rsp), %eax
testl %eax, %eax
movq %r15, %r9
movq %r12, %r15
movq %r13, %r12
movq %rbx, %r13
movq %rbp, %rbx
movb 0xf(%rsp), %bpl
je 0x1e32a
cmpl $0x1, %eax
jne 0x1e323
cmpq $0x0, 0x28(%rsp)
je 0x1e39d
testb %al, %al
je 0x1e32a
testq %rbx, %rbx
jne 0x1e345
jmp 0x1e39d
xorl %ecx, %ecx
testq %rbx, %rbx
je 0x1e2a4
movsd 0x30(%rsp), %xmm0
ucomisd %xmm0, %xmm0
jp 0x1e2a4
movzbl (%rbx), %ecx
testl %ecx, %ecx
je 0x1e35c
cmpl $0x1, %ecx
jne 0x1e367
cmpq $0x0, 0x18(%rbx)
je 0x1e39d
testb %cl, %cl
jne 0x1e367
movsd 0x20(%rbx), %xmm0
ucomisd %xmm0, %xmm0
jp 0x1e39d
movb (%rbx), %cl
orb %al, %cl
jne 0x1e3f5
cvttsd2si 0x20(%rbx), %rax
cvttsd2si 0x30(%rsp), %rcx
movq %rcx, %rdx
xorq %rax, %rdx
xorps %xmm0, %xmm0
cvtsi2sd %rdx, %xmm0
movsd %xmm0, 0x20(%rbx)
cmpq %rcx, %rax
setne 0x1(%rbx)
jmp 0x1e2a6
xorl %ecx, %ecx
jmp 0x1e2a4
movq 0x28(%rsp), %rdi
callq 0x45c0
xorpd %xmm0, %xmm0
movupd %xmm0, 0x18(%rsp)
movq $0x0, 0x28(%rsp)
xorl %ecx, %ecx
testb $0x1, %bpl
jne 0x1e3e4
movq $0x0, 0x8(%rbx)
movw $0x0, (%rbx)
movabsq $0x7ff8000000000000, %rax # imm = 0x7FF8000000000000
movq %rax, 0x20(%rbx)
movl %ecx, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x28(%rsp), %rdi
callq 0x45c0
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
xorpd %xmm0, %xmm0
movupd %xmm0, 0x18(%rsp)
movq $0x0, 0x28(%rsp)
jmp 0x1e3e4
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/hts_expr.c
// Function: expr_func_avg
static int expr_func_avg(hts_expr_val_t *res) {
    if (!res->is_str)
        return -1;

    size_t l = res->s.l;
    double v = 0;
    const uint8_t *x = (uint8_t *)res->s.s;
    for (l = 0; l < res->s.l; l++)
        v += x[l];
    if (l)
        v /= l;

    res->is_str = 0;
    res->d = v;

    return 0;
}

// Assembly:
cmpb $0x0, (%rdi)
je 0x1f7dd
movq 0x8(%rdi), %rax
testq %rax, %rax
je 0x1f7e3
movq 0x18(%rdi), %rcx
xorpd %xmm0, %xmm0
xorl %edx, %edx
movzbl (%rcx,%rdx), %esi
xorps %xmm1, %xmm1
cvtsi2sd %esi, %xmm1
addsd %xmm1, %xmm0
incq %rdx
cmpq %rdx, %rax
jne 0x1f7c4
jmp 0x1f7e9
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
retq
xorpd %xmm0, %xmm0
xorl %eax, %eax
testq %rax, %rax
je 0x1f813
movq %rax, %xmm1
punpckldq 0x78f05(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x78f0d(%rip), %xmm1    # 0x98710
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
addsd %xmm1, %xmm2
divsd %xmm2, %xmm0
movb $0x0, (%rdi)
movsd %xmm0, 0x20(%rdi)
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/hts_expr.c
// Function: expr_func_min
static int expr_func_min(hts_expr_val_t *res) {
    if (!res->is_str)
        return -1;

    size_t l = res->s.l;
    int v = INT_MAX;
    const uint8_t *x = (uint8_t *)res->s.s;
    for (l = 0; l < res->s.l; l++)
        if (v > x[l])
            v = x[l];

    res->is_str = 0;
    res->d = v == INT_MAX ? NAN : v;

    return 0;
}

// Assembly:
cmpb $0x0, (%rdi)
je 0x1f84d
movq 0x8(%rdi), %rcx
testq %rcx, %rcx
je 0x1f853
movq 0x18(%rdi), %rdx
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
xorl %esi, %esi
movzbl (%rdx,%rsi), %r8d
cmpl %r8d, %eax
cmovgel %r8d, %eax
incq %rsi
cmpq %rsi, %rcx
jne 0x1f837
jmp 0x1f858
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
retq
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movb $0x0, (%rdi)
cmpl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
je 0x1f86c
cvtsi2ss %eax, %xmm0
cvtss2sd %xmm0, %xmm0
jmp 0x1f874
movsd 0x7a36c(%rip), %xmm0    # 0x99be0
movsd %xmm0, 0x20(%rdi)
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/hts_expr.c
// Function: expr_func_max
static int expr_func_max(hts_expr_val_t *res) {
    if (!res->is_str)
        return -1;

    size_t l = res->s.l;
    int v = INT_MIN;
    const uint8_t *x = (uint8_t *)res->s.s;
    for (l = 0; l < res->s.l; l++)
        if (v < x[l])
            v = x[l];

    res->is_str = 0;
    res->d = v == INT_MIN ? NAN : v;

    return 0;
}

// Assembly:
cmpb $0x0, (%rdi)
je 0x1f8ab
movq 0x8(%rdi), %rcx
testq %rcx, %rcx
je 0x1f8b1
movq 0x18(%rdi), %rdx
movl $0x80000000, %eax       # imm = 0x80000000
xorl %esi, %esi
movzbl (%rdx,%rsi), %r8d
cmpl %r8d, %eax
cmovlel %r8d, %eax
incq %rsi
cmpq %rsi, %rcx
jne 0x1f895
jmp 0x1f8b6
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
retq
movl $0x80000000, %eax       # imm = 0x80000000
movb $0x0, (%rdi)
movl %eax, %ecx
negl %ecx
jo 0x1f8c9
cvtsi2ss %eax, %xmm0
cvtss2sd %xmm0, %xmm0
jmp 0x1f8d1
movsd 0x7a30f(%rip), %xmm0    # 0x99be0
movsd %xmm0, 0x20(%rdi)
xorl %eax, %eax
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/multipart.c
// Function: free_part
static void free_part(hfile_part *p)
{
    free(p->url);
    if (p->headers) {
        char **hdr;
        for (hdr = p->headers; *hdr; hdr++) free(*hdr);
        free(p->headers);
    }

    p->url = NULL;
    p->headers = NULL;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rdi
callq 0x45c0
movq 0x8(%rbx), %r14
testq %r14, %r14
je 0x1ff92
movq (%r14), %rdi
testq %rdi, %rdi
je 0x1ff89
addq $0x8, %r14
callq 0x45c0
movq (%r14), %rdi
addq $0x8, %r14
testq %rdi, %rdi
jne 0x1ff78
movq 0x8(%rbx), %rdi
callq 0x45c0
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/regidx.c
// Function: regidx_insert_list
int regidx_insert_list(regidx_t *idx, char *line, char delim)
{
    kstring_t tmp = KS_INITIALIZE;
    char *ss = line;
    while ( *ss )
    {
        char *se = ss;
        while ( *se && *se!=delim ) se++;
        kputsn(ss, se-ss, ks_clear(&tmp));
        if ( regidx_insert(idx,tmp.s) < 0 )
        {
            ks_free(&tmp);
            return -1;
        }
        if ( !*se ) break;
        ss = se+1;
    }
    ks_free(&tmp);
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, 0x10(%rsp)
xorl %r12d, %r12d
xorl %ebp, %ebp
cmpb $0x0, (%r14)
je 0x2040f
xorl %r15d, %r15d
movb (%r14,%r15), %al
incq %r15
testb %al, %al
je 0x2034c
cmpb %bl, %al
jne 0x2033d
movq %r15, %rax
incq %rax
jne 0x20366
movq %r12, 0x8(%rsp)
callq 0x4050
movl $0x4b, (%rax)
jmp 0x203c2
cmpq %rax, %r12
jae 0x203a2
movq %r12, 0x8(%rsp)
movq %rax, %rcx
shrq $0x3e, %rcx
shrq %rax
testq %rcx, %rcx
movl $0x0, %ecx
cmoveq %rax, %rcx
leaq (%rcx,%r15), %r12
incq %r12
movq %rbp, %rdi
movq %r12, %rsi
callq 0x4840
movq %rax, %r13
testq %rax, %rax
jne 0x203a5
jmp 0x203c2
movq %rbp, %r13
leaq -0x1(%r15), %rdx
movq %r13, %rdi
movq %r14, %rsi
callq 0x43c0
movb $0x0, -0x1(%r13,%r15)
movq %r12, 0x8(%rsp)
movq %r13, %rbp
movq 0x10(%rsp), %rdi
movq %rbp, %rsi
callq 0x2042f
testl %eax, %eax
js 0x203f0
leaq (%r14,%r15), %rax
xorl %ecx, %ecx
cmpb $0x0, -0x1(%r14,%r15)
sete %cl
cmovneq %rax, %r14
leal (%rcx,%rcx,2), %eax
movq 0x8(%rsp), %r12
jmp 0x20402
movq %rbp, %rdi
callq 0x45c0
movl $0x1, %eax
xorl %r12d, %r12d
xorl %ebp, %ebp
testl %eax, %eax
je 0x20330
cmpl $0x3, %eax
jne 0x2041b
movq %rbp, %rdi
callq 0x45c0
xorl %eax, %eax
jmp 0x20420
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/regidx.c
// Function: regidx_insert
int regidx_insert(regidx_t *idx, char *line)
{
    if ( !line ) return 0;
    char *chr_from, *chr_to;
    hts_pos_t beg,end;
    int ret = idx->parse(line,&chr_from,&chr_to,&beg,&end,idx->payload,idx->usr);
    if ( ret==-2 ) return -1;   // error
    if ( ret==-1 ) return 0;    // skip the line
    return regidx_push(idx, chr_from,chr_to,beg,end,idx->payload);
}

// Assembly:
testq %rsi, %rsi
je 0x20473
pushq %rbx
subq $0x30, %rsp
movq %rdi, %rbx
movq 0x30(%rdi), %rax
movq 0x40(%rdi), %r9
movq %rax, (%rsp)
leaq 0x28(%rsp), %rax
leaq 0x20(%rsp), %rdx
leaq 0x18(%rsp), %rcx
leaq 0x10(%rsp), %r8
movq %rsi, %rdi
movq %rax, %rsi
callq *0x28(%rbx)
cmpl $-0x2, %eax
je 0x20476
cmpl $-0x1, %eax
jne 0x2047d
xorl %eax, %eax
jmp 0x2049d
xorl %eax, %eax
retq
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x2049d
movq 0x28(%rsp), %rsi
movq 0x20(%rsp), %rdx
movq 0x18(%rsp), %rcx
movq 0x10(%rsp), %r8
movq 0x40(%rbx), %r9
movq %rbx, %rdi
callq 0x204a3
addq $0x30, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/regidx.c
// Function: regidx_destroy
void regidx_destroy(regidx_t *idx)
{
    int i, j;
    if (!idx) return;
    for (i=0; i<idx->nseq; i++)
    {
        reglist_t *list = &idx->seq[i];
        if ( idx->free )
        {
            for (j=0; j<list->nreg; j++)
                idx->free((char *)list->dat + idx->payload_size*j);
        }
        free(list->dat);
        free(list->reg);
        free(list->idx);
    }
    free(idx->seq_names);
    free(idx->seq);
    free(idx->str.s);
    free(idx->payload);
    khash_str2int_destroy_free(idx->seq2regs);
    free(idx);
}

// Assembly:
testq %rdi, %rdi
je 0x20fb2
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpl $0x0, (%rdi)
jle 0x20f0e
xorl %r14d, %r14d
imulq $0x38, %r14, %r15
addq 0x8(%rbx), %r15
cmpq $0x0, 0x20(%rbx)
je 0x20ee9
cmpl $0x0, 0xc(%r15)
je 0x20ee9
xorl %r12d, %r12d
movslq 0x38(%rbx), %rdi
movslq %r12d, %r12
imulq %r12, %rdi
addq 0x20(%r15), %rdi
callq *0x20(%rbx)
incl %r12d
cmpl 0xc(%r15), %r12d
jb 0x20ece
movq 0x20(%r15), %rdi
callq 0x45c0
movq 0x18(%r15), %rdi
callq 0x45c0
movq (%r15), %rdi
callq 0x45c0
incq %r14
movslq (%rbx), %rax
cmpq %rax, %r14
jl 0x20eb5
movq 0x18(%rbx), %rdi
callq 0x45c0
movq 0x8(%rbx), %rdi
callq 0x45c0
movq 0x58(%rbx), %rdi
callq 0x45c0
movq 0x40(%rbx), %rdi
callq 0x45c0
movq 0x10(%rbx), %r14
testq %r14, %r14
je 0x20f9f
cmpl $0x0, (%r14)
je 0x20f7c
xorl %r15d, %r15d
xorl %r12d, %r12d
movq 0x10(%r14), %rax
movl %r12d, %ecx
shrl $0x4, %ecx
movl (%rax,%rcx,4), %eax
movl %r15d, %ecx
andb $0x1e, %cl
shrl %cl, %eax
testb $0x3, %al
jne 0x20f6d
movq 0x18(%r14), %rax
movq (%rax,%r12,8), %rdi
callq 0x45c0
incq %r12
movl (%r14), %eax
addl $0x2, %r15d
cmpq %rax, %r12
jb 0x20f47
movq 0x18(%r14), %rdi
callq 0x45c0
movq 0x10(%r14), %rdi
callq 0x45c0
movq 0x20(%r14), %rdi
callq 0x45c0
movq %r14, %rdi
callq 0x45c0
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x45c0
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/regidx.c
// Function: regidx_parse_bed
int regidx_parse_bed(const char *line, char **chr_beg, char **chr_end, hts_pos_t *beg, hts_pos_t *end, void *payload, void *usr)
{
    char *ss = (char*) line;
    while ( *ss && isspace_c(*ss) ) ss++;
    if ( !*ss ) return -1;      // skip blank lines
    if ( *ss=='#' ) return -1;  // skip comments

    char *se = ss;
    while ( *se && !isspace_c(*se) ) se++;

    *chr_beg = ss;
    *chr_end = se-1;

    if ( !*se )
    {
        // just the chromosome name
        *beg = 0;
        *end = MAX_COOR_0;
        return 0;
    }

    ss = se+1;
    *beg = hts_parse_decimal(ss, &se, 0);
    if ( ss==se ) { hts_log_error("Could not parse bed line: %s", line); return -2; }

    ss = se+1;
    *end = hts_parse_decimal(ss, &se, 0) - 1;
    if ( ss==se ) { hts_log_error("Could not parse bed line: %s", line); return -2; }

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movb (%rdi), %r15b
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testb %r15b, %r15b
je 0x21371
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %rbx
movq %rcx, 0x20(%rsp)
movq %r8, 0x18(%rsp)
callq 0x4510
movq (%rax), %rax
leaq 0x1(%rbx), %r14
movzbl %r15b, %ecx
testb $0x20, 0x1(%rax,%rcx,2)
je 0x21275
movb (%r14), %r15b
incq %r14
testb %r15b, %r15b
jne 0x2125a
jmp 0x21371
testb %r15b, %r15b
je 0x21371
cmpl $0x23, %ecx
je 0x21371
leaq -0x1(%r14), %rax
movq %rax, 0x8(%rsp)
movb (%rax), %bpl
movq %rax, %r15
testb %bpl, %bpl
je 0x212ce
movq %rax, 0x10(%rsp)
callq 0x4510
movq (%rax), %rcx
movzbl %bpl, %edx
testb $0x20, 0x1(%rcx,%rdx,2)
jne 0x212c3
movq %r14, 0x8(%rsp)
movb (%r14), %bpl
incq %r14
testb %bpl, %bpl
jne 0x212a5
decq %r14
movq %r14, %r15
movq 0x10(%rsp), %rax
movq %rax, (%r13)
leaq -0x1(%r15), %rax
movq %rax, (%r12)
cmpb $0x0, (%r15)
je 0x21351
incq %r15
leaq 0x8(%rsp), %r12
xorl %ebp, %ebp
movq %r15, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x19e86
movq 0x20(%rsp), %rcx
movq %rax, (%rcx)
movq (%r12), %r12
cmpq %r12, %r15
je 0x2132d
incq %r12
leaq 0x8(%rsp), %r14
movq %r12, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x19e86
decq %rax
movq 0x18(%rsp), %rcx
movq %rax, (%rcx)
cmpq (%r14), %r12
jne 0x21371
leaq 0x78bad(%rip), %rsi     # 0x99ee1
leaq 0x78bb7(%rip), %rdx     # 0x99ef2
movl $0x1, %edi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x14378
movl $0xfffffffe, %ebp       # imm = 0xFFFFFFFE
jmp 0x21371
movq 0x20(%rsp), %rax
movq $0x0, (%rax)
movabsq $0x800000000, %rax      # imm = 0x800000000
movq 0x18(%rsp), %rcx
movq %rax, (%rcx)
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_O1/samtools[P]htslib/regidx.c
// Function: regidx_parse_reg
int regidx_parse_reg(const char *line, char **chr_beg, char **chr_end, hts_pos_t *beg, hts_pos_t *end, void *payload, void *usr)
{
    char *ss = (char*) line;
    while ( *ss && isspace_c(*ss) ) ss++;
    if ( !*ss ) return -1;      // skip blank lines
    if ( *ss=='#' ) return -1;  // skip comments

    char *se = ss;
    while ( *se && *se!=':' ) se++;

    *chr_beg = ss;
    *chr_end = se-1;

    if ( !*se )
    {
        *beg = 0;
        *end = MAX_COOR_0;
        return 0;
    }

    ss = se+1;
    *beg = hts_parse_decimal(ss, &se, 0);
    if ( ss==se ) { hts_log_error("Could not parse reg line: %s", line); return -2; }
    if ( *beg==0 ) { hts_log_error("Could not parse reg line, expected 1-based coordinate: %s", line); return -2; }
    (*beg)--;

    if ( !se[0] || !se[1] )
        *end = se[0]=='-' ? MAX_COOR_0 : *beg;
    else
    {
        ss = se+1;
        *end = hts_parse_decimal(ss, &se, 0);
        if ( ss==se ) *end = *beg;
        else if ( *end==0 ) { hts_log_error("Could not parse reg line, expected 1-based coordinate: %s", line); return -2; }
        else (*end)--;
    }
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movb (%rdi), %r14b
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testb %r14b, %r14b
je 0x21ac5
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %rbx
movq %r8, 0x8(%rsp)
callq 0x4510
movq (%rax), %rcx
movq %rbx, %rax
movzbl %r14b, %edx
testb $0x20, 0x1(%rcx,%rdx,2)
je 0x219c9
movb 0x1(%rax), %r14b
incq %rax
testb %r14b, %r14b
jne 0x219ad
jmp 0x21ac5
testb %r14b, %r14b
je 0x21ac5
cmpl $0x23, %edx
je 0x21ac5
movq %rax, %rbp
movzbl (%rbp), %ecx
testl %ecx, %ecx
je 0x219f0
cmpl $0x3a, %ecx
je 0x219f0
incq %rbp
jmp 0x219de
movq %rbp, 0x10(%rsp)
movq %rax, (%r13)
leaq -0x1(%rbp), %rax
movq %rax, (%r12)
cmpb $0x0, (%rbp)
je 0x21a76
incq %rbp
leaq 0x10(%rsp), %r12
movq %rbp, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x19e86
movq %rax, (%r15)
movq (%r12), %r12
cmpq %r12, %rbp
je 0x21a93
testq %rax, %rax
je 0x21aa3
decq %rax
movq %rax, (%r15)
movb (%r12), %cl
testb %cl, %cl
je 0x21a87
cmpb $0x0, 0x1(%r12)
je 0x21ad6
incq %r12
leaq 0x10(%rsp), %r13
xorl %ebp, %ebp
movq %r12, %rdi
movq %r13, %rsi
xorl %edx, %edx
callq 0x19e86
movq 0x8(%rsp), %rcx
movq %rax, (%rcx)
cmpq (%r13), %r12
je 0x21add
testq %rax, %rax
je 0x21aa3
decq %rax
jmp 0x21a87
movq $0x0, (%r15)
movabsq $0x800000000, %rax      # imm = 0x800000000
movq 0x8(%rsp), %rcx
movq %rax, (%rcx)
xorl %ebp, %ebp
jmp 0x21ac5
leaq 0x784dd(%rip), %rsi     # 0x99f77
leaq 0x784e7(%rip), %rdx     # 0x99f88
jmp 0x21ab1
leaq 0x784cd(%rip), %rsi     # 0x99f77
leaq 0x784f4(%rip), %rdx     # 0x99fa5
movl $0x1, %edi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x14378
movl $0xfffffffe, %ebp       # imm = 0xFFFFFFFE
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpb $0x2d, %cl
je 0x21a7d
jmp 0x21a87
movq (%r15), %rax
movq %rax, (%rcx)
jmp 0x21ac5
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/regidx.c
// Function: regitr_init
regitr_t *regitr_init(regidx_t *regidx)
{
    regitr_t *regitr = (regitr_t*) calloc(1,sizeof(regitr_t));
    if (!regitr) return NULL;
    regitr->itr  = (itr_t_*) calloc(1,sizeof(itr_t_));
    if (!regitr->itr) {
        free(regitr);
        return NULL;
    }
    itr_t_ *itr = (itr_t_*) regitr->itr;
    itr->ridx = regidx;
    itr->list = NULL;
    return regitr;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movl $0x1, %edi
movl $0x28, %esi
callq 0x4300
testq %rax, %rax
je 0x21b31
movq %rax, %rbx
movl $0x1, %edi
movl $0x30, %esi
callq 0x4300
movq %rax, 0x20(%rbx)
testq %rax, %rax
je 0x21b29
movq %r14, 0x18(%rax)
movq $0x0, 0x20(%rax)
jmp 0x21b33
movq %rbx, %rdi
callq 0x45c0
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x21c06
cmpq $0x0, 0x18(%rdi)
je 0x21c06
movq 0x20(%rdi), %rcx
testq %rcx, %rcx
je 0x21c06
pushq %r15
pushq %r14
pushq %rbx
cmpl $0x0, 0x28(%rcx)
je 0x21bf2
movq 0x20(%rcx), %rdx
movl 0x10(%rcx), %esi
movl 0xc(%rdx), %r9d
cmpl %r9d, %esi
setb %r11b
jae 0x21c01
movslq %esi, %rbx
movq 0x18(%rdx), %r14
movq 0x8(%rcx), %r10
movq %rbx, %r8
shlq $0x20, %r8
shlq $0x4, %rbx
addq %r14, %rbx
addq $0x8, %rbx
movabsq $0x100000000, %r14      # imm = 0x100000000
cmpq %r10, -0x8(%rbx)
jg 0x21c01
movq (%rbx), %r15
cmpq (%rcx), %r15
jge 0x21c07
addq %r14, %r8
incl %esi
addq $0x10, %rbx
cmpl %esi, %r9d
seta %r11b
ja 0x21bd0
jmp 0x21c01
movl $0x1, 0x28(%rcx)
incl 0x10(%rcx)
movl $0x1, %eax
popq %rbx
popq %r14
popq %r15
retq
testb $0x1, %r11b
je 0x21c01
leal 0x1(%rsi), %eax
movl %eax, 0x10(%rcx)
movq 0x28(%rdx), %rax
movq %rax, 0x18(%rdi)
movq 0x18(%rdx), %rax
sarq $0x1c, %r8
movq (%rax,%r8), %r9
movq %r9, (%rdi)
movq 0x8(%rax,%r8), %rax
movq %rax, 0x8(%rdi)
movq 0x18(%rcx), %rax
movl 0x38(%rax), %ecx
movl $0x1, %eax
testl %ecx, %ecx
je 0x21c01
imull %esi, %ecx
movslq %ecx, %rcx
addq 0x20(%rdx), %rcx
movq %rcx, 0x10(%rdi)
jmp 0x21c01