// File: /workspace/github_cpp_makefile_star2_O3/richardposner[P]BioNetFit2/src/code/Swarm.cpp
// Function: Swarm::mutateParamGA[abi:cxx11](FreeParam*, double)
string Swarm::mutateParamGA(FreeParam* fp, double paramValue) {
	//Timer tmr;
	//uniform_real_distribution<double> unif(0,1);
	if(options.verbosity>=3){
		cout << "generating random dist" << endl;
	}
	boost::random::uniform_real_distribution<double> unif(0,1);
	if(options.verbosity>=3){
		cout << "done" << endl;
	}
	// Generate a random number and see if it's less than our mutation rate.  If is, we mutate.
	if (unif(generalRand) < fp->getMutationRate()) {
		// Store our mutation factor
		if(options.verbosity>=3){
			cout << "setting maxrange" << endl;
		}
		float maxChange = abs(paramValue) * fp->getMutationFactor();
		if(options.verbosity>=3){
			cout << "done" << endl;
		}
		// Generate a new distribution between 0 and double maxChange
		//using param_t = uniform_real_distribution<>::param_type;
		//param_t p{0.0, maxChange * 2};
		//unif.param(p);

		boost::random::uniform_real_distribution<double> unif(0.0, maxChange * 2);

		// Ger our new random number between 0 and maxChange, subtract maxChange.
		double change = unif(generalRand) - maxChange;

		// Add/subtract the value from the parameter
		paramValue+= change;
		//cout << "factor: " << fp->getMutationFactor() << " max change: " << maxChange << " rand: " << rand << endl << endl;
	}
	//double t = tmr.elapsed();
	//cout << "Mutate took " << t << " seconds" << endl;
	return toString(paramValue);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20, %rsp
movapd %xmm0, 0x10(%rsp)
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
cmpl $0x3, 0x1614(%rsi)
jb 0x9bd06
movq 0xda324(%rip), %r12     # 0x175fa8
leaq 0x64963(%rip), %rsi     # 0x1005ee
movl $0x16, %edx
movq %r12, %rdi
callq 0x22ab0
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x22940
movsbl %al, %esi
movq %r12, %rdi
callq 0x22050
movq %rax, %rdi
callq 0x22660
cmpl $0x3, 0x1614(%r15)
jb 0x9bd06
leaq 0x5faa3(%rip), %rsi     # 0xfb774
movl $0x4, %edx
movq %r12, %rdi
callq 0x22ab0
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x22940
movsbl %al, %esi
movq %r12, %rdi
callq 0x22050
movq %rax, %rdi
callq 0x22660
leaq 0x58(%r15), %r12
movsd 0x5c5de(%rip), %xmm1    # 0xf82f0
xorpd %xmm0, %xmm0
movq %r12, %rdi
callq 0xb00ba
xorps %xmm1, %xmm1
cvtss2sd 0x40(%r14), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x9bdf1
cmpl $0x2, 0x1614(%r15)
jbe 0x9bdf9
movq 0xda262(%rip), %r13     # 0x175fa8
leaq 0x648b8(%rip), %rsi     # 0x100605
movl $0x10, %edx
movq %r13, %rdi
callq 0x22ab0
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x22940
movsbl %al, %esi
movq %r13, %rdi
callq 0x22050
movq %rax, %rdi
callq 0x22660
cmpl $0x3, 0x1614(%r15)
movapd 0x5bebe(%rip), %xmm0    # 0xf7c50
andpd 0x10(%rsp), %xmm0
xorps %xmm1, %xmm1
cvtss2sd 0x44(%r14), %xmm1
mulsd %xmm0, %xmm1
jb 0x9be14
leaq 0x5f9c6(%rip), %rsi     # 0xfb774
movl $0x4, %edx
movq %r13, %rdi
movsd %xmm1, 0x8(%rsp)
callq 0x22ab0
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x22940
movsbl %al, %esi
movq %r13, %rdi
callq 0x22050
movq %rax, %rdi
callq 0x22660
movsd 0x8(%rsp), %xmm1
jmp 0x9be14
movapd 0x10(%rsp), %xmm0
jmp 0x9be5a
movapd 0x5be4f(%rip), %xmm0    # 0xf7c50
andpd 0x10(%rsp), %xmm0
xorps %xmm1, %xmm1
cvtss2sd 0x44(%r14), %xmm1
mulsd %xmm0, %xmm1
xorps %xmm0, %xmm0
cvtsd2ss %xmm1, %xmm0
movss %xmm0, 0x8(%rsp)
addss %xmm0, %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jbe 0x9be73
xorps %xmm1, %xmm1
cvtss2sd %xmm0, %xmm1
xorps %xmm0, %xmm0
movq %r12, %rdi
callq 0xb00ba
xorps %xmm1, %xmm1
cvtss2sd 0x8(%rsp), %xmm1
subsd %xmm1, %xmm0
movapd 0x10(%rsp), %xmm1
addsd %xmm0, %xmm1
movapd %xmm1, %xmm0
movq %rbx, %rdi
callq 0xbfad7
movq %rbx, %rax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x66205(%rip), %rdi     # 0x10207f
leaq 0x66210(%rip), %rsi     # 0x102091
leaq 0x66241(%rip), %rcx     # 0x1020c9
movl $0x9f, %edx
callq 0x22610