// File: auton1[P]viterbi/entry_filters.cpp
// Function: entry::filter_sites_by_allele_type(bool, bool)
void entry::filter_sites_by_allele_type(bool keep_only_indels, bool remove_indels)
{
	if (passed_filters == false)
		return;

	if ((keep_only_indels == false) && (remove_indels == false))
		return;
	if ((keep_only_indels == true) && (remove_indels == true))
		LOG.error("Can't both keep and remove all indels!");

	string allele;
	unsigned int ref_len, N_alleles;
	bool is_indel;

	parse_basic_entry(true);
	is_indel = false;
	allele = REF;
	ref_len = allele.size();
	if (ref_len != 1)
		is_indel = true;
	N_alleles = get_N_alleles();
	for (unsigned int ui=1; ui<N_alleles; ui++)
	{
		get_allele(ui, allele);
		if (allele.size() != ref_len)
		{
			is_indel = true;
			break;
		}
	}

	if (keep_only_indels == true)
	{
		if (is_indel == false)
			passed_filters = false;
	}
	else if (remove_indels == true)
	{
		if (is_indel == true)
			passed_filters = false;
	}
}

// Assembly:
subq $0x98, %rsp
movb %dl, %al
movb %sil, %cl
movq %rdi, 0x90(%rsp)
andb $0x1, %cl
movb %cl, 0x8f(%rsp)
andb $0x1, %al
movb %al, 0x8e(%rsp)
movq 0x90(%rsp), %rax
movq %rax, 0x18(%rsp)
movb 0xc(%rax), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x599d6
jmp 0x59bf4
movb 0x8f(%rsp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x599fd
movb 0x8e(%rsp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x599fd
jmp 0x59bf4
movb 0x8f(%rsp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x59ab3
movb 0x8e(%rsp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x59ab3
leaq 0x67(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0x69f0
movq 0x10(%rsp), %rdx
leaq 0x1c332(%rip), %rsi     # 0x75d74
leaq 0x68(%rsp), %rdi
callq 0x67c0
jmp 0x59a4e
leaq 0x39bab(%rip), %rdi     # 0x93600
leaq 0x68(%rsp), %rsi
movl $0x1, %edx
callq 0x712f0
jmp 0x59a66
leaq 0x68(%rsp), %rdi
callq 0x6b50
leaq 0x67(%rsp), %rdi
callq 0x65f0
jmp 0x59ab3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x58(%rsp)
movl %eax, 0x54(%rsp)
jmp 0x59aa4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x58(%rsp)
movl %eax, 0x54(%rsp)
leaq 0x68(%rsp), %rdi
callq 0x6b50
leaq 0x67(%rsp), %rdi
callq 0x65f0
jmp 0x59bfc
leaq 0x30(%rsp), %rdi
callq 0x67e0
movq 0x18(%rsp), %rdi
movq (%rdi), %rax
movq 0x10(%rax), %rax
movl $0x1, %esi
xorl %ecx, %ecx
movl %ecx, %edx
callq *%rax
jmp 0x59ad6
movq 0x18(%rsp), %rsi
movb $0x0, 0x27(%rsp)
addq $0x428, %rsi            # imm = 0x428
leaq 0x30(%rsp), %rdi
callq 0x6060
jmp 0x59af3
leaq 0x30(%rsp), %rdi
callq 0x6350
movl %eax, 0x2c(%rsp)
cmpl $0x1, 0x2c(%rsp)
je 0x59b2c
movb $0x1, 0x27(%rsp)
jmp 0x59b2c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x58(%rsp)
movl %eax, 0x54(%rsp)
leaq 0x30(%rsp), %rdi
callq 0x6b50
jmp 0x59bfc
movq 0x18(%rsp), %rdi
callq 0x4c290
movl %eax, 0xc(%rsp)
jmp 0x59b3c
movl 0xc(%rsp), %eax
movl %eax, 0x28(%rsp)
movl $0x1, 0x20(%rsp)
movl 0x20(%rsp), %eax
cmpl 0x28(%rsp), %eax
jae 0x59b94
movq 0x18(%rsp), %rdi
movl 0x20(%rsp), %esi
leaq 0x30(%rsp), %rdx
callq 0x4a920
jmp 0x59b6b
leaq 0x30(%rsp), %rdi
callq 0x6350
movl 0x2c(%rsp), %ecx
cmpq %rcx, %rax
je 0x59b85
movb $0x1, 0x27(%rsp)
jmp 0x59b94
jmp 0x59b87
movl 0x20(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x20(%rsp)
jmp 0x59b4c
movb 0x8f(%rsp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x59bbe
movb 0x27(%rsp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x59bbc
movq 0x18(%rsp), %rax
movb $0x0, 0xc(%rax)
jmp 0x59bea
movb 0x8e(%rsp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x59be8
movb 0x27(%rsp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x59be6
movq 0x18(%rsp), %rax
movb $0x0, 0xc(%rax)
jmp 0x59be8
jmp 0x59bea
leaq 0x30(%rsp), %rdi
callq 0x6b50
addq $0x98, %rsp
retq
movq 0x58(%rsp), %rdi
callq 0x69e0
nopw %cs:(%rax,%rax)