// File: /workspace/github_cpp_makefile_star2_O1/richardposner[P]BioNetFit2/src/code/Swarm.cpp
// Function: Swarm::runAGA()
void Swarm::runAGA() {
	if (options.verbosity >= 3) {
		cout << "Running an asynchronous genetic fit" << endl;
	}

	if (!checkIfFileExists(options.jobOutputDir + "1")) {
		string createDirCmd = "mkdir " + options.jobOutputDir + "1";
		if (runCommand(createDirCmd) != 0) {
			outputError("Error: Couldn't create first generation output directory with command: " + createDirCmd + ". Quitting.");
		}
	}

	//int sp = 0;

	// Holds finished particles
	vector<unsigned int> finishedParticles;

	// Run the first generation
	runGeneration();

	// Save swarm state
	saveSwarmState();


	string outputPath = options.jobOutputDir + toString(currentGeneration - 1 ) + "_summary.txt";

	outputRunSummary(outputPath);

	cout << "Generation: " << toString(currentGeneration - 1 ) << endl;


	// Breed generation
	breedGenerationGA();


	// Re-launch the particles in to the Swarm proper
	/*for (int p = 1; p <= options.swarmSize; ++p) {


		//for(int mid = 0; mid < options.models.size(); mid++){

		//	launchSubParticle(p, mid, false);

		//}

		launchParticle(p, false);
	}

*/

	//int newFinishedPar = 0;

	//bool stopCriteria = false;
	//int iteration = 0;

	/*
	cout << "==================================ENTERING LOOP==================================" << endl;
	while (!stopCriteria){
		usleep(250000);
		cout << "RAQUEL Iteration " << iteration;
		iteration++;
		// Check for any messages from particles and store finished particles

		//finishedParticles = checkMasterMessages();
		finishedParticles = checkMasterMessages();
		newFinishedPar += finishedParticles.size();

		cout << "new finished particles " << newFinishedPar << endl;
		cout << "Running particles " << runningParticles_.size() << endl;
		cout << "Global finished " << finishedParticles_.size() << endl;
		cout << "Global finished sub " << finishedSubParticles_.size() << endl;

		// Check stop criteria
		cout << "Checking stop criteria" << endl;
		stopCriteria = checkStopCriteria();
		cout << "Done, stop criteria value = " << stopCriteria << endl;

		cout << "flightcounter = " << flightCounter_ << endl;
		cout << "max flightcounter" << options.maxNumSimulations << endl;

		// Cleanup old files if needed
		string currentDirectory = options.jobOutputDir + toString(currentGeneration);
		if (options.deleteOldFiles) {
			cleanupFiles(currentDirectory.c_str());
		}

		// If we haven't reached stop criteria, breed and re-launch finished particles
//		if (!stopCriteria && finishedParticles.size() >= options.swarmSize/2) {
		if (!stopCriteria && finishedParticles_.size() >= options.swarmSize/2) {
			cout << "RAQUEL preparing for asynchronous breed, 1/2 of particles are done" << endl;
			// Get new params for any finished particles
			//breedGenerationGA(finishedParticles);
			copy(finishedParticles_.begin(), finishedParticles_.end(), inserter(finishedParticles, finishedParticles.begin()));
			cout << "Async Particles done: " << finishedParticles.size() << endl;

			breedGenerationGA(finishedParticles);
			newFinishedPar = 0;

		//for(auto i = finishedParticles.begin(); i != finishedParticles.end(); ++i){
		//		for(int j=0; j < options.models.size(); j++){
		//			sp = fcalcsubParID(*i, j, options.models.size());
		//			cout << "sending nex gen to " << sp << endl;
		//			swarmComm->sendToSwarm(0, sp, NEXT_GENERATION, false, swarmComm->univMessageSender);
		//		}
		//	}
			//finishedParticles.clear();
			//finishedParticles_.clear();
			//finishedSubParticles_.clear(); //Raquel added to solve problem of less and less result files as generations go

			// Re-launch any finished particles
			for (auto pID = finishedParticles_.begin(); pID != finishedParticles_.end(); ++pID) {

				launchParticle(*pID, false);

			}

			currentGeneration++;
			flightCounter_++;



		}
	}
	*/
	bool stopCriteria = false;
	while (!stopCriteria){
		if (options.verbosity >= 4) {
			cout << "RAQUEL: Started runGeneration();" << endl;
		}
		runAsyncGeneration();
		if (options.verbosity >= 4) {
			cout << "RAQUEL: Finished runGeneration();" << endl;

			cout << "RAQUEL: Started checkStopCriteria();" << endl;
		}

		saveSwarmState();
		if (options.verbosity >= 4) {
			cout << "RAQUEL: Finished saveSwarmState();" << endl;
		}


		string currentDirectory = options.jobOutputDir + toString(currentGeneration);
		if (options.deleteOldFiles) {
			if (options.verbosity >= 4) {
				cout << "RAQUEL: Started cleanupFiles();" << endl;
			}
			cleanupFiles(currentDirectory.c_str());
			if (options.verbosity >= 4) {
				cout << "RAQUEL: Finished cleanupFiles();" << endl;
			}

		}

		string outputPath = options.jobOutputDir + toString(currentGeneration - 1 ) + "_summary.txt";

		outputRunSummary(outputPath);

		cout << "Generation: " << toString(currentGeneration - 1 ) << endl;

		stopCriteria = checkStopCriteria();
		if (options.verbosity >= 4) {
			cout << "RAQUEL: Stop criteria value is " << stopCriteria << endl;

			cout << "RAQUEL: Finished checkStopCriteria();" << endl;
			cout << "RAQUEL: Started saveSwarmState();" << endl;
		}

		if (!stopCriteria) {

			if(options.verbosity>=3){

				cout << "RAQUEL: started breedGenerationGA();" << endl;
			}
			finishedParticles.clear();
			for(auto i = finishedParticles_.begin(); i!=finishedParticles_.end(); ++i){
				//cout << "RAQUEL: processing particle number: " << *i << endl;
				finishedParticles.push_back(*i);
			}
			breedGenerationGA(finishedParticles);
			if(options.verbosity>=3){

				cout << "RAQUEL: finished breedGenerationGA();" << endl;
			}
		}

		currentsubswarmBestFits_.clear();

	}

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x198, %rsp            # imm = 0x198
movq %rdi, %rbx
cmpl $0x3, 0x1614(%rdi)
jb 0x811a9
movq 0xf4e22(%rip), %r14     # 0x175f90
leaq 0x7f755(%rip), %rsi     # 0x1008ca
movl $0x23, %edx
movq %r14, %rdi
callq 0x22ab0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x22940
movsbl %al, %esi
movq %r14, %rdi
callq 0x22050
movq %rax, %rdi
callq 0x22660
leaq 0xd8(%rsp), %r15
movq %r15, -0x10(%r15)
movq 0x1520(%rbx), %rsi
movq 0x1528(%rbx), %rdx
addq %rsi, %rdx
leaq 0xc8(%rsp), %r14
movq %r14, %rdi
callq 0x32180
leaq 0x77a1f(%rip), %rsi     # 0xf8bfc
movq %r14, %rdi
callq 0x233b0
leaq 0xc8(%rsp), %rdi
callq 0xbf2c2
movl %eax, %ebp
movq 0xc8(%rsp), %rdi
cmpq %r15, %rdi
je 0x81211
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0x229c0
testl %ebp, %ebp
jne 0x81314
leaq 0x1520(%rbx), %rdx
leaq 0x76d70(%rip), %rsi     # 0xf7f97
movq %rsp, %r14
movq %r14, %rdi
callq 0x319d8
leaq 0x779c3(%rip), %rsi     # 0xf8bfc
movq %r14, %rdi
callq 0x233b0
leaq 0x50(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x81268
movq %rdx, 0x40(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x50(%rsp)
jmp 0x8126f
movups (%rcx), %xmm0
movups %xmm0, (%r14)
movq 0x8(%rax), %rdx
movq %rdx, 0x48(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x10(%rsp), %r15
movq -0x10(%r15), %rdi
cmpq %r15, %rdi
je 0x812a2
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x229c0
leaq 0x150(%rsp), %r12
movq %r12, -0x10(%r12)
movq 0x40(%rsp), %rsi
movq 0x48(%rsp), %rdx
addq %rsi, %rdx
leaq 0x140(%rsp), %rdi
callq 0x32180
leaq 0x140(%rsp), %rdi
callq 0xc038e
movl %eax, %ebp
movq 0x140(%rsp), %rdi
cmpq %r12, %rdi
je 0x812f5
movq 0x150(%rsp), %rsi
incq %rsi
callq 0x229c0
testl %ebp, %ebp
jne 0x81c7b
movq 0x40(%rsp), %rdi
cmpq %r14, %rdi
je 0x81314
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x229c0
xorps %xmm0, %xmm0
movaps %xmm0, 0x80(%rsp)
movq $0x0, 0x90(%rsp)
movq %rbx, %rdi
callq 0x8d672
movq %rbx, %rdi
callq 0x9c93c
movl 0x13e8(%rbx), %esi
decl %esi
leaq 0x20(%rsp), %rdi
callq 0xc03b8
movq 0x1520(%rbx), %rcx
movq 0x1528(%rbx), %r8
leaq 0x20(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x22a80
leaq 0x10(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x81390
movq %rdx, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
jmp 0x81398
movups (%rcx), %xmm0
movups %xmm0, (%r12)
movq 0x8(%rax), %rdx
movq %rsp, %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x7f3bd(%rip), %rsi     # 0x100776
callq 0x233b0
leaq 0x50(%rsp), %rsi
movq %rsi, -0x10(%rsi)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x813e5
movq %rdx, 0x40(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x50(%rsp)
jmp 0x813eb
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0x48(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x81419
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x229c0
leaq 0x30(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x81434
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x229c0
leaq 0x130(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x40(%rsp), %rsi
movq 0x48(%rsp), %rdx
addq %rsi, %rdx
leaq 0x120(%rsp), %rdi
callq 0x32180
leaq 0x120(%rsp), %rsi
movq %rbx, %rdi
callq 0x92400
movq 0x120(%rsp), %rdi
cmpq %r14, %rdi
je 0x81487
movq 0x130(%rsp), %rsi
incq %rsi
callq 0x229c0
movq 0xf4b02(%rip), %rdi     # 0x175f90
leaq 0x7de5d(%rip), %rsi     # 0xff2f2
movl $0xc, %edx
callq 0x22ab0
movl 0x13e8(%rbx), %esi
decl %esi
movq %rsp, %rdi
callq 0xc03b8
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq 0xf4ad1(%rip), %r14     # 0x175f90
movq %r14, %rdi
callq 0x22ab0
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x22940
movsbl %al, %esi
movq %r15, %rdi
callq 0x22050
movq %rax, %rdi
callq 0x22660
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x81507
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x229c0
xorps %xmm0, %xmm0
leaq 0x160(%rsp), %rsi
movaps %xmm0, (%rsi)
movq $0x0, 0x10(%rsi)
movq %rbx, %rdi
callq 0x9d6f8
movq 0x160(%rsp), %rdi
testq %rdi, %rdi
je 0x81542
movq 0x170(%rsp), %rsi
subq %rdi, %rsi
callq 0x229c0
leaq 0x18c8(%rbx), %r15
leaq 0x1c30(%rbx), %rax
movq %rax, 0xa0(%rsp)
leaq 0x80(%rsp), %rbp
cmpl $0x4, 0x1614(%rbx)
jb 0x815a4
movl $0x20, %edx
movq %r14, %rdi
leaq 0x7f376(%rip), %rsi     # 0x1008ee
callq 0x22ab0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x22940
movsbl %al, %esi
movq %r14, %rdi
callq 0x22050
movq %rax, %rdi
callq 0x22660
movq %rbx, %rdi
callq 0x90612
cmpl $0x4, 0x1614(%rbx)
jb 0x8162b
movl $0x21, %edx
movq %r14, %rdi
leaq 0x7f34b(%rip), %rsi     # 0x10090f
callq 0x22ab0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x22940
movsbl %al, %esi
movq %r14, %rdi
callq 0x22050
movq %rax, %rdi
callq 0x22660
movl $0x24, %edx
movq %r14, %rdi
leaq 0x7f332(%rip), %rsi     # 0x100931
callq 0x22ab0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x22940
movsbl %al, %esi
movq %r14, %rdi
callq 0x22050
movq %rax, %rdi
callq 0x22660
movq %rbx, %rdi
callq 0x9c93c
cmpl $0x4, 0x1614(%rbx)
jb 0x81677
movl $0x22, %edx
movq %r14, %rdi
leaq 0x7f30b(%rip), %rsi     # 0x100956
callq 0x22ab0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x22940
movsbl %al, %esi
movq %r14, %rdi
callq 0x22050
movq %rax, %rdi
callq 0x22660
movl 0x13e8(%rbx), %esi
leaq 0x20(%rsp), %r13
movq %r13, %rdi
callq 0xc03b8
movq 0x1520(%rbx), %rcx
movq 0x1528(%rbx), %r8
movq %r13, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x22a80
movq %r12, (%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x816c5
movq %rdx, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
jmp 0x816cd
movups (%rcx), %xmm0
movups %xmm0, (%r12)
movq 0x8(%rax), %rdx
movq %rdx, 0x8(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x81701
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x229c0
cmpb $0x1, 0x1646(%rbx)
jne 0x8179f
cmpl $0x4, 0x1614(%rbx)
jb 0x81752
movl $0x1f, %edx
movq %r14, %rdi
leaq 0x7f253(%rip), %rsi     # 0x100979
callq 0x22ab0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x22940
movsbl %al, %esi
movq %r14, %rdi
callq 0x22050
movq %rax, %rdi
callq 0x22660
movq (%rsp), %rsi
callq 0x91f58
cmpl $0x4, 0x1614(%rbx)
jb 0x8179f
movl $0x20, %edx
movq %r14, %rdi
leaq 0x7f226(%rip), %rsi     # 0x100999
callq 0x22ab0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x22940
movsbl %al, %esi
movq %r14, %rdi
callq 0x22050
movq %rax, %rdi
callq 0x22660
movl 0x13e8(%rbx), %esi
decl %esi
leaq 0x100(%rsp), %r12
movq %r12, %rdi
callq 0xc03b8
movq 0x1520(%rbx), %rcx
movq 0x1528(%rbx), %r8
movq %r12, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x22a80
leaq 0x70(%rsp), %rsi
movq %rsi, 0x60(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x817f9
movq %rdx, 0x60(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x70(%rsp)
jmp 0x817ff
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0x68(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x60(%rsp), %rdi
leaq 0x7ef53(%rip), %rsi     # 0x100776
callq 0x233b0
leaq 0x30(%rsp), %rsi
movq %rsi, 0x20(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x81850
movq %rdx, 0x20(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x30(%rsp)
jmp 0x81856
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0x28(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x8188a
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x229c0
movq 0x100(%rsp), %rdi
leaq 0x110(%rsp), %rax
cmpq %rax, %rdi
je 0x818af
movq 0x110(%rsp), %rsi
incq %rsi
callq 0x229c0
leaq 0xb8(%rsp), %rax
movq %rax, 0xa8(%rsp)
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
addq %rsi, %rdx
leaq 0xa8(%rsp), %rdi
callq 0x32180
movq %rbx, %rdi
leaq 0xa8(%rsp), %rsi
callq 0x92400
movq 0xa8(%rsp), %rdi
leaq 0xb8(%rsp), %rax
cmpq %rax, %rdi
je 0x8190e
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x229c0
movl $0xc, %edx
movq %r14, %rdi
leaq 0x7d9d5(%rip), %rsi     # 0xff2f2
callq 0x22ab0
movl 0x13e8(%rbx), %esi
decl %esi
leaq 0x60(%rsp), %rdi
callq 0xc03b8
movq 0x60(%rsp), %rsi
movq 0x68(%rsp), %rdx
movq %r14, %rdi
callq 0x22ab0
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x22940
movsbl %al, %esi
movq %r12, %rdi
callq 0x22050
movq %rax, %rdi
callq 0x22660
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x8198c
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x229c0
movq %rbx, %rdi
callq 0x8795e
movl %eax, %r12d
cmpl $0x4, 0x1614(%rbx)
jb 0x81a64
movl $0x1f, %edx
movq %r14, %rdi
leaq 0x7f007(%rip), %rsi     # 0x1009ba
callq 0x22ab0
movzbl %r12b, %esi
movq %r14, %rdi
callq 0x230e0
movq %rax, %r13
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x22940
movsbl %al, %esi
movq %r13, %rdi
callq 0x22050
movq %rax, %rdi
callq 0x22660
movl $0x25, %edx
movq %r14, %rdi
leaq 0x7efdd(%rip), %rsi     # 0x1009da
callq 0x22ab0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x22940
movsbl %al, %esi
movq %r14, %rdi
callq 0x22050
movq %rax, %rdi
callq 0x22660
movl $0x21, %edx
movq %r14, %rdi
leaq 0x7efc8(%rip), %rsi     # 0x100a00
callq 0x22ab0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x22940
movsbl %al, %esi
movq %r14, %rdi
callq 0x22050
movq %rax, %rdi
callq 0x22660
testb %r12b, %r12b
jne 0x81bec
cmpl $0x3, 0x1614(%rbx)
jb 0x81ab1
movl $0x24, %edx
movq %r14, %rdi
leaq 0x7ef9d(%rip), %rsi     # 0x100a22
callq 0x22ab0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x22940
movsbl %al, %esi
movq %r14, %rdi
callq 0x22050
movq %rax, %rdi
callq 0x22660
movq 0x80(%rsp), %rax
cmpq %rax, 0x88(%rsp)
je 0x81acb
movq %rax, 0x88(%rsp)
movq 0x18d8(%rbx), %r13
cmpq %r15, %r13
je 0x81b17
leaq 0x20(%r13), %rdx
movq 0x88(%rsp), %rsi
cmpq 0x90(%rsp), %rsi
je 0x81aff
movl (%rdx), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x88(%rsp)
jmp 0x81b07
movq %rbp, %rdi
callq 0x6b5ce
movq %r13, %rdi
callq 0x22ad0
movq %rax, %r13
cmpq %r15, %rax
jne 0x81ad7
leaq 0xe8(%rsp), %rdi
movq %rbp, %rsi
callq 0xa8934
movq %rbx, %rdi
leaq 0xe8(%rsp), %rsi
callq 0x9d6f8
movq 0xe8(%rsp), %rdi
testq %rdi, %rdi
je 0x81b54
movq 0xf8(%rsp), %rsi
subq %rdi, %rsi
callq 0x229c0
cmpl $0x3, 0x1614(%rbx)
jb 0x81b98
movl $0x25, %edx
movq %r14, %rdi
leaq 0x7eedb(%rip), %rsi     # 0x100a47
callq 0x22ab0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x22940
movsbl %al, %esi
movq %r14, %rdi
callq 0x22050
movq %rax, %rdi
callq 0x22660
movq 0xa0(%rsp), %rdi
callq 0xb02de
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x81bc1
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x229c0
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x81bdc
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x229c0
testb %r12b, %r12b
leaq 0x10(%rsp), %r12
je 0x81560
jmp 0x81c30
movq 0xa0(%rsp), %rdi
callq 0xb02de
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x81c15
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x229c0
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x81c30
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x229c0
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x81c4c
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x229c0
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x81c69
movq 0x90(%rsp), %rsi
subq %rdi, %rsi
callq 0x229c0
addq $0x198, %rsp            # imm = 0x198
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x7eaac(%rip), %rsi     # 0x10072e
movq %rsp, %rdi
leaq 0x40(%rsp), %rdx
callq 0x319d8
leaq 0x7fd3c(%rip), %rsi     # 0x1019d2
movq %rsp, %rdi
callq 0x233b0
leaq 0x188(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x81cc4
movups (%rcx), %xmm0
movups %xmm0, (%r12)
jmp 0x81cd7
movq %rdx, 0x178(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x188(%rsp)
movq 0x8(%rax), %rdx
leaq 0x178(%rsp), %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq %rbx, %rdi
callq 0x78b66
movq %rax, %rbx
movq 0x178(%rsp), %rdi
cmpq %r12, %rdi
je 0x81d23
movq 0x188(%rsp), %rsi
incq %rsi
callq 0x229c0
jmp 0x81d23
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x81d5a
movq 0x10(%rsp), %rsi
jmp 0x81d4d
jmp 0x81d57
movq %rax, %rbx
movq 0x140(%rsp), %rdi
cmpq %r12, %rdi
je 0x81d5a
movq 0x150(%rsp), %rsi
incq %rsi
callq 0x229c0
jmp 0x81d5a
movq %rax, %rbx
movq 0x40(%rsp), %rdi
cmpq %r14, %rdi
je 0x81fb5
movq 0x50(%rsp), %rsi
jmp 0x81e35
movq %rax, %rbx
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x81fb5
movq 0x10(%rsp), %rsi
jmp 0x81e35
movq %rax, %rbx
movq 0x160(%rsp), %rdi
testq %rdi, %rdi
je 0x81f7c
movq 0x170(%rsp), %rsi
subq %rdi, %rsi
jmp 0x81f77
jmp 0x81f3d
movq %rax, %rbx
movq 0x120(%rsp), %rdi
cmpq %r14, %rdi
je 0x81f7c
movq 0x130(%rsp), %rsi
jmp 0x81f74
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x81df9
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x229c0
jmp 0x81df9
movq %rax, %rbx
leaq 0x30(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x81f98
movq 0x30(%rsp), %rsi
jmp 0x81f90
jmp 0x81e42
jmp 0x81e19
movq %rax, %rbx
movq 0xc8(%rsp), %rdi
cmpq %r15, %rdi
je 0x81fb5
movq 0xd8(%rsp), %rsi
incq %rsi
jmp 0x81fb0
jmp 0x81f3d
movq %rax, %rbx
jmp 0x81f98
jmp 0x81f15
movq %rax, %rbx
movq 0xe8(%rsp), %rdi
testq %rdi, %rdi
je 0x81f45
movq 0xf8(%rsp), %rsi
subq %rdi, %rsi
jmp 0x81f34
jmp 0x81f42
movq %rax, %rbx
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x81ee9
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x229c0
jmp 0x81ee9
movq %rax, %rbx
movq 0xa8(%rsp), %rdi
leaq 0xb8(%rsp), %rax
cmpq %rax, %rdi
je 0x81f45
movq 0xb8(%rsp), %rsi
jmp 0x81f31
movq %rax, %rbx
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x81f7c
movq 0x30(%rsp), %rsi
jmp 0x81f74
movq %rax, %rbx
jmp 0x81f0e
jmp 0x81f3d
movq %rax, %rbx
movq 0x100(%rsp), %rdi
leaq 0x110(%rsp), %rax
cmpq %rax, %rdi
je 0x81f0e
movq 0x110(%rsp), %rsi
incq %rsi
callq 0x229c0
leaq 0x10(%rsp), %r12
jmp 0x81f66
movq %rax, %rbx
jmp 0x81f66
movq %rax, %rbx
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x81f45
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x229c0
jmp 0x81f45
jmp 0x81f42
movq %rax, %rbx
jmp 0x81f7c
movq %rax, %rbx
leaq 0x10(%rsp), %r12
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x81f66
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x229c0
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x81f7c
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x229c0
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x81f98
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x229c0
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x81fb5
movq 0x90(%rsp), %rsi
subq %rdi, %rsi
callq 0x229c0
movq %rbx, %rdi
callq 0x23240
nop