// File: /workspace/github_cpp_makefile_star2_O2/tonymugen[P]sampleSNPs/sampleSNPs.cpp
// Function: main
int main(int argc, char *argv[]){
	string fileType;   // type variant file; Supporting what varfiles supports
	string inFileName; // input file name; will strip off the extension if necessary
	string nSampTxt;   // string version of the number of samples
	uint64_t n;        // number of samples

	// set usage message
	string cliHelp = "Command line flags required (in any order):\n  -s NNN (number of samples)\n  -i fileName (input file name, with or without extension)\n  -t fileType (type of SNP file; required if no extension in the input file name)";
	unordered_map <char, string> clInfo;
	parseCL(argc, argv, clInfo);
	auto clIter = clInfo.begin(); // iterator of the command line flags

	// Process CLI flags
	clIter = clInfo.find('s');
	if (clIter == clInfo.end()) { // if not there, complain
		cerr << "ERROR: specification of the number of samples is required" << endl;
		cerr << cliHelp << endl;
		exit(1);
	} else {
		n        = stoi(clIter->second);
		nSampTxt = clIter->second;
	}

	clIter = clInfo.find('i');
	if (clIter == clInfo.end()) { // if not there, complain
		cerr << "ERROR: specification of the input file name is required" << endl;
		cerr << cliHelp << endl;
		exit(2);
	} else {
		inFileName = clIter->second;
	}

	clIter = clInfo.find('t');
	if (clIter == clInfo.end()) { // if not there, set to nothing
		fileType = "";
	} else {
		fileType = clIter->second;
	}

	// Processing file types first
	if (fileType == "BED") {
		// Doing BED. First figure out if there is an extension on the file name
		string ext;
		bool haveExt = false;
		auto flNit   = inFileName.end() - 1;
		for (; flNit != inFileName.begin(); --flNit) {
			if ((*flNit) == '.') {
				haveExt = true;
				break;
			}
			ext = (*flNit) + ext;
		}
		// get rid of the extension
		if (haveExt && (ext != "bed")) {
			cerr << "WARNING: extension " << ext << " non-standard for BED files; will assume that it is not an extension" << endl;
		} else if (haveExt){
			inFileName.erase(flNit, inFileName.end());
		}
		string outFileStub = inFileName + "_s" + nSampTxt;
		BedFileI bedIn(inFileName);
		BedFileO bedOut(outFileStub);
		bedIn.sample(bedOut, n);

	} else if (fileType == "TPED"){
		// Doing TPED. First figure out if there is an extension on the file name
		string ext;
		bool haveExt = false;
		auto flNit   = inFileName.end();
		for (; flNit != inFileName.begin(); --flNit) {
			if ((*flNit) == '.') {
				haveExt = true;
				break;
			}
			ext = (*flNit) + ext;
		}
		// get rid of the extension
		if (haveExt && (ext != "tped")) {
			cerr << "WARNING: extension " << ext << " non-standard for TPED files; will assume that it is not an extension" << endl;
		} else if (haveExt){
			inFileName.erase(flNit, inFileName.end());
		}
		string outFileStub = inFileName + "_s" + nSampTxt;
		TpedFileI tpedIn(inFileName);
		TpedFileO tpedOut(outFileStub);
		tpedIn.sample(tpedOut, n);

	} else if (fileType == "VCF"){
		// Doing VCF. First figure out if there is an extension on the file name
		string ext;
		bool haveExt = false;
		auto flNit   = inFileName.end() - 1;
		for (; flNit != inFileName.begin(); --flNit) {
			if ((*flNit) == '.') {
				haveExt = true;
				break;
			}
			ext = (*flNit) + ext;
		}
		// get rid of the extension
		if (haveExt) {
			if (ext != "vcf") {
				// Did they specify a file name stub that has periods in it? If yes, the file with the .vcf added should exist
				string testNam = inFileName + ".vcf";
				if (FILE *file = fopen(testNam.c_str(), "r")) {
					ext = "vcf";
					fclose(file);
				} else {
					cerr << "WARNING: extension " << ext << " non-standard for VCF files" << endl;
					inFileName.erase(flNit, inFileName.end());
				}
			} else {
				inFileName.erase(flNit, inFileName.end());
			}

		}
		string outFileName = inFileName + "_s" + nSampTxt + "." + ext; // not messing with the provided extension
		inFileName         = inFileName + "." + ext;

		VcfFileI vcfIn(inFileName);
		VcfFileO vcfOut(outFileName);
		vcfIn.sample(vcfOut, n);

	} else if (fileType == "HMP"){
		// Doing hapmap. First figure out if there is an extension on the file name
		string ext;
		bool haveExt = false;
		auto flNit   = inFileName.end() - 1;
		for (; flNit != inFileName.begin(); --flNit) {
			if ((*flNit) == '.') {
				if (ext == "txt") { // because typically it is .hmp.txt
					ext = (*flNit) + ext;
					continue;
				}
				haveExt = true;
				break;
			}
			ext = (*flNit) + ext;
		}
		// get rid of the extension
		if (haveExt) {
			if ( (ext != "hmp.txt") && (ext != "hmp") ) {
				// Did they specify a file name stub that has periods in it? If yes, the file with the .hmp.txt added should exist
				string testNam1 = inFileName + ".hmp.txt";
				string testNam2 = inFileName + ".hmp";
				if (FILE *file = fopen(testNam1.c_str(), "r")) {
					ext = "hmp.txt";
					fclose(file);
				} else if (FILE *file = fopen(testNam2.c_str(), "r")){
					ext = "hmp";
					fclose(file);
				}
				else {
					cerr << "WARNING: extension " << ext << " non-standard for HapMap files" << endl;
					inFileName.erase(flNit, inFileName.end());
				}
			} else {
				inFileName.erase(flNit, inFileName.end());
			}
		}
		string outFileName = inFileName + "_s" + nSampTxt + "." + ext;
		inFileName         = inFileName + "." + ext;
		HmpFileI hmpIn(inFileName);
		HmpFileO hmpOut(outFileName);
		hmpIn.sample(hmpOut, n);

	} else { // no (or an unrecognized) file type specified on CL
		// First figure out if there is an extension on the file name
		string ext;
		bool haveExt = false;
		auto flNit   = inFileName.end() - 1;
		for (; flNit != inFileName.begin(); --flNit) {
			if ((*flNit) == '.') {
				if (ext == "txt") { // because typically it is .hmp.txt
					ext = (*flNit) + ext;
					continue;
				}
				haveExt = true;
				break;
			}
			ext = (*flNit) + ext;
		}
		if (haveExt) {
			if (ext == "bed") {
				if (!fileType.empty()) {
					cerr << "WARNING: unrecognized file type " << fileType << " specified. Assuming BED file based on extension" << endl;
				}
				inFileName.erase(flNit, inFileName.end());
				string outFileStub = inFileName + "_s" + nSampTxt;
				BedFileI bedIn(inFileName);
				BedFileO bedOut(outFileStub);
				bedIn.sample(bedOut, n);

			} else if (ext == "tped") {
				if (!fileType.empty()) {
					cerr << "WARNING: unrecognized file type " << fileType << " specified. Assuming TPED file based on extension" << endl;
				}
				inFileName.erase(flNit, inFileName.end());
				string outFileStub = inFileName + "_s" + nSampTxt;
				TpedFileI tpedIn(inFileName);
				TpedFileO tpedOut(outFileStub);
				tpedIn.sample(tpedOut, n);

			} else if (ext == "vcf") {
				if (!fileType.empty()) {
					cerr << "WARNING: unrecognized file type " << fileType << " specified. Assuming VCF file based on extension" << endl;
				}
				inFileName.erase(flNit, inFileName.end());
				string outFileName = inFileName + "_s" + nSampTxt + ".vcf";
				inFileName         = inFileName + "." + ext;
				VcfFileI vcfIn(inFileName);
				VcfFileO vcfOut(outFileName);
				vcfIn.sample(vcfOut, n);

			} else if ( (ext == "hmp.txt") || (ext == "hmp") ) {
				if (!fileType.empty()) {
					cerr << "WARNING: unrecognized file type " << fileType << " specified. Assuming HapMap file based on extension" << endl;
				}
				inFileName.erase(flNit, inFileName.end());
				string outFileName = inFileName + "_s" + nSampTxt + ext;
				inFileName         = inFileName + "." + ext;
				HmpFileI hmpIn(inFileName);
				HmpFileO hmpOut(outFileName);
				hmpIn.sample(hmpOut, n);

			} else {
				if (fileType.empty()) {
					cerr << "ERROR: unrecognized extension (" << ext << ") in input file name " << inFileName << " and no file type specified" << endl;
					exit(3);
				} else {
					cerr << "ERROR: unrecognized extension (" << ext << ") in input file name " << inFileName << " and unrecognized file type (" << fileType  << ") specified" << endl;
					exit(4);
				}

			}
		} else {
			if (fileType.empty()) {
				cerr << "ERROR: no extension in input file name " << inFileName << " and no file type specified" << endl;
				exit(3);
			} else {
				cerr << "ERROR: no extension in input file name " << inFileName << " and unrecognized file type (" << fileType  << ") specified" << endl;
				exit(4);
			}
		}
	}

}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xe38, %rsp            # imm = 0xE38
movq %rsi, %rbx
leaq 0x78(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movl %edi, 0x8c(%rsp)
xorl %ecx, %ecx
leaq 0x10(%rsp), %rdx
movq %rdx, -0x10(%rdx)
andq $0x0, -0x8(%rdx)
movb %cl, (%rax)
movb %cl, (%rdx)
leaq 0xa0(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb %cl, (%rax)
leaq 0xf711(%rip), %rsi      # 0x1407f
leaq 0xd0(%rsp), %rdi
leaq 0x128(%rsp), %rdx
callq 0x5d1e
leaq 0x120(%rsp), %rax
movq %rax, -0x30(%rax)
movq $0x1, -0x28(%rax)
xorps %xmm0, %xmm0
movups %xmm0, -0x20(%rax)
movl $0x3f800000, -0x10(%rax) # imm = 0x3F800000
movups %xmm0, -0x8(%rax)
leaq 0x8c(%rsp), %rdi
leaq 0xf0(%rsp), %rdx
movq %rbx, %rsi
callq 0x484c
leaq 0x128(%rsp), %rsi
movb $0x73, (%rsi)
leaq 0xf0(%rsp), %rdi
callq 0x66ba
movq %rax, %rbx
testq %rax, %rax
je 0x596d
addq $0x10, %rbx
pushq $0xa
popq %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x5d59
cltq
movq %rax, 0x40(%rsp)
leaq 0x90(%rsp), %rdi
movq %rbx, %rsi
callq 0x4170
leaq 0x128(%rsp), %rsi
movb $0x69, (%rsi)
leaq 0xf0(%rsp), %rdi
callq 0x66ba
testq %rax, %rax
je 0x59a8
addq $0x10, %rax
movq %rsp, %rdi
movq %rax, %rsi
callq 0x4170
leaq 0x128(%rsp), %rsi
movb $0x74, (%rsi)
leaq 0xf0(%rsp), %rdi
callq 0x66ba
testq %rax, %rax
je 0x4a6d
addq $0x10, %rax
leaq 0x68(%rsp), %rdi
movq %rax, %rsi
callq 0x4170
jmp 0x4a7e
leaq 0x100b9(%rip), %rsi     # 0x14b2d
leaq 0x68(%rsp), %rdi
callq 0x4520
leaq 0xfdf8(%rip), %rsi      # 0x1487d
leaq 0x68(%rsp), %rdi
callq 0x5d75
leaq 0x30(%rsp), %rbx
testb %al, %al
je 0x4aff
leaq 0x20(%rsp), %r14
movq %rbx, (%r14)
andq $0x0, 0x8(%r14)
movb $0x0, 0x10(%r14)
movq (%rsp), %rax
movq 0x8(%rsp), %rcx
leaq (%rcx,%rax), %rbx
decq %rbx
leaq 0x128(%rsp), %r15
cmpq %rax, %rbx
je 0x4d59
movb (%rbx), %al
cmpb $0x2e, %al
je 0x4bf7
movsbl %al, %esi
movq %r15, %rdi
movq %r14, %rdx
callq 0x5d82
movq %r14, %rdi
movq %r15, %rsi
callq 0x4320
movq %r15, %rdi
callq 0x4558
movq (%rsp), %rax
decq %rbx
jmp 0x4ac2
leaq 0xf71d(%rip), %rsi      # 0x14223
leaq 0x68(%rsp), %rdi
callq 0x5d75
testb %al, %al
je 0x4b77
leaq 0x20(%rsp), %r14
movq %rbx, (%r14)
andq $0x0, 0x8(%r14)
movb $0x0, 0x10(%r14)
movq (%rsp), %rax
movq 0x8(%rsp), %rbx
addq %rax, %rbx
leaq 0x128(%rsp), %r15
cmpq %rax, %rbx
je 0x4fdf
movb (%rbx), %al
cmpb $0x2e, %al
je 0x4cf2
movsbl %al, %esi
movq %r15, %rdi
movq %r14, %rdx
callq 0x5d82
movq %r14, %rdi
movq %r15, %rsi
callq 0x4320
movq %r15, %rdi
callq 0x4558
decq %rbx
movq (%rsp), %rax
jmp 0x4b3a
leaq 0xf6f0(%rip), %rsi      # 0x1426e
leaq 0x68(%rsp), %rdi
callq 0x5d75
testb %al, %al
je 0x4c4c
leaq 0x20(%rsp), %r14
movq %rbx, (%r14)
andq $0x0, 0x8(%r14)
movb $0x0, 0x10(%r14)
movq (%rsp), %rax
movq 0x8(%rsp), %rcx
leaq (%rcx,%rax), %rbx
decq %rbx
leaq 0x128(%rsp), %r15
cmpq %rax, %rbx
je 0x53e9
movb (%rbx), %al
cmpb $0x2e, %al
je 0x4f5f
movsbl %al, %esi
movq %r15, %rdi
movq %r14, %rdx
callq 0x5d82
movq %r14, %rdi
movq %r15, %rsi
callq 0x4320
movq %r15, %rdi
callq 0x4558
movq (%rsp), %rax
decq %rbx
jmp 0x4bba
leaq 0xfb30(%rip), %rsi      # 0x1472e
leaq 0x20(%rsp), %rdi
callq 0x5ddf
testb %al, %al
je 0x4d47
movq 0x173d9(%rip), %rdi     # 0x1bff0
leaq 0xf5a9(%rip), %rsi      # 0x141c7
callq 0x42a0
leaq 0x20(%rsp), %rsi
movq %rax, %rdi
callq 0x4270
leaq 0xf5a4(%rip), %rsi      # 0x141db
movq %rax, %rdi
callq 0x42a0
movq %rax, %rdi
callq 0x4140
jmp 0x4d59
leaq 0xf640(%rip), %rsi      # 0x14293
leaq 0x68(%rsp), %rdi
callq 0x5d75
leaq 0x20(%rsp), %r14
testb %al, %al
je 0x4df2
movq %rbx, (%r14)
andq $0x0, 0x8(%r14)
movb $0x0, 0x10(%r14)
movq (%rsp), %rax
movq 0x8(%rsp), %rcx
leaq (%rcx,%rax), %rbx
decq %rbx
leaq 0xf60e(%rip), %r15      # 0x1429c
leaq 0x128(%rsp), %r12
cmpq %rax, %rbx
je 0x56e8
movb (%rbx), %al
cmpb $0x2e, %al
jne 0x4cc8
movq %r14, %rdi
movq %r15, %rsi
callq 0x5d75
testb %al, %al
je 0x5178
movsbl (%rbx), %esi
movq %r12, %rdi
movq %r14, %rdx
callq 0x5d82
jmp 0x4cd6
movsbl %al, %esi
movq %r12, %rdi
movq %r14, %rdx
callq 0x5d82
movq %r14, %rdi
movq %r12, %rsi
callq 0x4320
movq %r12, %rdi
callq 0x4558
movq (%rsp), %rax
decq %rbx
jmp 0x4c96
leaq 0xf75e(%rip), %rsi      # 0x14457
leaq 0x20(%rsp), %rdi
callq 0x5ddf
testb %al, %al
je 0x4fcd
movq 0x172de(%rip), %rdi     # 0x1bff0
leaq 0xf4ae(%rip), %rsi      # 0x141c7
callq 0x42a0
leaq 0x20(%rsp), %rsi
movq %rax, %rdi
callq 0x4270
leaq 0xf4f6(%rip), %rsi      # 0x14228
movq %rax, %rdi
callq 0x42a0
movq %rax, %rdi
callq 0x4140
jmp 0x4fdf
movq %rsp, %rdi
movq (%rdi), %rdx
addq 0x8(%rdi), %rdx
movq %rbx, %rsi
callq 0x4080
leaq 0xf4c0(%rip), %rdx      # 0x14220
leaq 0x128(%rsp), %rdi
movq %rsp, %rsi
callq 0x5e08
leaq 0x48(%rsp), %rdi
leaq 0x128(%rsp), %rsi
leaq 0x90(%rsp), %rdx
callq 0x5de9
leaq 0x128(%rsp), %rdi
callq 0x4558
leaq 0x128(%rsp), %rdi
movq %rsp, %rsi
callq 0x5e40
leaq 0x7b0(%rsp), %rdi
leaq 0x48(%rsp), %rsi
callq 0x5e5a
leaq 0x128(%rsp), %rdi
leaq 0x7b0(%rsp), %rsi
leaq 0x40(%rsp), %rdx
callq 0x9b6e
leaq 0x7b0(%rsp), %rdi
callq 0x7520
leaq 0x128(%rsp), %rdi
callq 0x7520
jmp 0x5828
movq %rbx, (%r14)
andq $0x0, 0x8(%r14)
movb $0x0, 0x10(%r14)
movq (%rsp), %rax
movq 0x8(%rsp), %rcx
leaq (%rcx,%rax), %rbx
decq %rbx
leaq 0xf486(%rip), %r15      # 0x1429c
leaq 0x128(%rsp), %r12
cmpq %rax, %rbx
je 0x58d4
movb (%rbx), %al
cmpb $0x2e, %al
jne 0x4e4c
movq %r14, %rdi
movq %r15, %rsi
callq 0x5d75
testb %al, %al
je 0x4e76
movsbl (%rbx), %esi
movq %r12, %rdi
movq %r14, %rdx
callq 0x5d82
jmp 0x4e5a
movsbl %al, %esi
movq %r12, %rdi
movq %r14, %rdx
callq 0x5d82
movq %r14, %rdi
movq %r12, %rsi
callq 0x4320
movq %r12, %rdi
callq 0x4558
movq (%rsp), %rax
decq %rbx
jmp 0x4e1e
leaq 0xf8b1(%rip), %rsi      # 0x1472e
leaq 0x20(%rsp), %rdi
callq 0x5d75
testb %al, %al
je 0x5078
cmpq $0x0, 0x70(%rsp)
je 0x4ece
movq 0x17152(%rip), %rdi     # 0x1bff0
leaq 0xf41f(%rip), %rsi      # 0x142c4
callq 0x42a0
leaq 0x68(%rsp), %rsi
movq %rax, %rdi
callq 0x4270
leaq 0xf427(%rip), %rsi      # 0x142e5
movq %rax, %rdi
callq 0x42a0
movq %rax, %rdi
callq 0x4140
movq %rsp, %rdi
movq (%rdi), %rdx
addq 0x8(%rdi), %rdx
movq %rbx, %rsi
callq 0x4080
leaq 0xf339(%rip), %rdx      # 0x14220
leaq 0x128(%rsp), %rdi
movq %rsp, %rsi
callq 0x5e08
leaq 0x48(%rsp), %rdi
leaq 0x128(%rsp), %rsi
leaq 0x90(%rsp), %rdx
callq 0x5de9
leaq 0x128(%rsp), %rdi
callq 0x4558
leaq 0x128(%rsp), %rdi
movq %rsp, %rsi
callq 0x5e40
leaq 0x7b0(%rsp), %rdi
leaq 0x48(%rsp), %rsi
callq 0x5e5a
leaq 0x128(%rsp), %rdi
leaq 0x7b0(%rsp), %rsi
leaq 0x40(%rsp), %rdx
callq 0x9b6e
jmp 0x4dd3
leaq 0xf30d(%rip), %rsi      # 0x14273
leaq 0x20(%rsp), %rdi
callq 0x5ddf
testb %al, %al
je 0x5161
leaq 0xf2f3(%rip), %rdx      # 0x14272
leaq 0x128(%rsp), %rdi
movq %rsp, %rsi
callq 0x5e08
movq 0x128(%rsp), %rdi
leaq 0xfa42(%rip), %rsi      # 0x149e0
callq 0x42f0
testq %rax, %rax
je 0x5393
movq %rax, %r14
leaq 0xf2bd(%rip), %rsi      # 0x14273
leaq 0x20(%rsp), %rdi
callq 0x4520
movq %r14, %rdi
callq 0x42b0
jmp 0x53dc
movq %rsp, %rdi
movq (%rdi), %rdx
addq 0x8(%rdi), %rdx
movq %rbx, %rsi
callq 0x4080
leaq 0xf23a(%rip), %rdx      # 0x14220
leaq 0x128(%rsp), %rdi
movq %rsp, %rsi
callq 0x5e08
leaq 0x48(%rsp), %rdi
leaq 0x128(%rsp), %rsi
leaq 0x90(%rsp), %rdx
callq 0x5de9
leaq 0x128(%rsp), %rdi
callq 0x4558
leaq 0x128(%rsp), %rdi
movq %rsp, %rsi
callq 0x5e74
leaq 0x7b0(%rsp), %rdi
leaq 0x48(%rsp), %rsi
callq 0x5e8e
leaq 0x128(%rsp), %rdi
leaq 0x7b0(%rsp), %rsi
leaq 0x40(%rsp), %rdx
callq 0xf8a4
leaq 0x7b0(%rsp), %rdi
callq 0xebfe
leaq 0x128(%rsp), %rdi
callq 0xebfe
jmp 0x5828
leaq 0xf3d8(%rip), %rsi      # 0x14457
leaq 0x20(%rsp), %rdi
callq 0x5d75
testb %al, %al
je 0x520e
cmpq $0x0, 0x70(%rsp)
je 0x50d0
movq 0x16f50(%rip), %rdi     # 0x1bff0
leaq 0xf21d(%rip), %rsi      # 0x142c4
callq 0x42a0
leaq 0x68(%rsp), %rsi
movq %rax, %rdi
callq 0x4270
leaq 0xf256(%rip), %rsi      # 0x14316
movq %rax, %rdi
callq 0x42a0
movq %rax, %rdi
callq 0x4140
movq %rsp, %rdi
movq (%rdi), %rdx
addq 0x8(%rdi), %rdx
movq %rbx, %rsi
callq 0x4080
leaq 0xf137(%rip), %rdx      # 0x14220
leaq 0x128(%rsp), %rdi
movq %rsp, %rsi
callq 0x5e08
leaq 0x48(%rsp), %rdi
leaq 0x128(%rsp), %rsi
leaq 0x90(%rsp), %rdx
callq 0x5de9
leaq 0x128(%rsp), %rdi
callq 0x4558
leaq 0x128(%rsp), %rdi
movq %rsp, %rsi
callq 0x5e74
leaq 0x7b0(%rsp), %rdi
leaq 0x48(%rsp), %rsi
callq 0x5e8e
leaq 0x128(%rsp), %rdi
leaq 0x7b0(%rsp), %rsi
leaq 0x40(%rsp), %rdx
callq 0xf8a4
jmp 0x5059
movq %rsp, %rdi
movq (%rdi), %rdx
addq 0x8(%rdi), %rdx
movq %rbx, %rsi
callq 0x4080
jmp 0x53e9
leaq 0xf119(%rip), %rsi      # 0x14298
leaq 0x20(%rsp), %rdi
callq 0x5ddf
testb %al, %al
je 0x537c
leaq 0xf109(%rip), %rsi      # 0x142a1
leaq 0x20(%rsp), %rdi
callq 0x5ddf
testb %al, %al
je 0x537c
leaq 0xf0e6(%rip), %rdx      # 0x14297
leaq 0x128(%rsp), %rdi
movq %rsp, %rsi
callq 0x5e08
leaq 0xf0d8(%rip), %rdx      # 0x142a0
leaq 0x7b0(%rsp), %rdi
movq %rsp, %rsi
callq 0x5e08
movq 0x128(%rsp), %rdi
leaq 0xf7f9(%rip), %rsi      # 0x149e0
callq 0x42f0
testq %rax, %rax
je 0x5695
movq %rax, %r14
leaq 0xf099(%rip), %rsi      # 0x14298
leaq 0x20(%rsp), %rdi
callq 0x4520
jmp 0x56c6
leaq 0xf05e(%rip), %rsi      # 0x14273
leaq 0x20(%rsp), %rdi
callq 0x5d75
testb %al, %al
je 0x5514
cmpq $0x0, 0x70(%rsp)
je 0x5266
movq 0x16dba(%rip), %rdi     # 0x1bff0
leaq 0xf087(%rip), %rsi      # 0x142c4
callq 0x42a0
leaq 0x68(%rsp), %rsi
movq %rax, %rdi
callq 0x4270
leaq 0xf0f2(%rip), %rsi      # 0x14348
movq %rax, %rdi
callq 0x42a0
movq %rax, %rdi
callq 0x4140
movq %rsp, %rdi
movq (%rdi), %rdx
addq 0x8(%rdi), %rdx
movq %rbx, %rsi
callq 0x4080
leaq 0xefa1(%rip), %rdx      # 0x14220
leaq 0x7b0(%rsp), %rdi
movq %rsp, %rsi
callq 0x5e08
leaq 0x128(%rsp), %rdi
leaq 0x7b0(%rsp), %rsi
leaq 0x90(%rsp), %rdx
callq 0x5de9
leaq 0xefbf(%rip), %rdx      # 0x14272
leaq 0x48(%rsp), %rdi
leaq 0x128(%rsp), %rsi
callq 0x5ea7
leaq 0x128(%rsp), %rdi
callq 0x4558
leaq 0x7b0(%rsp), %rdi
callq 0x4558
leaq 0xf3d9(%rip), %rdx      # 0x146bf
leaq 0x7b0(%rsp), %rdi
movq %rsp, %rsi
callq 0x5e08
leaq 0x128(%rsp), %rdi
leaq 0x7b0(%rsp), %rsi
leaq 0x20(%rsp), %rdx
callq 0x5de9
movq %rsp, %rbx
leaq 0x128(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4320
movq %r14, %rdi
callq 0x4558
leaq 0x7b0(%rsp), %rdi
callq 0x4558
leaq 0x128(%rsp), %rdi
movq %rbx, %rsi
callq 0x5ec6
leaq 0x7b0(%rsp), %rdi
leaq 0x48(%rsp), %rsi
callq 0x5ee0
leaq 0x128(%rsp), %rdi
leaq 0x7b0(%rsp), %rsi
leaq 0x40(%rsp), %rdx
callq 0x10a60
jmp 0x580e
movq %rsp, %rdi
movq (%rdi), %rdx
addq 0x8(%rdi), %rdx
movq %rbx, %rsi
callq 0x4080
jmp 0x56e8
movq 0x16c56(%rip), %rdi     # 0x1bff0
leaq 0xee26(%rip), %rsi      # 0x141c7
callq 0x42a0
leaq 0x20(%rsp), %rsi
movq %rax, %rdi
callq 0x4270
leaq 0xeebd(%rip), %rsi      # 0x14277
movq %rax, %rdi
callq 0x42a0
movq %rax, %rdi
callq 0x4140
movq %rsp, %rdi
movq (%rdi), %rdx
addq 0x8(%rdi), %rdx
movq %rbx, %rsi
callq 0x4080
leaq 0x128(%rsp), %rdi
callq 0x4558
leaq 0xee30(%rip), %rdx      # 0x14220
leaq 0xb0(%rsp), %rdi
movq %rsp, %rsi
callq 0x5e08
leaq 0x7b0(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
leaq 0x90(%rsp), %rdx
callq 0x5de9
leaq 0xf29b(%rip), %rdx      # 0x146bf
leaq 0x128(%rsp), %rdi
leaq 0x7b0(%rsp), %rsi
callq 0x5ea7
leaq 0x48(%rsp), %rdi
leaq 0x128(%rsp), %rsi
leaq 0x20(%rsp), %rdx
callq 0x5de9
leaq 0x128(%rsp), %rdi
callq 0x4558
leaq 0x7b0(%rsp), %rdi
callq 0x4558
leaq 0xb0(%rsp), %rdi
callq 0x4558
leaq 0xf241(%rip), %rdx      # 0x146bf
leaq 0x7b0(%rsp), %rdi
movq %rsp, %rsi
callq 0x5e08
leaq 0x128(%rsp), %rdi
leaq 0x7b0(%rsp), %rsi
leaq 0x20(%rsp), %rdx
callq 0x5de9
movq %rsp, %rbx
leaq 0x128(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4320
movq %r14, %rdi
callq 0x4558
leaq 0x7b0(%rsp), %rdi
callq 0x4558
leaq 0x128(%rsp), %rdi
movq %rbx, %rsi
callq 0x5ec6
leaq 0x7b0(%rsp), %rdi
leaq 0x48(%rsp), %rsi
callq 0x5ee0
leaq 0x128(%rsp), %rdi
leaq 0x7b0(%rsp), %rsi
leaq 0x40(%rsp), %rdx
callq 0x10a60
jmp 0x580e
leaq 0xed7d(%rip), %rsi      # 0x14298
leaq 0x20(%rsp), %rdi
callq 0x5d75
testb %al, %al
jne 0x5542
leaq 0xed71(%rip), %rsi      # 0x142a1
leaq 0x20(%rsp), %rdi
callq 0x5d75
testb %al, %al
je 0x59e7
cmpq $0x0, 0x70(%rsp)
je 0x5581
movq 0x16a9f(%rip), %rdi     # 0x1bff0
leaq 0xed6c(%rip), %rsi      # 0x142c4
callq 0x42a0
leaq 0x68(%rsp), %rsi
movq %rax, %rdi
callq 0x4270
leaq 0xee08(%rip), %rsi      # 0x14379
movq %rax, %rdi
callq 0x42a0
movq %rax, %rdi
callq 0x4140
movq %rsp, %rdi
movq (%rdi), %rdx
addq 0x8(%rdi), %rdx
movq %rbx, %rsi
callq 0x4080
leaq 0xec86(%rip), %rdx      # 0x14220
leaq 0x7b0(%rsp), %rdi
movq %rsp, %rsi
callq 0x5e08
leaq 0x128(%rsp), %rdi
leaq 0x7b0(%rsp), %rsi
leaq 0x90(%rsp), %rdx
callq 0x5de9
leaq 0x48(%rsp), %rdi
leaq 0x128(%rsp), %rsi
leaq 0x20(%rsp), %rdx
callq 0x5de9
leaq 0x128(%rsp), %rdi
callq 0x4558
leaq 0x7b0(%rsp), %rdi
callq 0x4558
leaq 0xf0c0(%rip), %rdx      # 0x146bf
leaq 0x7b0(%rsp), %rdi
movq %rsp, %rsi
callq 0x5e08
leaq 0x128(%rsp), %rdi
leaq 0x7b0(%rsp), %rsi
leaq 0x20(%rsp), %rdx
callq 0x5de9
movq %rsp, %rbx
leaq 0x128(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4320
movq %r14, %rdi
callq 0x4558
leaq 0x7b0(%rsp), %rdi
callq 0x4558
leaq 0x128(%rsp), %rdi
movq %rbx, %rsi
callq 0x11308
leaq 0x7b0(%rsp), %rdi
leaq 0x48(%rsp), %rsi
callq 0x5efa
leaq 0x128(%rsp), %rdi
leaq 0x7b0(%rsp), %rsi
leaq 0x40(%rsp), %rdx
callq 0x1184a
jmp 0x580e
movq 0x7b0(%rsp), %rdi
leaq 0xf33c(%rip), %rsi      # 0x149e0
callq 0x42f0
testq %rax, %rax
je 0x5886
movq %rax, %r14
leaq 0xebe5(%rip), %rsi      # 0x142a1
leaq 0x20(%rsp), %rdi
callq 0x4520
movq %r14, %rdi
callq 0x42b0
leaq 0x7b0(%rsp), %rdi
callq 0x4558
leaq 0x128(%rsp), %rdi
callq 0x4558
leaq 0xeb31(%rip), %rdx      # 0x14220
leaq 0xb0(%rsp), %rdi
movq %rsp, %rsi
callq 0x5e08
leaq 0x7b0(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
leaq 0x90(%rsp), %rdx
callq 0x5de9
leaq 0xef9c(%rip), %rdx      # 0x146bf
leaq 0x128(%rsp), %rdi
leaq 0x7b0(%rsp), %rsi
callq 0x5ea7
leaq 0x48(%rsp), %rdi
leaq 0x128(%rsp), %rsi
leaq 0x20(%rsp), %rdx
callq 0x5de9
leaq 0x128(%rsp), %rdi
callq 0x4558
leaq 0x7b0(%rsp), %rdi
callq 0x4558
leaq 0xb0(%rsp), %rdi
callq 0x4558
leaq 0xef42(%rip), %rdx      # 0x146bf
leaq 0x7b0(%rsp), %rdi
movq %rsp, %rsi
callq 0x5e08
leaq 0x128(%rsp), %rdi
leaq 0x7b0(%rsp), %rsi
leaq 0x20(%rsp), %rdx
callq 0x5de9
movq %rsp, %rbx
leaq 0x128(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4320
movq %r14, %rdi
callq 0x4558
leaq 0x7b0(%rsp), %rdi
callq 0x4558
leaq 0x128(%rsp), %rdi
movq %rbx, %rsi
callq 0x11308
leaq 0x7b0(%rsp), %rdi
leaq 0x48(%rsp), %rsi
callq 0x5efa
leaq 0x128(%rsp), %rdi
leaq 0x7b0(%rsp), %rsi
leaq 0x40(%rsp), %rdx
callq 0x1184a
leaq 0x7b0(%rsp), %rdi
callq 0x5f14
leaq 0x128(%rsp), %rdi
callq 0x5f14
leaq 0x48(%rsp), %rdi
callq 0x4558
leaq 0x20(%rsp), %rdi
callq 0x4558
leaq 0xf0(%rsp), %rdi
callq 0x61d4
leaq 0xd0(%rsp), %rdi
callq 0x4558
leaq 0x90(%rsp), %rdi
callq 0x4558
movq %rsp, %rdi
callq 0x4558
leaq 0x68(%rsp), %rdi
callq 0x4558
xorl %eax, %eax
addq $0xe38, %rsp            # imm = 0xE38
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq 0x16763(%rip), %rdi     # 0x1bff0
leaq 0xe933(%rip), %rsi      # 0x141c7
callq 0x42a0
leaq 0x20(%rsp), %rsi
movq %rax, %rdi
callq 0x4270
leaq 0xe9f8(%rip), %rsi      # 0x142a5
movq %rax, %rdi
callq 0x42a0
movq %rax, %rdi
callq 0x4140
movq %rsp, %rdi
movq (%rdi), %rdx
addq 0x8(%rdi), %rdx
movq %rbx, %rsi
callq 0x4080
jmp 0x56ce
cmpq $0x0, 0x70(%rsp)
jne 0x5918
movq 0x1670d(%rip), %rdi     # 0x1bff0
leaq 0xeb3f(%rip), %rsi      # 0x14429
callq 0x42a0
movq %rsp, %rsi
movq %rax, %rdi
callq 0x4270
leaq 0xeae2(%rip), %rsi      # 0x143e3
movq %rax, %rdi
callq 0x42a0
movq %rax, %rdi
callq 0x4140
pushq $0x3
jmp 0x59e1
movq 0x166d1(%rip), %rdi     # 0x1bff0
leaq 0xeb03(%rip), %rsi      # 0x14429
callq 0x42a0
movq %rsp, %rsi
movq %rax, %rdi
callq 0x4270
leaq 0xeac2(%rip), %rsi      # 0x143ff
movq %rax, %rdi
callq 0x42a0
leaq 0x68(%rsp), %rsi
movq %rax, %rdi
callq 0x4270
leaq 0xeac4(%rip), %rsi      # 0x1441d
movq %rax, %rdi
callq 0x42a0
movq %rax, %rdi
callq 0x4140
pushq $0x4
jmp 0x59e1
movq 0x1667c(%rip), %rdi     # 0x1bff0
leaq 0xe7da(%rip), %rsi      # 0x14155
callq 0x42a0
movq %rax, %rdi
callq 0x4140
movq 0x16661(%rip), %rdi     # 0x1bff0
leaq 0xd0(%rsp), %rsi
callq 0x4270
movq %rax, %rdi
callq 0x4140
pushq $0x1
jmp 0x59e1
movq 0x16641(%rip), %rdi     # 0x1bff0
leaq 0xe7d9(%rip), %rsi      # 0x1418f
callq 0x42a0
movq %rax, %rdi
callq 0x4140
movq 0x16626(%rip), %rdi     # 0x1bff0
leaq 0xd0(%rsp), %rsi
callq 0x4270
movq %rax, %rdi
callq 0x4140
pushq $0x2
popq %rdi
callq 0x4310
cmpq $0x0, 0x70(%rsp)
jne 0x5a45
movq 0x165fa(%rip), %rdi     # 0x1bff0
leaq 0xe9b0(%rip), %rsi      # 0x143ad
callq 0x42a0
leaq 0x20(%rsp), %rsi
movq %rax, %rdi
callq 0x4270
leaq 0xe9b7(%rip), %rsi      # 0x143cd
movq %rax, %rdi
callq 0x42a0
movq %rsp, %rsi
movq %rax, %rdi
callq 0x4270
leaq 0xe9b3(%rip), %rsi      # 0x143e3
movq %rax, %rdi
callq 0x42a0
movq %rax, %rdi
callq 0x4140
jmp 0x5911
movq 0x165a4(%rip), %rdi     # 0x1bff0
leaq 0xe95a(%rip), %rsi      # 0x143ad
callq 0x42a0
leaq 0x20(%rsp), %rsi
movq %rax, %rdi
callq 0x4270
leaq 0xe961(%rip), %rsi      # 0x143cd
movq %rax, %rdi
callq 0x42a0
movq %rsp, %rsi
movq %rax, %rdi
callq 0x4270
leaq 0xe979(%rip), %rsi      # 0x143ff
movq %rax, %rdi
callq 0x42a0
leaq 0x68(%rsp), %rsi
movq %rax, %rdi
callq 0x4270
leaq 0xe97b(%rip), %rsi      # 0x1441d
movq %rax, %rdi
callq 0x42a0
movq %rax, %rdi
callq 0x4140
jmp 0x5969
jmp 0x5abb
jmp 0x5abb
movq %rax, %rbx
leaq 0x7b0(%rsp), %rdi
callq 0x4558
jmp 0x5c9e
jmp 0x5c9b
jmp 0x5ccf
jmp 0x5bc0
jmp 0x5bc0
jmp 0x5bd2
jmp 0x5bd2
jmp 0x5c91
jmp 0x5c91
jmp 0x5bec
jmp 0x5bec
jmp 0x5c91
jmp 0x5c91
jmp 0x5b0e
movq %rax, %rbx
leaq 0x128(%rsp), %rdi
callq 0x4558
jmp 0x5b25
jmp 0x5b22
movq %rax, %rbx
leaq 0x7b0(%rsp), %rdi
jmp 0x5ca6
jmp 0x5ccf
jmp 0x5ccf
jmp 0x5ccf
jmp 0x5ccf
jmp 0x5c9b
jmp 0x5ccf
jmp 0x5c41
jmp 0x5c53
jmp 0x5c91
jmp 0x5c9b
jmp 0x5ccf
jmp 0x5ccf
jmp 0x5ccf
jmp 0x5ccf
jmp 0x5c6d
jmp 0x5c7f
jmp 0x5c91
jmp 0x5c9b
jmp 0x5ccf
jmp 0x5ccf
jmp 0x5ccf
jmp 0x5bc0
jmp 0x5bd2
jmp 0x5c91
jmp 0x5bec
jmp 0x5c91
jmp 0x5c06
jmp 0x5c18
jmp 0x5c2a
jmp 0x5ccf
jmp 0x5c9b
jmp 0x5ccf
movq %rax, %rbx
leaq 0x7b0(%rsp), %rdi
callq 0x5f14
jmp 0x5bd5
movq %rax, %rbx
leaq 0x128(%rsp), %rdi
callq 0x5f14
jmp 0x5c94
jmp 0x5c91
movq %rax, %rbx
leaq 0x7b0(%rsp), %rdi
callq 0x4558
jmp 0x5c94
jmp 0x5c91
movq %rax, %rbx
leaq 0x128(%rsp), %rdi
callq 0x4558
jmp 0x5c1b
movq %rax, %rbx
leaq 0x7b0(%rsp), %rdi
callq 0x4558
jmp 0x5c2d
movq %rax, %rbx
leaq 0xb0(%rsp), %rdi
jmp 0x5ca6
jmp 0x5ccf
jmp 0x5ccf
movq %rax, %rbx
leaq 0x7b0(%rsp), %rdi
callq 0xebfe
jmp 0x5c56
movq %rax, %rbx
leaq 0x128(%rsp), %rdi
callq 0xebfe
jmp 0x5c94
jmp 0x5c91
jmp 0x5c9b
jmp 0x5ccf
jmp 0x5ccf
movq %rax, %rbx
leaq 0x7b0(%rsp), %rdi
callq 0x7520
jmp 0x5c82
movq %rax, %rbx
leaq 0x128(%rsp), %rdi
callq 0x7520
jmp 0x5c94
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
jmp 0x5ca6
movq %rax, %rbx
leaq 0x128(%rsp), %rdi
callq 0x4558
jmp 0x5cd2
jmp 0x5ccf
jmp 0x5ccf
jmp 0x5ccf
jmp 0x5cca
jmp 0x5cca
jmp 0x5cca
jmp 0x5cca
movq %rax, %rbx
jmp 0x5cf6
jmp 0x5ccf
jmp 0x5ccf
jmp 0x5ccf
jmp 0x5ccf
jmp 0x5ccf
movq %rax, %rbx
jmp 0x5cdc
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x4558
leaq 0xf0(%rsp), %rdi
callq 0x61d4
leaq 0xd0(%rsp), %rdi
callq 0x4558
leaq 0x90(%rsp), %rdi
callq 0x4558
movq %rsp, %rdi
callq 0x4558
leaq 0x68(%rsp), %rdi
callq 0x4558
movq %rbx, %rdi
callq 0x44d0
nop