// File: /workspace/github_c_makefile_star2_O2/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 %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0x7c76a(%rip), %rsi     # 0x8404c
callq 0xa70f
testq %rax, %rax
je 0x7a1e
movq %rax, %r14
leaq 0x80e37(%rip), %rdi     # 0x88731
callq 0x275a7
testq %rax, %rax
je 0x7a3e
movq %rax, %r15
callq 0x2849e
testq %rax, %rax
je 0x7a53
movq %rax, %r12
leaq 0x7e26a(%rip), %rsi     # 0x85b8d
movq %r15, %rdi
callq 0x26fc2
testl %eax, %eax
jne 0x7a6b
leaq 0x7e28a(%rip), %rsi     # 0x85bc4
movq %r15, %rdi
callq 0x26fc2
testl %eax, %eax
jne 0x7a7b
leaq 0x851b8(%rip), %rsi     # 0x8cb09
movq %r15, %rdi
callq 0x249dc
testl %eax, %eax
jne 0x7a8b
movq %r15, %rdi
xorl %esi, %esi
callq 0x249dc
testl %eax, %eax
jne 0x7a9b
movq %r14, %rdi
movq %r15, %rsi
callq 0x281c9
testl %eax, %eax
jne 0x7a0f
leaq 0xacb43(%rip), %rax     # 0xb44d0
movl (%rax), %eax
movq %rsp, %rcx
movl %eax, (%rcx)
movl $0x423c70a4, 0x4(%rcx)  # imm = 0x423C70A4
leaq 0xacb32(%rip), %rax     # 0xb44d4
movl (%rax), %eax
movl %eax, 0x8(%rcx)
movl $0xaa071ba5, 0xc(%rcx)  # imm = 0xAA071BA5
leaq 0x7e2c1(%rip), %rdx     # 0x85c76
pushq $0x4
popq %r8
pushq $0x2
popq %r9
movq %r15, %rdi
movq %r12, %rsi
callq 0x3156c
testl %eax, %eax
jne 0x7aab
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x298d5
testl %eax, %eax
jne 0x7a0f
movq %r12, %rdi
callq 0x28630
movq %r15, %rdi
callq 0x27a34
movq %r14, %rdi
callq 0xb8e5
testl %eax, %eax
jne 0x7ac0
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x7d820(%rip), %rdi     # 0x85236
movq %rbx, %rsi
jmp 0x7ab9
callq 0x4050
movl (%rax), %edi
callq 0x4140
leaq 0x7c61e(%rip), %rdi     # 0x8404f
movq %rbx, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0x5abc
callq 0x4050
movl (%rax), %edi
callq 0x4140
leaq 0x7c617(%rip), %rdi     # 0x84068
jmp 0x7a66
callq 0x4050
movl (%rax), %edi
callq 0x4140
leaq 0x7c614(%rip), %rdi     # 0x8407a
movq %rax, %rsi
jmp 0x7ab9
leaq 0x7c617(%rip), %rdi     # 0x84089
leaq 0x7e124(%rip), %rsi     # 0x85b9d
jmp 0x7ab9
leaq 0x7c607(%rip), %rdi     # 0x84089
leaq 0x7e179(%rip), %rsi     # 0x85c02
jmp 0x7ab9
leaq 0x7c5f7(%rip), %rdi     # 0x84089
leaq 0x7e1c0(%rip), %rsi     # 0x85c59
jmp 0x7ab9
leaq 0x7c5e7(%rip), %rdi     # 0x84089
leaq 0x7d769(%rip), %rsi     # 0x85212
jmp 0x7ab9
leaq 0x7c5d7(%rip), %rdi     # 0x84089
leaq 0x7e1c0(%rip), %rsi     # 0x85c79
xorl %eax, %eax
callq 0x5abc
movl %eax, %ebp
movq 0xab517(%rip), %rax     # 0xb2fe0
movq (%rax), %rdi
leaq 0x7dc05(%rip), %rsi     # 0x856d8
movq %rbx, %rdx
movl %ebp, %ecx
xorl %eax, %eax
callq 0x4720
movl %ebp, %edi
callq 0x45f0