// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/vcf.c
// Function: bcf_unpack
int bcf_unpack(bcf1_t *b, int which)
{
    if ( !b->shared.l ) return 0; // Building a new BCF record from scratch
    uint8_t *ptr = (uint8_t*)b->shared.s, *ptr_ori;
    int i;
    bcf_dec_t *d = &b->d;
    if (which & BCF_UN_FLT) which |= BCF_UN_STR;
    if (which & BCF_UN_INFO) which |= BCF_UN_SHR;
    if ((which&BCF_UN_STR) && !(b->unpacked&BCF_UN_STR))
    {
        kstring_t tmp;

        // ID
        tmp.l = 0; tmp.s = d->id; tmp.m = d->m_id;
        ptr_ori = ptr;
        ptr = bcf_fmt_sized_array(&tmp, ptr);
        b->unpack_size[0] = ptr - ptr_ori;
        kputc_('\0', &tmp);
        d->id = tmp.s; d->m_id = tmp.m;

        // REF and ALT are in a single block (d->als) and d->alleles are pointers into this block
        hts_expand(char*, b->n_allele, d->m_allele, d->allele); // NM: hts_expand() is a macro
        tmp.l = 0; tmp.s = d->als; tmp.m = d->m_als;
        ptr_ori = ptr;
        for (i = 0; i < b->n_allele; ++i) {
            // Use offset within tmp.s as realloc may change pointer
            d->allele[i] = (char *)(intptr_t)tmp.l;
            ptr = bcf_fmt_sized_array(&tmp, ptr);
            kputc_('\0', &tmp);
        }
        b->unpack_size[1] = ptr - ptr_ori;
        d->als = tmp.s; d->m_als = tmp.m;

        // Convert our offsets within tmp.s back to pointers again
        for (i = 0; i < b->n_allele; ++i)
            d->allele[i] = d->als + (ptrdiff_t)d->allele[i];
        b->unpacked |= BCF_UN_STR;
    }
    if ((which&BCF_UN_FLT) && !(b->unpacked&BCF_UN_FLT)) { // FILTER
        ptr = (uint8_t*)b->shared.s + b->unpack_size[0] + b->unpack_size[1];
        ptr_ori = ptr;
        if (*ptr>>4) {
            int type;
            d->n_flt = bcf_dec_size(ptr, &ptr, &type);
            hts_expand(int, d->n_flt, d->m_flt, d->flt);
            for (i = 0; i < d->n_flt; ++i)
                d->flt[i] = bcf_dec_int1(ptr, type, &ptr);
        } else ++ptr, d->n_flt = 0;
        b->unpack_size[2] = ptr - ptr_ori;
        b->unpacked |= BCF_UN_FLT;
    }
    if ((which&BCF_UN_INFO) && !(b->unpacked&BCF_UN_INFO)) { // INFO
        ptr = (uint8_t*)b->shared.s + b->unpack_size[0] + b->unpack_size[1] + b->unpack_size[2];
        hts_expand(bcf_info_t, b->n_info, d->m_info, d->info);
        for (i = 0; i < d->m_info; ++i) d->info[i].vptr_free = 0;
        for (i = 0; i < b->n_info; ++i)
            ptr = bcf_unpack_info_core1(ptr, &d->info[i]);
        b->unpacked |= BCF_UN_INFO;
    }
    if ((which&BCF_UN_FMT) && b->n_sample && !(b->unpacked&BCF_UN_FMT)) { // FORMAT
        ptr = (uint8_t*)b->indiv.s;
        hts_expand(bcf_fmt_t, b->n_fmt, d->m_fmt, d->fmt);
        for (i = 0; i < d->m_fmt; ++i) d->fmt[i].p_free = 0;
        for (i = 0; i < b->n_fmt; ++i)
            ptr = bcf_unpack_fmt_core1(ptr, b->n_sample, &d->fmt[i]);
        b->unpacked |= BCF_UN_FMT;
    }
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x20(%rax)
jne 0x48136
movl $0x0, -0x4(%rbp)
jmp 0x48830
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
addq $0x50, %rax
movq %rax, -0x38(%rbp)
movl -0x14(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x48162
movl -0x14(%rbp), %eax
orl $0x1, %eax
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x48176
movl -0x14(%rbp), %eax
orl $0x7, %eax
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x483be
movq -0x10(%rbp), %rax
movl 0xbc(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x483be
movq $0x0, -0x50(%rbp)
movq -0x38(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x38(%rbp), %rax
movslq 0x8(%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rsi
leaq -0x50(%rbp), %rdi
callq 0x45470
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq -0x28(%rbp), %rcx
subq %rcx, %rax
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0xc0(%rax)
xorl %edi, %edi
leaq -0x50(%rbp), %rsi
callq 0x452d0
movq -0x40(%rbp), %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x48(%rbp), %rax
movl %eax, %ecx
movq -0x38(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
shrq $0x10, %rax
andq $0xffff, %rax           # imm = 0xFFFF
movq -0x38(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jle 0x4829e
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
shrq $0x10, %rax
andq $0xffff, %rax           # imm = 0xFFFF
cmpl $0x1, %eax
jl 0x48258
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
shrq $0x10, %rax
andq $0xffff, %rax           # imm = 0xFFFF
movl %eax, -0x58(%rbp)
jmp 0x48262
movl $0x1, %eax
movl %eax, -0x58(%rbp)
jmp 0x48262
movl -0x58(%rbp), %eax
movslq %eax, %rdi
movq -0x38(%rbp), %rax
movslq 0x10(%rax), %rsi
movq -0x38(%rbp), %r9
addq $0x38, %r9
movl $0x4, %edx
movl $0x8, %ecx
xorl %r8d, %r8d
leaq 0xbfb8f(%rip), %rax     # 0x107e1b
movq %rax, (%rsp)
callq 0x15780
movl %eax, %ecx
movq -0x38(%rbp), %rax
movl %ecx, 0x10(%rax)
jmp 0x482a0
movq $0x0, -0x50(%rbp)
movq -0x38(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x38(%rbp), %rax
movslq 0xc(%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x28(%rbp)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x10(%rbp), %rcx
movq 0x18(%rcx), %rcx
shrq $0x10, %rcx
andq $0xffff, %rcx           # imm = 0xFFFF
cmpl %ecx, %eax
jge 0x48324
movq -0x50(%rbp), %rdx
movq -0x38(%rbp), %rax
movq 0x38(%rax), %rax
movslq -0x2c(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x20(%rbp), %rsi
leaq -0x50(%rbp), %rdi
callq 0x45470
movq %rax, -0x20(%rbp)
xorl %edi, %edi
leaq -0x50(%rbp), %rsi
callq 0x452d0
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x482cf
movq -0x20(%rbp), %rax
movq -0x28(%rbp), %rcx
subq %rcx, %rax
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0xc4(%rax)
movq -0x40(%rbp), %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x48(%rbp), %rax
movl %eax, %ecx
movq -0x38(%rbp), %rax
movl %ecx, 0xc(%rax)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x10(%rbp), %rcx
movq 0x18(%rcx), %rcx
shrq $0x10, %rcx
andq $0xffff, %rcx           # imm = 0xFFFF
cmpl %ecx, %eax
jge 0x483ab
movq -0x38(%rbp), %rax
movq 0x30(%rax), %rdx
movq -0x38(%rbp), %rax
movq 0x38(%rax), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
addq %rax, %rdx
movq -0x38(%rbp), %rax
movq 0x38(%rax), %rax
movslq -0x2c(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x4835b
movq -0x10(%rbp), %rax
movl 0xbc(%rax), %ecx
orl $0x1, %ecx
movl %ecx, 0xbc(%rax)
movl -0x14(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x4852e
movq -0x10(%rbp), %rax
movl 0xbc(%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
jne 0x4852e
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movq -0x10(%rbp), %rcx
movslq 0xc0(%rcx), %rcx
addq %rcx, %rax
movq -0x10(%rbp), %rcx
movslq 0xc4(%rcx), %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
movzbl (%rax), %eax
sarl $0x4, %eax
cmpl $0x0, %eax
je 0x484ed
movq -0x20(%rbp), %rdi
leaq -0x20(%rbp), %rsi
leaq -0x54(%rbp), %rdx
callq 0x454d0
movl %eax, %ecx
movq -0x38(%rbp), %rax
movl %ecx, 0x18(%rax)
movq -0x38(%rbp), %rax
movl 0x18(%rax), %eax
movq -0x38(%rbp), %rcx
cmpl 0x14(%rcx), %eax
jle 0x484aa
movq -0x38(%rbp), %rax
cmpl $0x1, 0x18(%rax)
jl 0x48466
movq -0x38(%rbp), %rax
movl 0x18(%rax), %eax
movl %eax, -0x5c(%rbp)
jmp 0x48470
movl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0x48470
movl -0x5c(%rbp), %eax
movslq %eax, %rdi
movq -0x38(%rbp), %rax
movslq 0x14(%rax), %rsi
movq -0x38(%rbp), %r9
addq $0x20, %r9
movl $0x4, %ecx
xorl %r8d, %r8d
leaq 0xbf986(%rip), %rax     # 0x107e1b
movq %rcx, %rdx
movq %rax, (%rsp)
callq 0x15780
movl %eax, %ecx
movq -0x38(%rbp), %rax
movl %ecx, 0x14(%rax)
jmp 0x484ac
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x38(%rbp), %rcx
cmpl 0x18(%rcx), %eax
jge 0x484eb
movq -0x20(%rbp), %rdi
movl -0x54(%rbp), %esi
leaq -0x20(%rbp), %rdx
callq 0x48840
movl %eax, %edx
movq -0x38(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x2c(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x484b3
jmp 0x48504
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
movq -0x38(%rbp), %rax
movl $0x0, 0x18(%rax)
movq -0x20(%rbp), %rax
movq -0x28(%rbp), %rcx
subq %rcx, %rax
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0xc8(%rax)
movq -0x10(%rbp), %rax
movl 0xbc(%rax), %ecx
orl $0x2, %ecx
movl %ecx, 0xbc(%rax)
movl -0x14(%rbp), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x486a9
movq -0x10(%rbp), %rax
movl 0xbc(%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
jne 0x486a9
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movq -0x10(%rbp), %rcx
movslq 0xc0(%rcx), %rcx
addq %rcx, %rax
movq -0x10(%rbp), %rcx
movslq 0xc4(%rcx), %rcx
addq %rcx, %rax
movq -0x10(%rbp), %rcx
movslq 0xc8(%rcx), %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
andq $0xffff, %rax           # imm = 0xFFFF
movq -0x38(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jle 0x4860c
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
andq $0xffff, %rax           # imm = 0xFFFF
cmpl $0x1, %eax
jl 0x485c6
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
andq $0xffff, %rax           # imm = 0xFFFF
movl %eax, -0x60(%rbp)
jmp 0x485d0
movl $0x1, %eax
movl %eax, -0x60(%rbp)
jmp 0x485d0
movl -0x60(%rbp), %eax
movslq %eax, %rdi
movq -0x38(%rbp), %rax
movslq 0x4(%rax), %rsi
movq -0x38(%rbp), %r9
addq $0x40, %r9
movl $0x4, %edx
movl $0x28, %ecx
xorl %r8d, %r8d
leaq 0xbf821(%rip), %rax     # 0x107e1b
movq %rax, (%rsp)
callq 0x15780
movl %eax, %ecx
movq -0x38(%rbp), %rax
movl %ecx, 0x4(%rax)
jmp 0x4860e
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x38(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jge 0x4864e
movq -0x38(%rbp), %rax
movq 0x40(%rax), %rax
movslq -0x2c(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl 0x1c(%rax), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
orl $0x0, %ecx
movl %ecx, 0x1c(%rax)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x48615
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x10(%rbp), %rcx
movq 0x18(%rcx), %rcx
andq $0xffff, %rcx           # imm = 0xFFFF
cmpl %ecx, %eax
jge 0x48696
movq -0x20(%rbp), %rdi
movq -0x38(%rbp), %rax
movq 0x40(%rax), %rsi
movslq -0x2c(%rbp), %rax
imulq $0x28, %rax, %rax
addq %rax, %rsi
callq 0x48900
movq %rax, -0x20(%rbp)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x48655
movq -0x10(%rbp), %rax
movl 0xbc(%rax), %ecx
orl $0x4, %ecx
movl %ecx, 0xbc(%rax)
movl -0x14(%rbp), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0x48829
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
shrq $0x28, %rax
cmpl $0x0, %eax
je 0x48829
movq -0x10(%rbp), %rax
movl 0xbc(%rax), %eax
andl $0x8, %eax
cmpl $0x0, %eax
jne 0x48829
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
shrq $0x20, %rax
andq $0xff, %rax
movq -0x38(%rbp), %rcx
cmpl (%rcx), %eax
jle 0x4877b
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
shrq $0x20, %rax
andq $0xff, %rax
cmpl $0x1, %eax
jl 0x48737
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
shrq $0x20, %rax
andq $0xff, %rax
movl %eax, -0x64(%rbp)
jmp 0x48741
movl $0x1, %eax
movl %eax, -0x64(%rbp)
jmp 0x48741
movl -0x64(%rbp), %eax
movslq %eax, %rdi
movq -0x38(%rbp), %rax
movslq (%rax), %rsi
movq -0x38(%rbp), %r9
addq $0x48, %r9
movl $0x4, %edx
movl $0x20, %ecx
xorl %r8d, %r8d
leaq 0xbf6b1(%rip), %rax     # 0x107e1b
movq %rax, (%rsp)
callq 0x15780
movl %eax, %ecx
movq -0x38(%rbp), %rax
movl %ecx, (%rax)
jmp 0x4877d
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x38(%rbp), %rcx
cmpl (%rcx), %eax
jge 0x487bc
movq -0x38(%rbp), %rax
movq 0x48(%rax), %rax
movslq -0x2c(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movl 0x1c(%rax), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
orl $0x0, %ecx
movl %ecx, 0x1c(%rax)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x48784
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x10(%rbp), %rcx
movq 0x18(%rcx), %rcx
shrq $0x20, %rcx
andq $0xff, %rcx
cmpl %ecx, %eax
jge 0x48816
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
shrq $0x28, %rax
movl %eax, %esi
movq -0x38(%rbp), %rax
movq 0x48(%rax), %rdx
movslq -0x2c(%rbp), %rax
shlq $0x5, %rax
addq %rax, %rdx
callq 0x414a0
movq %rax, -0x20(%rbp)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x487c3
movq -0x10(%rbp), %rax
movl 0xbc(%rax), %ecx
orl $0x8, %ecx
movl %ecx, 0xbc(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x70, %rsp
popq %rbp
retq
nopl (%rax)