// File: /workspace/github_c_makefile_star2_O0/lh3[P]bgt/vcf.c
// Function: bcf_unpack
int bcf_unpack(bcf1_t *b, int which)
{
	uint8_t *ptr = (uint8_t*)b->shared.s;
	int *offset, 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)) { // ID
		kstring_t tmp;
		tmp.l = 0; tmp.m = d->m_str; tmp.s = d->id;
		ptr = bcf_fmt_sized_array(&tmp, ptr); kputc('\0', &tmp);
		// REF and ALT
		offset = (int*)alloca(b->n_allele * sizeof(int));
		for (i = 0; i < b->n_allele; ++i) {
			offset[i] = tmp.l;
			ptr = bcf_fmt_sized_array(&tmp, ptr);
			kputc('\0', &tmp);
		}
		hts_expand(char*, b->n_allele, d->m_allele, d->allele); // NM: hts_expand() is a macro
		for (i = 0; i < b->n_allele; ++i)
			d->allele[i] = tmp.s + offset[i];
		d->m_str = tmp.m; d->id = tmp.s; // write tmp back
		b->unpack_ptr = ptr;
		b->unpacked |= BCF_UN_STR;
	}
	if ((which&BCF_UN_FLT) && !(b->unpacked&BCF_UN_FLT)) { // FILTER
		ptr = b->unpack_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_ptr = ptr;
		b->unpacked |= BCF_UN_FLT;
	}
	if ((which&BCF_UN_INFO) && !(b->unpacked&BCF_UN_INFO)) { // INFO
		ptr = b->unpack_ptr;
		hts_expand(bcf_info_t, b->n_info, d->m_info, d->info);
		bcf_unpack_info_core(ptr, b->n_info, d->info);
		b->unpacked |= BCF_UN_INFO;
	}
	if ((which&BCF_UN_FMT) && b->n_sample && !(b->unpacked&BCF_UN_FMT)) { // FORMAT
		hts_expand(bcf_fmt_t, b->n_fmt, d->m_fmt, d->fmt);
		bcf_unpack_fmt_core((uint8_t*)b->indiv.s, b->n_sample, b->n_fmt, d->fmt);
		b->unpacked |= BCF_UN_FMT;
	}
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
addq $0x48, %rax
movq %rax, -0x30(%rbp)
movl -0xc(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x13d3b
movl -0xc(%rbp), %eax
orl $0x1, %eax
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x13d4f
movl -0xc(%rbp), %eax
orl $0x7, %eax
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x13f95
movq -0x8(%rbp), %rax
movl 0x88(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x13f95
movq $0x0, -0x48(%rbp)
movq -0x30(%rbp), %rax
movslq 0x8(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x30(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rsi
leaq -0x48(%rbp), %rdi
movq %rdi, -0x58(%rbp)
callq 0x11930
movq -0x58(%rbp), %rsi
movq %rax, -0x18(%rbp)
xorl %edi, %edi
callq 0x10ce0
movq -0x8(%rbp), %rax
movzwl 0x12(%rax), %ecx
movl %ecx, %eax
leal 0xf(,%rax,4), %eax
andl $-0x10, %eax
movl %eax, %ecx
movq %rsp, %rax
subq %rcx, %rax
movq %rax, %rsp
movq %rax, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
movq -0x8(%rbp), %rcx
movq 0x10(%rcx), %rcx
shrq $0x10, %rcx
andq $0xffff, %rcx           # imm = 0xFFFF
cmpl %ecx, %eax
jge 0x13e30
movq -0x48(%rbp), %rax
movl %eax, %edx
movq -0x20(%rbp), %rax
movslq -0x24(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movq -0x18(%rbp), %rsi
leaq -0x48(%rbp), %rdi
callq 0x11930
movq %rax, -0x18(%rbp)
xorl %edi, %edi
leaq -0x48(%rbp), %rsi
callq 0x10ce0
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x13dde
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
shrq $0x10, %rax
andq $0xffff, %rax           # imm = 0xFFFF
movq -0x30(%rbp), %rcx
cmpl 0xc(%rcx), %eax
jle 0x13f0b
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
shrq $0x10, %rax
andq $0xffff, %rax           # imm = 0xFFFF
movl %eax, %ecx
movq -0x30(%rbp), %rax
movl %ecx, 0xc(%rax)
movq -0x30(%rbp), %rax
movl 0xc(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0xc(%rax)
movq -0x30(%rbp), %rax
movl 0xc(%rax), %ecx
sarl %ecx
movq -0x30(%rbp), %rax
orl 0xc(%rax), %ecx
movl %ecx, 0xc(%rax)
movq -0x30(%rbp), %rax
movl 0xc(%rax), %ecx
sarl $0x2, %ecx
movq -0x30(%rbp), %rax
orl 0xc(%rax), %ecx
movl %ecx, 0xc(%rax)
movq -0x30(%rbp), %rax
movl 0xc(%rax), %ecx
sarl $0x4, %ecx
movq -0x30(%rbp), %rax
orl 0xc(%rax), %ecx
movl %ecx, 0xc(%rax)
movq -0x30(%rbp), %rax
movl 0xc(%rax), %ecx
sarl $0x8, %ecx
movq -0x30(%rbp), %rax
orl 0xc(%rax), %ecx
movl %ecx, 0xc(%rax)
movq -0x30(%rbp), %rax
movl 0xc(%rax), %ecx
sarl $0x10, %ecx
movq -0x30(%rbp), %rax
orl 0xc(%rax), %ecx
movl %ecx, 0xc(%rax)
movq -0x30(%rbp), %rax
movl 0xc(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0xc(%rax)
movq -0x30(%rbp), %rax
movq 0x20(%rax), %rdi
movq -0x30(%rbp), %rax
movslq 0xc(%rax), %rsi
shlq $0x3, %rsi
callq 0x2340
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x20(%rax)
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
movq -0x8(%rbp), %rcx
movq 0x10(%rcx), %rcx
shrq $0x10, %rcx
andq $0xffff, %rcx           # imm = 0xFFFF
cmpl %ecx, %eax
jge 0x13f5a
movq -0x38(%rbp), %rdx
movq -0x20(%rbp), %rax
movslq -0x24(%rbp), %rcx
movslq (%rax,%rcx,4), %rax
addq %rax, %rdx
movq -0x30(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x24(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x13f12
movq -0x40(%rbp), %rax
movl %eax, %ecx
movq -0x30(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x38(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x18(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x90(%rax)
movq -0x8(%rbp), %rax
movl 0x88(%rax), %ecx
orl $0x1, %ecx
movl %ecx, 0x88(%rax)
movl -0xc(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x14133
movq -0x8(%rbp), %rax
movl 0x88(%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
jne 0x14133
movq -0x8(%rbp), %rax
movq 0x90(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movzbl (%rax), %eax
sarl $0x4, %eax
cmpl $0x0, %eax
je 0x140fa
movq -0x18(%rbp), %rdi
leaq -0x18(%rbp), %rsi
leaq -0x4c(%rbp), %rdx
callq 0x11990
movl %eax, %ecx
movq -0x30(%rbp), %rax
movl %ecx, 0x14(%rax)
movq -0x30(%rbp), %rax
movl 0x14(%rax), %eax
movq -0x30(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jle 0x140b9
movq -0x30(%rbp), %rax
movl 0x14(%rax), %ecx
movq -0x30(%rbp), %rax
movl %ecx, 0x10(%rax)
movq -0x30(%rbp), %rax
movl 0x10(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x10(%rax)
movq -0x30(%rbp), %rax
movl 0x10(%rax), %ecx
sarl %ecx
movq -0x30(%rbp), %rax
orl 0x10(%rax), %ecx
movl %ecx, 0x10(%rax)
movq -0x30(%rbp), %rax
movl 0x10(%rax), %ecx
sarl $0x2, %ecx
movq -0x30(%rbp), %rax
orl 0x10(%rax), %ecx
movl %ecx, 0x10(%rax)
movq -0x30(%rbp), %rax
movl 0x10(%rax), %ecx
sarl $0x4, %ecx
movq -0x30(%rbp), %rax
orl 0x10(%rax), %ecx
movl %ecx, 0x10(%rax)
movq -0x30(%rbp), %rax
movl 0x10(%rax), %ecx
sarl $0x8, %ecx
movq -0x30(%rbp), %rax
orl 0x10(%rax), %ecx
movl %ecx, 0x10(%rax)
movq -0x30(%rbp), %rax
movl 0x10(%rax), %ecx
sarl $0x10, %ecx
movq -0x30(%rbp), %rax
orl 0x10(%rax), %ecx
movl %ecx, 0x10(%rax)
movq -0x30(%rbp), %rax
movl 0x10(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x10(%rax)
movq -0x30(%rbp), %rax
movq 0x28(%rax), %rdi
movq -0x30(%rbp), %rax
movslq 0x10(%rax), %rsi
shlq $0x2, %rsi
callq 0x2340
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x28(%rax)
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
movq -0x30(%rbp), %rcx
cmpl 0x14(%rcx), %eax
jge 0x140f8
movq -0x18(%rbp), %rdi
movl -0x4c(%rbp), %esi
leaq -0x18(%rbp), %rdx
callq 0x143c0
movl %eax, %edx
movq -0x30(%rbp), %rax
movq 0x28(%rax), %rax
movslq -0x24(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x140c0
jmp 0x14111
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
movq -0x30(%rbp), %rax
movl $0x0, 0x14(%rax)
movq -0x18(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x90(%rax)
movq -0x8(%rbp), %rax
movl 0x88(%rax), %ecx
orl $0x2, %ecx
movl %ecx, 0x88(%rax)
movl -0xc(%rbp), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x1426e
movq -0x8(%rbp), %rax
movl 0x88(%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
jne 0x1426e
movq -0x8(%rbp), %rax
movq 0x90(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
andq $0xffff, %rax           # imm = 0xFFFF
movq -0x30(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jle 0x1423a
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
andq $0xffff, %rax           # imm = 0xFFFF
movl %eax, %ecx
movq -0x30(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x30(%rbp), %rax
movl 0x4(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x4(%rax)
movq -0x30(%rbp), %rax
movl 0x4(%rax), %ecx
sarl %ecx
movq -0x30(%rbp), %rax
orl 0x4(%rax), %ecx
movl %ecx, 0x4(%rax)
movq -0x30(%rbp), %rax
movl 0x4(%rax), %ecx
sarl $0x2, %ecx
movq -0x30(%rbp), %rax
orl 0x4(%rax), %ecx
movl %ecx, 0x4(%rax)
movq -0x30(%rbp), %rax
movl 0x4(%rax), %ecx
sarl $0x4, %ecx
movq -0x30(%rbp), %rax
orl 0x4(%rax), %ecx
movl %ecx, 0x4(%rax)
movq -0x30(%rbp), %rax
movl 0x4(%rax), %ecx
sarl $0x8, %ecx
movq -0x30(%rbp), %rax
orl 0x4(%rax), %ecx
movl %ecx, 0x4(%rax)
movq -0x30(%rbp), %rax
movl 0x4(%rax), %ecx
sarl $0x10, %ecx
movq -0x30(%rbp), %rax
orl 0x4(%rax), %ecx
movl %ecx, 0x4(%rax)
movq -0x30(%rbp), %rax
movl 0x4(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x4(%rax)
movq -0x30(%rbp), %rax
movq 0x30(%rax), %rdi
movq -0x30(%rbp), %rax
movslq 0x4(%rax), %rax
imulq $0x18, %rax, %rsi
callq 0x2340
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x18(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
andq $0xffff, %rax           # imm = 0xFFFF
movl %eax, %esi
movq -0x30(%rbp), %rax
movq 0x30(%rax), %rdx
callq 0x13bb0
movq -0x8(%rbp), %rax
movl 0x88(%rax), %ecx
orl $0x4, %ecx
movl %ecx, 0x88(%rax)
movl -0xc(%rbp), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0x143b7
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
shrq $0x28, %rax
cmpl $0x0, %eax
je 0x143b7
movq -0x8(%rbp), %rax
movl 0x88(%rax), %eax
andl $0x8, %eax
cmpl $0x0, %eax
jne 0x143b7
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
shrq $0x20, %rax
andq $0xff, %rax
movq -0x30(%rbp), %rcx
cmpl (%rcx), %eax
jle 0x1436d
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
shrq $0x20, %rax
andq $0xff, %rax
movl %eax, %ecx
movq -0x30(%rbp), %rax
movl %ecx, (%rax)
movq -0x30(%rbp), %rax
movl (%rax), %ecx
addl $-0x1, %ecx
movl %ecx, (%rax)
movq -0x30(%rbp), %rax
movl (%rax), %ecx
sarl %ecx
movq -0x30(%rbp), %rax
orl (%rax), %ecx
movl %ecx, (%rax)
movq -0x30(%rbp), %rax
movl (%rax), %ecx
sarl $0x2, %ecx
movq -0x30(%rbp), %rax
orl (%rax), %ecx
movl %ecx, (%rax)
movq -0x30(%rbp), %rax
movl (%rax), %ecx
sarl $0x4, %ecx
movq -0x30(%rbp), %rax
orl (%rax), %ecx
movl %ecx, (%rax)
movq -0x30(%rbp), %rax
movl (%rax), %ecx
sarl $0x8, %ecx
movq -0x30(%rbp), %rax
orl (%rax), %ecx
movl %ecx, (%rax)
movq -0x30(%rbp), %rax
movl (%rax), %ecx
sarl $0x10, %ecx
movq -0x30(%rbp), %rax
orl (%rax), %ecx
movl %ecx, (%rax)
movq -0x30(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movq -0x30(%rbp), %rax
movq 0x38(%rax), %rdi
movq -0x30(%rbp), %rax
movslq (%rax), %rax
imulq $0x18, %rax, %rsi
callq 0x2340
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x38(%rax)
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
shrq $0x28, %rax
movl %eax, %esi
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
shrq $0x20, %rax
andq $0xff, %rax
movl %eax, %edx
movq -0x30(%rbp), %rax
movq 0x38(%rax), %rcx
callq 0x13a90
movq -0x8(%rbp), %rax
movl 0x88(%rax), %ecx
orl $0x8, %ecx
movl %ecx, 0x88(%rax)
xorl %eax, %eax
movq %rbp, %rsp
popq %rbp
retq
nop