// File: /workspace/github_cpp_makefile_star2_O3/richardposner[P]BioNetFit2/src/code/Swarm.cpp
// Function: Swarm::setExpPath(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int)
void Swarm::setExpPath(std::string prefixPath, std::string path, int mid){

/*   old ver, just one exp file for each model
	std::vector<string> paths;
	string expfile;

	expPaths_.clear();
	paths = split_string(path, ",");
	if (paths.size()>1)
		outputError("Can not set more than 1 exp file for each model at this version");

	for(int i=0; i< paths.size(); ++i){
		expfile = convertToAbsPath(paths.at(i));
//cout<<"Swarm::setExpPath AAA1  Enter a number..."; mypause();
		expPaths_.push_back(expfile);
//cout<<"Swarm::setExpPath AAA2, File:"<< expfile <<"  Enter a number..."; mypause();
		addExp(expfile, mid);
//cout<<"Swarm::setExpPath AAA3  Enter a number..."; mypause();

		if (options.verbosity >=3) cout<<"Exp["<<i<<"]  :"<<expfile <<" is added to the list of exp files.\n";
	}
*/

	std::vector<string> Paths;
	std::vector<string> absPaths;
	fs::path prefix(prefixPath);
	string expfile;
	Paths = split_string(path, ",");

	if (mid==-1){ //razi: means that each file is for one model [in the sqame order]

		for(unsigned int i=0; i< Paths.size(); ++i){
			fs::path path(Paths.at(i));
			fs::path abspath = path;
			
			if (!fs::exists(path.string())){
				abspath = prefix / path;
			}
			absPaths.clear();
			expfile = abspath.string();
			if(options.verbosity>=3){
				cout<<"*** exp file found"<<expfile<< " set for model:"<<i<<endl;
			}
			absPaths.push_back(expfile);
			expPaths_.insert(make_pair(i, absPaths));
			addExp(expfile, i);
			if (options.verbosity >=3) cout<<"Exp["<<i<<"]  :"<<expfile <<" is added to the list of exp files.\n";
		}


	}else{
		if((mid>=0)&&((unsigned) mid < options.models.size())){
			absPaths.clear();
			for(unsigned int i=0; i< Paths.size(); ++i){
				fs::path path(Paths.at(i));
				fs::path abspath = path;
				
				if (!fs::exists(path.string())){
					abspath = prefix / path;
				}
				expfile = abspath.string();
				absPaths.push_back(expfile);
				if(options.verbosity>=3){
					cout<<"*** exp file found"<<expfile<<endl;
				}
				if (options.verbosity >= 3){ cout<<"Swarm::setExpPath try to add  File:"<< expfile <<endl;}
				addExp(expfile, mid);
				if (options.verbosity >=3) cout<<"Exp["<<i<<"]  :"<<expfile <<" is added to the list of exp files for model:"<<mid<<".\n";
			}
			//cout<<"Number of exp files for this model: "<< absPaths.size()<<endl; cout<< "Number of expPaths_ before adding :"<< expPaths_.size()<<endl;
			expPaths_[mid]= absPaths; //razi: there is eeror for duplicate key, expPaths_.insert(make_pair(mid, absPaths));
		}
		else
			outputError("Invalid request to set exp files. I am quitting...");
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x198, %rsp            # imm = 0x198
movl %ecx, %ebp
movq %rdx, %r14
movq %rdi, %rbx
xorps %xmm0, %xmm0
movaps %xmm0, 0x90(%rsp)
xorl %eax, %eax
movq %rax, 0xa0(%rsp)
movq %rax, 0xc0(%rsp)
movaps %xmm0, 0xb0(%rsp)
leaq 0xe8(%rsp), %rax
movq %rax, -0x10(%rax)
movq (%rsi), %rax
movq 0x8(%rsi), %rdx
addq %rax, %rdx
leaq 0xd8(%rsp), %rdi
movq %rax, %rsi
callq 0x3213c
leaq 0x78(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x168(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
leaq 0x158(%rsp), %rdi
callq 0x3213c
leaq 0x148(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x7f7df(%rip), %rsi     # 0xf7dc0
leaq 0x7f7d9(%rip), %rdx     # 0xf7dc1
leaq 0x138(%rsp), %rdi
callq 0x321d2
leaq 0x40(%rsp), %rdi
leaq 0x158(%rsp), %rsi
leaq 0x138(%rsp), %rdx
callq 0xbe638
movq 0xa0(%rsp), %rax
leaq 0x40(%rsp), %r14
movaps (%r14), %xmm0
movq 0x10(%r14), %rcx
movq %rcx, 0xa0(%rsp)
movaps 0x90(%rsp), %xmm1
movaps %xmm0, 0x90(%rsp)
leaq 0x20(%rsp), %rdi
movaps %xmm1, (%rdi)
movq %rax, 0x10(%rdi)
xorps %xmm0, %xmm0
movaps %xmm0, (%r14)
movq $0x0, 0x10(%r14)
callq 0x31a0a
movq %r14, %rdi
callq 0x31a0a
movq 0x138(%rsp), %rdi
cmpq %r12, %rdi
je 0x78681
movq 0x148(%rsp), %rsi
incq %rsi
callq 0x229c0
movq 0x158(%rsp), %rdi
cmpq %r15, %rdi
je 0x7869e
movq 0x168(%rsp), %rsi
incq %rsi
callq 0x229c0
cmpl $-0x1, %ebp
je 0x78a9a
testl %ebp, %ebp
js 0x78e6d
movl %ebp, %eax
movq 0x15c8(%rbx), %rcx
subq 0x15c0(%rbx), %rcx
sarq $0x3, %rcx
cmpq %rax, %rcx
jbe 0x78e6d
movl %ebp, 0x88(%rsp)
movq 0xb0(%rsp), %r14
movq 0xb8(%rsp), %r15
cmpq %r14, %r15
je 0x7871b
leaq 0x10(%r14), %r12
movq -0x10(%r12), %rdi
cmpq %rdi, %r12
je 0x78702
movq (%r12), %rsi
incq %rsi
callq 0x229c0
leaq 0x20(%r12), %rax
addq $0x10, %r12
cmpq %r15, %r12
movq %rax, %r12
jne 0x786ec
movq %r14, 0xb8(%rsp)
movq 0x90(%rsp), %rax
cmpq %rax, 0x98(%rsp)
je 0x78a68
leaq 0x10(%rsp), %r14
movl $0x1, %ebp
xorl %r13d, %r13d
movq %rsp, %r12
movq %r13, %rcx
shlq $0x5, %rcx
leaq 0x30(%rsp), %rdx
movq %rdx, 0x20(%rsp)
movq (%rax,%rcx), %rsi
movq 0x8(%rax,%rcx), %rdx
addq %rsi, %rdx
leaq 0x20(%rsp), %rdi
callq 0x3213c
leaq 0x50(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
addq %rsi, %rdx
leaq 0x40(%rsp), %rdi
callq 0x3213c
movq %r14, (%rsp)
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
addq %rsi, %rdx
movq %r12, %rdi
callq 0x3213c
leaq 0xd0(%rsp), %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0xd7330
movl 0xd0(%rsp), %r15d
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x787d2
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x229c0
cmpl $0x1, %r15d
ja 0x78827
movq %r14, (%rsp)
movq 0xd8(%rsp), %rsi
movq 0xe0(%rsp), %rdx
addq %rsi, %rdx
movq %r12, %rdi
callq 0x3213c
movq %r12, %rdi
leaq 0x20(%rsp), %rsi
callq 0xdc620
leaq 0x40(%rsp), %rdi
movq %r12, %rsi
callq 0x22bb0
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x78827
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x229c0
leaq 0x68(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0x22500
leaq 0xb0(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x31cec
cmpl $0x3, 0x1614(%rbx)
jb 0x7890e
movl $0x12, %edx
movq 0xfd747(%rip), %rdi     # 0x175fa8
leaq 0x85d3d(%rip), %rsi     # 0xfe5a5
callq 0x22ab0
movq 0x68(%rsp), %rsi
movq 0x70(%rsp), %rdx
movq 0xfd72a(%rip), %rdi     # 0x175fa8
callq 0x22ab0
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x22940
movsbl %al, %esi
movq %r15, %rdi
callq 0x22050
movq %rax, %rdi
callq 0x22660
cmpl $0x3, 0x1614(%rbx)
jb 0x7890e
movl $0x23, %edx
movq 0xfd6e6(%rip), %rdi     # 0x175fa8
leaq 0x85d2e(%rip), %rsi     # 0xfe5f7
callq 0x22ab0
movq 0x68(%rsp), %rsi
movq 0x70(%rsp), %rdx
movq 0xfd6c9(%rip), %rdi     # 0x175fa8
callq 0x22ab0
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x22940
movsbl %al, %esi
movq %r15, %rdi
callq 0x22050
movq %rax, %rdi
callq 0x22660
leaq 0x108(%rsp), %rax
movq %rax, 0xf8(%rsp)
movq 0x68(%rsp), %rsi
movq 0x70(%rsp), %rdx
addq %rsi, %rdx
leaq 0xf8(%rsp), %rdi
callq 0x3213c
movq %rbx, %rdi
leaq 0xf8(%rsp), %rsi
movl 0x88(%rsp), %edx
callq 0x77520
movq 0xf8(%rsp), %rdi
leaq 0x108(%rsp), %rax
cmpq %rax, %rdi
je 0x78974
movq 0x108(%rsp), %rsi
incq %rsi
callq 0x229c0
cmpl $0x3, 0x1614(%rbx)
jb 0x78a0b
movl $0x4, %edx
movq 0xfd61b(%rip), %rdi     # 0x175fa8
leaq 0x85c34(%rip), %rsi     # 0xfe5c8
callq 0x22ab0
movq 0xfd608(%rip), %rdi     # 0x175fa8
movq %r13, %rsi
callq 0x22650
movq %rax, %r15
movl $0x4, %edx
movq %rax, %rdi
leaq 0x85c13(%rip), %rsi     # 0xfe5cd
callq 0x22ab0
movq 0x68(%rsp), %rsi
movq 0x70(%rsp), %rdx
movq %r15, %rdi
callq 0x22ab0
movq %rax, %r15
movl $0x2d, %edx
movq %rax, %rdi
leaq 0x85c38(%rip), %rsi     # 0xfe61b
callq 0x22ab0
movq %r15, %rdi
movl 0x88(%rsp), %esi
callq 0x231e0
movl $0x2, %edx
movq %rax, %rdi
leaq 0x88ace(%rip), %rsi     # 0x1014d4
callq 0x22ab0
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x78a27
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x229c0
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x78a43
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x229c0
movl %ebp, %r13d
movq 0x90(%rsp), %rax
movq 0x98(%rsp), %rcx
subq %rax, %rcx
sarq $0x5, %rcx
incl %ebp
cmpq %r13, %rcx
ja 0x78741
addq $0x1908, %rbx           # imm = 0x1908
leaq 0x20(%rsp), %rsi
movl 0x88(%rsp), %eax
movl %eax, (%rsi)
movq %rbx, %rdi
callq 0xa744e
leaq 0xb0(%rsp), %rsi
movq %rax, %rdi
callq 0x31dd2
jmp 0x78e00
movq 0x90(%rsp), %rax
cmpq %rax, 0x98(%rsp)
je 0x78e00
leaq 0x30(%rsp), %r15
leaq 0x50(%rsp), %rbp
leaq 0x1908(%rbx), %rcx
movq %rcx, 0x88(%rsp)
xorl %r12d, %r12d
movq %rsp, %r13
movq %r12, %rcx
shlq $0x5, %rcx
movq %r15, 0x20(%rsp)
movq (%rax,%rcx), %rsi
movq 0x8(%rax,%rcx), %rdx
addq %rsi, %rdx
leaq 0x20(%rsp), %rdi
callq 0x3213c
movq %rbp, 0x40(%rsp)
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
addq %rsi, %rdx
leaq 0x40(%rsp), %rdi
callq 0x3213c
leaq 0x10(%rsp), %rax
movq %rax, (%rsp)
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
addq %rsi, %rdx
movq %r13, %rdi
callq 0x3213c
leaq 0xd0(%rsp), %rdi
movq %r13, %rsi
xorl %edx, %edx
callq 0xd7330
movl 0xd0(%rsp), %ebp
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x78b5f
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x229c0
cmpl $0x1, %ebp
ja 0x78bbd
leaq 0x10(%rsp), %rax
movq %rax, (%rsp)
movq 0xd8(%rsp), %rsi
movq 0xe0(%rsp), %rdx
addq %rsi, %rdx
movq %r13, %rdi
callq 0x3213c
movq %r13, %rdi
leaq 0x20(%rsp), %rsi
callq 0xdc620
leaq 0x40(%rsp), %rdi
movq %r13, %rsi
callq 0x22bb0
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x78bbd
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x229c0
movq 0xb0(%rsp), %r14
movq 0xb8(%rsp), %rbp
cmpq %r14, %rbp
je 0x78c07
leaq 0x10(%r14), %r15
movq -0x10(%r15), %rdi
cmpq %rdi, %r15
je 0x78bea
movq (%r15), %rsi
incq %rsi
callq 0x229c0
leaq 0x20(%r15), %rax
addq $0x10, %r15
cmpq %rbp, %r15
movq %rax, %r15
jne 0x78bd6
movq %r14, 0xb8(%rsp)
leaq 0x30(%rsp), %r15
leaq 0x68(%rsp), %rdi
leaq 0x40(%rsp), %rsi
leaq 0x50(%rsp), %rbp
callq 0x22500
cmpl $0x3, 0x1614(%rbx)
jb 0x78c9e
movl $0x12, %edx
movq 0xfd378(%rip), %rdi     # 0x175fa8
leaq 0x8596e(%rip), %rsi     # 0xfe5a5
callq 0x22ab0
movq 0x68(%rsp), %rsi
movq 0x70(%rsp), %rdx
movq 0xfd35b(%rip), %rdi     # 0x175fa8
callq 0x22ab0
movq %rax, %r14
movl $0xf, %edx
movq %rax, %rdi
leaq 0x85954(%rip), %rsi     # 0xfe5b8
callq 0x22ab0
movq %r14, %rdi
movq %r12, %rsi
callq 0x22650
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x22940
movsbl %al, %esi
movq %r14, %rdi
callq 0x22050
movq %rax, %rdi
callq 0x22660
leaq 0xb0(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x31cec
movl %r12d, (%rsp)
leaq 0x8(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
callq 0x47812
movq 0x88(%rsp), %rdi
movq %r13, %rsi
callq 0xae3ac
leaq 0x8(%rsp), %rdi
callq 0x31a0a
leaq 0x128(%rsp), %rax
movq %rax, 0x118(%rsp)
movq 0x68(%rsp), %rsi
movq 0x70(%rsp), %rdx
addq %rsi, %rdx
leaq 0x118(%rsp), %rdi
callq 0x3213c
movq %rbx, %rdi
leaq 0x118(%rsp), %rsi
movl %r12d, %edx
callq 0x77520
movq 0x118(%rsp), %rdi
leaq 0x128(%rsp), %rax
cmpq %rax, %rdi
je 0x78d42
movq 0x128(%rsp), %rsi
incq %rsi
callq 0x229c0
cmpl $0x3, 0x1614(%rbx)
jb 0x78daf
movl $0x4, %edx
movq 0xfd251(%rip), %rdi     # 0x175fa8
leaq 0x8586a(%rip), %rsi     # 0xfe5c8
callq 0x22ab0
movq 0xfd23e(%rip), %rdi     # 0x175fa8
movq %r12, %rsi
callq 0x22650
movq %rax, %r14
movl $0x4, %edx
movq %rax, %rdi
leaq 0x85849(%rip), %rsi     # 0xfe5cd
callq 0x22ab0
movq 0x68(%rsp), %rsi
movq 0x70(%rsp), %rdx
movq %r14, %rdi
callq 0x22ab0
movl $0x24, %edx
movq %rax, %rdi
leaq 0x85828(%rip), %rsi     # 0xfe5d2
callq 0x22ab0
movq 0x40(%rsp), %rdi
cmpq %rbp, %rdi
je 0x78dc6
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x229c0
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x78ddd
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x229c0
incl %r12d
movq 0x90(%rsp), %rax
movq 0x98(%rsp), %rcx
subq %rax, %rcx
sarq $0x5, %rcx
cmpq %r12, %rcx
ja 0x78acf
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x78e1c
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x229c0
movq 0xd8(%rsp), %rdi
leaq 0xe8(%rsp), %rax
cmpq %rax, %rdi
je 0x78e41
movq 0xe8(%rsp), %rsi
incq %rsi
callq 0x229c0
leaq 0xb0(%rsp), %rdi
callq 0x31a0a
leaq 0x90(%rsp), %rdi
callq 0x31a0a
addq $0x198, %rsp            # imm = 0x198
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x188(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x857c9(%rip), %rsi     # 0xfe649
leaq 0x857f4(%rip), %rdx     # 0xfe67b
leaq 0x178(%rsp), %rdi
callq 0x321d2
leaq 0x178(%rsp), %rsi
movq %rbx, %rdi
callq 0x784c2
movq %rax, %rbx
movq 0x178(%rsp), %rdi
cmpq %r14, %rdi
je 0x7901e
movq 0x188(%rsp), %rsi
jmp 0x79016
jmp 0x78f88
movq %rax, %rbx
movq 0x138(%rsp), %rdi
cmpq %r12, %rdi
je 0x78eef
movq 0x148(%rsp), %rsi
incq %rsi
callq 0x229c0
jmp 0x78eef
movq %rax, %rbx
movq 0x158(%rsp), %rdi
cmpq %r15, %rdi
je 0x7901e
movq 0x168(%rsp), %rsi
jmp 0x79016
jmp 0x78f88
movq %rax, %rbx
jmp 0x7905f
jmp 0x78f88
jmp 0x78f2d
jmp 0x78f28
jmp 0x78fe3
jmp 0x78f97
jmp 0x78f88
jmp 0x78f90
movq %rax, %rbx
jmp 0x78f81
movq %rax, %rbx
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x78f81
movq 0x10(%rsp), %rsi
jmp 0x78f79
jmp 0x78fd4
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x31a0a
jmp 0x78fd7
movq %rax, %rbx
movq 0x118(%rsp), %rdi
leaq 0x128(%rsp), %rax
cmpq %rax, %rdi
je 0x78f81
movq 0x128(%rsp), %rsi
incq %rsi
callq 0x229c0
leaq 0x50(%rsp), %rbp
jmp 0x78fd7
movq %rax, %rbx
jmp 0x7901e
movq %rax, %rbx
jmp 0x79002
jmp 0x78fe3
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x78fe6
movq 0x10(%rsp), %rsi
jmp 0x78fca
movq %rax, %rbx
movq 0xf8(%rsp), %rdi
leaq 0x108(%rsp), %rax
cmpq %rax, %rdi
je 0x78fe6
movq 0x108(%rsp), %rsi
incq %rsi
callq 0x229c0
jmp 0x78fe6
movq %rax, %rbx
movq 0x40(%rsp), %rdi
cmpq %rbp, %rdi
jne 0x78ff5
jmp 0x79002
movq %rax, %rbx
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x79002
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x229c0
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x7901e
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x229c0
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x7903a
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x229c0
movq 0xd8(%rsp), %rdi
leaq 0xe8(%rsp), %rax
cmpq %rax, %rdi
je 0x7905f
movq 0xe8(%rsp), %rsi
incq %rsi
callq 0x229c0
leaq 0xb0(%rsp), %rdi
callq 0x31a0a
leaq 0x90(%rsp), %rdi
callq 0x31a0a
movq %rbx, %rdi
callq 0x23240
nop