// File: /workspace/github_cpp_makefile_star2_O2/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 $0x188, %rsp            # imm = 0x188
movl %ecx, 0x8(%rsp)
movq %rdx, %r14
movq %rdi, %rbx
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
andq $0x0, 0x20(%rsp)
movaps %xmm0, 0x30(%rsp)
andq $0x0, 0x40(%rsp)
leaq 0xc8(%rsp), %rdi
callq 0x28dd0
leaq 0x78(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x108(%rsp), %rdi
movq %r14, %rsi
callq 0x28dd0
leaq 0x6ad99(%rip), %rsi     # 0xd5d10
leaq 0xe8(%rsp), %rdi
leaq 0x48(%rsp), %rdx
callq 0x33402
leaq 0xa8(%rsp), %rdi
leaq 0x108(%rsp), %rsi
leaq 0xe8(%rsp), %rdx
callq 0x9e9d4
leaq 0x10(%rsp), %rdi
leaq 0xa8(%rsp), %r14
movq %r14, %rsi
callq 0x6230a
movq %r14, %rdi
callq 0x3355a
leaq 0xe8(%rsp), %rdi
callq 0x295a0
leaq 0x108(%rsp), %rdi
callq 0x295a0
movl 0x8(%rsp), %eax
cmpl $-0x1, %eax
je 0x6b24e
testl %eax, %eax
js 0x6b432
movl %eax, %eax
movq 0x15c8(%rbx), %rcx
subq 0x15c0(%rbx), %rcx
sarq $0x3, %rcx
cmpq %rax, %rcx
jbe 0x6b432
leaq 0x30(%rsp), %rdi
callq 0x3376e
xorl %r15d, %r15d
leaq 0xa8(%rsp), %r13
leaq 0x88(%rsp), %r14
leaq 0x68(%rsp), %rbp
movl %r15d, %r15d
movq 0x18(%rsp), %rax
subq 0x10(%rsp), %rax
sarq $0x5, %rax
cmpq %r15, %rax
jbe 0x6b1e7
leaq 0x10(%rsp), %rdi
movq %r15, %rsi
callq 0x85e18
movq %r13, %rdi
movq %rax, %rsi
callq 0x28dd0
leaq 0x48(%rsp), %rdi
movq %r13, %rsi
callq 0x28dd0
movq %r14, %rdi
movq %r13, %rsi
callq 0x28dd0
movq %r14, %rdi
callq 0x85e39
movl %eax, %r12d
movq %r14, %rdi
callq 0x295a0
testb %r12b, %r12b
jne 0x6b0bb
movq %r14, %rdi
leaq 0xc8(%rsp), %rsi
movq %r13, %rdx
callq 0x33467
leaq 0x48(%rsp), %rdi
movq %r14, %rsi
callq 0x28c40
movq %r14, %rdi
callq 0x295a0
movq %rbp, %rdi
leaq 0x48(%rsp), %rsi
callq 0x28570
leaq 0x30(%rsp), %rdi
movq %rbp, %rsi
callq 0x33776
cmpl $0x3, 0x1614(%rbx)
jb 0x6b133
movq 0xfaeb3(%rip), %rdi     # 0x165f98
leaq 0x71619(%rip), %rsi     # 0xdc705
callq 0x289f0
movq %rax, %rdi
movq %rbp, %rsi
callq 0x28910
movq %rax, %rdi
callq 0x284a0
cmpl $0x3, 0x1614(%rbx)
jb 0x6b133
movq 0xfae84(%rip), %rdi     # 0x165f98
leaq 0x7163c(%rip), %rsi     # 0xdc757
callq 0x289f0
movq %rax, %rdi
movq %rbp, %rsi
callq 0x28910
movq %rax, %rdi
callq 0x284a0
leaq 0x148(%rsp), %rdi
movq %rbp, %rsi
callq 0x28dd0
movq %rbx, %rdi
leaq 0x148(%rsp), %r12
movq %r12, %rsi
movl 0x8(%rsp), %edx
callq 0x6a498
movq %r12, %rdi
callq 0x295a0
cmpl $0x3, 0x1614(%rbx)
jb 0x6b1cd
movq 0xfae26(%rip), %rdi     # 0x165f98
leaq 0x715af(%rip), %rsi     # 0xdc728
callq 0x289f0
movq %rax, %rdi
movq %r15, %rsi
callq 0x286e0
movq %rax, %rdi
leaq 0x7159a(%rip), %rsi     # 0xdc72d
callq 0x289f0
movq %rax, %rdi
movq %rbp, %rsi
callq 0x28910
movq %rax, %rdi
leaq 0x715ce(%rip), %rsi     # 0xdc77b
callq 0x289f0
movq %rax, %rdi
movl 0x8(%rsp), %esi
callq 0x29290
movq %rax, %rdi
leaq 0x744f5(%rip), %rsi     # 0xdf6bd
callq 0x289f0
leaq 0x48(%rsp), %rdi
callq 0x295a0
movq %r13, %rdi
callq 0x295a0
incl %r15d
jmp 0x6b031
addq $0x1908, %rbx           # imm = 0x1908
leaq 0xa8(%rsp), %rsi
movl 0x8(%rsp), %eax
movl %eax, (%rsi)
movq %rbx, %rdi
callq 0x85e5c
leaq 0x30(%rsp), %rsi
movq %rax, %rdi
callq 0x3386c
leaq 0x68(%rsp), %rdi
callq 0x295a0
leaq 0xc8(%rsp), %rdi
callq 0x295a0
leaq 0x30(%rsp), %rdi
callq 0x3355a
leaq 0x10(%rsp), %rdi
callq 0x3355a
addq $0x188, %rsp            # imm = 0x188
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1908(%rbx), %rax
movq %rax, 0x8(%rsp)
xorl %ebp, %ebp
leaq 0xa8(%rsp), %r13
leaq 0x88(%rsp), %r14
movl %ebp, %r12d
movq 0x18(%rsp), %rax
subq 0x10(%rsp), %rax
sarq $0x5, %rax
cmpq %r12, %rax
jbe 0x6b211
leaq 0x10(%rsp), %rdi
movq %r12, %rsi
callq 0x85e18
movq %r13, %rdi
movq %rax, %rsi
callq 0x28dd0
leaq 0x48(%rsp), %rdi
movq %r13, %rsi
callq 0x28dd0
movq %r14, %rdi
movq %r13, %rsi
callq 0x28dd0
movq %r14, %rdi
callq 0x85e39
movl %eax, %r15d
movq %r14, %rdi
callq 0x295a0
testb %r15b, %r15b
jne 0x6b2f2
movq %r14, %rdi
leaq 0xc8(%rsp), %rsi
movq %r13, %rdx
callq 0x33467
leaq 0x48(%rsp), %rdi
movq %r14, %rsi
callq 0x28c40
movq %r14, %rdi
callq 0x295a0
leaq 0x30(%rsp), %rdi
callq 0x3376e
leaq 0x68(%rsp), %rdi
leaq 0x48(%rsp), %rsi
callq 0x28570
cmpl $0x3, 0x1614(%rbx)
jb 0x6b356
movq 0xfac7d(%rip), %rdi     # 0x165f98
leaq 0x713e3(%rip), %rsi     # 0xdc705
callq 0x289f0
movq %rax, %rdi
leaq 0x68(%rsp), %rsi
callq 0x28910
movq %rax, %rdi
leaq 0x713da(%rip), %rsi     # 0xdc718
callq 0x289f0
movq %rax, %rdi
movq %r12, %rsi
callq 0x286e0
movq %rax, %rdi
callq 0x284a0
leaq 0x30(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x33776
movl %ebp, 0x88(%rsp)
leaq 0x90(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x4758e
movq 0x8(%rsp), %rdi
movq %r14, %rsi
callq 0x8df28
leaq 0x90(%rsp), %rdi
callq 0x3355a
leaq 0x168(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x28dd0
movq %rbx, %rdi
leaq 0x168(%rsp), %r15
movq %r15, %rsi
movl %ebp, %edx
callq 0x6a498
movq %r15, %rdi
callq 0x295a0
cmpl $0x3, 0x1614(%rbx)
jb 0x6b419
movq 0xfabc1(%rip), %rdi     # 0x165f98
leaq 0x7134a(%rip), %rsi     # 0xdc728
callq 0x289f0
movq %rax, %rdi
movq %r12, %rsi
callq 0x286e0
movq %rax, %rdi
leaq 0x71335(%rip), %rsi     # 0xdc72d
callq 0x289f0
movq %rax, %rdi
leaq 0x68(%rsp), %rsi
callq 0x28910
movq %rax, %rdi
leaq 0x7131e(%rip), %rsi     # 0xdc732
callq 0x289f0
leaq 0x48(%rsp), %rdi
callq 0x295a0
movq %r13, %rdi
callq 0x295a0
incl %ebp
jmp 0x6b26c
leaq 0x71370(%rip), %rsi     # 0xdc7a9
leaq 0x128(%rsp), %rdi
leaq 0xa8(%rsp), %rdx
callq 0x33402
leaq 0x128(%rsp), %rsi
movq %rbx, %rdi
callq 0x6aed2
movq %rax, %rbx
leaq 0x128(%rsp), %rdi
jmp 0x6b50a
jmp 0x6b4ee
movq %rax, %rbx
leaq 0xe8(%rsp), %rdi
callq 0x295a0
jmp 0x6b485
movq %rax, %rbx
leaq 0x108(%rsp), %rdi
jmp 0x6b50a
jmp 0x6b4ee
movq %rax, %rbx
jmp 0x6b526
jmp 0x6b4ee
jmp 0x6b4f5
jmp 0x6b4f5
jmp 0x6b4f5
jmp 0x6b4f5
movq %rax, %rbx
leaq 0x90(%rsp), %rdi
callq 0x3355a
jmp 0x6b4f8
movq %rax, %rbx
leaq 0x168(%rsp), %rdi
jmp 0x6b4e0
jmp 0x6b4e7
jmp 0x6b4d5
movq %rax, %rbx
leaq 0x148(%rsp), %rdi
jmp 0x6b4e0
jmp 0x6b4f5
movq %rax, %rbx
leaq 0x88(%rsp), %rdi
callq 0x295a0
jmp 0x6b4f8
movq %rax, %rbx
jmp 0x6b502
jmp 0x6b4ee
movq %rax, %rbx
jmp 0x6b50f
jmp 0x6b4f5
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x295a0
leaq 0xa8(%rsp), %rdi
callq 0x295a0
leaq 0x68(%rsp), %rdi
callq 0x295a0
leaq 0xc8(%rsp), %rdi
callq 0x295a0
leaq 0x30(%rsp), %rdi
callq 0x3355a
leaq 0x10(%rsp), %rdi
callq 0x3355a
movq %rbx, %rdi
callq 0x292f0