// File: auton1[P]viterbi/vcf_entry_setters.cpp
// Function: vcf_entry::set_indv_GENOTYPE_and_PHASE(unsigned int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void vcf_entry::set_indv_GENOTYPE_and_PHASE(unsigned int indv, const string &in)
{
	ploidy.resize(N_indv);
	if ((in.size() == 3) && ((in.c_str()[1] == '/') || (in.c_str()[1] == '|')))
	{	// Fast, diploid case...
		ploidy[indv] = 2;
		set_indv_PHASE(indv, in.c_str()[1]);
		set_indv_GENOTYPE_alleles(indv, in.c_str()[0], in.c_str()[2]);
	}
	else
	{	// More complex case...
		size_t pos = in.find_first_of("/|");
		if (pos != string::npos)
		{	// autosome
			ploidy[indv] = 2;
			set_indv_PHASE(indv, in[pos]);
			set_indv_GENOTYPE_alleles(indv, make_pair(in.substr(0,pos), in.substr(pos+1)));
		}
		else
		{	// Male chrX, or chrY
			ploidy[indv] = 1;
			set_indv_PHASE(indv, '|');
			set_indv_GENOTYPE_alleles(indv, make_pair(in.substr(0,pos), "."));
		}

		// Check for polypoidy
		size_t pos2 = in.find_last_of("/|");
		if (pos != pos2)
			LOG.error("Polypolidy found, and not supported by vcftools: " + CHROM + ":" + header::int2str(POS));
	}

	parsed_GT[indv] = true;
}

