// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/vcf.c
// Function: bcf_get_info_values
int bcf_get_info_values(const bcf_hdr_t *hdr, bcf1_t *line, const char *tag, void **dst, int *ndst, int type)
{
    int i, ret = -4, tag_id = bcf_hdr_id2int(hdr, BCF_DT_ID, tag);
    if ( !bcf_hdr_idinfo_exists(hdr,BCF_HL_INFO,tag_id) ) return -1;    // no such INFO field in the header
    if ( bcf_hdr_id2type(hdr,BCF_HL_INFO,tag_id)!=(type & 0xff) ) return -2;     // expected different type

    if ( !(line->unpacked & BCF_UN_INFO) ) bcf_unpack(line, BCF_UN_INFO);

    for (i=0; i<line->n_info; i++)
        if ( line->d.info[i].key==tag_id ) break;
    if ( i==line->n_info ) return ( type==BCF_HT_FLAG ) ? 0 : -3;       // the tag is not present in this record
    if ( type==BCF_HT_FLAG ) return 1;

    bcf_info_t *info = &line->d.info[i];
    if ( !info->vptr ) return -3;           // the tag was marked for removal
    if ( type==BCF_HT_STR )
    {
        if ( *ndst < info->len+1 )
        {
            *ndst = info->len + 1;
            *dst  = realloc(*dst, *ndst);
        }
        memcpy(*dst,info->vptr,info->len);
        ((uint8_t*)*dst)[info->len] = 0;
        return info->len;
    }

    // Make sure the buffer is big enough
    int size1;
    switch (type) {
        case BCF_HT_INT:  size1 = sizeof(int32_t); break;
        case BCF_HT_LONG: size1 = sizeof(int64_t); break;
        case BCF_HT_REAL: size1 = sizeof(float); break;
        default:
            hts_log_error("Unexpected output type %d at %s:%"PRIhts_pos, type, bcf_seqname_safe(hdr,line), line->pos+1);
            return -2;
    }
    if ( *ndst < info->len )
    {
        *ndst = info->len;
        *dst  = realloc(*dst, *ndst * size1);
    }

    #define BRANCH(type_t, convert, is_missing, is_vector_end, set_missing, set_regular, out_type_t) do { \
        out_type_t *tmp = (out_type_t *) *dst; \
        int j; \
        for (j=0; j<info->len; j++) \
        { \
            type_t p = convert(info->vptr + j * sizeof(type_t)); \
            if ( is_vector_end ) break; \
            if ( is_missing ) set_missing; \
            else set_regular; \
            tmp++; \
        } \
        ret = j; \
    } while (0)
    switch (info->type) {
        case BCF_BT_INT8:
            if (type == BCF_HT_LONG) {
                BRANCH(int8_t,  le_to_i8,  p==bcf_int8_missing,  p==bcf_int8_vector_end,  *tmp=bcf_int64_missing, *tmp=p, int64_t);
            } else {
                BRANCH(int8_t,  le_to_i8,  p==bcf_int8_missing,  p==bcf_int8_vector_end,  *tmp=bcf_int32_missing, *tmp=p, int32_t);
            }
            break;
        case BCF_BT_INT16:
            if (type == BCF_HT_LONG) {
                BRANCH(int16_t, le_to_i16, p==bcf_int16_missing, p==bcf_int16_vector_end, *tmp=bcf_int64_missing, *tmp=p, int64_t);
            } else {
                BRANCH(int16_t, le_to_i16, p==bcf_int16_missing, p==bcf_int16_vector_end, *tmp=bcf_int32_missing, *tmp=p, int32_t);
            }
            break;
        case BCF_BT_INT32:
            if (type == BCF_HT_LONG) {
                BRANCH(int32_t, le_to_i32, p==bcf_int32_missing, p==bcf_int32_vector_end, *tmp=bcf_int64_missing, *tmp=p, int64_t); break;
            } else {
                BRANCH(int32_t, le_to_i32, p==bcf_int32_missing, p==bcf_int32_vector_end, *tmp=bcf_int32_missing, *tmp=p, int32_t); break;
            }
        case BCF_BT_FLOAT: BRANCH(uint32_t, le_to_u32, p==bcf_float_missing, p==bcf_float_vector_end, bcf_float_set_missing(*tmp), bcf_float_set(tmp, p), float); break;
        default: hts_log_error("Unexpected type %d at %s:%"PRIhts_pos, info->type, bcf_seqname_safe(hdr,line), line->pos+1); return -2;
    }
    #undef BRANCH
    return ret;  // set by BRANCH
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movl %r9d, -0x34(%rbp)
movl $0xfffffffc, -0x3c(%rbp) # imm = 0xFFFFFFFC
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rdx
xorl %esi, %esi
callq 0x3e820
movl %eax, -0x40(%rbp)
cmpl $0x0, -0x40(%rbp)
jl 0x5006b
movl -0x40(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl (%rcx), %eax
jge 0x5006b
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x40(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
cmpq $0x0, 0x8(%rax)
je 0x5006b
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x40(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rax
andq $0xf, %rax
cmpl $0xf, %eax
jne 0x50077
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x50842
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x40(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rax
shrq $0x4, %rax
andq $0xf, %rax
movl -0x34(%rbp), %ecx
andl $0xff, %ecx
cmpl %ecx, %eax
je 0x500b3
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x50842
movq -0x18(%rbp), %rax
movl 0xbc(%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
jne 0x500d3
movq -0x18(%rbp), %rdi
movl $0x4, %esi
callq 0x48110
movl $0x0, -0x38(%rbp)
movl -0x38(%rbp), %eax
movq -0x18(%rbp), %rcx
movq 0x18(%rcx), %rcx
andq $0xffff, %rcx           # imm = 0xFFFF
cmpl %ecx, %eax
jge 0x5011c
movq -0x18(%rbp), %rax
movq 0x90(%rax), %rax
movslq -0x38(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
cmpl -0x40(%rbp), %eax
jne 0x5010f
jmp 0x5011c
jmp 0x50111
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x500da
movl -0x38(%rbp), %eax
movq -0x18(%rbp), %rcx
movq 0x18(%rcx), %rcx
andq $0xffff, %rcx           # imm = 0xFFFF
cmpl %ecx, %eax
jne 0x5014a
movl -0x34(%rbp), %edx
movl $0xfffffffd, %eax       # imm = 0xFFFFFFFD
xorl %ecx, %ecx
cmpl $0x0, %edx
cmovel %ecx, %eax
movl %eax, -0x4(%rbp)
jmp 0x50842
cmpl $0x0, -0x34(%rbp)
jne 0x5015c
movl $0x1, -0x4(%rbp)
jmp 0x50842
movq -0x18(%rbp), %rax
movq 0x90(%rax), %rax
movslq -0x38(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
cmpq $0x0, 0x10(%rax)
jne 0x5018d
movl $0xfffffffd, -0x4(%rbp) # imm = 0xFFFFFFFD
jmp 0x50842
cmpl $0x3, -0x34(%rbp)
jne 0x50212
movq -0x30(%rbp), %rax
movl (%rax), %eax
movq -0x48(%rbp), %rcx
movl 0x20(%rcx), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
jge 0x501d4
movq -0x48(%rbp), %rax
movl 0x20(%rax), %ecx
addl $0x1, %ecx
movq -0x30(%rbp), %rax
movl %ecx, (%rax)
movq -0x28(%rbp), %rax
movq (%rax), %rdi
movq -0x30(%rbp), %rax
movslq (%rax), %rsi
callq 0x4840
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movq -0x28(%rbp), %rax
movq (%rax), %rdi
movq -0x48(%rbp), %rax
movq 0x10(%rax), %rsi
movq -0x48(%rbp), %rax
movslq 0x20(%rax), %rdx
callq 0x43b0
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq -0x48(%rbp), %rcx
movslq 0x20(%rcx), %rcx
movb $0x0, (%rax,%rcx)
movq -0x48(%rbp), %rax
movl 0x20(%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x50842
movl -0x34(%rbp), %eax
movl %eax, -0xc4(%rbp)
subl $0x1, %eax
je 0x5023e
jmp 0x50222
movl -0xc4(%rbp), %eax
subl $0x2, %eax
je 0x50250
jmp 0x5022f
movl -0xc4(%rbp), %eax
subl $0x101, %eax            # imm = 0x101
je 0x50247
jmp 0x50259
movl $0x4, -0x4c(%rbp)
jmp 0x502a9
movl $0x8, -0x4c(%rbp)
jmp 0x502a9
movl $0x4, -0x4c(%rbp)
jmp 0x502a9
movl -0x34(%rbp), %eax
movl %eax, -0xc8(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x43520
movl -0xc8(%rbp), %ecx
movq %rax, %r8
movq -0x18(%rbp), %rax
movq (%rax), %r9
addq $0x1, %r9
movl $0x1, %edi
leaq 0xb820e(%rip), %rsi     # 0x10849d
leaq 0xb821b(%rip), %rdx     # 0x1084b1
movb $0x0, %al
callq 0x9d90
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x50842
movq -0x30(%rbp), %rax
movl (%rax), %eax
movq -0x48(%rbp), %rcx
cmpl 0x20(%rcx), %eax
jge 0x502e8
movq -0x48(%rbp), %rax
movl 0x20(%rax), %ecx
movq -0x30(%rbp), %rax
movl %ecx, (%rax)
movq -0x28(%rbp), %rax
movq (%rax), %rdi
movq -0x30(%rbp), %rax
movl (%rax), %eax
imull -0x4c(%rbp), %eax
movslq %eax, %rsi
callq 0x4840
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movq -0x48(%rbp), %rax
movl 0x4(%rax), %eax
decl %eax
movl %eax, %ecx
movq %rcx, -0xd0(%rbp)
subl $0x4, %eax
ja 0x507eb
movq -0xd0(%rbp), %rax
leaq 0xb6cdb(%rip), %rcx     # 0x106fec
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
cmpl $0x101, -0x34(%rbp)     # imm = 0x101
jne 0x503b7
jmp 0x50329
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x58(%rbp)
movl $0x0, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
movq -0x48(%rbp), %rcx
cmpl 0x20(%rcx), %eax
jge 0x503ac
movq -0x48(%rbp), %rax
movq 0x10(%rax), %rdi
movslq -0x5c(%rbp), %rax
shlq $0x0, %rax
addq %rax, %rdi
callq 0x45340
movb %al, -0x5d(%rbp)
movsbl -0x5d(%rbp), %eax
cmpl $-0x7f, %eax
jne 0x5036d
jmp 0x503ac
movsbl -0x5d(%rbp), %eax
cmpl $-0x80, %eax
jne 0x50389
movq -0x58(%rbp), %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
movq %rcx, (%rax)
jmp 0x50395
movsbq -0x5d(%rbp), %rcx
movq -0x58(%rbp), %rax
movq %rcx, (%rax)
movq -0x58(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x58(%rbp)
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0x5033b
movl -0x5c(%rbp), %eax
movl %eax, -0x3c(%rbp)
jmp 0x5043b
jmp 0x503b9
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x68(%rbp)
movl $0x0, -0x6c(%rbp)
movl -0x6c(%rbp), %eax
movq -0x48(%rbp), %rcx
cmpl 0x20(%rcx), %eax
jge 0x50433
movq -0x48(%rbp), %rax
movq 0x10(%rax), %rdi
movslq -0x6c(%rbp), %rax
shlq $0x0, %rax
addq %rax, %rdi
callq 0x45340
movb %al, -0x6d(%rbp)
movsbl -0x6d(%rbp), %eax
cmpl $-0x7f, %eax
jne 0x503fd
jmp 0x50433
movsbl -0x6d(%rbp), %eax
cmpl $-0x80, %eax
jne 0x50412
movq -0x68(%rbp), %rax
movl $0x80000000, (%rax)     # imm = 0x80000000
jmp 0x5041c
movsbl -0x6d(%rbp), %ecx
movq -0x68(%rbp), %rax
movl %ecx, (%rax)
movq -0x68(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x68(%rbp)
movl -0x6c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x6c(%rbp)
jmp 0x503cb
movl -0x6c(%rbp), %eax
movl %eax, -0x3c(%rbp)
jmp 0x5043b
jmp 0x5083c
cmpl $0x101, -0x34(%rbp)     # imm = 0x101
jne 0x504e1
jmp 0x5044f
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x78(%rbp)
movl $0x0, -0x7c(%rbp)
movl -0x7c(%rbp), %eax
movq -0x48(%rbp), %rcx
cmpl 0x20(%rcx), %eax
jge 0x504d6
movq -0x48(%rbp), %rax
movq 0x10(%rax), %rdi
movslq -0x7c(%rbp), %rax
shlq %rax
addq %rax, %rdi
callq 0x45390
movw %ax, -0x7e(%rbp)
movswl -0x7e(%rbp), %eax
cmpl $0xffff8001, %eax       # imm = 0xFFFF8001
jne 0x50495
jmp 0x504d6
movswl -0x7e(%rbp), %eax
cmpl $0xffff8000, %eax       # imm = 0xFFFF8000
jne 0x504b3
movq -0x78(%rbp), %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
movq %rcx, (%rax)
jmp 0x504bf
movswq -0x7e(%rbp), %rcx
movq -0x78(%rbp), %rax
movq %rcx, (%rax)
movq -0x78(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x78(%rbp)
movl -0x7c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x7c(%rbp)
jmp 0x50461
movl -0x7c(%rbp), %eax
movl %eax, -0x3c(%rbp)
jmp 0x5059d
jmp 0x504e3
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x88(%rbp)
movl $0x0, -0x8c(%rbp)
movl -0x8c(%rbp), %eax
movq -0x48(%rbp), %rcx
cmpl 0x20(%rcx), %eax
jge 0x50592
movq -0x48(%rbp), %rax
movq 0x10(%rax), %rdi
movslq -0x8c(%rbp), %rax
shlq %rax
addq %rax, %rdi
callq 0x45390
movw %ax, -0x8e(%rbp)
movswl -0x8e(%rbp), %eax
cmpl $0xffff8001, %eax       # imm = 0xFFFF8001
jne 0x5053f
jmp 0x50592
movswl -0x8e(%rbp), %eax
cmpl $0xffff8000, %eax       # imm = 0xFFFF8000
jne 0x5055c
movq -0x88(%rbp), %rax
movl $0x80000000, (%rax)     # imm = 0x80000000
jmp 0x5056c
movswl -0x8e(%rbp), %ecx
movq -0x88(%rbp), %rax
movl %ecx, (%rax)
movq -0x88(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x88(%rbp)
movl -0x8c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8c(%rbp)
jmp 0x504fb
movl -0x8c(%rbp), %eax
movl %eax, -0x3c(%rbp)
jmp 0x5059d
jmp 0x5083c
cmpl $0x101, -0x34(%rbp)     # imm = 0x101
jne 0x50672
jmp 0x505b1
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x98(%rbp)
movl $0x0, -0x9c(%rbp)
movl -0x9c(%rbp), %eax
movq -0x48(%rbp), %rcx
cmpl 0x20(%rcx), %eax
jge 0x50664
movq -0x48(%rbp), %rax
movq 0x10(%rax), %rdi
movslq -0x9c(%rbp), %rax
shlq $0x2, %rax
addq %rax, %rdi
callq 0x453e0
movl %eax, -0xa0(%rbp)
cmpl $0x80000001, -0xa0(%rbp) # imm = 0x80000001
jne 0x5060b
jmp 0x50664
cmpl $0x80000000, -0xa0(%rbp) # imm = 0x80000000
jne 0x5062d
movq -0x98(%rbp), %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
movq %rcx, (%rax)
jmp 0x5063e
movslq -0xa0(%rbp), %rcx
movq -0x98(%rbp), %rax
movq %rcx, (%rax)
movq -0x98(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x98(%rbp)
movl -0x9c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x9c(%rbp)
jmp 0x505c9
movl -0x9c(%rbp), %eax
movl %eax, -0x3c(%rbp)
jmp 0x5083c
jmp 0x50674
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq %rax, -0xa8(%rbp)
movl $0x0, -0xac(%rbp)
movl -0xac(%rbp), %eax
movq -0x48(%rbp), %rcx
cmpl 0x20(%rcx), %eax
jge 0x5071a
movq -0x48(%rbp), %rax
movq 0x10(%rax), %rdi
movslq -0xac(%rbp), %rax
shlq $0x2, %rax
addq %rax, %rdi
callq 0x453e0
movl %eax, -0xb0(%rbp)
cmpl $0x80000001, -0xb0(%rbp) # imm = 0x80000001
jne 0x506ca
jmp 0x5071a
cmpl $0x80000000, -0xb0(%rbp) # imm = 0x80000000
jne 0x506e5
movq -0xa8(%rbp), %rax
movl $0x80000000, (%rax)     # imm = 0x80000000
jmp 0x506f4
movl -0xb0(%rbp), %ecx
movq -0xa8(%rbp), %rax
movl %ecx, (%rax)
movq -0xa8(%rbp), %rax
addq $0x4, %rax
movq %rax, -0xa8(%rbp)
movl -0xac(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xac(%rbp)
jmp 0x5068c
movl -0xac(%rbp), %eax
movl %eax, -0x3c(%rbp)
jmp 0x5083c
jmp 0x5072a
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq %rax, -0xb8(%rbp)
movl $0x0, -0xbc(%rbp)
movl -0xbc(%rbp), %eax
movq -0x48(%rbp), %rcx
cmpl 0x20(%rcx), %eax
jge 0x507e0
movq -0x48(%rbp), %rax
movq 0x10(%rax), %rdi
movslq -0xbc(%rbp), %rax
shlq $0x2, %rax
addq %rax, %rdi
callq 0x45430
movl %eax, -0xc0(%rbp)
movl -0xc0(%rbp), %eax
cmpl 0xd4ec2(%rip), %eax     # 0x125644
jne 0x50786
jmp 0x507e0
movl -0xc0(%rbp), %eax
cmpl 0xd4eae(%rip), %eax     # 0x125640
jne 0x507a8
movq -0xb8(%rbp), %rdi
movl 0xd4e9f(%rip), %esi     # 0x125640
callq 0x40e90
jmp 0x507ba
movq -0xb8(%rbp), %rdi
movl -0xc0(%rbp), %esi
callq 0x40e90
movq -0xb8(%rbp), %rax
addq $0x4, %rax
movq %rax, -0xb8(%rbp)
movl -0xbc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xbc(%rbp)
jmp 0x50742
movl -0xbc(%rbp), %eax
movl %eax, -0x3c(%rbp)
jmp 0x5083c
movq -0x48(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0xd4(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x43520
movl -0xd4(%rbp), %ecx
movq %rax, %r8
movq -0x18(%rbp), %rax
movq (%rax), %r9
addq $0x1, %r9
movl $0x1, %edi
leaq 0xb7c78(%rip), %rsi     # 0x10849d
leaq 0xb76af(%rip), %rdx     # 0x107edb
movb $0x0, %al
callq 0x9d90
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x50842
movl -0x3c(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xe0, %rsp
popq %rbp
retq
nop