LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/vcf.c
// Function: bcf_hdr_check_sanity
void bcf_hdr_check_sanity(bcf_hdr_t *hdr)
{
    static int PL_warned = 0, GL_warned = 0;

    if ( !PL_warned )
    {
        int id = bcf_hdr_id2int(hdr, BCF_DT_ID, "PL");
        if ( bcf_hdr_idinfo_exists(hdr,BCF_HL_FMT,id) && bcf_hdr_id2length(hdr,BCF_HL_FMT,id)!=BCF_VL_G )
        {
            hts_log_warning("PL should be declared as Number=G");
            PL_warned = 1;
        }
    }
    if ( !GL_warned )
    {
        int id = bcf_hdr_id2int(hdr, BCF_DT_ID, "GL");
        if ( bcf_hdr_idinfo_exists(hdr,BCF_HL_FMT,id) && bcf_hdr_id2length(hdr,BCF_HL_FMT,id)!=BCF_VL_G )
        {
            hts_log_warning("GL should be declared as Number=G");
            GL_warned = 1;
        }
    }
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
cmpb $0x0, 0xa1960(%rip)     # 0xcfe00
jne 0x2e50e
leaq 0x80316(%rip), %rdx     # 0xae7bf
movq %rbx, %rdi
xorl %esi, %esi
callq 0x2e585
testl %eax, %eax
js 0x2e50e
cmpl (%rbx), %eax
jge 0x2e50e
movq 0x10(%rbx), %rcx
movl %eax, %eax
shlq $0x4, %rax
movq 0x8(%rcx,%rax), %rax
testq %rax, %rax
je 0x2e50e
movl 0x10(%rax), %eax
movl %eax, %ecx
notl %ecx
testb $0xf, %cl
sete %cl
andl $0xf00, %eax            # imm = 0xF00
cmpl $0x300, %eax            # imm = 0x300
sete %al
orb %cl, %al
jne 0x2e50e
leaq 0x802ce(%rip), %rsi     # 0xae7c2
leaq 0x802dc(%rip), %rdx     # 0xae7d7
movl $0x3, %edi
xorl %eax, %eax
callq 0x9774
movb $0x1, 0xa18f2(%rip)     # 0xcfe00
cmpb $0x0, 0xa18ef(%rip)     # 0xcfe04
jne 0x2e583
leaq 0x802db(%rip), %rdx     # 0xae7f9
movq %rbx, %rdi
xorl %esi, %esi
callq 0x2e585
testl %eax, %eax
js 0x2e583
cmpl (%rbx), %eax
jge 0x2e583
movq 0x10(%rbx), %rcx
movl %eax, %eax
shlq $0x4, %rax
movq 0x8(%rcx,%rax), %rax
testq %rax, %rax
je 0x2e583
movl 0x10(%rax), %eax
movl %eax, %ecx
notl %ecx
testb $0xf, %cl
sete %cl
andl $0xf00, %eax            # imm = 0xF00
cmpl $0x300, %eax            # imm = 0x300
sete %al
orb %cl, %al
jne 0x2e583
leaq 0x80259(%rip), %rsi     # 0xae7c2
leaq 0x8028c(%rip), %rdx     # 0xae7fc
movl $0x3, %edi
xorl %eax, %eax
callq 0x9774
movb $0x1, 0xa1881(%rip)     # 0xcfe04
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/vcf.c
// Function: bcf_hdr_id2int
int bcf_hdr_id2int(const bcf_hdr_t *h, int which, const char *id)
{
    khint_t k;
    vdict_t *d = (vdict_t*)h->dict[which];
    k = kh_get(vdict, d, id);
    return k == kh_end(d)? -1 : kh_val(d, k).id;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movslq %esi, %rax
movq 0x28(%rdi,%rax,8), %rax
movq %rax, 0x8(%rsp)
movl (%rax), %ecx
testl %ecx, %ecx
je 0x2e5d9
movq %rdx, %rbx
movq %rcx, 0x18(%rsp)
leal -0x1(%rcx), %esi
movb (%rdx), %cl
testb %cl, %cl
je 0x2e5e1
leaq 0x1(%rbx), %rax
movl $0x811c9dc5, %r13d      # imm = 0x811C9DC5
movzbl %cl, %ecx
xorl %r13d, %ecx
imull $0x1000193, %ecx, %r13d # imm = 0x1000193
movb (%rax), %cl
incq %rax
testb %cl, %cl
jne 0x2e5c1
jmp 0x2e5e7
xorl %r15d, %r15d
jmp 0x2e674
movl $0x811c9dc5, %r13d      # imm = 0x811C9DC5
andl %esi, %r13d
movq 0x8(%rsp), %rax
movq 0x10(%rax), %rdi
movl $0x1, %r14d
movl %r13d, %r15d
movl %esi, 0x14(%rsp)
movq %rdi, 0x20(%rsp)
movl %r15d, %eax
shrl $0x4, %eax
movl (%rdi,%rax,4), %r12d
leal (%r15,%r15), %ebp
andl $0x1e, %ebp
movl %r12d, %eax
movl %ebp, %ecx
shrl %cl, %eax
testb $0x2, %al
jne 0x2e662
testb $0x1, %al
jne 0x2e64a
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rax
movl %r15d, %ecx
movq (%rax,%rcx,8), %rdi
movq %rbx, %rsi
callq 0x46e0
movq 0x20(%rsp), %rdi
movl 0x14(%rsp), %esi
testl %eax, %eax
je 0x2e662
addl %r14d, %r15d
andl %esi, %r15d
incl %r14d
cmpl %r13d, %r15d
jne 0x2e605
movq 0x18(%rsp), %rcx
movl %ecx, %r15d
jmp 0x2e674
movl %ebp, %ecx
shrl %cl, %r12d
testb $0x3, %r12b
movq 0x18(%rsp), %rcx
cmovnel %ecx, %r15d
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl %ecx, %r15d
je 0x2e692
movq 0x8(%rsp), %rax
movq 0x20(%rax), %rax
movl %r15d, %ecx
imulq $0x38, %rcx, %rcx
movl 0x30(%rax,%rcx), %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/vcf.c
// Function: bcf_hdr_printf
int bcf_hdr_printf(bcf_hdr_t *hdr, const char *fmt, ...)
{
    char tmp[256], *line = tmp;
    va_list ap;
    va_start(ap, fmt);
    int n = vsnprintf(line, sizeof(tmp), fmt, ap);
    va_end(ap);

    if (n >= sizeof(tmp)) {
        n++; // For trailing NUL
        line = (char*)malloc(n);
        if (!line)
            return -1;

        va_start(ap, fmt);
        vsnprintf(line, n, fmt, ap);
        va_end(ap);
    }

    int ret = bcf_hdr_append(hdr, line);

    if (line != tmp) free(line);
    return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1d8, %rsp            # imm = 0x1D8
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x20(%rsp), %rbp
movq %rdx, 0x10(%rbp)
movq %rcx, 0x18(%rbp)
movq %r8, 0x20(%rbp)
movq %r9, 0x28(%rbp)
testb %al, %al
je 0x2ef59
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq %rsp, %rcx
movq %rbp, 0x10(%rcx)
leaq 0x210(%rsp), %rax
movq %rax, 0x8(%rcx)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rcx)
leaq 0xd0(%rsp), %r15
movl $0x100, %esi            # imm = 0x100
movq %r15, %rdi
movq %r14, %rdx
callq 0x42c0
movq %r15, %r12
cmpl $0x100, %eax            # imm = 0x100
jb 0x2efde
incl %eax
movslq %eax, %r13
movq %r13, %rdi
callq 0x46a0
testq %rax, %rax
je 0x2effa
movq %rax, %r12
movq %rsp, %rcx
movq %rbp, 0x10(%rcx)
leaq 0x210(%rsp), %rax
movq %rax, 0x8(%rcx)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rcx)
movq %r12, %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x42c0
movq %rbx, %rdi
movq %r12, %rsi
callq 0x2e8ff
movl %eax, %ebx
cmpq %r15, %r12
je 0x2efff
movq %r12, %rdi
callq 0x45c0
jmp 0x2efff
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
addq $0x1d8, %rsp            # imm = 0x1D8
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_hdr_get_version
const char *bcf_hdr_get_version(const bcf_hdr_t *hdr)
{
    bcf_hrec_t *hrec = bcf_hdr_get_hrec(hdr, BCF_HL_GEN, "fileformat", NULL, NULL);
    if ( !hrec )
    {
        hts_log_warning("No version string found, assuming VCFv4.2");
        return "VCFv4.2";
    }
    return hrec->value;
}

// Assembly:
pushq %rax
leaq 0x7f77f(%rip), %rdx     # 0xae79a
movl $0x5, %esi
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x2dff0
testq %rax, %rax
je 0x2f035
movq 0x10(%rax), %rax
jmp 0x2f056
leaq 0x7f904(%rip), %rsi     # 0xae940
leaq 0x7f911(%rip), %rdx     # 0xae954
movl $0x3, %edi
xorl %eax, %eax
callq 0x9774
leaq 0x7f920(%rip), %rax     # 0xae976
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/vcf.c
// Function: bcf_hdr_set_version
int bcf_hdr_set_version(bcf_hdr_t *hdr, const char *version)
{
    bcf_hrec_t *hrec = bcf_hdr_get_hrec(hdr, BCF_HL_GEN, "fileformat", NULL, NULL);
    if ( !hrec )
    {
        int len;
        kstring_t str = {0,0,0};
        if ( ksprintf(&str,"##fileformat=%s", version) < 0 ) return -1;
        hrec = bcf_hdr_parse_line(hdr, str.s, &len);
        free(str.s);

        get_hdr_aux(hdr)->version = bcf_get_version(NULL, hrec->value);
    }
    else
    {
        bcf_hrec_t *tmp = bcf_hrec_dup(hrec);
        if ( !tmp ) return -1;
        free(tmp->value);
        tmp->value = strdup(version);
        if ( !tmp->value ) return -1;
        bcf_hdr_update_hrec(hdr, hrec, tmp);
        bcf_hrec_destroy(tmp);
    }
    hdr->dirty = 1;
    //TODO rlen may change, deal with it
    return 0; // FIXME: check for errs in this function (return < 0 if so)
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x30, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x7f729(%rip), %rdx     # 0xae79a
movl $0x5, %esi
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x2dff0
testq %rax, %rax
je 0x2f0d4
movq %rax, %r15
movq %rax, %rdi
callq 0x2bdad
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testq %rax, %rax
je 0x2f13a
movq %rax, %r12
movq 0x10(%rax), %rdi
callq 0x45c0
movq %r14, %rdi
callq 0x4930
movq %rax, 0x10(%r12)
testq %rax, %rax
je 0x2f13a
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x2c96c
movq %r12, %rdi
callq 0x2bd39
jmp 0x2f12a
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %rdi
movaps %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
leaq 0x7f890(%rip), %rsi     # 0xae97e
movq %r14, %rdx
xorl %eax, %eax
callq 0x8b533
testl %eax, %eax
js 0x2f135
movq 0x20(%rsp), %rsi
leaq 0xc(%rsp), %rdx
callq 0x2c456
movq %rax, %r14
movq 0x20(%rsp), %rdi
callq 0x45c0
movq 0x10(%r14), %rsi
xorl %edi, %edi
callq 0x2cd13
movq 0x28(%rbx), %rcx
movl %eax, 0x38(%rcx)
movl $0x1, 0x54(%rbx)
xorl %ebp, %ebp
jmp 0x2f13a
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
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_init
bcf_hdr_t *bcf_hdr_init(const char *mode)
{
    int i;
    bcf_hdr_t *h;
    h = (bcf_hdr_t*)calloc(1, sizeof(bcf_hdr_t));
    if (!h) return NULL;
    for (i = 0; i < 3; ++i) {
        if ((h->dict[i] = kh_init(vdict)) == NULL) goto fail;
        // Supersize the hash to make collisions very unlikely
        static int dsize[3] = {16384,16384,2048}; // info, contig, format
        if (kh_resize(vdict, h->dict[i], dsize[i]) < 0) goto fail;
    }

    bcf_hdr_aux_t *aux = (bcf_hdr_aux_t*)calloc(1,sizeof(bcf_hdr_aux_t));
    if ( !aux ) goto fail;
    if ( (aux->gen = kh_init(hdict))==NULL ) { free(aux); goto fail; }
    aux->key_len = NULL;
    aux->dict = *((vdict_t*)h->dict[0]);
    aux->version = 0;
    free(h->dict[0]);
    h->dict[0] = aux;

    if ( strchr(mode,'w') )
    {
        bcf_hdr_append(h, "##fileformat=VCFv4.2");
        // The filter PASS must appear first in the dictionary
        bcf_hdr_append(h, "##FILTER=<ID=PASS,Description=\"All filters passed\">");
        aux->version = VCF_DEF;
    }
    return h;

 fail:
    for (i = 0; i < 3; ++i)
        kh_destroy(vdict, h->dict[i]);
    free(h);
    return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
movl $0x1, %edi
movl $0xa8, %esi
callq 0x42f0
testq %rax, %rax
je 0x2f2a1
movq %rax, %rbx
xorl %r15d, %r15d
leaq 0x7ee2f(%rip), %r12     # 0xadfa8
movl $0x1, %edi
movl $0x28, %esi
callq 0x42f0
movq %rax, 0x28(%rbx,%r15,2)
testq %rax, %rax
je 0x2f25e
movl (%r15,%r12), %esi
movq %rax, %rdi
callq 0x2f2b2
testl %eax, %eax
js 0x2f25e
addq $0x4, %r15
cmpq $0xc, %r15
jne 0x2f179
movl $0x1, %edi
movl $0x40, %esi
callq 0x42f0
testq %rax, %rax
je 0x2f25e
movq %rax, %r15
movl $0x1, %edi
movl $0x28, %esi
callq 0x42f0
movq %rax, 0x28(%r15)
testq %rax, %rax
je 0x2f256
movq $0x0, 0x30(%r15)
movq 0x28(%rbx), %rdi
movq 0x20(%rdi), %rax
movq %rax, 0x20(%r15)
movups (%rdi), %xmm0
movups 0x10(%rdi), %xmm1
movups %xmm1, 0x10(%r15)
movups %xmm0, (%r15)
movl $0x0, 0x38(%r15)
callq 0x45c0
movq %r15, 0x28(%rbx)
movq %r14, %rdi
movl $0x77, %esi
callq 0x4180
testq %rax, %rax
je 0x2f2a3
leaq 0x7f759(%rip), %rsi     # 0xae98e
movq %rbx, %rdi
callq 0x2e8ff
leaq 0x7f62d(%rip), %rsi     # 0xae871
movq %rbx, %rdi
callq 0x2e8ff
movl $0x3d10d0, 0x38(%r15)   # imm = 0x3D10D0
jmp 0x2f2a3
movq %r15, %rdi
callq 0x45c0
movl $0x5, %r15d
movq (%rbx,%r15,8), %r14
testq %r14, %r14
je 0x2f290
movq 0x18(%r14), %rdi
callq 0x45c0
movq 0x10(%r14), %rdi
callq 0x45c0
movq 0x20(%r14), %rdi
callq 0x45c0
movq %r14, %rdi
callq 0x45c0
incq %r15
cmpq $0x8, %r15
jne 0x2f264
movq %rbx, %rdi
callq 0x45c0
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/vcf.c
// Function: bcf_hdr_destroy
void bcf_hdr_destroy(bcf_hdr_t *h)
{
    int i;
    khint_t k;
    if (!h) return;
    for (i = 0; i < 3; ++i) {
        vdict_t *d = (vdict_t*)h->dict[i];
        if (d == 0) continue;
        for (k = kh_begin(d); k != kh_end(d); ++k)
            if (kh_exist(d, k)) free((char*)kh_key(d, k));
        if ( i==0 )
        {
            bcf_hdr_aux_t *aux = get_hdr_aux(h);
            for (k=kh_begin(aux->gen); k<kh_end(aux->gen); k++)
                if ( kh_exist(aux->gen,k) ) free((char*)kh_key(aux->gen,k));
            kh_destroy(hdict, aux->gen);
            free(aux->key_len); // may exist for dict[0] only
        }
        kh_destroy(vdict, d);
        free(h->id[i]);
    }
    for (i=0; i<h->nhrec; i++)
        bcf_hrec_destroy(h->hrec[i]);
    if (h->nhrec) free(h->hrec);
    if (h->samples) free(h->samples);
    free(h->keep_samples);
    free(h->transl[0]); free(h->transl[1]);
    free(h->mem.s);
    free(h);
}

// Assembly:
testq %rdi, %rdi
je 0x2f82e
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r15
xorl %r12d, %r12d
movq %rdi, (%rsp)
movq 0x28(%r15,%r12,8), %r14
testq %r14, %r14
je 0x2f7a6
cmpl $0x0, (%r14)
je 0x2f6fc
xorl %ebx, %ebx
xorl %ebp, %ebp
movq 0x10(%r14), %rax
movl %ebp, %ecx
shrl $0x4, %ecx
movl (%rax,%rcx,4), %eax
movl %ebx, %ecx
andb $0x1e, %cl
shrl %cl, %eax
testb $0x3, %al
jne 0x2f6f2
movq 0x18(%r14), %rax
movl %ebp, %ecx
movq (%rax,%rcx,8), %rdi
callq 0x45c0
incl %ebp
addl $0x2, %ebx
cmpl (%r14), %ebp
jne 0x2f6cc
testq %r12, %r12
jne 0x2f779
movq 0x28(%r15), %r13
movq 0x28(%r13), %r15
cmpl $0x0, (%r15)
je 0x2f749
xorl %ebp, %ebp
xorl %ebx, %ebx
movq 0x10(%r15), %rax
movl %ebx, %ecx
shrl $0x4, %ecx
movl (%rax,%rcx,4), %eax
movl %ebp, %ecx
andb $0x1e, %cl
shrl %cl, %eax
testb $0x3, %al
jne 0x2f737
movq 0x18(%r15), %rax
movq (%rax,%rbx,8), %rdi
callq 0x45c0
incq %rbx
movq 0x28(%r13), %r15
movl (%r15), %eax
addl $0x2, %ebp
cmpq %rax, %rbx
jb 0x2f713
movq 0x18(%r15), %rdi
callq 0x45c0
movq 0x10(%r15), %rdi
callq 0x45c0
movq 0x20(%r15), %rdi
callq 0x45c0
movq %r15, %rdi
callq 0x45c0
movq 0x30(%r13), %rdi
callq 0x45c0
movq (%rsp), %r15
movq 0x18(%r14), %rdi
callq 0x45c0
movq 0x10(%r14), %rdi
callq 0x45c0
movq 0x20(%r14), %rdi
callq 0x45c0
movq %r14, %rdi
callq 0x45c0
movq 0x10(%r15,%r12,8), %rdi
callq 0x45c0
incq %r12
cmpq $0x3, %r12
jne 0x2f6b4
movl 0x50(%r15), %eax
testl %eax, %eax
jle 0x2f7d6
xorl %ebx, %ebx
movq 0x48(%r15), %rax
movq (%rax,%rbx,8), %rdi
callq 0x2bd39
incq %rbx
movslq 0x50(%r15), %rax
cmpq %rax, %rbx
jl 0x2f7bd
testl %eax, %eax
je 0x2f7e3
movq 0x48(%r15), %rdi
callq 0x45c0
movq 0x40(%r15), %rdi
testq %rdi, %rdi
je 0x2f7f1
callq 0x45c0
movq 0x78(%r15), %rdi
callq 0x45c0
movq 0x60(%r15), %rdi
callq 0x45c0
movq 0x68(%r15), %rdi
callq 0x45c0
movq 0x90(%r15), %rdi
callq 0x45c0
movq %r15, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x45c0
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/vcf.c
// Function: bcf_hdr_write
int bcf_hdr_write(htsFile *hfp, bcf_hdr_t *h)
{
    if (!h) {
        errno = EINVAL;
        return -1;
    }
    if ( h->dirty ) {
        if (bcf_hdr_sync(h) < 0) return -1;
    }
    hfp->format.category = variant_data;
    if (hfp->format.format == vcf || hfp->format.format == text_format) {
        hfp->format.format = vcf;
        return vcf_hdr_write(hfp, h);
    }

    if (hfp->format.format == binary_format)
        hfp->format.format = bcf;

    kstring_t htxt = {0,0,0};
    if (bcf_hdr_format(h, 1, &htxt) < 0) {
        free(htxt.s);
        return -1;
    }
    kputc('\0', &htxt); // include the \0 byte

    BGZF *fp = hfp->fp.bgzf;
    if ( bgzf_write(fp, "BCF\2\2", 5) !=5 ) return -1;
    uint8_t hlen[4];
    u32_to_le(htxt.l, hlen);
    if ( bgzf_write(fp, hlen, 4) !=4 ) return -1;
    if ( bgzf_write(fp, htxt.s, htxt.l) != htxt.l ) return -1;
    if ( bgzf_flush(fp) < 0) return -1;

    free(htxt.s);
    return 0;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
testq %rsi, %rsi
je 0x304ca
movq %rsi, %r14
movq %rdi, %rbx
cmpl $0x0, 0x54(%rsi)
je 0x30498
movq %r14, %rdi
callq 0x2bc46
testl %eax, %eax
js 0x304d5
movl $0x2, 0x48(%rbx)
movl 0x4c(%rbx), %eax
cmpl $0x1, %eax
je 0x304e4
cmpl $0x8, %eax
je 0x304b1
cmpl $0x2, %eax
jne 0x304eb
movl $0x8, 0x4c(%rbx)
movq %rbx, %rdi
movq %r14, %rsi
addq $0x28, %rsp
popq %rbx
popq %r14
jmp 0x30610
callq 0x4050
movl $0x16, (%rax)
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
addq $0x28, %rsp
popq %rbx
popq %r14
retq
movl $0x9, 0x4c(%rbx)
xorps %xmm0, %xmm0
movq %rsp, %rdx
movaps %xmm0, (%rdx)
movq $0x0, 0x10(%rdx)
movq %r14, %rdi
movl $0x1, %esi
callq 0x30754
testl %eax, %eax
js 0x30601
movq (%rsp), %rax
addq $0x2, %rax
cmpq %rax, 0x8(%rsp)
jae 0x30556
movq %rax, %rcx
shrq $0x3e, %rcx
movq %rax, %rdx
shrq %rdx
xorl %r14d, %r14d
testq %rcx, %rcx
cmoveq %rdx, %r14
addq %rax, %r14
movq 0x10(%rsp), %rdi
movq %r14, %rsi
callq 0x4860
testq %rax, %rax
je 0x30578
movq %rax, 0x10(%rsp)
movq %r14, 0x8(%rsp)
movq (%rsp), %rax
movq 0x10(%rsp), %rcx
leaq 0x1(%rax), %rdx
movq %rdx, (%rsp)
xorl %edx, %edx
movb %dl, (%rcx,%rax)
movq (%rsp), %rax
movq 0x10(%rsp), %rcx
movb %dl, (%rcx,%rax)
movq 0x38(%rbx), %r14
leaq 0x7e4dc(%rip), %rsi     # 0xaea5f
movl $0x5, %edx
movq %r14, %rdi
callq 0x8eb43
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpq $0x5, %rax
jne 0x304da
movl (%rsp), %eax
leaq 0x24(%rsp), %rsi
movl %eax, (%rsi)
movl $0x4, %edx
movq %r14, %rdi
callq 0x8eb43
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpq $0x4, %rax
jne 0x304da
movq (%rsp), %rdx
movq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x8eb43
cmpq (%rsp), %rax
jne 0x304da
movq %r14, %rdi
callq 0x8e6b1
testl %eax, %eax
js 0x304da
movq 0x10(%rsp), %rdi
callq 0x45c0
xorl %ebx, %ebx
jmp 0x304da
movq 0x10(%rsp), %rdi
callq 0x45c0
jmp 0x304d5
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/vcf.c
// Function: vcf_hdr_write
int vcf_hdr_write(htsFile *fp, const bcf_hdr_t *h)
{
    kstring_t htxt = {0,0,0};
    if (bcf_hdr_format(h, 0, &htxt) < 0) {
        free(htxt.s);
        return -1;
    }
    while (htxt.l && htxt.s[htxt.l-1] == '\0') --htxt.l; // kill trailing zeros
    int ret;
    if ( fp->format.compression!=no_compression ) {
        ret = bgzf_write(fp->fp.bgzf, htxt.s, htxt.l);
        if (bgzf_flush(fp->fp.bgzf) != 0) return -1;
    } else {
        ret = hwrite(fp->fp.hfile, htxt.s, htxt.l);
    }
    free(htxt.s);
    return ret<0 ? -1 : 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rdi, %r12
xorps %xmm0, %xmm0
movq %rsp, %rdx
movaps %xmm0, (%rdx)
movq $0x0, 0x10(%rdx)
movq %rsi, %rdi
xorl %esi, %esi
callq 0x30754
testl %eax, %eax
js 0x306a0
movq (%rsp), %rbx
testq %rbx, %rbx
je 0x3065f
movq 0x10(%rsp), %rax
cmpb $0x0, -0x1(%rax,%rbx)
jne 0x3065f
decq %rbx
movq %rbx, (%rsp)
jne 0x3064d
xorl %ebx, %ebx
cmpl $0x0, 0x54(%r12)
movq 0x38(%r12), %r15
movq 0x10(%rsp), %r14
je 0x306b4
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x8eb43
movq %rax, %r13
movq 0x38(%r12), %rdi
callq 0x8e6b1
movl %eax, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testl %ecx, %ecx
jne 0x30746
jmp 0x30735
movq 0x10(%rsp), %rdi
callq 0x45c0
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x30746
testb $0x2, 0x30(%r15)
jne 0x306e1
movq 0x18(%r15), %rsi
movq %rsi, %rax
subq 0x8(%r15), %rax
cmpq %rbx, %rax
jae 0x306e1
addq %rbx, %rsi
subq (%r15), %rsi
movq %r15, %rdi
callq 0x9a811
movq 0x18(%r15), %rax
movq %rax, 0x10(%r15)
movq 0x8(%r15), %rdi
movq 0x18(%r15), %r12
subq %rdi, %r12
cmpq %rbx, %r12
ja 0x306f6
cmpq (%r15), %rdi
je 0x30722
cmpq %rbx, %r12
movq %rbx, %r13
cmovbq %r12, %r13
movq %r14, %rsi
movq %r13, %rdx
callq 0x43c0
addq %r13, 0x8(%r15)
cmpq %rbx, %r12
jae 0x30735
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
movq %r13, %rcx
jmp 0x3072d
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
xorl %ecx, %ecx
callq 0x9acfa
movq %rax, %r13
movq 0x10(%rsp), %rdi
callq 0x45c0
movslq %r13d, %rax
shrq $0x1f, %rax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/vcf.c
// Function: bcf_hdr_format
int bcf_hdr_format(const bcf_hdr_t *hdr, int is_bcf, kstring_t *str)
{
    int i, r = 0;
    for (i=0; i<hdr->nhrec; i++)
        r |= _bcf_hrec_format(hdr->hrec[i], is_bcf, str) < 0;

    r |= ksprintf(str, "#CHROM\tPOS\tID\tREF\tALT\tQUAL\tFILTER\tINFO") < 0;
    if ( bcf_hdr_nsamples(hdr) )
    {
        r |= ksprintf(str, "\tFORMAT") < 0;
        for (i=0; i<bcf_hdr_nsamples(hdr); i++)
            r |= ksprintf(str, "\t%s", hdr->samples[i]) < 0;
    }
    r |= ksprintf(str, "\n") < 0;

    return r ? -1 : 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rdi, %r14
cmpl $0x0, 0x50(%rdi)
jle 0x30796
movl %esi, %ebp
xorl %r12d, %r12d
xorl %r15d, %r15d
movq 0x48(%r14), %rax
movq (%rax,%r12,8), %rdi
movl %ebp, %esi
movq %rbx, %rdx
callq 0x32eac
shrl $0x1f, %eax
orl %eax, %r15d
incq %r12
movslq 0x50(%r14), %rax
cmpq %rax, %r12
jl 0x30770
jmp 0x30799
xorl %r15d, %r15d
leaq 0x7dd00(%rip), %rsi     # 0xae4a0
movq %rbx, %rdi
xorl %eax, %eax
callq 0x8b533
movl %eax, %ebp
cmpl $0x0, 0x8(%r14)
je 0x30805
leaq 0x7e463(%rip), %rsi     # 0xaec1d
movq %rbx, %rdi
xorl %eax, %eax
callq 0x8b533
orl %eax, %ebp
shrl $0x1f, %ebp
orl %r15d, %ebp
cmpl $0x0, 0x8(%r14)
jle 0x3080b
leaq 0x7dde5(%rip), %r15     # 0xae5bf
xorl %r12d, %r12d
movq 0x40(%r14), %rax
movq (%rax,%r12,8), %rdx
movq %rbx, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x8b533
shrl $0x1f, %eax
orl %eax, %ebp
incq %r12
movslq 0x8(%r14), %rax
cmpq %rax, %r12
jl 0x307dd
jmp 0x3080b
shrl $0x1f, %ebp
orl %r15d, %ebp
leaq 0x7b351(%rip), %rsi     # 0xabb63
movq %rbx, %rdi
xorl %eax, %eax
callq 0x8b533
shrl $0x1f, %eax
xorl %ecx, %ecx
orl %ebp, %eax
setne %cl
negl %ecx
movl %ecx, %eax
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_clear
void bcf_clear(bcf1_t *v)
{
    int i;
    for (i=0; i<v->d.m_info; i++)
    {
        if ( v->d.info[i].vptr_free )
        {
            free(v->d.info[i].vptr - v->d.info[i].vptr_off);
            v->d.info[i].vptr_free = 0;
        }
    }
    for (i=0; i<v->d.m_fmt; i++)
    {
        if ( v->d.fmt[i].p_free )
        {
            free(v->d.fmt[i].p - v->d.fmt[i].p_off);
            v->d.fmt[i].p_free = 0;
        }
    }
    v->rid = v->pos = v->rlen = v->unpacked = 0;
    bcf_float_set_missing(v->qual);
    v->n_info = v->n_allele = v->n_fmt = v->n_sample = 0;
    v->shared.l = v->indiv.l = 0;
    v->d.var_type = -1;
    v->d.shared_dirty = 0;
    v->d.indiv_dirty  = 0;
    v->d.n_flt = 0;
    v->errcode = 0;
    if (v->d.m_als) v->d.als[0] = 0;
    if (v->d.m_id) v->d.id[0] = 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
cmpl $0x0, 0x54(%rdi)
jle 0x30899
movl $0x1c, %r14d
xorl %r15d, %r15d
movq 0x90(%rbx), %rcx
movl (%rcx,%r14), %eax
testl %eax, %eax
jns 0x30889
movq -0xc(%rcx,%r14), %rdi
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
subq %rax, %rdi
callq 0x45c0
movq 0x90(%rbx), %rax
andl $0x7fffffff, (%rax,%r14) # imm = 0x7FFFFFFF
incq %r15
movslq 0x54(%rbx), %rax
addq $0x28, %r14
cmpq %rax, %r15
jl 0x30859
cmpl $0x0, 0x50(%rbx)
jle 0x308e8
movl $0x1c, %r14d
xorl %r15d, %r15d
movq 0x98(%rbx), %rcx
movl (%rcx,%r14), %eax
testl %eax, %eax
jns 0x308d8
movq -0xc(%rcx,%r14), %rdi
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
subq %rax, %rdi
callq 0x45c0
movq 0x98(%rbx), %rax
andl $0x7fffffff, (%rax,%r14) # imm = 0x7FFFFFFF
incq %r15
movslq 0x50(%rbx), %rax
addq $0x20, %r14
cmpq %rax, %r15
jl 0x308a8
xorl %eax, %eax
movl %eax, 0xbc(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movl %eax, 0x10(%rbx)
movl 0x9ec11(%rip), %ecx     # 0xcf510
movl %ecx, 0x14(%rbx)
movq $0x0, 0x38(%rbx)
movups %xmm0, 0x18(%rbx)
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movq %rcx, 0xac(%rbx)
movl %eax, 0xb4(%rbx)
movl %eax, 0x68(%rbx)
movl %eax, 0xcc(%rbx)
cmpl %eax, 0x5c(%rbx)
je 0x30938
movq 0x80(%rbx), %rax
movb $0x0, (%rax)
cmpl $0x0, 0x58(%rbx)
je 0x30945
movq 0x78(%rbx), %rax
movb $0x0, (%rax)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/vcf.c
// Function: bcf_empty
void bcf_empty(bcf1_t *v)
{
    bcf_clear1(v);
    free(v->d.id);
    free(v->d.als);
    free(v->d.allele); free(v->d.flt); free(v->d.info); free(v->d.fmt);
    if (v->d.var ) free(v->d.var);
    free(v->shared.s); free(v->indiv.s);
    memset(&v->d,0,sizeof(v->d));
    memset(&v->shared,0,sizeof(v->shared));
    memset(&v->indiv,0,sizeof(v->indiv));
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x30842
movq 0x78(%rbx), %rdi
callq 0x45c0
movq 0x80(%rbx), %rdi
callq 0x45c0
movq 0x88(%rbx), %rdi
callq 0x45c0
movq 0x70(%rbx), %rdi
callq 0x45c0
movq 0x90(%rbx), %rdi
callq 0x45c0
movq 0x98(%rbx), %rdi
callq 0x45c0
movq 0xa0(%rbx), %rdi
testq %rdi, %rdi
je 0x309aa
callq 0x45c0
leaq 0x20(%rbx), %r14
movq 0x30(%rbx), %rdi
callq 0x45c0
movq 0x48(%rbx), %rdi
callq 0x45c0
movl $0x98, %edx
movq %r14, %rdi
xorl %esi, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x4250
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/vcf.c
// Function: bcf_unpack_fmt_core1
static inline uint8_t *bcf_unpack_fmt_core1(uint8_t *ptr, int n_sample, bcf_fmt_t *fmt)
{
    uint8_t *ptr_start = ptr;
    fmt->id = bcf_dec_typed_int1(ptr, &ptr);
    fmt->n = bcf_dec_size(ptr, &ptr, &fmt->type);
    fmt->size = fmt->n << bcf_type_shift[fmt->type];
    fmt->p = ptr;
    fmt->p_off  = ptr - ptr_start;
    fmt->p_free = 0;
    ptr += n_sample * fmt->size;
    fmt->p_len = ptr - fmt->p;
    return ptr;
}

// Assembly:
movzbl (%rdi), %eax
andl $0xf, %eax
decl %eax
cmpl $0x3, %eax
ja 0x30d6b
leaq 0x7cf4b(%rip), %rcx     # 0xadc84
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x2(%rdi), %rax
movsbq 0x1(%rdi), %rcx
jmp 0x30d70
leaq 0x5(%rdi), %rax
movl 0x1(%rdi), %ecx
jmp 0x30d70
leaq 0x9(%rdi), %rax
movq 0x1(%rdi), %rcx
jmp 0x30d70
leaq 0x3(%rdi), %rax
movswq 0x1(%rdi), %rcx
jmp 0x30d70
xorl %ecx, %ecx
movq %rdi, %rax
movl %ecx, (%rdx)
movzbl (%rax), %ecx
andl $0xf, %ecx
movl %ecx, 0xc(%rdx)
movzbl (%rax), %r8d
cmpl $0xef, %r8d
jbe 0x30db6
movzbl 0x1(%rax), %r8d
andl $0xf, %r8d
decl %r8d
cmpl $0x3, %r8d
ja 0x30e09
leaq 0x7cef3(%rip), %r9      # 0xadc94
movslq (%r9,%r8,4), %r8
addq %r9, %r8
jmpq *%r8
movsbq 0x2(%rax), %r8
addq $0x3, %rax
jmp 0x30dbd
incq %rax
shrl $0x4, %r8d
movl %r8d, 0x4(%rdx)
leaq 0x9e758(%rip), %r9      # 0xcf520
movb (%rcx,%r9), %cl
shll %cl, %r8d
movl %r8d, 0x8(%rdx)
movq %rax, 0x10(%rdx)
subl %edi, %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, 0x1c(%rdx)
imull %esi, %r8d
movl %r8d, 0x18(%rdx)
retq
movl 0x2(%rax), %r8d
addq $0x6, %rax
jmp 0x30dbd
movq 0x2(%rax), %r8
addq $0xa, %rax
jmp 0x30dbd
movswq 0x2(%rax), %r8
addq $0x4, %rax
jmp 0x30dbd
xorl %r8d, %r8d
jmp 0x30dbd
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/vcf.c
// Function: bcf_read
int bcf_read(htsFile *fp, const bcf_hdr_t *h, bcf1_t *v)
{
    if (fp->format.format == vcf) return vcf_read(fp,h,v);
    int ret = bcf_read1_core(fp->fp.bgzf, v);
    if (ret == 0) ret = bcf_record_check(h, v);
    if ( ret!=0 || !h->keep_samples ) return ret;
    return bcf_subset_format(h,v);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
cmpl $0x8, 0x4c(%rdi)
jne 0x30e30
movq %r14, %rsi
movq %rbx, %rdx
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x30e6b
movq 0x38(%rdi), %rdi
movq %rbx, %rsi
callq 0x30ea4
testl %eax, %eax
jne 0x30e4b
movq %r14, %rdi
movq %rbx, %rsi
callq 0x31084
testl %eax, %eax
jne 0x30e63
cmpq $0x0, 0x78(%r14)
je 0x30e63
movq %r14, %rdi
movq %rbx, %rsi
callq 0x309ee
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_readrec
int bcf_readrec(BGZF *fp, void *null, void *vv, int *tid, hts_pos_t *beg, hts_pos_t *end)
{
    bcf1_t *v = (bcf1_t *) vv;
    int ret = bcf_read1_core(fp, v);
    if (ret == 0) ret = bcf_record_check(NULL, v);
    if (ret  >= 0)
        *tid = v->rid, *beg = v->pos, *end = v->pos + v->rlen;
    return ret;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %rbx
movq %r8, %r15
movq %rcx, %r12
movq %rdx, %r14
movq %rdx, %rsi
callq 0x30ea4
testl %eax, %eax
jne 0x31b93
xorl %edi, %edi
movq %r14, %rsi
callq 0x31084
testl %eax, %eax
js 0x31baf
movl 0x10(%r14), %ecx
movl %ecx, (%r12)
movq (%r14), %rcx
movq %rcx, (%r15)
movq 0x8(%r14), %rcx
addq (%r14), %rcx
movq %rcx, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/vcf.c
// Function: bcf_copy
bcf1_t *bcf_copy(bcf1_t *dst, bcf1_t *src)
{
    bcf1_sync(src);

    bcf_clear(dst);
    dst->rid  = src->rid;
    dst->pos  = src->pos;
    dst->rlen = src->rlen;
    dst->qual = src->qual;
    dst->n_info = src->n_info; dst->n_allele = src->n_allele;
    dst->n_fmt = src->n_fmt; dst->n_sample = src->n_sample;

    if ( dst->shared.m < src->shared.l )
    {
        dst->shared.s = (char*) realloc(dst->shared.s, src->shared.l);
        dst->shared.m = src->shared.l;
    }
    dst->shared.l = src->shared.l;
    memcpy(dst->shared.s,src->shared.s,dst->shared.l);

    if ( dst->indiv.m < src->indiv.l )
    {
        dst->indiv.s = (char*) realloc(dst->indiv.s, src->indiv.l);
        dst->indiv.m = src->indiv.l;
    }
    dst->indiv.l = src->indiv.l;
    memcpy(dst->indiv.s,src->indiv.s,dst->indiv.l);

    return dst;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x31cd3
movq %rbx, %rdi
callq 0x30842
movl 0x10(%r14), %eax
movl %eax, 0x10(%rbx)
movq (%r14), %rax
movq %rax, (%rbx)
movq 0x8(%r14), %rax
movq %rax, 0x8(%rbx)
movss 0x14(%r14), %xmm0
movss %xmm0, 0x14(%rbx)
movq 0x18(%rbx), %rcx
movq 0x28(%rbx), %rax
movw 0x18(%r14), %cx
movq %rcx, 0x18(%rbx)
movzwl 0x1a(%r14), %edx
shll $0x10, %edx
movabsq $-0xffff0001, %rsi      # imm = 0xFFFFFFFF0000FFFF
andq %rcx, %rsi
orq %rdx, %rsi
movq %rsi, 0x18(%rbx)
movzbl 0x1c(%r14), %ecx
shlq $0x20, %rcx
movabsq $-0xff00000001, %rdx    # imm = 0xFFFFFF00FFFFFFFF
andq %rsi, %rdx
orq %rcx, %rdx
movq %rdx, 0x18(%rbx)
movabsq $-0x10000000000, %rcx   # imm = 0xFFFFFF0000000000
andq 0x18(%r14), %rcx
movabsq $0xffffffffff, %rsi     # imm = 0xFFFFFFFFFF
andq %rdx, %rsi
orq %rcx, %rsi
movq %rsi, 0x18(%rbx)
movq 0x20(%r14), %rsi
cmpq %rsi, %rax
jae 0x31c7f
movq 0x30(%rbx), %rdi
callq 0x4860
movq %rax, 0x30(%rbx)
movq 0x20(%r14), %rax
movq %rax, 0x28(%rbx)
movq 0x20(%r14), %rdx
movq %rdx, 0x20(%rbx)
movq 0x30(%rbx), %rdi
movq 0x30(%r14), %rsi
callq 0x43c0
movq 0x38(%r14), %rsi
cmpq %rsi, 0x40(%rbx)
jae 0x31cb3
movq 0x48(%rbx), %rdi
callq 0x4860
movq %rax, 0x48(%rbx)
movq 0x38(%r14), %rax
movq %rax, 0x40(%rbx)
movq 0x38(%r14), %rdx
movq %rdx, 0x38(%rbx)
movq 0x48(%rbx), %rdi
movq 0x48(%r14), %rsi
callq 0x43c0
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/vcf.c
// Function: bcf_strerror
const char *bcf_strerror(int errorcode, char *buffer, size_t maxbuffer) {
    size_t usedup = 0;
    int ret = 0;
    int idx;

    if (!buffer || maxbuffer < 4)
        return NULL;           //invalid / insufficient buffer

    if (!errorcode) {
        buffer[0] = '\0';      //no error, set null
        return buffer;
    }

    for (idx = 0; idx < sizeof(errdesc_bcf) / sizeof(err_desc); ++idx) {
        if (errorcode & errdesc_bcf[idx].errorcode) {    //error is set, add description
            ret = add_desc_to_buffer(buffer, &usedup, maxbuffer, errdesc_bcf[idx].description);
            if (ret < 0)
                break;         //not enough space, ... added, no need to continue

            errorcode &= ~errdesc_bcf[idx].errorcode;    //reset the error
        }
    }

    if (errorcode && (ret >= 0))  {     //undescribed error is present in error code and had enough buffer, try to add unkonwn error as well§
        add_desc_to_buffer(buffer, &usedup, maxbuffer, "Unknown error");
    }
    return buffer;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq $0x0, (%rsp)
testq %rsi, %rsi
sete %al
cmpq $0x4, %rdx
setb %cl
orb %al, %cl
je 0x32d01
xorl %ebx, %ebx
jmp 0x32d6e
movq %rsi, %rbx
movl %edi, %ebp
testl %edi, %edi
je 0x32d6b
movq %rdx, %r14
xorl %eax, %eax
movl $0x8, %r12d
leaq 0x9ba24(%rip), %r13     # 0xce740
movl -0x8(%r12,%r13), %r15d
testl %ebp, %r15d
je 0x32d42
movq (%r12,%r13), %rcx
movq %rbx, %rdi
movq %rsp, %rsi
movq %r14, %rdx
callq 0x41e8a
testl %eax, %eax
js 0x32d4c
notl %r15d
andl %r15d, %ebp
addq $0x10, %r12
cmpq $0x78, %r12
jne 0x32d1c
testl %ebp, %ebp
je 0x32d6e
testl %eax, %eax
js 0x32d6e
leaq 0x7c710(%rip), %rcx     # 0xaf46b
movq %rsp, %rsi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x41e8a
jmp 0x32d6e
movb $0x0, (%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/vcf.c
// Function: bcf_hdr_set
int bcf_hdr_set(bcf_hdr_t *hdr, const char *fname)
{
    int i = 0, n = 0, save_errno;
    char **lines = hts_readlines(fname, &n);
    if ( !lines ) return 1;
    for (i=0; i<n-1; i++)
    {
        int k;
        bcf_hrec_t *hrec = bcf_hdr_parse_line(hdr,lines[i],&k);
        if (!hrec) goto fail;
        if (bcf_hdr_add_hrec(hdr, hrec) < 0) {
            bcf_hrec_destroy(hrec);
            goto fail;
        }
        free(lines[i]);
        lines[i] = NULL;
    }
    if (bcf_hdr_parse_sample_line(hdr, lines[n-1]) < 0) goto fail;
    if (bcf_hdr_sync(hdr) < 0) goto fail;
    free(lines[n-1]);
    free(lines);
    return 0;

 fail:
    save_errno = errno;
    for (; i < n; i++)
        free(lines[i]);
    free(lines);
    errno = save_errno;
    return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rax
movq %rdi, %r15
movq %rsp, %rsi
movl $0x0, (%rsi)
movq %rax, %rdi
callq 0xb5b1
movq %rax, %r14
movl $0x1, %eax
testq %r14, %r14
je 0x32e96
movl (%rsp), %eax
cmpl $0x2, %eax
jl 0x32e1c
xorl %ebp, %ebp
leaq 0x4(%rsp), %r12
movq (%r14,%rbp,8), %rsi
movq %r12, %rdx
callq 0x2c456
movl $0x5, %ebx
testq %rax, %rax
je 0x32e07
movq %rax, %r13
movq %r15, %rdi
movq %rax, %rsi
callq 0x2ce41
testl %eax, %eax
js 0x32dff
movq (%r14,%rbp,8), %rdi
callq 0x45c0
movq $0x0, (%r14,%rbp,8)
xorl %ebx, %ebx
jmp 0x32e07
movq %r13, %rdi
callq 0x2bd39
testl %ebx, %ebx
jne 0x32e58
incq %rbp
movslq (%rsp), %rax
decq %rax
cmpq %rax, %rbp
jl 0x32dc2
jmp 0x32e20
decl %eax
xorl %ebp, %ebp
cltq
movq (%r14,%rax,8), %rsi
movq %r15, %rdi
callq 0x2bb58
testl %eax, %eax
js 0x32e5d
movq %r15, %rdi
callq 0x2bc46
testl %eax, %eax
js 0x32e5d
movslq (%rsp), %rax
movq -0x8(%r14,%rax,8), %rdi
callq 0x45c0
movq %r14, %rdi
callq 0x45c0
xorl %eax, %eax
jmp 0x32e96
cmpl $0x5, %ebx
jne 0x32e96
callq 0x4050
movq %rax, %r15
movl (%rax), %ebx
cmpl (%rsp), %ebp
jge 0x32e84
movl %ebp, %r12d
movq (%r14,%r12,8), %rdi
callq 0x45c0
incq %r12
movslq (%rsp), %rax
cmpq %rax, %r12
jl 0x32e6f
movq %r14, %rdi
callq 0x45c0
movl %ebx, (%r15)
movl $0x1, %eax
jmp 0x32e96
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_format
static int _bcf_hrec_format(const bcf_hrec_t *hrec, int is_bcf, kstring_t *str)
{
    uint32_t e = 0;
    if ( !hrec->value )
    {
        int j, nout = 0;
        e |= ksprintf(str, "##%s=<", hrec->key) < 0;
        for (j=0; j<hrec->nkeys; j++)
        {
            // do not output IDX if output is VCF
            if ( !is_bcf && !strcmp("IDX",hrec->keys[j]) ) continue;
            if ( nout ) e |= kputc(',',str) < 0;
            e |= ksprintf(str,"%s=%s", hrec->keys[j], hrec->vals[j]) < 0;
            nout++;
        }
        e |= ksprintf(str,">\n") < 0;
    }
    else
        e |= ksprintf(str,"##%s=%s\n", hrec->key,hrec->value) < 0;

    return e == 0 ? 0 : -1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq 0x8(%rdi), %rdx
movq 0x10(%rdi), %rcx
testq %rcx, %rcx
je 0x32ee0
leaq 0x7b732(%rip), %rsi     # 0xae600
movq %rbx, %rdi
xorl %eax, %eax
callq 0x8b533
shrl $0x1f, %eax
jmp 0x32ffe
movl %esi, %r12d
movq %rdi, %r15
leaq 0x7b702(%rip), %rsi     # 0xae5ef
movq %rbx, %rdi
xorl %eax, %eax
callq 0x8b533
movl %eax, %ebp
shrl $0x1f, %ebp
cmpl $0x0, 0x18(%r15)
jle 0x32fe8
xorl %r13d, %r13d
xorl %r14d, %r14d
movl %r12d, 0x4(%rsp)
testl %r12d, %r12d
jne 0x32f33
movq 0x20(%r15), %rax
movq (%rax,%r13,8), %rsi
leaq 0x77afd(%rip), %rdi     # 0xaaa23
callq 0x46e0
testl %eax, %eax
je 0x32fca
testl %r14d, %r14d
je 0x32fa1
movq (%rbx), %rax
addq $0x2, %rax
cmpq %rax, 0x8(%rbx)
jae 0x32f80
movq %rax, %rcx
shrq $0x3e, %rcx
movq %rax, %rdx
shrq %rdx
testq %rcx, %rcx
movl $0x0, %r12d
cmoveq %rdx, %r12
addq %rax, %r12
movq 0x10(%rbx), %rdi
movq %r12, %rsi
callq 0x4860
testq %rax, %rax
je 0x32fdc
movq %rax, 0x10(%rbx)
movq %r12, 0x8(%rbx)
movl 0x4(%rsp), %r12d
movq (%rbx), %rax
movq 0x10(%rbx), %rcx
leaq 0x1(%rax), %rdx
movq %rdx, (%rbx)
movb $0x2c, (%rcx,%rax)
movq (%rbx), %rax
movq 0x10(%rbx), %rcx
movb $0x0, (%rcx,%rax)
xorl %eax, %eax
orl %eax, %ebp
movq 0x20(%r15), %rax
movq 0x28(%r15), %rcx
movq (%rax,%r13,8), %rdx
movq (%rcx,%r13,8), %rcx
movq %rbx, %rdi
leaq 0x7b7d9(%rip), %rsi     # 0xae794
xorl %eax, %eax
callq 0x8b533
shrl $0x1f, %eax
orl %eax, %ebp
incl %r14d
incq %r13
movslq 0x18(%r15), %rax
cmpq %rax, %r13
jl 0x32f12
jmp 0x32fe8
movl $0x1, %eax
movl 0x4(%rsp), %r12d
jmp 0x32f9f
leaq 0x7b60e(%rip), %rsi     # 0xae5fd
movq %rbx, %rdi
xorl %eax, %eax
callq 0x8b533
shrl $0x1f, %eax
orl %ebp, %eax
xorl %ecx, %ecx
negl %eax
sbbl %ecx, %ecx
movl %ecx, %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_hdr_fmt_text
char *bcf_hdr_fmt_text(const bcf_hdr_t *hdr, int is_bcf, int *len)
{
    kstring_t txt = {0,0,0};
    if (bcf_hdr_format(hdr, is_bcf, &txt) < 0)
        return NULL;
    if ( len ) *len = txt.l;
    return txt.s;
}

// Assembly:
pushq %rbx
subq $0x20, %rsp
movq %rdx, %rbx
xorps %xmm0, %xmm0
movq %rsp, %rdx
movaps %xmm0, (%rdx)
movq $0x0, 0x10(%rdx)
callq 0x30754
testl %eax, %eax
js 0x33048
testq %rbx, %rbx
je 0x33041
movl (%rsp), %eax
movl %eax, (%rbx)
movq 0x10(%rsp), %rax
jmp 0x3304a
xorl %eax, %eax
addq $0x20, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/./htslib/vcf.h
// Function: bcf_enc_size
static inline int bcf_enc_size(kstring_t *s, int size, int type)
{
    // Most common case is first
    if (size < 15) {
        if (ks_resize(s, s->l + 1) < 0)
            return -1;
        uint8_t *p = (uint8_t *)s->s + s->l;
        *p++ = (size<<4) | type;
        s->l++;
        return 0;
    }

    if (ks_resize(s, s->l + 6) < 0)
        return -1;
    uint8_t *p = (uint8_t *)s->s + s->l;
    *p++ = 15<<4|type;

    if (size < 128) {
        *p++ = 1<<4|BCF_BT_INT8;
        *p++ = size;
        s->l += 3;
    } else {
        if (size < 32768) {
            *p++ = 1<<4|BCF_BT_INT16;
            i16_to_le(size, p);
            s->l += 4;
        } else {
            *p++ = 1<<4|BCF_BT_INT32;
            i32_to_le(size, p);
            s->l += 6;
        }
    }
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %r14d
movl %esi, %ebp
movq %rdi, %rbx
movq (%rdi), %rax
movq 0x8(%rdi), %rcx
cmpl $0xe, %esi
jg 0x33797
incq %rax
cmpq %rax, %rcx
jae 0x3377c
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 0x33811
movq %rax, 0x10(%rbx)
movq %r15, 0x8(%rbx)
movq (%rbx), %rax
movq 0x10(%rbx), %rcx
shll $0x4, %ebp
orl %r14d, %ebp
movb %bpl, (%rcx,%rax)
movl $0x1, %eax
jmp 0x33826
addq $0x6, %rax
cmpq %rax, %rcx
jae 0x337d3
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 0x33811
movq %rax, 0x10(%rbx)
movq %r15, 0x8(%rbx)
movq (%rbx), %rax
movq 0x10(%rbx), %rcx
orb $-0x10, %r14b
movb %r14b, (%rcx,%rax)
cmpl $0x7f, %ebp
jg 0x337f8
movb $0x11, 0x1(%rcx,%rax)
movb %bpl, 0x2(%rcx,%rax)
movl $0x3, %eax
jmp 0x33826
cmpl $0x7fff, %ebp           # imm = 0x7FFF
jg 0x33818
movb $0x12, 0x1(%rcx,%rax)
movw %bp, 0x2(%rcx,%rax)
movl $0x4, %eax
jmp 0x33826
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x3382b
movb $0x13, 0x1(%rcx,%rax)
movl %ebp, 0x2(%rcx,%rax)
movl $0x6, %eax
addq %rax, (%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/vcf.c
// Function: bcf_enc_vfloat
int bcf_enc_vfloat(kstring_t *s, int n, float *a)
{
    assert(n >= 0);
    bcf_enc_size(s, n, BCF_BT_FLOAT);
    serialize_float_array(s, n, a);
    return 0; // FIXME: check for errs in this function
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testl %esi, %esi
js 0x338df
movq %rdx, %r14
movl %esi, %ebp
movq %rdi, %rbx
movl $0x5, %edx
callq 0x33722
movl %ebp, %r13d
leaq (,%r13,4), %r12
movq (%rbx), %rax
addq %r12, %rax
cmpq %rax, 0x8(%rbx)
jae 0x338a5
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 0x338ce
movq %rax, 0x10(%rbx)
movq %r15, 0x8(%rbx)
movq (%rbx), %rax
testl %ebp, %ebp
je 0x338c8
movq 0x10(%rbx), %rcx
addq %rax, %rcx
xorl %edx, %edx
movss (%r14,%rdx,4), %xmm0
movss %xmm0, (%rcx,%rdx,4)
incq %rdx
cmpq %rdx, %r13
jne 0x338b5
addq %r12, %rax
movq %rax, (%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x7b36a(%rip), %rdi     # 0xaec50
leaq 0x7ad36(%rip), %rsi     # 0xae623
leaq 0x7b363(%rip), %rcx     # 0xaec57
movl $0xaa4, %edx            # imm = 0xAA4
callq 0x42e0
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/./htslib/kstring.h
// Function: kputc_
static inline int kputc_(int c, kstring_t *s)
{
	if (ks_resize(s, s->l + 1) < 0)
		return EOF;
	s->s[s->l++] = c;
	return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movl %edi, %ebx
movq (%rsi), %rax
incq %rax
cmpq %rax, 0x8(%rsi)
jae 0x342aa
movq %rax, %rcx
shrq $0x3e, %rcx
movq %rax, %rdx
shrq %rdx
xorl %r15d, %r15d
testq %rcx, %rcx
cmoveq %rdx, %r15
addq %rax, %r15
movq 0x10(%r14), %rdi
movq %r15, %rsi
callq 0x4860
testq %rax, %rax
je 0x342bb
movq %rax, 0x10(%r14)
movq %r15, 0x8(%r14)
movq (%r14), %rax
movq 0x10(%r14), %rcx
leaq 0x1(%rax), %rdx
movq %rdx, (%r14)
movb %bl, (%rcx,%rax)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/vcf.c
// Function: bcf_fmt_sized_array
uint8_t *bcf_fmt_sized_array(kstring_t *s, uint8_t *ptr)
{
    int x, type;
    x = bcf_dec_size(ptr, &ptr, &type);
    bcf_fmt_array(s, x, type, ptr);
    return ptr + (x << bcf_type_shift[type]);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movzbl (%rsi), %r14d
cmpl $0xef, %r14d
jbe 0x342ff
movzbl 0x1(%rbx), %eax
andl $0xf, %eax
decl %eax
cmpl $0x3, %eax
ja 0x34354
leaq 0x799e5(%rip), %rcx     # 0xadcd0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movsbq 0x2(%rbx), %r15
addq $0x3, %rbx
jmp 0x34309
incq %rbx
movl %r14d, %r15d
shrl $0x4, %r15d
andl $0xf, %r14d
movl %r15d, %esi
movl %r14d, %edx
movq %rbx, %rcx
callq 0x3399d
leaq 0x9b1fe(%rip), %rax     # 0xcf520
movb (%r14,%rax), %cl
shll %cl, %r15d
movslq %r15d, %rax
addq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
movl 0x2(%rbx), %r15d
addq $0x6, %rbx
jmp 0x34309
movq 0x2(%rbx), %r15
addq $0xa, %rbx
jmp 0x34309
movswq 0x2(%rbx), %r15
addq $0x4, %rbx
jmp 0x34309
xorl %r15d, %r15d
jmp 0x34309
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/vcf.c
// Function: vcf_open_mode
int vcf_open_mode(char *mode, const char *fn, const char *format)
{
    if (format == NULL) {
        // Try to pick a format based on the filename extension
        char extension[HTS_MAX_EXT_LEN];
        if (find_file_extension(fn, extension) < 0) return -1;
        return vcf_open_mode(mode, fn, extension);
    }
    else if (strcasecmp(format, "bcf") == 0) strcpy(mode, "b");
    else if (strcasecmp(format, "vcf") == 0) strcpy(mode, "");
    else if (strcasecmp(format, "vcf.gz") == 0 || strcasecmp(format, "vcf.bgz") == 0) strcpy(mode, "z");
    else return -1;

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
testq %rdx, %rdx
je 0x38d6a
movq %rdx, %r15
leaq 0x7231f(%rip), %rsi     # 0xab034
movq %rdx, %rdi
callq 0x4520
testl %eax, %eax
je 0x38d86
leaq 0x72307(%rip), %rsi     # 0xab02f
movq %r15, %rdi
callq 0x4520
testl %eax, %eax
je 0x38d8d
leaq 0x722ec(%rip), %rsi     # 0xab027
movq %r15, %rdi
callq 0x4520
testl %eax, %eax
je 0x38d63
leaq 0x76048(%rip), %rsi     # 0xaed96
movq %r15, %rdi
callq 0x4520
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testl %eax, %eax
jne 0x38e8e
movw $0x7a, (%rbx)
jmp 0x38d90
movq %rsi, %r14
testq %rsi, %rsi
je 0x38d97
leaq 0x71d7d(%rip), %rsi     # 0xaaaf6
movq %r14, %rdi
callq 0x40d0
movq %rax, %r15
jmp 0x38d9a
movw $0x62, (%rbx)
jmp 0x38d90
movb $0x0, (%rbx)
xorl %ebp, %ebp
jmp 0x38e8e
xorl %r15d, %r15d
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testq %r14, %r14
je 0x38e8e
testq %r15, %r15
jne 0x38dbb
movq %r14, %rdi
callq 0x41c0
movq %rax, %r15
addq %r14, %r15
movq %r15, %rsi
cmpq %r14, %r15
setbe %al
jbe 0x38df7
movb (%r15), %al
andb $-0x2, %al
cmpb $0x2e, %al
jne 0x38dd6
xorl %eax, %eax
movq %r15, %rsi
jmp 0x38df7
leaq -0x1(%r15), %rsi
cmpq %r14, %rsi
setbe %al
jbe 0x38df4
movb (%rsi), %cl
andb $-0x2, %cl
decq %rsi
cmpb $0x2e, %cl
jne 0x38dda
incq %rsi
jmp 0x38df7
movq %r14, %rsi
testb %al, %al
jne 0x38e52
cmpb $0x2e, (%rsi)
jne 0x38e52
movq %r15, %rax
subq %rsi, %rax
cmpq $0x4, %rax
je 0x38e24
cmpq $0x3, %rax
jne 0x38e52
cmpb $0x67, 0x1(%rsi)
jne 0x38e1e
cmpb $0x7a, 0x2(%rsi)
je 0x38e36
cmpq $0x4, %rax
jne 0x38e52
cmpb $0x62, 0x1(%rsi)
jne 0x38e52
cmpb $0x67, 0x2(%rsi)
jne 0x38e52
cmpb $0x7a, 0x3(%rsi)
jne 0x38e52
decq %rsi
movq %rsi, %rax
movq %rax, %rsi
cmpq %r14, %rax
jbe 0x38e52
movb (%rsi), %cl
andb $-0x2, %cl
leaq -0x1(%rsi), %rax
cmpb $0x2e, %cl
jne 0x38e3c
cmpb $0x2e, (%rsi)
jne 0x38e8e
subq %rsi, %r15
leaq -0xa(%r15), %rax
cmpq $-0x7, %rax
jb 0x38e8e
incq %rsi
leaq -0x1(%r15), %rdx
leaq 0x7(%rsp), %r12
movq %r12, %rdi
callq 0x43c0
movb $0x0, 0x6(%rsp,%r15)
movq %rbx, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x38cf7
movl %eax, %ebp
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq