// File: /workspace/github_cpp_makefile_star2_O3/tonymugen[P]sampleSNPs/varfiles.cpp
// Function: sampFiles::BedFileI::sampleLD(unsigned long const&)
void BedFileI::sampleLD(const uint64_t &n){
	if (n == 0) {
		cerr << "WARNING: zero SNPs requested. Nothing to be done." << endl;
		return;
	}

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

    } catch (system_error &error) {
        cerr << "ERROR: cannot open BIM file for input: " << error.code().message() << flush;
        perror(" ");
        exit(1);
    }
	uint64_t nSamp = 2UL * n; // n is the number of pairs
	uint64_t N           = _numLines(); // also sets _nCols correctly
    const uint16_t Npad  = _nCols % 4UL;
    const uint64_t Nbed  = (_nCols/4UL) + static_cast<uint64_t>(Npad > 0UL);
	const string outName = _fileStub + "_LD.tsv";
	if (nSamp > N) {
		cerr << "ERROR: requested a sample of " << nSamp << " SNPs that is greater than the number of SNPs (" << N << ") in the input file." << endl;
		return;
	} else if (nSamp == N) {
		cerr << "WARNING: the number of sampled SNPs the same as the total number of SNPs in the file. LD will be between neighboring loci." << endl;
		// use neighboring loci
		char *locus1  = new char[Nbed];
		char *locus2  = new char[Nbed];
		uint64_t cumS = 0; // cumulative position in the file
		double rSq;
		double Dprime;
		double cnt1;
		double cnt2;
		string chrID;   // chromosome ID
		uint64_t pos1;  // position of locus1
		uint64_t pos2;  // position of locus2
		string bimLine; // line in the .bim file
		string field;   // single field in the .bim file
		stringstream lineStream;

		ofstream outFile(outName);
		outFile << "ChrID\tpos1\tpos2\tDistance\trSq\tDprime\tn1\tn2"  << endl;

        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);
        }
		while (nSamp) {
			// first locus in the pair
			_varFile.seekg(cumS*Nbed + 3); // seekg() index is base-0
			_varFile.read(locus1, Nbed);
			getline(_bimFile, bimLine);
			cumS++;
			nSamp--;

			lineStream.str(bimLine); // replaces whatever was there from before
			lineStream >> field;
			chrID = field;
			lineStream >> field >> field >> field;
			pos1 = atoi(field.c_str());

			// second locus
			_varFile.seekg(cumS*Nbed + 3);
			_varFile.read(locus2, Nbed);
			getline(_bimFile, bimLine);
			cumS++;
			nSamp--;

			lineStream.str(bimLine);
			lineStream >> field;
			if (chrID != field) { // if the chromosome number changes, we discard this pair and continue
				continue;
			}
			lineStream >> field >> field >> field;
			pos2 = atoi(field.c_str());
			if (pos2 <= pos1) {
				cerr << "WARNING: second SNP position (" << pos2 << ") no larger than the first (" << pos1 << ") on chromosome " << chrID << ". Skipping this pair without re-trying." << endl;
				continue;
			}
			_ld(locus1, locus2, Nbed, Npad, rSq, Dprime, cnt1, cnt2);
			outFile << chrID << "\t" << pos1 << "\t" << pos2 << "\t" << pos2 - pos1 << "\t" << rSq << "\t" << Dprime << "\t" << cnt1 << "\t" << cnt2 << endl;
		}

		delete [] locus1;
		delete [] locus2;
		_varFile.close();
		_bimFile.close();
		outFile.close();

	}
	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 << ": " << error.code().message() << flush;
		perror(" ");
		exit(1);
	}
	// sample loci and calculate LD
	char *locus1  = new char[Nbed];
	char *locus2  = new char[Nbed];
	uint64_t cumS = 0; // cumulative position in the file
	uint64_t S;
	double rSq;
	double Dprime;
	double cnt1;
	double cnt2;
	string chrID;   // chromosome ID
	uint64_t pos1;  // position of locus1
	uint64_t pos2;  // position of locus2
	string bimLine; // line in the .bim file
	string field;   // single field in the .bim file
	stringstream lineStream;

	ofstream outFile(outName);
	outFile << "ChrID\tpos1\tpos2\tDistance\trSq\tDprime\tn1\tn2"  << endl;

	RanDraw *snpSamp;  // so that I can catch RanDraw constructor exceptions
	try {
		snpSamp = new RanDraw();
	} catch (string error) {
		cerr << "ERROR: " << error << endl;
		exit(5);
	}

	while (nSamp) {
		// first locus in the pair
		try {
			S = snpSamp->vitter(nSamp, 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(locus1, Nbed);
		cumS++;                        // step up cumS because seekg() will not change it (unlike the getline() that automatially advances)
		while (S) { // skipping S lines in the bim file
			_bimFile.ignore(numeric_limits<streamsize>::max(), '\n');
			S--;
		}
		getline(_bimFile, bimLine);
		lineStream.str(bimLine); // replaces whatever was there from before
		lineStream >> field;
		chrID = field;
		lineStream >> field >> field >> field;
		pos1 = atoi(field.c_str());
		nSamp--;

		// second locus
		try {
			S = snpSamp->vitter(nSamp, N);
		} catch (string error) {
			cerr << "ERROR: " << error << endl;
			exit(5);
		}
		cumS += S;
		N    -= S + 1;
		_varFile.seekg(cumS*Nbed + 3);
		_varFile.read(locus2, Nbed);
		cumS++;
		while (S) {
			_bimFile.ignore(numeric_limits<streamsize>::max(), '\n');
			S--;
		}
		getline(_bimFile, bimLine);

		lineStream.str(bimLine);
		lineStream >> field;
		if (chrID != field) { // if the chromosome number changes, we discard this pair and start over
			nSamp++;          // back up so that we end up with the correct number of pairs regardless of how many chromosome boundaries we cross
			continue;
		}
		lineStream >> field >> field >> field;
		pos2 = atoi(field.c_str());
		if (pos2 <= pos1) {
			cerr << "WARNING: second SNP position (" << pos2 << ") no larger than the first (" << pos1 << ") on chromosome " << chrID << ". Skipping this pair without re-trying." << endl;
			nSamp--; // will not re-try in this case
			continue;
		}
		_ld(locus1, locus2, Nbed, Npad, rSq, Dprime, cnt1, cnt2);
		outFile << chrID << "\t" << pos1 << "\t" << pos2 << "\t" << pos2 - pos1 << "\t" << rSq << "\t" << Dprime << "\t" << cnt1 << "\t" << cnt2 << endl;
		nSamp--;
	}

	delete [] locus1;
	delete [] locus2;
	_varFile.close();
	_bimFile.close();
	outFile.close();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x4c8, %rsp            # imm = 0x4C8
cmpq $0x0, (%rsi)
je 0xd24d
movq %rsi, %r14
leaq 0x458(%rdi), %rbx
movq %rdi, 0x8(%rsp)
leaq 0x4d8(%rdi), %r15
movq %r15, %rdi
callq 0x40a0
testb %al, %al
je 0xd0b7
movq %rbx, %rdi
callq 0x4060
leaq 0x150(%rsp), %r12
movq %r12, -0x10(%r12)
movq 0x8(%rsp), %rax
movq 0x668(%rax), %rsi
movq 0x670(%rax), %rdx
addq %rsi, %rdx
leaq 0x140(%rsp), %rdi
callq 0x76e4
leaq 0xb746(%rip), %rsi      # 0x18834
leaq 0x140(%rsp), %rdi
callq 0x4530
movq 0x140(%rsp), %rsi
movq %rbx, %rdi
movl $0x8, %edx
callq 0x4270
movq %r15, %rdi
callq 0x40a0
testb %al, %al
je 0xe13d
movq 0x140(%rsp), %rdi
cmpq %r12, %rdi
je 0xd13d
movq 0x150(%rsp), %rsi
incq %rsi
callq 0x42d0
movq (%r14), %r13
movq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x8ece
movq %rax, %r14
movq 0x238(%r15), %r12
movl %r12d, %eax
andl $0x3, %eax
movw %ax, 0x1e(%rsp)
shrq $0x2, %r12
cmpq $0x1, %rax
sbbq $-0x1, %r12
movq %r12, 0x118(%rsp)
leaq 0x108(%rsp), %rax
movq %rax, -0x10(%rax)
movq 0x668(%r15), %rsi
movq 0x670(%r15), %rdx
addq %rsi, %rdx
leaq 0xf8(%rsp), %r15
movq %r15, %rdi
callq 0x76e4
leaq 0xb860(%rip), %rsi      # 0x18a0a
movq %r15, %rdi
callq 0x4530
movq %r13, %rbp
addq %r13, %r13
cmpq %r14, %r13
jbe 0xd2a0
movq 0x12e28(%rip), %rdi     # 0x1fff0
leaq 0xb427(%rip), %rsi      # 0x185f6
movl $0x1d, %edx
callq 0x42f0
movq 0x12e10(%rip), %rdi     # 0x1fff0
movq %r13, %rsi
callq 0x41a0
movq %rax, %rbx
leaq 0xb706(%rip), %rsi      # 0x188f8
movl $0x2f, %edx
movq %rax, %rdi
callq 0x42f0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x41a0
movq %rax, %rbx
leaq 0xb430(%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 0xe106
movq 0x12d9c(%rip), %rbx     # 0x1fff0
leaq 0xb369(%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 $0x4c8, %rsp            # imm = 0x4C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x41b0
movq %r12, 0x20(%rsp)
jne 0xd938
movq 0x12d3e(%rip), %r15     # 0x1fff0
leaq 0xb759(%rip), %rsi      # 0x18a12
movl $0x7a, %edx
movq %r15, %rdi
callq 0x42f0
movq (%r15), %rax
addq -0x18(%rax), %r15
movq %r15, %rdi
movl $0xa, %esi
callq 0x4290
movsbl %al, %esi
movq 0x12d0c(%rip), %rdi     # 0x1fff0
callq 0x4040
movq %rax, %rdi
callq 0x41b0
movq %r12, %rdi
callq 0x4030
movq %rax, 0x48(%rsp)
movq %r12, %rdi
callq 0x4030
movq %rax, 0xb0(%rsp)
leaq 0x80(%rsp), %rcx
movq %rcx, -0x10(%rcx)
xorl %eax, %eax
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq 0xa0(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq 0x38(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq 0x340(%rsp), %rdi
callq 0x41c0
leaq 0x140(%rsp), %rdi
leaq 0xf8(%rsp), %rsi
movl $0x10, %edx
callq 0x4540
leaq 0xb71c(%rip), %rsi      # 0x18a8d
leaq 0x140(%rsp), %r15
movl $0x29, %edx
movq %r15, %rdi
callq 0x42f0
movq 0x140(%rsp), %rax
addq -0x18(%rax), %r15
movq %r15, %rdi
movl $0xa, %esi
callq 0x4290
movsbl %al, %esi
leaq 0x140(%rsp), %rdi
callq 0x4040
movq %rax, %rdi
callq 0x41b0
movq 0x8(%rsp), %r15
leaq 0x8(%r15), %rdi
movq 0x218(%r15), %rsi
movq %rdi, 0x10(%rsp)
movl $0xc, %edx
callq 0x4270
leaq 0x88(%r15), %rdi
callq 0x40a0
testb %al, %al
je 0xe2a6
leaq 0x50(%rsp), %rsi
movl $0x3, %edx
movq 0x10(%rsp), %rdi
callq 0x4350
cmpb $0x6c, 0x50(%rsp)
jne 0xe2fe
cmpb $0x1b, 0x51(%rsp)
jne 0xe2fe
cmpb $0x1, 0x52(%rsp)
jne 0xe35e
testq %r13, %r13
je 0xd83e
addq %rbp, %rbp
negq %rbp
movq %rbp, 0x120(%rsp)
movq 0x20(%rsp), %rax
addq %rax, %rax
movq %rax, 0xc8(%rsp)
movl $0x3, %r13d
movq 0x10(%rsp), %rdi
movq %r13, %rsi
xorl %edx, %edx
callq 0x4360
movq 0x10(%rsp), %rdi
movq 0x48(%rsp), %rsi
movq 0x20(%rsp), %rdx
callq 0x4350
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x4290
movsbl %al, %edx
movq %rbx, %rdi
leaq 0x90(%rsp), %rsi
callq 0x4500
leaq 0x358(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0x4410
leaq 0x340(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x4370
leaq 0x70(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x4160
leaq 0x340(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x4370
movq %rax, %rdi
leaq 0x28(%rsp), %rsi
callq 0x4370
movq %rax, %rdi
leaq 0x28(%rsp), %rsi
callq 0x4370
movq 0x28(%rsp), %rdi
callq 0x4440
movl %eax, %r12d
movq 0x20(%rsp), %rax
leaq (%rax,%r13), %rsi
movq 0x10(%rsp), %rdi
xorl %edx, %edx
callq 0x4360
movq 0x10(%rsp), %rdi
movq 0xb0(%rsp), %rsi
movq 0x20(%rsp), %rdx
callq 0x4350
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x4290
movsbl %al, %edx
movq %rbx, %rdi
leaq 0x90(%rsp), %rsi
callq 0x4500
leaq 0x358(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0x4410
leaq 0x340(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x4370
movq 0x78(%rsp), %rdx
cmpq 0x30(%rsp), %rdx
jne 0xd827
testq %rdx, %rdx
je 0xd5ab
movq 0x28(%rsp), %rsi
movq 0x70(%rsp), %rdi
callq 0x42e0
testl %eax, %eax
jne 0xd827
leaq 0x340(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x4370
movq %rax, %rdi
leaq 0x28(%rsp), %rsi
callq 0x4370
movq %rax, %rdi
leaq 0x28(%rsp), %rsi
callq 0x4370
movslq %r12d, %r12
movq 0x28(%rsp), %rdi
callq 0x4440
movslq %eax, %rbp
cmpl %r12d, %ebp
jbe 0xd776
subq $0x8, %rsp
movq 0x50(%rsp), %rsi
movq 0xb8(%rsp), %rdx
leaq 0x120(%rsp), %rcx
leaq 0x26(%rsp), %r8
leaq 0xf8(%rsp), %r9
leaq 0xe0(%rsp), %rax
pushq %rax
leaq 0xf0(%rsp), %rax
pushq %rax
leaq 0x100(%rsp), %rax
pushq %rax
callq 0x9740
addq $0x20, %rsp
movq 0x70(%rsp), %rsi
movq 0x78(%rsp), %rdx
leaq 0x140(%rsp), %rdi
callq 0x42f0
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0xb4c9(%rip), %rsi      # 0x18b2c
callq 0x42f0
movq %r15, %rdi
movq %r12, %rsi
callq 0x41a0
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0xb4a7(%rip), %rsi      # 0x18b2c
callq 0x42f0
movq %r15, %rdi
movq %rbp, %rsi
callq 0x41a0
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0xb485(%rip), %rsi      # 0x18b2c
callq 0x42f0
subq %r12, %rbp
movq %r15, %rdi
movq %rbp, %rsi
callq 0x41a0
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0xb460(%rip), %rsi      # 0x18b2c
callq 0x42f0
movsd 0xf0(%rsp), %xmm0
movq %r15, %rdi
callq 0x4470
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0xb438(%rip), %rsi      # 0x18b2c
callq 0x42f0
movsd 0xe8(%rsp), %xmm0
movq %r15, %rdi
callq 0x4470
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0xb410(%rip), %rsi      # 0x18b2c
callq 0x42f0
movsd 0xe0(%rsp), %xmm0
movq %r15, %rdi
callq 0x4470
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0xb3e8(%rip), %rsi      # 0x18b2c
callq 0x42f0
movsd 0xd8(%rsp), %xmm0
movq %r15, %rdi
callq 0x4470
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x4290
jmp 0xd814
movl $0x1e, %edx
movq 0x1286e(%rip), %rdi     # 0x1fff0
leaq 0xb32e(%rip), %rsi      # 0x18ab7
callq 0x42f0
movq 0x1285b(%rip), %rdi     # 0x1fff0
movq %rbp, %rsi
callq 0x41a0
movq %rax, %r15
movl $0x1c, %edx
movq %rax, %rdi
leaq 0xb327(%rip), %rsi      # 0x18ad6
callq 0x42f0
movq %r15, %rdi
movq %r12, %rsi
callq 0x41a0
movq %rax, %r12
movl $0x10, %edx
movq %rax, %rdi
leaq 0xb322(%rip), %rsi      # 0x18af3
callq 0x42f0
movq 0x70(%rsp), %rsi
movq 0x78(%rsp), %rdx
movq %r12, %rdi
callq 0x42f0
movq %rax, %r12
movl $0x27, %edx
movq %rax, %rdi
leaq 0xb30a(%rip), %rsi      # 0x18b04
callq 0x42f0
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x4290
movsbl %al, %esi
movq %r12, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x41b0
addq 0xc8(%rsp), %r13
addq $0x2, 0x120(%rsp)
jne 0xd44c
movq 0x48(%rsp), %rdi
callq 0x4380
movq 0xb0(%rsp), %rdi
callq 0x4380
movq 0x10(%rsp), %rdi
callq 0x4060
movq %rbx, %rdi
callq 0x4060
leaq 0x140(%rsp), %rdi
callq 0x43d0
movq 0x12755(%rip), %rax     # 0x1ffd0
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq 0x148(%rsp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, 0x140(%rsp,%rcx)
callq 0x4250
leaq 0x238(%rsp), %rdi
callq 0x40f0
movq 0x126fd(%rip), %rsi     # 0x1ffb0
leaq 0x340(%rsp), %rdi
callq 0x4200
leaq 0x3c0(%rsp), %rdi
callq 0x40f0
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0xd8e9
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x42d0
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
je 0xd90e
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x42d0
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
movq 0x20(%rsp), %r12
je 0xd935
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x42d0
xorl %r13d, %r13d
movq 0x8(%rsp), %r15
leaq 0x8(%r15), %rdi
movq 0x218(%r15), %rsi
movq %rdi, 0x10(%rsp)
movl $0xc, %edx
callq 0x4270
leaq 0x88(%r15), %rdi
callq 0x40a0
testb %al, %al
je 0xe195
leaq 0x140(%rsp), %rsi
movl $0x3, %edx
movq 0x10(%rsp), %rdi
callq 0x4350
cmpb $0x6c, 0x140(%rsp)
jne 0xe1f0
cmpb $0x1b, 0x141(%rsp)
jne 0xe1f0
cmpb $0x1, 0x142(%rsp)
jne 0xe24b
movq %r12, %rdi
callq 0x4030
movq %rax, 0x8(%rsp)
movq %r12, %rdi
callq 0x4030
movq %rax, 0xc0(%rsp)
leaq 0x80(%rsp), %rcx
movq %rcx, -0x10(%rcx)
xorl %eax, %eax
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq 0xa0(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq 0x38(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq 0x340(%rsp), %rdi
callq 0x41c0
leaq 0x140(%rsp), %rdi
leaq 0xf8(%rsp), %rsi
movl $0x10, %edx
callq 0x4540
leaq 0xb061(%rip), %rsi      # 0x18a8d
leaq 0x140(%rsp), %r15
movl $0x29, %edx
movq %r15, %rdi
callq 0x42f0
movq 0x140(%rsp), %rax
addq -0x18(%rax), %r15
movq %r15, %rdi
movl $0xa, %esi
callq 0x4290
movsbl %al, %esi
leaq 0x140(%rsp), %rdi
callq 0x4040
movq %rax, %rdi
callq 0x41b0
movl $0x8, %edi
callq 0x42c0
movq %rax, 0x48(%rsp)
movq %rax, %rdi
callq 0x172de
testq %r13, %r13
je 0xe014
xorl %ebp, %ebp
movabsq $0x7fffffffffffffff, %r12 # imm = 0x7FFFFFFFFFFFFFFF
movq %r13, %xmm0
movq 0xa9f5(%rip), %xmm1     # 0x184a0
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0xa9f9(%rip), %xmm2     # 0x184b0
subpd %xmm2, %xmm0
movapd %xmm0, %xmm3
unpckhpd %xmm0, %xmm3            # xmm3 = xmm3[1],xmm0[1]
addsd %xmm0, %xmm3
movapd %xmm3, 0xb0(%rsp)
movq %r13, 0x138(%rsp)
leaq -0x1(%r13), %rax
movq %rax, %xmm0
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
subpd %xmm2, %xmm0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
movapd %xmm1, 0x120(%rsp)
movaps 0xb0(%rsp), %xmm0
movsd %xmm0, 0x50(%rsp)
movq %r14, %xmm0
punpckldq 0xa987(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0xa98f(%rip), %xmm0     # 0x184b0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
movsd %xmm1, 0xd0(%rsp)
movq 0x48(%rsp), %rdi
leaq 0x50(%rsp), %rsi
leaq 0xd0(%rsp), %rdx
callq 0x175fe
movq %rax, %r13
addq %rax, %rbp
movq 0x20(%rsp), %rsi
imulq %rbp, %rsi
addq $0x3, %rsi
movq 0x10(%rsp), %rdi
xorl %edx, %edx
callq 0x4360
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rsi
movq 0x20(%rsp), %rdx
callq 0x4350
testq %r13, %r13
je 0xdb9d
movq %r13, %r15
movq %rbx, %rdi
movq %r12, %rsi
movl $0xa, %edx
callq 0x4190
decq %r15
jne 0xdb88
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x4290
movsbl %al, %edx
movq %rbx, %rdi
leaq 0x90(%rsp), %rsi
callq 0x4500
leaq 0x358(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0x4410
leaq 0x340(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x4370
leaq 0x70(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x4160
leaq 0x340(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x4370
movq %rax, %rdi
leaq 0x28(%rsp), %rsi
callq 0x4370
movq %rax, %rdi
leaq 0x28(%rsp), %rsi
callq 0x4370
notq %r13
addq %r13, %r14
movq 0x28(%rsp), %rdi
callq 0x4440
movl %eax, 0xc8(%rsp)
movaps 0x120(%rsp), %xmm0
movsd %xmm0, 0x50(%rsp)
movq %r14, %r13
movq %r14, %xmm0
punpckldq 0xa845(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0xa84d(%rip), %xmm0     # 0x184b0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
movsd %xmm1, 0xd0(%rsp)
movq 0x48(%rsp), %rdi
leaq 0x50(%rsp), %rsi
leaq 0xd0(%rsp), %rdx
callq 0x175fe
movq %rax, %r14
incq %rbp
addq %rax, %rbp
movq %rbp, %rsi
imulq 0x20(%rsp), %rsi
addq $0x3, %rsi
movq 0x10(%rsp), %rdi
xorl %edx, %edx
callq 0x4360
movq 0x10(%rsp), %rdi
movq 0xc0(%rsp), %rsi
movq 0x20(%rsp), %rdx
callq 0x4350
testq %r14, %r14
je 0xdce5
movq %r14, %r15
movq %rbx, %rdi
movq %r12, %rsi
movl $0xa, %edx
callq 0x4190
decq %r15
jne 0xdcd0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x4290
movsbl %al, %edx
movq %rbx, %rdi
leaq 0x90(%rsp), %rsi
callq 0x4500
leaq 0x358(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0x4410
leaq 0x340(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x4370
notq %r14
addq %r14, %r13
movq %r13, %r14
incq %rbp
movq 0x78(%rsp), %rdx
cmpq 0x30(%rsp), %rdx
jne 0xdafe
testq %rdx, %rdx
je 0xdd6b
movq 0x28(%rsp), %rsi
movq 0x70(%rsp), %rdi
callq 0x42e0
testl %eax, %eax
jne 0xdafe
leaq 0x340(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x4370
movq %rax, %rdi
leaq 0x28(%rsp), %rsi
callq 0x4370
movq %rax, %rdi
leaq 0x28(%rsp), %rsi
callq 0x4370
movslq 0xc8(%rsp), %r15
movq 0x28(%rsp), %rdi
callq 0x4440
movslq %eax, %r13
movq %r15, 0xb0(%rsp)
cmpl %r15d, %r13d
jbe 0xdf4d
subq $0x8, %rsp
movq 0x10(%rsp), %rsi
movq 0xc8(%rsp), %rdx
leaq 0x120(%rsp), %rcx
leaq 0x26(%rsp), %r8
leaq 0xf8(%rsp), %r9
leaq 0xe0(%rsp), %rax
pushq %rax
leaq 0xf0(%rsp), %rax
pushq %rax
leaq 0x100(%rsp), %rax
pushq %rax
callq 0x9740
addq $0x20, %rsp
movq 0x70(%rsp), %rsi
movq 0x78(%rsp), %rdx
leaq 0x140(%rsp), %rdi
callq 0x42f0
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0xacfc(%rip), %rsi      # 0x18b2c
callq 0x42f0
movq %r15, %rdi
movq 0xb0(%rsp), %rsi
callq 0x41a0
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0xacd5(%rip), %rsi      # 0x18b2c
callq 0x42f0
movq %r15, %rdi
movq %r13, %rsi
callq 0x41a0
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0xacb3(%rip), %rsi      # 0x18b2c
callq 0x42f0
subq 0xb0(%rsp), %r13
movq %r15, %rdi
movq %r13, %rsi
callq 0x41a0
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0xac89(%rip), %rsi      # 0x18b2c
callq 0x42f0
movsd 0xf0(%rsp), %xmm0
movq %r15, %rdi
callq 0x4470
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0xac61(%rip), %rsi      # 0x18b2c
callq 0x42f0
movsd 0xe8(%rsp), %xmm0
movq %r15, %rdi
callq 0x4470
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0xac39(%rip), %rsi      # 0x18b2c
callq 0x42f0
movsd 0xe0(%rsp), %xmm0
movq %r15, %rdi
callq 0x4470
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0xac11(%rip), %rsi      # 0x18b2c
callq 0x42f0
movsd 0xd8(%rsp), %xmm0
movq %r15, %rdi
callq 0x4470
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x4290
jmp 0xdfef
movl $0x1e, %edx
movq 0x12097(%rip), %rdi     # 0x1fff0
leaq 0xab57(%rip), %rsi      # 0x18ab7
callq 0x42f0
movq 0x12084(%rip), %rdi     # 0x1fff0
movq %r13, %rsi
callq 0x41a0
movq %rax, %r15
movl $0x1c, %edx
movq %rax, %rdi
leaq 0xab50(%rip), %rsi      # 0x18ad6
callq 0x42f0
movq %r15, %rdi
movq 0xb0(%rsp), %rsi
callq 0x41a0
movq %rax, %r15
movl $0x10, %edx
movq %rax, %rdi
leaq 0xab46(%rip), %rsi      # 0x18af3
callq 0x42f0
movq 0x70(%rsp), %rsi
movq 0x78(%rsp), %rdx
movq %r15, %rdi
callq 0x42f0
movq %rax, %r15
movl $0x27, %edx
movq %rax, %rdi
leaq 0xab2e(%rip), %rsi      # 0x18b04
callq 0x42f0
movq (%r15), %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
movq 0x138(%rsp), %r13
addq $-0x2, %r13
jne 0xda9e
movq 0x8(%rsp), %rdi
callq 0x4380
movq 0xc0(%rsp), %rdi
callq 0x4380
movq 0x10(%rsp), %rdi
callq 0x4060
movq %rbx, %rdi
callq 0x4060
leaq 0x140(%rsp), %rdi
callq 0x43d0
movq 0x11f7f(%rip), %rax     # 0x1ffd0
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq 0x148(%rsp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, 0x140(%rsp,%rcx)
callq 0x4250
leaq 0x238(%rsp), %rdi
callq 0x40f0
movq 0x11f27(%rip), %rsi     # 0x1ffb0
leaq 0x340(%rsp), %rdi
callq 0x4200
leaq 0x3c0(%rsp), %rdi
callq 0x40f0
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0xe0bf
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x42d0
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
je 0xe0e4
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x42d0
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0xe106
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x42d0
movq 0xf8(%rsp), %rdi
leaq 0x108(%rsp), %rax
cmpq %rax, %rdi
je 0xe12b
movq 0x108(%rsp), %rsi
incq %rsi
callq 0x42d0
addq $0x4c8, %rsp            # imm = 0x4C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x11eac(%rip), %rdi     # 0x1fff0
leaq 0xa76e(%rip), %rsi      # 0x188b9
movl $0x20, %edx
callq 0x42f0
movq 0x140(%rsp), %rsi
movq 0x148(%rsp), %rdx
movq 0x11e84(%rip), %rdi     # 0x1fff0
callq 0x42f0
movq %rax, %rbx
leaq 0xa3f1(%rip), %rsi      # 0x1856c
movl $0xa, %edx
movq %rax, %rdi
callq 0x42f0
movq %rbx, %rdi
callq 0x4130
jmp 0xe354
movq 0x11e54(%rip), %rdi     # 0x1fff0
leaq 0xa7d7(%rip), %rsi      # 0x1897a
movl $0x20, %edx
movq 0x8(%rsp), %rbx
callq 0x42f0
movq 0x218(%rbx), %rsi
movq 0x220(%rbx), %rdx
movq 0x11e29(%rip), %rdi     # 0x1fff0
callq 0x42f0
movq %rax, %rbx
leaq 0xa396(%rip), %rsi      # 0x1856c
movl $0xa, %edx
movq %rax, %rdi
callq 0x42f0
movq %rbx, %rdi
callq 0x4130
jmp 0xe354
movq 0x11df9(%rip), %rdi     # 0x1fff0
leaq 0xa658(%rip), %rsi      # 0x18856
movl $0x13, %edx
callq 0x42f0
movq 0x8(%rsp), %rax
movq 0x218(%rax), %rsi
movq 0x220(%rax), %rdx
movq 0x11dce(%rip), %rdi     # 0x1fff0
callq 0x42f0
movq %rax, %rbx
leaq 0xa639(%rip), %rsi      # 0x1886a
movl $0x16, %edx
movq %rax, %rdi
callq 0x42f0
movq %rbx, %rdi
callq 0x4130
jmp 0xe354
movq 0x11d9e(%rip), %rdi     # 0x1fff0
leaq 0xa5fd(%rip), %rsi      # 0x18856
movl $0x13, %edx
callq 0x42f0
movq 0x8(%rsp), %rax
movq 0x218(%rax), %rsi
movq 0x220(%rax), %rdx
movq 0x11d73(%rip), %rdi     # 0x1fff0
callq 0x42f0
movq %rax, %rbx
leaq 0xa5f5(%rip), %rsi      # 0x18881
movl $0x37, %edx
movq %rax, %rdi
callq 0x42f0
movq %rbx, %rdi
callq 0x4130
jmp 0xe3b4
movq 0x11d43(%rip), %rdi     # 0x1fff0
leaq 0xa6c6(%rip), %rsi      # 0x1897a
movl $0x20, %edx
movq 0x8(%rsp), %rbx
callq 0x42f0
movq 0x218(%rbx), %rsi
movq 0x220(%rbx), %rdx
movq 0x11d18(%rip), %rdi     # 0x1fff0
callq 0x42f0
movq %rax, %rbx
leaq 0xa285(%rip), %rsi      # 0x1856c
movl $0xa, %edx
movq %rax, %rdi
callq 0x42f0
movq %rbx, %rdi
callq 0x4130
jmp 0xe354
movq 0x11ceb(%rip), %rdi     # 0x1fff0
leaq 0xa54a(%rip), %rsi      # 0x18856
movl $0x13, %edx
callq 0x42f0
movq 0x8(%rsp), %rax
movq 0x218(%rax), %rsi
movq 0x220(%rax), %rdx
movq 0x11cc0(%rip), %rdi     # 0x1fff0
callq 0x42f0
movq %rax, %rbx
leaq 0xa52b(%rip), %rsi      # 0x1886a
movl $0x16, %edx
movq %rax, %rdi
callq 0x42f0
movq %rbx, %rdi
callq 0x4130
movl $0x2, %edi
callq 0x4320
movq 0x11c8b(%rip), %rdi     # 0x1fff0
leaq 0xa4ea(%rip), %rsi      # 0x18856
movl $0x13, %edx
callq 0x42f0
movq 0x8(%rsp), %rax
movq 0x218(%rax), %rsi
movq 0x220(%rax), %rdx
movq 0x11c60(%rip), %rdi     # 0x1fff0
callq 0x42f0
movq %rax, %rbx
leaq 0xa4e2(%rip), %rsi      # 0x18881
movl $0x37, %edx
movq %rax, %rdi
callq 0x42f0
movq %rbx, %rdi
callq 0x4130
movl $0x3, %edi
callq 0x4320
movq %rax, %rbx
jmp 0xe8b4
jmp 0xe495
jmp 0xe744
jmp 0xe744
jmp 0xe4a7
movq %rdx, %r14
movq %rax, %rbx
movl $0x8, %esi
movq 0x48(%rsp), %rdi
callq 0x42d0
jmp 0xe3f7
movq %rdx, %r14
movq %rax, %rbx
cmpl $0x2, %r14d
jne 0xe8a7
movq %rbx, %rdi
callq 0x4340
leaq 0x60(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq 0x50(%rsp), %rdi
callq 0x76e4
movq %rbx, %rdi
callq 0x4110
movq 0x11bbb(%rip), %rdi     # 0x1fff0
leaq 0xa2e9(%rip), %rsi      # 0x18725
movl $0x7, %edx
callq 0x42f0
movq 0x50(%rsp), %rsi
movq 0x58(%rsp), %rdx
movq 0x11b99(%rip), %rdi     # 0x1fff0
callq 0x42f0
movq %rax, %rdi
callq 0x4130
jmp 0xe86d
movq %rax, %rbx
movq 0x50(%rsp), %rdi
cmpq %r14, %rdi
je 0xe483
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x42d0
callq 0x4480
jmp 0xe8a7
movq %rax, %rbx
jmp 0xe8b4
movq %rax, %rbx
jmp 0xe8d5
jmp 0xe744
jmp 0xe744
movq %rax, %rbx
cmpl $0x1, %edx
jne 0xe74f
movq %rbx, %rdi
callq 0x4110
movq %rax, %rbx
movq 0x11b2b(%rip), %rdi     # 0x1fff0
leaq 0xa4cf(%rip), %rsi      # 0x1899b
movl $0x1d, %edx
callq 0x42f0
movq 0x8(%rsp), %rax
movq 0x218(%rax), %rsi
movq 0x220(%rax), %rdx
movq 0x11b00(%rip), %rdi     # 0x1fff0
callq 0x42f0
movq %rax, %r14
leaq 0xa4fe(%rip), %rsi      # 0x189fd
movl $0xc, %edx
movq %rax, %rdi
callq 0x42f0
movq 0x18(%rbx), %rsi
movl 0x10(%rbx), %edx
movq (%rsi), %rax
leaq 0x50(%rsp), %rdi
callq *0x20(%rax)
movq 0x50(%rsp), %rsi
movq 0x58(%rsp), %rdx
movq %r14, %rdi
callq 0x42f0
movq %rax, %rdi
callq 0x41b0
leaq 0x50(%rsp), %rdi
callq 0x47fb
movq %rax, %rbx
leaq 0x60(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xe567
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x42d0
jmp 0xe567
jmp 0xe564
movq %rax, %rbx
callq 0x4480
jmp 0xe74f
jmp 0xe58b
jmp 0xe744
jmp 0xe675
movq %r12, %r15
movq %rdx, %r14
movq %rax, %rbx
jmp 0xe69b
movq %rax, %rbx
cmpl $0x1, %edx
jne 0xe938
movq %rbx, %rdi
callq 0x4110
movq %rax, %rbx
movq 0x11a47(%rip), %rdi     # 0x1fff0
leaq 0xa289(%rip), %rsi      # 0x18839
movl $0x1c, %edx
callq 0x42f0
movq 0x8(%rsp), %rax
movq 0x218(%rax), %rsi
movq 0x220(%rax), %rdx
movq 0x11a1c(%rip), %rdi     # 0x1fff0
callq 0x42f0
movq %rax, %r14
leaq 0xa22e(%rip), %rsi      # 0x18811
movl $0x2, %edx
movq %rax, %rdi
callq 0x42f0
movq 0x18(%rbx), %rsi
movl 0x10(%rbx), %edx
movq (%rsi), %rax
leaq 0x140(%rsp), %rdi
callq *0x20(%rax)
movq 0x140(%rsp), %rsi
movq 0x148(%rsp), %rdx
movq %r14, %rdi
callq 0x42f0
movq %rax, %rdi
callq 0x41b0
leaq 0x140(%rsp), %rdi
callq 0x47e1
movq %rax, %rbx
movq 0x140(%rsp), %rdi
leaq 0x150(%rsp), %rax
cmpq %rax, %rdi
je 0xe661
movq 0x150(%rsp), %rsi
incq %rsi
callq 0x42d0
jmp 0xe661
jmp 0xe65e
movq %rax, %rbx
callq 0x4480
jmp 0xe938
jmp 0xe8a4
jmp 0xe74c
movq %rdx, %r14
movq %rax, %rbx
movq 0x140(%rsp), %rdi
movq %r12, %r15
cmpq %r12, %rdi
je 0xe69b
movq 0x150(%rsp), %rsi
incq %rsi
callq 0x42d0
cmpl $0x1, %r14d
jne 0xe95d
movq %rbx, %rdi
callq 0x4110
movq %rax, %rbx
movq 0x11939(%rip), %rdi     # 0x1fff0
leaq 0xa324(%rip), %rsi      # 0x189e2
movl $0x27, %edx
callq 0x42f0
movq 0x18(%rbx), %rsi
movl 0x10(%rbx), %edx
movq (%rsi), %rax
leaq 0x140(%rsp), %rdi
callq *0x20(%rax)
movq 0x140(%rsp), %rsi
movq 0x148(%rsp), %rdx
movq 0x118fc(%rip), %rdi     # 0x1fff0
callq 0x42f0
movq %rax, %rdi
callq 0x41b0
leaq 0x140(%rsp), %rdi
callq 0x47c7
movq %rax, %rbx
movq 0x140(%rsp), %rdi
cmpq %r15, %rdi
je 0xe735
movq 0x150(%rsp), %rsi
incq %rsi
callq 0x42d0
jmp 0xe735
jmp 0xe732
movq %rax, %rbx
callq 0x4480
jmp 0xe95d
jmp 0xe8a4
movq %rax, %rbx
jmp 0xe938
movq %rax, %rbx
leaq 0x140(%rsp), %rdi
callq 0x4400
jmp 0xe8b4
jmp 0xe8a4
movq %rax, %rbx
cmpl $0x2, %edx
jne 0xe8a7
movq %rbx, %rdi
callq 0x4340
leaq 0x60(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq 0x50(%rsp), %rdi
callq 0x76e4
movq %rbx, %rdi
callq 0x4110
movq 0x1184a(%rip), %rdi     # 0x1fff0
leaq 0x9f78(%rip), %rsi      # 0x18725
movl $0x7, %edx
callq 0x42f0
movq 0x50(%rsp), %rsi
movq 0x58(%rsp), %rdx
movq 0x11828(%rip), %rdi     # 0x1fff0
callq 0x42f0
movq %rax, %rdi
callq 0x4130
jmp 0xe86d
movq %rax, %rbx
movq 0x50(%rsp), %rdi
cmpq %r14, %rdi
je 0xe7f4
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x42d0
callq 0x4480
jmp 0xe8a7
movq %rax, %rbx
cmpl $0x2, %edx
jne 0xe8a7
movq %rbx, %rdi
callq 0x4340
leaq 0x60(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq 0x50(%rsp), %rdi
callq 0x76e4
movq %rbx, %rdi
callq 0x4110
movq 0x117b2(%rip), %rdi     # 0x1fff0
leaq 0x9ee0(%rip), %rsi      # 0x18725
movl $0x7, %edx
callq 0x42f0
movq 0x50(%rsp), %rsi
movq 0x58(%rsp), %rdx
movq 0x11790(%rip), %rdi     # 0x1fff0
callq 0x42f0
movq %rax, %rdi
callq 0x4130
movl $0x5, %edi
callq 0x4320
movq %rax, %rbx
movq 0x50(%rsp), %rdi
cmpq %r14, %rdi
je 0xe891
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x42d0
callq 0x4480
jmp 0xe8a7
movq %rax, %rdi
callq 0x76d8
jmp 0xe8a4
jmp 0xe8a4
movq %rax, %rbx
leaq 0x140(%rsp), %rdi
callq 0x4400
movq 0x116f5(%rip), %rsi     # 0x1ffb0
leaq 0x340(%rsp), %rdi
callq 0x4200
leaq 0x3c0(%rsp), %rdi
callq 0x40f0
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0xe8f1
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x42d0
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
je 0xe916
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x42d0
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0xe938
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x42d0
movq 0xf8(%rsp), %rdi
leaq 0x108(%rsp), %rax
cmpq %rax, %rdi
je 0xe95d
movq 0x108(%rsp), %rsi
incq %rsi
callq 0x42d0
movq %rbx, %rdi
callq 0x44e0
nop