// File: auton1[P]viterbi/vcf_entry.cpp
// Function: vcf_entry::parse_genotype_entry(unsigned int, bool, bool, bool, bool)
void vcf_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(FORMAT_str);

	static string tmpstr;
	static istringstream ss;
	ss.clear(); ss.str(GENOTYPE_str[indv]);

	int N_required = GT + GQ + DP + FT;
	int N_got = 0;

	int i=0;
	while (getline(ss, tmpstr, ':'))
	{
		if (GT && (i == GT_idx))
		{
			set_indv_GENOTYPE_and_PHASE(indv, tmpstr);
			N_got++;
		}
		else if (GQ && (i == GQ_idx))
		{
			set_indv_GQUALITY(indv, header::str2double(tmpstr));
			N_got++;
		}
		else if (DP && (i == DP_idx))
		{
			set_indv_DEPTH(indv, header::str2int(tmpstr));
			N_got++;
		}
		else if (FT && (i == FT_idx))
		{
			set_indv_GFILTER(indv, tmpstr);
			N_got++;
		}

		if (N_got == N_required)
			break;
		i++;
	}

	// 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:
subq $0xe8, %rsp
movl %r8d, 0x30(%rsp)
movl %ecx, %eax
movl 0x30(%rsp), %ecx
movl %eax, 0x34(%rsp)
movl %edx, %eax
movl 0x34(%rsp), %edx
movl %eax, 0x38(%rsp)
movl %esi, %eax
movl 0x38(%rsp), %esi
movl %eax, 0x3c(%rsp)
movq %rdi, %r8
movl 0x3c(%rsp), %edi
movb %r9b, %al
movq %r8, 0xe0(%rsp)
movl %edi, 0xdc(%rsp)
andb $0x1, %sil
movb %sil, 0xdb(%rsp)
andb $0x1, %dl
movb %dl, 0xda(%rsp)
andb $0x1, %cl
movb %cl, 0xd9(%rsp)
andb $0x1, %al
movb %al, 0xd8(%rsp)
movq 0xe0(%rsp), %rax
movq %rax, 0x40(%rsp)
movb 0x3d9(%rax), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x3efd9
movq 0x40(%rsp), %rdi
movq (%rdi), %rax
movl $0x1, %esi
callq *0x18(%rax)
movq 0x40(%rsp), %rax
movb 0x3dd(%rax), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x3f002
movq 0x40(%rsp), %rdi
movq %rdi, %rsi
addq $0x718, %rsi            # imm = 0x718
callq 0x4ff50
cmpb $0x0, 0x54c37(%rip)     # 0x93c40
jne 0x3f04e
leaq 0x54c2e(%rip), %rdi     # 0x93c40
callq 0x6a40
cmpl $0x0, %eax
je 0x3f04e
leaq 0x54bfd(%rip), %rdi     # 0x93c20
callq 0x67e0
movq 0x53f79(%rip), %rdi     # 0x92fa8
leaq 0x54bea(%rip), %rsi     # 0x93c20
leaq 0x54563(%rip), %rdx     # 0x935a0
callq 0x6490
leaq 0x54bf7(%rip), %rdi     # 0x93c40
callq 0x62f0
cmpb $0x0, 0x54d73(%rip)     # 0x93dc8
jne 0x3f09c
leaq 0x54d6a(%rip), %rdi     # 0x93dc8
callq 0x6a40
cmpl $0x0, %eax
je 0x3f09c
leaq 0x54bd9(%rip), %rdi     # 0x93c48
callq 0x6390
jmp 0x3f076
movq 0x53f13(%rip), %rdi     # 0x92f90
leaq 0x54bc4(%rip), %rsi     # 0x93c48
leaq 0x54515(%rip), %rdx     # 0x935a0
callq 0x6490
leaq 0x54d31(%rip), %rdi     # 0x93dc8
callq 0x62f0
movq 0x54ba5(%rip), %rax     # 0x93c48
leaq 0x54b9e(%rip), %rdi     # 0x93c48
addq -0x18(%rax), %rdi
xorl %esi, %esi
callq 0x6950
movq 0x40(%rsp), %rdi
addq $0x758, %rdi            # imm = 0x758
movl 0xdc(%rsp), %eax
movl %eax, %esi
callq 0x10290
movq %rax, %rsi
leaq 0x54b6f(%rip), %rdi     # 0x93c48
callq 0x6630
movb 0xdb(%rsp), %al
andb $0x1, %al
movzbl %al, %eax
movb 0xda(%rsp), %cl
andb $0x1, %cl
movzbl %cl, %ecx
addl %ecx, %eax
movb 0xd9(%rsp), %cl
andb $0x1, %cl
movzbl %cl, %ecx
addl %ecx, %eax
movb 0xd8(%rsp), %cl
andb $0x1, %cl
movzbl %cl, %ecx
addl %ecx, %eax
movl %eax, 0xc8(%rsp)
movl $0x0, 0xc4(%rsp)
movl $0x0, 0xc0(%rsp)
leaq 0x54b0d(%rip), %rdi     # 0x93c48
leaq 0x54ade(%rip), %rsi     # 0x93c20
movl $0x3a, %edx
callq 0x6a80
movq %rax, %rdi
movq (%rdi), %rax
addq -0x18(%rax), %rdi
callq 0x6700
testb $0x1, %al
jne 0x3f164
jmp 0x3f308
testb $0x1, 0xdb(%rsp)
je 0x3f1d5
movq 0x40(%rsp), %rcx
movl 0xc0(%rsp), %eax
cmpl 0x630(%rcx), %eax
jne 0x3f1d5
movq 0x40(%rsp), %rdi
movl 0xdc(%rsp), %esi
leaq 0x54a8b(%rip), %rdx     # 0x93c20
callq 0x50930
movl 0xc4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc4(%rsp)
jmp 0x3f2e0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xd0(%rsp)
movl %eax, 0xcc(%rsp)
leaq 0x54bfd(%rip), %rdi     # 0x93dc8
callq 0x62d0
jmp 0x3f5af
testb $0x1, 0xda(%rsp)
je 0x3f236
movq 0x40(%rsp), %rcx
movl 0xc0(%rsp), %eax
cmpl 0x634(%rcx), %eax
jne 0x3f236
movl 0xdc(%rsp), %eax
movl %eax, 0x2c(%rsp)
leaq 0x54a1b(%rip), %rdi     # 0x93c20
movsd 0x35d33(%rip), %xmm0    # 0x74f40
callq 0x306c0
movq 0x40(%rsp), %rdi
movl 0x2c(%rsp), %esi
callq 0x51460
movl 0xc4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc4(%rsp)
jmp 0x3f2de
testb $0x1, 0xd9(%rsp)
je 0x3f293
movq 0x40(%rsp), %rcx
movl 0xc0(%rsp), %eax
cmpl 0x638(%rcx), %eax
jne 0x3f293
movl 0xdc(%rsp), %eax
movl %eax, 0x28(%rsp)
leaq 0x549ba(%rip), %rdi     # 0x93c20
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x2fb70
movq 0x40(%rsp), %rdi
movl 0x28(%rsp), %esi
movl %eax, %edx
callq 0x4f990
movl 0xc4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc4(%rsp)
jmp 0x3f2dc
testb $0x1, 0xd8(%rsp)
je 0x3f2da
movq 0x40(%rsp), %rcx
movl 0xc0(%rsp), %eax
cmpl 0x63c(%rcx), %eax
jne 0x3f2da
movq 0x40(%rsp), %rdi
movl 0xdc(%rsp), %esi
leaq 0x5495c(%rip), %rdx     # 0x93c20
callq 0x515a0
movl 0xc4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc4(%rsp)
jmp 0x3f2dc
jmp 0x3f2de
jmp 0x3f2e0
movl 0xc4(%rsp), %eax
cmpl 0xc8(%rsp), %eax
jne 0x3f2f2
jmp 0x3f308
movl 0xc0(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc0(%rsp)
jmp 0x3f134
xorl %eax, %eax
testb $0x1, 0xdb(%rsp)
movb %al, 0x27(%rsp)
je 0x3f35e
movq 0x40(%rsp), %rdi
addq $0x560, %rdi            # imm = 0x560
movl 0xdc(%rsp), %eax
movl %eax, %esi
callq 0x102b0
movq %rax, 0xb0(%rsp)
movq %rdx, 0xb8(%rsp)
leaq 0xb0(%rsp), %rdi
callq 0x10310
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
sete %al
movb %al, 0x27(%rsp)
movb 0x27(%rsp), %al
testb $0x1, %al
jne 0x3f368
jmp 0x3f3c1
movl 0xdc(%rsp), %eax
movl %eax, 0x20(%rsp)
movl $0xffffffff, 0xa4(%rsp) # imm = 0xFFFFFFFF
movl $0xffffffff, 0xa0(%rsp) # imm = 0xFFFFFFFF
leaq 0xa4(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
callq 0x397b0
movq 0x40(%rsp), %rdi
movl 0x20(%rsp), %esi
movq %rax, 0xa8(%rsp)
leaq 0xa8(%rsp), %rdx
movl $0x2f, %ecx
callq 0x51240
xorl %eax, %eax
testb $0x1, 0xda(%rsp)
movb %al, 0x1f(%rsp)
je 0x3f417
movq 0x40(%rsp), %rdi
addq $0x588, %rdi            # imm = 0x588
movl 0xdc(%rsp), %eax
movl %eax, %esi
callq 0x102b0
movq %rax, 0x90(%rsp)
movq %rdx, 0x98(%rsp)
leaq 0x90(%rsp), %rdi
callq 0x10310
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
sete %al
movb %al, 0x1f(%rsp)
movb 0x1f(%rsp), %al
testb $0x1, %al
jne 0x3f421
jmp 0x3f43a
movq 0x40(%rsp), %rdi
movl 0xdc(%rsp), %esi
movsd 0x35b0b(%rip), %xmm0    # 0x74f40
callq 0x51460
xorl %eax, %eax
testb $0x1, 0xd9(%rsp)
movb %al, 0x1e(%rsp)
je 0x3f490
movq 0x40(%rsp), %rdi
addq $0x5b0, %rdi            # imm = 0x5B0
movl 0xdc(%rsp), %eax
movl %eax, %esi
callq 0x102b0
movq %rax, 0x80(%rsp)
movq %rdx, 0x88(%rsp)
leaq 0x80(%rsp), %rdi
callq 0x10310
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
sete %al
movb %al, 0x1e(%rsp)
movb 0x1e(%rsp), %al
testb $0x1, %al
jne 0x3f49a
jmp 0x3f4b0
movq 0x40(%rsp), %rdi
movl 0xdc(%rsp), %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x4f990
xorl %eax, %eax
testb $0x1, 0xd8(%rsp)
movb %al, 0x1d(%rsp)
je 0x3f4fd
movq 0x40(%rsp), %rdi
addq $0x5d8, %rdi            # imm = 0x5D8
movl 0xdc(%rsp), %eax
movl %eax, %esi
callq 0x102b0
movq %rax, 0x70(%rsp)
movq %rdx, 0x78(%rsp)
leaq 0x70(%rsp), %rdi
callq 0x10310
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
sete %al
movb %al, 0x1d(%rsp)
movb 0x1d(%rsp), %al
testb $0x1, %al
jne 0x3f50a
jmp 0x3f5a7
movl 0xdc(%rsp), %eax
movl %eax, 0xc(%rsp)
leaq 0x4f(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0x69f0
movq 0x10(%rsp), %rdx
leaq 0x367f9(%rip), %rsi     # 0x75d29
leaq 0x50(%rsp), %rdi
callq 0x67c0
jmp 0x3f53c
movl 0xc(%rsp), %esi
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rdx
callq 0x515a0
jmp 0x3f551
leaq 0x50(%rsp), %rdi
callq 0x6b50
leaq 0x4f(%rsp), %rdi
callq 0x65f0
jmp 0x3f5a7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xd0(%rsp)
movl %eax, 0xcc(%rsp)
jmp 0x3f59b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xd0(%rsp)
movl %eax, 0xcc(%rsp)
leaq 0x50(%rsp), %rdi
callq 0x6b50
leaq 0x4f(%rsp), %rdi
callq 0x65f0
jmp 0x3f5af
addq $0xe8, %rsp
retq
movq 0xd0(%rsp), %rdi
callq 0x69e0
nopl (%rax)