// File: /workspace/github_cpp_makefile_star2_O2/melop[P]admixem/Individual.cpp
// Function: Individual::HandleCourter(Individual*, bool)
int Individual::HandleCourter(Individual * pCourter , bool bIgnoreGlobalRules) {

	
		#ifdef _OPENMP
		int nCPU = omp_get_thread_num();
		//int nTotalCPUs = omp_get_max_threads();
			#ifdef DEBUG
			printf("CPU %d: %s : %d\n", nCPU, "SexSelFormulae # ", nCPU);
			#endif
		#else
			int nCPU = 0;
		#endif

	int nCurrGen = SimulConfig.GetCurrGen();

	if (pCourter->IsDead()) {
		throw(new Exception("Cannot mate with dead courter. Something went wrong."));
	}

	if (this->_nAvailableGametes == 0) {
		//no more gametes, byebye.
		return  0;
	}
	//entry point for sexual selection.

	string sPop = ((Population*)(this->_pPop))->GetPopName();
	
	list< vector<string> > * pqvCourterSymbols = SimulConfig.pSexualSelConfig->GetFormulaSymbolStringsCourter( sPop);
	list< vector<string> > * pqvSelfSymbols = SimulConfig.pSexualSelConfig->GetFormulaSymbolStringsSelf( sPop);
	list< vector<string> > * pqvDadSymbols = SimulConfig.pSexualSelConfig->GetFormulaSymbolStringsDad( sPop);
	list< vector<string> > * pqvMomSymbols = SimulConfig.pSexualSelConfig->GetFormulaSymbolStringsMom( sPop);

	//Traits for oblique imprinting; note that things for peer imprinting has already been set at the pop level. see Population::Breed()
	list< vector<string> > * pqvPrevGenCurrPopSymbols = SimulConfig.pSexualSelConfig->GetFormulaSymbolStringsPrevGenCurrPop(sPop);
	list< vector<string> > * pqvPrevGenCurrPopCourterSymbols = SimulConfig.pSexualSelConfig->GetFormulaSymbolStringsPrevGenCurrPopCourter(sPop);
	list< vector<string> > * pqvPrevGenCurrPopChooserSymbols = SimulConfig.pSexualSelConfig->GetFormulaSymbolStringsPrevGenCurrPopChooser(sPop);

	list< vector<string> > * pqvPrevGenPrevPopSymbols = SimulConfig.pSexualSelConfig->GetFormulaSymbolStringsPrevGenPrevPop(sPop);
	list< vector<string> > * pqvPrevGenPrevPopCourterSymbols = SimulConfig.pSexualSelConfig->GetFormulaSymbolStringsPrevGenPrevPopCourter(sPop);
	list< vector<string> > * pqvPrevGenPrevPopChooserSymbols = SimulConfig.pSexualSelConfig->GetFormulaSymbolStringsPrevGenPrevPopChooser(sPop);

	list< vector<string> >::iterator itSelfSymbols= pqvSelfSymbols->begin();
	list< vector<string> >::iterator itCourterSymbols= pqvCourterSymbols->begin();
	list< vector<string> >::iterator itDadSymbols= pqvDadSymbols->begin();
	list< vector<string> >::iterator itMomSymbols= pqvMomSymbols->begin();

	list< vector<string> >::iterator itPrevGenCurrPopSymbols		=        pqvPrevGenCurrPopSymbols->begin();
	list< vector<string> >::iterator itPrevGenCurrPopCourterSymbols = 		 pqvPrevGenCurrPopCourterSymbols->begin();
	list< vector<string> >::iterator itPrevGenCurrPopChooserSymbols =		 pqvPrevGenCurrPopChooserSymbols->begin();
	
	list< vector<string> >::iterator itPrevGenPrevPopSymbols		= 				 pqvPrevGenPrevPopSymbols->begin();
	list< vector<string> >::iterator itPrevGenPrevPopCourterSymbols =  		 pqvPrevGenPrevPopCourterSymbols->begin();
	list< vector<string> >::iterator itPrevGenPrevPopChooserSymbols =		 pqvPrevGenPrevPopChooserSymbols->begin();

	bool bAccept = true;

	//#pragma omp critical 
	//{
		list< pair< Parser *, int > > * pqParsers = SimulConfig.pSexualSelConfig->GetFormulae(sPop);
		for (list< pair< Parser *, int > > ::iterator itParser= pqParsers->begin(); itParser != pqParsers->end() ; ++itParser) {
			vector<string> vSymbolsSelf = *itSelfSymbols;
			vector<string> vSymbolsCourter = *itCourterSymbols;
			vector<string> vSymbolsDad = *itDadSymbols;
			vector<string> vSymbolsMom = *itMomSymbols;

			vector<string> vSymbolsPrevGenCurrPop		=	*itPrevGenCurrPopSymbols	;	
			vector<string> vSymbolsPrevGenCurrPopCourter = *itPrevGenCurrPopCourterSymbols;
			vector<string> vSymbolsPrevGenCurrPopChooser = *itPrevGenCurrPopChooserSymbols;
			 
			vector<string> vSymbolsPrevGenPrevPop		 =	*itPrevGenPrevPopSymbols		;
			vector<string> vSymbolsPrevGenPrevPopCourter = *itPrevGenPrevPopCourterSymbols;
			vector<string> vSymbolsPrevGenPrevPopChooser = *itPrevGenPrevPopChooserSymbols;

			Parser * pParser = itParser->first;
			int nGen = itParser->second;

			if ((nGen ==-1 && !bIgnoreGlobalRules) || (bIgnoreGlobalRules && nGen == nCurrGen) ) { // two scenarios: apply global rule or apply generation-specific rule
				

				//Set self symbol values
				for(vector<string>::iterator itSymbol=vSymbolsSelf.begin();itSymbol!=vSymbolsSelf.end();++itSymbol)
				{
					pParser->symbols_[string("My_"+(*itSymbol))] = this->GetPhenotype(*itSymbol);
					pParser->symbols_[*itSymbol] = this->GetPhenotype(*itSymbol); //set both variables
				}

				//Set courter symbol values
				for(vector<string>::iterator itSymbol=vSymbolsCourter.begin();itSymbol!=vSymbolsCourter.end();++itSymbol)
				{
					pParser->symbols_[string("Courter_"+(*itSymbol))] = pCourter->GetPhenotype(*itSymbol);				
				}

				//Set dad symbol values
				bool bSkipRule = false; // rules containing references to parental phenotypes will be skipped in generation 0
				for(vector<string>::iterator itSymbol=vSymbolsDad.begin();itSymbol!=vSymbolsDad.end();++itSymbol)
				{
					if (nCurrGen == 0) {
						bSkipRule = true;
						break;
					}

					pParser->symbols_[string("Dad_"+(*itSymbol))] = this->_mpDadPhenotypes[*itSymbol];				
				}

				//Set mom symbol values
				for(vector<string>::iterator itSymbol=vSymbolsMom.begin();itSymbol!=vSymbolsMom.end();++itSymbol)
				{
					if (nCurrGen == 0) {
						bSkipRule = true;
						break;
					}

					pParser->symbols_[string("Mom_"+(*itSymbol))] = this->_mpMomPhenotypes[*itSymbol];				
				}

				//Set PrevGenCurrPop symbol values
				bSkipRule = bSkipRule || this->fnSetParserPopWide(pParser , vSymbolsPrevGenCurrPop, string("PrevGenCurrPop"), ((Population*)this->GetPop())->_mpPrevGenSumPhenotype);
				//Set PrevGenCurrPopCourter symbol values
				bSkipRule = bSkipRule || this->fnSetParserPopWide(pParser , vSymbolsPrevGenCurrPopCourter , string("PrevGenCurrPopCourter"), ((Population*)this->GetPop())->_mpPrevGenSumPhenotypeMale);
				//Set PrevGenCurrPopChooser
				bSkipRule = bSkipRule || this->fnSetParserPopWide(pParser , vSymbolsPrevGenCurrPopChooser, string("PrevGenCurrPopChooser"), ((Population*)this->GetPop())->_mpPrevGenSumPhenotypeFemale);
				
				//set PrevGenPrevPop
				bSkipRule = bSkipRule || this->fnSetParserPopWide(pParser , vSymbolsPrevGenPrevPop, string("PrevGenPrevPop"), ((Population*)this->GetPrevPop())->_mpPrevGenSumPhenotype);
				// set PrevGenPrevPopCourter
				bSkipRule = bSkipRule || this->fnSetParserPopWide(pParser , vSymbolsPrevGenPrevPopCourter, string("PrevGenPrevPopCourter"), ((Population*)this->GetPrevPop())->_mpPrevGenSumPhenotypeMale);
				//set PrevGenPrevPopChooser
				bSkipRule = bSkipRule || this->fnSetParserPopWide(pParser , vSymbolsPrevGenPrevPopChooser, string("PrevGenPrevPopChooser"), ((Population*)this->GetPrevPop())->_mpPrevGenSumPhenotypeFemale);
				


				if (bSkipRule) continue;
				

				bAccept = (vUniformGen[nCPU]->Next() <= pParser->Evaluate())? true : false;

				if (!bAccept) {
					return 0; //reject mate
				}

			}

			/*
			if (!bAccept) {
				break;
			}
			*/
			++itSelfSymbols;
			++itCourterSymbols;
			++itDadSymbols;
			++itMomSymbols;

			++itPrevGenCurrPopSymbols;	
			++itPrevGenCurrPopCourterSymbols;
			++itPrevGenCurrPopChooserSymbols;
			
			++itPrevGenPrevPopSymbols;
			++itPrevGenPrevPopCourterSymbols;
			++itPrevGenPrevPopChooserSymbols;

		}
	
	//}//end critical

	if (!bAccept) {
		return 0;
	}

	int nSuccess;
	#pragma omp critical 
	{
		if (pCourter) {
			this->_arrOtherParentsForOffsprings.push_back(pCourter);
			nSuccess = 1;
		}
		else {
			nSuccess = 0;
		}
	}//end critical

	return nSuccess;
	
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x398, %rsp            # imm = 0x398
movl %edx, 0x8(%rsp)
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, 0x80(%rsp)
leaq 0x241fc(%rip), %r15     # 0x45938
movq %r15, %rdi
callq 0x16ac0
movl %eax, 0x1c(%rsp)
cmpb $0x1, 0x2d(%rbx)
je 0x2216f
cmpl $0x0, 0x40(%r14)
je 0x22159
movq %r14, 0x10(%rsp)
movq 0x18(%r14), %rsi
leaq 0x90(%rsp), %r14
movq %r14, %rdi
callq 0x27b7e
movq 0x28(%r15), %rbx
leaq 0x318(%rsp), %rdi
movq %r14, %rsi
callq 0x7550
leaq 0x318(%rsp), %rsi
movq %rbx, %rdi
callq 0x151d0
movq %rax, %r13
leaq 0x318(%rsp), %rdi
callq 0x71a0
movq 0x28(%r15), %rbx
leaq 0x2f8(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0x7550
leaq 0x2f8(%rsp), %rsi
movq %rbx, %rdi
callq 0x151dc
movq %rax, 0x78(%rsp)
leaq 0x2f8(%rsp), %rdi
callq 0x71a0
movq 0x28(%r15), %rbx
leaq 0x2d8(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0x7550
leaq 0x2d8(%rsp), %rsi
movq %rbx, %rdi
callq 0x1520c
movq %rax, 0x70(%rsp)
leaq 0x2d8(%rsp), %rdi
callq 0x71a0
movq 0x28(%r15), %rbx
leaq 0x2b8(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0x7550
leaq 0x2b8(%rsp), %rsi
movq %rbx, %rdi
callq 0x15218
movq %rax, 0x30(%rsp)
leaq 0x2b8(%rsp), %rdi
callq 0x71a0
movq 0x28(%r15), %rbx
leaq 0x298(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0x7550
leaq 0x298(%rsp), %rsi
movq %rbx, %rdi
callq 0x15224
movq %rax, 0x28(%rsp)
leaq 0x298(%rsp), %rdi
callq 0x71a0
movq 0x28(%r15), %rbx
leaq 0x278(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0x7550
leaq 0x278(%rsp), %rsi
movq %rbx, %rdi
callq 0x15230
movq %rax, 0x20(%rsp)
leaq 0x278(%rsp), %rdi
callq 0x71a0
movq 0x28(%r15), %rbx
leaq 0x258(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0x7550
leaq 0x258(%rsp), %rsi
movq %rbx, %rdi
callq 0x1523c
movq %rax, %rbx
leaq 0x258(%rsp), %rdi
callq 0x71a0
movq 0x28(%r15), %r14
leaq 0x238(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0x7550
leaq 0x238(%rsp), %rsi
movq %r14, %rdi
callq 0x15248
movq %rax, %rbp
leaq 0x238(%rsp), %rdi
callq 0x71a0
movq 0x28(%r15), %r14
leaq 0x218(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0x7550
leaq 0x218(%rsp), %rsi
movq %r14, %rdi
callq 0x15254
movq %rax, %r12
leaq 0x218(%rsp), %rdi
callq 0x71a0
movq 0x28(%r15), %r14
leaq 0x1f8(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0x7550
leaq 0x1f8(%rsp), %rsi
movq %r14, %rdi
callq 0x15260
movq %rax, %r14
leaq 0x1f8(%rsp), %rdi
callq 0x71a0
movq 0x78(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x68(%rsp)
movq (%r13), %rax
movq %rax, 0x60(%rsp)
movq 0x70(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x58(%rsp)
movq 0x30(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x30(%rsp)
movq 0x28(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x28(%rsp)
movq 0x20(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x20(%rsp)
movq (%rbx), %rax
movq %rax, 0x50(%rsp)
movq (%rbp), %rax
movq %rax, 0x48(%rsp)
movq (%r12), %rax
movq %rax, 0x40(%rsp)
movq (%r14), %rax
movq %rax, 0x38(%rsp)
movq 0x28(%r15), %rbx
leaq 0x1d8(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0x7550
leaq 0x1d8(%rsp), %rsi
movq %rbx, %rdi
callq 0x151a0
movq 0x10(%rsp), %rbx
movq %rax, %r14
leaq 0x1d8(%rsp), %rdi
callq 0x71a0
cmpb $0x0, 0x8(%rsp)
pushq $-0x1
popq %rax
cmovnel 0x1c(%rsp), %eax
movl %eax, 0x8c(%rsp)
leaq 0xb0(%rbx), %rax
movq %rax, 0x78(%rsp)
leaq 0xe0(%rbx), %rax
movq %rax, 0x70(%rsp)
movb $0x1, %al
movl %eax, 0x18(%rsp)
leaq 0xb0(%rsp), %r13
leaq 0x378(%rsp), %r15
movq %r14, %rbx
movq %r14, 0xd8(%rsp)
movq (%rbx), %rbx
cmpq %r14, %rbx
je 0x22115
movq 0x68(%rsp), %rax
leaq 0x10(%rax), %rsi
leaq 0x130(%rsp), %rdi
callq 0x1dc64
movq 0x60(%rsp), %rax
leaq 0x10(%rax), %rsi
leaq 0x118(%rsp), %rdi
callq 0x1dc64
leaq 0x358(%rsp), %r14
movq 0x58(%rsp), %rax
leaq 0x10(%rax), %rsi
leaq 0x100(%rsp), %rdi
callq 0x1dc64
movq 0x30(%rsp), %rax
leaq 0x10(%rax), %rsi
leaq 0xe8(%rsp), %rdi
callq 0x1dc64
movq 0x28(%rsp), %rax
leaq 0x10(%rax), %rsi
leaq 0x1c0(%rsp), %rdi
callq 0x1dc64
movq 0x20(%rsp), %rax
leaq 0x10(%rax), %rsi
leaq 0x1a8(%rsp), %rdi
callq 0x1dc64
movq 0x50(%rsp), %rax
leaq 0x10(%rax), %rsi
leaq 0x190(%rsp), %rdi
callq 0x1dc64
movq 0x48(%rsp), %rax
leaq 0x10(%rax), %rsi
leaq 0x178(%rsp), %rdi
callq 0x1dc64
movq 0x40(%rsp), %rax
leaq 0x10(%rax), %rsi
leaq 0x160(%rsp), %rdi
callq 0x1dc64
movq 0x38(%rsp), %rax
leaq 0x10(%rax), %rsi
leaq 0x148(%rsp), %rdi
callq 0x1dc64
movl 0x8c(%rsp), %eax
cmpl %eax, 0x18(%rbx)
movq %rbx, 0xe0(%rsp)
jne 0x21ff2
movq 0x10(%rbx), %rax
movq 0x130(%rsp), %rbx
movq %rax, 0xd0(%rsp)
leaq 0x68(%rax), %rbp
cmpq 0x138(%rsp), %rbx
je 0x21c80
leaq 0x338(%rsp), %r12
movq %r12, %rdi
movq %rbx, %rsi
callq 0x7550
movq 0x10(%rsp), %rdi
movq %r12, %rsi
callq 0x2242e
movsd %xmm0, 0x8(%rsp)
movq %r13, %rdi
leaq 0xc4be(%rip), %rsi      # 0x2e0c8
movq %rbx, %rdx
callq 0x9325
movq %rbp, %rdi
movq %r13, %rsi
callq 0x18432
movsd 0x8(%rsp), %xmm0
movsd %xmm0, (%rax)
movq %r13, %rdi
callq 0x71a0
leaq 0x338(%rsp), %rdi
callq 0x71a0
movq %r15, %rdi
movq %rbx, %rsi
callq 0x7550
movq 0x10(%rsp), %rdi
movq %r15, %rsi
callq 0x2242e
movsd %xmm0, 0x8(%rsp)
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x94ac
movsd 0x8(%rsp), %xmm0
movsd %xmm0, (%rax)
movq %r15, %rdi
callq 0x71a0
addq $0x20, %rbx
jmp 0x21bcc
movq 0x118(%rsp), %rbx
cmpq 0x120(%rsp), %rbx
je 0x21cf3
movq 0x80(%rsp), %r12
movq %r14, %rdi
movq %rbx, %rsi
callq 0x7550
movq %r12, %rdi
movq %r14, %rsi
callq 0x2242e
movsd %xmm0, 0x8(%rsp)
movq %r13, %rdi
leaq 0xc53b(%rip), %rsi      # 0x2e1fb
movq %rbx, %rdx
callq 0x9325
movq %rbp, %rdi
movq %r13, %rsi
callq 0x18432
movsd 0x8(%rsp), %xmm0
movsd %xmm0, (%rax)
movq %r13, %rdi
callq 0x71a0
movq %r14, %rdi
callq 0x71a0
addq $0x20, %rbx
jmp 0x21c88
movq 0x100(%rsp), %rbx
movq 0x108(%rsp), %r14
cmpl $0x0, 0x1c(%rsp)
je 0x21d5b
cmpq %r14, %rbx
je 0x21d5b
movq 0x78(%rsp), %rdi
movq %rbx, %rsi
callq 0x94ac
movsd (%rax), %xmm0
movsd %xmm0, 0x8(%rsp)
movq %r13, %rdi
leaq 0xc4a3(%rip), %rsi      # 0x2e1d3
movq %rbx, %rdx
callq 0x9325
movq %rbp, %rdi
movq %r13, %rsi
callq 0x18432
movsd 0x8(%rsp), %xmm0
movsd %xmm0, (%rax)
movq %r13, %rdi
callq 0x71a0
addq $0x20, %rbx
jmp 0x21cfb
movq 0xe8(%rsp), %r12
cmpq 0xf0(%rsp), %r12
je 0x21dc4
cmpl $0x0, 0x1c(%rsp)
je 0x21fb0
movq 0x70(%rsp), %rdi
movq %r12, %rsi
callq 0x94ac
movsd (%rax), %xmm0
movsd %xmm0, 0x8(%rsp)
movq %r13, %rdi
leaq 0xc43f(%rip), %rsi      # 0x2e1d8
movq %r12, %rdx
callq 0x9325
movq %rbp, %rdi
movq %r13, %rsi
callq 0x18432
movsd 0x8(%rsp), %xmm0
movsd %xmm0, (%rax)
movq %r13, %rdi
callq 0x71a0
addq $0x20, %r12
jmp 0x21d63
cmpq %r14, %rbx
jne 0x21fb0
movq %r13, %rdi
leaq 0xd048(%rip), %rsi      # 0x2ee1f
leaq 0x7(%rsp), %rdx
callq 0x9512
movq 0x10(%rsp), %rax
movq 0x18(%rax), %r8
movl $0x148, %eax            # imm = 0x148
addq %rax, %r8
movq 0xd0(%rsp), %r14
movq %r14, %rsi
leaq 0x1c0(%rsp), %rdx
movq %r13, %rcx
callq 0x2243e
movl %eax, %ebx
movq %r13, %rdi
callq 0x71a0
testb %bl, %bl
jne 0x21fb0
movq %r13, %rdi
leaq 0xd005(%rip), %rsi      # 0x2ee2e
leaq 0x7(%rsp), %rdx
callq 0x9512
movq 0x10(%rsp), %rax
movq 0x18(%rax), %r8
movl $0x178, %eax            # imm = 0x178
addq %rax, %r8
movq %r14, %rsi
leaq 0x1a8(%rsp), %rdx
movq %r13, %rcx
callq 0x2243e
movl %eax, %ebx
movq %r13, %rdi
callq 0x71a0
testb %bl, %bl
jne 0x21fb0
movq %r13, %rdi
leaq 0xcfd1(%rip), %rsi      # 0x2ee44
leaq 0x7(%rsp), %rdx
callq 0x9512
movq 0x10(%rsp), %rax
movq 0x18(%rax), %r8
movl $0x1a8, %eax            # imm = 0x1A8
addq %rax, %r8
movq %r14, %rsi
leaq 0x190(%rsp), %rdx
movq %r13, %rcx
callq 0x2243e
movl %eax, %ebx
movq %r13, %rdi
callq 0x71a0
testb %bl, %bl
jne 0x21fb0
movq %r13, %rdi
leaq 0xcf9d(%rip), %rsi      # 0x2ee5a
leaq 0x7(%rsp), %rdx
callq 0x9512
movq 0x10(%rsp), %rax
movq 0x20(%rax), %r8
testq %r8, %r8
jne 0x21ede
movq 0x10(%rsp), %rax
movq 0x18(%rax), %r8
addq $0x148, %r8             # imm = 0x148
movq %r14, %rsi
leaq 0x178(%rsp), %rdx
movq %r13, %rcx
callq 0x2243e
movl %eax, %ebx
movq %r13, %rdi
callq 0x71a0
testb %bl, %bl
jne 0x21fb0
movq %r13, %rdi
leaq 0xcf55(%rip), %rsi      # 0x2ee69
leaq 0x7(%rsp), %rdx
callq 0x9512
movq 0x10(%rsp), %rax
movq 0x20(%rax), %r8
testq %r8, %r8
jne 0x21f35
movq 0x10(%rsp), %rax
movq 0x18(%rax), %r8
addq $0x178, %r8             # imm = 0x178
movq %r14, %rsi
leaq 0x160(%rsp), %rdx
movq %r13, %rcx
callq 0x2243e
movl %eax, %ebx
movq %r13, %rdi
callq 0x71a0
testb %bl, %bl
jne 0x21fb0
movq %r13, %rdi
leaq 0xcf18(%rip), %rsi      # 0x2ee7f
leaq 0x7(%rsp), %rdx
callq 0x9512
movq 0x10(%rsp), %rax
movq 0x20(%rax), %r8
testq %r8, %r8
jne 0x21f88
movq 0x10(%rsp), %rax
movq 0x18(%rax), %r8
addq $0x1a8, %r8             # imm = 0x1A8
movq %r14, %rsi
leaq 0x148(%rsp), %rdx
movq %r13, %rcx
callq 0x2243e
movl %eax, %ebx
movq %r13, %rdi
callq 0x71a0
testb %bl, %bl
je 0x21fb8
pushq $0x4
popq %rbx
jmp 0x22076
leaq 0x23b01(%rip), %rax     # 0x45ac0
movq (%rax), %rax
movq (%rax), %rdi
movq (%rdi), %rax
callq *(%rax)
movsd %xmm0, 0x8(%rsp)
movq %r14, %rdi
callq 0x920c
movb $0x1, %al
movl %eax, 0x18(%rsp)
ucomisd 0x8(%rsp), %xmm0
jae 0x21ff2
movl $0x0, 0x18(%rsp)
pushq $0x1
jmp 0x21fb2
movq 0x68(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x68(%rsp)
movq 0x60(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x60(%rsp)
movq 0x58(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x58(%rsp)
movq 0x30(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x30(%rsp)
movq 0x28(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x28(%rsp)
movq 0x20(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x20(%rsp)
movq 0x50(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x50(%rsp)
movq 0x48(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x48(%rsp)
movq 0x40(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x40(%rsp)
movq 0x38(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x38(%rsp)
xorl %ebx, %ebx
leaq 0x148(%rsp), %rdi
callq 0x17632
leaq 0x160(%rsp), %rdi
callq 0x17632
leaq 0x178(%rsp), %rdi
callq 0x17632
leaq 0x190(%rsp), %rdi
callq 0x17632
leaq 0x1a8(%rsp), %rdi
callq 0x17632
leaq 0x1c0(%rsp), %rdi
callq 0x17632
leaq 0xe8(%rsp), %rdi
callq 0x17632
leaq 0x100(%rsp), %rdi
callq 0x17632
leaq 0x118(%rsp), %rdi
callq 0x17632
leaq 0x130(%rsp), %rdi
callq 0x17632
testb $0x3, %bl
movq 0xd8(%rsp), %r14
movq 0xe0(%rsp), %rbx
je 0x21aac
xorl %ebx, %ebx
jmp 0x2214a
cmpq $0x0, 0x80(%rsp)
setne %al
movl 0x18(%rsp), %ecx
andb %al, %cl
xorl %ebx, %ebx
cmpb $0x1, %cl
jne 0x2214a
movq 0x10(%rsp), %rdi
addq $0x140, %rdi            # imm = 0x140
leaq 0x80(%rsp), %rsi
callq 0x2320e
pushq $0x1
popq %rbx
leaq 0x90(%rsp), %rdi
callq 0x71a0
jmp 0x2215b
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x398, %rsp            # imm = 0x398
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 0xcc5e(%rip), %rsi      # 0x2edea
movq %rax, %rdi
callq 0xad94
movq %r15, (%r14)
leaq 0x22b3a(%rip), %rsi     # 0x44cd8
movq %r14, %rdi
xorl %edx, %edx
callq 0x76a0
jmp 0x22390
jmp 0x2232d
jmp 0x22390
jmp 0x2232d
jmp 0x22390
jmp 0x2232d
jmp 0x22390
jmp 0x222fb
movq %rax, %rbx
pushq $0x1
popq %rsi
movq %r15, %rdi
callq 0x7400
jmp 0x221ed
jmp 0x2232d
jmp 0x22390
movq %rax, %rbx
movq %r14, %rdi
callq 0x7300
jmp 0x22422
jmp 0x2232d
jmp 0x22390
movq %rax, %rbx
leaq 0x1d8(%rsp), %rdi
jmp 0x222c0
jmp 0x222fb
movq %rax, %rbx
leaq 0x1f8(%rsp), %rdi
jmp 0x222c0
jmp 0x222fb
movq %rax, %rbx
leaq 0x218(%rsp), %rdi
jmp 0x222c0
jmp 0x222fb
movq %rax, %rbx
leaq 0x238(%rsp), %rdi
jmp 0x222c0
jmp 0x222fb
movq %rax, %rbx
leaq 0x258(%rsp), %rdi
jmp 0x222c0
jmp 0x222fb
movq %rax, %rbx
leaq 0x278(%rsp), %rdi
jmp 0x222c0
jmp 0x222fb
movq %rax, %rbx
leaq 0x298(%rsp), %rdi
jmp 0x222c0
jmp 0x222fb
movq %rax, %rbx
leaq 0x2b8(%rsp), %rdi
jmp 0x222c0
jmp 0x222fb
movq %rax, %rbx
leaq 0x2d8(%rsp), %rdi
jmp 0x222c0
jmp 0x222fb
movq %rax, %rbx
leaq 0x2f8(%rsp), %rdi
jmp 0x222c0
jmp 0x222fb
movq %rax, %rbx
leaq 0x318(%rsp), %rdi
callq 0x71a0
jmp 0x22415
jmp 0x222fb
jmp 0x2232d
jmp 0x22390
movq %rax, %rbx
jmp 0x223a0
movq %rax, %rbx
jmp 0x223ee
movq %rax, %rbx
jmp 0x223e1
movq %rax, %rbx
jmp 0x223d4
movq %rax, %rbx
jmp 0x223c7
movq %rax, %rbx
jmp 0x22415
movq %rax, %rbx
jmp 0x223ba
movq %rax, %rbx
jmp 0x22408
movq %rax, %rbx
jmp 0x223ad
movq %rax, %rbx
jmp 0x223fb
jmp 0x22390
jmp 0x22390
jmp 0x2232d
jmp 0x22390
jmp 0x22390
movq %rax, %rbx
leaq 0xb0(%rsp), %rdi
jmp 0x22389
jmp 0x2233e
jmp 0x22390
movq %rax, %rbx
jmp 0x22353
movq %rax, %rbx
leaq 0xb0(%rsp), %rdi
callq 0x71a0
leaq 0x358(%rsp), %rdi
jmp 0x22389
jmp 0x22371
movq %rax, %rbx
leaq 0xb0(%rsp), %rdi
callq 0x71a0
jmp 0x22374
movq %rax, %rbx
leaq 0x338(%rsp), %rdi
jmp 0x22389
movq %rax, %rbx
leaq 0x378(%rsp), %rdi
callq 0x71a0
jmp 0x22393
movq %rax, %rbx
leaq 0x148(%rsp), %rdi
callq 0x17632
leaq 0x160(%rsp), %rdi
callq 0x17632
leaq 0x178(%rsp), %rdi
callq 0x17632
leaq 0x190(%rsp), %rdi
callq 0x17632
leaq 0x1a8(%rsp), %rdi
callq 0x17632
leaq 0x1c0(%rsp), %rdi
callq 0x17632
leaq 0xe8(%rsp), %rdi
callq 0x17632
leaq 0x100(%rsp), %rdi
callq 0x17632
leaq 0x118(%rsp), %rdi
callq 0x17632
leaq 0x130(%rsp), %rdi
callq 0x17632
leaq 0x90(%rsp), %rdi
callq 0x71a0
movq %rbx, %rdi
callq 0x76d0