// Assembly:
subq $0x208, %rsp            # imm = 0x208
movq %rdi, 0x200(%rsp)
movl %esi, 0x1fc(%rsp)
movq %rdx, 0x1f0(%rsp)
movq 0x200(%rsp), %rax
movq %rax, 0x30(%rsp)
movq %rax, %rdi
addq $0x4e8, %rdi            # imm = 0x4E8
movl 0x8(%rax), %eax
movl %eax, %esi
callq 0x10140
movq 0x1f0(%rsp), %rdi
callq 0x6350
cmpq $0x3, %rax
jne 0x50a49
movq 0x1f0(%rsp), %rdi
callq 0x61a0
movsbl 0x1(%rax), %eax
cmpl $0x2f, %eax
je 0x509b6
movq 0x1f0(%rsp), %rdi
callq 0x61a0
movsbl 0x1(%rax), %eax
cmpl $0x7c, %eax
jne 0x50a49
movq 0x30(%rsp), %rdi
addq $0x4e8, %rdi            # imm = 0x4E8
movl 0x1fc(%rsp), %eax
movl %eax, %esi
callq 0xecf0
movl $0x2, (%rax)
movl 0x1fc(%rsp), %eax
movl %eax, 0x24(%rsp)
movq 0x1f0(%rsp), %rdi
callq 0x61a0
movl 0x24(%rsp), %esi
movq 0x30(%rsp), %rdi
movsbl 0x1(%rax), %edx
callq 0x50f00
movl 0x1fc(%rsp), %eax
movl %eax, 0x28(%rsp)
movq 0x1f0(%rsp), %rdi
callq 0x61a0
movb (%rax), %al
movb %al, 0x2f(%rsp)
movq 0x1f0(%rsp), %rdi
callq 0x61a0
movq 0x30(%rsp), %rdi
movl 0x28(%rsp), %esi
movb 0x2f(%rsp), %cl
movsbl %cl, %edx
movsbl 0x2(%rax), %ecx
callq 0x50fb0
jmp 0x50eb5
movq 0x1f0(%rsp), %rdi
leaq 0x25066(%rip), %rsi     # 0x75abe
xorl %eax, %eax
movl %eax, %edx
callq 0x6230
movq %rax, 0x1e8(%rsp)
cmpq $-0x1, 0x1e8(%rsp)
je 0x50bed
movq 0x30(%rsp), %rdi
addq $0x4e8, %rdi            # imm = 0x4E8
movl 0x1fc(%rsp), %eax
movl %eax, %esi
callq 0xecf0
movl $0x2, (%rax)
movl 0x1fc(%rsp), %eax
movl %eax, 0x1c(%rsp)
movq 0x1f0(%rsp), %rdi
movq 0x1e8(%rsp), %rsi
callq 0x6610
movq 0x30(%rsp), %rdi
movl 0x1c(%rsp), %esi
movsbl (%rax), %edx
callq 0x50f00
movl 0x1fc(%rsp), %eax
movl %eax, 0x20(%rsp)
movq 0x1f0(%rsp), %rsi
movq 0x1e8(%rsp), %rcx
xorl %eax, %eax
movl %eax, %edx
leaq 0x188(%rsp), %rdi
callq 0x6580
movq 0x1f0(%rsp), %rsi
movq 0x1e8(%rsp), %rdx
incq %rdx
leaq 0x168(%rsp), %rdi
movq $-0x1, %rcx
callq 0x6580
jmp 0x50b1e
leaq 0x1a8(%rsp), %rdi
leaq 0x188(%rsp), %rsi
leaq 0x168(%rsp), %rdx
callq 0x51cc0
jmp 0x50b3d
movl 0x20(%rsp), %esi
movq 0x30(%rsp), %rdi
leaq 0x1a8(%rsp), %rdx
callq 0x510e0
jmp 0x50b55
leaq 0x1a8(%rsp), %rdi
callq 0x3a810
leaq 0x168(%rsp), %rdi
callq 0x6b50
leaq 0x188(%rsp), %rdi
callq 0x6b50
jmp 0x50d33
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x160(%rsp)
movl %eax, 0x15c(%rsp)
jmp 0x50bdb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x160(%rsp)
movl %eax, 0x15c(%rsp)
jmp 0x50bce
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x160(%rsp)
movl %eax, 0x15c(%rsp)
leaq 0x1a8(%rsp), %rdi
callq 0x3a810
leaq 0x168(%rsp), %rdi
callq 0x6b50
leaq 0x188(%rsp), %rdi
callq 0x6b50
jmp 0x50ef0
movq 0x30(%rsp), %rdi
addq $0x4e8, %rdi            # imm = 0x4E8
movl 0x1fc(%rsp), %eax
movl %eax, %esi
callq 0xecf0
movq 0x30(%rsp), %rdi
movl $0x1, (%rax)
movl 0x1fc(%rsp), %esi
movl $0x7c, %edx
callq 0x50f00
movl 0x1fc(%rsp), %eax
movl %eax, 0xc(%rsp)
movq 0x1f0(%rsp), %rsi
movq 0x1e8(%rsp), %rcx
xorl %eax, %eax
movl %eax, %edx
leaq 0xd0(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0x6580
movq 0x10(%rsp), %rsi
leaq 0x2447e(%rip), %rdx     # 0x750de
leaq 0xf0(%rsp), %rdi
callq 0x51d00
jmp 0x50c6f
leaq 0x118(%rsp), %rdi
leaq 0xf0(%rsp), %rsi
callq 0x51d40
jmp 0x50c86
movl 0xc(%rsp), %esi
movq 0x30(%rsp), %rdi
leaq 0x118(%rsp), %rdx
callq 0x510e0
jmp 0x50c9e
leaq 0x118(%rsp), %rdi
callq 0x3a810
leaq 0xf0(%rsp), %rdi
callq 0x51de0
leaq 0xd0(%rsp), %rdi
callq 0x6b50
jmp 0x50d33
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x160(%rsp)
movl %eax, 0x15c(%rsp)
jmp 0x50d21
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x160(%rsp)
movl %eax, 0x15c(%rsp)
jmp 0x50d14
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x160(%rsp)
movl %eax, 0x15c(%rsp)
leaq 0x118(%rsp), %rdi
callq 0x3a810
leaq 0xf0(%rsp), %rdi
callq 0x51de0
leaq 0xd0(%rsp), %rdi
callq 0x6b50
jmp 0x50ef0
movq 0x1f0(%rsp), %rdi
leaq 0x24d7c(%rip), %rsi     # 0x75abe
movq $-0x1, %rdx
callq 0x64f0
movq %rax, 0xc8(%rsp)
movq 0x1e8(%rsp), %rax
cmpq 0xc8(%rsp), %rax
je 0x50eb3
movq 0x30(%rsp), %rdx
addq $0x3e0, %rdx            # imm = 0x3E0
leaq 0x24d42(%rip), %rsi     # 0x75ac1
leaq 0x68(%rsp), %rdi
movq %rdi, (%rsp)
callq 0xe8d0
movq (%rsp), %rsi
leaq 0x25147(%rip), %rdx     # 0x75edf
leaq 0x88(%rsp), %rdi
callq 0xf4a0
jmp 0x50da7
movq 0x30(%rsp), %rax
movl 0x400(%rax), %esi
leaq 0x48(%rsp), %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x30500
jmp 0x50dc3
leaq 0xa8(%rsp), %rdi
leaq 0x88(%rsp), %rsi
leaq 0x48(%rsp), %rdx
callq 0xffb0
jmp 0x50ddf
leaq 0x4281a(%rip), %rdi     # 0x93600
leaq 0xa8(%rsp), %rsi
movl $0x1, %edx
callq 0x712f0
jmp 0x50dfa
leaq 0xa8(%rsp), %rdi
callq 0x6b50
leaq 0x48(%rsp), %rdi
callq 0x6b50
leaq 0x88(%rsp), %rdi
callq 0x6b50
leaq 0x68(%rsp), %rdi
callq 0x6b50
jmp 0x50eb3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x160(%rsp)
movl %eax, 0x15c(%rsp)
jmp 0x50ea7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x160(%rsp)
movl %eax, 0x15c(%rsp)
jmp 0x50e9a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x160(%rsp)
movl %eax, 0x15c(%rsp)
jmp 0x50e90
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x160(%rsp)
movl %eax, 0x15c(%rsp)
leaq 0xa8(%rsp), %rdi
callq 0x6b50
leaq 0x48(%rsp), %rdi
callq 0x6b50
leaq 0x88(%rsp), %rdi
callq 0x6b50
leaq 0x68(%rsp), %rdi
callq 0x6b50
jmp 0x50ef0
jmp 0x50eb5
movq 0x30(%rsp), %rdi
addq $0x560, %rdi            # imm = 0x560
movl 0x1fc(%rsp), %eax
movl %eax, %esi
callq 0x102b0
movq %rax, 0x38(%rsp)
movq %rdx, 0x40(%rsp)
leaq 0x38(%rsp), %rdi
movl $0x1, %esi
callq 0x1bd30
addq $0x208, %rsp            # imm = 0x208
retq
movq 0x160(%rsp), %rdi
callq 0x69e0
nopl (%rax)