// File: auton1[P]viterbi/entry_filters.cpp
// Function: entry::filter_sites_by_filter_status(std::set<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>> const&, std::set<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>> const&, bool)
void entry::filter_sites_by_filter_status(const set<string> &filter_flags_to_remove, const set<string> &filter_flags_to_keep, bool remove_all)
{
	// Filter sites by entries in the FILTER field.
	if (passed_filters == false)
		return;

	if ((remove_all == false) && (filter_flags_to_remove.empty()) && (filter_flags_to_keep.empty()))
		return;

	vector<string> FILTERs;
	unsigned int N_to_remove = filter_flags_to_remove.size();
	unsigned int N_to_keep = filter_flags_to_keep.size();
	parse_basic_entry(false, true);
	get_FILTER_vector(FILTERs);

	if (N_to_keep > 0)
	{
		bool keep = false;
		for (unsigned int ui=0; ui<FILTERs.size(); ui++)
			if (filter_flags_to_keep.find(FILTERs[ui]) != filter_flags_to_keep.end())
			{
				keep = true; break;
			}

		passed_filters = keep;
	}
	if (passed_filters==false)
		return;

	if ( (FILTERs.size() >= 1) && (FILTERs[0] == "PASS") )
		return;
	else if ((remove_all == true) && (!FILTERs.empty()))
		passed_filters = false;
	else if (N_to_remove > 0)
	{
		for (unsigned int ui=0; ui<FILTERs.size(); ui++)
			if (filter_flags_to_remove.find(FILTERs[ui]) != filter_flags_to_remove.end())
				passed_filters = false;
	}
}

// Assembly:
subq $0xc8, %rsp
movb %cl, %al
movq %rdi, 0xc0(%rsp)
movq %rsi, 0xb8(%rsp)
movq %rdx, 0xb0(%rsp)
andb $0x1, %al
movb %al, 0xaf(%rsp)
movq 0xc0(%rsp), %rax
movq %rax, 0x40(%rsp)
movb 0xc(%rax), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x59cd9
jmp 0x59fe0
movb 0xaf(%rsp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x59d15
movq 0xb8(%rsp), %rdi
callq 0x4d120
testb $0x1, %al
jne 0x59cfd
jmp 0x59d15
movq 0xb0(%rsp), %rdi
callq 0x4d120
testb $0x1, %al
jne 0x59d10
jmp 0x59d15
jmp 0x59fe0
leaq 0x90(%rsp), %rdi
callq 0x10260
movq 0xb8(%rsp), %rdi
callq 0x10b30
movl %eax, 0x8c(%rsp)
movq 0xb0(%rsp), %rdi
callq 0x10b30
movq 0x40(%rsp), %rdi
movl %eax, 0x88(%rsp)
movq (%rdi), %rax
movq 0x10(%rax), %rax
movl $0x1, %edx
xorl %ecx, %ecx
movl %ecx, %esi
callq *%rax
jmp 0x59d63
movq 0x40(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0x4afe0
jmp 0x59d77
cmpl $0x0, 0x88(%rsp)
jbe 0x59e69
movb $0x0, 0x7b(%rsp)
movl $0x0, 0x74(%rsp)
movl 0x74(%rsp), %eax
movq %rax, 0x38(%rsp)
leaq 0x90(%rsp), %rdi
callq 0x10270
movq %rax, %rcx
movq 0x38(%rsp), %rax
cmpq %rcx, %rax
jae 0x59e5a
movq 0xb0(%rsp), %rax
movq %rax, 0x28(%rsp)
movl 0x74(%rsp), %eax
movl %eax, %esi
leaq 0x90(%rsp), %rdi
callq 0x10290
movq 0x28(%rsp), %rdi
movq %rax, %rsi
callq 0x39780
movq %rax, 0x30(%rsp)
jmp 0x59ded
movq 0x30(%rsp), %rax
movq %rax, 0x68(%rsp)
movq 0xb0(%rsp), %rdi
callq 0x10ba0
movq %rax, 0x60(%rsp)
leaq 0x68(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0x39760
testb $0x1, %al
jne 0x59e1e
jmp 0x59e48
movb $0x1, 0x7b(%rsp)
jmp 0x59e5a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x80(%rsp)
movl %eax, 0x7c(%rsp)
leaq 0x90(%rsp), %rdi
callq 0x10cc0
jmp 0x59fe8
jmp 0x59e4a
movl 0x74(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x74(%rsp)
jmp 0x59d92
movq 0x40(%rsp), %rax
movb 0x7b(%rsp), %cl
andb $0x1, %cl
movb %cl, 0xc(%rax)
movq 0x40(%rsp), %rax
movb 0xc(%rax), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x59e88
movl $0x1, 0x5c(%rsp)
jmp 0x59fd3
leaq 0x90(%rsp), %rdi
callq 0x10270
cmpq $0x1, %rax
jb 0x59ed8
xorl %eax, %eax
movl %eax, %esi
leaq 0x90(%rsp), %rdi
callq 0x10290
movq %rax, %rdi
leaq 0x1a66e(%rip), %rsi     # 0x74524
callq 0xea20
movb %al, 0x27(%rsp)
jmp 0x59ec1
movb 0x27(%rsp), %al
testb $0x1, %al
jne 0x59ecb
jmp 0x59ed8
movl $0x1, 0x5c(%rsp)
jmp 0x59fd3
movb 0xaf(%rsp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x59f08
leaq 0x90(%rsp), %rdi
callq 0x39710
testb $0x1, %al
jne 0x59f08
movq 0x40(%rsp), %rax
movb $0x0, 0xc(%rax)
jmp 0x59fc9
cmpl $0x0, 0x8c(%rsp)
jbe 0x59fc7
movl $0x0, 0x58(%rsp)
movl 0x58(%rsp), %eax
movq %rax, 0x18(%rsp)
leaq 0x90(%rsp), %rdi
callq 0x10270
movq %rax, %rcx
movq 0x18(%rsp), %rax
cmpq %rcx, %rax
jae 0x59fc5
movq 0xb8(%rsp), %rax
movq %rax, 0x8(%rsp)
movl 0x58(%rsp), %eax
movl %eax, %esi
leaq 0x90(%rsp), %rdi
callq 0x10290
movq 0x8(%rsp), %rdi
movq %rax, %rsi
callq 0x39780
movq %rax, 0x10(%rsp)
jmp 0x59f79
movq 0x10(%rsp), %rax
movq %rax, 0x50(%rsp)
movq 0xb8(%rsp), %rdi
callq 0x10ba0
movq %rax, 0x48(%rsp)
leaq 0x50(%rsp), %rdi
leaq 0x48(%rsp), %rsi
callq 0x39760
testb $0x1, %al
jne 0x59faa
jmp 0x59fb3
movq 0x40(%rsp), %rax
movb $0x0, 0xc(%rax)
jmp 0x59fb5
movl 0x58(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x58(%rsp)
jmp 0x59f1e
jmp 0x59fc7
jmp 0x59fc9
jmp 0x59fcb
movl $0x0, 0x5c(%rsp)
leaq 0x90(%rsp), %rdi
callq 0x10cc0
addq $0xc8, %rsp
retq
movq 0x80(%rsp), %rdi
callq 0x69e0
nopw %cs:(%rax,%rax)