// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/test/test-vcf-api.c
// Function: test_get_info_values
void test_get_info_values(const char *fname)
{
    htsFile *fp = hts_open(fname, "r");
    if (!fp) error("Failed to open \"%s\" : %s", fname, strerror(errno));
    bcf_hdr_t *hdr = bcf_hdr_read(fp);
    if (!hdr) error("bcf_hdr_read : %s", strerror(errno));
    bcf1_t *line = bcf_init();
    if (!line) error("bcf_init : %s", strerror(errno));
    int r;
    while ((r = bcf_read(fp, hdr, line)) == 0)
    {
        float *afs = 0;
        int32_t *negs = NULL;
        int count = 0;
        int ret = bcf_get_info_float(hdr, line, "AF", &afs, &count);

        if (line->pos == 14369)
        {
            if (ret != 1 || afs[0] != 0.5f)
            {
                fprintf(stderr, "AF on position 14370 should be 0.5\n");
                exit(-1);
            }
        }
        else
        {
            if (ret != 2 || afs[0] != 0.333f || !bcf_float_is_missing(afs[1]))
            {
                fprintf(stderr, "AF on position 1110696 should be 0.333, missing\n");
                exit(-1);
            }
        }

        free(afs);

        int32_t expected = (line->pos == 14369)? -127 : -128;
        count = 0;
        ret = bcf_get_info_int32(hdr, line, "NEG", &negs, &count);
        if (ret != 1 || negs[0] != expected)
        {
            if (ret < 0)
                fprintf(stderr, "NEG should be %d, got error ret=%d\n", expected, ret);
            else if (ret == 0)
                fprintf(stderr, "NEG should be %d, got no entries\n", expected);
            else
                fprintf(stderr, "NEG should be %d, got %d entries (first is %d)\n", expected, ret, negs[0]);
            exit(1);
        }
        free(negs);
    }
    if (r < -1) error("bcf_read");

    bcf_destroy(line);
    bcf_hdr_destroy(hdr);
    hts_close(fp);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %r14
leaq 0xa792e(%rip), %rsi     # 0xaf544
callq 0xbbc0
testq %rax, %rax
je 0x7e1d
movq %rax, %rbx
movq %rax, %rdi
callq 0x30c97
testq %rax, %rax
je 0x7e3d
movq %rax, %r14
callq 0x31d1e
testq %rax, %rax
je 0x7e52
movq %rax, %r15
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x322f9
testl %eax, %eax
jne 0x7d72
xorl %r13d, %r13d
leaq 0x4(%rsp), %rbp
movq %r13, 0x10(%rsp)
movq %r13, 0x8(%rsp)
movl $0x0, 0x4(%rsp)
movq %r14, %rdi
movq %r15, %rsi
leaq 0xb4c0e(%rip), %rdx     # 0xbc897
leaq 0x10(%rsp), %rcx
movq %rbp, %r8
movl $0x2, %r9d
callq 0x42bb2
cmpq $0x3821, (%r15)         # imm = 0x3821
jne 0x7ccb
cmpl $0x1, %eax
jne 0x7e18
movq 0x10(%rsp), %rdi
movss (%rdi), %xmm0
ucomiss 0xa2386(%rip), %xmm0    # 0xaa044
jne 0x7e18
jnp 0x7d02
jmp 0x7e18
cmpl $0x2, %eax
jne 0x7e13
movq 0x10(%rsp), %rdi
movss (%rdi), %xmm0
ucomiss 0xa235c(%rip), %xmm0    # 0xaa040
jne 0x7e13
jp 0x7e13
leaq 0xcb7d9(%rip), %rax     # 0xd34d0
movl (%rax), %eax
cmpl 0x4(%rdi), %eax
jne 0x7e13
callq 0x45c0
xorl %r12d, %r12d
cmpq $0x3821, (%r15)         # imm = 0x3821
sete %r12b
orl $-0x80, %r12d
movl $0x0, 0x4(%rsp)
movq %r14, %rdi
movq %r15, %rsi
leaq 0xa330f(%rip), %rdx     # 0xab03d
leaq 0x8(%rsp), %rcx
movq %rbp, %r8
movl $0x1, %r9d
callq 0x42bb2
cmpl $0x1, %eax
jne 0x7da2
movq 0x8(%rsp), %rdi
movl (%rdi), %r8d
cmpl %r12d, %r8d
jne 0x7dec
callq 0x45c0
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x322f9
testl %eax, %eax
je 0x7c6a
cmpl $-0x2, %eax
jle 0x7e6f
movq %r15, %rdi
callq 0x31ec9
movq %r14, %rdi
callq 0x30af4
movq %rbx, %rdi
callq 0xce22
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testl %eax, %eax
jns 0x7dc5
movq 0xca233(%rip), %rcx     # 0xd1fe0
movq (%rcx), %rdi
leaq 0xa3d57(%rip), %rsi     # 0xabb0e
movl %r12d, %edx
movl %eax, %ecx
xorl %eax, %eax
callq 0x4720
jmp 0x7e09
jne 0x7de4
movq 0xca212(%rip), %rax     # 0xd1fe0
movq (%rax), %rdi
leaq 0xa3d5a(%rip), %rsi     # 0xabb32
movl %r12d, %edx
xorl %eax, %eax
callq 0x4720
jmp 0x7e09
movq 0x8(%rsp), %rcx
movl (%rcx), %r8d
movq 0xca1ed(%rip), %rcx     # 0xd1fe0
movq (%rcx), %rdi
leaq 0xa3d57(%rip), %rsi     # 0xabb54
movl %r12d, %edx
movl %eax, %ecx
xorl %eax, %eax
callq 0x4720
movl $0x1, %edi
callq 0x45f0
callq 0x4ac7
callq 0x4aec
callq 0x4050
movl (%rax), %edi
callq 0x4140
leaq 0xa221f(%rip), %rdi     # 0xaa04f
movq %r14, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0x602c
callq 0x4050
movl (%rax), %edi
callq 0x4140
leaq 0xa38ae(%rip), %rdi     # 0xab6fe
jmp 0x7e65
callq 0x4050
movl (%rax), %edi
callq 0x4140
leaq 0xa3c46(%rip), %rdi     # 0xabaab
movq %rax, %rsi
xorl %eax, %eax
callq 0x602c
leaq 0xa3d0e(%rip), %rdi     # 0xabb84
xorl %eax, %eax
callq 0x602c