// File: auton1[P]viterbi/entry_filters.cpp
// Function: entry::filter_sites_by_positions(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void entry::filter_sites_by_positions(const string &positions_file, const string &exclude_positions_file)
{
	// Filter sites by a user defined file containing a list of positions
	if (passed_filters == false)
		return;

	if ((positions_file == "") && (exclude_positions_file == ""))
		return;

	int idx;
	if (keep_positions.empty() && positions_file != "")
	{
		string chr;
		int pos1;
		unsigned int N_chr=chr_to_idx.size();
		stringstream ss;
		string line;
		unsigned int gzMAX_LINE_LEN = 1024*1024;
		char *gz_readbuffer = new char[gzMAX_LINE_LEN];

		gzFile gz_in = gzopen(positions_file.c_str(), "rb");
		if (gz_in == NULL)
			LOG.error("Could not open Positions file: " + positions_file);

		while (!gzeof(gz_in))
		{
			line = "";
			bool again = true;
			while (again == true)
			{
				gzgets(gz_in, gz_readbuffer, gzMAX_LINE_LEN);
				line.append(gz_readbuffer);
				if (strlen(gz_readbuffer) != gzMAX_LINE_LEN-1)
					again = false;
			}
			if (line[0] == '#')
				continue;
			line.erase( line.find_last_not_of(" \t\n\r") + 1);	// Trim whitespace at end of line (required in gzipped case!)

			ss.clear();
			ss.str(line);
			ss >> chr >> pos1;

			if (chr_to_idx.find(chr) == chr_to_idx.end())
			{
				N_chr++;
				chr_to_idx[chr] = (N_chr-1);
				keep_positions.resize(N_chr);
			}

			idx = chr_to_idx[chr];
			keep_positions[idx].insert(pos1);
		}
		gzclose(gz_in);
		delete [] gz_readbuffer;
	}
	if (exclude_positions.empty() && exclude_positions_file != "")
	{
		string chr;
		int pos1;
		unsigned int N_chr=0;
		stringstream ss;
		string line;
		unsigned int gzMAX_LINE_LEN = 1024*1024;
		char *gz_readbuffer = new char[gzMAX_LINE_LEN];

		gzFile gz_in = gzopen(exclude_positions_file.c_str(), "rb");
		if (gz_in == NULL)
			LOG.error("Could not open Positions file: " + exclude_positions_file);

		while (!gzeof(gz_in))
		{
			line = "";
			bool again = true;
			while (again == true)
			{
				gzgets(gz_in, gz_readbuffer, gzMAX_LINE_LEN);
				line.append(gz_readbuffer);
				if (strlen(gz_readbuffer) != gzMAX_LINE_LEN-1)
					again = false;
			}
			if (line[0] == '#')
				continue;
			line.erase( line.find_last_not_of(" \t\n\r") + 1);	// Trim whitespace at end of line (required in gzipped case!)

			ss.clear();
			ss.str(line);
			ss >> chr >> pos1;

			if (chr_to_idx.find(chr) == chr_to_idx.end())
			{
				N_chr++;
				chr_to_idx[chr] = (N_chr-1);
				exclude_positions.resize(N_chr);
			}

			idx = chr_to_idx[chr];
			exclude_positions[idx].insert(pos1);
		}
		gzclose(gz_in);
		delete [] gz_readbuffer;
	}

	parse_basic_entry();

	if (!keep_positions.empty())
	{	// Check to see if position is in keep list
			if (chr_to_idx.find(CHROM) == chr_to_idx.end())
				passed_filters = false;
			else
			{
				idx = chr_to_idx[CHROM];
				bool found=false;

				if (keep_positions[idx].find(POS) != keep_positions[idx].end())
					found = true;

				if (found == false)
					passed_filters = false;
			}
	}
	if (!exclude_positions.empty())
	{	// Check to see if position is in exclude list
		if (chr_to_idx.find(CHROM) != chr_to_idx.end())
		{
			idx = chr_to_idx[CHROM];
			bool found=false;

			if (exclude_positions[idx].find(POS) != exclude_positions[idx].end())
				found = true;

				if (found == true)
					passed_filters = false;
		}
	}
}

// Assembly:
subq $0x5c8, %rsp            # imm = 0x5C8
movq %rdi, 0x5c0(%rsp)
movq %rsi, 0x5b8(%rsp)
movq %rdx, 0x5b0(%rsp)
movq 0x5c0(%rsp), %rax
movq %rax, 0xe0(%rsp)
movb 0xc(%rax), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x5a111
jmp 0x5ad50
movq 0x5b8(%rsp), %rdi
leaq 0x1bc09(%rip), %rsi     # 0x75d29
callq 0xea20
testb $0x1, %al
jne 0x5a12b
jmp 0x5a14a
movq 0x5b0(%rsp), %rdi
leaq 0x1bbef(%rip), %rsi     # 0x75d29
callq 0xea20
testb $0x1, %al
jne 0x5a145
jmp 0x5a14a
jmp 0x5ad50
leaq 0x3a32f(%rip), %rdi     # 0x94480
callq 0x5edf0
testb $0x1, %al
jne 0x5a15f
jmp 0x5a635
movq 0x5b8(%rsp), %rdi
leaq 0x1bbbb(%rip), %rsi     # 0x75d29
callq 0x30930
testb $0x1, %al
jne 0x5a17c
jmp 0x5a635
leaq 0x588(%rsp), %rdi
callq 0x67e0
leaq 0x3a320(%rip), %rdi     # 0x944b0
callq 0x5ee40
movl %eax, 0x580(%rsp)
leaq 0x3f8(%rsp), %rdi
callq 0x6360
jmp 0x5a1ab
leaq 0x3c8(%rsp), %rdi
callq 0x67e0
movl $0x100000, 0x3c4(%rsp) # imm = 0x100000
movl 0x3c4(%rsp), %eax
movl %eax, %edi
callq 0x6030
movq %rax, 0xd8(%rsp)
jmp 0x5a1db
movq 0xd8(%rsp), %rax
movq %rax, 0x3b8(%rsp)
movq 0x5b8(%rsp), %rdi
callq 0x61a0
movq %rax, %rdi
leaq 0x1a28b(%rip), %rsi     # 0x7448d
callq 0x6860
movq %rax, 0xd0(%rsp)
jmp 0x5a211
movq 0xd0(%rsp), %rax
movq %rax, 0x3b0(%rsp)
cmpq $0x0, 0x3b0(%rsp)
jne 0x5a2d0
movq 0x5b8(%rsp), %rdx
leaq 0x1ba78(%rip), %rsi     # 0x75cb7
leaq 0x390(%rsp), %rdi
callq 0xe8d0
jmp 0x5a24e
leaq 0x393ab(%rip), %rdi     # 0x93600
leaq 0x390(%rsp), %rsi
movl $0x1, %edx
callq 0x712f0
jmp 0x5a269
leaq 0x390(%rsp), %rdi
callq 0x6b50
jmp 0x5a2d0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3f0(%rsp)
movl %eax, 0x3ec(%rsp)
jmp 0x5a623
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3f0(%rsp)
movl %eax, 0x3ec(%rsp)
jmp 0x5a609
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3f0(%rsp)
movl %eax, 0x3ec(%rsp)
leaq 0x390(%rsp), %rdi
callq 0x6b50
jmp 0x5a609
jmp 0x5a2d2
movq 0x3b0(%rsp), %rdi
callq 0x6140
movl %eax, 0xcc(%rsp)
jmp 0x5a2e8
movl 0xcc(%rsp), %eax
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x5a300
jmp 0x5a5b4
leaq 0x1ba22(%rip), %rsi     # 0x75d29
leaq 0x3c8(%rsp), %rdi
callq 0x67b0
jmp 0x5a316
movb $0x1, 0x38f(%rsp)
movb 0x38f(%rsp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x5a38c
movq 0x3b0(%rsp), %rdi
movq 0x3b8(%rsp), %rsi
movl 0x3c4(%rsp), %edx
callq 0x6980
jmp 0x5a34d
movq 0x3b8(%rsp), %rsi
leaq 0x3c8(%rsp), %rdi
callq 0x6ac0
jmp 0x5a364
movq 0x3b8(%rsp), %rdi
callq 0x61d0
movl 0x3c4(%rsp), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
cmpq %rcx, %rax
je 0x5a38a
movb $0x0, 0x38f(%rsp)
jmp 0x5a31e
xorl %eax, %eax
movl %eax, %esi
leaq 0x3c8(%rsp), %rdi
callq 0x6b20
movq %rax, 0xc0(%rsp)
jmp 0x5a3a7
movq 0xc0(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x23, %eax
jne 0x5a3bc
jmp 0x5a2d2
leaq 0x1a2ba(%rip), %rsi     # 0x7467d
leaq 0x3c8(%rsp), %rdi
movq %rdi, 0xb0(%rsp)
movq $-0x1, %rdx
movq %rdx, 0xb8(%rsp)
callq 0x6a30
movq 0xb0(%rsp), %rdi
movq 0xb8(%rsp), %rdx
movq %rax, %rsi
incq %rsi
callq 0x60f0
jmp 0x5a404
movq 0x3f8(%rsp), %rax
movq -0x18(%rax), %rax
leaq 0x3f8(%rsp,%rax), %rdi
xorl %esi, %esi
callq 0x6950
jmp 0x5a421
leaq 0x3f8(%rsp), %rdi
leaq 0x3c8(%rsp), %rsi
callq 0x6650
jmp 0x5a438
leaq 0x3f8(%rsp), %rdi
leaq 0x588(%rsp), %rsi
callq 0x6720
movq %rax, 0xa8(%rsp)
jmp 0x5a457
movq 0xa8(%rsp), %rdi
leaq 0x584(%rsp), %rsi
callq 0x62b0
jmp 0x5a46e
leaq 0x3a03b(%rip), %rdi     # 0x944b0
leaq 0x588(%rsp), %rsi
callq 0x310f0
movq %rax, 0xa0(%rsp)
jmp 0x5a48c
movq 0xa0(%rsp), %rax
movq %rax, 0x380(%rsp)
leaq 0x3a00d(%rip), %rdi     # 0x944b0
callq 0x31120
movq %rax, 0x378(%rsp)
leaq 0x380(%rsp), %rdi
leaq 0x378(%rsp), %rsi
callq 0x32ab0
testb $0x1, %al
jne 0x5a4cb
jmp 0x5a533
movl 0x580(%rsp), %eax
incl %eax
movl %eax, 0x580(%rsp)
movl 0x580(%rsp), %eax
decl %eax
movl %eax, 0x94(%rsp)
leaq 0x39fbe(%rip), %rdi     # 0x944b0
leaq 0x588(%rsp), %rsi
callq 0x30fe0
movq %rax, 0x98(%rsp)
jmp 0x5a509
movq 0x98(%rsp), %rax
movl 0x94(%rsp), %ecx
movl %ecx, (%rax)
movl 0x580(%rsp), %eax
movl %eax, %esi
leaq 0x39f56(%rip), %rdi     # 0x94480
callq 0x5ee50
jmp 0x5a531
jmp 0x5a533
leaq 0x39f76(%rip), %rdi     # 0x944b0
leaq 0x588(%rsp), %rsi
callq 0x30fe0
movq %rax, 0x88(%rsp)
jmp 0x5a551
movq 0x88(%rsp), %rax
movl (%rax), %eax
movl %eax, 0x5ac(%rsp)
movslq 0x5ac(%rsp), %rsi
leaq 0x39f0f(%rip), %rdi     # 0x94480
callq 0x5eef0
movq %rax, %rdi
leaq 0x584(%rsp), %rsi
callq 0x5ef10
movb %dl, 0x7f(%rsp)
movq %rax, 0x80(%rsp)
jmp 0x5a594
movb 0x7f(%rsp), %al
movq 0x80(%rsp), %rcx
movq %rcx, 0x368(%rsp)
movb %al, 0x370(%rsp)
jmp 0x5a2d2
movq 0x3b0(%rsp), %rdi
callq 0x6940
jmp 0x5a5c3
movq 0x3b8(%rsp), %rax
movq %rax, 0x70(%rsp)
cmpq $0x0, %rax
je 0x5a5e0
movq 0x70(%rsp), %rdi
callq 0x6750
leaq 0x3c8(%rsp), %rdi
callq 0x6b50
leaq 0x3f8(%rsp), %rdi
callq 0x63c0
leaq 0x588(%rsp), %rdi
callq 0x6b50
jmp 0x5a635
leaq 0x3c8(%rsp), %rdi
callq 0x6b50
leaq 0x3f8(%rsp), %rdi
callq 0x63c0
leaq 0x588(%rsp), %rdi
callq 0x6b50
jmp 0x5ad58
leaq 0x39e5c(%rip), %rdi     # 0x94498
callq 0x5edf0
testb $0x1, %al
jne 0x5a64a
jmp 0x5aace
movq 0x5b0(%rsp), %rdi
leaq 0x1b6d0(%rip), %rsi     # 0x75d29
callq 0x30930
testb $0x1, %al
jne 0x5a667
jmp 0x5aace
leaq 0x348(%rsp), %rdi
callq 0x67e0
movl $0x0, 0x340(%rsp)
leaq 0x1b8(%rsp), %rdi
callq 0x6360
jmp 0x5a68e
leaq 0x198(%rsp), %rdi
callq 0x67e0
movl $0x100000, 0x194(%rsp) # imm = 0x100000
movl 0x194(%rsp), %eax
movl %eax, %edi
callq 0x6030
movq %rax, 0x68(%rsp)
jmp 0x5a6bb
movq 0x68(%rsp), %rax
movq %rax, 0x188(%rsp)
movq 0x5b0(%rsp), %rdi
callq 0x61a0
movq %rax, %rdi
leaq 0x19dae(%rip), %rsi     # 0x7448d
callq 0x6860
movq %rax, 0x60(%rsp)
jmp 0x5a6eb
movq 0x60(%rsp), %rax
movq %rax, 0x180(%rsp)
cmpq $0x0, 0x180(%rsp)
jne 0x5a7a7
movq 0x5b0(%rsp), %rdx
leaq 0x1b5a1(%rip), %rsi     # 0x75cb7
leaq 0x160(%rsp), %rdi
callq 0xe8d0
jmp 0x5a725
leaq 0x38ed4(%rip), %rdi     # 0x93600
leaq 0x160(%rsp), %rsi
movl $0x1, %edx
callq 0x712f0
jmp 0x5a740
leaq 0x160(%rsp), %rdi
callq 0x6b50
jmp 0x5a7a7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3f0(%rsp)
movl %eax, 0x3ec(%rsp)
jmp 0x5aabc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3f0(%rsp)
movl %eax, 0x3ec(%rsp)
jmp 0x5aaa2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3f0(%rsp)
movl %eax, 0x3ec(%rsp)
leaq 0x160(%rsp), %rdi
callq 0x6b50
jmp 0x5aaa2
jmp 0x5a7a9
movq 0x180(%rsp), %rdi
callq 0x6140
movl %eax, 0x5c(%rsp)
jmp 0x5a7bc
movl 0x5c(%rsp), %eax
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x5a7d1
jmp 0x5aa4f
leaq 0x1b551(%rip), %rsi     # 0x75d29
leaq 0x198(%rsp), %rdi
callq 0x67b0
jmp 0x5a7e7
movb $0x1, 0x15f(%rsp)
movb 0x15f(%rsp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x5a85d
movq 0x180(%rsp), %rdi
movq 0x188(%rsp), %rsi
movl 0x194(%rsp), %edx
callq 0x6980
jmp 0x5a81e
movq 0x188(%rsp), %rsi
leaq 0x198(%rsp), %rdi
callq 0x6ac0
jmp 0x5a835
movq 0x188(%rsp), %rdi
callq 0x61d0
movl 0x194(%rsp), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
cmpq %rcx, %rax
je 0x5a85b
movb $0x0, 0x15f(%rsp)
jmp 0x5a7ef
xorl %eax, %eax
movl %eax, %esi
leaq 0x198(%rsp), %rdi
callq 0x6b20
movq %rax, 0x50(%rsp)
jmp 0x5a875
movq 0x50(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x23, %eax
jne 0x5a887
jmp 0x5a7a9
leaq 0x19def(%rip), %rsi     # 0x7467d
leaq 0x198(%rsp), %rdi
movq %rdi, 0x40(%rsp)
movq $-0x1, %rdx
movq %rdx, 0x48(%rsp)
callq 0x6a30
movq 0x40(%rsp), %rdi
movq 0x48(%rsp), %rdx
movq %rax, %rsi
incq %rsi
callq 0x60f0
jmp 0x5a8c3
movq 0x1b8(%rsp), %rax
movq -0x18(%rax), %rax
leaq 0x1b8(%rsp,%rax), %rdi
xorl %esi, %esi
callq 0x6950
jmp 0x5a8e0
leaq 0x1b8(%rsp), %rdi
leaq 0x198(%rsp), %rsi
callq 0x6650
jmp 0x5a8f7
leaq 0x1b8(%rsp), %rdi
leaq 0x348(%rsp), %rsi
callq 0x6720
movq %rax, 0x38(%rsp)
jmp 0x5a913
movq 0x38(%rsp), %rdi
leaq 0x344(%rsp), %rsi
callq 0x62b0
jmp 0x5a927
leaq 0x39b82(%rip), %rdi     # 0x944b0
leaq 0x348(%rsp), %rsi
callq 0x310f0
movq %rax, 0x30(%rsp)
jmp 0x5a942
movq 0x30(%rsp), %rax
movq %rax, 0x150(%rsp)
leaq 0x39b5a(%rip), %rdi     # 0x944b0
callq 0x31120
movq %rax, 0x148(%rsp)
leaq 0x150(%rsp), %rdi
leaq 0x148(%rsp), %rsi
callq 0x32ab0
testb $0x1, %al
jne 0x5a97e
jmp 0x5a9da
movl 0x340(%rsp), %eax
incl %eax
movl %eax, 0x340(%rsp)
movl 0x340(%rsp), %eax
decl %eax
movl %eax, 0x24(%rsp)
leaq 0x39b0e(%rip), %rdi     # 0x944b0
leaq 0x348(%rsp), %rsi
callq 0x30fe0
movq %rax, 0x28(%rsp)
jmp 0x5a9b6
movq 0x28(%rsp), %rax
movl 0x24(%rsp), %ecx
movl %ecx, (%rax)
movl 0x340(%rsp), %eax
movl %eax, %esi
leaq 0x39ac7(%rip), %rdi     # 0x94498
callq 0x5ee50
jmp 0x5a9d8
jmp 0x5a9da
leaq 0x39acf(%rip), %rdi     # 0x944b0
leaq 0x348(%rsp), %rsi
callq 0x30fe0
movq %rax, 0x18(%rsp)
jmp 0x5a9f5
movq 0x18(%rsp), %rax
movl (%rax), %eax
movl %eax, 0x5ac(%rsp)
movslq 0x5ac(%rsp), %rsi
leaq 0x39a86(%rip), %rdi     # 0x94498
callq 0x5eef0
movq %rax, %rdi
leaq 0x344(%rsp), %rsi
callq 0x5ef10
movb %dl, 0xf(%rsp)
movq %rax, 0x10(%rsp)
jmp 0x5aa32
movb 0xf(%rsp), %al
movq 0x10(%rsp), %rcx
movq %rcx, 0x138(%rsp)
movb %al, 0x140(%rsp)
jmp 0x5a7a9
movq 0x180(%rsp), %rdi
callq 0x6940
jmp 0x5aa5e
movq 0x188(%rsp), %rax
movq %rax, (%rsp)
cmpq $0x0, %rax
je 0x5aa79
movq (%rsp), %rdi
callq 0x6750
leaq 0x198(%rsp), %rdi
callq 0x6b50
leaq 0x1b8(%rsp), %rdi
callq 0x63c0
leaq 0x348(%rsp), %rdi
callq 0x6b50
jmp 0x5aace
leaq 0x198(%rsp), %rdi
callq 0x6b50
leaq 0x1b8(%rsp), %rdi
callq 0x63c0
leaq 0x348(%rsp), %rdi
callq 0x6b50
jmp 0x5ad58
movq 0xe0(%rsp), %rdi
movq (%rdi), %rax
xorl %ecx, %ecx
movl %ecx, %esi
movl %ecx, %edx
callq *0x10(%rax)
leaq 0x39997(%rip), %rdi     # 0x94480
callq 0x5edf0
testb $0x1, %al
jne 0x5ac20
movq 0xe0(%rsp), %rsi
addq $0x3e0, %rsi            # imm = 0x3E0
leaq 0x399a4(%rip), %rdi     # 0x944b0
callq 0x310f0
movq %rax, 0x130(%rsp)
leaq 0x39990(%rip), %rdi     # 0x944b0
callq 0x31120
movq %rax, 0x128(%rsp)
leaq 0x130(%rsp), %rdi
leaq 0x128(%rsp), %rsi
callq 0x32ab0
testb $0x1, %al
jne 0x5ab48
jmp 0x5ab59
movq 0xe0(%rsp), %rax
movb $0x0, 0xc(%rax)
jmp 0x5ac1e
movq 0xe0(%rsp), %rsi
addq $0x3e0, %rsi            # imm = 0x3E0
leaq 0x39941(%rip), %rdi     # 0x944b0
callq 0x30fe0
movl (%rax), %eax
movl %eax, 0x5ac(%rsp)
movb $0x0, 0x127(%rsp)
movslq 0x5ac(%rsp), %rsi
leaq 0x398ec(%rip), %rdi     # 0x94480
callq 0x5eef0
movq 0xe0(%rsp), %rsi
movq %rax, %rdi
addq $0x400, %rsi            # imm = 0x400
callq 0x5ef90
movq %rax, 0x118(%rsp)
movslq 0x5ac(%rsp), %rsi
leaq 0x398b9(%rip), %rdi     # 0x94480
callq 0x5eef0
movq %rax, %rdi
callq 0x5efd0
movq %rax, 0x110(%rsp)
leaq 0x118(%rsp), %rdi
leaq 0x110(%rsp), %rsi
callq 0x5ef70
testb $0x1, %al
jne 0x5abf7
jmp 0x5abff
movb $0x1, 0x127(%rsp)
movb 0x127(%rsp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x5ac1c
movq 0xe0(%rsp), %rax
movb $0x0, 0xc(%rax)
jmp 0x5ac1e
jmp 0x5ac20
leaq 0x39871(%rip), %rdi     # 0x94498
callq 0x5edf0
testb $0x1, %al
jne 0x5ad50
movq 0xe0(%rsp), %rsi
addq $0x3e0, %rsi            # imm = 0x3E0
leaq 0x39866(%rip), %rdi     # 0x944b0
callq 0x310f0
movq %rax, 0x108(%rsp)
leaq 0x39852(%rip), %rdi     # 0x944b0
callq 0x31120
movq %rax, 0x100(%rsp)
leaq 0x108(%rsp), %rdi
leaq 0x100(%rsp), %rsi
callq 0x310d0
testb $0x1, %al
jne 0x5ac89
jmp 0x5ad4e
movq 0xe0(%rsp), %rsi
addq $0x3e0, %rsi            # imm = 0x3E0
leaq 0x39811(%rip), %rdi     # 0x944b0
callq 0x30fe0
movl (%rax), %eax
movl %eax, 0x5ac(%rsp)
movb $0x0, 0xff(%rsp)
movslq 0x5ac(%rsp), %rsi
leaq 0x397d4(%rip), %rdi     # 0x94498
callq 0x5eef0
movq 0xe0(%rsp), %rsi
movq %rax, %rdi
addq $0x400, %rsi            # imm = 0x400
callq 0x5ef90
movq %rax, 0xf0(%rsp)
movslq 0x5ac(%rsp), %rsi
leaq 0x397a1(%rip), %rdi     # 0x94498
callq 0x5eef0
movq %rax, %rdi
callq 0x5efd0
movq %rax, 0xe8(%rsp)
leaq 0xf0(%rsp), %rdi
leaq 0xe8(%rsp), %rsi
callq 0x5ef70
testb $0x1, %al
jne 0x5ad27
jmp 0x5ad2f
movb $0x1, 0xff(%rsp)
movb 0xff(%rsp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x5ad4c
movq 0xe0(%rsp), %rax
movb $0x0, 0xc(%rax)
jmp 0x5ad4e
jmp 0x5ad50
addq $0x5c8, %rsp            # imm = 0x5C8
retq
movq 0x3f0(%rsp), %rdi
callq 0x69e0
nopw %cs:(%rax,%rax)