// File: /workspace/github_cpp_makefile_star2_O3/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, %rax
movq %rdi, %r14
leaq 0xa8(%rsp), %r13
movq %r13, -0x10(%r13)
movq (%rsi), %rsi
movq %rax, 0x8(%rsp)
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq 0x98(%rsp), %r15
movq %r15, %rdi
callq 0x3213c
leaq 0x18(%rsp), %rdi
movq %r15, %rsi
callq 0xbdb20
movq 0x98(%rsp), %rdi
cmpq %r13, %rdi
je 0x796f9
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x229c0
leaq 0x15c0(%r14), %r15
movq 0x15c0(%r14), %rax
movq 0x15c8(%r14), %rdx
subq %rax, %rdx
movq %rdx, %rbx
shrq $0x3, %rbx
cmpl %ebp, %ebx
jne 0x7981d
movl $0xc0, %edi
callq 0x22980
movq %rax, %r12
leaq 0x88(%rsp), %r13
movq %r13, -0x10(%r13)
movq 0x18(%rsp), %rsi
movq 0x20(%rsp), %rdx
addq %rsi, %rdx
leaq 0x78(%rsp), %rdi
callq 0x3213c
movb $0x1, %bl
leaq 0x78(%rsp), %rdx
movq %r12, %rdi
movq %r14, %rsi
callq 0x4d270
leaq 0x10(%rsp), %rsi
movq %r12, (%rsi)
xorl %ebx, %ebx
movq %r15, %rdi
callq 0x67786
movq 0x78(%rsp), %rdi
cmpq %r13, %rdi
je 0x7978e
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x229c0
cmpl $0x4, 0x1614(%r14)
jb 0x79a53
movq 0xfc805(%rip), %rdi     # 0x175fa8
leaq 0x84f1f(%rip), %rsi     # 0xfe6c9
movl $0x7, %edx
callq 0x22ab0
movq 0xfc7ed(%rip), %rdi     # 0x175fa8
movl %ebp, %esi
callq 0x231e0
movq %rax, %r14
leaq 0xa8da1(%rip), %rsi     # 0x12256d
movl $0x3, %edx
movq %rax, %rdi
callq 0x22ab0
movq 0x8(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq %r14, %rdi
callq 0x22ab0
movq %rax, %rbx
leaq 0x84eda(%rip), %rsi     # 0xfe6d1
movl $0x23, %edx
movq %rax, %rdi
callq 0x22ab0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x22940
jmp 0x79a40
jbe 0x7992d
movslq %ebp, %r13
testb %r12b, %r12b
jne 0x79843
sarq $0x3, %rdx
cmpq %r13, %rdx
jbe 0x79a80
cmpq $0x0, (%rax,%r13,8)
jne 0x79a53
movl $0xc0, %edi
callq 0x22980
movq %rax, %r12
leaq 0x68(%rsp), %rbx
movq %rbx, -0x10(%rbx)
movq 0x18(%rsp), %rsi
movq 0x20(%rsp), %rdx
addq %rsi, %rdx
leaq 0x58(%rsp), %rdi
callq 0x3213c
leaq 0x58(%rsp), %rdx
movq %r12, %rdi
movq %r14, %rsi
callq 0x4d270
movq (%r15), %rax
movq %r12, (%rax,%r13,8)
movq 0x58(%rsp), %rdi
cmpq %rbx, %rdi
je 0x7989e
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x229c0
cmpl $0x4, 0x1614(%r14)
jb 0x79a53
movq 0xfc6f5(%rip), %rdi     # 0x175fa8
leaq 0x84e0f(%rip), %rsi     # 0xfe6c9
movl $0x7, %edx
callq 0x22ab0
movq 0xfc6dd(%rip), %rdi     # 0x175fa8
movl %ebp, %esi
callq 0x231e0
movq %rax, %r14
leaq 0xa8c91(%rip), %rsi     # 0x12256d
movl $0x3, %edx
movq %rax, %rdi
callq 0x22ab0
movq 0x8(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq %r14, %rdi
callq 0x22ab0
movq %rax, %rbx
leaq 0x84dee(%rip), %rsi     # 0xfe6f5
movl $0x20, %edx
movq %rax, %rdi
callq 0x22ab0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x22940
jmp 0x79a40
leaq 0x10(%rsp), %r12
movq $0x0, 0x10(%rsp)
movq %r15, %rdi
movq %r12, %rsi
callq 0x67786
incl %ebx
cmpl %ebx, %ebp
jne 0x79932
movl $0xc0, %edi
callq 0x22980
movq %rax, %r12
leaq 0x48(%rsp), %rbx
movq %rbx, -0x10(%rbx)
movq 0x18(%rsp), %rsi
movq 0x20(%rsp), %rdx
addq %rsi, %rdx
leaq 0x38(%rsp), %rdi
callq 0x3213c
movb $0x1, %r13b
leaq 0x38(%rsp), %rdx
movq %r12, %rdi
movq %r14, %rsi
callq 0x4d270
leaq 0x10(%rsp), %rsi
movq %r12, (%rsi)
xorl %r13d, %r13d
movq %r15, %rdi
callq 0x67786
movq 0x38(%rsp), %rdi
cmpq %rbx, %rdi
je 0x799b6
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x229c0
cmpl $0x4, 0x1614(%r14)
jb 0x79a53
movq 0xfc5dd(%rip), %rdi     # 0x175fa8
leaq 0x84cf7(%rip), %rsi     # 0xfe6c9
movl $0x7, %edx
callq 0x22ab0
movq 0xfc5c5(%rip), %rdi     # 0x175fa8
movl %ebp, %esi
callq 0x231e0
movq %rax, %r14
leaq 0xa8b79(%rip), %rsi     # 0x12256d
movl $0x3, %edx
movq %rax, %rdi
callq 0x22ab0
movq 0x8(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq %r14, %rdi
callq 0x22ab0
movq %rax, %rbx
leaq 0x84cf7(%rip), %rsi     # 0xfe716
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 0x79a6e
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 0x79bf2(%rip), %rdi     # 0xf3679
movq %r13, %rsi
xorl %eax, %eax
callq 0x22f40
movq %rax, %r14
movq 0x58(%rsp), %rdi
cmpq %rbx, %rdi
je 0x79afc
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x229c0
jmp 0x79afc
jmp 0x79ad4
jmp 0x79ad4
jmp 0x79b1a
movq %rax, %r14
movq 0x38(%rsp), %rdi
cmpq %rbx, %rdi
je 0x79acd
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x229c0
testb %r13b, %r13b
jne 0x79afc
jmp 0x79b1d
movq %rax, %r14
jmp 0x79afc
jmp 0x79b1a
movq %rax, %r14
movq 0x78(%rsp), %rdi
cmpq %r13, %rdi
je 0x79af8
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x229c0
testb %bl, %bl
je 0x79b1d
movl $0xc0, %esi
movq %r12, %rdi
callq 0x229c0
jmp 0x79b1d
movq %rax, %r14
movq 0x98(%rsp), %rdi
jmp 0x79b26
jmp 0x79b1a
movq %rax, %r14
leaq 0x28(%rsp), %r13
movq -0x10(%r13), %rdi
cmpq %r13, %rdi
je 0x79b37
movq (%r13), %rsi
incq %rsi
callq 0x229c0
movq %r14, %rdi
callq 0x23240
nop