LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/vcf.c
// Function: bcf_unpack_info_core1
static inline uint8_t *bcf_unpack_info_core1(uint8_t *ptr, bcf_info_t *info)
{
    uint8_t *ptr_start = ptr;
    int64_t len = 0;
    info->key = bcf_dec_typed_int1(ptr, &ptr);
    len = info->len = bcf_dec_size(ptr, &ptr, &info->type);
    info->vptr = ptr;
    info->vptr_off  = ptr - ptr_start;
    info->vptr_free = 0;
    info->v1.i = 0;
    if (info->len == 1) {
        switch(info->type) {
        case BCF_BT_INT8:
        case BCF_BT_CHAR:
            info->v1.i = *(int8_t*)ptr;
            break;
        case BCF_BT_INT16:
            info->v1.i = le_to_i16(ptr);
            len <<= 1;
            break;
        case BCF_BT_INT32:
            info->v1.i = le_to_i32(ptr);
            len <<= 2;
            break;
        case BCF_BT_FLOAT:
            info->v1.f = le_to_float(ptr);
            len <<= 2;
            break;
        case BCF_BT_INT64:
            info->v1.i = le_to_i64(ptr);
            len <<= 3;
            break;
        }
    } else {
        len <<= bcf_type_shift[info->type];
    }
    ptr += len;

    info->vptr_len = ptr - info->vptr;
    return ptr;
}

