// File: /workspace/github_cpp_makefile_star2_O3/ChnMasterOG[P]KmerGO2/kmergo/kmer_filtering.cpp
// Function: categorical_feature_filtering(unsigned short, 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>>>>, KmerGO_parameters)
void categorical_feature_filtering(uint16_t Nprocess, std::vector<std::string> files_vec, KmerGO_parameters p)
{
	std::string line, kmer;
	std::string input_file_name = files_vec[Nprocess];
	std::string onput_file_name_l = joinPath(p.features_path, "categorical_l_" + std::to_string(Nprocess) + ".txt");
	std::string onput_file_name_n = joinPath(p.features_path, "categorical_n_" + std::to_string(Nprocess) + ".txt");
	std::ifstream input_file(input_file_name);
	std::ofstream output_file_l(onput_file_name_l);
	std::ofstream output_file_n(onput_file_name_n);
	std::vector<short> sample_label;	// -1 inexistence, 0 groupA, 1 groupB
	std::string::size_type position;

	/* read head text and set labels */
	std::getline(input_file, line);
	mtx.lock();	// mutex
	progress += line.size() + 1;	// update progress
	mtx.unlock();
	output_file_l << line << "\tASS\tLabel\n";	// write logical file head text
	output_file_n << line << "\tASS-l\tP\tASS-n\tLabel\n";	// write numerical file head text
	position = line.find("\t");
	line = line.substr(position + 1);	// remove string "k-mer"
	position = line.find("\t");
	while (position != line.npos)	// split groupA and groupB
	{
		std::string sample_name = line.substr(0, position);
		if (p.trait_information_map.find(sample_name) != p.trait_information_map.end())
		{
			if (p.trait_information_map[sample_name].compare(p.groupA_name) == 0) sample_label.push_back(0);
			else sample_label.push_back(1);
		}
		else sample_label.push_back(-1);
		line = line.substr(position + 1);
		position = line.find("\t");
	}
	if (p.trait_information_map.find(line) != p.trait_information_map.end())
	{
		if (p.trait_information_map[line].compare(p.groupA_name) == 0) sample_label.push_back(0);
		else sample_label.push_back(1);
	}
	else sample_label.push_back(-1);

	/* filtering */
	while (std::getline(input_file, line))
	{
		std::string src_line(line);
		position = line.find("\t");
		line = line.substr(position + 1);	// remove first k-mer
		position = line.find("\t");
		std::vector<float> group1, group2;
		int cnt = 0, tp = 0, tn = 0;
		std::string judge_label;
		while (position != line.npos)
		{
			std::string value_str = line.substr(0, position);
			float value_float = std::stof(value_str);
			/* add values to groups */
			if (sample_label[cnt] == 0)	// is groupA
			{
				group1.push_back(value_float);
				if (value_float > 0) ++tp;
			}
			else if(sample_label[cnt] == 1)	// is groupB
			{
				group2.push_back(value_float);
				if (value_float == 0) ++tn;
			}
			line = line.substr(position + 1);
			position = line.find("\t");
			++cnt;
		}
		/* calculation */
		float assL = ((float)tp / group1.size() + (float)tn / group2.size()) / 2;	// ass_l
		if (assL > 0.5) judge_label = p.groupA_name;
		else
		{
			judge_label = p.groupB_name;
			assL = 1 - assL;
		}
		if (assL >= p.assl)	// logical ASS
		{
			output_file_l << src_line << '\t' << std::to_string(assL) << '\t' << judge_label << '\n';
		}
		else	// numerical ASS
		{
			float pValue = ranksums(group1, group2);
			if (pValue < p.p_value)
			{
				std::vector<Logistic_Data> dataSet;
				for (float i : group1)
				{
					dataSet.push_back(Logistic_Data(std::vector<float>{i}, 0));	// 1 feature for group1
				}
				for (float i : group2)
				{
					dataSet.push_back(Logistic_Data(std::vector<float>{i}, 1));	// 1 feature for group2
				}
				std::vector<Logistic_Data> testdataSet(dataSet);
				Logistic model(dataSet);
				model.logisticRegression();	// fit the logistics model
				model.predictClass(testdataSet);
				/* calculate the confusion matrix */
				tp = tn = 0;
				for (unsigned int i = 0; i < group1.size(); i++)	// caculate tp
				{
					if (testdataSet[i].cls == dataSet[i].cls) ++tp;
				}
				for (unsigned int i = 0; i < group1.size(); i++)	// caculate tn
				{
					if (testdataSet[i].cls == dataSet[i].cls) ++tn;
				}
				float assN = ((float)tp / group1.size() + (float)tn / group2.size()) / 2;	// ass_n
				if (assN >= p.assn)
				{
					output_file_n << src_line << '\t' << std::to_string(assL) << '\t' << pValue <<
						'\t' << assN << '\t' << judge_label << '\n';
				}
			}
		}
		mtx.lock();
		progress += src_line.size() + 1;	// update progress
		mtx.unlock();
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x8b8, %rsp            # imm = 0x8B8
movq %rdx, %r14
movl %edi, %ebx
leaq 0xd0(%rsp), %rcx
movq %rcx, -0x10(%rcx)
xorl %eax, %eax
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq 0x1a0(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
movq (%rsi), %rax
movl %edi, %ecx
shll $0x5, %ecx
leaq 0x168(%rsp), %rdx
movq %rdx, -0x10(%rdx)
movq (%rax,%rcx), %rsi
movq 0x8(%rax,%rcx), %rdx
addq %rsi, %rdx
leaq 0x158(%rsp), %rdi
callq 0x408000
leaq 0x230(%rsp), %r13
movq %r13, -0x10(%r13)
movq 0x80(%r14), %rsi
movq %r14, 0x70(%rsp)
movq 0x88(%r14), %rdx
addq %rsi, %rdx
leaq 0x220(%rsp), %rdi
callq 0x408000
movzwl %bx, %ebp
movl $0x1, %r14d
cmpw $0xa, %bp
jb 0x40cd35
movl $0x2, %r14d
cmpw $0x64, %bx
jb 0x40cd35
movl $0x3, %r14d
cmpl $0x3e8, %ebp            # imm = 0x3E8
jb 0x40cd35
cmpl $0x2710, %ebp           # imm = 0x2710
movl $0x5, %r14d
sbbl $0x0, %r14d
movl %r14d, %esi
leaq 0x4c8(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x4b8(%rsp), %rdi
movl $0x2d, %edx
callq 0x48b4d0
leaq 0x4b8(%rsp), %r15
movq (%r15), %rdi
movl %r14d, %esi
movl %ebp, %edx
callq 0x407f93
leaq 0x19576d(%rip), %rcx    # 0x5a24e0
movl $0xe, %r8d
movq %r15, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x48cb60
leaq 0x2c0(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x40cdb5
movq %rdx, 0x2b0(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x2c0(%rsp)
jmp 0x40cdbc
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rdx
leaq 0x2b0(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x1954da(%rip), %rsi    # 0x5a22bc
callq 0x48d320
leaq 0x1f0(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x40ce17
movq %rdx, 0x1e0(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x1f0(%rsp)
jmp 0x40ce1e
movups (%rcx), %xmm0
movups %xmm0, (%r14)
movq 0x8(%rax), %rsi
leaq 0x1e0(%rsp), %rdx
movq %rsi, 0x8(%rdx)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x290(%rsp), %rdi
leaq 0x220(%rsp), %rsi
callq 0x407aca
movq 0x1e0(%rsp), %rdi
cmpq %r14, %rdi
je 0x40ce6f
movq 0x1f0(%rsp), %rsi
incq %rsi
callq 0x41ae90
movq 0x2b0(%rsp), %rdi
cmpq %r15, %rdi
movq 0x70(%rsp), %r14
je 0x40ce91
movq 0x2c0(%rsp), %rsi
incq %rsi
callq 0x41ae90
movq 0x4b8(%rsp), %rdi
cmpq %r12, %rdi
je 0x40ceae
movq 0x4c8(%rsp), %rsi
incq %rsi
callq 0x41ae90
movq 0x220(%rsp), %rdi
cmpq %r13, %rdi
je 0x40cecb
movq 0x230(%rsp), %rsi
incq %rsi
callq 0x41ae90
leaq 0x210(%rsp), %r13
movq %r13, -0x10(%r13)
movq 0x80(%r14), %rsi
movq 0x88(%r14), %rdx
addq %rsi, %rdx
leaq 0x200(%rsp), %rdi
callq 0x408000
movl $0x1, %r14d
cmpw $0xa, %bx
jb 0x40cf2b
movl $0x2, %r14d
cmpw $0x64, %bx
jb 0x40cf2b
movl $0x3, %r14d
cmpl $0x3e8, %ebp            # imm = 0x3E8
jb 0x40cf2b
cmpl $0x2710, %ebp           # imm = 0x2710
movl $0x5, %r14d
sbbl $0x0, %r14d
movl %r14d, %esi
leaq 0x4b8(%rsp), %rdi
movq %r12, (%rdi)
movl $0x2d, %edx
callq 0x48b4d0
leaq 0x4b8(%rsp), %rbx
movq (%rbx), %rdi
movl %r14d, %esi
movl %ebp, %edx
callq 0x407f93
leaq 0x195590(%rip), %rcx    # 0x5a24ef
movl $0xe, %r8d
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x48cb60
movq %r15, 0x2b0(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x40cf9d
movq %rdx, 0x2b0(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x2c0(%rsp)
jmp 0x40cfa4
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rdx
leaq 0x2b0(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x1952f2(%rip), %rsi    # 0x5a22bc
callq 0x48d320
leaq 0x1d0(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x40cfff
movq %rdx, 0x1c0(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x1d0(%rsp)
jmp 0x40d006
movups (%rcx), %xmm0
movups %xmm0, (%r14)
movq 0x8(%rax), %rsi
leaq 0x1c0(%rsp), %rdx
movq %rsi, 0x8(%rdx)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x270(%rsp), %rdi
leaq 0x200(%rsp), %rsi
callq 0x407aca
movq 0x1c0(%rsp), %rdi
cmpq %r14, %rdi
je 0x40d057
movq 0x1d0(%rsp), %rsi
incq %rsi
callq 0x41ae90
movq 0x2b0(%rsp), %rdi
cmpq %r15, %rdi
je 0x40d074
movq 0x2c0(%rsp), %rsi
incq %rsi
callq 0x41ae90
movq 0x4b8(%rsp), %rdi
cmpq %r12, %rdi
je 0x40d091
movq 0x4c8(%rsp), %rsi
incq %rsi
callq 0x41ae90
movq 0x200(%rsp), %rdi
cmpq %r13, %rdi
je 0x40d0ae
movq 0x210(%rsp), %rsi
incq %rsi
callq 0x41ae90
leaq 0x2b0(%rsp), %rbx
leaq 0x158(%rsp), %rsi
movq %rbx, %rdi
movl $0x8, %edx
callq 0x461c60
leaq 0x4b8(%rsp), %rdi
leaq 0x290(%rsp), %rsi
movl $0x10, %edx
callq 0x461dd0
leaq 0x6b8(%rsp), %rdi
leaq 0x270(%rsp), %rsi
movl $0x10, %edx
callq 0x461dd0
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
movq 0x2b0(%rsp), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x4663c0
movsbl %al, %edx
leaq 0x2b0(%rsp), %rdi
leaq 0xc0(%rsp), %rsi
callq 0x41d090
leaq 0x20e5e0(%rip), %rdi    # 0x61b728
callq 0x4fb7a0
testl %eax, %eax
jne 0x40e088
movq 0xc8(%rsp), %rax
movq 0x20e5b4(%rip), %rcx    # 0x61b718
addq %rcx, %rax
incq %rax
movq %rax, 0x20e5a7(%rip)    # 0x61b718
leaq 0x20e5b0(%rip), %rdi    # 0x61b728
callq 0x4fc680
movq 0xc0(%rsp), %rsi
movq 0xc8(%rsp), %rdx
leaq 0x4b8(%rsp), %rdi
callq 0x485270
leaq 0x19535d(%rip), %rsi    # 0x5a24fe
movl $0xb, %edx
movq %rax, %rdi
callq 0x485270
movq 0xc0(%rsp), %rsi
movq 0xc8(%rsp), %rdx
leaq 0x6b8(%rsp), %rdi
callq 0x485270
leaq 0x195338(%rip), %rsi    # 0x5a250a
movl $0x15, %edx
movq %rax, %rdi
callq 0x485270
leaq 0x19533a(%rip), %rsi    # 0x5a2520
leaq 0xc0(%rsp), %rbx
movl $0x1, %ecx
movq %rbx, %rdi
xorl %edx, %edx
callq 0x48d5e0
leaq 0x1(%rax), %rdx
leaq 0x38(%rsp), %rdi
movq %rbx, %rsi
movq $-0x1, %rcx
callq 0x48e3a0
leaq 0xc0(%rsp), %rdi
leaq 0x38(%rsp), %rbx
movq %rbx, %rsi
callq 0x48bbc0
movq (%rbx), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x40d244
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x41ae90
leaq 0x1952d5(%rip), %rsi    # 0x5a2520
leaq 0xc0(%rsp), %rdi
movl $0x1, %ecx
xorl %edx, %edx
callq 0x48d5e0
cmpq $-0x1, %rax
je 0x40d404
movq %rax, %r13
movq 0x70(%rsp), %rax
leaq 0x158(%rax), %rbx
leaq 0x160(%rax), %r14
addq $0x108, %rax            # imm = 0x108
movq %rax, 0x8(%rsp)
leaq 0x38(%rsp), %r15
leaq 0xc0(%rsp), %r12
leaq 0xe0(%rsp), %rbp
movq %r15, %rdi
movq %r12, %rsi
xorl %edx, %edx
movq %r13, %rcx
callq 0x48e3a0
movq %rbx, %rdi
movq %r15, %rsi
callq 0x410070
cmpq %r14, %rax
je 0x40d2fc
movq %rbx, %rdi
movq %r15, %rsi
callq 0x40addc
movq %rax, %rdi
movq 0x8(%rsp), %rsi
callq 0x48dbd0
testl %eax, %eax
je 0x40d31d
movw $0x1, 0xe0(%rsp)
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x40d3ce
movw $0x1, (%rsi)
jmp 0x40d33c
movw $0xffff, 0xe0(%rsp)     # imm = 0xFFFF
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x40d3e0
movw $0xffff, (%rsi)         # imm = 0xFFFF
jmp 0x40d33c
movw $0x0, 0xe0(%rsp)
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x40d3f2
movw $0x0, (%rsi)
addq $0x2, %rsi
movq %rsi, 0x18(%rsp)
incq %r13
movq %rbp, %rdi
movq %r12, %rsi
movq %r13, %rdx
movq $-0x1, %rcx
callq 0x48e3a0
movq %r12, %rdi
movq %rbp, %rsi
callq 0x48bbc0
movq 0xe0(%rsp), %rdi
leaq 0xf0(%rsp), %rax
cmpq %rax, %rdi
je 0x40d38d
movq 0xf0(%rsp), %rsi
incq %rsi
callq 0x41ae90
movl $0x1, %ecx
movq %r12, %rdi
leaq 0x195184(%rip), %rsi    # 0x5a2520
xorl %edx, %edx
callq 0x48d5e0
movq %rax, %r13
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x40d3c2
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x41ae90
cmpq $-0x1, %r13
jne 0x40d29f
jmp 0x40d404
leaq 0x10(%rsp), %rdi
movq %rbp, %rdx
callq 0x4100b6
jmp 0x40d345
leaq 0x10(%rsp), %rdi
movq %rbp, %rdx
callq 0x4100b6
jmp 0x40d345
leaq 0x10(%rsp), %rdi
movq %rbp, %rdx
callq 0x4100b6
jmp 0x40d345
movq 0x70(%rsp), %r14
leaq 0x158(%r14), %rbx
leaq 0xc0(%rsp), %rsi
movq %rbx, %rdi
callq 0x410070
leaq 0x160(%r14), %rcx
cmpq %rcx, %rax
je 0x40d46d
leaq 0xc0(%rsp), %rsi
movq %rbx, %rdi
callq 0x40addc
leaq 0x108(%r14), %rsi
movq %rax, %rdi
callq 0x48dbd0
testl %eax, %eax
je 0x40d48b
movw $0x1, 0x38(%rsp)
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x40e02d
movw $0x1, (%rsi)
jmp 0x40d4a7
movw $0xffff, 0x38(%rsp)     # imm = 0xFFFF
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x40e041
movw $0xffff, (%rsi)         # imm = 0xFFFF
jmp 0x40d4a7
movw $0x0, 0x38(%rsp)
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x40e055
movw $0x0, (%rsi)
addq $0x2, %rsi
movq %rsi, 0x18(%rsp)
leaq 0x130(%r14), %rax
movq %rax, 0x1b8(%rsp)
leaq 0x108(%r14), %rax
movq %rax, 0x1b0(%rsp)
leaq 0xc0(%rsp), %r12
leaq 0x38(%rsp), %r15
leaq 0x118(%rsp), %rbp
movq 0x2b0(%rsp), %rax
movq -0x18(%rax), %rdi
leaq 0x2b0(%rsp), %rbx
addq %rbx, %rdi
movl $0xa, %esi
callq 0x4663c0
movsbl %al, %edx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x41d090
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x40ded8
leaq 0xf0(%rsp), %rax
movq %rax, 0xe0(%rsp)
movq 0xc0(%rsp), %rsi
movq 0xc8(%rsp), %rdx
addq %rsi, %rdx
leaq 0xe0(%rsp), %rdi
callq 0x408000
movl $0x1, %ecx
movq %r12, %rdi
leaq 0x194fbd(%rip), %rsi    # 0x5a2520
xorl %edx, %edx
callq 0x48d5e0
leaq 0x1(%rax), %rdx
movq %r15, %rdi
movq %r12, %rsi
movq $-0x1, %rcx
callq 0x48e3a0
movq %r12, %rdi
movq %r15, %rsi
callq 0x48bbc0
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x40d5a7
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x41ae90
movl $0x1, %ecx
movq %r12, %rdi
leaq 0x194f6a(%rip), %rsi    # 0x5a2520
xorl %edx, %edx
callq 0x48d5e0
movq %rax, %rbx
xorl %ecx, %ecx
movq %rcx, 0xb0(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0xa0(%rsp)
movq %rcx, 0x90(%rsp)
movaps %xmm0, 0x80(%rsp)
leaq 0x148(%rsp), %rax
movq %rax, 0x138(%rsp)
movq %rcx, 0x140(%rsp)
movb $0x0, 0x148(%rsp)
movss 0x194ec3(%rip), %xmm0   # 0x5a24d0
movss %xmm0, 0x8(%rsp)
cmpq $-0x1, %rbx
je 0x40d8b0
xorl %r14d, %r14d
movl $0x0, 0x7c(%rsp)
movl $0x0, 0x30(%rsp)
movq %r15, %rdi
movq %r12, %rsi
xorl %edx, %edx
movq %rbx, %rcx
callq 0x48e3a0
movq %rbx, 0x8(%rsp)
movq %r12, %rbx
movq 0x38(%rsp), %r13
callq 0x4c4e20
movq %rax, %r12
movq %rbp, %rsi
movl (%rax), %eax
movl %eax, 0x34(%rsp)
movl $0x0, (%r12)
movq %r13, %rdi
callq 0x4dc350
cmpq %r13, 0x118(%rsp)
je 0x40e069
movl (%r12), %eax
testl %eax, %eax
je 0x40d68e
cmpl $0x22, %eax
jne 0x40d696
jmp 0x40e075
movl 0x34(%rsp), %eax
movl %eax, (%r12)
movss %xmm0, 0x100(%rsp)
movq 0x10(%rsp), %rax
movzwl (%rax,%r14), %eax
cmpl $0x1, %eax
je 0x40d6de
testl %eax, %eax
movq %rbx, %r12
jne 0x40d70a
movq 0xa8(%rsp), %rsi
cmpq 0xb0(%rsp), %rsi
movq 0x8(%rsp), %rbx
je 0x40d711
movss %xmm0, (%rsi)
addq $0x4, %rsi
movq %rsi, 0xa8(%rsp)
jmp 0x40d726
movq 0x88(%rsp), %rsi
cmpq 0x90(%rsp), %rsi
movq %rbx, %r12
je 0x40d73e
movss %xmm0, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x88(%rsp)
movq 0x8(%rsp), %rbx
jmp 0x40d758
movq 0x8(%rsp), %rbx
jmp 0x40d770
leaq 0xa0(%rsp), %rdi
leaq 0x100(%rsp), %rdx
callq 0x4101ee
movss 0x100(%rsp), %xmm0
ucomiss 0x194da6(%rip), %xmm0   # 0x5a24dc
jbe 0x40d770
incl 0x7c(%rsp)
jmp 0x40d770
leaq 0x80(%rsp), %rdi
leaq 0x100(%rsp), %rdx
callq 0x4101ee
movq 0x8(%rsp), %rbx
movss 0x100(%rsp), %xmm0
ucomiss 0x194d74(%rip), %xmm0   # 0x5a24dc
jne 0x40d770
jp 0x40d770
incl 0x30(%rsp)
incq %rbx
movq %rbp, %rdi
movq %r12, %rsi
movq %rbx, %rdx
movq $-0x1, %rcx
callq 0x48e3a0
movq %r12, %rdi
movq %rbp, %rsi
callq 0x48bbc0
movq 0x118(%rsp), %rdi
leaq 0x128(%rsp), %rax
cmpq %rax, %rdi
je 0x40d7b8
movq 0x128(%rsp), %rsi
incq %rsi
callq 0x41ae90
movl $0x1, %ecx
movq %r12, %rdi
leaq 0x194d59(%rip), %rsi    # 0x5a2520
xorl %edx, %edx
callq 0x48d5e0
movq %rax, %rbx
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x40d7ed
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x41ae90
addq $0x2, %r14
cmpq $-0x1, %rbx
jne 0x40d630
movq 0xa8(%rsp), %rax
subq 0xa0(%rsp), %rax
sarq $0x2, %rax
js 0x40d81b
xorps %xmm0, %xmm0
cvtsi2ss %rax, %xmm0
jmp 0x40d833
movq %rax, %rcx
shrq %rcx
andl $0x1, %eax
orq %rcx, %rax
xorps %xmm0, %xmm0
cvtsi2ss %rax, %xmm0
addss %xmm0, %xmm0
movq 0x70(%rsp), %r14
movq 0x88(%rsp), %rax
subq 0x80(%rsp), %rax
sarq $0x2, %rax
js 0x40d855
cvtsi2ss %rax, %xmm1
jmp 0x40d86a
movq %rax, %rcx
shrq %rcx
andl $0x1, %eax
orq %rcx, %rax
cvtsi2ss %rax, %xmm1
addss %xmm1, %xmm1
cvtsi2ssl 0x7c(%rsp), %xmm2
divss %xmm0, %xmm2
cvtsi2ssl 0x30(%rsp), %xmm3
divss %xmm1, %xmm3
addss %xmm2, %xmm3
movss 0x194c4a(%rip), %xmm0   # 0x5a24d4
mulss %xmm0, %xmm3
movss %xmm3, 0x8(%rsp)
ucomiss %xmm0, %xmm3
jbe 0x40d8b0
leaq 0x138(%rsp), %rdi
movq 0x1b0(%rsp), %rsi
callq 0x48b7a0
jmp 0x40d8d9
leaq 0x138(%rsp), %rdi
movq 0x1b8(%rsp), %rsi
callq 0x48b7a0
movss 0x194c0b(%rip), %xmm0   # 0x5a24d8
subss 0x8(%rsp), %xmm0
movss %xmm0, 0x8(%rsp)
movss 0x8(%rsp), %xmm0
ucomiss 0x10(%r14), %xmm0
jae 0x40d9d1
leaq 0xa0(%rsp), %rdi
leaq 0x80(%rsp), %rsi
callq 0x419cd5
movss 0x14(%r14), %xmm1
ucomiss %xmm0, %xmm1
jbe 0x40de10
movss %xmm0, 0x34(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x100(%rsp)
movq $0x0, 0x110(%rsp)
movq 0xa0(%rsp), %rbx
movq 0xa8(%rsp), %r14
cmpq %r14, %rbx
je 0x40daab
movss (%rbx), %xmm0
movss %xmm0, 0x118(%rsp)
movl $0x1, %edx
leaq 0x258(%rsp), %r13
movq %r13, %rdi
movq %rbp, %rsi
leaq 0x178(%rsp), %rcx
callq 0x40fd8e
movq %r15, %rdi
movq %r13, %rsi
callq 0x40bdce
movl $0x0, 0x50(%rsp)
leaq 0x100(%rsp), %rdi
movq %r15, %rsi
callq 0x410380
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x40d9ab
movq 0x48(%rsp), %rsi
subq %rdi, %rsi
callq 0x41ae90
movq 0x258(%rsp), %rdi
testq %rdi, %rdi
je 0x40d9c8
movq 0x268(%rsp), %rsi
subq %rdi, %rsi
callq 0x41ae90
addq $0x4, %rbx
jmp 0x40d93b
movq 0xe0(%rsp), %rsi
movq 0xe8(%rsp), %rdx
leaq 0x4b8(%rsp), %rdi
callq 0x485270
movb $0x9, 0x38(%rsp)
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x485270
movq %rax, %rbx
xorps %xmm0, %xmm0
cvtss2sd 0x8(%rsp), %xmm0
movl $0x3a, %edx
movq %r15, %rdi
movq $0x4f2d20, %rsi         # imm = 0x4F2D20
leaq 0x1b9587(%rip), %rcx    # 0x5c6fac
movb $0x1, %al
callq 0x40ffbe
movq 0x38(%rsp), %rsi
movq 0x40(%rsp), %rdx
movq %rbx, %rdi
callq 0x485270
movb $0x9, 0x118(%rsp)
movl $0x1, %edx
movq %rax, %rdi
movq %rbp, %rsi
callq 0x485270
movq 0x138(%rsp), %rsi
movq 0x140(%rsp), %rdx
movq %rax, %rdi
callq 0x485270
movb $0xa, 0x118(%rsp)
movl $0x1, %edx
movq %rax, %rdi
movq %rbp, %rsi
callq 0x485270
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x40de10
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x41ae90
jmp 0x40de10
movq 0x80(%rsp), %rbx
movq 0x88(%rsp), %r14
cmpq %r14, %rbx
je 0x40db51
movss (%rbx), %xmm0
movss %xmm0, 0x118(%rsp)
movl $0x1, %edx
leaq 0x240(%rsp), %r13
movq %r13, %rdi
movq %rbp, %rsi
leaq 0x178(%rsp), %rcx
callq 0x40fd8e
movq %r15, %rdi
movq %r13, %rsi
callq 0x40bdce
movl $0x1, 0x50(%rsp)
leaq 0x100(%rsp), %rdi
movq %r15, %rsi
callq 0x410380
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x40db2b
movq 0x48(%rsp), %rsi
subq %rdi, %rsi
callq 0x41ae90
movq 0x240(%rsp), %rdi
testq %rdi, %rdi
je 0x40db48
movq 0x250(%rsp), %rsi
subq %rdi, %rsi
callq 0x41ae90
addq $0x4, %rbx
jmp 0x40dabb
leaq 0x178(%rsp), %rdi
leaq 0x100(%rsp), %rbx
movq %rbx, %rsi
callq 0x40fdd4
movq %r15, %rdi
movq %rbx, %rsi
callq 0x41a3a0
movq 0x70(%rsp), %r14
movq %r15, %rdi
callq 0x41a4ea
movq %r15, %rdi
leaq 0x178(%rsp), %rsi
callq 0x41ab40
movq 0xa0(%rsp), %rcx
movq 0xa8(%rsp), %rdx
movq %rdx, %rax
subq %rcx, %rax
sarq $0x2, %rax
xorps %xmm0, %xmm0
cmpq %rcx, %rdx
je 0x40dc41
movq 0x178(%rsp), %rdi
xorl %esi, %esi
movl $0x18, %r8d
movl $0x1, %r9d
movq 0x100(%rsp), %r10
movl (%rdi,%r8), %r11d
xorl %ebx, %ebx
cmpl (%r10,%r8), %r11d
sete %bl
addl %ebx, %esi
movl %r9d, %r11d
addq $0x20, %r8
incl %r9d
cmpq %r11, %rax
ja 0x40dbd5
cvtsi2ss %esi, %xmm3
cmpq %rcx, %rdx
je 0x40dc44
movq 0x178(%rsp), %rdx
xorl %ecx, %ecx
movl $0x18, %esi
movl $0x1, %edi
movq 0x100(%rsp), %r8
movl (%rdx,%rsi), %r9d
xorl %r10d, %r10d
cmpl (%r8,%rsi), %r9d
sete %r10b
addl %r10d, %ecx
movl %edi, %r9d
addq $0x20, %rsi
incl %edi
cmpq %r9, %rax
ja 0x40dc18
xorps %xmm0, %xmm0
cvtsi2ss %ecx, %xmm0
jmp 0x40dc44
xorps %xmm3, %xmm3
movq 0x88(%rsp), %rcx
subq 0x80(%rsp), %rcx
sarq $0x2, %rcx
js 0x40dc64
xorps %xmm1, %xmm1
cvtsi2ss %rcx, %xmm1
jmp 0x40dc7c
movq %rcx, %rdx
shrq %rdx
andl $0x1, %ecx
orq %rdx, %rcx
xorps %xmm1, %xmm1
cvtsi2ss %rcx, %xmm1
addss %xmm1, %xmm1
cvtsi2ss %rax, %xmm2
divss %xmm1, %xmm0
divss %xmm2, %xmm3
addss %xmm0, %xmm3
mulss 0x19483f(%rip), %xmm3   # 0x5a24d4
ucomiss 0x18(%r14), %xmm3
jb 0x40ddd7
movss %xmm3, 0x30(%rsp)
movq 0xe0(%rsp), %rsi
movq 0xe8(%rsp), %rdx
leaq 0x6b8(%rsp), %rdi
callq 0x485270
movb $0x9, 0x118(%rsp)
movl $0x1, %edx
movq %rax, %rdi
movq %rbp, %rsi
callq 0x485270
movq %rax, %rbx
xorps %xmm0, %xmm0
cvtss2sd 0x8(%rsp), %xmm0
movl $0x3a, %edx
movq %rbp, %rdi
movq $0x4f2d20, %rsi         # imm = 0x4F2D20
leaq 0x1b92af(%rip), %rcx    # 0x5c6fac
movb $0x1, %al
callq 0x40ffbe
movq 0x118(%rsp), %rsi
movq 0x120(%rsp), %rdx
movq %rbx, %rdi
callq 0x485270
movb $0x9, 0x7(%rsp)
movl $0x1, %edx
movq %rax, %rdi
leaq 0x7(%rsp), %rsi
callq 0x485270
xorps %xmm0, %xmm0
cvtss2sd 0x34(%rsp), %xmm0
movq %rax, %rdi
callq 0x4864d0
movb $0x9, 0x7(%rsp)
movl $0x1, %edx
movq %rax, %rdi
leaq 0x7(%rsp), %rsi
callq 0x485270
xorps %xmm0, %xmm0
cvtss2sd 0x30(%rsp), %xmm0
movq %rax, %rdi
callq 0x4864d0
movb $0x9, 0x7(%rsp)
movl $0x1, %edx
movq %rax, %rdi
leaq 0x7(%rsp), %rsi
callq 0x485270
movq 0x138(%rsp), %rsi
movq 0x140(%rsp), %rdx
movq %rax, %rdi
callq 0x485270
movb $0xa, 0x7(%rsp)
movl $0x1, %edx
movq %rax, %rdi
leaq 0x7(%rsp), %rsi
callq 0x485270
movq 0x118(%rsp), %rdi
leaq 0x128(%rsp), %rax
cmpq %rax, %rdi
je 0x40ddd7
movq 0x128(%rsp), %rsi
incq %rsi
callq 0x41ae90
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x40ddee
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x41ae90
movq %r15, %rdi
callq 0x40fe80
leaq 0x178(%rsp), %rdi
callq 0x40fe80
leaq 0x100(%rsp), %rdi
callq 0x40fe80
leaq 0x20d911(%rip), %rbx    # 0x61b728
movq %rbx, %rdi
callq 0x4fb7a0
testl %eax, %eax
jne 0x40e081
movq 0xe8(%rsp), %rax
movq 0x20d8e2(%rip), %rcx    # 0x61b718
addq %rcx, %rax
incq %rax
movq %rax, 0x20d8d5(%rip)    # 0x61b718
movq %rbx, %rdi
callq 0x4fc680
movq 0x138(%rsp), %rdi
leaq 0x148(%rsp), %rax
cmpq %rax, %rdi
je 0x40de70
movq 0x148(%rsp), %rsi
incq %rsi
callq 0x41ae90
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x40de8d
movq 0x90(%rsp), %rsi
subq %rdi, %rsi
callq 0x41ae90
movq 0xa0(%rsp), %rdi
testq %rdi, %rdi
je 0x40deaa
movq 0xb0(%rsp), %rsi
subq %rdi, %rsi
callq 0x41ae90
movq 0xe0(%rsp), %rdi
leaq 0xf0(%rsp), %rax
cmpq %rax, %rdi
je 0x40d4e3
movq 0xf0(%rsp), %rsi
incq %rsi
callq 0x41ae90
jmp 0x40d4e3
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x40deef
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x41ae90
movq $0x614fe8, %rax         # imm = 0x614FE8
movq (%rax), %rbx
movq 0x18(%rax), %r14
leaq 0x6c0(%rsp), %rdi
movq %rbx, -0x8(%rdi)
movq -0x18(%rbx), %rax
movq %r14, 0x6b8(%rsp,%rax)
callq 0x4608b0
movl $0xf8, %r15d
leaq 0x6b8(%rsp), %rdi
addq %r15, %rdi
callq 0x4677e0
leaq 0x4c0(%rsp), %rdi
movq %rbx, -0x8(%rdi)
movq -0x18(%rbx), %rax
movq %r14, 0x4b8(%rsp,%rax)
callq 0x4608b0
leaq 0x4b8(%rsp), %rdi
addq %r15, %rdi
callq 0x4677e0
leaq 0x2b0(%rsp), %rdi
callq 0x462990
leaq 0x280(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x40df8b
movq 0x280(%rsp), %rsi
incq %rsi
callq 0x41ae90
leaq 0x2a0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x40dfac
movq 0x2a0(%rsp), %rsi
incq %rsi
callq 0x41ae90
movq 0x158(%rsp), %rdi
leaq 0x168(%rsp), %rax
cmpq %rax, %rdi
je 0x40dfd1
movq 0x168(%rsp), %rsi
incq %rsi
callq 0x41ae90
movq 0x190(%rsp), %rdi
leaq 0x1a0(%rsp), %rax
cmpq %rax, %rdi
je 0x40dff6
movq 0x1a0(%rsp), %rsi
incq %rsi
callq 0x41ae90
movq 0xc0(%rsp), %rdi
leaq 0xd0(%rsp), %rax
cmpq %rax, %rdi
je 0x40e01b
movq 0xd0(%rsp), %rsi
incq %rsi
callq 0x41ae90
addq $0x8b8, %rsp            # imm = 0x8B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x10(%rsp), %rdi
leaq 0x38(%rsp), %rdx
callq 0x4100b6
jmp 0x40d4b0
leaq 0x10(%rsp), %rdi
leaq 0x38(%rsp), %rdx
callq 0x4100b6
jmp 0x40d4b0
leaq 0x10(%rsp), %rdi
leaq 0x38(%rsp), %rdx
callq 0x4100b6
jmp 0x40d4b0
leaq 0x1944db(%rip), %rdi    # 0x5a254b
callq 0x402ab8
leaq 0x1944cf(%rip), %rdi    # 0x5a254b
callq 0x402b68
movl %eax, %edi
callq 0x402db7
movl %eax, %edi
callq 0x402db7
jmp 0x40e291
jmp 0x40e291
jmp 0x40e291
jmp 0x40e291
jmp 0x40e291
movq %rax, %rbx
jmp 0x40e403
movq %rax, %rbx
jmp 0x40e410
movq %rax, %rbx
jmp 0x40e41d
movq %rax, %rbx
movq 0x1c0(%rsp), %rdi
cmpq %r14, %rdi
je 0x40e0e5
movq 0x1d0(%rsp), %rsi
incq %rsi
callq 0x41ae90
jmp 0x40e0e5
movq %rax, %rbx
movq 0x2b0(%rsp), %rdi
cmpq %r15, %rdi
je 0x40e107
movq 0x2c0(%rsp), %rsi
incq %rsi
callq 0x41ae90
jmp 0x40e107
movq %rax, %rbx
movq 0x4b8(%rsp), %rdi
cmpq %r12, %rdi
je 0x40e129
movq 0x4c8(%rsp), %rsi
incq %rsi
callq 0x41ae90
jmp 0x40e129
movq %rax, %rbx
movq 0x200(%rsp), %rdi
cmpq %r13, %rdi
je 0x40e43e
movq 0x210(%rsp), %rsi
jmp 0x40e436
movq %rax, %rbx
jmp 0x40e43e
movq %rax, %rbx
movq 0x1e0(%rsp), %rdi
cmpq %r14, %rdi
je 0x40e174
movq 0x1f0(%rsp), %rsi
incq %rsi
callq 0x41ae90
jmp 0x40e174
movq %rax, %rbx
movq 0x2b0(%rsp), %rdi
cmpq %r15, %rdi
je 0x40e196
movq 0x2c0(%rsp), %rsi
incq %rsi
callq 0x41ae90
jmp 0x40e196
movq %rax, %rbx
movq 0x4b8(%rsp), %rdi
cmpq %r12, %rdi
je 0x40e1b8
movq 0x4c8(%rsp), %rsi
incq %rsi
callq 0x41ae90
jmp 0x40e1b8
movq %rax, %rbx
movq 0x220(%rsp), %rdi
cmpq %r13, %rdi
je 0x40e45f
movq 0x230(%rsp), %rsi
jmp 0x40e457
movq %rax, %rbx
jmp 0x40e45f
movq %rax, %rbx
jmp 0x40e484
jmp 0x40e214
jmp 0x40e214
jmp 0x40e214
jmp 0x40e1ff
jmp 0x40e1ff
movq %rax, %rbx
jmp 0x40e266
jmp 0x40e2ed
jmp 0x40e291
movq %rax, %rbx
jmp 0x40e25c
jmp 0x40e328
jmp 0x40e328
jmp 0x40e214
jmp 0x40e291
jmp 0x40e214
movq %rax, %rbx
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x40e3df
movq 0x48(%rsp), %rsi
jmp 0x40e3d7
movq %rax, %rbx
movq 0x118(%rsp), %rdi
leaq 0x128(%rsp), %rax
cmpq %rax, %rdi
je 0x40e25c
movq 0x128(%rsp), %rsi
incq %rsi
callq 0x41ae90
leaq 0x38(%rsp), %rdi
callq 0x40fe5e
leaq 0x178(%rsp), %rdi
callq 0x40fe80
jmp 0x40e312
jmp 0x40e328
movq %rax, %rbx
jmp 0x40e3ba
jmp 0x40e291
jmp 0x40e323
jmp 0x40e328
movq %rax, %rbx
jmp 0x40e3df
movq %rax, %rbx
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x40e2ba
movq 0x48(%rsp), %rsi
subq %rdi, %rsi
callq 0x41ae90
jmp 0x40e2ba
jmp 0x40e2ed
movq %rax, %rbx
movq 0x240(%rsp), %rdi
testq %rdi, %rdi
je 0x40e312
movq 0x250(%rsp), %rsi
jmp 0x40e30a
movq %rax, %rbx
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x40e2f5
movq 0x48(%rsp), %rsi
subq %rdi, %rsi
callq 0x41ae90
jmp 0x40e2f5
movq %rax, %rbx
jmp 0x40e312
movq %rax, %rbx
movq 0x258(%rsp), %rdi
testq %rdi, %rdi
je 0x40e312
movq 0x268(%rsp), %rsi
subq %rdi, %rsi
callq 0x41ae90
leaq 0x100(%rsp), %rdi
callq 0x40fe80
jmp 0x40e35b
jmp 0x40e323
movq %rax, %rbx
jmp 0x40e33f
movq %rax, %rbx
jmp 0x40e35b
movq %rax, %rbx
cmpl $0x0, (%r12)
jne 0x40e33f
movl 0x34(%rsp), %eax
movl %eax, (%r12)
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x40e35b
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x41ae90
movq 0x138(%rsp), %rdi
leaq 0x148(%rsp), %rax
cmpq %rax, %rdi
je 0x40e380
movq 0x148(%rsp), %rsi
incq %rsi
callq 0x41ae90
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x40e39d
movq 0x90(%rsp), %rsi
subq %rdi, %rsi
callq 0x41ae90
movq 0xa0(%rsp), %rdi
testq %rdi, %rdi
je 0x40e3ba
movq 0xb0(%rsp), %rsi
subq %rdi, %rsi
callq 0x41ae90
movq 0xe0(%rsp), %rdi
leaq 0xf0(%rsp), %rax
cmpq %rax, %rdi
je 0x40e3df
movq 0xf0(%rsp), %rsi
incq %rsi
callq 0x41ae90
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x40e3f6
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x41ae90
leaq 0x6b8(%rsp), %rdi
callq 0x462850
leaq 0x4b8(%rsp), %rdi
callq 0x462850
leaq 0x2b0(%rsp), %rdi
callq 0x462990
leaq 0x280(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x40e43e
movq 0x280(%rsp), %rsi
incq %rsi
callq 0x41ae90
leaq 0x2a0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x40e45f
movq 0x2a0(%rsp), %rsi
incq %rsi
callq 0x41ae90
leaq 0x168(%rsp), %rax
movq 0x158(%rsp), %rdi
cmpq %rax, %rdi
je 0x40e484
movq 0x168(%rsp), %rsi
incq %rsi
callq 0x41ae90
leaq 0x1a0(%rsp), %rax
movq 0x190(%rsp), %rdi
cmpq %rax, %rdi
je 0x40e4a9
movq 0x1a0(%rsp), %rsi
incq %rsi
callq 0x41ae90
movq 0xc0(%rsp), %rdi
leaq 0xd0(%rsp), %rax
cmpq %rax, %rdi
je 0x40e4ce
movq 0xd0(%rsp), %rsi
incq %rsi
callq 0x41ae90
movq %rbx, %rdi
callq 0x4bfce0