// File: /workspace/github_cpp_makefile_star2_O1/cssartori[P]ga-qap/src/main.cpp
// Function: read_parameter(int, char**)
void read_parameter(int argc, char **argv){

	if(argc < 3){
		cout << "Usage:\n" << argv[0] << " -f [input file path]" << endl;
		exit(-1);
	}

	int i=1;
	if(argv[i][0] != '-'){
		cout << "Parameter " << argv[i] << "not defined." << endl;
		exit(-1);
	}else if(argv[i][1] != 'f'){
		cout << "Expected first parameter -f [input file path], found " << argv[i] << "." << endl;
		exit(-1);
	}

	i++;
	input_file = argv[i]; //input file path

	for(i=3;i<argc;i++){
		if(argv[i][0] == '-'){
			switch(argv[i][1]){
				case 'p'://population size
					i++;
					pop_size = atoi(argv[i]);
					break;
				case 's'://random seed
					i++;
					seed = atoi(argv[i]);
					break;
				case 'i'://max iterations
					i++;
					max_iterations = atoi(argv[i]);
					break;
				case 'c'://crossover probability
					i++;
					cross_p = atof(argv[i]);
					break;
				case 'k'://tournament size
					i++;
					tournament_size = atoi(argv[i]);
					break;
				case 'o'://output file path
					i++;
					output_file = argv[i];
					break;
				case 'm'://print out allowed
					prints = true;
					break;
				default:
					cout << "Parameter " << argv[i] << "not defined." << endl;
					exit(-1);
			}
		}else{
			cout << "Parameter " << argv[i] << "not defined." << endl;
			exit(-1);
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
cmpl $0x2, %edi
jle 0x33f8
movq 0x8(%rbx), %rax
cmpb $0x2d, (%rax)
jne 0x341f
cmpb $0x66, 0x1(%rax)
jne 0x3438
movl %edi, %ebp
movq 0x10(%rbx), %rax
movq %rax, 0x6ed4(%rip)      # 0xa1a0
cmpl $0x3, %edi
je 0x33af
movl $0x3, %r15d
leaq 0x3dd6(%rip), %r14      # 0x70b8
movslq %r15d, %r12
movq (%rbx,%r12,8), %rax
cmpb $0x2d, (%rax)
jne 0x33b8
movzbl 0x1(%rax), %eax
addl $-0x63, %eax
cmpl $0x10, %eax
ja 0x33b8
movslq (%r14,%rax,4), %rax
addq %r14, %rax
jmpq *%rax
leal 0x1(%r12), %r15d
movq 0x8(%rbx,%r12,8), %rdi
callq 0x21e0
movsd %xmm0, 0x6e5e(%rip)     # 0xa180
jmp 0x33a3
leal 0x1(%r12), %r15d
movq 0x8(%rbx,%r12,8), %rax
movq %rax, 0x6e73(%rip)      # 0xa1a8
jmp 0x33a3
leal 0x1(%r12), %r15d
movq 0x8(%rbx,%r12,8), %rdi
callq 0x2240
cltq
movq %rax, 0x6e21(%rip)      # 0xa170
jmp 0x33a3
leal 0x1(%r12), %r15d
movq 0x8(%rbx,%r12,8), %rdi
callq 0x2240
cltq
movq %rax, 0x6e47(%rip)      # 0xa1b0
jmp 0x33a3
leal 0x1(%r12), %r15d
movq 0x8(%rbx,%r12,8), %rdi
callq 0x2240
cltq
movq %rax, 0x6df5(%rip)      # 0xa178
jmp 0x33a3
movb $0x1, 0x6e2c(%rip)      # 0xa1b8
jmp 0x33a3
leal 0x1(%r12), %r15d
movq 0x8(%rbx,%r12,8), %rdi
callq 0x2240
movl %eax, 0x6de5(%rip)      # 0xa188
incl %r15d
cmpl %ebp, %r15d
jl 0x32e2
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0x6c19(%rip), %rdi      # 0x9fd8
leaq 0x3dfc(%rip), %rsi      # 0x71c2
callq 0x2170
movq (%rbx,%r12,8), %rsi
movq %rax, %rdi
callq 0x2170
leaq 0x3def(%rip), %rsi      # 0x71cd
movq %rax, %rdi
callq 0x2170
movq %rax, %rdi
callq 0x20a0
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x21d0
movq 0x6bd9(%rip), %rdi      # 0x9fd8
leaq 0x3d9e(%rip), %rsi      # 0x71a4
callq 0x2170
movq (%rbx), %rsi
movq %rax, %rdi
callq 0x2170
leaq 0x3d8f(%rip), %rsi      # 0x71ac
jmp 0x33de
movq 0x6bb2(%rip), %rdi      # 0x9fd8
leaq 0x3d95(%rip), %rsi      # 0x71c2
callq 0x2170
movq 0x8(%rbx), %rsi
jmp 0x33cf
movq 0x6b99(%rip), %rdi      # 0x9fd8
leaq 0x3d94(%rip), %rsi      # 0x71da
callq 0x2170
movq 0x8(%rbx), %rsi
movq %rax, %rdi
callq 0x2170
leaq 0x3ed3(%rip), %rsi      # 0x7331
jmp 0x33de
nop