// File: /workspace/github_cpp_makefile_star2_O1/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 0xe0(%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 0x40805e
leaq 0x230(%rsp), %r13
movq %r13, -0x10(%r13)
movq 0x80(%r14), %rsi
movq %r14, 0x68(%rsp)
movq 0x88(%r14), %rdx
addq %rsi, %rdx
leaq 0x220(%rsp), %rdi
callq 0x40805e
movzwl %bx, %ebp
movl $0x1, %r14d
cmpw $0xa, %bp
jb 0x40d035
movl $0x2, %r14d
cmpw $0x64, %bx
jb 0x40d035
movl $0x3, %r14d
cmpl $0x3e8, %ebp            # imm = 0x3E8
jb 0x40d035
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 0x48b9e0
leaq 0x4b8(%rsp), %r15
movq (%r15), %rdi
movl %r14d, %esi
movl %ebp, %edx
callq 0x407ff1
leaq 0x196469(%rip), %rcx    # 0x5a34dc
movl $0xe, %r8d
movq %r15, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x48d070
leaq 0x2c0(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x40d0b5
movq %rdx, 0x2b0(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x2c0(%rsp)
jmp 0x40d0bc
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 0x1961da(%rip), %rsi    # 0x5a32bc
callq 0x48d830
leaq 0x1f0(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x40d117
movq %rdx, 0x1e0(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x1f0(%rsp)
jmp 0x40d11e
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 0x407b32
movq 0x1e0(%rsp), %rdi
cmpq %r14, %rdi
je 0x40d16f
movq 0x1f0(%rsp), %rsi
incq %rsi
callq 0x41b3a0
movq 0x2b0(%rsp), %rdi
cmpq %r15, %rdi
je 0x40d18c
movq 0x2c0(%rsp), %rsi
incq %rsi
callq 0x41b3a0
movq 0x4b8(%rsp), %rdi
cmpq %r12, %rdi
je 0x40d1a9
movq 0x4c8(%rsp), %rsi
incq %rsi
callq 0x41b3a0
movq 0x220(%rsp), %rdi
cmpq %r13, %rdi
je 0x40d1c6
movq 0x230(%rsp), %rsi
incq %rsi
callq 0x41b3a0
leaq 0x210(%rsp), %r13
movq %r13, -0x10(%r13)
movq 0x68(%rsp), %rax
movq 0x80(%rax), %rsi
movq 0x88(%rax), %rdx
addq %rsi, %rdx
leaq 0x200(%rsp), %rdi
callq 0x40805e
movl $0x1, %r14d
cmpw $0xa, %bx
jb 0x40d22b
movl $0x2, %r14d
cmpw $0x64, %bx
jb 0x40d22b
movl $0x3, %r14d
cmpl $0x3e8, %ebp            # imm = 0x3E8
jb 0x40d22b
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 0x48b9e0
leaq 0x4b8(%rsp), %rbx
movq (%rbx), %rdi
movl %r14d, %esi
movl %ebp, %edx
callq 0x407ff1
leaq 0x19628c(%rip), %rcx    # 0x5a34eb
movl $0xe, %r8d
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x48d070
movq %r15, 0x2b0(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x40d29d
movq %rdx, 0x2b0(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x2c0(%rsp)
jmp 0x40d2a4
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 0x195ff2(%rip), %rsi    # 0x5a32bc
callq 0x48d830
leaq 0x1d0(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x40d2ff
movq %rdx, 0x1c0(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x1d0(%rsp)
jmp 0x40d306
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 0x407b32
movq 0x1c0(%rsp), %rdi
cmpq %r14, %rdi
je 0x40d357
movq 0x1d0(%rsp), %rsi
incq %rsi
callq 0x41b3a0
movq 0x2b0(%rsp), %rdi
cmpq %r15, %rdi
je 0x40d374
movq 0x2c0(%rsp), %rsi
incq %rsi
callq 0x41b3a0
movq 0x4b8(%rsp), %rdi
cmpq %r12, %rdi
je 0x40d391
movq 0x4c8(%rsp), %rsi
incq %rsi
callq 0x41b3a0
movq 0x200(%rsp), %rdi
cmpq %r13, %rdi
je 0x40d3ae
movq 0x210(%rsp), %rsi
incq %rsi
callq 0x41b3a0
leaq 0x2b0(%rsp), %rbx
leaq 0x158(%rsp), %rsi
movq %rbx, %rdi
movl $0x8, %edx
callq 0x462170
leaq 0x4b8(%rsp), %rdi
leaq 0x290(%rsp), %rsi
movl $0x10, %edx
callq 0x4622e0
leaq 0x6b8(%rsp), %rdi
leaq 0x270(%rsp), %rsi
movl $0x10, %edx
callq 0x4622e0
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 0x4668d0
movsbl %al, %edx
leaq 0x2b0(%rsp), %rdi
leaq 0xd0(%rsp), %rsi
callq 0x41d5a0
leaq 0x20f2e0(%rip), %rdi    # 0x61c728
callq 0x4fbcf0
testl %eax, %eax
jne 0x40e395
movq 0xd8(%rsp), %rax
movq 0x20f2b4(%rip), %rcx    # 0x61c718
addq %rcx, %rax
incq %rax
movq %rax, 0x20f2a7(%rip)    # 0x61c718
leaq 0x20f2b0(%rip), %rdi    # 0x61c728
callq 0x4fcbd0
movq 0xd0(%rsp), %rsi
movq 0xd8(%rsp), %rdx
leaq 0x4b8(%rsp), %rdi
callq 0x485780
leaq 0x196059(%rip), %rsi    # 0x5a34fa
movl $0xb, %edx
movq %rax, %rdi
callq 0x485780
movq 0xd0(%rsp), %rsi
movq 0xd8(%rsp), %rdx
leaq 0x6b8(%rsp), %rdi
callq 0x485780
leaq 0x196034(%rip), %rsi    # 0x5a3506
movl $0x15, %edx
movq %rax, %rdi
callq 0x485780
leaq 0x196036(%rip), %rsi    # 0x5a351c
leaq 0xd0(%rsp), %rbx
movl $0x1, %ecx
movq %rbx, %rdi
xorl %edx, %edx
callq 0x48daf0
leaq 0x1(%rax), %rdx
leaq 0x30(%rsp), %rdi
movq %rbx, %rsi
movq $-0x1, %rcx
callq 0x48e8b0
leaq 0xd0(%rsp), %rdi
leaq 0x30(%rsp), %rbx
movq %rbx, %rsi
callq 0x48c0d0
movq (%rbx), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x40d544
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x41b3a0
leaq 0x195fd1(%rip), %rsi    # 0x5a351c
leaq 0xd0(%rsp), %rdi
movl $0x1, %ecx
xorl %edx, %edx
callq 0x48daf0
cmpq $-0x1, %rax
je 0x40d704
movq %rax, %r13
movq 0x68(%rsp), %rax
leaq 0x158(%rax), %rbx
leaq 0x160(%rax), %r14
addq $0x108, %rax            # imm = 0x108
movq %rax, 0x8(%rsp)
leaq 0x30(%rsp), %r15
leaq 0xd0(%rsp), %r12
leaq 0xf0(%rsp), %rbp
movq %r15, %rdi
movq %r12, %rsi
xorl %edx, %edx
movq %r13, %rcx
callq 0x48e8b0
movq %rbx, %rdi
movq %r15, %rsi
callq 0x410394
cmpq %r14, %rax
je 0x40d5fc
movq %rbx, %rdi
movq %r15, %rsi
callq 0x40b06a
movq %rax, %rdi
movq 0x8(%rsp), %rsi
callq 0x48e0e0
testl %eax, %eax
je 0x40d61d
movw $0x1, 0xf0(%rsp)
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x40d6ce
movw $0x1, (%rsi)
jmp 0x40d63c
movw $0xffff, 0xf0(%rsp)     # imm = 0xFFFF
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x40d6e0
movw $0xffff, (%rsi)         # imm = 0xFFFF
jmp 0x40d63c
movw $0x0, 0xf0(%rsp)
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x40d6f2
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 0x48e8b0
movq %r12, %rdi
movq %rbp, %rsi
callq 0x48c0d0
movq 0xf0(%rsp), %rdi
leaq 0x100(%rsp), %rax
cmpq %rax, %rdi
je 0x40d68d
movq 0x100(%rsp), %rsi
incq %rsi
callq 0x41b3a0
movl $0x1, %ecx
movq %r12, %rdi
leaq 0x195e80(%rip), %rsi    # 0x5a351c
xorl %edx, %edx
callq 0x48daf0
movq %rax, %r13
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x40d6c2
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x41b3a0
cmpq $-0x1, %r13
jne 0x40d59f
jmp 0x40d704
leaq 0x10(%rsp), %rdi
movq %rbp, %rdx
callq 0x4103da
jmp 0x40d645
leaq 0x10(%rsp), %rdi
movq %rbp, %rdx
callq 0x4103da
jmp 0x40d645
leaq 0x10(%rsp), %rdi
movq %rbp, %rdx
callq 0x4103da
jmp 0x40d645
movq 0x68(%rsp), %r14
leaq 0x158(%r14), %rbx
leaq 0xd0(%rsp), %rsi
movq %rbx, %rdi
callq 0x410394
leaq 0x2b0(%rsp), %r12
leaq 0x160(%r14), %rcx
cmpq %rcx, %rax
je 0x40d775
leaq 0xd0(%rsp), %rsi
movq %rbx, %rdi
callq 0x40b06a
leaq 0x108(%r14), %rsi
movq %rax, %rdi
callq 0x48e0e0
testl %eax, %eax
je 0x40d793
movw $0x1, 0x30(%rsp)
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x40e33a
movw $0x1, (%rsi)
jmp 0x40d7af
movw $0xffff, 0x30(%rsp)     # imm = 0xFFFF
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x40e34e
movw $0xffff, (%rsi)         # imm = 0xFFFF
jmp 0x40d7af
movw $0x0, 0x30(%rsp)
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x40e362
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 0xd0(%rsp), %r13
leaq 0x30(%rsp), %rbp
leaq 0x70(%rsp), %r14
movq 0x2b0(%rsp), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x4668d0
movsbl %al, %edx
movq %r12, %rdi
movq %r13, %rsi
callq 0x41d5a0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x40e1e5
leaq 0x100(%rsp), %rax
movq %rax, 0xf0(%rsp)
movq 0xd0(%rsp), %rsi
movq 0xd8(%rsp), %rdx
addq %rsi, %rdx
leaq 0xf0(%rsp), %rdi
callq 0x40805e
movl $0x1, %ecx
movq %r13, %rdi
leaq 0x195cbc(%rip), %rsi    # 0x5a351c
xorl %edx, %edx
callq 0x48daf0
leaq 0x1(%rax), %rdx
movq %rbp, %rdi
movq %r13, %rsi
movq $-0x1, %rcx
callq 0x48e8b0
movq %r13, %rdi
movq %rbp, %rsi
callq 0x48c0d0
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x40d8a4
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x41b3a0
movl $0x1, %ecx
movq %r13, %rdi
leaq 0x195c69(%rip), %rsi    # 0x5a351c
xorl %edx, %edx
callq 0x48daf0
movq %rax, %rbx
xorl %ecx, %ecx
movq %rcx, 0xc0(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0xb0(%rsp)
movq %rcx, 0xa0(%rsp)
movaps %xmm0, 0x90(%rsp)
leaq 0x140(%rsp), %rax
movq %rax, 0x130(%rsp)
movq %rcx, 0x138(%rsp)
movb $0x0, 0x140(%rsp)
cmpq $-0x1, %rbx
je 0x40dae9
xorl %ebp, %ebp
movl $0x0, 0x2c(%rsp)
movl $0x0, 0x8(%rsp)
leaq 0x30(%rsp), %rdi
movq %r13, %rsi
xorl %edx, %edx
movq %rbx, %rcx
callq 0x48e8b0
movq 0x30(%rsp), %r12
callq 0x4c5370
movq %rax, %r15
movq %r14, %rsi
movl (%rax), %r14d
movl $0x0, (%rax)
movq %r12, %rdi
callq 0x4dc8a0
cmpq %r12, 0x70(%rsp)
je 0x40e376
movl (%r15), %eax
testl %eax, %eax
je 0x40d96d
cmpl $0x22, %eax
jne 0x40d970
jmp 0x40e382
movl %r14d, (%r15)
movss %xmm0, 0x110(%rsp)
movq 0x10(%rsp), %rax
movzwl (%rax,%rbp), %eax
cmpl $0x1, %eax
je 0x40d9c0
testl %eax, %eax
leaq 0x2b0(%rsp), %r12
leaq 0x70(%rsp), %r14
jne 0x40da4b
movq 0xb8(%rsp), %rsi
cmpq 0xc0(%rsp), %rsi
je 0x40d9f1
movss %xmm0, (%rsi)
addq $0x4, %rsi
movq %rsi, 0xb8(%rsp)
jmp 0x40da06
movq 0x98(%rsp), %rsi
cmpq 0xa0(%rsp), %rsi
leaq 0x2b0(%rsp), %r12
leaq 0x70(%rsp), %r14
je 0x40da1e
movss %xmm0, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x98(%rsp)
jmp 0x40da33
leaq 0xb0(%rsp), %rdi
leaq 0x110(%rsp), %rdx
callq 0x410512
movss 0x110(%rsp), %xmm0
ucomiss 0x195ac2(%rip), %xmm0   # 0x5a34d8
jbe 0x40da4b
incl 0x2c(%rsp)
jmp 0x40da4b
leaq 0x90(%rsp), %rdi
leaq 0x110(%rsp), %rdx
callq 0x410512
movss 0x110(%rsp), %xmm0
ucomiss 0x195a95(%rip), %xmm0   # 0x5a34d8
jne 0x40da4b
jp 0x40da4b
incl 0x8(%rsp)
incq %rbx
movq %r14, %rdi
movq %r13, %rsi
movq %rbx, %rdx
movq $-0x1, %rcx
callq 0x48e8b0
movq %r13, %rdi
movq %r14, %rsi
callq 0x48c0d0
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0x40da90
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x41b3a0
movl $0x1, %ecx
movq %r13, %rdi
leaq 0x195a7d(%rip), %rsi    # 0x5a351c
xorl %edx, %edx
callq 0x48daf0
movq %rax, %rbx
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x40dac5
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x41b3a0
addq $0x2, %rbp
cmpq $-0x1, %rbx
jne 0x40d91e
cvtsi2ssl 0x2c(%rsp), %xmm3
xorps %xmm0, %xmm0
cvtsi2ssl 0x8(%rsp), %xmm0
leaq 0x30(%rsp), %rbp
jmp 0x40daef
xorps %xmm0, %xmm0
xorps %xmm3, %xmm3
movq 0xb8(%rsp), %rax
subq 0xb0(%rsp), %rax
sarq $0x2, %rax
js 0x40db0c
cvtsi2ss %rax, %xmm1
jmp 0x40db21
movq %rax, %rcx
shrq %rcx
andl $0x1, %eax
orq %rcx, %rax
cvtsi2ss %rax, %xmm1
addss %xmm1, %xmm1
movq 0x98(%rsp), %rax
subq 0x90(%rsp), %rax
sarq $0x2, %rax
js 0x40db3e
cvtsi2ss %rax, %xmm2
jmp 0x40db53
movq %rax, %rcx
shrq %rcx
andl $0x1, %eax
orq %rcx, %rax
cvtsi2ss %rax, %xmm2
addss %xmm2, %xmm2
divss %xmm2, %xmm0
divss %xmm1, %xmm3
addss %xmm0, %xmm3
movss 0x195969(%rip), %xmm0   # 0x5a34d0
mulss %xmm0, %xmm3
movss %xmm3, 0x8(%rsp)
ucomiss %xmm0, %xmm3
jbe 0x40db8d
leaq 0x130(%rsp), %rdi
movq 0x1b0(%rsp), %rsi
callq 0x48bcb0
jmp 0x40dbb6
leaq 0x130(%rsp), %rdi
movq 0x1b8(%rsp), %rsi
callq 0x48bcb0
movss 0x19592a(%rip), %xmm0   # 0x5a34d4
subss 0x8(%rsp), %xmm0
movss %xmm0, 0x8(%rsp)
movq 0x68(%rsp), %rax
movss 0x8(%rsp), %xmm0
ucomiss 0x10(%rax), %xmm0
jae 0x40dcbc
leaq 0xb0(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0x41a233
movq 0x68(%rsp), %rax
movss 0x14(%rax), %xmm1
ucomiss %xmm0, %xmm1
leaq 0x20eb34(%rip), %rbx    # 0x61c728
jbe 0x40e124
movss %xmm0, 0x2c(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x110(%rsp)
movq $0x0, 0x120(%rsp)
movq 0xb0(%rsp), %rbx
movq 0xb8(%rsp), %r14
cmpq %r14, %rbx
je 0x40dd97
movss (%rbx), %xmm0
movss %xmm0, 0x70(%rsp)
movl $0x1, %edx
leaq 0x258(%rsp), %r15
movq %r15, %rdi
leaq 0x70(%rsp), %rsi
leaq 0x178(%rsp), %rcx
callq 0x4100a8
movq %rbp, %rdi
movq %r15, %rsi
callq 0x40c0a2
movl $0x0, 0x48(%rsp)
leaq 0x110(%rsp), %rdi
movq %rbp, %rsi
callq 0x4106b0
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x40dc96
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x41b3a0
movq 0x258(%rsp), %rdi
testq %rdi, %rdi
je 0x40dcb3
movq 0x268(%rsp), %rsi
subq %rdi, %rsi
callq 0x41b3a0
addq $0x4, %rbx
jmp 0x40dc27
movq 0xf0(%rsp), %rsi
movq 0xf8(%rsp), %rdx
leaq 0x4b8(%rsp), %rdi
callq 0x485780
movb $0x9, 0x30(%rsp)
movl $0x1, %edx
movq %rax, %rdi
movq %rbp, %rsi
callq 0x485780
movq %rax, %rbx
xorps %xmm0, %xmm0
cvtss2sd 0x8(%rsp), %xmm0
movl $0x3a, %edx
movq %rbp, %rdi
movq $0x4f3270, %rsi         # imm = 0x4F3270
leaq 0x1ba27c(%rip), %rcx    # 0x5c7f8c
movb $0x1, %al
callq 0x4102e2
movq 0x30(%rsp), %rsi
movq 0x38(%rsp), %rdx
movq %rbx, %rdi
callq 0x485780
movb $0x9, 0x70(%rsp)
movl $0x1, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x485780
movq 0x130(%rsp), %rsi
movq 0x138(%rsp), %rdx
movq %rax, %rdi
callq 0x485780
movb $0xa, 0x70(%rsp)
movl $0x1, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x485780
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
leaq 0x20e9a9(%rip), %rbx    # 0x61c728
je 0x40e124
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x41b3a0
jmp 0x40e124
movq 0x90(%rsp), %rbx
movq 0x98(%rsp), %r14
cmpq %r14, %rbx
je 0x40de3c
movss (%rbx), %xmm0
movss %xmm0, 0x70(%rsp)
movl $0x1, %edx
leaq 0x240(%rsp), %r15
movq %r15, %rdi
leaq 0x70(%rsp), %rsi
leaq 0x178(%rsp), %rcx
callq 0x4100a8
movq %rbp, %rdi
movq %r15, %rsi
callq 0x40c0a2
movl $0x1, 0x48(%rsp)
leaq 0x110(%rsp), %rdi
movq %rbp, %rsi
callq 0x4106b0
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x40de16
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x41b3a0
movq 0x240(%rsp), %rdi
testq %rdi, %rdi
je 0x40de33
movq 0x250(%rsp), %rsi
subq %rdi, %rsi
callq 0x41b3a0
addq $0x4, %rbx
jmp 0x40dda7
leaq 0x178(%rsp), %rdi
leaq 0x110(%rsp), %rbx
movq %rbx, %rsi
callq 0x4100ee
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x41a92c
leaq 0x70(%rsp), %r14
movq %rbp, %rdi
callq 0x41aa76
movq %rbp, %rdi
leaq 0x178(%rsp), %rsi
callq 0x41b102
movq 0xb0(%rsp), %rcx
movq 0xb8(%rsp), %rdx
movq %rdx, %rax
subq %rcx, %rax
sarq $0x2, %rax
xorps %xmm0, %xmm0
xorps %xmm3, %xmm3
cmpq %rcx, %rdx
je 0x40deec
movq 0x178(%rsp), %rdi
xorl %esi, %esi
movl $0x18, %r8d
movl $0x1, %r9d
movq 0x110(%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 0x40debf
xorps %xmm3, %xmm3
cvtsi2ss %esi, %xmm3
leaq 0x110(%rsp), %rbx
cmpq %rcx, %rdx
je 0x40df34
movq 0x178(%rsp), %rdx
xorl %ecx, %ecx
movl $0x18, %esi
movl $0x1, %edi
movq 0x110(%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 0x40df0d
xorps %xmm0, %xmm0
cvtsi2ss %ecx, %xmm0
testq %rax, %rax
js 0x40df43
xorps %xmm1, %xmm1
cvtsi2ss %rax, %xmm1
jmp 0x40df5b
movq %rax, %rcx
shrq %rcx
andl $0x1, %eax
orq %rcx, %rax
xorps %xmm1, %xmm1
cvtsi2ss %rax, %xmm1
addss %xmm1, %xmm1
movq 0x98(%rsp), %rax
subq 0x90(%rsp), %rax
sarq $0x2, %rax
js 0x40df78
cvtsi2ss %rax, %xmm2
jmp 0x40df8d
movq %rax, %rcx
shrq %rcx
andl $0x1, %eax
orq %rcx, %rax
cvtsi2ss %rax, %xmm2
addss %xmm2, %xmm2
divss %xmm2, %xmm0
divss %xmm1, %xmm3
addss %xmm0, %xmm3
mulss 0x19552f(%rip), %xmm3   # 0x5a34d0
movq 0x68(%rsp), %rax
ucomiss 0x18(%rax), %xmm3
jb 0x40e0e9
movss %xmm3, 0x154(%rsp)
movq 0xf0(%rsp), %rsi
movq 0xf8(%rsp), %rdx
leaq 0x6b8(%rsp), %rdi
callq 0x485780
movb $0x9, 0x70(%rsp)
movl $0x1, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x485780
movq %rax, %rbx
xorps %xmm0, %xmm0
cvtss2sd 0x8(%rsp), %xmm0
movl $0x3a, %edx
movq %r14, %rdi
movq $0x4f3270, %rsi         # imm = 0x4F3270
leaq 0x1b9f7f(%rip), %rcx    # 0x5c7f8c
movb $0x1, %al
callq 0x4102e2
movq 0x70(%rsp), %rsi
movq 0x78(%rsp), %rdx
movq %rbx, %rdi
callq 0x485780
movb $0x9, 0x7(%rsp)
movl $0x1, %edx
movq %rax, %rdi
leaq 0x7(%rsp), %rsi
callq 0x485780
xorps %xmm0, %xmm0
cvtss2sd 0x2c(%rsp), %xmm0
movq %rax, %rdi
callq 0x4869e0
movb $0x9, 0x7(%rsp)
movl $0x1, %edx
movq %rax, %rdi
leaq 0x7(%rsp), %rsi
callq 0x485780
xorps %xmm0, %xmm0
cvtss2sd 0x154(%rsp), %xmm0
movq %rax, %rdi
callq 0x4869e0
movb $0x9, 0x7(%rsp)
movl $0x1, %edx
movq %rax, %rdi
leaq 0x7(%rsp), %rsi
callq 0x485780
movq 0x130(%rsp), %rsi
movq 0x138(%rsp), %rdx
movq %rax, %rdi
callq 0x485780
movb $0xa, 0x7(%rsp)
movl $0x1, %edx
movq %rax, %rdi
leaq 0x7(%rsp), %rsi
callq 0x485780
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
leaq 0x110(%rsp), %rbx
je 0x40e0e9
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x41b3a0
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0x40e100
movq 0x58(%rsp), %rsi
subq %rdi, %rsi
callq 0x41b3a0
movq %rbp, %rdi
callq 0x41019a
leaq 0x178(%rsp), %rdi
callq 0x41019a
movq %rbx, %rdi
callq 0x41019a
leaq 0x20e604(%rip), %rbx    # 0x61c728
movq %rbx, %rdi
callq 0x4fbcf0
testl %eax, %eax
jne 0x40e38e
movq 0xf8(%rsp), %rax
movq 0x20e5d5(%rip), %rcx    # 0x61c718
addq %rcx, %rax
incq %rax
movq %rax, 0x20e5c8(%rip)    # 0x61c718
movq %rbx, %rdi
callq 0x4fcbd0
movq 0x130(%rsp), %rdi
leaq 0x140(%rsp), %rax
cmpq %rax, %rdi
je 0x40e17d
movq 0x140(%rsp), %rsi
incq %rsi
callq 0x41b3a0
movq 0x90(%rsp), %rdi
testq %rdi, %rdi
je 0x40e19a
movq 0xa0(%rsp), %rsi
subq %rdi, %rsi
callq 0x41b3a0
movq 0xb0(%rsp), %rdi
testq %rdi, %rdi
je 0x40e1b7
movq 0xc0(%rsp), %rsi
subq %rdi, %rsi
callq 0x41b3a0
movq 0xf0(%rsp), %rdi
leaq 0x100(%rsp), %rax
cmpq %rax, %rdi
je 0x40d7e8
movq 0x100(%rsp), %rsi
incq %rsi
callq 0x41b3a0
jmp 0x40d7e8
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x40e1fc
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x41b3a0
movq $0x615fe8, %rax         # imm = 0x615FE8
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 0x460dc0
movl $0xf8, %r15d
leaq 0x6b8(%rsp), %rdi
addq %r15, %rdi
callq 0x467cf0
leaq 0x4c0(%rsp), %rdi
movq %rbx, -0x8(%rdi)
movq -0x18(%rbx), %rax
movq %r14, 0x4b8(%rsp,%rax)
callq 0x460dc0
leaq 0x4b8(%rsp), %rdi
addq %r15, %rdi
callq 0x467cf0
leaq 0x2b0(%rsp), %rdi
callq 0x462ea0
leaq 0x280(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x40e298
movq 0x280(%rsp), %rsi
incq %rsi
callq 0x41b3a0
leaq 0x2a0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x40e2b9
movq 0x2a0(%rsp), %rsi
incq %rsi
callq 0x41b3a0
movq 0x158(%rsp), %rdi
leaq 0x168(%rsp), %rax
cmpq %rax, %rdi
je 0x40e2de
movq 0x168(%rsp), %rsi
incq %rsi
callq 0x41b3a0
movq 0x190(%rsp), %rdi
leaq 0x1a0(%rsp), %rax
cmpq %rax, %rdi
je 0x40e303
movq 0x1a0(%rsp), %rsi
incq %rsi
callq 0x41b3a0
movq 0xd0(%rsp), %rdi
leaq 0xe0(%rsp), %rax
cmpq %rax, %rdi
je 0x40e328
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x41b3a0
addq $0x8b8, %rsp            # imm = 0x8B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x10(%rsp), %rdi
leaq 0x30(%rsp), %rdx
callq 0x4103da
jmp 0x40d7b8
leaq 0x10(%rsp), %rdi
leaq 0x30(%rsp), %rdx
callq 0x4103da
jmp 0x40d7b8
leaq 0x10(%rsp), %rdi
leaq 0x30(%rsp), %rdx
callq 0x4103da
jmp 0x40d7b8
leaq 0x1951ca(%rip), %rdi    # 0x5a3547
callq 0x402ab8
leaq 0x1951be(%rip), %rdi    # 0x5a3547
callq 0x402b68
movl %eax, %edi
callq 0x402db7
movl %eax, %edi
callq 0x402db7
jmp 0x40e59b
jmp 0x40e59b
jmp 0x40e59b
jmp 0x40e59b
jmp 0x40e59b
movq %rax, %rbx
jmp 0x40e707
movq %rax, %rbx
jmp 0x40e714
movq %rax, %rbx
jmp 0x40e721
movq %rax, %rbx
movq 0x1c0(%rsp), %rdi
cmpq %r14, %rdi
je 0x40e3f2
movq 0x1d0(%rsp), %rsi
incq %rsi
callq 0x41b3a0
jmp 0x40e3f2
movq %rax, %rbx
movq 0x2b0(%rsp), %rdi
cmpq %r15, %rdi
je 0x40e414
movq 0x2c0(%rsp), %rsi
incq %rsi
callq 0x41b3a0
jmp 0x40e414
movq %rax, %rbx
movq 0x4b8(%rsp), %rdi
cmpq %r12, %rdi
je 0x40e436
movq 0x4c8(%rsp), %rsi
incq %rsi
callq 0x41b3a0
jmp 0x40e436
movq %rax, %rbx
movq 0x200(%rsp), %rdi
cmpq %r13, %rdi
je 0x40e742
movq 0x210(%rsp), %rsi
jmp 0x40e73a
movq %rax, %rbx
jmp 0x40e742
movq %rax, %rbx
movq 0x1e0(%rsp), %rdi
cmpq %r14, %rdi
je 0x40e481
movq 0x1f0(%rsp), %rsi
incq %rsi
callq 0x41b3a0
jmp 0x40e481
movq %rax, %rbx
movq 0x2b0(%rsp), %rdi
cmpq %r15, %rdi
je 0x40e4a3
movq 0x2c0(%rsp), %rsi
incq %rsi
callq 0x41b3a0
jmp 0x40e4a3
movq %rax, %rbx
movq 0x4b8(%rsp), %rdi
cmpq %r12, %rdi
je 0x40e4c5
movq 0x4c8(%rsp), %rsi
incq %rsi
callq 0x41b3a0
jmp 0x40e4c5
movq %rax, %rbx
movq 0x220(%rsp), %rdi
cmpq %r13, %rdi
je 0x40e763
movq 0x230(%rsp), %rsi
jmp 0x40e75b
movq %rax, %rbx
jmp 0x40e763
movq %rax, %rbx
jmp 0x40e788
jmp 0x40e521
jmp 0x40e521
jmp 0x40e521
jmp 0x40e50c
jmp 0x40e50c
movq %rax, %rbx
jmp 0x40e570
jmp 0x40e5f7
jmp 0x40e59b
movq %rax, %rbx
jmp 0x40e566
jmp 0x40e632
jmp 0x40e632
jmp 0x40e521
jmp 0x40e59b
jmp 0x40e521
movq %rax, %rbx
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x40e6e3
movq 0x40(%rsp), %rsi
jmp 0x40e6db
movq %rax, %rbx
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0x40e566
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x41b3a0
leaq 0x30(%rsp), %rdi
callq 0x410178
leaq 0x178(%rsp), %rdi
callq 0x41019a
jmp 0x40e61c
jmp 0x40e632
movq %rax, %rbx
jmp 0x40e6be
jmp 0x40e59b
jmp 0x40e62d
jmp 0x40e632
movq %rax, %rbx
jmp 0x40e6e3
movq %rax, %rbx
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x40e5c4
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x41b3a0
jmp 0x40e5c4
jmp 0x40e5f7
movq %rax, %rbx
movq 0x240(%rsp), %rdi
testq %rdi, %rdi
je 0x40e61c
movq 0x250(%rsp), %rsi
jmp 0x40e614
movq %rax, %rbx
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x40e5ff
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x41b3a0
jmp 0x40e5ff
movq %rax, %rbx
jmp 0x40e61c
movq %rax, %rbx
movq 0x258(%rsp), %rdi
testq %rdi, %rdi
je 0x40e61c
movq 0x268(%rsp), %rsi
subq %rdi, %rsi
callq 0x41b3a0
leaq 0x110(%rsp), %rdi
callq 0x41019a
jmp 0x40e65f
jmp 0x40e62d
movq %rax, %rbx
jmp 0x40e643
movq %rax, %rbx
jmp 0x40e65f
movq %rax, %rbx
cmpl $0x0, (%r15)
jne 0x40e643
movl %r14d, (%r15)
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x40e65f
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x41b3a0
movq 0x130(%rsp), %rdi
leaq 0x140(%rsp), %rax
cmpq %rax, %rdi
je 0x40e684
movq 0x140(%rsp), %rsi
incq %rsi
callq 0x41b3a0
movq 0x90(%rsp), %rdi
testq %rdi, %rdi
je 0x40e6a1
movq 0xa0(%rsp), %rsi
subq %rdi, %rsi
callq 0x41b3a0
movq 0xb0(%rsp), %rdi
testq %rdi, %rdi
je 0x40e6be
movq 0xc0(%rsp), %rsi
subq %rdi, %rsi
callq 0x41b3a0
movq 0xf0(%rsp), %rdi
leaq 0x100(%rsp), %rax
cmpq %rax, %rdi
je 0x40e6e3
movq 0x100(%rsp), %rsi
incq %rsi
callq 0x41b3a0
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x40e6fa
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x41b3a0
leaq 0x6b8(%rsp), %rdi
callq 0x462d60
leaq 0x4b8(%rsp), %rdi
callq 0x462d60
leaq 0x2b0(%rsp), %rdi
callq 0x462ea0
leaq 0x280(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x40e742
movq 0x280(%rsp), %rsi
incq %rsi
callq 0x41b3a0
leaq 0x2a0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x40e763
movq 0x2a0(%rsp), %rsi
incq %rsi
callq 0x41b3a0
leaq 0x168(%rsp), %rax
movq 0x158(%rsp), %rdi
cmpq %rax, %rdi
je 0x40e788
movq 0x168(%rsp), %rsi
incq %rsi
callq 0x41b3a0
leaq 0x1a0(%rsp), %rax
movq 0x190(%rsp), %rdi
cmpq %rax, %rdi
je 0x40e7ad
movq 0x1a0(%rsp), %rsi
incq %rsi
callq 0x41b3a0
movq 0xd0(%rsp), %rdi
leaq 0xe0(%rsp), %rax
cmpq %rax, %rdi
je 0x40e7d2
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x41b3a0
movq %rbx, %rdi
callq 0x4c0230