// File: /workspace/github_cpp_makefile_star2_O3/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 0x78(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x8f56(%rip), %rsi      # 0x3662c
leaq 0x8f5a(%rip), %rdx      # 0x36637
leaq 0x68(%rsp), %rdi
callq 0x85fc
leaq 0x98(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x6ba8(%rip), %rdx      # 0x342a2
leaq 0x88(%rsp), %rdi
movq %rdx, %rsi
callq 0x85fc
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, 0x30(%rsp)
movaps %xmm0, 0x20(%rsp)
cmpl $0x3, 0x14(%rsp)
jl 0x2df29
movl $0xf, %eax
movq %rax, 0x40(%rsp)
movl $0x2, %r15d
leaq 0xb8(%rsp), %r13
movq $0x0, 0xc8(%rsp)
leaq 0xa8(%rsp), %r14
leaq 0x48(%rsp), %rbx
movslq %r15d, %rax
movq 0x18(%rsp), %rcx
movq (%rcx,%rax,8), %rsi
movq %r14, %rdi
movq %rbx, %rdx
callq 0x182e0
movq %r14, %rdi
leaq 0x7889(%rip), %rsi      # 0x3501f
callq 0x50f0
testl %eax, %eax
je 0x2d904
movq %r14, %rdi
leaq 0x7875(%rip), %rsi      # 0x35022
callq 0x50f0
testl %eax, %eax
je 0x2d904
movq %r14, %rdi
leaq 0x81eb(%rip), %rsi      # 0x359af
callq 0x50f0
movb $0x1, %bpl
testl %eax, %eax
je 0x2d94f
movq %r14, %rdi
leaq 0x784b(%rip), %rsi      # 0x35029
callq 0x50f0
testl %eax, %eax
je 0x2d95b
movq %r14, %rdi
leaq 0x7da1(%rip), %rsi      # 0x35596
callq 0x50f0
testl %eax, %eax
je 0x2daba
movq %r14, %rdi
leaq 0x7d65(%rip), %rsi      # 0x35571
callq 0x50f0
testl %eax, %eax
je 0x2dba8
movq %r14, %rdi
leaq 0x88e9(%rip), %rsi      # 0x3610c
callq 0x50f0
testl %eax, %eax
je 0x2dc59
movq %r14, %rdi
leaq 0x87eb(%rip), %rsi      # 0x36025
callq 0x50f0
testl %eax, %eax
je 0x2dc63
movq %r14, %rdi
leaq 0x7b7b(%rip), %rsi      # 0x353cc
callq 0x50f0
testl %eax, %eax
je 0x2dc6d
movq %r14, %rdi
leaq 0x7ac1(%rip), %rsi      # 0x35329
callq 0x50f0
testl %eax, %eax
je 0x2dc77
movq %r14, %rdi
leaq 0x7820(%rip), %rsi      # 0x3509f
callq 0x50f0
testl %eax, %eax
je 0x2dcaf
movq %r14, %rdi
leaq 0x7b11(%rip), %rsi      # 0x353a7
callq 0x50f0
testl %eax, %eax
je 0x2dd20
movq 0xa8(%rsp), %rax
cmpb $0x2d, (%rax)
jne 0x2dd7f
movq 0x13735(%rip), %rdi     # 0x40ff0
callq 0x5190
movq %rax, %r14
movl $0x12, %edx
movq %rax, %rdi
leaq 0x77f2(%rip), %rsi      # 0x350c4
callq 0x5420
movq 0xa8(%rsp), %rsi
movq 0xb0(%rsp), %rdx
movq %r14, %rdi
callq 0x5420
movq %rax, %rdi
callq 0x5190
movq %rax, %rdi
callq 0x5190
jmp 0x2dc4c
xorl %ebp, %ebp
callq 0x2d2df
xorl %r12d, %r12d
movq 0xa8(%rsp), %rdi
cmpq %r13, %rdi
je 0x2d92b
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x53c0
testb %bpl, %bpl
je 0x2de57
incl %r15d
cmpl 0x14(%rsp), %r15d
leaq 0xa8(%rsp), %r14
jl 0x2d775
jmp 0x2de61
movb $0x1, %al
movq %rax, 0xc8(%rsp)
jmp 0x2d90e
incl %r15d
cmpl 0x14(%rsp), %r15d
jge 0x2db09
movslq %r15d, %rax
movq 0x18(%rsp), %rcx
movq (%rcx,%rax,8), %rdi
callq 0x25cfc
movq %rax, %r14
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 0x2d9c3
movslq 0x13b32(%rip), %rax     # 0x414e0
cmpq %rax, %r14
jl 0x2d9c3
movslq 0x13b2a(%rip), %rax     # 0x414e4
cmpq %rax, %r14
jle 0x2dab0
movq 0x13626(%rip), %rcx     # 0x40ff0
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq 0x13608(%rip), %rdi     # 0x40ff0
callq 0x5030
movq %rax, %rdi
callq 0x5250
movq %rax, %r12
movl $0x2d, %edx
movq %rax, %rdi
leaq 0x764e(%rip), %rsi      # 0x35055
callq 0x5420
movl 0x13ace(%rip), %esi     # 0x414e0
movq %r12, %rdi
callq 0x5690
movq %rax, %r12
movl $0x5, %edx
movq %rax, %rdi
leaq 0x6b85(%rip), %rsi      # 0x345b1
callq 0x5420
movl 0x13aad(%rip), %esi     # 0x414e4
movq %r12, %rdi
callq 0x5690
movq %rax, %r12
movl $0x1b, %edx
movq %rax, %rdi
leaq 0x7632(%rip), %rsi      # 0x35083
callq 0x5420
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq %r12, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5250
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq %r12, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5250
movl $0x1, %r12d
xorl %ebp, %ebp
movq %r14, 0x40(%rsp)
jmp 0x2d90e
incl %r15d
cmpl 0x14(%rsp), %r15d
jge 0x2dbb2
movslq %r15d, %rax
movq 0x18(%rsp), %rcx
movq (%rcx,%rax,8), %r14
movq 0x90(%rsp), %r13
movq %r14, %rdi
callq 0x5180
leaq 0x88(%rsp), %rdi
xorl %esi, %esi
movq %r13, %rdx
leaq 0xb8(%rsp), %r13
movq %r14, %rcx
movq %rax, %r8
callq 0x55e0
jmp 0x2d90e
movq 0x134e0(%rip), %rcx     # 0x40ff0
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq 0x134c2(%rip), %rdi     # 0x40ff0
callq 0x5030
movq %rax, %rdi
callq 0x5250
movq %rax, %r14
movl $0x28, %edx
movq %rax, %rdi
leaq 0x74df(%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 0x2dc4c
movb $0x1, 0x12(%rsp)
jmp 0x2d90e
movq 0x13437(%rip), %rcx     # 0x40ff0
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq 0x13419(%rip), %rdi     # 0x40ff0
callq 0x5030
movq %rax, %rdi
callq 0x5250
movq %rax, %r14
movl $0x21, %edx
movq %rax, %rdi
leaq 0x79a3(%rip), %rsi      # 0x35599
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, %r12d
xorl %ebp, %ebp
jmp 0x2d90e
movb $0x1, 0x11(%rsp)
jmp 0x2d90e
movb $0x1, 0x10(%rsp)
jmp 0x2d90e
movb $0x1, 0xf(%rsp)
jmp 0x2d90e
incl %r15d
cmpl 0x14(%rsp), %r15d
jge 0x2dce8
movslq %r15d, %rax
movq 0x18(%rsp), %rcx
movq (%rcx,%rax,8), %rsi
movq %rbx, %r14
movq %rbx, %rdi
leaq 0x13(%rsp), %rdx
callq 0x182e0
leaq 0x68(%rsp), %rdi
movq %r14, %rsi
callq 0x5470
jmp 0x2dd5a
incl %r15d
cmpl 0x14(%rsp), %r15d
jge 0x2dd96
movslq %r15d, %rax
movq 0x18(%rsp), %rcx
movq (%rcx,%rax,8), %rsi
movq %rbx, %r14
movq %rbx, %rdi
leaq 0x13(%rsp), %rdx
callq 0x182e0
movq %r14, %rdi
leaq 0x20(%rsp), %rsi
callq 0x8148
jmp 0x2dd5a
movq 0x13301(%rip), %rdi     # 0x40ff0
callq 0x5190
movq %rax, %r14
movl $0x21, %edx
movq %rax, %rdi
leaq 0x786e(%rip), %rsi      # 0x35574
callq 0x5420
movq %r14, %rdi
callq 0x5190
movq %rax, %rdi
callq 0x5190
jmp 0x2dc4c
incl %r15d
cmpl 0x14(%rsp), %r15d
jge 0x2ddce
movslq %r15d, %rax
movq 0x18(%rsp), %rcx
movq (%rcx,%rax,8), %rsi
movq %rbx, %r14
movq %rbx, %rdi
leaq 0x13(%rsp), %rdx
callq 0x182e0
movq %r14, %rdi
leaq 0xd0(%rsp), %rsi
callq 0x8148
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x2d90e
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x53c0
jmp 0x2d90e
leaq 0x20(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
callq 0x8528
jmp 0x2d90e
movq 0x13253(%rip), %rdi     # 0x40ff0
callq 0x5190
movq %rax, %r14
movl $0x21, %edx
movq %rax, %rdi
leaq 0x72ee(%rip), %rsi      # 0x350a2
callq 0x5420
movq %r14, %rdi
callq 0x5190
movq %rax, %rdi
callq 0x5190
jmp 0x2dc4c
movq 0x1321b(%rip), %rdi     # 0x40ff0
callq 0x5190
movq %rax, %r14
movl $0x21, %edx
movq %rax, %rdi
leaq 0x75be(%rip), %rsi      # 0x353aa
callq 0x5420
movq %r14, %rdi
callq 0x5190
movq %rax, %rdi
callq 0x5190
jmp 0x2dc4c
movq %rax, %r14
cmpl $0x1, %edx
jne 0x2e436
movq %r14, %rdi
callq 0x5160
movq 0x131cf(%rip), %rdi     # 0x40ff0
callq 0x5190
movq %rax, %r14
movl $0x28, %edx
movq %rax, %rdi
leaq 0x71f4(%rip), %rsi      # 0x3502c
callq 0x5420
movq %r14, %rdi
callq 0x5190
movq %rax, %rdi
callq 0x5190
callq 0x5630
jmp 0x2dc4c
leaq 0x78(%rsp), %r13
jmp 0x2dfa1
movq 0x28(%rsp), %rax
cmpq 0x20(%rsp), %rax
leaq 0x78(%rsp), %r13
je 0x2df29
movq 0x40(%rsp), %rbp
cmpb $0x1, 0xf(%rsp)
jne 0x2de93
leaq 0x7546(%rip), %rsi      # 0x353cf
leaq 0x68(%rsp), %rdi
callq 0x5710
leaq 0x58e7(%rip), %rsi      # 0x33781
leaq 0x68(%rsp), %rdi
callq 0x5710
leaq 0x63f7(%rip), %rsi      # 0x342a2
leaq 0x88(%rsp), %rdi
callq 0x50f0
testl %eax, %eax
je 0x2e009
callq 0x26352
movq 0x130f4(%rip), %rbx     # 0x40fc0
leaq 0x8780(%rip), %rsi      # 0x36653
movl $0x9, %edx
movq %rbx, %rdi
callq 0x5420
movq 0x20(%rsp), %r12
movq 0x28(%rsp), %rax
movq %rax, %rsi
subq %r12, %rsi
sarq $0x5, %rsi
movslq 0x135f5(%rip), %rcx     # 0x414f0
cmpq %rcx, %rsi
jbe 0x2e068
movq 0x130b5(%rip), %rdi     # 0x40fc0
callq 0x5240
leaq 0x6bda(%rip), %rsi      # 0x34af1
movl $0x6, %edx
movq %rax, %rdi
callq 0x5420
jmp 0x2e0a7
movq 0x130c0(%rip), %rdi     # 0x40ff0
movq (%rdi), %rax
addq -0x18(%rax), %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq 0x130a5(%rip), %rdi     # 0x40ff0
callq 0x5030
movq %rax, %rdi
callq 0x5250
movq %rax, %rbx
leaq 0x7175(%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, %r12d
callq 0x2d2df
leaq 0x20(%rsp), %rdi
callq 0xab8e
leaq 0xd0(%rsp), %rdi
callq 0xab8e
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x2dfdd
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x53c0
movq 0x68(%rsp), %rdi
cmpq %r13, %rdi
je 0x2dff4
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x53c0
movl %r12d, %eax
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x12fe0(%rip), %rdi     # 0x40ff0
movq (%rdi), %rax
addq -0x18(%rax), %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq 0x12fc5(%rip), %rdi     # 0x40ff0
callq 0x5030
movq %rax, %rdi
callq 0x5250
movq %rax, %rbx
leaq 0x85f6(%rip), %rsi      # 0x36638
movl $0x1a, %edx
movq %rax, %rdi
callq 0x5420
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x53a0
jmp 0x2df83
cmpq %rax, %r12
je 0x2e0a7
movq 0x12f4c(%rip), %r14     # 0x40fc0
leaq 0x630d(%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 0x28(%rsp), %r12
jne 0x2e07b
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq 0x12efb(%rip), %rdi     # 0x40fc0
callq 0x5030
movq %rax, %rdi
callq 0x5250
movq 0x12ee7(%rip), %rdi     # 0x40fc0
leaq 0x857d(%rip), %rsi      # 0x3665d
movl $0x19, %edx
callq 0x5420
movq 0x12ecf(%rip), %rdi     # 0x40fc0
movq %rbp, %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 0x12e96(%rip), %rdi     # 0x40fc0
leaq 0x8546(%rip), %rsi      # 0x36677
movl $0x6, %edx
callq 0x5420
movq 0x88(%rsp), %rsi
movq 0x90(%rsp), %rdx
movq 0x12e6e(%rip), %rdi     # 0x40fc0
callq 0x5420
movq %rax, %rbx
leaq 0x851d(%rip), %rsi      # 0x3667e
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 0x84eb(%rip), %rcx      # 0x3668c
leaq 0x8510(%rip), %rsi      # 0x366b8
testl %eax, %eax
cmovneq %rcx, %rsi
xorl $0x1, %eax
leaq 0x2b(,%rax,4), %rdx
movq 0x12e00(%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 0x12dda(%rip), %rdi     # 0x40fc0
callq 0x5030
movq %rax, %rdi
callq 0x5250
leaq 0x84ee(%rip), %rax      # 0x366e8
leaq 0x8528(%rip), %rsi      # 0x36729
cmpb $0x0, 0x11(%rsp)
cmovneq %rax, %rsi
movl $0x40, %eax
movl $0x2f, %edx
cmovneq %rax, %rdx
movq 0x12da1(%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 0x12d7b(%rip), %rdi     # 0x40fc0
callq 0x5030
movq %rax, %rdi
callq 0x5250
cmpb $0x1, 0x10(%rsp)
jne 0x2e29f
movq 0x12d60(%rip), %rbx     # 0x40fc0
leaq 0x84f2(%rip), %rsi      # 0x36759
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 0x12d2e(%rip), %rdi     # 0x40fc0
callq 0x5030
movq %rax, %rdi
callq 0x5250
leaq 0x84e3(%rip), %rax      # 0x36789
leaq 0x850a(%rip), %rsi      # 0x367b7
movq 0xc8(%rsp), %rcx
testb $0x1, %cl
cmovneq %rax, %rsi
movzbl %cl, %r14d
andl $0x1, %r14d
leaq 0x2b(,%r14,2), %rdx
movq 0x12ced(%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 0x12cc7(%rip), %rdi     # 0x40fc0
callq 0x5030
movq %rax, %rdi
callq 0x5250
movq 0x12cb3(%rip), %rdi     # 0x40fc0
leaq 0x7130(%rip), %rsi      # 0x35444
movl $0x1a, %edx
callq 0x5420
movq 0x68(%rsp), %rsi
movq 0x70(%rsp), %rdx
movq 0x12c91(%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 0xa8(%rsp), %rcx
movl %ebp, (%rcx)
leaq 0xf(%rsp), %rax
leaq 0x10(%rsp), %r10
leaq 0x88(%rsp), %rdi
leaq 0x68(%rsp), %rsi
leaq 0x20(%rsp), %rdx
leaq 0x12(%rsp), %r8
leaq 0x11(%rsp), %r9
pushq %r14
leaq 0xd8(%rsp), %r11
pushq %r11
pushq %rax
pushq %r10
callq 0x1be53
addq $0x20, %rsp
xorl %r12d, %r12d
testl %eax, %eax
setne %r12b
jmp 0x2dfa1
jmp 0x2e433
movq %rax, %r14
callq 0x5630
jmp 0x2e436
movq %rax, %rdi
callq 0x7d38
jmp 0x2e3f6
jmp 0x2e433
movq %rax, %r14
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x2e436
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x53c0
jmp 0x2e436
jmp 0x2e433
jmp 0x2e433
jmp 0x2e42e
movq %rax, %r14
jmp 0x2e48f
movq %rax, %r14
jmp 0x2e4ab
jmp 0x2e42e
jmp 0x2e42e
movq %rax, %r14
jmp 0x2e453
movq %rax, %r14
movq 0xa8(%rsp), %rdi
cmpq %r13, %rdi
je 0x2e453
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x53c0
leaq 0x20(%rsp), %rdi
callq 0xab8e
leaq 0xd0(%rsp), %rdi
callq 0xab8e
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x2e48f
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x53c0
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x2e4ab
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x53c0
movq %r14, %rdi
callq 0x56a0