// File: /workspace/github_cpp_makefile_star2_O2/ChnMasterOG[P]KmerGO2/kmergo/KmerGO.cpp
// Function: main
int main(int argc, char* argv[])
{

	if (argc <= 2 || help_or_version(argc, argv))
	{
		print_info();
		return EXIT_FAILURE;
	}

	int32 i;
	char char_temp[1024];
	std::string input_path = "No select", output_path = "No select";

	//------------------------------------------------------------
	// Parse input parameters
	//------------------------------------------------------------

	if (strncmp(argv[1], "kmc3", 4) == 0)
		tool = KMC3;
	else if (strncmp(argv[1], "union", 5) == 0)
		tool = UNION;
	else if (strncmp(argv[1], "filtering", 9) == 0)
		tool = FILTERING;
	else if (strncmp(argv[1], "cap3", 4) == 0)
		tool = CAP3;
	else if (strncmp(argv[1], "all", 3) == 0)
	{
		param.single_step = false;
		tool = ALL;
	}

	if (tool == NO_SELECTED)
	{
		std::cout << "KmerGO ver. " << KMERGO_VER << " (" << KMERGO_DATE << ")\n"
			<< "Error! <tool> is required and is one of {kmc3,union,filtering,cap3,all}.\n";
		return EXIT_FAILURE;
	}

	for (i = 2; i < argc; ++i)
	{
		if (argv[i][0] == '-')
		{
			if (strncmp(argv[i], "-m", 2) == 0)
				param.mode = atoi(&argv[i][3]);
			else if (strncmp(argv[i], "-k", 2) == 0)
				param.k_value = atoi(&argv[i][3]);
			else if (strncmp(argv[i], "-ci", 3) == 0)
				param.ci_value = atoi(&argv[i][4]);
			else if (strncmp(argv[i], "-cs", 3) == 0)
				param.cs_value = atoi(&argv[i][4]);
			else if (strncmp(argv[i], "-n", 2) == 0)
				param.process_number = atoi(&argv[i][3]);
			else if (strncmp(argv[i], "-p", 2) == 0)
				param.p_value = atof(&argv[i][3]);
			else if (strncmp(argv[i], "-assl", 5) == 0)
				param.assl = atof(&argv[i][6]);
			else if (strncmp(argv[i], "-assn", 5) == 0)
				param.assn = atof(&argv[i][6]);
			else if (strncmp(argv[i], "-corr", 5) == 0)
				param.corr_vaule = atof(&argv[i][6]);
			else if (strncmp(argv[i], "-i", 2) == 0)
			{
				strcpy(char_temp, &argv[i][3]);
				input_path = char_temp;
				//if (input_path.compare(input_path.length() - 1, 1, "/", 0, 1) != 0) input_path = input_path + "/";
			}
			else if (strncmp(argv[i], "-o", 2) == 0)
			{
				strcpy(char_temp, &argv[i][3]);
				output_path = char_temp;
				//if (output_path.compare(output_path.length() - 1, 1, "/", 0, 1) != 0) output_path = output_path + "/";
			}
			else if (strncmp(argv[i], "-t", 2) == 0)
			{
				strcpy(char_temp, &argv[i][3]);
				param.csv_path = char_temp;
			}
			else if (strncmp(argv[i], "-e", 2) == 0)
			{
				strcpy(char_temp, &argv[i][3]);
				param.temp_path = char_temp;
				//if (param.temp_path.compare(param.temp_path.length() - 1, 1, "/", 0, 1) != 0) param.temp_path = param.temp_path + "/";
			}
			else
			{
				std::cout << "KmerGO ver. " << KMERGO_VER << " (" << KMERGO_DATE << ")\n"
					<< "Error! Can not read some parameters.\n";
				return EXIT_FAILURE;
			}
		}
	}

	if (input_path == "No select" or output_path == "No select")
	{
		std::cout << "KmerGO ver. " << KMERGO_VER << " (" << KMERGO_DATE << ")\n"
			<< "Error! input files path and output files path are required.\n";
		return EXIT_FAILURE;
	}

	switch (tool)
	{
	case KMC3:
		param.samples_path = input_path;
		param.kmercountings_path = output_path;
		break;
	case UNION:
		param.kmercountings_path = input_path;
		param.matrixes_path = output_path;
		break;
	case FILTERING:
		param.matrixes_path = input_path;
		param.features_path = output_path;
		break;
	case CAP3:
		param.features_path = input_path;
		param.results_path = output_path;
		break;
	case ALL:
		param.samples_path = input_path;
		param.kmercountings_path = joinPath(param.temp_path, "kmer_countings/");
		param.matrixes_path = joinPath(param.temp_path, "kmer_matrixes/");
		param.features_path = joinPath(param.temp_path, "kmer_features/");
		param.results_path = output_path;
		// create folder
		if (system(("mkdir " + param.kmercountings_path).c_str()))
		{
			std::cout << "Error: mkdir" << std::endl;
		}
		if (system(("mkdir " + param.matrixes_path).c_str()))
		{
			std::cout << "Error: mkdir" << std::endl;
		}
		if (system(("mkdir " + param.features_path).c_str()))
		{
			std::cout << "Error: mkdir" << std::endl;
		}
	case NO_SELECTED:
		;
	}

	//------------------------------------------------------------
	// Read CSV
	//------------------------------------------------------------

	bool csv_err = false;
	if (tool == FILTERING || tool == ALL)
	{
		std::cout << "read CSV..." << "\n";
		csv_err = !Read_CSV(param.csv_path, param.trait_information_map);
		if (csv_err)
		{
			std::cout << "KmerGO ver. " << KMERGO_VER << " (" << KMERGO_DATE << ")\n"
				<< "Error! Can't not read the csv file.\n";
			return EXIT_FAILURE;
		}
		if (param.trait_information_map.size() <= 1)
		{
			std::cout << "KmerGO ver. " << KMERGO_VER << " (" << KMERGO_DATE << ")\n"
				<< "Error! Sample number is too small.\n";
			return EXIT_FAILURE;
		}
		if (param.mode == 1)
		{
			param.groupA_name = "";
			param.groupA_number = param.trait_information_map.size();
		}
		else
		{
			param.groupA_name = param.trait_information_map.begin()->second;
			param.groupB_name = "";
			std::map<std::string, std::string>::iterator it;
			for (it = param.trait_information_map.begin(); it != param.trait_information_map.end(); it++) {
				if (!param.groupA_name.compare(it->second)) param.groupA_number++;
				else if (param.groupB_name.compare(it->second) && param.groupB_name.empty())
				{
					param.groupB_name = it->second;
					param.groupB_number++;
				}
				else if (!param.groupB_name.compare(it->second)) param.groupB_number++;
				else 
				{
					std::cout << "KmerGO ver. " << KMERGO_VER << " (" << KMERGO_DATE << ")\n"
						<< "Error! More than 2 groups of data.\n";
					return EXIT_FAILURE;
				}
			}
		}
	}

	//------------------------------------------------------------
	// Run KmerGO
	//------------------------------------------------------------

	///////////////////////////////////////////////////////
	////////////////////////Module 1///////////////////////
	//////////////////////////KMC3/////////////////////////
	///////////////////////////////////////////////////////
	if (tool == KMC3 || tool == ALL)
	{
		std::cout << "runing KMC3..." << "\n";
		if (kmer_counting(param, loginfo))
		{
			std::cout << "KmerGO ver. " << KMERGO_VER << " (" << KMERGO_DATE << ")\n"
				<< "KMC3 step error! \n" << loginfo << "\n";
			return EXIT_FAILURE;
		}
	}

	///////////////////////////////////////////////////////
	////////////////////////Module 2///////////////////////
	/////////////////////////Union/////////////////////////
	///////////////////////////////////////////////////////
	if (tool == UNION || tool == ALL)
	{
		std::cout << "runing UNION..." << "\n";
		if (kmer_union(param, loginfo))
		{
			std::cout << "KmerGO ver. " << KMERGO_VER << " (" << KMERGO_DATE << ")\n"
				<< "Union step error! \n" << loginfo << "\n";
			return EXIT_FAILURE;
		}
	}

	////////////////////////Module 5///////////////////////
	/////////////////Add PCA function here/////////////////
	/////////Read k-mer matrix and calculate PCA///////////
	/* Add code here. */

	///////////////////////////////////////////////////////
	////////////////////////Module 3///////////////////////
	///////////////////////Filtering///////////////////////
	///////////////////////////////////////////////////////
	if (tool == FILTERING || tool == ALL)
	{
		std::cout << "runing FILTERING..." << "\n";
		if (kmer_filtering(param, loginfo))
		{
			std::cout << "KmerGO ver. " << KMERGO_VER << " (" << KMERGO_DATE << ")\n"
				<< "Filtering step error! \n" << loginfo << "\n";
			return EXIT_FAILURE;
		}
	}

	///////////////////////////////////////////////////////
	////////////////////////Module 4///////////////////////
	//////////////////////////CAP3/////////////////////////
	///////////////////////////////////////////////////////
	if (tool == CAP3 || tool == ALL)
	{
		std::cout << "runing CAP3..." << "\n";
		if (kmer_assembly(param, loginfo))
		{
			std::cout << "KmerGO ver. " << KMERGO_VER << " (" << KMERGO_DATE << ")\n"
				<< "CAP3 step error! \n" << loginfo << "\n";
			return EXIT_FAILURE;
		}
	}

	return EXIT_SUCCESS;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x558, %rsp            # imm = 0x558
cmpl $0x3, %edi
jl 0x40ee0f
movq %rsi, %rbx
movl %edi, %ebp
callq 0x40ebe0
testb %al, %al
je 0x40ee1c
callq 0x40ec9b
pushq $0x1
popq %rbx
jmp 0x40f9cc
leaq 0x18de29(%rip), %r14    # 0x59cc4c
leaq 0x30(%rsp), %rdi
leaq 0x50(%rsp), %rdx
movq %r14, %rsi
callq 0x405d40
leaq 0x50(%rsp), %rdi
leaq 0x10(%rsp), %rdx
movq %r14, %rsi
callq 0x405d40
movq 0x8(%rbx), %r12
leaq 0x18de04(%rip), %rsi    # 0x59cc56
pushq $0x4
popq %rdx
movq %r12, %rdi
callq 0x401048
testl %eax, %eax
je 0x40eec9
leaq 0x18ddf3(%rip), %rsi    # 0x59cc5b
pushq $0x5
popq %rdx
movq %r12, %rdi
callq 0x401048
testl %eax, %eax
je 0x40eecd
leaq 0x18dde3(%rip), %rsi    # 0x59cc61
pushq $0x9
popq %rdx
movq %r12, %rdi
callq 0x401048
testl %eax, %eax
je 0x40eed1
leaq 0x18ddd7(%rip), %rsi    # 0x59cc6b
pushq $0x4
popq %rdx
movq %r12, %rdi
callq 0x401048
testl %eax, %eax
je 0x40ef39
cmpb $0x61, (%r12)
jne 0x40eed5
cmpb $0x6c, 0x1(%r12)
jne 0x40eed5
cmpb $0x6c, 0x2(%r12)
jne 0x40eed5
movb $0x0, 0x20799b(%rip)    # 0x616860
pushq $0x5
jmp 0x40ef3b
pushq $0x1
jmp 0x40ef3b
pushq $0x2
jmp 0x40ef3b
pushq $0x3
jmp 0x40ef3b
cmpl $0x0, 0x207880(%rip)    # 0x61675c
jne 0x40ef42
movq $0x1b6c960, %rdi        # imm = 0x1B6C960
leaq 0x18d949(%rip), %rsi    # 0x59c835
callq 0x47de40
leaq 0x18d94a(%rip), %rsi    # 0x59c842
movq %rax, %rdi
callq 0x47de40
leaq 0x192b42(%rip), %rsi    # 0x5a1a49
movq %rax, %rdi
callq 0x47de40
leaq 0x18d932(%rip), %rsi    # 0x59c848
movq %rax, %rdi
callq 0x47de40
leaq 0x18da89(%rip), %rsi    # 0x59c9ae
movq %rax, %rdi
callq 0x47de40
leaq 0x18dd3c(%rip), %rsi    # 0x59cc70
jmp 0x40f1ae
pushq $0x4
popq %rax
movl %eax, 0x20781a(%rip)    # 0x61675c
movl %ebp, %r15d
pushq $0x2
popq %r12
leaq 0x18dd6b(%rip), %r14    # 0x59ccbb
pushq $0x5
popq %r13
cmpq %r15, %r12
jae 0x40f12e
movq (%rbx,%r12,8), %rbp
cmpb $0x2d, (%rbp)
jne 0x40f126
cmpb $0x6d, 0x1(%rbp)
jne 0x40ef88
addq $0x3, %rbp
movq %rbp, %rdi
callq 0x4d3b70
movb %al, 0x2077eb(%rip)     # 0x61676e
jmp 0x40f126
cmpb $0x6b, 0x1(%rbp)
jne 0x40efa6
addq $0x3, %rbp
movq %rbp, %rdi
callq 0x4d3b70
movw %ax, 0x2077bf(%rip)     # 0x616760
jmp 0x40f126
cmpb $0x63, 0x1(%rbp)
jne 0x40efc9
cmpb $0x69, 0x2(%rbp)
jne 0x40efc9
addq $0x4, %rbp
movq %rbp, %rdi
callq 0x4d3b70
movl %eax, 0x2077a0(%rip)    # 0x616764
jmp 0x40f126
cmpb $0x63, 0x1(%rbp)
jne 0x40efec
cmpb $0x73, 0x2(%rbp)
jne 0x40efec
addq $0x4, %rbp
movq %rbp, %rdi
callq 0x4d3b70
movl %eax, 0x207781(%rip)    # 0x616768
jmp 0x40f126
cmpb $0x6e, 0x1(%rbp)
jne 0x40f00a
addq $0x3, %rbp
movq %rbp, %rdi
callq 0x4d3b70
movw %ax, 0x207767(%rip)     # 0x61676c
jmp 0x40f126
cmpb $0x70, 0x1(%rbp)
jne 0x40f02d
addq $0x3, %rbp
movq %rbp, %rdi
callq 0x4d3b60
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x20774c(%rip)   # 0x616774
jmp 0x40f126
movq %rbp, %rdi
movq %r14, %rsi
movq %r13, %rdx
callq 0x401048
testl %eax, %eax
je 0x40f0da
movq %rbp, %rdi
leaq 0x18dc74(%rip), %rsi    # 0x59ccc1
movq %r13, %rdx
callq 0x401048
testl %eax, %eax
je 0x40f0f4
movq %rbp, %rdi
leaq 0x18dc60(%rip), %rsi    # 0x59ccc7
movq %r13, %rdx
callq 0x401048
testl %eax, %eax
je 0x40f10e
cmpb $0x69, 0x1(%rbp)
leaq 0x30(%rsp), %r14
je 0x40f0ab
cmpb $0x6f, 0x1(%rbp)
leaq 0x50(%rsp), %r14
je 0x40f0ab
cmpb $0x74, 0x1(%rbp)
leaq 0x2077a8(%rip), %r14    # 0x616840
je 0x40f0ab
cmpb $0x65, 0x1(%rbp)
leaq 0x20777b(%rip), %r14    # 0x616820
jne 0x40fa43
addq $0x3, %rbp
leaq 0x150(%rsp), %r13
movq %r13, %rdi
movq %rbp, %rsi
callq 0x4010a0
movq %r14, %rdi
movq %r13, %rsi
callq 0x4851c0
leaq 0x18dbe7(%rip), %r14    # 0x59ccbb
pushq $0x5
popq %r13
jmp 0x40f126
addq $0x6, %rbp
movq %rbp, %rdi
callq 0x4d3b60
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x20767e(%rip)   # 0x616770
jmp 0x40f126
addq $0x6, %rbp
movq %rbp, %rdi
callq 0x4d3b60
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x20766c(%rip)   # 0x616778
jmp 0x40f126
addq $0x6, %rbp
movq %rbp, %rdi
callq 0x4d3b60
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x207656(%rip)   # 0x61677c
incq %r12
jmp 0x40ef54
leaq 0x18db17(%rip), %rsi    # 0x59cc4c
leaq 0x30(%rsp), %rdi
callq 0x40fd35
testb %al, %al
jne 0x40f158
leaq 0x18db02(%rip), %rsi    # 0x59cc4c
leaq 0x50(%rsp), %rdi
callq 0x40fd35
testb %al, %al
je 0x40f1bb
movq $0x1b6c960, %rdi        # imm = 0x1B6C960
leaq 0x18d6cf(%rip), %rsi    # 0x59c835
callq 0x47de40
leaq 0x18d6d0(%rip), %rsi    # 0x59c842
movq %rax, %rdi
callq 0x47de40
leaq 0x1928c8(%rip), %rsi    # 0x5a1a49
movq %rax, %rdi
callq 0x47de40
leaq 0x18d6b8(%rip), %rsi    # 0x59c848
movq %rax, %rdi
callq 0x47de40
leaq 0x18d80f(%rip), %rsi    # 0x59c9ae
movq %rax, %rdi
callq 0x47de40
leaq 0x18db45(%rip), %rsi    # 0x59ccf3
movq %rax, %rdi
callq 0x47de40
jmp 0x40f9b5
movl 0x20759b(%rip), %eax    # 0x61675c
leal -0x1(%rax), %ecx
cmpl $0x4, %ecx
ja 0x40f4d8
leaq 0x18d63c(%rip), %rax    # 0x59c810
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
leaq 0x20759c(%rip), %rdi    # 0x616780
leaq 0x30(%rsp), %rsi
callq 0x483e40
leaq 0x2075ab(%rip), %rdi    # 0x6167a0
jmp 0x40f4c8
leaq 0x20757f(%rip), %rdi    # 0x616780
leaq 0x30(%rsp), %rsi
callq 0x483e40
leaq 0x20760e(%rip), %rsi    # 0x616820
leaq 0x130(%rsp), %rdi
callq 0x486820
leaq 0x18db0a(%rip), %rsi    # 0x59cd30
leaq 0x110(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x405d40
leaq 0x10(%rsp), %rdi
leaq 0x130(%rsp), %rsi
leaq 0x110(%rsp), %rdx
callq 0x405fcb
leaq 0x207547(%rip), %rdi    # 0x6167a0
leaq 0x10(%rsp), %rbx
movq %rbx, %rsi
callq 0x484260
movq %rbx, %rdi
callq 0x484210
leaq 0x110(%rsp), %rdi
callq 0x484210
leaq 0x130(%rsp), %rdi
callq 0x484210
leaq 0x207591(%rip), %rsi    # 0x616820
leaq 0xf0(%rsp), %rdi
callq 0x486820
leaq 0x18da9d(%rip), %rsi    # 0x59cd40
leaq 0xd0(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x405d40
leaq 0x10(%rsp), %rdi
leaq 0xf0(%rsp), %rsi
leaq 0xd0(%rsp), %rdx
callq 0x405fcb
leaq 0x2074ea(%rip), %rdi    # 0x6167c0
leaq 0x10(%rsp), %rbx
movq %rbx, %rsi
callq 0x484260
movq %rbx, %rdi
callq 0x484210
leaq 0xd0(%rsp), %rdi
callq 0x484210
leaq 0xf0(%rsp), %rdi
callq 0x484210
leaq 0x207514(%rip), %rsi    # 0x616820
leaq 0xb0(%rsp), %rdi
callq 0x486820
leaq 0x18da2f(%rip), %rsi    # 0x59cd4f
leaq 0x90(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x405d40
leaq 0x10(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
leaq 0x90(%rsp), %rdx
callq 0x405fcb
leaq 0x20748d(%rip), %rdi    # 0x6167e0
leaq 0x10(%rsp), %rbx
movq %rbx, %rsi
callq 0x484260
movq %rbx, %rdi
callq 0x484210
leaq 0x90(%rsp), %rdi
callq 0x484210
leaq 0xb0(%rsp), %rdi
callq 0x484210
leaq 0x207477(%rip), %rdi    # 0x616800
leaq 0x50(%rsp), %rsi
callq 0x483e40
leaq 0x18d9c4(%rip), %rsi    # 0x59cd5e
leaq 0x2073ff(%rip), %rdx    # 0x6167a0
leaq 0x10(%rsp), %rdi
callq 0x408269
movq 0x10(%rsp), %rdi
callq 0x4de250
movl %eax, %ebx
leaq 0x10(%rsp), %rdi
callq 0x484210
testl %ebx, %ebx
je 0x40f3e0
movq $0x1b6c960, %rdi        # imm = 0x1B6C960
leaq 0x18d992(%rip), %rsi    # 0x59cd65
callq 0x47de40
movq %rax, %rdi
callq 0x47d720
leaq 0x18d977(%rip), %rsi    # 0x59cd5e
leaq 0x2073d2(%rip), %rdx    # 0x6167c0
leaq 0x10(%rsp), %rdi
callq 0x408269
movq 0x10(%rsp), %rdi
callq 0x4de250
movl %eax, %ebx
leaq 0x10(%rsp), %rdi
callq 0x484210
testl %ebx, %ebx
je 0x40f42d
movq $0x1b6c960, %rdi        # imm = 0x1B6C960
leaq 0x18d945(%rip), %rsi    # 0x59cd65
callq 0x47de40
movq %rax, %rdi
callq 0x47d720
leaq 0x18d92a(%rip), %rsi    # 0x59cd5e
leaq 0x2073a5(%rip), %rdx    # 0x6167e0
leaq 0x10(%rsp), %rdi
callq 0x408269
movq 0x10(%rsp), %rdi
callq 0x4de250
movl %eax, %ebx
leaq 0x10(%rsp), %rdi
callq 0x484210
testl %ebx, %ebx
je 0x40f4d2
movq $0x1b6c960, %rdi        # imm = 0x1B6C960
leaq 0x18d8f8(%rip), %rsi    # 0x59cd65
callq 0x47de40
movq %rax, %rdi
callq 0x47d720
jmp 0x40f4d2
leaq 0x20733d(%rip), %rdi    # 0x6167c0
leaq 0x30(%rsp), %rsi
callq 0x483e40
leaq 0x20734c(%rip), %rdi    # 0x6167e0
jmp 0x40f4c8
leaq 0x207343(%rip), %rdi    # 0x6167e0
leaq 0x30(%rsp), %rsi
callq 0x483e40
leaq 0x207352(%rip), %rdi    # 0x616800
jmp 0x40f4c8
leaq 0x2072e9(%rip), %rdi    # 0x6167a0
leaq 0x30(%rsp), %rsi
callq 0x483e40
leaq 0x2072f8(%rip), %rdi    # 0x6167c0
leaq 0x50(%rsp), %rsi
callq 0x483e40
movl 0x207284(%rip), %eax    # 0x61675c
cmpl $0x5, %eax
je 0x40f4e6
cmpl $0x3, %eax
jne 0x40f62a
movq $0x1b6c960, %rdi        # imm = 0x1B6C960
leaq 0x18d87e(%rip), %rsi    # 0x59cd72
callq 0x47de40
leaq 0x197f8a(%rip), %rsi    # 0x5a748a
movq %rax, %rdi
callq 0x47de40
leaq 0x207331(%rip), %rsi    # 0x616840
leaq 0x70(%rsp), %rdi
callq 0x486820
leaq 0x207398(%rip), %rsi    # 0x6168b8
leaq 0x70(%rsp), %rdi
callq 0x40e0ec
movl %eax, %ebx
leaq 0x70(%rsp), %rdi
callq 0x484210
testb %bl, %bl
je 0x40f5a3
cmpq $0x1, 0x20739e(%rip)    # 0x6168e0
ja 0x40f5fe
movq $0x1b6c960, %rdi        # imm = 0x1B6C960
leaq 0x18d2df(%rip), %rsi    # 0x59c835
callq 0x47de40
leaq 0x18d2e0(%rip), %rsi    # 0x59c842
movq %rax, %rdi
callq 0x47de40
leaq 0x1924d8(%rip), %rsi    # 0x5a1a49
movq %rax, %rdi
callq 0x47de40
leaq 0x18d2c8(%rip), %rsi    # 0x59c848
movq %rax, %rdi
callq 0x47de40
leaq 0x18d41f(%rip), %rsi    # 0x59c9ae
movq %rax, %rdi
callq 0x47de40
leaq 0x18d805(%rip), %rsi    # 0x59cda3
jmp 0x40f9ad
movq $0x1b6c960, %rdi        # imm = 0x1B6C960
leaq 0x18d284(%rip), %rsi    # 0x59c835
callq 0x47de40
leaq 0x18d285(%rip), %rsi    # 0x59c842
movq %rax, %rdi
callq 0x47de40
leaq 0x19247d(%rip), %rsi    # 0x5a1a49
movq %rax, %rdi
callq 0x47de40
leaq 0x18d26d(%rip), %rsi    # 0x59c848
movq %rax, %rdi
callq 0x47de40
leaq 0x18d3c4(%rip), %rsi    # 0x59c9ae
movq %rax, %rdi
callq 0x47de40
leaq 0x18d785(%rip), %rsi    # 0x59cd7e
jmp 0x40f9ad
cmpb $0x1, 0x207169(%rip)    # 0x61676e
jne 0x40f780
leaq 0x207256(%rip), %rdi    # 0x616868
leaq 0x1b1891(%rip), %rsi    # 0x5c0eaa
callq 0x4851c0
movl 0x2072bc(%rip), %eax    # 0x6168e0
movl %eax, 0x20725e(%rip)    # 0x616888
movl 0x20712c(%rip), %eax    # 0x61675c
movl %eax, %ecx
andl $-0x5, %ecx
cmpl $0x1, %ecx
jne 0x40f6d9
movq $0x1b6c960, %rdi        # imm = 0x1B6C960
leaq 0x18d79f(%rip), %rsi    # 0x59cdeb
callq 0x47de40
leaq 0x197e32(%rip), %rsi    # 0x5a748a
movq %rax, %rdi
callq 0x47de40
leaq 0x2070f9(%rip), %rdi    # 0x616760
leaq 0x20727a(%rip), %rsi    # 0x6168e8
callq 0x404a58
testw %ax, %ax
je 0x40f6d3
movq $0x1b6c960, %rdi        # imm = 0x1B6C960
leaq 0x18d1af(%rip), %rsi    # 0x59c835
callq 0x47de40
leaq 0x18d1b0(%rip), %rsi    # 0x59c842
movq %rax, %rdi
callq 0x47de40
leaq 0x1923a8(%rip), %rsi    # 0x5a1a49
movq %rax, %rdi
callq 0x47de40
leaq 0x18d198(%rip), %rsi    # 0x59c848
movq %rax, %rdi
callq 0x47de40
leaq 0x18d2ef(%rip), %rsi    # 0x59c9ae
movq %rax, %rdi
callq 0x47de40
leaq 0x18d72c(%rip), %rsi    # 0x59cdfa
jmp 0x40f98f
movl 0x207083(%rip), %eax    # 0x61675c
cmpl $0x5, %eax
je 0x40f6e7
cmpl $0x2, %eax
jne 0x40f848
movq $0x1b6c960, %rdi        # imm = 0x1B6C960
leaq 0x18d718(%rip), %rsi    # 0x59ce0d
callq 0x47de40
leaq 0x197d89(%rip), %rsi    # 0x5a748a
movq %rax, %rdi
callq 0x47de40
leaq 0x207050(%rip), %rdi    # 0x616760
leaq 0x2071d1(%rip), %rsi    # 0x6168e8
callq 0x40755b
testw %ax, %ax
je 0x40f842
movq $0x1b6c960, %rdi        # imm = 0x1B6C960
leaq 0x18d102(%rip), %rsi    # 0x59c835
callq 0x47de40
leaq 0x18d103(%rip), %rsi    # 0x59c842
movq %rax, %rdi
callq 0x47de40
leaq 0x1922fb(%rip), %rsi    # 0x5a1a49
movq %rax, %rdi
callq 0x47de40
leaq 0x18d0eb(%rip), %rsi    # 0x59c848
movq %rax, %rdi
callq 0x47de40
leaq 0x18d242(%rip), %rsi    # 0x59c9ae
movq %rax, %rdi
callq 0x47de40
leaq 0x18d6a2(%rip), %rsi    # 0x59ce1d
jmp 0x40f98f
movq 0x207149(%rip), %rsi    # 0x6168d0
addq $0x40, %rsi
leaq 0x2070d6(%rip), %rdi    # 0x616868
callq 0x483e40
leaq 0x2070f2(%rip), %rdi    # 0x616890
leaq 0x1b1705(%rip), %rsi    # 0x5c0eaa
callq 0x4851c0
movq 0x20711f(%rip), %r14    # 0x6168d0
leaq 0x207108(%rip), %r13    # 0x6168c0
leaq 0x2070a9(%rip), %rbx    # 0x616868
leaq 0x2070c2(%rip), %rbp    # 0x616888
leaq 0x2070c3(%rip), %r15    # 0x616890
cmpq %r13, %r14
je 0x40f62a
leaq 0x40(%r14), %r12
movq %rbx, %rdi
movq %r12, %rsi
callq 0x486270
movq %rbp, %rcx
testl %eax, %eax
je 0x40f833
movq %r15, %rdi
movq %r12, %rsi
callq 0x486270
testl %eax, %eax
je 0x40f819
cmpq $0x0, 0x207095(%rip)    # 0x616898
jne 0x40f819
movq %r15, %rdi
movq %r12, %rsi
callq 0x483e40
leaq 0x207099(%rip), %rcx    # 0x6168b0
jmp 0x40f833
movq %r15, %rdi
movq %r12, %rsi
callq 0x486270
leaq 0x207085(%rip), %rcx    # 0x6168b0
testl %eax, %eax
jne 0x40f9e0
incl (%rcx)
movq %r14, %rdi
callq 0x41cc20
movq %rax, %r14
jmp 0x40f7cd
movl 0x206f14(%rip), %eax    # 0x61675c
cmpl $0x5, %eax
je 0x40f856
cmpl $0x3, %eax
jne 0x40f8f1
movq $0x1b6c960, %rdi        # imm = 0x1B6C960
leaq 0x18d5cd(%rip), %rsi    # 0x59ce31
callq 0x47de40
leaq 0x197c1a(%rip), %rsi    # 0x5a748a
movq %rax, %rdi
callq 0x47de40
leaq 0x206ee1(%rip), %rdi    # 0x616760
leaq 0x207062(%rip), %rsi    # 0x6168e8
callq 0x40b5c6
testw %ax, %ax
je 0x40f8eb
movq $0x1b6c960, %rdi        # imm = 0x1B6C960
leaq 0x18cf97(%rip), %rsi    # 0x59c835
callq 0x47de40
leaq 0x18cf98(%rip), %rsi    # 0x59c842
movq %rax, %rdi
callq 0x47de40
leaq 0x192190(%rip), %rsi    # 0x5a1a49
movq %rax, %rdi
callq 0x47de40
leaq 0x18cf80(%rip), %rsi    # 0x59c848
movq %rax, %rdi
callq 0x47de40
leaq 0x18d0d7(%rip), %rsi    # 0x59c9ae
movq %rax, %rdi
callq 0x47de40
leaq 0x18d55f(%rip), %rsi    # 0x59ce45
jmp 0x40f98f
movl 0x206e6b(%rip), %eax    # 0x61675c
andl $-0x2, %eax
xorl %ebx, %ebx
cmpl $0x4, %eax
jne 0x40f9b8
movq $0x1b6c960, %rdi        # imm = 0x1B6C960
leaq 0x18d550(%rip), %rsi    # 0x59ce5d
callq 0x47de40
leaq 0x197b71(%rip), %rsi    # 0x5a748a
movq %rax, %rdi
callq 0x47de40
leaq 0x206e38(%rip), %rdi    # 0x616760
leaq 0x206fb9(%rip), %rsi    # 0x6168e8
callq 0x40cbb4
testw %ax, %ax
je 0x40f9b8
movq $0x1b6c960, %rdi        # imm = 0x1B6C960
leaq 0x18ceee(%rip), %rsi    # 0x59c835
callq 0x47de40
leaq 0x18ceef(%rip), %rsi    # 0x59c842
movq %rax, %rdi
callq 0x47de40
leaq 0x1920e7(%rip), %rsi    # 0x5a1a49
movq %rax, %rdi
callq 0x47de40
leaq 0x18ced7(%rip), %rsi    # 0x59c848
movq %rax, %rdi
callq 0x47de40
leaq 0x18d02e(%rip), %rsi    # 0x59c9ae
movq %rax, %rdi
callq 0x47de40
leaq 0x18d4dd(%rip), %rsi    # 0x59ce6c
movq %rax, %rdi
callq 0x47de40
leaq 0x206f4a(%rip), %rsi    # 0x6168e8
movq %rax, %rdi
callq 0x486ac0
leaq 0x197add(%rip), %rsi    # 0x5a748a
movq %rax, %rdi
callq 0x47de40
pushq $0x1
popq %rbx
leaq 0x50(%rsp), %rdi
callq 0x484210
leaq 0x30(%rsp), %rdi
callq 0x484210
movl %ebx, %eax
addq $0x558, %rsp            # imm = 0x558
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq $0x1b6c960, %rdi        # imm = 0x1B6C960
leaq 0x18ce47(%rip), %rsi    # 0x59c835
callq 0x47de40
leaq 0x18ce48(%rip), %rsi    # 0x59c842
movq %rax, %rdi
callq 0x47de40
leaq 0x192040(%rip), %rsi    # 0x5a1a49
movq %rax, %rdi
callq 0x47de40
leaq 0x18ce30(%rip), %rsi    # 0x59c848
movq %rax, %rdi
callq 0x47de40
leaq 0x18cf87(%rip), %rsi    # 0x59c9ae
movq %rax, %rdi
callq 0x47de40
leaq 0x18d391(%rip), %rsi    # 0x59cdc7
movq %rax, %rdi
callq 0x47de40
jmp 0x40f9b5
movq $0x1b6c960, %rdi        # imm = 0x1B6C960
leaq 0x18cde4(%rip), %rsi    # 0x59c835
callq 0x47de40
leaq 0x18cde5(%rip), %rsi    # 0x59c842
movq %rax, %rdi
callq 0x47de40
leaq 0x191fdd(%rip), %rsi    # 0x5a1a49
movq %rax, %rdi
callq 0x47de40
leaq 0x18cdcd(%rip), %rsi    # 0x59c848
movq %rax, %rdi
callq 0x47de40
leaq 0x18cf24(%rip), %rsi    # 0x59c9ae
movq %rax, %rdi
callq 0x47de40
leaq 0x18d234(%rip), %rsi    # 0x59cccd
jmp 0x40f1ae
jmp 0x40fb3f
jmp 0x40fb3f
jmp 0x40fab6
jmp 0x40fb3f
jmp 0x40fab6
jmp 0x40fb3f
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
jmp 0x40fb2f
jmp 0x40fb3f
movq %rax, %rbx
leaq 0x90(%rsp), %rdi
callq 0x484210
jmp 0x40fad7
movq %rax, %rbx
leaq 0xb0(%rsp), %rdi
jmp 0x40fb2f
jmp 0x40fb3f
movq %rax, %rbx
leaq 0xd0(%rsp), %rdi
callq 0x484210
jmp 0x40faf8
movq %rax, %rbx
leaq 0xf0(%rsp), %rdi
jmp 0x40fb2f
jmp 0x40fb3f
movq %rax, %rbx
leaq 0x110(%rsp), %rdi
callq 0x484210
jmp 0x40fb19
movq %rax, %rbx
leaq 0x130(%rsp), %rdi
jmp 0x40fb2f
jmp 0x40fb3f
jmp 0x40fb3f
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
callq 0x484210
jmp 0x40fb42
movq %rax, %rbx
jmp 0x40fb4c
jmp 0x40fb3f
jmp 0x40fb3f
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x484210
leaq 0x30(%rsp), %rdi
callq 0x484210
movq %rbx, %rdi
callq 0x4b8e10