LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/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 0x875a4
movq 0xeea3f(%rip), %r14     # 0x175fa8
leaq 0x77892(%rip), %rsi     # 0xfee02
movl $0x25, %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
movl 0x1620(%rbx), %eax
testl %eax, %eax
jle 0x87625
leaq 0x1cf0(%rbx), %r14
leaq 0x1a20(%rbx), %r15
xorpd %xmm0, %xmm0
xorl %ebp, %ebp
leaq 0x4(%rsp), %r12
movq %rsp, %r13
incl %ebp
movq 0x1ac8(%rbx), %rcx
cmpl 0x28(%rcx), %ebp
je 0x8761f
movl %ebp, 0x4(%rsp)
movq %r14, %rdi
movq %r12, %rsi
movsd %xmm0, 0x10(%rsp)
callq 0xa7a8c
movsd (%rax), %xmm0
movsd %xmm0, 0x8(%rsp)
movl %ebp, (%rsp)
movq %r15, %rdi
movq %r13, %rsi
callq 0xa7734
movsd 0x10(%rsp), %xmm0
movsd 0x8(%rsp), %xmm1
mulsd (%rax), %xmm1
addsd %xmm1, %xmm0
movl 0x1620(%rbx), %eax
cmpl %eax, %ebp
jl 0x875ca
jmp 0x87629
xorpd %xmm0, %xmm0
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0xa7ad2
movl 0x15b8(%rbx), %ecx
xorpd %xmm1, %xmm1
xorpd %xmm0, %xmm0
testl %ecx, %ecx
je 0x87694
movsd (%rax), %xmm2
movq 0x1ac8(%rbx), %rax
subsd 0x20(%rax), %xmm2
mulsd %xmm2, %xmm2
leal 0x1(%rcx), %edx
cmpl $0x3, %edx
movl $0x2, %eax
cmovael %edx, %eax
decl %eax
addsd %xmm2, %xmm0
decl %eax
jne 0x8768c
cmpl $0x1, %ecx
je 0x8769f
xorpd %xmm2, %xmm2
jmp 0x876a7
movsd 0x70c49(%rip), %xmm2    # 0xf82f0
mulsd %xmm2, %xmm0
ucomisd %xmm1, %xmm0
jb 0x876ba
xorps %xmm1, %xmm1
sqrtsd %xmm0, %xmm1
jmp 0x876c3
callq 0x22790
movapd %xmm0, %xmm1
movsd 0x70c25(%rip), %xmm2    # 0xf82f0
movapd %xmm2, %xmm0
divsd %xmm1, %xmm0
movl 0x1620(%rbx), %eax
testl %eax, %eax
jle 0x87703
movq 0x1ac8(%rbx), %rcx
movl 0x28(%rcx), %ecx
divsd %xmm0, %xmm2
decl %ecx
xorpd %xmm1, %xmm1
xorl %edx, %edx
cmpl %edx, %ecx
je 0x876fb
addsd %xmm2, %xmm1
incl %edx
cmpl %edx, %eax
jne 0x876f3
jmp 0x87707
xorpd %xmm1, %xmm1
divsd %xmm1, %xmm0
addq $0x10, %rsp
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x8979b
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0xec865(%rip), %r14     # 0x175fa8
leaq 0x75ad5(%rip), %rsi     # 0xff21f
movl $0x13, %edx
movq %r14, %rdi
callq 0x22ab0
xorps %xmm0, %xmm0
cvtss2sd 0x1688(%rbx), %xmm0
movq %r14, %rdi
callq 0x23060
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x22940
movsbl %al, %esi
movq %rbx, %rdi
callq 0x22050
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x22660
retq
// File: /workspace/github_cpp_makefile_star2_O3/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
movq %rdi, %rbx
movl 0x1620(%rdi), %ecx
testl %ecx, %ecx
jle 0x944c0
movl %esi, %ebp
movq 0x15c0(%rbx), %rax
movq 0x15c8(%rbx), %rdx
movl $0x1, %r15d
movq %rax, %rsi
subq %rax, %rdx
je 0x944ad
sarq $0x3, %rdx
xorl %r12d, %r12d
movl %r15d, %edi
movl %r12d, %esi
callq 0xbe989
movl %eax, %r13d
cmpl $0x3, 0x1614(%rbx)
jb 0x94467
movl $0x21, %edx
movq 0xe1ba6(%rip), %r14     # 0x175fa8
movq %r14, %rdi
leaq 0x6d356(%rip), %rsi     # 0x101762
callq 0x22ab0
movq %r14, %rdi
movl %r13d, %esi
callq 0x231e0
movq %rax, %r14
movl $0x8, %edx
movq %rax, %rdi
leaq 0x6d356(%rip), %rsi     # 0x101784
callq 0x22ab0
movq %r14, %rdi
movl %ebp, %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 (%rbx), %rdi
movl $0xffffffff, (%rsp)     # imm = 0xFFFFFFFF
xorl %esi, %esi
movl %r13d, %edx
movl %ebp, %ecx
xorl %r8d, %r8d
movq %rdi, %r9
callq 0x6bac2
incl %r12d
movq 0x15c0(%rbx), %rax
movq 0x15c8(%rbx), %rsi
movq %rsi, %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq %r12, %rdx
ja 0x943df
movl 0x1620(%rbx), %ecx
leal 0x1(%r15), %edi
movq %rsi, %rdx
cmpl %ecx, %r15d
movl %edi, %r15d
jl 0x943cc
movq (%rbx), %rdi
movq (%rdi), %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x6aebc
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0xafd3e
movq %rsp, %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x958ea
movq (%r14), %rdi
testq %rdi, %rdi
je 0x95fe1
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x229c0
addq $0x18, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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
movsd %xmm0, 0x8(%rsp)
movq 0x18(%rsi), %rax
leaq 0x8(%rsi), %r14
cmpq %r14, %rax
je 0x9bc4b
movl %edx, %ebp
movq %rsi, %rbx
cmpl %ebp, 0x28(%rax)
je 0x9bc26
movq %rax, %rdi
callq 0x22670
cmpq %r14, %rax
jne 0x9bc12
jmp 0x9bc4b
movq %rbx, %rdi
movq %rax, %rsi
callq 0xaf960
leaq 0x10(%rsp), %rsi
movsd 0x8(%rsp), %xmm0
movsd %xmm0, (%rsi)
movl %ebp, 0x8(%rsi)
movq %rbx, %rdi
callq 0xaefd4
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 %r15
pushq %r14
pushq %rbx
subq $0x280, %rsp            # imm = 0x280
movq %rdi, %rbx
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
movq 0x1520(%rdi), %rsi
movq 0x1528(%rdi), %rdx
addq %rsi, %rdx
movq %rsp, %r14
movq %r14, %rdi
callq 0x3213c
leaq 0x86854(%rip), %rsi     # 0x122721
movq %r14, %rdi
callq 0x233b0
leaq 0x80(%rsp), %rdi
movq %rsp, %rsi
movl $0x10, %edx
callq 0x233d0
leaq 0xf0(%rsp), %rdi
callq 0x221e0
testb %al, %al
je 0x9bf47
leaq 0x20(%rsp), %rdi
leaq 0x80(%rsp), %rsi
xorl %edx, %edx
callq 0xa7f98
callq 0xa896c
leaq 0x20(%rsp), %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0xe7360
leaq 0x80(%rsp), %rdi
callq 0x22de0
leaq 0x20(%rsp), %rdi
callq 0xe6f00
leaq 0x48(%rsp), %rdi
callq 0xeb5c0
jmp 0x9bf9e
movq 0xda05a(%rip), %rdi     # 0x175fa8
leaq 0x646c1(%rip), %rsi     # 0x100616
movl $0x26, %edx
callq 0x22ab0
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq 0xda039(%rip), %rdi     # 0x175fa8
callq 0x22ab0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x22940
movsbl %al, %esi
movq %rbx, %rdi
callq 0x22050
movq %rax, %rdi
callq 0x22660
movq 0xd9fe3(%rip), %rax     # 0x175f88
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq 0x88(%rsp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, 0x80(%rsp,%rcx)
callq 0x227d0
leaq 0x178(%rsp), %rdi
callq 0x222d0
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x9bfec
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x229c0
addq $0x280, %rsp            # imm = 0x280
popq %rbx
popq %r14
popq %r15
retq
jmp 0x9c01b
jmp 0x9bffd
movq %rax, %rbx
jmp 0x9c02b
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0xe6f00
leaq 0x48(%rsp), %rdi
callq 0xeb5c0
jmp 0x9c01e
movq %rax, %rbx
leaq 0x80(%rsp), %rdi
callq 0x22ea0
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x9c041
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x229c0
movq %rbx, %rdi
callq 0x23240
nop
// File: /workspace/github_cpp_makefile_star2_O3/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
movl $0x0, (%rdx)
leaq 0xb(%rsp), %rcx
callq 0xa8316
cmpl $0x0, 0x1620(%r14)
jle 0xa16e8
xorl %r15d, %r15d
callq 0x22230
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
mulss 0x5c9a1(%rip), %xmm0    # 0xfe068
addss 0x5c99d(%rip), %xmm0    # 0xfe06c
movq (%rbx), %rax
movss %xmm0, 0x4(%rax,%r15,4)
movslq 0x1620(%r14), %rax
incq %r15
cmpq %rax, %r15
jl 0xa16b3
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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
movl $0x0, (%rdx)
leaq 0xb(%rsp), %rcx
callq 0xa8316
cmpl $0x0, 0x1620(%r14)
jle 0xa176e
xorl %r15d, %r15d
callq 0x22230
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
mulss 0x5c923(%rip), %xmm0    # 0xfe068
mulss 0x5c92b(%rip), %xmm0    # 0xfe078
addss 0x5c927(%rip), %xmm0    # 0xfe07c
movq (%rbx), %rax
movss %xmm0, 0x4(%rax,%r15,4)
movslq 0x1620(%r14), %rax
incq %r15
cmpq %rax, %r15
jl 0xa1731
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x1ab8(%rsi), %rdi
callq 0x22a10
movsd 0x20(%rax), %xmm0
movq 0x1ac8(%r14), %rax
subsd 0x20(%rax), %xmm0
movl 0x1620(%r14), %ebp
divsd 0x1710(%r14), %xmm0
callq 0x227a0
movsd %xmm0, 0x8(%rsp)
movslq 0x1620(%r14), %rsi
incq %rsi
leaq 0x10(%rsp), %rdx
movq $0x0, (%rdx)
leaq 0x7(%rsp), %rcx
movq %rbx, %rdi
callq 0xa81f4
cmpl $0x0, 0x1620(%r14)
jle 0xa184f
xorps %xmm0, %xmm0
cvtsi2sd %ebp, %xmm0
movsd 0x5c830(%rip), %xmm1    # 0xfe030
addsd %xmm1, %xmm0
divsd %xmm0, %xmm1
movsd 0x8(%rsp), %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, 0x8(%rsp)
xorl %r15d, %r15d
xorps %xmm0, %xmm0
cvtsi2sd %r15d, %xmm0
mulsd 0x8(%rsp), %xmm0
addsd 0x552b7(%rip), %xmm0    # 0xf6ae8
callq 0x23270
movq (%rbx), %rax
movsd %xmm0, 0x8(%rax,%r15,8)
movslq 0x1620(%r14), %rax
incq %r15
cmpq %rax, %r15
jl 0xa181b
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movl 0x1620(%rsi), %ebp
movsd 0x56a72(%rip), %xmm0    # 0xf82f0
divsd 0x1718(%rsi), %xmm0
callq 0x227a0
movsd %xmm0, 0x10(%rsp)
movslq 0x1620(%r14), %rsi
incq %rsi
leaq 0x18(%rsp), %rdx
movq $0x0, (%rdx)
leaq 0xf(%rsp), %rcx
movq %rbx, %rdi
callq 0xa81f4
cmpl $0x0, 0x1620(%r14)
jle 0xa1924
xorps %xmm0, %xmm0
cvtsi2sd %ebp, %xmm0
movsd 0x5c763(%rip), %xmm1    # 0xfe030
addsd %xmm1, %xmm0
divsd %xmm0, %xmm1
movsd 0x10(%rsp), %xmm0
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x10(%rsp)
movq (%rbx), %r15
xorl %r12d, %r12d
xorps %xmm0, %xmm0
cvtsi2ss %r12d, %xmm0
mulss 0x10(%rsp), %xmm0
addss 0x5c3f7(%rip), %xmm0    # 0xfdcfc
callq 0x23100
cvtss2sd %xmm0, %xmm0
movsd %xmm0, 0x8(%r15,%r12,8)
movslq 0x1620(%r14), %rax
incq %r12
cmpq %rax, %r12
jl 0xa18ef
movq %rbx, %rax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0xa7a8c
movsd (%rax), %xmm1
subsd 0x8(%rsp), %xmm1
xorpd %xmm0, %xmm0
addsd %xmm1, %xmm0
xorps %xmm1, %xmm1
cvtss2sd 0x4(%rsp), %xmm1
divsd %xmm1, %xmm0
callq 0x23270
cvtsd2ss %xmm0, %xmm0
minss 0x5c36e(%rip), %xmm0    # 0xfdcf8
movss %xmm0, 0x4(%rsp)
callq 0x22230
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
mulss 0x5c6c4(%rip), %xmm0    # 0xfe068
movss 0x4(%rsp), %xmm1
ucomiss %xmm0, %xmm1
seta %al
addq $0x18, %rsp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x22230
cltd
idivl 0x1620(%r15)
movl %edx, %r12d
leal 0x1(%r12), %eax
movl %eax, 0xc(%rsp)
callq 0x22230
cltd
idivl 0x1620(%r15)
cmpl %edx, %r12d
je 0xa19e5
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 0xa7a8c
movsd (%rax), %xmm0
movsd %xmm0, 0x10(%rsp)
movq %r15, %rdi
movq %r12, %rsi
callq 0xa7a8c
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 0x5c57b(%rip), %xmm0    # 0xfdfd0
divpd %xmm1, %xmm0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
subsd %xmm1, %xmm0
mulsd %xmm2, %xmm0
callq 0x23270
cvtsd2ss %xmm0, %xmm0
minss 0x5c27e(%rip), %xmm0    # 0xfdcf8
movss %xmm0, 0x10(%rsp)
callq 0x22230
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
mulss 0x5c5d4(%rip), %xmm0    # 0xfe068
movss 0x10(%rsp), %xmm1
ucomiss %xmm0, %xmm1
jbe 0xa1ae6
movl 0xc(%rsp), %eax
movq (%r14), %rcx
xorps %xmm0, %xmm0
cvtsd2ss (%rcx,%rax,8), %xmm0
movq (%rbx), %rdx
xorps %xmm1, %xmm1
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)
xorps %xmm0, %xmm0
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_O3/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 %r15
pushq %r14
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
movl %esi, 0x4(%rsp)
cmpl $0x3, 0x1614(%rdi)
jb 0xa1dfc
movl %edx, %ebp
movl %esi, %r14d
movq 0xd4216(%rip), %r15     # 0x175fa8
leaq 0x5ff17(%rip), %rsi     # 0x101cb0
movl $0x2f, %edx
movq %r15, %rdi
callq 0x22ab0
movl %r14d, %esi
movq %r15, %rdi
callq 0x22650
movq %rax, %r14
leaq 0x5ef5c(%rip), %rsi     # 0x100d17
movl $0x8, %edx
movq %rax, %rdi
callq 0x22ab0
movl %ebp, %esi
movq %r14, %rdi
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
leaq 0x1a20(%rbx), %rdi
leaq 0x4(%rsp), %r14
movq %r14, %rsi
callq 0xa7a8c
leaq 0x1400(%rbx), %rdi
movq %r14, %rsi
callq 0xa7a46
leaq 0x8(%rsp), %rdi
movq %rax, %rsi
callq 0x65d5c
leaq 0x20(%rsp), %rdi
movq %rbx, %rsi
callq 0xa1e5c
movq %rax, %rbx
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0xa1e53
movq 0x18(%rsp), %rsi
subq %rdi, %rsi
callq 0x229c0
movq %rbx, %rdi
callq 0x23240
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rsi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x5f88e(%rip), %rsi     # 0x101714
leaq 0x5f8b4(%rip), %rdx     # 0x101741
movq %rsp, %r14
movq %r14, %rdi
callq 0x321d2
movq %rbx, %rdi
movq %r14, %rsi
callq 0x784c2
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0xa1ebc
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x229c0
movq %rbx, %rdi
callq 0x23240
// File: /workspace/github_cpp_makefile_star2_O3/richardposner[P]BioNetFit2/src/code/Swarm.cpp
// Function: Swarm::getNearestNeighbors(unsigned int, unsigned int)
map<double, unsigned int> Swarm::getNearestNeighbors(unsigned int it, unsigned int N) {
	map<double, unsigned int> neighbors;

	// Normalize it params
	vector<double> itParams = normalizeParams(particleCurrParamSets_.at(it));

	for (auto paramSet = particleCurrParamSets_.begin(); paramSet != particleCurrParamSets_.end(); ++paramSet) {
		// Skip this particle if it is the 'it', or if it has the same fit as 'it'
		if (paramSet->first == it || particleCurrParamSets_.at(it) == particleCurrParamSets_.at(paramSet->first)) {
			continue;
		}

		// Calculate sum of squares
		double sum = 0;
		vector<double> pParams = normalizeParams(particleCurrParamSets_.at(paramSet->first));
		auto itIt = itParams.begin();
		for (auto param = pParams.begin(); param != pParams.end(); ++param) {
			sum += pow((*itIt - *param), 2);
			++itIt;
		}

		// Insert sum and id to map. It is automatically ordered.
		neighbors.insert(pair<double, unsigned int>(sum, paramSet->first));
	}

	// We only need the top N, so delete the rest
	auto nIt = neighbors.begin();
	advance(nIt, N);
	neighbors.erase(nIt, neighbors.end());

	return neighbors;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x38, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x4(%rsp), %rsi
movl %edx, (%rsi)
leaq 0x8(%rdi), %rax
movl $0x0, 0x8(%rdi)
xorl %ecx, %ecx
movq %rcx, 0x10(%rdi)
movq %rax, 0x18(%rdi)
movq %rax, 0x20(%rdi)
movq %rcx, 0x28(%rdi)
leaq 0x1400(%r14), %rdi
callq 0xa7a46
leaq 0x8(%rsp), %rdi
movq %rax, %rsi
callq 0x65d5c
leaq 0x20(%rsp), %rdi
movq %r14, %rsi
callq 0xa1e5c
movq %rax, %r14
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0xa253c
movq 0x18(%rsp), %rsi
subq %rdi, %rsi
callq 0x229c0
jmp 0xa253c
movq %rax, %r14
movq %rbx, %rdi
callq 0x462de
movq %r14, %rdi
callq 0x23240
// File: /workspace/github_cpp_makefile_star2_O3/richardposner[P]BioNetFit2/src/./code/Data.hh
// Function: void Data::serialize<boost::archive::binary_iarchive>(boost::archive::binary_iarchive&, 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 %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x8(%rdi), %r15
callq 0xc4c04
movq %r14, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0xe5cc0
leaq 0x38(%rbx), %r15
callq 0xc4e64
movq %r14, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0xe5cc0
leaq 0x70(%rbx), %rsi
leaq 0x28(%r14), %r15
movq %r15, %rdi
callq 0xea010
leaq 0x90(%rbx), %r12
callq 0xc4c04
movq %r14, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0xe5cc0
leaq 0xc0(%rbx), %r12
callq 0xc4c04
movq %r14, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0xe5cc0
leaq 0xf0(%rbx), %r12
callq 0xc4c04
movq %r14, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0xe5cc0
leaq 0x120(%rbx), %r12
callq 0xc4c04
movq %r14, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0xe5cc0
leaq 0x150(%rbx), %rsi
movq %r14, %rdi
callq 0xc6b98
leaq 0x158(%rbx), %rsi
movq %r15, %rdi
callq 0xc7052
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0xc7f3c
// File: /workspace/github_cpp_makefile_star2_O3/richardposner[P]BioNetFit2/src/./code/FreeParam.hh
// Function: void FreeParam::serialize<boost::archive::binary_iarchive>(boost::archive::binary_iarchive&, 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 %rdi, %rbx
leaq 0x28(%rsi), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0xea010
leaq 0x20(%rbx), %rsi
movq %r14, %rdi
callq 0xea010
leaq 0x40(%rbx), %rsi
movq %r14, %rdi
callq 0xc768e
leaq 0x44(%rbx), %rsi
movq %r14, %rdi
callq 0xc768e
leaq 0x48(%rbx), %rsi
movq %r14, %rdi
callq 0xc768e
leaq 0x4c(%rbx), %rsi
movq %r14, %rdi
callq 0xc768e
leaq 0x50(%rbx), %rsi
movq %r14, %rdi
callq 0xc7052
addq $0x51, %rbx
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xc7052
// File: /workspace/github_cpp_makefile_star2_O3/richardposner[P]BioNetFit2/src/./code/Model.hh
// Function: void Model::serialize<boost::archive::binary_iarchive>(boost::archive::binary_iarchive&, 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 %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x60(%rdi), %rsi
movq %r14, %rdi
callq 0xc6b98
leaq 0x30(%rbx), %r15
callq 0xc50c4
movq %r14, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0xe5cc0
callq 0xc5454
movq %r14, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0xe5cc0
leaq 0x68(%rbx), %rsi
leaq 0x28(%r14), %r15
movq %r15, %rdi
callq 0xea010
leaq 0x88(%rbx), %r12
callq 0xc5f9c
movq %r14, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0xe5cc0
leaq 0xa0(%rbx), %r12
callq 0xc5f9c
movq %r14, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0xe5cc0
addq $0xb8, %rbx
movq %r15, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0xc7052
nop
// File: /workspace/github_cpp_makefile_star2_O3/richardposner[P]BioNetFit2/src/./code/Model.hh
// Function: void Model::action::serialize<boost::archive::binary_iarchive>(boost::archive::binary_iarchive&, unsigned int)
void serialize(Archive& ar, const unsigned version) {

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

			ar & dataSet;
		}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x28(%rsi), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0xea010
leaq 0x20(%r14), %rsi
movq %r15, %rdi
callq 0xc70d6
leaq 0x28(%r14), %rsi
movq %r15, %rdi
callq 0xea010
leaq 0x48(%r14), %rsi
movq %r15, %rdi
callq 0xea010
addq $0x68, %r14
movq %rbx, %rdi
movq %r14, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0xc7cc4
// File: /workspace/github_cpp_makefile_star2_O3/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 %r13
pushq %r12
pushq %rbx
subq $0x80, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x30(%rsp), %r12
movq %r12, -0x10(%r12)
movq $0x0, -0x8(%r12)
movb $0x0, (%r12)
leaq 0x50(%rsp), %r13
movq %r13, -0x10(%r13)
movq (%rsi), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
leaq 0x40(%rsp), %rdi
callq 0x3213c
leaq 0x60(%rsp), %rdi
xorl %esi, %esi
callq 0xd5450
movq %rsp, %rdi
leaq 0x40(%rsp), %rsi
leaq 0x60(%rsp), %rdx
xorl %ecx, %ecx
callq 0xd7d40
leaq 0x20(%rsp), %rdi
movq %rsp, %r15
movq %r15, %rsi
callq 0x22bb0
movq (%r15), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0xbdbb5
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x229c0
leaq 0x70(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xbdbd0
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x229c0
movq 0x40(%rsp), %rdi
cmpq %r13, %rdi
je 0xbdbe7
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x229c0
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
addq %rsi, %rdx
movq %rsp, %rdi
callq 0x3213c
leaq 0x10(%rbx), %rcx
cmpq $0x0, 0x8(%rsp)
movq %rcx, (%rbx)
je 0xbdc2b
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
addq %rsi, %rdx
movq %rbx, %rdi
callq 0x3213c
jmp 0xbdc61
movq (%r14), %rdx
leaq 0x10(%r14), %rax
cmpq %rax, %rdx
je 0xbdc43
movq %rdx, (%rbx)
movq (%rax), %rcx
movq %rcx, 0x10(%rbx)
jmp 0xbdc49
movups (%rax), %xmm0
movups %xmm0, (%rcx)
movq 0x8(%r14), %rcx
movq %rcx, 0x8(%rbx)
movq %rax, (%r14)
movq $0x0, 0x8(%r14)
movb $0x0, 0x10(%r14)
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0xbdc77
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x229c0
movq 0x20(%rsp), %rdi
cmpq %r12, %rdi
je 0xbdc8e
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x229c0
movq %rbx, %rax
addq $0x80, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0xbdcfc
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x229c0
jmp 0xbdcfc
movq %rax, %r15
leaq 0x70(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xbdce0
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x229c0
jmp 0xbdce0
movq %rax, %r15
movq 0x40(%rsp), %rdi
cmpq %r13, %rdi
je 0xbdd1e
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x229c0
jmp 0xbdd1e
movq %rax, %rbx
movq 0x20(%rsp), %rdi
cmpq %r12, %rdi
je 0xbdd13
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x229c0
movq %rbx, %rdi
callq 0x23240
movq %rax, %r15
movq %r15, %rdi
callq 0x22360
callq 0x230b0
jmp 0xbdbe7
jmp 0xbdcf9
// File: /workspace/github_cpp_makefile_star2_O3/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 %r14
pushq %rbx
subq $0x18, %rsp
leaq 0xc(%rsp), %r8
movl $0x0, (%r8)
movq (%rdi), %rdi
leaq 0x63c09(%rip), %rsi     # 0x121958
xorl %ebx, %ebx
leaq 0x14(%rsp), %rdx
leaq 0x10(%rsp), %rcx
xorl %eax, %eax
callq 0x22950
cmpl $0x2, %eax
jl 0xbdd7c
imull $0xe10, 0x14(%rsp), %eax # imm = 0xE10
imull $0x3c, 0x10(%rsp), %ebx
addl %eax, %ebx
addl 0xc(%rsp), %ebx
jmp 0xbddbe
movq 0xb8225(%rip), %r14     # 0x175fa8
leaq 0x63bd7(%rip), %rsi     # 0x121961
movl $0x69, %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
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movl %ecx, %ebp
movl %edx, %r14d
movq %rdi, %rbx
leaq 0x10(%rdi), %r15
movq %r15, (%rdi)
movq (%rsi), %rax
movq 0x8(%rsi), %rdx
addq %rax, %rdx
movq %rax, %rsi
callq 0x3213c
testl %r14d, %r14d
je 0xbe91c
movq (%rbx), %r14
movq 0x8(%rbx), %rsi
addq %r14, %rsi
movq 0xb7659(%rip), %rdx     # 0x175f40
movq %r14, %rdi
callq 0xbfda7
movq (%rbx), %rcx
movq %r14, %rsi
subq %rcx, %rsi
movq 0x8(%rbx), %rdx
addq %rcx, %rdx
cmpq %rax, %rdx
je 0xbe914
subq %r14, %rax
movq %rbx, %rdi
movq %rax, %rdx
callq 0x22b20
jmp 0xbe91c
movq %rsi, 0x8(%rbx)
movb $0x0, (%rcx,%rsi)
testb %bpl, %bpl
je 0xbe95b
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
addq %rax, %rcx
leaq 0x10(%rsp), %rsi
movq %rcx, (%rsi)
leaq 0x8(%rsp), %rdx
movq %rax, (%rdx)
movq 0xb75fe(%rip), %rcx     # 0x175f40
movq %rsp, %rdi
callq 0xbfe78
movq (%rsp), %rax
movq %rax, %rcx
subq (%rbx), %rcx
movq %rcx, 0x8(%rbx)
movb $0x0, (%rax)
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
jmp 0xbe96b
movq %rax, %r14
movq (%rbx), %rdi
cmpq %r15, %rdi
je 0xbe981
movq (%r15), %rsi
incq %rsi
callq 0x229c0
movq %r14, %rdi
callq 0x23240
// File: /workspace/github_cpp_makefile_star2_O3/richardposner[P]BioNetFit2/src/code/Utils.cpp
// Function: split(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void split(const string& str, vector<string>& tokens, const string& delimiters) {
	// Skip delimiters at beginning.
	string::size_type lastPos = str.find_first_not_of(delimiters, 0);
	// Find first "non-delimiter".
	string::size_type pos = str.find_first_of(delimiters, lastPos);

	while (string::npos != pos || string::npos != lastPos)
	{
		// Found a token, add it to the vector.
		tokens.push_back(str.substr(lastPos, pos - lastPos));
		// Skip delimiters.  Note the "not_of"
		lastPos = str.find_first_not_of(delimiters, pos);
		// Find next "non-delimiter"
		pos = str.find_first_of(delimiters, lastPos);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq (%rdx), %rsi
movq 0x8(%rdx), %rcx
xorl %edx, %edx
callq 0x23160
movq %rax, %rbp
movq (%rbx), %rsi
movq 0x8(%rbx), %rcx
movq %r15, %rdi
movq %rax, %rdx
callq 0x22f50
movq %rax, %r13
movq %rbp, %rax
andq %r13, %rax
cmpq $-0x1, %rax
je 0xbeae7
leaq 0x8(%rsp), %r12
movq %r13, %rcx
subq %rbp, %rcx
movq %r12, %rdi
movq %r15, %rsi
movq %rbp, %rdx
callq 0x22a00
movq %r14, %rdi
movq %r12, %rsi
callq 0x6a2a2
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0xbeab1
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x229c0
movq (%rbx), %rsi
movq 0x8(%rbx), %rcx
movq %r15, %rdi
movq %r13, %rdx
callq 0x23160
movq %rax, %rbp
movq (%rbx), %rsi
movq 0x8(%rbx), %rcx
movq %r15, %rdi
movq %rax, %rdx
callq 0x22f50
movq %rax, %r13
movq %rbp, %rax
andq %r13, %rax
cmpq $-0x1, %rax
jne 0xbea76
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0xbeb15
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x229c0
movq %rbx, %rdi
callq 0x23240
// File: /workspace/github_cpp_makefile_star2_O3/richardposner[P]BioNetFit2/src/code/Utils.cpp
// Function: commonPath(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>> const&, char)
string commonPath( const std::vector<std::string> & dirs , char separator ) {
	std::vector<std::string>::const_iterator vsi = dirs.begin( ) ;
	int maxCharactersCommon = vsi->length( ) ;
	std::string compareString = *vsi ;
	for ( vsi = dirs.begin( ) + 1 ; vsi != dirs.end( ) ; vsi++ ) {
		std::pair<std::string::const_iterator , std::string::const_iterator> p =
		std::mismatch( compareString.begin( ) , compareString.end( ) , vsi->begin( ) ) ;
		if (( p.first - compareString.begin( ) ) < maxCharactersCommon )
		maxCharactersCommon = p.first - compareString.begin( ) ;
	}
	std::string::size_type found = compareString.rfind( separator , maxCharactersCommon ) ;
	return compareString.substr( 0 , found ) ;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movq (%rsi), %rax
movq 0x8(%rax), %r12
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rsi
movq %r12, %rdx
addq %rsi, %rdx
movq %rsp, %rdi
callq 0x3213c
movq (%r14), %rax
movq 0x8(%r14), %rcx
addq $0x20, %rax
cmpq %rcx, %rax
je 0xbf739
movq (%rsp), %rdx
movq 0x8(%rsp), %rsi
leaq (%rdx,%rsi), %rdi
testq %rsi, %rsi
je 0xbf71b
movq (%rax), %r9
xorl %r8d, %r8d
movb (%rdx,%r8), %r10b
cmpb (%r9,%r8), %r10b
jne 0xbf720
incq %r8
cmpq %r8, %rsi
jne 0xbf704
movq %rdi, %r8
jmp 0xbf723
movq %rdx, %r8
jmp 0xbf723
addq %rdx, %r8
subq %rdx, %r8
movslq %r12d, %r12
cmpq %r12, %r8
cmovll %r8d, %r12d
addq $0x20, %rax
cmpq %rcx, %rax
jne 0xbf6f9
movslq %r12d, %rdx
movsbl %bpl, %esi
movq %rsp, %r14
movq %r14, %rdi
callq 0x233f0
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
movq %rax, %rcx
callq 0x22a00
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0xbf771
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x229c0
movq %rbx, %rax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0xbf79a
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x229c0
movq %rbx, %rdi
callq 0x23240
// File: /workspace/github_cpp_makefile_star2_O3/richardposner[P]BioNetFit2/src/code/Utils.cpp
// Function: createParticlePipe(char const*)
bool createParticlePipe(const char * path) {

	if (checkIfFileExists(path)) {
		unlink(path);
	}

	int fifo_status = mkfifo(path, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP);
	if (fifo_status) {
		cout << "Warning: Couldn't create pipe with path: " << path << endl;
		return false;
	}
	else {
		return true;
	}
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x30, %rsp
movq %rdi, %rbx
leaq 0x10(%rsp), %r14
leaq 0xf(%rsp), %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x319cc
movq %r14, %rdi
callq 0xbe9a8
movl %eax, %ebp
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xbf7e7
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x229c0
testl %ebp, %ebp
je 0xbf7f3
movq %rbx, %rdi
callq 0x22410
movq %rbx, %rdi
movl $0x1b0, %esi            # imm = 0x1B0
callq 0x22150
movl %eax, %ebp
testl %eax, %eax
je 0xbf881
movq 0xb679b(%rip), %r14     # 0x175fa8
leaq 0x626d7(%rip), %rsi     # 0x121eeb
movl $0x29, %edx
movq %r14, %rdi
callq 0x22ab0
testq %rbx, %rbx
je 0xbf842
movq %rbx, %rdi
callq 0x223a0
movq 0xb6773(%rip), %rdi     # 0x175fa8
movq %rbx, %rsi
movq %rax, %rdx
callq 0x22ab0
jmp 0xbf85a
movq (%r14), %rax
movq -0x18(%rax), %rax
leaq (%r14,%rax), %rdi
movl 0x20(%r14,%rax), %esi
orl $0x1, %esi
callq 0x23180
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
testl %ebp, %ebp
sete %al
addq $0x30, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xbf8ad
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x229c0
movq %rbx, %rdi
callq 0x23240
// File: /workspace/github_cpp_makefile_star2_O3/richardposner[P]BioNetFit2/src/code/Utils.cpp
// Function: isFloat(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
bool isFloat(string number) {
	istringstream iss(number);
	float f;
	iss >> noskipws >> f; // noskipws considers leading whitespace invalid
	// Check the entire string was consumed and if either failbit or badbit is set
	return iss.eof() && !iss.fail();
}

// Assembly:
pushq %rbx
subq $0x190, %rsp            # imm = 0x190
movq %rdi, %rsi
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
movl $0x8, %edx
callq 0x23130
movq (%rbx), %rax
movq -0x18(%rax), %rax
andl $0xffffefff, 0x28(%rsp,%rax) # imm = 0xFFFFEFFF
leaq 0xc(%rsp), %rsi
movq %rbx, %rdi
callq 0x23430
leaq 0x10(%rsp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
movl 0x30(%rsp,%rax), %eax
andl $0x7, %eax
cmpl $0x2, %eax
sete %bl
movq 0xb668a(%rip), %rsi     # 0x175f98
callq 0x22e00
leaq 0x88(%rsp), %rdi
callq 0x222d0
movl %ebx, %eax
addq $0x190, %rsp            # imm = 0x190
popq %rbx
retq
movq %rax, %rbx
movq 0xb6663(%rip), %rsi     # 0x175f98
leaq 0x10(%rsp), %rdi
callq 0x22e00
leaq 0x88(%rsp), %rdi
callq 0x222d0
movq %rbx, %rdi
callq 0x23240
// File: /workspace/github_cpp_makefile_star2_O3/richardposner[P]BioNetFit2/src/code/Utils.cpp
// Function: runCommand(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
int runCommand(string cmd, string &result) {

	std::shared_ptr<FILE> pipe(popen(cmd.c_str(), "r"), pclose);

	if (!pipe) {
		return 1;
	}

	char buffer[1024];
	result.clear();

	while (!feof(pipe.get())) {
		if (fgets(buffer, 1024, pipe.get()) != NULL)
			result += buffer;
	}

	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x418, %rsp            # imm = 0x418
movq %rsi, %rbx
movq (%rdi), %rdi
leaq 0x3f928(%rip), %rsi     # 0xff293
callq 0x222a0
leaq 0x8(%rsp), %r14
movq %rax, -0x8(%r14)
movq 0xb6640(%rip), %rdx     # 0x175fc0
movq %r14, %rdi
movq %rax, %rsi
callq 0xc0314
cmpq $0x0, -0x8(%r14)
je 0xbf9e4
movq $0x0, 0x8(%rbx)
movq (%rbx), %rax
movb $0x0, (%rax)
movq (%rsp), %rdi
callq 0x22fc0
testl %eax, %eax
jne 0xbf9e0
leaq 0x10(%rsp), %r14
movq (%rsp), %rdx
movq %r14, %rdi
movl $0x400, %esi            # imm = 0x400
callq 0x23000
testq %rax, %rax
je 0xbf9d3
movq %rbx, %rdi
movq %r14, %rsi
callq 0x233b0
movq (%rsp), %rdi
callq 0x22fc0
testl %eax, %eax
je 0xbf9b2
xorl %ebx, %ebx
jmp 0xbf9e9
movl $0x1, %ebx
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0xbf9f8
callq 0xbfc0c
movl %ebx, %eax
addq $0x418, %rsp            # imm = 0x418
popq %rbx
popq %r14
retq
movq %rax, %rbx
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0xbfa17
callq 0xbfc0c
movq %rbx, %rdi
callq 0x23240
// File: /workspace/github_cpp_makefile_star2_O3/brianwu02[P]ImageProcessing/ordered_dither.cpp
// Function: main
int main(int argc, char** argv) {
    int n, m;
    double gamma;
    imageP	I1, I2, tmp_img;
    // read input image (I1) and reserve space for output (I2)
    I1 = IP_readImage(argv[1]);
    I2 = NEWIMAGE;
    tmp_img = NEWIMAGE;
    
    // read m and gamma from STDIN
    m = atoi(argv[2]);
    n = pow(m, 2);

    // check if n is a power of 2
    if (n != 9) {
        if (not(is_pow_of_2(n))) {
            cerr << n << " is not a power of 2. Exiting." << endl;
            exit(1);
        }
    }
    gamma = atof(argv[3]);
    
    // threshold image and save result in file
    ordered_dither(I1, n, gamma, I2, tmp_img, m);
    IP_saveImage(I2, argv[4]);
    
    // free up image structures/memory
    IP_freeImage(I1);
    IP_freeImage(I2);
    IP_freeImage(tmp_img);
	return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq 0x8(%rsi), %rdi
callq 0x2670
movq %rax, %rbx
movl $0x10, %edi
callq 0x2150
movq %rax, %r15
movl $0x10, %edi
callq 0x2150
movq %rax, %r12
movq 0x10(%r14), %rdi
callq 0x2190
movl %eax, %ebp
cvtsi2sd %eax, %xmm0
mulsd %xmm0, %xmm0
cvttsd2si %xmm0, %r13d
cmpl $0x9, %r13d
je 0x239c
testl %r13d, %r13d
je 0x23f5
leal -0x1(%r13), %eax
testl %eax, %r13d
jne 0x23f5
movq 0x18(%r14), %rdi
callq 0x2120
cvtsd2ss %xmm0, %xmm0
movq %rbx, %rdi
movl %r13d, %esi
movq %r15, %rdx
movq %r12, %rcx
movl %ebp, %r8d
callq 0x2435
movq 0x20(%r14), %rsi
movq %r15, %rdi
callq 0x2896
movq %rbx, %rdi
callq 0x2a47
movq %r15, %rdi
callq 0x2a47
movq %r12, %rdi
callq 0x2a47
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x2bf4(%rip), %rdi      # 0x4ff0
movl %r13d, %esi
callq 0x21a0
leaq 0xc0d(%rip), %rsi       # 0x3018
movq %rax, %rdi
callq 0x20d0
movq %rax, %rdi
callq 0x2070
movl $0x1, %edi
callq 0x2110