// File: /workspace/github_cpp_makefile_star2_O1/richardposner[P]BioNetFit2/src/code/Swarm.cpp
// Function: Swarm::processParticlesPSO(std::vector<unsigned int, std::allocator<unsigned int>>, bool)
void Swarm::processParticlesPSO(vector<unsigned int> particles, bool newFlight) {

	map<unsigned int, std::vector<double> > particleNewParamSets;

	// Create the output directory for the next generation
	if (!checkIfFileExists(options.jobOutputDir + toString(currentGeneration))) {
		string createDirCmd = "mkdir " + options.jobOutputDir + toString(currentGeneration);
		int retryCounter = 0;
		while (runCommand(createDirCmd) != 0 && !checkIfFileExists(options.jobOutputDir + toString(currentGeneration))) {
			if(++retryCounter >= 100) {
				outputError("Error: Couldn't create " + options.jobOutputDir + toString(currentGeneration) + " to hold next generation's output.");
			}
			//sleep(1);
			cout << "Trying again to create dir" << endl;
		}
	}
	else if (options.verbosity >= 4) cout<<"Swarm::breedGenerationGA-AAA4, dir already exist\n.";


	if (options.verbosity >= 3) {
		cout << "Processing " << particles.size() << " particles" << endl;
	}

	vector<double> mBests;
	if (options.psoType == "qpso") {
		mBests = calcQPSOmBests();
	}

	// For each particle in our particle set
	for (auto particle = particles.begin(); particle != particles.end(); ++particle) {
		if (options.verbosity >= 3) {
			cout << "Processing particle " << *particle << endl;
		}

		// Calculate the next iteration positions according
		// to user preference
		if (options.psoType == "pso") {
			if (options.enhancedInertia) {
				updateInertia();
			}
			//cout << "RAQUEL before calcParticlePosPSO" << endl;

			particleCurrParamSets_[*particle] = calcParticlePosPSO(*particle);

			//for(int mid = 0; mid < options.models.size(); mid++){
			//	update_cur_particle_params(*particle, mid, true);
			//}

			//cout << "RAQUEL after calcParticlePosPSO size: " << particleCurrParamSets_[*particle].size() << endl;

		}
		else if (options.psoType == "bbpso") {
			if (options.verbosity >= 3) {
				cout << "RAQUEL before calcParticlePosBBPSO" << endl;
			}
			particleCurrParamSets_[*particle] = calcParticlePosBBPSO(*particle);
			if (options.verbosity >= 3) {
				cout << "RAQUEL after calcParticlePosBBPSO" << endl;
			}
		}
		else if (options.psoType == "bbpsoexp") {
			particleCurrParamSets_[*particle] = calcParticlePosBBPSO(*particle, true);
		}
		else if (options.psoType == "qpso") {
			updateContractionExpansionCoefficient();
			particleCurrParamSets_[*particle] = calcParticlePosQPSO(*particle, mBests);
		}

		if (options.verbosity >= 3) {
			cout << "Got next positions for particle " << *particle << endl;
		}
		// Convert positions to string so they can be sent to the particle
		vector<string> nextPositionsStr;
		vector<double> nextPositionsDouble;
		for (auto param = particleCurrParamSets_.at(*particle).begin(); param != particleCurrParamSets_.at(*particle).end(); ++param) {
			//nextPositionsStr.push_back(toString(static_cast<long double>(*param)));
			nextPositionsStr.push_back(toString(*param));
			nextPositionsDouble.push_back(*param);
			//cout << "Param " << *param << " size: " << particleCurrParamSets_.at(*particle).size() << endl;
			//cout << "Total size: " << particleCurrParamSets_.size() << endl;
		}

		//particleCurrParamSets_[*particle] = nextPositionsDouble;

		//subparticleCurrParamSets_.insert(make_pair(*particle, zmap));

		if (options.verbosity >= 3) {
			cout << "Sending new positions to " << *particle << endl;
		}

		// Replace any changed param sets in the master set
	//	for (auto child = particleCurrParamSets_.begin(); child != particleNewParamSets.end(); ++child) {
	//		cout << "param " << child<-first << endl;
	//	}

		// Finally, send the parameters

		//swarmComm->sendToSwarm(0, *particle, SEND_FINAL_PARAMS_TO_PARTICLE, false, nextPositionsStr);
		//for(int mid = 0; mid < options.models.size(); mid++){
		//	update_cur_particle_params(*particle, mid, true);
		//}

		int sp = 0;
		//Raquel: had to change the line above to send the message to subparticles
		if (options.verbosity >= 3) {
			cout << "RAQUEL total models " << options.models.size() << endl;
		}
		for(unsigned int i = 0; i < options.models.size(); i++){

			sp = fcalcsubParID(*particle, i, options.models.size());
			if (options.verbosity >= 3) {
				cout << "RAQUEL: sending message to subPar: " << sp << " model " << i << " particle " << *particle << endl;
			}
			swarmComm->sendToSwarm(0, sp, SEND_FINAL_PARAMS_TO_PARTICLE, false, nextPositionsStr);
			if (options.verbosity >= 3) {
				cout << "RAQUEL: sent message to subPar: " << sp << endl;
			}

			subparticleCurrParamSets_[*particle][i] = nextPositionsDouble;

			//for(auto param = nextPositionsStr.begin(); param != nextPositionsStr.end(); ++param) {
			//	particleNewParamSets[sp].push_back(stod(*param));
			//}
		}



		// Replace any changed param sets in the master set
		//for (auto child = particleNewParamSets.begin(); child != particleNewParamSets.end(); ++child) {
		//	particleCurrParamSets_[child->first] = child->second;
		//}



	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x198, %rsp            # imm = 0x198
movq %rsi, 0x80(%rsp)
movq %rdi, %rbx
leaq 0x170(%rsp), %rax
movl $0x0, (%rax)
xorl %ecx, %ecx
movq %rcx, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
movq %rcx, 0x20(%rax)
movl 0x13e8(%rdi), %esi
leaq 0x10(%rsp), %rdi
callq 0xc03b8
movq 0x1520(%rbx), %rcx
movq 0x1528(%rbx), %r8
leaq 0x10(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x22a80
leaq 0x120(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x890f6
movq %rdx, 0x110(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x120(%rsp)
jmp 0x890fd
movups (%rcx), %xmm0
movups %xmm0, (%r14)
movq 0x8(%rax), %rdx
leaq 0x110(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
callq 0xbf2c2
movl %eax, %ebp
movq 0x110(%rsp), %rdi
cmpq %r14, %rdi
je 0x89140
movq 0x120(%rsp), %rsi
incq %rsi
callq 0x229c0
leaq 0x20(%rsp), %r14
movq -0x10(%r14), %rdi
cmpq %r14, %rdi
je 0x8915b
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x229c0
testl %ebp, %ebp
je 0x89189
cmpl $0x4, 0x1614(%rbx)
jb 0x89493
movq 0xece1d(%rip), %rdi     # 0x175f90
leaq 0x75d32(%rip), %rsi     # 0xfeeac
movl $0x32, %edx
callq 0x22ab0
jmp 0x89493
leaq 0x1520(%rbx), %r15
leaq 0x6ee00(%rip), %rsi     # 0xf7f97
leaq 0x90(%rsp), %rdi
movq %r15, %rdx
callq 0x319d8
movl 0x13e8(%rbx), %esi
leaq 0x30(%rsp), %rdi
callq 0xc03b8
leaq 0xa0(%rsp), %rdi
movq -0x10(%rdi), %rcx
movq -0x8(%rdi), %r8
movq 0x38(%rsp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %esi
cmpq %rdi, %rcx
je 0x891e2
movq 0xa0(%rsp), %rsi
cmpq %rsi, %rax
jbe 0x89201
leaq 0x40(%rsp), %rdi
movl $0xf, %esi
cmpq %rdi, -0x10(%rdi)
je 0x891fc
movq 0x40(%rsp), %rsi
cmpq %rsi, %rax
jbe 0x89215
movq 0x30(%rsp), %rsi
leaq 0x90(%rsp), %rdi
callq 0x222b0
jmp 0x89223
leaq 0x30(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x22a80
movq %r14, 0x10(%rsp)
movq (%rax), %rdx
leaq 0x10(%rax), %rcx
cmpq %rcx, %rdx
je 0x89243
movq %rdx, 0x10(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x20(%rsp)
jmp 0x8924a
movups (%rcx), %xmm0
movups %xmm0, (%r14)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0x18(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq 0x40(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x89282
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x229c0
movq %r15, 0x78(%rsp)
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
je 0x892ac
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x229c0
leaq 0xc0(%rsp), %r13
movl $0x64, %ebp
leaq 0xf0(%rsp), %r15
movq 0xeccc8(%rip), %r12     # 0x175f90
leaq 0x100(%rsp), %rax
movq %rax, 0xf0(%rsp)
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
addq %rsi, %rdx
movq %r15, %rdi
callq 0x32180
movq %r15, %rdi
callq 0xc038e
movl %eax, %r14d
testl %eax, %eax
je 0x89368
movl %ebp, 0x88(%rsp)
movq %r12, %rbp
movq %r15, %r12
movl 0x13e8(%rbx), %esi
leaq 0x90(%rsp), %r15
movq %r15, %rdi
callq 0xc03b8
movq 0x1520(%rbx), %rcx
movq 0x1528(%rbx), %r8
movq %r15, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x22a80
movq %r13, 0xb0(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
movq %r12, %r15
je 0x8936d
movq %rdx, 0xb0(%rsp)
movq (%rcx), %rdx
movq %rdx, 0xc0(%rsp)
jmp 0x89375
xorl %r13d, %r13d
jmp 0x893ad
movups (%rcx), %xmm0
movups %xmm0, (%r13)
movq %rbp, %r12
movq 0x8(%rax), %rdx
movq %rdx, 0xb8(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0xb0(%rsp), %rdi
callq 0xbf2c2
movl 0x88(%rsp), %ebp
testl %eax, %eax
sete %r13b
testl %r14d, %r14d
je 0x893fc
movq 0xb0(%rsp), %rdi
leaq 0xc0(%rsp), %rax
cmpq %rax, %rdi
je 0x893d7
movq 0xc0(%rsp), %rsi
incq %rsi
callq 0x229c0
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
je 0x893fc
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x229c0
movq 0xf0(%rsp), %rdi
leaq 0x100(%rsp), %rax
cmpq %rax, %rdi
je 0x89421
movq 0x100(%rsp), %rsi
incq %rsi
callq 0x229c0
testb %r13b, %r13b
je 0x89477
decl %ebp
je 0x89c3a
movl $0x1a, %edx
movq %r12, %rdi
leaq 0x75a54(%rip), %rsi     # 0xfee91
callq 0x22ab0
leaq 0xc0(%rsp), %r13
movq (%r12), %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
jmp 0x892c8
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x89493
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x229c0
cmpl $0x3, 0x1614(%rbx)
jb 0x89511
movq 0xecaed(%rip), %rdi     # 0x175f90
leaq 0x75a35(%rip), %rsi     # 0xfeedf
movl $0xb, %edx
callq 0x22ab0
movq 0x80(%rsp), %rax
movq 0x8(%rax), %rsi
subq (%rax), %rsi
sarq $0x2, %rsi
movq 0xecac2(%rip), %rdi     # 0x175f90
callq 0x22650
movq %rax, %r14
leaq 0x75fe4(%rip), %rsi     # 0xff4c1
movl $0xa, %edx
movq %rax, %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
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
movq $0x0, 0x40(%rsp)
leaq 0x16d8(%rbx), %r14
leaq 0x68399(%rip), %rsi     # 0xf18c9
movq %r14, %rdi
callq 0x22250
testl %eax, %eax
jne 0x8959c
leaq 0x10(%rsp), %rdi
movq %rbx, %rsi
callq 0x7d2a8
movq 0x30(%rsp), %rdi
movq 0x40(%rsp), %rsi
movq 0x10(%rsp), %rax
movq %rax, 0x30(%rsp)
movups 0x18(%rsp), %xmm0
movups %xmm0, 0x38(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
testq %rdi, %rdi
je 0x89585
subq %rdi, %rsi
callq 0x229c0
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x8959c
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x229c0
movq %r14, 0x78(%rsp)
movq 0x80(%rsp), %rax
movq (%rax), %r12
cmpq 0x8(%rax), %r12
je 0x89c04
leaq 0x1400(%rbx), %r13
leaq 0x1460(%rbx), %rax
movq %rax, 0x88(%rsp)
leaq 0x10(%rsp), %r15
cmpl $0x3, 0x1614(%rbx)
jb 0x8962c
movl $0x14, %edx
movq 0xec9aa(%rip), %rdi     # 0x175f90
leaq 0x758fe(%rip), %rsi     # 0xfeeeb
callq 0x22ab0
movl (%r12), %esi
movq 0xec993(%rip), %rdi     # 0x175f90
callq 0x22650
movq %rax, %r14
movq (%rax), %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 0x78(%rsp), %r14
movq %r14, %rdi
leaq 0x758c7(%rip), %rsi     # 0xfef02
callq 0x22250
testl %eax, %eax
je 0x89709
movq %r14, %rdi
leaq 0x758ae(%rip), %rsi     # 0xfef00
callq 0x22250
testl %eax, %eax
je 0x89739
movq %r14, %rdi
leaq 0x758e2(%rip), %rsi     # 0xfef4b
callq 0x22250
testl %eax, %eax
je 0x89823
movq %r14, %rdi
leaq 0x68249(%rip), %rsi     # 0xf18c9
callq 0x22250
testl %eax, %eax
jne 0x89864
movq %rbx, %rdi
callq 0x8ac84
movl (%r12), %ebp
leaq 0x130(%rsp), %r14
movq %r14, %rdi
leaq 0x30(%rsp), %rsi
callq 0x66228
movq %r15, %rdi
movq %rbx, %rsi
movl %ebp, %edx
movq %r14, %rcx
callq 0x8ad56
movq %r13, %rdi
movq %r12, %rsi
callq 0xa873a
movq %rax, %rdi
movq %r15, %rsi
callq 0xafaa8
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x896eb
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x229c0
movq 0x130(%rsp), %rdi
testq %rdi, %rdi
je 0x89864
movq 0x140(%rsp), %rsi
jmp 0x8985c
cmpb $0x1, 0x16f9(%rbx)
jne 0x8971a
movq %rbx, %rdi
callq 0x8a03a
movl (%r12), %edx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x8a0ea
movq %r13, %rdi
movq %r12, %rsi
callq 0xa873a
jmp 0x89842
cmpl $0x3, 0x1614(%rbx)
jb 0x8978c
movl $0x22, %edx
movq 0xec842(%rip), %rdi     # 0x175f90
leaq 0x757b1(%rip), %rsi     # 0xfef06
callq 0x22ab0
movq 0xec82f(%rip), %rcx     # 0x175f90
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x22940
movsbl %al, %esi
movq 0xec811(%rip), %rdi     # 0x175f90
callq 0x22050
movq %rax, %rdi
callq 0x22660
movl (%r12), %edx
movq %r15, %rdi
movq %rbx, %rsi
xorl %ecx, %ecx
callq 0x8a722
movq %r13, %rdi
movq %r12, %rsi
callq 0xa873a
movq %rax, %rdi
movq %r15, %rsi
callq 0xafaa8
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x897ca
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x229c0
cmpl $0x3, 0x1614(%rbx)
jb 0x89864
movl $0x21, %edx
movq 0xec7ad(%rip), %rdi     # 0x175f90
leaq 0x7573f(%rip), %rsi     # 0xfef29
callq 0x22ab0
movq 0xec79a(%rip), %rcx     # 0x175f90
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x22940
movsbl %al, %esi
movq 0xec77c(%rip), %rdi     # 0x175f90
callq 0x22050
movq %rax, %rdi
callq 0x22660
jmp 0x89864
movl (%r12), %edx
movq %r15, %rdi
movq %rbx, %rsi
movl $0x1, %ecx
callq 0x8a722
movq %r13, %rdi
movq %r12, %rsi
callq 0xa873a
movq %rax, %rdi
movq %r15, %rsi
callq 0xafaa8
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x89864
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x229c0
cmpl $0x3, 0x1614(%rbx)
jb 0x898bf
movl $0x20, %edx
movq 0xec717(%rip), %rdi     # 0x175f90
leaq 0x756d4(%rip), %rsi     # 0xfef54
callq 0x22ab0
movl (%r12), %esi
movq 0xec700(%rip), %rdi     # 0x175f90
callq 0x22650
movq %rax, %r14
movq (%rax), %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
xorps %xmm0, %xmm0
movaps %xmm0, 0xd0(%rsp)
xorl %eax, %eax
movq %rax, 0xe0(%rsp)
movq %rax, 0x60(%rsp)
movaps %xmm0, 0x50(%rsp)
movq %r13, %rdi
movq %r12, %rsi
callq 0xa837c
movq (%rax), %r14
movq %r13, %rdi
movq %r12, %rsi
callq 0xa837c
cmpq 0x8(%rax), %r14
je 0x89969
movsd (%r14), %xmm0
movq %r15, %rdi
callq 0xc0446
leaq 0xd0(%rsp), %rdi
movq %r15, %rsi
callq 0x6a77e
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x89936
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x229c0
movq 0x58(%rsp), %rsi
cmpq 0x60(%rsp), %rsi
je 0x89956
movsd (%r14), %xmm0
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x58(%rsp)
jmp 0x89963
leaq 0x50(%rsp), %rdi
movq %r14, %rdx
callq 0x68992
addq $0x8, %r14
jmp 0x898ec
cmpl $0x2, 0x1614(%rbx)
jbe 0x899c4
movl $0x19, %edx
movq 0xec612(%rip), %rdi     # 0x175f90
leaq 0x755f0(%rip), %rsi     # 0xfef75
callq 0x22ab0
movl (%r12), %esi
movq 0xec5fb(%rip), %rdi     # 0x175f90
callq 0x22650
movq %rax, %r14
movq (%rax), %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
cmpl $0x3, 0x1614(%rbx)
jb 0x89a2d
movl $0x14, %edx
movq 0xec5b7(%rip), %rdi     # 0x175f90
leaq 0x755af(%rip), %rsi     # 0xfef8f
callq 0x22ab0
movq 0x15c8(%rbx), %rsi
subq 0x15c0(%rbx), %rsi
sarq $0x3, %rsi
movq 0xec592(%rip), %rdi     # 0x175f90
callq 0x22650
movq %rax, %r14
movq (%rax), %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 $0x0, 0x10(%rsp)
movq 0x15c8(%rbx), %rdx
subq 0x15c0(%rbx), %rdx
je 0x89bca
sarq $0x3, %rdx
xorl %esi, %esi
movl (%r12), %edi
callq 0xbf2a3
movl %eax, %r14d
cmpl $0x3, 0x1614(%rbx)
jb 0x89aff
movl $0x23, %edx
movq 0xec51c(%rip), %rdi     # 0x175f90
leaq 0x75529(%rip), %rsi     # 0xfefa4
callq 0x22ab0
movq 0xec509(%rip), %rdi     # 0x175f90
movl %r14d, %esi
callq 0x231e0
movq %rax, %rbp
movl $0x7, %edx
movq %rax, %rdi
leaq 0x6f6f8(%rip), %rsi     # 0xf9199
callq 0x22ab0
movl 0x10(%rsp), %esi
movq %rbp, %rdi
callq 0x22650
movq %rax, %rbp
movl $0xa, %edx
movq %rax, %rdi
leaq 0x763e1(%rip), %rsi     # 0xffea5
callq 0x22ab0
movl (%r12), %esi
movq %rbp, %rdi
callq 0x22650
movq %rax, %rbp
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0x22940
movsbl %al, %esi
movq %rbp, %rdi
callq 0x22050
movq %rax, %rdi
callq 0x22660
movq (%rbx), %rdi
movl $0xffffffff, (%rsp)     # imm = 0xFFFFFFFF
xorl %esi, %esi
movl %r14d, %edx
movl $0x15, %ecx
xorl %r8d, %r8d
leaq 0xd0(%rsp), %r9
callq 0x6bfb0
cmpl $0x3, 0x1614(%rbx)
jb 0x89b7d
movl $0x20, %edx
movq 0xec458(%rip), %rdi     # 0x175f90
leaq 0x75489(%rip), %rsi     # 0xfefc8
callq 0x22ab0
movq 0xec445(%rip), %rdi     # 0x175f90
movl %r14d, %esi
callq 0x231e0
movq %rax, %r14
movq (%rax), %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 0x88(%rsp), %rdi
movq %r12, %rsi
callq 0xa879e
movq %rax, %rdi
movq %r15, %rsi
callq 0xa873a
movq %rax, %rdi
leaq 0x50(%rsp), %rsi
callq 0xa8098
movl 0x10(%rsp), %esi
incl %esi
movl %esi, 0x10(%rsp)
movq 0x15c8(%rbx), %rdx
subq 0x15c0(%rbx), %rdx
sarq $0x3, %rdx
cmpq %rsi, %rdx
ja 0x89a4f
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x89be1
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x229c0
leaq 0xd0(%rsp), %rdi
callq 0x31a9e
addq $0x4, %r12
movq 0x80(%rsp), %rax
cmpq 0x8(%rax), %r12
jne 0x895d1
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x89c1b
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x229c0
leaq 0x168(%rsp), %rdi
callq 0x72c1c
addq $0x198, %rsp            # imm = 0x198
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x75215(%rip), %rsi     # 0xfee56
leaq 0xd0(%rsp), %rdi
movq 0x78(%rsp), %rdx
callq 0x319d8
movl 0x13e8(%rbx), %esi
leaq 0x50(%rsp), %rdi
callq 0xc03b8
leaq 0xe0(%rsp), %rdi
movq -0x10(%rdi), %rcx
movq -0x8(%rdi), %r8
movq 0x58(%rsp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %esi
cmpq %rdi, %rcx
je 0x89c8e
movq 0xe0(%rsp), %rsi
leaq 0x60(%rsp), %r14
cmpq %rsi, %rax
jbe 0x89cae
movl $0xf, %esi
cmpq %r14, 0x50(%rsp)
je 0x89ca9
movq 0x60(%rsp), %rsi
cmpq %rsi, %rax
jbe 0x89cc2
movq 0x50(%rsp), %rsi
leaq 0xd0(%rsp), %rdi
callq 0x222b0
jmp 0x89cd0
leaq 0x50(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x22a80
leaq 0x40(%rsp), %rcx
movq %rcx, 0x30(%rsp)
movq (%rax), %rdx
leaq 0x10(%rax), %rcx
cmpq %rcx, %rdx
jne 0x89cf3
movups (%rcx), %xmm0
leaq 0x40(%rsp), %rdx
movups %xmm0, (%rdx)
jmp 0x89d00
movq %rdx, 0x30(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x40(%rsp)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0x38(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq 0x7514a(%rip), %rsi     # 0xfee6e
leaq 0x30(%rsp), %rdi
callq 0x233b0
leaq 0x158(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x89d52
movups (%rcx), %xmm0
movups %xmm0, (%r15)
jmp 0x89d65
movq %rdx, 0x148(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x158(%rsp)
movq 0x8(%rax), %rdx
leaq 0x148(%rsp), %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq %rbx, %rdi
callq 0x78b66
jmp 0x89fbb
movq %rax, %rbx
leaq 0x40(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x89db4
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x229c0
jmp 0x89db4
movq %rax, %rbx
leaq 0xa0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x8a025
movq 0xa0(%rsp), %rsi
jmp 0x89fb6
jmp 0x89edd
movq %rax, %rbx
movq 0x148(%rsp), %rdi
cmpq %r15, %rdi
je 0x89e00
movq 0x158(%rsp), %rsi
incq %rsi
callq 0x229c0
jmp 0x89e00
movq %rax, %rbx
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x89e59
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x229c0
jmp 0x89e59
movq %rax, %rbx
movq 0x110(%rsp), %rdi
cmpq %r14, %rdi
je 0x89e43
movq 0x120(%rsp), %rsi
incq %rsi
callq 0x229c0
jmp 0x89e43
movq %rax, %rbx
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
jmp 0x89fac
jmp 0x89edd
movq %rax, %rbx
movq 0x50(%rsp), %rdi
cmpq %r14, %rdi
je 0x89ebb
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x229c0
jmp 0x89ebb
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x89e91
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x229c0
jmp 0x89e91
movq %rax, %rbx
movq 0x130(%rsp), %rdi
testq %rdi, %rdi
je 0x8a00e
movq 0x140(%rsp), %rsi
jmp 0x89f0c
jmp 0x89fbb
jmp 0x89ef6
jmp 0x89fbb
movq %rax, %rbx
leaq 0xe0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x89fa2
movq 0xe0(%rsp), %rsi
jmp 0x89f8f
movq %rax, %rbx
jmp 0x8a025
jmp 0x89ef6
jmp 0x89fbb
jmp 0x89f9f
jmp 0x89fbb
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x8a00e
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x229c0
jmp 0x8a00e
movq %rax, %rbx
jmp 0x89f46
movq %rax, %rbx
movq 0xb0(%rsp), %rdi
leaq 0xc0(%rsp), %rax
cmpq %rax, %rdi
je 0x89f46
movq 0xc0(%rsp), %rsi
incq %rsi
callq 0x229c0
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
je 0x89f72
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x229c0
jmp 0x89f72
jmp 0x89f6f
movq %rax, %rbx
movq 0xf0(%rsp), %rdi
leaq 0x100(%rsp), %rax
cmpq %rax, %rdi
je 0x89fa2
movq 0x100(%rsp), %rsi
incq %rsi
callq 0x229c0
jmp 0x89fa2
jmp 0x89fe7
jmp 0x89fe7
jmp 0x89fe7
movq %rax, %rbx
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x8a025
movq 0x20(%rsp), %rsi
incq %rsi
jmp 0x8a020
movq %rax, %rbx
jmp 0x8a00e
jmp 0x89fe7
movq %rax, %rbx
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x89fea
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x229c0
jmp 0x89fea
jmp 0x89fe7
jmp 0x89fe7
movq %rax, %rbx
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x8a001
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x229c0
leaq 0xd0(%rsp), %rdi
callq 0x31a9e
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x8a025
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x229c0
leaq 0x168(%rsp), %rdi
callq 0x72c1c
movq %rbx, %rdi
callq 0x23240