// File: /workspace/github_cpp_makefile_star2_O2/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rdx, %r15
movl %esi, %ebp
movq %rdi, %rbx
leaq 0x4e8(%rdi), %r13
movl 0x8(%rdi), %esi
movq %r13, %rdi
callq 0x9c6c
cmpq $0x3, 0x8(%r15)
movl %ebp, %r14d
jne 0x1e336
movq (%r15), %rax
movzbl 0x1(%rax), %ecx
cmpl $0x7c, %ecx
je 0x1e300
cmpl $0x2f, %ecx
jne 0x1e336
movq 0x4e8(%rbx), %rcx
movl $0x2, (%rcx,%r14,4)
movsbl 0x1(%rax), %edx
movq %rbx, %rdi
movl %ebp, %esi
callq 0x1e5d4
movq (%r15), %rax
movsbl (%rax), %edx
movsbl 0x2(%rax), %ecx
movq %rbx, %rdi
movl %ebp, %esi
callq 0x1e634
jmp 0x1e534
leaq 0x10831(%rip), %rsi     # 0x2eb6e
movq %r15, %rdi
xorl %edx, %edx
callq 0x51f0
movq %rax, %r12
movq (%r13), %rax
cmpq $-0x1, %r12
je 0x1e3d1
movl $0x2, (%rax,%r14,4)
movq (%r15), %rax
movsbl (%rax,%r12), %edx
movq %rbx, %rdi
movl %ebp, %esi
callq 0x1e5d4
leaq 0x20(%rsp), %rdi
movq %r15, %rsi
xorl %edx, %edx
movq %r12, %rcx
callq 0x54c0
leaq 0x1(%r12), %rdx
movq %rsp, %rdi
pushq $-0x1
popq %rcx
movq %r15, %rsi
callq 0x54c0
leaq 0x48(%rsp), %r13
leaq 0x20(%rsp), %rsi
movq %rsp, %rdx
movq %r13, %rdi
callq 0x1ef62
movq %rbx, %rdi
movl %ebp, %esi
movq %r13, %rdx
callq 0x1e6b8
leaq 0x48(%rsp), %rdi
callq 0x1665a
movq %rsp, %rdi
callq 0x5908
leaq 0x20(%rsp), %rdi
jmp 0x1e47f
movl $0x1, (%rax,%r14,4)
pushq $0x7c
popq %rdx
movq %rbx, %rdi
movl %ebp, %esi
callq 0x1e5d4
movq %rsp, %r13
pushq $-0x1
popq %rcx
movq %r13, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x54c0
leaq 0x30(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq (%r13), %rdx
leaq 0x10(%rsp), %rax
cmpq %rax, %rdx
je 0x1e421
movq %rdx, 0x20(%rsp)
movq 0x10(%rsp), %rcx
movq %rcx, 0x30(%rsp)
jmp 0x1e427
movups (%rax), %xmm0
movups %xmm0, (%rcx)
movq 0x8(%rsp), %rcx
leaq 0x20(%rsp), %rsi
movq %rax, (%rsp)
andq $0x0, 0x8(%rsp)
movq %rcx, 0x8(%rsi)
movb $0x0, 0x10(%rsp)
leaq 0xfce2(%rip), %rax      # 0x2e12d
movq %rax, 0x20(%rsi)
leaq 0x48(%rsp), %rdi
callq 0x1ee22
leaq 0x48(%rsp), %rdx
movq %rbx, %rdi
movl %ebp, %esi
callq 0x1e6b8
leaq 0x48(%rsp), %rdi
callq 0x1665a
leaq 0x20(%rsp), %rdi
callq 0x5908
movq %rsp, %rdi
callq 0x5908
leaq 0x106e3(%rip), %rsi     # 0x2eb6e
pushq $-0x1
popq %rdx
movq %r15, %rdi
callq 0x5450
cmpq %rax, %r12
je 0x1e534
leaq 0x3e0(%rbx), %rdx
leaq 0x106c4(%rip), %rsi     # 0x2eb71
leaq 0x20(%rsp), %r15
movq %r15, %rdi
callq 0x967d
leaq 0x10b2c(%rip), %rdx     # 0x2efed
leaq 0x48(%rsp), %rdi
movq %r15, %rsi
callq 0x98b6
movl 0x400(%rbx), %esi
movq %rsp, %rdi
pushq $-0x1
popq %rdx
callq 0x12c9c
leaq 0x88(%rsp), %rdi
leaq 0x48(%rsp), %rsi
movq %rsp, %rdx
callq 0x9be3
leaq 0x22fd5(%rip), %rdi     # 0x414d0
leaq 0x88(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0x2bf18
leaq 0x88(%rsp), %rdi
callq 0x5908
movq %rsp, %rdi
callq 0x5908
leaq 0x48(%rsp), %rdi
callq 0x5908
leaq 0x20(%rsp), %rdi
callq 0x5908
addq $0x560, %rbx            # imm = 0x560
movq %rbx, %rdi
movq %r14, %rsi
callq 0x9cc0
orq %rdx, (%rax)
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x1665a
jmp 0x1e56d
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x5908
movq %rsp, %rdi
jmp 0x1e5c6
movq %rax, %rbx
leaq 0x88(%rsp), %rdi
callq 0x5908
jmp 0x1e591
movq %rax, %rbx
movq %rsp, %rdi
callq 0x5908
jmp 0x1e59e
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
jmp 0x1e5b7
jmp 0x1e5be
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x1665a
movq %rsp, %rdi
callq 0x5908
jmp 0x1e5c1
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x5908
movq %rbx, %rdi
callq 0x5800
nop