// File: 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
movq %rsp, %rbp
subq $0x1d0, %rsp            # imm = 0x1D0
movq %rsi, -0x120(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x118(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x448b0
leaq -0x49(%rbp), %rdi
movq %rdi, -0x110(%rbp)
callq 0x30a70
movq -0x110(%rbp), %rdx
leaq 0xf5393(%rip), %rsi     # 0x1e40cf
leaq -0x48(%rbp), %rdi
callq 0x44470
jmp 0xeed47
movq -0x120(%rbp), %rdi
leaq -0x28(%rbp), %rsi
leaq -0x48(%rbp), %rdx
callq 0x17d490
jmp 0xeed5d
leaq -0x48(%rbp), %rdi
callq 0x311e8
leaq -0x49(%rbp), %rdi
callq 0x311c0
leaq -0x28(%rbp), %rdi
callq 0x44960
cmpq $0x3, %rax
jne 0xef31f
movq -0x118(%rbp), %rax
addq $0x1590, %rax           # imm = 0x1590
movq %rax, -0x130(%rbp)
xorl %eax, %eax
movl %eax, %esi
leaq -0x28(%rbp), %rdi
callq 0x449e0
movq -0x130(%rbp), %rdi
movq %rax, %rsi
callq 0x44980
movq %rax, -0x128(%rbp)
jmp 0xeedbb
movq -0x128(%rbp), %rax
cmpq $0x0, %rax
ja 0xeedfb
xorl %eax, %eax
movl %eax, %esi
leaq -0x28(%rbp), %rdi
callq 0x449e0
movq %rax, %rdi
leaq 0xed4e9(%rip), %rsi     # 0x1dc2c8
callq 0x44930
movb %al, -0x131(%rbp)
jmp 0xeedec
movb -0x131(%rbp), %al
testb $0x1, %al
jne 0xeedfb
jmp 0xef2a6
leaq -0x28(%rbp), %rdi
movl $0x1, %esi
callq 0x449e0
movq %rax, %rsi
movb $0x0, -0xa1(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x2f300
jmp 0xeee1e
leaq -0x80(%rbp), %rdi
callq 0x17e1b0
movb %al, -0x132(%rbp)
jmp 0xeee2f
movb -0x132(%rbp), %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x133(%rbp)
jne 0xeee44
jmp 0xeee8c
leaq -0x28(%rbp), %rdi
movl $0x2, %esi
callq 0x449e0
movq %rax, %rsi
leaq -0xa0(%rbp), %rdi
callq 0x2f300
jmp 0xeee63
movb $0x1, -0xa1(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0x17e1b0
movb %al, -0x134(%rbp)
jmp 0xeee7e
movb -0x134(%rbp), %al
movb %al, -0x133(%rbp)
jmp 0xeee8c
movb -0x133(%rbp), %al
movb %al, -0x135(%rbp)
testb $0x1, -0xa1(%rbp)
jne 0xeeea3
jmp 0xeeeaf
leaq -0xa0(%rbp), %rdi
callq 0x311e8
leaq -0x80(%rbp), %rdi
callq 0x311e8
movb -0x135(%rbp), %al
testb $0x1, %al
jne 0xeeec7
jmp 0xef20f
xorl %eax, %eax
movl %eax, %esi
leaq -0x28(%rbp), %rdi
callq 0x449e0
movq %rax, %rdi
leaq 0xed3ea(%rip), %rsi     # 0x1dc2c8
callq 0x45af0
movb %al, -0x136(%rbp)
jmp 0xeeeeb
movb -0x136(%rbp), %al
testb $0x1, %al
jne 0xeeefa
jmp 0xef0d9
movq -0x118(%rbp), %rax
addq $0x1590, %rax           # imm = 0x1590
movq %rax, -0x148(%rbp)
xorl %eax, %eax
movl %eax, %esi
leaq -0x28(%rbp), %rdi
callq 0x449e0
movq -0x148(%rbp), %rdi
movq %rax, %rsi
callq 0x44a00
movq %rax, -0x140(%rbp)
jmp 0xeef33
movq -0x140(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x158(%rbp)
leaq -0x28(%rbp), %rdi
movl $0x1, %esi
callq 0x449e0
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x44680
movss %xmm0, -0x14c(%rbp)
jmp 0xeef68
movss -0x14c(%rbp), %xmm0
movq -0x158(%rbp), %rdi
callq 0x122410
jmp 0xeef7e
movq -0x118(%rbp), %rax
addq $0x1590, %rax           # imm = 0x1590
movq %rax, -0x168(%rbp)
xorl %eax, %eax
movl %eax, %esi
leaq -0x28(%rbp), %rdi
callq 0x449e0
movq -0x168(%rbp), %rdi
movq %rax, %rsi
callq 0x44a00
movq %rax, -0x160(%rbp)
jmp 0xeefb7
movq -0x160(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x178(%rbp)
leaq -0x28(%rbp), %rdi
movl $0x2, %esi
callq 0x449e0
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x44680
movss %xmm0, -0x16c(%rbp)
jmp 0xeefec
movss -0x16c(%rbp), %xmm0
movq -0x178(%rbp), %rdi
callq 0x122430
jmp 0xef002
movq -0x118(%rbp), %rax
addq $0x1590, %rax           # imm = 0x1590
movq %rax, -0x188(%rbp)
xorl %eax, %eax
movl %eax, %esi
leaq -0x28(%rbp), %rdi
callq 0x449e0
movq -0x188(%rbp), %rdi
movq %rax, %rsi
callq 0x44a00
movq %rax, -0x180(%rbp)
jmp 0xef03b
movq -0x180(%rbp), %rax
movq (%rax), %rdi
movl $0x1, %esi
callq 0x122450
jmp 0xef051
jmp 0xef20a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0xef079
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x311e8
leaq -0x49(%rbp), %rdi
callq 0x311c0
jmp 0xef3c3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0xef3c3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0xef0cb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
testb $0x1, -0xa1(%rbp)
jne 0xef0bd
jmp 0xef0c9
leaq -0xa0(%rbp), %rdi
callq 0x311e8
jmp 0xef0cb
leaq -0x80(%rbp), %rdi
callq 0x311e8
jmp 0xef3c3
movq -0x118(%rbp), %rdi
addq $0x14c0, %rdi           # imm = 0x14C0
addq $0xd0, %rdi
callq 0x44c70
movq %rax, -0xb0(%rbp)
movq -0x118(%rbp), %rdi
addq $0x14c0, %rdi           # imm = 0x14C0
addq $0xd0, %rdi
callq 0x44cd0
movq %rax, -0xb8(%rbp)
leaq -0xb0(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x44ca0
testb $0x1, %al
jne 0xef137
jmp 0xef208
leaq -0xb0(%rbp), %rdi
callq 0x44d00
movq 0x20(%rax), %rax
movq %rax, -0x198(%rbp)
leaq -0x28(%rbp), %rdi
movl $0x1, %esi
callq 0x449e0
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x44680
movss %xmm0, -0x18c(%rbp)
jmp 0xef172
movss -0x18c(%rbp), %xmm0
movq -0x198(%rbp), %rdi
callq 0x122410
jmp 0xef188
leaq -0xb0(%rbp), %rdi
callq 0x44d00
movq 0x20(%rax), %rax
movq %rax, -0x1a8(%rbp)
leaq -0x28(%rbp), %rdi
movl $0x2, %esi
callq 0x449e0
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x44680
movss %xmm0, -0x19c(%rbp)
jmp 0xef1c3
movss -0x19c(%rbp), %xmm0
movq -0x1a8(%rbp), %rdi
callq 0x122430
jmp 0xef1d9
leaq -0xb0(%rbp), %rdi
callq 0x44d00
movq 0x20(%rax), %rdi
movl $0x1, %esi
callq 0x122450
jmp 0xef1f5
jmp 0xef1f7
leaq -0xb0(%rbp), %rdi
callq 0x44d20
jmp 0xef0fa
jmp 0xef20a
jmp 0xef2a4
leaq -0xd9(%rbp), %rdi
movq %rdi, -0x1b0(%rbp)
callq 0x30a70
movq -0x1b0(%rbp), %rdx
leaq 0xf2189(%rip), %rsi     # 0x1e13b9
leaq -0xd8(%rbp), %rdi
callq 0x44470
jmp 0xef23e
movq -0x118(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
callq 0xeada0
jmp 0xef253
leaq -0xd8(%rbp), %rdi
callq 0x311e8
leaq -0xd9(%rbp), %rdi
callq 0x311c0
jmp 0xef2a4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0xef293
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0xd8(%rbp), %rdi
callq 0x311e8
leaq -0xd9(%rbp), %rdi
callq 0x311c0
jmp 0xef3c3
jmp 0xef31a
movq 0x1e5ca3(%rip), %rdi    # 0x2d4f50
leaq 0xf2175(%rip), %rsi     # 0x1e1429
callq 0x2ff50
movq %rax, -0x1b8(%rbp)
jmp 0xef2c2
xorl %eax, %eax
movl %eax, %esi
leaq -0x28(%rbp), %rdi
callq 0x449e0
movq -0x1b8(%rbp), %rdi
movq %rax, %rsi
callq 0x2f780
movq %rax, -0x1c0(%rbp)
jmp 0xef2e7
movq -0x1c0(%rbp), %rdi
leaq 0xf215a(%rip), %rsi     # 0x1e144f
callq 0x2ff50
movq %rax, -0x1c8(%rbp)
jmp 0xef303
movq -0x1c8(%rbp), %rdi
movq 0x1e5cb7(%rip), %rsi    # 0x2d4fc8
callq 0x30c10
jmp 0xef318
jmp 0xef31a
jmp 0xef3b1
leaq -0x101(%rbp), %rdi
movq %rdi, -0x1d0(%rbp)
callq 0x30a70
movq -0x1d0(%rbp), %rdx
leaq 0xf2194(%rip), %rsi     # 0x1e14d4
leaq -0x100(%rbp), %rdi
callq 0x44470
jmp 0xef34e
movq -0x118(%rbp), %rdi
leaq -0x100(%rbp), %rsi
callq 0xeada0
jmp 0xef363
leaq -0x100(%rbp), %rdi
callq 0x311e8
leaq -0x101(%rbp), %rdi
callq 0x311c0
jmp 0xef3b1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0xef3a3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x100(%rbp), %rdi
callq 0x311e8
leaq -0x101(%rbp), %rdi
callq 0x311c0
jmp 0xef3c3
leaq -0x28(%rbp), %rdi
callq 0x448d0
addq $0x1d0, %rsp            # imm = 0x1D0
popq %rbp
retq
leaq -0x28(%rbp), %rdi
callq 0x448d0
movq -0x58(%rbp), %rdi
callq 0x30170
nopw %cs:(%rax,%rax)