// File: auton1[P]viterbi/entry_getters.cpp
// Function: entry::get_allele_counts(std::vector<int, std::allocator<int>>&, unsigned int&, std::vector<bool, std::allocator<bool>> const&, std::vector<bool, std::allocator<bool>> const&) const
void entry::get_allele_counts(vector<int> &out, unsigned int &N_non_missing_chr_out, const vector<bool> &include_indv, const vector<bool> &include_genotype) const
{
	pair<int,int> genotype;
	vector<int> allele_counts(get_N_alleles(), 0);
	N_non_missing_chr_out = 0;

	for (unsigned int ui=0; ui<N_indv; ui++)
	{
		//FILTERING BY INDIVIDUAL
		if ((include_indv[ui] == true) && (include_genotype[ui] == true))
		{
			assert(parsed_GT[ui] == true);
			get_indv_GENOTYPE_ids(ui, genotype);

			if (genotype.first > -1)
			{
				allele_counts[genotype.first]++;
				N_non_missing_chr_out++;
			}
			if (genotype.second > -1)
			{
				allele_counts[genotype.second]++;
				N_non_missing_chr_out++;
			}
		}
	}
	out = allele_counts;
}

// Assembly:
subq $0x88, %rsp
movq %rdi, 0x80(%rsp)
movq %rsi, 0x78(%rsp)
movq %rdx, 0x70(%rsp)
movq %rcx, 0x68(%rsp)
movq %r8, 0x60(%rsp)
movq 0x80(%rsp), %rax
movq %rax, 0x10(%rsp)
leaq 0x58(%rsp), %rdi
callq 0x2a380
movq 0x10(%rsp), %rdi
callq 0x4c290
movl %eax, %eax
movq %rax, 0x18(%rsp)
movl $0x0, 0x3c(%rsp)
leaq 0x3b(%rsp), %rdi
movq %rdi, 0x20(%rsp)
callq 0xf3c0
movq 0x18(%rsp), %rsi
movq 0x20(%rsp), %rcx
leaq 0x40(%rsp), %rdi
leaq 0x3c(%rsp), %rdx
callq 0x4d4e0
jmp 0x4c47d
leaq 0x3b(%rsp), %rdi
callq 0xf450
movq 0x70(%rsp), %rax
movl $0x0, (%rax)
movl $0x0, 0x28(%rsp)
movq 0x10(%rsp), %rcx
movl 0x28(%rsp), %eax
cmpl 0x8(%rcx), %eax
jae 0x4c5fd
movq 0x68(%rsp), %rdi
movl 0x28(%rsp), %eax
movl %eax, %esi
callq 0xf150
movb %al, 0xf(%rsp)
jmp 0x4c4c2
movb 0xf(%rsp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x4c5eb
movq 0x60(%rsp), %rdi
movl 0x28(%rsp), %eax
movl %eax, %esi
callq 0xf150
movb %al, 0xe(%rsp)
jmp 0x4c4ea
movb 0xe(%rsp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x4c5eb
movq 0x10(%rsp), %rdi
addq $0x560, %rdi            # imm = 0x560
movl 0x28(%rsp), %eax
movl %eax, %esi
callq 0xf150
movb %al, 0xd(%rsp)
jmp 0x4c519
movb 0xd(%rsp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x4c529
jmp 0x4c582
leaq 0x28df0(%rip), %rdi     # 0x75320
leaq 0x28d79(%rip), %rsi     # 0x752b0
movl $0x194, %edx            # imm = 0x194
leaq 0x2935e(%rip), %rcx     # 0x758a1
callq 0x6300
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x30(%rsp)
movl %eax, 0x2c(%rsp)
leaq 0x3b(%rsp), %rdi
callq 0xf450
jmp 0x4c620
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x30(%rsp)
movl %eax, 0x2c(%rsp)
leaq 0x40(%rsp), %rdi
callq 0xed70
jmp 0x4c620
movq 0x10(%rsp), %rdi
movl 0x28(%rsp), %esi
leaq 0x58(%rsp), %rdx
callq 0x4bd10
jmp 0x4c597
cmpl $-0x1, 0x58(%rsp)
jle 0x4c5c0
movslq 0x58(%rsp), %rsi
leaq 0x40(%rsp), %rdi
callq 0xecf0
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movq 0x70(%rsp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
cmpl $-0x1, 0x5c(%rsp)
jle 0x4c5e9
movslq 0x5c(%rsp), %rsi
leaq 0x40(%rsp), %rdi
callq 0xecf0
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movq 0x70(%rsp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
jmp 0x4c5eb
jmp 0x4c5ed
movl 0x28(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x28(%rsp)
jmp 0x4c49a
movq 0x78(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0x4d560
jmp 0x4c60e
leaq 0x40(%rsp), %rdi
callq 0xed70
addq $0x88, %rsp
retq
movq 0x30(%rsp), %rdi
callq 0x69e0
nopw (%rax,%rax)