// File: /workspace/github_cpp_makefile_star2_O3/melop[P]admixem/Population.cpp
// Function: Population::Breed()
bool Population::Breed() {
	
	
	int nCurrGen = SimulConfig.GetCurrGen(); // tell what is the current generation
	bool bIgnoreGlobalRules = SimulConfig.pSexualSelConfig->IgnoreGlobalRules(nCurrGen); // is there special sexual selection rules for this generation?
	bool bIgnoreGlobalRulesNa = SimulConfig.pNaturalSelConfig->IgnoreGlobalRules(nCurrGen);
	double nSampleMate = SimulConfig.GetNumericConfig("SampleMate");
	string sOffSpringCountFunc = SimulConfig.GetConfig("kids_per_female_func");
	int nOffSpringCountFunc = (sOffSpringCountFunc=="Poisson")? 1:0; //1 - Poisson, 0- normal distribution with variance being 1/4 of mean

	if (_mpMales.size()==0 || _mpFemales.size()==0) {
		printf("Pop %s cannot breed because one of the sexes is 0...\n", _sPopName.c_str());
		this->_bBred = true;
		return false;
	}

	//Check if natural selection prob or sexual selection prob is zero, if so, no need to continue.
	list< pair< Parser *, int> > * pqParsers = SimulConfig.pNaturalSelConfig->GetFormulae(this->GetPopName());

	for (list< pair< Parser *, int> >::iterator itParser= pqParsers->begin(); itParser != pqParsers->end() ; ++itParser) {
		int nGen = itParser->second;
		if ((nGen ==-1 && !bIgnoreGlobalRules) || (bIgnoreGlobalRulesNa && nGen == nCurrGen) ) {
			if (itParser->first->IsZero) {
				this->_bBred = true;
				return true; //no need to continue since surviving prob is zero.
			}
		}
	}

	printf("Pop %s breeding...\n", _sPopName.c_str());
	int nNewOffSpringCount = 0;
	int nNumFemales = _mpFemales.size();
	
	vector< Poisson* > vOffSpringPoissonGen; 
	

	//set population level variables for freq dependent sexual selection:

	
	map< int, map<string , list< pair<Parser *, int> > > > * mppqParsers = SimulConfig.pSexualSelConfig->GetFormulaeAllCPUs();

	list< vector<string> > * pqvPopCourterSymbols = SimulConfig.pSexualSelConfig->GetFormulaSymbolStringsPopCourter( this->_sPopName);
	list< vector<string> > * pqvPopChooserSymbols = SimulConfig.pSexualSelConfig->GetFormulaSymbolStringsPopChooser( this->_sPopName);
	list< vector<string> > * pqvPopSymbols = SimulConfig.pSexualSelConfig->GetFormulaSymbolStringsPop( this->_sPopName);



	for(int nCPU=0;nCPU<nTotalCPUCore;nCPU++) { //set global current population parameters for all the CPUs

		list< pair< Parser *, int > > * pqParsers = &(*mppqParsers)[nCPU][this->_sPopName];
		list< vector<string> >::iterator itPopCourterSymbols= pqvPopCourterSymbols->begin();
		list< vector<string> >::iterator itPopChooserSymbols= pqvPopChooserSymbols->begin();
		list< vector<string> >::iterator itPopSymbols= pqvPopSymbols->begin();

		for (list< pair< Parser *, int > > ::iterator itParser= pqParsers->begin(); itParser != pqParsers->end() ; ++itParser) {
				vector<string> vSymbolsPopCourter = *itPopCourterSymbols;
				vector<string> vSymbolsPopChooser = *itPopChooserSymbols;
				vector<string> vSymbolsPop = *itPopSymbols;

				Parser * pParser = itParser->first;

				//Set courter symbol values
				for(vector<string>::iterator itSymbol=vSymbolsPop.begin();itSymbol!=vSymbolsPop.end();++itSymbol)
				{
					string sSymbol = (*itSymbol).substr(4);
					string sType = (*itSymbol).substr(0, 3); //either Avg or Std
					if (sType != "Avg" && sType != "Std") {
						throw new Exception("Population parameter type unknown!");
					}
					if (this->_mpSumPhenotype.find(sSymbol) == _mpSumPhenotype.end()) {
						throw new Exception("Unable to find population symbol");
					}
			
					pParser->symbols_[string("Pop_Avg_"+sSymbol)] = this->_mpSumPhenotype[sSymbol].first;
					pParser->symbols_[string("Pop_Std_"+sSymbol)] = this->_mpSumPhenotype[sSymbol].second;
					cout << "CPU:" << nCPU << "Pop_Avg_" << sSymbol.c_str() << "=" << this->_mpSumPhenotype[sSymbol].first << "\n";
					cout << "CPU:" << nCPU << "Pop_Std_" << sSymbol.c_str() << "=" << this->_mpSumPhenotype[sSymbol].second << "\n";
				}

				for(vector<string>::iterator itSymbol=vSymbolsPopCourter.begin();itSymbol!=vSymbolsPopCourter.end();++itSymbol)
				{
					string sSymbol = (*itSymbol).substr(4);
					string sType = (*itSymbol).substr(0, 3); //either Avg or Std
					if (sType != "Avg" && sType != "Std") {
						throw new Exception("Population parameter type unknown!");
					}
					if (this->_mpSumPhenotypeMale.find(sSymbol) == _mpSumPhenotypeMale.end()) {
						throw new Exception("Unable to find population symbol: male");
					}
			
					pParser->symbols_[string("PopCourter_Avg_"+sSymbol)] = this->_mpSumPhenotypeMale[sSymbol].first;
					pParser->symbols_[string("PopCourter_Std_"+sSymbol)] = this->_mpSumPhenotypeMale[sSymbol].second;
					cout << "CPU:" << nCPU << "PopCourter_Avg_" << sSymbol.c_str() << "=" << this->_mpSumPhenotypeMale[sSymbol].first << "\n";
					cout << "CPU:" << nCPU << "PopCourter_Std_" << sSymbol.c_str() << "=" << this->_mpSumPhenotypeMale[sSymbol].second << "\n";
				}

				for(vector<string>::iterator itSymbol=vSymbolsPopChooser.begin();itSymbol!=vSymbolsPopChooser.end();++itSymbol)
				{
					string sSymbol = (*itSymbol).substr(4);
					string sType = (*itSymbol).substr(0, 3); //either Avg or Std
					if (sType != "Avg" && sType != "Std") {
						throw new Exception("Population parameter type unknown!");
					}
					if (this->_mpSumPhenotypeFemale.find(sSymbol) == _mpSumPhenotypeFemale.end()) {
						throw new Exception("Unable to find population symbol: female");
					}
			
					pParser->symbols_[string("PopChooser_Avg_"+sSymbol)] = this->_mpSumPhenotypeFemale[sSymbol].first;
					pParser->symbols_[string("PopChooser_Std_"+sSymbol)] = this->_mpSumPhenotypeFemale[sSymbol].second;
					cout << "CPU:" << nCPU << "PopChooser_Avg_" << sSymbol.c_str() << "=" << this->_mpSumPhenotypeFemale[sSymbol].first << "\n";
					cout << "CPU:" << nCPU << "PopChooser_Std_" << sSymbol.c_str() << "=" << this->_mpSumPhenotypeFemale[sSymbol].second << "\n";


				}
			
				++itPopCourterSymbols;
				++itPopChooserSymbols;
				++itPopSymbols;
		}
	}

	//for (vector<Individual *>::iterator itFemale = _mpFemales.begin(); itFemale!= _mpFemales.end(); ++itFemale) {
	//enable omp. because this is random access, ideal for parallel
	std::set<int> stSampledFemales;//keep a list of the females already sampled so that they're not sampled twice.
	std::set<int> stExhaustedFemales; // a list of females without further gametes
	//int nExhaustedFemales=0;
	bool bCourterHandeled = false;
	int nMaxLoop = SimulConfig.GetNumericConfig("FemaleGiveBirthMaxIterations");
	nMaxLoop = (nMaxLoop==-1)? 1000:nMaxLoop; //do at most 20 loops.
	int nLoopCount = 0;
	int nSameAvgKidIterCount = 0;
	double nPrevKidPerFemale = -1.0;
	do 
	{
		nLoopCount++;
		if (nNewOffSpringCount >= this->_nPopMaxSize) {
			printf("Max Pop Size met.\n");
			break; //no need to continue;
		}
		//#pragma omp critical
		//{
			if (stSampledFemales.size() != 0) {
				stSampledFemales.clear();
			}
		//}
	double nAvgKidPerFemale = (double)(_nPopMaxSize - nNewOffSpringCount) / (double)nNumFemales; // average kid per female, given the number offsprings left to fill the pop
	vOffSpringPoissonGen.clear();
		
	if (nPrevKidPerFemale == nAvgKidPerFemale ) {
		//no addition;
		if (nSameAvgKidIterCount > nMaxLoop) {
			printf("No more breeding possible\n");
			break;
		} else {
			nSameAvgKidIterCount++;	
		}
	}
	nPrevKidPerFemale = nAvgKidPerFemale;
		
	for(int nCPU=0;nCPU<nTotalCPUCore;nCPU++) { //set global current population parameters for all the CPUs

		//initialize poisson generators for offspring numbers
		if (nOffSpringCountFunc == 1 ) {
			Poisson * OffSpPois = new Poisson(nAvgKidPerFemale);
			vOffSpringPoissonGen.push_back(OffSpPois);
		}
	}

	printf("AvgKidPerFemale: %f\n", nAvgKidPerFemale);

	#pragma omp parallel shared(bCourterHandeled, stExhaustedFemales, stSampledFemales, nNumFemales, nSampleMate, bIgnoreGlobalRules, nAvgKidPerFemale, bIgnoreGlobalRulesNa, nNewOffSpringCount) 
	//private(pFemale, nCourters, pCourter, vOffSprings, itOffSpring)
	{
	


	#pragma omp for 
		//reduction(+: nNewOffSpringCount) 
	for(int i=0;i<nNumFemales;i++) 
	{
		if (nNewOffSpringCount >= this->_nPopMaxSize || stExhaustedFemales.size() >= this->_mpFemales.size()) {
			continue; // first see if new pop already filled up by other threads. if so then do nothing.
		}
		
		#ifdef _OPENMP
		int nCPU = omp_get_thread_num();
			#ifdef DEBUG
			printf("CPU %d: %s : %d\n", nCPU, "SexSelFormulae # ", nCPU);
			#endif
		#else
			int nCPU = 0;
		#endif

		//Go over each female so that they can mate.
		int nRandFemaleInd=fnGetRandIndex(nNumFemales);
		bool bGetRandSuccess = true;
		
			while((stSampledFemales.find(nRandFemaleInd)!= stSampledFemales.end()) && (stExhaustedFemales.find(nRandFemaleInd) == stExhaustedFemales.end())) {
				nRandFemaleInd=fnGetRandIndex(nNumFemales);
				if (stExhaustedFemales.size() >= this->_mpFemales.size()) {
					bGetRandSuccess = false;
					break;
				}
			}
			if (bGetRandSuccess) {
				#pragma omp critical
				{
					stSampledFemales.insert(nRandFemaleInd);
				}
			}
		#ifdef DEBUG
		printf("CPU %d: Female Id: %d\n", nCPU, nRandFemaleInd);
		#endif
		if (!bGetRandSuccess) {
			continue;
		}

		Individual * pFemale = this->_mpFemales.at(nRandFemaleInd); //get random female

		if (pFemale->GetGameteNum() == 0) 
		{
				#pragma omp critical
				{
			
			
						stExhaustedFemales.insert(nRandFemaleInd); // this female cannot produce more offsprings.

				}
				continue; //if already no gamete then don't bother.
				//nExhaustedFemales++;
		}

		if (!bCourterHandeled) {
		int nCourters = (int)nSampleMate; //(int)NormalExt(nSampleMate , 1, 0, 100);

		
			for (int j=0;j<nCourters;j++) {
				#ifdef DEBUG
				printf("CPU %d: Breed::beforerandom\n", nCPU);
				printf("CPU %d: _mpMale.size() %d\n", nCPU, _mpMales.size());
				#endif
				
				Individual * pCourter = this->_mpMales.at(fnGetRandIndex(this->_mpMales.size() ));

				#ifdef DEBUG
				printf("CPU %d: Breed::afterrandom\n", nCPU);
				#endif
				//#pragma omp critical
				//{
					pFemale->HandleCourter(pCourter , bIgnoreGlobalRules);
				//}
				#ifdef DEBUG
				printf("CPU %d : Breed::aftercourterhandler\n", nCPU);
				#endif
			}
		}
		

		//After mating, get the offspring out!

		vector<Individual *> vOffSprings;

		int nTargetOffSpringCount =  round(NormalExt(nAvgKidPerFemale,nAvgKidPerFemale/4, 0,10000));

		if ( nOffSpringCountFunc == 1 ) { //use poisson distribution for offspring number
			#ifdef DEBUG
			printf("CPU %d : Getting Target offspring...\n", nCPU );
			#endif
			nTargetOffSpringCount = vOffSpringPoissonGen[nCPU]->Next();
			#ifdef DEBUG
			printf("CPU %d : Target offspring: %d\n", nCPU, nTargetOffSpringCount );
			#endif
		}
		//#pragma omp critical
		//{
		if (nTargetOffSpringCount == 0) {
			continue;
		}

		#ifdef DEBUG

		printf("CPU %d: Breed::GiveBirth before\n", nCPU);
		#endif
		
		pFemale->GiveBirth(vOffSprings, nTargetOffSpringCount, bIgnoreGlobalRulesNa); // to save memory, natural selection that isn't frequency dependent is carried out in the GiveBirth Function!
		
		#ifdef DEBUG

		printf("CPU %d: Breed::GiveBirth after\n", nCPU);
		#endif
		//}

		if (pFemale->GetGameteNum() == 0) 
		{
			#ifdef DEBUG

			printf("CPU %d: Exhausted female before\n", nCPU);
			#endif
			#pragma omp critical
			{
			
			
				stExhaustedFemales.insert(nRandFemaleInd); // this female cannot produce more offsprings.
				//nExhaustedFemales++;
			}

			#ifdef DEBUG
			printf("CPU %d: Exhausted female after\n", nCPU);
			#endif
		}

		#ifdef DEBUG
		printf("CPU %d: Start insert offspring\n", nCPU);
		#endif
		//#pragma omp critical
		//{
		for (vector<Individual *>::iterator itOffSpring = vOffSprings.begin(); itOffSpring!=vOffSprings.end(); ++itOffSpring) 
		{

			if (nNewOffSpringCount < this->_nPopMaxSize)
			{
				if ( (*itOffSpring)->GetSex() == Individual::Male) {

					//#pragma omp critical
						this->_mpvNewGenMales[nCPU].push_back(*itOffSpring);
					//}
				}
				else {
					//#pragma omp critical
					//{
						this->_mpvNewGenFemales[nCPU].push_back(*itOffSpring);
					//}
				}
				#pragma omp critical
				{
					nNewOffSpringCount++;
				}
			}
			else {

				printf("No need to insert more offsprings, break;\n");
				break; // no need to do anything more, already exceeded limit;
			}
		}

		//} // end omp
		#ifdef DEBUG
		printf("CPU %d: end insert offspring\n", nCPU);
		#endif

	}

		
	} //end parallel block

	bCourterHandeled = true;
		
		for(int nCPU=0;nCPU<nTotalCPUCore;nCPU++) { //set global current population parameters for all the CPUs
			//delete poisson generators for offspring numbers
			if (nOffSpringCountFunc == 1 ) {
				#ifdef DEBUG
				printf("CPU %d: Realease poisson generator\n", nCPU);
				#endif
				delete vOffSpringPoissonGen[nCPU];
				vOffSpringPoissonGen[nCPU] = NULL;
			}
		}


	} // end do block
	while( (nLoopCount <= nMaxLoop) && (nNewOffSpringCount < this->_nPopMaxSize) && (stExhaustedFemales.size() < this->_mpFemales.size()) ) ; //end do while block.
	/* needs more work
	int nExcessOffsprings = nNewOffSpringCount - this->_nPopMaxSize;
	int nExcessMales = nExcessOffsprings / 2;
	int nExcessFemales = nExcessOffsprings - nExcessMales;
	int nDeletedMales = 0;
	int nDeletedFemales = 0;
	
	if (nExcessOffsprings > 0) {
		printf("Delete %d extra males and %d females (total %d)\n", nExcessMales,  nExcessFemales, nExcessOffsprings);	
	}
	
		for(int nCPU=0;nCPU<nTotalCPUCore;nCPU++) { //set global current population parameters for all the CPUs

			if (nDeletedMales < nExcessMales && (!this->_mpvNewGenMales[nCPU].empty())) {
				Individual *pToDelete = (this->_mpvNewGenMales[nCPU].back());
				this->_mpvNewGenMales[nCPU].pop_back();
				delete pToDelete;
				nDeletedMales++;
			}
                        if (nDeletedFemales < nExcessFemales && (!this->_mpvNewGenFemales[nCPU].empty())) {
                                Individual *pToDelete = (this->_mpvNewGenFemales[nCPU].back());
                                this->_mpvNewGenFemales[nCPU].pop_back();
				delete pToDelete;
                                nDeletedFemales++;
                        }
		}
	*/
	
	this->_bBred = true; //set flag
	return true;

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x298, %rsp            # imm = 0x298
movq %rdi, 0x8(%rsp)
leaq 0x1e2a7(%rip), %rbx     # 0x48908
movq %rbx, %rdi
callq 0x199ca
movl %eax, %ebp
movq 0x28(%rbx), %rdi
movl %eax, %esi
callq 0x1796e
movb %al, 0x3(%rsp)
movq 0x20(%rbx), %rdi
movl %ebp, %esi
callq 0x15c6e
movb %al, 0x2(%rsp)
leaq 0x288(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0xc258(%rip), %rsi      # 0x368f4
leaq 0xc25b(%rip), %rdx      # 0x368fe
leaq 0x278(%rsp), %r14
movq %r14, %rdi
callq 0xa91c
movq %rbx, %rdi
movq %r14, %rsi
callq 0x19708
movsd %xmm0, 0x130(%rsp)
movq 0x278(%rsp), %rdi
cmpq %r15, %rdi
je 0x2a6e4
movq 0x288(%rsp), %rsi
incq %rsi
callq 0x7390
leaq 0x248(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0xc208(%rip), %rsi      # 0x368ff
leaq 0xc215(%rip), %rdx      # 0x36913
leaq 0x238(%rsp), %rdi
callq 0xa91c
movq 0x8(%rsp), %r15
leaq 0x1e1f1(%rip), %rbx     # 0x48908
leaq 0x258(%rsp), %rdi
leaq 0x238(%rsp), %rdx
movq %rbx, %rsi
callq 0x1023e
movq 0x238(%rsp), %rdi
cmpq %r14, %rdi
je 0x2a74c
movq 0x248(%rsp), %rsi
incq %rsi
callq 0x7390
leaq 0xa1e9(%rip), %rsi      # 0x3493c
leaq 0x258(%rsp), %rdi
callq 0x7100
movl %eax, 0x64(%rsp)
movq 0x50(%r15), %rax
cmpq 0x48(%r15), %rax
je 0x2ba80
movq 0x68(%r15), %rax
cmpq 0x60(%r15), %rax
je 0x2ba80
movq 0x20(%rbx), %r14
movq %r15, %rax
leaq 0x228(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq 0x218(%rsp), %rdi
callq 0xa9b2
leaq 0x218(%rsp), %rsi
movq %r14, %rdi
callq 0x15cb6
movq %rax, %r14
movq 0x218(%rsp), %rdi
cmpq %r15, %rdi
je 0x2a7da
movq 0x228(%rsp), %rsi
incq %rsi
callq 0x7390
movq (%r14), %rax
cmpq %r14, %rax
movq 0x8(%rsp), %r15
je 0x2a817
movl 0x18(%rax), %edx
cmpl $-0x1, %edx
setne %cl
cmpl %ebp, %edx
sete %dl
testb %dl, 0x2(%rsp)
jne 0x2a801
orb 0x3(%rsp), %cl
jne 0x2a80f
movq 0x10(%rax), %rcx
cmpb $0x1, 0x61(%rcx)
je 0x2ba9a
movq (%rax), %rax
cmpq %r14, %rax
jne 0x2a7e7
movq (%r15), %rsi
leaq 0xc129(%rip), %rdi      # 0x3694a
xorl %eax, %eax
callq 0x7060
movq 0x68(%r15), %rax
subq 0x60(%r15), %rax
movq %rax, 0x58(%rsp)
xorpd %xmm0, %xmm0
movapd %xmm0, 0x80(%rsp)
movq $0x0, 0x90(%rsp)
movq 0x28(%rbx), %rdi
callq 0x179f0
movq %rax, 0x150(%rsp)
movq %r15, %rax
movq 0x28(%rbx), %r14
leaq 0x208(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq 0x1f8(%rsp), %rdi
callq 0xa9b2
leaq 0x1f8(%rsp), %rsi
movq %r14, %rdi
callq 0x17a1a
movq %rax, 0x148(%rsp)
movq 0x1f8(%rsp), %rdi
cmpq %r15, %rdi
je 0x2a8be
movq 0x208(%rsp), %rsi
incq %rsi
callq 0x7390
movq 0x28(%rbx), %r14
leaq 0x1e8(%rsp), %r15
movq %r15, -0x10(%r15)
movq 0x8(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq 0x1d8(%rsp), %rdi
callq 0xa9b2
leaq 0x1d8(%rsp), %rsi
movq %r14, %rdi
callq 0x17a26
movq %rax, 0x140(%rsp)
movq 0x1d8(%rsp), %rdi
cmpq %r15, %rdi
je 0x2a91f
movq 0x1e8(%rsp), %rsi
incq %rsi
callq 0x7390
movq 0x28(%rbx), %rbx
leaq 0x1c8(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x8(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq 0x1b8(%rsp), %rdi
callq 0xa9b2
leaq 0x1b8(%rsp), %rsi
movq %rbx, %rdi
callq 0x17a0e
movq %rax, 0x138(%rsp)
movq 0x1b8(%rsp), %rdi
cmpq %r14, %rdi
je 0x2a980
movq 0x1c8(%rsp), %rsi
incq %rsi
callq 0x7390
movl $0x0, 0x4(%rsp)
leaq 0x1da2d(%rip), %rax     # 0x483bc
cmpl $0x0, (%rax)
jle 0x2b4ca
movq 0x8(%rsp), %rax
leaq 0xb8(%rax), %rcx
movq %rcx, 0x18(%rsp)
leaq 0xc0(%rax), %rcx
movq %rcx, 0xd8(%rsp)
leaq 0xe8(%rax), %rcx
movq %rcx, 0x40(%rsp)
leaq 0xf0(%rax), %rcx
movq %rcx, 0xd0(%rsp)
leaq 0x118(%rax), %rcx
movq %rcx, 0x50(%rsp)
addq $0x120, %rax            # imm = 0x120
movq %rax, 0x128(%rsp)
leaq 0x68(%rsp), %rbx
leaq 0xa0(%rsp), %r15
movq 0x1d58f(%rip), %r12     # 0x47f90
movq 0x150(%rsp), %rdi
leaq 0x4(%rsp), %rsi
callq 0x1a7a0
movq %rax, %rdi
movq 0x8(%rsp), %rsi
callq 0x1a806
movq %rax, %rcx
movq (%rax), %rax
movq %rax, 0x120(%rsp)
cmpq %rcx, %rax
je 0x2b4b1
movq 0x138(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x110(%rsp)
movq 0x140(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x118(%rsp)
movq 0x148(%rsp), %rax
movq (%rax), %r14
movq %rcx, 0x158(%rsp)
movq %r14, 0x160(%rsp)
leaq 0x10(%r14), %rsi
movq %rbx, %rdi
callq 0x2024e
movq 0x118(%rsp), %rax
leaq 0x10(%rax), %rsi
leaq 0x180(%rsp), %rdi
callq 0x2024e
movq 0x110(%rsp), %rax
leaq 0x10(%rax), %rsi
leaq 0x168(%rsp), %rdi
callq 0x2024e
movq 0x120(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x48(%rsp)
movq 0x168(%rsp), %r13
cmpq 0x170(%rsp), %r13
je 0x2adf0
movq 0x48(%rsp), %rax
leaq 0x68(%rax), %r14
movl $0x4, %edx
movq %r15, %rdi
movq %r13, %rsi
movq $-0x1, %rcx
callq 0x73c0
movl $0x3, %ecx
leaq 0xe0(%rsp), %rbx
movq %rbx, %rdi
movq %r13, %rsi
xorl %edx, %edx
callq 0x73c0
movq %rbx, %rdi
leaq 0xb3b5(%rip), %rsi      # 0x35ed6
callq 0x7100
testl %eax, %eax
je 0x2ab41
movq %rbx, %rdi
leaq 0xb3a6(%rip), %rsi      # 0x35eda
callq 0x7100
testl %eax, %eax
jne 0x2bbb3
movq 0x18(%rsp), %rdi
movq %r15, %rsi
callq 0x27446
cmpq 0xd8(%rsp), %rax
je 0x2bb29
movq 0x18(%rsp), %rdi
movq %r15, %rsi
callq 0x26884
movsd (%rax), %xmm0
movsd %xmm0, 0x10(%rsp)
leaq 0x20(%rsp), %rbx
movq %rbx, %rdi
leaq 0xbdff(%rip), %rsi      # 0x36981
movq %r15, %rdx
callq 0x9a1b
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1b47a
movsd 0x10(%rsp), %xmm0
movsd %xmm0, (%rax)
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x2abbb
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x7390
movq 0x18(%rsp), %rdi
movq %r15, %rsi
callq 0x26884
movsd 0x8(%rax), %xmm0
movsd %xmm0, 0x10(%rsp)
leaq 0x20(%rsp), %rbx
movq %rbx, %rdi
leaq 0xbda8(%rip), %rsi      # 0x3698a
movq %r15, %rdx
callq 0x9a1b
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1b47a
movsd 0x10(%rsp), %xmm0
movsd %xmm0, (%rax)
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x2ac1b
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x7390
movl $0x4, %edx
movq %r12, %rdi
leaq 0xbd69(%rip), %rsi      # 0x36993
callq 0x7400
movl 0x4(%rsp), %esi
movq %r12, %rdi
callq 0x7670
movq %rax, %rbp
movl $0x8, %edx
movq %rax, %rdi
leaq 0xbd34(%rip), %rsi      # 0x36981
callq 0x7400
movq 0xa0(%rsp), %rbx
testq %rbx, %rbx
je 0x2ac77
movq %rbx, %rdi
callq 0x7170
movq %rbp, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x7400
jmp 0x2ac91
movq (%rbp), %rax
movq -0x18(%rax), %rax
movq %rbp, %rdi
addq %rax, %rdi
movl 0x20(%rbp,%rax), %esi
orl $0x1, %esi
callq 0x7640
movl $0x1, %edx
movq %rbp, %rdi
leaq 0xb8fd(%rip), %rsi      # 0x3659d
callq 0x7400
movq 0x18(%rsp), %rdi
movq %r15, %rsi
callq 0x26884
movsd (%rax), %xmm0
movq %rbp, %rdi
callq 0x75c0
movl $0x1, %edx
movq %rax, %rdi
leaq 0xa2ca(%rip), %rsi      # 0x34f97
callq 0x7400
movl $0x4, %edx
movq %r12, %rdi
leaq 0xbcb2(%rip), %rsi      # 0x36993
callq 0x7400
movl 0x4(%rsp), %esi
movq %r12, %rdi
callq 0x7670
movq %rax, %rbp
movl $0x8, %edx
movq %rax, %rdi
leaq 0xbc86(%rip), %rsi      # 0x3698a
callq 0x7400
movq 0xa0(%rsp), %rbx
testq %rbx, %rbx
je 0x2ad33
movq %rbx, %rdi
callq 0x7170
movq %rbp, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x7400
leaq 0x68(%rsp), %rbx
jmp 0x2ad52
movq (%rbp), %rax
movq -0x18(%rax), %rax
movq %rbp, %rdi
addq %rax, %rdi
movl 0x20(%rbp,%rax), %esi
orl $0x1, %esi
callq 0x7640
leaq 0x68(%rsp), %rbx
movl $0x1, %edx
movq %rbp, %rdi
leaq 0xb83c(%rip), %rsi      # 0x3659d
callq 0x7400
movq 0x18(%rsp), %rdi
movq %r15, %rsi
callq 0x26884
movsd 0x8(%rax), %xmm0
movq %rbp, %rdi
callq 0x75c0
movl $0x1, %edx
movq %rax, %rdi
leaq 0xa208(%rip), %rsi      # 0x34f97
callq 0x7400
movq 0xe0(%rsp), %rdi
leaq 0xf0(%rsp), %rax
cmpq %rax, %rdi
je 0x2adb9
movq 0xf0(%rsp), %rsi
incq %rsi
callq 0x7390
movq 0xa0(%rsp), %rdi
leaq 0xb0(%rsp), %rax
cmpq %rax, %rdi
je 0x2adde
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x7390
addq $0x20, %r13
cmpq 0x170(%rsp), %r13
jne 0x2aae6
movq 0x68(%rsp), %r13
cmpq 0x70(%rsp), %r13
je 0x2b110
movq 0x48(%rsp), %rax
leaq 0x68(%rax), %r14
movl $0x4, %edx
movq %r15, %rdi
movq %r13, %rsi
movq $-0x1, %rcx
callq 0x73c0
movl $0x3, %ecx
leaq 0xe0(%rsp), %rbx
movq %rbx, %rdi
movq %r13, %rsi
xorl %edx, %edx
callq 0x73c0
movq %rbx, %rdi
leaq 0xb092(%rip), %rsi      # 0x35ed6
callq 0x7100
testl %eax, %eax
je 0x2ae64
movq %rbx, %rdi
leaq 0xb083(%rip), %rsi      # 0x35eda
callq 0x7100
testl %eax, %eax
jne 0x2bbf0
movq 0x40(%rsp), %rdi
movq %r15, %rsi
callq 0x27446
cmpq 0xd0(%rsp), %rax
je 0x2bb57
movq 0x40(%rsp), %rdi
movq %r15, %rsi
callq 0x26884
movsd (%rax), %xmm0
movsd %xmm0, 0x10(%rsp)
leaq 0x20(%rsp), %rbx
movq %rbx, %rdi
leaq 0xbb1a(%rip), %rsi      # 0x369bf
movq %r15, %rdx
callq 0x9a1b
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1b47a
movsd 0x10(%rsp), %xmm0
movsd %xmm0, (%rax)
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x2aede
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x7390
movq 0x40(%rsp), %rdi
movq %r15, %rsi
callq 0x26884
movsd 0x8(%rax), %xmm0
movsd %xmm0, 0x10(%rsp)
leaq 0x20(%rsp), %rbx
movq %rbx, %rdi
leaq 0xbaca(%rip), %rsi      # 0x369cf
movq %r15, %rdx
callq 0x9a1b
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1b47a
movsd 0x10(%rsp), %xmm0
movsd %xmm0, (%rax)
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x2af3e
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x7390
movl $0x4, %edx
movq %r12, %rdi
leaq 0xba46(%rip), %rsi      # 0x36993
callq 0x7400
movl 0x4(%rsp), %esi
movq %r12, %rdi
callq 0x7670
movq %rax, %rbp
movl $0xf, %edx
movq %rax, %rdi
leaq 0xba4f(%rip), %rsi      # 0x369bf
callq 0x7400
movq 0xa0(%rsp), %rbx
testq %rbx, %rbx
je 0x2af9a
movq %rbx, %rdi
callq 0x7170
movq %rbp, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x7400
jmp 0x2afb4
movq (%rbp), %rax
movq -0x18(%rax), %rax
movq %rbp, %rdi
addq %rax, %rdi
movl 0x20(%rbp,%rax), %esi
orl $0x1, %esi
callq 0x7640
movl $0x1, %edx
movq %rbp, %rdi
leaq 0xb5da(%rip), %rsi      # 0x3659d
callq 0x7400
movq 0x40(%rsp), %rdi
movq %r15, %rsi
callq 0x26884
movsd (%rax), %xmm0
movq %rbp, %rdi
callq 0x75c0
movl $0x1, %edx
movq %rax, %rdi
leaq 0x9fa7(%rip), %rsi      # 0x34f97
callq 0x7400
movl $0x4, %edx
movq %r12, %rdi
leaq 0xb98f(%rip), %rsi      # 0x36993
callq 0x7400
movl 0x4(%rsp), %esi
movq %r12, %rdi
callq 0x7670
movq %rax, %rbp
movl $0xf, %edx
movq %rax, %rdi
leaq 0xb9a8(%rip), %rsi      # 0x369cf
callq 0x7400
movq 0xa0(%rsp), %rbx
testq %rbx, %rbx
je 0x2b056
movq %rbx, %rdi
callq 0x7170
movq %rbp, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x7400
leaq 0x68(%rsp), %rbx
jmp 0x2b075
movq (%rbp), %rax
movq -0x18(%rax), %rax
movq %rbp, %rdi
addq %rax, %rdi
movl 0x20(%rbp,%rax), %esi
orl $0x1, %esi
callq 0x7640
leaq 0x68(%rsp), %rbx
movl $0x1, %edx
movq %rbp, %rdi
leaq 0xb519(%rip), %rsi      # 0x3659d
callq 0x7400
movq 0x40(%rsp), %rdi
movq %r15, %rsi
callq 0x26884
movsd 0x8(%rax), %xmm0
movq %rbp, %rdi
callq 0x75c0
movl $0x1, %edx
movq %rax, %rdi
leaq 0x9ee5(%rip), %rsi      # 0x34f97
callq 0x7400
movq 0xe0(%rsp), %rdi
leaq 0xf0(%rsp), %rax
cmpq %rax, %rdi
je 0x2b0dc
movq 0xf0(%rsp), %rsi
incq %rsi
callq 0x7390
movq 0xa0(%rsp), %rdi
leaq 0xb0(%rsp), %rax
cmpq %rax, %rdi
je 0x2b101
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x7390
addq $0x20, %r13
cmpq 0x70(%rsp), %r13
jne 0x2ae09
movq 0x180(%rsp), %r13
cmpq 0x188(%rsp), %r13
je 0x2b43a
addq $0x68, 0x48(%rsp)
movl $0x4, %edx
movq %r15, %rdi
movq %r13, %rsi
movq $-0x1, %rcx
callq 0x73c0
movl $0x3, %ecx
leaq 0xe0(%rsp), %rbx
movq %rbx, %rdi
movq %r13, %rsi
xorl %edx, %edx
callq 0x73c0
movq %rbx, %rdi
leaq 0xad6f(%rip), %rsi      # 0x35ed6
callq 0x7100
testl %eax, %eax
je 0x2b187
movq %rbx, %rdi
leaq 0xad60(%rip), %rsi      # 0x35eda
callq 0x7100
testl %eax, %eax
jne 0x2bc2d
movq 0x50(%rsp), %rdi
movq %r15, %rsi
callq 0x27446
cmpq 0x128(%rsp), %rax
je 0x2bb85
movq 0x50(%rsp), %rdi
movq %r15, %rsi
callq 0x26884
movsd (%rax), %xmm0
movsd %xmm0, 0x10(%rsp)
leaq 0x20(%rsp), %rbx
movq %rbx, %rdi
leaq 0xb840(%rip), %rsi      # 0x36a08
movq %r15, %rdx
callq 0x9a1b
movq 0x48(%rsp), %rdi
movq %rbx, %rsi
callq 0x1b47a
movsd 0x10(%rsp), %xmm0
movsd %xmm0, (%rax)
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x2b203
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x7390
movq 0x50(%rsp), %rdi
movq %r15, %rsi
callq 0x26884
movsd 0x8(%rax), %xmm0
movsd %xmm0, 0x10(%rsp)
leaq 0x20(%rsp), %rbx
movq %rbx, %rdi
leaq 0xb7ee(%rip), %rsi      # 0x36a18
movq %r15, %rdx
callq 0x9a1b
movq 0x48(%rsp), %rdi
movq %rbx, %rsi
callq 0x1b47a
movsd 0x10(%rsp), %xmm0
movsd %xmm0, (%rax)
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x2b265
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x7390
movl $0x4, %edx
movq %r12, %rdi
leaq 0xb71f(%rip), %rsi      # 0x36993
callq 0x7400
movl 0x4(%rsp), %esi
movq %r12, %rdi
callq 0x7670
movq %rax, %r14
movl $0xf, %edx
movq %rax, %rdi
leaq 0xb771(%rip), %rsi      # 0x36a08
callq 0x7400
movq 0xa0(%rsp), %rbx
testq %rbx, %rbx
je 0x2b2c1
movq %rbx, %rdi
callq 0x7170
movq %r14, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x7400
jmp 0x2b2db
movq (%r14), %rax
movq -0x18(%rax), %rax
movq %r14, %rdi
addq %rax, %rdi
movl 0x20(%r14,%rax), %esi
orl $0x1, %esi
callq 0x7640
movl $0x1, %edx
movq %r14, %rdi
leaq 0xb2b3(%rip), %rsi      # 0x3659d
callq 0x7400
movq 0x50(%rsp), %rdi
movq %r15, %rsi
callq 0x26884
movsd (%rax), %xmm0
movq %r14, %rdi
callq 0x75c0
movl $0x1, %edx
movq %rax, %rdi
leaq 0x9c80(%rip), %rsi      # 0x34f97
callq 0x7400
movl $0x4, %edx
movq %r12, %rdi
leaq 0xb668(%rip), %rsi      # 0x36993
callq 0x7400
movl 0x4(%rsp), %esi
movq %r12, %rdi
callq 0x7670
movq %rax, %r14
movl $0xf, %edx
movq %rax, %rdi
leaq 0xb6ca(%rip), %rsi      # 0x36a18
callq 0x7400
movq 0xa0(%rsp), %rbx
testq %rbx, %rbx
je 0x2b37d
movq %rbx, %rdi
callq 0x7170
movq %r14, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x7400
leaq 0x68(%rsp), %rbx
jmp 0x2b39c
movq (%r14), %rax
movq -0x18(%rax), %rax
movq %r14, %rdi
addq %rax, %rdi
movl 0x20(%r14,%rax), %esi
orl $0x1, %esi
callq 0x7640
leaq 0x68(%rsp), %rbx
movl $0x1, %edx
movq %r14, %rdi
leaq 0xb1f2(%rip), %rsi      # 0x3659d
callq 0x7400
movq 0x50(%rsp), %rdi
movq %r15, %rsi
callq 0x26884
movsd 0x8(%rax), %xmm0
movq %r14, %rdi
callq 0x75c0
movl $0x1, %edx
movq %rax, %rdi
leaq 0x9bbe(%rip), %rsi      # 0x34f97
callq 0x7400
movq 0xe0(%rsp), %rdi
leaq 0xf0(%rsp), %rax
cmpq %rax, %rdi
je 0x2b403
movq 0xf0(%rsp), %rsi
incq %rsi
callq 0x7390
movq 0xa0(%rsp), %rdi
leaq 0xb0(%rsp), %rax
cmpq %rax, %rdi
je 0x2b428
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x7390
addq $0x20, %r13
cmpq 0x188(%rsp), %r13
jne 0x2b12c
movq 0x160(%rsp), %r14
movq (%r14), %r14
movq 0x118(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x118(%rsp)
movq 0x110(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x110(%rsp)
leaq 0x168(%rsp), %rdi
callq 0x1a6c6
leaq 0x180(%rsp), %rdi
callq 0x1a6c6
movq %rbx, %rdi
callq 0x1a6c6
movq 0x120(%rsp), %rax
movq (%rax), %rax
movq 0x158(%rsp), %rcx
movq %rax, 0x120(%rsp)
cmpq %rcx, %rax
jne 0x2aa70
movl 0x4(%rsp), %eax
incl %eax
movl %eax, 0x4(%rsp)
leaq 0x1cefa(%rip), %rcx     # 0x483bc
cmpl (%rcx), %eax
jl 0x2aa01
leaq 0xa8(%rsp), %rbx
xorl %eax, %eax
movl %eax, (%rbx)
movq %rax, 0x8(%rbx)
movq %rbx, 0x10(%rbx)
movq %rbx, 0x18(%rbx)
movq %rax, 0x20(%rbx)
leaq 0xe8(%rsp), %r14
movl %eax, (%r14)
movq %rax, 0x8(%r14)
movq %r14, 0x10(%r14)
movq %r14, 0x18(%r14)
movq %rax, 0x20(%r14)
leaq 0x1a8(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0xb514(%rip), %rsi      # 0x36a28
leaq 0xb529(%rip), %rdx      # 0x36a44
leaq 0x198(%rsp), %rdi
callq 0xa91c
leaq 0x1d3d9(%rip), %rdi     # 0x48908
leaq 0x198(%rsp), %rsi
callq 0x19708
shrq $0x3, 0x58(%rsp)
cvttsd2si %xmm0, %ebp
movq 0x198(%rsp), %rdi
cmpq %r15, %rdi
je 0x2b563
movq 0x1a8(%rsp), %rsi
incq %rsi
callq 0x7390
cmpl $-0x1, %ebp
movl $0x3e8, %eax            # imm = 0x3E8
cmovnel %ebp, %eax
movl %eax, 0xd8(%rsp)
xorps %xmm0, %xmm0
cvtsi2sdl 0x58(%rsp), %xmm0
movsd %xmm0, 0x128(%rsp)
cvttsd2si 0x130(%rsp), %eax
movl %eax, 0x10(%rsp)
movq 0x8(%rsp), %r15
movl 0x2c(%r15), %eax
movq $0x0, 0xd0(%rsp)
movsd 0x8e57(%rip), %xmm1     # 0x34408
movl $0x0, 0x48(%rsp)
movq $0x0, 0x40(%rsp)
xorl %r13d, %r13d
movl 0x64(%rsp), %ebp
cmpl %eax, %r13d
jge 0x2baa1
cmpq $0x0, 0xc8(%rsp)
je 0x2b5fa
leaq 0xa0(%rsp), %rdi
movsd %xmm1, 0x18(%rsp)
callq 0x2e4a0
movsd 0x18(%rsp), %xmm1
movl 0x2c(%r15), %eax
movq 0x80(%rsp), %rcx
cmpq %rcx, 0x88(%rsp)
je 0x2b614
movq %rcx, 0x88(%rsp)
subl %r13d, %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd 0x128(%rsp), %xmm0
movsd %xmm0, 0x18(%rsp)
ucomisd %xmm0, %xmm1
jne 0x2b654
jp 0x2b654
movq 0xd0(%rsp), %rax
cmpl 0xd8(%rsp), %eax
jg 0x2baaa
incl %eax
movq %rax, 0xd0(%rsp)
leaq 0x1cd61(%rip), %rax     # 0x483bc
movl (%rax), %eax
testl %eax, %eax
jle 0x2b6cb
xorl %r15d, %r15d
testl %ebp, %ebp
jne 0x2b6c3
movl $0x10, %edi
callq 0x7380
movq %rax, %r12
movq %rax, %rdi
movsd 0x18(%rsp), %xmm0
callq 0xd11e
movq %r12, 0x20(%rsp)
movq 0x88(%rsp), %rsi
cmpq 0x90(%rsp), %rsi
je 0x2b6a8
movq %r12, (%rsi)
addq $0x8, 0x88(%rsp)
jmp 0x2b6ba
leaq 0x80(%rsp), %rdi
leaq 0x20(%rsp), %rdx
callq 0x1cecc
leaq 0x1ccfb(%rip), %rax     # 0x483bc
movl (%rax), %eax
incl %r15d
cmpl %eax, %r15d
jl 0x2b664
leaq 0xb373(%rip), %rdi      # 0x36a45
movsd 0x18(%rsp), %xmm0
movb $0x1, %al
callq 0x7060
cmpl $0x0, 0x58(%rsp)
jle 0x2b9e9
cmpl $0x0, 0x10(%rsp)
setle %al
movsd 0x18(%rsp), %xmm0
mulsd 0xa918(%rip), %xmm0     # 0x36018
movsd %xmm0, 0x50(%rsp)
movq 0x40(%rsp), %rcx
orb %al, %cl
movq %rcx, 0x40(%rsp)
xorl %r15d, %r15d
movq 0x8(%rsp), %rcx
cmpl 0x2c(%rcx), %r13d
jge 0x2b9db
movq 0x68(%rcx), %rax
subq 0x60(%rcx), %rax
sarq $0x3, %rax
cmpq %rax, 0x108(%rsp)
jae 0x2b9db
movq 0x58(%rsp), %rdi
callq 0x296fa
movl %eax, 0x68(%rsp)
movq 0xb0(%rsp), %rdi
testq %rdi, %rdi
je 0x2b806
movq %rbx, %r8
movq %r8, %rcx
movq %rdi, %rdx
movl 0x20(%rdi), %esi
xorl %edi, %edi
cmpl %eax, %esi
setl %dil
movq %rdx, %r8
cmovlq %rcx, %r8
movq 0x10(%rdx,%rdi,8), %rdi
testq %rdi, %rdi
jne 0x2b760
cmpq %rbx, %r8
je 0x2b806
cmpl %eax, %esi
cmovlq %rcx, %rdx
cmpl 0x20(%rdx), %eax
jl 0x2b806
movq 0xf0(%rsp), %rdi
testq %rdi, %rdi
je 0x2b7d4
movq %r14, %r8
movq %r8, %rcx
movq %rdi, %rdx
movl 0x20(%rdi), %esi
xorl %edi, %edi
cmpl %eax, %esi
setl %dil
movq %rdx, %r8
cmovlq %rcx, %r8
movq 0x10(%rdx,%rdi,8), %rdi
testq %rdi, %rdi
jne 0x2b7a2
cmpq %r14, %r8
je 0x2b7d4
cmpl %eax, %esi
cmovlq %rcx, %rdx
cmpl 0x20(%rdx), %eax
jge 0x2b806
movq 0x58(%rsp), %rdi
callq 0x296fa
movl %eax, 0x68(%rsp)
movq 0x8(%rsp), %rdx
movq 0x68(%rdx), %rcx
subq 0x60(%rdx), %rcx
sarq $0x3, %rcx
cmpq %rcx, 0x108(%rsp)
jb 0x2b74c
jmp 0x2b9db
leaq 0xa0(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x202d8
movslq 0x68(%rsp), %rsi
movq 0x8(%rsp), %rcx
movq 0x60(%rcx), %rax
movq 0x68(%rcx), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq %rsi, %rdx
jbe 0x2bc78
movq (%rax,%rsi,8), %r12
movq %r12, %rdi
callq 0x25a4c
testl %eax, %eax
je 0x2b9a1
testb $0x1, 0x40(%rsp)
jne 0x2b8a4
movl 0x10(%rsp), %ebp
movq 0x8(%rsp), %rax
movq 0x50(%rax), %rdi
subq 0x48(%rax), %rdi
shrq $0x3, %rdi
callq 0x296fa
movslq %eax, %rsi
movq 0x8(%rsp), %rcx
movq 0x48(%rcx), %rax
movq 0x50(%rcx), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq %rsi, %rdx
jbe 0x2bc6a
movq (%rax,%rsi,8), %rsi
movzbl 0x3(%rsp), %edx
movq %r12, %rdi
callq 0x2435a
decl %ebp
jne 0x2b859
xorpd %xmm0, %xmm0
movapd %xmm0, 0x20(%rsp)
movq $0x0, 0x30(%rsp)
xorps %xmm2, %xmm2
movsd 0x18(%rsp), %xmm0
movsd 0x50(%rsp), %xmm1
movsd 0xafd2(%rip), %xmm3     # 0x368a0
callq 0x29650
movl 0x64(%rsp), %ebp
callq 0x29748
testl %ebp, %ebp
jne 0x2b8f0
movq 0x80(%rsp), %rax
movq (%rax), %rdi
movq (%rdi), %rax
callq *(%rax)
cvttsd2si %xmm0, %edx
testl %edx, %edx
je 0x2b9c1
movzbl 0x2(%rsp), %ecx
movq %r12, %rdi
leaq 0x20(%rsp), %rsi
callq 0x25a50
movq %r12, %rdi
callq 0x25a4c
testl %eax, %eax
jne 0x2b92c
leaq 0xe0(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x202d8
movq 0x20(%rsp), %r12
cmpq 0x28(%rsp), %r12
je 0x2b9c6
movq 0x8(%rsp), %rax
cmpl 0x2c(%rax), %r13d
jge 0x2b9b5
movq (%r12), %rdi
callq 0x23632
testl %eax, %eax
je 0x2b962
movq 0x8(%rsp), %rax
movq 0xb0(%rax), %rdi
jmp 0x2b96e
movq 0x8(%rsp), %rax
movq 0xa8(%rax), %rdi
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
je 0x2b989
addq $0x8, %rdi
movq (%r12), %rax
movq %rax, (%rsi)
addq $0x8, (%rdi)
jmp 0x2b991
movq %r12, %rdx
callq 0x2730a
incl %r13d
addq $0x8, %r12
cmpq 0x28(%rsp), %r12
jne 0x2b93c
jmp 0x2b9c1
leaq 0xe0(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x202d8
jmp 0x2b9db
leaq 0xb1f1(%rip), %rdi      # 0x36bad
callq 0x7560
movq 0x20(%rsp), %r12
testq %r12, %r12
je 0x2b9db
movq 0x30(%rsp), %rsi
subq %r12, %rsi
movq %r12, %rdi
callq 0x7390
incl %r15d
cmpl 0x58(%rsp), %r15d
jne 0x2b715
leaq 0x1c9cc(%rip), %rax     # 0x483bc
movl (%rax), %eax
testl %eax, %eax
jle 0x2ba38
xorl %r15d, %r15d
testl %ebp, %ebp
jne 0x2ba2d
movq 0x80(%rsp), %rcx
movq (%rcx,%r15,8), %rdi
testq %rdi, %rdi
je 0x2ba25
movq (%rdi), %rax
callq *0x20(%rax)
movq 0x80(%rsp), %rcx
leaq 0x1c999(%rip), %rax     # 0x483bc
movl (%rax), %eax
movq $0x0, (%rcx,%r15,8)
incq %r15
movslq %eax, %rcx
cmpq %rcx, %r15
jl 0x2b9f9
movl 0x48(%rsp), %eax
cmpl 0xd8(%rsp), %eax
movq 0x8(%rsp), %r15
jge 0x2bab6
movl 0x2c(%r15), %eax
cmpl %eax, %r13d
jge 0x2bab6
incl 0x48(%rsp)
movq 0x68(%r15), %rcx
subq 0x60(%r15), %rcx
sarq $0x3, %rcx
movb $0x1, %dl
movq %rdx, 0x40(%rsp)
movsd 0x18(%rsp), %xmm1
cmpq %rcx, 0x108(%rsp)
jb 0x2b5c9
jmp 0x2bab6
movq (%r15), %rsi
leaq 0xae8a(%rip), %rdi      # 0x36914
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x7060
movb $0x1, 0x40(%r15)
jmp 0x2baf4
movb $0x1, 0x40(%r15)
jmp 0x2baf2
leaq 0xb149(%rip), %rdi      # 0x36bf1
jmp 0x2bab1
leaq 0xb126(%rip), %rdi      # 0x36bd7
callq 0x7560
movb $0x1, 0x40(%r15)
leaq 0xe0(%rsp), %rdi
callq 0x2e450
leaq 0xa0(%rsp), %rdi
callq 0x2e450
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x2baf2
movq 0x90(%rsp), %rsi
subq %rdi, %rsi
callq 0x7390
movb $0x1, %bl
leaq 0x268(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2bb15
movq 0x268(%rsp), %rsi
incq %rsi
callq 0x7390
movl %ebx, %eax
addq $0x298, %rsp            # imm = 0x298
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x8, %edi
callq 0x7180
movq %rax, %r14
movl $0x1, %edi
callq 0x7380
movq %rax, %r15
leaq 0xa36b(%rip), %rsi      # 0x35eb5
movq %rax, %rdi
callq 0xb5c8
jmp 0x2bbdc
movl $0x8, %edi
callq 0x7180
movq %rax, %r14
movl $0x1, %edi
callq 0x7380
movq %rax, %r15
leaq 0xae20(%rip), %rsi      # 0x36998
movq %rax, %rdi
callq 0xb5c8
jmp 0x2bc19
movl $0x8, %edi
callq 0x7180
movq %rax, %r14
movl $0x1, %edi
callq 0x7380
movq %rax, %r15
leaq 0xae39(%rip), %rsi      # 0x369df
movq %rax, %rdi
callq 0xb5c8
jmp 0x2bc56
movl $0x8, %edi
callq 0x7180
movq %rax, %r14
movl $0x1, %edi
callq 0x7380
movq %rax, %r15
leaq 0xad8a(%rip), %rsi      # 0x3695e
movq %rax, %rdi
callq 0xb5c8
movq %r15, (%r14)
leaq 0x1c0d2(%rip), %rsi     # 0x47cb8
movq %r14, %rdi
xorl %edx, %edx
callq 0x7660
movl $0x8, %edi
callq 0x7180
movq %rax, %r14
movl $0x1, %edi
callq 0x7380
movq %rax, %r15
leaq 0xad4d(%rip), %rsi      # 0x3695e
movq %rax, %rdi
callq 0xb5c8
movq %r15, (%r14)
leaq 0x1c095(%rip), %rsi     # 0x47cb8
movq %r14, %rdi
xorl %edx, %edx
callq 0x7660
movl $0x8, %edi
callq 0x7180
movq %rax, %r14
movl $0x1, %edi
callq 0x7380
movq %rax, %r15
leaq 0xad10(%rip), %rsi      # 0x3695e
movq %rax, %rdi
callq 0xb5c8
movq %r15, (%r14)
leaq 0x1c058(%rip), %rsi     # 0x47cb8
movq %r14, %rdi
xorl %edx, %edx
callq 0x7660
leaq 0x9f55(%rip), %rdi      # 0x35bc6
xorl %eax, %eax
callq 0x7530
leaq 0x9f47(%rip), %rdi      # 0x35bc6
xorl %eax, %eax
callq 0x7530
movq %rax, %rbx
movq 0x198(%rsp), %rdi
cmpq %r15, %rdi
je 0x2bdf4
movq 0x1a8(%rsp), %rsi
incq %rsi
jmp 0x2bdce
jmp 0x2bdf1
movq %rax, %rbx
movq 0x1b8(%rsp), %rdi
cmpq %r14, %rdi
je 0x2bf10
movq 0x1c8(%rsp), %rsi
jmp 0x2bd11
jmp 0x2bddd
movq %rax, %rbx
movq 0x1d8(%rsp), %rdi
cmpq %r15, %rdi
je 0x2bf10
movq 0x1e8(%rsp), %rsi
jmp 0x2bd11
jmp 0x2bddd
movq %rax, %rbx
movq 0x1f8(%rsp), %rdi
cmpq %r15, %rdi
je 0x2bf10
movq 0x208(%rsp), %rsi
incq %rsi
callq 0x7390
jmp 0x2bf10
jmp 0x2bddd
jmp 0x2bddd
movq %rax, %rbx
movq 0x218(%rsp), %rdi
cmpq %r15, %rdi
je 0x2bf2d
movq 0x228(%rsp), %rsi
incq %rsi
jmp 0x2bf28
movq %rax, %rbx
jmp 0x2bf2d
movq %rax, %rbx
movq 0x238(%rsp), %rdi
cmpq %r14, %rdi
je 0x2bf4e
movq 0x248(%rsp), %rsi
jmp 0x2bf46
movq %rax, %rbx
jmp 0x2bf4e
movq %rax, %rbx
movq 0x278(%rsp), %rdi
cmpq %r15, %rdi
je 0x2bf4e
movq 0x288(%rsp), %rsi
jmp 0x2bf46
jmp 0x2bddd
jmp 0x2bdf1
jmp 0x2bdf1
jmp 0x2bdf1
jmp 0x2bdf1
jmp 0x2bdb9
movq %rax, %rbx
movl $0x10, %esi
movq %r12, %rdi
jmp 0x2bdce
jmp 0x2bdf1
movq %rax, %rbx
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x2bdf4
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x7390
jmp 0x2bdf4
movq %rax, %rbx
jmp 0x2bef9
movq %rax, %rbx
jmp 0x2bf10
movq %rax, %rbx
jmp 0x2bf06
jmp 0x2bdf1
jmp 0x2bdf1
movq %rax, %rbx
leaq 0xe0(%rsp), %rdi
callq 0x2e450
leaq 0xa0(%rsp), %rdi
callq 0x2e450
jmp 0x2bf10
jmp 0x2be1d
jmp 0x2be1d
jmp 0x2be1d
jmp 0x2be1d
jmp 0x2be1d
movq %rax, %rbx
movl $0x1, %esi
movq %r15, %rdi
callq 0x7390
jmp 0x2be42
jmp 0x2be3f
jmp 0x2be3f
jmp 0x2be3f
jmp 0x2be9f
jmp 0x2be9f
jmp 0x2be9f
jmp 0x2be3f
jmp 0x2be3f
movq %rax, %rbx
movq %r14, %rdi
callq 0x72a0
jmp 0x2bea2
jmp 0x2be68
jmp 0x2be6d
jmp 0x2be9f
jmp 0x2be78
jmp 0x2be78
jmp 0x2be9f
jmp 0x2be9f
jmp 0x2be6d
jmp 0x2be68
jmp 0x2be9f
jmp 0x2be9f
jmp 0x2be78
jmp 0x2be9f
jmp 0x2be78
movq %rax, %rbx
jmp 0x2beec
movq %rax, %rbx
jmp 0x2bec7
jmp 0x2be78
jmp 0x2be9f
jmp 0x2be9f
movq %rax, %rbx
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x2bea2
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x7390
jmp 0x2bea2
jmp 0x2be9f
jmp 0x2be9f
jmp 0x2be9f
movq %rax, %rbx
movq 0xe0(%rsp), %rdi
leaq 0xf0(%rsp), %rax
cmpq %rax, %rdi
je 0x2bec7
movq 0xf0(%rsp), %rsi
incq %rsi
callq 0x7390
movq 0xa0(%rsp), %rdi
leaq 0xb0(%rsp), %rax
cmpq %rax, %rdi
je 0x2beec
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x7390
leaq 0x168(%rsp), %rdi
callq 0x1a6c6
leaq 0x180(%rsp), %rdi
callq 0x1a6c6
leaq 0x68(%rsp), %rdi
callq 0x1a6c6
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x2bf2d
movq 0x90(%rsp), %rsi
subq %rdi, %rsi
callq 0x7390
leaq 0x268(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2bf4e
movq 0x268(%rsp), %rsi
incq %rsi
callq 0x7390
movq %rbx, %rdi
callq 0x76a0