// File: /workspace/github_cpp_makefile_star2_O2/richardposner[P]BioNetFit2/src/code/Particle.cpp
// Function: Particle::checkMessagesDE(unsigned int)
bool Particle::checkMessagesDE(unsigned int mid) {
	unsigned int subParID = calcsubParID(mid);
	if ((mid<0)|| (mid >= swarm_->getNumModels()) || (!getSubParticle(mid)) || (!models.at(mid)))
		outputError("checkMessagesDE Failed. Invalid SubParticle.  PID:"+ toString(id_) + "  model id:" + toString(mid)+ "  subParID:" + toString(subParID)+". Quitting !!!");

	Model * mdl= models.at(mid);

	while(1) {

		if (swarm_->options.verbosity >= 3) {
			cout << "Checking for messages from master" << endl;
		}

		int numCheckedMessages = 0;
		int numMessages = swarm_->swarmComm->recvMessage(-1, subParID, -1, true, swarm_->swarmComm->univMessageReceiver, true);


		if (swarm_->options.verbosity >= 3) {
			//cout << "Found " << numMessages << " messages" << endl;

			/*
			for (auto sm = swarm_->swarmComm->univMessageReceiver.begin(); sm != swarm_->swarmComm->univMessageReceiver.end(); ++sm) {
				cout << "tag: " << sm->second.tag << endl;
			}
			 */
		}

		// Holds iterator ranges when finding items in the message holder
		pair <Pheromones::swarmMsgHolderIt, Pheromones::swarmMsgHolderIt> smhRange;

		while (numCheckedMessages < numMessages) {
			smhRange = swarm_->swarmComm->univMessageReceiver.equal_range(SEND_FINAL_PARAMS_TO_PARTICLE);
			if (smhRange.first != smhRange.second) {
				if (swarm_->options.verbosity >= 3) {
					cout << "Receiving parameter list from master mid: " << mid << " simParams size: " << simParams_.size() << " SEND_FINAL_PARAMS_TO_PARTICLE " << SEND_FINAL_PARAMS_TO_PARTICLE << endl;
				}
				for (Pheromones::swarmMsgHolderIt sm = smhRange.first; sm != smhRange.second; ++sm) {
					if (swarm_->options.verbosity >= 4){
						cout << "sm->second.message size: " << sm->second.message.size() << endl;
					}
					//cout << "sm->second.message[0]: " << sm->second.message[0] << endl;
					int messageIndex = 0;
					if(sm->second.message.size()>0){


					for (auto p = simParams_[mid].begin(); p != simParams_[mid].end(); ++p) {
						if (swarm_->options.verbosity >= 3) {
							cout << id_ << " updating parameter " << p->first << " to " << sm->second.message[messageIndex] << endl;
						}
						p->second = stod(sm->second.message[messageIndex]);
						++messageIndex;
					}

					for (unsigned int i = 1; i <= swarm_->options.smoothing; ++i) {

						// Construct our filenames
						string bnglFilename = swarm_->getModelName(mid, false)+"_" + toString(id_) + "_" + toString(i) + ".bngl";
						string path = swarm_->options.jobOutputDir + toString(currentGeneration_ + 1) + "/";
						string bnglFullPath = path + bnglFilename;
						string suffix = toString(id_) + "_" + toString(i);

						if (!checkIfFileExists(path)) {

							runCommand("mkdir " + path);
						}

						// And generate our models
						if (mdl->getHasGenerateNetwork()){
							// If we're using ODE solver, output .net and .bngl
							if (swarm_->options.verbosity >= 3) {
								cout << "Using ODE solver, output .net and .bngl" << endl;
							}
							mdl->outputModelWithParams(simParams_[mid], path, bnglFilename, suffix, false, false, true, false, false);
						}
						else {
							// If we're using network free simulation, output .bngl
							if (swarm_->options.verbosity >= 3) {
								cout << " using network free simulation, output .bngl" << endl;
							}
							mdl->outputModelWithParams(simParams_[mid], path, bnglFilename, suffix, false, false, false, false, false);
						}
					}

					}
					++numCheckedMessages;

				}
			}

			smhRange = swarm_->swarmComm->univMessageReceiver.equal_range(FIT_FINISHED);
			if (smhRange.first != smhRange.second) {

				if (swarm_->options.verbosity >= 3) {
					cout << "SubParticle " << subParID << ": Master told me to die" << endl;
				}
				if (swarm_->options.verbosity >= 3) {
					cout << "RAQUEL entering ~pheromones" << endl;
				}
				swarm_->swarmComm->~Pheromones();
				if (swarm_->options.verbosity >= 3) {
					cout << "RAQUEL exiting ~pheromones" << endl;
				}
				exit(0);
			}

			smhRange = swarm_->swarmComm->univMessageReceiver.equal_range(NEW_BOOTSTRAP);
			if (smhRange.first != smhRange.second) {

				if (swarm_->options.verbosity >= 3) {
					cout << "SubParticle " << subParID << ": Starting a new bootstrapping run" << endl;
				}

				++swarm_->bootstrapCounter;
				currentGeneration_ = 1;

				swarm_->swarmComm->univMessageReceiver.clear();
				return true;
			}

			smhRange = swarm_->swarmComm->univMessageReceiver.equal_range(BEGIN_NELDER_MEAD);
			if (smhRange.first != smhRange.second) {

				if (swarm_->options.verbosity >= 3) {
					cout << "Beginning Nelder-Mead local search" << endl;

					cout << "deserializing simplex" << endl;
				}
				std::stringstream iss;
				iss.str(smhRange.first->second.message[0]); // Simplex is serialized in the first indice of the message vector
				boost::archive::text_iarchive ia(iss);
				map<double, vector<double> > simplex;
				ia >> simplex;
				if (swarm_->options.verbosity >= 3) {
					cout << "running search" << endl;
				}
				runNelderMead(simplex, mid);
				if (swarm_->options.verbosity >= 3) {
					cout << "nelder mead finished. old calc: " << simplex.begin()->first << " new calc: " << fitCalcs.at(mid)[-1] << endl;
				}
				vector<string> paramsStr;
				paramsStr.push_back(toString(fitCalcs.at(mid)[-1]));
				for (auto p = simParams_.at(mid).begin(); p != simParams_.at(mid).end(); ++p) {
					paramsStr.push_back(toString(p->second));
					if (swarm_->options.verbosity >= 3) {
						cout << "new param: " << p->second << endl;
					}
				}
				swarm_->swarmComm->sendToSwarm(subParID, 0, SIMULATION_END, false, paramsStr);
				swarm_->swarmComm->univMessageReceiver.clear();

				return false;
			}

			smhRange = swarm_->swarmComm->univMessageReceiver.equal_range(NEXT_GENERATION);
			if (smhRange.first != smhRange.second) {

				if (swarm_->options.verbosity >= 3) {
					cout  << "SubParticle " << subParID <<  ": Master told me to move to the next iteration" << endl;
				}

				swarm_->swarmComm->univMessageReceiver.clear();
				return true;
			}
		}
		swarm_->swarmComm->univMessageReceiver.clear();
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x4e8, %rsp            # imm = 0x4E8
movl %esi, %ebp
movq %rdi, %rbx
callq 0x5645e
movq 0xa8(%rbx), %rcx
movq 0x15c8(%rcx), %rdx
subq 0x15c0(%rcx), %rdx
movl %eax, 0x8(%rsp)
shrq $0x3, %rdx
movl %ebp, %eax
movq %rax, 0x10(%rsp)
movl %ebp, 0xc(%rsp)
cmpl %ebp, %edx
jbe 0x58788
movq %rbx, %rdi
movl 0xc(%rsp), %esi
callq 0x59f90
testq %rax, %rax
je 0x58788
leaq 0x78(%rbx), %rdi
movq 0x10(%rsp), %rsi
callq 0x3374c
cmpq $0x0, (%rax)
jne 0x588d2
movl 0x40(%rbx), %esi
leaq 0xc0(%rsp), %r14
movq %r14, %rdi
callq 0x9f56b
leaq 0x7e993(%rip), %rsi     # 0xd7135
leaq 0x40(%rsp), %rdi
movq %r14, %rdx
callq 0x4933b
leaq 0x7e421(%rip), %rdx     # 0xd6bd7
leaq 0x20(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0x3336c
leaq 0xe0(%rsp), %rdi
movl 0xc(%rsp), %esi
callq 0x9f56b
leaq 0x88(%rsp), %rdi
leaq 0x20(%rsp), %rsi
leaq 0xe0(%rsp), %rdx
callq 0x4e6ed
leaq 0x7de8d(%rip), %rdx     # 0xd6684
leaq 0x130(%rsp), %rdi
leaq 0x88(%rsp), %rsi
callq 0x3336c
leaq 0x110(%rsp), %rdi
movl 0x8(%rsp), %esi
callq 0x9f56b
leaq 0x360(%rsp), %rdi
leaq 0x130(%rsp), %rsi
leaq 0x110(%rsp), %rdx
callq 0x4e6ed
leaq 0x7e4b1(%rip), %rdx     # 0xd6cf2
leaq 0x1b0(%rsp), %rdi
leaq 0x360(%rsp), %rsi
callq 0x3336c
leaq 0x1b0(%rsp), %rdi
callq 0x9f54b
leaq 0x1b0(%rsp), %rdi
callq 0x295a0
leaq 0x360(%rsp), %rdi
callq 0x295a0
leaq 0x110(%rsp), %rdi
callq 0x295a0
leaq 0x130(%rsp), %rdi
callq 0x295a0
leaq 0x88(%rsp), %rdi
callq 0x295a0
leaq 0xe0(%rsp), %rdi
callq 0x295a0
leaq 0x20(%rsp), %rdi
callq 0x295a0
leaq 0x40(%rsp), %rdi
callq 0x295a0
leaq 0xc0(%rsp), %rdi
callq 0x295a0
leaq 0x78(%rbx), %rdi
movq 0x10(%rsp), %rsi
callq 0x3374c
movq (%rax), %rax
movq %rax, 0x70(%rsp)
movl 0x8(%rsp), %eax
movq %rax, 0x68(%rsp)
leaq 0x18(%rbx), %rax
movq %rax, 0xb8(%rsp)
leaq 0x360(%rsp), %r13
leaq 0x130(%rsp), %rbp
leaq 0x1d0(%rsp), %r12
movl %eax, 0x4(%rsp)
movq 0xa8(%rbx), %rax
cmpl $0x3, 0x1614(%rax)
jb 0x5894b
movq 0x10d668(%rip), %rdi    # 0x165f98
leaq 0x7e831(%rip), %rsi     # 0xd7168
callq 0x289f0
movq %rax, %rdi
callq 0x284a0
movq 0xa8(%rbx), %rax
movq (%rax), %rdi
leaq 0x18(%rdi), %r9
pushq $-0x1
popq %rcx
movl %ecx, %esi
movl 0x8(%rsp), %edx
pushq $0x1
popq %r8
pushq $-0x1
pushq $0x1
callq 0x60fd6
popq %rcx
popq %rdx
movl %eax, 0x1c(%rsp)
xorl %r15d, %r15d
movq 0xa8(%rbx), %rax
movq (%rax), %rdi
addq $0x18, %rdi
movl %r15d, 0x18(%rsp)
cmpl 0x1c(%rsp), %r15d
jge 0x590cd
movl $0x15, 0x360(%rsp)
movq %r13, %rsi
callq 0x5da18
movq %rax, %r15
movq 0xa8(%rbx), %rax
movq %rdx, 0x100(%rsp)
cmpq %rdx, %r15
je 0x58fce
cmpl $0x3, 0x1614(%rax)
jb 0x58a31
movq 0x10d5cb(%rip), %rdi    # 0x165f98
leaq 0x7e7b6(%rip), %rsi     # 0xd718a
callq 0x289f0
movq %rax, %rdi
movq 0x10(%rsp), %rsi
callq 0x286e0
movq %rax, %rdi
leaq 0x7e7c5(%rip), %rsi     # 0xd71b5
callq 0x289f0
movq %rax, %rdi
movq 0x8(%rbx), %rax
subq (%rbx), %rax
cqto
pushq $0x30
popq %rcx
idivq %rcx
movq %rax, %rsi
callq 0x286e0
movq %rax, %rdi
leaq 0x7e7ae(%rip), %rsi     # 0xd71c7
callq 0x289f0
movq %rax, %rdi
pushq $0x15
popq %rsi
callq 0x29290
movq %rax, %rdi
callq 0x284a0
movl 0x18(%rsp), %r14d
movq 0xa8(%rbx), %rax
cmpq 0x100(%rsp), %r15
je 0x58fd3
movl %r14d, 0x84(%rsp)
cmpl $0x4, 0x1614(%rax)
jb 0x58a8b
movq 0x10d535(%rip), %rdi    # 0x165f98
leaq 0x7e77d(%rip), %rsi     # 0xd71e7
callq 0x289f0
movq 0x40(%r15), %rsi
subq 0x38(%r15), %rsi
sarq $0x5, %rsi
movq %rax, %rdi
callq 0x286e0
movq %rax, %rdi
callq 0x284a0
movq 0x40(%r15), %rax
cmpq 0x38(%r15), %rax
je 0x58fab
movq (%rbx), %rax
imulq $0x30, 0x10(%rsp), %rcx
movq %rcx, 0x78(%rsp)
movq 0x18(%rax,%rcx), %r13
xorl %r14d, %r14d
movq 0x78(%rsp), %rcx
addq %rcx, %rax
addq $0x8, %rax
cmpq %rax, %r13
je 0x58b5d
movq %rbx, %r12
movq 0xa8(%rbx), %rax
cmpl $0x3, 0x1614(%rax)
jb 0x58b29
movl 0x40(%r12), %esi
movq 0x10d4b5(%rip), %rdi    # 0x165f98
callq 0x286e0
movq %rax, %rdi
leaq 0x7e347(%rip), %rsi     # 0xd6e39
callq 0x289f0
leaq 0x20(%r13), %rsi
movq %rax, %rdi
callq 0x28910
movq %rax, %rdi
leaq 0x86368(%rip), %rsi     # 0xdee75
callq 0x289f0
movq 0x38(%r15), %rsi
addq %r14, %rsi
movq %rax, %rdi
callq 0x28910
movq %rax, %rdi
callq 0x284a0
movq 0x38(%r15), %rdi
addq %r14, %rdi
xorl %esi, %esi
callq 0x33525
movsd %xmm0, 0x40(%r13)
movq %r13, %rdi
callq 0x28700
movq %rax, %r13
movq (%r12), %rax
addq $0x20, %r14
leaq 0x1d0(%rsp), %r12
jmp 0x58aaf
pushq $0x1
popq %r13
movq %r15, 0x108(%rsp)
movq 0xa8(%rbx), %rsi
cmpl 0x1658(%rsi), %r13d
leaq 0xc0(%rsp), %rdi
ja 0x58fab
movl 0xc(%rsp), %edx
xorl %ecx, %ecx
movq %rdi, %r14
callq 0x6bd9a
leaq 0x40(%rsp), %rdi
movq %r14, %rsi
leaq 0x7d1c5(%rip), %rdx     # 0xd5d67
callq 0x3336c
movl 0x40(%rbx), %esi
leaq 0xe0(%rsp), %r15
movq %r15, %rdi
callq 0x9f56b
leaq 0x20(%rsp), %r14
movq %r14, %rdi
leaq 0x40(%rsp), %rsi
movq %r15, %rdx
callq 0x4e6ed
leaq 0x88(%rsp), %rdi
movq %r14, %rsi
leaq 0x7d186(%rip), %rdx     # 0xd5d67
callq 0x3336c
leaq 0x110(%rsp), %r15
movq %r15, %rdi
movl %r13d, %esi
callq 0x9f56b
leaq 0x130(%rsp), %r14
movq %r14, %rdi
leaq 0x88(%rsp), %rsi
movq %r15, %rdx
callq 0x4e6ed
leaq 0x360(%rsp), %rdi
movq %r14, %rsi
leaq 0x7e5fd(%rip), %rdx     # 0xd7223
callq 0x3336c
movq %r14, %rdi
callq 0x295a0
movq %r15, %rdi
callq 0x295a0
leaq 0x88(%rsp), %r12
movq %r12, %rdi
callq 0x295a0
leaq 0x20(%rsp), %r15
movq %r15, %rdi
callq 0x295a0
leaq 0xe0(%rsp), %rdi
callq 0x295a0
leaq 0x40(%rsp), %rdi
callq 0x295a0
leaq 0xc0(%rsp), %rdi
callq 0x295a0
movq 0xa8(%rbx), %r14
movl 0xb0(%rbx), %esi
incl %esi
movq %r15, %rdi
callq 0x9f56b
addq $0x1520, %r14           # imm = 0x1520
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x5a115
leaq 0x130(%rsp), %r14
movq %r14, %rdi
movq %r12, %rsi
leaq 0x84cfa(%rip), %rdx     # 0xdd9b7
callq 0x3336c
movq %r12, %rdi
callq 0x295a0
leaq 0x20(%rsp), %rdi
callq 0x295a0
movq %r12, %rdi
movq %r14, %rsi
leaq 0x360(%rsp), %rdx
callq 0x34fc8
movl 0x40(%rbx), %esi
leaq 0xc0(%rsp), %r14
movq %r14, %rdi
callq 0x9f56b
leaq 0x40(%rsp), %rdi
movq %r14, %rsi
leaq 0x7d05e(%rip), %rdx     # 0xd5d67
callq 0x3336c
leaq 0xe0(%rsp), %r15
movq %r15, %rdi
movl %r13d, %esi
callq 0x9f56b
leaq 0x20(%rsp), %rdi
leaq 0x40(%rsp), %r14
movq %r14, %rsi
movq %r15, %rdx
callq 0x4e6ed
movq %r15, %rdi
callq 0x295a0
movq %r14, %rdi
callq 0x295a0
leaq 0xc0(%rsp), %rdi
callq 0x295a0
leaq 0x2a0(%rsp), %rdi
leaq 0x130(%rsp), %rsi
callq 0x28dd0
leaq 0x2a0(%rsp), %r15
movq %r15, %rdi
callq 0x9ec28
movl %eax, %r14d
movq %r15, %rdi
callq 0x295a0
testl %r14d, %r14d
jne 0x58dbc
leaq 0x280(%rsp), %rdi
leaq 0x7d100(%rip), %rsi     # 0xd5e97
leaq 0x130(%rsp), %rdx
callq 0x3338b
leaq 0x280(%rsp), %r14
movq %r14, %rdi
callq 0x9f543
movq %r14, %rdi
callq 0x295a0
movq 0xa8(%rbx), %rax
movl 0x1614(%rax), %eax
movq 0x70(%rsp), %rcx
cmpb $0x1, 0xb8(%rcx)
jne 0x58e91
cmpl $0x3, %eax
jb 0x58dfb
movq 0x10d1b1(%rip), %rdi    # 0x165f98
leaq 0x7e413(%rip), %rsi     # 0xd7201
callq 0x289f0
movq %rax, %rdi
callq 0x284a0
movq (%rbx), %rsi
addq 0x78(%rsp), %rsi
leaq 0x330(%rsp), %rdi
callq 0x4e96a
leaq 0x260(%rsp), %rdi
leaq 0x130(%rsp), %rsi
callq 0x28dd0
leaq 0x240(%rsp), %rdi
leaq 0x360(%rsp), %rsi
callq 0x28dd0
leaq 0x310(%rsp), %rbp
movq %rbp, %rdi
leaq 0x20(%rsp), %rsi
callq 0x28dd0
movq 0x70(%rsp), %rdi
leaq 0x330(%rsp), %r14
movq %r14, %rsi
leaq 0x260(%rsp), %r12
movq %r12, %rdx
leaq 0x240(%rsp), %r15
movq %r15, %rcx
movq %rbp, %r8
xorl %r9d, %r9d
pushq $0x0
pushq $0x0
pushq $0x1
pushq $0x0
callq 0x4cf22
addq $0x20, %rsp
jmp 0x58f42
cmpl $0x3, %eax
jb 0x58eb1
movq 0x10d0fb(%rip), %rdi    # 0x165f98
leaq 0x7e385(%rip), %rsi     # 0xd7229
callq 0x289f0
movq %rax, %rdi
callq 0x284a0
movq (%rbx), %rsi
addq 0x78(%rsp), %rsi
leaq 0x2e0(%rsp), %rdi
callq 0x4e96a
leaq 0x220(%rsp), %rdi
leaq 0x130(%rsp), %rsi
callq 0x28dd0
leaq 0x200(%rsp), %rdi
leaq 0x360(%rsp), %rsi
callq 0x28dd0
leaq 0x2c0(%rsp), %rbp
movq %rbp, %rdi
leaq 0x20(%rsp), %rsi
callq 0x28dd0
movq 0x70(%rsp), %rdi
leaq 0x2e0(%rsp), %r14
movq %r14, %rsi
leaq 0x220(%rsp), %r12
movq %r12, %rdx
leaq 0x200(%rsp), %r15
movq %r15, %rcx
movq %rbp, %r8
xorl %r9d, %r9d
pushq $0x0
pushq $0x0
pushq $0x0
pushq $0x0
callq 0x4cf22
addq $0x20, %rsp
movq %rbp, %rdi
callq 0x295a0
movq %r15, %rdi
callq 0x295a0
movq %r12, %rdi
callq 0x295a0
movq %r14, %rdi
callq 0x495ac
leaq 0x20(%rsp), %rdi
callq 0x295a0
leaq 0x88(%rsp), %rdi
callq 0x295a0
leaq 0x130(%rsp), %rdi
callq 0x295a0
leaq 0x360(%rsp), %rdi
callq 0x295a0
incl %r13d
leaq 0x1d0(%rsp), %r12
movq 0x108(%rsp), %r15
jmp 0x58b69
movl 0x84(%rsp), %r14d
incl %r14d
movq (%r15), %r15
leaq 0x360(%rsp), %r13
leaq 0x130(%rsp), %rbp
jmp 0x58a36
movl 0x18(%rsp), %r14d
movq (%rax), %rdi
addq $0x18, %rdi
movl $0x16, 0x360(%rsp)
movq %r13, %rsi
callq 0x5da18
movq 0xa8(%rbx), %rcx
cmpq %rdx, %rax
jne 0x5944e
movq (%rcx), %rdi
addq $0x18, %rdi
movl $0x19, 0x360(%rsp)
movq %r13, %rsi
callq 0x5da18
movq 0xa8(%rbx), %rcx
cmpq %rdx, %rax
jne 0x590d7
movl %r14d, %r15d
movq (%rcx), %rdi
addq $0x18, %rdi
movl $0x1a, 0x360(%rsp)
movq %r13, %rsi
callq 0x5da18
movq %rax, %r14
movq 0xa8(%rbx), %rax
cmpq %rdx, %r14
jne 0x59145
movq (%rax), %rdi
addq $0x18, %rdi
movl $0x12, 0x360(%rsp)
movq %r13, %rsi
callq 0x5da18
cmpq %rdx, %rax
je 0x58971
movq 0xa8(%rbx), %rax
cmpl $0x3, 0x1614(%rax)
jb 0x590c8
movq 0x10cf07(%rip), %rdi    # 0x165f98
leaq 0x84fea(%rip), %rsi     # 0xde082
callq 0x289f0
movq %rax, %rdi
movq 0x68(%rsp), %rsi
callq 0x286e0
movq %rax, %rdi
leaq 0x7e23b(%rip), %rsi     # 0xd72ef
callq 0x289f0
movq %rax, %rdi
callq 0x284a0
movq 0xa8(%rbx), %rax
movq (%rax), %rdi
jmp 0x59131
callq 0x5d19a
jmp 0x59428
cmpl $0x3, 0x1614(%rcx)
jb 0x5911e
movq 0x10ceb1(%rip), %rdi    # 0x165f98
leaq 0x84f94(%rip), %rsi     # 0xde082
callq 0x289f0
movq %rax, %rdi
movq 0x68(%rsp), %rsi
callq 0x286e0
movq %rax, %rdi
leaq 0x7de96(%rip), %rsi     # 0xd6fa0
callq 0x289f0
movq %rax, %rdi
callq 0x284a0
movq 0xa8(%rbx), %rcx
incl 0x13ec(%rcx)
movl $0x1, 0xb0(%rbx)
movq (%rcx), %rdi
addq $0x18, %rdi
callq 0x5d19a
movb $0x1, %al
movl %eax, 0x4(%rsp)
jmp 0x59428
cmpl $0x3, 0x1614(%rax)
jb 0x5918b
movq 0x10ce43(%rip), %r12    # 0x165f98
movq %r12, %rdi
leaq 0x7e10f(%rip), %rsi     # 0xd726e
callq 0x289f0
movq %rax, %rdi
callq 0x284a0
movq %r12, %rdi
leaq 0x1d0(%rsp), %r12
leaq 0x7e113(%rip), %rsi     # 0xd7291
callq 0x289f0
movq %rax, %rdi
callq 0x284a0
movq %r13, %rdi
callq 0x28710
movq 0x38(%r14), %rsi
leaq 0x378(%rsp), %rdi
callq 0x28f70
movq %rbp, %rdi
movq %r13, %rsi
xorl %edx, %edx
callq 0x5a262
andl $0x0, 0x90(%rsp)
andq $0x0, 0x98(%rsp)
leaq 0x90(%rsp), %rax
movq %rax, 0xa0(%rsp)
movq %rax, 0xa8(%rsp)
andq $0x0, 0xb0(%rsp)
movq %rbp, %rdi
leaq 0x88(%rsp), %rsi
callq 0x5da6a
movq 0xa8(%rbx), %rax
cmpl $0x3, 0x1614(%rax)
jb 0x5921e
movq 0x10cd8e(%rip), %rdi    # 0x165f98
leaq 0x7e096(%rip), %rsi     # 0xd72a7
callq 0x289f0
movq %rax, %rdi
callq 0x284a0
movq %r12, %rdi
leaq 0x88(%rsp), %rsi
callq 0x5afc6
movq %rbx, %rdi
movq %r12, %rsi
movl 0xc(%rsp), %edx
callq 0x51194
movq %r12, %rdi
callq 0x5b254
movq 0xa8(%rbx), %rax
cmpl $0x3, 0x1614(%rax)
jb 0x592c7
movq 0x10cd3c(%rip), %rdi    # 0x165f98
leaq 0x7e053(%rip), %rsi     # 0xd72b6
callq 0x289f0
movq 0xa0(%rsp), %rcx
movsd 0x20(%rcx), %xmm0
movq %rax, %rdi
callq 0x290f0
movq %rax, %rdi
leaq 0x7e050(%rip), %rsi     # 0xd72d7
callq 0x289f0
movq %rax, %r14
movq 0xb8(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0x5a0a2
orl $-0x1, 0x20(%rsp)
movq %rax, %rdi
leaq 0x20(%rsp), %rsi
callq 0x5a0c0
movsd (%rax), %xmm0
movq %r14, %rdi
callq 0x290f0
movq %rax, %rdi
callq 0x284a0
xorps %xmm0, %xmm0
movaps %xmm0, 0x40(%rsp)
andq $0x0, 0x50(%rsp)
movq 0xb8(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0x5a0a2
orl $-0x1, 0xc0(%rsp)
movq %rax, %rdi
leaq 0xc0(%rsp), %rsi
callq 0x5a0c0
leaq 0x20(%rsp), %r14
movsd (%rax), %xmm0
movq %r14, %rdi
callq 0x9f57b
leaq 0x40(%rsp), %rdi
movq %r14, %rsi
callq 0x5ec8c
movq %r14, %rdi
callq 0x295a0
movq %rbx, %rdi
movq 0x10(%rsp), %rsi
callq 0x59f72
movq 0x18(%rax), %r14
movq %rbx, %rdi
movq 0x10(%rsp), %rsi
callq 0x59f72
addq $0x8, %rax
cmpq %rax, %r14
je 0x593bd
movsd 0x40(%r14), %xmm0
leaq 0x20(%rsp), %r15
movq %r15, %rdi
callq 0x9f57b
leaq 0x40(%rsp), %rdi
movq %r15, %rsi
callq 0x5ec8c
movq %r15, %rdi
callq 0x295a0
movq 0xa8(%rbx), %rax
cmpl $0x3, 0x1614(%rax)
jb 0x593ad
movq 0x10cc0d(%rip), %rdi    # 0x165f98
leaq 0x7df51(%rip), %rsi     # 0xd72e3
callq 0x289f0
movsd 0x40(%r14), %xmm0
movq %rax, %rdi
callq 0x290f0
movq %rax, %rdi
callq 0x284a0
movq %r14, %rdi
callq 0x28700
movq %rax, %r14
jmp 0x59336
movq 0xa8(%rbx), %rax
movq (%rax), %rdi
subq $0x8, %rsp
movl 0x10(%rsp), %esi
xorl %edx, %edx
pushq $0xd
popq %rcx
xorl %r8d, %r8d
leaq 0x48(%rsp), %r14
movq %r14, %r9
pushq $-0x1
callq 0x600c8
popq %rax
popq %rcx
movq 0xa8(%rbx), %rax
movq (%rax), %rdi
addq $0x18, %rdi
callq 0x5d19a
movq %r14, %rdi
callq 0x3355a
leaq 0x88(%rsp), %rdi
callq 0x5b254
movq %rbp, %rdi
callq 0x5a2a0
movq %r13, %rdi
callq 0x28790
movl $0x0, 0x4(%rsp)
movl 0x18(%rsp), %eax
cmpl 0x1c(%rsp), %eax
jge 0x58919
movl 0x4(%rsp), %eax
andb $0x1, %al
addq $0x4e8, %rsp            # imm = 0x4E8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x3, 0x1614(%rcx)
jb 0x594c0
movq 0x10cb3a(%rip), %rdi    # 0x165f98
leaq 0x84c1d(%rip), %rsi     # 0xde082
callq 0x289f0
movq %rax, %rdi
movq 0x68(%rsp), %rsi
callq 0x286e0
leaq 0x7ddd8(%rip), %rsi     # 0xd7256
movq %rax, %rdi
callq 0x289f0
movq %rax, %rdi
callq 0x284a0
movq 0xa8(%rbx), %rcx
cmpl $0x3, 0x1614(%rcx)
jb 0x594c0
movq 0x10caf3(%rip), %rdi    # 0x165f98
leaq 0x7dabd(%rip), %rsi     # 0xd6f69
callq 0x289f0
movq %rax, %rdi
callq 0x284a0
movq 0xa8(%rbx), %rcx
movq (%rcx), %rdi
callq 0x5fb5c
movq 0xa8(%rbx), %rax
cmpl $0x3, 0x1614(%rax)
jb 0x594f3
movq 0x10cab9(%rip), %rdi    # 0x165f98
leaq 0x7da9f(%rip), %rsi     # 0xd6f85
callq 0x289f0
movq %rax, %rdi
callq 0x284a0
xorl %edi, %edi
callq 0x28c20
movq %rax, %rbx
leaq 0x1b0(%rsp), %rdi
callq 0x295a0
jmp 0x5950f
movq %rax, %rbx
leaq 0x360(%rsp), %rdi
callq 0x295a0
jmp 0x59521
movq %rax, %rbx
leaq 0x110(%rsp), %rdi
callq 0x295a0
jmp 0x59533
movq %rax, %rbx
leaq 0x130(%rsp), %rdi
callq 0x295a0
jmp 0x59545
movq %rax, %rbx
leaq 0x88(%rsp), %rdi
callq 0x295a0
leaq 0xe0(%rsp), %rdi
callq 0x295a0
leaq 0x20(%rsp), %rdi
callq 0x295a0
leaq 0x40(%rsp), %rdi
callq 0x295a0
jmp 0x5976e
movq %rax, %rbx
jmp 0x59552
movq %rax, %rbx
jmp 0x5955f
movq %rax, %rbx
jmp 0x59569
movq %rax, %rbx
jmp 0x59573
jmp 0x595ba
movq %rax, %rbx
leaq 0x1d0(%rsp), %rdi
callq 0x5b254
jmp 0x595d8
jmp 0x595cb
jmp 0x595a4
movq %rax, %rbx
jmp 0x595f2
jmp 0x595cb
jmp 0x595cb
jmp 0x595b3
jmp 0x595b3
jmp 0x595cb
movq %rax, %rbx
jmp 0x595d8
jmp 0x595cb
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x295a0
jmp 0x595ce
jmp 0x595cb
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x3355a
leaq 0x88(%rsp), %rdi
callq 0x5b254
leaq 0x130(%rsp), %rdi
callq 0x5a2a0
leaq 0x360(%rsp), %rdi
callq 0x28790
jmp 0x597c3
movq %rax, %rbx
leaq 0x280(%rsp), %rdi
jmp 0x59783
movq %rax, %rbx
leaq 0x2c0(%rsp), %rdi
callq 0x295a0
jmp 0x59633
movq %rax, %rbx
jmp 0x59690
movq %rax, %rbx
jmp 0x59676
movq %rax, %rbx
leaq 0x200(%rsp), %rdi
callq 0x295a0
jmp 0x59683
movq %rax, %rbx
jmp 0x5965c
movq %rax, %rbx
jmp 0x59669
movq %rax, %rbx
leaq 0x310(%rsp), %rdi
callq 0x295a0
leaq 0x240(%rsp), %rdi
callq 0x295a0
leaq 0x260(%rsp), %rdi
callq 0x295a0
leaq 0x330(%rsp), %rdi
jmp 0x59698
movq %rax, %rbx
leaq 0x220(%rsp), %rdi
callq 0x295a0
leaq 0x2e0(%rsp), %rdi
callq 0x495ac
jmp 0x59792
movq %rax, %rbx
jmp 0x596c7
movq %rax, %rbx
jmp 0x5976e
movq %rax, %rbx
jmp 0x59764
movq %rax, %rbx
leaq 0x88(%rsp), %rdi
callq 0x295a0
leaq 0x20(%rsp), %rdi
jmp 0x597b1
movq %rax, %rbx
jmp 0x597a9
movq %rax, %rbx
jmp 0x59757
movq %rax, %rbx
jmp 0x5979c
movq %rax, %rbx
jmp 0x5974d
movq %rax, %rbx
jmp 0x59740
movq %rax, %rbx
jmp 0x59719
movq %rax, %rbx
jmp 0x59733
movq %rax, %rbx
jmp 0x5970f
movq %rax, %rbx
leaq 0xe0(%rsp), %rdi
callq 0x295a0
leaq 0x40(%rsp), %rdi
callq 0x295a0
leaq 0xc0(%rsp), %rdi
jmp 0x59797
movq %rax, %rbx
leaq 0x130(%rsp), %rdi
callq 0x295a0
leaq 0x110(%rsp), %rdi
callq 0x295a0
leaq 0x88(%rsp), %rdi
callq 0x295a0
leaq 0x20(%rsp), %rdi
callq 0x295a0
leaq 0xe0(%rsp), %rdi
callq 0x295a0
leaq 0x40(%rsp), %rdi
callq 0x295a0
leaq 0xc0(%rsp), %rdi
jmp 0x597be
movq %rax, %rbx
leaq 0x2a0(%rsp), %rdi
callq 0x295a0
jmp 0x59792
movq %rax, %rbx
jmp 0x597b6
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x295a0
leaq 0x88(%rsp), %rdi
callq 0x295a0
leaq 0x130(%rsp), %rdi
callq 0x295a0
leaq 0x360(%rsp), %rdi
callq 0x295a0
movq %rbx, %rdi
callq 0x292f0
nop