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

	bool distancefile=true;
	bool clusterfile=true;
	bool includesingletons=false;
	std::string prefix="distances";
	float minid=0.9;
	int maxsnps=20;
	std::vector < std::string > args;

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

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

		if (arg=="-h" || arg=="--help"){
			distanceHelp();
			return 0;
		}
		else if (arg=="-c"){
			clusterfile=false;
		}
		else if (arg == "-d"){
			distancefile=false;
		}
		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){
				try {
					minid = getfloat(argv[i]);
				}
				catch (const std::invalid_argument& e) {
					std::cerr << std::endl << "Expecting float between 0 and 1 after -i flag" << std::endl << std::endl;
					return 1;
				}
			}
			else {
				std::cerr << std::endl << "Expecting float between 0 and 1 after -i flag" << std::endl << std::endl;
				return 1;
			}
			if (minid < 0 || minid > 1){
				std::cerr << std::endl << "Minimum identity must be between 0 and 1" << std::endl << std::endl;
				return 1;
			}
		}
		else if (arg == "-o"){
			i++;
			if (i<argc){
				prefix = argv[i];
			}
			else {
				std::cerr << std::endl << "Expecting string after -o flag" << std::endl << std::endl;
				return 1;
			}
		}
		else if (arg == "-s"){
			i++;
			if (i<argc){
				try {
					maxsnps = getint(argv[i]);
				}
				catch (const std::invalid_argument& e) {
					std::cerr << std::endl << "Expecting positive integer after -s flag" << std::endl << std::endl;
					return 1;
				}
			}
			else {
				std::cerr << std::endl << "Expecting positive integer after -s flag" << std::endl << std::endl;
				return 1;
			}
			if (maxsnps < 0){
				std::cerr << std::endl << "Maximum number of SNPs must be 0 or greater" << std::endl << std::endl;
				return 1;
			}
		}
		else if (arg == "-S"){
			includesingletons=true;
		}
		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;
		distanceHelp();
		return 1;
	}

	if (distancefile==false && clusterfile==false){
		std::cerr << std::endl << "At least one output file is required. i.e. you cannot use the -c and -d flags together." << std::endl << std::endl;
		return 1;
	}
	if (prefix=="false"){
		std::cerr << std::endl << "An output prefix (-p) is required." << std::endl << std::endl;
		return 1;
	}

	skaVersion();

	std::cout << "Calculating pairwise distances 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 << "Clusters will be created for isolates that are within " << maxsnps << " SNPs of one another and share at least " << minid*100 << "% of the split kmers of the isolate with fewer kmers" << std::endl;

	if (distancefile){
		std::cout << "Distances will be written to " << prefix << ".distances.tsv" << std::endl;
	}
	if (clusterfile){
		std::cout << "Clusters will be written to files with the prefix " << prefix << std::endl;
	}
	std::cout << std::endl;

	if (kmerDistance(prefix, distancefile, clusterfile, args, maxsnps, minid, includesingletons)){return 1;}

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movq %rsi, 0x20(%rsp)
movl %edi, %ebx
leaq 0x60(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x9f62(%rip), %rsi      # 0x33985
leaq 0x9f64(%rip), %rdx      # 0x3398e
leaq 0x50(%rsp), %rdi
callq 0x862a
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
movq $0x0, 0x40(%rsp)
cmpl $0x3, %ebx
setge %r12b
jl 0x2a17c
movl %ebx, 0x18(%rsp)
movss 0xaeda(%rip), %xmm0     # 0x34938
movss %xmm0, 0xc(%rsp)
movl $0x14, 0x2c(%rsp)
movl $0x2, %r14d
movb $0x1, %al
movl %eax, 0x10(%rsp)
movq $0x0, 0x48(%rsp)
leaq 0x98(%rsp), %r15
movb $0x1, %al
movl %eax, 0x14(%rsp)
movslq %r14d, %rax
movq 0x20(%rsp), %rcx
movq (%rcx,%rax,8), %rsi
leaq 0x70(%rsp), %rbp
movq %rbp, %rdi
movq %r15, %rdx
callq 0x184a2
movq %rbp, %rdi
leaq 0xb57a(%rip), %rsi      # 0x3502f
callq 0x50f0
testl %eax, %eax
je 0x29bd8
movq %rbp, %rdi
leaq 0xb566(%rip), %rsi      # 0x35032
callq 0x50f0
testl %eax, %eax
je 0x29bd8
movq %rbp, %rdi
leaq 0xbedc(%rip), %rsi      # 0x359bf
callq 0x50f0
movb $0x1, %r13b
testl %eax, %eax
je 0x29c24
movq %rbp, %rdi
leaq 0xbec5(%rip), %rsi      # 0x359c2
callq 0x50f0
testl %eax, %eax
je 0x29c2e
movq %rbp, %rdi
leaq 0xb59b(%rip), %rsi      # 0x350af
callq 0x50f0
testl %eax, %eax
je 0x29c38
movq %rbp, %rdi
leaq 0xba56(%rip), %rsi      # 0x35581
callq 0x50f0
testl %eax, %eax
je 0x29c9d
movq %rbp, %rdi
leaq 0xb7f7(%rip), %rsi      # 0x35339
callq 0x50f0
testl %eax, %eax
je 0x29d82
movq %rbp, %rdi
leaq 0xb85e(%rip), %rsi      # 0x353b7
callq 0x50f0
testl %eax, %eax
je 0x29e6f
movq %rbp, %rdi
leaq 0xbf01(%rip), %rsi      # 0x35a71
callq 0x50f0
movb $0x1, %r13b
testl %eax, %eax
je 0x2a016
movq 0x70(%rsp), %rax
cmpb $0x2d, (%rax)
jne 0x2a022
movq 0x1745b(%rip), %rdi     # 0x40ff0
callq 0x5190
movq %rax, %rbx
movl $0x12, %edx
movq %rax, %rdi
leaq 0xb528(%rip), %rsi      # 0x350d4
callq 0x5420
movq 0x70(%rsp), %rsi
movq 0x78(%rsp), %rdx
movq %rbx, %rdi
callq 0x5420
movq %rax, %rdi
callq 0x5190
movq %rax, %rdi
callq 0x5190
jmp 0x2a0d0
xorl %r13d, %r13d
callq 0x296df
xorl %ebx, %ebx
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0x29c04
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x53c0
testb %r13b, %r13b
je 0x2a1a6
incl %r14d
cmpl 0x18(%rsp), %r14d
setl %r12b
jl 0x29a8f
jmp 0x2a1a6
movl $0x0, 0x14(%rsp)
jmp 0x29be2
movl $0x0, 0x10(%rsp)
jmp 0x29be2
incl %r14d
cmpl 0x18(%rsp), %r14d
jge 0x29ce3
movslq %r14d, %rax
movq 0x20(%rsp), %rcx
movq (%rcx,%rax,8), %rsi
movq %r15, %rbp
movq %r15, %rdi
leaq 0x1f(%rsp), %rdx
callq 0x184a2
movq %rbp, %rdi
leaq 0x30(%rsp), %rsi
callq 0x817c
movq 0x98(%rsp), %rdi
leaq 0xa8(%rsp), %rax
cmpq %rax, %rdi
je 0x29be2
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x53c0
jmp 0x29be2
incl %r14d
cmpl 0x18(%rsp), %r14d
jge 0x29dd0
movslq %r14d, %rax
movq 0x20(%rsp), %rcx
movq (%rcx,%rax,8), %rdi
callq 0x26159
movaps %xmm0, %xmm1
xorps %xmm0, %xmm0
ucomiss %xmm1, %xmm0
ja 0x29f71
ucomiss 0x9332(%rip), %xmm1     # 0x33004
ja 0x29f71
movss %xmm1, 0xc(%rsp)
jmp 0x29be2
movq 0x17306(%rip), %rcx     # 0x40ff0
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq 0x172e8(%rip), %rdi     # 0x40ff0
callq 0x5030
movq %rax, %rdi
callq 0x5250
movq %rax, %rbx
movl $0x21, %edx
movq %rax, %rdi
leaq 0xb38b(%rip), %rsi      # 0x350b2
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 0x2a0d0
incl %r14d
cmpl 0x18(%rsp), %r14d
jge 0x29ed2
movslq %r14d, %rax
movq 0x20(%rsp), %rcx
movq (%rcx,%rax,8), %rbp
movq 0x58(%rsp), %rax
movq %rax, 0x90(%rsp)
movq %rbp, %rdi
callq 0x5180
leaq 0x50(%rsp), %rdi
xorl %esi, %esi
movq 0x90(%rsp), %rdx
movq %rbp, %rcx
movq %rax, %r8
callq 0x55e0
jmp 0x29be2
movq 0x17219(%rip), %rcx     # 0x40ff0
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq 0x171fb(%rip), %rdi     # 0x40ff0
callq 0x5030
movq %rax, %rdi
callq 0x5250
movq %rax, %rbx
movl $0x2d, %edx
movq %rax, %rdi
leaq 0xbbb1(%rip), %rsi      # 0x359c5
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 0x2a0d0
incl %r14d
cmpl 0x18(%rsp), %r14d
jge 0x2a036
movslq %r14d, %rax
movq 0x20(%rsp), %rcx
movq (%rcx,%rax,8), %rdi
callq 0x260f0
movl %eax, 0x2c(%rsp)
testl %eax, %eax
jns 0x29be2
movq 0x1714f(%rip), %rdi     # 0x40ff0
callq 0x5190
movq %rax, %rbx
movl $0x2b, %edx
movq %rax, %rdi
leaq 0xbb8d(%rip), %rsi      # 0x35a45
callq 0x5420
movq %rbx, %rdi
callq 0x5190
movq %rax, %rdi
callq 0x5190
jmp 0x2a0d0
movq 0x17117(%rip), %rcx     # 0x40ff0
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq 0x170f9(%rip), %rdi     # 0x40ff0
callq 0x5030
movq %rax, %rdi
callq 0x5250
movq %rax, %rbx
movl $0x1e, %edx
movq %rax, %rdi
leaq 0xb426(%rip), %rsi      # 0x3533c
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 0x2a0d0
movss %xmm1, 0xc(%rsp)
movq 0x17072(%rip), %rcx     # 0x40ff0
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq 0x17054(%rip), %rdi     # 0x40ff0
callq 0x5030
movq %rax, %rdi
callq 0x5250
movq %rax, %rbx
movl $0x28, %edx
movq %rax, %rdi
leaq 0xba38(%rip), %rsi      # 0x359f3
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 0x2a0d0
movb $0x1, %al
movq %rax, 0x48(%rsp)
jmp 0x29be2
leaq 0x30(%rsp), %rdi
leaq 0x70(%rsp), %rsi
callq 0x855c
jmp 0x29be2
movq 0x16fb3(%rip), %rcx     # 0x40ff0
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq 0x16f95(%rip), %rdi     # 0x40ff0
callq 0x5030
movq %rax, %rdi
callq 0x5250
movq %rax, %rbx
movl $0x28, %edx
movq %rax, %rdi
leaq 0xb9a2(%rip), %rsi      # 0x35a1c
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 %r13d, %r13d
jmp 0x29be2
movq %rax, %rbx
cmpl $0x1, %edx
jne 0x2a6c6
movq %rbx, %rdi
callq 0x5160
movq 0x16ef8(%rip), %rdi     # 0x40ff0
callq 0x5190
movq %rax, %rbx
movl $0x28, %edx
movq %rax, %rdi
leaq 0xb90d(%rip), %rsi      # 0x35a1c
callq 0x5420
movq %rbx, %rdi
callq 0x5190
movq %rax, %rdi
callq 0x5190
callq 0x5630
jmp 0x2a0d0
movq %rax, %rbx
cmpl $0x1, %edx
jne 0x2a6c6
movq %rbx, %rdi
callq 0x5160
movq 0x16eaa(%rip), %rdi     # 0x40ff0
callq 0x5190
movq %rax, %rbx
movl $0x2d, %edx
movq %rax, %rdi
leaq 0xb868(%rip), %rsi      # 0x359c5
callq 0x5420
movq %rbx, %rdi
callq 0x5190
movq %rax, %rdi
callq 0x5190
callq 0x5630
jmp 0x2a0d0
movq $0x0, 0x48(%rsp)
movl $0x14, %ebp
movss 0xa7a6(%rip), %xmm0     # 0x34938
movss %xmm0, 0xc(%rsp)
movb $0x1, %al
movl %eax, 0x14(%rsp)
movb $0x1, %al
movl %eax, 0x10(%rsp)
jmp 0x2a1aa
movl 0x2c(%rsp), %ebp
testb $0x1, %r12b
jne 0x2a62f
movq 0x38(%rsp), %rax
cmpq 0x30(%rsp), %rax
je 0x2a25d
movl 0x10(%rsp), %eax
orb 0x14(%rsp), %al
testb $0x1, %al
jne 0x2a2d9
movq 0x16e15(%rip), %rdi     # 0x40ff0
movq (%rdi), %rax
addq -0x18(%rax), %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq 0x16dfa(%rip), %rdi     # 0x40ff0
callq 0x5030
movq %rax, %rdi
callq 0x5250
movq %rax, %rbx
leaq 0xb867(%rip), %rsi      # 0x35a74
movl $0x57, %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
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x53a0
jmp 0x2a3d8
movq 0x16d8c(%rip), %rdi     # 0x40ff0
movq (%rdi), %rax
addq -0x18(%rax), %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq 0x16d71(%rip), %rdi     # 0x40ff0
callq 0x5030
movq %rax, %rdi
callq 0x5250
movq %rax, %rbx
leaq 0xae51(%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
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5030
movq %rax, %rdi
callq 0x5250
movl $0x1, %ebx
callq 0x296df
jmp 0x2a62f
leaq 0xb7ec(%rip), %rsi      # 0x35acc
leaq 0x50(%rsp), %rdi
callq 0x50f0
testl %eax, %eax
je 0x2a354
callq 0x26746
movq 0x16cc6(%rip), %rbx     # 0x40fc0
leaq 0xb7f4(%rip), %rsi      # 0x35af5
movl $0x23, %edx
movq %rbx, %rdi
callq 0x5420
movq 0x30(%rsp), %r12
movq 0x38(%rsp), %rsi
subq %r12, %rsi
sarq $0x5, %rsi
movslq 0x171ca(%rip), %rax     # 0x414f0
cmpq %rax, %rsi
jbe 0x2a3f5
movq 0x16c8a(%rip), %rdi     # 0x40fc0
callq 0x5240
leaq 0xa7bf(%rip), %rsi      # 0x34b01
movl $0x6, %edx
movq %rax, %rdi
callq 0x5420
jmp 0x2a436
movq 0x16c95(%rip), %rdi     # 0x40ff0
movq (%rdi), %rax
addq -0x18(%rax), %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq 0x16c7a(%rip), %rdi     # 0x40ff0
callq 0x5030
movq %rax, %rdi
callq 0x5250
movq %rax, %rbx
leaq 0xb745(%rip), %rsi      # 0x35ad2
movl $0x22, %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
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
movl $0x1, %ebx
movq %rax, %rdi
callq 0x5250
jmp 0x2a62f
cmpq 0x38(%rsp), %r12
je 0x2a436
movq 0x16bbd(%rip), %r14     # 0x40fc0
leaq 0x9f8e(%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 0x38(%rsp), %r12
jne 0x2a40a
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq 0x16b6c(%rip), %rdi     # 0x40fc0
callq 0x5030
movq %rax, %rdi
callq 0x5250
movq 0x16b58(%rip), %rdi     # 0x40fc0
leaq 0xb6aa(%rip), %rsi      # 0x35b19
movl $0x36, %edx
callq 0x5420
movq 0x16b40(%rip), %rbx     # 0x40fc0
movq %rbx, %rdi
movl %ebp, %esi
callq 0x5690
movq %rax, %r14
leaq 0xb6bc(%rip), %rsi      # 0x35b50
movl $0x28, %edx
movq %rax, %rdi
callq 0x5420
movss 0x91d3(%rip), %xmm0     # 0x3367c
mulss 0xc(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
movq %r14, %rdi
callq 0x5610
movq %rax, %r14
leaq 0xb6b4(%rip), %rsi      # 0x35b79
movl $0x34, %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, 0x10(%rsp)
je 0x2a56c
movq 0x16ab9(%rip), %rdi     # 0x40fc0
leaq 0xb6a0(%rip), %rsi      # 0x35bae
movl $0x1d, %edx
callq 0x5420
movq 0x50(%rsp), %rsi
movq 0x58(%rsp), %rdx
movq 0x16a97(%rip), %rdi     # 0x40fc0
callq 0x5420
movq %rax, %r14
leaq 0x94cd(%rip), %rsi      # 0x33a05
movl $0xe, %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, 0x14(%rsp)
je 0x2a5cb
movq 0x16a46(%rip), %rdi     # 0x40fc0
leaq 0xb64b(%rip), %rsi      # 0x35bcc
movl $0x32, %edx
callq 0x5420
movq 0x50(%rsp), %rsi
movq 0x58(%rsp), %rdx
movq 0x16a24(%rip), %rdi     # 0x40fc0
callq 0x5420
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 (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x53a0
movsbl %al, %esi
movq 0x169d7(%rip), %rdi     # 0x40fc0
callq 0x5030
movq %rax, %rdi
callq 0x5250
movzbl 0x10(%rsp), %esi
andl $0x1, %esi
movzbl 0x14(%rsp), %edx
andl $0x1, %edx
movzbl 0x48(%rsp), %r9d
andl $0x1, %r9d
leaq 0x50(%rsp), %rdi
leaq 0x30(%rsp), %rcx
movl %ebp, %r8d
movss 0xc(%rsp), %xmm0
callq 0x10600
xorl %ebx, %ebx
testl %eax, %eax
setne %bl
leaq 0x30(%rsp), %rdi
callq 0xabee
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x2a655
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x53c0
movl %ebx, %eax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2a6c3
movq %rax, %rbx
callq 0x5630
jmp 0x2a6c6
jmp 0x2a6c3
movq %rax, %rbx
callq 0x5630
jmp 0x2a6c6
movq %rax, %rdi
callq 0x7d6a
movq %rax, %rbx
movq 0x98(%rsp), %rdi
leaq 0xa8(%rsp), %rax
cmpq %rax, %rdi
je 0x2a6c6
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x53c0
jmp 0x2a6c6
jmp 0x2a6c3
movq %rax, %rbx
jmp 0x2a70e
jmp 0x2a6be
jmp 0x2a6be
movq %rax, %rbx
jmp 0x2a6e8
movq %rax, %rbx
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0x2a6e8
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x53c0
leaq 0x30(%rsp), %rdi
callq 0xabee
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x2a70e
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x53c0
movq %rbx, %rdi
callq 0x56a0