// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
leaq 0xfdfc5(%rip), %rsi     # 0x10601c
callq 0xcf30
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x8090
movq -0x8(%rbp), %rax
movq %rax, -0x40(%rbp)
callq 0x4050
movl (%rax), %edi
callq 0x4120
movq -0x40(%rbp), %rsi
movq %rax, %rdx
leaq 0xfdf96(%rip), %rdi     # 0x10601f
movb $0x0, %al
callq 0x5ae0
leaq 0x102925(%rip), %rdi    # 0x10a9bc
callq 0x425e0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x80c4
callq 0x4050
movl (%rax), %edi
callq 0x4120
movq %rax, %rsi
leaq 0xfdf7b(%rip), %rdi     # 0x106038
movb $0x0, %al
callq 0x5ae0
callq 0x43c30
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x80f1
callq 0x4050
movl (%rax), %edi
callq 0x4120
movq %rax, %rsi
leaq 0xfdf60(%rip), %rdi     # 0x10604a
movb $0x0, %al
callq 0x5ae0
movq -0x18(%rbp), %rdi
leaq 0xffa61(%rip), %rsi     # 0x107b5d
callq 0x41c70
cmpl $0x0, %eax
jne 0x8108
jmp 0x811d
leaq 0xfdf4a(%rip), %rdi     # 0x106059
leaq 0xffa57(%rip), %rsi     # 0x107b6d
movb $0x0, %al
callq 0x5ae0
movq -0x18(%rbp), %rdi
leaq 0xffa6c(%rip), %rsi     # 0x107b94
callq 0x41c70
cmpl $0x0, %eax
jne 0x8134
jmp 0x8149
leaq 0xfdf1e(%rip), %rdi     # 0x106059
leaq 0xffa90(%rip), %rsi     # 0x107bd2
movb $0x0, %al
callq 0x5ae0
movq -0x18(%rbp), %rdi
leaq 0x106f7d(%rip), %rsi    # 0x10f0d1
callq 0x3da70
cmpl $0x0, %eax
jne 0x8160
jmp 0x8175
leaq 0xfdef2(%rip), %rdi     # 0x106059
leaq 0xffabb(%rip), %rsi     # 0x107c29
movb $0x0, %al
callq 0x5ae0
movq -0x18(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x3da70
cmpl $0x0, %eax
jne 0x8189
jmp 0x819e
leaq 0xfdec9(%rip), %rdi     # 0x106059
leaq 0xff04b(%rip), %rsi     # 0x1071e2
movb $0x0, %al
callq 0x5ae0
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x43790
cmpl $0x0, %eax
je 0x81c2
movq -0x8(%rbp), %rsi
leaq 0xff04b(%rip), %rdi     # 0x107206
movb $0x0, %al
callq 0x5ae0
leaq -0x30(%rbp), %rdi
leaq 0x124423(%rip), %rax    # 0x12c5f0
movl (%rax), %esi
callq 0x7300
movss 0xfde3c(%rip), %xmm0    # 0x106018
movss %xmm0, -0x2c(%rbp)
leaq -0x30(%rbp), %rdi
addq $0x8, %rdi
leaq 0x124404(%rip), %rax    # 0x12c5f4
movl (%rax), %esi
callq 0x7300
movss 0xfde15(%rip), %xmm0    # 0x106014
movss %xmm0, -0x24(%rbp)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
leaq -0x30(%rbp), %rcx
leaq 0xffa2f(%rip), %rdx     # 0x107c46
movl $0x4, %r8d
movl $0x2, %r9d
callq 0x518f0
cmpl $0x0, %eax
jne 0x822f
jmp 0x8244
leaq 0xfde23(%rip), %rdi     # 0x106059
leaq 0xffa0c(%rip), %rsi     # 0x107c49
movb $0x0, %al
callq 0x5ae0
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x46180
cmpl $0x0, %eax
je 0x826c
movq -0x8(%rbp), %rsi
leaq 0xfefa1(%rip), %rdi     # 0x107206
movb $0x0, %al
callq 0x5ae0
movq -0x20(%rbp), %rdi
callq 0x44020
movq -0x18(%rbp), %rdi
callq 0x42dd0
movq -0x10(%rbp), %rdi
callq 0xf050
movl %eax, -0x34(%rbp)
cmpl $0x0, %eax
je 0x82b6
movq 0x122d42(%rip), %rax    # 0x12afd8
movq (%rax), %rdi
movq -0x8(%rbp), %rdx
movl -0x34(%rbp), %ecx
leaq 0xff401(%rip), %rsi     # 0x1076a8
movb $0x0, %al
callq 0x4700
movl -0x34(%rbp), %edi
callq 0x45d0
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)