// Assembly:
movzbl (%rdi), %eax
andl $0xf, %eax
decl %eax
cmpl $0x3, %eax
ja 0x39583
leaq 0x74927(%rip), %rcx     # 0xade78
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x2(%rdi), %rax
movsbq 0x1(%rdi), %rcx
jmp 0x39588
leaq 0x5(%rdi), %rax
movl 0x1(%rdi), %ecx
jmp 0x39588
leaq 0x9(%rdi), %rax
movq 0x1(%rdi), %rcx
jmp 0x39588
leaq 0x3(%rdi), %rax
movswq 0x1(%rdi), %rcx
jmp 0x39588
xorl %ecx, %ecx
movq %rdi, %rax
movl %ecx, (%rsi)
movzbl (%rax), %ecx
andl $0xf, %ecx
movl %ecx, 0x4(%rsi)
movzbl (%rax), %edx
cmpl $0xef, %edx
jbe 0x395cb
movzbl 0x1(%rax), %edx
andl $0xf, %edx
decl %edx
cmpl $0x3, %edx
ja 0x3964a
leaq 0x748d1(%rip), %r8      # 0xade88
movslq (%r8,%rdx,4), %rdx
addq %r8, %rdx
jmpq *%rdx
movsbq 0x2(%rax), %rdx
addq $0x3, %rax
jmp 0x395d1
incq %rax
shrl $0x4, %edx
movl %edx, 0x20(%rsi)
movslq %edx, %rdx
movq %rax, 0x10(%rsi)
movl %eax, %r8d
subl %edi, %r8d
andl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
movl %r8d, 0x1c(%rsi)
movq $0x0, 0x8(%rsi)
cmpl $0x1, %edx
jne 0x3961d
movzbl %cl, %ecx
decl %ecx
cmpl $0x6, %ecx
ja 0x39682
leaq 0x7488e(%rip), %rdi     # 0xade98
movslq (%rdi,%rcx,4), %rcx
addq %rdi, %rcx
jmpq *%rcx
movsbq (%rax), %rcx
movq %rcx, 0x8(%rsi)
jmp 0x39682
leaq 0x95efc(%rip), %rdi     # 0xcf520
movb (%rcx,%rdi), %cl
shlq %cl, %rdx
jmp 0x39682
movl 0x2(%rax), %edx
addq $0x6, %rax
jmp 0x395d1
movq 0x2(%rax), %rdx
addq $0xa, %rax
jmp 0x395d1
movswq 0x2(%rax), %rdx
addq $0x4, %rax
jmp 0x395d1
xorl %edx, %edx
jmp 0x395d1
movswq (%rax), %rcx
movq %rcx, 0x8(%rsi)
movl $0x2, %edx
jmp 0x39682
movss (%rax), %xmm0
movss %xmm0, 0x8(%rsi)
jmp 0x3966f
movslq (%rax), %rcx
movq %rcx, 0x8(%rsi)
movl $0x4, %edx
jmp 0x39682
movq (%rax), %rcx
movq %rcx, 0x8(%rsi)
movl $0x8, %edx
addq %rdx, %rax
movl %edx, 0x18(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/./htslib/kstring.h
// Function: kputll
static inline int kputll(long long c, kstring_t *s)
{
    // Worst case expansion.  One check reduces function size
    // and aids inlining chance.  Memory overhead is minimal.
    if (ks_resize(s, s->l + 23) < 0)
	return EOF;

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

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

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

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

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

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

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

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq (%rsi), %rax
addq $0x17, %rax
cmpq %rax, 0x8(%rsi)
jae 0x3b125
movq %rax, %rcx
shrq $0x3e, %rcx
movq %rax, %rdx
shrq %rdx
xorl %r15d, %r15d
testq %rcx, %rcx
cmoveq %rdx, %r15
addq %rax, %r15
movq 0x10(%rbx), %rdi
movq %r15, %rsi
callq 0x4860
testq %rax, %rax
je 0x3b1dc
movq %rax, 0x10(%rbx)
movq %r15, 0x8(%rbx)
testq %r14, %r14
jns 0x3b13f
negq %r14
movq (%rbx), %rax
movq 0x10(%rbx), %rcx
leaq 0x1(%rax), %rdx
movq %rdx, (%rbx)
movb $0x2d, (%rcx,%rax)
movq %r14, %rax
shrq $0x20, %rax
jne 0x3b158
movl %r14d, %edi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x41f37
movl $0x1, %eax
movl $0xfffffffe, %ecx       # imm = 0xFFFFFFFE
addq %rax, %rax
leaq (%rax,%rax,4), %rax
incl %ecx
cmpq %rax, %r14
jae 0x3b162
movq 0x10(%rbx), %rsi
addq (%rbx), %rsi
leal 0x2(%rcx), %edi
leaq 0x7076f(%rip), %r8      # 0xab8f0
movabsq $0x28f5c28f5c28f5c3, %r9 # imm = 0x28F5C28F5C28F5C3
movq %r14, %r10
movq %r14, %rax
shrq $0x2, %rax
mulq %r9
movq %rdx, %r14
shrq $0x2, %r14
imulq $0x64, %r14, %rax
movq %r10, %rdx
subq %rax, %rdx
movl %ecx, %eax
movzwl (%r8,%rdx,2), %edx
movw %dx, (%rsi,%rax)
addl $-0x2, %ecx
cmpq $0x3e7, %r10            # imm = 0x3E7
ja 0x3b18b
cmpl $-0x1, %ecx
jne 0x3b1cc
orb $0x30, %r14b
movb %r14b, (%rsi)
movl %edi, %eax
addq (%rbx), %rax
movq %rax, (%rbx)
movq 0x10(%rbx), %rcx
movb $0x0, (%rcx,%rax)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/vcf.c
// Function: vcf_write_line
int vcf_write_line(htsFile *fp, kstring_t *line)
{
    int ret;
    if ( line->s[line->l-1]!='\n' ) kputc('\n',line);
    if ( fp->format.compression!=no_compression )
        ret = bgzf_write(fp->fp.bgzf, line->s, line->l);
    else
        ret = hwrite(fp->fp.hfile, line->s, line->l);
    return ret==line->l ? 0 : -1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq (%rsi), %rax
movq 0x10(%rsi), %rdi
cmpb $0xa, -0x1(%rdi,%rax)
je 0x3beee
addq $0x2, %rax
cmpq %rax, 0x8(%rbx)
jae 0x3bed1
movq %rax, %rcx
shrq $0x3e, %rcx
movq %rax, %rdx
shrq %rdx
xorl %r15d, %r15d
testq %rcx, %rcx
cmoveq %rdx, %r15
addq %rax, %r15
movq %r15, %rsi
callq 0x4860
testq %rax, %rax
je 0x3beee
movq %rax, 0x10(%rbx)
movq %r15, 0x8(%rbx)
movq (%rbx), %rax
movq 0x10(%rbx), %rcx
leaq 0x1(%rax), %rdx
movq %rdx, (%rbx)
movb $0xa, (%rcx,%rax)
movq (%rbx), %rax
movq 0x10(%rbx), %rcx
movb $0x0, (%rcx,%rax)
cmpl $0x0, 0x54(%r14)
movq 0x38(%r14), %r12
movq (%rbx), %r14
movq 0x10(%rbx), %r15
je 0x3bf13
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x8eb43
jmp 0x3bf9b
testb $0x2, 0x30(%r12)
jne 0x3bf46
movq 0x18(%r12), %rsi
movq %rsi, %rax
subq 0x8(%r12), %rax
cmpq %r14, %rax
jae 0x3bf46
addq %r14, %rsi
subq (%r12), %rsi
movq %r12, %rdi
callq 0x9a811
movq 0x18(%r12), %rax
movq %rax, 0x10(%r12)
movq 0x8(%r12), %rdi
movq 0x18(%r12), %rbp
subq %rdi, %rbp
cmpq %r14, %rbp
ja 0x3bf5e
cmpq (%r12), %rdi
je 0x3bf8b
cmpq %r14, %rbp
movq %r14, %r13
cmovbq %rbp, %r13
movq %r15, %rsi
movq %r13, %rdx
callq 0x43c0
addq %r13, 0x8(%r12)
cmpq %r14, %rbp
jae 0x3bf9e
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %r13, %rcx
jmp 0x3bf96
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
xorl %ecx, %ecx
callq 0x9acfa
movq %rax, %r13
movslq %r13d, %rcx
xorl %eax, %eax
cmpq (%rbx), %rcx
setne %al
negl %eax
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/vcf.c
// Function: bcf_index
hts_idx_t *bcf_index(htsFile *fp, int min_shift)
{
    int n_lvls;
    bcf1_t *b = NULL;
    hts_idx_t *idx = NULL;
    bcf_hdr_t *h;
    int r;
    h = bcf_hdr_read(fp);
    if ( !h ) return NULL;
    int nids = 0;
    n_lvls = idx_calc_n_lvls_ids(h, min_shift, 0, &nids);
    idx = hts_idx_init(nids, HTS_FMT_CSI, bgzf_tell(fp->fp.bgzf), min_shift, n_lvls);
    if (!idx) goto fail;
    b = bcf_init1();
    if (!b) goto fail;
    while ((r = bcf_read1(fp,h, b)) >= 0) {
        int ret;
        ret = hts_idx_push(idx, b->rid, b->pos, b->pos + b->rlen, bgzf_tell(fp->fp.bgzf), 1);
        if (ret < 0) goto fail;
    }
    if (r < -1) goto fail;
    hts_idx_finish(idx, bgzf_tell(fp->fp.bgzf));
    bcf_destroy1(b);
    bcf_hdr_destroy(h);
    return idx;

 fail:
    hts_idx_destroy(idx);
    bcf_destroy1(b);
    bcf_hdr_destroy(h);
    return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %esi, %ebp
movq %rdi, %r12
callq 0x2f82f
testq %rax, %rax
je 0x3c085
movq %rax, %rbx
leaq 0xc(%rsp), %r15
movl $0x0, (%r15)
xorl %r14d, %r14d
movq %rax, %rdi
movl %ebp, %esi
xorl %edx, %edx
movq %r15, %rcx
callq 0x3c0ea
movl (%r15), %edi
movq 0x38(%r12), %rcx
movq 0x18(%rcx), %rsi
shlq $0x10, %rsi
movzwl 0x10(%rcx), %edx
orq %rsi, %rdx
xorl %esi, %esi
movl %ebp, %ecx
movl %eax, %r8d
callq 0xb94c
movq %rax, %r15
testq %rax, %rax
je 0x3c094
movl $0x1, %edi
movl $0xd0, %esi
callq 0x42f0
testq %rax, %rax
je 0x3c08a
movq %rax, %r14
movq %r12, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x30e0e
testl %eax, %eax
js 0x3c08f
movl 0x10(%r14), %esi
movq (%r14), %rdx
movq 0x8(%r14), %rcx
addq %rdx, %rcx
movq 0x38(%r12), %rax
movq 0x18(%rax), %rdi
shlq $0x10, %rdi
movzwl 0x10(%rax), %r8d
orq %rdi, %r8
movq %r15, %rdi
movl $0x1, %r9d
callq 0xc2e9
testl %eax, %eax
jns 0x3c03c
jmp 0x3c094
xorl %r15d, %r15d
jmp 0x3c0bc
xorl %r14d, %r14d
jmp 0x3c094
cmpl $-0x1, %eax
je 0x3c0cc
movq %r15, %rdi
callq 0xac5a
xorl %r15d, %r15d
testq %r14, %r14
je 0x3c0b4
movq %r14, %rdi
callq 0x3094b
movq %r14, %rdi
callq 0x45c0
movq %rbx, %rdi
callq 0x2f696
movq %r15, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0x38(%r12), %rax
movq 0x18(%rax), %rcx
shlq $0x10, %rcx
movzwl 0x10(%rax), %esi
orq %rcx, %rsi
movq %r15, %rdi
callq 0xba4b
jmp 0x3c0a4
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/vcf.c
// Function: idx_calc_n_lvls_ids
static int idx_calc_n_lvls_ids(const bcf_hdr_t *h, int min_shift,
                               int starting_n_lvls, int *nids_out)
{
    int n_lvls, i, nids = 0;
    int64_t max_len = 0, s;

    for (i = 0; i < h->n[BCF_DT_CTG]; ++i)
    {
        if ( !h->id[BCF_DT_CTG][i].val ) continue;
        if ( max_len < h->id[BCF_DT_CTG][i].val->info[0] )
            max_len = h->id[BCF_DT_CTG][i].val->info[0];
        nids++;
    }
    if ( !max_len ) max_len = (1LL<<31) - 1;  // In case contig line is broken.
    max_len += 256;
    s = hts_bin_maxpos(min_shift, starting_n_lvls);
    for (n_lvls = starting_n_lvls; max_len > s; ++n_lvls, s <<= 3);

    if (nids_out) *nids_out = nids;
    return n_lvls;
}

// Assembly:
movq %rcx, %r8
movl %edx, %eax
movslq 0x4(%rdi), %rcx
testq %rcx, %rcx
jle 0x3c129
movq 0x18(%rdi), %rdi
shlq $0x4, %rcx
xorl %r10d, %r10d
xorl %r9d, %r9d
xorl %edx, %edx
movq 0x8(%rdi,%r10), %r11
testq %r11, %r11
je 0x3c11e
movq (%r11), %r11
cmpq %r11, %r9
cmovbeq %r11, %r9
incl %edx
addq $0x10, %r10
cmpq %r10, %rcx
jne 0x3c108
jmp 0x3c12e
xorl %edx, %edx
xorl %r9d, %r9d
leaq 0x100(%r9), %rcx
testq %r9, %r9
movl $0x800000ff, %edi       # imm = 0x800000FF
cmovneq %rcx, %rdi
leal (%rax,%rax,2), %ecx
addl %esi, %ecx
movl $0x1, %esi
shlq %cl, %rsi
cmpq %rsi, %rdi
jle 0x3c15b
incl %eax
shlq $0x3, %rsi
jmp 0x3c14e
testq %r8, %r8
je 0x3c163
movl %edx, (%r8)
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/vcf.c
// Function: bcf_index_build3
int bcf_index_build3(const char *fn, const char *fnidx, int min_shift, int n_threads)
{
    htsFile *fp;
    hts_idx_t *idx;
    tbx_t *tbx;
    int ret;
    if ((fp = hts_open(fn, "rb")) == 0) return -2;
    if (n_threads)
        hts_set_threads(fp, n_threads);
    if ( fp->format.compression!=bgzf ) { hts_close(fp); return -3; }
    switch (fp->format.format) {
        case bcf:
            if (!min_shift) {
                hts_log_error("TBI indices for BCF files are not supported");
                ret = -1;
            } else {
                idx = bcf_index(fp, min_shift);
                if (idx) {
                    ret = hts_idx_save_as(idx, fn, fnidx, HTS_FMT_CSI);
                    if (ret < 0) ret = -4;
                    hts_idx_destroy(idx);
                }
                else ret = -1;
            }
            break;

        case vcf:
            tbx = tbx_index(hts_get_bgzfp(fp), min_shift, &tbx_conf_vcf);
            if (tbx) {
                ret = hts_idx_save_as(tbx->idx, fn, fnidx, min_shift > 0 ? HTS_FMT_CSI : HTS_FMT_TBI);
                if (ret < 0) ret = -4;
                tbx_destroy(tbx);
            }
            else ret = -1;
            break;

        default:
            ret = -3;
            break;
    }
    hts_close(fp);
    return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %r12d
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %r15
leaq 0x72d5b(%rip), %rsi     # 0xaeef6
callq 0x9877
testq %rax, %rax
je 0x3c21d
movq %rax, %rbx
testl %r12d, %r12d
je 0x3c1b8
movq %rbx, %rdi
movl %r12d, %esi
callq 0xadcd
movl $0xfffffffd, %r12d      # imm = 0xFFFFFFFD
cmpl $0x2, 0x54(%rbx)
jne 0x3c294
movl 0x4c(%rbx), %eax
cmpl $0x8, %eax
je 0x3c225
cmpl $0x9, %eax
jne 0x3c294
testl %ebp, %ebp
je 0x3c274
movq %rbx, %rdi
movl %ebp, %esi
callq 0x3bfba
testq %rax, %rax
je 0x3c28e
movq %rax, %r13
movq %rax, %rdi
movq %r15, %rsi
movq %r14, %rdx
xorl %ecx, %ecx
callq 0xc8c3
testl %eax, %eax
movl $0xfffffffc, %r12d      # imm = 0xFFFFFFFC
cmovnsl %eax, %r12d
movq %r13, %rdi
callq 0xac5a
jmp 0x3c294
movl $0xfffffffe, %r12d      # imm = 0xFFFFFFFE
jmp 0x3c29c
movq %rbx, %rdi
callq 0xaebd
leaq 0x7da6c(%rip), %rdx     # 0xb9ca0
movq %rax, %rdi
movl %ebp, %esi
callq 0x9dd80
testq %rax, %rax
je 0x3c28e
movq %rax, %r13
movq 0x18(%rax), %rdi
xorl %ecx, %ecx
testl %ebp, %ebp
setle %cl
addl %ecx, %ecx
movq %r15, %rsi
movq %r14, %rdx
callq 0xc8c3
testl %eax, %eax
movl $0xfffffffc, %r12d      # imm = 0xFFFFFFFC
cmovnsl %eax, %r12d
movq %r13, %rdi
callq 0x9e22a
jmp 0x3c294
leaq 0x72c7e(%rip), %rsi     # 0xaeef9
leaq 0x72c88(%rip), %rdx     # 0xaef0a
movl $0x1, %edi
xorl %eax, %eax
callq 0x9774
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
movq %rbx, %rdi
callq 0xaae1
movl %r12d, %eax
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/vcf.c
// Function: bcf_idx_init
int bcf_idx_init(htsFile *fp, bcf_hdr_t *h, int min_shift, const char *fnidx) {
    int n_lvls, nids = 0;

    if (fp->format.compression != bgzf) {
        hts_log_error("Indexing is only supported on BGZF-compressed files");
        return -3; // Matches no-compression return for bcf_index_build3()
    }

    if (fp->format.format == vcf)
        return vcf_idx_init(fp, h, min_shift, fnidx);

    if (!min_shift)
        min_shift = 14;

    n_lvls = idx_calc_n_lvls_ids(h, min_shift, 0, &nids);

    fp->idx = hts_idx_init(nids, HTS_FMT_CSI, bgzf_tell(fp->fp.bgzf), min_shift, n_lvls);
    if (!fp->idx) return -1;
    fp->fnidx = fnidx;

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x30, %rsp
movl $0x0, 0xc(%rsp)
cmpl $0x2, 0x54(%rdi)
jne 0x3c324
movq %rcx, %r14
movl %edx, %ebp
movq %rdi, %rbx
cmpl $0x8, 0x4c(%rdi)
jne 0x3c348
testl %ebp, %ebp
je 0x3c3a5
movl $0x21, %eax
subl %ebp, %eax
cltq
imulq $0x55555556, %rax, %rdx # imm = 0x55555556
movq %rdx, %rax
shrq $0x3f, %rax
shrq $0x20, %rdx
addl %eax, %edx
xorl %r15d, %r15d
movq %rsi, %rdi
movl %ebp, %esi
xorl %ecx, %ecx
callq 0x3c0ea
movl %eax, %r8d
jmp 0x3c3b6
leaq 0x72c0b(%rip), %rsi     # 0xaef36
leaq 0x72c11(%rip), %rdx     # 0xaef43
movl $0x1, %edi
xorl %eax, %eax
callq 0x9774
movl $0xfffffffd, %ebp       # imm = 0xFFFFFFFD
jmp 0x3c437
testl %ebp, %ebp
movl $0xe, %r15d
cmovnel %ebp, %r15d
xorl %ebp, %ebp
leaq 0xc(%rsp), %r12
movq %rsi, %rdi
movl %r15d, %esi
xorl %edx, %edx
movq %r12, %rcx
callq 0x3c0ea
movl (%r12), %edi
movq 0x38(%rbx), %rcx
movq 0x18(%rcx), %rsi
shlq $0x10, %rsi
movzwl 0x10(%rcx), %edx
orq %rsi, %rdx
xorl %esi, %esi
movl %r15d, %ecx
movl %eax, %r8d
callq 0xb94c
movq %rax, 0x68(%rbx)
testq %rax, %rax
je 0x3c41f
movq %r14, 0x70(%rbx)
jmp 0x3c437
movl $0x2, %r15d
movl $0x5, %r8d
movl $0xe, %ebp
movq 0x38(%rbx), %rax
movq 0x18(%rax), %rcx
shlq $0x10, %rcx
movzwl 0x10(%rax), %edx
orq %rcx, %rdx
xorl %edi, %edi
movl %r15d, %esi
movl %ebp, %ecx
callq 0xb94c
movq %rax, 0x68(%rbx)
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testq %rax, %rax
je 0x3c437
movaps 0x71856(%rip), %xmm0    # 0xadc40
leaq 0x10(%rsp), %rdx
movaps %xmm0, (%rdx)
movq $0x23, 0x10(%rdx)
movl $0x0, 0x18(%rdx)
movq %rax, %rdi
movl $0x1c, %esi
movl $0x1, %ecx
callq 0xce0e
testl %eax, %eax
js 0x3c426
movq %r14, 0x70(%rbx)
xorl %ebp, %ebp
jmp 0x3c437
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jmp 0x3c437
movq 0x68(%rbx), %rdi
callq 0xac5a
movq $0x0, 0x68(%rbx)
movl %ebp, %eax
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/vcf.c
// Function: bcf_hdr_dup
bcf_hdr_t *bcf_hdr_dup(const bcf_hdr_t *hdr)
{
    bcf_hdr_t *hout = bcf_hdr_init("r");
    if (!hout) {
        hts_log_error("Failed to allocate bcf header");
        return NULL;
    }
    kstring_t htxt = {0,0,0};
    if (bcf_hdr_format(hdr, 1, &htxt) < 0) {
        free(htxt.s);
        return NULL;
    }
    if ( bcf_hdr_parse(hout, htxt.s) < 0 ) {
        bcf_hdr_destroy(hout);
        hout = NULL;
    }
    free(htxt.s);
    return hout;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rdi, %r14
leaq 0x6f9c3(%rip), %rdi     # 0xad22f
callq 0x2f149
testq %rax, %rax
je 0x3d8c0
movq %rax, %rbx
xorps %xmm0, %xmm0
movq %rsp, %r15
movaps %xmm0, (%r15)
movq $0x0, 0x10(%r15)
movq %r14, %rdi
movl $0x1, %esi
movq %r15, %rdx
callq 0x30754
movq 0x10(%r15), %rsi
testl %eax, %eax
js 0x3d8de
movq %rbx, %rdi
callq 0x2e6a1
testl %eax, %eax
jns 0x3d8b9
movq %rbx, %rdi
callq 0x2f696
xorl %ebx, %ebx
movq 0x10(%rsp), %rsi
jmp 0x3d8e0
leaq 0x717ef(%rip), %rsi     # 0xaf0b6
leaq 0x7113d(%rip), %rdx     # 0xaea0b
xorl %ebx, %ebx
movl $0x1, %edi
xorl %eax, %eax
callq 0x9774
jmp 0x3d8e8
xorl %ebx, %ebx
movq %rsi, %rdi
callq 0x45c0
movq %rbx, %rax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/vcf.c
// Function: bcf_is_snp
int bcf_is_snp(bcf1_t *v)
{
    int i;
    bcf_unpack(v, BCF_UN_STR);
    for (i = 0; i < v->n_allele; ++i)
    {
        if ( v->d.allele[i][1]==0 && v->d.allele[i][0]!='*' ) continue;

        // mpileup's <X> allele, see also below. This is not completely satisfactory,
        // a general library is here narrowly tailored to fit samtools.
        if ( v->d.allele[i][0]=='<' && v->d.allele[i][1]=='X' && v->d.allele[i][2]=='>' ) continue;
        if ( v->d.allele[i][0]=='<' && v->d.allele[i][1]=='*' && v->d.allele[i][2]=='>' ) continue;

        break;
    }
    return i == v->n_allele;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl $0x1, %esi
callq 0x38e9d
movl 0x18(%rbx), %eax
movl %eax, %ecx
shrl $0x10, %ecx
xorl %edx, %edx
cmpl $0x10000, %eax          # imm = 0x10000
jb 0x3efe7
movq 0x88(%rbx), %rax
cmpl $0x1, %ecx
movl %ecx, %edx
adcl $0x0, %edx
xorl %esi, %esi
movq (%rax,%rsi,8), %rdi
movb 0x1(%rdi), %r8b
testb %r8b, %r8b
jne 0x3efad
cmpb $0x2a, (%rdi)
jne 0x3efdb
movb (%rdi), %r9b
movl %r9d, %r10d
xorb $0x3c, %r10b
movl %r8d, %r11d
xorb $0x58, %r11b
orb %r10b, %r11b
jne 0x3efc9
cmpb $0x3e, 0x2(%rdi)
je 0x3efdb
cmpb $0x2a, %r8b
jne 0x3efe5
cmpb $0x3c, %r9b
jne 0x3efe5
cmpb $0x3e, 0x2(%rdi)
jne 0x3efe5
incq %rsi
cmpq %rsi, %rdx
jne 0x3ef9b
jmp 0x3efe7
movl %esi, %edx
xorl %eax, %eax
cmpl %ecx, %edx
sete %al
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/vcf.c
// Function: bcf_get_variant_types
int bcf_get_variant_types(bcf1_t *rec)
{
    if ( rec->d.var_type==-1 ) {
        if (bcf_set_variant_types(rec) != 0) {
            hts_log_error("Couldn't get variant types: %s", strerror(errno));
            exit(1); // Due to legacy API having no way to report failures
        }
    }
    return rec->d.var_type & ORIG_VAR_TYPES;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
cmpl $-0x1, 0xac(%rdi)
jne 0x3f009
movq %rbx, %rdi
callq 0x3f047
testl %eax, %eax
jne 0x3f014
movl 0xac(%rbx), %eax
andl $0x3f, %eax
popq %rbx
retq
callq 0x4050
movl (%rax), %edi
callq 0x4140
leaq 0x7015f(%rip), %rsi     # 0xaf186
leaq 0x7016e(%rip), %rdx     # 0xaf19c
movl $0x1, %edi
movq %rax, %rcx
xorl %eax, %eax
callq 0x9774
movl $0x1, %edi
callq 0x45f0
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/vcf.c
// Function: bcf_get_variant_type
int bcf_get_variant_type(bcf1_t *rec, int ith_allele)
{
    if ( rec->d.var_type==-1 ) {
        if (bcf_set_variant_types(rec) != 0) {
            hts_log_error("Couldn't get variant types: %s", strerror(errno));
            exit(1); // Due to legacy API having no way to report failures
        }
    }
    if (ith_allele < 0 || ith_allele >= rec->n_allele) {
        hts_log_error("Requested allele outside valid range");
        exit(1);
    }
    return rec->d.var[ith_allele].type & ORIG_VAR_TYPES;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
cmpl $-0x1, 0xac(%rdi)
jne 0x3f4cb
movq %r14, %rdi
callq 0x3f047
testl %eax, %eax
jne 0x3f513
testl %ebx, %ebx
js 0x3f4ef
movzwl 0x1a(%r14), %eax
cmpl %ebx, %eax
jle 0x3f4ef
movq 0xa0(%r14), %rax
movl %ebx, %ecx
movl (%rax,%rcx,8), %eax
andl $0x3f, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x6fcc5(%rip), %rsi     # 0xaf1bb
leaq 0x6fcd3(%rip), %rdx     # 0xaf1d0
movl $0x1, %edi
xorl %eax, %eax
callq 0x9774
movl $0x1, %edi
callq 0x45f0
callq 0x4050
movl (%rax), %edi
callq 0x4140
leaq 0x6fc95(%rip), %rsi     # 0xaf1bb
leaq 0x6fc6f(%rip), %rdx     # 0xaf19c
movl $0x1, %edi
movq %rax, %rcx
xorl %eax, %eax
callq 0x9774
jmp 0x3f509
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/vcf.c
// Function: bcf_has_variant_type
int bcf_has_variant_type(bcf1_t *rec, int ith_allele, uint32_t bitmask)
{
    if ( rec->d.var_type==-1 ) {
        if (bcf_set_variant_types(rec) != 0) return -1;
    }
    if (ith_allele < 0 || ith_allele >= rec->n_allele) return -1;
    if (bitmask == VCF_REF) {  // VCF_REF is 0, so handled as a special case
        return rec->d.var[ith_allele].type == VCF_REF;
    }
    return bitmask & rec->d.var[ith_allele].type;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ebx
movl %esi, %ebp
movq %rdi, %r14
cmpl $-0x1, 0xac(%rdi)
je 0x3f55d
testl %ebp, %ebp
jns 0x3f574
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x3f59f
movq %r14, %rdi
callq 0x3f047
movl %eax, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testl %ebp, %ebp
js 0x3f59f
testl %ecx, %ecx
jne 0x3f59f
movzwl 0x1a(%r14), %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl %ebp, %ecx
jle 0x3f59f
movq 0xa0(%r14), %rax
movl %ebp, %ecx
movl (%rax,%rcx,8), %ecx
testl %ebx, %ebx
je 0x3f598
andl %ebx, %ecx
movl %ecx, %eax
jmp 0x3f59f
xorl %eax, %eax
testl %ecx, %ecx
sete %al
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/vcf.c
// Function: bcf_variant_length
int bcf_variant_length(bcf1_t *rec, int ith_allele)
{
    if ( rec->d.var_type==-1 ) {
        if (bcf_set_variant_types(rec) != 0) return bcf_int32_missing;
    }
    if (ith_allele < 0 || ith_allele >= rec->n_allele) return bcf_int32_missing;
    return rec->d.var[ith_allele].n;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
cmpl $-0x1, 0xac(%rdi)
je 0x3f5c1
testl %ebx, %ebx
jns 0x3f5d8
movl $0x80000000, %eax       # imm = 0x80000000
jmp 0x3f5f3
movq %r14, %rdi
callq 0x3f047
movl %eax, %ecx
movl $0x80000000, %eax       # imm = 0x80000000
testl %ebx, %ebx
js 0x3f5f3
testl %ecx, %ecx
jne 0x3f5f3
movzwl 0x1a(%r14), %ecx
movl $0x80000000, %eax       # imm = 0x80000000
cmpl %ebx, %ecx
jle 0x3f5f3
movq 0xa0(%r14), %rax
movl %ebx, %ecx
movl 0x4(%rax,%rcx,8), %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/vcf.c
// Function: bcf_has_variant_types
int bcf_has_variant_types(bcf1_t *rec, uint32_t bitmask,
                          enum bcf_variant_match mode)
{
    if ( rec->d.var_type==-1 ) {
        if (bcf_set_variant_types(rec) != 0) return -1;
    }
    uint32_t type = rec->d.var_type;
    if ( mode==bcf_match_overlap ) return bitmask & type;

    // VCF_INDEL is always set with VCF_INS and VCF_DEL by bcf_set_variant_type[s], but the bitmask may
    // ask for say `VCF_INS` or `VCF_INDEL` only
    if ( bitmask&(VCF_INS|VCF_DEL) && !(bitmask&VCF_INDEL) ) type &= ~VCF_INDEL;
    else if ( bitmask&VCF_INDEL && !(bitmask&(VCF_INS|VCF_DEL)) ) type &= ~(VCF_INS|VCF_DEL);

    if ( mode==bcf_match_subset )
    {
        if ( ~bitmask & type ) return 0;
        else return bitmask & type;
    }
    // mode == bcf_match_exact
    if ( bitmask==VCF_REF ) return type==bitmask ? 1 : 0;
    return type==bitmask ? type : 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ebp
movl %esi, %ebx
movq %rdi, %r14
cmpl $-0x1, 0xac(%rdi)
je 0x3f636
movl 0xac(%r14), %eax
cmpl $0x1, %ebp
jne 0x3f61f
andl %ebx, %eax
jmp 0x3f688
testb $-0x40, %bl
sete %cl
movl %ebx, %edx
andl $0x4, %edx
shrl $0x2, %edx
orb %cl, %dl
jne 0x3f64b
andl $-0x5, %eax
jmp 0x3f65e
movq %r14, %rdi
callq 0x3f047
movl %eax, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testl %ecx, %ecx
jne 0x3f688
jmp 0x3f60f
testb $0x4, %bl
je 0x3f65e
movl %eax, %ecx
andl $0xffffff3f, %ecx       # imm = 0xFFFFFF3F
testb $-0x40, %bl
cmovel %ecx, %eax
cmpl $0x2, %ebp
jne 0x3f674
movl %eax, %ecx
andl %ebx, %ecx
notl %ebx
xorl %edx, %edx
testl %ebx, %eax
cmovel %ecx, %edx
movl %edx, %eax
jmp 0x3f688
xorl %ecx, %ecx
testl %ebx, %ebx
je 0x3f681
cmpl %ebx, %eax
cmovnel %ecx, %eax
jmp 0x3f688
testl %eax, %eax
sete %cl
movl %ecx, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/vcf.c
// Function: bcf_update_format_string
int bcf_update_format_string(const bcf_hdr_t *hdr, bcf1_t *line, const char *key, const char **values, int n)
{
    if ( !n )
        return bcf_update_format(hdr,line,key,NULL,0,BCF_HT_STR);

    int i, max_len = 0;
    for (i=0; i<n; i++)
    {
        int len = strlen(values[i]);
        if ( len > max_len ) max_len = len;
    }
    char *out = (char*) malloc(max_len*n);
    if ( !out ) return -2;
    for (i=0; i<n; i++)
    {
        char *dst = out+i*max_len;
        const char *src = values[i];
        int j = 0;
        while ( src[j] ) { dst[j] = src[j]; j++; }
        for (; j<max_len; j++) dst[j] = 0;
    }
    int ret = bcf_update_format(hdr,line,key,out,max_len*n,BCF_HT_STR);
    free(out);
    return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
testl %r8d, %r8d
je 0x3fd3c
movl %r8d, %r14d
movq %rcx, %r12
movl %r8d, %r15d
movq %rdx, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq %rdi, 0x10(%rsp)
jle 0x3fd5a
xorl %ebx, %ebx
xorl %ebp, %ebp
movq (%r12,%rbx,8), %rdi
callq 0x41c0
movq %rax, %r13
cmpl %r13d, %ebp
cmovgl %ebp, %r13d
incq %rbx
movl %r13d, %ebp
cmpq %rbx, %r15
jne 0x3fd1c
jmp 0x3fd5d
xorl %ecx, %ecx
xorl %r8d, %r8d
movl $0x3, %r9d
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3fe23
xorl %r13d, %r13d
movl %r13d, %ebx
imull %r14d, %ebx
movslq %ebx, %rdi
callq 0x46a0
movq %rax, (%rsp)
testq %rax, %rax
je 0x3fe0f
movl %ebx, 0xc(%rsp)
testl %r14d, %r14d
jle 0x3fddb
movl %r13d, %r14d
xorl %ebp, %ebp
movq (%rsp), %rbx
movq (%r12,%rbp,8), %rax
movb (%rax), %cl
movl $0x0, %edx
testb %cl, %cl
je 0x3fdaa
xorl %edx, %edx
movb %cl, (%rbx,%rdx)
movb 0x1(%rax,%rdx), %cl
incq %rdx
testb %cl, %cl
jne 0x3fd9c
cmpl %r13d, %edx
jge 0x3fdd0
movl %r13d, %eax
imull %ebp, %eax
movslq %eax, %rdi
movl %edx, %eax
addq (%rsp), %rdi
addq %rax, %rdi
notl %edx
addl %r13d, %edx
incq %rdx
xorl %esi, %esi
callq 0x4250
incq %rbp
addq %r14, %rbx
cmpq %r15, %rbp
jne 0x3fd8b
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
movq 0x20(%rsp), %rdx
movq (%rsp), %rbx
movq %rbx, %rcx
movl 0xc(%rsp), %r8d
movl $0x3, %r9d
callq 0x3fe23
movl %eax, %ebp
movq %rbx, %rdi
callq 0x45c0
movl %ebp, %eax
jmp 0x3fe14
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
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/vcf.c
// Function: bcf_update_filter
int bcf_update_filter(const bcf_hdr_t *hdr, bcf1_t *line, int *flt_ids, int n)
{
    if ( !(line->unpacked & BCF_UN_FLT) ) bcf_unpack(line, BCF_UN_FLT);
    line->d.shared_dirty |= BCF1_DIRTY_FLT;
    line->d.n_flt = n;
    if ( !n ) return 0;
    hts_expand(int, line->d.n_flt, line->d.m_flt, line->d.flt);
    int i;
    for (i=0; i<n; i++)
        line->d.flt[i] = flt_ids[i];
    return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl %ecx, %ebp
movq %rdx, %rbx
movq %rsi, %r14
testb $0x2, 0xbc(%rsi)
jne 0x408d7
movq %r14, %rdi
movl $0x2, %esi
callq 0x38e9d
orb $0x4, 0xb0(%r14)
movl %ebp, 0x68(%r14)
testl %ebp, %ebp
je 0x40939
movslq 0x64(%r14), %rsi
cmpl %ebp, %esi
jge 0x4091f
cmpl $0x2, %ebp
movl $0x1, %edi
cmovgel %ebp, %edi
leaq 0x70(%r14), %r9
leaq 0x6ea53(%rip), %rax     # 0xaf358
movq %rax, (%rsp)
movl $0x4, %edx
movl $0x4, %ecx
xorl %r8d, %r8d
callq 0x1183c
movl %eax, 0x64(%r14)
testl %ebp, %ebp
jle 0x40939
movq 0x70(%r14), %rax
movl %ebp, %ecx
xorl %edx, %edx
movl (%rbx,%rdx,4), %esi
movl %esi, (%rax,%rdx,4)
incq %rdx
cmpq %rdx, %rcx
jne 0x4092b
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/vcf.c
// Function: bcf_add_filter
int bcf_add_filter(const bcf_hdr_t *hdr, bcf1_t *line, int flt_id)
{
    if ( !(line->unpacked & BCF_UN_FLT) ) bcf_unpack(line, BCF_UN_FLT);
    int i;
    for (i=0; i<line->d.n_flt; i++)
        if ( flt_id==line->d.flt[i] ) break;
    if ( i<line->d.n_flt ) return 0;    // this filter is already set
    line->d.shared_dirty |= BCF1_DIRTY_FLT;
    if ( flt_id==0 )    // set to PASS
        line->d.n_flt = 1;
    else if ( line->d.n_flt==1 && line->d.flt[0]==0 )
        line->d.n_flt = 1;
    else
        line->d.n_flt++;
    hts_expand(int, line->d.n_flt, line->d.m_flt, line->d.flt);
    line->d.flt[line->d.n_flt-1] = flt_id;
    return 1;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rsi, %r14
testb $0x2, 0xbc(%rsi)
jne 0x40963
movq %r14, %rdi
movl $0x2, %esi
callq 0x38e9d
movslq 0x68(%r14), %rcx
testq %rcx, %rcx
setg %dl
jle 0x4099b
movq 0x70(%r14), %rax
cmpl %ebx, (%rax)
je 0x40995
leaq -0x1(%rcx), %rdx
xorl %esi, %esi
cmpq %rsi, %rdx
je 0x4099b
leaq 0x1(%rsi), %rdi
cmpl %ebx, 0x4(%rax,%rsi,4)
movq %rdi, %rsi
jne 0x4097d
cmpq %rcx, %rdi
setb %dl
xorl %eax, %eax
testb %dl, %dl
jne 0x40a0b
orb $0x4, 0xb0(%r14)
movl $0x1, %eax
testl %ebx, %ebx
je 0x409be
cmpl $0x1, %ecx
jne 0x409ba
movq 0x70(%r14), %rdx
cmpl $0x0, (%rdx)
je 0x409be
incl %ecx
movl %ecx, %eax
movl %eax, 0x68(%r14)
movslq 0x64(%r14), %rsi
cmpl %esi, %eax
jle 0x409fa
cmpl $0x2, %eax
movl $0x1, %edi
cmovgel %eax, %edi
leaq 0x70(%r14), %r9
leaq 0x6e98a(%rip), %rax     # 0xaf36a
movq %rax, (%rsp)
movl $0x4, %edx
movl $0x4, %ecx
xorl %r8d, %r8d
callq 0x1183c
movl %eax, 0x64(%r14)
movq 0x70(%r14), %rax
movslq 0x68(%r14), %rcx
movl %ebx, -0x4(%rax,%rcx,4)
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/vcf.c
// Function: bcf_remove_filter
int bcf_remove_filter(const bcf_hdr_t *hdr, bcf1_t *line, int flt_id, int pass)
{
    if ( !(line->unpacked & BCF_UN_FLT) ) bcf_unpack(line, BCF_UN_FLT);
    int i;
    for (i=0; i<line->d.n_flt; i++)
        if ( flt_id==line->d.flt[i] ) break;
    if ( i==line->d.n_flt ) return 0;   // the filter is not present
    line->d.shared_dirty |= BCF1_DIRTY_FLT;
    if ( i!=line->d.n_flt-1 ) memmove(line->d.flt+i,line->d.flt+i+1,(line->d.n_flt-i-1)*sizeof(*line->d.flt));
    line->d.n_flt--;
    if ( !line->d.n_flt && pass ) bcf_add_filter(hdr,line,0);
    return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %ecx, %ebp
movl %edx, %r14d
movq %rsi, %rbx
testb $0x2, 0xbc(%rsi)
jne 0x40a35
movq %rbx, %rdi
movl $0x2, %esi
callq 0x38e9d
movl 0x68(%rbx), %eax
testl %eax, %eax
jle 0x40a54
movq 0x70(%rbx), %rdx
xorl %ecx, %ecx
cmpl %r14d, (%rdx,%rcx,4)
je 0x40a56
incq %rcx
cmpq %rcx, %rax
jne 0x40a42
movl %eax, %ecx
jmp 0x40a56
xorl %ecx, %ecx
cmpl %eax, %ecx
je 0x40aa3
orb $0x4, 0xb0(%rbx)
leal -0x1(%rax), %edx
cmpl %edx, %ecx
je 0x40a8a
movq 0x70(%rbx), %rdx
movl %ecx, %esi
leaq (%rdx,%rsi,4), %rdi
leaq (%rdx,%rsi,4), %rsi
addq $0x4, %rsi
notl %ecx
addl %eax, %ecx
movslq %ecx, %rdx
shlq $0x2, %rdx
callq 0x4850
decl 0x68(%rbx)
setne %al
testl %ebp, %ebp
sete %cl
orb %al, %cl
jne 0x40aa3
movq %rbx, %rsi
xorl %edx, %edx
callq 0x40944
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/vcf.c
// Function: bcf_has_filter
int bcf_has_filter(const bcf_hdr_t *hdr, bcf1_t *line, char *filter)
{
    if ( filter[0]=='.' && !filter[1] ) filter = "PASS";
    int id = bcf_hdr_id2int(hdr, BCF_DT_ID, filter);
    if ( !bcf_hdr_idinfo_exists(hdr,BCF_HL_FLT,id) ) return -1;  // not defined in the header

    if ( !(line->unpacked & BCF_UN_FLT) ) bcf_unpack(line, BCF_UN_FLT);
    if ( id==0 && !line->d.n_flt) return 1; // PASS

    int i;
    for (i=0; i<line->d.n_flt; i++)
        if ( line->d.flt[i]==id ) return 1;
    return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
cmpb $0x2e, (%rdx)
jne 0x40ac8
cmpb $0x0, 0x1(%rdx)
leaq 0x6e8b5(%rip), %rax     # 0xaf379
cmoveq %rax, %rdx
movq %r14, %rdi
xorl %esi, %esi
callq 0x2e585
movl %eax, %ebp
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testl %ebp, %ebp
js 0x40b48
cmpl (%r14), %ebp
jge 0x40b48
movq 0x10(%r14), %rcx
movl %ebp, %edx
shlq $0x4, %rdx
movq 0x8(%rcx,%rdx), %rcx
testq %rcx, %rcx
je 0x40b48
movl (%rcx), %ecx
notl %ecx
testb $0xf, %cl
je 0x40b48
testb $0x2, 0xbc(%rbx)
jne 0x40b15
movq %rbx, %rdi
movl $0x2, %esi
callq 0x38e9d
testl %ebp, %ebp
jne 0x40b1f
cmpl $0x0, 0x68(%rbx)
je 0x40b3f
movslq 0x68(%rbx), %rcx
testq %rcx, %rcx
jle 0x40b46
movq 0x70(%rbx), %rdx
xorl %esi, %esi
xorl %eax, %eax
cmpl %ebp, (%rdx,%rsi,4)
je 0x40b3f
incq %rsi
cmpq %rsi, %rcx
jne 0x40b30
jmp 0x40b48
movl $0x1, %eax
jmp 0x40b48
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/vcf.c
// Function: bcf_update_alleles_str
int bcf_update_alleles_str(const bcf_hdr_t *hdr, bcf1_t *line, const char *alleles_string)
{
    if ( !(line->unpacked & BCF_UN_STR) ) bcf_unpack(line, BCF_UN_STR);
    kstring_t tmp;
    tmp.l = 0; tmp.s = line->d.als; tmp.m = line->d.m_als;
    kputs(alleles_string, &tmp);
    line->d.als = tmp.s; line->d.m_als = tmp.m;

    int nals = 1;
    char *t = line->d.als;
    while (*t)
    {
        if ( *t==',' ) { *t = 0; nals++; }
        t++;
    }
    return _bcf1_sync_alleles(hdr, line, nals);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r12
movq %rsi, %rbx
movq %rdi, 0x10(%rsp)
testb $0x1, 0xbc(%rsi)
jne 0x40e5e
movq %rbx, %rdi
movl $0x1, %esi
callq 0x38e9d
movq 0x80(%rbx), %r15
movl 0x5c(%rbx), %r13d
testq %r12, %r12
je 0x40ebb
movq %r12, %rdi
callq 0x41c0
movq %rax, %rdx
addq $0x2, %rax
je 0x40ec8
movslq %r13d, %rbp
cmpq %rbp, %rax
jbe 0x40ed5
movq %rax, %rcx
shrq $0x3e, %rcx
movq %rdx, %r14
movq %rax, %rdx
shrq %rdx
xorl %ebp, %ebp
testq %rcx, %rcx
cmoveq %rdx, %rbp
addq %rax, %rbp
movq %r15, %rdi
movq %rbp, %rsi
callq 0x4860
movq %r14, %rdx
movq %rax, %r14
testq %rax, %rax
jne 0x40ed8
jmp 0x40ef1
callq 0x4050
movl $0xe, (%rax)
jmp 0x40ef1
callq 0x4050
movl $0x4b, (%rax)
jmp 0x40ef1
movq %r15, %r14
movq %r14, %rdi
movq %r12, %rsi
movq %rdx, %r15
callq 0x43c0
movb $0x0, (%r14,%r15)
movq %r14, %r15
movl %ebp, %r13d
movq %r15, 0x80(%rbx)
movl %r13d, 0x5c(%rbx)
movl $0x1, %ebp
movzbl (%r15), %eax
cmpl $0x2c, %eax
je 0x40f10
testl %eax, %eax
jne 0x40f16
jmp 0x40f1b
movb $0x0, (%r15)
incl %ebp
incq %r15
jmp 0x40f01
orb $0x2, 0xb0(%rbx)
movl $0xffffffff, 0xac(%rbx) # imm = 0xFFFFFFFF
movw %bp, 0x1a(%rbx)
movzwl %bp, %edi
movslq 0x60(%rbx), %rsi
cmpl %esi, %edi
jle 0x40f68
cmpl $0x1, %edi
adcl $0x0, %edi
leaq 0x88(%rbx), %r9
leaq 0x6f0ff(%rip), %rax     # 0xb004e
movq %rax, (%rsp)
movl $0x4, %edx
movl $0x8, %ecx
xorl %r8d, %r8d
callq 0x1183c
movl %eax, 0x60(%rbx)
testl %ebp, %ebp
jle 0x40f93
movq 0x80(%rbx), %rdx
movl %ebp, %eax
xorl %ecx, %ecx
movq 0x88(%rbx), %rsi
movq %rdx, (%rsi,%rcx,8)
cmpb $0x0, (%rdx)
leaq 0x1(%rdx), %rdx
jne 0x40f82
incq %rcx
cmpq %rax, %rcx
jne 0x40f77
movq 0x10(%rsp), %rdi
movq %rbx, %rsi
callq 0x37d95
movq %rax, 0x8(%rbx)
xorl %eax, %eax
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/vcf.c
// Function: bcf_update_id
int bcf_update_id(const bcf_hdr_t *hdr, bcf1_t *line, const char *id)
{
    if ( !(line->unpacked & BCF_UN_STR) ) bcf_unpack(line, BCF_UN_STR);
    kstring_t tmp;
    tmp.l = 0; tmp.s = line->d.id; tmp.m = line->d.m_id;
    if ( id )
        kputs(id, &tmp);
    else
        kputs(".", &tmp);
    line->d.id = tmp.s; line->d.m_id = tmp.m;
    line->d.shared_dirty |= BCF1_DIRTY_ID;
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rsi, %rbx
testb $0x1, 0xbc(%rsi)
jne 0x40fdc
movq %rbx, %rdi
movl $0x1, %esi
callq 0x38e9d
movq 0x78(%rbx), %r14
movslq 0x58(%rbx), %r13
testq %r15, %r15
je 0x41034
movq %r15, %rdi
callq 0x41c0
movq %rax, %rdx
addq $0x2, %rax
je 0x41054
cmpq %r13, %rax
jbe 0x41061
movq %rax, %rcx
shrq $0x3e, %rcx
movq %rdx, %rbp
movq %rax, %rdx
shrq %rdx
xorl %r12d, %r12d
testq %rcx, %rcx
cmoveq %rdx, %r12
addq %rax, %r12
movq %r14, %rdi
movq %r12, %rsi
callq 0x4860
movq %rbp, %rdx
movq %rax, %rbp
testq %rax, %rax
jne 0x41067
jmp 0x41094
cmpl $0x2, %r13d
ja 0x41083
movl $0x4, %r15d
movl $0x4, %esi
movq %r14, %rdi
callq 0x4860
testq %rax, %rax
jne 0x41089
jmp 0x41094
callq 0x4050
movl $0x4b, (%rax)
jmp 0x41094
movq %r14, %rbp
movq %r13, %r12
movq %rbp, %rdi
movq %r15, %rsi
movq %rdx, %r14
callq 0x43c0
movb $0x0, (%rbp,%r14)
movq %rbp, %r14
movq %r12, %r13
jmp 0x41094
movq %r14, %rax
movq %r13, %r15
movw $0x2e, (%rax)
movq %rax, %r14
movq %r15, %r13
movq %r14, 0x78(%rbx)
movl %r13d, 0x58(%rbx)
orb $0x1, 0xb0(%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/vcf.c
// Function: bcf_add_id
int bcf_add_id(const bcf_hdr_t *hdr, bcf1_t *line, const char *id)
{
    if ( !id ) return 0;
    if ( !(line->unpacked & BCF_UN_STR) ) bcf_unpack(line, BCF_UN_STR);

    kstring_t tmp;
    tmp.l = 0; tmp.s = line->d.id; tmp.m = line->d.m_id;

    int len = strlen(id);
    char *dst = line->d.id;
    while ( *dst && (dst=strstr(dst,id)) )
    {
        if ( dst[len]!=0 && dst[len]!=';' ) dst++;              // a prefix, not a match
        else if ( dst==line->d.id || dst[-1]==';' ) return 0;   // already present
        dst++;  // a suffix, not a match
    }
    if ( line->d.id && (line->d.id[0]!='.' || line->d.id[1]) )
    {
        tmp.l = strlen(line->d.id);
        kputc(';',&tmp);
    }
    kputs(id,&tmp);

    line->d.id = tmp.s; line->d.m_id = tmp.m;
    line->d.shared_dirty |= BCF1_DIRTY_ID;
    return 0;

}

// Assembly:
testq %rdx, %rdx
je 0x4125b
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r14
movq %rsi, %rbx
testb $0x1, 0xbc(%rsi)
jne 0x410e7
movq %rbx, %rdi
movl $0x1, %esi
callq 0x38e9d
movq 0x78(%rbx), %r15
movslq 0x58(%rbx), %rbp
cmpb $0x0, (%r15)
je 0x4113f
movq %r14, %rdi
callq 0x41c0
movslq %eax, %r12
movq %r15, %rdi
movq %r14, %rsi
callq 0x40d0
testq %rax, %rax
je 0x4113f
movzbl (%rax,%r12), %ecx
testl %ecx, %ecx
je 0x4111e
cmpl $0x3b, %ecx
jne 0x41132
cmpq %r15, %rax
je 0x4124d
cmpb $0x3b, -0x1(%rax)
jne 0x41135
jmp 0x4124d
incq %rax
leaq 0x1(%rax), %rdi
cmpb $0x0, 0x1(%rax)
jne 0x41103
cmpb $0x2e, (%r15)
jne 0x4114c
cmpb $0x0, 0x1(%r15)
je 0x411a4
movq %r15, %rdi
callq 0x41c0
movq %rax, %r12
addq $0x2, %rax
cmpq %rbp, %rax
jbe 0x4118c
movq %rax, %rcx
shrq $0x3e, %rcx
movq %rax, %rdx
shrq %rdx
xorl %r13d, %r13d
testq %rcx, %rcx
cmoveq %rdx, %r13
addq %rax, %r13
movq %r15, %rdi
movq %r13, %rsi
callq 0x4860
testq %rax, %rax
jne 0x41192
jmp 0x411a7
movq %r15, %rax
movq %rbp, %r13
movw $0x3b, (%rax,%r12)
incq %r12
movq %rax, %r15
movq %r13, %rbp
jmp 0x411a7
xorl %r12d, %r12d
movq %r14, %rdi
callq 0x41c0
movq %rax, %r13
addq %r12, %rax
addq $0x2, %rax
cmpq %r12, %rax
jbe 0x411fb
cmpq %rax, %rbp
movq %rbp, %rcx
jae 0x4120d
movq %rcx, 0x8(%rsp)
movq %rax, %rcx
shrq $0x3e, %rcx
movq %rax, %rdx
shrq %rdx
xorl %esi, %esi
testq %rcx, %rcx
cmoveq %rdx, %rsi
addq %rax, %rsi
movq %r15, %rdi
movq %rsi, 0x10(%rsp)
callq 0x4860
movq %rax, %rbp
testq %rax, %rax
jne 0x41215
jmp 0x4123a
movq %rbp, 0x8(%rsp)
callq 0x4050
movl $0x4b, (%rax)
jmp 0x4123a
movq %r15, %rbp
movq %rcx, 0x10(%rsp)
leaq (%r12,%rbp), %rdi
movq %r14, %rsi
movq %r13, %rdx
callq 0x43c0
addq %r12, %r13
movb $0x0, (%rbp,%r13)
movq %rbp, %r15
movq 0x10(%rsp), %rax
movq %rax, 0x8(%rsp)
movq %r15, 0x78(%rbx)
movq 0x8(%rsp), %rax
movl %eax, 0x58(%rbx)
orb $0x1, 0xb0(%rbx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/vcf.c
// Function: bcf_get_fmt_id
bcf_fmt_t *bcf_get_fmt_id(bcf1_t *line, const int id)
{
    int i;
    if ( !(line->unpacked & BCF_UN_FMT) ) bcf_unpack(line, BCF_UN_FMT);
    for (i=0; i<line->n_fmt; i++)
    {
        if ( line->d.fmt[i].id==id ) return &line->d.fmt[i];
    }
    return NULL;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
testb $0x8, 0xbc(%rdi)
jne 0x412d0
movq %r14, %rdi
movl $0x8, %esi
callq 0x38e9d
movq 0x18(%r14), %rcx
shrq $0x20, %rcx
testb %cl, %cl
je 0x412f3
movq 0x98(%r14), %rax
movzbl %cl, %ecx
cmpl %ebx, (%rax)
je 0x412f5
addq $0x20, %rax
decq %rcx
jne 0x412e6
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/vcf.c
// Function: bcf_get_info_id
bcf_info_t *bcf_get_info_id(bcf1_t *line, const int id)
{
    int i;
    if ( !(line->unpacked & BCF_UN_INFO) ) bcf_unpack(line, BCF_UN_INFO);
    for (i=0; i<line->n_info; i++)
    {
        if ( line->d.info[i].key==id ) return &line->d.info[i];
    }
    return NULL;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
testb $0x4, 0xbc(%rdi)
jne 0x4136f
movq %r14, %rdi
movl $0x4, %esi
callq 0x38e9d
movzwl 0x18(%r14), %ecx
testq %rcx, %rcx
je 0x4138d
movq 0x90(%r14), %rax
cmpl %ebx, (%rax)
je 0x4138f
addq $0x28, %rax
decq %rcx
jne 0x41380
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/vcf.c
// Function: add_desc_to_buffer
static int add_desc_to_buffer(char *buffer, size_t *offset, size_t maxbuffer, const char *description) {

    if (!description || !buffer || !offset || (maxbuffer < 4))
        return -1;

    size_t rembuffer = maxbuffer - *offset;
    if (rembuffer > (strlen(description) + (rembuffer == maxbuffer ? 0 : 1))) {    //add description with optionally required ','
        *offset += snprintf(buffer + *offset, rembuffer, "%s%s", (rembuffer == maxbuffer)? "": ",", description);
    } else {    //not enough space for description, put ...
        size_t tmppos = (rembuffer <= 4) ? maxbuffer - 4 : *offset;
        snprintf(buffer + tmppos, 4, "...");    //ignore offset update
        return -1;
    }
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r14
testq %rcx, %rcx
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jne 0x41f26
movq %rdx, %r12
movq %rsi, %rbx
movq %rdi, (%rsp)
movq (%rsi), %r15
movq %rdx, %r13
subq %r15, %r13
movq %r14, %rdi
callq 0x41c0
cmpq $0x1, %r15
sbbq $-0x1, %rax
cmpq %rax, %r13
jbe 0x41f0e
movq (%rsp), %rdi
addq %r15, %rdi
testq %r15, %r15
leaq 0x6ac45(%rip), %rax     # 0xacb2b
leaq 0x68aa0(%rip), %rcx     # 0xaa98d
cmovneq %rax, %rcx
leaq 0x68c2e(%rip), %rdx     # 0xaab26
xorl %ebp, %ebp
movq %r13, %rsi
movq %r14, %r8
xorl %eax, %eax
callq 0x4820
cltq
addq %rax, (%rbx)
jmp 0x41f26
addq $-0x4, %r12
cmpq $0x5, %r13
cmovbq %r12, %r15
movq (%rsp), %rax
movl $0x2e2e2e, (%rax,%r15)  # imm = 0x2E2E2E
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/vcf.c
// Function: bcf_hrec_set_type
static void bcf_hrec_set_type(bcf_hrec_t *hrec)
{
    if ( !strcmp(hrec->key, "contig") ) hrec->type = BCF_HL_CTG;
    else if ( !strcmp(hrec->key, "INFO") ) hrec->type = BCF_HL_INFO;
    else if ( !strcmp(hrec->key, "FILTER") ) hrec->type = BCF_HL_FLT;
    else if ( !strcmp(hrec->key, "FORMAT") ) hrec->type = BCF_HL_FMT;
    else if ( hrec->nkeys>0 ) hrec->type = BCF_HL_STR;
    else hrec->type = BCF_HL_GEN;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x8(%rdi), %r14
leaq 0x6dd56(%rip), %rsi     # 0xb00dd
movq %r14, %rdi
callq 0x46e0
testl %eax, %eax
je 0x423da
leaq 0x6c128(%rip), %rsi     # 0xae4c2
movq %r14, %rdi
callq 0x46e0
testl %eax, %eax
je 0x423e1
leaq 0x68a14(%rip), %rsi     # 0xaadc1
movq %r14, %rdi
callq 0x46e0
testl %eax, %eax
je 0x423e8
leaq 0x6c85e(%rip), %rsi     # 0xaec1e
movq %r14, %rdi
callq 0x46e0
testl %eax, %eax
je 0x423ec
xorl %eax, %eax
cmpl $0x0, 0x18(%rbx)
setg %al
xorl $0x5, %eax
jmp 0x423f1
movl $0x3, %eax
jmp 0x423f1
movl $0x1, %eax
jmp 0x423f1
xorl %eax, %eax
jmp 0x423f1
movl $0x2, %eax
movl %eax, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq