// File: /workspace/github_cpp_makefile_star2_O1/ChnMasterOG[P]KmerGO2/kmergo/kmer_union.cpp
// Function: get_Son_Matrix(unsigned short, KmerGO_parameters, std::vector<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>>>>, std::vector<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>>>>, std::vector<float, std::allocator<float>>)
void get_Son_Matrix(uint16_t Nprocess, KmerGO_parameters p, std::vector<std::string> kmerdb_list, 
	std::vector<std::string> beacon_kmer, std::vector<float> ALLfcounter)
{
	uint32 i;
	uint32 files_number = kmerdb_list.size();
	uint32 _kmer_length;

	CKMCFile* kmer_data_base = new CKMCFile[files_number];
	FILE* out_file;
	std::string out_file_name = joinPath(p.matrixes_path, "son_matrix_" + std::to_string(Nprocess) + ".txt");

	/* open k-mer data base */
	for (i = 0; i < files_number; i++)
	{
		if (!kmer_data_base[i].OpenForListing(joinPath(p.kmercountings_path, kmerdb_list[i])))
		{
			mtx.lock();
			union_err_number = -11;
			mtx.unlock();
			std::cout << "Thread-" << std::to_string(Nprocess) << "[Error]: Can not open some k-mer database in at least one thread." << std::endl;
			return;
		}
	}

	/* open the output file */
	if ((out_file = fopen(out_file_name.c_str(), "wb")) == NULL)
	{
		mtx.lock();
		union_err_number = -12;
		mtx.unlock();
		std::cout << "Thread-" << std::to_string(Nprocess) << "[Error]: Can not open output files in at least one thread." << std::endl;
		return;
	}
	setvbuf(out_file, NULL, _IOFBF, 1 << 24);

	/* get information from the k-mer database */
	_kmer_length = kmer_data_base[0].KmerLength();
	CKmerAPI kmer_object(_kmer_length);
	CKmerAPI beacon_start_kmer_object(_kmer_length);
	CKmerAPI beacon_end_kmer_object(_kmer_length);
	CKmerAPI minimum_kmer_object(_kmer_length);
	CKmerAPI maximum_kmer_object(_kmer_length);
	uint64 counter;

	/* create beacon k-mer object: start-kmer index is 0; end-kmer index is 1 */
	beacon_start_kmer_object.from_string(beacon_kmer[0]);
	beacon_end_kmer_object.from_string(beacon_kmer[1]);

	/* create minimum/maximum k-mer object */
	std::string temp_str = "";
	for (i = 0; i < _kmer_length - 1; i++) temp_str += "A";
	minimum_kmer_object.from_string(temp_str);	// is less than "A"*_kmer_length (modified kmer_api "operator<" function)
	temp_str = "";
	for (i = 0; i < _kmer_length; i++) temp_str += "T";
	maximum_kmer_object.from_string(temp_str);

	/* write head text */
	fwrite("k-mer", 1, 5, out_file);
	for (i = 0; i < files_number; i++)
	{
		fwrite("\t", 1, 1, out_file);
		fwrite(kmerdb_list[i].c_str(), 1, kmerdb_list[i].length(), out_file);
	}
	fwrite("\n", 1, 1, out_file);
	
	/* jump to corresponding k-mer and build k-mer loser tree */
	KmerLoserTree kmer_losertree(files_number, _kmer_length);
	uint32 end_number = 0;
	bool start_flag;
	for (i = 0; i < files_number; i++)
	{
		start_flag = false;
		while (kmer_data_base[i].ReadNextKmer(kmer_object, counter))
		{
			if (!kmer_object.operator<(beacon_start_kmer_object))
			{
				kmer_losertree.kmer_list[i].operator=(kmer_object);
				kmer_losertree.counter_list[i] = counter;
				start_flag = true;
				break;
			}
		}
		if (!start_flag || !kmer_object.operator<(beacon_end_kmer_object))	// no next k-mer
		{
			end_number++;
			kmer_losertree.kmer_list[i].operator=(maximum_kmer_object);
			kmer_losertree.counter_list[i] = 0;
		}
		else
		{
			mtx.lock();
			progress++;
			mtx.unlock();
		}
	}
	if (end_number == files_number)	// end of running
	{
		for (i = 0; i < files_number; i++) kmer_data_base[i].Close();
		fclose(out_file);
		delete[] kmer_data_base;
		return;
	}
	kmer_losertree.kmer_list[files_number].operator=(minimum_kmer_object);
	kmer_losertree.build();

	/* prepare variables for main loop */
	uint32 min_index;
	uint32 no_zero_counter[2] = { 0, 0 };
	uint32 no_zero_counter_thr[2] = { 1, 1 };
	std::vector<std::string> zero_matrix;
	std::vector<std::string> write_matrix;
	CKmerAPI min_kmer(_kmer_length);
	char temp_cstr[1024];

	if (p.single_step == false)
	{
		no_zero_counter_thr[0] = p.groupA_number * 0.2;
		if (!p.groupA_name.compare("")) no_zero_counter_thr[1] = 1;
		else no_zero_counter_thr[1] = (files_number - p.groupA_number) * 0.2;
	}

	for (i = 0; i < files_number; i++)
	{
		zero_matrix.push_back("\t0");
		write_matrix.push_back("\t0");
	}

	/* main loop */
	while (true)
	{
		min_index = kmer_losertree.getMIN();
		sprintf(temp_cstr, "\t%.4f", (double)kmer_losertree.counter_list[min_index] / ALLfcounter[min_index]);	// normalization
		if (min_kmer.operator==(kmer_losertree.kmer_list[min_index]))	// new k-mer is equal to last k-mer
		{
			write_matrix[min_index] = temp_cstr;
		}
		else
		{
			if (no_zero_counter[0] >= no_zero_counter_thr[0] || no_zero_counter[1] >= no_zero_counter_thr[1])	// write last line
			{
				min_kmer.to_string(temp_str);
				fwrite(temp_str.c_str(), 1, _kmer_length, out_file);
				for (i = 0; i < files_number; i++) fwrite(write_matrix[i].c_str(), 1, write_matrix[i].length(), out_file);
				fwrite("\n", 1, 1, out_file);
			}
			no_zero_counter[0] = no_zero_counter[1] = 0;
			write_matrix = zero_matrix;
			write_matrix[min_index] = temp_cstr;
		}
		if (p.single_step == false)	// count no zero numbers
		{
			if (!p.groupA_name.compare("")) no_zero_counter[0]++;
			else if(!p.trait_information_map[kmerdb_list[min_index]].compare(p.groupA_name)) no_zero_counter[0]++;
			else no_zero_counter[1]++;
		}
		else no_zero_counter[0]++;
		min_kmer.operator=(kmer_losertree.kmer_list[min_index]);
		if (!kmer_data_base[min_index].ReadNextKmer(kmer_object, counter) || !kmer_object.operator<(beacon_end_kmer_object))	// no next k-mer
		{
			end_number++;
			kmer_object = maximum_kmer_object;
			counter = 0;
		}
		else
		{
			mtx.lock();
			progress++;	// update progress
			mtx.unlock();
		}
		if (end_number == files_number)	// end of running
		{
			if (no_zero_counter[0] >= no_zero_counter_thr[0] || no_zero_counter[1] >= no_zero_counter_thr[1])	// write last line
			{
				min_kmer.to_string(temp_str);
				fwrite(temp_str.c_str(), 1, _kmer_length, out_file);
				for (i = 0; i < files_number; i++) fwrite(write_matrix[i].c_str(), 1, write_matrix[i].length(), out_file);
				fwrite("\n", 1, 1, out_file);
			}
			break;
		}
		kmer_losertree.kmer_list[min_index].operator=(kmer_object);
		kmer_losertree.counter_list[min_index] = counter;
		kmer_losertree.adjust(min_index);
	}

	/* close files */
	for (i = 0; i < files_number; i++) kmer_data_base[i].Close();
	fclose(out_file);

	delete[] kmer_data_base;

	return;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x698, %rsp            # imm = 0x698
movq %r8, 0x228(%rsp)
movq %rcx, %rbp
movq %rsi, 0x40(%rsp)
movl %edi, 0x30(%rsp)
movq 0x8(%rdx), %rax
movq %rdx, 0xf0(%rsp)
subq (%rdx), %rax
sarq $0x5, %rax
movq %rax, 0x10(%rsp)
movl %eax, %r15d
movq %r15, %rbx
shlq $0x6, %rbx
leaq (%rbx,%rbx,2), %r14
addq $0x8, %r14
movq %r14, %rdi
callq 0x41c2a0
movq %rax, %r13
movq %r15, (%rax)
addq $0x8, %rax
movq %rax, 0x48(%rsp)
movq %r15, 0x90(%rsp)
testq %r15, %r15
je 0x408315
leaq (%rbx,%rbx,2), %r12
negq %r12
xorl %r15d, %r15d
movq 0x48(%rsp), %rbx
movq %rbx, %rdi
callq 0x416c52
addq $-0xc0, %r15
addq $0xc0, %rbx
cmpq %r15, %r12
jne 0x4082fa
movq %r13, 0x130(%rsp)
leaq 0x260(%rsp), %r15
movq %r15, -0x10(%r15)
movq 0x40(%rsp), %rax
movq 0x60(%rax), %rsi
movq 0x68(%rax), %rdx
addq %rsi, %rdx
leaq 0x250(%rsp), %rdi
callq 0x40805e
movl 0x30(%rsp), %eax
movzwl %ax, %r12d
movl $0x1, %ebx
cmpw $0xa, %r12w
jb 0x408382
movl $0x2, %ebx
cmpw $0x64, %ax
jb 0x408382
movl $0x3, %ebx
cmpl $0x3e8, %r12d           # imm = 0x3E8
jb 0x408382
cmpl $0x2710, %r12d          # imm = 0x2710
movl $0x5, %ebx
sbbl $0x0, %ebx
movl %ebx, %esi
leaq 0x1a0(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x190(%rsp), %rdi
movl $0x2d, %edx
callq 0x48b9e0
leaq 0x190(%rsp), %r14
movq (%r14), %rdi
movl %ebx, %esi
movl %r12d, %edx
callq 0x407ff1
leaq 0x19aef2(%rip), %rcx    # 0x5a32b0
movl $0xb, %r8d
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x48d070
leaq 0x2a0(%rsp), %rbx
movq %rbx, -0x10(%rbx)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x408400
movq %rdx, 0x290(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x2a0(%rsp)
jmp 0x408408
movupd (%rcx), %xmm0
movupd %xmm0, (%rbx)
movq 0x8(%rax), %rdx
leaq 0x290(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x19ae8e(%rip), %rsi    # 0x5a32bc
callq 0x48d830
leaq 0x240(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x408463
movq %rdx, 0x230(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x240(%rsp)
jmp 0x40846c
movupd (%rcx), %xmm0
movupd %xmm0, (%r14)
movq 0x8(%rax), %rsi
leaq 0x230(%rsp), %rdx
movq %rsi, 0x8(%rdx)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x270(%rsp), %rdi
leaq 0x250(%rsp), %rsi
callq 0x407b32
movq 0x230(%rsp), %rdi
cmpq %r14, %rdi
je 0x4084bd
movq 0x240(%rsp), %rsi
incq %rsi
callq 0x41b3a0
movq 0x290(%rsp), %rdi
cmpq %rbx, %rdi
je 0x4084da
movq 0x2a0(%rsp), %rsi
incq %rsi
callq 0x41b3a0
movq 0x190(%rsp), %rdi
cmpq %r13, %rdi
je 0x4084f7
movq 0x1a0(%rsp), %rsi
incq %rsi
callq 0x41b3a0
movl %r12d, 0x8(%rsp)
movq %rbp, 0x50(%rsp)
movq 0x250(%rsp), %rdi
cmpq %r15, %rdi
je 0x40851e
movq 0x260(%rsp), %rsi
incq %rsi
callq 0x41b3a0
cmpl $0x0, 0x10(%rsp)
je 0x408655
movq 0x90(%rsp), %r12
shlq $0x5, %r12
xorl %ebx, %ebx
leaq 0x1e0(%rsp), %rbp
leaq 0x290(%rsp), %r15
movq 0x48(%rsp), %r14
leaq 0x180(%rsp), %rax
movq %rax, 0x170(%rsp)
movq 0x40(%rsp), %rax
movq 0x40(%rax), %rsi
movq 0x48(%rax), %rdx
addq %rsi, %rdx
leaq 0x170(%rsp), %rdi
callq 0x40805e
movq 0xf0(%rsp), %rax
movq (%rax), %rax
leaq 0x1f0(%rsp), %rcx
movq %rcx, 0x1e0(%rsp)
movq (%rax,%rbx), %rsi
movq 0x8(%rax,%rbx), %rdx
addq %rsi, %rdx
movq %rbp, %rdi
callq 0x40805e
movq %r15, %rdi
leaq 0x170(%rsp), %rsi
movq %rbp, %rdx
callq 0x407b32
movq %r14, %rdi
movq %r15, %rsi
callq 0x416a7a
movl %eax, %r13d
movq 0x290(%rsp), %rdi
leaq 0x2a0(%rsp), %rax
cmpq %rax, %rdi
je 0x4085ee
movq 0x2a0(%rsp), %rsi
incq %rsi
callq 0x41b3a0
movq 0x1e0(%rsp), %rdi
leaq 0x1f0(%rsp), %rax
cmpq %rax, %rdi
je 0x408613
movq 0x1f0(%rsp), %rsi
incq %rsi
callq 0x41b3a0
movq 0x170(%rsp), %rdi
leaq 0x180(%rsp), %rax
cmpq %rax, %rdi
je 0x408638
movq 0x180(%rsp), %rsi
incq %rsi
callq 0x41b3a0
testb %r13b, %r13b
je 0x4086fa
addq $0xc0, %r14
addq $0x20, %rbx
cmpq %rbx, %r12
jne 0x40854c
movq 0x270(%rsp), %rdi
leaq 0x19aca7(%rip), %rsi    # 0x5a330b
callq 0x4ee010
testq %rax, %rax
movl 0x8(%rsp), %ebp
je 0x408803
movq %rax, %r13
movl $0x1000000, %ecx        # imm = 0x1000000
movq %rax, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x4eeee0
movq 0x48(%rsp), %rdi
callq 0x417730
movl %eax, %r12d
testl %eax, %eax
movq 0x50(%rsp), %rbx
je 0x408929
movl %r12d, %eax
andl $0x3, %eax
movb $0x4, %cl
subb %al, %cl
testl %eax, %eax
movzbl %cl, %ecx
cmovel %eax, %ecx
movb %cl, 0x24(%rsp)
movzbl %cl, %r14d
addl %r12d, %r14d
movl %r14d, %eax
andl $0x1f, %eax
shrl $0x5, %r14d
cmpl $0x1, %eax
sbbl $-0x1, %r14d
movl %r14d, 0x28(%rsp)
shll $0x3, %r14d
movq %r14, %rdi
callq 0x41c2a0
movq %rax, 0x18(%rsp)
movq %rax, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x401098
jmp 0x40893f
leaq 0x213fe7(%rip), %rdi    # 0x61c6e8
callq 0x4fbcf0
testl %eax, %eax
jne 0x409c8d
movw $0xfff5, 0x213fc3(%rip) # imm = 0xFFF5
leaq 0x213fca(%rip), %rdi    # 0x61c6e8
callq 0x4fcbd0
movq $0x1b72960, %rdi        # imm = 0x1B72960
leaq 0x19ab90(%rip), %rsi    # 0x5a32c1
movl $0x7, %edx
callq 0x485780
leaq 0x2a0(%rsp), %r14
movl 0x8(%rsp), %ebp
movl $0x1, %ebx
movl 0x30(%rsp), %eax
cmpw $0xa, %ax
jb 0x40877c
movl $0x2, %ebx
cmpw $0x64, %ax
jb 0x40877c
movl $0x3, %ebx
cmpl $0x3e8, %ebp            # imm = 0x3E8
jb 0x40877c
cmpl $0x2710, %ebp           # imm = 0x2710
movl $0x5, %ebx
sbbl $0x0, %ebx
movl %ebx, %esi
leaq 0x290(%rsp), %rdi
movq %r14, (%rdi)
movl $0x2d, %edx
callq 0x48b9e0
movq 0x290(%rsp), %rdi
movl %ebx, %esi
movl %ebp, %edx
callq 0x407ff1
movq 0x290(%rsp), %rsi
movq 0x298(%rsp), %rdx
movq $0x1b72960, %rdi        # imm = 0x1B72960
callq 0x485780
movq %rax, %rbx
leaq 0x19aaff(%rip), %rsi    # 0x5a32c9
movl $0x41, %edx
movq %rax, %rdi
callq 0x485780
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x4668d0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x485280
movq %rax, %rdi
callq 0x484850
jmp 0x408903
leaq 0x213ede(%rip), %rdi    # 0x61c6e8
callq 0x4fbcf0
testl %eax, %eax
jne 0x409c8d
movw $0xfff4, 0x213eba(%rip) # imm = 0xFFF4
leaq 0x213ec1(%rip), %rdi    # 0x61c6e8
callq 0x4fcbd0
movq $0x1b72960, %rdi        # imm = 0x1B72960
leaq 0x19aa87(%rip), %rsi    # 0x5a32c1
movl $0x7, %edx
callq 0x485780
leaq 0x2a0(%rsp), %r14
movl $0x1, %ebx
movl 0x30(%rsp), %eax
cmpw $0xa, %ax
jb 0x408881
movl $0x2, %ebx
cmpw $0x64, %ax
jb 0x408881
movl $0x3, %ebx
cmpl $0x3e8, %ebp            # imm = 0x3E8
jb 0x408881
cmpl $0x2710, %ebp           # imm = 0x2710
movl $0x5, %ebx
sbbl $0x0, %ebx
movl %ebx, %esi
leaq 0x290(%rsp), %rdi
movq %r14, (%rdi)
movl $0x2d, %edx
callq 0x48b9e0
movq 0x290(%rsp), %rdi
movl %ebx, %esi
movl %ebp, %edx
callq 0x407ff1
movq 0x290(%rsp), %rsi
movq 0x298(%rsp), %rdx
movq $0x1b72960, %rdi        # imm = 0x1B72960
callq 0x485780
movq %rax, %rbx
leaq 0x19aa3f(%rip), %rsi    # 0x5a330e
movl $0x3a, %edx
movq %rax, %rdi
callq 0x485780
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x4668d0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x485280
movq %rax, %rdi
callq 0x484850
movq 0x290(%rsp), %rdi
cmpq %r14, %rdi
je 0x409c4c
movq 0x2a0(%rsp), %rsi
incq %rsi
callq 0x41b3a0
jmp 0x409c4c
movq $0x0, 0x18(%rsp)
movl $0x0, 0x28(%rsp)
movb $0x0, 0x24(%rsp)
movl %r12d, 0x20(%rsp)
testl %r12d, %r12d
je 0x4089a5
movl %r12d, %eax
andl $0x3, %eax
movb $0x4, %cl
subb %al, %cl
testl %eax, %eax
movzbl %cl, %ecx
cmovel %eax, %ecx
movb %cl, 0x104(%rsp)
movzbl %cl, %r14d
addl %r12d, %r14d
movl %r14d, %eax
andl $0x1f, %eax
shrl $0x5, %r14d
cmpl $0x1, %eax
sbbl $-0x1, %r14d
movl %r14d, 0x108(%rsp)
shll $0x3, %r14d
movq %r14, %rdi
callq 0x41c2a0
movq %rax, 0xf8(%rsp)
movq %rax, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x401098
jmp 0x4089c4
movq $0x0, 0xf8(%rsp)
movl $0x0, 0x108(%rsp)
movb $0x0, 0x104(%rsp)
movl %r12d, 0x100(%rsp)
testl %r12d, %r12d
je 0x408a2d
movl %r12d, %eax
andl $0x3, %eax
movb $0x4, %cl
subb %al, %cl
testl %eax, %eax
movzbl %cl, %ecx
cmovel %eax, %ecx
movb %cl, 0xd4(%rsp)
movzbl %cl, %r14d
addl %r12d, %r14d
movl %r14d, %eax
andl $0x1f, %eax
shrl $0x5, %r14d
cmpl $0x1, %eax
sbbl $-0x1, %r14d
movl %r14d, 0xd8(%rsp)
shll $0x3, %r14d
movq %r14, %rdi
callq 0x41c2a0
movq %rax, 0xc8(%rsp)
movq %rax, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x401098
jmp 0x408a4c
movq $0x0, 0xc8(%rsp)
movl $0x0, 0xd8(%rsp)
movb $0x0, 0xd4(%rsp)
movl %r12d, 0xd0(%rsp)
testl %r12d, %r12d
je 0x408ab5
movl %r12d, %eax
andl $0x3, %eax
movb $0x4, %cl
subb %al, %cl
testl %eax, %eax
movzbl %cl, %ecx
cmovel %eax, %ecx
movb %cl, 0xbc(%rsp)
movzbl %cl, %r14d
addl %r12d, %r14d
movl %r14d, %eax
andl $0x1f, %eax
shrl $0x5, %r14d
cmpl $0x1, %eax
sbbl $-0x1, %r14d
movl %r14d, 0xc0(%rsp)
shll $0x3, %r14d
movq %r14, %rdi
callq 0x41c2a0
movq %rax, 0xb0(%rsp)
movq %rax, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x401098
jmp 0x408ad4
movq $0x0, 0xb0(%rsp)
movl $0x0, 0xc0(%rsp)
movb $0x0, 0xbc(%rsp)
movl %r12d, 0xb8(%rsp)
testl %r12d, %r12d
je 0x408b34
movl %r12d, %eax
andl $0x3, %eax
movb $0x4, %cl
subb %al, %cl
testl %eax, %eax
movzbl %cl, %ecx
cmovel %eax, %ecx
movb %cl, 0x64(%rsp)
movzbl %cl, %r14d
addl %r12d, %r14d
movl %r14d, %eax
andl $0x1f, %eax
shrl $0x5, %r14d
cmpl $0x1, %eax
sbbl $-0x1, %r14d
movl %r14d, 0x68(%rsp)
shll $0x3, %r14d
movq %r14, %rdi
callq 0x41c2a0
movq %rax, 0x58(%rsp)
movq %rax, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x401098
jmp 0x408b4a
movq $0x0, 0x58(%rsp)
movl $0x0, 0x68(%rsp)
movb $0x0, 0x64(%rsp)
movl %r12d, 0x60(%rsp)
movq (%rbx), %rax
movq 0x8(%rax), %rdx
testq %rdx, %rdx
je 0x408b91
movq (%rax), %rcx
movzbl (%rcx), %edi
movq $0x1b71940, %rsi        # imm = 0x1B71940
cmpb $-0x1, (%rsi,%rdi)
je 0x408ba1
movl $0x1, %r8d
movl %r8d, %edi
cmpq %rdi, %rdx
jbe 0x408b91
movzbl (%rcx,%rdi), %r9d
leal 0x1(%rdi), %r8d
cmpb $-0x1, (%rsi,%r9)
jne 0x408b74
cmpq %rdi, %rdx
ja 0x408ba1
movq (%rax), %rsi
leaq 0xf8(%rsp), %rdi
callq 0x40b342
movq (%rbx), %rax
movq 0x28(%rax), %rdx
testq %rdx, %rdx
je 0x408be4
movq 0x20(%rax), %rcx
movzbl (%rcx), %edi
movq $0x1b71940, %rsi        # imm = 0x1B71940
cmpb $-0x1, (%rsi,%rdi)
je 0x408bf5
movl $0x1, %r8d
movl %r8d, %edi
cmpq %rdi, %rdx
jbe 0x408be4
movzbl (%rcx,%rdi), %r9d
leal 0x1(%rdi), %r8d
cmpb $-0x1, (%rsi,%r9)
jne 0x408bc7
cmpq %rdi, %rdx
ja 0x408bf5
movq 0x20(%rax), %rsi
leaq 0xc8(%rsp), %rdi
callq 0x40b342
leaq 0x80(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x1bf2a2(%rip), %rdx    # 0x5c7eaa
leaq 0x70(%rsp), %rdi
movq %rdx, %rsi
callq 0x4080ee
movl %r12d, %ebx
decl %ebx
je 0x408c37
leaq 0x1b120a(%rip), %r14    # 0x5b9e2d
leaq 0x70(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x48d830
decl %ebx
jne 0x408c28
movq 0x78(%rsp), %rdx
testq %rdx, %rdx
je 0x408c76
movq 0x70(%rsp), %rax
movzbl (%rax), %esi
movq $0x1b71940, %rcx        # imm = 0x1B71940
cmpb $-0x1, (%rcx,%rsi)
je 0x408c88
movl $0x1, %edi
movl %edi, %esi
cmpq %rsi, %rdx
jbe 0x408c76
movzbl (%rax,%rsi), %r8d
leal 0x1(%rsi), %edi
cmpb $-0x1, (%rcx,%r8)
jne 0x408c5b
cmpq %rsi, %rdx
ja 0x408c88
movq 0x70(%rsp), %rsi
leaq 0xb0(%rsp), %rdi
callq 0x40b342
leaq 0x70(%rsp), %rdi
movq 0x8(%rdi), %rdx
leaq 0x1bf212(%rip), %rcx    # 0x5c7eaa
xorl %esi, %esi
xorl %r8d, %r8d
callq 0x48ccd0
testl %r12d, %r12d
je 0x408cc5
leaq 0x1b1187(%rip), %r14    # 0x5b9e35
leaq 0x70(%rsp), %r15
movl %r12d, %ebx
movq %r15, %rdi
movq %r14, %rsi
callq 0x48d830
decl %ebx
jne 0x408cb6
movq 0x78(%rsp), %rdx
testq %rdx, %rdx
je 0x408d04
movq 0x70(%rsp), %rax
movzbl (%rax), %esi
movq $0x1b71940, %rcx        # imm = 0x1B71940
cmpb $-0x1, (%rcx,%rsi)
je 0x408d13
movl $0x1, %edi
movl %edi, %esi
cmpq %rsi, %rdx
jbe 0x408d04
movzbl (%rax,%rsi), %r8d
leal 0x1(%rsi), %edi
cmpb $-0x1, (%rcx,%r8)
jne 0x408ce9
cmpq %rsi, %rdx
ja 0x408d13
movq 0x70(%rsp), %rsi
leaq 0x58(%rsp), %rdi
callq 0x40b342
leaq 0x19a62f(%rip), %rdi    # 0x5a3349
movl $0x1, %esi
movl $0x5, %edx
movq %r13, %rcx
callq 0x4ee490
cmpl $0x0, 0x10(%rsp)
movq 0xf0(%rsp), %r15
je 0x408d79
movq 0x90(%rsp), %rbx
shlq $0x5, %rbx
xorl %r14d, %r14d
movl $0x9, %edi
movq %r13, %rsi
callq 0x4f29f0
movq (%r15), %rax
movq (%rax,%r14), %rdi
movq 0x8(%rax,%r14), %rdx
movl $0x1, %esi
movq %r13, %rcx
callq 0x4ee490
addq $0x20, %r14
cmpq %r14, %rbx
jne 0x408d4a
movl $0xa, %edi
movq %r13, %rsi
callq 0x4f29f0
leaq 0x190(%rsp), %rdi
movq 0x10(%rsp), %rbx
movl %ebx, %esi
movl %r12d, %edx
callq 0x4140ec
testl %ebx, %ebx
movq 0x40(%rsp), %r14
movq %r13, 0xa0(%rsp)
je 0x409041
movl %ebx, %eax
movq %rax, 0x8(%rsp)
xorl %ebx, %ebx
leaq 0x18(%rsp), %r15
leaq 0xa8(%rsp), %r13
movl $0x0, 0x4(%rsp)
leaq (%rbx,%rbx,2), %r14
movq %r14, 0x30(%rsp)
shlq $0x6, %r14
addq 0x48(%rsp), %r14
movq %r14, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x417396
movl %eax, %ebp
testb %al, %al
je 0x408fa6
movl 0x20(%rsp), %eax
cmpl %eax, 0x100(%rsp)
jne 0x408e32
movl 0x28(%rsp), %ecx
testq %rcx, %rcx
setne %dl
je 0x408e6d
movq 0xf8(%rsp), %rdi
movq 0x18(%rsp), %r8
movq (%rdi), %rsi
movq (%r8), %r9
movb $0x1, %dl
cmpq %r9, %rsi
jbe 0x408e37
movb $0x1, %sil
jmp 0x408e6d
seta %dl
jmp 0x408e70
jae 0x408e3d
xorl %esi, %esi
jmp 0x408e6d
movl $0x1, %esi
movq %rsi, %rdx
cmpq %rdx, %rcx
je 0x408e67
movq (%rdi,%rdx,8), %r9
movq (%r8,%rdx,8), %r10
cmpq %r10, %r9
ja 0x408e64
leaq 0x1(%rdx), %rsi
cmpq %r10, %r9
jae 0x408e42
xorl %esi, %esi
jmp 0x408e67
movb $0x1, %sil
cmpq %rcx, %rdx
setb %dl
andb %sil, %dl
testb %dl, %dl
jne 0x408de2
movq 0x1b0(%rsp), %rcx
movq 0x30(%rsp), %rdx
leaq (%rcx,%rdx,8), %r14
movl 0x8(%r14), %ecx
cmpl %ecx, %eax
je 0x408ec6
testl %ecx, %ecx
je 0x408ea2
movq (%r14), %rdi
testq %rdi, %rdi
je 0x408ea2
callq 0x41b3b0
movl 0x20(%rsp), %eax
movl %eax, 0x8(%r14)
movb 0x24(%rsp), %al
movb %al, 0xc(%r14)
movl 0x28(%rsp), %edi
movl %edi, 0x10(%r14)
shlq $0x3, %rdi
callq 0x41c2a0
movq %rax, (%r14)
movl 0x10(%r14), %eax
testq %rax, %rax
je 0x408ee9
movq 0x18(%rsp), %rcx
movq (%r14), %rdx
xorl %esi, %esi
movq (%rcx,%rsi,8), %rdi
movq %rdi, (%rdx,%rsi,8)
incq %rsi
cmpq %rsi, %rax
jne 0x408ed9
movl 0xa8(%rsp), %eax
movq 0x1c8(%rsp), %rcx
movl %eax, (%rcx,%rbx,4)
testb %bpl, %bpl
je 0x408fa6
movl 0x20(%rsp), %eax
cmpl %eax, 0xd0(%rsp)
jne 0x408f3b
movl 0x28(%rsp), %eax
testq %rax, %rax
setne %cl
je 0x408f75
movq 0xc8(%rsp), %rsi
movq 0x18(%rsp), %rdi
movq (%rsi), %rdx
movq (%rdi), %r8
movb $0x1, %cl
cmpq %r8, %rdx
jbe 0x408f40
movb $0x1, %dl
jmp 0x408f75
seta %cl
jmp 0x408f77
jae 0x408f46
xorl %edx, %edx
jmp 0x408f75
movl $0x1, %edx
movq %rdx, %rcx
cmpq %rcx, %rax
je 0x408f6f
movq (%rsi,%rcx,8), %r8
movq (%rdi,%rcx,8), %r9
cmpq %r9, %r8
ja 0x408f6d
leaq 0x1(%rcx), %rdx
cmpq %r9, %r8
jae 0x408f4b
xorl %edx, %edx
jmp 0x408f6f
movb $0x1, %dl
cmpq %rax, %rcx
setb %cl
andb %dl, %cl
testb %cl, %cl
je 0x408fa6
leaq 0x213766(%rip), %r14    # 0x61c6e8
movq %r14, %rdi
callq 0x4fbcf0
testl %eax, %eax
jne 0x409c86
incq 0x213747(%rip)          # 0x61c6e0
movq %r14, %rdi
callq 0x4fcbd0
jmp 0x40902c
movq 0x1b0(%rsp), %rax
movq 0x30(%rsp), %rcx
leaq (%rax,%rcx,8), %r14
movl 0x8(%r14), %eax
cmpl %eax, 0x60(%rsp)
je 0x408ff6
testl %eax, %eax
je 0x408fd2
movq (%r14), %rdi
testq %rdi, %rdi
je 0x408fd2
callq 0x41b3b0
movl 0x60(%rsp), %eax
movl %eax, 0x8(%r14)
movb 0x64(%rsp), %al
movb %al, 0xc(%r14)
movl 0x68(%rsp), %edi
movl %edi, 0x10(%r14)
shlq $0x3, %rdi
callq 0x41c2a0
movq %rax, (%r14)
movl 0x10(%r14), %eax
testq %rax, %rax
je 0x409019
movq 0x58(%rsp), %rcx
movq (%r14), %rdx
xorl %esi, %esi
movq (%rcx,%rsi,8), %rdi
movq %rdi, (%rdx,%rsi,8)
incq %rsi
cmpq %rsi, %rax
jne 0x409009
incl 0x4(%rsp)
movq 0x1c8(%rsp), %rax
movl $0x0, (%rax,%rbx,4)
movq 0x40(%rsp), %r14
incq %rbx
cmpq 0x8(%rsp), %rbx
jne 0x408dd0
jmp 0x409049
movl $0x0, 0x4(%rsp)
movq 0x10(%rsp), %rax
cmpl %eax, 0x4(%rsp)
movq 0xa0(%rsp), %r15
jne 0x4090d3
testl %eax, %eax
movq 0x130(%rsp), %r12
movq 0x48(%rsp), %r14
je 0x409083
movl %eax, %ebx
movq %r14, %rdi
callq 0x417592
addq $0xc0, %r14
decq %rbx
jne 0x40906f
movq %r15, %rdi
callq 0x4ed8e0
movq (%r12), %rcx
movq %rcx, %rax
shlq $0x6, %rax
leaq (%rax,%rax,2), %rbx
addq $0x8, %rbx
testq %rcx, %rcx
je 0x4090c3
leaq (%rax,%rax,2), %r14
movq %r12, %r15
addq $-0xb8, %r15
leaq (%r15,%r14), %rdi
callq 0x416c76
addq $-0xc0, %r14
jne 0x4090b1
movq %r12, %rdi
movq %rbx, %rsi
callq 0x41b3c0
jmp 0x409bc9
movq 0x1b0(%rsp), %rax
movq 0x90(%rsp), %rcx
leaq (%rcx,%rcx,2), %rcx
leaq (%rax,%rcx,8), %rbx
movl 0x8(%rbx), %eax
cmpl %eax, 0xb8(%rsp)
je 0x409132
testl %eax, %eax
je 0x409108
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x409108
callq 0x41b3b0
movl 0xb8(%rsp), %eax
movl %eax, 0x8(%rbx)
movb 0xbc(%rsp), %al
movb %al, 0xc(%rbx)
movl 0xc0(%rsp), %edi
movl %edi, 0x10(%rbx)
shlq $0x3, %rdi
callq 0x41c2a0
movq %rax, (%rbx)
movl 0x10(%rbx), %eax
testq %rax, %rax
je 0x409157
movq 0xb0(%rsp), %rcx
movq (%rbx), %rdx
xorl %esi, %esi
movq (%rcx,%rsi,8), %rdi
movq %rdi, (%rdx,%rsi,8)
incq %rsi
cmpq %rsi, %rax
jne 0x409147
leaq 0x190(%rsp), %rdi
callq 0x4143e2
xorl %r15d, %r15d
xorpd %xmm0, %xmm0
movapd %xmm0, 0x200(%rsp)
movq %r15, 0x210(%rsp)
movq %r15, 0x120(%rsp)
movapd %xmm0, 0x110(%rsp)
testl %r12d, %r12d
je 0x4091ec
movl %r12d, %eax
andl $0x3, %eax
movb $0x4, %cl
subb %al, %cl
testl %eax, %eax
movzbl %cl, %ecx
cmovel %eax, %ecx
movl %ecx, 0x3c(%rsp)
movzbl %cl, %ecx
addl %r12d, %ecx
movl %ecx, %eax
andl $0x1f, %eax
shrl $0x5, %ecx
cmpl $0x1, %eax
sbbl $-0x1, %ecx
movq %rcx, 0x8(%rsp)
leal (,%rcx,8), %r14d
movq %r14, %rdi
callq 0x41c2a0
movl 0x4(%rsp), %ebx
movq %rax, %r15
movq %rax, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x401098
movq 0x40(%rsp), %r14
jmp 0x409201
movl $0x0, 0x3c(%rsp)
movq $0x0, 0x8(%rsp)
movl 0x4(%rsp), %ebx
movl $0x1, %eax
movq %rax, 0xe0(%rsp)
cmpb $0x0, 0x100(%r14)
je 0x409227
movl $0x1, %eax
movq %rax, 0xe8(%rsp)
jmp 0x40928b
movl 0x128(%r14), %eax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
mulsd 0x19a012(%rip), %xmm0   # 0x5a3250
cvttsd2si %xmm0, %rax
movq %rax, 0xe8(%rsp)
leaq 0x108(%r14), %rdi
leaq 0x1bec51(%rip), %rsi    # 0x5c7eaa
callq 0x48e290
testl %eax, %eax
je 0x40928b
movq 0x10(%rsp), %rax
subl 0x128(%r14), %eax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
mulsd 0x199fd2(%rip), %xmm0   # 0x5a3250
cvttsd2si %xmm0, %rax
movq %rax, 0xe0(%rsp)
cmpl $0x0, 0x10(%rsp)
je 0x40934d
leaq 0x160(%rsp), %r14
leaq 0x150(%rsp), %rbp
movq 0x10(%rsp), %rax
movl %eax, %r13d
movq %r14, 0x150(%rsp)
movq %rbp, %rdi
leaq 0x19a08f(%rip), %rsi    # 0x5a334f
leaq 0x19a08a(%rip), %rdx    # 0x5a3351
callq 0x4080ee
leaq 0x200(%rsp), %rdi
movq %rbp, %rsi
callq 0x407d8a
movq 0x150(%rsp), %rdi
cmpq %r14, %rdi
je 0x4092f9
movq 0x160(%rsp), %rsi
incq %rsi
callq 0x41b3a0
movq %r14, 0x150(%rsp)
movq %rbp, %rdi
leaq 0x19a044(%rip), %rsi    # 0x5a334f
leaq 0x19a03f(%rip), %rdx    # 0x5a3351
callq 0x4080ee
leaq 0x110(%rsp), %rdi
movq %rbp, %rsi
callq 0x407d8a
movq 0x150(%rsp), %rdi
cmpq %r14, %rdi
je 0x409344
movq 0x160(%rsp), %rsi
incq %rsi
callq 0x41b3a0
decl %r13d
jne 0x4092ae
movl %r12d, %eax
movq %rax, 0x138(%rsp)
movq 0x40(%rsp), %rax
leaq 0x108(%rax), %rcx
movq %rcx, 0x140(%rsp)
addq $0x158, %rax            # imm = 0x158
movq %rax, 0x218(%rsp)
shlq $0x5, 0x90(%rsp)
xorl %ebp, %ebp
movq $0x5a3ef4, %r13         # imm = 0x5A3EF4
movl $0x0, 0x4(%rsp)
leaq 0x190(%rsp), %rdi
callq 0x414448
movl %eax, 0x9c(%rsp)
movl 0x9c(%rsp), %r14d
movq 0x1c8(%rsp), %rax
movl (%rax,%r14,4), %eax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
movq 0x228(%rsp), %rax
movq (%rax), %rax
cvtss2sd (%rax,%r14,4), %xmm1
divsd %xmm1, %xmm0
leaq 0x290(%rsp), %rdi
leaq 0x199f6a(%rip), %rsi    # 0x5a3352
movb $0x1, %al
callq 0x4e7390
movq 0x1b0(%rsp), %rax
movq %r14, 0x50(%rsp)
leaq (%r14,%r14,2), %rcx
movq %rcx, 0x30(%rsp)
cmpl %r12d, 0x8(%rax,%rcx,8)
movq %r15, 0x148(%rsp)
jne 0x4094c3
cmpl $0x0, 0x8(%rsp)
sete %cl
je 0x40945f
movq 0x30(%rsp), %rcx
leaq (%rax,%rcx,8), %rax
movq (%rax), %rax
movq (%rax), %rcx
cmpq (%r15), %rcx
jne 0x4094c3
movl 0x8(%rsp), %ecx
movl $0x1, %esi
movq %rsi, %rdx
cmpq %rsi, %rcx
je 0x409459
movq (%rax,%rdx,8), %rdi
leaq 0x1(%rdx), %rsi
cmpq (%r15,%rdx,8), %rdi
je 0x409443
cmpq %rcx, %rdx
setae %cl
testb %cl, %cl
je 0x4094c3
movq 0x110(%rsp), %rax
movq 0x50(%rsp), %rcx
shlq $0x5, %rcx
leaq (%rax,%rcx), %r14
movq %rbp, 0x220(%rsp)
movq 0x8(%rax,%rcx), %rbp
movl %ebx, %r15d
leaq 0x290(%rsp), %rbx
movq %rbx, %rdi
callq 0x401140
movq %r14, %rdi
xorl %esi, %esi
movq %rbp, %rdx
movq 0x220(%rsp), %rbp
movq %rbx, %rcx
movl %r15d, %ebx
movq 0x148(%rsp), %r15
movq %rax, %r8
callq 0x48ccd0
jmp 0x4096c5
cmpl 0xe8(%rsp), %ebp
jae 0x4094dd
movl 0x4(%rsp), %eax
cmpl 0xe0(%rsp), %eax
jb 0x40965b
movl %r12d, %esi
leaq 0x70(%rsp), %rdi
xorl %edx, %edx
callq 0x48cc80
cmpl $0x0, 0x8(%rsp)
je 0x4095eb
movq 0x70(%rsp), %rax
leaq 0x7(%r15), %rcx
movl 0x8(%rsp), %edx
xorl %esi, %esi
xorl %edi, %edi
movl 0x3c(%rsp), %r8d
testl %r12d, %r12d
je 0x4095df
leaq (%rcx,%rsi,8), %r9
xorl %r10d, %r10d
xorl %r11d, %r11d
testl %r10d, %r10d
jne 0x40952f
testb %r8b, %r8b
je 0x40952f
decb %r8b
jmp 0x40954e
movzbl (%r9), %r14d
shrl $0x6, %r14d
movb (%r13,%r14), %bpl
movl %edi, %r14d
incl %edi
movb %bpl, (%rax,%r14)
cmpl %r12d, %edi
je 0x4095df
testl %r10d, %r10d
jne 0x40955d
testb %r8b, %r8b
je 0x40955d
decb %r8b
jmp 0x40957c
movzbl (%r9), %r14d
shrl $0x4, %r14d
andl $0x3, %r14d
movb (%r13,%r14), %bpl
movl %edi, %r14d
incl %edi
movb %bpl, (%rax,%r14)
cmpl %r12d, %edi
je 0x4095df
testl %r10d, %r10d
jne 0x40958b
testb %r8b, %r8b
je 0x40958b
decb %r8b
jmp 0x4095aa
movzbl (%r9), %r14d
shrl $0x2, %r14d
andl $0x3, %r14d
movb (%r13,%r14), %bpl
movl %edi, %r14d
incl %edi
movb %bpl, (%rax,%r14)
cmpl %r12d, %edi
je 0x4095df
movzbl (%r9), %r14d
andl $0x3, %r14d
movb (%r13,%r14), %bpl
movl %edi, %r14d
incl %edi
movb %bpl, (%rax,%r14)
cmpl %r12d, %edi
je 0x4095df
cmpl $0x1b, %r11d
ja 0x4095df
decq %r9
addl $0x4, %r11d
addl $-0x4, %r10d
cmpl %r12d, %r11d
jb 0x409520
incq %rsi
cmpq %rdx, %rsi
jne 0x40950d
movl %ebx, 0x4(%rsp)
movq 0x70(%rsp), %rdi
movl $0x1, %esi
movq 0x138(%rsp), %rdx
movq 0xa0(%rsp), %rbx
movq %rbx, %rcx
callq 0x4ee490
cmpl $0x0, 0x10(%rsp)
movq 0x90(%rsp), %rbp
je 0x40964a
xorl %r14d, %r14d
movq 0x110(%rsp), %rax
movq (%rax,%r14), %rdi
movq 0x8(%rax,%r14), %rdx
movl $0x1, %esi
movq %rbx, %rcx
callq 0x4ee490
addq $0x20, %r14
cmpq %r14, %rbp
jne 0x409623
movl $0xa, %edi
movq %rbx, %rsi
callq 0x4f29f0
movl 0x4(%rsp), %ebx
leaq 0x110(%rsp), %rdi
leaq 0x200(%rsp), %rsi
callq 0x40aef0
movq 0x110(%rsp), %rax
movq 0x50(%rsp), %rcx
shlq $0x5, %rcx
leaq (%rax,%rcx), %r14
movq 0x8(%rax,%rcx), %rbp
movl %ebx, %r15d
leaq 0x290(%rsp), %rbx
movq %rbx, %rdi
callq 0x401140
movq %r14, %rdi
xorl %esi, %esi
movq %rbp, %rdx
xorl %ebp, %ebp
movq %rbx, %rcx
movl %r15d, %ebx
movq 0x148(%rsp), %r15
movq %rax, %r8
callq 0x48ccd0
movl $0x0, 0x4(%rsp)
movq 0x40(%rsp), %rax
cmpb $0x0, 0x100(%rax)
je 0x4097b8
incl %ebp
movq 0x1b0(%rsp), %rax
movq 0x30(%rsp), %rcx
leaq (%rax,%rcx,8), %r14
cmpl %r12d, 0x8(%r14)
je 0x409727
testl %r12d, %r12d
je 0x409702
testq %r15, %r15
je 0x409702
movq %r15, %rdi
callq 0x41b3b0
movl 0x8(%r14), %r12d
movb 0xc(%r14), %al
movl %eax, 0x3c(%rsp)
movl 0x10(%r14), %eax
movq %rax, 0x8(%rsp)
leaq (,%rax,8), %rdi
callq 0x41c2a0
movq %rax, %r15
cmpl $0x0, 0x8(%rsp)
je 0x409747
movq (%r14), %rax
movl 0x8(%rsp), %ecx
xorl %edx, %edx
movq (%rax,%rdx,8), %rsi
movq %rsi, (%r15,%rdx,8)
incq %rdx
cmpq %rdx, %rcx
jne 0x409737
movq 0x30(%rsp), %rdi
shlq $0x6, %rdi
addq 0x48(%rsp), %rdi
leaq 0x18(%rsp), %rsi
leaq 0xa8(%rsp), %rdx
callq 0x417396
testb %al, %al
leaq 0x212f78(%rip), %r14    # 0x61c6e8
je 0x409877
movl 0x20(%rsp), %eax
cmpl %eax, 0xd0(%rsp)
jne 0x409816
movl 0x28(%rsp), %eax
testq %rax, %rax
setne %cl
je 0x409850
movq 0xc8(%rsp), %rsi
movq 0x18(%rsp), %rdi
movq (%rsi), %rdx
movq (%rdi), %r8
movb $0x1, %cl
cmpq %r8, %rdx
jbe 0x40981b
movb $0x1, %dl
jmp 0x409850
movq 0x140(%rsp), %rdi
leaq 0x1be6e3(%rip), %rsi    # 0x5c7eaa
callq 0x48e290
testl %eax, %eax
je 0x4096d7
movq 0x50(%rsp), %rsi
shlq $0x5, %rsi
movq 0xf0(%rsp), %rax
addq (%rax), %rsi
movq 0x218(%rsp), %rdi
callq 0x40b06a
movq %rax, %rdi
movq 0x140(%rsp), %rsi
callq 0x48e0e0
testl %eax, %eax
je 0x4096d7
incl 0x4(%rsp)
jmp 0x4096d9
seta %cl
jmp 0x409852
jae 0x409821
xorl %edx, %edx
jmp 0x409850
movl $0x1, %edx
movq %rdx, %rcx
cmpq %rcx, %rax
je 0x40984a
movq (%rsi,%rcx,8), %r8
movq (%rdi,%rcx,8), %r9
cmpq %r9, %r8
ja 0x409848
leaq 0x1(%rcx), %rdx
cmpq %r9, %r8
jae 0x409826
xorl %edx, %edx
jmp 0x40984a
movb $0x1, %dl
cmpq %rax, %rcx
setb %cl
andb %dl, %cl
testb %cl, %cl
je 0x409877
movq %r14, %rdi
callq 0x4fbcf0
testl %eax, %eax
jne 0x409c7f
incq 0x212e73(%rip)          # 0x61c6e0
movq %r14, %rdi
callq 0x4fcbd0
jmp 0x4098ed
movl 0x20(%rsp), %eax
cmpl %eax, 0x60(%rsp)
je 0x4098ba
testl %eax, %eax
je 0x409894
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x409894
callq 0x41b3b0
movl 0x60(%rsp), %eax
movl %eax, 0x20(%rsp)
movb 0x64(%rsp), %al
movb %al, 0x24(%rsp)
movl 0x68(%rsp), %edi
movl %edi, 0x28(%rsp)
shlq $0x3, %rdi
callq 0x41c2a0
movq %rax, 0x18(%rsp)
movl 0x28(%rsp), %eax
testq %rax, %rax
je 0x4098df
movq 0x58(%rsp), %rcx
movq 0x18(%rsp), %rdx
xorl %esi, %esi
movq (%rcx,%rsi,8), %rdi
movq %rdi, (%rdx,%rsi,8)
incq %rsi
cmpq %rsi, %rax
jne 0x4098cf
incl %ebx
movq $0x0, 0xa8(%rsp)
cmpl 0x10(%rsp), %ebx
je 0x40999a
movq 0x1b0(%rsp), %rax
movq 0x30(%rsp), %rcx
leaq (%rax,%rcx,8), %r14
movl 0x8(%r14), %eax
cmpl %eax, 0x20(%rsp)
je 0x409947
testl %eax, %eax
je 0x409923
movq (%r14), %rdi
testq %rdi, %rdi
je 0x409923
callq 0x41b3b0
movl 0x20(%rsp), %eax
movl %eax, 0x8(%r14)
movb 0x24(%rsp), %al
movb %al, 0xc(%r14)
movl 0x28(%rsp), %edi
movl %edi, 0x10(%r14)
shlq $0x3, %rdi
callq 0x41c2a0
movq %rax, (%r14)
movl 0x10(%r14), %eax
testq %rax, %rax
je 0x40996a
movq 0x18(%rsp), %rcx
movq (%r14), %rdx
xorl %esi, %esi
movq (%rcx,%rsi,8), %rdi
movq %rdi, (%rdx,%rsi,8)
incq %rsi
cmpq %rsi, %rax
jne 0x40995a
movl 0xa8(%rsp), %eax
movq 0x1c8(%rsp), %rcx
movq 0x50(%rsp), %rdx
movl %eax, (%rcx,%rdx,4)
leaq 0x190(%rsp), %rdi
movl 0x9c(%rsp), %esi
callq 0x4142a6
jmp 0x409394
cmpl 0xe8(%rsp), %ebp
jae 0x4099b4
movl 0x4(%rsp), %eax
cmpl 0xe0(%rsp), %eax
jb 0x409b26
movl %r12d, %esi
leaq 0x70(%rsp), %rdi
xorl %edx, %edx
callq 0x48cc80
movq 0x8(%rsp), %rax
testl %eax, %eax
movl 0x3c(%rsp), %ebx
je 0x409abe
movq %rax, %rdx
movq 0x70(%rsp), %rax
leaq 0x7(%r15), %rcx
movl %edx, %edx
xorl %esi, %esi
xorl %edi, %edi
testl %r12d, %r12d
je 0x409ab2
leaq (%rcx,%rsi,8), %r8
xorl %r9d, %r9d
xorl %r10d, %r10d
testl %r9d, %r9d
jne 0x409a06
testb %bl, %bl
je 0x409a06
decb %bl
jmp 0x409a25
movzbl (%r8), %r11d
shrl $0x6, %r11d
movb (%r13,%r11), %r11b
movl %edi, %r14d
incl %edi
movb %r11b, (%rax,%r14)
cmpl %r12d, %edi
je 0x409ab2
testl %r9d, %r9d
jne 0x409a32
testb %bl, %bl
je 0x409a32
decb %bl
jmp 0x409a51
movzbl (%r8), %r11d
shrl $0x4, %r11d
andl $0x3, %r11d
movb (%r13,%r11), %r11b
movl %edi, %r14d
incl %edi
movb %r11b, (%rax,%r14)
cmpl %r12d, %edi
je 0x409ab2
testl %r9d, %r9d
jne 0x409a5e
testb %bl, %bl
je 0x409a5e
decb %bl
jmp 0x409a7d
movzbl (%r8), %r11d
shrl $0x2, %r11d
andl $0x3, %r11d
movb (%r13,%r11), %r11b
movl %edi, %r14d
incl %edi
movb %r11b, (%rax,%r14)
cmpl %r12d, %edi
je 0x409ab2
movzbl (%r8), %r11d
andl $0x3, %r11d
movb (%r13,%r11), %r11b
movl %edi, %r14d
incl %edi
movb %r11b, (%rax,%r14)
cmpl %r12d, %edi
je 0x409ab2
cmpl $0x1b, %r10d
ja 0x409ab2
decq %r8
addl $0x4, %r10d
addl $-0x4, %r9d
cmpl %r12d, %r10d
jb 0x4099f9
incq %rsi
cmpq %rdx, %rsi
jne 0x4099e6
movq 0x70(%rsp), %rdi
movl $0x1, %esi
movq 0x138(%rsp), %rdx
movq 0xa0(%rsp), %r12
movq %r12, %rcx
callq 0x4ee490
cmpl $0x0, 0x10(%rsp)
je 0x409b19
movl 0x10(%rsp), %ebx
shlq $0x5, %rbx
xorl %r14d, %r14d
movq 0x110(%rsp), %rax
movq (%rax,%r14), %rdi
movq 0x8(%rax,%r14), %rdx
movl $0x1, %esi
movq %r12, %rcx
callq 0x4ee490
addq $0x20, %r14
cmpq %r14, %rbx
jne 0x409af2
movl $0xa, %edi
movq %r12, %rsi
callq 0x4f29f0
movq 0x10(%rsp), %rax
testl %eax, %eax
movq 0x130(%rsp), %r13
movq 0x48(%rsp), %r14
je 0x409b52
movl %eax, %ebx
movq %r14, %rdi
callq 0x417592
addq $0xc0, %r14
decq %rbx
jne 0x409b3e
movq 0xa0(%rsp), %rdi
callq 0x4ed8e0
movq (%r13), %rcx
movq %rcx, %rax
shlq $0x6, %rax
leaq (%rax,%rax,2), %rbx
addq $0x8, %rbx
testq %rcx, %rcx
je 0x409b97
leaq (%rax,%rax,2), %r14
movq %r13, %r12
addq $-0xb8, %r12
leaq (%r12,%r14), %rdi
callq 0x416c76
addq $-0xc0, %r14
jne 0x409b85
movq %r13, %rdi
movq %rbx, %rsi
callq 0x41b3c0
testq %r15, %r15
je 0x409baf
movq %r15, %rdi
callq 0x41b3b0
leaq 0x110(%rsp), %rdi
callq 0x407c92
leaq 0x200(%rsp), %rdi
callq 0x407c92
leaq 0x190(%rsp), %rdi
callq 0x414262
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0x409bf8
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x41b3a0
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0x409c07
callq 0x41b3b0
movq 0xb0(%rsp), %rdi
testq %rdi, %rdi
je 0x409c19
callq 0x41b3b0
movq 0xc8(%rsp), %rdi
testq %rdi, %rdi
je 0x409c2b
callq 0x41b3b0
movq 0xf8(%rsp), %rdi
testq %rdi, %rdi
je 0x409c3d
callq 0x41b3b0
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x409c4c
callq 0x41b3b0
leaq 0x280(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x409c6d
movq 0x280(%rsp), %rsi
incq %rsi
callq 0x41b3a0
addq $0x698, %rsp            # imm = 0x698
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %eax, %edi
callq 0x402db7
movl %eax, %edi
callq 0x402db7
movl %eax, %edi
callq 0x402db7
movq %rax, %rbx
jmp 0x409eac
jmp 0x409ddd
movq %rax, %rbx
jmp 0x409f09
movq %rax, %rbx
jmp 0x409f1b
movq %rax, %rbx
jmp 0x409f2d
movq %rax, %rbx
jmp 0x409f3f
jmp 0x409ddd
jmp 0x409ddd
jmp 0x409dd0
jmp 0x409cd2
movq %rax, %rbx
jmp 0x409efa
jmp 0x409dd0
movq %rbx, %r12
movq %rax, %rbx
movq 0x230(%rsp), %rdi
cmpq %r14, %rdi
je 0x409d0a
movq 0x240(%rsp), %rsi
incq %rsi
callq 0x41b3a0
jmp 0x409d0a
movq %rbx, %r12
movq %rax, %rbx
movq 0x290(%rsp), %rdi
cmpq %r12, %rdi
je 0x409d2c
movq 0x2a0(%rsp), %rsi
incq %rsi
callq 0x41b3a0
jmp 0x409d2c
movq %rax, %rbx
movq 0x190(%rsp), %rdi
cmpq %r13, %rdi
je 0x409d4e
movq 0x1a0(%rsp), %rsi
incq %rsi
callq 0x41b3a0
jmp 0x409d4e
movq %rax, %rbx
movq 0x250(%rsp), %rdi
jmp 0x409f5a
jmp 0x409d64
jmp 0x409ec8
jmp 0x409ddd
movq %rax, %rbx
movq 0x290(%rsp), %rdi
cmpq %r14, %rdi
je 0x409f4e
movq 0x2a0(%rsp), %rsi
jmp 0x409e58
jmp 0x409e9c
jmp 0x409e9c
jmp 0x409e9c
jmp 0x409d9b
jmp 0x409e9c
movq %rax, %rbx
movq 0x150(%rsp), %rdi
cmpq %r14, %rdi
je 0x409e9f
movq 0x160(%rsp), %rsi
incq %rsi
callq 0x41b3a0
jmp 0x409e9f
jmp 0x409ec8
jmp 0x409ec8
jmp 0x409dd0
movq %rax, %rbx
jmp 0x409ed8
movq %rax, %rbx
jmp 0x409e0d
movq %rax, %rbx
jmp 0x409f4e
movq %rax, %rbx
movq 0x290(%rsp), %rdi
leaq 0x2a0(%rsp), %rax
cmpq %rax, %rdi
je 0x409e0d
movq 0x2a0(%rsp), %rsi
incq %rsi
callq 0x41b3a0
movq 0x1e0(%rsp), %rdi
leaq 0x1f0(%rsp), %rax
cmpq %rax, %rdi
je 0x409e37
movq 0x1f0(%rsp), %rsi
incq %rsi
callq 0x41b3a0
jmp 0x409e37
movq %rax, %rbx
movq 0x170(%rsp), %rdi
leaq 0x180(%rsp), %rax
cmpq %rax, %rdi
je 0x409f4e
movq 0x180(%rsp), %rsi
incq %rsi
callq 0x41b3a0
jmp 0x409f4e
movq %rax, %rbx
testq %r15, %r15
je 0x409e8c
negq %r15
movq %r13, %r12
addq $-0xb8, %r12
leaq (%r12,%r15), %rdi
callq 0x416c76
addq $-0xc0, %r15
jne 0x409e7a
movq %r13, %rdi
movq %r14, %rsi
callq 0x41b3c0
jmp 0x409f6a
movq %rax, %rbx
testq %r15, %r15
je 0x409eac
movq %r15, %rdi
callq 0x41b3b0
leaq 0x110(%rsp), %rdi
callq 0x407c92
leaq 0x200(%rsp), %rdi
callq 0x407c92
jmp 0x409ecb
movq %rax, %rbx
leaq 0x190(%rsp), %rdi
callq 0x414262
leaq 0x80(%rsp), %rax
movq 0x70(%rsp), %rdi
cmpq %rax, %rdi
je 0x409efa
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x41b3a0
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0x409f09
callq 0x41b3b0
movq 0xb0(%rsp), %rdi
testq %rdi, %rdi
je 0x409f1b
callq 0x41b3b0
movq 0xc8(%rsp), %rdi
testq %rdi, %rdi
je 0x409f2d
callq 0x41b3b0
movq 0xf8(%rsp), %rdi
testq %rdi, %rdi
je 0x409f3f
callq 0x41b3b0
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x409f4e
callq 0x41b3b0
leaq 0x280(%rsp), %r15
movq -0x10(%r15), %rdi
cmpq %r15, %rdi
je 0x409f6a
movq (%r15), %rsi
incq %rsi
callq 0x41b3a0
movq %rbx, %rdi
callq 0x4c0230