// File: /workspace/github_cpp_makefile_star2_O2/melop[P]admixem/Population.cpp
// Function: Population::FreqDependentNaturalSelection()
void Population::FreqDependentNaturalSelection() {

	int nCurrGen = SimulConfig.GetCurrGen();
	bool bIgnoreGlobalRules = SimulConfig.pNaturalSelConfig->IgnoreGlobalRules(nCurrGen);
	string sPop = this->_sPopName;

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


	//list< vector<string> > * pqvCourterSymbols = SimulConfig.pNaturalSelConfig->GetFormulaSymbolStringsCourter( sPop);
	list< vector<string> > * pqvSelfSymbols = SimulConfig.pNaturalSelConfig->GetFormulaSymbolStringsSelf( sPop);
	list< vector<string> > * pqvPopSymbols = SimulConfig.pNaturalSelConfig->GetFormulaSymbolStringsPop( sPop);
	list< vector<string> > * pqvPopCourterSymbols = SimulConfig.pNaturalSelConfig->GetFormulaSymbolStringsPopCourter( sPop);
	list< vector<string> > * pqvPopChooserSymbols = SimulConfig.pNaturalSelConfig->GetFormulaSymbolStringsPopChooser( sPop);

	//set population level parameters


	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 itPopSymbols = pqvPopSymbols->begin();
		list< vector<string> >::iterator itPopCourterSymbols = pqvPopCourterSymbols->begin();
		list< vector<string> >::iterator itPopChooserSymbols = pqvPopChooserSymbols->begin();

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

			Parser * pParser = itParser->first;
			//set population level symbols

			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;

			}

			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;

			}

			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;

			}

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

	}
	//now go through each individual 
	vector<int>::size_type nMale = this->_mpMales.size();
	vector<int>::size_type nFemale = this->_mpFemales.size();

	#pragma omp parallel 
	{

	#pragma omp for
	//for (vector< Individual * >::size_type i=0; i< nMale; i++ ) {
	for (signed long i=0; i< nMale; i++ ) {
		Individual * pInd = _mpMales[i];

		#ifdef _OPENMP
		int nCPU = omp_get_thread_num();
		#else
		int nCPU = 0;
		#endif

		list< pair< Parser *, int > > * pqParsers = &(*mppqParsers)[nCPU][this->_sPopName];
		list< vector<string> >::iterator itSelfSymbols = pqvSelfSymbols->begin();
		for (list< pair< Parser *, int> >::iterator itParser= pqParsers->begin(); itParser != pqParsers->end() ; ++itParser) {
			vector<string> vSymbolsSelf = *itSelfSymbols;
			Parser * pParser = itParser->first;
			int nGen = itParser->second;

			if ((nGen ==-1 && !bIgnoreGlobalRules) || (bIgnoreGlobalRules && nGen == nCurrGen) ) {

				for(vector<string>::iterator itSymbol=vSymbolsSelf.begin();itSymbol!=vSymbolsSelf.end();++itSymbol)
				{
					//#pragma omp critical
					//{
						pParser->symbols_[string("My_"+(*itSymbol))] = pInd->GetPhenotype(*itSymbol);
						pParser->symbols_[*itSymbol] = pInd->GetPhenotype(*itSymbol); //set both variables
					//}
				}

				bool bLive = true;
				//#pragma omp critical 
				//{
					bLive = (UniformGen.Next() <= pParser->Evaluate())? true : false;
				//}

				if (!bLive) {

					#pragma omp critical 
					{
						delete pInd; // uhoh, dead!!
						_mpMales[i] = NULL; //mark it
						//_mpMales.erase(_mpMales.begin() + i);
					}
					break;
				}
			}
		
			++itSelfSymbols;
		}


	}

	#pragma omp for
	//for (vector< Individual * >::size_type i=0; i< nFemale; i++ ) {
	for (signed long i=0; i< nFemale; i++ ) {
		Individual * pInd = _mpFemales[i];

		#ifdef _OPENMP
		int nCPU = omp_get_thread_num();
		#else
		int nCPU = 0;
		#endif

		list< pair< Parser *, int > > * pqParsers = &(*mppqParsers)[nCPU][this->_sPopName];

		list< vector<string> >::iterator itSelfSymbols = pqvSelfSymbols->begin();
		for (list< pair< Parser *, int> >::iterator itParser= pqParsers->begin(); itParser != pqParsers->end() ; ++itParser) {
			vector<string> vSymbolsSelf = *itSelfSymbols;
			Parser * pParser = itParser->first;
			int nGen = itParser->second;

			if ((nGen ==-1 && !bIgnoreGlobalRules) || (bIgnoreGlobalRules && nGen == nCurrGen) ) {

				for(vector<string>::iterator itSymbol=vSymbolsSelf.begin();itSymbol!=vSymbolsSelf.end();++itSymbol)
				{
					//#pragma omp critical 
					//{
						pParser->symbols_[string("My_"+(*itSymbol))] = pInd->GetPhenotype(*itSymbol);
						pParser->symbols_[*itSymbol] = pInd->GetPhenotype(*itSymbol); //set both variables
					//}
				}

				bool bLive = true;
				//#pragma omp critical 
				//{
					bLive = (UniformGen.Next() <= pParser->Evaluate())? true : false;
				//}

				if (!bLive) {
					#pragma omp critical 
					{
						delete pInd; // uhoh, dead!!
						_mpFemales[i] = NULL;
						//_mpFemales.erase(_mpFemales.begin() + i);
					}
					break;
				}
			}
		
			++itSelfSymbols;
		}


	}

	} //end parallel block

	//clear NULL pointers from the arrays:

	for (vector< Individual * >::size_type i=0; i< nMale; i++ ) {
		if (! _mpMales[i]) {
			_mpMales.erase(_mpMales.begin() + i);
			nMale--; // readjust upper bound
			i--;
		}
	}
	
	for (vector< Individual * >::size_type i=0; i< nFemale; i++ ) {
		if (! _mpFemales[i]) {
			_mpFemales.erase(_mpFemales.begin() + i);
			nFemale--; // readjust upper bound
			i--;
		}
	}

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x268, %rsp            # imm = 0x268
movq %rdi, %r14
leaq 0x1d449(%rip), %rbx     # 0x45938
movq %rbx, %rdi
callq 0x16ac0
movq 0x20(%rbx), %rdi
movl %eax, 0x7c(%rsp)
movl %eax, %esi
callq 0x139e6
movb %al, 0x17(%rsp)
leaq 0x100(%rsp), %rdi
movq %r14, 0x40(%rsp)
movq %r14, %rsi
callq 0x7550
movq 0x20(%rbx), %rdi
callq 0x13a7c
movq %rax, 0x70(%rsp)
movq 0x20(%rbx), %r14
leaq 0x1c8(%rsp), %rdi
leaq 0x100(%rsp), %rsi
callq 0x7550
leaq 0x1c8(%rsp), %rsi
movq %r14, %rdi
callq 0x139b6
movq %rax, 0xa0(%rsp)
leaq 0x1c8(%rsp), %rdi
callq 0x71a0
movq 0x20(%rbx), %r14
leaq 0x1a8(%rsp), %rdi
leaq 0x100(%rsp), %rsi
callq 0x7550
leaq 0x1a8(%rsp), %rsi
movq %r14, %rdi
callq 0x139c2
movq %rax, 0xd8(%rsp)
leaq 0x1a8(%rsp), %rdi
callq 0x71a0
movq 0x20(%rbx), %r14
leaq 0x188(%rsp), %rdi
leaq 0x100(%rsp), %rsi
callq 0x7550
leaq 0x188(%rsp), %rsi
movq %r14, %rdi
callq 0x139ce
movq %rax, 0xd0(%rsp)
leaq 0x188(%rsp), %rdi
callq 0x71a0
movq 0x20(%rbx), %rbx
leaq 0x168(%rsp), %rdi
leaq 0x100(%rsp), %rsi
callq 0x7550
leaq 0x168(%rsp), %rsi
movq %rbx, %rdi
callq 0x139da
movq %rax, 0xc8(%rsp)
leaq 0x168(%rsp), %rdi
callq 0x71a0
movq 0x40(%rsp), %rax
leaq 0xb8(%rax), %rcx
movq %rcx, 0x8(%rsp)
leaq 0xc0(%rax), %rcx
movq %rcx, 0x68(%rsp)
leaq 0xe8(%rax), %rcx
movq %rcx, 0x18(%rsp)
leaq 0xf0(%rax), %rcx
movq %rcx, 0x50(%rsp)
leaq 0x118(%rax), %r12
addq $0x120, %rax            # imm = 0x120
movq %rax, 0x48(%rsp)
xorl %eax, %eax
leaq 0xe0(%rsp), %rbp
leaq 0x80(%rsp), %r14
leaq 0xa8(%rsp), %rbx
movl %eax, 0x5c(%rsp)
leaq 0x1cd53(%rip), %rcx     # 0x453e4
cmpl (%rcx), %eax
jge 0x28b05
movq 0x70(%rsp), %rdi
leaq 0x5c(%rsp), %rsi
callq 0x176fe
movq %rax, %rdi
movq 0x40(%rsp), %rsi
callq 0x1774c
movq %rax, %rcx
movq 0xd8(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x30(%rsp)
movq 0xd0(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x28(%rsp)
movq 0xc8(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x38(%rsp)
movq %rcx, 0x20(%rsp)
movq %rcx, 0x60(%rsp)
movq 0x20(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x20(%rsp)
cmpq %rcx, %rax
je 0x28afa
movq 0x30(%rsp), %rax
leaq 0x10(%rax), %rsi
leaq 0x150(%rsp), %rdi
callq 0x1dc64
movq 0x28(%rsp), %rax
leaq 0x10(%rax), %rsi
leaq 0x138(%rsp), %rdi
callq 0x1dc64
movq 0x38(%rsp), %rax
leaq 0x10(%rax), %rsi
leaq 0x120(%rsp), %rdi
callq 0x1dc64
movq 0x20(%rsp), %rax
movq 0x10(%rax), %r13
movq 0x150(%rsp), %r15
addq $0x68, %r13
cmpq 0x158(%rsp), %r15
je 0x28872
movq %rbp, %rdi
movq %r15, %rsi
pushq $0x4
popq %rdx
pushq $-0x1
popq %rcx
callq 0x7430
movq %r14, %rdi
movq %r15, %rsi
xorl %edx, %edx
pushq $0x3
popq %rcx
callq 0x7430
movq %r14, %rdi
leaq 0x671e(%rip), %rsi      # 0x2eeb6
callq 0x17c35
testb %al, %al
je 0x287b8
movq %r14, %rdi
leaq 0x670f(%rip), %rsi      # 0x2eeba
callq 0x17c35
testb %al, %al
jne 0x2904a
movq 0x8(%rsp), %rdi
movq %rbp, %rsi
callq 0x24054
cmpq 0x68(%rsp), %rax
je 0x28fcf
movq 0x8(%rsp), %rdi
movq %rbp, %rsi
callq 0x2322c
movsd (%rax), %xmm0
movsd %xmm0, (%rsp)
movq %rbx, %rdi
leaq 0x7161(%rip), %rsi      # 0x2f951
movq %rbp, %rdx
callq 0x9325
movq %r13, %rdi
movq %rbx, %rsi
callq 0x18432
movsd (%rsp), %xmm0
movsd %xmm0, (%rax)
movq %rbx, %rdi
callq 0x71a0
movq 0x8(%rsp), %rdi
movq %rbp, %rsi
callq 0x2322c
movsd 0x8(%rax), %xmm0
movsd %xmm0, (%rsp)
movq %rbx, %rdi
leaq 0x7125(%rip), %rsi      # 0x2f95a
movq %rbp, %rdx
callq 0x9325
movq %r13, %rdi
movq %rbx, %rsi
callq 0x18432
movsd (%rsp), %xmm0
movsd %xmm0, (%rax)
movq %rbx, %rdi
callq 0x71a0
movq %r14, %rdi
callq 0x71a0
movq %rbp, %rdi
callq 0x71a0
addq $0x20, %r15
jmp 0x2875f
movq 0x138(%rsp), %r15
cmpq 0x140(%rsp), %r15
je 0x2898d
movq %rbp, %rdi
movq %r15, %rsi
pushq $0x4
popq %rdx
pushq $-0x1
popq %rcx
callq 0x7430
movq %r14, %rdi
movq %r15, %rsi
xorl %edx, %edx
pushq $0x3
popq %rcx
callq 0x7430
movq %r14, %rdi
leaq 0x6603(%rip), %rsi      # 0x2eeb6
callq 0x17c35
testb %al, %al
je 0x288d3
movq %r14, %rdi
leaq 0x65f4(%rip), %rsi      # 0x2eeba
callq 0x17c35
testb %al, %al
jne 0x29083
movq 0x18(%rsp), %rdi
movq %rbp, %rsi
callq 0x24054
cmpq 0x50(%rsp), %rax
je 0x28ff6
movq 0x18(%rsp), %rdi
movq %rbp, %rsi
callq 0x2322c
movsd (%rax), %xmm0
movsd %xmm0, (%rsp)
movq %rbx, %rdi
leaq 0x7084(%rip), %rsi      # 0x2f98f
movq %rbp, %rdx
callq 0x9325
movq %r13, %rdi
movq %rbx, %rsi
callq 0x18432
movsd (%rsp), %xmm0
movsd %xmm0, (%rax)
movq %rbx, %rdi
callq 0x71a0
movq 0x18(%rsp), %rdi
movq %rbp, %rsi
callq 0x2322c
movsd 0x8(%rax), %xmm0
movsd %xmm0, (%rsp)
movq %rbx, %rdi
leaq 0x704f(%rip), %rsi      # 0x2f99f
movq %rbp, %rdx
callq 0x9325
movq %r13, %rdi
movq %rbx, %rsi
callq 0x18432
movsd (%rsp), %xmm0
movsd %xmm0, (%rax)
movq %rbx, %rdi
callq 0x71a0
movq %r14, %rdi
callq 0x71a0
movq %rbp, %rdi
callq 0x71a0
addq $0x20, %r15
jmp 0x2887a
movq 0x120(%rsp), %r15
cmpq 0x128(%rsp), %r15
je 0x28aa2
movq %rbp, %rdi
movq %r15, %rsi
pushq $0x4
popq %rdx
pushq $-0x1
popq %rcx
callq 0x7430
movq %r14, %rdi
movq %r15, %rsi
xorl %edx, %edx
pushq $0x3
popq %rcx
callq 0x7430
movq %r14, %rdi
leaq 0x64e8(%rip), %rsi      # 0x2eeb6
callq 0x17c35
testb %al, %al
je 0x289ee
movq %r14, %rdi
leaq 0x64d9(%rip), %rsi      # 0x2eeba
callq 0x17c35
testb %al, %al
jne 0x290bc
movq %r12, %rdi
movq %rbp, %rsi
callq 0x24054
cmpq 0x48(%rsp), %rax
je 0x29020
movq %r12, %rdi
movq %rbp, %rsi
callq 0x2322c
movsd (%rax), %xmm0
movsd %xmm0, (%rsp)
movq %rbx, %rdi
leaq 0x6fb6(%rip), %rsi      # 0x2f9d8
movq %rbp, %rdx
callq 0x9325
movq %r13, %rdi
movq %rbx, %rsi
callq 0x18432
movsd (%rsp), %xmm0
movsd %xmm0, (%rax)
movq %rbx, %rdi
callq 0x71a0
movq %r12, %rdi
movq %rbp, %rsi
callq 0x2322c
movsd 0x8(%rax), %xmm0
movsd %xmm0, (%rsp)
movq %rbx, %rdi
leaq 0x6f83(%rip), %rsi      # 0x2f9e8
movq %rbp, %rdx
callq 0x9325
movq %r13, %rdi
movq %rbx, %rsi
callq 0x18432
movsd (%rsp), %xmm0
movsd %xmm0, (%rax)
movq %rbx, %rdi
callq 0x71a0
movq %r14, %rdi
callq 0x71a0
movq %rbp, %rdi
callq 0x71a0
addq $0x20, %r15
jmp 0x28995
movq 0x30(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x30(%rsp)
movq 0x28(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x28(%rsp)
movq 0x38(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x38(%rsp)
leaq 0x120(%rsp), %rdi
callq 0x17632
leaq 0x138(%rsp), %rdi
callq 0x17632
leaq 0x150(%rsp), %rdi
callq 0x17632
movq 0x60(%rsp), %rcx
jmp 0x286f2
movl 0x5c(%rsp), %eax
incl %eax
jmp 0x28686
movq 0x40(%rsp), %rax
leaq 0x48(%rax), %rcx
movq %rcx, 0x30(%rsp)
movq 0x50(%rax), %rdx
movq 0x68(%rax), %rcx
subq 0x48(%rax), %rdx
sarq $0x3, %rdx
movq %rdx, 0x38(%rsp)
leaq 0x60(%rax), %rdx
movq %rdx, 0x28(%rsp)
subq 0x60(%rax), %rcx
sarq $0x3, %rcx
movq %rcx, 0x60(%rsp)
cmpb $0x0, 0x17(%rsp)
pushq $-0x1
popq %rax
cmovnel 0x7c(%rsp), %eax
movl %eax, 0x68(%rsp)
xorl %ecx, %ecx
leaq 0x248(%rsp), %rbp
leaq 0xe0(%rsp), %rbx
leaq 0x228(%rsp), %r14
cmpq 0x38(%rsp), %rcx
je 0x28d4d
movq 0x30(%rsp), %rax
movq (%rax), %rax
movq %rcx, 0x20(%rsp)
movq (%rax,%rcx,8), %r13
andl $0x0, 0xa8(%rsp)
movq 0x70(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
callq 0x176fe
movq %rax, %rdi
movq 0x40(%rsp), %rsi
callq 0x1774c
movq %rax, %rcx
movq 0xa0(%rsp), %rax
movq (%rax), %rax
movq %rax, (%rsp)
movq %rcx, 0x18(%rsp)
movq %rcx, 0x50(%rsp)
movq 0x18(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x18(%rsp)
cmpq %rcx, %rax
je 0x28d40
movq (%rsp), %rax
leaq 0x10(%rax), %rsi
leaq 0x80(%rsp), %rdi
callq 0x1dc64
movl 0x68(%rsp), %eax
movq 0x18(%rsp), %rcx
cmpl %eax, 0x18(%rcx)
jne 0x28d17
movq 0x18(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x80(%rsp), %r12
movq %rax, 0x48(%rsp)
leaq 0x68(%rax), %r15
cmpq 0x88(%rsp), %r12
je 0x28cc2
movq %rbp, %rdi
movq %r12, %rsi
callq 0x7550
movq %r13, %rdi
movq %rbp, %rsi
callq 0x2242e
movsd %xmm0, 0x8(%rsp)
movq %rbx, %rdi
leaq 0x5475(%rip), %rsi      # 0x2e0c8
movq %r12, %rdx
callq 0x9325
movq %r15, %rdi
movq %rbx, %rsi
callq 0x18432
movsd 0x8(%rsp), %xmm0
movsd %xmm0, (%rax)
movq %rbx, %rdi
callq 0x71a0
movq %rbp, %rdi
callq 0x71a0
movq %r14, %rdi
movq %r12, %rsi
callq 0x7550
movq %r13, %rdi
movq %r14, %rsi
callq 0x2242e
movsd %xmm0, 0x8(%rsp)
movq %r15, %rdi
movq %r12, %rsi
callq 0x94ac
movsd 0x8(%rsp), %xmm0
movsd %xmm0, (%rax)
movq %r14, %rdi
callq 0x71a0
addq $0x20, %r12
jmp 0x28c1f
leaq 0x1cda7(%rip), %rdi     # 0x45a70
callq 0xb2e2
movsd %xmm0, 0x8(%rsp)
movq 0x48(%rsp), %rdi
callq 0x920c
ucomisd 0x8(%rsp), %xmm0
jae 0x28d17
testq %r13, %r13
je 0x28cf3
movq %r13, %rdi
callq 0x1fc0e
movl $0x158, %esi            # imm = 0x158
movq %r13, %rdi
callq 0x7400
movq 0x30(%rsp), %rax
movq (%rax), %rax
movq 0x20(%rsp), %rcx
andq $0x0, (%rax,%rcx,8)
xorl %r15d, %r15d
jmp 0x28d25
movq (%rsp), %rax
movq (%rax), %rax
movq %rax, (%rsp)
movb $0x1, %r15b
leaq 0x80(%rsp), %rdi
callq 0x17632
testb %r15b, %r15b
movq 0x50(%rsp), %rcx
jne 0x28bc8
movq 0x20(%rsp), %rcx
incq %rcx
jmp 0x28b69
xorl %ecx, %ecx
leaq 0x208(%rsp), %rbp
leaq 0xe0(%rsp), %rbx
leaq 0x1e8(%rsp), %r14
cmpq 0x60(%rsp), %rcx
je 0x28f4b
movq 0x28(%rsp), %rax
movq (%rax), %rax
movq %rcx, 0x20(%rsp)
movq (%rax,%rcx,8), %r13
andl $0x0, 0xa8(%rsp)
movq 0x70(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
callq 0x176fe
movq %rax, %rdi
movq 0x40(%rsp), %rsi
callq 0x1774c
movq %rax, %rcx
movq 0xa0(%rsp), %rax
movq (%rax), %rax
movq %rax, (%rsp)
movq %rcx, 0x18(%rsp)
movq %rcx, 0x50(%rsp)
movq 0x18(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x18(%rsp)
cmpq %rcx, %rax
je 0x28f3e
movq (%rsp), %rax
leaq 0x10(%rax), %rsi
leaq 0x80(%rsp), %rdi
callq 0x1dc64
movl 0x68(%rsp), %eax
movq 0x18(%rsp), %rcx
cmpl %eax, 0x18(%rcx)
jne 0x28f15
movq 0x18(%rsp), %rax
movq 0x10(%rax), %rax
movq 0x80(%rsp), %r12
movq %rax, 0x48(%rsp)
leaq 0x68(%rax), %r15
cmpq 0x88(%rsp), %r12
je 0x28ec0
movq %rbp, %rdi
movq %r12, %rsi
callq 0x7550
movq %r13, %rdi
movq %rbp, %rsi
callq 0x2242e
movsd %xmm0, 0x8(%rsp)
movq %rbx, %rdi
leaq 0x5277(%rip), %rsi      # 0x2e0c8
movq %r12, %rdx
callq 0x9325
movq %r15, %rdi
movq %rbx, %rsi
callq 0x18432
movsd 0x8(%rsp), %xmm0
movsd %xmm0, (%rax)
movq %rbx, %rdi
callq 0x71a0
movq %rbp, %rdi
callq 0x71a0
movq %r14, %rdi
movq %r12, %rsi
callq 0x7550
movq %r13, %rdi
movq %r14, %rsi
callq 0x2242e
movsd %xmm0, 0x8(%rsp)
movq %r15, %rdi
movq %r12, %rsi
callq 0x94ac
movsd 0x8(%rsp), %xmm0
movsd %xmm0, (%rax)
movq %r14, %rdi
callq 0x71a0
addq $0x20, %r12
jmp 0x28e1d
leaq 0x1cba9(%rip), %rdi     # 0x45a70
callq 0xb2e2
movsd %xmm0, 0x8(%rsp)
movq 0x48(%rsp), %rdi
callq 0x920c
ucomisd 0x8(%rsp), %xmm0
jae 0x28f15
testq %r13, %r13
je 0x28ef1
movq %r13, %rdi
callq 0x1fc0e
movl $0x158, %esi            # imm = 0x158
movq %r13, %rdi
callq 0x7400
movq 0x28(%rsp), %rax
movq (%rax), %rax
movq 0x20(%rsp), %rcx
andq $0x0, (%rax,%rcx,8)
xorl %r15d, %r15d
jmp 0x28f23
movq (%rsp), %rax
movq (%rax), %rax
movq %rax, (%rsp)
movb $0x1, %r15b
leaq 0x80(%rsp), %rdi
callq 0x17632
testb %r15b, %r15b
movq 0x50(%rsp), %rcx
jne 0x28dc6
movq 0x20(%rsp), %rcx
incq %rcx
jmp 0x28d67
xorl %ebx, %ebx
movq 0x60(%rsp), %r14
movq 0x28(%rsp), %r15
movq 0x30(%rsp), %r12
movq 0x38(%rsp), %r13
cmpq %r13, %rbx
jae 0x28f88
movq (%r12), %rax
cmpq $0x0, (%rax,%rbx,8)
jne 0x28f83
leaq (%rax,%rbx,8), %rsi
movq %r12, %rdi
callq 0x295da
decq %r13
decq %rbx
incq %rbx
jmp 0x28f61
xorl %ebx, %ebx
cmpq %r14, %rbx
jae 0x28fb0
movq (%r15), %rax
cmpq $0x0, (%rax,%rbx,8)
jne 0x28fab
leaq (%rax,%rbx,8), %rsi
movq %r15, %rdi
callq 0x295da
decq %r14
decq %rbx
incq %rbx
jmp 0x28f8a
leaq 0x100(%rsp), %rdi
callq 0x71a0
addq $0x268, %rsp            # imm = 0x268
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x8
popq %rdi
callq 0x71d0
movq %rax, %r14
pushq $0x1
popq %rdi
callq 0x73f0
movq %rax, %r15
leaq 0x5ea9(%rip), %rsi      # 0x2ee95
movq %rax, %rdi
callq 0xad94
jmp 0x2906f
pushq $0x8
popq %rdi
callq 0x71d0
movq %rax, %r14
pushq $0x1
popq %rdi
callq 0x73f0
movq %rax, %r15
leaq 0x6955(%rip), %rsi      # 0x2f968
movq %rax, %rdi
callq 0xad94
jmp 0x290a8
pushq $0x8
popq %rdi
callq 0x71d0
movq %rax, %r14
pushq $0x1
popq %rdi
callq 0x73f0
movq %rax, %r15
leaq 0x6972(%rip), %rsi      # 0x2f9af
movq %rax, %rdi
callq 0xad94
jmp 0x290e1
pushq $0x8
popq %rdi
callq 0x71d0
movq %rax, %r14
pushq $0x1
popq %rdi
callq 0x73f0
movq %rax, %r15
leaq 0x68c7(%rip), %rsi      # 0x2f92e
movq %rax, %rdi
callq 0xad94
movq %r15, (%r14)
leaq 0x1bc5f(%rip), %rsi     # 0x44cd8
movq %r14, %rdi
xorl %edx, %edx
callq 0x76a0
pushq $0x8
popq %rdi
callq 0x71d0
movq %rax, %r14
pushq $0x1
popq %rdi
callq 0x73f0
movq %rax, %r15
leaq 0x688e(%rip), %rsi      # 0x2f92e
movq %rax, %rdi
callq 0xad94
movq %r15, (%r14)
leaq 0x1bc26(%rip), %rsi     # 0x44cd8
movq %r14, %rdi
xorl %edx, %edx
callq 0x76a0
pushq $0x8
popq %rdi
callq 0x71d0
movq %rax, %r14
pushq $0x1
popq %rdi
callq 0x73f0
movq %rax, %r15
leaq 0x6855(%rip), %rsi      # 0x2f92e
movq %rax, %rdi
callq 0xad94
movq %r15, (%r14)
leaq 0x1bbed(%rip), %rsi     # 0x44cd8
movq %r14, %rdi
xorl %edx, %edx
callq 0x76a0
movq %rax, %rbx
leaq 0x168(%rsp), %rdi
jmp 0x2912d
jmp 0x29153
movq %rax, %rbx
leaq 0x188(%rsp), %rdi
jmp 0x2912d
jmp 0x29153
movq %rax, %rbx
leaq 0x1a8(%rsp), %rdi
jmp 0x2912d
jmp 0x29153
movq %rax, %rbx
leaq 0x1c8(%rsp), %rdi
callq 0x71a0
jmp 0x292a6
jmp 0x29153
jmp 0x29153
jmp 0x29153
jmp 0x29153
jmp 0x29153
jmp 0x29153
jmp 0x29153
jmp 0x291fd
jmp 0x29153
jmp 0x291fd
jmp 0x29153
movq %rax, %rbx
jmp 0x292a6
movq %rax, %rbx
jmp 0x29299
movq %rax, %rbx
jmp 0x2928c
jmp 0x291bb
jmp 0x291bb
jmp 0x291bb
jmp 0x29173
movq %rax, %rbx
jmp 0x29188
movq %rax, %rbx
leaq 0xe0(%rsp), %rdi
callq 0x71a0
leaq 0x208(%rsp), %rdi
jmp 0x291f6
jmp 0x29194
movq %rax, %rbx
jmp 0x291a9
movq %rax, %rbx
leaq 0xe0(%rsp), %rdi
callq 0x71a0
leaq 0x248(%rsp), %rdi
jmp 0x291f6
jmp 0x291bb
jmp 0x29211
jmp 0x291bb
jmp 0x29211
movq %rax, %rbx
pushq $0x1
popq %rsi
movq %r15, %rdi
callq 0x7400
jmp 0x29214
jmp 0x29211
jmp 0x29262
jmp 0x29262
jmp 0x29262
movq %rax, %rbx
leaq 0x1e8(%rsp), %rdi
jmp 0x291f6
jmp 0x291fd
movq %rax, %rbx
leaq 0x228(%rsp), %rdi
callq 0x71a0
jmp 0x29200
movq %rax, %rbx
leaq 0x80(%rsp), %rdi
jmp 0x292a1
jmp 0x29211
jmp 0x29211
movq %rax, %rbx
movq %r14, %rdi
callq 0x7300
jmp 0x29265
jmp 0x29262
jmp 0x2924c
jmp 0x2923e
jmp 0x29243
jmp 0x29262
jmp 0x29262
jmp 0x2924c
jmp 0x29262
jmp 0x2923e
jmp 0x2924c
jmp 0x29243
jmp 0x29262
jmp 0x29262
jmp 0x2924c
jmp 0x29262
jmp 0x2924c
movq %rax, %rbx
jmp 0x2927f
movq %rax, %rbx
jmp 0x29272
jmp 0x29262
jmp 0x29262
movq %rax, %rbx
leaq 0xa8(%rsp), %rdi
callq 0x71a0
jmp 0x29265
jmp 0x29262
jmp 0x29262
movq %rax, %rbx
leaq 0x80(%rsp), %rdi
callq 0x71a0
leaq 0xe0(%rsp), %rdi
callq 0x71a0
leaq 0x120(%rsp), %rdi
callq 0x17632
leaq 0x138(%rsp), %rdi
callq 0x17632
leaq 0x150(%rsp), %rdi
callq 0x17632
leaq 0x100(%rsp), %rdi
callq 0x71a0
movq %rbx, %rdi
callq 0x76d0
nop