// File: /workspace/github_cpp_makefile_star2_O2/richardposner[P]BioNetFit2/src/code/Particle.cpp
// Function: Particle::checkMessagesPSO(unsigned int)
void Particle::checkMessagesPSO(unsigned int mid) {

	unsigned int subParID = calcsubParID(mid);
	if ((mid<0)|| (mid >= swarm_->getNumModels()) || (!models.at(mid)))
	    outputError("checkMessagesGenetic Failed. Invalid SubParticle.  PID:"+ toString(id_) + "  model id:" + toString(mid)+ "  subParID:" + toString(subParID)+". Quitting !!!" );
	//if ((mid<0)|| (mid >= swarm_->getNumModels()) || (!getSubParticle(mid)) || (!models.at(mid)))
	//outputError("checkMessagesGenetic Failed. Invalid SubParticle.  PID:"+ toString(id_) + "  model id:" + toString(mid)+ "  subParID:" + toString(subParID)+". Quitting !!!");
	if (swarm_->options.verbosity >= 3) {
		cout << "RAQUEL: I am subparticle " << subParID << " my model is " << mid << " generation " << currentGeneration_ << endl;
	}
	Model * mdl= models.at(mid);
		// Holds iterator ranges when finding items in the message holder
		pair <Pheromones::swarmMsgHolderIt, Pheromones::swarmMsgHolderIt> smhRange;
		if (swarm_->options.verbosity >= 3) {
			cout << "RAQUEL entering while from function that takes mid as input" << endl;
		}
		string path; //Raquel: declaring it outside the while loop


		while (1) {
			// Retrieve any messages
			int numCheckedMessages = 0;
			if (swarm_->options.verbosity >= 3) {
				cout << "RAQUEL I am subPar " << subParID << " model " << mid << " waiting for message." << endl;
			}
			int numMessages = swarm_->swarmComm->recvMessage(-1, subParID, -1, true, swarm_->swarmComm->univMessageReceiver, true);
			if (swarm_->options.verbosity >= 3) {
				cout << "RAQUEL inside LOOP ITERATION in checkMessagesGenetic" << endl;

				cout << "RAQUEL entering univMessageReceiver.equal_range(SEND_FINAL_PARAMS_TO_PARTICLE)" << endl;
			}
			smhRange = swarm_->swarmComm->univMessageReceiver.equal_range(SEND_FINAL_PARAMS_TO_PARTICLE);
			if (swarm_->options.verbosity >= 3) {
				cout << "RAQUEL passed univMessageReceiver.equal_range(SEND_FINAL_PARAMS_TO_PARTICLE)" << endl;
			}

			if (smhRange.first != smhRange.second) {
				if (swarm_->options.verbosity >= 3) {
					cout << subParID << " found final params" << endl;
				}
				for (Pheromones::swarmMsgHolderIt sm = smhRange.first; sm != smhRange.second; ++sm) {
					//Timer tmr;

					int messageIndex = 0;
					for (auto p = simParams_.at(mid).begin(); p != simParams_.at(mid).end(); ++p) {
						//cout << id_ << " updating parameter " << p->first << " to " << sm->second.message[messageIndex] << endl;
						p->second = stod(sm->second.message[messageIndex]);
						//cout << "updated param " << p->first << ": " << p->second << endl;
						++messageIndex;
					}

					path = swarm_->options.jobOutputDir + toString(currentGeneration_ + 1) + "/";

					if (!checkIfFileExists(path)) {
						runCommand("mkdir " + path);
					}

					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 bnglFullPath = path + bnglFilename;
						string suffix = toString(id_) + "_" + toString(i);
						if (swarm_->options.verbosity >= 3) {
							cout << "RAQUEL CREATING BNGL: " << bnglFullPath << endl;
						}
						// And generate our models
						if (swarm_->options.models.at(mid)->getHasGenerateNetwork()){
							// If we're using ODE solver, output .net and .bngl
							mdl->outputModelWithParams(simParams_.at(mid), path, bnglFilename, suffix, false, false, true, false, false);
						}
						else {
							// If we're using network free simulation, output .bngl
							mdl->outputModelWithParams(simParams_.at(mid), path, bnglFilename, suffix, false, false, false, false, false);
						}
						if (swarm_->options.verbosity >= 3) {
							cout << "RAQUEL BNGL generated: " <<  bnglFullPath << " id_ " << toString(id_) << " i " << toString(i) << " subParID " << subParID << endl;
						}
					}

					// Tell the master we have our new params and are ready for the next generation
					//cout << id_ << " telling master we're finished " << endl;
					//swarm_->swarmComm->sendToSwarm(subParID, 0, DONE_BREEDING, false, swarm_->swarmComm->univMessageSender);

					//double t = tmr.elapsed();
					//cout << "SEND_FINAL_PARAMS took " << t << " seconds" << endl;
					++numCheckedMessages;
				}
			}

			if (swarm_->options.verbosity >= 3) {
				cout << "RAQUEL BEFORE IF numCheckedMessages >= numMessages" << endl;
			}
			if (numCheckedMessages >= numMessages) {
				swarm_->swarmComm->univMessageReceiver.clear();
				if (swarm_->options.verbosity >= 3) {
					cout << "RAQUEL INSIDE IF numCheckedMessages >= numMessages = " << numCheckedMessages << ":" << numMessages << endl;
				}
				continue;
				//return 0; //Raquel: added
			}
			if (swarm_->options.verbosity >= 3) {
				cout << "RAQUEL PASSED IF numCheckedMessages >= numMessages" << endl;

			}

			if (swarm_->swarmComm->univMessageReceiver.find(FIT_FINISHED) != swarm_->swarmComm->univMessageReceiver.end()) {
				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);
				//return;
			}

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

				++swarm_->bootstrapCounter;
				currentGeneration_ = 0;
				simParams_.at(mid).clear();
				generateParams();
				if (swarm_->options.verbosity >= 3) {
					cout << "RAQUEL INSIDE IF swarm_->swarmComm->univMessageReceiver.find(NEW_BOOTSTRAP)" << endl;
				}
				swarm_->swarmComm->univMessageReceiver.clear();
				return;
			}

			if (swarm_->swarmComm->univMessageReceiver.find(NEXT_GENERATION) != swarm_->swarmComm->univMessageReceiver.end()) {
				if (swarm_->options.verbosity >= 3) {
					cout << "RAQUEL INSIDE IF swarm_->swarmComm->univMessageReceiver.find(NEXT_GENERATION)" << endl;
				}
				swarm_->swarmComm->univMessageReceiver.clear();
				
				return;
			}

			swarm_->swarmComm->univMessageReceiver.clear();
		}
		if(swarm_->options.verbosity >=4){
			cout << "RAQUEL exiting while that takes mid as input" << endl;
		}


}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2e8, %rsp            # imm = 0x2E8
movl %esi, %ebp
movq %rdi, %rbx
callq 0x5645e
movq 0xa8(%rbx), %rcx
movq 0x15c8(%rcx), %rdx
subq 0x15c0(%rcx), %rdx
movl %eax, 0x1c(%rsp)
shrq $0x3, %rdx
movl %ebp, %r14d
movl %ebp, 0x24(%rsp)
cmpl %ebp, %edx
jbe 0x5786d
leaq 0x78(%rbx), %rdi
movq %r14, %rsi
callq 0x3374c
cmpq $0x0, (%rax)
jne 0x579b4
movq %r14, %r15
movl 0x40(%rbx), %esi
leaq 0xa8(%rsp), %r14
movq %r14, %rdi
callq 0x9f56b
leaq 0x7f430(%rip), %rsi     # 0xd6cba
leaq 0x70(%rsp), %rdi
movq %r14, %rdx
callq 0x4933b
leaq 0x7f339(%rip), %rdx     # 0xd6bd7
leaq 0x50(%rsp), %rdi
leaq 0x70(%rsp), %rsi
callq 0x3336c
leaq 0x108(%rsp), %rdi
movl 0x24(%rsp), %esi
callq 0x9f56b
movq %r15, %r14
leaq 0xc8(%rsp), %rdi
leaq 0x50(%rsp), %rsi
leaq 0x108(%rsp), %rdx
callq 0x4e6ed
leaq 0x7eda2(%rip), %rdx     # 0xd6684
leaq 0x30(%rsp), %rdi
leaq 0xc8(%rsp), %rsi
callq 0x3336c
leaq 0x128(%rsp), %rdi
movl 0x1c(%rsp), %esi
callq 0x9f56b
leaq 0xe8(%rsp), %rdi
leaq 0x30(%rsp), %rsi
leaq 0x128(%rsp), %rdx
callq 0x4e6ed
leaq 0x7f3cc(%rip), %rdx     # 0xd6cf2
leaq 0x148(%rsp), %rdi
leaq 0xe8(%rsp), %rsi
callq 0x3336c
leaq 0x148(%rsp), %rdi
callq 0x9f54b
leaq 0x148(%rsp), %rdi
callq 0x295a0
leaq 0xe8(%rsp), %rdi
callq 0x295a0
leaq 0x128(%rsp), %rdi
callq 0x295a0
leaq 0x30(%rsp), %rdi
callq 0x295a0
leaq 0xc8(%rsp), %rdi
callq 0x295a0
leaq 0x108(%rsp), %rdi
callq 0x295a0
leaq 0x50(%rsp), %rdi
callq 0x295a0
leaq 0x70(%rsp), %rdi
callq 0x295a0
leaq 0xa8(%rsp), %rdi
callq 0x295a0
movq 0xa8(%rbx), %rax
cmpl $0x2, 0x1614(%rax)
movl 0x1c(%rsp), %r15d
movq %r15, 0x28(%rsp)
jbe 0x57a2b
movq 0x10e5c3(%rip), %rdi    # 0x165f98
leaq 0x7f681(%rip), %rsi     # 0xd705d
callq 0x289f0
movq %rax, %rdi
movq %r15, %rsi
callq 0x286e0
leaq 0x7f684(%rip), %rsi     # 0xd7077
movq %rax, %rdi
callq 0x289f0
movq %rax, %rdi
movq %r14, %rsi
callq 0x286e0
leaq 0x85c06(%rip), %rsi     # 0xdd613
movq %rax, %rdi
callq 0x289f0
movl 0xb0(%rbx), %esi
movq %rax, %rdi
callq 0x286e0
movq %rax, %rdi
callq 0x284a0
leaq 0x78(%rbx), %rdi
movq %r14, 0x10(%rsp)
movq %r14, %rsi
callq 0x3374c
movq (%rax), %rax
movq %rax, 0x98(%rsp)
movq 0xa8(%rbx), %rax
cmpl $0x3, 0x1614(%rax)
jb 0x57a72
movq 0x10e53a(%rip), %rdi    # 0x165f98
leaq 0x7f29c(%rip), %rsi     # 0xd6d01
callq 0x289f0
movq %rax, %rdi
callq 0x284a0
leaq 0xf8(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movq 0xa8(%rbx), %rax
cmpl $0x3, 0x1614(%rax)
jb 0x57af0
movq 0x10e4fb(%rip), %rdi    # 0x165f98
leaq 0x7f5e1(%rip), %rsi     # 0xd7085
callq 0x289f0
movq %rax, %rdi
movq 0x28(%rsp), %rsi
callq 0x286e0
movq %rax, %rdi
leaq 0x7f5d9(%rip), %rsi     # 0xd7099
callq 0x289f0
movq %rax, %rdi
movq 0x10(%rsp), %rsi
callq 0x286e0
movq %rax, %rdi
leaq 0x7f5c5(%rip), %rsi     # 0xd70a1
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 0x1c(%rsp), %edx
pushq $0x1
popq %r8
pushq $-0x1
pushq $0x1
callq 0x60fd6
popq %rcx
popq %rdx
movl %eax, 0x20(%rsp)
movq 0xa8(%rbx), %rax
cmpl $0x3, 0x1614(%rax)
jb 0x57b60
movq 0x10e46e(%rip), %rdi    # 0x165f98
leaq 0x7f586(%rip), %rsi     # 0xd70b7
callq 0x289f0
movq %rax, %rdi
callq 0x284a0
movq 0x10e453(%rip), %rdi    # 0x165f98
leaq 0x7f251(%rip), %rsi     # 0xd6d9d
callq 0x289f0
movq %rax, %rdi
callq 0x284a0
movq 0xa8(%rbx), %rax
movq (%rax), %rdi
addq $0x18, %rdi
movl $0x15, 0x30(%rsp)
leaq 0x30(%rsp), %rsi
callq 0x5da18
movq %rdx, 0x90(%rsp)
movq %rax, %r14
movq 0xa8(%rbx), %rax
cmpl $0x3, 0x1614(%rax)
jb 0x57bb6
movq 0x10e3fd(%rip), %rdi    # 0x165f98
leaq 0x7f24a(%rip), %rsi     # 0xd6dec
callq 0x289f0
movq %rax, %rdi
callq 0x284a0
movq 0xa8(%rbx), %rax
cmpq 0x90(%rsp), %r14
je 0x581a3
cmpl $0x3, 0x1614(%rax)
jb 0x57bf5
movq 0x10e3c4(%rip), %rdi    # 0x165f98
movq 0x28(%rsp), %rsi
callq 0x286e0
movq %rax, %rdi
leaq 0x7f504(%rip), %rsi     # 0xd70ec
callq 0x289f0
movq %rax, %rdi
callq 0x284a0
movl $0x0, 0xc(%rsp)
movq %r14, 0xa0(%rsp)
cmpq 0x90(%rsp), %r14
je 0x5819a
movq %rbx, %rdi
movq 0x10(%rsp), %rsi
callq 0x59f72
movq 0x18(%rax), %r13
xorl %r15d, %r15d
movq %rbx, %rdi
movq 0x10(%rsp), %rsi
callq 0x59f72
addq $0x8, %rax
cmpq %rax, %r13
je 0x57c6a
movq 0xa0(%rsp), %rax
movq 0x38(%rax), %rdi
addq %r15, %rdi
xorl %esi, %esi
callq 0x33525
movsd %xmm0, 0x40(%r13)
movq %r13, %rdi
callq 0x28700
movq %rax, %r13
addq $0x20, %r15
jmp 0x57c27
movq 0xa8(%rbx), %r15
movl 0xb0(%rbx), %esi
incl %esi
leaq 0x50(%rsp), %r12
movq %r12, %rdi
callq 0x9f56b
addq $0x1520, %r15           # imm = 0x1520
leaq 0xc8(%rsp), %r13
movq %r13, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x5a115
leaq 0x30(%rsp), %r15
movq %r15, %rdi
movq %r13, %rsi
leaq 0x85d02(%rip), %rdx     # 0xdd9b7
callq 0x3336c
leaq 0xe8(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x28c40
movq %r15, %rdi
callq 0x295a0
movq %r13, %rdi
callq 0x295a0
leaq 0x50(%rsp), %rdi
callq 0x295a0
leaq 0x2c8(%rsp), %r15
movq %r15, %rdi
movq %r12, %rsi
callq 0x28dd0
movq %r15, %rdi
callq 0x9ec28
movl %eax, %ebp
movq %r15, %rdi
callq 0x295a0
testl %ebp, %ebp
jne 0x57d44
leaq 0x208(%rsp), %rdi
leaq 0x7e178(%rip), %rsi     # 0xd5e97
leaq 0xe8(%rsp), %rdx
callq 0x3338b
leaq 0x208(%rsp), %r15
movq %r15, %rdi
callq 0x9f543
movq %r15, %rdi
callq 0x295a0
pushq $0x1
popq %r13
movq 0xa8(%rbx), %rsi
cmpl 0x1658(%rsi), %r13d
ja 0x58186
leaq 0x108(%rsp), %r15
movq %r15, %rdi
movl 0x24(%rsp), %edx
xorl %ecx, %ecx
callq 0x6bd9a
leaq 0xa8(%rsp), %rdi
movq %r15, %rsi
leaq 0x7dfe3(%rip), %rdx     # 0xd5d67
callq 0x3336c
movl 0x40(%rbx), %esi
leaq 0x128(%rsp), %r15
movq %r15, %rdi
callq 0x9f56b
leaq 0x70(%rsp), %r12
movq %r12, %rdi
leaq 0xa8(%rsp), %rsi
movq %r15, %rdx
callq 0x4e6ed
leaq 0x50(%rsp), %rdi
movq %r12, %rsi
leaq 0x7dfa4(%rip), %rdx     # 0xd5d67
callq 0x3336c
leaq 0x1e8(%rsp), %r15
movq %r15, %rdi
movl %r13d, %esi
callq 0x9f56b
leaq 0xc8(%rsp), %r12
movq %r12, %rdi
leaq 0x50(%rsp), %rsi
movq %r15, %rdx
callq 0x4e6ed
leaq 0x30(%rsp), %r15
movq %r15, %rdi
movq %r12, %rsi
leaq 0x7f41e(%rip), %rdx     # 0xd7223
callq 0x3336c
movq %r12, %rdi
callq 0x295a0
leaq 0x1e8(%rsp), %rdi
callq 0x295a0
leaq 0x50(%rsp), %rdi
callq 0x295a0
leaq 0x70(%rsp), %rdi
callq 0x295a0
leaq 0x128(%rsp), %rdi
callq 0x295a0
leaq 0xa8(%rsp), %rbp
movq %rbp, %rdi
callq 0x295a0
leaq 0x108(%rsp), %rdi
callq 0x295a0
movq %r12, %rdi
leaq 0xe8(%rsp), %rsi
movq %r15, %rdx
callq 0x34fc8
movl 0x40(%rbx), %esi
movq %rbp, %rdi
callq 0x9f56b
leaq 0x70(%rsp), %rdi
movq %rbp, %rsi
leaq 0x7dedd(%rip), %rdx     # 0xd5d67
callq 0x3336c
leaq 0x108(%rsp), %r15
movq %r15, %rdi
movl %r13d, %esi
callq 0x9f56b
leaq 0x50(%rsp), %rdi
leaq 0x70(%rsp), %r12
movq %r12, %rsi
movq %r15, %rdx
callq 0x4e6ed
movq %r15, %rdi
callq 0x295a0
movq %r12, %rdi
callq 0x295a0
leaq 0xa8(%rsp), %rdi
callq 0x295a0
movq 0xa8(%rbx), %rdi
cmpl $0x3, 0x1614(%rdi)
jb 0x57f16
movq 0x10e0ad(%rip), %rdi    # 0x165f98
leaq 0x7ef82(%rip), %rsi     # 0xd6e74
callq 0x289f0
movq %rax, %rdi
leaq 0xc8(%rsp), %rsi
callq 0x28910
movq %rax, %rdi
callq 0x284a0
movq 0xa8(%rbx), %rdi
addq $0x15c0, %rdi           # imm = 0x15C0
movq 0x10(%rsp), %rsi
callq 0x3374c
movq (%rax), %rax
cmpb $0x1, 0xb8(%rax)
jne 0x57fd5
movq %rbx, %rdi
movq 0x10(%rsp), %rsi
callq 0x59f72
leaq 0x298(%rsp), %rdi
movq %rax, %rsi
callq 0x4e96a
leaq 0x1c8(%rsp), %rdi
leaq 0xe8(%rsp), %rsi
callq 0x28dd0
leaq 0x1a8(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x28dd0
leaq 0x278(%rsp), %r14
movq %r14, %rdi
leaq 0x50(%rsp), %rsi
callq 0x28dd0
movq 0x98(%rsp), %rdi
leaq 0x298(%rsp), %r15
movq %r15, %rsi
leaq 0x1c8(%rsp), %rbp
movq %rbp, %rdx
leaq 0x1a8(%rsp), %r12
movq %r12, %rcx
movq %r14, %r8
xorl %r9d, %r9d
pushq $0x0
pushq $0x0
pushq $0x1
pushq $0x0
callq 0x4cf22
addq $0x20, %rsp
jmp 0x5806e
movq %rbx, %rdi
movq 0x10(%rsp), %rsi
callq 0x59f72
leaq 0x248(%rsp), %rdi
movq %rax, %rsi
callq 0x4e96a
leaq 0x188(%rsp), %rdi
leaq 0xe8(%rsp), %rsi
callq 0x28dd0
leaq 0x168(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x28dd0
leaq 0x228(%rsp), %r14
movq %r14, %rdi
leaq 0x50(%rsp), %rsi
callq 0x28dd0
movq 0x98(%rsp), %rdi
leaq 0x248(%rsp), %r15
movq %r15, %rsi
leaq 0x188(%rsp), %rbp
movq %rbp, %rdx
leaq 0x168(%rsp), %r12
movq %r12, %rcx
movq %r14, %r8
xorl %r9d, %r9d
pushq $0x0
pushq $0x0
pushq $0x0
pushq $0x0
callq 0x4cf22
addq $0x20, %rsp
movq %r14, %rdi
callq 0x295a0
movq %r12, %rdi
callq 0x295a0
movq %rbp, %rdi
callq 0x295a0
movq %r15, %rdi
callq 0x495ac
movq 0xa8(%rbx), %rax
cmpl $0x3, 0x1614(%rax)
jb 0x5815d
movq 0x10deef(%rip), %rdi    # 0x165f98
leaq 0x7eddb(%rip), %rsi     # 0xd6e8b
callq 0x289f0
movq %rax, %rdi
leaq 0xc8(%rsp), %rsi
callq 0x28910
movq %rax, %rdi
leaq 0x7edd4(%rip), %rsi     # 0xd6ea3
callq 0x289f0
movq %rax, %r15
movl 0x40(%rbx), %esi
leaq 0x70(%rsp), %r12
movq %r12, %rdi
callq 0x9f56b
movq %r15, %rdi
movq %r12, %rsi
callq 0x28910
movq %rax, %rdi
leaq 0x7edad(%rip), %rsi     # 0xd6ea9
callq 0x289f0
movq %rax, %r15
leaq 0xa8(%rsp), %r12
movq %r12, %rdi
movl %r13d, %esi
callq 0x9f56b
movq %r15, %rdi
movq %r12, %rsi
callq 0x28910
movq %rax, %rdi
leaq 0xa8c50(%rip), %rsi     # 0x100d7c
callq 0x289f0
movq %rax, %rdi
movq 0x28(%rsp), %rsi
callq 0x286e0
movq %rax, %rdi
callq 0x284a0
leaq 0xa8(%rsp), %rdi
callq 0x295a0
leaq 0x70(%rsp), %rdi
callq 0x295a0
leaq 0x50(%rsp), %rdi
callq 0x295a0
leaq 0xc8(%rsp), %rdi
callq 0x295a0
leaq 0x30(%rsp), %rdi
callq 0x295a0
incl %r13d
jmp 0x57d48
incl 0xc(%rsp)
movq 0xa0(%rsp), %r14
movq (%r14), %r14
jmp 0x57bfd
movq 0xa8(%rbx), %rax
jmp 0x581ab
movl $0x0, 0xc(%rsp)
cmpl $0x3, 0x1614(%rax)
jb 0x581cf
movq 0x10dddd(%rip), %rdi    # 0x165f98
leaq 0x7ed0b(%rip), %rsi     # 0xd6ecd
callq 0x289f0
movq %rax, %rdi
callq 0x284a0
movq 0xa8(%rbx), %rax
movl 0xc(%rsp), %ecx
cmpl 0x20(%rsp), %ecx
jge 0x5829b
cmpl $0x3, 0x1614(%rax)
jb 0x5820f
movq 0x10dda4(%rip), %rdi    # 0x165f98
leaq 0x7ed3b(%rip), %rsi     # 0xd6f36
callq 0x289f0
movq %rax, %rdi
callq 0x284a0
movq 0xa8(%rbx), %rax
movq (%rax), %rdi
addq $0x18, %rdi
movl $0x16, 0x30(%rsp)
leaq 0x30(%rsp), %rsi
callq 0x5d11e
movq 0xa8(%rbx), %rcx
movq (%rcx), %rdi
testq %rax, %rax
jne 0x583f9
addq $0x18, %rdi
movl $0x19, 0x30(%rsp)
leaq 0x30(%rsp), %rsi
callq 0x5d11e
movq 0xa8(%rbx), %rcx
testq %rax, %rax
jne 0x58302
movq (%rcx), %rdi
addq $0x18, %rdi
movl $0x12, 0x30(%rsp)
leaq 0x30(%rsp), %rsi
callq 0x5d11e
movq 0xa8(%rbx), %rcx
movq (%rcx), %rdi
testq %rax, %rax
jne 0x583a3
addq $0x18, %rdi
callq 0x5d19a
jmp 0x57a86
movq (%rax), %rdi
addq $0x18, %rdi
callq 0x5d19a
movq 0xa8(%rbx), %rax
cmpl $0x3, 0x1614(%rax)
jb 0x57a86
movq 0x10dcd6(%rip), %rdi    # 0x165f98
leaq 0x7ec37(%rip), %rsi     # 0xd6f00
callq 0x289f0
movq %rax, %rdi
movl 0xc(%rsp), %esi
callq 0x29290
movq %rax, %rdi
leaq 0x8444c(%rip), %rsi     # 0xdc730
callq 0x289f0
movq %rax, %rdi
movl 0x20(%rsp), %esi
callq 0x29290
movq %rax, %rdi
callq 0x284a0
jmp 0x57a86
cmpl $0x3, 0x1614(%rcx)
movq 0x10(%rsp), %r14
jb 0x5834e
movq 0x10dc81(%rip), %rdi    # 0x165f98
leaq 0x85d64(%rip), %rsi     # 0xde082
callq 0x289f0
movq %rax, %rdi
movq 0x28(%rsp), %rsi
callq 0x286e0
leaq 0x7ec69(%rip), %rsi     # 0xd6fa0
movq %rax, %rdi
callq 0x289f0
movq %rax, %rdi
callq 0x284a0
movq 0xa8(%rbx), %rcx
incl 0x13ec(%rcx)
andl $0x0, 0xb0(%rbx)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x59f72
movq %rax, %rdi
callq 0x5da3c
movq %rbx, %rdi
callq 0x50cca
movq 0xa8(%rbx), %rax
cmpl $0x3, 0x1614(%rax)
jb 0x583ce
movq 0x10dc0b(%rip), %rdi    # 0x165f98
leaq 0x7ec2f(%rip), %rsi     # 0xd6fc3
callq 0x289f0
movq %rax, %rdi
callq 0x284a0
jmp 0x583c7
cmpl $0x3, 0x1614(%rcx)
jb 0x583d1
movq 0x10dbe5(%rip), %rdi    # 0x165f98
leaq 0x7ec55(%rip), %rsi     # 0xd700f
callq 0x289f0
movq %rax, %rdi
callq 0x284a0
movq 0xa8(%rbx), %rax
movq (%rax), %rdi
addq $0x18, %rdi
callq 0x5d19a
leaq 0xe8(%rsp), %rdi
callq 0x295a0
addq $0x2e8, %rsp            # imm = 0x2E8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x3, 0x1614(%rcx)
jb 0x58427
movq 0x10db8f(%rip), %rdi    # 0x165f98
leaq 0x7ecf0(%rip), %rsi     # 0xd7100
callq 0x289f0
movq %rax, %rdi
callq 0x284a0
movq 0xa8(%rbx), %rax
movq (%rax), %rdi
callq 0x5fb5c
movq 0xa8(%rbx), %rax
cmpl $0x3, 0x1614(%rax)
jb 0x58457
movq 0x10db55(%rip), %rdi    # 0x165f98
leaq 0x7ecd1(%rip), %rsi     # 0xd711b
callq 0x289f0
movq %rax, %rdi
callq 0x284a0
xorl %edi, %edi
callq 0x28c20
movq %rax, %rbx
leaq 0x148(%rsp), %rdi
callq 0x295a0
jmp 0x58473
movq %rax, %rbx
leaq 0xe8(%rsp), %rdi
callq 0x295a0
jmp 0x58485
movq %rax, %rbx
leaq 0x128(%rsp), %rdi
callq 0x295a0
jmp 0x58497
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x295a0
jmp 0x584a6
movq %rax, %rbx
leaq 0xc8(%rsp), %rdi
callq 0x295a0
leaq 0x108(%rsp), %rdi
callq 0x295a0
leaq 0x50(%rsp), %rdi
callq 0x295a0
leaq 0x70(%rsp), %rdi
callq 0x295a0
leaq 0xa8(%rsp), %rdi
jmp 0x5870b
movq %rax, %rbx
jmp 0x584b3
movq %rax, %rbx
jmp 0x584c0
movq %rax, %rbx
jmp 0x584ca
movq %rax, %rbx
jmp 0x584d4
jmp 0x586be
jmp 0x586be
jmp 0x586be
jmp 0x586be
jmp 0x586be
jmp 0x586be
movq %rax, %rbx
leaq 0x208(%rsp), %rdi
jmp 0x586fe
jmp 0x586be
movq %rax, %rbx
leaq 0x2c8(%rsp), %rdi
jmp 0x586fe
jmp 0x586be
movq %rax, %rbx
jmp 0x58552
movq %rax, %rbx
leaq 0xc8(%rsp), %rdi
callq 0x295a0
leaq 0x50(%rsp), %rdi
jmp 0x586fe
jmp 0x586be
jmp 0x586be
movq %rax, %rbx
jmp 0x585ae
jmp 0x586df
movq %rax, %rbx
leaq 0x228(%rsp), %rdi
callq 0x295a0
jmp 0x585a1
movq %rax, %rbx
jmp 0x585da
movq %rax, %rbx
leaq 0x278(%rsp), %rdi
callq 0x295a0
jmp 0x585cd
movq %rax, %rbx
jmp 0x585bb
movq %rax, %rbx
leaq 0x168(%rsp), %rdi
callq 0x295a0
leaq 0x188(%rsp), %rdi
callq 0x295a0
leaq 0x248(%rsp), %rdi
jmp 0x585ef
movq %rax, %rbx
jmp 0x585e7
movq %rax, %rbx
leaq 0x1a8(%rsp), %rdi
callq 0x295a0
leaq 0x1c8(%rsp), %rdi
callq 0x295a0
leaq 0x298(%rsp), %rdi
callq 0x495ac
jmp 0x586e2
jmp 0x585fb
movq %rax, %rbx
jmp 0x586d3
movq %rax, %rbx
leaq 0xc8(%rsp), %rdi
callq 0x295a0
jmp 0x58677
jmp 0x586be
movq %rax, %rbx
jmp 0x586f9
movq %rax, %rbx
jmp 0x586b2
movq %rax, %rbx
jmp 0x586ec
movq %rax, %rbx
jmp 0x586a5
movq %rax, %rbx
jmp 0x58665
movq %rax, %rbx
jmp 0x58698
movq %rax, %rbx
jmp 0x5865b
movq %rax, %rbx
jmp 0x5868e
movq %rax, %rbx
leaq 0x108(%rsp), %rdi
callq 0x295a0
leaq 0x70(%rsp), %rdi
callq 0x295a0
leaq 0xa8(%rsp), %rdi
jmp 0x586e7
movq %rax, %rbx
jmp 0x58684
movq %rax, %rbx
leaq 0x1e8(%rsp), %rdi
callq 0x295a0
leaq 0x50(%rsp), %rdi
callq 0x295a0
leaq 0x70(%rsp), %rdi
callq 0x295a0
leaq 0x128(%rsp), %rdi
callq 0x295a0
leaq 0xa8(%rsp), %rdi
callq 0x295a0
leaq 0x108(%rsp), %rdi
jmp 0x586fe
jmp 0x586be
movq %rax, %rbx
jmp 0x58703
movq %rax, %rbx
leaq 0xa8(%rsp), %rdi
callq 0x295a0
leaq 0x70(%rsp), %rdi
callq 0x295a0
jmp 0x586e2
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x295a0
leaq 0xc8(%rsp), %rdi
callq 0x295a0
leaq 0x30(%rsp), %rdi
callq 0x295a0
leaq 0xe8(%rsp), %rdi
callq 0x295a0
movq %rbx, %rdi
callq 0x292f0