// File: /workspace/github_cpp_makefile_star2_O1/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 $0x548, %rsp            # imm = 0x548
cmpl $0x3, %edi
jl 0x414ce8
movq %rsi, %rbx
movl %edi, %ebp
callq 0x4149e8
testb %al, %al
je 0x414d06
callq 0x414b03
movl $0x1, %ebx
movl %ebx, %eax
addq $0x548, %rsp            # imm = 0x548
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x30(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x18ef26(%rip), %r14    # 0x5a3c3c
leaq 0x18ef28(%rip), %r15    # 0x5a3c45
leaq 0x20(%rsp), %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x4080ee
leaq 0x50(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x40(%rsp), %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x4080ee
movq 0x8(%rbx), %r14
leaq 0x18eef5(%rip), %rsi    # 0x5a3c46
movl $0x4, %edx
movq %r14, %rdi
callq 0x401048
testl %eax, %eax
je 0x414dd0
leaq 0x18eee2(%rip), %rsi    # 0x5a3c4b
movl $0x5, %edx
movq %r14, %rdi
callq 0x401048
testl %eax, %eax
je 0x414dd7
leaq 0x18eed0(%rip), %rsi    # 0x5a3c51
movl $0x9, %edx
movq %r14, %rdi
callq 0x401048
testl %eax, %eax
je 0x414dde
leaq 0x18eec2(%rip), %rsi    # 0x5a3c5b
movl $0x4, %edx
movq %r14, %rdi
callq 0x401048
testl %eax, %eax
je 0x414de5
leaq 0x19e23f(%rip), %rsi    # 0x5b2ff0
movl $0x3, %edx
movq %r14, %rdi
callq 0x401048
testl %eax, %eax
jne 0x414df0
movb $0x0, 0x207a97(%rip)    # 0x61c860
movl $0x5, %eax
jmp 0x414dea
movl $0x1, %eax
jmp 0x414dea
movl $0x2, %eax
jmp 0x414dea
movl $0x3, %eax
jmp 0x414dea
movl $0x4, %eax
movl %eax, 0x20796c(%rip)    # 0x61c75c
cmpl $0x0, 0x207965(%rip)    # 0x61c75c
je 0x41519d
cmpl $0x4, %ebp
movl $0x3, %r13d
cmovgel %ebp, %r13d
movl $0x2, %ebp
leaq 0x18ee95(%rip), %r12    # 0x5a3cab
leaq 0x18e23a(%rip), %r15    # 0x5a3057
movq (%rbx,%rbp,8), %r14
cmpb $0x2d, (%r14)
jne 0x4150a0
movl $0x2, %edx
movq %r14, %rdi
movq %r12, %rsi
callq 0x401048
testl %eax, %eax
je 0x414fcb
movl $0x2, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x401048
testl %eax, %eax
je 0x414fe2
movl $0x3, %edx
movq %r14, %rdi
leaq 0x18e1f1(%rip), %rsi    # 0x5a305b
callq 0x401048
testl %eax, %eax
je 0x414ffa
movl $0x3, %edx
movq %r14, %rdi
leaq 0x18e1da(%rip), %rsi    # 0x5a3060
callq 0x401048
testl %eax, %eax
je 0x415011
movl $0x2, %edx
movq %r14, %rdi
leaq 0x18ee0c(%rip), %rsi    # 0x5a3cae
callq 0x401048
testl %eax, %eax
je 0x415025
movl $0x2, %edx
movq %r14, %rdi
leaq 0x18edf3(%rip), %rsi    # 0x5a3cb1
callq 0x401048
testl %eax, %eax
je 0x41503a
movl $0x5, %edx
movq %r14, %rdi
leaq 0x18edda(%rip), %rsi    # 0x5a3cb4
callq 0x401048
testl %eax, %eax
je 0x415054
movl $0x5, %edx
movq %r14, %rdi
leaq 0x18edc4(%rip), %rsi    # 0x5a3cba
callq 0x401048
testl %eax, %eax
je 0x41506e
movl $0x5, %edx
movq %r14, %rdi
leaq 0x18edae(%rip), %rsi    # 0x5a3cc0
callq 0x401048
testl %eax, %eax
je 0x415088
movl $0x2, %edx
movq %r14, %rdi
leaq 0x18ed98(%rip), %rsi    # 0x5a3cc6
callq 0x401048
leaq 0x20(%rsp), %r15
testl %eax, %eax
je 0x414f9b
movl $0x2, %edx
movq %r14, %rdi
leaq 0x18ed7e(%rip), %rsi    # 0x5a3cc9
callq 0x401048
leaq 0x40(%rsp), %r15
testl %eax, %eax
je 0x414f9b
movl $0x2, %edx
movq %r14, %rdi
leaq 0x18ed64(%rip), %rsi    # 0x5a3ccc
callq 0x401048
leaq 0x2078cc(%rip), %r15    # 0x61c840
testl %eax, %eax
je 0x414f9b
movl $0x2, %edx
movq %r14, %rdi
leaq 0x18ed48(%rip), %rsi    # 0x5a3ccf
callq 0x401048
leaq 0x20788d(%rip), %r15    # 0x61c820
testl %eax, %eax
jne 0x415da2
addq $0x3, %r14
leaq 0x140(%rsp), %rdi
movq %r14, %rsi
callq 0x4010a8
movq %r15, %rdi
leaq 0x140(%rsp), %rsi
callq 0x48d0d0
leaq 0x18e091(%rip), %r15    # 0x5a3057
jmp 0x4150a0
addq $0x3, %r14
movq %r14, %rdi
callq 0x4daf90
movb %al, 0x207791(%rip)     # 0x61c76e
jmp 0x4150a0
addq $0x3, %r14
movq %r14, %rdi
callq 0x4daf90
movw %ax, 0x20776b(%rip)     # 0x61c760
jmp 0x4150a0
addq $0x4, %r14
movq %r14, %rdi
callq 0x4daf90
movl %eax, 0x207758(%rip)    # 0x61c764
jmp 0x4150a0
addq $0x4, %r14
movq %r14, %rdi
callq 0x4daf90
movl %eax, 0x207745(%rip)    # 0x61c768
jmp 0x4150a0
addq $0x3, %r14
movq %r14, %rdi
callq 0x4daf90
movw %ax, 0x207734(%rip)     # 0x61c76c
jmp 0x4150a0
addq $0x3, %r14
movq %r14, %rdi
callq 0x4daf80
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x207722(%rip)   # 0x61c774
jmp 0x4150a0
addq $0x6, %r14
movq %r14, %rdi
callq 0x4daf80
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x207704(%rip)   # 0x61c770
jmp 0x4150a0
addq $0x6, %r14
movq %r14, %rdi
callq 0x4daf80
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x2076f2(%rip)   # 0x61c778
jmp 0x4150a0
addq $0x6, %r14
movq %r14, %rdi
callq 0x4daf80
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x2076dc(%rip)   # 0x61c77c
incq %rbp
cmpq %rbp, %r13
jne 0x414e1d
leaq 0x18eb89(%rip), %rsi    # 0x5a3c3c
leaq 0x20(%rsp), %rdi
callq 0x48e290
testl %eax, %eax
je 0x415114
leaq 0x18eb74(%rip), %rsi    # 0x5a3c3c
leaq 0x40(%rsp), %rdi
callq 0x48e290
testl %eax, %eax
je 0x415114
movl 0x207680(%rip), %eax    # 0x61c75c
decl %eax
cmpl $0x4, %eax
ja 0x415634
leaq 0x18e712(%rip), %rcx    # 0x5a3800
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x207682(%rip), %rdi    # 0x61c780
leaq 0x20(%rsp), %rsi
callq 0x48bcb0
leaq 0x207691(%rip), %rdi    # 0x61c7a0
jmp 0x41562a
movq $0x1b72960, %rdi        # imm = 0x1B72960
leaq 0x18e703(%rip), %rsi    # 0x5a3825
movl $0xc, %edx
callq 0x485780
movq $0x1b72960, %rdi        # imm = 0x1B72960
leaq 0x18e6f8(%rip), %rsi    # 0x5a3832
movl $0x5, %edx
callq 0x485780
movq $0x1b72960, %rdi        # imm = 0x1B72960
leaq 0x1938f7(%rip), %rsi    # 0x5a8a49
movl $0x2, %edx
callq 0x485780
movq $0x1b72960, %rdi        # imm = 0x1B72960
leaq 0x18e6ce(%rip), %rsi    # 0x5a3838
movl $0xa, %edx
callq 0x485780
movq $0x1b72960, %rdi        # imm = 0x1B72960
leaq 0x18e81c(%rip), %rsi    # 0x5a399e
movl $0x2, %edx
callq 0x485780
movl $0x3c, %edx
leaq 0x18eb60(%rip), %rsi    # 0x5a3cf8
jmp 0x415221
movq $0x1b72960, %rdi        # imm = 0x1B72960
leaq 0x18e67a(%rip), %rsi    # 0x5a3825
movl $0xc, %edx
callq 0x485780
movq $0x1b72960, %rdi        # imm = 0x1B72960
leaq 0x18e66f(%rip), %rsi    # 0x5a3832
movl $0x5, %edx
callq 0x485780
movq $0x1b72960, %rdi        # imm = 0x1B72960
leaq 0x19386e(%rip), %rsi    # 0x5a8a49
movl $0x2, %edx
callq 0x485780
movq $0x1b72960, %rdi        # imm = 0x1B72960
leaq 0x18e645(%rip), %rsi    # 0x5a3838
movl $0xa, %edx
callq 0x485780
movq $0x1b72960, %rdi        # imm = 0x1B72960
leaq 0x18e793(%rip), %rsi    # 0x5a399e
movl $0x2, %edx
callq 0x485780
movl $0x4a, %edx
leaq 0x18ea3f(%rip), %rsi    # 0x5a3c60
movl $0x1, %ebx
movq $0x1b72960, %rdi        # imm = 0x1B72960
callq 0x485780
jmp 0x415d61
leaq 0x207542(%rip), %rdi    # 0x61c780
leaq 0x20(%rsp), %rsi
callq 0x48bcb0
leaq 0x130(%rsp), %r15
movq %r15, -0x10(%r15)
movq 0x2075c5(%rip), %rsi    # 0x61c820
movq 0x2075c6(%rip), %rdx    # 0x61c828
addq %rsi, %rdx
leaq 0x120(%rsp), %rdi
callq 0x40805e
leaq 0x110(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x18eaaf(%rip), %rsi    # 0x5a3d35
leaq 0x18eab7(%rip), %rdx    # 0x5a3d44
leaq 0x100(%rsp), %rdi
callq 0x4080ee
movq %rsp, %rdi
leaq 0x120(%rsp), %rsi
leaq 0x100(%rsp), %rdx
callq 0x407b32
leaq 0x2074e7(%rip), %rdi    # 0x61c7a0
movq %rsp, %rbx
movq %rbx, %rsi
callq 0x48c0d0
movq (%rbx), %rdi
leaq 0x10(%rsp), %r14
cmpq %r14, %rdi
je 0x4152de
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x41b3a0
movq 0x100(%rsp), %rdi
cmpq %r12, %rdi
je 0x4152fb
movq 0x110(%rsp), %rsi
incq %rsi
callq 0x41b3a0
movq 0x120(%rsp), %rdi
cmpq %r15, %rdi
je 0x415318
movq 0x130(%rsp), %rsi
incq %rsi
callq 0x41b3a0
leaq 0xf0(%rsp), %r15
movq %r15, -0x10(%r15)
movq 0x2074f5(%rip), %rsi    # 0x61c820
movq 0x2074f6(%rip), %rdx    # 0x61c828
addq %rsi, %rdx
leaq 0xe0(%rsp), %rdi
callq 0x40805e
leaq 0xd0(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x18e9ef(%rip), %rsi    # 0x5a3d45
leaq 0x18e9f6(%rip), %rdx    # 0x5a3d53
leaq 0xc0(%rsp), %rdi
callq 0x4080ee
movq %rsp, %rdi
leaq 0xe0(%rsp), %rsi
leaq 0xc0(%rsp), %rdx
callq 0x407b32
leaq 0x207437(%rip), %rdi    # 0x61c7c0
movq %rsp, %rbx
movq %rbx, %rsi
callq 0x48c0d0
movq (%rbx), %rdi
cmpq %r14, %rdi
je 0x4153a9
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x41b3a0
movq 0xc0(%rsp), %rdi
cmpq %r12, %rdi
je 0x4153c6
movq 0xd0(%rsp), %rsi
incq %rsi
callq 0x41b3a0
movq 0xe0(%rsp), %rdi
cmpq %r15, %rdi
je 0x4153e3
movq 0xf0(%rsp), %rsi
incq %rsi
callq 0x41b3a0
leaq 0xb0(%rsp), %r15
movq %r15, -0x10(%r15)
movq 0x20742a(%rip), %rsi    # 0x61c820
movq 0x20742b(%rip), %rdx    # 0x61c828
addq %rsi, %rdx
leaq 0xa0(%rsp), %rdi
callq 0x40805e
leaq 0x90(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x18e933(%rip), %rsi    # 0x5a3d54
leaq 0x18e93a(%rip), %rdx    # 0x5a3d62
leaq 0x80(%rsp), %rdi
callq 0x4080ee
movq %rsp, %rdi
leaq 0xa0(%rsp), %rsi
leaq 0x80(%rsp), %rdx
callq 0x407b32
leaq 0x20738c(%rip), %rdi    # 0x61c7e0
movq %rsp, %rbx
movq %rbx, %rsi
callq 0x48c0d0
movq (%rbx), %rdi
cmpq %r14, %rdi
je 0x415474
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x41b3a0
movq 0x80(%rsp), %rdi
cmpq %r12, %rdi
je 0x415491
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x41b3a0
movq 0xa0(%rsp), %rdi
cmpq %r15, %rdi
je 0x4154ae
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x41b3a0
leaq 0x20734b(%rip), %rdi    # 0x61c800
leaq 0x40(%rsp), %rsi
callq 0x48bcb0
leaq 0x18e89d(%rip), %rsi    # 0x5a3d63
leaq 0x2072d3(%rip), %rdx    # 0x61c7a0
movq %rsp, %rdi
callq 0x40b0e6
movq (%rsp), %rdi
callq 0x4e5670
movl %eax, %ebx
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x4154f6
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x41b3a0
testl %ebx, %ebx
je 0x41551e
movq $0x1b72960, %rdi        # imm = 0x1B72960
leaq 0x18e862(%rip), %rsi    # 0x5a3d6a
movl $0xc, %edx
callq 0x485780
movq $0x1b72960, %rdi        # imm = 0x1B72960
callq 0x485590
leaq 0x18e83e(%rip), %rsi    # 0x5a3d63
leaq 0x207294(%rip), %rdx    # 0x61c7c0
movq %rsp, %rdi
callq 0x40b0e6
movq (%rsp), %rdi
callq 0x4e5670
movl %eax, %ebx
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x415555
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x41b3a0
testl %ebx, %ebx
je 0x41557d
movq $0x1b72960, %rdi        # imm = 0x1B72960
leaq 0x18e803(%rip), %rsi    # 0x5a3d6a
movl $0xc, %edx
callq 0x485780
movq $0x1b72960, %rdi        # imm = 0x1B72960
callq 0x485590
leaq 0x18e7df(%rip), %rsi    # 0x5a3d63
leaq 0x207255(%rip), %rdx    # 0x61c7e0
movq %rsp, %rdi
callq 0x40b0e6
movq (%rsp), %rdi
callq 0x4e5670
movl %eax, %ebx
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x4155b4
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x41b3a0
testl %ebx, %ebx
je 0x415634
movq $0x1b72960, %rdi        # imm = 0x1B72960
leaq 0x18e7a4(%rip), %rsi    # 0x5a3d6a
movl $0xc, %edx
callq 0x485780
movq $0x1b72960, %rdi        # imm = 0x1B72960
callq 0x485590
jmp 0x415634
leaq 0x2071db(%rip), %rdi    # 0x61c7c0
leaq 0x20(%rsp), %rsi
callq 0x48bcb0
leaq 0x2071ea(%rip), %rdi    # 0x61c7e0
jmp 0x41562a
leaq 0x2071e1(%rip), %rdi    # 0x61c7e0
leaq 0x20(%rsp), %rsi
callq 0x48bcb0
leaq 0x2071f0(%rip), %rdi    # 0x61c800
jmp 0x41562a
leaq 0x207187(%rip), %rdi    # 0x61c7a0
leaq 0x20(%rsp), %rsi
callq 0x48bcb0
leaq 0x207196(%rip), %rdi    # 0x61c7c0
leaq 0x40(%rsp), %rsi
callq 0x48bcb0
movl 0x207122(%rip), %eax    # 0x61c75c
cmpl $0x5, %eax
je 0x415648
cmpl $0x3, %eax
jne 0x415982
movq $0x1b72960, %rdi        # imm = 0x1B72960
leaq 0x18e721(%rip), %rsi    # 0x5a3d77
movl $0xb, %edx
callq 0x485780
movq $0x1b72960, %rdi        # imm = 0x1B72960
leaq 0x198e1c(%rip), %rsi    # 0x5ae48a
movl $0x1, %edx
callq 0x485780
leaq 0x70(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x2071b8(%rip), %rsi    # 0x61c840
movq 0x2071b9(%rip), %rdx    # 0x61c848
addq %rsi, %rdx
leaq 0x60(%rsp), %rdi
callq 0x40805e
leaq 0x207215(%rip), %rsi    # 0x61c8b8
leaq 0x60(%rsp), %rdi
callq 0x413ca4
movl %eax, %ebx
movq 0x60(%rsp), %rdi
cmpq %r14, %rdi
je 0x4156c6
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x41b3a0
testb %bl, %bl
je 0x415764
cmpq $0x1, 0x20720a(%rip)    # 0x61c8e0
ja 0x4157ec
movq $0x1b72960, %rdi        # imm = 0x1B72960
leaq 0x18e13b(%rip), %rsi    # 0x5a3825
movl $0xc, %edx
callq 0x485780
movq $0x1b72960, %rdi        # imm = 0x1B72960
leaq 0x18e130(%rip), %rsi    # 0x5a3832
movl $0x5, %edx
callq 0x485780
movq $0x1b72960, %rdi        # imm = 0x1B72960
leaq 0x19332f(%rip), %rsi    # 0x5a8a49
movl $0x2, %edx
callq 0x485780
movq $0x1b72960, %r14        # imm = 0x1B72960
leaq 0x18e106(%rip), %rsi    # 0x5a3838
movl $0xa, %edx
movq %r14, %rdi
callq 0x485780
leaq 0x18e258(%rip), %rsi    # 0x5a399e
movl $0x2, %edx
movq %r14, %rdi
callq 0x485780
movl $0x23, %edx
leaq 0x18e649(%rip), %rsi    # 0x5a3da8
jmp 0x415d54
movq $0x1b72960, %rdi        # imm = 0x1B72960
leaq 0x18e0b3(%rip), %rsi    # 0x5a3825
movl $0xc, %edx
callq 0x485780
movq $0x1b72960, %rdi        # imm = 0x1B72960
leaq 0x18e0a8(%rip), %rsi    # 0x5a3832
movl $0x5, %edx
callq 0x485780
movq $0x1b72960, %rdi        # imm = 0x1B72960
leaq 0x1932a7(%rip), %rsi    # 0x5a8a49
movl $0x2, %edx
callq 0x485780
movq $0x1b72960, %r14        # imm = 0x1B72960
leaq 0x18e07e(%rip), %rsi    # 0x5a3838
movl $0xa, %edx
movq %r14, %rdi
callq 0x485780
leaq 0x18e1d0(%rip), %rsi    # 0x5a399e
movl $0x2, %edx
movq %r14, %rdi
callq 0x485780
movl $0x24, %edx
leaq 0x18e59c(%rip), %rsi    # 0x5a3d83
jmp 0x415d54
cmpb $0x1, 0x206f7b(%rip)    # 0x61c76e
jne 0x415819
leaq 0x20706c(%rip), %rdi    # 0x61c868
leaq 0x1b26a7(%rip), %rsi    # 0x5c7eaa
callq 0x48d0d0
movl 0x2070d2(%rip), %eax    # 0x61c8e0
movl %eax, 0x207074(%rip)    # 0x61c888
jmp 0x415982
movq 0x2070b0(%rip), %rsi    # 0x61c8d0
addq $0x40, %rsi
leaq 0x20703d(%rip), %rdi    # 0x61c868
callq 0x48bcb0
leaq 0x207059(%rip), %rdi    # 0x61c890
leaq 0x1b266c(%rip), %rsi    # 0x5c7eaa
callq 0x48d0d0
movq 0x207086(%rip), %r14    # 0x61c8d0
leaq 0x20706f(%rip), %r15    # 0x61c8c0
xorl %ebx, %ebx
cmpq %r15, %r14
sete %bpl
je 0x415978
leaq 0x207029(%rip), %r12    # 0x61c890
leaq 0x40(%r14), %r13
leaq 0x206ff6(%rip), %rdi    # 0x61c868
movq %r13, %rsi
callq 0x48e0e0
leaq 0x207007(%rip), %rcx    # 0x61c888
testl %eax, %eax
je 0x4158c8
movq %r12, %rdi
movq %r13, %rsi
callq 0x48e0e0
testl %eax, %eax
je 0x4158b2
cmpq $0x0, 0x206ffc(%rip)    # 0x61c898
jne 0x4158b2
movq %r12, %rdi
movq %r13, %rsi
callq 0x48bcb0
leaq 0x207000(%rip), %rcx    # 0x61c8b0
jmp 0x4158c8
movq %r12, %rdi
movq %r13, %rsi
callq 0x48e0e0
leaq 0x206fec(%rip), %rcx    # 0x61c8b0
testl %eax, %eax
jne 0x4158e3
incl (%rcx)
movq %r14, %rdi
callq 0x424a90
movq %rax, %r14
cmpq %r15, %rax
sete %bpl
jne 0x415867
jmp 0x415978
movq $0x1b72960, %rdi        # imm = 0x1B72960
leaq 0x18df34(%rip), %rsi    # 0x5a3825
movl $0xc, %edx
callq 0x485780
movq $0x1b72960, %rdi        # imm = 0x1B72960
leaq 0x18df29(%rip), %rsi    # 0x5a3832
movl $0x5, %edx
callq 0x485780
movq $0x1b72960, %rdi        # imm = 0x1B72960
leaq 0x193128(%rip), %rsi    # 0x5a8a49
movl $0x2, %edx
callq 0x485780
movq $0x1b72960, %rdi        # imm = 0x1B72960
leaq 0x18deff(%rip), %rsi    # 0x5a3838
movl $0xa, %edx
callq 0x485780
movq $0x1b72960, %rdi        # imm = 0x1B72960
leaq 0x18e04d(%rip), %rsi    # 0x5a399e
movl $0x2, %edx
callq 0x485780
movl $0x1, %ebx
movq $0x1b72960, %rdi        # imm = 0x1B72960
leaq 0x18e45e(%rip), %rsi    # 0x5a3dcc
movl $0x23, %edx
callq 0x485780
testb $0x1, %bpl
je 0x415d61
movl 0x206dd4(%rip), %eax    # 0x61c75c
andl $-0x5, %eax
cmpl $0x1, %eax
jne 0x415a69
movq $0x1b72960, %rdi        # imm = 0x1B72960
leaq 0x18e44e(%rip), %rsi    # 0x5a3df0
movl $0xe, %edx
callq 0x485780
movq $0x1b72960, %rdi        # imm = 0x1B72960
leaq 0x198ad0(%rip), %rsi    # 0x5ae48a
movl $0x1, %edx
callq 0x485780
leaq 0x206d95(%rip), %rdi    # 0x61c760
leaq 0x206f16(%rip), %rsi    # 0x61c8e8
callq 0x404c78
testw %ax, %ax
je 0x415a69
movq $0x1b72960, %rdi        # imm = 0x1B72960
leaq 0x18de37(%rip), %rsi    # 0x5a3825
movl $0xc, %edx
callq 0x485780
movq $0x1b72960, %rdi        # imm = 0x1B72960
leaq 0x18de2c(%rip), %rsi    # 0x5a3832
movl $0x5, %edx
callq 0x485780
movq $0x1b72960, %rdi        # imm = 0x1B72960
leaq 0x19302b(%rip), %rsi    # 0x5a8a49
movl $0x2, %edx
callq 0x485780
movq $0x1b72960, %rdi        # imm = 0x1B72960
leaq 0x18de02(%rip), %rsi    # 0x5a3838
movl $0xa, %edx
callq 0x485780
movq $0x1b72960, %rdi        # imm = 0x1B72960
leaq 0x18df50(%rip), %rsi    # 0x5a399e
movl $0x2, %edx
callq 0x485780
movl $0x12, %edx
leaq 0x18e39b(%rip), %rsi    # 0x5a3dff
jmp 0x415d1f
movl 0x206ced(%rip), %eax    # 0x61c75c
cmpl $0x5, %eax
je 0x415a7d
cmpl $0x2, %eax
jne 0x415b52
movq $0x1b72960, %rdi        # imm = 0x1B72960
leaq 0x18e387(%rip), %rsi    # 0x5a3e12
movl $0xf, %edx
callq 0x485780
movq $0x1b72960, %rdi        # imm = 0x1B72960
leaq 0x1989e7(%rip), %rsi    # 0x5ae48a
movl $0x1, %edx
callq 0x485780
leaq 0x206cac(%rip), %rdi    # 0x61c760
leaq 0x206e2d(%rip), %rsi    # 0x61c8e8
callq 0x40a127
testw %ax, %ax
je 0x415b52
movq $0x1b72960, %rdi        # imm = 0x1B72960
leaq 0x18dd4e(%rip), %rsi    # 0x5a3825
movl $0xc, %edx
callq 0x485780
movq $0x1b72960, %rdi        # imm = 0x1B72960
leaq 0x18dd43(%rip), %rsi    # 0x5a3832
movl $0x5, %edx
callq 0x485780
movq $0x1b72960, %rdi        # imm = 0x1B72960
leaq 0x192f42(%rip), %rsi    # 0x5a8a49
movl $0x2, %edx
callq 0x485780
movq $0x1b72960, %rdi        # imm = 0x1B72960
leaq 0x18dd19(%rip), %rsi    # 0x5a3838
movl $0xa, %edx
callq 0x485780
movq $0x1b72960, %rdi        # imm = 0x1B72960
leaq 0x18de67(%rip), %rsi    # 0x5a399e
movl $0x2, %edx
callq 0x485780
movl $0x13, %edx
leaq 0x18e2d5(%rip), %rsi    # 0x5a3e22
jmp 0x415d1f
movl 0x206c04(%rip), %eax    # 0x61c75c
cmpl $0x5, %eax
je 0x415b66
cmpl $0x3, %eax
jne 0x415c3b
movq $0x1b72960, %rdi        # imm = 0x1B72960
leaq 0x18e2c2(%rip), %rsi    # 0x5a3e36
movl $0x13, %edx
callq 0x485780
movq $0x1b72960, %rdi        # imm = 0x1B72960
leaq 0x1988fe(%rip), %rsi    # 0x5ae48a
movl $0x1, %edx
callq 0x485780
leaq 0x206bc3(%rip), %rdi    # 0x61c760
leaq 0x206d44(%rip), %rsi    # 0x61c8e8
callq 0x40fc8c
testw %ax, %ax
je 0x415c3b
movq $0x1b72960, %rdi        # imm = 0x1B72960
leaq 0x18dc65(%rip), %rsi    # 0x5a3825
movl $0xc, %edx
callq 0x485780
movq $0x1b72960, %rdi        # imm = 0x1B72960
leaq 0x18dc5a(%rip), %rsi    # 0x5a3832
movl $0x5, %edx
callq 0x485780
movq $0x1b72960, %rdi        # imm = 0x1B72960
leaq 0x192e59(%rip), %rsi    # 0x5a8a49
movl $0x2, %edx
callq 0x485780
movq $0x1b72960, %rdi        # imm = 0x1B72960
leaq 0x18dc30(%rip), %rsi    # 0x5a3838
movl $0xa, %edx
callq 0x485780
movq $0x1b72960, %rdi        # imm = 0x1B72960
leaq 0x18dd7e(%rip), %rsi    # 0x5a399e
movl $0x2, %edx
callq 0x485780
movl $0x17, %edx
leaq 0x18e214(%rip), %rsi    # 0x5a3e4a
jmp 0x415d1f
movl 0x206b1b(%rip), %eax    # 0x61c75c
andl $-0x2, %eax
xorl %ebx, %ebx
cmpl $0x4, %eax
jne 0x415d61
movq $0x1b72960, %rdi        # imm = 0x1B72960
leaq 0x18e205(%rip), %rsi    # 0x5a3e62
movl $0xe, %edx
callq 0x485780
movq $0x1b72960, %rdi        # imm = 0x1B72960
leaq 0x198815(%rip), %rsi    # 0x5ae48a
movl $0x1, %edx
callq 0x485780
leaq 0x206ada(%rip), %rdi    # 0x61c760
leaq 0x206c5b(%rip), %rsi    # 0x61c8e8
callq 0x4110a8
testw %ax, %ax
je 0x415d61
movq $0x1b72960, %rdi        # imm = 0x1B72960
leaq 0x18db7c(%rip), %rsi    # 0x5a3825
movl $0xc, %edx
callq 0x485780
movq $0x1b72960, %rdi        # imm = 0x1B72960
leaq 0x18db71(%rip), %rsi    # 0x5a3832
movl $0x5, %edx
callq 0x485780
movq $0x1b72960, %rdi        # imm = 0x1B72960
leaq 0x192d70(%rip), %rsi    # 0x5a8a49
movl $0x2, %edx
callq 0x485780
movq $0x1b72960, %rdi        # imm = 0x1B72960
leaq 0x18db47(%rip), %rsi    # 0x5a3838
movl $0xa, %edx
callq 0x485780
movq $0x1b72960, %rdi        # imm = 0x1B72960
leaq 0x18dc95(%rip), %rsi    # 0x5a399e
movl $0x2, %edx
callq 0x485780
movl $0x12, %edx
leaq 0x18e152(%rip), %rsi    # 0x5a3e71
movq $0x1b72960, %rdi        # imm = 0x1B72960
callq 0x485780
movq 0x206bb6(%rip), %rsi    # 0x61c8e8
movq 0x206bb7(%rip), %rdx    # 0x61c8f0
movq $0x1b72960, %rdi        # imm = 0x1B72960
callq 0x485780
movq %rax, %r14
movl $0x1, %edx
leaq 0x198736(%rip), %rsi    # 0x5ae48a
movl $0x1, %ebx
movq %r14, %rdi
callq 0x485780
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x415d7d
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x41b3a0
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x414cf2
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x41b3a0
jmp 0x414cf2
movq $0x1b72960, %rdi        # imm = 0x1B72960
leaq 0x18da75(%rip), %rsi    # 0x5a3825
movl $0xc, %edx
callq 0x485780
movq $0x1b72960, %rdi        # imm = 0x1B72960
leaq 0x18da6a(%rip), %rsi    # 0x5a3832
movl $0x5, %edx
callq 0x485780
movq $0x1b72960, %rdi        # imm = 0x1B72960
leaq 0x192c69(%rip), %rsi    # 0x5a8a49
movl $0x2, %edx
callq 0x485780
movq $0x1b72960, %rdi        # imm = 0x1B72960
leaq 0x18da40(%rip), %rsi    # 0x5a3838
movl $0xa, %edx
callq 0x485780
movq $0x1b72960, %rdi        # imm = 0x1B72960
leaq 0x18db8e(%rip), %rsi    # 0x5a399e
movl $0x2, %edx
callq 0x485780
movl $0x25, %edx
leaq 0x18deac(%rip), %rsi    # 0x5a3cd2
jmp 0x415221
jmp 0x415f4d
jmp 0x415f4d
jmp 0x415e43
jmp 0x415f4d
jmp 0x415e43
jmp 0x415f4d
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x415f50
movq 0x10(%rsp), %rsi
jmp 0x415f3a
jmp 0x415f4d
movq %rax, %rbx
movq 0x80(%rsp), %rdi
cmpq %r12, %rdi
je 0x415e87
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x41b3a0
jmp 0x415e87
movq %rax, %rbx
movq 0xa0(%rsp), %rdi
cmpq %r15, %rdi
je 0x415f50
movq 0xb0(%rsp), %rsi
jmp 0x415f3a
jmp 0x415f4d
movq %rax, %rbx
movq 0xc0(%rsp), %rdi
cmpq %r12, %rdi
je 0x415ecf
movq 0xd0(%rsp), %rsi
incq %rsi
callq 0x41b3a0
jmp 0x415ecf
movq %rax, %rbx
movq 0xe0(%rsp), %rdi
cmpq %r15, %rdi
je 0x415f50
movq 0xf0(%rsp), %rsi
jmp 0x415f3a
jmp 0x415f4d
movq %rax, %rbx
movq 0x100(%rsp), %rdi
cmpq %r12, %rdi
je 0x415f0d
movq 0x110(%rsp), %rsi
incq %rsi
callq 0x41b3a0
jmp 0x415f0d
movq %rax, %rbx
movq 0x120(%rsp), %rdi
cmpq %r15, %rdi
je 0x415f50
movq 0x130(%rsp), %rsi
jmp 0x415f3a
jmp 0x415f4d
jmp 0x415f4d
movq %rax, %rbx
movq 0x60(%rsp), %rdi
cmpq %r14, %rdi
je 0x415f50
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x41b3a0
jmp 0x415f50
jmp 0x415f4d
movq %rax, %rbx
jmp 0x415f6c
jmp 0x415f4d
movq %rax, %rbx
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x415f6c
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x41b3a0
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x415f88
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x41b3a0
movq %rbx, %rdi
callq 0x4c0230