// File: /workspace/github_cpp_makefile_star2_O1/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 0x32180
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 0x32180
leaq 0x148(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x7f18b(%rip), %rsi     # 0xf7e10
leaq 0x7f185(%rip), %rdx     # 0xf7e11
leaq 0x138(%rsp), %rdi
callq 0x32210
leaq 0x48(%rsp), %rdi
leaq 0x158(%rsp), %rsi
leaq 0x138(%rsp), %rdx
callq 0xbef52
xorps %xmm0, %xmm0
leaq 0x20(%rsp), %rdi
movaps %xmm0, (%rdi)
movaps 0x90(%rsp), %xmm0
movq 0xa0(%rsp), %rax
leaq 0x48(%rsp), %r14
movups (%r14), %xmm1
movaps %xmm1, 0x90(%rsp)
movq 0x10(%r14), %rcx
movq %rcx, 0xa0(%rsp)
movaps (%rdi), %xmm1
movaps %xmm0, (%rdi)
movq %rax, 0x10(%rdi)
movups %xmm1, (%r14)
movq $0x0, 0x10(%r14)
callq 0x31a9e
movq %r14, %rdi
callq 0x31a9e
movq 0x138(%rsp), %rdi
cmpq %r12, %rdi
je 0x78d2b
movq 0x148(%rsp), %rsi
incq %rsi
callq 0x229c0
movq 0x158(%rsp), %rdi
cmpq %r15, %rdi
je 0x78d48
movq 0x168(%rsp), %rsi
incq %rsi
callq 0x229c0
cmpl $-0x1, %ebp
je 0x7913e
testl %ebp, %ebp
js 0x79511
movl %ebp, %eax
movq 0x15c8(%rbx), %rcx
subq 0x15c0(%rbx), %rcx
sarq $0x3, %rcx
cmpq %rax, %rcx
jbe 0x79511
movl %ebp, 0x88(%rsp)
movq 0xb0(%rsp), %r14
movq 0xb8(%rsp), %r15
cmpq %r14, %r15
je 0x78dc5
leaq 0x10(%r14), %r12
movq -0x10(%r12), %rdi
cmpq %rdi, %r12
je 0x78dac
movq (%r12), %rsi
incq %rsi
callq 0x229c0
leaq 0x20(%r12), %rax
addq $0x10, %r12
cmpq %r15, %r12
movq %rax, %r12
jne 0x78d96
movq %r14, 0xb8(%rsp)
movq 0x90(%rsp), %rax
cmpq %rax, 0x98(%rsp)
je 0x7910c
movl $0x1, %ebp
xorl %r13d, %r13d
movq %rsp, %r12
movq 0xfd1a3(%rip), %r14     # 0x175f90
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 0x32180
leaq 0x58(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
addq %rsi, %rdx
leaq 0x48(%rsp), %rdi
callq 0x32180
leaq 0x10(%rsp), %rax
movq %rax, (%rsp)
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
addq %rsi, %rdx
movq %r12, %rdi
callq 0x32180
leaq 0xd0(%rsp), %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0xd7c80
movl 0xd0(%rsp), %r15d
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x78e88
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x229c0
cmpl $0x1, %r15d
ja 0x78ee7
leaq 0x10(%rsp), %rax
movq %rax, (%rsp)
movq 0xd8(%rsp), %rsi
movq 0xe0(%rsp), %rdx
addq %rsi, %rdx
movq %r12, %rdi
callq 0x32180
movq %r12, %rdi
leaq 0x20(%rsp), %rsi
callq 0xdcf70
leaq 0x48(%rsp), %rdi
movq %r12, %rsi
callq 0x22bb0
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x78ee7
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x229c0
leaq 0x68(%rsp), %rdi
leaq 0x48(%rsp), %rsi
callq 0x22500
leaq 0xb0(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x31d52
cmpl $0x3, 0x1614(%rbx)
jb 0x78f61
movl $0x12, %edx
movq %r14, %rdi
leaq 0x85615(%rip), %rsi     # 0xfe535
callq 0x22ab0
movq 0x68(%rsp), %rsi
movq 0x70(%rsp), %rdx
movq %r14, %rdi
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 0x78fba
movl $0x23, %edx
movq %r14, %rdi
leaq 0x8560e(%rip), %rsi     # 0xfe587
callq 0x22ab0
movq 0x68(%rsp), %rsi
movq 0x70(%rsp), %rdx
movq %r14, %rdi
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 0x32180
movq %rbx, %rdi
leaq 0xf8(%rsp), %rsi
movl 0x88(%rsp), %edx
callq 0x77b74
movq 0xf8(%rsp), %rdi
leaq 0x108(%rsp), %rax
cmpq %rax, %rdi
je 0x79020
movq 0x108(%rsp), %rsi
incq %rsi
callq 0x229c0
cmpl $0x3, 0x1614(%rbx)
jb 0x790af
movl $0x4, %edx
movq %r14, %rdi
leaq 0x8551c(%rip), %rsi     # 0xfe558
callq 0x22ab0
movq %r14, %rdi
movq %r13, %rsi
callq 0x22650
movq %rax, %r15
movl $0x4, %edx
movq %rax, %rdi
leaq 0x854ff(%rip), %rsi     # 0xfe55d
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 0x85524(%rip), %rsi     # 0xfe5ab
callq 0x22ab0
movq %r15, %rdi
movl 0x88(%rsp), %esi
callq 0x231e0
movl $0x2, %edx
movq %rax, %rdi
leaq 0x88443(%rip), %rsi     # 0x1014ed
callq 0x22ab0
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x790cb
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x229c0
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x790e7
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 0x78ded
addq $0x1908, %rbx           # imm = 0x1908
leaq 0x20(%rsp), %rsi
movl 0x88(%rsp), %eax
movl %eax, (%rsi)
movq %rbx, %rdi
callq 0xa7ea0
leaq 0xb0(%rsp), %rsi
movq %rax, %rdi
callq 0x31e38
jmp 0x794a4
movq 0x90(%rsp), %rax
cmpq %rax, 0x98(%rsp)
je 0x794a4
leaq 0x30(%rsp), %r15
leaq 0x58(%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 0x32180
movq %rbp, 0x48(%rsp)
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
addq %rsi, %rdx
leaq 0x48(%rsp), %rdi
callq 0x32180
leaq 0x10(%rsp), %rax
movq %rax, (%rsp)
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
addq %rsi, %rdx
movq %r13, %rdi
callq 0x32180
leaq 0xd0(%rsp), %rdi
movq %r13, %rsi
xorl %edx, %edx
callq 0xd7c80
movl 0xd0(%rsp), %ebp
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x79203
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x229c0
cmpl $0x1, %ebp
ja 0x79261
leaq 0x10(%rsp), %rax
movq %rax, (%rsp)
movq 0xd8(%rsp), %rsi
movq 0xe0(%rsp), %rdx
addq %rsi, %rdx
movq %r13, %rdi
callq 0x32180
movq %r13, %rdi
leaq 0x20(%rsp), %rsi
callq 0xdcf70
leaq 0x48(%rsp), %rdi
movq %r13, %rsi
callq 0x22bb0
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x79261
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x229c0
movq 0xb0(%rsp), %r14
movq 0xb8(%rsp), %rbp
cmpq %r14, %rbp
je 0x792ab
leaq 0x10(%r14), %r15
movq -0x10(%r15), %rdi
cmpq %rdi, %r15
je 0x7928e
movq (%r15), %rsi
incq %rsi
callq 0x229c0
leaq 0x20(%r15), %rax
addq $0x10, %r15
cmpq %rbp, %r15
movq %rax, %r15
jne 0x7927a
movq %r14, 0xb8(%rsp)
leaq 0x30(%rsp), %r15
leaq 0x68(%rsp), %rdi
leaq 0x48(%rsp), %rsi
leaq 0x58(%rsp), %rbp
callq 0x22500
cmpl $0x3, 0x1614(%rbx)
jb 0x79342
movl $0x12, %edx
movq 0xfccbc(%rip), %rdi     # 0x175f90
leaq 0x8525a(%rip), %rsi     # 0xfe535
callq 0x22ab0
movq 0x68(%rsp), %rsi
movq 0x70(%rsp), %rdx
movq 0xfcc9f(%rip), %rdi     # 0x175f90
callq 0x22ab0
movq %rax, %r14
movl $0xf, %edx
movq %rax, %rdi
leaq 0x85240(%rip), %rsi     # 0xfe548
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 0x31d52
movl %r12d, (%rsp)
leaq 0x8(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
callq 0x47a3e
movq 0x88(%rsp), %rdi
movq %r13, %rsi
callq 0xaeb18
leaq 0x8(%rsp), %rdi
callq 0x31a9e
leaq 0x128(%rsp), %rax
movq %rax, 0x118(%rsp)
movq 0x68(%rsp), %rsi
movq 0x70(%rsp), %rdx
addq %rsi, %rdx
leaq 0x118(%rsp), %rdi
callq 0x32180
movq %rbx, %rdi
leaq 0x118(%rsp), %rsi
movl %r12d, %edx
callq 0x77b74
movq 0x118(%rsp), %rdi
leaq 0x128(%rsp), %rax
cmpq %rax, %rdi
je 0x793e6
movq 0x128(%rsp), %rsi
incq %rsi
callq 0x229c0
cmpl $0x3, 0x1614(%rbx)
jb 0x79453
movl $0x4, %edx
movq 0xfcb95(%rip), %rdi     # 0x175f90
leaq 0x85156(%rip), %rsi     # 0xfe558
callq 0x22ab0
movq 0xfcb82(%rip), %rdi     # 0x175f90
movq %r12, %rsi
callq 0x22650
movq %rax, %r14
movl $0x4, %edx
movq %rax, %rdi
leaq 0x85135(%rip), %rsi     # 0xfe55d
callq 0x22ab0
movq 0x68(%rsp), %rsi
movq 0x70(%rsp), %rdx
movq %r14, %rdi
callq 0x22ab0
movl $0x24, %edx
movq %rax, %rdi
leaq 0x85114(%rip), %rsi     # 0xfe562
callq 0x22ab0
movq 0x48(%rsp), %rdi
cmpq %rbp, %rdi
je 0x7946a
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x229c0
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x79481
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 0x79173
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x794c0
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x229c0
movq 0xd8(%rsp), %rdi
leaq 0xe8(%rsp), %rax
cmpq %rax, %rdi
je 0x794e5
movq 0xe8(%rsp), %rsi
incq %rsi
callq 0x229c0
leaq 0xb0(%rsp), %rdi
callq 0x31a9e
leaq 0x90(%rsp), %rdi
callq 0x31a9e
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 0x850b5(%rip), %rsi     # 0xfe5d9
leaq 0x850e0(%rip), %rdx     # 0xfe60b
leaq 0x178(%rsp), %rdi
callq 0x32210
leaq 0x178(%rsp), %rsi
movq %rbx, %rdi
callq 0x78b66
movq %rax, %rbx
movq 0x178(%rsp), %rdi
cmpq %r14, %rdi
je 0x796ca
movq 0x188(%rsp), %rsi
jmp 0x796c2
jmp 0x7962f
movq %rax, %rbx
movq 0x138(%rsp), %rdi
cmpq %r12, %rdi
je 0x79593
movq 0x148(%rsp), %rsi
incq %rsi
callq 0x229c0
jmp 0x79593
movq %rax, %rbx
movq 0x158(%rsp), %rdi
cmpq %r15, %rdi
je 0x796ca
movq 0x168(%rsp), %rsi
jmp 0x796c2
jmp 0x7962f
movq %rax, %rbx
jmp 0x7970b
jmp 0x7962f
jmp 0x795d1
jmp 0x795cc
jmp 0x7968f
jmp 0x7963e
jmp 0x7962f
jmp 0x79637
movq %rax, %rbx
jmp 0x79628
movq %rax, %rbx
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x79628
movq 0x10(%rsp), %rsi
jmp 0x79620
jmp 0x79680
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x31a9e
jmp 0x79683
movq %rax, %rbx
movq 0x118(%rsp), %rdi
leaq 0x128(%rsp), %rax
cmpq %rax, %rdi
je 0x79628
movq 0x128(%rsp), %rsi
incq %rsi
callq 0x229c0
leaq 0x58(%rsp), %rbp
jmp 0x79683
movq %rax, %rbx
jmp 0x796ca
movq %rax, %rbx
jmp 0x796ae
jmp 0x7968f
movq %rax, %rbx
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x79692
movq 0x10(%rsp), %rsi
jmp 0x79676
movq %rax, %rbx
movq 0xf8(%rsp), %rdi
leaq 0x108(%rsp), %rax
cmpq %rax, %rdi
je 0x79692
movq 0x108(%rsp), %rsi
incq %rsi
callq 0x229c0
jmp 0x79692
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %rbp, %rdi
jne 0x796a1
jmp 0x796ae
movq %rax, %rbx
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x796ae
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x229c0
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x796ca
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x229c0
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x796e6
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x229c0
movq 0xd8(%rsp), %rdi
leaq 0xe8(%rsp), %rax
cmpq %rax, %rdi
je 0x7970b
movq 0xe8(%rsp), %rsi
incq %rsi
callq 0x229c0
leaq 0xb0(%rsp), %rdi
callq 0x31a9e
leaq 0x90(%rsp), %rdi
callq 0x31a9e
movq %rbx, %rdi
callq 0x23240
nop