// File: /workspace/github_cpp_makefile_star2_O2/auton1[P]viterbi/bcf_entry.cpp
// Function: bcf_entry::parse_genotype_entry(unsigned int, bool, bool, bool, bool)
void bcf_entry::parse_genotype_entry(unsigned int indv, bool GT, bool GQ, bool DP, bool FT)
{
	if (fully_parsed == false)
		parse_full_entry(true);

	if (parsed_FORMAT == false)
		set_FORMAT();

	unsigned int l_pos, indv_size, type, size, ui;
	vector<int> ids;

	if ( GT && !parsed_GT[indv] && GT_idx != -1 )
		ids.push_back(GT_idx);
	if (GQ && !parsed_GQ[indv] && GQ_idx != -1)
		ids.push_back(GQ_idx);
	if (DP && !parsed_DP[indv] && DP_idx != -1)
		ids.push_back(DP_idx);
	if (FT && !parsed_FT[indv] && FT_idx != -1)
		ids.push_back(FT_idx);

	for(unsigned int i=0; i<ids.size(); i++)
	{
		ui = ids[i];
		type = FORMAT_types[ui];
		size = FORMAT_sizes[ui];
		indv_size = FORMAT_skip[ui];
		l_pos = FORMAT_positions[ui] + indv*indv_size;

		if ((int)ui == GT_idx)
			set_indv_GENOTYPE_and_PHASE(indv, l_pos, size);
		else if ((int)ui == GQ_idx)
		{
			if (size>1)
				LOG.error("Error: Only expect single value for QUALITY.\n");

			float tmp;
			if (type==5)
				tmp = *reinterpret_cast<const float*>(&line[l_pos]);
			else if (type==1)
			{
				int8_t tmp2 = *reinterpret_cast<const int8_t*>(&line[l_pos]);
				tmp = (float)tmp2;
			}
			else if (type==2)
			{
				int16_t tmp2 = *reinterpret_cast<const int16_t*>(&line[l_pos]);
				tmp = (float)tmp2;
			}
			else if (type==3)
			{
				int32_t tmp2 = *reinterpret_cast<const int32_t*>(&line[l_pos]);
				tmp = (float)tmp2;
			}
			else
				LOG.error("Error: Invalid type for QUALITY.\n");

			set_indv_GQUALITY(indv, tmp);
		}
		else if ((int)ui == DP_idx)
		{
			if (size>1)
				LOG.error("Error: Only expect single value for DEPTH.\n");

			int tmp = -1;

			if (type==1)
			{
				if ( !check_missing(l_pos, 1, line) )
					tmp = *reinterpret_cast<const int8_t*>(&line[l_pos]);
			}
			else if (type==2)
			{
				if ( !check_missing(l_pos, 2, line) )
					tmp = *reinterpret_cast<const int16_t*>(&line[l_pos]);
			}
			else if (type==3)
			{
				if ( !check_missing(l_pos, 3, line) )
					tmp = *reinterpret_cast<const int32_t*>(&line[l_pos]);
			}
			else if (type==5)
			{
				float tmp2 = -1;
				if ( !check_missing(l_pos, 5, line) )
					tmp2 = *reinterpret_cast<const float*>(&line[l_pos]);
				tmp = (int)tmp2;
			}
			else
				LOG.error("Error: Invalid type for DEPTH.\n");

			set_indv_DEPTH(indv, tmp);
		}
		else if ((int)ui == FT_idx)
		{
			if (type == 7)
			{
				vector<char> tmp;
				tmp.resize( size*sizeof(char) );
				memcpy(&tmp[0], &line[l_pos], size*sizeof(char));
				set_indv_GFILTER(indv, tmp);
			}
			else
				LOG.one_off_warning("Warning: FT values must be encoded in string format.\n");
		}
	}
	// Set missing return values if requested a value, but couldn't find it
	if (GT && (parsed_GT[indv] == false))
	{
		set_indv_GENOTYPE_and_PHASE(indv, make_pair(-1,-1), '/');
	}
	if (GQ && (parsed_GQ[indv] == false))
	{
		set_indv_GQUALITY(indv, -1);
	}
	if (DP && (parsed_DP[indv] == false))
	{
		set_indv_DEPTH(indv, -1);
	}
	if (FT && (parsed_FT[indv] == false))
	{
		set_indv_GFILTER(indv, "");
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
movl %r9d, %ebp
movl %r8d, %r12d
movl %ecx, %r13d
movl %edx, 0x1c(%rsp)
movl %esi, %ebx
movq %rdi, %r14
cmpb $0x0, 0x3d9(%rdi)
jne 0x1466c
movq (%r14), %rax
pushq $0x1
popq %rsi
movq %r14, %rdi
callq *0x18(%rax)
cmpb $0x0, 0x3dd(%r14)
jne 0x1467e
movq %r14, %rdi
callq 0x20588
andq $0x0, 0x60(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x50(%rsp)
movl %ebx, 0x8(%rsp)
movl %ebx, %r15d
cmpb $0x0, 0x1c(%rsp)
je 0x146c9
leaq 0x560(%r14), %rdi
movq %r15, %rsi
callq 0x9cc0
testq %rdx, (%rax)
jne 0x146c9
cmpl $-0x1, 0x630(%r14)
je 0x146c9
leaq 0x630(%r14), %rsi
leaq 0x50(%rsp), %rdi
callq 0x9700
testb %r13b, %r13b
je 0x146fd
leaq 0x588(%r14), %rdi
movq %r15, %rsi
callq 0x9cc0
testq %rdx, (%rax)
jne 0x146fd
cmpl $-0x1, 0x634(%r14)
je 0x146fd
leaq 0x634(%r14), %rsi
leaq 0x50(%rsp), %rdi
callq 0x9700
testb %r12b, %r12b
je 0x14731
leaq 0x5b0(%r14), %rdi
movq %r15, %rsi
callq 0x9cc0
testq %rdx, (%rax)
jne 0x14731
cmpl $-0x1, 0x638(%r14)
je 0x14731
leaq 0x638(%r14), %rsi
leaq 0x50(%rsp), %rdi
callq 0x9700
testb %bpl, %bpl
je 0x14765
leaq 0x5d8(%r14), %rdi
movq %r15, %rsi
callq 0x9cc0
testq %rdx, (%rax)
jne 0x14765
cmpl $-0x1, 0x63c(%r14)
je 0x14765
leaq 0x63c(%r14), %rsi
leaq 0x50(%rsp), %rdi
callq 0x9700
movl %r13d, 0x24(%rsp)
movl %r12d, 0x28(%rsp)
movq %r15, 0x70(%rsp)
movl %ebp, 0x2c(%rsp)
leaq 0x3c0(%r14), %rax
movq %rax, 0x10(%rsp)
xorl %r13d, %r13d
leaq 0x30(%rsp), %r15
leaq 0xd8(%rsp), %rbx
movl %r13d, %r13d
movq 0x50(%rsp), %rax
movq 0x58(%rsp), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq %r13, %rcx
jbe 0x14b18
movl (%rax,%r13,4), %eax
movq 0x658(%r14), %rcx
movq 0x670(%r14), %rdx
movl (%rcx,%rax,4), %ebp
movl (%rdx,%rax,4), %esi
movl %esi, 0x20(%rsp)
movq 0x640(%r14), %rcx
movq 0x688(%r14), %rdx
movl (%rdx,%rax,4), %edx
movl 0x8(%rsp), %r8d
imull %r8d, %edx
addl (%rcx,%rax,4), %edx
movl %edx, 0x4(%rsp)
cmpl 0x630(%r14), %eax
jne 0x14811
movq %r14, %rdi
movl %r8d, %esi
leaq 0x4(%rsp), %rdx
leaq 0x20(%rsp), %rcx
callq 0x20a5e
jmp 0x14b10
cmpl 0x634(%r14), %eax
jne 0x14889
movq %rbx, %r12
movq %r15, %rbx
cmpl $0x2, %esi
jb 0x14859
leaq 0xf8(%rsp), %r15
movq %r15, %rdi
leaq 0x19751(%rip), %rsi     # 0x2df88
movq %rbx, %rdx
callq 0x5160
leaq 0x2cc8a(%rip), %rdi     # 0x414d0
movq %r15, %rsi
pushq $0x1
popq %rdx
callq 0x2bf18
movq %r15, %rdi
callq 0x5908
decl %ebp
cmpl $0x4, %ebp
ja 0x149d9
leaq 0x196d5(%rip), %rcx     # 0x2df40
movslq (%rcx,%rbp,4), %rax
addq %rcx, %rax
jmpq *%rax
movl 0x4(%rsp), %eax
movq 0x10(%rsp), %rcx
movq (%rcx), %rcx
movsbl (%rcx,%rax), %eax
jmp 0x149a2
cmpl 0x638(%r14), %eax
jne 0x1491e
cmpl $0x2, %esi
jb 0x148cf
leaq 0xb8(%rsp), %r12
movq %r12, %rdi
leaq 0x1972b(%rip), %rsi     # 0x2dfd8
movq %r15, %rdx
callq 0x5160
leaq 0x2cc14(%rip), %rdi     # 0x414d0
movq %r12, %rsi
pushq $0x1
popq %rdx
callq 0x2bf18
movq %r12, %rdi
callq 0x5908
decl %ebp
cmpl $0x4, %ebp
ja 0x14acd
leaq 0x1964b(%rip), %rcx     # 0x2df2c
movslq (%rcx,%rbp,4), %rax
addq %rcx, %rax
jmpq *%rax
movl 0x4(%rsp), %esi
movq %r14, %rdi
pushq $0x1
popq %rdx
movq 0x10(%rsp), %rcx
callq 0x1b818
pushq $-0x1
popq %rdx
testb %al, %al
jne 0x14b04
movl 0x4(%rsp), %eax
movq 0x10(%rsp), %rcx
movq (%rcx), %rcx
movsbl (%rcx,%rax), %edx
jmp 0x14b04
cmpl 0x63c(%r14), %eax
jne 0x14b10
cmpl $0x7, %ebp
jne 0x14a0c
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
andq $0x0, 0x40(%rsp)
movq %r15, %rdi
callq 0xcc7c
movq 0x30(%rsp), %rdi
movl 0x4(%rsp), %esi
addq 0x3c0(%r14), %rsi
movl 0x20(%rsp), %edx
callq 0x53b0
movq %r14, %rdi
movl 0x8(%rsp), %esi
movq %r15, %rdx
callq 0x21014
movq %r15, %rdi
callq 0xe88a
jmp 0x14b10
movl 0x4(%rsp), %eax
movq 0x10(%rsp), %rcx
movq (%rcx), %rcx
cvtsi2ssl (%rcx,%rax), %xmm0
jmp 0x149b9
movl 0x4(%rsp), %eax
movq 0x10(%rsp), %rcx
movq (%rcx), %rcx
movswl (%rcx,%rax), %eax
cvtsi2ss %eax, %xmm0
jmp 0x149b9
movl 0x4(%rsp), %eax
movq 0x10(%rsp), %rcx
movq (%rcx), %rcx
movss (%rcx,%rax), %xmm0
movss %xmm0, 0x30(%rsp)
movq %rbx, %r15
movq %r12, %rbx
movq %r14, %rdi
movl 0x8(%rsp), %esi
movq %r15, %rdx
callq 0x20f5c
jmp 0x14b10
movq %r12, %rdi
leaq 0x195d3(%rip), %rsi     # 0x2dfb6
leaq 0xf(%rsp), %rdx
callq 0x5160
leaq 0x2cadc(%rip), %rdi     # 0x414d0
movq %r12, %rsi
pushq $0x1
popq %rdx
callq 0x2bf18
movq %rbx, %r15
movq %r12, %rdi
callq 0x5908
jmp 0x149c2
leaq 0x78(%rsp), %r12
movq %r12, %rdi
leaq 0x19609(%rip), %rsi     # 0x2e024
movq %r15, %rdx
callq 0x5160
leaq 0x2caa6(%rip), %rdi     # 0x414d0
movq %r12, %rsi
callq 0x2c10c
movq %r12, %rdi
callq 0x5908
jmp 0x14b10
movl 0x4(%rsp), %esi
movq %r14, %rdi
pushq $0x3
popq %rdx
movq 0x10(%rsp), %rcx
callq 0x1b818
pushq $-0x1
popq %rdx
testb %al, %al
jne 0x14b04
movl 0x4(%rsp), %eax
movq 0x10(%rsp), %rcx
movq (%rcx), %rcx
movl (%rcx,%rax), %edx
jmp 0x14b04
movl 0x4(%rsp), %esi
movq %r14, %rdi
pushq $0x2
popq %rdx
movq 0x10(%rsp), %rcx
callq 0x1b818
pushq $-0x1
popq %rdx
testb %al, %al
jne 0x14b04
movl 0x4(%rsp), %eax
movq 0x10(%rsp), %rcx
movq (%rcx), %rcx
movswl (%rcx,%rax), %edx
jmp 0x14b04
movl 0x4(%rsp), %esi
movq %r14, %rdi
pushq $0x5
popq %rdx
movq 0x10(%rsp), %rcx
callq 0x1b818
pushq $-0x1
popq %rdx
testb %al, %al
jne 0x14b04
movl 0x4(%rsp), %eax
movq 0x10(%rsp), %rcx
movq (%rcx), %rcx
cvttss2si (%rcx,%rax), %edx
jmp 0x14b04
leaq 0x98(%rsp), %r12
movq %r12, %rdi
leaq 0x19525(%rip), %rsi     # 0x2e004
movq %r15, %rdx
callq 0x5160
leaq 0x2c9e2(%rip), %rdi     # 0x414d0
movq %r12, %rsi
pushq $0x1
popq %rdx
callq 0x2bf18
movq %r12, %rdi
callq 0x5908
pushq $-0x1
popq %rdx
movq %r14, %rdi
movl 0x8(%rsp), %esi
callq 0x1dd9c
incl %r13d
jmp 0x14794
cmpb $0x0, 0x1c(%rsp)
movl 0x2c(%rsp), %ebp
movq 0x70(%rsp), %r15
movl 0x28(%rsp), %r12d
movl 0x24(%rsp), %r13d
je 0x14b5e
leaq 0x560(%r14), %rdi
movq %r15, %rsi
callq 0x9cc0
testq %rdx, (%rax)
jne 0x14b5e
leaq 0x30(%rsp), %rdx
orq $-0x1, (%rdx)
pushq $0x2f
popq %rcx
movq %r14, %rdi
movl 0x8(%rsp), %esi
callq 0x20d88
testb %r13b, %r13b
je 0x14b8e
leaq 0x588(%r14), %rdi
movq %r15, %rsi
callq 0x9cc0
testq %rdx, (%rax)
jne 0x14b8e
leaq 0x30(%rsp), %rdx
movl $0xbf800000, (%rdx)     # imm = 0xBF800000
movq %r14, %rdi
movl 0x8(%rsp), %esi
callq 0x20f5c
testb %r12b, %r12b
je 0x14bb6
leaq 0x5b0(%r14), %rdi
movq %r15, %rsi
callq 0x9cc0
testq %rdx, (%rax)
jne 0x14bb6
pushq $-0x1
popq %rdx
movq %r14, %rdi
movl 0x8(%rsp), %esi
callq 0x1dd9c
testb %bpl, %bpl
je 0x14c00
leaq 0x5d8(%r14), %rdi
movq %r15, %rsi
callq 0x9cc0
testq %rdx, (%rax)
jne 0x14c00
leaq 0x1a261(%rip), %rsi     # 0x2ee37
leaq 0x30(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x5160
leaq 0x30(%rsp), %rdx
movq %r14, %rdi
movl 0x8(%rsp), %esi
callq 0x2122c
leaq 0x30(%rsp), %rdi
callq 0x5908
leaq 0x50(%rsp), %rdi
callq 0xa18e
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
jmp 0x14c95
jmp 0x14ca0
jmp 0x14ca0
jmp 0x14ca0
jmp 0x14ca0
jmp 0x14ca0
jmp 0x14ca0
jmp 0x14ca0
jmp 0x14ca0
jmp 0x14ca0
jmp 0x14ca0
jmp 0x14ca0
jmp 0x14ca0
movq %rax, %rbx
leaq 0x98(%rsp), %rdi
jmp 0x14c95
jmp 0x14ca0
jmp 0x14ca0
movq %rax, %rbx
leaq 0x78(%rsp), %rdi
jmp 0x14c95
jmp 0x14ca0
movq %rax, %rbx
leaq 0xd8(%rsp), %rdi
jmp 0x14c95
jmp 0x14ca0
jmp 0x14ca0
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0xe88a
jmp 0x14ca3
movq %rax, %rbx
leaq 0xb8(%rsp), %rdi
jmp 0x14c95
jmp 0x14ca0
movq %rax, %rbx
leaq 0xf8(%rsp), %rdi
callq 0x5908
jmp 0x14ca3
jmp 0x14ca0
jmp 0x14ca0
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0xa18e
movq %rbx, %rdi
callq 0x5800
nop