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

	std::string outfile="fastq";
	long int covcutoff=4;
	long int filecovcutoff=2;
	long int kmersize=15;
	long int minquality=20;
	bool printalleles=false;
	float minmaf=0.2;
	std::vector < std::string > args;

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

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

		if (arg=="-h" || arg=="--help"){
			fastqHelp();
			return 0;
		}
		else if (arg=="-a"){
			printalleles=true;
		}
		else if (arg == "-c"){
			i++;
			if (i<argc){
				try {
					covcutoff = getint(argv[i]);
				}
				catch (const std::invalid_argument& e) {
					std::cerr << std::endl << "Expecting positive integer after -c flag" << std::endl << std::endl;
					return 1;
				}
			}
			else {
				std::cerr << std::endl << "Expecting positive integer after -c flag" << std::endl << std::endl;
				return 1;
			}
			if (covcutoff < MinCov){
				std::cerr << std::endl << "Coverage cutoff must be a positive integer greater than or equal to " << MinCov << std::endl << std::endl;
				return 1;
			}
		}
		else if (arg == "-C"){
			i++;
			if (i<argc){
				try {
					filecovcutoff = getint(argv[i]);
				}
				catch (const std::invalid_argument& e) {
					std::cerr << std::endl << "Expecting positive integer after -C flag" << std::endl << std::endl;
					return 1;
				}
			}
			else {
				std::cerr << std::endl << "Expecting positive integer after -C flag" << std::endl << std::endl;
				return 1;
			}
			if (filecovcutoff < MinFileCov){
				std::cerr << std::endl << "File coverage cutoff must be a positive integer greater than or equal to " << MinFileCov << std::endl << std::endl;
				return 1;
			}
		}
		else if (arg == "-k"){
			i++;
			if (i<argc){
				try {
					kmersize = getint(argv[i]);
				}
				catch (const std::invalid_argument& e) {
					std::cerr << std::endl << "Expecting positive integer after -k flag" << std::endl << std::endl;
					return 1;
				}
			}
			else {
				std::cerr << std::endl << "Expecting positive integer after -k flag" << std::endl << std::endl;
				return 1;
			}
			if (kmersize < MinKmer || kmersize > MaxKmer || kmersize % 3 != 0){
				std::cerr << std::endl << "Kmer size must be a positive integer between " << MinKmer << " and " << MaxKmer << " and must be divisible by 3" << std::endl << std::endl;
				return 1;
			}
		}
		else if (arg == "-m"){
			i++;
			if (i<argc){
				try {
					minmaf = getfloat(argv[i]);
				}
				catch (const std::invalid_argument& e) {
					std::cerr << std::endl << "Expecting float between 0 and 1 after -m flag" << std::endl << std::endl;
					return 1;
				}
			}
			else {
				std::cerr << std::endl << "Expecting float between 0 and 1 after -m flag" << std::endl << std::endl;
				return 1;
			}
			if (minmaf < 0 || minmaf > 1){
				std::cerr << std::endl << "Minimum minor allele frequency must be between 0 and 1" << std::endl << std::endl;
				return 1;
			}
		}
		else if (arg == "-o"){
			i++;
			if (i<argc){
				outfile = std::string(argv[i]);
			}
			else {
				std::cerr << std::endl << "Expecting file name after -o flag" << std::endl << std::endl;
				return 1;
			}
		}
		else if (arg == "-q"){
			i++;
			if (i<argc){
				try {
					minquality = getint(argv[i]);
				}
				catch (const std::invalid_argument& e) {
					std::cerr << std::endl << "Expecting positive integer after -q flag" << std::endl << std::endl;
					return 1;
				}
			}
			else {
				std::cerr << std::endl << "Expecting positive integer after -q flag" << std::endl << std::endl;
				return 1;
			}
			if (minquality < MinQual || minquality > MaxQual){
				std::cerr << std::endl << "Minimum quality cutoff must be a positive integer between " << MinQual << " and " << MaxQual << 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;
		fastqHelp();
		return 1;
	}

	skaVersion();

	std::cout << "Creating split " << kmersize << "mers for ";
	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;
	std::cout << "Filters:" << std::endl;
	std::cout << "\tCoverage cutoff = " << covcutoff << std::endl;
	std::cout << "\tPer file coverage cutoff = " << filecovcutoff << std::endl;
	std::cout << "\tMinimum minor allele frequency = " << minmaf << std::endl;
	std::cout << "\tMinimum base quality = " << minquality << std::endl;
	std::cout << "Output will be written to " << outfile << ".skf" << std::endl;
	if (printalleles){
		std::cout << "Allele frequencies will be written to " << outfile << "_alleles.tsv" << std::endl;
	}

	std::cout << std::endl;

	if (fastqToKmers(args, outfile, kmersize, minquality, filecovcutoff, covcutoff, minmaf, printalleles)){return 1;}

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movq %rsi, 0x8(%rsp)
movl %edi, %ebx
leaq 0x70(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0xad78(%rip), %rsi      # 0x3601f
leaq 0xad76(%rip), %rdx      # 0x36024
leaq 0x60(%rsp), %rdi
callq 0x85fc
movl $0x3e4ccccd, 0x10(%rsp) # imm = 0x3E4CCCCD
xorps %xmm0, %xmm0
movaps %xmm0, 0x40(%rsp)
movq $0x0, 0x50(%rsp)
cmpl $0x3, %ebx
jl 0x2bf71
movl $0xf, %eax
movq %rax, 0x20(%rsp)
movl $0x14, %eax
movq %rax, 0x18(%rsp)
movl $0x2, %r12d
movl $0x2, %eax
movq %rax, 0x28(%rsp)
movl $0x4, %eax
movq %rax, 0x30(%rsp)
movl $0x0, 0x14(%rsp)
leaq 0xa8(%rsp), %rbp
movslq %r12d, %rax
movq 0x8(%rsp), %rcx
movq (%rcx,%rax,8), %rsi
leaq 0x80(%rsp), %r15
movq %r15, %rdi
movq %rbp, %rdx
callq 0x182e0
movq %r15, %rdi
leaq 0x9cde(%rip), %rsi      # 0x3501f
callq 0x50f0
testl %eax, %eax
je 0x2b46a
movq %r15, %rdi
leaq 0x9cca(%rip), %rsi      # 0x35022
callq 0x50f0
testl %eax, %eax
je 0x2b46a
movq %r15, %rdi
leaq 0xacb6(%rip), %rsi      # 0x36025
callq 0x50f0
movb $0x1, %r13b
testl %eax, %eax
je 0x2b4b4
movq %r15, %rdi
leaq 0xa626(%rip), %rsi      # 0x359af
callq 0x50f0
testl %eax, %eax
je 0x2b4bc
movq %r15, %rdi
leaq 0xacf6(%rip), %rsi      # 0x36096
callq 0x50f0
testl %eax, %eax
je 0x2b5aa
movq %r15, %rdi
leaq 0x9c72(%rip), %rsi      # 0x35029
callq 0x50f0
testl %eax, %eax
je 0x2b737
movq %r15, %rdi
leaq 0xad3e(%rip), %rsi      # 0x3610c
callq 0x50f0
testl %eax, %eax
je 0x2b933
movq %r15, %rdi
leaq 0x9f44(%rip), %rsi      # 0x35329
callq 0x50f0
testl %eax, %eax
je 0x2ba96
movq %r15, %rdi
leaq 0xa320(%rip), %rsi      # 0x3571c
callq 0x50f0
testl %eax, %eax
je 0x2bb98
movq 0x80(%rsp), %rax
cmpb $0x2d, (%rax)
jne 0x2bc49
movq 0x15bcf(%rip), %rdi     # 0x40ff0
callq 0x5190
movq %rax, %r14
movl $0x12, %edx
movq %rax, %rdi
leaq 0x9c8c(%rip), %rsi      # 0x350c4
callq 0x5420
movq 0x80(%rsp), %rsi
movq 0x88(%rsp), %rdx
movq %r14, %rdi
callq 0x5420
movq %rax, %rdi
callq 0x5190
movq %rax, %rdi
callq 0x5190
jmp 0x2bd2f
xorl %r13d, %r13d
callq 0x2af63
xorl %r14d, %r14d
movq 0x80(%rsp), %rdi
leaq 0x90(%rsp), %rax
cmpq %rax, %rdi
je 0x2b49a
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x53c0
testb %r13b, %r13b
je 0x2c35d
incl %r12d
cmpl %ebx, %r12d
jl 0x2b318
jmp 0x2becf
movb $0x1, %al
movl %eax, 0x14(%rsp)
jmp 0x2b475
incl %r12d
cmpl %ebx, %r12d
jge 0x2b698
movslq %r12d, %rax
movq 0x8(%rsp), %rcx
movq (%rcx,%rax,8), %rdi
callq 0x25cfc
movq %rax, %r15
movslq 0x16009(%rip), %rax     # 0x414ec
cmpq %rax, %r15
jge 0x2b5a0
movq 0x15afd(%rip), %rcx     # 0x40ff0
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq 0x15adf(%rip), %rdi     # 0x40ff0
callq 0x5030
movq %rax, %rdi
callq 0x5250
movq %rax, %r14
movl $0x44, %edx
movq %rax, %rdi
leaq 0xab21(%rip), %rsi      # 0x36051
callq 0x5420
movl 0x15fb1(%rip), %esi     # 0x414ec
movq %r14, %rdi
callq 0x5690
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq %r14, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5250
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq %r14, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5250
movl $0x1, %r14d
xorl %r13d, %r13d
movq %r15, 0x30(%rsp)
jmp 0x2b475
incl %r12d
cmpl %ebx, %r12d
jge 0x2b894
movslq %r12d, %rax
movq 0x8(%rsp), %rcx
movq (%rcx,%rax,8), %rdi
callq 0x25cfc
movq %rax, %r15
movslq 0x15fb7(%rip), %rax     # 0x41588
cmpq %rax, %r15
jge 0x2b68e
movq 0x15a0f(%rip), %rcx     # 0x40ff0
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq 0x159f1(%rip), %rdi     # 0x40ff0
callq 0x5030
movq %rax, %rdi
callq 0x5250
movq %rax, %r14
movl $0x49, %edx
movq %rax, %rdi
leaq 0xaaa4(%rip), %rsi      # 0x360c2
callq 0x5420
movl 0x15f5f(%rip), %esi     # 0x41588
movq %r14, %rdi
callq 0x5690
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq %r14, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5250
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq %r14, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5250
movl $0x1, %r14d
xorl %r13d, %r13d
movq %r15, 0x28(%rsp)
jmp 0x2b475
movq 0x15951(%rip), %rcx     # 0x40ff0
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq 0x15933(%rip), %rdi     # 0x40ff0
callq 0x5030
movq %rax, %rdi
callq 0x5250
movq %rax, %r14
movl $0x28, %edx
movq %rax, %rdi
leaq 0xa94c(%rip), %rsi      # 0x36028
callq 0x5420
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq %r14, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5250
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq %r14, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5250
jmp 0x2bd2f
incl %r12d
cmpl %ebx, %r12d
jge 0x2b9f7
movslq %r12d, %rax
movq 0x8(%rsp), %rcx
movq (%rcx,%rax,8), %rdi
callq 0x25cfc
movq %rax, %r15
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rcx, %rax
movabsq $0x2aaaaaaaaaaaaaaa, %rcx # imm = 0x2AAAAAAAAAAAAAAA
addq %rcx, %rax
movabsq $0x5555555555555554, %rcx # imm = 0x5555555555555554
cmpq %rcx, %rax
ja 0x2b79d
movslq 0x15d58(%rip), %rax     # 0x414e0
cmpq %rax, %r15
jl 0x2b79d
movslq 0x15d50(%rip), %rax     # 0x414e4
cmpq %rax, %r15
jle 0x2b88a
movq 0x1584c(%rip), %rcx     # 0x40ff0
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq 0x1582e(%rip), %rdi     # 0x40ff0
callq 0x5030
movq %rax, %rdi
callq 0x5250
movq %rax, %r14
movl $0x2d, %edx
movq %rax, %rdi
leaq 0x9874(%rip), %rsi      # 0x35055
callq 0x5420
movl 0x15cf4(%rip), %esi     # 0x414e0
movq %r14, %rdi
callq 0x5690
movq %rax, %r14
movl $0x5, %edx
movq %rax, %rdi
leaq 0x8dab(%rip), %rsi      # 0x345b1
callq 0x5420
movl 0x15cd3(%rip), %esi     # 0x414e4
movq %r14, %rdi
callq 0x5690
movq %rax, %r14
movl $0x1b, %edx
movq %rax, %rdi
leaq 0x9858(%rip), %rsi      # 0x35083
callq 0x5420
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq %r14, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5250
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq %r14, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5250
movl $0x1, %r14d
xorl %r13d, %r13d
movq %r15, 0x20(%rsp)
jmp 0x2b475
movq 0x15755(%rip), %rcx     # 0x40ff0
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq 0x15737(%rip), %rdi     # 0x40ff0
callq 0x5030
movq %rax, %rdi
callq 0x5250
movq %rax, %r14
movl $0x28, %edx
movq %rax, %rdi
leaq 0xa7c1(%rip), %rsi      # 0x36099
callq 0x5420
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq %r14, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5250
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq %r14, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5250
jmp 0x2bd2f
incl %r12d
cmpl %ebx, %r12d
jge 0x2baf9
movslq %r12d, %rax
movq 0x8(%rsp), %rcx
movq (%rcx,%rax,8), %rdi
callq 0x25d65
movss %xmm0, 0x10(%rsp)
xorps %xmm1, %xmm1
ucomiss %xmm0, %xmm1
ja 0x2b96b
ucomiss 0x769f(%rip), %xmm0     # 0x33004
jbe 0x2b475
movq 0x1567e(%rip), %rcx     # 0x40ff0
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq 0x15660(%rip), %rdi     # 0x40ff0
callq 0x5030
movq %rax, %rdi
callq 0x5250
movq %rax, %r14
movl $0x36, %edx
movq %rax, %rdi
leaq 0xa78e(%rip), %rsi      # 0x3613d
callq 0x5420
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq %r14, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5250
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x53a0
jmp 0x2bb80
movq 0x155f2(%rip), %rcx     # 0x40ff0
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq 0x155d4(%rip), %rdi     # 0x40ff0
callq 0x5030
movq %rax, %rdi
callq 0x5250
movq %rax, %r14
movl $0x28, %edx
movq %rax, %rdi
leaq 0x95f1(%rip), %rsi      # 0x3502c
callq 0x5420
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq %r14, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5250
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq %r14, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5250
jmp 0x2bd2f
incl %r12d
cmpl %ebx, %r12d
jge 0x2bc60
movslq %r12d, %rax
movq 0x8(%rsp), %rcx
movq (%rcx,%rax,8), %rsi
movq %rbp, %r15
movq %rbp, %rdi
leaq 0x3c(%rsp), %rdx
callq 0x182e0
leaq 0x60(%rsp), %rdi
movq %r15, %rsi
callq 0x5470
movq 0xa8(%rsp), %rdi
leaq 0xb8(%rsp), %rax
cmpq %rax, %rdi
je 0x2b475
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x53c0
jmp 0x2b475
movq 0x154f0(%rip), %rcx     # 0x40ff0
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq 0x154d2(%rip), %rdi     # 0x40ff0
callq 0x5030
movq %rax, %rdi
callq 0x5250
movq %rax, %r14
movl $0x2d, %edx
movq %rax, %rdi
leaq 0xa5d2(%rip), %rsi      # 0x3610f
callq 0x5420
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq %r14, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5250
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq %r14, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5250
jmp 0x2bd2f
incl %r12d
cmpl %ebx, %r12d
jge 0x2bcfc
movslq %r12d, %rax
movq 0x8(%rsp), %rcx
movq (%rcx,%rax,8), %rdi
callq 0x25cfc
movq %rax, %r15
movslq 0x159c5(%rip), %rax     # 0x41584
cmpq %rax, %r15
jl 0x2bbd0
movslq 0x1591d(%rip), %rax     # 0x414e8
cmpq %rax, %r15
jle 0x2bc3f
movq 0x15419(%rip), %rdi     # 0x40ff0
callq 0x5190
movq %rax, %r14
movl $0x3a, %edx
movq %rax, %rdi
leaq 0xa5af(%rip), %rsi      # 0x3619d
callq 0x5420
movl 0x1598b(%rip), %esi     # 0x41584
movq %r14, %rdi
callq 0x5690
movq %rax, %r14
movl $0x5, %edx
movq %rax, %rdi
leaq 0x899e(%rip), %rsi      # 0x345b1
callq 0x5420
movl 0x158ca(%rip), %esi     # 0x414e8
movq %r14, %rdi
callq 0x5690
movq %rax, %rdi
callq 0x5190
movq %rax, %rdi
callq 0x5190
movl $0x1, %r14d
xorl %r13d, %r13d
movq %r15, 0x18(%rsp)
jmp 0x2b475
leaq 0x40(%rsp), %rdi
leaq 0x80(%rsp), %rsi
callq 0x8528
jmp 0x2b475
movq 0x15389(%rip), %rcx     # 0x40ff0
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq 0x1536b(%rip), %rdi     # 0x40ff0
callq 0x5030
movq %rax, %rdi
callq 0x5250
movq %rax, %r14
movl $0x21, %edx
movq %rax, %rdi
leaq 0x98d0(%rip), %rsi      # 0x35574
callq 0x5420
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq %r14, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5250
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq %r14, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5250
jmp 0x2bd2f
movq 0x152ed(%rip), %rdi     # 0x40ff0
callq 0x5190
movq %rax, %r14
movl $0x28, %edx
movq %rax, %rdi
leaq 0xa45a(%rip), %rsi      # 0x36174
callq 0x5420
movq %r14, %rdi
callq 0x5190
movq %rax, %rdi
callq 0x5190
movl $0x1, %r14d
xorl %r13d, %r13d
jmp 0x2b475
movq %rax, %r14
cmpl $0x1, %edx
jne 0x2c3f1
movq %r14, %rdi
callq 0x5160
movq 0x15298(%rip), %rdi     # 0x40ff0
callq 0x5190
movq %rax, %r14
movl $0x28, %edx
movq %rax, %rdi
leaq 0xa405(%rip), %rsi      # 0x36174
callq 0x5420
movq %r14, %rdi
callq 0x5190
movq %rax, %rdi
callq 0x5190
callq 0x5630
jmp 0x2bd2f
movq %rax, %r14
cmpl $0x1, %edx
jne 0x2c3f1
movq %r14, %rdi
callq 0x5160
movq 0x1524a(%rip), %rdi     # 0x40ff0
callq 0x5190
movq %rax, %r14
movl $0x2d, %edx
movq %rax, %rdi
leaq 0xa352(%rip), %rsi      # 0x3610f
callq 0x5420
movq %r14, %rdi
callq 0x5190
movq %rax, %rdi
callq 0x5190
callq 0x5630
jmp 0x2bd2f
movq %rax, %r14
cmpl $0x1, %edx
jne 0x2c3f1
movq %r14, %rdi
callq 0x5160
movq 0x151f9(%rip), %rdi     # 0x40ff0
callq 0x5190
movq %rax, %r14
movl $0x28, %edx
movq %rax, %rdi
leaq 0x921e(%rip), %rsi      # 0x3502c
callq 0x5420
movq %r14, %rdi
callq 0x5190
movq %rax, %rdi
callq 0x5190
callq 0x5630
jmp 0x2bd2f
movq %rax, %r14
cmpl $0x1, %edx
jne 0x2c3f1
movq %r14, %rdi
callq 0x5160
movq 0x151a8(%rip), %rdi     # 0x40ff0
callq 0x5190
movq %rax, %r14
movl $0x28, %edx
movq %rax, %rdi
leaq 0xa23a(%rip), %rsi      # 0x36099
callq 0x5420
movq %r14, %rdi
callq 0x5190
movq %rax, %rdi
callq 0x5190
callq 0x5630
jmp 0x2bd2f
movq %rax, %r14
cmpl $0x1, %edx
jne 0x2c3f1
movq %r14, %rdi
callq 0x5160
movq 0x15157(%rip), %rdi     # 0x40ff0
callq 0x5190
movq %rax, %r14
movl $0x28, %edx
movq %rax, %rdi
leaq 0xa178(%rip), %rsi      # 0x36028
callq 0x5420
movq %r14, %rdi
callq 0x5190
movq %rax, %rdi
callq 0x5190
callq 0x5630
jmp 0x2bd2f
movq 0x48(%rsp), %rax
cmpq 0x40(%rsp), %rax
je 0x2bf71
callq 0x26352
movl 0x14(%rsp), %ebp
movq 0x150d1(%rip), %rdi     # 0x40fc0
leaq 0x91f3(%rip), %rsi      # 0x350e9
movl $0xf, %edx
callq 0x5420
movq 0x150b9(%rip), %rbx     # 0x40fc0
movq %rbx, %rdi
movq 0x20(%rsp), %rsi
callq 0x5390
leaq 0x78ba(%rip), %rsi      # 0x337d5
movl $0x9, %edx
movq %rax, %rdi
callq 0x5420
movq 0x40(%rsp), %r12
movq 0x48(%rsp), %rax
movq %rax, %rsi
subq %r12, %rsi
sarq $0x5, %rsi
movslq 0x155ad(%rip), %rcx     # 0x414f0
cmpq %rcx, %rsi
jbe 0x2bfee
movq 0x1506d(%rip), %rdi     # 0x40fc0
callq 0x5240
leaq 0x8b92(%rip), %rsi      # 0x34af1
movl $0x6, %edx
movq %rax, %rdi
callq 0x5420
jmp 0x2c02d
movq 0x15078(%rip), %rdi     # 0x40ff0
movq (%rdi), %rax
addq -0x18(%rax), %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq 0x1505d(%rip), %rdi     # 0x40ff0
callq 0x5030
movq %rax, %rdi
callq 0x5250
movq %rax, %rbx
leaq 0x912d(%rip), %rsi      # 0x350d7
movl $0x11, %edx
movq %rax, %rdi
callq 0x5420
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5250
movl $0x1, %r14d
callq 0x2af63
jmp 0x2c35d
cmpq %rax, %r12
je 0x2c02d
movq 0x14fc6(%rip), %r14     # 0x40fc0
leaq 0x8387(%rip), %r15      # 0x34388
movq (%r12), %rsi
movq 0x8(%r12), %rdx
movq %r14, %rdi
callq 0x5420
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x5420
addq $0x20, %r12
cmpq 0x48(%rsp), %r12
jne 0x2c001
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq 0x14f75(%rip), %rdi     # 0x40fc0
callq 0x5030
movq %rax, %rdi
callq 0x5250
movq 0x14f61(%rip), %rbx     # 0x40fc0
leaq 0xa172(%rip), %rsi      # 0x361d8
movl $0x8, %edx
movq %rbx, %rdi
callq 0x5420
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq 0x14f2f(%rip), %rdi     # 0x40fc0
callq 0x5030
movq %rax, %rdi
callq 0x5250
movq 0x14f1b(%rip), %rdi     # 0x40fc0
leaq 0xa135(%rip), %rsi      # 0x361e1
movl $0x13, %edx
callq 0x5420
movq 0x14f03(%rip), %rdi     # 0x40fc0
movq 0x30(%rsp), %rsi
callq 0x5390
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5250
movq 0x14ec8(%rip), %rdi     # 0x40fc0
leaq 0xa0f6(%rip), %rsi      # 0x361f5
movl $0x1c, %edx
callq 0x5420
movq 0x14eb0(%rip), %rdi     # 0x40fc0
movq 0x28(%rsp), %rsi
callq 0x5390
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5250
movq 0x14e75(%rip), %rdi     # 0x40fc0
leaq 0xa0c0(%rip), %rsi      # 0x36212
movl $0x22, %edx
callq 0x5420
cvtss2sd 0x10(%rsp), %xmm0
movq 0x14e57(%rip), %rdi     # 0x40fc0
callq 0x5610
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5250
movq 0x14e21(%rip), %rdi     # 0x40fc0
leaq 0xa08f(%rip), %rsi      # 0x36235
movl $0x18, %edx
callq 0x5420
movq 0x14e09(%rip), %rdi     # 0x40fc0
movq 0x18(%rsp), %rsi
callq 0x5390
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5250
movq 0x14dce(%rip), %rdi     # 0x40fc0
leaq 0x924b(%rip), %rsi      # 0x35444
movl $0x1a, %edx
callq 0x5420
movq 0x60(%rsp), %rsi
movq 0x68(%rsp), %rdx
movq 0x14dac(%rip), %rbx     # 0x40fc0
movq %rbx, %rdi
callq 0x5420
movq %rax, %r14
leaq 0x9b28(%rip), %rsi      # 0x35d4e
movl $0x4, %edx
movq %rax, %rdi
callq 0x5420
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq %r14, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5250
testb $0x1, %bpl
je 0x2c2cc
movq 0x14d59(%rip), %rdi     # 0x40fc0
leaq 0x9fe0(%rip), %rsi      # 0x3624e
movl $0x26, %edx
callq 0x5420
movq 0x60(%rsp), %rsi
movq 0x68(%rsp), %rdx
movq 0x14d37(%rip), %rdi     # 0x40fc0
callq 0x5420
movq %rax, %r14
leaq 0x7941(%rip), %rsi      # 0x33bd9
movl $0xc, %edx
movq %rax, %rdi
callq 0x5420
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq %r14, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5250
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq 0x14cd6(%rip), %rdi     # 0x40fc0
callq 0x5030
movq %rax, %rdi
callq 0x5250
leaq 0x80(%rsp), %rdx
movq 0x20(%rsp), %rax
movl %eax, (%rdx)
leaq 0xa8(%rsp), %rcx
movq 0x18(%rsp), %rax
movl %eax, (%rcx)
leaq 0x3c(%rsp), %r8
movq 0x28(%rsp), %rax
movl %eax, (%r8)
leaq 0xa4(%rsp), %r9
movq 0x30(%rsp), %rax
movl %eax, (%r9)
movzbl %bpl, %eax
andl $0x1, %eax
leaq 0x10(%rsp), %r10
leaq 0x40(%rsp), %rdi
leaq 0x60(%rsp), %rsi
pushq %rax
pushq %r10
callq 0x138dc
addq $0x10, %rsp
xorl %r14d, %r14d
testl %eax, %eax
setne %r14b
leaq 0x40(%rsp), %rdi
callq 0xab8e
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x2c383
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x53c0
movl %r14d, %eax
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2c3ee
movq %rax, %r14
callq 0x5630
jmp 0x2c3f1
jmp 0x2c3ee
movq %rax, %r14
callq 0x5630
jmp 0x2c3f1
movq %rax, %r14
callq 0x5630
jmp 0x2c3f1
jmp 0x2c3ee
movq %rax, %r14
callq 0x5630
jmp 0x2c3f1
jmp 0x2c3ee
movq %rax, %r14
callq 0x5630
jmp 0x2c3f1
jmp 0x2c3ee
movq %rax, %rdi
callq 0x7d38
jmp 0x2c3ee
jmp 0x2c3e9
movq %rax, %r14
jmp 0x2c43c
jmp 0x2c3e9
jmp 0x2c3e9
movq %rax, %r14
jmp 0x2c416
movq %rax, %r14
movq 0x80(%rsp), %rdi
leaq 0x90(%rsp), %rax
cmpq %rax, %rdi
je 0x2c416
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x53c0
leaq 0x40(%rsp), %rdi
callq 0xab8e
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x2c43c
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x53c0
movq %r14, %rdi
callq 0x56a0