// File: auton1[P]viterbi/entry_getters.cpp
// Function: entry::get_genotype_counts(std::vector<bool, std::allocator<bool>> const&, std::vector<bool, std::allocator<bool>> const&, unsigned int&, unsigned int&, unsigned int&) const
void entry::get_genotype_counts(const vector<bool> &include_indv, const vector<bool> &include_genotype, unsigned int &out_N_hom1, unsigned int &out_N_het, unsigned int &out_N_hom2) const
{
	out_N_hom1 = 0; out_N_hom2 = 0; out_N_het = 0;
	pair<int, int> genotype;
	if (ALT.size() > 1)
		LOG.error("Tried to return the genotype counts of a non-biallelic SNP", 99);

	for (unsigned int ui=0; ui<N_indv; ui++)
	{
		if ((include_indv[ui] == true) && (include_genotype[ui] == true))
		{
			assert(parsed_GT[ui] == true);
			get_indv_GENOTYPE_ids(ui, genotype);
			if ((genotype.first > -1) && (genotype.second > -1))
			{
				if (genotype.first != genotype.second)
					out_N_het++;
				else if (genotype.first == 0)
					out_N_hom1++;
				else if (genotype.first == 1)
					out_N_hom2++;
				else
					LOG.error("Unknown allele in genotype", 98);
			}
		}
	}
}

// Assembly:
subq $0xb8, %rsp
movq %rdi, 0xb0(%rsp)
movq %rsi, 0xa8(%rsp)
movq %rdx, 0xa0(%rsp)
movq %rcx, 0x98(%rsp)
movq %r8, 0x90(%rsp)
movq %r9, 0x88(%rsp)
movq 0xb0(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x98(%rsp), %rax
movl $0x0, (%rax)
movq 0x88(%rsp), %rax
movl $0x0, (%rax)
movq 0x90(%rsp), %rax
movl $0x0, (%rax)
leaq 0x80(%rsp), %rdi
callq 0x2a380
movq 0x18(%rsp), %rdi
addq $0x448, %rdi            # imm = 0x448
callq 0x10270
cmpq $0x1, %rax
jbe 0x4c752
leaq 0x5f(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0x69f0
movq 0x10(%rsp), %rdx
leaq 0x2922f(%rip), %rsi     # 0x75910
leaq 0x60(%rsp), %rdi
callq 0x67c0
jmp 0x4c6ed
leaq 0x46f0c(%rip), %rdi     # 0x93600
leaq 0x60(%rsp), %rsi
movl $0x63, %edx
callq 0x712f0
jmp 0x4c705
leaq 0x60(%rsp), %rdi
callq 0x6b50
leaq 0x5f(%rsp), %rdi
callq 0x65f0
jmp 0x4c752
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x50(%rsp)
movl %eax, 0x4c(%rsp)
jmp 0x4c743
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x50(%rsp)
movl %eax, 0x4c(%rsp)
leaq 0x60(%rsp), %rdi
callq 0x6b50
leaq 0x5f(%rsp), %rdi
callq 0x65f0
jmp 0x4c92d
movl $0x0, 0x48(%rsp)
movq 0x18(%rsp), %rcx
movl 0x48(%rsp), %eax
cmpl 0x8(%rcx), %eax
jae 0x4c925
movq 0xa8(%rsp), %rdi
movl 0x48(%rsp), %eax
movl %eax, %esi
callq 0xf150
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x4c913
movq 0xa0(%rsp), %rdi
movl 0x48(%rsp), %eax
movl %eax, %esi
callq 0xf150
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x4c913
movq 0x18(%rsp), %rdi
addq $0x560, %rdi            # imm = 0x560
movl 0x48(%rsp), %eax
movl %eax, %esi
callq 0xf150
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x4c7d1
jmp 0x4c7f0
leaq 0x28b48(%rip), %rdi     # 0x75320
leaq 0x28ad1(%rip), %rsi     # 0x752b0
movl $0x1b1, %edx            # imm = 0x1B1
leaq 0x29160(%rip), %rcx     # 0x7594b
callq 0x6300
movq 0x18(%rsp), %rdi
movl 0x48(%rsp), %esi
leaq 0x80(%rsp), %rdx
callq 0x4bd10
cmpl $-0x1, 0x80(%rsp)
jle 0x4c911
cmpl $-0x1, 0x84(%rsp)
jle 0x4c911
movl 0x80(%rsp), %eax
cmpl 0x84(%rsp), %eax
je 0x4c846
movq 0x90(%rsp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
jmp 0x4c90f
cmpl $0x0, 0x80(%rsp)
jne 0x4c864
movq 0x98(%rsp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
jmp 0x4c90d
cmpl $0x1, 0x80(%rsp)
jne 0x4c882
movq 0x88(%rsp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
jmp 0x4c90b
leaq 0x27(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0x69f0
movq 0x8(%rsp), %rdx
leaq 0x29130(%rip), %rsi     # 0x759cd
leaq 0x28(%rsp), %rdi
callq 0x67c0
jmp 0x4c8a9
leaq 0x46d50(%rip), %rdi     # 0x93600
leaq 0x28(%rsp), %rsi
movl $0x62, %edx
callq 0x712f0
jmp 0x4c8c1
leaq 0x28(%rsp), %rdi
callq 0x6b50
leaq 0x27(%rsp), %rdi
callq 0x65f0
jmp 0x4c90b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x50(%rsp)
movl %eax, 0x4c(%rsp)
jmp 0x4c8ff
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x50(%rsp)
movl %eax, 0x4c(%rsp)
leaq 0x28(%rsp), %rdi
callq 0x6b50
leaq 0x27(%rsp), %rdi
callq 0x65f0
jmp 0x4c92d
jmp 0x4c90d
jmp 0x4c90f
jmp 0x4c911
jmp 0x4c913
jmp 0x4c915
movl 0x48(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x48(%rsp)
jmp 0x4c75a
addq $0xb8, %rsp
retq
movq 0x50(%rsp), %rdi
callq 0x69e0
nopw (%rax,%rax)