LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/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 0x87ff0
movq 0xedfdb(%rip), %r14     # 0x175f90
leaq 0x76dd6(%rip), %rsi     # 0xfed92
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
cmpl $0x0, 0x1620(%rbx)
jle 0x8806e
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), %rax
cmpl 0x28(%rax), %ebp
je 0x88064
movl %ebp, 0x4(%rsp)
movq %r14, %rdi
movq %r12, %rsi
movsd %xmm0, 0x10(%rsp)
callq 0xa83c8
movsd (%rax), %xmm0
movsd %xmm0, 0x8(%rsp)
movl %ebp, (%rsp)
movq %r15, %rdi
movq %r13, %rsi
callq 0xa816e
movsd 0x10(%rsp), %xmm0
movsd 0x8(%rsp), %xmm1
mulsd (%rax), %xmm1
addsd %xmm1, %xmm0
cmpl 0x1620(%rbx), %ebp
jl 0x88015
jmp 0x88072
xorpd %xmm0, %xmm0
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0xa8414
movl 0x15b8(%rbx), %ecx
xorpd %xmm1, %xmm1
xorpd %xmm0, %xmm0
testl %ecx, %ecx
je 0x880de
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 0x880d6
cmpl $0x1, %ecx
je 0x880e9
xorpd %xmm2, %xmm2
jmp 0x880f1
movsd 0x7021f(%rip), %xmm2    # 0xf8310
mulsd %xmm2, %xmm0
ucomisd %xmm1, %xmm0
jb 0x88104
xorps %xmm1, %xmm1
sqrtsd %xmm0, %xmm1
jmp 0x8810d
callq 0x22790
movapd %xmm0, %xmm1
movsd 0x701fb(%rip), %xmm2    # 0xf8310
movapd %xmm2, %xmm0
divsd %xmm1, %xmm0
movl 0x1620(%rbx), %eax
testl %eax, %eax
jle 0x8814d
movq 0x1ac8(%rbx), %rcx
movl 0x28(%rcx), %ecx
divsd %xmm0, %xmm2
decl %ecx
xorpd %xmm1, %xmm1
xorl %edx, %edx
cmpl %edx, %ecx
je 0x88145
addsd %xmm2, %xmm1
incl %edx
cmpl %edx, %eax
jne 0x8813d
jmp 0x88151
xorpd %xmm1, %xmm1
divsd %xmm1, %xmm0
addq $0x10, %rsp
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x8a0e9
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0xebeff(%rip), %r14     # 0x175f90
leaq 0x75117(%rip), %rsi     # 0xff1af
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_O1/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
cmpl $0x0, 0x1620(%rdi)
jle 0x94dd0
movl %esi, %ebp
movl $0x1, %r15d
movq 0x15c8(%rbx), %rdx
subq 0x15c0(%rbx), %rdx
je 0x94dbc
sarq $0x3, %rdx
xorl %r12d, %r12d
movl %r15d, %edi
movl %r12d, %esi
callq 0xbf2a3
movl %eax, %r13d
cmpl $0x3, 0x1614(%rbx)
jb 0x94d82
movl $0x21, %edx
movq 0xe1273(%rip), %r14     # 0x175f90
movq %r14, %rdi
leaq 0x6ca54(%rip), %rsi     # 0x10177b
callq 0x22ab0
movq %r14, %rdi
movl %r13d, %esi
callq 0x231e0
movq %rax, %r14
movl $0x8, %edx
movq %rax, %rdi
leaq 0x6ca54(%rip), %rsi     # 0x10179d
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 0x6bfb0
incl %r12d
movq 0x15c8(%rbx), %rdx
subq 0x15c0(%rbx), %rdx
sarq $0x3, %rdx
cmpq %r12, %rdx
ja 0x94cfa
leal 0x1(%r15), %eax
cmpl 0x1620(%rbx), %r15d
movl %eax, %r15d
jl 0x94cdf
movq (%rbx), %rdi
movq (%rdi), %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x6b3a4
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0xb0570
movq %rsp, %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x96206
movq (%r14), %rdi
testq %rdi, %rdi
je 0x9695b
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x229c0
addq $0x18, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x9c713
movl %edx, %ebp
movq %rsi, %rbx
cmpl %ebp, 0x28(%rax)
je 0x9c6ee
movq %rax, %rdi
callq 0x22670
cmpq %r14, %rax
jne 0x9c6da
jmp 0x9c713
movq %rbx, %rdi
movq %rax, %rsi
callq 0xb0192
leaq 0x10(%rsp), %rsi
movsd 0x8(%rsp), %xmm0
movsd %xmm0, (%rsi)
movl %ebp, 0x8(%rsi)
movq %rbx, %rdi
callq 0xaf774
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x32180
leaq 0x85dca(%rip), %rsi     # 0x122741
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 0x9c9f1
leaq 0x20(%rsp), %rdi
leaq 0x80(%rsp), %rsi
xorl %edx, %edx
callq 0xa88ca
callq 0xa90f0
leaq 0x20(%rsp), %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0xe7cb0
leaq 0x80(%rsp), %rdi
callq 0x22de0
leaq 0x20(%rsp), %rdi
callq 0xe7850
leaq 0x48(%rsp), %rdi
callq 0xebf10
jmp 0x9ca48
movq 0xd9598(%rip), %rdi     # 0x175f90
leaq 0x63c30(%rip), %rsi     # 0x10062f
movl $0x26, %edx
callq 0x22ab0
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq 0xd9577(%rip), %rdi     # 0x175f90
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 0xd9521(%rip), %rax     # 0x175f70
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 0x9ca96
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x229c0
addq $0x280, %rsp            # imm = 0x280
popq %rbx
popq %r14
popq %r15
retq
jmp 0x9cac5
jmp 0x9caa7
movq %rax, %rbx
jmp 0x9cad5
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0xe7850
leaq 0x48(%rsp), %rdi
callq 0xebf10
jmp 0x9cac8
movq %rax, %rbx
leaq 0x80(%rsp), %rdi
callq 0x22ea0
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x9caeb
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x229c0
movq %rbx, %rdi
callq 0x23240
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0xa8bac
cmpl $0x0, 0x1620(%r14)
jle 0xa219c
xorl %r15d, %r15d
callq 0x22230
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
mulss 0x5be7d(%rip), %xmm0    # 0xfdff8
addss 0x5be79(%rip), %xmm0    # 0xfdffc
movq (%rbx), %rax
movss %xmm0, 0x4(%rax,%r15,4)
movslq 0x1620(%r14), %rax
incq %r15
cmpq %rax, %r15
jl 0xa2167
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0xa8bac
cmpl $0x0, 0x1620(%r14)
jle 0xa2222
xorl %r15d, %r15d
callq 0x22230
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
mulss 0x5bdff(%rip), %xmm0    # 0xfdff8
mulss 0x5be07(%rip), %xmm0    # 0xfe008
addss 0x5be03(%rip), %xmm0    # 0xfe00c
movq (%rbx), %rax
movss %xmm0, 0x4(%rax,%r15,4)
movslq 0x1620(%r14), %rax
incq %r15
cmpq %rax, %r15
jl 0xa21e5
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0xa8b2a
cmpl $0x0, 0x1620(%r14)
jle 0xa2303
xorps %xmm0, %xmm0
cvtsi2sd %ebp, %xmm0
movsd 0x5bd0c(%rip), %xmm1    # 0xfdfc0
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 0x54853(%rip), %xmm0    # 0xf6b38
callq 0x23270
movq (%rbx), %rax
movsd %xmm0, 0x8(%rax,%r15,8)
movslq 0x1620(%r14), %rax
incq %r15
cmpq %rax, %r15
jl 0xa22cf
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x55fde(%rip), %xmm0    # 0xf8310
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 0xa8b2a
cmpl $0x0, 0x1620(%r14)
jle 0xa23d8
xorps %xmm0, %xmm0
cvtsi2sd %ebp, %xmm0
movsd 0x5bc3f(%rip), %xmm1    # 0xfdfc0
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 0x5b983(%rip), %xmm0    # 0xfdd3c
callq 0x23100
cvtss2sd %xmm0, %xmm0
movsd %xmm0, 0x8(%r15,%r12,8)
movslq 0x1620(%r14), %rax
incq %r12
cmpq %rax, %r12
jl 0xa23a3
movq %rbx, %rax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0xa83c8
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 0x5b8fa(%rip), %xmm0    # 0xfdd38
movss %xmm0, 0x4(%rsp)
callq 0x22230
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
mulss 0x5bba0(%rip), %xmm0    # 0xfdff8
movss 0x4(%rsp), %xmm1
ucomiss %xmm0, %xmm1
seta %al
addq $0x18, %rsp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 $0x10, %rsp
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r15
callq 0x22230
cltd
idivl 0x1620(%r15)
incl %edx
movl %edx, (%rsp)
callq 0x22230
cltd
idivl 0x1620(%r15)
incl %edx
movl %edx, 0x4(%rsp)
cmpl %edx, (%rsp)
je 0xa2492
addq $0x1a20, %r15           # imm = 0x1A20
movq %rsp, %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0xa83c8
movsd (%rax), %xmm0
movsd %xmm0, 0x8(%rsp)
leaq 0x4(%rsp), %r13
movq %r15, %rdi
movq %r13, %rsi
callq 0xa83c8
movsd 0x8(%rsp), %xmm2
subsd (%rax), %xmm2
movl (%r12), %eax
movq (%rbx), %rcx
movsd 0x55e1e(%rip), %xmm1    # 0xf8310
movapd %xmm1, %xmm0
divsd (%rcx,%rax,8), %xmm0
movl (%r13), %eax
divsd (%rcx,%rax,8), %xmm1
subsd %xmm1, %xmm0
mulsd %xmm2, %xmm0
callq 0x23270
cvtsd2ss %xmm0, %xmm0
minss 0x5b81b(%rip), %xmm0    # 0xfdd38
movss %xmm0, 0x8(%rsp)
callq 0x22230
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
mulss 0x5bac1(%rip), %xmm0    # 0xfdff8
movss 0x8(%rsp), %xmm1
ucomiss %xmm0, %xmm1
jbe 0xa2588
movl (%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 0x4(%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 $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0xa28b0
movl %edx, %ebp
movq 0xd374b(%rip), %r14     # 0x175f90
leaq 0x5f47d(%rip), %rsi     # 0x101cc9
movl $0x2f, %edx
movq %r14, %rdi
callq 0x22ab0
movl 0xc(%rsp), %esi
movq %r14, %rdi
callq 0x22650
movq %rax, %r14
leaq 0x5e4c1(%rip), %rsi     # 0x100d30
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 0xc(%rsp), %r14
movq %r14, %rsi
callq 0xa83c8
leaq 0x1400(%rbx), %rdi
movq %r14, %rsi
callq 0xa837c
leaq 0x10(%rsp), %rdi
movq %rax, %rsi
callq 0x66228
leaq 0x28(%rsp), %rdi
movq %rbx, %rsi
callq 0xa2910
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0xa2907
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x229c0
movq %rbx, %rdi
callq 0x23240
nop
// File: /workspace/github_cpp_makefile_star2_O1/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, %r14
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x5edf0(%rip), %rsi     # 0x10172d
leaq 0x5ee16(%rip), %rdx     # 0x10175a
movq %rsp, %rdi
callq 0x32210
movq %rsp, %rsi
movq %r14, %rdi
callq 0x78b66
movq %rax, %r14
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0xa2975
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x229c0
jmp 0xa2975
movq %rax, %r14
movq (%rbx), %rdi
testq %rdi, %rdi
je 0xa2989
movq 0x10(%rbx), %rsi
subq %rdi, %rsi
callq 0x229c0
movq %r14, %rdi
callq 0x23240
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0xa837c
leaq 0x8(%rsp), %rdi
movq %rax, %rsi
callq 0x66228
leaq 0x20(%rsp), %rdi
movq %r14, %rsi
callq 0xa2910
movq %rax, %r14
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0xa3016
movq 0x18(%rsp), %rsi
subq %rdi, %rsi
callq 0x229c0
jmp 0xa3016
movq %rax, %r14
movq %rbx, %rdi
callq 0x464c2
movq %r14, %rdi
callq 0x23240
// File: /workspace/github_cpp_makefile_star2_O1/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 0xc5512
movq %r14, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0xe6610
leaq 0x38(%rbx), %r15
callq 0xc5772
movq %r14, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0xe6610
leaq 0x70(%rbx), %rsi
leaq 0x28(%r14), %r15
movq %r15, %rdi
callq 0xea960
leaq 0x90(%rbx), %r12
callq 0xc5512
movq %r14, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0xe6610
leaq 0xc0(%rbx), %r12
callq 0xc5512
movq %r14, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0xe6610
leaq 0xf0(%rbx), %r12
callq 0xc5512
movq %r14, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0xe6610
leaq 0x120(%rbx), %r12
callq 0xc5512
movq %r14, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0xe6610
leaq 0x150(%rbx), %rsi
movq %r14, %rdi
callq 0xc74a6
leaq 0x158(%rbx), %rsi
movq %r15, %rdi
callq 0xc7960
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0xc884a
// File: /workspace/github_cpp_makefile_star2_O1/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 0xea960
leaq 0x20(%rbx), %rsi
movq %r14, %rdi
callq 0xea960
leaq 0x40(%rbx), %rsi
movq %r14, %rdi
callq 0xc7f9c
leaq 0x44(%rbx), %rsi
movq %r14, %rdi
callq 0xc7f9c
leaq 0x48(%rbx), %rsi
movq %r14, %rdi
callq 0xc7f9c
leaq 0x4c(%rbx), %rsi
movq %r14, %rdi
callq 0xc7f9c
leaq 0x50(%rbx), %rsi
movq %r14, %rdi
callq 0xc7960
addq $0x51, %rbx
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xc7960
// File: /workspace/github_cpp_makefile_star2_O1/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 0xc74a6
leaq 0x30(%rbx), %r15
callq 0xc59d2
movq %r14, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0xe6610
callq 0xc5d62
movq %r14, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0xe6610
leaq 0x68(%rbx), %rsi
leaq 0x28(%r14), %r15
movq %r15, %rdi
callq 0xea960
leaq 0x88(%rbx), %r12
callq 0xc68aa
movq %r14, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0xe6610
leaq 0xa0(%rbx), %r12
callq 0xc68aa
movq %r14, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0xe6610
addq $0xb8, %rbx
movq %r15, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0xc7960
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0xea960
leaq 0x20(%r14), %rsi
movq %r15, %rdi
callq 0xc79e4
leaq 0x28(%r14), %rsi
movq %r15, %rdi
callq 0xea960
leaq 0x48(%r14), %rsi
movq %r15, %rdi
callq 0xea960
addq $0x68, %r14
movq %rbx, %rdi
movq %r14, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0xc85d2
// File: /workspace/github_cpp_makefile_star2_O1/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 0x32180
leaq 0x60(%rsp), %rdi
xorl %esi, %esi
callq 0xd5da0
movq %rsp, %rdi
leaq 0x40(%rsp), %rsi
leaq 0x60(%rsp), %rdx
xorl %ecx, %ecx
callq 0xd8690
leaq 0x20(%rsp), %rdi
movq %rsp, %r15
movq %r15, %rsi
callq 0x22bb0
movq (%r15), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0xbe4c9
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x229c0
leaq 0x70(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xbe4e4
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x229c0
movq 0x40(%rsp), %rdi
cmpq %r13, %rdi
je 0xbe4fb
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 0x32180
leaq 0x10(%rbx), %rcx
cmpq $0x0, 0x8(%rsp)
movq %rcx, (%rbx)
je 0xbe53f
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
addq %rsi, %rdx
movq %rbx, %rdi
callq 0x32180
jmp 0xbe575
movq (%r14), %rdx
leaq 0x10(%r14), %rax
cmpq %rax, %rdx
je 0xbe557
movq %rdx, (%rbx)
movq (%rax), %rcx
movq %rcx, 0x10(%rbx)
jmp 0xbe55d
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 0xbe58b
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x229c0
movq 0x20(%rsp), %rdi
cmpq %r12, %rdi
je 0xbe5a2
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 0xbe610
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x229c0
jmp 0xbe610
movq %rax, %r15
leaq 0x70(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xbe5f4
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x229c0
jmp 0xbe5f4
movq %rax, %r15
movq 0x40(%rsp), %rdi
cmpq %r13, %rdi
je 0xbe632
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x229c0
jmp 0xbe632
movq %rax, %rbx
movq 0x20(%rsp), %rdi
cmpq %r12, %rdi
je 0xbe627
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x229c0
movq %rbx, %rdi
callq 0x23240
movq %rax, %r15
movq %r15, %rdi
callq 0x22360
callq 0x230b0
jmp 0xbe4fb
jmp 0xbe60d
// File: /workspace/github_cpp_makefile_star2_O1/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 0x63315(%rip), %rsi     # 0x121978
xorl %ebx, %ebx
leaq 0x14(%rsp), %rdx
leaq 0x10(%rsp), %rcx
xorl %eax, %eax
callq 0x22950
cmpl $0x2, %eax
jl 0xbe690
imull $0xe10, 0x14(%rsp), %eax # imm = 0xE10
imull $0x3c, 0x10(%rsp), %ebx
addl %eax, %ebx
addl 0xc(%rsp), %ebx
jmp 0xbe6d2
movq 0xb78f9(%rip), %r14     # 0x175f90
leaq 0x632e3(%rip), %rsi     # 0x121981
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_O1/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 0x32180
testl %r14d, %r14d
je 0xbf236
movq (%rbx), %r14
movq 0x8(%rbx), %rsi
addq %r14, %rsi
movq 0xb6d27(%rip), %rdx     # 0x175f28
movq %r14, %rdi
callq 0xc0717
movq (%rbx), %rcx
movq %r14, %rsi
subq %rcx, %rsi
movq 0x8(%rbx), %rdx
addq %rcx, %rdx
cmpq %rax, %rdx
je 0xbf22e
subq %r14, %rax
movq %rbx, %rdi
movq %rax, %rdx
callq 0x22b20
jmp 0xbf236
movq %rsi, 0x8(%rbx)
movb $0x0, (%rcx,%rsi)
testb %bpl, %bpl
je 0xbf275
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 0xb6ccc(%rip), %rcx     # 0x175f28
movq %rsp, %rdi
callq 0xc07dd
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 0xbf285
movq %rax, %r14
movq (%rbx), %rdi
cmpq %r15, %rdi
je 0xbf29b
movq (%r15), %rsi
incq %rsi
callq 0x229c0
movq %r14, %rdi
callq 0x23240
// File: /workspace/github_cpp_makefile_star2_O1/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 0xbf401
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 0x6a77e
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0xbf3cb
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 0xbf390
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 0xbf42f
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x229c0
movq %rbx, %rdi
callq 0x23240
// File: /workspace/github_cpp_makefile_star2_O1/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
movl 0x8(%rax), %r12d
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
movq %rsp, %rdi
callq 0x32180
movq (%r14), %rax
movq 0x8(%r14), %rcx
addq $0x20, %rax
cmpq %rcx, %rax
je 0xc00a8
movq (%rsp), %rdx
movq 0x8(%rsp), %rsi
leaq (%rdx,%rsi), %rdi
movq %rdx, %r8
testq %rsi, %rsi
je 0xc0092
movq (%rax), %r9
xorl %r8d, %r8d
movb (%rdx,%r8), %r10b
cmpb (%r9,%r8), %r10b
jne 0xc008f
incq %r8
cmpq %r8, %rsi
jne 0xc0078
movq %rdi, %r8
jmp 0xc0092
addq %rdx, %r8
subq %rdx, %r8
movslq %r12d, %r12
cmpq %r12, %r8
cmovll %r8d, %r12d
addq $0x20, %rax
cmpq %rcx, %rax
jne 0xc006a
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 0xc00e0
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 0xc0109
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x229c0
movq %rbx, %rdi
callq 0x23240
// File: /workspace/github_cpp_makefile_star2_O1/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 0x31a60
movq %r14, %rdi
callq 0xbf2c2
movl %eax, %ebp
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xc0156
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x229c0
testl %ebp, %ebp
je 0xc0162
movq %rbx, %rdi
callq 0x22410
movq %rbx, %rdi
movl $0x1b0, %esi            # imm = 0x1B0
callq 0x22150
movl %eax, %ebp
testl %eax, %eax
je 0xc01f0
movq 0xb5e14(%rip), %r14     # 0x175f90
leaq 0x61d88(%rip), %rsi     # 0x121f0b
movl $0x29, %edx
movq %r14, %rdi
callq 0x22ab0
testq %rbx, %rbx
je 0xc01b1
movq %rbx, %rdi
callq 0x223a0
movq 0xb5dec(%rip), %rdi     # 0x175f90
movq %rbx, %rsi
movq %rax, %rdx
callq 0x22ab0
jmp 0xc01c9
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 0xc021c
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x229c0
movq %rbx, %rdi
callq 0x23240
// File: /workspace/github_cpp_makefile_star2_O1/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 0xb5d03(%rip), %rsi     # 0x175f80
callq 0x22e00
leaq 0x88(%rsp), %rdi
callq 0x222d0
movl %ebx, %eax
addq $0x190, %rsp            # imm = 0x190
popq %rbx
retq
movq %rax, %rbx
movq 0xb5cdc(%rip), %rsi     # 0x175f80
leaq 0x10(%rsp), %rdi
callq 0x22e00
leaq 0x88(%rsp), %rdi
callq 0x222d0
movq %rbx, %rdi
callq 0x23240
// File: /workspace/github_cpp_makefile_star2_O1/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 0x3ef49(%rip), %rsi     # 0xff223
callq 0x222a0
leaq 0x8(%rsp), %r14
movq %rax, -0x8(%r14)
movq 0xb5cb9(%rip), %rdx     # 0x175fa8
movq %r14, %rdi
movq %rax, %rsi
callq 0xc0c6a
cmpq $0x0, -0x8(%r14)
je 0xc0353
movq $0x0, 0x8(%rbx)
movq (%rbx), %rax
movb $0x0, (%rax)
movq (%rsp), %rdi
callq 0x22fc0
testl %eax, %eax
jne 0xc034f
leaq 0x10(%rsp), %r14
movq (%rsp), %rdx
movq %r14, %rdi
movl $0x400, %esi            # imm = 0x400
callq 0x23000
testq %rax, %rax
je 0xc0342
movq %rbx, %rdi
movq %r14, %rsi
callq 0x233b0
movq (%rsp), %rdi
callq 0x22fc0
testl %eax, %eax
je 0xc0321
xorl %ebx, %ebx
jmp 0xc0358
movl $0x1, %ebx
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0xc0367
callq 0xc057c
movl %ebx, %eax
addq $0x418, %rsp            # imm = 0x418
popq %rbx
popq %r14
retq
movq %rax, %rbx
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0xc0386
callq 0xc057c
movq %rbx, %rdi
callq 0x23240
// File: /workspace/github_cpp_makefile_star2_O1/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 0x2674
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 0x289a
movq %rbx, %rdi
callq 0x2a4b
movq %r15, %rdi
callq 0x2a4b
movq %r12, %rdi
callq 0x2a4b
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