// File: /workspace/github_cpp_makefile_star2_O1/richardposner[P]BioNetFit2/src/code/Swarm.cpp
// Function: Swarm::setModel(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int, bool)
void Swarm::setModel(std::string path, int mid, bool overwrite){
	std::string modelfile = convertToAbsPath(path);
	unsigned int  nmodel=getNumModels();

	if ((unsigned) mid == nmodel){
		this->options.models.push_back(new Model(this, modelfile));  //add to the end
		if(options.verbosity >=4) cout<<" Model["<< mid<<"]: "<<path<<" is appended to the list of models."<<endl;
	}else if ((unsigned) mid < nmodel){ //model may exist
		if ((overwrite) || (! options.models.at(mid))){ //if no model is set or overwrite is allowed
			this->options.models[mid] = new Model(this, modelfile); //you may need to kill the overwritten model
			if(options.verbosity >=4) cout<<" Model["<< mid<<"]: "<<path<<" is added to the list of models."<<endl;
		}
	}else {    //include dummy
		for (unsigned int i=0; i < mid - nmodel; i++) //add dummy file
			this->options.models.push_back(0);
		this->options.models.push_back(new Model(this, modelfile));  //add to the end
		if(options.verbosity >=4) cout<<" Model["<< mid<<"]: "<<path<<" is added to the list of models after filling dummy models."<<endl;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movl %ecx, %r12d
movl %edx, %ebp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0xa8(%rsp), %r13
movq %r13, -0x10(%r13)
movq (%rsi), %rsi
movq 0x8(%rbx), %rdx
addq %rsi, %rdx
leaq 0x98(%rsp), %r15
movq %r15, %rdi
callq 0x32180
leaq 0x18(%rsp), %rdi
movq %r15, %rsi
callq 0xbe434
movq 0x98(%rsp), %rdi
cmpq %r13, %rdi
je 0x79da6
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x229c0
leaq 0x15c0(%r14), %r15
movq 0x15c0(%r14), %rax
movq 0x15c8(%r14), %rcx
subq %rax, %rcx
shrq $0x3, %rcx
cmpl %ecx, %ebp
jne 0x79ec3
movl $0xc0, %edi
callq 0x22980
movq %rax, %r12
leaq 0x48(%rsp), %rax
movq %rax, -0x10(%rax)
movq 0x18(%rsp), %rsi
movq 0x20(%rsp), %rdx
addq %rsi, %rdx
leaq 0x38(%rsp), %rdi
callq 0x32180
movb $0x1, %r13b
leaq 0x38(%rsp), %rdx
movq %r12, %rdi
movq %r14, %rsi
callq 0x4d544
leaq 0x10(%rsp), %rsi
movq %r12, (%rsi)
xorl %r13d, %r13d
movq %r15, %rdi
callq 0x67c5a
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x79e39
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x229c0
cmpl $0x4, 0x1614(%r14)
jb 0x7a117
movq 0xfc142(%rip), %rdi     # 0x175f90
leaq 0x84804(%rip), %rsi     # 0xfe659
movl $0x7, %edx
callq 0x22ab0
movq 0xfc12a(%rip), %rdi     # 0x175f90
movl %ebp, %esi
callq 0x231e0
movq %rax, %r14
leaq 0xa8716(%rip), %rsi     # 0x12258d
movl $0x3, %edx
movq %rax, %rdi
callq 0x22ab0
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %r14, %rdi
callq 0x22ab0
movq %rax, %rbx
leaq 0x847c4(%rip), %rsi     # 0xfe661
movl $0x23, %edx
movq %rax, %rdi
callq 0x22ab0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x22940
jmp 0x7a104
jae 0x79fec
movslq %ebp, %r13
testb %r12b, %r12b
jne 0x79ef3
movq 0x15c8(%r14), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq %r13, %rdx
jbe 0x7a144
cmpq $0x0, (%rax,%r13,8)
jne 0x7a117
movl $0xc0, %edi
callq 0x22980
movq %rax, %r12
movq %rbx, 0x8(%rsp)
movl %ebp, %ebx
leaq 0x88(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq 0x18(%rsp), %rsi
movq 0x20(%rsp), %rdx
addq %rsi, %rdx
leaq 0x78(%rsp), %rdi
callq 0x32180
leaq 0x78(%rsp), %rdx
movq %r12, %rdi
movq %r14, %rsi
callq 0x4d544
movq (%r15), %rax
movq %r12, (%rax,%r13,8)
movq 0x78(%rsp), %rdi
cmpq %rbp, %rdi
je 0x79f5b
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x229c0
cmpl $0x4, 0x1614(%r14)
movl %ebx, %ebp
movq 0x8(%rsp), %rbx
jb 0x7a117
movq 0xfc019(%rip), %rdi     # 0x175f90
leaq 0x846db(%rip), %rsi     # 0xfe659
movl $0x7, %edx
callq 0x22ab0
movq 0xfc001(%rip), %rdi     # 0x175f90
movl %ebp, %esi
callq 0x231e0
movq %rax, %r14
leaq 0xa85ed(%rip), %rsi     # 0x12258d
movl $0x3, %edx
movq %rax, %rdi
callq 0x22ab0
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %r14, %rdi
callq 0x22ab0
movq %rax, %rbx
leaq 0x846bf(%rip), %rsi     # 0xfe685
movl $0x20, %edx
movq %rax, %rdi
callq 0x22ab0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x22940
jmp 0x7a104
movl %ebp, 0x8(%rsp)
subl %ecx, %ebp
je 0x7a011
leaq 0x10(%rsp), %r12
movq $0x0, 0x10(%rsp)
movq %r15, %rdi
movq %r12, %rsi
callq 0x67c5a
decl %ebp
jne 0x79ff9
movl $0xc0, %edi
callq 0x22980
movq %rax, %r12
leaq 0x68(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq 0x18(%rsp), %rsi
movq 0x20(%rsp), %rdx
addq %rsi, %rdx
leaq 0x58(%rsp), %rdi
callq 0x32180
movb $0x1, %r13b
leaq 0x58(%rsp), %rdx
movq %r12, %rdi
movq %r14, %rsi
callq 0x4d544
leaq 0x10(%rsp), %rsi
movq %r12, (%rsi)
xorl %r13d, %r13d
movq %r15, %rdi
callq 0x67c5a
movq 0x58(%rsp), %rdi
cmpq %rbp, %rdi
je 0x7a07b
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x229c0
cmpl $0x4, 0x1614(%r14)
movl 0x8(%rsp), %ebp
jb 0x7a117
movq 0xfbefc(%rip), %rdi     # 0x175f90
leaq 0x845be(%rip), %rsi     # 0xfe659
movl $0x7, %edx
callq 0x22ab0
movq 0xfbee4(%rip), %rdi     # 0x175f90
movl %ebp, %esi
callq 0x231e0
movq %rax, %r14
leaq 0xa84d0(%rip), %rsi     # 0x12258d
movl $0x3, %edx
movq %rax, %rdi
callq 0x22ab0
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %r14, %rdi
callq 0x22ab0
movq %rax, %rbx
leaq 0x845c3(%rip), %rsi     # 0xfe6a6
movl $0x3b, %edx
movq %rax, %rdi
callq 0x22ab0
movq (%rbx), %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
leaq 0x28(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7a132
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x229c0
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x7957a(%rip), %rdi     # 0xf36c5
movq %r13, %rsi
xorl %eax, %eax
callq 0x22f40
movq %rax, %r14
movq 0x78(%rsp), %rdi
cmpq %rbp, %rdi
je 0x7a1bf
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x229c0
jmp 0x7a1bf
movq %rax, %r14
jmp 0x7a1bf
jmp 0x7a191
jmp 0x7a1dd
movq %rax, %r14
movq 0x58(%rsp), %rdi
cmpq %rbp, %rdi
je 0x7a1ba
movq 0x68(%rsp), %rsi
jmp 0x7a1b2
movq %rax, %r14
movb $0x1, %r13b
jmp 0x7a1ba
jmp 0x7a1dd
movq %rax, %r14
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x7a1ba
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x229c0
testb %r13b, %r13b
je 0x7a1e0
movl $0xc0, %esi
movq %r12, %rdi
callq 0x229c0
jmp 0x7a1e0
movq %rax, %r14
movq 0x98(%rsp), %rdi
jmp 0x7a1e9
jmp 0x7a1dd
movq %rax, %r14
leaq 0x28(%rsp), %r13
movq -0x10(%r13), %rdi
cmpq %r13, %rdi
je 0x7a1fa
movq (%r13), %rsi
incq %rsi
callq 0x229c0
movq %r14, %rdi
callq 0x23240