// File: /workspace/github_c_makefile_star2_O2/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 0x81eba(%rip), %rsi     # 0x8950f
callq 0xa70f
testq %rax, %rax
je 0x786c
movq %rax, %rbx
movq %rax, %rdi
callq 0x27ba6
testq %rax, %rax
je 0x788c
movq %rax, %r14
callq 0x2849e
testq %rax, %rax
je 0x78a1
movq %rax, %r15
leaq 0x4(%rsp), %rbp
pushq $0x1
popq %r13
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x288ae
testl %eax, %eax
jne 0x7798
andq $0x0, 0x10(%rsp)
andq $0x0, 0x8(%rsp)
andl $0x0, 0x4(%rsp)
movq %r14, %rdi
movq %r15, %rsi
leaq 0x8e88f(%rip), %rdx     # 0x95f57
leaq 0x10(%rsp), %rcx
movq %rbp, %r8
pushq $0x2
popq %r9
callq 0x32306
cmpq $0x3821, (%r15)         # imm = 0x3821
jne 0x7708
cmpl $0x1, %eax
jne 0x784c
movq 0x10(%rsp), %rdi
movss (%rdi), %xmm0
ucomiss 0x7c949(%rip), %xmm0    # 0x84044
jne 0x784c
jnp 0x773f
jmp 0x784c
cmpl $0x2, %eax
jne 0x7837
movq 0x10(%rsp), %rdi
movss (%rdi), %xmm0
ucomiss 0x7c91f(%rip), %xmm0    # 0x84040
jne 0x7837
jp 0x7837
leaq 0xacd9c(%rip), %rax     # 0xb44d0
movl (%rax), %eax
cmpl 0x4(%rdi), %eax
jne 0x7837
callq 0x45c0
xorl %r12d, %r12d
cmpq $0x3821, (%r15)         # imm = 0x3821
sete %r12b
orl $-0x80, %r12d
andl $0x0, 0x4(%rsp)
movq %r14, %rdi
movq %r15, %rsi
leaq 0x7d8d5(%rip), %rdx     # 0x8503d
leaq 0x8(%rsp), %rcx
movq %rbp, %r8
movl %r13d, %r9d
callq 0x32306
cmpl $0x1, %eax
jne 0x77c8
movq 0x8(%rsp), %rdi
movl (%rdi), %r8d
cmpl %r12d, %r8d
jne 0x7812
callq 0x45c0
jmp 0x7694
cmpl $-0x2, %eax
jle 0x78be
movq %r15, %rdi
callq 0x28630
movq %r14, %rdi
callq 0x27a34
movq %rbx, %rdi
callq 0xb8e5
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testl %eax, %eax
jns 0x77eb
movq 0xab80d(%rip), %rcx     # 0xb2fe0
movq (%rcx), %rdi
leaq 0x7e331(%rip), %rsi     # 0x85b0e
movl %r12d, %edx
movl %eax, %ecx
xorl %eax, %eax
callq 0x4720
jmp 0x782f
jne 0x780a
movq 0xab7ec(%rip), %rax     # 0xb2fe0
movq (%rax), %rdi
leaq 0x7e334(%rip), %rsi     # 0x85b32
movl %r12d, %edx
xorl %eax, %eax
callq 0x4720
jmp 0x782f
movq 0x8(%rsp), %rcx
movl (%rcx), %r8d
movq 0xab7c7(%rip), %rcx     # 0xb2fe0
movq (%rcx), %rdi
leaq 0x7e331(%rip), %rsi     # 0x85b54
movl %r12d, %edx
movl %eax, %ecx
xorl %eax, %eax
callq 0x4720
pushq $0x1
popq %rdi
callq 0x45f0
movq 0xab7a2(%rip), %rax     # 0xb2fe0
movq (%rax), %rcx
leaq 0x7e295(%rip), %rdi     # 0x85add
pushq $0x30
jmp 0x785f
movq 0xab78d(%rip), %rax     # 0xb2fe0
movq (%rax), %rcx
leaq 0x7e25c(%rip), %rdi     # 0x85ab9
pushq $0x23
popq %rsi
pushq $0x1
popq %rdx
callq 0x49b0
pushq $-0x1
jmp 0x7831
callq 0x4050
movl (%rax), %edi
callq 0x4140
leaq 0x7c7d0(%rip), %rdi     # 0x8404f
movq %r14, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0x5abc
callq 0x4050
movl (%rax), %edi
callq 0x4140
leaq 0x7de5f(%rip), %rdi     # 0x856fe
jmp 0x78b4
callq 0x4050
movl (%rax), %edi
callq 0x4140
leaq 0x7e1f7(%rip), %rdi     # 0x85aab
movq %rax, %rsi
xorl %eax, %eax
callq 0x5abc
leaq 0x7e2bf(%rip), %rdi     # 0x85b84
xorl %eax, %eax
callq 0x5abc