// File: /workspace/github_cpp_makefile_star2_O1/tonymugen[P]sampleSNPs/varfiles.cpp
// Function: sampFiles::BedFileI::sample(sampFiles::BedFileO&, unsigned long const&)
void BedFileI::sample(BedFileO &out, const uint64_t &n){

	if (n == 0) {
		cerr << "WARNING: zero SNPs requested. Nothing to be done." << endl;
		return;
	}
	// start by figuring out the number of SNPs in the .bed file
	if (out._varFile.is_open()) {
		out.close();
	}
	// First have to know the number of lines
	string outFam  = out._fileStub + ".fam";
	string famName = _fileStub + ".fam";

	try {
		_famFile.open(famName.c_str(), ios::in);
		if (!_famFile.is_open()) {
			cerr << "ERROR: failed to open .fam file " << famName << " for input" << endl;
			exit(2);
		}

	} catch (system_error &error) {
		cerr << "ERROR: cannot open .fam file " << _fileName << " for input: " << error.code().message() << flush;
		perror(" ");
		exit(1);
	}

	try {
		out._famFile.open(outFam.c_str(), ios::out | ios::trunc);
		if (!out._famFile.is_open()) {
			cerr << "ERROR: failed to open .fam file " << outFam << " for output" << endl;
			exit(2);
		}

	} catch (system_error &error) {
		cerr << "ERROR: cannot open .fam file " << out._fileName << " for output: " << error.code().message() << flush;
		perror(" ");
		exit(1);
	}

	_nCols        = _famLines(out._famFile); // copying the .fam file
    uint64_t N    = _numLines(); // number of SNPs in the .bed file
    uint64_t Nbed = (_nCols/4UL) + static_cast<uint64_t>( (_nCols%4UL) > 0UL );
	_varFile.close();

	// Test for potential problems
	string inBim  = _fileStub + ".bim";
	string outBim = out._fileStub + ".bim";
	if (N < n) {
		cerr << "ERROR: requested a sample of " << n << " SNPs that is greater than the number of SNPs (" << N << ") in the input file." << endl;
		return;
	} else if (N == n) {
		cerr << "WARNING: sample size (" << n << ") the same as the number of SNPs (" << N << ") in the input file. Simply copying the files." << endl;
		char *buf;
		const size_t bufSize = BUF_SIZE;
		try {
			buf = new char[bufSize];
		} catch (bad_alloc&) {
			cerr << "ERROR: failed to allocate buffer" << endl;
			exit(4);
		}

		// Copy .bed
		try {
			_varFile.open(_fileName.c_str(), ios::in | ios::binary);
			if (!_varFile.is_open()) {
				cerr << "ERROR: failed to open .bed file " << _fileName << " for input" << endl;
				exit(2);
			}

			// check the magic bytes and SNP-major status
			char magic[3];
			_varFile.read(magic, 3);
			if ( (magic[0] != static_cast<char>(0x6C)) || (magic[1] != static_cast<char>(0x1B)) ) {
				cerr << "ERROR: binary file " << _fileName << " not recognized as BED" << endl;
				exit(2);
			} else if (magic[2] != static_cast<char>(0x01)){
				cerr << "ERROR: binary file " << _fileName << " not SNP-major. Run a newer version of plink to fix it." << endl;
				exit(3);
			}

		} catch (system_error &error) {
			cerr << "ERROR: cannot open .bed file " << _fileName << " for input: " << error.code().message() << flush;
			perror(" ");
			exit(1);
		}
		try {
			out._varFile.open(out._fileName.c_str(), ios::out);
			if (!out._varFile.is_open()) {
				cerr << "ERROR: failed to open .bed file " << out._fileName << " for output" << endl;
				exit(2);
			}

		} catch (system_error &error) {
			cerr << "ERROR: cannot open .bed file " << out._fileName << " for output: " << error.code().message() << flush;
			perror(" ");
			exit(1);
		}
		while (_varFile) {
			_varFile.read(buf, bufSize);
			out._varFile.write(buf, _varFile.gcount()); // must be gcount() in case we got to the end of the file
		}
		_varFile.close();
		out._varFile.close();

		// Copy .bim
		try {
			_bimFile.open(inBim.c_str(), ios::in);
			if (!_bimFile.is_open()) {
				cerr << "ERROR: failed to open .bim file " << inBim << " for input" << endl;
				exit(2);
			}

		} catch (system_error &error) {
			cerr << "ERROR: cannot open .bim file " << inBim << " for input: " << error.code().message() << flush;
			perror(" ");
			exit(1);
		}
		try {
			out._bimFile.open(outBim.c_str(), ios::out);
			if (!out._bimFile.is_open()) {
				cerr << "ERROR: failed to open .bim file " << outBim << " for output" << endl;
				exit(2);
			}

		} catch (system_error &error) {
			cerr << "ERROR: cannot open .bim file " << outBim << " for output: " << error.code().message() << flush;
			perror(" ");
			exit(1);
		}
		while (_bimFile) {
			_bimFile.read(buf, bufSize);
			out._bimFile.write(buf, _bimFile.gcount());
		}
		_bimFile.close();
		out._bimFile.close();
		delete [] buf;
		return;
	}

	// Passed all the tests, proceed to sampling
	char *SNPbuf;
	try {
		SNPbuf = new char[Nbed]; // .read() does not append a null-character
	} catch (bad_alloc &) {
		cerr << "ERROR: failed to allocate the SNP buffer" << endl;
		exit(4);

	}
	string bimLine;

	try {
		_bimFile.open(inBim.c_str(), ios::in);
		if (!_bimFile.is_open()) {
			cerr << "ERROR: failed to open .bim file " << inBim << " for input" << endl;
			exit(2);
		}

	} catch (system_error &error) {
		cerr << "ERROR: cannot open .bim file " << inBim << " for input: " << error.code().message() << flush;
		perror(" ");
		exit(1);
	}
	try {
		out._bimFile.open(outBim.c_str(), ios::out);
		if (!out._bimFile.is_open()) {
			cerr << "ERROR: failed to open .bim file " << outBim << " for output" << endl;
			exit(2);
		}


	} catch (system_error &error) {
		cerr << "ERROR: cannot open .bim file " << outBim << " for output: " << error.code().message() << flush;
		perror(" ");
		exit(1);
	}

	try {
		_varFile.open(_fileName.c_str(), ios::in | ios::binary);
		if (!_varFile.is_open()) {
			cerr << "ERROR: failed to open .bed file " << _fileName << " for input" << endl;
			exit(2);
		}
		// check the magic bytes and SNP-major status
		char magic[3];
		_varFile.read(magic, 3);
		if ( (magic[0] != static_cast<char>(0x6C)) || (magic[1] != static_cast<char>(0x1B)) ) {
			cerr << "ERROR: binary file " << _fileName << " not recognized as BED" << endl;
			exit(2);
		} else if (magic[2] != static_cast<char>(0x01)){
			cerr << "ERROR: binary file " << _fileName << " not SNP-major. Run a newer version of plink to fix it." << endl;
			exit(3);
		}
	} catch (system_error &error) {
		cerr << "ERROR: cannot open .bed file " << _fileName << " for input: " << error.code().message() << flush;
		perror(" ");
		exit(1);
	}
	try {
		out._varFile.open(out._fileName.c_str(), ios::out | ios::binary | ios::trunc);
		if (!out._varFile.is_open()) {
			cerr << "ERROR: failed to open .bed file " << out._fileName << " for output" << endl;
			exit(2);
		}

		// write the magic bytes and the SNP-major status byte
		char magic[3] = {static_cast<char>(0x6C), static_cast<char>(0x1B), static_cast<char>(0x01)};
		out._varFile.write(magic, 3);

	} catch (system_error &error) {
		cerr << "ERROR: cannot open .bed file " << out._fileName << " for output: " << error.code().message() << flush;
		perror(" ");
		exit(1);
	}

	uint64_t nloc = n; // local copy of n
	uint64_t S;
	uint64_t cumS = 0; // cumulative position in the file
	RanDraw *snpSamp;  // so that I can catch RanDraw constructor exceptions
	try {
		snpSamp = new RanDraw();
	} catch (string error) {
		cerr << "ERROR: " << error << endl;
		exit(5);
	}
	while (nloc) {
		try {
			S = snpSamp->vitter(nloc, N); // sample the number of SNPs to skip; keep track of the running total
		} catch (string error) {
			cerr << "ERROR: " << error << endl;
			exit(5);
		}
		cumS += S;
		N    -= S + 1;
		_varFile.seekg(cumS*Nbed + 3); // seekg() index is base-0
		_varFile.read(SNPbuf, Nbed);
		cumS++;                        // step up cumS because seekg() will not change it (unlike the getline() that automatially advances)
		out._varFile.write(SNPbuf, Nbed);
		while (S) { // skipping S lines in the bim file
			_bimFile.ignore(numeric_limits<streamsize>::max(), '\n');
			S--;
		}
		getline(_bimFile, bimLine);
		out._bimFile << bimLine << endl;
		nloc--;

	}
	_varFile.close();
	out._varFile.close();
	_bimFile.close();
	out._bimFile.close();
	delete [] SNPbuf;
	delete snpSamp;

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
cmpq $0x0, (%rdx)
je 0xbadc
movq %rdx, %r13
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x88(%rsi), %rbp
movq %rbp, %rdi
callq 0x40a0
testb %al, %al
je 0xb894
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x8(%rax)
leaq 0xe8(%rsp), %rax
movq %rax, -0x10(%rax)
movq 0x668(%rbx), %rsi
movq %rbx, 0x8(%rsp)
movq 0x670(%rbx), %rdx
addq %rsi, %rdx
leaq 0xd8(%rsp), %rbx
movq %rbx, %rdi
callq 0x7720
leaq 0xcec8(%rip), %rsi      # 0x18795
movq %rbx, %rdi
callq 0x4530
leaq 0xc8(%rsp), %rax
movq %rax, -0x10(%rax)
movq 0x668(%r14), %rsi
movq 0x670(%r14), %rdx
addq %rsi, %rdx
leaq 0xb8(%rsp), %rdi
callq 0x7720
leaq 0xce8f(%rip), %rsi      # 0x18795
leaq 0xb8(%rsp), %rdi
callq 0x4530
leaq 0x248(%r14), %rdi
movq 0xb8(%rsp), %rsi
movl $0x8, %edx
callq 0x4270
leaq 0x2c8(%r14), %rdi
callq 0x40a0
testb %al, %al
je 0xc169
movq 0x8(%rsp), %r15
leaq 0x248(%r15), %rbx
movq 0xd8(%rsp), %rsi
movq %rbx, %rdi
movl $0x30, %edx
callq 0x4270
leaq 0x2c8(%r15), %rdi
callq 0x40a0
testb %al, %al
je 0xc1be
movq %r14, %rdi
movq %rbx, %rsi
callq 0x945e
movq %r13, %rbx
movq %rax, 0x238(%r14)
movq %r14, %rdi
callq 0x8f46
movq %rax, %r12
movq 0x238(%r14), %rax
movq %rax, %rcx
shrq $0x2, %rcx
andl $0x3, %eax
cmpq $0x1, %rax
sbbq $-0x1, %rcx
movq %rcx, 0xa0(%rsp)
leaq 0x8(%r14), %rdi
movq %rdi, 0x30(%rsp)
callq 0x4060
leaq 0x68(%rsp), %rax
movq %rax, -0x10(%rax)
movq 0x668(%r14), %rsi
movq 0x670(%r14), %rdx
addq %rsi, %rdx
leaq 0x58(%rsp), %rdi
callq 0x7720
leaq 0xce45(%rip), %rsi      # 0x18834
leaq 0x58(%rsp), %rdi
callq 0x4530
leaq 0x88(%rsp), %rax
movq %rax, -0x10(%rax)
movq 0x8(%rsp), %rax
movq 0x668(%rax), %rsi
movq 0x670(%rax), %rdx
addq %rsi, %rdx
leaq 0x78(%rsp), %rdi
callq 0x7720
movq %rbp, 0x98(%rsp)
leaq 0xce00(%rip), %rsi      # 0x18834
leaq 0x78(%rsp), %rdi
callq 0x4530
movq 0x8(%rsp), %rax
leaq 0x8(%rax), %rbp
cmpq (%rbx), %r12
jae 0xbb2f
movq 0x14599(%rip), %rdi     # 0x1fff0
leaq 0xcb98(%rip), %rsi      # 0x185f6
movl $0x1d, %edx
callq 0x42f0
movq (%rbx), %rsi
movq 0x1457e(%rip), %rdi     # 0x1fff0
callq 0x41a0
movq %rax, %rbx
leaq 0xce77(%rip), %rsi      # 0x188f8
movl $0x2f, %edx
movq %rax, %rdi
callq 0x42f0
movq %rbx, %rdi
movq %r12, %rsi
callq 0x41a0
movq %rax, %rbx
leaq 0xcba1(%rip), %rsi      # 0x18644
movl $0x14, %edx
movq %rax, %rdi
callq 0x42f0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x4290
movsbl %al, %esi
movq %rbx, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x41b0
jmp 0xc0cf
movq 0x1450d(%rip), %rbx     # 0x1fff0
leaq 0xcada(%rip), %rsi      # 0x185c4
movl $0x31, %edx
movq %rbx, %rdi
callq 0x42f0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x4290
movsbl %al, %esi
movq %rbx, %rdi
callq 0x4040
movq %rax, %rdi
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x41b0
jne 0xbc96
movq 0x144b4(%rip), %rdi     # 0x1fff0
leaq 0xcb16(%rip), %rsi      # 0x18659
movl $0x16, %edx
callq 0x42f0
movq (%rbx), %rsi
movq 0x14499(%rip), %rdi     # 0x1fff0
callq 0x41a0
movq %rax, %rbx
leaq 0xcdc2(%rip), %rsi      # 0x18928
movl $0x22, %edx
movq %rax, %rdi
callq 0x42f0
movq %rbx, %rdi
movq %r12, %rsi
callq 0x41a0
movq %rax, %rbx
leaq 0xcdc3(%rip), %rsi      # 0x1894b
movl $0x2e, %edx
movq %rax, %rdi
callq 0x42f0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x4290
movsbl %al, %esi
movq %rbx, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x41b0
movl $0xa00000, %edi         # imm = 0xA00000
callq 0x4030
movq %rax, %rbx
movq 0x218(%r14), %rsi
movq 0x30(%rsp), %rdi
movl $0xc, %edx
callq 0x4270
leaq 0x88(%r14), %rdi
callq 0x40a0
testb %al, %al
je 0xc3c1
leaq 0x38(%rsp), %rsi
movl $0x3, %edx
movq 0x30(%rsp), %rdi
callq 0x4350
cmpb $0x6c, 0x38(%rsp)
jne 0xc46d
cmpb $0x1b, 0x39(%rsp)
jne 0xc46d
cmpb $0x1, 0x3a(%rsp)
jne 0xc4c3
movq 0x8(%rsp), %rax
movq 0x218(%rax), %rsi
movq %rbp, %rdi
movl $0x10, %edx
callq 0x4270
movq 0x98(%rsp), %rdi
callq 0x40a0
testb %al, %al
je 0xc51e
movq 0x8(%rsp), %rax
leaq 0x18(%rax), %r12
movq 0x8(%r14), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x28(%r14,%rax)
jne 0xc005
movl $0xa00000, %edx         # imm = 0xA00000
movq 0x30(%rsp), %rdi
movq %rbx, %rsi
callq 0x4350
movq 0x10(%r14), %rdx
movq %r12, %rdi
movq %rbx, %rsi
callq 0x4390
jmp 0xbc5f
movq 0xa0(%rsp), %rdi
callq 0x4030
movq %rax, 0xb0(%rsp)
leaq 0x48(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x458(%r14), %rbx
movq 0x58(%rsp), %rsi
movq %rbx, %rdi
movl $0x8, %edx
callq 0x4270
leaq 0x4d8(%r14), %rdi
callq 0x40a0
testb %al, %al
je 0xc21b
movq 0x8(%rsp), %r15
leaq 0x458(%r15), %rdi
movq 0x78(%rsp), %rsi
movq %rdi, 0x100(%rsp)
movl $0x10, %edx
callq 0x4270
leaq 0x4d8(%r15), %rdi
callq 0x40a0
testb %al, %al
je 0xc26a
movq 0x218(%r14), %rsi
movq 0x30(%rsp), %rdi
movl $0xc, %edx
callq 0x4270
leaq 0x88(%r14), %rdi
callq 0x40a0
testb %al, %al
je 0xc2bf
leaq 0x10(%rsp), %rsi
movl $0x3, %edx
movq 0x30(%rsp), %rdi
callq 0x4350
cmpb $0x6c, 0x10(%rsp)
jne 0xc315
cmpb $0x1b, 0x11(%rsp)
jne 0xc315
cmpb $0x1, 0x12(%rsp)
jne 0xc36b
movq 0x8(%rsp), %r14
movq 0x218(%r14), %rsi
movq %rbp, %rdi
movl $0x34, %edx
callq 0x4270
movq 0x98(%rsp), %rdi
callq 0x40a0
testb %al, %al
je 0xc417
movq %r12, %r15
leaq 0x10(%rsp), %rsi
movb $0x1, 0x2(%rsi)
movw $0x1b6c, (%rsi)         # imm = 0x1B6C
leaq 0x18(%r14), %rdi
movl $0x3, %edx
movq %rdi, 0x108(%rsp)
callq 0x4390
movq (%r13), %r12
movl $0x8, %edi
callq 0x42c0
movq %rbp, 0xf8(%rsp)
movq %rax, 0xa8(%rsp)
movq %rax, %rdi
callq 0x174a0
testq %r12, %r12
je 0xbf84
movq %r15, %rax
addq $0x468, 0x8(%rsp)       # imm = 0x468
xorl %r13d, %r13d
movabsq $0x7fffffffffffffff, %r14 # imm = 0x7FFFFFFFFFFFFFFF
movq %r12, %xmm0
movq 0xc674(%rip), %xmm2     # 0x184a0
punpckldq %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
movapd 0xc678(%rip), %xmm3     # 0x184b0
subpd %xmm3, %xmm0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
movsd %xmm1, 0x10(%rsp)
movq %rax, 0x98(%rsp)
movq %rax, %xmm0
punpckldq %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
subpd %xmm3, %xmm0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
movsd %xmm1, 0x110(%rsp)
movq 0xa8(%rsp), %rdi
leaq 0x10(%rsp), %rsi
leaq 0x110(%rsp), %rdx
callq 0x177c4
movq %rax, %rbp
addq %rax, %r13
movq %r13, %rsi
imulq 0xa0(%rsp), %rsi
addq $0x3, %rsi
movq 0x30(%rsp), %rdi
xorl %edx, %edx
callq 0x4360
movq 0x30(%rsp), %rdi
movq 0xb0(%rsp), %rsi
movq 0xa0(%rsp), %rdx
callq 0x4350
movq 0x108(%rsp), %rdi
movq 0xb0(%rsp), %rsi
movq 0xa0(%rsp), %rdx
callq 0x4390
testq %rbp, %rbp
je 0xbf08
movq %rbp, %r15
movq %rbx, %rdi
movq %r14, %rsi
movl $0xa, %edx
callq 0x4190
decq %r15
jne 0xbef3
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x4290
movsbl %al, %edx
movq %rbx, %rdi
leaq 0x38(%rsp), %rsi
callq 0x4500
movq 0x38(%rsp), %rsi
movq 0x40(%rsp), %rdx
movq 0x8(%rsp), %rdi
callq 0x42f0
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x4290
movsbl %al, %esi
movq %r15, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x41b0
notq %rbp
movq 0x98(%rsp), %rax
addq %rbp, %rax
incq %r13
decq %r12
jne 0xbe1f
movq 0x30(%rsp), %rdi
callq 0x4060
movq 0xf8(%rsp), %rdi
callq 0x4060
movq %rbx, %rdi
callq 0x4060
movq 0x100(%rsp), %rdi
callq 0x4060
movq 0xb0(%rsp), %rdi
callq 0x4380
movq 0xa8(%rsp), %rbx
movq (%rbx), %rdi
testq %rdi, %rdi
je 0xbfd3
movq (%rdi), %rax
callq *0x8(%rax)
movl $0x8, %esi
movq %rbx, %rdi
callq 0x42d0
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0xc0cf
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x42d0
jmp 0xc0cf
movq 0x30(%rsp), %rdi
callq 0x4060
movq %rbp, %rdi
callq 0x4060
leaq 0x458(%r14), %r15
movq 0x58(%rsp), %rsi
movq %r15, %rdi
movl $0x8, %edx
callq 0x4270
leaq 0x4d8(%r14), %rdi
callq 0x40a0
testb %al, %al
je 0xc579
movq 0x8(%rsp), %r13
leaq 0x458(%r13), %r12
movq 0x78(%rsp), %rsi
movq %r12, %rdi
movl $0x10, %edx
callq 0x4270
leaq 0x4d8(%r13), %rdi
callq 0x40a0
testb %al, %al
je 0xc5cb
addq $0x468, %r13            # imm = 0x468
movq 0x458(%r14), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x478(%r14,%rax)
jne 0xc0b7
movl $0xa00000, %edx         # imm = 0xA00000
movq %r15, %rdi
movq %rbx, %rsi
callq 0x4350
movq 0x460(%r14), %rdx
movq %r13, %rdi
movq %rbx, %rsi
callq 0x4390
jmp 0xc07d
movq %r15, %rdi
callq 0x4060
movq %r12, %rdi
callq 0x4060
movq %rbx, %rdi
callq 0x4380
movq 0x78(%rsp), %rdi
leaq 0x88(%rsp), %rax
cmpq %rax, %rdi
je 0xc0f1
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x42d0
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0xc10d
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x42d0
movq 0xb8(%rsp), %rdi
leaq 0xc8(%rsp), %rax
cmpq %rax, %rdi
je 0xc132
movq 0xc8(%rsp), %rsi
incq %rsi
callq 0x42d0
movq 0xd8(%rsp), %rdi
leaq 0xe8(%rsp), %rax
cmpq %rax, %rdi
je 0xc157
movq 0xe8(%rsp), %rsi
incq %rsi
callq 0x42d0
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x13e80(%rip), %rdi     # 0x1fff0
leaq 0xc623(%rip), %rsi      # 0x1879a
movl $0x20, %edx
callq 0x42f0
movq 0xb8(%rsp), %rsi
movq 0xc0(%rsp), %rdx
movq 0x13e58(%rip), %rdi     # 0x1fff0
callq 0x42f0
movq %rax, %rbx
leaq 0xc3c5(%rip), %rsi      # 0x1856c
movl $0xa, %edx
movq %rax, %rdi
callq 0x42f0
movq %rbx, %rdi
callq 0x4130
jmp 0xc211
movq 0x13e2b(%rip), %rdi     # 0x1fff0
leaq 0xc5ce(%rip), %rsi      # 0x1879a
movl $0x20, %edx
callq 0x42f0
movq 0xd8(%rsp), %rsi
movq 0xe0(%rsp), %rdx
movq 0x13e03(%rip), %rdi     # 0x1fff0
callq 0x42f0
movq %rax, %rbx
leaq 0xc4e6(%rip), %rsi      # 0x186e2
movl $0xb, %edx
movq %rax, %rdi
callq 0x42f0
movq %rbx, %rdi
callq 0x4130
movl $0x2, %edi
callq 0x4320
movq 0x13dce(%rip), %rdi     # 0x1fff0
leaq 0xc690(%rip), %rsi      # 0x188b9
movl $0x20, %edx
callq 0x42f0
movq 0x58(%rsp), %rsi
movq 0x60(%rsp), %rdx
movq 0x13dac(%rip), %rdi     # 0x1fff0
callq 0x42f0
movq %rax, %rbx
leaq 0xc319(%rip), %rsi      # 0x1856c
movl $0xa, %edx
movq %rax, %rdi
callq 0x42f0
movq %rbx, %rdi
callq 0x4130
jmp 0xc211
movq 0x13d7f(%rip), %rdi     # 0x1fff0
leaq 0xc641(%rip), %rsi      # 0x188b9
movl $0x20, %edx
callq 0x42f0
movq 0x78(%rsp), %rsi
movq 0x80(%rsp), %rdx
movq 0x13d5a(%rip), %rdi     # 0x1fff0
callq 0x42f0
movq %rax, %rbx
leaq 0xc43d(%rip), %rsi      # 0x186e2
movl $0xb, %edx
movq %rax, %rdi
callq 0x42f0
movq %rbx, %rdi
callq 0x4130
jmp 0xc211
movq 0x13d2a(%rip), %rdi     # 0x1fff0
leaq 0xc6ad(%rip), %rsi      # 0x1897a
movl $0x20, %edx
callq 0x42f0
movq 0x218(%r14), %rsi
movq 0x220(%r14), %rdx
movq 0x13d04(%rip), %rdi     # 0x1fff0
callq 0x42f0
movq %rax, %rbx
leaq 0xc271(%rip), %rsi      # 0x1856c
movl $0xa, %edx
movq %rax, %rdi
callq 0x42f0
movq %rbx, %rdi
callq 0x4130
jmp 0xc211
movq 0x13cd4(%rip), %rdi     # 0x1fff0
leaq 0xc533(%rip), %rsi      # 0x18856
movl $0x13, %edx
callq 0x42f0
movq 0x218(%r14), %rsi
movq 0x220(%r14), %rdx
movq 0x13cae(%rip), %rdi     # 0x1fff0
callq 0x42f0
movq %rax, %rbx
leaq 0xc519(%rip), %rsi      # 0x1886a
movl $0x16, %edx
movq %rax, %rdi
callq 0x42f0
movq %rbx, %rdi
callq 0x4130
jmp 0xc211
movq 0x13c7e(%rip), %rdi     # 0x1fff0
leaq 0xc4dd(%rip), %rsi      # 0x18856
movl $0x13, %edx
callq 0x42f0
movq 0x218(%r14), %rsi
movq 0x220(%r14), %rdx
movq 0x13c58(%rip), %rdi     # 0x1fff0
callq 0x42f0
movq %rax, %rbx
leaq 0xc4da(%rip), %rsi      # 0x18881
movl $0x37, %edx
movq %rax, %rdi
callq 0x42f0
movq %rbx, %rdi
callq 0x4130
jmp 0xc514
movq 0x13c28(%rip), %rdi     # 0x1fff0
leaq 0xc5ab(%rip), %rsi      # 0x1897a
movl $0x20, %edx
callq 0x42f0
movq 0x218(%r14), %rsi
movq 0x220(%r14), %rdx
movq 0x13c02(%rip), %rdi     # 0x1fff0
callq 0x42f0
movq %rax, %rbx
leaq 0xc16f(%rip), %rsi      # 0x1856c
movl $0xa, %edx
movq %rax, %rdi
callq 0x42f0
movq %rbx, %rdi
callq 0x4130
jmp 0xc211
movq 0x13bd2(%rip), %rdi     # 0x1fff0
leaq 0xc555(%rip), %rsi      # 0x1897a
movl $0x20, %edx
callq 0x42f0
movq 0x218(%r14), %rsi
movq 0x220(%r14), %rdx
movq 0x13bac(%rip), %rdi     # 0x1fff0
callq 0x42f0
movq %rax, %rbx
leaq 0xc28f(%rip), %rsi      # 0x186e2
movl $0xb, %edx
movq %rax, %rdi
callq 0x42f0
movq %rbx, %rdi
callq 0x4130
jmp 0xc211
movq 0x13b7c(%rip), %rdi     # 0x1fff0
leaq 0xc3db(%rip), %rsi      # 0x18856
movl $0x13, %edx
callq 0x42f0
movq 0x218(%r14), %rsi
movq 0x220(%r14), %rdx
movq 0x13b56(%rip), %rdi     # 0x1fff0
callq 0x42f0
movq %rax, %rbx
leaq 0xc3c1(%rip), %rsi      # 0x1886a
movl $0x16, %edx
movq %rax, %rdi
callq 0x42f0
movq %rbx, %rdi
callq 0x4130
jmp 0xc211
movq 0x13b26(%rip), %rdi     # 0x1fff0
leaq 0xc385(%rip), %rsi      # 0x18856
movl $0x13, %edx
callq 0x42f0
movq 0x218(%r14), %rsi
movq 0x220(%r14), %rdx
movq 0x13b00(%rip), %rdi     # 0x1fff0
callq 0x42f0
movq %rax, %rbx
leaq 0xc382(%rip), %rsi      # 0x18881
movl $0x37, %edx
movq %rax, %rdi
callq 0x42f0
movq %rbx, %rdi
callq 0x4130
movl $0x3, %edi
callq 0x4320
movq 0x13acb(%rip), %rdi     # 0x1fff0
leaq 0xc44e(%rip), %rsi      # 0x1897a
movl $0x20, %edx
callq 0x42f0
movq 0x8(%rsp), %rax
movq 0x218(%rax), %rsi
movq 0x220(%rax), %rdx
movq 0x13aa0(%rip), %rdi     # 0x1fff0
callq 0x42f0
movq %rax, %rbx
leaq 0xc183(%rip), %rsi      # 0x186e2
movl $0xb, %edx
movq %rax, %rdi
callq 0x42f0
movq %rbx, %rdi
callq 0x4130
jmp 0xc211
movq 0x13a70(%rip), %rdi     # 0x1fff0
leaq 0xc332(%rip), %rsi      # 0x188b9
movl $0x20, %edx
callq 0x42f0
movq 0x58(%rsp), %rsi
movq 0x60(%rsp), %rdx
movq 0x13a4e(%rip), %rdi     # 0x1fff0
callq 0x42f0
movq %rax, %rbx
leaq 0xbfbb(%rip), %rsi      # 0x1856c
movl $0xa, %edx
movq %rax, %rdi
callq 0x42f0
movq %rbx, %rdi
callq 0x4130
jmp 0xc211
movq 0x13a1e(%rip), %rdi     # 0x1fff0
leaq 0xc2e0(%rip), %rsi      # 0x188b9
movl $0x20, %edx
callq 0x42f0
movq 0x78(%rsp), %rsi
movq 0x80(%rsp), %rdx
movq 0x139f9(%rip), %rdi     # 0x1fff0
callq 0x42f0
movq %rax, %rbx
leaq 0xc0dc(%rip), %rsi      # 0x186e2
movl $0xb, %edx
movq %rax, %rdi
callq 0x42f0
movq %rbx, %rdi
callq 0x4130
jmp 0xc211
movq %rdx, %rbx
movq %rax, %r15
movl $0x8, %esi
movq 0xa8(%rsp), %rdi
callq 0x42d0
jmp 0xc640
movq %rdx, %rbx
movq %rax, %r15
cmpl $0x3, %ebx
jne 0xd014
movq %r15, %rdi
callq 0x4340
leaq 0x20(%rsp), %rbx
movq %rbx, -0x10(%rbx)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq 0x10(%rsp), %rdi
callq 0x7720
movq %r15, %rdi
callq 0x4110
movq 0x13973(%rip), %rdi     # 0x1fff0
leaq 0xc0a1(%rip), %rsi      # 0x18725
movl $0x7, %edx
callq 0x42f0
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq 0x13951(%rip), %rdi     # 0x1fff0
callq 0x42f0
movq %rax, %rdi
callq 0x4130
jmp 0xcfd3
movq %rax, %r15
movq 0x10(%rsp), %rdi
cmpq %rbx, %rdi
je 0xc6cb
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x42d0
callq 0x4480
jmp 0xd014
jmp 0xc9bf
movq %rax, %r15
cmpl $0x2, %edx
jne 0xd030
movq %r15, %rdi
callq 0x4110
movq 0x138fb(%rip), %rdi     # 0x1fff0
leaq 0xbfc5(%rip), %rsi      # 0x186c1
movl $0x20, %edx
callq 0x42f0
movq 0x138e3(%rip), %rdi     # 0x1fff0
callq 0x4130
jmp 0xc759
movq %rax, %r15
callq 0x4480
jmp 0xd030
movq %rax, %r15
cmpl $0x2, %edx
jne 0xd030
movq %r15, %rdi
callq 0x4110
movq 0x138b4(%rip), %rdi     # 0x1fff0
leaq 0xc276(%rip), %rsi      # 0x189b9
movl $0x28, %edx
callq 0x42f0
movq 0x1389c(%rip), %rdi     # 0x1fff0
callq 0x4130
movl $0x4, %edi
callq 0x4320
movq %rax, %r15
callq 0x4480
jmp 0xd030
movq %rax, %r15
cmpl $0x1, %edx
jne 0xd030
movq %r15, %rdi
callq 0x4110
movq %rax, %rbx
movq 0x13862(%rip), %rdi     # 0x1fff0
leaq 0xc145(%rip), %rsi      # 0x188da
movl $0x1d, %edx
callq 0x42f0
movq 0x78(%rsp), %rsi
movq 0x80(%rsp), %rdx
movq 0x1383d(%rip), %rdi     # 0x1fff0
callq 0x42f0
movq %rax, %r14
leaq 0xbf2c(%rip), %rsi      # 0x186ee
movl $0xd, %edx
movq %rax, %rdi
callq 0x42f0
movq 0x18(%rbx), %rsi
movl 0x10(%rbx), %edx
movq (%rsi), %rax
leaq 0x38(%rsp), %rdi
callq *0x20(%rax)
movq 0x38(%rsp), %rsi
movq 0x40(%rsp), %rdx
movq %r14, %rdi
callq 0x42f0
movq %rax, %rdi
callq 0x41b0
leaq 0x38(%rsp), %rdi
callq 0x4793
movq %rax, %r15
leaq 0x48(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xc82a
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x42d0
jmp 0xc82a
jmp 0xc827
movq %rax, %r15
callq 0x4480
jmp 0xd030
movq %rax, %r15
cmpl $0x1, %edx
jne 0xd030
movq %r15, %rdi
callq 0x4110
movq %rax, %rbx
movq 0x1379e(%rip), %rdi     # 0x1fff0
leaq 0xc081(%rip), %rsi      # 0x188da
movl $0x1d, %edx
callq 0x42f0
movq 0x58(%rsp), %rsi
movq 0x60(%rsp), %rdx
movq 0x1377c(%rip), %rdi     # 0x1fff0
callq 0x42f0
movq %rax, %r14
leaq 0xc17a(%rip), %rsi      # 0x189fd
movl $0xc, %edx
movq %rax, %rdi
callq 0x42f0
movq 0x18(%rbx), %rsi
movl 0x10(%rbx), %edx
movq (%rsi), %rax
leaq 0x38(%rsp), %rdi
callq *0x20(%rax)
movq 0x38(%rsp), %rsi
movq 0x40(%rsp), %rdx
movq %r14, %rdi
callq 0x42f0
movq %rax, %rdi
callq 0x41b0
leaq 0x38(%rsp), %rdi
callq 0x4779
movq %rax, %r15
leaq 0x48(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xc8eb
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x42d0
jmp 0xc8eb
jmp 0xc8e8
movq %rax, %r15
callq 0x4480
jmp 0xd030
movq %rax, %r15
cmpl $0x1, %edx
jne 0xd030
movq %r15, %rdi
callq 0x4110
movq %rax, %rbx
movq 0x136dd(%rip), %rdi     # 0x1fff0
leaq 0xc081(%rip), %rsi      # 0x1899b
movl $0x1d, %edx
callq 0x42f0
movq 0x8(%rsp), %rax
movq 0x218(%rax), %rsi
movq 0x220(%rax), %rdx
movq 0x136b2(%rip), %rdi     # 0x1fff0
callq 0x42f0
movq %rax, %r14
leaq 0xbda1(%rip), %rsi      # 0x186ee
movl $0xd, %edx
movq %rax, %rdi
callq 0x42f0
movq 0x18(%rbx), %rsi
movl 0x10(%rbx), %edx
movq (%rsi), %rax
leaq 0x38(%rsp), %rdi
callq *0x20(%rax)
movq 0x38(%rsp), %rsi
movq 0x40(%rsp), %rdx
movq %r14, %rdi
callq 0x42f0
movq %rax, %rdi
callq 0x41b0
leaq 0x38(%rsp), %rdi
callq 0x475f
movq %rax, %r15
leaq 0x48(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xc9b5
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x42d0
jmp 0xc9b5
jmp 0xc9b2
movq %rax, %r15
callq 0x4480
jmp 0xd030
movq %rax, %r15
cmpl $0x1, %edx
jne 0xd014
movq %r15, %rdi
callq 0x4110
movq %rax, %rbx
movq 0x13613(%rip), %rdi     # 0x1fff0
leaq 0xbfb7(%rip), %rsi      # 0x1899b
movl $0x1d, %edx
callq 0x42f0
movq 0x8(%rsp), %rax
movq 0x218(%rax), %rsi
movq 0x220(%rax), %rdx
movq 0x135e8(%rip), %rdi     # 0x1fff0
callq 0x42f0
movq %rax, %r14
leaq 0xbcd7(%rip), %rsi      # 0x186ee
movl $0xd, %edx
movq %rax, %rdi
callq 0x42f0
movq 0x18(%rbx), %rsi
movl 0x10(%rbx), %edx
movq (%rsi), %rax
leaq 0x10(%rsp), %rdi
callq *0x20(%rax)
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq %r14, %rdi
callq 0x42f0
movq %rax, %rdi
callq 0x41b0
leaq 0x10(%rsp), %rdi
callq 0x472b
movq %rax, %r15
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xca7f
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x42d0
jmp 0xca7f
jmp 0xca7c
movq %rax, %r15
callq 0x4480
jmp 0xd014
jmp 0xcc18
jmp 0xccdd
movq %rax, %r15
cmpl $0x1, %edx
jne 0xd014
movq %r15, %rdi
callq 0x4110
movq %rax, %rbx
movq 0x1353f(%rip), %rdi     # 0x1fff0
leaq 0xbe22(%rip), %rsi      # 0x188da
movl $0x1d, %edx
callq 0x42f0
movq 0x78(%rsp), %rsi
movq 0x80(%rsp), %rdx
movq 0x1351a(%rip), %rdi     # 0x1fff0
callq 0x42f0
movq %rax, %r14
leaq 0xbc09(%rip), %rsi      # 0x186ee
movl $0xd, %edx
movq %rax, %rdi
callq 0x42f0
movq 0x18(%rbx), %rsi
movl 0x10(%rbx), %edx
movq (%rsi), %rax
leaq 0x10(%rsp), %rdi
callq *0x20(%rax)
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq %r14, %rdi
callq 0x42f0
movq %rax, %rdi
callq 0x41b0
leaq 0x10(%rsp), %rdi
callq 0x4711
movq %rax, %r15
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xcb4d
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x42d0
jmp 0xcb4d
jmp 0xcb4a
movq %rax, %r15
callq 0x4480
jmp 0xd014
movq %rax, %r15
cmpl $0x1, %edx
jne 0xd014
movq %r15, %rdi
callq 0x4110
movq %rax, %rbx
movq 0x1347b(%rip), %rdi     # 0x1fff0
leaq 0xbd5e(%rip), %rsi      # 0x188da
movl $0x1d, %edx
callq 0x42f0
movq 0x58(%rsp), %rsi
movq 0x60(%rsp), %rdx
movq 0x13459(%rip), %rdi     # 0x1fff0
callq 0x42f0
movq %rax, %r14
leaq 0xbe57(%rip), %rsi      # 0x189fd
movl $0xc, %edx
movq %rax, %rdi
callq 0x42f0
movq 0x18(%rbx), %rsi
movl 0x10(%rbx), %edx
movq (%rsi), %rax
leaq 0x10(%rsp), %rdi
callq *0x20(%rax)
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq %r14, %rdi
callq 0x42f0
movq %rax, %rdi
callq 0x41b0
leaq 0x10(%rsp), %rdi
callq 0x46f7
movq %rax, %r15
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xcc0e
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x42d0
jmp 0xcc0e
jmp 0xcc0b
movq %rax, %r15
callq 0x4480
jmp 0xd014
movq %rax, %r15
cmpl $0x1, %edx
jne 0xd030
movq %r15, %rdi
callq 0x4110
movq %rax, %rbx
movq 0x133ba(%rip), %rdi     # 0x1fff0
leaq 0xbd5e(%rip), %rsi      # 0x1899b
movl $0x1d, %edx
callq 0x42f0
movq 0x218(%r14), %rsi
movq 0x220(%r14), %rdx
movq 0x13394(%rip), %rdi     # 0x1fff0
callq 0x42f0
movq %rax, %r14
leaq 0xbd92(%rip), %rsi      # 0x189fd
movl $0xc, %edx
movq %rax, %rdi
callq 0x42f0
movq 0x18(%rbx), %rsi
movl 0x10(%rbx), %edx
movq (%rsi), %rax
leaq 0x38(%rsp), %rdi
callq *0x20(%rax)
movq 0x38(%rsp), %rsi
movq 0x40(%rsp), %rdx
movq %r14, %rdi
callq 0x42f0
movq %rax, %rdi
callq 0x41b0
leaq 0x38(%rsp), %rdi
callq 0x47ad
movq %rax, %r15
leaq 0x48(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xccd3
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x42d0
jmp 0xccd3
jmp 0xccd0
movq %rax, %r15
callq 0x4480
jmp 0xd030
movq %rax, %r15
cmpl $0x1, %edx
jne 0xd014
movq %r15, %rdi
callq 0x4110
movq %rax, %rbx
movq 0x132f5(%rip), %rdi     # 0x1fff0
leaq 0xbc99(%rip), %rsi      # 0x1899b
movl $0x1d, %edx
callq 0x42f0
movq 0x218(%r14), %rsi
movq 0x220(%r14), %rdx
movq 0x132cf(%rip), %rdi     # 0x1fff0
callq 0x42f0
movq %rax, %r14
leaq 0xbccd(%rip), %rsi      # 0x189fd
movl $0xc, %edx
movq %rax, %rdi
callq 0x42f0
movq 0x18(%rbx), %rsi
movl 0x10(%rbx), %edx
movq (%rsi), %rax
leaq 0x10(%rsp), %rdi
callq *0x20(%rax)
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq %r14, %rdi
callq 0x42f0
movq %rax, %rdi
callq 0x41b0
leaq 0x10(%rsp), %rdi
callq 0x4745
movq %rax, %r15
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xcd98
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x42d0
jmp 0xcd98
jmp 0xcd95
movq %rax, %r15
callq 0x4480
jmp 0xd014
jmp 0xd011
jmp 0xd00a
jmp 0xd00a
jmp 0xcdb3
movq %rax, %r15
jmp 0xd052
jmp 0xcdc3
jmp 0xcdc3
jmp 0xcdc3
jmp 0xcdc3
movq %rax, %r15
jmp 0xd06e
jmp 0xcdcd
movq %rax, %r15
jmp 0xd093
movq %rax, %r15
cmpl $0x1, %edx
jne 0xd06e
movq %r15, %rdi
callq 0x4110
movq %rax, %rbx
movq 0x131fd(%rip), %rdi     # 0x1fff0
leaq 0xb9c1(%rip), %rsi      # 0x187bb
movl $0x1d, %edx
callq 0x42f0
movq 0x8(%rsp), %rax
movq 0x218(%rax), %rsi
movq 0x220(%rax), %rdx
movq 0x131d2(%rip), %rdi     # 0x1fff0
callq 0x42f0
movq %rax, %r14
leaq 0xb8c1(%rip), %rsi      # 0x186ee
movl $0xd, %edx
movq %rax, %rdi
callq 0x42f0
movq 0x18(%rbx), %rsi
movl 0x10(%rbx), %edx
movq (%rsi), %rax
leaq 0x58(%rsp), %rdi
callq *0x20(%rax)
movq 0x58(%rsp), %rsi
movq 0x60(%rsp), %rdx
movq %r14, %rdi
callq 0x42f0
movq %rax, %rdi
callq 0x41b0
leaq 0x58(%rsp), %rdi
callq 0x46dd
movq %rax, %r15
leaq 0x68(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xce95
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x42d0
jmp 0xce95
jmp 0xce92
movq %rax, %r15
callq 0x4480
jmp 0xd06e
movq %rax, %r15
cmpl $0x1, %edx
jne 0xd06e
movq %r15, %rdi
callq 0x4110
movq %rax, %rbx
movq 0x13133(%rip), %rdi     # 0x1fff0
leaq 0xb8f7(%rip), %rsi      # 0x187bb
movl $0x1d, %edx
callq 0x42f0
movq 0x218(%r14), %rsi
movq 0x220(%r14), %rdx
movq 0x1310d(%rip), %rdi     # 0x1fff0
callq 0x42f0
movq %rax, %r14
leaq 0xbb0b(%rip), %rsi      # 0x189fd
movl $0xc, %edx
movq %rax, %rdi
callq 0x42f0
movq 0x18(%rbx), %rsi
movl 0x10(%rbx), %edx
movq (%rsi), %rax
leaq 0x58(%rsp), %rdi
callq *0x20(%rax)
movq 0x58(%rsp), %rsi
movq 0x60(%rsp), %rdx
movq %r14, %rdi
callq 0x42f0
movq %rax, %rdi
callq 0x41b0
leaq 0x58(%rsp), %rdi
callq 0x46c3
movq %rax, %r15
leaq 0x68(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xcf5a
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x42d0
jmp 0xcf5a
jmp 0xcf57
movq %rax, %r15
callq 0x4480
jmp 0xd06e
movq %rax, %r15
cmpl $0x3, %edx
jne 0xd014
movq %r15, %rdi
callq 0x4340
leaq 0x20(%rsp), %rbx
movq %rbx, -0x10(%rbx)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq 0x10(%rsp), %rdi
callq 0x7720
movq %r15, %rdi
callq 0x4110
movq 0x1304c(%rip), %rdi     # 0x1fff0
leaq 0xb77a(%rip), %rsi      # 0x18725
movl $0x7, %edx
callq 0x42f0
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq 0x1302a(%rip), %rdi     # 0x1fff0
callq 0x42f0
movq %rax, %rdi
callq 0x4130
movl $0x5, %edi
callq 0x4320
movq %rax, %r15
movq 0x10(%rsp), %rdi
cmpq %rbx, %rdi
je 0xcff7
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x42d0
callq 0x4480
jmp 0xd014
movq %rax, %rdi
callq 0x7714
jmp 0xd00a
jmp 0xd00a
movq %rax, %r15
jmp 0xd030
jmp 0xd011
movq %rax, %r15
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0xd030
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x42d0
movq 0x78(%rsp), %rdi
leaq 0x88(%rsp), %rax
cmpq %rax, %rdi
je 0xd052
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x42d0
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0xd06e
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x42d0
movq 0xb8(%rsp), %rdi
leaq 0xc8(%rsp), %rax
cmpq %rax, %rdi
je 0xd093
movq 0xc8(%rsp), %rsi
incq %rsi
callq 0x42d0
movq 0xd8(%rsp), %rdi
leaq 0xe8(%rsp), %rax
cmpq %rax, %rdi
je 0xd0b8
movq 0xe8(%rsp), %rsi
incq %rsi
callq 0x42d0
movq %r15, %rdi
callq 0x44e0