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

	std::string outprefix = "mappedkmers";
	std::string reference = "";
	long int kmersize=15;
	bool includeref=false;
	bool maprepeats=false;
	bool fillall=false;
	bool variantonly=false;
	bool circular=false;
	std::vector < std::string > sample;
	std::vector < std::string > args;

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

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

		if (arg=="-h" || arg=="--help"){
			mapHelp();
			return 0;
		}
		else if (arg=="-c"){
			circular=true;
		}
		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 == "-r"){
			i++;
			if (i<argc){
				reference = argv[i];
			}
			else {
				std::cerr << std::endl << "Expecting file name after -r flag" << std::endl << std::endl;
				return 1;
			}
		}
		else if (arg == "-i"){
			includeref = true;
		}
		else if (arg == "-m"){
			maprepeats = true;
		}
		else if (arg == "-a"){
			fillall = true;
		}
		else if (arg == "-v"){
			variantonly = true;
		}
		else if (arg == "-o"){
			i++;
			if (i<argc){
				outprefix = std::string(argv[i]);
			}
			else {
				std::cerr << std::endl << "Expecting file name after -o flag" << std::endl << std::endl;
				return 1;
			}
		}
		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 == "-s"){
			i++;
			if (i<argc){
				fileToVector(argv[i], sample);
			}
			else {
				std::cerr << std::endl << "Expecting file name after -s flag" << 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;
		mapHelp();
		return 1;
	}

	if (variantonly){
		outprefix+="_variants";
	}

	outprefix+=".aln";

	if (reference==""){
		std::cerr << std::endl << "Reference file is required" << std::endl;
		mapHelp();
		return 1;
	}

	skaVersion();

	std::cout << "Aligning ";
	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 << "Using split kmer size of " << kmersize << std::endl;
	std::cout << "Using " << reference << " as reference" << std::endl;
	if (includeref){
		std::cout << "Reference will be included in the alignment" << std::endl;
	}
	else{
		std::cout << "Reference will not be included in the alignment" << std::endl;
	}
	if (maprepeats){
		std::cout << "Repeats in the reference will be mapped rather than left as gaps" << std::endl;
	}
	else{
		std::cout << "Repeats in the reference will be output as gaps" << std::endl;
	}
	if (fillall){
		std::cout << "All bases in kmers will be mapped as lower case" << std::endl;
	}
	if (circular){
		std::cout << "Reference contigs will be treated as circular" << std::endl;
	}
	else {
		std::cout << "Reference contigs will be treated as linear" << std::endl;
	}
	std::cout << "Output will be written to " << outprefix << std::endl << std::endl;

	if (alignKmersToReference(reference, outprefix, args, kmersize, includeref, maprepeats, fillall, variantonly, sample, circular)){return 1;}

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movq %rsi, 0x18(%rsp)
movl %edi, 0x14(%rsp)
leaq 0xa0(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x8a17(%rip), %rsi      # 0x3663c
leaq 0x8a1b(%rip), %rdx      # 0x36647
leaq 0x90(%rsp), %rdi
callq 0x862a
leaq 0x80(%rsp), %rbp
movq %rbp, -0x10(%rbp)
leaq 0x6666(%rip), %rdx      # 0x342b2
leaq 0x70(%rsp), %rdi
movq %rdx, %rsi
callq 0x862a
xorl %eax, %eax
movb %al, 0x12(%rsp)
movb %al, 0x11(%rsp)
movb %al, 0x10(%rsp)
movb %al, 0xf(%rsp)
movq %rax, 0xe0(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0xd0(%rsp)
movq %rax, 0x60(%rsp)
movaps %xmm0, 0x50(%rsp)
cmpl $0x3, 0x14(%rsp)
setge %r14b
jl 0x2e395
movl $0xf, %eax
movq %rax, 0x20(%rsp)
movl $0x2, %ebp
xorl %r12d, %r12d
leaq 0xb0(%rsp), %r15
movslq %ebp, %rax
movq 0x18(%rsp), %rcx
movq (%rcx,%rax,8), %rsi
movq %r15, %rdi
leaq 0x30(%rsp), %rdx
callq 0x184a2
movq %r15, %rdi
leaq 0x735b(%rip), %rsi      # 0x3502f
callq 0x50f0
testl %eax, %eax
je 0x2de45
movq %r15, %rdi
leaq 0x7347(%rip), %rsi      # 0x35032
callq 0x50f0
testl %eax, %eax
je 0x2de45
movq %r15, %rdi
leaq 0x7cbd(%rip), %rsi      # 0x359bf
callq 0x50f0
movq %r15, %r13
movb $0x1, %r15b
testl %eax, %eax
je 0x2de9a
movq %r13, %rdi
leaq 0x731a(%rip), %rsi      # 0x35039
callq 0x50f0
testl %eax, %eax
je 0x2de9f
movq %r13, %rdi
leaq 0x7870(%rip), %rsi      # 0x355a6
callq 0x50f0
testl %eax, %eax
je 0x2dffb
movq %r13, %rdi
leaq 0x7834(%rip), %rsi      # 0x35581
callq 0x50f0
testl %eax, %eax
je 0x2e0e3
movq %r13, %rdi
leaq 0x83b8(%rip), %rsi      # 0x3611c
callq 0x50f0
testl %eax, %eax
je 0x2e194
movq %r13, %rdi
leaq 0x82ba(%rip), %rsi      # 0x36035
callq 0x50f0
testl %eax, %eax
je 0x2e19e
movq %r13, %rdi
leaq 0x764a(%rip), %rsi      # 0x353dc
callq 0x50f0
testl %eax, %eax
je 0x2e1a8
movq %r13, %rdi
leaq 0x7590(%rip), %rsi      # 0x35339
callq 0x50f0
testl %eax, %eax
je 0x2e1b2
movq %r13, %rdi
leaq 0x72ef(%rip), %rsi      # 0x350af
callq 0x50f0
testl %eax, %eax
je 0x2e1ed
movq %r13, %rdi
leaq 0x75e0(%rip), %rsi      # 0x353b7
callq 0x50f0
testl %eax, %eax
je 0x2e25e
movq 0xb0(%rsp), %rax
cmpb $0x2d, (%rax)
jne 0x2e2bd
movq 0x131f4(%rip), %rdi     # 0x40ff0
callq 0x5190
movq %rax, %rbx
movl $0x12, %edx
movq %rax, %rdi
leaq 0x72c1(%rip), %rsi      # 0x350d4
callq 0x5420
movq 0xb0(%rsp), %rsi
movq 0xb8(%rsp), %rdx
movq %rbx, %rdi
callq 0x5420
movq %rax, %rdi
callq 0x5190
movq %rax, %rdi
callq 0x5190
jmp 0x2e187
xorl %r15d, %r15d
callq 0x2d82b
xorl %ebx, %ebx
movq 0xb0(%rsp), %rdi
leaq 0xc0(%rsp), %rax
cmpq %rax, %rdi
je 0x2de74
movq 0xc0(%rsp), %rsi
incq %rsi
callq 0x53c0
testb %r15b, %r15b
leaq 0xb0(%rsp), %r15
je 0x2e3aa
incl %ebp
cmpl 0x14(%rsp), %ebp
setl %r14b
jl 0x2dcb1
jmp 0x2e3aa
movb $0x1, %r12b
jmp 0x2de4f
incl %ebp
cmpl 0x14(%rsp), %ebp
jge 0x2e044
movslq %ebp, %rax
movq 0x18(%rsp), %rcx
movq (%rcx,%rax,8), %rdi
callq 0x260f0
movq %rax, %r13
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 0x2df05
movslq 0x135f0(%rip), %rax     # 0x414e0
cmpq %rax, %r13
jl 0x2df05
movslq 0x135e8(%rip), %rax     # 0x414e4
cmpq %rax, %r13
jle 0x2dff1
movq 0x130e4(%rip), %rcx     # 0x40ff0
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq 0x130c6(%rip), %rdi     # 0x40ff0
callq 0x5030
movq %rax, %rdi
callq 0x5250
movq %rax, %rbx
movl $0x2d, %edx
movq %rax, %rdi
leaq 0x711c(%rip), %rsi      # 0x35065
callq 0x5420
movl 0x1358c(%rip), %esi     # 0x414e0
movq %rbx, %rdi
callq 0x5690
movq %rax, %rbx
movl $0x5, %edx
movq %rax, %rdi
leaq 0x6653(%rip), %rsi      # 0x345c1
callq 0x5420
movl 0x1356b(%rip), %esi     # 0x414e4
movq %rbx, %rdi
callq 0x5690
movq %rax, %rbx
movl $0x1b, %edx
movq %rax, %rdi
leaq 0x7100(%rip), %rsi      # 0x35093
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
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
movl $0x1, %ebx
xorl %r15d, %r15d
movq %r13, 0x20(%rsp)
jmp 0x2de4f
incl %ebp
cmpl 0x14(%rsp), %ebp
jge 0x2e0ed
movslq %ebp, %rax
movq 0x18(%rsp), %rcx
movq (%rcx,%rax,8), %r13
movq %r12, 0x28(%rsp)
movq 0x78(%rsp), %r12
movq %r13, %rdi
callq 0x5180
leaq 0x70(%rsp), %rdi
xorl %esi, %esi
movq %r12, %rdx
movq 0x28(%rsp), %r12
movq %r13, %rcx
movq %rax, %r8
callq 0x55e0
jmp 0x2de4f
movq 0x12fa5(%rip), %rcx     # 0x40ff0
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq 0x12f87(%rip), %rdi     # 0x40ff0
callq 0x5030
movq %rax, %rdi
callq 0x5250
movq %rax, %rbx
movl $0x28, %edx
movq %rax, %rdi
leaq 0x6fb4(%rip), %rsi      # 0x3503c
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
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
jmp 0x2e187
movb $0x1, 0x12(%rsp)
jmp 0x2de4f
movq 0x12efc(%rip), %rcx     # 0x40ff0
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq 0x12ede(%rip), %rdi     # 0x40ff0
callq 0x5030
movq %rax, %rdi
callq 0x5250
movq %rax, %rbx
movl $0x21, %edx
movq %rax, %rdi
leaq 0x7478(%rip), %rsi      # 0x355a9
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
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
movl $0x1, %ebx
xorl %r15d, %r15d
jmp 0x2de4f
movb $0x1, 0x11(%rsp)
jmp 0x2de4f
movb $0x1, 0x10(%rsp)
jmp 0x2de4f
movb $0x1, 0xf(%rsp)
jmp 0x2de4f
incl %ebp
cmpl 0x14(%rsp), %ebp
jge 0x2e226
movslq %ebp, %rax
movq 0x18(%rsp), %rcx
movq (%rcx,%rax,8), %rsi
leaq 0x30(%rsp), %r13
movq %r13, %rdi
leaq 0x13(%rsp), %rdx
callq 0x184a2
leaq 0x90(%rsp), %rdi
movq %r13, %rsi
callq 0x5470
jmp 0x2e298
incl %ebp
cmpl 0x14(%rsp), %ebp
jge 0x2e2d4
movslq %ebp, %rax
movq 0x18(%rsp), %rcx
movq (%rcx,%rax,8), %rsi
leaq 0x30(%rsp), %r13
movq %r13, %rdi
leaq 0x13(%rsp), %rdx
callq 0x184a2
movq %r13, %rdi
leaq 0x50(%rsp), %rsi
callq 0x817c
jmp 0x2e298
movq 0x12dc3(%rip), %rdi     # 0x40ff0
callq 0x5190
movq %rax, %rbx
movl $0x21, %edx
movq %rax, %rdi
leaq 0x7340(%rip), %rsi      # 0x35584
callq 0x5420
movq %rbx, %rdi
callq 0x5190
movq %rax, %rdi
callq 0x5190
jmp 0x2e187
incl %ebp
cmpl 0x14(%rsp), %ebp
jge 0x2e30c
movslq %ebp, %rax
movq 0x18(%rsp), %rcx
movq (%rcx,%rax,8), %rsi
leaq 0x30(%rsp), %r13
movq %r13, %rdi
leaq 0x13(%rsp), %rdx
callq 0x184a2
movq %r13, %rdi
leaq 0xd0(%rsp), %rsi
callq 0x817c
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x2de4f
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x53c0
jmp 0x2de4f
leaq 0x50(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
callq 0x855c
jmp 0x2de4f
movq 0x12d15(%rip), %rdi     # 0x40ff0
callq 0x5190
movq %rax, %rbx
movl $0x21, %edx
movq %rax, %rdi
leaq 0x6dc0(%rip), %rsi      # 0x350b2
callq 0x5420
movq %rbx, %rdi
callq 0x5190
movq %rax, %rdi
callq 0x5190
jmp 0x2e187
movq 0x12cdd(%rip), %rdi     # 0x40ff0
callq 0x5190
movq %rax, %rbx
movl $0x21, %edx
movq %rax, %rdi
leaq 0x7090(%rip), %rsi      # 0x353ba
callq 0x5420
movq %rbx, %rdi
callq 0x5190
movq %rax, %rdi
callq 0x5190
jmp 0x2e187
movq %rax, %rbx
cmpl $0x1, %edx
jne 0x2e98e
movq %rbx, %rdi
callq 0x5160
movq 0x12c91(%rip), %rdi     # 0x40ff0
callq 0x5190
movq %rax, %rbx
movl $0x28, %edx
movq %rax, %rdi
leaq 0x6cc6(%rip), %rsi      # 0x3503c
callq 0x5420
movq %rbx, %rdi
callq 0x5190
movq %rax, %rdi
callq 0x5190
callq 0x5630
jmp 0x2e187
movq $0x0, 0x28(%rsp)
movl $0xf, %eax
movq %rax, 0x20(%rsp)
jmp 0x2e3bf
movq %r12, 0x28(%rsp)
leaq 0xa0(%rsp), %r13
leaq 0x80(%rsp), %rbp
testb $0x1, %r14b
jne 0x2e8d4
movq 0x58(%rsp), %rax
cmpq 0x50(%rsp), %rax
je 0x2e487
cmpb $0x1, 0xf(%rsp)
jne 0x2e3f4
leaq 0x6ff8(%rip), %rsi      # 0x353df
leaq 0x90(%rsp), %rdi
callq 0x5710
leaq 0x5386(%rip), %rsi      # 0x33781
leaq 0x90(%rsp), %rdi
callq 0x5710
leaq 0x5ea3(%rip), %rsi      # 0x342b2
leaq 0x70(%rsp), %rdi
callq 0x50f0
testl %eax, %eax
je 0x2e4e3
callq 0x26746
movq 0x12b93(%rip), %rbx     # 0x40fc0
leaq 0x822f(%rip), %rsi      # 0x36663
movl $0x9, %edx
movq %rbx, %rdi
callq 0x5420
movq 0x50(%rsp), %r12
movq 0x58(%rsp), %rsi
subq %r12, %rsi
sarq $0x5, %rsi
movslq 0x13097(%rip), %rax     # 0x414f0
cmpq %rax, %rsi
jbe 0x2e55f
movq 0x12b57(%rip), %rdi     # 0x40fc0
callq 0x5240
leaq 0x668c(%rip), %rsi      # 0x34b01
movl $0x6, %edx
movq %rax, %rdi
callq 0x5420
jmp 0x2e5a0
movq 0x12b62(%rip), %rdi     # 0x40ff0
movq (%rdi), %rax
addq -0x18(%rax), %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq 0x12b47(%rip), %rdi     # 0x40ff0
callq 0x5030
movq %rax, %rdi
callq 0x5250
movq %rax, %rbx
leaq 0x6c27(%rip), %rsi      # 0x350e7
movl $0x11, %edx
movq %rax, %rdi
callq 0x5420
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x53a0
jmp 0x2e53d
movq 0x12b06(%rip), %rdi     # 0x40ff0
movq (%rdi), %rax
addq -0x18(%rax), %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq 0x12aeb(%rip), %rdi     # 0x40ff0
callq 0x5030
movq %rax, %rdi
callq 0x5250
movq %rax, %rbx
leaq 0x812c(%rip), %rsi      # 0x36648
movl $0x1a, %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, %ebx
callq 0x2d82b
jmp 0x2e8d4
cmpq 0x58(%rsp), %r12
je 0x2e5a0
movq 0x12a53(%rip), %r14     # 0x40fc0
leaq 0x5e24(%rip), %r15      # 0x34398
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 0x58(%rsp), %r12
jne 0x2e574
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq 0x12a02(%rip), %rdi     # 0x40fc0
callq 0x5030
movq %rax, %rdi
callq 0x5250
movq 0x129ee(%rip), %rdi     # 0x40fc0
leaq 0x8094(%rip), %rsi      # 0x3666d
movl $0x19, %edx
callq 0x5420
movq 0x129d6(%rip), %rdi     # 0x40fc0
movq 0x20(%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 0x1299b(%rip), %rdi     # 0x40fc0
leaq 0x805b(%rip), %rsi      # 0x36687
movl $0x6, %edx
callq 0x5420
movq 0x70(%rsp), %rsi
movq 0x78(%rsp), %rdx
movq 0x12979(%rip), %rdi     # 0x40fc0
callq 0x5420
movq %rax, %rbx
leaq 0x8038(%rip), %rsi      # 0x3668e
movl $0xd, %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
movzbl 0x12(%rsp), %eax
leaq 0x8006(%rip), %rcx      # 0x3669c
leaq 0x802b(%rip), %rsi      # 0x366c8
testl %eax, %eax
cmovneq %rcx, %rsi
xorl $0x1, %eax
leaq 0x2b(,%rax,4), %rdx
movq 0x1290b(%rip), %rbx     # 0x40fc0
movq %rbx, %rdi
callq 0x5420
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq 0x128e5(%rip), %rdi     # 0x40fc0
callq 0x5030
movq %rax, %rdi
callq 0x5250
leaq 0x8009(%rip), %rax      # 0x366f8
leaq 0x8043(%rip), %rsi      # 0x36739
cmpb $0x0, 0x11(%rsp)
cmovneq %rax, %rsi
movl $0x40, %eax
movl $0x2f, %edx
cmovneq %rax, %rdx
movq 0x128ac(%rip), %rbx     # 0x40fc0
movq %rbx, %rdi
callq 0x5420
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq 0x12886(%rip), %rdi     # 0x40fc0
callq 0x5030
movq %rax, %rdi
callq 0x5250
cmpb $0x1, 0x10(%rsp)
jne 0x2e794
movq 0x1286b(%rip), %rbx     # 0x40fc0
leaq 0x800d(%rip), %rsi      # 0x36769
movl $0x2f, %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 0x12839(%rip), %rdi     # 0x40fc0
callq 0x5030
movq %rax, %rdi
callq 0x5250
leaq 0x7ffe(%rip), %rax      # 0x36799
leaq 0x8025(%rip), %rsi      # 0x367c7
movq 0x28(%rsp), %rcx
testb $0x1, %cl
cmovneq %rax, %rsi
movzbl %cl, %r14d
andl $0x1, %r14d
leaq 0x2b(,%r14,2), %rdx
movq 0x127fb(%rip), %rbx     # 0x40fc0
movq %rbx, %rdi
callq 0x5420
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq 0x127d5(%rip), %rdi     # 0x40fc0
callq 0x5030
movq %rax, %rdi
callq 0x5250
movq 0x127c1(%rip), %rdi     # 0x40fc0
leaq 0x6c4e(%rip), %rsi      # 0x35454
movl $0x1a, %edx
callq 0x5420
movq 0x90(%rsp), %rsi
movq 0x98(%rsp), %rdx
movq 0x12799(%rip), %rdi     # 0x40fc0
callq 0x5420
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 %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
leaq 0xb0(%rsp), %rcx
movq 0x20(%rsp), %rax
movl %eax, (%rcx)
leaq 0xd0(%rsp), %rax
leaq 0xf(%rsp), %r10
leaq 0x10(%rsp), %r11
leaq 0x70(%rsp), %rdi
leaq 0x90(%rsp), %rsi
leaq 0x50(%rsp), %rdx
leaq 0x12(%rsp), %r8
leaq 0x11(%rsp), %r9
pushq %r14
pushq %rax
pushq %r10
pushq %r11
callq 0x1c0f7
addq $0x20, %rsp
xorl %ebx, %ebx
testl %eax, %eax
setne %bl
leaq 0x50(%rsp), %rdi
callq 0xabee
leaq 0xd0(%rsp), %rdi
callq 0xabee
movq 0x70(%rsp), %rdi
cmpq %rbp, %rdi
je 0x2e905
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x53c0
movq 0x90(%rsp), %rdi
cmpq %r13, %rdi
je 0x2e922
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x53c0
movl %ebx, %eax
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2e98b
movq %rax, %rbx
callq 0x5630
jmp 0x2e98e
movq %rax, %rdi
callq 0x7d6a
jmp 0x2e94e
jmp 0x2e98b
movq %rax, %rbx
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x2e98e
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x53c0
jmp 0x2e98e
jmp 0x2e98b
jmp 0x2e98b
jmp 0x2e986
movq %rax, %rbx
jmp 0x2e9ec
movq %rax, %rbx
jmp 0x2ea11
jmp 0x2e986
jmp 0x2e986
movq %rax, %rbx
jmp 0x2e9b3
movq %rax, %rbx
movq 0xb0(%rsp), %rdi
leaq 0xc0(%rsp), %rax
cmpq %rax, %rdi
je 0x2e9b3
movq 0xc0(%rsp), %rsi
incq %rsi
callq 0x53c0
leaq 0x50(%rsp), %rdi
callq 0xabee
leaq 0xd0(%rsp), %rdi
callq 0xabee
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0x2e9ec
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x53c0
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
je 0x2ea11
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x53c0
movq %rbx, %rdi
callq 0x56a0