// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/test/test-vcf-api.c
// Function: write_format_values
void write_format_values(const char *fname)
{
    // Init
    htsFile *fp = hts_open(fname, "wb");
    if (!fp) error("Failed to open \"%s\" : %s", fname, strerror(errno));
    bcf_hdr_t *hdr = bcf_hdr_init("w");
    if (!hdr) error("bcf_hdr_init : %s", strerror(errno));
    bcf1_t *rec = bcf_init1();
    if (!rec) error("bcf_init1 : %s", strerror(errno));

    // Create VCF header
    check0(bcf_hdr_append(hdr, "##contig=<ID=1>"));
    check0(bcf_hdr_append(hdr, "##FORMAT=<ID=TF,Number=1,Type=Float,Description=\"Test Float\">"));
    check0(bcf_hdr_add_sample(hdr, "S"));
    check0(bcf_hdr_add_sample(hdr, NULL)); // to update internal structures
    if ( bcf_hdr_write(fp, hdr)!=0 ) error("Failed to write to %s\n", fname);

    // Add a record
    // .. FORMAT
    float test[4];
    bcf_float_set_missing(test[0]);
    test[1] = 47.11f;
    bcf_float_set_vector_end(test[2]);
    test[3] = -1.2e-13;
    check0(bcf_update_format_float(hdr, rec, "TF", test, 4));
    if ( bcf_write1(fp, hdr, rec)!=0 ) error("Failed to write to %s\n", fname);

    bcf_destroy1(rec);
    bcf_hdr_destroy(hdr);
    int ret;
    if ((ret = hts_close(fp)))
    {
        fprintf(stderr, "hts_close(%s): non-zero status %d\n", fname, ret);
        exit(ret);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0xa21ba(%rip), %rsi     # 0xaa04c
callq 0xbbc0
testq %rax, %rax
je 0x7fd1
movq %rax, %r14
leaq 0xa68c7(%rip), %rdi     # 0xae771
callq 0x305f9
testq %rax, %rax
je 0x7ff1
movq %rax, %r15
callq 0x31d1e
testq %rax, %rax
je 0x8006
movq %rax, %r12
leaq 0xa3cba(%rip), %rsi     # 0xabb8d
movq %r15, %rdi
callq 0x2fdb9
testl %eax, %eax
jne 0x801e
leaq 0xa3cda(%rip), %rsi     # 0xabbc4
movq %r15, %rdi
callq 0x2fdb9
testl %eax, %eax
jne 0x802e
leaq 0xaae90(%rip), %rsi     # 0xb2d91
movq %r15, %rdi
callq 0x2cf88
testl %eax, %eax
jne 0x803e
movq %r15, %rdi
xorl %esi, %esi
callq 0x2cf88
testl %eax, %eax
jne 0x804e
movq %r14, %rdi
movq %r15, %rsi
callq 0x3196a
testl %eax, %eax
jne 0x7fc2
leaq 0xcb593(%rip), %rax     # 0xd34d0
movl (%rax), %eax
movq %rsp, %rcx
movl %eax, (%rcx)
movl $0x423c70a4, 0x4(%rcx)  # imm = 0x423C70A4
leaq 0xcb582(%rip), %rax     # 0xd34d4
movl (%rax), %eax
movl %eax, 0x8(%rcx)
movl $0xaa071ba5, 0xc(%rcx)  # imm = 0xAA071BA5
leaq 0xa3d11(%rip), %rdx     # 0xabc76
movq %r15, %rdi
movq %r12, %rsi
movl $0x4, %r8d
movl $0x2, %r9d
callq 0x4168f
testl %eax, %eax
jne 0x805e
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x33c66
testl %eax, %eax
jne 0x7fc2
movq %r12, %rdi
callq 0x31ec9
movq %r15, %rdi
callq 0x30af4
movq %r14, %rdi
callq 0xce22
testl %eax, %eax
jne 0x8073
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0xa326d(%rip), %rdi     # 0xab236
movq %rbx, %rsi
jmp 0x806c
callq 0x4050
movl (%rax), %edi
callq 0x4140
leaq 0xa206b(%rip), %rdi     # 0xaa04f
movq %rbx, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0x602c
callq 0x4050
movl (%rax), %edi
callq 0x4140
leaq 0xa2064(%rip), %rdi     # 0xaa068
jmp 0x8019
callq 0x4050
movl (%rax), %edi
callq 0x4140
leaq 0xa2061(%rip), %rdi     # 0xaa07a
movq %rax, %rsi
jmp 0x806c
leaq 0xa2064(%rip), %rdi     # 0xaa089
leaq 0xa3b71(%rip), %rsi     # 0xabb9d
jmp 0x806c
leaq 0xa2054(%rip), %rdi     # 0xaa089
leaq 0xa3bc6(%rip), %rsi     # 0xabc02
jmp 0x806c
leaq 0xa2044(%rip), %rdi     # 0xaa089
leaq 0xa3c0d(%rip), %rsi     # 0xabc59
jmp 0x806c
leaq 0xa2034(%rip), %rdi     # 0xaa089
leaq 0xa31b6(%rip), %rsi     # 0xab212
jmp 0x806c
leaq 0xa2024(%rip), %rdi     # 0xaa089
leaq 0xa3c0d(%rip), %rsi     # 0xabc79
xorl %eax, %eax
callq 0x602c
movq %rbx, %rdi
movl %eax, %esi
callq 0x4b11