// File: /workspace/github_cpp_makefile_star2_O3/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 0x414948
movq %rsi, %rbx
movl %edi, %ebp
callq 0x41463c
testb %al, %al
je 0x414966
callq 0x414763
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 0x18e2d6(%rip), %r14    # 0x5a2c4c
leaq 0x18e2d8(%rip), %r12    # 0x5a2c55
leaq 0x20(%rsp), %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x408096
leaq 0x50(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x40(%rsp), %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x408096
movq 0x8(%rbx), %r12
leaq 0x18e2a5(%rip), %rsi    # 0x5a2c56
movl $0x4, %edx
movq %r12, %rdi
callq 0x401048
testl %eax, %eax
je 0x414a36
leaq 0x18e292(%rip), %rsi    # 0x5a2c5b
movl $0x5, %edx
movq %r12, %rdi
callq 0x401048
testl %eax, %eax
je 0x414a40
leaq 0x18e280(%rip), %rsi    # 0x5a2c61
movl $0x9, %edx
movq %r12, %rdi
callq 0x401048
testl %eax, %eax
je 0x414a4a
leaq 0x18e272(%rip), %rsi    # 0x5a2c6b
movl $0x4, %edx
movq %r12, %rdi
callq 0x401048
testl %eax, %eax
je 0x414aea
cmpb $0x61, (%r12)
jne 0x414a54
cmpb $0x6c, 0x1(%r12)
jne 0x414a54
cmpb $0x6c, 0x2(%r12)
jne 0x414a54
movb $0x0, 0x206e34(%rip)    # 0x61b860
movl $0x5, %eax
jmp 0x414aef
movl $0x1, %eax
jmp 0x414aef
movl $0x2, %eax
jmp 0x414aef
movl $0x3, %eax
jmp 0x414aef
cmpl $0x0, 0x206d01(%rip)    # 0x61b75c
jne 0x414af5
movq $0x1b71960, %rdi        # imm = 0x1B71960
leaq 0x18ddc6(%rip), %rsi    # 0x5a2835
movl $0xc, %edx
callq 0x485270
movq $0x1b71960, %rdi        # imm = 0x1B71960
leaq 0x18ddbb(%rip), %rsi    # 0x5a2842
movl $0x5, %edx
callq 0x485270
movq $0x1b71960, %rdi        # imm = 0x1B71960
leaq 0x192fca(%rip), %rsi    # 0x5a7a69
movl $0x2, %edx
callq 0x485270
movq $0x1b71960, %rdi        # imm = 0x1B71960
leaq 0x18dd91(%rip), %rsi    # 0x5a2848
movl $0xa, %edx
callq 0x485270
movq $0x1b71960, %rdi        # imm = 0x1B71960
leaq 0x18dedf(%rip), %rsi    # 0x5a29ae
movl $0x2, %edx
callq 0x485270
movl $0x4a, %edx
leaq 0x18e18b(%rip), %rsi    # 0x5a2c70
jmp 0x414dd3
movl $0x4, %eax
movl %eax, 0x206c67(%rip)    # 0x61b75c
movl %ebp, %r15d
movl $0x2, %r13d
leaq 0x18e1b6(%rip), %r12    # 0x5a2cbb
leaq 0x18e1b5(%rip), %r14    # 0x5a2cc1
movq (%rbx,%r13,8), %rbp
cmpb $0x2d, (%rbp)
jne 0x414cda
cmpb $0x6d, 0x1(%rbp)
jne 0x414b37
addq $0x3, %rbp
movq %rbp, %rdi
callq 0x4daa40
movb %al, 0x206c3c(%rip)     # 0x61b76e
jmp 0x414cda
cmpb $0x6b, 0x1(%rbp)
jne 0x414b55
addq $0x3, %rbp
movq %rbp, %rdi
callq 0x4daa40
movw %ax, 0x206c10(%rip)     # 0x61b760
jmp 0x414cda
cmpb $0x63, 0x1(%rbp)
jne 0x414b78
cmpb $0x69, 0x2(%rbp)
jne 0x414b78
addq $0x4, %rbp
movq %rbp, %rdi
callq 0x4daa40
movl %eax, 0x206bf1(%rip)    # 0x61b764
jmp 0x414cda
cmpb $0x63, 0x1(%rbp)
jne 0x414b9b
cmpb $0x73, 0x2(%rbp)
jne 0x414b9b
addq $0x4, %rbp
movq %rbp, %rdi
callq 0x4daa40
movl %eax, 0x206bd2(%rip)    # 0x61b768
jmp 0x414cda
cmpb $0x6e, 0x1(%rbp)
jne 0x414bb9
addq $0x3, %rbp
movq %rbp, %rdi
callq 0x4daa40
movw %ax, 0x206bb8(%rip)     # 0x61b76c
jmp 0x414cda
cmpb $0x70, 0x1(%rbp)
jne 0x414bdc
addq $0x3, %rbp
movq %rbp, %rdi
callq 0x4daa30
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x206b9d(%rip)   # 0x61b774
jmp 0x414cda
movl $0x5, %edx
movq %rbp, %rdi
movq %r12, %rsi
callq 0x401048
testl %eax, %eax
je 0x414c8e
movl $0x5, %edx
movq %rbp, %rdi
movq %r14, %rsi
callq 0x401048
testl %eax, %eax
je 0x414ca8
movl $0x5, %edx
movq %rbp, %rdi
leaq 0x18e0ac(%rip), %rsi    # 0x5a2cc7
callq 0x401048
testl %eax, %eax
je 0x414cc2
cmpb $0x69, 0x1(%rbp)
leaq 0x20(%rsp), %r14
je 0x414c5c
cmpb $0x6f, 0x1(%rbp)
leaq 0x40(%rsp), %r14
je 0x414c5c
cmpb $0x74, 0x1(%rbp)
leaq 0x206bf7(%rip), %r14    # 0x61b840
je 0x414c5c
cmpb $0x65, 0x1(%rbp)
leaq 0x206bca(%rip), %r14    # 0x61b820
jne 0x41594c
addq $0x3, %rbp
leaq 0x140(%rsp), %r12
movq %r12, %rdi
movq %rbp, %rsi
callq 0x4010a8
movq %r14, %rdi
movq %r12, %rsi
callq 0x48cbc0
leaq 0x18e03c(%rip), %r14    # 0x5a2cc1
leaq 0x18e02f(%rip), %r12    # 0x5a2cbb
jmp 0x414cda
addq $0x6, %rbp
movq %rbp, %rdi
callq 0x4daa30
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x206aca(%rip)   # 0x61b770
jmp 0x414cda
addq $0x6, %rbp
movq %rbp, %rdi
callq 0x4daa30
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x206ab8(%rip)   # 0x61b778
jmp 0x414cda
addq $0x6, %rbp
movq %rbp, %rdi
callq 0x4daa30
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x206aa2(%rip)   # 0x61b77c
incq %r13
cmpq %r13, %r15
jne 0x414b0c
leaq 0x18df5f(%rip), %rsi    # 0x5a2c4c
leaq 0x20(%rsp), %rdi
callq 0x48dd80
testl %eax, %eax
je 0x414d4f
leaq 0x18df4a(%rip), %rsi    # 0x5a2c4c
leaq 0x40(%rsp), %rdi
callq 0x48dd80
testl %eax, %eax
je 0x414d4f
movl 0x206a46(%rip), %eax    # 0x61b75c
leal -0x1(%rax), %ecx
cmpl $0x4, %ecx
ja 0x4151ec
leaq 0x18dae7(%rip), %rax    # 0x5a2810
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
leaq 0x206a47(%rip), %rdi    # 0x61b780
leaq 0x20(%rsp), %rsi
callq 0x48b7a0
leaq 0x206a56(%rip), %rdi    # 0x61b7a0
jmp 0x4151dc
movq $0x1b71960, %rdi        # imm = 0x1B71960
leaq 0x18dad8(%rip), %rsi    # 0x5a2835
movl $0xc, %edx
callq 0x485270
movq $0x1b71960, %rdi        # imm = 0x1B71960
leaq 0x18dacd(%rip), %rsi    # 0x5a2842
movl $0x5, %edx
callq 0x485270
movq $0x1b71960, %rdi        # imm = 0x1B71960
leaq 0x192cdc(%rip), %rsi    # 0x5a7a69
movl $0x2, %edx
callq 0x485270
movq $0x1b71960, %rdi        # imm = 0x1B71960
leaq 0x18daa3(%rip), %rsi    # 0x5a2848
movl $0xa, %edx
callq 0x485270
movq $0x1b71960, %rdi        # imm = 0x1B71960
leaq 0x18dbf1(%rip), %rsi    # 0x5a29ae
movl $0x2, %edx
callq 0x485270
movl $0x3c, %edx
leaq 0x18df20(%rip), %rsi    # 0x5a2cf3
movl $0x1, %ebx
movq $0x1b71960, %rdi        # imm = 0x1B71960
callq 0x485270
jmp 0x415871
leaq 0x206990(%rip), %rdi    # 0x61b780
leaq 0x20(%rsp), %rsi
callq 0x48b7a0
leaq 0x130(%rsp), %r15
movq %r15, -0x10(%r15)
movq 0x206a13(%rip), %rsi    # 0x61b820
movq 0x206a14(%rip), %rdx    # 0x61b828
addq %rsi, %rdx
leaq 0x120(%rsp), %rdi
callq 0x408000
leaq 0x110(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x18def8(%rip), %rsi    # 0x5a2d30
leaq 0x18df00(%rip), %rdx    # 0x5a2d3f
leaq 0x100(%rsp), %rdi
callq 0x408096
movq %rsp, %rdi
leaq 0x120(%rsp), %rsi
leaq 0x100(%rsp), %rdx
callq 0x407aca
leaq 0x206935(%rip), %rdi    # 0x61b7a0
movq %rsp, %rbx
movq %rbx, %rsi
callq 0x48bbc0
movq (%rbx), %rdi
leaq 0x10(%rsp), %r14
cmpq %r14, %rdi
je 0x414e90
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x41ae90
movq 0x100(%rsp), %rdi
cmpq %r12, %rdi
je 0x414ead
movq 0x110(%rsp), %rsi
incq %rsi
callq 0x41ae90
movq 0x120(%rsp), %rdi
cmpq %r15, %rdi
je 0x414eca
movq 0x130(%rsp), %rsi
incq %rsi
callq 0x41ae90
leaq 0xf0(%rsp), %r15
movq %r15, -0x10(%r15)
movq 0x206943(%rip), %rsi    # 0x61b820
movq 0x206944(%rip), %rdx    # 0x61b828
addq %rsi, %rdx
leaq 0xe0(%rsp), %rdi
callq 0x408000
leaq 0xd0(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x18de38(%rip), %rsi    # 0x5a2d40
leaq 0x18de3f(%rip), %rdx    # 0x5a2d4e
leaq 0xc0(%rsp), %rdi
callq 0x408096
movq %rsp, %rdi
leaq 0xe0(%rsp), %rsi
leaq 0xc0(%rsp), %rdx
callq 0x407aca
leaq 0x206885(%rip), %rdi    # 0x61b7c0
movq %rsp, %rbx
movq %rbx, %rsi
callq 0x48bbc0
movq (%rbx), %rdi
cmpq %r14, %rdi
je 0x414f5b
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x41ae90
movq 0xc0(%rsp), %rdi
cmpq %r12, %rdi
je 0x414f78
movq 0xd0(%rsp), %rsi
incq %rsi
callq 0x41ae90
movq 0xe0(%rsp), %rdi
cmpq %r15, %rdi
je 0x414f95
movq 0xf0(%rsp), %rsi
incq %rsi
callq 0x41ae90
leaq 0xb0(%rsp), %r15
movq %r15, -0x10(%r15)
movq 0x206878(%rip), %rsi    # 0x61b820
movq 0x206879(%rip), %rdx    # 0x61b828
addq %rsi, %rdx
leaq 0xa0(%rsp), %rdi
callq 0x408000
leaq 0x90(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x18dd7c(%rip), %rsi    # 0x5a2d4f
leaq 0x18dd83(%rip), %rdx    # 0x5a2d5d
leaq 0x80(%rsp), %rdi
callq 0x408096
movq %rsp, %rdi
leaq 0xa0(%rsp), %rsi
leaq 0x80(%rsp), %rdx
callq 0x407aca
leaq 0x2067da(%rip), %rdi    # 0x61b7e0
movq %rsp, %rbx
movq %rbx, %rsi
callq 0x48bbc0
movq (%rbx), %rdi
cmpq %r14, %rdi
je 0x415026
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x41ae90
movq 0x80(%rsp), %rdi
cmpq %r12, %rdi
je 0x415043
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x41ae90
movq 0xa0(%rsp), %rdi
cmpq %r15, %rdi
je 0x415060
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x41ae90
leaq 0x206799(%rip), %rdi    # 0x61b800
leaq 0x40(%rsp), %rsi
callq 0x48b7a0
leaq 0x18dce6(%rip), %rsi    # 0x5a2d5e
leaq 0x206721(%rip), %rdx    # 0x61b7a0
movq %rsp, %rdi
callq 0x40ae58
movq (%rsp), %rdi
callq 0x4e5120
movl %eax, %ebx
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x4150a8
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x41ae90
testl %ebx, %ebx
je 0x4150d0
movq $0x1b71960, %rdi        # imm = 0x1B71960
leaq 0x18dcab(%rip), %rsi    # 0x5a2d65
movl $0xc, %edx
callq 0x485270
movq $0x1b71960, %rdi        # imm = 0x1B71960
callq 0x485080
leaq 0x18dc87(%rip), %rsi    # 0x5a2d5e
leaq 0x2066e2(%rip), %rdx    # 0x61b7c0
movq %rsp, %rdi
callq 0x40ae58
movq (%rsp), %rdi
callq 0x4e5120
movl %eax, %ebx
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x415107
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x41ae90
testl %ebx, %ebx
je 0x41512f
movq $0x1b71960, %rdi        # imm = 0x1B71960
leaq 0x18dc4c(%rip), %rsi    # 0x5a2d65
movl $0xc, %edx
callq 0x485270
movq $0x1b71960, %rdi        # imm = 0x1B71960
callq 0x485080
leaq 0x18dc28(%rip), %rsi    # 0x5a2d5e
leaq 0x2066a3(%rip), %rdx    # 0x61b7e0
movq %rsp, %rdi
callq 0x40ae58
movq (%rsp), %rdi
callq 0x4e5120
movl %eax, %ebx
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x415166
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x41ae90
testl %ebx, %ebx
je 0x4151e6
movq $0x1b71960, %rdi        # imm = 0x1B71960
leaq 0x18dbed(%rip), %rsi    # 0x5a2d65
movl $0xc, %edx
callq 0x485270
movq $0x1b71960, %rdi        # imm = 0x1B71960
callq 0x485080
jmp 0x4151e6
leaq 0x206629(%rip), %rdi    # 0x61b7c0
leaq 0x20(%rsp), %rsi
callq 0x48b7a0
leaq 0x206638(%rip), %rdi    # 0x61b7e0
jmp 0x4151dc
leaq 0x20662f(%rip), %rdi    # 0x61b7e0
leaq 0x20(%rsp), %rsi
callq 0x48b7a0
leaq 0x20663e(%rip), %rdi    # 0x61b800
jmp 0x4151dc
leaq 0x2065d5(%rip), %rdi    # 0x61b7a0
leaq 0x20(%rsp), %rsi
callq 0x48b7a0
leaq 0x2065e4(%rip), %rdi    # 0x61b7c0
leaq 0x40(%rsp), %rsi
callq 0x48b7a0
movl 0x206570(%rip), %eax    # 0x61b75c
cmpl $0x5, %eax
je 0x4151fa
cmpl $0x3, %eax
jne 0x415490
movq $0x1b71960, %rdi        # imm = 0x1B71960
leaq 0x18db6a(%rip), %rsi    # 0x5a2d72
movl $0xb, %edx
callq 0x485270
movq $0x1b71960, %rdi        # imm = 0x1B71960
leaq 0x19828a(%rip), %rsi    # 0x5ad4aa
movl $0x1, %edx
callq 0x485270
leaq 0x70(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x206606(%rip), %rsi    # 0x61b840
movq 0x206607(%rip), %rdx    # 0x61b848
addq %rsi, %rdx
leaq 0x60(%rsp), %rdi
callq 0x408000
leaq 0x206663(%rip), %rsi    # 0x61b8b8
leaq 0x60(%rsp), %rdi
callq 0x41392c
movl %eax, %ebx
movq 0x60(%rsp), %rdi
cmpq %r14, %rdi
je 0x415278
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x41ae90
testb %bl, %bl
je 0x415316
cmpq $0x1, 0x206658(%rip)    # 0x61b8e0
ja 0x41539e
movq $0x1b71960, %rdi        # imm = 0x1B71960
leaq 0x18d599(%rip), %rsi    # 0x5a2835
movl $0xc, %edx
callq 0x485270
movq $0x1b71960, %rdi        # imm = 0x1B71960
leaq 0x18d58e(%rip), %rsi    # 0x5a2842
movl $0x5, %edx
callq 0x485270
movq $0x1b71960, %rdi        # imm = 0x1B71960
leaq 0x19279d(%rip), %rsi    # 0x5a7a69
movl $0x2, %edx
callq 0x485270
movq $0x1b71960, %r14        # imm = 0x1B71960
leaq 0x18d564(%rip), %rsi    # 0x5a2848
movl $0xa, %edx
movq %r14, %rdi
callq 0x485270
leaq 0x18d6b6(%rip), %rsi    # 0x5a29ae
movl $0x2, %edx
movq %r14, %rdi
callq 0x485270
movl $0x23, %edx
leaq 0x18da92(%rip), %rsi    # 0x5a2da3
jmp 0x415864
movq $0x1b71960, %rdi        # imm = 0x1B71960
leaq 0x18d511(%rip), %rsi    # 0x5a2835
movl $0xc, %edx
callq 0x485270
movq $0x1b71960, %rdi        # imm = 0x1B71960
leaq 0x18d506(%rip), %rsi    # 0x5a2842
movl $0x5, %edx
callq 0x485270
movq $0x1b71960, %rdi        # imm = 0x1B71960
leaq 0x192715(%rip), %rsi    # 0x5a7a69
movl $0x2, %edx
callq 0x485270
movq $0x1b71960, %r14        # imm = 0x1B71960
leaq 0x18d4dc(%rip), %rsi    # 0x5a2848
movl $0xa, %edx
movq %r14, %rdi
callq 0x485270
leaq 0x18d62e(%rip), %rsi    # 0x5a29ae
movl $0x2, %edx
movq %r14, %rdi
callq 0x485270
movl $0x24, %edx
leaq 0x18d9e5(%rip), %rsi    # 0x5a2d7e
jmp 0x415864
cmpb $0x1, 0x2063c9(%rip)    # 0x61b76e
jne 0x4153cb
leaq 0x2064ba(%rip), %rdi    # 0x61b868
leaq 0x1b1b15(%rip), %rsi    # 0x5c6eca
callq 0x48cbc0
movl 0x206520(%rip), %eax    # 0x61b8e0
movl %eax, 0x2064c2(%rip)    # 0x61b888
jmp 0x415490
movq 0x2064fe(%rip), %rsi    # 0x61b8d0
addq $0x40, %rsi
leaq 0x20648b(%rip), %rdi    # 0x61b868
callq 0x48b7a0
leaq 0x2064a7(%rip), %rdi    # 0x61b890
leaq 0x1b1ada(%rip), %rsi    # 0x5c6eca
callq 0x48cbc0
movq 0x2064d4(%rip), %rbx    # 0x61b8d0
leaq 0x2064bd(%rip), %r13    # 0x61b8c0
cmpq %r13, %rbx
je 0x415490
leaq 0x206455(%rip), %r14    # 0x61b868
leaq 0x20646e(%rip), %rbp    # 0x61b888
leaq 0x20646f(%rip), %r15    # 0x61b890
leaq 0x40(%rbx), %r12
movq %r14, %rdi
movq %r12, %rsi
callq 0x48dbd0
movq %rbp, %rcx
testl %eax, %eax
je 0x41547e
movq %r15, %rdi
movq %r12, %rsi
callq 0x48dbd0
testl %eax, %eax
je 0x415464
cmpq $0x0, 0x20644a(%rip)    # 0x61b898
jne 0x415464
movq %r15, %rdi
movq %r12, %rsi
callq 0x48b7a0
leaq 0x20644e(%rip), %rcx    # 0x61b8b0
jmp 0x41547e
movq %r15, %rdi
movq %r12, %rsi
callq 0x48dbd0
leaq 0x20643a(%rip), %rcx    # 0x61b8b0
testl %eax, %eax
jne 0x4158b2
incl (%rcx)
movq %rbx, %rdi
callq 0x424580
movq %rax, %rbx
cmpq %r13, %rax
jne 0x415421
movl 0x2062c6(%rip), %eax    # 0x61b75c
movl %eax, %ecx
andl $-0x5, %ecx
cmpl $0x1, %ecx
jne 0x41557f
movq $0x1b71960, %rdi        # imm = 0x1B71960
leaq 0x18d939(%rip), %rsi    # 0x5a2deb
movl $0xe, %edx
callq 0x485270
movq $0x1b71960, %rdi        # imm = 0x1B71960
leaq 0x197fe0(%rip), %rsi    # 0x5ad4aa
movl $0x1, %edx
callq 0x485270
leaq 0x206285(%rip), %rdi    # 0x61b760
leaq 0x206406(%rip), %rsi    # 0x61b8e8
callq 0x404c78
testw %ax, %ax
je 0x415579
movq $0x1b71960, %rdi        # imm = 0x1B71960
leaq 0x18d337(%rip), %rsi    # 0x5a2835
movl $0xc, %edx
callq 0x485270
movq $0x1b71960, %rdi        # imm = 0x1B71960
leaq 0x18d32c(%rip), %rsi    # 0x5a2842
movl $0x5, %edx
callq 0x485270
movq $0x1b71960, %rdi        # imm = 0x1B71960
leaq 0x19253b(%rip), %rsi    # 0x5a7a69
movl $0x2, %edx
callq 0x485270
movq $0x1b71960, %rdi        # imm = 0x1B71960
leaq 0x18d302(%rip), %rsi    # 0x5a2848
movl $0xa, %edx
callq 0x485270
movq $0x1b71960, %rdi        # imm = 0x1B71960
leaq 0x18d450(%rip), %rsi    # 0x5a29ae
movl $0x2, %edx
callq 0x485270
movl $0x12, %edx
leaq 0x18d886(%rip), %rsi    # 0x5a2dfa
jmp 0x41582f
movl 0x2061dd(%rip), %eax    # 0x61b75c
cmpl $0x5, %eax
je 0x41558d
cmpl $0x2, %eax
jne 0x415668
movq $0x1b71960, %rdi        # imm = 0x1B71960
leaq 0x18d872(%rip), %rsi    # 0x5a2e0d
movl $0xf, %edx
callq 0x485270
movq $0x1b71960, %rdi        # imm = 0x1B71960
leaq 0x197ef7(%rip), %rsi    # 0x5ad4aa
movl $0x1, %edx
callq 0x485270
leaq 0x20619c(%rip), %rdi    # 0x61b760
leaq 0x20631d(%rip), %rsi    # 0x61b8e8
callq 0x409d4b
testw %ax, %ax
je 0x415662
movq $0x1b71960, %rdi        # imm = 0x1B71960
leaq 0x18d24e(%rip), %rsi    # 0x5a2835
movl $0xc, %edx
callq 0x485270
movq $0x1b71960, %rdi        # imm = 0x1B71960
leaq 0x18d243(%rip), %rsi    # 0x5a2842
movl $0x5, %edx
callq 0x485270
movq $0x1b71960, %rdi        # imm = 0x1B71960
leaq 0x192452(%rip), %rsi    # 0x5a7a69
movl $0x2, %edx
callq 0x485270
movq $0x1b71960, %rdi        # imm = 0x1B71960
leaq 0x18d219(%rip), %rsi    # 0x5a2848
movl $0xa, %edx
callq 0x485270
movq $0x1b71960, %rdi        # imm = 0x1B71960
leaq 0x18d367(%rip), %rsi    # 0x5a29ae
movl $0x2, %edx
callq 0x485270
movl $0x13, %edx
leaq 0x18d7c0(%rip), %rsi    # 0x5a2e1d
jmp 0x41582f
movl 0x2060f4(%rip), %eax    # 0x61b75c
cmpl $0x5, %eax
je 0x415676
cmpl $0x3, %eax
jne 0x415751
movq $0x1b71960, %rdi        # imm = 0x1B71960
leaq 0x18d7ad(%rip), %rsi    # 0x5a2e31
movl $0x13, %edx
callq 0x485270
movq $0x1b71960, %rdi        # imm = 0x1B71960
leaq 0x197e0e(%rip), %rsi    # 0x5ad4aa
movl $0x1, %edx
callq 0x485270
leaq 0x2060b3(%rip), %rdi    # 0x61b760
leaq 0x206234(%rip), %rsi    # 0x61b8e8
callq 0x40f93e
testw %ax, %ax
je 0x41574b
movq $0x1b71960, %rdi        # imm = 0x1B71960
leaq 0x18d165(%rip), %rsi    # 0x5a2835
movl $0xc, %edx
callq 0x485270
movq $0x1b71960, %rdi        # imm = 0x1B71960
leaq 0x18d15a(%rip), %rsi    # 0x5a2842
movl $0x5, %edx
callq 0x485270
movq $0x1b71960, %rdi        # imm = 0x1B71960
leaq 0x192369(%rip), %rsi    # 0x5a7a69
movl $0x2, %edx
callq 0x485270
movq $0x1b71960, %rdi        # imm = 0x1B71960
leaq 0x18d130(%rip), %rsi    # 0x5a2848
movl $0xa, %edx
callq 0x485270
movq $0x1b71960, %rdi        # imm = 0x1B71960
leaq 0x18d27e(%rip), %rsi    # 0x5a29ae
movl $0x2, %edx
callq 0x485270
movl $0x17, %edx
leaq 0x18d6ff(%rip), %rsi    # 0x5a2e45
jmp 0x41582f
movl 0x20600b(%rip), %eax    # 0x61b75c
andl $-0x2, %eax
xorl %ebx, %ebx
cmpl $0x4, %eax
jne 0x415871
movq $0x1b71960, %rdi        # imm = 0x1B71960
leaq 0x18d6f0(%rip), %rsi    # 0x5a2e5d
movl $0xe, %edx
callq 0x485270
movq $0x1b71960, %rdi        # imm = 0x1B71960
leaq 0x197d25(%rip), %rsi    # 0x5ad4aa
movl $0x1, %edx
callq 0x485270
leaq 0x205fca(%rip), %rdi    # 0x61b760
leaq 0x20614b(%rip), %rsi    # 0x61b8e8
callq 0x410d1c
testw %ax, %ax
je 0x415871
movq $0x1b71960, %rdi        # imm = 0x1B71960
leaq 0x18d07c(%rip), %rsi    # 0x5a2835
movl $0xc, %edx
callq 0x485270
movq $0x1b71960, %rdi        # imm = 0x1B71960
leaq 0x18d071(%rip), %rsi    # 0x5a2842
movl $0x5, %edx
callq 0x485270
movq $0x1b71960, %rdi        # imm = 0x1B71960
leaq 0x192280(%rip), %rsi    # 0x5a7a69
movl $0x2, %edx
callq 0x485270
movq $0x1b71960, %rdi        # imm = 0x1B71960
leaq 0x18d047(%rip), %rsi    # 0x5a2848
movl $0xa, %edx
callq 0x485270
movq $0x1b71960, %rdi        # imm = 0x1B71960
leaq 0x18d195(%rip), %rsi    # 0x5a29ae
movl $0x2, %edx
callq 0x485270
movl $0x12, %edx
leaq 0x18d63d(%rip), %rsi    # 0x5a2e6c
movq $0x1b71960, %rdi        # imm = 0x1B71960
callq 0x485270
movq 0x2060a6(%rip), %rsi    # 0x61b8e8
movq 0x2060a7(%rip), %rdx    # 0x61b8f0
movq $0x1b71960, %rdi        # imm = 0x1B71960
callq 0x485270
movq %rax, %r14
movl $0x1, %edx
leaq 0x197c46(%rip), %rsi    # 0x5ad4aa
movl $0x1, %ebx
movq %r14, %rdi
callq 0x485270
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x41588d
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x41ae90
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x414952
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x41ae90
jmp 0x414952
movq $0x1b71960, %rdi        # imm = 0x1B71960
leaq 0x18cf75(%rip), %rsi    # 0x5a2835
movl $0xc, %edx
callq 0x485270
movq $0x1b71960, %rdi        # imm = 0x1B71960
leaq 0x18cf6a(%rip), %rsi    # 0x5a2842
movl $0x5, %edx
callq 0x485270
movq $0x1b71960, %rdi        # imm = 0x1B71960
leaq 0x192179(%rip), %rsi    # 0x5a7a69
movl $0x2, %edx
callq 0x485270
movq $0x1b71960, %rdi        # imm = 0x1B71960
leaq 0x18cf40(%rip), %rsi    # 0x5a2848
movl $0xa, %edx
callq 0x485270
movq $0x1b71960, %rdi        # imm = 0x1B71960
leaq 0x18d08e(%rip), %rsi    # 0x5a29ae
movl $0x2, %edx
callq 0x485270
movl $0x1, %ebx
movq $0x1b71960, %rdi        # imm = 0x1B71960
leaq 0x18d48a(%rip), %rsi    # 0x5a2dc7
movl $0x23, %edx
callq 0x485270
jmp 0x415871
movq $0x1b71960, %rdi        # imm = 0x1B71960
leaq 0x18cedb(%rip), %rsi    # 0x5a2835
movl $0xc, %edx
callq 0x485270
movq $0x1b71960, %rdi        # imm = 0x1B71960
leaq 0x18ced0(%rip), %rsi    # 0x5a2842
movl $0x5, %edx
callq 0x485270
movq $0x1b71960, %rdi        # imm = 0x1B71960
leaq 0x1920df(%rip), %rsi    # 0x5a7a69
movl $0x2, %edx
callq 0x485270
movq $0x1b71960, %rdi        # imm = 0x1B71960
leaq 0x18cea6(%rip), %rsi    # 0x5a2848
movl $0xa, %edx
callq 0x485270
movq $0x1b71960, %rdi        # imm = 0x1B71960
leaq 0x18cff4(%rip), %rsi    # 0x5a29ae
movl $0x2, %edx
callq 0x485270
movl $0x25, %edx
leaq 0x18d2fd(%rip), %rsi    # 0x5a2ccd
jmp 0x414dd3
jmp 0x415af7
jmp 0x415af7
jmp 0x4159ed
jmp 0x415af7
jmp 0x4159ed
jmp 0x415af7
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x415afa
movq 0x10(%rsp), %rsi
jmp 0x415ae4
jmp 0x415af7
movq %rax, %rbx
movq 0x80(%rsp), %rdi
cmpq %r12, %rdi
je 0x415a31
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x41ae90
jmp 0x415a31
movq %rax, %rbx
movq 0xa0(%rsp), %rdi
cmpq %r15, %rdi
je 0x415afa
movq 0xb0(%rsp), %rsi
jmp 0x415ae4
jmp 0x415af7
movq %rax, %rbx
movq 0xc0(%rsp), %rdi
cmpq %r12, %rdi
je 0x415a79
movq 0xd0(%rsp), %rsi
incq %rsi
callq 0x41ae90
jmp 0x415a79
movq %rax, %rbx
movq 0xe0(%rsp), %rdi
cmpq %r15, %rdi
je 0x415afa
movq 0xf0(%rsp), %rsi
jmp 0x415ae4
jmp 0x415af7
movq %rax, %rbx
movq 0x100(%rsp), %rdi
cmpq %r12, %rdi
je 0x415ab7
movq 0x110(%rsp), %rsi
incq %rsi
callq 0x41ae90
jmp 0x415ab7
movq %rax, %rbx
movq 0x120(%rsp), %rdi
cmpq %r15, %rdi
je 0x415afa
movq 0x130(%rsp), %rsi
jmp 0x415ae4
jmp 0x415af7
jmp 0x415af7
movq %rax, %rbx
movq 0x60(%rsp), %rdi
cmpq %r14, %rdi
je 0x415afa
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x41ae90
jmp 0x415afa
movq %rax, %rbx
jmp 0x415b16
jmp 0x415af7
jmp 0x415af7
movq %rax, %rbx
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x415b16
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x41ae90
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x415b32
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x41ae90
movq %rbx, %rdi
callq 0x4bfce0