// File: /workspace/github_cpp_makefile_star2_O3/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 0xba8e
movq %rdx, %r13
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x88(%rsi), %rbp
movq %rbp, %rdi
callq 0x40a0
testb %al, %al
je 0xb846
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 0x76e4
leaq 0xcf16(%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 0x76e4
leaq 0xcedd(%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 0xc11b
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 0xc170
movq %r14, %rdi
movq %rbx, %rsi
callq 0x93e6
movq %r13, %rbx
movq %rax, 0x238(%r14)
movq %r14, %rdi
callq 0x8ece
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 0x76e4
leaq 0xce93(%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 0x76e4
movq %rbp, 0x98(%rsp)
leaq 0xce4e(%rip), %rsi      # 0x18834
leaq 0x78(%rsp), %rdi
callq 0x4530
movq 0x8(%rsp), %rax
leaq 0x8(%rax), %rbp
cmpq (%rbx), %r12
jae 0xbae1
movq 0x145e7(%rip), %rdi     # 0x1fff0
leaq 0xcbe6(%rip), %rsi      # 0x185f6
movl $0x1d, %edx
callq 0x42f0
movq (%rbx), %rsi
movq 0x145cc(%rip), %rdi     # 0x1fff0
callq 0x41a0
movq %rax, %rbx
leaq 0xcec5(%rip), %rsi      # 0x188f8
movl $0x2f, %edx
movq %rax, %rdi
callq 0x42f0
movq %rbx, %rdi
movq %r12, %rsi
callq 0x41a0
movq %rax, %rbx
leaq 0xcbef(%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 0xc081
movq 0x1455b(%rip), %rbx     # 0x1fff0
leaq 0xcb28(%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 0xbc48
movq 0x14502(%rip), %rdi     # 0x1fff0
leaq 0xcb64(%rip), %rsi      # 0x18659
movl $0x16, %edx
callq 0x42f0
movq (%rbx), %rsi
movq 0x144e7(%rip), %rdi     # 0x1fff0
callq 0x41a0
movq %rax, %rbx
leaq 0xce10(%rip), %rsi      # 0x18928
movl $0x22, %edx
movq %rax, %rdi
callq 0x42f0
movq %rbx, %rdi
movq %r12, %rsi
callq 0x41a0
movq %rax, %rbx
leaq 0xce11(%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 0xc373
leaq 0x38(%rsp), %rsi
movl $0x3, %edx
movq 0x30(%rsp), %rdi
callq 0x4350
cmpb $0x6c, 0x38(%rsp)
jne 0xc41f
cmpb $0x1b, 0x39(%rsp)
jne 0xc41f
cmpb $0x1, 0x3a(%rsp)
jne 0xc475
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 0xc4d0
movq 0x8(%rsp), %rax
leaq 0x18(%rax), %r12
movq 0x8(%r14), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x28(%r14,%rax)
jne 0xbfb7
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 0xbc11
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 0xc1cd
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 0xc21c
movq 0x218(%r14), %rsi
movq 0x30(%rsp), %rdi
movl $0xc, %edx
callq 0x4270
leaq 0x88(%r14), %rdi
callq 0x40a0
testb %al, %al
je 0xc271
leaq 0x10(%rsp), %rsi
movl $0x3, %edx
movq 0x30(%rsp), %rdi
callq 0x4350
cmpb $0x6c, 0x10(%rsp)
jne 0xc2c7
cmpb $0x1b, 0x11(%rsp)
jne 0xc2c7
cmpb $0x1, 0x12(%rsp)
jne 0xc31d
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 0xc3c9
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 0x172de
testq %r12, %r12
je 0xbf36
movq %r15, %rax
addq $0x468, 0x8(%rsp)       # imm = 0x468
xorl %r13d, %r13d
movabsq $0x7fffffffffffffff, %r14 # imm = 0x7FFFFFFFFFFFFFFF
movq %r12, %xmm0
movq 0xc6c2(%rip), %xmm2     # 0x184a0
punpckldq %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
movapd 0xc6c6(%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 0x175fe
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 0xbeba
movq %rbp, %r15
movq %rbx, %rdi
movq %r14, %rsi
movl $0xa, %edx
callq 0x4190
decq %r15
jne 0xbea5
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 0xbdd1
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 0xbf85
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 0xc081
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x42d0
jmp 0xc081
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 0xc52b
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 0xc57d
addq $0x468, %r13            # imm = 0x468
movq 0x458(%r14), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x478(%r14,%rax)
jne 0xc069
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 0xc02f
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 0xc0a3
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x42d0
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0xc0bf
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x42d0
movq 0xb8(%rsp), %rdi
leaq 0xc8(%rsp), %rax
cmpq %rax, %rdi
je 0xc0e4
movq 0xc8(%rsp), %rsi
incq %rsi
callq 0x42d0
movq 0xd8(%rsp), %rdi
leaq 0xe8(%rsp), %rax
cmpq %rax, %rdi
je 0xc109
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 0x13ece(%rip), %rdi     # 0x1fff0
leaq 0xc671(%rip), %rsi      # 0x1879a
movl $0x20, %edx
callq 0x42f0
movq 0xb8(%rsp), %rsi
movq 0xc0(%rsp), %rdx
movq 0x13ea6(%rip), %rdi     # 0x1fff0
callq 0x42f0
movq %rax, %rbx
leaq 0xc413(%rip), %rsi      # 0x1856c
movl $0xa, %edx
movq %rax, %rdi
callq 0x42f0
movq %rbx, %rdi
callq 0x4130
jmp 0xc1c3
movq 0x13e79(%rip), %rdi     # 0x1fff0
leaq 0xc61c(%rip), %rsi      # 0x1879a
movl $0x20, %edx
callq 0x42f0
movq 0xd8(%rsp), %rsi
movq 0xe0(%rsp), %rdx
movq 0x13e51(%rip), %rdi     # 0x1fff0
callq 0x42f0
movq %rax, %rbx
leaq 0xc534(%rip), %rsi      # 0x186e2
movl $0xb, %edx
movq %rax, %rdi
callq 0x42f0
movq %rbx, %rdi
callq 0x4130
movl $0x2, %edi
callq 0x4320
movq 0x13e1c(%rip), %rdi     # 0x1fff0
leaq 0xc6de(%rip), %rsi      # 0x188b9
movl $0x20, %edx
callq 0x42f0
movq 0x58(%rsp), %rsi
movq 0x60(%rsp), %rdx
movq 0x13dfa(%rip), %rdi     # 0x1fff0
callq 0x42f0
movq %rax, %rbx
leaq 0xc367(%rip), %rsi      # 0x1856c
movl $0xa, %edx
movq %rax, %rdi
callq 0x42f0
movq %rbx, %rdi
callq 0x4130
jmp 0xc1c3
movq 0x13dcd(%rip), %rdi     # 0x1fff0
leaq 0xc68f(%rip), %rsi      # 0x188b9
movl $0x20, %edx
callq 0x42f0
movq 0x78(%rsp), %rsi
movq 0x80(%rsp), %rdx
movq 0x13da8(%rip), %rdi     # 0x1fff0
callq 0x42f0
movq %rax, %rbx
leaq 0xc48b(%rip), %rsi      # 0x186e2
movl $0xb, %edx
movq %rax, %rdi
callq 0x42f0
movq %rbx, %rdi
callq 0x4130
jmp 0xc1c3
movq 0x13d78(%rip), %rdi     # 0x1fff0
leaq 0xc6fb(%rip), %rsi      # 0x1897a
movl $0x20, %edx
callq 0x42f0
movq 0x218(%r14), %rsi
movq 0x220(%r14), %rdx
movq 0x13d52(%rip), %rdi     # 0x1fff0
callq 0x42f0
movq %rax, %rbx
leaq 0xc2bf(%rip), %rsi      # 0x1856c
movl $0xa, %edx
movq %rax, %rdi
callq 0x42f0
movq %rbx, %rdi
callq 0x4130
jmp 0xc1c3
movq 0x13d22(%rip), %rdi     # 0x1fff0
leaq 0xc581(%rip), %rsi      # 0x18856
movl $0x13, %edx
callq 0x42f0
movq 0x218(%r14), %rsi
movq 0x220(%r14), %rdx
movq 0x13cfc(%rip), %rdi     # 0x1fff0
callq 0x42f0
movq %rax, %rbx
leaq 0xc567(%rip), %rsi      # 0x1886a
movl $0x16, %edx
movq %rax, %rdi
callq 0x42f0
movq %rbx, %rdi
callq 0x4130
jmp 0xc1c3
movq 0x13ccc(%rip), %rdi     # 0x1fff0
leaq 0xc52b(%rip), %rsi      # 0x18856
movl $0x13, %edx
callq 0x42f0
movq 0x218(%r14), %rsi
movq 0x220(%r14), %rdx
movq 0x13ca6(%rip), %rdi     # 0x1fff0
callq 0x42f0
movq %rax, %rbx
leaq 0xc528(%rip), %rsi      # 0x18881
movl $0x37, %edx
movq %rax, %rdi
callq 0x42f0
movq %rbx, %rdi
callq 0x4130
jmp 0xc4c6
movq 0x13c76(%rip), %rdi     # 0x1fff0
leaq 0xc5f9(%rip), %rsi      # 0x1897a
movl $0x20, %edx
callq 0x42f0
movq 0x218(%r14), %rsi
movq 0x220(%r14), %rdx
movq 0x13c50(%rip), %rdi     # 0x1fff0
callq 0x42f0
movq %rax, %rbx
leaq 0xc1bd(%rip), %rsi      # 0x1856c
movl $0xa, %edx
movq %rax, %rdi
callq 0x42f0
movq %rbx, %rdi
callq 0x4130
jmp 0xc1c3
movq 0x13c20(%rip), %rdi     # 0x1fff0
leaq 0xc5a3(%rip), %rsi      # 0x1897a
movl $0x20, %edx
callq 0x42f0
movq 0x218(%r14), %rsi
movq 0x220(%r14), %rdx
movq 0x13bfa(%rip), %rdi     # 0x1fff0
callq 0x42f0
movq %rax, %rbx
leaq 0xc2dd(%rip), %rsi      # 0x186e2
movl $0xb, %edx
movq %rax, %rdi
callq 0x42f0
movq %rbx, %rdi
callq 0x4130
jmp 0xc1c3
movq 0x13bca(%rip), %rdi     # 0x1fff0
leaq 0xc429(%rip), %rsi      # 0x18856
movl $0x13, %edx
callq 0x42f0
movq 0x218(%r14), %rsi
movq 0x220(%r14), %rdx
movq 0x13ba4(%rip), %rdi     # 0x1fff0
callq 0x42f0
movq %rax, %rbx
leaq 0xc40f(%rip), %rsi      # 0x1886a
movl $0x16, %edx
movq %rax, %rdi
callq 0x42f0
movq %rbx, %rdi
callq 0x4130
jmp 0xc1c3
movq 0x13b74(%rip), %rdi     # 0x1fff0
leaq 0xc3d3(%rip), %rsi      # 0x18856
movl $0x13, %edx
callq 0x42f0
movq 0x218(%r14), %rsi
movq 0x220(%r14), %rdx
movq 0x13b4e(%rip), %rdi     # 0x1fff0
callq 0x42f0
movq %rax, %rbx
leaq 0xc3d0(%rip), %rsi      # 0x18881
movl $0x37, %edx
movq %rax, %rdi
callq 0x42f0
movq %rbx, %rdi
callq 0x4130
movl $0x3, %edi
callq 0x4320
movq 0x13b19(%rip), %rdi     # 0x1fff0
leaq 0xc49c(%rip), %rsi      # 0x1897a
movl $0x20, %edx
callq 0x42f0
movq 0x8(%rsp), %rax
movq 0x218(%rax), %rsi
movq 0x220(%rax), %rdx
movq 0x13aee(%rip), %rdi     # 0x1fff0
callq 0x42f0
movq %rax, %rbx
leaq 0xc1d1(%rip), %rsi      # 0x186e2
movl $0xb, %edx
movq %rax, %rdi
callq 0x42f0
movq %rbx, %rdi
callq 0x4130
jmp 0xc1c3
movq 0x13abe(%rip), %rdi     # 0x1fff0
leaq 0xc380(%rip), %rsi      # 0x188b9
movl $0x20, %edx
callq 0x42f0
movq 0x58(%rsp), %rsi
movq 0x60(%rsp), %rdx
movq 0x13a9c(%rip), %rdi     # 0x1fff0
callq 0x42f0
movq %rax, %rbx
leaq 0xc009(%rip), %rsi      # 0x1856c
movl $0xa, %edx
movq %rax, %rdi
callq 0x42f0
movq %rbx, %rdi
callq 0x4130
jmp 0xc1c3
movq 0x13a6c(%rip), %rdi     # 0x1fff0
leaq 0xc32e(%rip), %rsi      # 0x188b9
movl $0x20, %edx
callq 0x42f0
movq 0x78(%rsp), %rsi
movq 0x80(%rsp), %rdx
movq 0x13a47(%rip), %rdi     # 0x1fff0
callq 0x42f0
movq %rax, %rbx
leaq 0xc12a(%rip), %rsi      # 0x186e2
movl $0xb, %edx
movq %rax, %rdi
callq 0x42f0
movq %rbx, %rdi
callq 0x4130
jmp 0xc1c3
movq %rdx, %rbx
movq %rax, %r15
movl $0x8, %esi
movq 0xa8(%rsp), %rdi
callq 0x42d0
jmp 0xc5f2
movq %rdx, %rbx
movq %rax, %r15
cmpl $0x3, %ebx
jne 0xcfc6
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 0x76e4
movq %r15, %rdi
callq 0x4110
movq 0x139c1(%rip), %rdi     # 0x1fff0
leaq 0xc0ef(%rip), %rsi      # 0x18725
movl $0x7, %edx
callq 0x42f0
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq 0x1399f(%rip), %rdi     # 0x1fff0
callq 0x42f0
movq %rax, %rdi
callq 0x4130
jmp 0xcf85
movq %rax, %r15
movq 0x10(%rsp), %rdi
cmpq %rbx, %rdi
je 0xc67d
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x42d0
callq 0x4480
jmp 0xcfc6
jmp 0xc971
movq %rax, %r15
cmpl $0x2, %edx
jne 0xcfe2
movq %r15, %rdi
callq 0x4110
movq 0x13949(%rip), %rdi     # 0x1fff0
leaq 0xc013(%rip), %rsi      # 0x186c1
movl $0x20, %edx
callq 0x42f0
movq 0x13931(%rip), %rdi     # 0x1fff0
callq 0x4130
jmp 0xc70b
movq %rax, %r15
callq 0x4480
jmp 0xcfe2
movq %rax, %r15
cmpl $0x2, %edx
jne 0xcfe2
movq %r15, %rdi
callq 0x4110
movq 0x13902(%rip), %rdi     # 0x1fff0
leaq 0xc2c4(%rip), %rsi      # 0x189b9
movl $0x28, %edx
callq 0x42f0
movq 0x138ea(%rip), %rdi     # 0x1fff0
callq 0x4130
movl $0x4, %edi
callq 0x4320
movq %rax, %r15
callq 0x4480
jmp 0xcfe2
movq %rax, %r15
cmpl $0x1, %edx
jne 0xcfe2
movq %r15, %rdi
callq 0x4110
movq %rax, %rbx
movq 0x138b0(%rip), %rdi     # 0x1fff0
leaq 0xc193(%rip), %rsi      # 0x188da
movl $0x1d, %edx
callq 0x42f0
movq 0x78(%rsp), %rsi
movq 0x80(%rsp), %rdx
movq 0x1388b(%rip), %rdi     # 0x1fff0
callq 0x42f0
movq %rax, %r14
leaq 0xbf7a(%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 0xc7dc
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x42d0
jmp 0xc7dc
jmp 0xc7d9
movq %rax, %r15
callq 0x4480
jmp 0xcfe2
movq %rax, %r15
cmpl $0x1, %edx
jne 0xcfe2
movq %r15, %rdi
callq 0x4110
movq %rax, %rbx
movq 0x137ec(%rip), %rdi     # 0x1fff0
leaq 0xc0cf(%rip), %rsi      # 0x188da
movl $0x1d, %edx
callq 0x42f0
movq 0x58(%rsp), %rsi
movq 0x60(%rsp), %rdx
movq 0x137ca(%rip), %rdi     # 0x1fff0
callq 0x42f0
movq %rax, %r14
leaq 0xc1c8(%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 0xc89d
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x42d0
jmp 0xc89d
jmp 0xc89a
movq %rax, %r15
callq 0x4480
jmp 0xcfe2
movq %rax, %r15
cmpl $0x1, %edx
jne 0xcfe2
movq %r15, %rdi
callq 0x4110
movq %rax, %rbx
movq 0x1372b(%rip), %rdi     # 0x1fff0
leaq 0xc0cf(%rip), %rsi      # 0x1899b
movl $0x1d, %edx
callq 0x42f0
movq 0x8(%rsp), %rax
movq 0x218(%rax), %rsi
movq 0x220(%rax), %rdx
movq 0x13700(%rip), %rdi     # 0x1fff0
callq 0x42f0
movq %rax, %r14
leaq 0xbdef(%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 0xc967
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x42d0
jmp 0xc967
jmp 0xc964
movq %rax, %r15
callq 0x4480
jmp 0xcfe2
movq %rax, %r15
cmpl $0x1, %edx
jne 0xcfc6
movq %r15, %rdi
callq 0x4110
movq %rax, %rbx
movq 0x13661(%rip), %rdi     # 0x1fff0
leaq 0xc005(%rip), %rsi      # 0x1899b
movl $0x1d, %edx
callq 0x42f0
movq 0x8(%rsp), %rax
movq 0x218(%rax), %rsi
movq 0x220(%rax), %rdx
movq 0x13636(%rip), %rdi     # 0x1fff0
callq 0x42f0
movq %rax, %r14
leaq 0xbd25(%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 0xca31
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x42d0
jmp 0xca31
jmp 0xca2e
movq %rax, %r15
callq 0x4480
jmp 0xcfc6
jmp 0xcbca
jmp 0xcc8f
movq %rax, %r15
cmpl $0x1, %edx
jne 0xcfc6
movq %r15, %rdi
callq 0x4110
movq %rax, %rbx
movq 0x1358d(%rip), %rdi     # 0x1fff0
leaq 0xbe70(%rip), %rsi      # 0x188da
movl $0x1d, %edx
callq 0x42f0
movq 0x78(%rsp), %rsi
movq 0x80(%rsp), %rdx
movq 0x13568(%rip), %rdi     # 0x1fff0
callq 0x42f0
movq %rax, %r14
leaq 0xbc57(%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 0xcaff
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x42d0
jmp 0xcaff
jmp 0xcafc
movq %rax, %r15
callq 0x4480
jmp 0xcfc6
movq %rax, %r15
cmpl $0x1, %edx
jne 0xcfc6
movq %r15, %rdi
callq 0x4110
movq %rax, %rbx
movq 0x134c9(%rip), %rdi     # 0x1fff0
leaq 0xbdac(%rip), %rsi      # 0x188da
movl $0x1d, %edx
callq 0x42f0
movq 0x58(%rsp), %rsi
movq 0x60(%rsp), %rdx
movq 0x134a7(%rip), %rdi     # 0x1fff0
callq 0x42f0
movq %rax, %r14
leaq 0xbea5(%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 0xcbc0
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x42d0
jmp 0xcbc0
jmp 0xcbbd
movq %rax, %r15
callq 0x4480
jmp 0xcfc6
movq %rax, %r15
cmpl $0x1, %edx
jne 0xcfe2
movq %r15, %rdi
callq 0x4110
movq %rax, %rbx
movq 0x13408(%rip), %rdi     # 0x1fff0
leaq 0xbdac(%rip), %rsi      # 0x1899b
movl $0x1d, %edx
callq 0x42f0
movq 0x218(%r14), %rsi
movq 0x220(%r14), %rdx
movq 0x133e2(%rip), %rdi     # 0x1fff0
callq 0x42f0
movq %rax, %r14
leaq 0xbde0(%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 0xcc85
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x42d0
jmp 0xcc85
jmp 0xcc82
movq %rax, %r15
callq 0x4480
jmp 0xcfe2
movq %rax, %r15
cmpl $0x1, %edx
jne 0xcfc6
movq %r15, %rdi
callq 0x4110
movq %rax, %rbx
movq 0x13343(%rip), %rdi     # 0x1fff0
leaq 0xbce7(%rip), %rsi      # 0x1899b
movl $0x1d, %edx
callq 0x42f0
movq 0x218(%r14), %rsi
movq 0x220(%r14), %rdx
movq 0x1331d(%rip), %rdi     # 0x1fff0
callq 0x42f0
movq %rax, %r14
leaq 0xbd1b(%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 0xcd4a
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x42d0
jmp 0xcd4a
jmp 0xcd47
movq %rax, %r15
callq 0x4480
jmp 0xcfc6
jmp 0xcfc3
jmp 0xcfbc
jmp 0xcfbc
jmp 0xcd65
movq %rax, %r15
jmp 0xd004
jmp 0xcd75
jmp 0xcd75
jmp 0xcd75
jmp 0xcd75
movq %rax, %r15
jmp 0xd020
jmp 0xcd7f
movq %rax, %r15
jmp 0xd045
movq %rax, %r15
cmpl $0x1, %edx
jne 0xd020
movq %r15, %rdi
callq 0x4110
movq %rax, %rbx
movq 0x1324b(%rip), %rdi     # 0x1fff0
leaq 0xba0f(%rip), %rsi      # 0x187bb
movl $0x1d, %edx
callq 0x42f0
movq 0x8(%rsp), %rax
movq 0x218(%rax), %rsi
movq 0x220(%rax), %rdx
movq 0x13220(%rip), %rdi     # 0x1fff0
callq 0x42f0
movq %rax, %r14
leaq 0xb90f(%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 0xce47
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x42d0
jmp 0xce47
jmp 0xce44
movq %rax, %r15
callq 0x4480
jmp 0xd020
movq %rax, %r15
cmpl $0x1, %edx
jne 0xd020
movq %r15, %rdi
callq 0x4110
movq %rax, %rbx
movq 0x13181(%rip), %rdi     # 0x1fff0
leaq 0xb945(%rip), %rsi      # 0x187bb
movl $0x1d, %edx
callq 0x42f0
movq 0x218(%r14), %rsi
movq 0x220(%r14), %rdx
movq 0x1315b(%rip), %rdi     # 0x1fff0
callq 0x42f0
movq %rax, %r14
leaq 0xbb59(%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 0xcf0c
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x42d0
jmp 0xcf0c
jmp 0xcf09
movq %rax, %r15
callq 0x4480
jmp 0xd020
movq %rax, %r15
cmpl $0x3, %edx
jne 0xcfc6
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 0x76e4
movq %r15, %rdi
callq 0x4110
movq 0x1309a(%rip), %rdi     # 0x1fff0
leaq 0xb7c8(%rip), %rsi      # 0x18725
movl $0x7, %edx
callq 0x42f0
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq 0x13078(%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 0xcfa9
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x42d0
callq 0x4480
jmp 0xcfc6
movq %rax, %rdi
callq 0x76d8
jmp 0xcfbc
jmp 0xcfbc
movq %rax, %r15
jmp 0xcfe2
jmp 0xcfc3
movq %rax, %r15
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0xcfe2
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x42d0
movq 0x78(%rsp), %rdi
leaq 0x88(%rsp), %rax
cmpq %rax, %rdi
je 0xd004
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x42d0
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0xd020
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x42d0
movq 0xb8(%rsp), %rdi
leaq 0xc8(%rsp), %rax
cmpq %rax, %rdi
je 0xd045
movq 0xc8(%rsp), %rsi
incq %rsi
callq 0x42d0
movq 0xd8(%rsp), %rdi
leaq 0xe8(%rsp), %rax
cmpq %rax, %rdi
je 0xd06a
movq 0xe8(%rsp), %rsi
incq %rsi
callq 0x42d0
movq %r15, %rdi
callq 0x44e0