// File: /workspace/github_c_makefile_star2_O1/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 0xa41ea(%rip), %rsi     # 0xac04c
callq 0xbee7
testq %rax, %rax
je 0x7fa1
movq %rax, %r14
leaq 0xa8947(%rip), %rdi     # 0xb07c1
callq 0x317a9
testq %rax, %rax
je 0x7fc1
movq %rax, %r15
callq 0x32e93
testq %rax, %rax
je 0x7fd6
movq %rax, %r12
leaq 0xa5cea(%rip), %rsi     # 0xadb8d
movq %r15, %rdi
callq 0x30f5f
testl %eax, %eax
jne 0x7fee
leaq 0xa5d0a(%rip), %rsi     # 0xadbc4
movq %r15, %rdi
callq 0x30f5f
testl %eax, %eax
jne 0x7ffe
leaq 0xaceb0(%rip), %rsi     # 0xb4d81
movq %r15, %rdi
callq 0x2dfec
testl %eax, %eax
jne 0x800e
movq %r15, %rdi
xorl %esi, %esi
callq 0x2dfec
testl %eax, %eax
jne 0x801e
movq %r14, %rdi
movq %r15, %rsi
callq 0x32ad4
testl %eax, %eax
jne 0x7f92
leaq 0xcd5c3(%rip), %rax     # 0xd54d0
movl (%rax), %eax
movq %rsp, %rcx
movl %eax, (%rcx)
movl $0x423c70a4, 0x4(%rcx)  # imm = 0x423C70A4
leaq 0xcd5b2(%rip), %rax     # 0xd54d4
movl (%rax), %eax
movl %eax, 0x8(%rcx)
movl $0xaa071ba5, 0xc(%rcx)  # imm = 0xAA071BA5
leaq 0xa5d41(%rip), %rdx     # 0xadc76
movq %r15, %rdi
movq %r12, %rsi
movl $0x4, %r8d
movl $0x2, %r9d
callq 0x42483
testl %eax, %eax
jne 0x802e
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x34dc3
testl %eax, %eax
jne 0x7f92
movq %r12, %rdi
callq 0x33036
movq %r15, %rdi
callq 0x31cf6
movq %r14, %rdi
callq 0xd151
testl %eax, %eax
jne 0x8043
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0xa529d(%rip), %rdi     # 0xad236
movq %rbx, %rsi
jmp 0x803c
callq 0x4050
movl (%rax), %edi
callq 0x4140
leaq 0xa409b(%rip), %rdi     # 0xac04f
movq %rbx, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0x600c
callq 0x4050
movl (%rax), %edi
callq 0x4140
leaq 0xa4094(%rip), %rdi     # 0xac068
jmp 0x7fe9
callq 0x4050
movl (%rax), %edi
callq 0x4140
leaq 0xa4091(%rip), %rdi     # 0xac07a
movq %rax, %rsi
jmp 0x803c
leaq 0xa4094(%rip), %rdi     # 0xac089
leaq 0xa5ba1(%rip), %rsi     # 0xadb9d
jmp 0x803c
leaq 0xa4084(%rip), %rdi     # 0xac089
leaq 0xa5bf6(%rip), %rsi     # 0xadc02
jmp 0x803c
leaq 0xa4074(%rip), %rdi     # 0xac089
leaq 0xa5c3d(%rip), %rsi     # 0xadc59
jmp 0x803c
leaq 0xa4064(%rip), %rdi     # 0xac089
leaq 0xa51e6(%rip), %rsi     # 0xad212
jmp 0x803c
leaq 0xa4054(%rip), %rdi     # 0xac089
leaq 0xa5c3d(%rip), %rsi     # 0xadc79
xorl %eax, %eax
callq 0x600c
movq %rbx, %rdi
movl %eax, %esi
callq 0x4b11