// File: /workspace/github_cpp_makefile_star2_O2/richardposner[P]BioNetFit2/src/code/Swarm.cpp
// Function: Swarm::addMutate(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void Swarm::addMutate(std::string mutateString) {
	vector<string> mutComponents;
	split(mutateString, mutComponents);

	// Make sure we have three components to work with
	if (mutComponents.size() == 3) {
		// Make sure first parameter name exists as a free parameter
		if (options.freeParams_.count(mutComponents[0]) > 0 || mutComponents[0] == "default") {
			// Make sure 2nd and 3rd components are numeric
			if (isFloat(mutComponents[1]) && isFloat(mutComponents[2])) {
				if (mutComponents[0] != "default") {
					//cout << "not default" << endl;
					options.freeParams_.at(mutComponents[0])->setMutationRate(stof(mutComponents[1]));
					options.freeParams_.at(mutComponents[0])->setMutationFactor(stof(mutComponents[2]));
					options.freeParams_.at(mutComponents[0])->setHasMutation(true);

					//cout << "setting " << mutComponents[0] << " to " << mutComponents[1] << ":" << mutComponents[2] << endl;
				}
				else {
					for (map<string,FreeParam*>::iterator fp = options.freeParams_.begin(); fp != options.freeParams_.end(); ++fp) {
						//cout << "setting " << mutComponents[0] << " to " << mutComponents[1] << ":" << mutComponents[2] << endl;

						fp->second->setMutationRate(stof(mutComponents[1]));
						fp->second->setMutationFactor(stof(mutComponents[2]));
						fp->second->setHasMutation(true);
					}
				}
			}
			else {
				outputError("Error: Problem parsing the mutation option in your .conf file. The mutation rate and/or factor are non-numeric.");
			}
		}
		else {
			cout << "Warning: We found a mutation option '" << mutComponents[0] << "' in your .conf file, but don't see a matching free parameter specification in your model file. We will ignore this mutation factor." << endl;
		}
	}
	else {
		outputError("Error: Problem parsing a mutation option in your .conf file. Each mutation option requires three components: the parameter name, mutation rate, and mutation factor.");
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0xc8, %rsp
movq %rsi, %r14
movq %rdi, %rbx
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
andq $0x0, 0x20(%rsp)
leaq 0x722e7(%rip), %rsi     # 0xdf60d
leaq 0x28(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x33402
leaq 0x10(%rsp), %rsi
leaq 0x28(%rsp), %rdx
movq %r14, %rdi
callq 0x9ec69
leaq 0x28(%rsp), %rdi
callq 0x295a0
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rax
subq %rsi, %rax
cmpq $0x60, %rax
jne 0x6d51d
leaq 0x1590(%rbx), %r14
movq %r14, %rdi
callq 0x33588
testq %rax, %rax
jne 0x6d395
movq 0x10(%rsp), %rdi
leaq 0x6a5e1(%rip), %rsi     # 0xd7969
callq 0x3357b
testb %al, %al
je 0x6d4ce
movq 0x10(%rsp), %rsi
addq $0x20, %rsi
leaq 0x48(%rsp), %rdi
callq 0x28dd0
leaq 0x48(%rsp), %rdi
callq 0x9f424
testb %al, %al
je 0x6d546
movq 0x10(%rsp), %rsi
addq $0x40, %rsi
leaq 0x68(%rsp), %rdi
callq 0x28dd0
leaq 0x68(%rsp), %rdi
callq 0x9f424
movl %eax, %ebp
leaq 0x68(%rsp), %rdi
callq 0x295a0
leaq 0x48(%rsp), %rdi
callq 0x295a0
testb %bpl, %bpl
je 0x6d550
movq 0x10(%rsp), %rdi
leaq 0x6a567(%rip), %rsi     # 0xd7969
callq 0x33990
testb %al, %al
je 0x6d46e
movq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x335a2
movq (%rax), %rbx
movq 0x10(%rsp), %rdi
addq $0x20, %rdi
xorl %esi, %esi
callq 0x3349f
movss %xmm0, 0x40(%rbx)
movq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x335a2
movq (%rax), %rbx
movq 0x10(%rsp), %rdi
addq $0x40, %rdi
xorl %esi, %esi
callq 0x3349f
movss %xmm0, 0x44(%rbx)
movq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x335a2
movq (%rax), %rax
movb $0x1, 0x50(%rax)
jmp 0x6d505
movq 0x15a8(%rbx), %r14
addq $0x1598, %rbx           # imm = 0x1598
cmpq %rbx, %r14
je 0x6d505
movq 0x40(%r14), %r15
movq 0x10(%rsp), %rdi
addq $0x20, %rdi
xorl %esi, %esi
callq 0x3349f
movss %xmm0, 0x40(%r15)
movq 0x40(%r14), %r15
movq 0x10(%rsp), %rdi
addq $0x40, %rdi
xorl %esi, %esi
callq 0x3349f
movss %xmm0, 0x44(%r15)
movq 0x40(%r14), %rax
movb $0x1, 0x50(%rax)
movq %r14, %rdi
callq 0x28700
movq %rax, %r14
jmp 0x6d47c
movq 0xf8ac3(%rip), %rdi     # 0x165f98
leaq 0x6f5dd(%rip), %rsi     # 0xdcab9
callq 0x289f0
movq 0x10(%rsp), %rsi
movq %rax, %rdi
callq 0x28910
leaq 0x6f5ea(%rip), %rsi     # 0xdcadf
movq %rax, %rdi
callq 0x289f0
movq %rax, %rdi
callq 0x284a0
leaq 0x10(%rsp), %rdi
callq 0x3355a
addq $0xc8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x6f640(%rip), %rsi     # 0xdcb64
leaq 0x88(%rsp), %rdi
leaq 0x28(%rsp), %rdx
callq 0x33402
leaq 0x88(%rsp), %rsi
movq %rbx, %rdi
callq 0x6aed2
leaq 0x48(%rsp), %rdi
callq 0x295a0
leaq 0x6f4f2(%rip), %rsi     # 0xdca49
leaq 0xa8(%rsp), %rdi
leaq 0x28(%rsp), %rdx
callq 0x33402
leaq 0xa8(%rsp), %rsi
movq %rbx, %rdi
callq 0x6aed2
movq %rax, %rbx
leaq 0x88(%rsp), %rdi
jmp 0x6d5ba
jmp 0x6d5c3
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0x295a0
jmp 0x6d5b5
movq %rax, %rbx
leaq 0xa8(%rsp), %rdi
jmp 0x6d5ba
jmp 0x6d5c3
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
jmp 0x6d5ba
jmp 0x6d5c3
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x295a0
jmp 0x6d5c6
jmp 0x6d5c3
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x3355a
movq %rbx, %rdi
callq 0x292f0