LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/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
andq $0x0, (%r8)
andl $0x0, 0xc(%rdi)
movq (%rdi), %rcx
movq %rbx, %r9
callq 0x18e94
pushq $-0x1
popq %rbp
testl %eax, %eax
jne 0x18e05
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x18dc0
callq 0x191b7
cmpb $0x0, (%rax)
jne 0x18e10
cmpb $0x0, (%rbx)
je 0x18de3
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 0x18e05
movq %rbx, %rdi
callq 0x191cd
xorl %ebp, %ebp
testl %eax, %eax
je 0x18e05
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 0x851c1(%rip), %rax     # 0x9dfd8
movq (%rax), %rdi
movq (%r14), %rdx
leaq 0x5ff7b(%rip), %rsi     # 0x78d9f
xorl %eax, %eax
callq 0x4700
jmp 0x18e05
// File: /workspace/github_c_makefile_star2_O2/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 0x19b20
testl %eax, %eax
je 0x19a45
pushq $-0x1
popq %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorpd %xmm0, %xmm0
leaq 0x10(%rsp), %rbp
andq $0x0, 0x20(%rbp)
movapd %xmm0, 0x10(%rbp)
movapd %xmm0, (%rbp)
movb $0x1, %al
movl %eax, 0xc(%rsp)
movq (%r14), %rdi
callq 0x191b7
cmpb $0x5e, (%rax)
jne 0x19ade
incq %rax
movq %r13, %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %rax, %rcx
movq %r14, %r8
movq %rbp, %r9
callq 0x19b20
testl %eax, %eax
jne 0x19a33
movq %rbp, %rdi
callq 0x191cd
testl %eax, %eax
je 0x19ad4
movq %rbx, %rdi
callq 0x191cd
testl %eax, %eax
je 0x19ad4
movb 0x10(%rsp), %al
orb (%rbx), %al
jne 0x19b11
cvttsd2si 0x20(%rbx), %rax
cvttsd2si 0x30(%rsp), %rcx
movq %rcx, %rdx
xorq %rax, %rdx
cvtsi2sd %rdx, %xmm0
movsd %xmm0, 0x20(%rbx)
cmpq %rcx, %rax
setne 0x1(%rbx)
jmp 0x19a63
movl $0x0, 0xc(%rsp)
jmp 0x19a63
leaq 0x18(%rsp), %rdi
callq 0x18e75
xorl %eax, %eax
testb $0x1, 0xc(%rsp)
jne 0x19a36
andq $0x0, 0x8(%rbx)
andw $0x0, (%rbx)
movabsq $0x7ff8000000000000, %rcx # imm = 0x7FF8000000000000
movq %rcx, 0x20(%rbx)
jmp 0x19a36
leaq 0x18(%rsp), %rdi
callq 0x18e75
jmp 0x19a33
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/hts_expr.c
// Function: add_expr
static int add_expr(hts_filter_t *filt, void *data, hts_expr_sym_func *fn,
                    char *str, char **end, hts_expr_val_t *res) {
    if (mul_expr(filt, data, fn, str, end, res))
        return -1;

    str = *end;
    hts_expr_val_t val = HTS_EXPR_VAL_INIT;
    while (*str) {
        str = ws(str);
        int undef = 0;
        if (*str == '+' || *str == '-') {
            if (mul_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 (val.is_str || res->is_str) {
                hts_expr_val_free(&val);
                return -1; // arith on strings
            }
        }

        if (*str == '+')
            res->d += val.d;
        else if (*str == '-')
            res->d -= val.d;
        else
            break;

        if (undef)
            hts_expr_val_undef(res);
        else
            res->is_true = res->d != 0;

        str = *end;
    }

    hts_expr_val_free(&val);

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %r9, %rbx
movq %r8, %r14
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r13
callq 0x19da4
testl %eax, %eax
je 0x19c61
pushq $-0x1
popq %rax
jmp 0x19d95
movq %r13, 0x10(%rsp)
movq %r15, 0x18(%rsp)
movq (%r14), %rdi
xorpd %xmm0, %xmm0
leaq 0x20(%rsp), %r13
movapd %xmm0, 0x10(%r13)
andq $0x0, 0x20(%r13)
movapd %xmm0, (%r13)
movl $0x0, 0xc(%rsp)
cmpb $0x0, (%rdi)
je 0x19d87
callq 0x191b7
movq %rax, %rbp
movzbl (%rax), %ecx
cmpl $0x2d, %ecx
je 0x19cae
cmpl $0x2b, %ecx
jne 0x19d09
leaq 0x1(%rbp), %rcx
movq 0x10(%rsp), %rdi
movq %r14, %r8
movq %r12, %r14
movq %r12, %rsi
movq 0x18(%rsp), %rdx
movq %r8, %r15
movq %r13, %r12
movq %r13, %r9
callq 0x19da4
testl %eax, %eax
jne 0x19c59
movq %r12, %rdi
callq 0x191cd
testl %eax, %eax
je 0x19d0d
movq %rbx, %rdi
callq 0x191cd
testl %eax, %eax
movq %r14, %r12
je 0x19d14
cmpb $0x0, 0x20(%rsp)
jne 0x19d7e
movq %r15, %r14
movb $0x1, %al
cmpb $0x0, (%rbx)
je 0x19d19
jmp 0x19d7e
movb $0x1, %al
jmp 0x19d1c
xorl %eax, %eax
movq %r14, %r12
jmp 0x19d16
xorl %eax, %eax
movq %r15, %r14
movb (%rbp), %cl
cmpb $0x2d, %cl
je 0x19d36
movzbl %cl, %ecx
cmpl $0x2b, %ecx
jne 0x19d87
movsd 0x40(%rsp), %xmm0
addsd 0x20(%rbx), %xmm0
jmp 0x19d41
movsd 0x20(%rbx), %xmm0
subsd 0x40(%rsp), %xmm0
movsd %xmm0, 0x20(%rbx)
testb %al, %al
je 0x19d5f
ucomisd 0x5b2b6(%rip), %xmm0    # 0x75008
setp %al
setne %cl
orb %al, %cl
movb %cl, 0x1(%rbx)
jmp 0x19d76
andq $0x0, 0x8(%rbx)
andw $0x0, (%rbx)
movabsq $0x7ff8000000000000, %rax # imm = 0x7FF8000000000000
movq %rax, 0x20(%rbx)
movq (%r14), %rdi
jmp 0x19c88
pushq $-0x1
popq %r15
movl %r15d, 0xc(%rsp)
leaq 0x28(%rsp), %rdi
callq 0x18e75
movl 0xc(%rsp), %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x1b0ea
movq (%r14), %rdi
testq %rdi, %rdi
je 0x1b0e1
callq 0x45c0
addq $0x8, %r14
jmp 0x1b0ce
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_O2/samtools[P]htslib/./htslib/khash_str2int.h
// Function: khash_str2int_get
static inline int khash_str2int_get(void *_hash, const char *str, int *value)
{
    khash_t(str2int) *hash = (khash_t(str2int)*)_hash;
    khint_t k;
    if ( !hash ) return -1;
    k = kh_get(str2int, hash, str);
    if ( k == kh_end(hash) ) return -1;
    if ( !value ) return 0;
    *value = kh_val(hash, k);
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, 0x10(%rsp)
pushq $-0x1
popq %rax
testq %rdi, %rdi
je 0x1b40d
movq %rdi, %r14
movl (%rdi), %ecx
testl %ecx, %ecx
je 0x1b3f5
movq %rdx, 0x20(%rsp)
movq %rcx, 0x18(%rsp)
leal -0x1(%rcx), %ebx
movq 0x10(%rsp), %rdi
callq 0x1c987
movl %eax, %ebp
movl %ebx, 0x4(%rsp)
andl %ebx, %ebp
movq %r14, 0x8(%rsp)
movq 0x10(%r14), %r12
pushq $0x1
popq %r15
movl %ebp, %ebx
movl %ebx, %eax
shrl $0x4, %eax
movl (%r12,%rax,4), %r14d
leal (%rbx,%rbx), %r13d
andl $0x1e, %r13d
movl %r14d, %eax
movl %r13d, %ecx
shrl %cl, %eax
testb $0x2, %al
jne 0x1b3d4
testb $0x1, %al
jne 0x1b3c1
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rax
movl %ebx, %ecx
movq (%rax,%rcx,8), %rdi
movq 0x10(%rsp), %rsi
callq 0x46c0
testl %eax, %eax
je 0x1b3d4
addl %r15d, %ebx
andl 0x4(%rsp), %ebx
incl %r15d
cmpl %ebp, %ebx
jne 0x1b383
pushq $-0x1
popq %rax
jmp 0x1b40d
movl %r13d, %ecx
shrl %cl, %r14d
testb $0x3, %r14b
movq 0x18(%rsp), %rcx
cmovnel %ecx, %ebx
pushq $-0x1
popq %rax
movq 0x20(%rsp), %rdx
movq 0x8(%rsp), %r14
jmp 0x1b3f7
xorl %ebx, %ebx
cmpl %ecx, %ebx
je 0x1b40d
xorl %eax, %eax
testq %rdx, %rdx
je 0x1b40d
movq 0x20(%r14), %rsi
movl %ebx, %ecx
movl (%rsi,%rcx,4), %ecx
movl %ecx, (%rdx)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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, %rax
movq %rdi, %r14
movq %rsp, %r15
andq $0x0, 0x10(%r15)
xorps %xmm0, %xmm0
movaps %xmm0, (%r15)
pushq $-0x1
popq %r13
xorl %ebp, %ebp
cmpb $0x0, (%rax)
je 0x1b4c1
movq %r13, %rsi
movq %rax, %r12
movb (%r12), %cl
incq %r12
incq %rsi
testb %cl, %cl
je 0x1b490
cmpb %bl, %cl
jne 0x1b47e
andq $0x0, (%rsp)
movq %rax, %rdi
movq %r15, %rdx
callq 0x1b4da
movq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x1b57a
testl %eax, %eax
js 0x1b4be
cmpb $0x0, -0x1(%r12)
movq %r12, %rax
jne 0x1b473
jmp 0x1b4c1
pushq $-0x1
popq %rbp
movq %rsp, %rdi
callq 0x1b5ec
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x1b5be
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 0x1b5c1
cmpl $-0x1, %eax
jne 0x1b5c6
xorl %eax, %eax
jmp 0x1b5e6
xorl %eax, %eax
retq
pushq $-0x1
popq %rax
jmp 0x1b5e6
movq 0x28(%rsp), %rsi
movq 0x20(%rsp), %rdx
movq 0x18(%rsp), %rcx
movq 0x10(%rsp), %r8
movq 0x40(%rbx), %r9
movq %rbx, %rdi
callq 0x1b60b
addq $0x30, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/regidx.c
// Function: cmp_regs
static inline int cmp_regs(reg_t *a, reg_t *b)
{
    if ( a->beg < b->beg ) return -1;
    if ( a->beg > b->beg ) return 1;
    if ( a->end < b->end ) return 1;    // longer intervals come first
    if ( a->end > b->end ) return -1;
    if ( a < b ) return -1; // this is are just for qsort reproducibility across platforms
    if ( a > b ) return 1;
    return 0;
}

// Assembly:
movq (%rsi), %rax
pushq $-0x1
popq %rcx
cmpq %rax, (%rdi)
jge 0x1ba8c
movl %ecx, %eax
retq
pushq $0x1
popq %rax
jg 0x1bab2
movq 0x8(%rsi), %rdx
cmpq %rdx, 0x8(%rdi)
jl 0x1bab2
setg %al
cmpq %rsi, %rdi
setb %dl
orb %al, %dl
movl %ecx, %eax
jne 0x1bab2
xorl %eax, %eax
cmpq %rsi, %rdi
seta %al
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/regidx.c
// Function: regidx_init_string
regidx_t *regidx_init_string(const char *str, regidx_parse_f parser, regidx_free_f free_f, size_t payload_size, void *usr_dat)
{
    kstring_t tmp = KS_INITIALIZE;
    regidx_t *idx = (regidx_t*) calloc(1,sizeof(regidx_t));
    if ( !idx ) return NULL;

    idx->free  = free_f;
    idx->parse = parser ? parser : regidx_parse_tab;
    idx->usr   = usr_dat;
    idx->seq2regs = khash_str2int_init();
    if (!idx->seq2regs) goto fail;
    idx->payload_size = payload_size;
    if ( payload_size ) {
        idx->payload = malloc(payload_size);
        if (!idx->payload) goto fail;
    }

    const char *ss = str;
    while ( *ss )
    {
        while ( *ss && isspace_c(*ss) ) ss++;
        const char *se = ss;
        while ( *se && *se!='\r' && *se!='\n' ) se++;
        if (kputsn(ss, se-ss, ks_clear(&tmp)) < 0) goto fail;
        if (regidx_insert(idx, tmp.s) < 0) goto fail;
        while ( *se && isspace_c(*se) ) se++;
        ss = se;
    }
    ks_free(&tmp);
    return idx;

 fail:
    regidx_destroy(idx);
    ks_free(&tmp);
    return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, %r12
movq %rcx, %r15
movq %rdx, %rbp
movq %rsi, %r13
movq %rdi, %r14
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
andq $0x0, 0x10(%rsp)
pushq $0x1
popq %rdi
pushq $0x60
popq %rsi
callq 0x4300
testq %rax, %rax
je 0x1bbe2
movq %rax, %rbx
movq %rbp, 0x20(%rax)
testq %r13, %r13
leaq 0xf4(%rip), %rax        # 0x1bbf6
cmovneq %r13, %rax
movq %rax, 0x28(%rbx)
movq %r12, 0x30(%rbx)
callq 0x1bd74
movq %rax, 0x10(%rbx)
testq %rax, %rax
je 0x1bbce
movl %r15d, 0x38(%rbx)
testq %r15, %r15
je 0x1bb3e
movq %r15, %rdi
callq 0x4680
movq %rax, 0x40(%rbx)
testq %rax, %rax
je 0x1bbce
movb (%r14), %r13b
movl $0x2401, %ebp           # imm = 0x2401
movq %rsp, %r15
testb %r13b, %r13b
je 0x1bbd8
testb %r13b, %r13b
je 0x1bb6d
movsbl %r13b, %edi
callq 0x1bd7f
testl %eax, %eax
je 0x1bb6d
movb 0x1(%r14), %r13b
incq %r14
jmp 0x1bb52
xorl %r12d, %r12d
cmpb $0xd, %r13b
ja 0x1bb7f
movzbl %r13b, %eax
btl %eax, %ebp
jb 0x1bb89
movb 0x1(%r14,%r12), %r13b
incq %r12
jmp 0x1bb70
andq $0x0, (%rsp)
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x1b4da
testl %eax, %eax
js 0x1bbce
movq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x1b57a
testl %eax, %eax
js 0x1bbce
addq %r12, %r14
movb (%r14), %r13b
testb %r13b, %r13b
je 0x1bb49
movsbl %r13b, %edi
callq 0x1bd7f
testl %eax, %eax
je 0x1bb49
incq %r14
jmp 0x1bbb4
movq %rbx, %rdi
callq 0x1bd98
xorl %ebx, %ebx
movq %rsp, %rdi
callq 0x1b5ec
jmp 0x1bbe4
xorl %ebx, %ebx
movq %rbx, %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/regidx.c
// Function: regidx_parse_tab
int regidx_parse_tab(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 tab line: %s", line); return -2; }
    if ( *beg==0 ) { hts_log_error("Could not parse tab line, expected 1-based coordinate: %s", line); return -2; }
    (*beg)--;

    if ( !se[0] || !se[1] )
        *end = *beg;
    else
    {
        ss = se+1;
        *end = hts_parse_decimal(ss, &se, 0);
        if ( ss==se || (*se && !isspace_c(*se)) ) *end = *beg;
        else if ( *end==0 ) { hts_log_error("Could not parse tab 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
movq %r8, (%rsp)
movq %rcx, %r14
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %rbx
pushq $-0x1
popq %rbp
movq %rdi, 0x8(%rsp)
movb (%rbx), %r15b
testb %r15b, %r15b
je 0x1bd57
movsbl %r15b, %edi
callq 0x1bd7f
testl %eax, %eax
je 0x1bc3a
incq %rbx
jmp 0x1bc1c
cmpb $0x23, %r15b
je 0x1bd57
leaq 0x1(%rbx), %rbp
testb %r15b, %r15b
je 0x1bc63
movsbl %r15b, %edi
callq 0x1bd7f
testl %eax, %eax
jne 0x1bc63
movb (%rbp), %r15b
incq %rbp
jmp 0x1bc48
leaq -0x1(%rbp), %rax
movq %rax, 0x10(%rsp)
movq %rbx, (%r13)
leaq -0x2(%rbp), %rax
movq %rax, (%r12)
cmpb $0x0, -0x1(%rbp)
je 0x1bd0e
leaq 0x10(%rsp), %r12
movq %rbp, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x15c0a
movq %rax, (%r14)
movq (%r12), %r12
cmpq %r12, %rbp
je 0x1bd27
testq %rax, %rax
je 0x1bd37
decq %rax
movq %rax, (%r14)
cmpb $0x0, (%r12)
je 0x1bd1c
cmpb $0x0, 0x1(%r12)
je 0x1bd1c
incq %r12
leaq 0x10(%rsp), %rbx
xorl %ebp, %ebp
movq %r12, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x15c0a
movq %rax, %r13
movq (%rsp), %rax
movq %r13, (%rax)
movq (%rbx), %rax
cmpq %rax, %r12
je 0x1bd68
movb (%rax), %al
testb %al, %al
je 0x1bcfd
movsbl %al, %edi
callq 0x1bd7f
testl %eax, %eax
je 0x1bd68
testq %r13, %r13
je 0x1bd37
decq %r13
movq (%rsp), %rax
movq %r13, (%rax)
jmp 0x1bd23
andq $0x0, (%r14)
movabsq $0x800000000, %rax      # imm = 0x800000000
movq (%rsp), %rcx
movq %rax, (%rcx)
xorl %ebp, %ebp
jmp 0x1bd57
leaq 0x5d261(%rip), %rsi     # 0x78f8f
leaq 0x5d26b(%rip), %rdx     # 0x78fa0
jmp 0x1bd45
leaq 0x5d251(%rip), %rsi     # 0x78f8f
leaq 0x5d278(%rip), %rdx     # 0x78fbd
pushq $0x1
popq %rdi
movq 0x8(%rsp), %rcx
xorl %eax, %eax
callq 0x110c6
pushq $-0x2
popq %rbp
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%r14), %rax
movq (%rsp), %rcx
movq %rax, (%rcx)
jmp 0x1bd57
// File: /workspace/github_c_makefile_star2_O2/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 0x1bea1
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
xorl %r14d, %r14d
movslq (%rbx), %rax
cmpq %rax, %r14
jge 0x1be03
imulq $0x38, %r14, %r15
addq 0x8(%rbx), %r15
cmpq $0x0, 0x20(%rbx)
je 0x1bde4
xorl %ebp, %ebp
cmpl 0xc(%r15), %ebp
jae 0x1bde4
movslq 0x38(%rbx), %rax
movslq %ebp, %rdi
imulq %rax, %rdi
addq 0x20(%r15), %rdi
callq *0x20(%rbx)
incl %ebp
jmp 0x1bdc8
movq 0x20(%r15), %rdi
callq 0x45c0
movq 0x18(%r15), %rdi
callq 0x45c0
movq (%r15), %rdi
callq 0x45c0
incq %r14
jmp 0x1bdaf
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 0x1be91
xorl %r15d, %r15d
xorl %r12d, %r12d
movl (%r14), %eax
cmpq %rax, %r12
jae 0x1be6e
movq 0x10(%r14), %rax
movq %r12, %rcx
shrq $0x4, %rcx
movl (%rax,%rcx,4), %eax
movl %r15d, %ecx
andb $0x1e, %cl
shrl %cl, %eax
testb $0x3, %al
jne 0x1be65
movq 0x18(%r14), %rax
movq (%rax,%r12,8), %rdi
callq 0x45c0
incq %r12
addl $0x2, %r15d
jmp 0x1be36
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
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x45c0
retq
// File: /workspace/github_c_makefile_star2_O2/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
movq %r8, %r14
movq %rcx, 0x10(%rsp)
movq %rdx, 0x20(%rsp)
movq %rsi, %r13
movq %rdi, %r12
pushq $-0x1
popq %rbp
movq %rdi, %rbx
movb (%rbx), %r15b
testb %r15b, %r15b
je 0x1c202
movsbl %r15b, %edi
callq 0x1bd7f
testl %eax, %eax
je 0x1c12f
incq %rbx
jmp 0x1c111
cmpb $0x23, %r15b
je 0x1c202
movq %r14, 0x8(%rsp)
leaq 0x1(%rbx), %r14
testb %r15b, %r15b
je 0x1c15c
movsbl %r15b, %edi
callq 0x1bd7f
testl %eax, %eax
jne 0x1c15c
movb (%r14), %r15b
incq %r14
jmp 0x1c142
leaq -0x1(%r14), %rax
movq %rax, 0x18(%rsp)
movq %rbx, (%r13)
leaq -0x2(%r14), %rax
movq 0x20(%rsp), %rcx
movq %rax, (%rcx)
cmpb $0x0, -0x1(%r14)
je 0x1c1e5
leaq 0x18(%rsp), %rbx
xorl %ebp, %ebp
movq %r14, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x15c0a
movq 0x10(%rsp), %rcx
movq %rax, (%rcx)
movq (%rbx), %r15
cmpq %r15, %r14
je 0x1c1c5
incq %r15
leaq 0x18(%rsp), %r14
movq %r15, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x15c0a
decq %rax
movq 0x8(%rsp), %rcx
movq %rax, (%rcx)
cmpq (%r14), %r15
jne 0x1c202
leaq 0x5cd95(%rip), %rsi     # 0x78f61
leaq 0x5cd9f(%rip), %rdx     # 0x78f72
pushq $0x1
popq %rdi
movq %r12, %rcx
xorl %eax, %eax
callq 0x110c6
pushq $-0x2
popq %rbp
jmp 0x1c202
movq 0x10(%rsp), %rax
andq $0x0, (%rax)
movabsq $0x800000000, %rax      # imm = 0x800000000
movq 0x8(%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_O2/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
movq %r8, 0x8(%rsp)
movq %rcx, %r14
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %rbx
pushq $-0x1
popq %rbp
movq %rdi, (%rsp)
movb (%rbx), %r15b
testb %r15b, %r15b
je 0x1c75b
movsbl %r15b, %edi
callq 0x1bd7f
testl %eax, %eax
je 0x1c64f
incq %rbx
jmp 0x1c631
cmpb $0x23, %r15b
je 0x1c75b
leaq 0x1(%rbx), %rbp
testb %r15b, %r15b
je 0x1c674
movzbl %r15b, %eax
cmpl $0x3a, %eax
je 0x1c674
movb (%rbp), %r15b
incq %rbp
jmp 0x1c65d
leaq -0x1(%rbp), %rax
movq %rax, 0x10(%rsp)
movq %rbx, (%r13)
leaq -0x2(%rbp), %rax
movq %rax, (%r12)
cmpb $0x0, -0x1(%rbp)
je 0x1c6fe
leaq 0x10(%rsp), %r12
movq %rbp, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x15c0a
movq %rax, (%r14)
movq (%r12), %r12
cmpq %r12, %rbp
je 0x1c716
testq %rax, %rax
je 0x1c726
decq %rax
movq %rax, (%r14)
movb (%r12), %cl
testb %cl, %cl
movq 0x8(%rsp), %rdx
je 0x1c756
cmpb $0x0, 0x1(%r12)
je 0x1c747
incq %r12
leaq 0x10(%rsp), %r13
movq %rdx, %rbx
xorl %ebp, %ebp
movq %r12, %rdi
movq %r13, %rsi
xorl %edx, %edx
callq 0x15c0a
movq %rax, (%rbx)
cmpq (%r13), %r12
je 0x1c76c
testq %rax, %rax
je 0x1c726
decq %rax
jmp 0x1c70c
andq $0x0, (%r14)
movabsq $0x800000000, %rax      # imm = 0x800000000
movq 0x8(%rsp), %rcx
movq %rax, (%rcx)
jmp 0x1c759
leaq 0x5c8da(%rip), %rsi     # 0x78ff7
leaq 0x5c8e4(%rip), %rdx     # 0x79008
jmp 0x1c734
leaq 0x5c8ca(%rip), %rsi     # 0x78ff7
leaq 0x5c8f1(%rip), %rdx     # 0x79025
pushq $0x1
popq %rdi
movq (%rsp), %rcx
xorl %eax, %eax
callq 0x110c6
pushq $-0x2
popq %rbp
jmp 0x1c75b
cmpb $0x2d, %cl
jne 0x1c756
movabsq $0x800000000, %rax      # imm = 0x800000000
movq %rax, (%rdx)
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%r14), %rax
movq %rax, (%rbx)
jmp 0x1c75b
// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x1
popq %rdi
pushq $0x28
popq %rsi
callq 0x4300
testq %rax, %rax
je 0x1c7b0
movq %rax, %rbx
pushq $0x1
popq %rdi
pushq $0x30
popq %rsi
callq 0x4300
movq %rax, 0x20(%rbx)
testq %rax, %rax
je 0x1c7a8
movq %r14, 0x18(%rax)
jmp 0x1c7b2
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_O2/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 0x1c8b2
cmpq $0x0, 0x18(%rdi)
je 0x1c8b2
movq 0x20(%rdi), %rcx
testq %rcx, %rcx
je 0x1c8b2
pushq %r14
pushq %rbx
cmpl $0x0, 0x28(%rcx)
je 0x1c866
movq 0x20(%rcx), %rdx
movslq 0x10(%rcx), %rsi
movl 0xc(%rdx), %r9d
movq %rsi, %r8
shlq $0x20, %r8
movq %rsi, %r10
shlq $0x4, %r10
orq $0x8, %r10
movabsq $0x100000000, %r11      # imm = 0x100000000
cmpl %esi, %r9d
jbe 0x1c8af
movq 0x18(%rdx), %rbx
movq -0x8(%rbx,%r10), %r14
cmpq 0x8(%rcx), %r14
jg 0x1c8af
movq (%rbx,%r10), %r14
cmpq (%rcx), %r14
jge 0x1c877
addq %r11, %r8
addq $0x10, %r10
incl %esi
jmp 0x1c83e
movl $0x1, 0x28(%rcx)
incl 0x10(%rcx)
movl $0x1, %eax
jmp 0x1c8af
leal 0x1(%rsi), %eax
movl %eax, 0x10(%rcx)
movq 0x28(%rdx), %rax
movq %rax, 0x18(%rdi)
sarq $0x1c, %r8
movups (%rbx,%r8), %xmm0
movups %xmm0, (%rdi)
movq 0x18(%rcx), %rax
movl 0x38(%rax), %ecx
movl $0x1, %eax
testl %ecx, %ecx
je 0x1c8af
imull %esi, %ecx
movslq %ecx, %rcx
addq 0x20(%rdx), %rcx
movq %rcx, 0x10(%rdi)
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/regidx.c
// Function: regitr_loop
int regitr_loop(regitr_t *regitr)
{
    if ( !regitr || !regitr->itr ) return 0;

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

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

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

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

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

    return 1;
}

// Assembly:
xorl %ecx, %ecx
testq %rdi, %rdi
je 0x1c953
movq 0x20(%rdi), %rsi
testq %rsi, %rsi
je 0x1c953
movq 0x18(%rsi), %r8
movq 0x20(%rsi), %r9
movq 0x8(%r8), %r10
testq %r9, %r9
jne 0x1c8e7
movq %r10, 0x20(%rsi)
andl $0x0, 0x10(%rsi)
movq %r10, %r9
movq %r9, %rax
subq %r10, %rax
pushq $0x38
popq %r11
cqto
idivq %r11
movslq (%r8), %r11
cmpq %r11, %rax
jae 0x1c953
movl 0x10(%rsi), %edx
cmpl 0xc(%r9), %edx
jb 0x1c91f
incq %rax
cmpq %r11, %rax
jae 0x1c953
imulq $0x38, %rax, %rax
addq %rax, %r10
movq %r10, 0x20(%rsi)
xorl %edx, %edx
movq %r10, %r9
movq 0x28(%r9), %rax
movq %rax, 0x18(%rdi)
movq 0x18(%r9), %rax
movl %edx, %ecx
shlq $0x4, %rcx
movups (%rax,%rcx), %xmm0
movups %xmm0, (%rdi)
movl 0x38(%r8), %eax
testl %eax, %eax
je 0x1c94b
imull %edx, %eax
addq 0x20(%r9), %rax
movq %rax, 0x10(%rdi)
incl %edx
movl %edx, 0x10(%rsi)
pushq $0x1
popq %rcx
movl %ecx, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/region.c
// Function: reg_destroy
static void reg_destroy(reghash_t *h) {

    khint_t k;

    if (!h)
        return;

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

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

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

// Assembly:
testq %rdi, %rdi
je 0x1d319
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
xorl %r14d, %r14d
testl %esi, %esi
cmovlel %r14d, %esi
imulq $0x28, %rsi, %r15
cmpq %r14, %r15
je 0x1d30c
movq 0x8(%rbx,%r14), %rdi
callq 0x45c0
addq $0x28, %r14
jmp 0x1d2f7
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x45c0
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/sam.c
// Function: sam_hdr_destroy
void sam_hdr_destroy(sam_hdr_t *bh)
{
    int32_t i;

    if (bh == NULL) return;

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

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

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x1d636
movq %rdi, %rbx
movl 0x40(%rdi), %eax
testl %eax, %eax
je 0x1d63e
decl %eax
movl %eax, 0x40(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
cmpq $0x0, 0x20(%rbx)
je 0x1d670
xorl %r14d, %r14d
movslq (%rbx), %rax
movq 0x20(%rbx), %rdi
cmpq %rax, %r14
jge 0x1d662
movq (%rdi,%r14,8), %rdi
callq 0x45c0
incq %r14
jmp 0x1d648
callq 0x45c0
movq 0x10(%rbx), %rdi
callq 0x45c0
movq 0x28(%rbx), %rdi
callq 0x45c0
movq 0x38(%rbx), %rdi
testq %rdi, %rdi
je 0x1d687
callq 0x69799
movq 0x30(%rbx), %rdi
testq %rdi, %rdi
je 0x1d695
callq 0xef8b
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: sam_hdr_dup_sdict
int sam_hdr_dup_sdict(const sam_hdr_t *h0, sam_hdr_t *h)
{
    const khash_t(s2i) *src_long_refs = (khash_t(s2i) *) h0->sdict;
    khash_t(s2i) *dest_long_refs = kh_init(s2i);
    int i;
    if (!dest_long_refs) return -1;

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

    h->sdict = dest_long_refs;
    return 0;
}

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

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

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

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

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

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x1e06a
movq %rdi, %r14
callq 0x1dec4
testq %rax, %rax
je 0x1e06a
movq %rax, %rbx
movq %rax, %rdi
movq %r14, %rsi
callq 0x1dfcb
testq %rax, %rax
jne 0x1e06c
movq %rbx, %rdi
callq 0x1df92
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/sam.c
// Function: bam_cigar2rqlens
static void bam_cigar2rqlens(int n_cigar, const uint32_t *cigar,
                             hts_pos_t *rlen, hts_pos_t *qlen)
{
    int k;
    *rlen = *qlen = 0;
    for (k = 0; k < n_cigar; ++k) {
        int type = bam_cigar_type(bam_cigar_op(cigar[k]));
        int len = bam_cigar_oplen(cigar[k]);
        if (type & 1) *qlen += len;
        if (type & 2) *rlen += len;
    }
}

// Assembly:
movq %rcx, %rax
andq $0x0, (%rcx)
andq $0x0, (%rdx)
xorl %r8d, %r8d
testl %edi, %edi
cmovlel %r8d, %edi
movl $0x3c1a7, %r9d          # imm = 0x3C1A7
cmpq %r8, %rdi
je 0x1e460
movl (%rsi,%r8,4), %r10d
leal (%r10,%r10), %ecx
movl $0x3c1a7, %r11d         # imm = 0x3C1A7
shrl %cl, %r11d
shrl $0x4, %r10d
btl %ecx, %r9d
jae 0x1e44f
addq %r10, (%rax)
testb $0x2, %r11b
je 0x1e45b
movl %r10d, %ecx
addq %rcx, (%rdx)
incq %r8
jmp 0x1e42c
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/./htslib/hts.h
// Function: hts_reg2bin
static inline int hts_reg2bin(hts_pos_t beg, hts_pos_t end, int min_shift, int n_lvls)
{
    int l, s = min_shift, t = ((1<<((n_lvls<<1) + n_lvls)) - 1) / 7;
    for (--end, l = n_lvls; l > 0; --l, s += 3, t -= 1<<((l<<1)+l))
        if (beg>>s == end>>s) return t + (beg>>s);
    return 0;
}

// Assembly:
decq %rsi
movl $0x1249, %eax           # imm = 0x1249
pushq $0xe
popq %rdx
pushq $0xc
popq %r8
pushq $-0x1
popq %r9
cmpl $0x1d, %edx
je 0x1e4a2
movq %rdi, %r10
movl %edx, %ecx
sarq %cl, %r10
movq %rsi, %r11
sarq %cl, %r11
cmpq %r11, %r10
je 0x1e4a5
movl %r9d, %r10d
movl %r8d, %ecx
shll %cl, %r10d
addq $0x3, %rdx
addl %r10d, %eax
addl $-0x3, %r8d
jmp 0x1e474
xorl %eax, %eax
retq
addl %r10d, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/sam.c
// Function: bam_cigar2qlen
hts_pos_t bam_cigar2qlen(int n_cigar, const uint32_t *cigar)
{
    int k;
    hts_pos_t l;
    for (k = l = 0; k < n_cigar; ++k)
        if (bam_cigar_type(bam_cigar_op(cigar[k]))&1)
            l += bam_cigar_oplen(cigar[k]);
    return l;
}

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

// Assembly:
xorl %edx, %edx
testl %edi, %edi
cmovlel %edx, %edi
xorl %eax, %eax
cmpq %rdx, %rdi
je 0x1e517
movl (%rsi,%rdx,4), %r8d
leal (%r8,%r8), %ecx
movl $0x3c1a7, %r9d          # imm = 0x3C1A7
shrl %cl, %r9d
shll $0x1e, %r9d
sarl $0x1f, %r9d
shrl $0x4, %r8d
andl %r9d, %r8d
addq %r8, %rax
incq %rdx
jmp 0x1e4ea
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/./htslib/bgzf.h
// Function: bgzf_write_small
static inline
ssize_t bgzf_write_small(BGZF *fp, const void *data, size_t length) {
    if (fp->is_compressed
        && (size_t) (BGZF_BLOCK_SIZE - fp->block_offset) > length) {
        // Short cut the common and easy mode
        memcpy((uint8_t *)fp->uncompressed_block + fp->block_offset,
               data, length);
        fp->block_offset += length;
        return length;
    } else {
        return bgzf_write(fp, data, length);
    }
}

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

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

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

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

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

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

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
pushq $-0x1
popq %rbp
jne 0x1ef17
movq %rsi, %r15
cmpb $0x0, (%rsi)
je 0x1ef17
movq %rdi, %rbx
movq %r15, %rdi
callq 0x41d0
cmpq $0xfe, %rax
ja 0x1ef17
movq %rax, %r14
leaq 0x1(%rax), %rdi
movzwl 0x12(%rbx), %eax
movl %edi, %ecx
andl $0x3, %ecx
pushq $0x4
popq %rdx
subl %ecx, %edx
xorl %esi, %esi
testq %rcx, %rcx
cmovnel %edx, %esi
movslq 0x40(%rbx), %rcx
movq %rsi, 0x10(%rsp)
movq %rdi, 0x8(%rsp)
leaq (%rdi,%rsi), %r12
movq %r12, %r13
subq %rax, %r13
addq %rcx, %r13
movq %rbx, %rdi
movq %r13, %rsi
callq 0x1e02a
testl %eax, %eax
js 0x1ef17
movzwl 0x12(%rbx), %eax
cmpq %rax, %r12
movq 0x10(%rsp), %rbp
je 0x1eedf
movq 0x38(%rbx), %rsi
movq 0x8(%rsp), %rcx
leaq (%rsi,%rcx), %rdi
addq %rbp, %rdi
addq %rax, %rsi
movslq 0x40(%rbx), %rdx
subq %rax, %rdx
callq 0x4830
movq 0x38(%rbx), %rdi
movq %r15, %rsi
movq 0x8(%rsp), %rdx
callq 0x43c0
movq %rbp, %rax
subq $0x1, %rax
jb 0x1ef08
movq 0x38(%rbx), %rcx
movb $0x0, 0x1(%rcx,%r14)
incq %r14
jmp 0x1eef3
movl %r13d, 0x40(%rbx)
movw %r12w, 0x12(%rbx)
movb %bpl, 0xf(%rbx)
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/sam.c
// Function: sam_idx_init
int sam_idx_init(htsFile *fp, sam_hdr_t *h, int min_shift, const char *fnidx) {
    fp->fnidx = fnidx;
    if (fp->format.format == bam || fp->format.format == bcf ||
        (fp->format.format == sam && fp->format.compression == bgzf)) {
        int n_lvls, fmt = HTS_FMT_CSI;
        if (min_shift > 0) {
            int64_t max_len = 0, s;
            int i;
            for (i = 0; i < h->n_targets; ++i)
                if (max_len < h->target_len[i]) max_len = h->target_len[i];
            max_len += 256;
            for (n_lvls = 0, s = 1<<min_shift; max_len > s; ++n_lvls, s <<= 3);

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

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

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

    return -1;
}

// Assembly:
movl %edx, %r9d
movq %rcx, 0x70(%rdi)
movl 0x4c(%rdi), %edx
pushq $-0x1
popq %rax
addl $-0x3, %edx
cmpl $0x6, %edx
ja 0x1f2cf
pushq %rbx
movq %rdi, %rbx
leaq 0x59ef6(%rip), %rdi     # 0x79100
movslq (%rdi,%rdx,4), %rdx
addq %rdi, %rdx
jmpq *%rdx
cmpl $0x2, 0x54(%rbx)
jne 0x1f2ce
movl (%rsi), %edi
testl %r9d, %r9d
jle 0x1f299
xorl %ecx, %ecx
testl %edi, %edi
movl $0x0, %edx
cmovgl %edi, %edx
xorl %eax, %eax
cmpq %rcx, %rdx
je 0x1f24b
movq 0x10(%rsi), %r8
movl (%r8,%rcx,4), %r8d
cmpq %r8, %rax
cmovleq %r8, %rax
incq %rcx
jmp 0x1f232
pushq $0x1
popq %rdx
movl %r9d, %ecx
shll %cl, %edx
addq $0x100, %rax            # imm = 0x100
movslq %edx, %rcx
xorl %esi, %esi
xorl %r8d, %r8d
cmpq %rcx, %rax
jle 0x1f2a4
incl %r8d
shlq $0x3, %rcx
jmp 0x1f261
leaq 0x562bd(%rip), %rsi     # 0x75533
movq %rcx, %rdi
callq 0x9596
movq 0x38(%rbx), %rcx
movq %rax, 0x8988(%rcx)
movq 0x38(%rbx), %rcx
xorl %eax, %eax
cmpq $0x1, 0x8988(%rcx)
jmp 0x1f2cc
pushq $0x1
popq %rsi
pushq $0x5
popq %r8
pushq $0xe
popq %r9
movq 0x38(%rbx), %rax
movq 0x18(%rax), %rcx
shlq $0x10, %rcx
movzwl 0x10(%rax), %edx
orq %rcx, %rdx
movl %r9d, %ecx
callq 0x13187
movq %rax, %rcx
movq %rax, 0x68(%rbx)
xorl %eax, %eax
cmpq $0x1, %rcx
sbbl %eax, %eax
popq %rbx
retq