// File: melop[P]admixem/config.cpp
// Function: RecombProbConfigurations::LoadFromFile(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void RecombProbConfigurations::LoadFromFile(string szConfigFile) {
	#ifdef _OPENMP
		int nTotalCPUCore =  omp_get_max_threads();//omp_get_num_threads();
		//printf("OpenMP enabled\n");
	#else
		int nTotalCPUCore = 1;
		//printf("OpenMP disabled \n");
	#endif

	FILE *pConfigFile;
	char szBuffer[12048];

	this->_nHaploidChrNum = ((SimulationConfigurations *)this->_pParentConfig)->pMarkerConfig->GetHaploidChromosomeNum(); // save a copy of the haploid chromosome number
	//Initialize arrays:
	this->_nExpectedMaleRecPerMeiosisArm1 = new double[_nHaploidChrNum];
	this->_nExpectedMaleRecPerMeiosisArm2 = new double[_nHaploidChrNum];
	this->_nExpectedFemaleRecPerMeiosisArm1 = new double[_nHaploidChrNum];
	this->_nExpectedFemaleRecPerMeiosisArm2 = new double[_nHaploidChrNum];

	this->pvBreakpointSamplePositions = new vector<double>[_nHaploidChrNum];
	this->pvMaleAccuProb = new vector<double>[_nHaploidChrNum];
	this->pvFemaleAccuProb = new vector<double>[_nHaploidChrNum];
	this->pvMaleMapDistance = new vector<double>[_nHaploidChrNum];
	this->pvFemaleMapDistance = new vector<double>[_nHaploidChrNum];
	this->pvAvgMapDistance = new vector<double>[_nHaploidChrNum];
	this->pvMaleRecArm1Gen = new vector< Poisson * >[nTotalCPUCore];
	this->pvMaleRecArm2Gen = new vector< Poisson * >[nTotalCPUCore];
	this->pvFemaleRecArm1Gen = new vector< Poisson * >[nTotalCPUCore];
	this->pvFemaleRecArm2Gen = new vector< Poisson * >[nTotalCPUCore];
	
	
	printf("Start loading marker probability file %s ...\n", szConfigFile.c_str());

	if (((SimulationConfigurations *)this->_pParentConfig)->GetConfig("UseUniformRec") == "yes") {
		printf("Instructed by configuration to use uniform distribution, will ignore candidate breakpoints in recombination file. But expected number of recombinations will still be used.\n");
		this->_bUseUniform = true;
		
	}
	else {
		this->_bUseUniform = false;
	}

	_szConfigFilename = szConfigFile; // save name of config file

	pConfigFile = fopen(szConfigFile.c_str(), "r");

	if (!pConfigFile) {
		printf("%s\n", "Cannot open marker file ...");
		throw "Cannot open marker file!";
	}



	int nCurrChr;
	char szCmd[100];
	double nVal, nPos, nMaleAccu, nFemaleAccu, nMaleMapDistance, nFemaleMapDistance, nAvgMapDistance;

	long nLastBpArm1=0; // the index of the last break point at arm 1
	long nBpIndex = -1;
	double nPrevProb = 0.0; // previous probability. 

	while(fgets(szBuffer, 12048, pConfigFile) != NULL) 
	{

		//sscanf(szBuffer, "%d %*f %f %f %f", &nNum, &nAbsPos, &nFreqPop1, &nFreqPop2);


		if (szBuffer[0] == ':') { // it's metadata line

			if (szBuffer[1] == 'c') { // it's the chr line
				//parse chromosome number:

				sscanf(szBuffer, ":chr %d", &nCurrChr);

				if (nCurrChr > this->_nHaploidChrNum || nCurrChr <=0 ) {
					throw "Chromosome number in marker probability file incorrect!";
				}

				if (nBpIndex > 0) {
					vLastBpOnArm1.push_back(nLastBpArm1==0? nBpIndex : nLastBpArm1); // this is the previous record.
				}
				nLastBpArm1=0;
				nBpIndex = -1;
				nPrevProb = 0.0; // previous probability. 
				nCurrChr--;
				continue; // go to the next line
			}
			else { // it's a command line

				sscanf(szBuffer, "%s = %lf", szCmd, &nVal);
				
				//printf("%s\n",szCmd);

				if (strcmp(szCmd, ":ExpectedMaleRecPerMeiosisArm1")==0) {
					this->_nExpectedMaleRecPerMeiosisArm1[nCurrChr] = nVal;
					for(int nCPU=0;nCPU<nTotalCPUCore;nCPU++) {
						Poisson * pPosGen = new Poisson(nVal);
						this->pvMaleRecArm1Gen[nCPU].push_back(pPosGen);
					}
				}
				if (strcmp(szCmd,":ExpectedMaleRecPerMeiosisArm2")==0) {
					this->_nExpectedMaleRecPerMeiosisArm2[nCurrChr] = nVal;
					for(int nCPU=0;nCPU<nTotalCPUCore;nCPU++) {
						Poisson * pPosGen = new Poisson(nVal);
						this->pvMaleRecArm2Gen[nCPU].push_back(pPosGen);
					}
				}

				if (strcmp(szCmd,":ExpectedFemaleRecPerMeiosisArm1")==0) {
					this->_nExpectedFemaleRecPerMeiosisArm1[nCurrChr] = nVal;
					for(int nCPU=0;nCPU<nTotalCPUCore;nCPU++) {
						Poisson * pPosGen = new Poisson(nVal);
						this->pvFemaleRecArm1Gen[nCPU].push_back(pPosGen);
					}
				}
				if (strcmp(szCmd,":ExpectedFemaleRecPerMeiosisArm2")==0) {
					this->_nExpectedFemaleRecPerMeiosisArm2[nCurrChr] = nVal;
					for(int nCPU=0;nCPU<nTotalCPUCore;nCPU++) {
						Poisson * pPosGen = new Poisson(nVal);
						this->pvFemaleRecArm2Gen[nCPU].push_back(pPosGen);
					}
				}

			}

			continue;

		}

		if (szBuffer[0] == '\t') {
			
			continue; //title line, skip
		}
		else { //parse real data

			if (sscanf(szBuffer, "%lf %*lf %lf %*lf %lf %*lf %*lf %*lf %lf %*lf %lf %*lf %lf %*lf", &nPos, &nMaleAccu, &nFemaleAccu, &nMaleMapDistance, &nFemaleMapDistance, &nAvgMapDistance)!=6) {
				continue; // couldn't parse line.	
			};

			nBpIndex++;
			if (nMaleAccu < nPrevProb ) { //switch in prob. crossing the centromere?
				if (nLastBpArm1 != 0) { // this was already set, the sequence is not monotonic.
					throw("Error: accumulative recombination rate must be monotonic within each arm.\n");
				}

				nLastBpArm1 = nBpIndex - 1;//the previous bp is the last one in arm 1.
				
			}
			this->pvBreakpointSamplePositions[nCurrChr].push_back(nPos);
			this->pvMaleAccuProb[nCurrChr].push_back(nMaleAccu);
			this->pvFemaleAccuProb[nCurrChr].push_back(nFemaleAccu);
			this->pvMaleMapDistance[nCurrChr].push_back(nMaleMapDistance);
			this->pvFemaleMapDistance[nCurrChr].push_back(nFemaleMapDistance);
			this->pvAvgMapDistance[nCurrChr].push_back(nAvgMapDistance);

			nPrevProb = nMaleAccu;
		}


	}

	//check that recombination break points on arms are complete:
	if ( pvMaleRecArm1Gen[0].size() != pvMaleRecArm2Gen[0].size() || pvMaleRecArm2Gen[0].size() != pvFemaleRecArm1Gen[0].size() || pvFemaleRecArm1Gen[0].size() != pvFemaleRecArm2Gen[0].size()) {
		throw(new Exception("The number of Recombination break point defined are not equal.\n"));
	}

	vLastBpOnArm1.push_back(nLastBpArm1==0? nBpIndex : nLastBpArm1); // this is the last chromosome.


	//calculate splines
	for(int nCurrChr=0;nCurrChr < this->_nHaploidChrNum; nCurrChr++) {
		double nChrLen = ((SimulationConfigurations*)this->_pParentConfig)->pMarkerConfig->GetChromosomeLength(nCurrChr);
		tk::spline oMaleSplineArm1, oFemaleSplineArm1,oMaleSplineArm2, oFemaleSplineArm2;
		oMaleSplineArm1.set_boundary(spline::first_deriv, 0.0, spline::first_deriv, this->pvBreakpointSamplePositions[nCurrChr].at(this->vLastBpOnArm1[nCurrChr]), false);
		oFemaleSplineArm1.set_boundary(spline::first_deriv, 0.0, spline::first_deriv, this->pvBreakpointSamplePositions[nCurrChr].at(this->vLastBpOnArm1[nCurrChr]), false);
		oMaleSplineArm2.set_boundary(spline::first_deriv, this->pvBreakpointSamplePositions[nCurrChr].at(this->vLastBpOnArm1[nCurrChr]), spline::first_deriv, nChrLen, false);
		oFemaleSplineArm2.set_boundary(spline::first_deriv, this->pvBreakpointSamplePositions[nCurrChr].at(this->vLastBpOnArm1[nCurrChr]), spline::first_deriv, nChrLen, false);
		size_t nTotalBps = this->pvBreakpointSamplePositions[nCurrChr].size();
		vector<double> vPosArm1, vPosArm2, vAccMaleArm1, vAccMaleArm2, vAccFemaleArm1, vAccFemaleArm2;
		copy(this->pvBreakpointSamplePositions[nCurrChr].begin(), this->pvBreakpointSamplePositions[nCurrChr].begin() + this->vLastBpOnArm1[nCurrChr] + 1 ,back_inserter(vPosArm1));
		copy(this->pvBreakpointSamplePositions[nCurrChr].begin() + this->vLastBpOnArm1[nCurrChr] + 1, this->pvBreakpointSamplePositions[nCurrChr].end() ,back_inserter(vPosArm2));
		copy(this->pvMaleAccuProb[nCurrChr].begin(), this->pvMaleAccuProb[nCurrChr].begin() + this->vLastBpOnArm1[nCurrChr] + 1 ,back_inserter(vAccMaleArm1));
		copy(this->pvMaleAccuProb[nCurrChr].begin() + this->vLastBpOnArm1[nCurrChr] + 1, this->pvMaleAccuProb[nCurrChr].end() ,back_inserter(vAccMaleArm2));
		copy(this->pvFemaleAccuProb[nCurrChr].begin(), this->pvFemaleAccuProb[nCurrChr].begin() + this->vLastBpOnArm1[nCurrChr] + 1 ,back_inserter(vAccFemaleArm1));
		copy(this->pvFemaleAccuProb[nCurrChr].begin() + this->vLastBpOnArm1[nCurrChr] + 1, this->pvFemaleAccuProb[nCurrChr].end() ,back_inserter(vAccFemaleArm2));

		// erase elements in case not monotonic:

		if (vPosArm1.size() > 2) { // must have more than 2 pairs of dots to predict a spline.
			this->fnEraseNonMonotonic(&vAccMaleArm1 , &vAccFemaleArm1, &vPosArm1);
			oMaleSplineArm1.set_points(vAccMaleArm1 , vPosArm1);
			oFemaleSplineArm1.set_points(vAccFemaleArm1 , vPosArm1);
		}

		if (vPosArm2.size() > 2) {
			this->fnEraseNonMonotonic(&vAccMaleArm2 , &vAccFemaleArm2, &vPosArm2);

			oMaleSplineArm2.set_points(vAccMaleArm2 , vPosArm2);
			oFemaleSplineArm2.set_points(vAccFemaleArm2 , vPosArm2);
		}


		this->vMaleAccuProbSplineArm1.push_back(oMaleSplineArm1);
		this->vMaleAccuProbSplineArm2.push_back(oMaleSplineArm2);
		this->vFemaleAccuProbSplineArm1.push_back(oFemaleSplineArm1);
		this->vFemaleAccuProbSplineArm2.push_back(oFemaleSplineArm2);
	}

	///printf("%f %f %f", this->pvBreakpointSamplePositions[0].at(0), this->pvMaleAccuProb[0].at(0), this->pvFemaleAccuProb[0].at(0));

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x37c0, %rsp           # imm = 0x37C0
movq %rsi, -0x3508(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x3500(%rbp)
movl $0x1, -0x14(%rbp)
movq (%rax), %rax
movq (%rax), %rdi
callq 0x1ce90
movl %eax, %ecx
movq -0x3500(%rbp), %rax
movl %ecx, 0x8(%rax)
movslq 0x8(%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x8040
movq %rax, %rcx
movq -0x3500(%rbp), %rax
movq %rcx, 0x30(%rax)
movslq 0x8(%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x8040
movq %rax, %rcx
movq -0x3500(%rbp), %rax
movq %rcx, 0x38(%rax)
movslq 0x8(%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x8040
movq %rax, %rcx
movq -0x3500(%rbp), %rax
movq %rcx, 0x40(%rax)
movslq 0x8(%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x8040
movq %rax, %rcx
movq -0x3500(%rbp), %rax
movq %rcx, 0x48(%rax)
movslq 0x8(%rax), %rax
movq %rax, -0x34f8(%rbp)
movl $0x18, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
addq $0x8, %rdi
setb %al
orb %al, %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x8040
movq %rax, %rcx
movq -0x34f8(%rbp), %rax
movq %rax, (%rcx)
addq $0x8, %rcx
movq %rcx, -0x34f0(%rbp)
cmpq $0x0, %rax
je 0x1d579
movq -0x34f0(%rbp), %rax
movq -0x34f8(%rbp), %rcx
imulq $0x18, %rcx, %rdx
movq %rax, %rcx
addq %rdx, %rcx
movq %rcx, -0x3518(%rbp)
movq %rax, -0x3510(%rbp)
movq -0x3510(%rbp), %rdi
movq %rdi, -0x3520(%rbp)
callq 0x2ad80
movq -0x3520(%rbp), %rax
movq -0x3518(%rbp), %rcx
addq $0x18, %rax
cmpq %rcx, %rax
movq %rax, -0x3510(%rbp)
jne 0x1d548
movq -0x3500(%rbp), %rax
movq -0x34f0(%rbp), %rcx
movq %rcx, 0x78(%rax)
movslq 0x8(%rax), %rax
movq %rax, -0x3530(%rbp)
movl $0x18, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
addq $0x8, %rdi
setb %al
orb %al, %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x8040
movq %rax, %rcx
movq -0x3530(%rbp), %rax
movq %rax, (%rcx)
addq $0x8, %rcx
movq %rcx, -0x3528(%rbp)
cmpq $0x0, %rax
je 0x1d635
movq -0x3528(%rbp), %rax
movq -0x3530(%rbp), %rcx
imulq $0x18, %rcx, %rdx
movq %rax, %rcx
addq %rdx, %rcx
movq %rcx, -0x3540(%rbp)
movq %rax, -0x3538(%rbp)
movq -0x3538(%rbp), %rdi
movq %rdi, -0x3548(%rbp)
callq 0x2ad80
movq -0x3548(%rbp), %rax
movq -0x3540(%rbp), %rcx
addq $0x18, %rax
cmpq %rcx, %rax
movq %rax, -0x3538(%rbp)
jne 0x1d604
movq -0x3500(%rbp), %rax
movq -0x3528(%rbp), %rcx
movq %rcx, 0x80(%rax)
movslq 0x8(%rax), %rax
movq %rax, -0x3558(%rbp)
movl $0x18, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
addq $0x8, %rdi
setb %al
orb %al, %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x8040
movq %rax, %rcx
movq -0x3558(%rbp), %rax
movq %rax, (%rcx)
addq $0x8, %rcx
movq %rcx, -0x3550(%rbp)
cmpq $0x0, %rax
je 0x1d6f4
movq -0x3550(%rbp), %rax
movq -0x3558(%rbp), %rcx
imulq $0x18, %rcx, %rdx
movq %rax, %rcx
addq %rdx, %rcx
movq %rcx, -0x3568(%rbp)
movq %rax, -0x3560(%rbp)
movq -0x3560(%rbp), %rdi
movq %rdi, -0x3570(%rbp)
callq 0x2ad80
movq -0x3570(%rbp), %rax
movq -0x3568(%rbp), %rcx
addq $0x18, %rax
cmpq %rcx, %rax
movq %rax, -0x3560(%rbp)
jne 0x1d6c3
movq -0x3500(%rbp), %rax
movq -0x3550(%rbp), %rcx
movq %rcx, 0x88(%rax)
movslq 0x8(%rax), %rax
movq %rax, -0x3580(%rbp)
movl $0x18, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
addq $0x8, %rdi
setb %al
orb %al, %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x8040
movq %rax, %rcx
movq -0x3580(%rbp), %rax
movq %rax, (%rcx)
addq $0x8, %rcx
movq %rcx, -0x3578(%rbp)
cmpq $0x0, %rax
je 0x1d7b3
movq -0x3578(%rbp), %rax
movq -0x3580(%rbp), %rcx
imulq $0x18, %rcx, %rdx
movq %rax, %rcx
addq %rdx, %rcx
movq %rcx, -0x3590(%rbp)
movq %rax, -0x3588(%rbp)
movq -0x3588(%rbp), %rdi
movq %rdi, -0x3598(%rbp)
callq 0x2ad80
movq -0x3598(%rbp), %rax
movq -0x3590(%rbp), %rcx
addq $0x18, %rax
cmpq %rcx, %rax
movq %rax, -0x3588(%rbp)
jne 0x1d782
movq -0x3500(%rbp), %rax
movq -0x3578(%rbp), %rcx
movq %rcx, 0x108(%rax)
movslq 0x8(%rax), %rax
movq %rax, -0x35a8(%rbp)
movl $0x18, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
addq $0x8, %rdi
setb %al
orb %al, %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x8040
movq %rax, %rcx
movq -0x35a8(%rbp), %rax
movq %rax, (%rcx)
addq $0x8, %rcx
movq %rcx, -0x35a0(%rbp)
cmpq $0x0, %rax
je 0x1d872
movq -0x35a0(%rbp), %rax
movq -0x35a8(%rbp), %rcx
imulq $0x18, %rcx, %rdx
movq %rax, %rcx
addq %rdx, %rcx
movq %rcx, -0x35b8(%rbp)
movq %rax, -0x35b0(%rbp)
movq -0x35b0(%rbp), %rdi
movq %rdi, -0x35c0(%rbp)
callq 0x2ad80
movq -0x35c0(%rbp), %rax
movq -0x35b8(%rbp), %rcx
addq $0x18, %rax
cmpq %rcx, %rax
movq %rax, -0x35b0(%rbp)
jne 0x1d841
movq -0x3500(%rbp), %rax
movq -0x35a0(%rbp), %rcx
movq %rcx, 0x110(%rax)
movslq 0x8(%rax), %rax
movq %rax, -0x35d0(%rbp)
movl $0x18, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
addq $0x8, %rdi
setb %al
orb %al, %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x8040
movq %rax, %rcx
movq -0x35d0(%rbp), %rax
movq %rax, (%rcx)
addq $0x8, %rcx
movq %rcx, -0x35c8(%rbp)
cmpq $0x0, %rax
je 0x1d931
movq -0x35c8(%rbp), %rax
movq -0x35d0(%rbp), %rcx
imulq $0x18, %rcx, %rdx
movq %rax, %rcx
addq %rdx, %rcx
movq %rcx, -0x35e0(%rbp)
movq %rax, -0x35d8(%rbp)
movq -0x35d8(%rbp), %rdi
movq %rdi, -0x35e8(%rbp)
callq 0x2ad80
movq -0x35e8(%rbp), %rax
movq -0x35e0(%rbp), %rcx
addq $0x18, %rax
cmpq %rcx, %rax
movq %rax, -0x35d8(%rbp)
jne 0x1d900
movq -0x3500(%rbp), %rax
movq -0x35c8(%rbp), %rcx
movq %rcx, 0x118(%rax)
movslq -0x14(%rbp), %rax
movq %rax, -0x35f8(%rbp)
movl $0x18, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
addq $0x8, %rdi
setb %al
orb %al, %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x8040
movq %rax, %rcx
movq -0x35f8(%rbp), %rax
movq %rax, (%rcx)
addq $0x8, %rcx
movq %rcx, -0x35f0(%rbp)
cmpq $0x0, %rax
je 0x1d9f0
movq -0x35f0(%rbp), %rax
movq -0x35f8(%rbp), %rcx
imulq $0x18, %rcx, %rdx
movq %rax, %rcx
addq %rdx, %rcx
movq %rcx, -0x3608(%rbp)
movq %rax, -0x3600(%rbp)
movq -0x3600(%rbp), %rdi
movq %rdi, -0x3610(%rbp)
callq 0x2ada0
movq -0x3610(%rbp), %rax
movq -0x3608(%rbp), %rcx
addq $0x18, %rax
cmpq %rcx, %rax
movq %rax, -0x3600(%rbp)
jne 0x1d9bf
movq -0x3500(%rbp), %rax
movq -0x35f0(%rbp), %rcx
movq %rcx, 0x50(%rax)
movslq -0x14(%rbp), %rax
movq %rax, -0x3620(%rbp)
movl $0x18, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
addq $0x8, %rdi
setb %al
orb %al, %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x8040
movq %rax, %rcx
movq -0x3620(%rbp), %rax
movq %rax, (%rcx)
addq $0x8, %rcx
movq %rcx, -0x3618(%rbp)
cmpq $0x0, %rax
je 0x1daac
movq -0x3618(%rbp), %rax
movq -0x3620(%rbp), %rcx
imulq $0x18, %rcx, %rdx
movq %rax, %rcx
addq %rdx, %rcx
movq %rcx, -0x3630(%rbp)
movq %rax, -0x3628(%rbp)
movq -0x3628(%rbp), %rdi
movq %rdi, -0x3638(%rbp)
callq 0x2ada0
movq -0x3638(%rbp), %rax
movq -0x3630(%rbp), %rcx
addq $0x18, %rax
cmpq %rcx, %rax
movq %rax, -0x3628(%rbp)
jne 0x1da7b
movq -0x3500(%rbp), %rax
movq -0x3618(%rbp), %rcx
movq %rcx, 0x58(%rax)
movslq -0x14(%rbp), %rax
movq %rax, -0x3648(%rbp)
movl $0x18, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
addq $0x8, %rdi
setb %al
orb %al, %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x8040
movq %rax, %rcx
movq -0x3648(%rbp), %rax
movq %rax, (%rcx)
addq $0x8, %rcx
movq %rcx, -0x3640(%rbp)
cmpq $0x0, %rax
je 0x1db68
movq -0x3640(%rbp), %rax
movq -0x3648(%rbp), %rcx
imulq $0x18, %rcx, %rdx
movq %rax, %rcx
addq %rdx, %rcx
movq %rcx, -0x3658(%rbp)
movq %rax, -0x3650(%rbp)
movq -0x3650(%rbp), %rdi
movq %rdi, -0x3660(%rbp)
callq 0x2ada0
movq -0x3660(%rbp), %rax
movq -0x3658(%rbp), %rcx
addq $0x18, %rax
cmpq %rcx, %rax
movq %rax, -0x3650(%rbp)
jne 0x1db37
movq -0x3500(%rbp), %rax
movq -0x3640(%rbp), %rcx
movq %rcx, 0x60(%rax)
movslq -0x14(%rbp), %rax
movq %rax, -0x3670(%rbp)
movl $0x18, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
addq $0x8, %rdi
setb %al
orb %al, %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x8040
movq %rax, %rcx
movq -0x3670(%rbp), %rax
movq %rax, (%rcx)
addq $0x8, %rcx
movq %rcx, -0x3668(%rbp)
cmpq $0x0, %rax
je 0x1dc24
movq -0x3668(%rbp), %rax
movq -0x3670(%rbp), %rcx
imulq $0x18, %rcx, %rdx
movq %rax, %rcx
addq %rdx, %rcx
movq %rcx, -0x3680(%rbp)
movq %rax, -0x3678(%rbp)
movq -0x3678(%rbp), %rdi
movq %rdi, -0x3688(%rbp)
callq 0x2ada0
movq -0x3688(%rbp), %rax
movq -0x3680(%rbp), %rcx
addq $0x18, %rax
cmpq %rcx, %rax
movq %rax, -0x3678(%rbp)
jne 0x1dbf3
movq -0x3500(%rbp), %rax
movq -0x3508(%rbp), %rdi
movq -0x3668(%rbp), %rcx
movq %rcx, 0x68(%rax)
callq 0x81d0
movq %rax, %rsi
leaq 0x591e4(%rip), %rdi     # 0x76e30
xorl %eax, %eax
callq 0x8080
movq -0x3500(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x3698(%rbp)
leaq -0x2f71(%rbp), %rdi
movq %rdi, -0x3690(%rbp)
callq 0x8870
movq -0x3690(%rbp), %rdx
leaq 0x591d9(%rip), %rsi     # 0x76e5e
leaq -0x2f70(%rbp), %rdi
callq 0xcb30
jmp 0x1dc93
movq -0x3698(%rbp), %rsi
leaq -0x2f50(%rbp), %rdi
leaq -0x2f70(%rbp), %rdx
callq 0x1c190
jmp 0x1dcaf
leaq 0x5ac0e(%rip), %rsi     # 0x788c4
leaq -0x2f50(%rbp), %rdi
callq 0xcbe0
movb %al, -0x3699(%rbp)
jmp 0x1dcca
leaq -0x2f50(%rbp), %rdi
callq 0x82e0
leaq -0x2f70(%rbp), %rdi
callq 0x82e0
leaq -0x2f71(%rbp), %rdi
callq 0x8540
movb -0x3699(%rbp), %al
testb $0x1, %al
jne 0x1dcfa
jmp 0x1dd78
leaq 0x5916b(%rip), %rdi     # 0x76e6c
movb $0x0, %al
callq 0x8080
movq -0x3500(%rbp), %rax
movb $0x1, 0x70(%rax)
jmp 0x1dd83
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x2f80(%rbp)
movl %eax, -0x2f84(%rbp)
jmp 0x1dd67
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x2f80(%rbp)
movl %eax, -0x2f84(%rbp)
jmp 0x1dd5b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x2f80(%rbp)
movl %eax, -0x2f84(%rbp)
leaq -0x2f50(%rbp), %rdi
callq 0x82e0
leaq -0x2f70(%rbp), %rdi
callq 0x82e0
leaq -0x2f71(%rbp), %rdi
callq 0x8540
jmp 0x1f1a8
movq -0x3500(%rbp), %rax
movb $0x0, 0x70(%rax)
movq -0x3508(%rbp), %rsi
movq -0x3500(%rbp), %rdi
addq $0x10, %rdi
callq 0x8070
movq -0x3508(%rbp), %rdi
callq 0x81d0
movq %rax, %rdi
leaq 0x5b192(%rip), %rsi     # 0x78f42
callq 0x85e0
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x1ddfc
leaq 0x5955f(%rip), %rdi     # 0x77326
leaq 0x58e6c(%rip), %rsi     # 0x76c3a
movb $0x0, %al
callq 0x8080
movl $0x8, %edi
callq 0x8230
movq %rax, %rdi
leaq 0x58e6d(%rip), %rax     # 0x76c56
movq %rax, (%rdi)
movq 0x8c155(%rip), %rsi     # 0xa9f48
xorl %eax, %eax
movl %eax, %edx
callq 0x8820
movq $0x0, -0x3030(%rbp)
movq $-0x1, -0x3038(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x3040(%rbp)
leaq -0x2f30(%rbp), %rdi
movq -0x20(%rbp), %rdx
movl $0x2f10, %esi           # imm = 0x2F10
callq 0x8750
cmpq $0x0, %rax
je 0x1e4e4
movsbl -0x2f30(%rbp), %eax
cmpl $0x3a, %eax
jne 0x1e314
movsbl -0x2f2f(%rbp), %eax
cmpl $0x63, %eax
jne 0x1df4a
leaq -0x2f30(%rbp), %rdi
leaq 0x590af(%rip), %rsi     # 0x76f19
leaq -0x2f88(%rbp), %rdx
movb $0x0, %al
callq 0x8480
movq -0x3500(%rbp), %rcx
movl -0x2f88(%rbp), %eax
cmpl 0x8(%rcx), %eax
jg 0x1de93
cmpl $0x0, -0x2f88(%rbp)
jg 0x1deba
movl $0x8, %edi
callq 0x8230
movq %rax, %rdi
leaq 0x5907a(%rip), %rax     # 0x76f21
movq %rax, (%rdi)
movq 0x8c097(%rip), %rsi     # 0xa9f48
xorl %eax, %eax
movl %eax, %edx
callq 0x8820
cmpq $0x0, -0x3038(%rbp)
jle 0x1df15
movq -0x3500(%rbp), %rax
addq $0xf0, %rax
movq %rax, -0x36a8(%rbp)
cmpq $0x0, -0x3030(%rbp)
jne 0x1def2
leaq -0x3038(%rbp), %rax
movq %rax, -0x36b0(%rbp)
jmp 0x1df02
leaq -0x3030(%rbp), %rax
movq %rax, -0x36b0(%rbp)
jmp 0x1df02
movq -0x36a8(%rbp), %rdi
movq -0x36b0(%rbp), %rsi
callq 0x2adc0
movq $0x0, -0x3030(%rbp)
movq $-0x1, -0x3038(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x3040(%rbp)
movl -0x2f88(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x2f88(%rbp)
jmp 0x1de1d
leaq -0x2f30(%rbp), %rdi
leaq -0x2ff0(%rbp), %rdx
leaq 0x58ffa(%rip), %rsi     # 0x76f59
leaq -0x2ff8(%rbp), %rcx
movb $0x0, %al
callq 0x8480
leaq -0x2ff0(%rbp), %rdi
leaq 0x58fe7(%rip), %rsi     # 0x76f62
callq 0x86c0
cmpl $0x0, %eax
jne 0x1e055
movq -0x3500(%rbp), %rax
movsd -0x2ff8(%rbp), %xmm0
movq 0x30(%rax), %rax
movslq -0x2f88(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl $0x0, -0x3044(%rbp)
movl -0x3044(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x1e053
movl $0x10, %edi
callq 0x84c0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x36b8(%rbp)
movsd -0x2ff8(%rbp), %xmm0
callq 0x155c0
jmp 0x1dfe7
movq -0x3500(%rbp), %rax
movq -0x36b8(%rbp), %rcx
movq %rcx, -0x3050(%rbp)
movq 0x50(%rax), %rdi
movslq -0x3044(%rbp), %rax
imulq $0x18, %rax, %rax
addq %rax, %rdi
leaq -0x3050(%rbp), %rsi
callq 0x2ae30
movl -0x3044(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3044(%rbp)
jmp 0x1dfb2
movq -0x36b8(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x2f80(%rbp)
movl %eax, -0x2f84(%rbp)
movl $0x10, %esi
callq 0x84d0
jmp 0x1f1a8
jmp 0x1e055
leaq -0x2ff0(%rbp), %rdi
leaq 0x58f1e(%rip), %rsi     # 0x76f81
callq 0x86c0
cmpl $0x0, %eax
jne 0x1e13d
movq -0x3500(%rbp), %rax
movsd -0x2ff8(%rbp), %xmm0
movq 0x38(%rax), %rax
movslq -0x2f88(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl $0x0, -0x3054(%rbp)
movl -0x3054(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x1e13b
movl $0x10, %edi
callq 0x84c0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x36c0(%rbp)
movsd -0x2ff8(%rbp), %xmm0
callq 0x155c0
jmp 0x1e0cf
movq -0x3500(%rbp), %rax
movq -0x36c0(%rbp), %rcx
movq %rcx, -0x3060(%rbp)
movq 0x58(%rax), %rdi
movslq -0x3054(%rbp), %rax
imulq $0x18, %rax, %rax
addq %rax, %rdi
leaq -0x3060(%rbp), %rsi
callq 0x2ae30
movl -0x3054(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3054(%rbp)
jmp 0x1e09a
movq -0x36c0(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x2f80(%rbp)
movl %eax, -0x2f84(%rbp)
movl $0x10, %esi
callq 0x84d0
jmp 0x1f1a8
jmp 0x1e13d
leaq -0x2ff0(%rbp), %rdi
leaq 0x58e55(%rip), %rsi     # 0x76fa0
callq 0x86c0
cmpl $0x0, %eax
jne 0x1e225
movq -0x3500(%rbp), %rax
movsd -0x2ff8(%rbp), %xmm0
movq 0x40(%rax), %rax
movslq -0x2f88(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl $0x0, -0x3064(%rbp)
movl -0x3064(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x1e223
movl $0x10, %edi
callq 0x84c0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x36c8(%rbp)
movsd -0x2ff8(%rbp), %xmm0
callq 0x155c0
jmp 0x1e1b7
movq -0x3500(%rbp), %rax
movq -0x36c8(%rbp), %rcx
movq %rcx, -0x3070(%rbp)
movq 0x60(%rax), %rdi
movslq -0x3064(%rbp), %rax
imulq $0x18, %rax, %rax
addq %rax, %rdi
leaq -0x3070(%rbp), %rsi
callq 0x2ae30
movl -0x3064(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3064(%rbp)
jmp 0x1e182
movq -0x36c8(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x2f80(%rbp)
movl %eax, -0x2f84(%rbp)
movl $0x10, %esi
callq 0x84d0
jmp 0x1f1a8
jmp 0x1e225
leaq -0x2ff0(%rbp), %rdi
leaq 0x58d8e(%rip), %rsi     # 0x76fc1
callq 0x86c0
cmpl $0x0, %eax
jne 0x1e30d
movq -0x3500(%rbp), %rax
movsd -0x2ff8(%rbp), %xmm0
movq 0x48(%rax), %rax
movslq -0x2f88(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl $0x0, -0x3074(%rbp)
movl -0x3074(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x1e30b
movl $0x10, %edi
callq 0x84c0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x36d0(%rbp)
movsd -0x2ff8(%rbp), %xmm0
callq 0x155c0
jmp 0x1e29f
movq -0x3500(%rbp), %rax
movq -0x36d0(%rbp), %rcx
movq %rcx, -0x3080(%rbp)
movq 0x68(%rax), %rdi
movslq -0x3074(%rbp), %rax
imulq $0x18, %rax, %rax
addq %rax, %rdi
leaq -0x3080(%rbp), %rsi
callq 0x2ae30
movl -0x3074(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3074(%rbp)
jmp 0x1e26a
movq -0x36d0(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x2f80(%rbp)
movl %eax, -0x2f84(%rbp)
movl $0x10, %esi
callq 0x84d0
jmp 0x1f1a8
jmp 0x1e30d
jmp 0x1e30f
jmp 0x1de1d
movsbl -0x2f30(%rbp), %eax
cmpl $0x9, %eax
jne 0x1e325
jmp 0x1de1d
leaq -0x2f30(%rbp), %rdi
leaq 0x58caf(%rip), %rsi     # 0x76fe2
leaq -0x3000(%rbp), %rdx
leaq -0x3008(%rbp), %rcx
leaq -0x3010(%rbp), %r8
leaq -0x3018(%rbp), %r9
leaq -0x3020(%rbp), %r10
leaq -0x3028(%rbp), %rax
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
movb $0x0, %al
callq 0x8480
cmpl $0x6, %eax
je 0x1e377
jmp 0x1de1d
movq -0x3038(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x3038(%rbp)
movsd -0x3008(%rbp), %xmm1
movsd -0x3040(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x1e3e2
cmpq $0x0, -0x3030(%rbp)
je 0x1e3d0
movl $0x8, %edi
callq 0x8230
movq %rax, %rdi
leaq 0x58c65(%rip), %rax     # 0x77022
movq %rax, (%rdi)
movq 0x8bb81(%rip), %rsi     # 0xa9f48
xorl %eax, %eax
movl %eax, %edx
callq 0x8820
movq -0x3038(%rbp), %rax
subq $0x1, %rax
movq %rax, -0x3030(%rbp)
movq -0x3500(%rbp), %rax
movq 0x78(%rax), %rdi
movslq -0x2f88(%rbp), %rax
imulq $0x18, %rax, %rax
addq %rax, %rdi
leaq -0x3000(%rbp), %rsi
callq 0x2aea0
movq -0x3500(%rbp), %rax
movq 0x80(%rax), %rdi
movslq -0x2f88(%rbp), %rax
imulq $0x18, %rax, %rax
addq %rax, %rdi
leaq -0x3008(%rbp), %rsi
callq 0x2aea0
movq -0x3500(%rbp), %rax
movq 0x88(%rax), %rdi
movslq -0x2f88(%rbp), %rax
imulq $0x18, %rax, %rax
addq %rax, %rdi
leaq -0x3010(%rbp), %rsi
callq 0x2aea0
movq -0x3500(%rbp), %rax
movq 0x108(%rax), %rdi
movslq -0x2f88(%rbp), %rax
imulq $0x18, %rax, %rax
addq %rax, %rdi
leaq -0x3018(%rbp), %rsi
callq 0x2aea0
movq -0x3500(%rbp), %rax
movq 0x110(%rax), %rdi
movslq -0x2f88(%rbp), %rax
imulq $0x18, %rax, %rax
addq %rax, %rdi
leaq -0x3020(%rbp), %rsi
callq 0x2aea0
movq -0x3500(%rbp), %rax
movq 0x118(%rax), %rdi
movslq -0x2f88(%rbp), %rax
imulq $0x18, %rax, %rax
addq %rax, %rdi
leaq -0x3028(%rbp), %rsi
callq 0x2aea0
movsd -0x3008(%rbp), %xmm0
movsd %xmm0, -0x3040(%rbp)
jmp 0x1de1d
movq -0x3500(%rbp), %rax
movq 0x50(%rax), %rdi
callq 0x2af10
movq %rax, %rcx
movq -0x3500(%rbp), %rax
movq %rcx, -0x36d8(%rbp)
movq 0x58(%rax), %rdi
callq 0x2af10
movq %rax, %rcx
movq -0x36d8(%rbp), %rax
cmpq %rcx, %rax
jne 0x1e593
movq -0x3500(%rbp), %rax
movq 0x58(%rax), %rdi
callq 0x2af10
movq %rax, %rcx
movq -0x3500(%rbp), %rax
movq %rcx, -0x36e0(%rbp)
movq 0x60(%rax), %rdi
callq 0x2af10
movq %rax, %rcx
movq -0x36e0(%rbp), %rax
cmpq %rcx, %rax
jne 0x1e593
movq -0x3500(%rbp), %rax
movq 0x60(%rax), %rdi
callq 0x2af10
movq %rax, %rcx
movq -0x3500(%rbp), %rax
movq %rcx, -0x36e8(%rbp)
movq 0x68(%rax), %rdi
callq 0x2af10
movq %rax, %rcx
movq -0x36e8(%rbp), %rax
cmpq %rcx, %rax
je 0x1e635
movl $0x8, %edi
callq 0x8230
movq %rax, -0x36f8(%rbp)
movl $0x1, %edi
callq 0x84c0
movq %rax, -0x36f0(%rbp)
jmp 0x1e5b7
movq -0x36f0(%rbp), %rdi
leaq 0x58aa8(%rip), %rsi     # 0x7706d
callq 0x129a0
jmp 0x1e5cc
movq -0x36f8(%rbp), %rdi
movq -0x36f0(%rbp), %rax
movq %rax, (%rdi)
leaq 0x8b6e4(%rip), %rsi     # 0xa9cc8
xorl %eax, %eax
movl %eax, %edx
callq 0x8820
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x2f80(%rbp)
movl %eax, -0x2f84(%rbp)
jmp 0x1e624
movq -0x36f0(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x2f80(%rbp)
movl %eax, -0x2f84(%rbp)
movl $0x1, %esi
callq 0x84d0
movq -0x36f8(%rbp), %rdi
callq 0x8370
jmp 0x1f1a8
movq -0x3500(%rbp), %rax
addq $0xf0, %rax
movq %rax, -0x3700(%rbp)
cmpq $0x0, -0x3030(%rbp)
jne 0x1e663
leaq -0x3038(%rbp), %rax
movq %rax, -0x3708(%rbp)
jmp 0x1e673
leaq -0x3030(%rbp), %rax
movq %rax, -0x3708(%rbp)
jmp 0x1e673
movq -0x3700(%rbp), %rdi
movq -0x3708(%rbp), %rsi
callq 0x2adc0
movl $0x0, -0x3084(%rbp)
movq -0x3500(%rbp), %rcx
movl -0x3084(%rbp), %eax
cmpl 0x8(%rcx), %eax
jge 0x1f19f
movq -0x3500(%rbp), %rax
movq (%rax), %rax
movq (%rax), %rdi
movl -0x3084(%rbp), %esi
callq 0x1f1c0
movsd %xmm0, -0x3090(%rbp)
leaq -0x3138(%rbp), %rdi
callq 0x1f1e0
leaq -0x31e0(%rbp), %rdi
callq 0x1f1e0
jmp 0x1e6e0
leaq -0x3288(%rbp), %rdi
callq 0x1f1e0
jmp 0x1e6ee
leaq -0x3330(%rbp), %rdi
callq 0x1f1e0
jmp 0x1e6fc
movq -0x3500(%rbp), %rdi
movq 0x78(%rdi), %rax
movslq -0x3084(%rbp), %rsi
leaq (%rsi,%rsi,2), %rcx
leaq (%rax,%rcx,8), %rax
movq %rax, -0x3718(%rbp)
addq $0xf0, %rdi
callq 0x2af30
movq -0x3718(%rbp), %rdi
movq (%rax), %rsi
callq 0x2a7a0
movq %rax, -0x3710(%rbp)
jmp 0x1e741
movq -0x3710(%rbp), %rax
movsd (%rax), %xmm1
leaq -0x3138(%rbp), %rdi
xorps %xmm0, %xmm0
movl $0x1, %edx
xorl %ecx, %ecx
movl %edx, %esi
callq 0x1f270
jmp 0x1e766
movq -0x3500(%rbp), %rdi
movq 0x78(%rdi), %rax
movslq -0x3084(%rbp), %rsi
leaq (%rsi,%rsi,2), %rcx
leaq (%rax,%rcx,8), %rax
movq %rax, -0x3728(%rbp)
addq $0xf0, %rdi
callq 0x2af30
movq -0x3728(%rbp), %rdi
movq (%rax), %rsi
callq 0x2a7a0
movq %rax, -0x3720(%rbp)
jmp 0x1e7ab
movq -0x3720(%rbp), %rax
movsd (%rax), %xmm1
leaq -0x31e0(%rbp), %rdi
xorps %xmm0, %xmm0
movl $0x1, %edx
xorl %ecx, %ecx
movl %edx, %esi
callq 0x1f270
jmp 0x1e7d0
movq -0x3500(%rbp), %rdi
movq 0x78(%rdi), %rax
movslq -0x3084(%rbp), %rsi
leaq (%rsi,%rsi,2), %rcx
leaq (%rax,%rcx,8), %rax
movq %rax, -0x3738(%rbp)
addq $0xf0, %rdi
callq 0x2af30
movq -0x3738(%rbp), %rdi
movq (%rax), %rsi
callq 0x2a7a0
movq %rax, -0x3730(%rbp)
jmp 0x1e815
movq -0x3730(%rbp), %rax
movsd (%rax), %xmm0
movsd -0x3090(%rbp), %xmm1
leaq -0x3288(%rbp), %rdi
movl $0x1, %edx
xorl %ecx, %ecx
movl %edx, %esi
callq 0x1f270
jmp 0x1e83f
movq -0x3500(%rbp), %rdi
movq 0x78(%rdi), %rax
movslq -0x3084(%rbp), %rsi
leaq (%rsi,%rsi,2), %rcx
leaq (%rax,%rcx,8), %rax
movq %rax, -0x3748(%rbp)
addq $0xf0, %rdi
callq 0x2af30
movq -0x3748(%rbp), %rdi
movq (%rax), %rsi
callq 0x2a7a0
movq %rax, -0x3740(%rbp)
jmp 0x1e884
movq -0x3740(%rbp), %rax
movsd (%rax), %xmm0
movsd -0x3090(%rbp), %xmm1
leaq -0x3330(%rbp), %rdi
movl $0x1, %edx
xorl %ecx, %ecx
movl %edx, %esi
callq 0x1f270
jmp 0x1e8ae
movq -0x3500(%rbp), %rax
movq 0x78(%rax), %rax
movslq -0x3084(%rbp), %rcx
leaq (%rcx,%rcx,2), %rcx
leaq (%rax,%rcx,8), %rdi
callq 0x2a780
movq %rax, -0x3338(%rbp)
leaq -0x3350(%rbp), %rdi
movq %rdi, -0x3758(%rbp)
callq 0x2ad80
leaq -0x3368(%rbp), %rdi
callq 0x2ad80
leaq -0x3380(%rbp), %rdi
callq 0x2ad80
leaq -0x3398(%rbp), %rdi
callq 0x2ad80
leaq -0x33b0(%rbp), %rdi
callq 0x2ad80
leaq -0x33c8(%rbp), %rdi
callq 0x2ad80
movq -0x3500(%rbp), %rax
movq 0x78(%rax), %rax
movslq -0x3084(%rbp), %rcx
leaq (%rcx,%rcx,2), %rcx
leaq (%rax,%rcx,8), %rdi
callq 0x2a6e0
movq %rax, %rcx
movq -0x3500(%rbp), %rax
movq %rcx, -0x33d0(%rbp)
movq 0x78(%rax), %rax
movslq -0x3084(%rbp), %rcx
leaq (%rcx,%rcx,2), %rcx
leaq (%rax,%rcx,8), %rdi
callq 0x2a6e0
movq -0x3500(%rbp), %rdi
movq %rax, -0x33e8(%rbp)
addq $0xf0, %rdi
movslq -0x3084(%rbp), %rsi
callq 0x2af30
movq (%rax), %rsi
leaq -0x33e8(%rbp), %rdi
callq 0x2ac40
movq %rax, -0x33e0(%rbp)
leaq -0x33e0(%rbp), %rdi
movl $0x1, %esi
callq 0x2ac40
movq -0x3758(%rbp), %rdi
movq %rax, -0x33d8(%rbp)
callq 0x2afc0
movq %rax, -0x3750(%rbp)
jmp 0x1e9cf
movq -0x3750(%rbp), %rax
movq %rax, -0x33f0(%rbp)
movq -0x33d0(%rbp), %rdi
movq -0x33d8(%rbp), %rsi
movq -0x33f0(%rbp), %rdx
callq 0x2af50
movq %rax, -0x3760(%rbp)
jmp 0x1ea00
movq -0x3500(%rbp), %rax
movq -0x3760(%rbp), %rcx
movq %rcx, -0x33f8(%rbp)
movq 0x78(%rax), %rax
movslq -0x3084(%rbp), %rcx
leaq (%rcx,%rcx,2), %rcx
leaq (%rax,%rcx,8), %rdi
callq 0x2a6e0
movq -0x3500(%rbp), %rdi
movq %rax, -0x3410(%rbp)
addq $0xf0, %rdi
movslq -0x3084(%rbp), %rsi
callq 0x2af30
movq (%rax), %rsi
leaq -0x3410(%rbp), %rdi
callq 0x2ac40
movq %rax, -0x3408(%rbp)
leaq -0x3408(%rbp), %rdi
movl $0x1, %esi
callq 0x2ac40
movq %rax, %rcx
movq -0x3500(%rbp), %rax
movq %rcx, -0x3400(%rbp)
movq 0x78(%rax), %rax
movslq -0x3084(%rbp), %rcx
leaq (%rcx,%rcx,2), %rcx
leaq (%rax,%rcx,8), %rdi
callq 0x2a710
movq %rax, -0x3418(%rbp)
leaq -0x3368(%rbp), %rdi
callq 0x2afc0
movq %rax, -0x3768(%rbp)
jmp 0x1eaba
movq -0x3768(%rbp), %rax
movq %rax, -0x3420(%rbp)
movq -0x3400(%rbp), %rdi
movq -0x3418(%rbp), %rsi
movq -0x3420(%rbp), %rdx
callq 0x2af50
movq %rax, -0x3770(%rbp)
jmp 0x1eaeb
movq -0x3500(%rbp), %rax
movq -0x3770(%rbp), %rcx
movq %rcx, -0x3428(%rbp)
movq 0x80(%rax), %rax
movslq -0x3084(%rbp), %rcx
leaq (%rcx,%rcx,2), %rcx
leaq (%rax,%rcx,8), %rdi
callq 0x2a6e0
movq %rax, %rcx
movq -0x3500(%rbp), %rax
movq %rcx, -0x3430(%rbp)
movq 0x80(%rax), %rax
movslq -0x3084(%rbp), %rcx
leaq (%rcx,%rcx,2), %rcx
leaq (%rax,%rcx,8), %rdi
callq 0x2a6e0
movq -0x3500(%rbp), %rdi
movq %rax, -0x3448(%rbp)
addq $0xf0, %rdi
movslq -0x3084(%rbp), %rsi
callq 0x2af30
movq (%rax), %rsi
leaq -0x3448(%rbp), %rdi
callq 0x2ac40
movq %rax, -0x3440(%rbp)
leaq -0x3440(%rbp), %rdi
movl $0x1, %esi
callq 0x2ac40
movq %rax, -0x3438(%rbp)
leaq -0x3380(%rbp), %rdi
callq 0x2afc0
movq %rax, -0x3778(%rbp)
jmp 0x1ebab
movq -0x3778(%rbp), %rax
movq %rax, -0x3450(%rbp)
movq -0x3430(%rbp), %rdi
movq -0x3438(%rbp), %rsi
movq -0x3450(%rbp), %rdx
callq 0x2af50
movq %rax, -0x3780(%rbp)
jmp 0x1ebdc
movq -0x3500(%rbp), %rax
movq -0x3780(%rbp), %rcx
movq %rcx, -0x3458(%rbp)
movq 0x80(%rax), %rax
movslq -0x3084(%rbp), %rcx
leaq (%rcx,%rcx,2), %rcx
leaq (%rax,%rcx,8), %rdi
callq 0x2a6e0
movq -0x3500(%rbp), %rdi
movq %rax, -0x3470(%rbp)
addq $0xf0, %rdi
movslq -0x3084(%rbp), %rsi
callq 0x2af30
movq (%rax), %rsi
leaq -0x3470(%rbp), %rdi
callq 0x2ac40
movq %rax, -0x3468(%rbp)
leaq -0x3468(%rbp), %rdi
movl $0x1, %esi
callq 0x2ac40
movq %rax, %rcx
movq -0x3500(%rbp), %rax
movq %rcx, -0x3460(%rbp)
movq 0x80(%rax), %rax
movslq -0x3084(%rbp), %rcx
leaq (%rcx,%rcx,2), %rcx
leaq (%rax,%rcx,8), %rdi
callq 0x2a710
movq %rax, -0x3478(%rbp)
leaq -0x3398(%rbp), %rdi
callq 0x2afc0
movq %rax, -0x3788(%rbp)
jmp 0x1ec9c
movq -0x3788(%rbp), %rax
movq %rax, -0x3480(%rbp)
movq -0x3460(%rbp), %rdi
movq -0x3478(%rbp), %rsi
movq -0x3480(%rbp), %rdx
callq 0x2af50
movq %rax, -0x3790(%rbp)
jmp 0x1eccd
movq -0x3500(%rbp), %rax
movq -0x3790(%rbp), %rcx
movq %rcx, -0x3488(%rbp)
movq 0x88(%rax), %rax
movslq -0x3084(%rbp), %rcx
leaq (%rcx,%rcx,2), %rcx
leaq (%rax,%rcx,8), %rdi
callq 0x2a6e0
movq %rax, %rcx
movq -0x3500(%rbp), %rax
movq %rcx, -0x3490(%rbp)
movq 0x88(%rax), %rax
movslq -0x3084(%rbp), %rcx
leaq (%rcx,%rcx,2), %rcx
leaq (%rax,%rcx,8), %rdi
callq 0x2a6e0
movq -0x3500(%rbp), %rdi
movq %rax, -0x34a8(%rbp)
addq $0xf0, %rdi
movslq -0x3084(%rbp), %rsi
callq 0x2af30
movq (%rax), %rsi
leaq -0x34a8(%rbp), %rdi
callq 0x2ac40
movq %rax, -0x34a0(%rbp)
leaq -0x34a0(%rbp), %rdi
movl $0x1, %esi
callq 0x2ac40
movq %rax, -0x3498(%rbp)
leaq -0x33b0(%rbp), %rdi
callq 0x2afc0
movq %rax, -0x3798(%rbp)
jmp 0x1ed8d
movq -0x3798(%rbp), %rax
movq %rax, -0x34b0(%rbp)
movq -0x3490(%rbp), %rdi
movq -0x3498(%rbp), %rsi
movq -0x34b0(%rbp), %rdx
callq 0x2af50
movq %rax, -0x37a0(%rbp)
jmp 0x1edbe
movq -0x3500(%rbp), %rax
movq -0x37a0(%rbp), %rcx
movq %rcx, -0x34b8(%rbp)
movq 0x88(%rax), %rax
movslq -0x3084(%rbp), %rcx
leaq (%rcx,%rcx,2), %rcx
leaq (%rax,%rcx,8), %rdi
callq 0x2a6e0
movq -0x3500(%rbp), %rdi
movq %rax, -0x34d0(%rbp)
addq $0xf0, %rdi
movslq -0x3084(%rbp), %rsi
callq 0x2af30
movq (%rax), %rsi
leaq -0x34d0(%rbp), %rdi
callq 0x2ac40
movq %rax, -0x34c8(%rbp)
leaq -0x34c8(%rbp), %rdi
movl $0x1, %esi
callq 0x2ac40
movq %rax, %rcx
movq -0x3500(%rbp), %rax
movq %rcx, -0x34c0(%rbp)
movq 0x88(%rax), %rax
movslq -0x3084(%rbp), %rcx
leaq (%rcx,%rcx,2), %rcx
leaq (%rax,%rcx,8), %rdi
callq 0x2a710
movq %rax, -0x34d8(%rbp)
leaq -0x33c8(%rbp), %rdi
callq 0x2afc0
movq %rax, -0x37a8(%rbp)
jmp 0x1ee7e
movq -0x37a8(%rbp), %rax
movq %rax, -0x34e0(%rbp)
movq -0x34c0(%rbp), %rdi
movq -0x34d8(%rbp), %rsi
movq -0x34e0(%rbp), %rdx
callq 0x2af50
movq %rax, -0x37b0(%rbp)
jmp 0x1eeaf
movq -0x37b0(%rbp), %rax
movq %rax, -0x34e8(%rbp)
leaq -0x3350(%rbp), %rdi
callq 0x2a780
cmpq $0x2, %rax
jbe 0x1eff8
movq -0x3500(%rbp), %rdi
leaq -0x3380(%rbp), %rsi
leaq -0x33b0(%rbp), %rdx
leaq -0x3350(%rbp), %rcx
callq 0x1cff0
jmp 0x1eef6
leaq -0x3138(%rbp), %rdi
leaq -0x3380(%rbp), %rsi
leaq -0x3350(%rbp), %rdx
movl $0x1, %ecx
callq 0x1f310
jmp 0x1ef17
leaq -0x31e0(%rbp), %rdi
leaq -0x33b0(%rbp), %rsi
leaq -0x3350(%rbp), %rdx
movl $0x1, %ecx
callq 0x1f310
jmp 0x1ef38
jmp 0x1eff8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x2f80(%rbp)
movl %eax, -0x2f84(%rbp)
jmp 0x1f191
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x2f80(%rbp)
movl %eax, -0x2f84(%rbp)
jmp 0x1f185
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x2f80(%rbp)
movl %eax, -0x2f84(%rbp)
jmp 0x1f179
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x2f80(%rbp)
movl %eax, -0x2f84(%rbp)
jmp 0x1f16d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x2f80(%rbp)
movl %eax, -0x2f84(%rbp)
leaq -0x33c8(%rbp), %rdi
callq 0x2aff0
leaq -0x33b0(%rbp), %rdi
callq 0x2aff0
leaq -0x3398(%rbp), %rdi
callq 0x2aff0
leaq -0x3380(%rbp), %rdi
callq 0x2aff0
leaq -0x3368(%rbp), %rdi
callq 0x2aff0
leaq -0x3350(%rbp), %rdi
callq 0x2aff0
jmp 0x1f16d
leaq -0x3368(%rbp), %rdi
callq 0x2a780
cmpq $0x2, %rax
jbe 0x1f071
movq -0x3500(%rbp), %rdi
leaq -0x3398(%rbp), %rsi
leaq -0x33c8(%rbp), %rdx
leaq -0x3368(%rbp), %rcx
callq 0x1cff0
jmp 0x1f02d
leaq -0x3288(%rbp), %rdi
leaq -0x3398(%rbp), %rsi
leaq -0x3368(%rbp), %rdx
movl $0x1, %ecx
callq 0x1f310
jmp 0x1f04e
leaq -0x3330(%rbp), %rdi
leaq -0x33c8(%rbp), %rsi
leaq -0x3368(%rbp), %rdx
movl $0x1, %ecx
callq 0x1f310
jmp 0x1f06f
jmp 0x1f071
movq -0x3500(%rbp), %rdi
addq $0x90, %rdi
leaq -0x3138(%rbp), %rsi
callq 0x203f0
jmp 0x1f08d
movq -0x3500(%rbp), %rdi
addq $0xc0, %rdi
leaq -0x3288(%rbp), %rsi
callq 0x203f0
jmp 0x1f0a9
movq -0x3500(%rbp), %rdi
addq $0xa8, %rdi
leaq -0x31e0(%rbp), %rsi
callq 0x203f0
jmp 0x1f0c5
movq -0x3500(%rbp), %rdi
addq $0xd8, %rdi
leaq -0x3330(%rbp), %rsi
callq 0x203f0
jmp 0x1f0e1
leaq -0x33c8(%rbp), %rdi
callq 0x2aff0
leaq -0x33b0(%rbp), %rdi
callq 0x2aff0
leaq -0x3398(%rbp), %rdi
callq 0x2aff0
leaq -0x3380(%rbp), %rdi
callq 0x2aff0
leaq -0x3368(%rbp), %rdi
callq 0x2aff0
leaq -0x3350(%rbp), %rdi
callq 0x2aff0
leaq -0x3330(%rbp), %rdi
callq 0x20460
leaq -0x3288(%rbp), %rdi
callq 0x20460
leaq -0x31e0(%rbp), %rdi
callq 0x20460
leaq -0x3138(%rbp), %rdi
callq 0x20460
movl -0x3084(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3084(%rbp)
jmp 0x1e690
leaq -0x3330(%rbp), %rdi
callq 0x20460
leaq -0x3288(%rbp), %rdi
callq 0x20460
leaq -0x31e0(%rbp), %rdi
callq 0x20460
leaq -0x3138(%rbp), %rdi
callq 0x20460
jmp 0x1f1a8
addq $0x37c0, %rsp           # imm = 0x37C0
popq %rbp
retq
movq -0x2f80(%rbp), %rdi
callq 0x8860
nopw %cs:(%rax,%rax)