// File: /workspace/github_cpp_makefile_star2_O3/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, 0x98(%rsp)
movq %rsi, 0x90(%rsp)
leaq 0x40(%rsp), %r15
movq %r15, -0x10(%r15)
xorl %eax, %eax
movq %rax, -0x8(%r15)
movb %al, (%r15)
leaq 0x80(%rsp), %r12
movq %r12, -0x10(%r12)
movq %rax, -0x8(%r12)
movb %al, (%r12)
leaq 0x20(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
movl $0x1, %ebx
movl %edi, 0x8(%rsp)
cmpl $0x2, %edi
jl 0xbf58d
leaq 0x10(%rsp), %rbp
leaq 0x30(%rsp), %r14
movslq %ebx, %rax
movq 0x90(%rsp), %rcx
movq (%rcx,%rax,8), %r13
movq 0x18(%rsp), %r15
movq %r13, %rdi
callq 0x223a0
movq %rbp, %rdi
xorl %esi, %esi
movq %r15, %rdx
movq %r13, %rcx
movq %rax, %r8
callq 0x22fb0
movl $0x1, %ecx
leaq 0x50(%rsp), %r15
movq %r15, %rdi
movq %rbp, %rsi
xorl %edx, %edx
callq 0x22a00
movq %r15, %rdi
leaq 0x42397(%rip), %rsi     # 0x101681
callq 0x22250
movl %eax, %r13d
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0xbf30e
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x229c0
testl %r13d, %r13d
jne 0xbf4aa
movq 0x18(%rsp), %rcx
decq %rcx
movl $0x1, %edx
movq %r15, %rdi
movq %rbp, %rsi
callq 0x22a00
movq %r14, %rdi
movq %r15, %rsi
callq 0x22bb0
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0xbf356
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x229c0
cmpq $0x0, 0x38(%rsp)
je 0xbf512
xorps %xmm0, %xmm0
movaps %xmm0, 0xa0(%rsp)
movq $0x0, 0xb0(%rsp)
incl %ebx
cmpl 0x8(%rsp), %ebx
jge 0xbf459
movq %rbp, %r14
movl %ebx, %ebp
movq 0x90(%rsp), %rax
movq (%rax,%rbp,8), %r15
movq 0x78(%rsp), %r13
movq %r15, %rdi
callq 0x223a0
leaq 0x70(%rsp), %r12
movq %r12, %rdi
xorl %esi, %esi
movq %r13, %rdx
movq %r15, %rcx
movq %rax, %r8
callq 0x22fb0
movl $0x1, %ecx
leaq 0x50(%rsp), %r15
movq %r15, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x22a00
movq %r15, %rdi
leaq 0x422a5(%rip), %rsi     # 0x101681
callq 0x22250
movl %eax, %r13d
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0xbf400
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x229c0
testl %r13d, %r13d
je 0xbf456
movq 0x90(%rsp), %rax
movq (%rax,%rbp,8), %rsi
movq %r15, %rdi
leaq 0xf(%rsp), %rdx
callq 0x319cc
leaq 0xa0(%rsp), %rdi
movq %r15, %rsi
callq 0x6a2a2
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
movq %r14, %rbp
je 0xbf379
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x229c0
jmp 0xbf379
movq %r14, %rbp
movq 0x98(%rsp), %rdi
leaq 0x30(%rsp), %r14
movq %r14, %rsi
callq 0xbfb90
leaq 0xa0(%rsp), %r15
movq %rax, %rdi
movq %r15, %rsi
callq 0x31dd2
movq %r15, %rdi
callq 0x31a0a
cmpl 0x8(%rsp), %ebx
jl 0xbf29a
movl $0x1, %ebx
leaq 0x40(%rsp), %r15
leaq 0x80(%rsp), %r12
jmp 0xbf58d
movq 0xb6af7(%rip), %rdi     # 0x175fa8
leaq 0x629ed(%rip), %rsi     # 0x121ea5
movl $0x1a, %edx
leaq 0x40(%rsp), %r15
leaq 0x80(%rsp), %r12
callq 0x22ab0
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq 0xb6ac8(%rip), %rdi     # 0x175fa8
callq 0x22ab0
movq %rax, %rbx
leaq 0x629d1(%rip), %rsi     # 0x121ec0
movl $0x2a, %edx
movq %rax, %rdi
callq 0x22ab0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x22940
jmp 0xbf578
movq 0xb6a8f(%rip), %rdi     # 0x175fa8
leaq 0x6294f(%rip), %rsi     # 0x121e6f
movl $0xf, %edx
leaq 0x40(%rsp), %r15
leaq 0x80(%rsp), %r12
callq 0x22ab0
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq 0xb6a60(%rip), %rdi     # 0x175fa8
callq 0x22ab0
movq %rax, %rbx
leaq 0x62928(%rip), %rsi     # 0x121e7f
movl $0x25, %edx
movq %rax, %rdi
callq 0x22ab0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x22940
movsbl %al, %esi
movq %rbx, %rdi
callq 0x22050
xorl %ebx, %ebx
movq %rax, %rdi
callq 0x22660
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0xbf5a9
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x229c0
movq 0x70(%rsp), %rdi
cmpq %r12, %rdi
je 0xbf5c3
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x229c0
movq 0x30(%rsp), %rdi
cmpq %r15, %rdi
je 0xbf5da
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x229c0
movl %ebx, %eax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
jmp 0xbf607
jmp 0xbf5f7
jmp 0xbf5f7
movq %rax, %r14
leaq 0x40(%rsp), %r15
leaq 0x80(%rsp), %r12
leaq 0x20(%rsp), %rbx
jmp 0xbf657
jmp 0xbf635
movq %rax, %r14
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0xbf638
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x229c0
jmp 0xbf638
jmp 0xbf635
jmp 0xbf635
movq %rax, %r14
leaq 0x40(%rsp), %r15
leaq 0x80(%rsp), %r12
leaq 0x20(%rsp), %rbx
leaq 0xa0(%rsp), %rdi
callq 0x31a0a
movq 0x10(%rsp), %rdi
cmpq %rbx, %rdi
je 0xbf66e
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x229c0
movq 0x70(%rsp), %rdi
cmpq %r12, %rdi
je 0xbf688
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x229c0
movq 0x30(%rsp), %rdi
cmpq %r15, %rdi
je 0xbf69f
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x229c0
movq %r14, %rdi
callq 0x23240