// File: simonrharris[P]SKA/src/ska.cpp
// Function: weedSubcommand(int, char**)
int weedSubcommand(int argc, char *argv[]){

	std::string infile="";
	std::string kmerfile="";
	float minproportion=0.0;
	float maxproportion=1.0;
	int minsamples=0;
	int maxsamples=0;
	std::vector < std::string > args;

	for (int i=2; i<argc; ++i){

		std::string arg=(argv[i]);

		if (arg=="-h" || arg=="--help"){
			weedHelp();
			return 0;
		}
		else if (arg == "-f"){
			i++;
			if (i<argc){
				fileToVector(argv[i], args);
			}
			else {
				std::cerr << std::endl << "Expecting file name after -f flag" << std::endl << std::endl;
				return 1;
			}
		}
		else if (arg == "-i"){
			i++;
			if (i<argc){
				infile = argv[i];
			}
			else {
				std::cerr << std::endl << "Expecting file name after -i flag" << std::endl << std::endl;
				return 1;
			}
		}
		else if (arg == "-m"){
			i++;
			if (i<argc){
				try {
					minsamples = getint(argv[i]);
				}
				catch (const std::invalid_argument& e) {
					std::cerr << std::endl << "Expecting positive int after -m flag" << std::endl << std::endl;
					return 1;
				}
			}
			else {
				std::cerr << std::endl << "Expecting positive int after -m flag" << std::endl << std::endl;
				return 1;
			}
			if (minsamples < 0){
				std::cerr << std::endl << "Minimum number of samples must be 0 or greater" << std::endl << std::endl;
				return 1;
			}
		}
		else if (arg == "-M"){
			i++;
			if (i<argc){
				try {
					maxsamples = getint(argv[i]);
				}
				catch (const std::invalid_argument& e) {
					std::cerr << std::endl << "Expecting positive int after -m flag" << std::endl << std::endl;
					return 1;
				}
			}
			else {
				std::cerr << std::endl << "Expecting positive int after -m flag" << std::endl << std::endl;
				return 1;
			}
			if (maxsamples < 0){
				std::cerr << std::endl << "Maximum number of samples must be 0 or greater" << std::endl << std::endl;
				return 1;
			}
		}
		else if (arg == "-p"){
			i++;
			if (i<argc){
				try {
					minproportion = getfloat(argv[i]);
				}
				catch (const std::invalid_argument& e) {
					std::cerr << std::endl << "Expecting float between 0 and 1 after -p flag" << std::endl << std::endl;
					return 1;
				}
			}
			else {
				std::cerr << std::endl << "Expecting float between 0 and 1 after -p flag" << std::endl << std::endl;
				return 1;
			}
			if (minproportion < 0 || minproportion > 1){
				std::cerr << std::endl << "Minimum proportion must be between 0 and 1" << std::endl << std::endl;
				return 1;
			}
		}
		else if (arg == "-P"){
			i++;
			if (i<argc){
				try {
					maxproportion = getfloat(argv[i]);
				}
				catch (const std::invalid_argument& e) {
					std::cerr << std::endl << "Expecting float between 0 and 1 after -P flag" << std::endl << std::endl;
					return 1;
				}
			}
			else {
				std::cerr << std::endl << "Expecting float between 0 and 1 after -P flag" << std::endl << std::endl;
				return 1;
			}
			if (maxproportion < 0 || maxproportion > 1){
				std::cerr << std::endl << "Maximum proportion must be between 0 and 1" << std::endl << std::endl;
				return 1;
			}
		}
		else if (arg[0]=='-'){
			std::cerr << std::endl << "Unrecognised flag " << arg << std::endl << std::endl;
				return 1;
		}
		else {
			args.push_back(arg);
		}
	}

	if (args.size()<1){
		std::cerr << std::endl << "Too few arguments" << std::endl;
		weedHelp();
		return 1;
	}

	if (infile=="" && minproportion==0 && minsamples==0 && maxproportion==1 && maxproportion==0){
		std::cerr << "Input split kmer file is required if no sample numbers or proportions are set" << std::endl;
		weedHelp();
		return 1;
	}

	if (minproportion>=maxproportion){
		std::cerr << "Maxproportion must be greater than minproportion" << std::endl;
		weedHelp();
		return 1;
	}
	if (minsamples>=maxsamples && maxsamples!=0){
		std::cerr << "Maxsamples must be greater than minsamples" << std::endl;
		weedHelp();
		return 1;
	}

	skaVersion();

	std::cout << "Weeding kmers in " << infile << std::endl;
	std::cout << "From ";
	if (args.size()>maxNamesToPrint){
		std::cout << args.size() << " files";
	}
	else {
		for (std::vector < std::string >::iterator it = args.begin(); it != args.end(); ++it){
			std::cout << *it << " ";
		}
	}

	std::cout << std::endl;

	if (weedKmers(args, infile, minproportion, maxproportion, minsamples, maxsamples)){return 1;}

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x360, %rsp            # imm = 0x360
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x31(%rbp), %rdi
movq %rdi, -0x128(%rbp)
callq 0x6910
movq -0x128(%rbp), %rdx
leaq 0x2f12(%rip), %rsi      # 0x5a2b2
leaq -0x30(%rbp), %rdi
callq 0xab20
jmp 0x573ab
leaq -0x31(%rbp), %rdi
callq 0x65a0
leaq -0x69(%rbp), %rdi
movq %rdi, -0x130(%rbp)
callq 0x6910
movq -0x130(%rbp), %rdx
leaq 0x2ee0(%rip), %rsi      # 0x5a2b2
leaq -0x68(%rbp), %rdi
callq 0xab20
jmp 0x573dd
leaq -0x69(%rbp), %rdi
callq 0x65a0
xorps %xmm0, %xmm0
movss %xmm0, -0x70(%rbp)
movss 0x1c0e(%rip), %xmm0     # 0x59004
movss %xmm0, -0x74(%rbp)
movl $0x0, -0x78(%rbp)
movl $0x0, -0x7c(%rbp)
leaq -0x98(%rbp), %rdi
callq 0x1ab40
movl $0x2, -0x9c(%rbp)
movl -0x9c(%rbp), %eax
cmpl -0x8(%rbp), %eax
jge 0x58236
movq -0x10(%rbp), %rax
movslq -0x9c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x140(%rbp)
leaq -0xc1(%rbp), %rdi
movq %rdi, -0x138(%rbp)
callq 0x6910
movq -0x140(%rbp), %rsi
movq -0x138(%rbp), %rdx
leaq -0xc0(%rbp), %rdi
callq 0xab20
jmp 0x57473
leaq -0xc1(%rbp), %rdi
callq 0x65a0
leaq 0x3b61(%rip), %rsi      # 0x5afe7
leaq -0xc0(%rbp), %rdi
callq 0x2dce0
movb %al, -0x141(%rbp)
jmp 0x5749a
movb -0x141(%rbp), %al
testb $0x1, %al
jne 0x574cd
jmp 0x574a6
leaq 0x3b3d(%rip), %rsi      # 0x5afea
leaq -0xc0(%rbp), %rdi
callq 0x2dce0
movb %al, -0x142(%rbp)
jmp 0x574c1
movb -0x142(%rbp), %al
testb $0x1, %al
jne 0x574cd
jmp 0x5754c
callq 0x571f0
jmp 0x574d4
movl $0x0, -0x4(%rbp)
movl $0x1, -0xc8(%rbp)
jmp 0x581f3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x31(%rbp), %rdi
callq 0x65a0
jmp 0x5861f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x69(%rbp), %rdi
callq 0x65a0
jmp 0x58616
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0xc1(%rbp), %rdi
callq 0x65a0
jmp 0x58601
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x58225
leaq 0x3b14(%rip), %rsi      # 0x5b067
leaq -0xc0(%rbp), %rdi
callq 0x2dce0
movb %al, -0x143(%rbp)
jmp 0x57567
movb -0x143(%rbp), %al
testb $0x1, %al
jne 0x57576
jmp 0x576c6
movl -0x9c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x9c(%rbp)
movl -0x9c(%rbp), %eax
cmpl -0x8(%rbp), %eax
jge 0x57642
movq -0x10(%rbp), %rax
movslq -0x9c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x158(%rbp)
leaq -0xe9(%rbp), %rdi
movq %rdi, -0x150(%rbp)
callq 0x6910
movq -0x158(%rbp), %rsi
movq -0x150(%rbp), %rdx
leaq -0xe8(%rbp), %rdi
callq 0xab20
jmp 0x575d9
leaq -0xe8(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0xa6a0
jmp 0x575ee
leaq -0xe8(%rbp), %rdi
callq 0x6a08
leaq -0xe9(%rbp), %rdi
callq 0x65a0
jmp 0x576c1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x57631
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0xe8(%rbp), %rdi
callq 0x6a08
leaq -0xe9(%rbp), %rdi
callq 0x65a0
jmp 0x58225
movq 0x219a7(%rip), %rdi     # 0x78ff0
movq 0x21940(%rip), %rsi     # 0x78f90
callq 0x6570
movq %rax, -0x160(%rbp)
jmp 0x5765e
movq -0x160(%rbp), %rdi
leaq 0x39fe(%rip), %rsi      # 0x5b06a
callq 0x6520
movq %rax, -0x168(%rbp)
jmp 0x5767a
movq -0x168(%rbp), %rdi
movq 0x21908(%rip), %rsi     # 0x78f90
callq 0x6570
movq %rax, -0x170(%rbp)
jmp 0x57696
movq -0x170(%rbp), %rdi
movq 0x218ec(%rip), %rsi     # 0x78f90
callq 0x6570
jmp 0x576ab
movl $0x1, -0x4(%rbp)
movl $0x1, -0xc8(%rbp)
jmp 0x581f3
jmp 0x581e7
leaq 0x3e6c(%rip), %rsi      # 0x5b539
leaq -0xc0(%rbp), %rdi
callq 0x2dce0
movb %al, -0x171(%rbp)
jmp 0x576e1
movb -0x171(%rbp), %al
testb $0x1, %al
jne 0x576f0
jmp 0x577aa
movl -0x9c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x9c(%rbp)
movl -0x9c(%rbp), %eax
cmpl -0x8(%rbp), %eax
jge 0x57726
movq -0x10(%rbp), %rax
movslq -0x9c(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
leaq -0x30(%rbp), %rdi
callq 0x6710
jmp 0x57724
jmp 0x577a5
movq 0x218c3(%rip), %rdi     # 0x78ff0
movq 0x2185c(%rip), %rsi     # 0x78f90
callq 0x6570
movq %rax, -0x180(%rbp)
jmp 0x57742
movq -0x180(%rbp), %rdi
leaq 0x4b8a(%rip), %rsi      # 0x5c2da
callq 0x6520
movq %rax, -0x188(%rbp)
jmp 0x5775e
movq -0x188(%rbp), %rdi
movq 0x21824(%rip), %rsi     # 0x78f90
callq 0x6570
movq %rax, -0x190(%rbp)
jmp 0x5777a
movq -0x190(%rbp), %rdi
movq 0x21808(%rip), %rsi     # 0x78f90
callq 0x6570
jmp 0x5778f
movl $0x1, -0x4(%rbp)
movl $0x1, -0xc8(%rbp)
jmp 0x581f3
jmp 0x581e5
leaq 0x4923(%rip), %rsi      # 0x5c0d4
leaq -0xc0(%rbp), %rdi
callq 0x2dce0
movb %al, -0x191(%rbp)
jmp 0x577c5
movb -0x191(%rbp), %al
testb $0x1, %al
jne 0x577d4
jmp 0x579f3
movl -0x9c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x9c(%rbp)
movl -0x9c(%rbp), %eax
cmpl -0x8(%rbp), %eax
jge 0x578ea
movq -0x10(%rbp), %rax
movslq -0x9c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x4c020
movq %rax, -0x1a0(%rbp)
jmp 0x5780f
movq -0x1a0(%rbp), %rax
movl %eax, -0x78(%rbp)
jmp 0x578e8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
movl -0x44(%rbp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0x58225
movq -0x40(%rbp), %rdi
callq 0x6200
movq %rax, -0xf8(%rbp)
movq 0x2179f(%rip), %rdi     # 0x78ff0
movq 0x21738(%rip), %rsi     # 0x78f90
callq 0x6570
movq %rax, -0x1a8(%rbp)
jmp 0x57866
movq -0x1a8(%rbp), %rdi
leaq 0x55e0(%rip), %rsi      # 0x5ce54
callq 0x6520
movq %rax, -0x1b0(%rbp)
jmp 0x57882
movq -0x1b0(%rbp), %rdi
movq 0x21700(%rip), %rsi     # 0x78f90
callq 0x6570
movq %rax, -0x1b8(%rbp)
jmp 0x5789e
movq -0x1b8(%rbp), %rdi
movq 0x216e4(%rip), %rsi     # 0x78f90
callq 0x6570
jmp 0x578b3
movl $0x1, -0x4(%rbp)
movl $0x1, -0xc8(%rbp)
callq 0x6860
jmp 0x578de
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
callq 0x6860
jmp 0x578e3
jmp 0x581f3
jmp 0x58225
jmp 0x57969
movq 0x216ff(%rip), %rdi     # 0x78ff0
movq 0x21698(%rip), %rsi     # 0x78f90
callq 0x6570
movq %rax, -0x1c0(%rbp)
jmp 0x57906
movq -0x1c0(%rbp), %rdi
leaq 0x5540(%rip), %rsi      # 0x5ce54
callq 0x6520
movq %rax, -0x1c8(%rbp)
jmp 0x57922
movq -0x1c8(%rbp), %rdi
movq 0x21660(%rip), %rsi     # 0x78f90
callq 0x6570
movq %rax, -0x1d0(%rbp)
jmp 0x5793e
movq -0x1d0(%rbp), %rdi
movq 0x21644(%rip), %rsi     # 0x78f90
callq 0x6570
jmp 0x57953
movl $0x1, -0x4(%rbp)
movl $0x1, -0xc8(%rbp)
jmp 0x581f3
cmpl $0x0, -0x78(%rbp)
jge 0x579ee
movq 0x2167a(%rip), %rdi     # 0x78ff0
movq 0x21613(%rip), %rsi     # 0x78f90
callq 0x6570
movq %rax, -0x1d8(%rbp)
jmp 0x5798b
movq -0x1d8(%rbp), %rdi
leaq 0x54e0(%rip), %rsi      # 0x5ce79
callq 0x6520
movq %rax, -0x1e0(%rbp)
jmp 0x579a7
movq -0x1e0(%rbp), %rdi
movq 0x215db(%rip), %rsi     # 0x78f90
callq 0x6570
movq %rax, -0x1e8(%rbp)
jmp 0x579c3
movq -0x1e8(%rbp), %rdi
movq 0x215bf(%rip), %rsi     # 0x78f90
callq 0x6570
jmp 0x579d8
movl $0x1, -0x4(%rbp)
movl $0x1, -0xc8(%rbp)
jmp 0x581f3
jmp 0x581e3
leaq 0x54ae(%rip), %rsi      # 0x5cea8
leaq -0xc0(%rbp), %rdi
callq 0x2dce0
movb %al, -0x1e9(%rbp)
jmp 0x57a0e
movb -0x1e9(%rbp), %al
testb $0x1, %al
jne 0x57a1d
jmp 0x57c3c
movl -0x9c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x9c(%rbp)
movl -0x9c(%rbp), %eax
cmpl -0x8(%rbp), %eax
jge 0x57b33
movq -0x10(%rbp), %rax
movslq -0x9c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x4c020
movq %rax, -0x1f8(%rbp)
jmp 0x57a58
movq -0x1f8(%rbp), %rax
movl %eax, -0x7c(%rbp)
jmp 0x57b31
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
movl -0x44(%rbp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0x58225
movq -0x40(%rbp), %rdi
callq 0x6200
movq %rax, -0x100(%rbp)
movq 0x21556(%rip), %rdi     # 0x78ff0
movq 0x214ef(%rip), %rsi     # 0x78f90
callq 0x6570
movq %rax, -0x200(%rbp)
jmp 0x57aaf
movq -0x200(%rbp), %rdi
leaq 0x5397(%rip), %rsi      # 0x5ce54
callq 0x6520
movq %rax, -0x208(%rbp)
jmp 0x57acb
movq -0x208(%rbp), %rdi
movq 0x214b7(%rip), %rsi     # 0x78f90
callq 0x6570
movq %rax, -0x210(%rbp)
jmp 0x57ae7
movq -0x210(%rbp), %rdi
movq 0x2149b(%rip), %rsi     # 0x78f90
callq 0x6570
jmp 0x57afc
movl $0x1, -0x4(%rbp)
movl $0x1, -0xc8(%rbp)
callq 0x6860
jmp 0x57b27
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
callq 0x6860
jmp 0x57b2c
jmp 0x581f3
jmp 0x58225
jmp 0x57bb2
movq 0x214b6(%rip), %rdi     # 0x78ff0
movq 0x2144f(%rip), %rsi     # 0x78f90
callq 0x6570
movq %rax, -0x218(%rbp)
jmp 0x57b4f
movq -0x218(%rbp), %rdi
leaq 0x52f7(%rip), %rsi      # 0x5ce54
callq 0x6520
movq %rax, -0x220(%rbp)
jmp 0x57b6b
movq -0x220(%rbp), %rdi
movq 0x21417(%rip), %rsi     # 0x78f90
callq 0x6570
movq %rax, -0x228(%rbp)
jmp 0x57b87
movq -0x228(%rbp), %rdi
movq 0x213fb(%rip), %rsi     # 0x78f90
callq 0x6570
jmp 0x57b9c
movl $0x1, -0x4(%rbp)
movl $0x1, -0xc8(%rbp)
jmp 0x581f3
cmpl $0x0, -0x7c(%rbp)
jge 0x57c37
movq 0x21431(%rip), %rdi     # 0x78ff0
movq 0x213ca(%rip), %rsi     # 0x78f90
callq 0x6570
movq %rax, -0x230(%rbp)
jmp 0x57bd4
movq -0x230(%rbp), %rdi
leaq 0x52c9(%rip), %rsi      # 0x5ceab
callq 0x6520
movq %rax, -0x238(%rbp)
jmp 0x57bf0
movq -0x238(%rbp), %rdi
movq 0x21392(%rip), %rsi     # 0x78f90
callq 0x6570
movq %rax, -0x240(%rbp)
jmp 0x57c0c
movq -0x240(%rbp), %rdi
movq 0x21376(%rip), %rsi     # 0x78f90
callq 0x6570
jmp 0x57c21
movl $0x1, -0x4(%rbp)
movl $0x1, -0xc8(%rbp)
jmp 0x581f3
jmp 0x581e1
leaq 0x36d0(%rip), %rsi      # 0x5b313
leaq -0xc0(%rbp), %rdi
callq 0x2dce0
movb %al, -0x241(%rbp)
jmp 0x57c57
movb -0x241(%rbp), %al
testb $0x1, %al
jne 0x57c66
jmp 0x57e9e
movl -0x9c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x9c(%rbp)
movl -0x9c(%rbp), %eax
cmpl -0x8(%rbp), %eax
jge 0x57d80
movq -0x10(%rbp), %rax
movslq -0x9c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x4c0c0
movss %xmm0, -0x248(%rbp)
jmp 0x57ca2
movss -0x248(%rbp), %xmm0
movss %xmm0, -0x70(%rbp)
jmp 0x57d7e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
movl -0x44(%rbp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0x58225
movq -0x40(%rbp), %rdi
callq 0x6200
movq %rax, -0x108(%rbp)
movq 0x21309(%rip), %rdi     # 0x78ff0
movq 0x212a2(%rip), %rsi     # 0x78f90
callq 0x6570
movq %rax, -0x250(%rbp)
jmp 0x57cfc
movq -0x250(%rbp), %rdi
leaq 0x360c(%rip), %rsi      # 0x5b316
callq 0x6520
movq %rax, -0x258(%rbp)
jmp 0x57d18
movq -0x258(%rbp), %rdi
movq 0x2126a(%rip), %rsi     # 0x78f90
callq 0x6570
movq %rax, -0x260(%rbp)
jmp 0x57d34
movq -0x260(%rbp), %rdi
movq 0x2124e(%rip), %rsi     # 0x78f90
callq 0x6570
jmp 0x57d49
movl $0x1, -0x4(%rbp)
movl $0x1, -0xc8(%rbp)
callq 0x6860
jmp 0x57d74
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
callq 0x6860
jmp 0x57d79
jmp 0x581f3
jmp 0x58225
jmp 0x57dff
movq 0x21269(%rip), %rdi     # 0x78ff0
movq 0x21202(%rip), %rsi     # 0x78f90
callq 0x6570
movq %rax, -0x268(%rbp)
jmp 0x57d9c
movq -0x268(%rbp), %rdi
leaq 0x356c(%rip), %rsi      # 0x5b316
callq 0x6520
movq %rax, -0x270(%rbp)
jmp 0x57db8
movq -0x270(%rbp), %rdi
movq 0x211ca(%rip), %rsi     # 0x78f90
callq 0x6570
movq %rax, -0x278(%rbp)
jmp 0x57dd4
movq -0x278(%rbp), %rdi
movq 0x211ae(%rip), %rsi     # 0x78f90
callq 0x6570
jmp 0x57de9
movl $0x1, -0x4(%rbp)
movl $0x1, -0xc8(%rbp)
jmp 0x581f3
xorps %xmm0, %xmm0
ucomiss -0x70(%rbp), %xmm0
ja 0x57e1a
movss -0x70(%rbp), %xmm0
movss 0x11ef(%rip), %xmm1     # 0x59004
ucomiss %xmm1, %xmm0
jbe 0x57e99
movq 0x211cf(%rip), %rdi     # 0x78ff0
movq 0x21168(%rip), %rsi     # 0x78f90
callq 0x6570
movq %rax, -0x280(%rbp)
jmp 0x57e36
movq -0x280(%rbp), %rdi
leaq 0x3500(%rip), %rsi      # 0x5b344
callq 0x6520
movq %rax, -0x288(%rbp)
jmp 0x57e52
movq -0x288(%rbp), %rdi
movq 0x21130(%rip), %rsi     # 0x78f90
callq 0x6570
movq %rax, -0x290(%rbp)
jmp 0x57e6e
movq -0x290(%rbp), %rdi
movq 0x21114(%rip), %rsi     # 0x78f90
callq 0x6570
jmp 0x57e83
movl $0x1, -0x4(%rbp)
movl $0x1, -0xc8(%rbp)
jmp 0x581f3
jmp 0x581df
leaq 0x5035(%rip), %rsi      # 0x5ceda
leaq -0xc0(%rbp), %rdi
callq 0x2dce0
movb %al, -0x291(%rbp)
jmp 0x57eb9
movb -0x291(%rbp), %al
testb $0x1, %al
jne 0x57ec8
jmp 0x58100
movl -0x9c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x9c(%rbp)
movl -0x9c(%rbp), %eax
cmpl -0x8(%rbp), %eax
jge 0x57fe2
movq -0x10(%rbp), %rax
movslq -0x9c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x4c0c0
movss %xmm0, -0x298(%rbp)
jmp 0x57f04
movss -0x298(%rbp), %xmm0
movss %xmm0, -0x74(%rbp)
jmp 0x57fe0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
movl -0x44(%rbp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0x58225
movq -0x40(%rbp), %rdi
callq 0x6200
movq %rax, -0x110(%rbp)
movq 0x210a7(%rip), %rdi     # 0x78ff0
movq 0x21040(%rip), %rsi     # 0x78f90
callq 0x6570
movq %rax, -0x2a0(%rbp)
jmp 0x57f5e
movq -0x2a0(%rbp), %rdi
leaq 0x4f71(%rip), %rsi      # 0x5cedd
callq 0x6520
movq %rax, -0x2a8(%rbp)
jmp 0x57f7a
movq -0x2a8(%rbp), %rdi
movq 0x21008(%rip), %rsi     # 0x78f90
callq 0x6570
movq %rax, -0x2b0(%rbp)
jmp 0x57f96
movq -0x2b0(%rbp), %rdi
movq 0x20fec(%rip), %rsi     # 0x78f90
callq 0x6570
jmp 0x57fab
movl $0x1, -0x4(%rbp)
movl $0x1, -0xc8(%rbp)
callq 0x6860
jmp 0x57fd6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
callq 0x6860
jmp 0x57fdb
jmp 0x581f3
jmp 0x58225
jmp 0x58061
movq 0x21007(%rip), %rdi     # 0x78ff0
movq 0x20fa0(%rip), %rsi     # 0x78f90
callq 0x6570
movq %rax, -0x2b8(%rbp)
jmp 0x57ffe
movq -0x2b8(%rbp), %rdi
leaq 0x4ed1(%rip), %rsi      # 0x5cedd
callq 0x6520
movq %rax, -0x2c0(%rbp)
jmp 0x5801a
movq -0x2c0(%rbp), %rdi
movq 0x20f68(%rip), %rsi     # 0x78f90
callq 0x6570
movq %rax, -0x2c8(%rbp)
jmp 0x58036
movq -0x2c8(%rbp), %rdi
movq 0x20f4c(%rip), %rsi     # 0x78f90
callq 0x6570
jmp 0x5804b
movl $0x1, -0x4(%rbp)
movl $0x1, -0xc8(%rbp)
jmp 0x581f3
xorps %xmm0, %xmm0
ucomiss -0x74(%rbp), %xmm0
ja 0x5807c
movss -0x74(%rbp), %xmm0
movss 0xf8d(%rip), %xmm1      # 0x59004
ucomiss %xmm1, %xmm0
jbe 0x580fb
movq 0x20f6d(%rip), %rdi     # 0x78ff0
movq 0x20f06(%rip), %rsi     # 0x78f90
callq 0x6570
movq %rax, -0x2d0(%rbp)
jmp 0x58098
movq -0x2d0(%rbp), %rdi
leaq 0x4e65(%rip), %rsi      # 0x5cf0b
callq 0x6520
movq %rax, -0x2d8(%rbp)
jmp 0x580b4
movq -0x2d8(%rbp), %rdi
movq 0x20ece(%rip), %rsi     # 0x78f90
callq 0x6570
movq %rax, -0x2e0(%rbp)
jmp 0x580d0
movq -0x2e0(%rbp), %rdi
movq 0x20eb2(%rip), %rsi     # 0x78f90
callq 0x6570
jmp 0x580e5
movl $0x1, -0x4(%rbp)
movl $0x1, -0xc8(%rbp)
jmp 0x581f3
jmp 0x581dd
xorl %eax, %eax
movl %eax, %esi
leaq -0xc0(%rbp), %rdi
callq 0x69e0
movq %rax, -0x2e8(%rbp)
jmp 0x58119
movq -0x2e8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0x581c4
movq 0x20ebd(%rip), %rdi     # 0x78ff0
movq 0x20e56(%rip), %rsi     # 0x78f90
callq 0x6570
movq %rax, -0x2f0(%rbp)
jmp 0x58148
movq -0x2f0(%rbp), %rdi
leaq 0x2f36(%rip), %rsi      # 0x5b08c
callq 0x6520
movq %rax, -0x2f8(%rbp)
jmp 0x58164
movq -0x2f8(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x64d0
movq %rax, -0x300(%rbp)
jmp 0x58180
movq -0x300(%rbp), %rdi
movq 0x20e02(%rip), %rsi     # 0x78f90
callq 0x6570
movq %rax, -0x308(%rbp)
jmp 0x5819c
movq -0x308(%rbp), %rdi
movq 0x20de6(%rip), %rsi     # 0x78f90
callq 0x6570
jmp 0x581b1
movl $0x1, -0x4(%rbp)
movl $0x1, -0xc8(%rbp)
jmp 0x581f3
leaq -0x98(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0xabd0
jmp 0x581d9
jmp 0x581db
jmp 0x581dd
jmp 0x581df
jmp 0x581e1
jmp 0x581e3
jmp 0x581e5
jmp 0x581e7
jmp 0x581e9
movl $0x0, -0xc8(%rbp)
leaq -0xc0(%rbp), %rdi
callq 0x6a08
movl -0xc8(%rbp), %eax
testl %eax, %eax
jne 0x585d7
jmp 0x5820f
jmp 0x58211
movl -0x9c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x9c(%rbp)
jmp 0x5741f
leaq -0xc0(%rbp), %rdi
callq 0x6a08
jmp 0x58601
leaq -0x98(%rbp), %rdi
callq 0xb670
cmpq $0x1, %rax
jae 0x582c3
movq 0x20da1(%rip), %rdi     # 0x78ff0
movq 0x20d3a(%rip), %rsi     # 0x78f90
callq 0x6570
movq %rax, -0x310(%rbp)
jmp 0x58264
movq -0x310(%rbp), %rdi
leaq 0x2e2d(%rip), %rsi      # 0x5b09f
callq 0x6520
movq %rax, -0x318(%rbp)
jmp 0x58280
movq -0x318(%rbp), %rdi
movq 0x20d02(%rip), %rsi     # 0x78f90
callq 0x6570
jmp 0x58295
callq 0x571f0
jmp 0x5829c
movl $0x1, -0x4(%rbp)
movl $0x1, -0xc8(%rbp)
jmp 0x585d7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x58601
leaq 0x1fe8(%rip), %rsi      # 0x5a2b2
leaq -0x30(%rbp), %rdi
callq 0x2dce0
movb %al, -0x319(%rbp)
jmp 0x582db
movb -0x319(%rbp), %al
testb $0x1, %al
jne 0x582ea
jmp 0x58370
movss -0x70(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x58370
jp 0x58370
cmpl $0x0, -0x78(%rbp)
jne 0x58370
movss -0x74(%rbp), %xmm0
movss 0xcf8(%rip), %xmm1      # 0x59004
ucomiss %xmm1, %xmm0
jne 0x58370
jp 0x58370
movss -0x74(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x58370
jp 0x58370
movq 0x20cc7(%rip), %rdi     # 0x78ff0
leaq 0x4c06(%rip), %rsi      # 0x5cf36
callq 0x6520
movq %rax, -0x328(%rbp)
jmp 0x5833e
movq -0x328(%rbp), %rdi
movq 0x20c44(%rip), %rsi     # 0x78f90
callq 0x6570
jmp 0x58353
callq 0x571f0
jmp 0x5835a
movl $0x1, -0x4(%rbp)
movl $0x1, -0xc8(%rbp)
jmp 0x585d7
movss -0x70(%rbp), %xmm0
ucomiss -0x74(%rbp), %xmm0
jb 0x583c9
movq 0x20c6e(%rip), %rdi     # 0x78ff0
leaq 0x4bfb(%rip), %rsi      # 0x5cf84
callq 0x6520
movq %rax, -0x330(%rbp)
jmp 0x58397
movq -0x330(%rbp), %rdi
movq 0x20beb(%rip), %rsi     # 0x78f90
callq 0x6570
jmp 0x583ac
callq 0x571f0
jmp 0x583b3
movl $0x1, -0x4(%rbp)
movl $0x1, -0xc8(%rbp)
jmp 0x585d7
movl -0x78(%rbp), %eax
cmpl -0x7c(%rbp), %eax
jl 0x58425
cmpl $0x0, -0x7c(%rbp)
je 0x58425
movq 0x20c12(%rip), %rdi     # 0x78ff0
leaq 0x4bd0(%rip), %rsi      # 0x5cfb5
callq 0x6520
movq %rax, -0x338(%rbp)
jmp 0x583f3
movq -0x338(%rbp), %rdi
movq 0x20b8f(%rip), %rsi     # 0x78f90
callq 0x6570
jmp 0x58408
callq 0x571f0
jmp 0x5840f
movl $0x1, -0x4(%rbp)
movl $0x1, -0xc8(%rbp)
jmp 0x585d7
callq 0x4c460
jmp 0x5842c
movq 0x20b75(%rip), %rdi     # 0x78fa8
leaq 0x4ba6(%rip), %rsi      # 0x5cfe0
callq 0x6520
movq %rax, -0x340(%rbp)
jmp 0x58448
movq -0x340(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x64d0
movq %rax, -0x348(%rbp)
jmp 0x58461
movq -0x348(%rbp), %rdi
movq 0x20b21(%rip), %rsi     # 0x78f90
callq 0x6570
jmp 0x58476
movq 0x20b2b(%rip), %rdi     # 0x78fa8
leaq 0x4b6e(%rip), %rsi      # 0x5cff2
callq 0x6520
jmp 0x5848b
leaq -0x98(%rbp), %rdi
callq 0xb670
movslq 0x211a2(%rip), %rcx     # 0x79640
cmpq %rcx, %rax
jbe 0x584e1
leaq -0x98(%rbp), %rdi
callq 0xb670
movq %rax, %rsi
movq 0x20aef(%rip), %rdi     # 0x78fa8
callq 0x6120
movq %rax, -0x350(%rbp)
jmp 0x584c7
movq -0x350(%rbp), %rdi
leaq 0x25e4(%rip), %rsi      # 0x5aab9
callq 0x6520
jmp 0x584dc
jmp 0x5856b
leaq -0x98(%rbp), %rdi
callq 0xb4c0
movq %rax, -0x118(%rbp)
leaq -0x98(%rbp), %rdi
callq 0xb340
movq %rax, -0x120(%rbp)
leaq -0x118(%rbp), %rdi
leaq -0x120(%rbp), %rsi
callq 0x4a690
testb $0x1, %al
jne 0x58520
jmp 0x58569
leaq -0x118(%rbp), %rdi
callq 0x30840
movq %rax, %rsi
movq 0x20a72(%rip), %rdi     # 0x78fa8
callq 0x64d0
movq %rax, -0x358(%rbp)
jmp 0x58544
movq -0x358(%rbp), %rdi
leaq 0x1dfb(%rip), %rsi      # 0x5a34d
callq 0x6520
jmp 0x58559
jmp 0x5855b
leaq -0x118(%rbp), %rdi
callq 0x4a6d0
jmp 0x584f4
jmp 0x5856b
movq 0x20a36(%rip), %rdi     # 0x78fa8
movq 0x20a17(%rip), %rsi     # 0x78f90
callq 0x6570
jmp 0x58580
movss -0x70(%rbp), %xmm0
movss -0x74(%rbp), %xmm1
movl -0x78(%rbp), %edx
movl -0x7c(%rbp), %ecx
leaq -0x98(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x49080
movl %eax, -0x35c(%rbp)
jmp 0x585a8
movl -0x35c(%rbp), %eax
cmpl $0x0, %eax
je 0x585c6
movl $0x1, -0x4(%rbp)
movl $0x1, -0xc8(%rbp)
jmp 0x585d7
movl $0x0, -0x4(%rbp)
movl $0x1, -0xc8(%rbp)
leaq -0x98(%rbp), %rdi
callq 0xfe90
leaq -0x68(%rbp), %rdi
callq 0x6a08
leaq -0x30(%rbp), %rdi
callq 0x6a08
movl -0x4(%rbp), %eax
addq $0x360, %rsp            # imm = 0x360
popq %rbp
retq
leaq -0x98(%rbp), %rdi
callq 0xfe90
leaq -0x68(%rbp), %rdi
callq 0x6a08
leaq -0x30(%rbp), %rdi
callq 0x6a08
movq -0x40(%rbp), %rdi
callq 0x6900
movq %rax, %rdi
callq 0x9b50