LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/richardposner[P]BioNetFit2/src/code/Swarm.cpp
// Function: Swarm::getModelName[abi:cxx11](unsigned int, bool)
std::string Swarm::getModelName(unsigned int modelId, bool FullPath){
	std::string path = options.models.at(modelId)->getName();
	if (FullPath)
		return path;
	else
		return getFilename(path);
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0x48, %rsp
movl %ecx, %ebp
movq %rdi, %rbx
leaq 0x15c0(%rsi), %rdi
movl %edx, %esi
callq 0x3374c
movq (%rax), %rsi
addq $0x68, %rsi
leaq 0x8(%rsp), %rdi
callq 0x28dd0
testl %ebp, %ebp
je 0x6bdeb
leaq 0x10(%rbx), %rcx
movq %rcx, (%rbx)
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdx
cmpq %rax, %rdx
je 0x6be13
movq %rdx, (%rbx)
movq 0x18(%rsp), %rcx
movq %rcx, 0x10(%rbx)
jmp 0x6be19
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x28dd0
leaq 0x28(%rsp), %rsi
movq %rbx, %rdi
callq 0x9ed1e
leaq 0x28(%rsp), %rdi
callq 0x295a0
jmp 0x6be32
movups (%rax), %xmm0
movups %xmm0, (%rcx)
movq 0x10(%rsp), %rcx
movq %rcx, 0x8(%rbx)
movq %rax, 0x8(%rsp)
andq $0x0, 0x10(%rsp)
movb $0x0, 0x18(%rsp)
leaq 0x8(%rsp), %rdi
callq 0x295a0
movq %rbx, %rax
addq $0x48, %rsp
popq %rbx
popq %rbp
retq
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x295a0
jmp 0x6be58
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x295a0
movq %rbx, %rdi
callq 0x292f0
// File: /workspace/github_cpp_makefile_star2_O2/richardposner[P]BioNetFit2/src/code/Swarm.cpp
// Function: Swarm::calcQPSOmBests()
vector<double> Swarm::calcQPSOmBests() {
	// Eq 2b Liu et al
	//cout<<"Modification needed\n...."; mypause();

	vector<double> mBests;

	//for (unsigned int param = 0; param < options.model->getFreeParams_().size(); ++param) {
	//for (auto param = this->getFreeParams_().begin(); param != this->getFreeParams_().end(); ++param) { //for (auto param = options.model->getFreeParams_().begin(); param != options.model->getFreeParams_().end(); ++param) {
	unsigned int i = 0;



		double sum = 0;
		for (int particle = 1; particle <= options.swarmSize; ++particle) {
			i = 0;
			for (auto param = particleCurrParamSets_.at(particle).begin(); param != particleCurrParamSets_.at(particle).end(); ++param) {

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

					sum += abs(particleBestParamSets_.at(particle)[i]);

	//			}
				++i;
			}



			double mean = sum / (double)options.swarmSize;

			// TODO: Adaptive mutation ala Liu 2005
			if (options.mutateQPSO) {
				boost::random::cauchy_distribution<double> dist(0, cauchyMutator_);
				double mutator = dist(generalRand);
				mean += mutator;
				//cout << mean << " mutated by: " << mutator << endl;
			}
			mBests.push_back(sum / (double)options.swarmSize);

		}


	//}

	return mBests;

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %rbx
xorpd %xmm0, %xmm0
andq $0x0, 0x10(%rdi)
movq %rdi, 0x8(%rsp)
movupd %xmm0, (%rdi)
leaq 0x1400(%rsi), %r15
leaq 0x1cc0(%rsi), %r12
leaq 0x58(%rsi), %rax
movq %rax, 0x28(%rsp)
pushq $0x1
popq %r13
xorpd %xmm0, %xmm0
movsd %xmm0, 0x10(%rsp)
leaq 0x18(%rsp), %rbp
movq %rsi, 0x30(%rsp)
cmpl 0x1620(%rbx), %r13d
jg 0x6d6fb
movl %r13d, 0x18(%rsp)
movq %r15, %rdi
movq %rbp, %rsi
callq 0x861e4
movq (%rax), %rbx
xorl %r14d, %r14d
movl %r13d, 0x18(%rsp)
movq %r15, %rdi
movq %rbp, %rsi
callq 0x861e4
cmpq 0x8(%rax), %rbx
je 0x6d69f
movl %r13d, 0x18(%rsp)
movq %r12, %rdi
movq %rbp, %rsi
callq 0x861e4
movl %r14d, %ecx
movq (%rax), %rax
movsd (%rax,%rcx,8), %xmm0
andpd 0x6851a(%rip), %xmm0    # 0xd5ba0
movsd 0x10(%rsp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, 0x10(%rsp)
incl %r14d
addq $0x8, %rbx
jmp 0x6d64d
movq 0x30(%rsp), %rbx
cmpb $0x0, 0x16ac(%rbx)
je 0x6d6ce
movsd 0x1da8(%rbx), %xmm0
andq $0x0, 0x18(%rsp)
movsd %xmm0, 0x20(%rsp)
movq %rbp, %rdi
movq 0x28(%rsp), %rsi
callq 0x8621c
cvtsi2sdl 0x1620(%rbx), %xmm0
movsd 0x10(%rsp), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, 0x18(%rsp)
movq 0x8(%rsp), %rdi
movq %rbp, %rsi
callq 0x5c482
incl %r13d
jmp 0x6d62a
movq 0x8(%rsp), %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x6d717
jmp 0x6d717
jmp 0x6d717
jmp 0x6d717
movq %rax, %r14
movq 0x8(%rsp), %rdi
callq 0x5c44e
movq %r14, %rdi
callq 0x292f0
// File: /workspace/github_cpp_makefile_star2_O2/richardposner[P]BioNetFit2/src/code/Swarm.cpp
// Function: Swarm::updateEnhancedStop()
void Swarm::updateEnhancedStop() {
	// First calculate particle weights

	if (options.verbosity >= 3) {
		cout << "Updating enhanced stop" << endl;
	}

	updateParticleWeights();
	weightedAvgPos_ = calcWeightedAveragePosition();
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
cmpl $0x3, 0x1614(%rdi)
jb 0x73256
movq 0xf2d56(%rip), %rdi     # 0x165f98
leaq 0x69cde(%rip), %rsi     # 0xdcf27
callq 0x289f0
movq %rax, %rdi
callq 0x284a0
movq %rbx, %rdi
callq 0x732b6
movq %rbx, %rdi
callq 0x7335a
movsd %xmm0, 0x1d88(%rbx)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/richardposner[P]BioNetFit2/src/code/Swarm.cpp
// Function: Swarm::getEuclidianNorm(double, unsigned int)
double Swarm::getEuclidianNorm(double y, unsigned int n) {

	// Eq 10 in Moraes at al
	double sum = 0;
	for (unsigned int i = 1; i <= n; ++i) {
		sum += pow(y, 2);
	}

	double norm = sqrt( (1/n) * sum);

	return norm;
}

// Assembly:
movapd %xmm0, %xmm1
mulsd %xmm0, %xmm1
xorpd %xmm0, %xmm0
pushq $0x1
popq %rax
cmpl %esi, %eax
ja 0x7328b
addsd %xmm1, %xmm0
incl %eax
jmp 0x7327f
xorpd %xmm1, %xmm1
cmpl $0x1, %esi
je 0x7329a
xorpd %xmm2, %xmm2
jmp 0x732a2
movsd 0x62f76(%rip), %xmm2    # 0xd6218
mulsd %xmm2, %xmm0
ucomisd %xmm1, %xmm0
jb 0x28820
sqrtsd %xmm0, %xmm0
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/richardposner[P]BioNetFit2/src/code/Swarm.cpp
// Function: Swarm::updateParticleWeights()
void Swarm::updateParticleWeights() {

	if (options.verbosity >= 3) {
		cout << "Updating particle weights" << endl;
	}

	for (int p = 1; p <= options.swarmSize; ++p) {
		particleWeights_[p] = calcParticleWeight(p);
	}
	if (options.verbosity >= 3) {
		cout << "done here" << endl;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
cmpl $0x3, 0x1614(%rdi)
jb 0x732e7
movq 0xf2cc5(%rip), %rdi     # 0x165f98
leaq 0x69c64(%rip), %rsi     # 0xdcf3e
callq 0x289f0
movq %rax, %rdi
callq 0x284a0
leaq 0x1cf0(%rbx), %r14
pushq $0x1
popq %rbp
leaq 0xc(%rsp), %r15
cmpl 0x1620(%rbx), %ebp
jg 0x7332b
movq %rbx, %rdi
movl %ebp, %esi
callq 0x73414
movsd %xmm0, 0x10(%rsp)
movl %ebp, 0xc(%rsp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x86066
movsd 0x10(%rsp), %xmm0
movsd %xmm0, (%rax)
incl %ebp
jmp 0x732f6
cmpl $0x2, 0x1614(%rbx)
jbe 0x7334f
movq 0xf2c5d(%rip), %rdi     # 0x165f98
leaq 0x69c16(%rip), %rsi     # 0xdcf58
callq 0x289f0
movq %rax, %rdi
callq 0x284a0
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/richardposner[P]BioNetFit2/src/code/Swarm.cpp
// Function: Swarm::calcWeightedAveragePosition()
double Swarm::calcWeightedAveragePosition() {

	if (options.verbosity >= 3) {
		cout << "Calculating weighted average position" << endl;
	}

	double sum = 0;
	for (int p = 1; p <= options.swarmSize; ++p) {

		if ((unsigned) p == particleBestFitsByFit_.begin()->second) {
			continue;
		}

		sum += particleWeights_.at(p) * particleBestFits_[p];
	}

	return sum;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
cmpl $0x3, 0x1614(%rdi)
jb 0x7338f
movq 0xf2c1d(%rip), %rdi     # 0x165f98
leaq 0x69be0(%rip), %rsi     # 0xdcf62
callq 0x289f0
movq %rax, %rdi
callq 0x284a0
leaq 0x1cf0(%rbx), %r14
leaq 0x1a20(%rbx), %r15
pushq $0x1
popq %rbp
xorpd %xmm0, %xmm0
leaq 0x4(%rsp), %r12
movq %rsp, %r13
cmpl 0x1620(%rbx), %ebp
jg 0x73405
movq 0x1ac8(%rbx), %rax
cmpl 0x28(%rax), %ebp
je 0x73401
movl %ebp, 0x4(%rsp)
movq %r14, %rdi
movq %r12, %rsi
movsd %xmm0, 0x10(%rsp)
callq 0x8626a
movsd (%rax), %xmm0
movsd %xmm0, 0x8(%rsp)
movl %ebp, (%rsp)
movq %r15, %rdi
movq %r13, %rsi
callq 0x86066
movsd 0x10(%rsp), %xmm0
movsd 0x8(%rsp), %xmm1
mulsd (%rax), %xmm1
addsd %xmm1, %xmm0
incl %ebp
jmp 0x733ac
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/richardposner[P]BioNetFit2/src/code/Swarm.cpp
// Function: Swarm::calcParticleWeight(unsigned int)
double Swarm::calcParticleWeight(unsigned int particle) {
	// Get reciprocal of euclidian norm of the difference between swarm best fit and particle best fit
	double numerator = 1 / getEuclidianNorm( (particleBestFits_[particle] - particleBestFitsByFit_.begin()->first), this->getNumFreeParams());

	// Eq 8 in Moraes et al
	double sum = 0;
	for (int i = 1; i <= options.swarmSize; ++i) {
		// Make sure we're not using the particle with the best fit -- it will
		// result in a div_by_0
		if ((unsigned)i == particleBestFitsByFit_.begin()->second) {
			continue;
		}

		// Add 1/euclidian
		sum += 1 / numerator;
	}

	double weight = numerator / sum;

	return weight;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0xc(%rsp), %rax
movl %esi, (%rax)
addq $0x1a20, %rdi           # imm = 0x1A20
movq %rax, %rsi
callq 0x862a2
movsd (%rax), %xmm0
movq 0x1ac8(%rbx), %rax
subsd 0x20(%rax), %xmm0
movl 0x15b8(%rbx), %esi
callq 0x73270
movapd %xmm0, %xmm1
movsd 0x62dbf(%rip), %xmm2    # 0xd6218
movapd %xmm2, %xmm0
divsd %xmm1, %xmm0
movl 0x1620(%rbx), %edx
movq 0x1ac8(%rbx), %rax
xorl %ecx, %ecx
testl %edx, %edx
cmovgl %edx, %ecx
divsd %xmm0, %xmm2
negl %ecx
xorpd %xmm1, %xmm1
pushq $0x1
popq %rdx
leal (%rcx,%rdx), %esi
cmpl $0x1, %esi
je 0x73497
cmpl 0x28(%rax), %edx
je 0x73493
addsd %xmm2, %xmm1
incl %edx
jmp 0x73482
divsd %xmm1, %xmm0
addq $0x10, %rsp
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/richardposner[P]BioNetFit2/src/code/Swarm.cpp
// Function: Swarm::updateInertia()
void Swarm::updateInertia() {
	// Eq 3 from Moraes et al
	options.inertia = options.inertiaInit + (options.inertiaFinal - options.inertiaInit) * (inertiaUpdateCounter_ / (float)(options.nmax + inertiaUpdateCounter_));
	if (options.verbosity >= 3) {
		cout << "Setting inertia to " << options.inertia << endl;
	}
}

// Assembly:
movss 0x169c(%rdi), %xmm0
movl 0x1d98(%rdi), %eax
cvtsi2ss %rax, %xmm1
movl 0x1694(%rdi), %ecx
addl %eax, %ecx
cvtsi2ss %rcx, %xmm2
movss 0x16a0(%rdi), %xmm3
subss %xmm0, %xmm3
divss %xmm2, %xmm1
mulss %xmm3, %xmm1
addss %xmm0, %xmm1
movss %xmm1, 0x1688(%rdi)
cmpl $0x3, 0x1614(%rdi)
jb 0x7482b
pushq %rbx
movq %rdi, %rbx
movq 0xf1792(%rip), %rdi     # 0x165f98
leaq 0x68b72(%rip), %rsi     # 0xdd37f
callq 0x289f0
movss 0x1688(%rbx), %xmm0
movq %rax, %rdi
callq 0x28780
movq %rax, %rdi
popq %rbx
jmp 0x284a0
retq
// File: /workspace/github_cpp_makefile_star2_O2/richardposner[P]BioNetFit2/src/code/Swarm.cpp
// Function: Swarm::killAllParticles(int)
void Swarm::killAllParticles(int tag) {
	int p, sp;
	unsigned int mid;
	for (p = 1; p <= options.swarmSize; ++p) {
		//cout << "killing " << p << " with tag: " << tag << endl;
		for(mid=0; mid < options.models.size(); mid++){//Raquel modified this
			//sp = (p-1)*getNumModels()+ mid + 1; //Raquel replaced by code bellow
			sp = fcalcsubParID(p, mid, options.models.size());

			if(options.verbosity>=3){
				cout << "RAQUEL sending message to subPar " << sp << "message=" << tag << endl;
			}
			swarmComm->sendToSwarm(0, sp, tag, false, swarmComm->univMessageSender);
		}
	}
	swarmComm->univMessageSender.clear();
	//cout << "killed all particles" << endl;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
pushq $0x1
popq %r14
leaq 0x64a9c(%rip), %r13     # 0xdf96d
cmpl 0x1620(%rbx), %r14d
jg 0x7af76
xorl %r15d, %r15d
movl %r15d, %eax
movq 0x15c8(%rbx), %rdx
subq 0x15c0(%rbx), %rdx
sarq $0x3, %rdx
cmpq %rax, %rdx
jbe 0x7af6e
movl %r14d, %edi
movl %r15d, %esi
callq 0x9ec09
movl %eax, %r12d
cmpl $0x3, 0x1614(%rbx)
jb 0x7af4d
movq 0xeb07f(%rip), %rdi     # 0x165f98
leaq 0x64a2b(%rip), %rsi     # 0xdf94b
callq 0x289f0
movq %rax, %rdi
movl %r12d, %esi
callq 0x29290
movq %rax, %rdi
movq %r13, %rsi
callq 0x289f0
movq %rax, %rdi
movl %ebp, %esi
callq 0x29290
movq %rax, %rdi
callq 0x284a0
movq (%rbx), %rdi
orl $-0x1, (%rsp)
xorl %esi, %esi
movl %r12d, %edx
movl %ebp, %ecx
xorl %r8d, %r8d
movq %rdi, %r9
callq 0x600c8
incl %r15d
jmp 0x7aee1
incl %r14d
jmp 0x7aed1
movq (%rbx), %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3376e
// File: /workspace/github_cpp_makefile_star2_O2/richardposner[P]BioNetFit2/src/code/Swarm.cpp
// Function: Swarm::addRunningParticle(int)
void Swarm::addRunningParticle(int subParID) {
	//int pID = fcalcParID(subParID, options.models.size());
	runningSubParticles_.insert(subParID);

	vector<unsigned int> newPar = update_finished_running_particles();
	//runningParticles_.insert(pID);

}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
addq $0x1820, %rdi           # imm = 0x1820
movq %rsp, %rax
movl %esi, (%rax)
movq %rax, %rsi
callq 0x8fcb0
movq %rsp, %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x7bc26
movq %r14, %rdi
callq 0x5b268
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/richardposner[P]BioNetFit2/src/code/Swarm.cpp
// Function: Swarm::getClusterCommand(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
string Swarm::getClusterCommand(string runCmd) {
	if (options.clusterSoftware == "slurm") {
		return generateSlurmMultiProgCmd(runCmd);
	}
	else if (options.clusterSoftware == "torque") {
		return generateTorqueBatchScript(runCmd);
	}
	else if (options.clusterSoftware == "mpi") {
		cout << "runCmd is: " << runCmd << endl;
		return generateMPICommand(runCmd);
	}
	else if (options.clusterSoftware == "BNF2mpi") {
			if(options.verbosity >= 3){
				cout << "runCmd is: " << runCmd << endl;
			}
			return generateBNF2MPICommand(runCmd);
	}
	else {
		return 0;
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x1730(%rsi), %r12
leaq 0x5364a(%rip), %rsi     # 0xd03bf
movq %r12, %rdi
callq 0x3357b
testb %al, %al
je 0x7cda6
leaq 0x68(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x28dd0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x7cee6
leaq 0x68(%rsp), %rdi
jmp 0x7cea5
leaq 0x53618(%rip), %rsi     # 0xd03c5
movq %r12, %rdi
callq 0x3357b
testb %al, %al
je 0x7cde1
leaq 0x48(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x28dd0
movq %rbx, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x7d6c0
leaq 0x48(%rsp), %rdi
jmp 0x7cea5
leaq 0x535e8(%rip), %rsi     # 0xd03d0
movq %r12, %rdi
callq 0x3357b
testb %al, %al
je 0x7ce3f
movq 0xe919d(%rip), %rdi     # 0x165f98
leaq 0x61515(%rip), %rsi     # 0xde317
callq 0x289f0
movq %rax, %rdi
movq %r15, %rsi
callq 0x28910
movq %rax, %rdi
callq 0x284a0
leaq 0x28(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x28dd0
movq %rbx, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x7da9e
leaq 0x28(%rsp), %rdi
jmp 0x7cea5
leaq 0x53586(%rip), %rsi     # 0xd03cc
movq %r12, %rdi
callq 0x3357b
testb %al, %al
je 0x7cebc
cmpl $0x3, 0x1614(%r14)
jb 0x7ce82
movq 0xe9135(%rip), %rdi     # 0x165f98
leaq 0x614ad(%rip), %rsi     # 0xde317
callq 0x289f0
movq %rax, %rdi
movq %r15, %rsi
callq 0x28910
movq %rax, %rdi
callq 0x284a0
leaq 0x8(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x28dd0
movq %rbx, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x7deea
leaq 0x8(%rsp), %rdi
callq 0x295a0
movq %rbx, %rax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x7(%rsp), %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x33402
jmp 0x7ceaa
jmp 0x7ced3
jmp 0x7ced3
jmp 0x7ced3
movq %rax, %rbx
movq %r12, %rdi
callq 0x295a0
movq %rbx, %rdi
callq 0x292f0
// File: /workspace/github_cpp_makefile_star2_O2/richardposner[P]BioNetFit2/src/code/Swarm.cpp
// Function: Swarm::pickWeighted(double, std::multimap<double, unsigned int, std::less<double>, std::allocator<std::pair<double const, unsigned int>>>&, unsigned int)
unsigned int Swarm::pickWeighted(double weightSum, multimap<double, unsigned int> &weights, unsigned int extraWeight) {
	double lowerBound = 0;
	double upperBound = weightSum;
	if(options.verbosity>=4){
		cout << "lower limit = " << lowerBound << "; upper limit = " << upperBound << endl;
	}
	// TODO: Better error handling here?
	if (upperBound <= 0) {
		return 0;
	}

	if(options.verbosity>=4){

		cout << "lower limit = " << lowerBound << "; upper limit = " << upperBound << endl;
	}
	boost::random::uniform_real_distribution<double> unif(lowerBound, upperBound);

	double random = unif(generalRand);
	double chosen = random * ( 1 - (extraWeight / 10 ));

	//cout << "chosen: " << chosen << endl;

	double currentSum = 0;
	unsigned int indexCounter = 0;
	for (multimap<double, unsigned int>::reverse_iterator w = weights.rbegin(); w != weights.rend(); ++w) {
		currentSum += w->first;
		//cout << "adding " << w->first << endl;

		if (currentSum >= chosen) {
			return indexCounter;
		}
		++indexCounter;
	}
	//cout << "fell off the end" << endl;
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movl %edx, %ebp
movq %rsi, %rbx
movapd %xmm0, %xmm1
movq %rdi, %r14
cmpl $0x4, 0x1614(%rdi)
jb 0x7e995
movq 0xe764c(%rip), %rdi     # 0x165f98
leaq 0x5fe64(%rip), %rsi     # 0xde7b7
movsd %xmm1, 0x8(%rsp)
callq 0x289f0
xorpd %xmm0, %xmm0
movq %rax, %rdi
callq 0x290f0
leaq 0x5fe55(%rip), %rsi     # 0xde7c6
movq %rax, %rdi
callq 0x289f0
movq %rax, %rdi
movsd 0x8(%rsp), %xmm0
callq 0x290f0
movq %rax, %rdi
callq 0x284a0
movsd 0x8(%rsp), %xmm1
xorl %r15d, %r15d
xorpd %xmm0, %xmm0
ucomisd %xmm1, %xmm0
jae 0x7ea80
cmpl $0x4, 0x1614(%r14)
jb 0x7ea00
movq 0xe75e1(%rip), %rdi     # 0x165f98
leaq 0x5fdf9(%rip), %rsi     # 0xde7b7
movsd %xmm1, 0x8(%rsp)
callq 0x289f0
xorpd %xmm0, %xmm0
movq %rax, %rdi
callq 0x290f0
leaq 0x5fdea(%rip), %rsi     # 0xde7c6
movq %rax, %rdi
callq 0x289f0
movq %rax, %rdi
movsd 0x8(%rsp), %xmm0
callq 0x290f0
movq %rax, %rdi
callq 0x284a0
movsd 0x8(%rsp), %xmm1
leaq 0x18(%rsp), %r15
xorpd %xmm0, %xmm0
movsd %xmm0, 0x8(%rsp)
movq %r15, %rdi
callq 0x866ac
addq $0x58, %r14
movq %r15, %rdi
movq %r14, %rsi
callq 0x866dc
xorl %r15d, %r15d
pushq $0xa
popq %rcx
movl %ebp, %eax
xorl %edx, %edx
divl %ecx
pushq $0x1
popq %rcx
subl %eax, %ecx
cvtsi2sd %rcx, %xmm1
mulsd %xmm0, %xmm1
movsd %xmm1, 0x10(%rsp)
movq 0x18(%rbx), %r14
addq $0x8, %rbx
xorl %ebp, %ebp
cmpq %r14, %rbx
je 0x7ea80
movq %rbx, %rdi
callq 0x28aa0
movsd 0x8(%rsp), %xmm0
addsd 0x20(%rax), %xmm0
movsd %xmm0, 0x8(%rsp)
ucomisd 0x10(%rsp), %xmm0
jae 0x7ea7d
movq %rax, %rbx
incl %ebp
jmp 0x7ea50
movl %ebp, %r15d
movl %r15d, %eax
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/richardposner[P]BioNetFit2/src/code/Swarm.cpp
// Function: Swarm::insertKeyByValue(std::multimap<double, unsigned int, std::less<double>, std::allocator<std::pair<double const, unsigned int>>>&, double, unsigned int)
void Swarm::insertKeyByValue(multimap<double, unsigned int> &theMap, double key, unsigned int value) {
	//cout << "looking for " << value << endl;
	for (auto thePair = theMap.begin(); thePair != theMap.end(); ++thePair) {
		if (thePair->second == value) {
			//cout << "found " << value << " inserting " << key << endl;
			theMap.erase(thePair);
			theMap.insert(pair<double, unsigned int>(key, value));
			return;
		}
	}
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
movl %edx, %ebp
movsd %xmm0, 0x8(%rsp)
movq %rsi, %rbx
movq 0x18(%rsi), %rax
leaq 0x8(%rsi), %r14
cmpq %r14, %rax
je 0x7eae2
cmpl %ebp, 0x28(%rax)
je 0x7eabd
movq %rax, %rdi
callq 0x28700
jmp 0x7eaa9
movq %rbx, %rdi
movq %rax, %rsi
callq 0x8f7e2
leaq 0x10(%rsp), %rsi
movsd 0x8(%rsp), %xmm0
movsd %xmm0, (%rsi)
movl %ebp, 0x8(%rsi)
movq %rbx, %rdi
callq 0x8edfc
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/richardposner[P]BioNetFit2/src/code/Swarm.cpp
// Function: Swarm::saveSwarmState()
void Swarm::saveSwarmState() {
	string serializedSwarmPath = options.jobOutputDir + "swarmState.sconf";

	std::ofstream ofs(serializedSwarmPath);
	if (ofs.is_open()) {

		boost::archive::binary_oarchive ar(ofs);
		ar & *this;
		ofs.close();
	}
	else {
		cout << "Warning: Couldn't save swarm state to " << serializedSwarmPath << endl;
	}
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x288, %rsp            # imm = 0x288
movq %rdi, %rbx
leaq 0x1520(%rdi), %rsi
leaq 0x81f94(%rip), %rdx     # 0x100c1f
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x334ed
leaq 0x88(%rsp), %rdi
pushq $0x10
popq %rdx
movq %r14, %rsi
callq 0x294c0
leaq 0xf8(%rsp), %rdi
callq 0x28200
testb %al, %al
je 0x7ecf6
leaq 0x28(%rsp), %rdi
leaq 0x88(%rsp), %rsi
xorl %edx, %edx
callq 0x866ee
leaq 0x28(%rsp), %rdi
movq %rbx, %rsi
callq 0x90140
leaq 0x88(%rsp), %rdi
callq 0x28e60
leaq 0x28(%rsp), %rdi
callq 0x86728
jmp 0x7ed1e
movq 0xe729b(%rip), %rdi     # 0x165f98
leaq 0x5fafb(%rip), %rsi     # 0xde7ff
callq 0x289f0
leaq 0x8(%rsp), %rsi
movq %rax, %rdi
callq 0x28910
movq %rax, %rdi
callq 0x284a0
leaq 0x88(%rsp), %rdi
callq 0x28f10
leaq 0x8(%rsp), %rdi
callq 0x295a0
addq $0x288, %rsp            # imm = 0x288
popq %rbx
popq %r14
retq
jmp 0x7ed56
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x86728
jmp 0x7ed59
movq %rax, %rbx
jmp 0x7ed66
movq %rax, %rbx
leaq 0x88(%rsp), %rdi
callq 0x28f10
leaq 0x8(%rsp), %rdi
callq 0x295a0
movq %rbx, %rdi
callq 0x292f0
// File: /workspace/github_cpp_makefile_star2_O2/richardposner[P]BioNetFit2/src/code/Swarm.cpp
// Function: Swarm::initPSOswarm(bool)
void Swarm::initPSOswarm(bool resumeFit) {
	vector<unsigned int> finishedParticles;
	//unsigned int numFinishedParticles = 0;

	if (options.verbosity >= 3) {
		cout << "Launching swarm" << endl;
	}

	// Launch all particles
	//for (unsigned int p = 1; p <= options.swarmSize; ++p) {
	//	launchParticle(p);
	//}

	//if (options.verbosity >= 3) {
	//	cout << "Waiting for particles to finish" << endl;
	//}

	// Wait until they are all finished so we can initialize
	// stuff for subsequent iterations
	/*while(numFinishedParticles < options.swarmSize) {
		// Check for our finished particles

		cout << "RAQUEL swarm size is " << options.swarmSize << " finished: " << numFinishedParticles << endl;
		finishedParticles = checkMasterMessages();
		numFinishedParticles += finishedParticles.size();

		// Sleep for a second
		usleep(1000000);
	}

	*/
	//Raquel replaced the loop above by a synchronous generation
	runGeneration();



	// Fill a vector with all pID's to send for processing
	vector<unsigned int> allParticles;
	for (int p = 1; p <= options.swarmSize; ++p) {
		allParticles.push_back(p);
	}

	// Send all pID's in for processing (update velocities and positions)
	processParticlesPSO(allParticles, false);

	// Set our optimum
	optimum_ = particleBestFitsByFit_.begin()->first;

	// If we're using enhanced stop criteria, update the enhanced stop variables
	if (options.enhancedStop) {
		// Initialize our particle weights and weighted average position
		updateEnhancedStop();
	}


}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x68, %rsp
movq %rdi, %rbx
andq $0x0, 0x40(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
cmpl $0x3, 0x1614(%rdi)
jb 0x7edb7
movq 0xe71f5(%rip), %rdi     # 0x165f98
leaq 0x5fa7c(%rip), %rsi     # 0xde826
callq 0x289f0
movq %rax, %rdi
callq 0x284a0
movq %rbx, %rdi
callq 0x76bce
leaq 0x10(%rsp), %r14
andq $0x0, 0x10(%r14)
xorps %xmm0, %xmm0
movaps %xmm0, (%r14)
pushq $0x1
popq %rbp
leaq 0xc(%rsp), %r15
cmpl 0x1620(%rbx), %ebp
jg 0x7edf3
movl %ebp, 0xc(%rsp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x8ed06
incl %ebp
jmp 0x7edd8
leaq 0x50(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x8673e
leaq 0x50(%rsp), %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x73f2e
leaq 0x50(%rsp), %rdi
callq 0x5b268
movq 0x1ac8(%rbx), %rax
movsd 0x20(%rax), %xmm0
movsd %xmm0, 0x1d90(%rbx)
cmpb $0x1, 0x16f8(%rbx)
jne 0x7ee40
movq %rbx, %rdi
callq 0x7322e
leaq 0x10(%rsp), %rdi
callq 0x5b268
leaq 0x30(%rsp), %rdi
callq 0x5b268
addq $0x68, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x5b268
jmp 0x7ee78
jmp 0x7ee75
movq %rax, %rbx
jmp 0x7ee82
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x5b268
leaq 0x30(%rsp), %rdi
callq 0x5b268
movq %rbx, %rdi
callq 0x292f0
// File: /workspace/github_cpp_makefile_star2_O2/richardposner[P]BioNetFit2/src/code/Swarm.cpp
// Function: Swarm::generateParticleFs()
vector<float> Swarm::generateParticleFs() {
	float min = 0.5;
	float max = 1.5;

	vector<float> Fs = vector<float>(options.swarmSize + 1, 0);

	for (int p = 1; p <= options.swarmSize; ++p) {
		float r = (float)rand() / (float)RAND_MAX;
		float diff = max - min;

		Fs[p] = (r * diff) + min;
	}

	return Fs;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movslq 0x1620(%rsi), %rsi
incq %rsi
leaq 0xc(%rsp), %rdx
andl $0x0, (%rdx)
leaq 0xb(%rsp), %rcx
callq 0x8694c
pushq $0x1
popq %r15
movslq 0x1620(%r14), %rax
cmpq %rax, %r15
jg 0x8256c
callq 0x28280
cvtsi2ss %eax, %xmm0
mulss 0x59c72(%rip), %xmm0    # 0xdc1c8
addss 0x59c6e(%rip), %xmm0    # 0xdc1cc
movq (%rbx), %rax
movss %xmm0, (%rax,%r15,4)
incq %r15
jmp 0x82539
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/richardposner[P]BioNetFit2/src/code/Swarm.cpp
// Function: Swarm::generateParticleCRs()
vector<float> Swarm::generateParticleCRs() {
	float min = 0.1;
	float max = 0.9;

	vector<float> CRs = vector<float>(options.swarmSize + 1, 0);

	for (int p = 1; p <= options.swarmSize; ++p) {
		float r = (float)rand() / (float)RAND_MAX;
		float diff = max - min;

		CRs[p] = (r * diff) + min;
	}

	return CRs;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movslq 0x1620(%rsi), %rsi
incq %rsi
leaq 0xc(%rsp), %rdx
andl $0x0, (%rdx)
leaq 0xb(%rsp), %rcx
callq 0x8694c
pushq $0x1
popq %r15
movslq 0x1620(%r14), %rax
cmpq %rax, %r15
jg 0x825e4
callq 0x28280
cvtsi2ss %eax, %xmm0
mulss 0x59c02(%rip), %xmm0    # 0xdc1c8
mulss 0x59c0a(%rip), %xmm0    # 0xdc1d8
addss 0x59c06(%rip), %xmm0    # 0xdc1dc
movq (%rbx), %rax
movss %xmm0, (%rax,%r15,4)
incq %r15
jmp 0x825a9
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/richardposner[P]BioNetFit2/src/code/Swarm.cpp
// Function: Swarm::generateParticleTemps()
vector<double> Swarm::generateParticleTemps() {
	// Eq 4 in Olensek et al

	// maxTemp is the difference between highest and lowest fits
	double maxTemp = particleBestFitsByFit_.rbegin()->first - particleBestFitsByFit_.begin()->first;
	//cout << "maxtemp is " << maxTemp << endl;
	//cout << "minTemp is " << options.minTemp << endl;
	//cout << "ss is " << options.swarmSize - 1 << endl;
	double ct = (1 / ((double)options.swarmSize - 1)) * log(maxTemp / options.minTemp);


	//cout << fixed << setprecision(10) << "ct is " << ct << endl;

	vector<double> temps = vector<double>(options.swarmSize + 1, 0);
	for (int p = 1; p <= options.swarmSize; ++p) {
		temps[p] = exp(0 - (ct * (p - 1)));
		//cout << fixed << setprecision(10) << "temp of " << p << " is " << temps[p] << endl;
	}

	return temps;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x1ab8(%rsi), %rdi
callq 0x28aa0
movsd 0x20(%rax), %xmm0
movq 0x1ac8(%r14), %rax
subsd 0x20(%rax), %xmm0
cvtsi2sdl 0x1620(%r14), %xmm1
addsd 0x59b61(%rip), %xmm1    # 0xdc190
movsd %xmm1, 0x8(%rsp)
divsd 0x1710(%r14), %xmm0
callq 0x28830
movsd %xmm0, 0x10(%rsp)
movslq 0x1620(%r14), %rsi
incq %rsi
leaq 0x18(%rsp), %rdx
andq $0x0, (%rdx)
leaq 0x7(%rsp), %rcx
movq %rbx, %rdi
callq 0x868f6
movsd 0x59b1f(%rip), %xmm0    # 0xdc190
divsd 0x8(%rsp), %xmm0
mulsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
pushq $0x1
popq %r15
movslq 0x1620(%r14), %rax
cmpq %rax, %r15
jg 0x826bc
leal -0x1(%r15), %eax
cvtsi2sd %eax, %xmm0
mulsd 0x8(%rsp), %xmm0
addsd 0x523d7(%rip), %xmm0    # 0xd4a80
callq 0x29320
movq (%rbx), %rax
movsd %xmm0, (%rax,%r15,8)
incq %r15
jmp 0x82687
movq %rbx, %rax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/richardposner[P]BioNetFit2/src/code/Swarm.cpp
// Function: Swarm::generateParticleRadii()
vector<double> Swarm::generateParticleRadii() {
	// Eq 4 in Olensek et al

	float rMax = 1;
	float cr = (1 / ((double)options.swarmSize - 1)) * log(rMax / options.minRadius);

	vector<double> radii = vector<double>(options.swarmSize + 1, 0);
	for (int p = 1; p <= options.swarmSize; ++p) {
		radii[p] = exp(0 - (cr * (p - 1)));
		//cout << "radius of " << p << " is " << radii[p] << endl;
	}

	return radii;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %rbx
cvtsi2sdl 0x1620(%rsi), %xmm0
movsd 0x59aa5(%rip), %xmm1    # 0xdc190
addsd %xmm1, %xmm0
divsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rsp)
movsd 0x53b17(%rip), %xmm0    # 0xd6218
divsd 0x1718(%rsi), %xmm0
callq 0x28830
mulsd 0x8(%rsp), %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x8(%rsp)
movslq 0x1620(%r14), %rsi
incq %rsi
leaq 0x10(%rsp), %rdx
andq $0x0, (%rdx)
leaq 0x7(%rsp), %rcx
movq %rbx, %rdi
callq 0x868f6
movq (%rbx), %r15
pushq $0x1
popq %r12
movslq 0x1620(%r14), %rax
cmpq %rax, %r12
jg 0x8277c
leal -0x1(%r12), %eax
cvtsi2ss %eax, %xmm0
mulss 0x8(%rsp), %xmm0
addss 0x59734(%rip), %xmm0    # 0xdbe9c
callq 0x291a0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, (%r15,%r12,8)
incq %r12
jmp 0x82745
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/richardposner[P]BioNetFit2/src/code/Swarm.cpp
// Function: Swarm::metropolisSelection(unsigned int, double, float)
bool Swarm::metropolisSelection(unsigned int particle, double fit, float particleTemp) {

	float p = min <float>(1, exp( (0 - (fit - particleBestFits_.at(particle))) / particleTemp ) );
	float r = (float)rand() / (float)RAND_MAX;

	if (r < p) {
		return true;
	}
	else {
		return false;
	}
}

// Assembly:
subq $0x18, %rsp
movss %xmm1, 0x4(%rsp)
movsd %xmm0, 0x8(%rsp)
leaq 0x14(%rsp), %rax
movl %esi, (%rax)
addq $0x1a20, %rdi           # imm = 0x1A20
movq %rax, %rsi
callq 0x8626a
movsd (%rax), %xmm1
subsd 0x8(%rsp), %xmm1
xorpd %xmm0, %xmm0
addsd %xmm1, %xmm0
cvtss2sd 0x4(%rsp), %xmm1
divsd %xmm1, %xmm0
callq 0x29320
cvtsd2ss %xmm0, %xmm0
minss 0x596b9(%rip), %xmm0    # 0xdbe98
movss %xmm0, 0x4(%rsp)
callq 0x28280
cvtsi2ss %eax, %xmm0
mulss 0x599d2(%rip), %xmm0    # 0xdc1c8
movss 0x4(%rsp), %xmm1
ucomiss %xmm0, %xmm1
seta %al
addq $0x18, %rsp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/richardposner[P]BioNetFit2/src/code/Swarm.cpp
// Function: Swarm::swapTR(std::vector<double, std::allocator<double>>, std::vector<double, std::allocator<double>>)
void Swarm::swapTR(vector<double> particleRadii, vector<double> particleTemps) {
	// Pick two random individuals
	unsigned int r1 = rand() % options.swarmSize + 1;
	unsigned int r2 = rand() % options.swarmSize + 1;

	// Make sure they're different
	while (r1 == r2) {
		r2 = rand() % options.swarmSize + 1;
	}

	// Choose probability and a random number [0,1]
	float p = min <float>(1, exp( (particleBestFits_.at(r1) - particleBestFits_.at(r2) ) * ((1/particleRadii[r1]) - (1/particleRadii[r2]))));
	float r = (float)rand() / (float)RAND_MAX;

	// Swap
	if (r < p) {
		float r1Temp = particleTemps[r1];
		float r1Radius = particleRadii[r1];

		particleTemps[r1] = particleTemps[r2];
		particleRadii[r1] = particleRadii[r2];

		particleTemps[r2] = r1Temp;
		particleRadii[r2] = r1Radius;
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r15
callq 0x28280
cltd
idivl 0x1620(%r15)
movl %edx, %r12d
leal 0x1(%r12), %eax
movl %eax, 0xc(%rsp)
callq 0x28280
cltd
idivl 0x1620(%r15)
cmpl %edx, %r12d
je 0x82837
incl %edx
leaq 0x1c(%rsp), %r12
movl %edx, (%r12)
addq $0x1a20, %r15           # imm = 0x1A20
leaq 0xc(%rsp), %r13
movq %r15, %rdi
movq %r13, %rsi
callq 0x8626a
movsd (%rax), %xmm0
movsd %xmm0, 0x10(%rsp)
movq %r15, %rdi
movq %r12, %rsi
callq 0x8626a
movsd 0x10(%rsp), %xmm2
subsd (%rax), %xmm2
movl (%r13), %eax
movq (%rbx), %rcx
movl (%r12), %edx
movsd (%rcx,%rax,8), %xmm1
movhpd (%rcx,%rdx,8), %xmm1    # xmm1 = xmm1[0],mem[0]
movapd 0x598a9(%rip), %xmm0    # 0xdc150
divpd %xmm1, %xmm0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
subsd %xmm1, %xmm0
mulsd %xmm2, %xmm0
callq 0x29320
cvtsd2ss %xmm0, %xmm0
minss 0x595cc(%rip), %xmm0    # 0xdbe98
movss %xmm0, 0x10(%rsp)
callq 0x28280
cvtsi2ss %eax, %xmm0
mulss 0x598e5(%rip), %xmm0    # 0xdc1c8
movss 0x10(%rsp), %xmm1
ucomiss %xmm0, %xmm1
jbe 0x8292c
movl 0xc(%rsp), %eax
movq (%r14), %rcx
cvtsd2ss (%rcx,%rax,8), %xmm0
movq (%rbx), %rdx
cvtsd2ss (%rdx,%rax,8), %xmm1
movl 0x1c(%rsp), %esi
movsd (%rcx,%rsi,8), %xmm2
movsd %xmm2, (%rcx,%rax,8)
movsd (%rdx,%rsi,8), %xmm2
movsd %xmm2, (%rdx,%rax,8)
cvtss2sd %xmm0, %xmm0
movsd %xmm0, (%rcx,%rsi,8)
cvtss2sd %xmm1, %xmm0
movsd %xmm0, (%rdx,%rsi,8)
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/richardposner[P]BioNetFit2/src/code/Swarm.cpp
// Function: Swarm::runNelderMead(unsigned int, unsigned int)
void Swarm::runNelderMead(unsigned int it, unsigned int cpu) {
	if (options.verbosity >= 3) {
		cout << "Running Nelder-Meade local search for particle " << it << " on cpu " << cpu << endl;
	}
	// On the master side, we just need to construct the simplex, serialize it,
	// then send it to the CPU..

	// calc -> params
	map<double, vector<double> > simplex {pair<double, vector<double> >(particleBestFits_.at(it), normalizeParams(particleCurrParamSets_.at(it)))};

	// Get our nearest neighbors in parameter space
	map<double, unsigned int> neighbors = getNearestNeighbors(it, this->getNumFreeParams());//map<double, unsigned int> neighbors = getNearestNeighbors(it, options.model->getNumFreeParams());

	// Fill our simplex
	for (auto particle = neighbors.begin(); particle != neighbors.end(); ++particle) {
		cout << "chose neighbor: " << particle->second << " with fit of " <<  particleBestFits_.at(particle->second) << endl;
		simplex[particleBestFits_.at(particle->second)] = normalizeParams(particleCurrParamSets_.at(particle->second));
		for (auto param = simplex[particleBestFits_.at(particle->second)].begin(); param != simplex[particleBestFits_.at(particle->second)].end(); ++ param) {
			cout << "p: " << *param << endl;
		}
	}

	std::stringstream oss;
	boost::archive::text_oarchive oa(oss);
	oa << simplex;
	std::string serializedSimplex(oss.str());

	vector<string> message;
	message.push_back(serializedSimplex);

	runningParticles_.insert(cpu);
	swarmComm->sendToSwarm(0, cpu, BEGIN_NELDER_MEAD, false, message);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x40, %rsp
movq %rdi, %rbx
movl %esi, 0xc(%rsp)
cmpl $0x3, 0x1614(%rdi)
jb 0x82b9a
movl %edx, %ebp
movl %esi, %r14d
movq 0xe3436(%rip), %rdi     # 0x165f98
leaq 0x5d330(%rip), %rsi     # 0xdfe99
callq 0x289f0
movl %r14d, %esi
movq %rax, %rdi
callq 0x286e0
leaq 0x5c380(%rip), %rsi     # 0xdef00
movq %rax, %rdi
callq 0x289f0
movl %ebp, %esi
movq %rax, %rdi
callq 0x286e0
movq %rax, %rdi
callq 0x284a0
leaq 0x1a20(%rbx), %rdi
leaq 0xc(%rsp), %r14
movq %r14, %rsi
callq 0x8626a
leaq 0x1400(%rbx), %rdi
movq %r14, %rsi
callq 0x861e4
leaq 0x10(%rsp), %rdi
movq %rax, %rsi
callq 0x59fa2
leaq 0x28(%rsp), %rdi
movq %rbx, %rsi
callq 0x82bec
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x5c44e
movq %rbx, %rdi
callq 0x292f0
// File: /workspace/github_cpp_makefile_star2_O2/richardposner[P]BioNetFit2/src/code/Swarm.cpp
// Function: Swarm::normalizeParams(std::vector<double, std::allocator<double>>)
vector<double> Swarm::normalizeParams(vector<double> oldParams) {
	vector<double> newParams;

	outputError("needs modifications to support multiple files");
/*	unsigned int d = 0;
	for (auto param = options.model->getFreeParams_().begin(); param != options.model->getFreeParams_().end(); ++param) {
		//cout << "denormalized: " << oldParams[d] << endl;
		//cout << "max: " << param->second->getGenMax() << " min: " << param->second->getGenMin() << " diff: " << (param->second->getGenMax() - param->second->getGenMin()) << endl;
		//newParams.push_back((oldParams[d++] - param->second->getGenMin()) / (param->second->getGenMax() - param->second->getGenMin()));
		newParams.push_back(normalizeParam(oldParams[d], param->second->getGenMin(), param->second->getGenMax(), param->second->getIsLog()));
		//cout << "normalized: " << *(newParams.end() - 1) << endl;
		++d;
	}
	*/
	return newParams;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r14
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
andq $0x0, 0x10(%rdi)
leaq 0x5ccf2(%rip), %rsi     # 0xdf8fd
leaq 0x8(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x33402
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x6aed2
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x295a0
jmp 0x82c39
movq %rax, %r14
movq %rbx, %rdi
callq 0x5c44e
movq %r14, %rdi
callq 0x292f0
nop
// File: /workspace/github_cpp_makefile_star2_O2/richardposner[P]BioNetFit2/src/code/Data.hh
// Function: void Data::serialize<boost::archive::binary_oarchive>(boost::archive::binary_oarchive&, unsigned int)
void serialize(Archive& ar, const unsigned version) {
		//std::cout << "serializing data" << std::endl;

		ar & standardDeviations;
		ar & colAverages;
		ar & dataPath;
		ar & dataOrig_;
		ar & dataStandardized_;
		ar & dataLogTransformed_;
		ar & dataDividedByInit_;

		ar & swarm_;
		ar & isExp_;
		ar & dataCurrent;
	}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x8(%rdi), %rsi
movq %r14, %rdi
callq 0x9216a
leaq 0x38(%rbx), %rsi
movq %r14, %rdi
callq 0x9218e
leaq 0x70(%rbx), %rsi
movq %r14, %rdi
callq 0x8b6d8
leaq 0x90(%rbx), %rsi
movq %r14, %rdi
callq 0x9216a
leaq 0xc0(%rbx), %rsi
movq %r14, %rdi
callq 0x9216a
leaq 0xf0(%rbx), %rsi
movq %r14, %rdi
callq 0x9216a
leaq 0x120(%rbx), %rsi
movq %r14, %rdi
callq 0x9216a
leaq 0x150(%rbx), %rsi
movq %r14, %rdi
callq 0x921b2
leaq 0x158(%rbx), %rsi
movq %r14, %rdi
callq 0x90964
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x9225c
// File: /workspace/github_cpp_makefile_star2_O2/richardposner[P]BioNetFit2/src/code/FreeParam.hh
// Function: void FreeParam::serialize<boost::archive::binary_oarchive>(boost::archive::binary_oarchive&, unsigned int)
void serialize(Archive& ar, const unsigned version) {
		//std::cout << " serializing fp" << std::endl;

		ar & parameterName_;
		ar & generationMethod_;
		ar & mutationRate_;
		ar & mutationFactor_;
		ar & genMin_;
		ar & genMax_;
		ar & hasMutation_;
		ar & isLog_;
	}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
movq %r14, %rsi
callq 0x8b6d8
leaq 0x20(%r14), %rsi
movq %rbx, %rdi
callq 0x8b6d8
leaq 0x40(%r14), %rsi
movq %rbx, %rdi
callq 0x913a0
leaq 0x44(%r14), %rsi
movq %rbx, %rdi
callq 0x913a0
leaq 0x48(%r14), %rsi
movq %rbx, %rdi
callq 0x913a0
leaq 0x4c(%r14), %rsi
movq %rbx, %rdi
callq 0x913a0
leaq 0x50(%r14), %rsi
movq %rbx, %rdi
callq 0x90964
addq $0x51, %r14
movq %rbx, %rdi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x90964
nop
// File: /workspace/github_cpp_makefile_star2_O2/richardposner[P]BioNetFit2/src/code/Model.hh
// Function: void Model::serialize<boost::archive::binary_oarchive>(boost::archive::binary_oarchive&, unsigned int)
void serialize(Archive& ar, const unsigned version) {
		//std::cout << " serializing model" << std::endl;
		ar & swarm_;

		ar & freeParams_;

		ar & actions;
		ar & modelPath_;
		ar & fullContents_;
		ar & netContents_;

		ar & hasGenerateNetwork_;

	}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x60(%rdi), %rsi
movq %rbx, %rdi
callq 0x921b2
leaq 0x30(%r14), %rsi
movq %rbx, %rdi
callq 0x91306
movq %rbx, %rdi
movq %r14, %rsi
callq 0x95622
leaq 0x68(%r14), %rsi
movq %rbx, %rdi
callq 0x8b6d8
leaq 0x88(%r14), %rsi
movq %rbx, %rdi
callq 0x90a16
leaq 0xa0(%r14), %rsi
movq %rbx, %rdi
callq 0x90a16
addq $0xb8, %r14
movq %rbx, %rdi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x90964
// File: /workspace/github_cpp_makefile_star2_O2/richardposner[P]BioNetFit2/src/code/Model.hh
// Function: void Model::action::serialize<boost::archive::binary_oarchive>(boost::archive::binary_oarchive&, unsigned int)
void serialize(Archive& ar, const unsigned version) {

			ar & full;
			ar & t_end;
			ar & type;
			ar & scanParam;

			ar & dataSet;
		}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
movq %r14, %rsi
callq 0x8b6d8
leaq 0x20(%r14), %rsi
movq %rbx, %rdi
callq 0x90b12
leaq 0x28(%r14), %rsi
movq %rbx, %rdi
callq 0x8b6d8
leaq 0x48(%r14), %rsi
movq %rbx, %rdi
callq 0x8b6d8
addq $0x68, %r14
movq %rbx, %rdi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x91c38
nop
// File: /workspace/github_cpp_makefile_star2_O2/richardposner[P]BioNetFit2/src/code/Utils.cpp
// Function: convertToAbsPath(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
string convertToAbsPath(string relPath) {
        path fullPath;

        try{
                fullPath = canonical(relPath);
        }
        catch(...){}
        string tmp = fullPath.string();
        if(tmp.empty()){

        	return relPath;
        }

        return fullPath.string();
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x80, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x30(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x60(%rsp), %rdi
callq 0x28dd0
leaq 0x40(%rsp), %rdi
callq 0x9f605
movq %rsp, %rdi
leaq 0x60(%rsp), %rsi
leaq 0x40(%rsp), %rdx
callq 0x9f5f5
leaq 0x20(%rsp), %rdi
movq %rsp, %r15
movq %r15, %rsi
callq 0x28c40
movq %r15, %rdi
callq 0x295a0
leaq 0x40(%rsp), %rdi
callq 0x295a0
leaq 0x60(%rsp), %rdi
callq 0x295a0
movq %rsp, %rdi
leaq 0x20(%rsp), %rsi
callq 0x28dd0
cmpq $0x0, 0x8(%rsp)
je 0x9e48d
leaq 0x20(%rsp), %rsi
movq %rbx, %rdi
callq 0x28dd0
jmp 0x9e498
movq %rbx, %rdi
movq %r14, %rsi
callq 0x28d00
movq %rsp, %rdi
callq 0x295a0
leaq 0x20(%rsp), %rdi
callq 0x295a0
movq %rbx, %rax
addq $0x80, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x295a0
jmp 0x9e4e8
movq %rax, %r15
leaq 0x40(%rsp), %rdi
callq 0x295a0
jmp 0x9e4d9
movq %rax, %r15
leaq 0x60(%rsp), %rdi
callq 0x295a0
jmp 0x9e4fd
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x295a0
movq %rbx, %rdi
callq 0x292f0
movq %rax, %r15
movq %r15, %rdi
callq 0x283c0
callq 0x29150
jmp 0x9e469
jmp 0x9e4e5
// File: /workspace/github_cpp_makefile_star2_O2/richardposner[P]BioNetFit2/src/code/Utils.cpp
// Function: convertTimeToSeconds(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
int convertTimeToSeconds(string time){ //Raquel adding this function for walltime calculation

	int h, m, s=0;
	if (sscanf(time.c_str(), "%d:%d:%d", &h, &m, &s) >= 2) {
	  int secs = h *3600 + m*60 + s;
	  return secs;

	}else{
		cout << "Error converting maxFitTime to seconds, please check the sintax of your input value. Ignoring MaxFitTime." << endl;
	}

	return 0;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
leaq 0x4(%rsp), %r8
andl $0x0, (%r8)
movq (%rdi), %rdi
leaq 0x6191f(%rip), %rsi     # 0xffe48
xorl %ebx, %ebx
leaq 0xc(%rsp), %rdx
leaq 0x8(%rsp), %rcx
xorl %eax, %eax
callq 0x289e0
cmpl $0x2, %eax
jl 0x9e556
imull $0xe10, 0xc(%rsp), %eax # imm = 0xE10
imull $0x3c, 0x8(%rsp), %ebx
addl %eax, %ebx
addl 0x4(%rsp), %ebx
jmp 0x9e571
movq 0xc7a3b(%rip), %rdi     # 0x165f98
leaq 0x618ed(%rip), %rsi     # 0xffe51
callq 0x289f0
movq %rax, %rdi
callq 0x284a0
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/richardposner[P]BioNetFit2/src/code/Utils.cpp
// Function: split_string(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
vector<std::string> split_string(std::string str, std::string delimiter){
	vector<std::string> strs;
	size_t pos = 0;
	std::string token;
	while ((pos = str.find(delimiter)) != std::string::npos) {
		token = str.substr(0, pos);
		token = trim(token,true,true);
		strs.push_back(token);
		str.erase(0, pos + delimiter.length());
	}
	if (!str.empty()){
		strs.push_back(trim(str,true,true));  //add the last piece
	}
	return strs;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rdx, %r15
movq %rsi, %r14
andq $0x0, 0x10(%rdi)
xorps %xmm0, %xmm0
movq %rdi, (%rsp)
movups %xmm0, (%rdi)
leaq 0x58(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x8(%rsp), %r12
leaq 0x48(%rsp), %r13
leaq 0x68(%rsp), %rbp
movq %r14, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x29540
cmpq $-0x1, %rax
je 0x9eaab
movq %rax, %rbx
movq %r12, %rdi
movq %r14, %rsi
xorl %edx, %edx
movq %rax, %rcx
callq 0x28a90
movq %r13, %rdi
movq %r12, %rsi
callq 0x28c40
movq %r12, %rdi
callq 0x295a0
movq %rbp, %rdi
movq %r13, %rsi
callq 0x28dd0
movq %r12, %rdi
movq %rbp, %rsi
pushq $0x1
popq %rcx
movl %ecx, %edx
callq 0x9eb61
movq %r13, %rdi
movq %r12, %rsi
callq 0x28c40
movq %r12, %rdi
callq 0x295a0
movq %rbp, %rdi
callq 0x295a0
movq (%rsp), %rdi
movq %r13, %rsi
callq 0x33776
addq 0x8(%r15), %rbx
movq %r14, %rdi
xorl %esi, %esi
movq %rbx, %rdx
callq 0x281f0
jmp 0x9ea1a
cmpq $0x0, 0x8(%r14)
je 0x9eaf5
leaq 0x28(%rsp), %rdi
movq %r14, %rsi
callq 0x28dd0
leaq 0x8(%rsp), %rdi
leaq 0x28(%rsp), %rsi
pushq $0x1
popq %rcx
movl %ecx, %edx
callq 0x9eb61
leaq 0x8(%rsp), %rsi
movq (%rsp), %rdi
callq 0x5ec8c
leaq 0x8(%rsp), %rdi
callq 0x295a0
leaq 0x28(%rsp), %rdi
callq 0x295a0
leaq 0x48(%rsp), %rdi
callq 0x295a0
movq (%rsp), %rax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x295a0
jmp 0x9eb27
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
jmp 0x9eb3a
jmp 0x9eb43
jmp 0x9eb43
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0x295a0
jmp 0x9eb46
jmp 0x9eb43
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x295a0
movq (%rsp), %rdi
callq 0x3355a
movq %rbx, %rdi
callq 0x292f0
// File: /workspace/github_cpp_makefile_star2_O2/richardposner[P]BioNetFit2/src/code/Utils.cpp
// Function: trim(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool, bool)
std::string trim(std::string str, bool ltrim, bool rtrim){
	std::string s =str;
	if(ltrim)  //trim from left
		s.erase(s.begin(), std::find_if(s.begin(), s.end(), std::not1(std::ptr_fun<int, int>(std::isspace))));
	if(rtrim)  //trim from right
		 s.erase(std::find_if(s.rbegin(), s.rend(), std::not1(std::ptr_fun<int, int>(std::isspace))).base(), s.end());
//cout<<"string: "<<str <<" len["<< str.size() <<"]is trimed to: "<<s<<" len["<< s.size()<<"]\n.";
	return s;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
movl %ecx, %ebp
movl %edx, %r14d
movq %rdi, %rbx
callq 0x28dd0
testl %r14d, %r14d
je 0x9eba2
movq (%rbx), %r14
movq 0x8(%rbx), %rsi
addq %r14, %rsi
movq 0xc73b4(%rip), %rdx     # 0x165f40
movq %r14, %rdi
callq 0x9f997
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x281d0
testb %bpl, %bpl
je 0x9ebe6
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
addq %rax, %rcx
leaq 0x18(%rsp), %rsi
movq %rcx, (%rsi)
leaq 0x10(%rsp), %rdx
movq %rax, (%rdx)
movq 0xc7378(%rip), %rcx     # 0x165f40
leaq 0x8(%rsp), %rdi
callq 0x9f615
movq 0x8(%rsp), %rsi
movq (%rbx), %rdx
addq 0x8(%rbx), %rdx
movq %rbx, %rdi
callq 0x281d0
movq %rbx, %rax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
jmp 0x9ebf6
jmp 0x9ebf6
movq %rax, %r14
movq %rbx, %rdi
callq 0x295a0
movq %r14, %rdi
callq 0x292f0