// File: 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
movq %rsp, %rbp
subq $0x1c0, %rsp            # imm = 0x1C0
movq %rsi, -0x110(%rbp)
movb %cl, %al
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
andb $0x1, %al
movb %al, -0x15(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x108(%rbp)
leaq -0x58(%rbp), %rdi
movq %rdi, -0x100(%rbp)
callq 0x2f300
movq -0x100(%rbp), %rsi
leaq -0x38(%rbp), %rdi
callq 0x17c530
jmp 0xebe61
leaq -0x58(%rbp), %rdi
callq 0x311e8
movq -0x108(%rbp), %rdi
callq 0x8dec0
movl %eax, -0x114(%rbp)
jmp 0xebe7e
movl -0x114(%rbp), %eax
movl %eax, -0x68(%rbp)
movl -0x14(%rbp), %eax
cmpl -0x68(%rbp), %eax
jne 0xec049
movq -0x108(%rbp), %rax
addq $0x15c0, %rax           # imm = 0x15C0
movq %rax, -0x128(%rbp)
movl $0xc0, %edi
callq 0x2f3b0
movq %rax, -0x120(%rbp)
jmp 0xebeba
movb $0x1, -0x91(%rbp)
leaq -0x90(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x2f300
jmp 0xebed3
movq -0x108(%rbp), %rsi
movq -0x120(%rbp), %rdi
leaq -0x90(%rbp), %rdx
callq 0x97dc0
jmp 0xebeef
movq -0x128(%rbp), %rdi
movq -0x120(%rbp), %rax
movb $0x0, -0x91(%rbp)
movq %rax, -0x70(%rbp)
leaq -0x70(%rbp), %rsi
callq 0xb21f0
jmp 0xebf13
leaq -0x90(%rbp), %rdi
callq 0x311e8
movq -0x108(%rbp), %rax
cmpl $0x4, 0x1614(%rax)
jb 0xec044
movq 0x1e9016(%rip), %rdi    # 0x2d4f50
leaq 0xf5258(%rip), %rsi     # 0x1e1199
callq 0x2ff50
movq %rax, -0x130(%rbp)
jmp 0xebf4f
movq -0x130(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x2f800
movq %rax, -0x138(%rbp)
jmp 0xebf67
movq -0x138(%rbp), %rdi
leaq 0x119a62(%rip), %rsi    # 0x2059d7
callq 0x2ff50
movq %rax, -0x140(%rbp)
jmp 0xebf83
movq -0x110(%rbp), %rsi
movq -0x140(%rbp), %rdi
callq 0x2f780
movq %rax, -0x148(%rbp)
jmp 0xebf9f
movq -0x148(%rbp), %rdi
leaq 0xf51f4(%rip), %rsi     # 0x1e11a1
callq 0x2ff50
movq %rax, -0x150(%rbp)
jmp 0xebfbb
movq -0x150(%rbp), %rdi
movq 0x1e8fff(%rip), %rsi    # 0x2d4fc8
callq 0x30c10
jmp 0xebfd0
jmp 0xec044
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x311e8
jmp 0xec40c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0xec403
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0xec023
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x311e8
testb $0x1, -0x91(%rbp)
jne 0xec02e
jmp 0xec03f
movq -0x120(%rbp), %rdi
movl $0xc0, %esi
callq 0x2f2a0
jmp 0xec403
jmp 0xec3f1
movl -0x14(%rbp), %eax
cmpl -0x68(%rbp), %eax
jae 0xec210
testb $0x1, -0x15(%rbp)
jne 0xec08c
movq -0x108(%rbp), %rdi
addq $0x15c0, %rdi           # imm = 0x15C0
movslq -0x14(%rbp), %rsi
callq 0x45190
movq %rax, -0x158(%rbp)
jmp 0xec07b
movq -0x158(%rbp), %rax
cmpq $0x0, (%rax)
jne 0xec20b
movl $0xc0, %edi
callq 0x2f3b0
movq %rax, -0x160(%rbp)
jmp 0xec09f
movb $0x1, -0xb9(%rbp)
leaq -0xb8(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x2f300
jmp 0xec0b8
movq -0x108(%rbp), %rsi
movq -0x160(%rbp), %rdi
leaq -0xb8(%rbp), %rdx
callq 0x97dc0
jmp 0xec0d4
movq -0x108(%rbp), %rdi
movb $0x0, -0xb9(%rbp)
addq $0x14c0, %rdi           # imm = 0x14C0
addq $0x100, %rdi            # imm = 0x100
movslq -0x14(%rbp), %rsi
callq 0x45b40
movq -0x160(%rbp), %rcx
movq %rcx, (%rax)
leaq -0xb8(%rbp), %rdi
callq 0x311e8
movq -0x108(%rbp), %rax
cmpl $0x4, 0x1614(%rax)
jb 0xec209
movq 0x1e8e26(%rip), %rdi    # 0x2d4f50
leaq 0xf5068(%rip), %rsi     # 0x1e1199
callq 0x2ff50
movq %rax, -0x168(%rbp)
jmp 0xec13f
movq -0x168(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x2f800
movq %rax, -0x170(%rbp)
jmp 0xec157
movq -0x170(%rbp), %rdi
leaq 0x119872(%rip), %rsi    # 0x2059d7
callq 0x2ff50
movq %rax, -0x178(%rbp)
jmp 0xec173
movq -0x110(%rbp), %rsi
movq -0x178(%rbp), %rdi
callq 0x2f780
movq %rax, -0x180(%rbp)
jmp 0xec18f
movq -0x180(%rbp), %rdi
leaq 0xf5028(%rip), %rsi     # 0x1e11c5
callq 0x2ff50
movq %rax, -0x188(%rbp)
jmp 0xec1ab
movq -0x188(%rbp), %rdi
movq 0x1e8e0f(%rip), %rsi    # 0x2d4fc8
callq 0x30c10
jmp 0xec1c0
jmp 0xec209
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0xec1e8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0xb8(%rbp), %rdi
callq 0x311e8
testb $0x1, -0xb9(%rbp)
jne 0xec1f3
jmp 0xec204
movq -0x160(%rbp), %rdi
movl $0xc0, %esi
callq 0x2f2a0
jmp 0xec403
jmp 0xec20b
jmp 0xec3ef
movl $0x0, -0xc0(%rbp)
movl -0xc0(%rbp), %eax
movl -0x14(%rbp), %ecx
subl -0x68(%rbp), %ecx
cmpl %ecx, %eax
jae 0xec264
movq -0x108(%rbp), %rdi
addq $0x15c0, %rdi           # imm = 0x15C0
movq $0x0, -0xc8(%rbp)
leaq -0xc8(%rbp), %rsi
callq 0xb21f0
jmp 0xec251
jmp 0xec253
movl -0xc0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc0(%rbp)
jmp 0xec21a
movq -0x108(%rbp), %rax
addq $0x15c0, %rax           # imm = 0x15C0
movq %rax, -0x198(%rbp)
movl $0xc0, %edi
callq 0x2f3b0
movq %rax, -0x190(%rbp)
jmp 0xec28b
movb $0x1, -0xf1(%rbp)
leaq -0xf0(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x2f300
jmp 0xec2a4
movq -0x108(%rbp), %rsi
movq -0x190(%rbp), %rdi
leaq -0xf0(%rbp), %rdx
callq 0x97dc0
jmp 0xec2c0
movq -0x198(%rbp), %rdi
movq -0x190(%rbp), %rax
movb $0x0, -0xf1(%rbp)
movq %rax, -0xd0(%rbp)
leaq -0xd0(%rbp), %rsi
callq 0xb21f0
jmp 0xec2ea
leaq -0xf0(%rbp), %rdi
callq 0x311e8
movq -0x108(%rbp), %rax
cmpl $0x4, 0x1614(%rax)
jb 0xec3ed
movq 0x1e8c3f(%rip), %rdi    # 0x2d4f50
leaq 0xf4e81(%rip), %rsi     # 0x1e1199
callq 0x2ff50
movq %rax, -0x1a0(%rbp)
jmp 0xec326
movq -0x1a0(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x2f800
movq %rax, -0x1a8(%rbp)
jmp 0xec33e
movq -0x1a8(%rbp), %rdi
leaq 0x11968b(%rip), %rsi    # 0x2059d7
callq 0x2ff50
movq %rax, -0x1b0(%rbp)
jmp 0xec35a
movq -0x110(%rbp), %rsi
movq -0x1b0(%rbp), %rdi
callq 0x2f780
movq %rax, -0x1b8(%rbp)
jmp 0xec376
movq -0x1b8(%rbp), %rdi
leaq 0xf4e62(%rip), %rsi     # 0x1e11e6
callq 0x2ff50
movq %rax, -0x1c0(%rbp)
jmp 0xec392
movq -0x1c0(%rbp), %rdi
movq 0x1e8c28(%rip), %rsi    # 0x2d4fc8
callq 0x30c10
jmp 0xec3a7
jmp 0xec3ed
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0xec3cf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0xf0(%rbp), %rdi
callq 0x311e8
testb $0x1, -0xf1(%rbp)
jne 0xec3da
jmp 0xec3eb
movq -0x190(%rbp), %rdi
movl $0xc0, %esi
callq 0x2f2a0
jmp 0xec403
jmp 0xec3ef
jmp 0xec3f1
leaq -0x38(%rbp), %rdi
callq 0x311e8
addq $0x1c0, %rsp            # imm = 0x1C0
popq %rbp
retq
leaq -0x38(%rbp), %rdi
callq 0x311e8
movq -0x60(%rbp), %rdi
callq 0x30170
nopw %cs:(%rax,%rax)