// File: /workspace/github_cpp_makefile_star2_O2/richardposner[P]BioNetFit2/src/code/Utils.cpp
// Function: readCommandLine(int, char const**, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>>>>&)
int readCommandLine(int argc, const char *argv[], map<string,vector<string> > &cmdLine){  //razi added
	int i, j=0; string sw; string temp;
	string s;
	for (i=1; i<argc; i++){
		s=argv[i];
		//cout<<"reading command line str["<<i<<"] = "<<s<<endl;
		if (s.substr(0,1).compare("-")==0){  //a new switch is found
			sw=s.substr(1,s.size()-1);
			if (sw.empty()){
				cout<<"Invalid switch:"<< s  <<"  value not specified, quitting .... "<<endl;
				return 0;
			}else{ //now read the options
				//cout<<"switch found:-"<<sw<<endl;

				vector<string> options; options.clear();
				j=1; bool exitflag=false;
				while(!exitflag){
					if ((i+j) < argc){
						temp = argv[i+j];
						//cout<<"checking options["<<j<<"]=" << temp << endl;
						if  (temp.substr(0,1).compare("-")==0){
							//cout<<"This is not an option, it is a new switch, i set to:"<<i+j<< endl;
							i=i+j-1;  //move the pointer to the new switch
							exitflag=true;
						}
						else{  //a valid option
							//cout<<"Option found: "<<argv[i+j]<<"   added to the list of options"<<endl;
							options.push_back(argv[i+j]);
							j++;  //collect other options
						}
					}else{
						//cout<<"Command line reading finished, reached the end while reading the options i+j:"<<i+j<<endl;
						i=i+j-1;  //move the pointer to the new switch
						exitflag=true;
					}
				}
				//if (options.size()>0), cout<<"# "<<options.size() <<"Options were found and added to the list"<<endl;
				cmdLine[sw]=options;
			}
		}else{
			cout<<"invalid format for switch:"<<s<<" Expecting to start with -, quitting .... "<<endl;
			return 0;
		}
	}
	return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movq %rdx, 0x18(%rsp)
movq %rsi, %r15
movl %edi, 0xc(%rsp)
leaq 0x50(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
leaq 0x88(%rsp), %rcx
movq %rcx, -0x10(%rcx)
andq $0x0, -0x8(%rcx)
xorl %edx, %edx
movb %dl, (%rax)
movb %dl, (%rcx)
leaq 0x30(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb %dl, (%rax)
pushq $0x1
popq %rbp
leaq 0x20(%rsp), %r12
leaq 0x98(%rsp), %r13
leaq 0x60(%rsp), %r14
movl %ebp, %eax
cmpl 0xc(%rsp), %eax
jge 0x9f25c
movq %rax, 0x10(%rsp)
cltq
movq (%r15,%rax,8), %rsi
movq %r12, %rdi
callq 0x29490
movq %r14, %rbx
movq %r13, %rdi
movq %r12, %rsi
xorl %edx, %edx
pushq $0x1
popq %rcx
callq 0x28a90
movq %r13, %rdi
leaq 0x407b4(%rip), %rsi     # 0xdf86a
callq 0x282a0
movl %eax, %r14d
movq %r13, %rdi
callq 0x295a0
testl %r14d, %r14d
jne 0x9f1fa
movq 0x28(%rsp), %rcx
decq %rcx
movq %r13, %rdi
movq %r12, %rsi
pushq $0x1
popq %rdx
callq 0x28a90
leaq 0x40(%rsp), %rdi
movq %r13, %rsi
callq 0x28c40
movq %r13, %rdi
callq 0x295a0
cmpq $0x0, 0x48(%rsp)
je 0x9f223
movq %rbx, %r14
xorps %xmm0, %xmm0
movaps %xmm0, 0x60(%rsp)
andq $0x0, 0x70(%rsp)
movq %rbx, %rdi
callq 0x3376e
xorl %eax, %eax
movl %ebp, %r12d
movq 0x10(%rsp), %rcx
movq %rcx, 0x10(%rsp)
addl %r12d, %ecx
movslq %ecx, %rbp
testb $0x1, %al
jne 0x9f1c4
cmpl 0xc(%rsp), %ebp
jge 0x9f1b3
movq (%r15,%rbp,8), %rsi
leaq 0x78(%rsp), %r14
movq %r14, %rdi
callq 0x29490
movq %r13, %rdi
movq %r14, %rsi
xorl %edx, %edx
pushq $0x1
popq %rcx
callq 0x28a90
movq %r13, %rdi
leaq 0x406fd(%rip), %rsi     # 0xdf86a
callq 0x282a0
movl %eax, %r14d
movq %r13, %rdi
callq 0x295a0
testl %r14d, %r14d
movq %rbx, %r14
je 0x9f1b3
movq (%r15,%rbp,8), %rsi
movq %r13, %rdi
leaq 0xb(%rsp), %rdx
callq 0x33402
movq %r14, %rdi
movq %r13, %rsi
callq 0x5ec8c
movq %r13, %rdi
callq 0x295a0
incl %r12d
incq %rbp
xorl %eax, %eax
jmp 0x9f134
movq 0x10(%rsp), %rcx
addl %r12d, %ecx
decl %ecx
movb $0x1, %al
jmp 0x9f129
movq 0x18(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0x9f640
movq %rax, %rdi
movq %r14, %rsi
callq 0x3386c
movq %r14, %rdi
callq 0x3355a
movq 0x10(%rsp), %rax
incl %eax
pushq $0x1
popq %rbp
leaq 0x20(%rsp), %r12
jmp 0x9f07c
movq 0xc6d97(%rip), %rdi     # 0x165f98
leaq 0x6118d(%rip), %rsi     # 0x100395
callq 0x289f0
leaq 0x20(%rsp), %rsi
movq %rax, %rdi
callq 0x28910
leaq 0x6118f(%rip), %rsi     # 0x1003b0
jmp 0x9f24a
movq 0xc6d6e(%rip), %rdi     # 0x165f98
leaq 0x6112e(%rip), %rsi     # 0x10035f
callq 0x289f0
leaq 0x20(%rsp), %rsi
movq %rax, %rdi
callq 0x28910
leaq 0x61125(%rip), %rsi     # 0x10036f
movq %rax, %rdi
callq 0x289f0
xorl %ebp, %ebp
movq %rax, %rdi
callq 0x284a0
leaq 0x20(%rsp), %rdi
callq 0x295a0
leaq 0x78(%rsp), %rdi
callq 0x295a0
leaq 0x40(%rsp), %rdi
callq 0x295a0
movl %ebp, %eax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x9f294
jmp 0x9f294
jmp 0x9f294
movq %rax, %rbx
jmp 0x9f2be
jmp 0x9f2b1
jmp 0x9f2b1
movq %rax, %rbx
leaq 0x98(%rsp), %rdi
callq 0x295a0
jmp 0x9f2b4
jmp 0x9f2b1
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x3355a
leaq 0x20(%rsp), %rdi
callq 0x295a0
leaq 0x78(%rsp), %rdi
callq 0x295a0
leaq 0x40(%rsp), %rdi
callq 0x295a0
movq %rbx, %rdi
callq 0x292f0