// File: /workspace/github_c_makefile_star2_O1/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 0xa99a0(%rip), %rsi     # 0xb1599
callq 0xbee7
testq %rax, %rax
je 0x7ded
movq %rax, %rbx
movq %rax, %rdi
callq 0x31e8f
testq %rax, %rax
je 0x7e0d
movq %rax, %r14
callq 0x32e93
testq %rax, %rax
je 0x7e22
movq %rax, %r15
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x3346e
testl %eax, %eax
jne 0x7d53
xorl %r13d, %r13d
leaq 0x4(%rsp), %rbp
movq %r13, 0x8(%rsp)
movq %r13, 0x10(%rsp)
movl $0x0, 0x4(%rsp)
movq %r14, %rdi
movq %r15, %rsi
leaq 0xb64db(%rip), %rdx     # 0xbe147
leaq 0x8(%rsp), %rcx
movq %rbp, %r8
movl $0x2, %r9d
callq 0x439f7
cmpq $0x3821, (%r15)         # imm = 0x3821
jne 0x7cae
cmpl $0x1, %eax
jne 0x7dc3
movq 0x8(%rsp), %rax
movss (%rax), %xmm0
ucomiss 0xa43a3(%rip), %xmm0    # 0xac044
jne 0x7dc3
jnp 0x7ce5
jmp 0x7dc3
cmpl $0x2, %eax
jne 0x7da6
movq 0x8(%rsp), %rax
movss (%rax), %xmm0
ucomiss 0xa4379(%rip), %xmm0    # 0xac040
jne 0x7da6
jp 0x7da6
leaq 0xcd7f6(%rip), %rcx     # 0xd54d0
movl (%rcx), %ecx
cmpl 0x4(%rax), %ecx
jne 0x7da6
movq 0x8(%rsp), %rdi
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 0xa5327(%rip), %rdx     # 0xad03d
leaq 0x10(%rsp), %rcx
movq %rbp, %r8
movl $0x1, %r9d
callq 0x439f7
cmpl $0x1, %eax
jne 0x7d83
movq 0x10(%rsp), %rdi
cmpl %r12d, (%rdi)
jne 0x7d83
callq 0x45c0
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x3346e
testl %eax, %eax
je 0x7c4d
cmpl $-0x2, %eax
jle 0x7e3f
movq %r15, %rdi
callq 0x33036
movq %r14, %rdi
callq 0x31cf6
movq %rbx, %rdi
callq 0xd151
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xcc256(%rip), %rcx     # 0xd3fe0
testl %eax, %eax
jns 0x7dab
movq (%rcx), %rdi
leaq 0xa5d76(%rip), %rsi     # 0xadb0e
movl %r12d, %edx
movl %eax, %ecx
xorl %eax, %eax
callq 0x4720
jmp 0x7de3
callq 0x4ac7
movq (%rcx), %rdi
jne 0x7dc8
leaq 0xa5d7b(%rip), %rsi     # 0xadb32
movl %r12d, %edx
xorl %eax, %eax
callq 0x4720
jmp 0x7de3
callq 0x4aec
movq 0x10(%rsp), %rcx
movl (%rcx), %r8d
leaq 0xa5d7d(%rip), %rsi     # 0xadb54
movl %r12d, %edx
movl %eax, %ecx
xorl %eax, %eax
callq 0x4720
movl $0x1, %edi
callq 0x45f0
callq 0x4050
movl (%rax), %edi
callq 0x4140
leaq 0xa424f(%rip), %rdi     # 0xac04f
movq %r14, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0x600c
callq 0x4050
movl (%rax), %edi
callq 0x4140
leaq 0xa58de(%rip), %rdi     # 0xad6fe
jmp 0x7e35
callq 0x4050
movl (%rax), %edi
callq 0x4140
leaq 0xa5c76(%rip), %rdi     # 0xadaab
movq %rax, %rsi
xorl %eax, %eax
callq 0x600c
leaq 0xa5d3e(%rip), %rdi     # 0xadb84
xorl %eax, %eax
callq 0x600c