// File: /workspace/github_cpp_makefile_star2_O2/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 0x31ad
movq 0x8(%rbx), %rax
cmpb $0x2d, (%rax)
jne 0x31d4
cmpb $0x66, 0x1(%rax)
jne 0x31ed
movl %edi, %ebp
movq 0x10(%rbx), %rax
movq %rax, 0x80f3(%rip)      # 0xb188
pushq $0x3
popq %r14
leaq 0x4018(%rip), %r15      # 0x70b8
cmpl %ebp, %r14d
jge 0x3166
movslq %r14d, %r12
movq (%rbx,%r12,8), %rax
cmpb $0x2d, (%rax)
jne 0x316f
movzbl 0x1(%rax), %eax
addl $-0x63, %eax
cmpl $0x10, %eax
ja 0x316f
movslq (%r15,%rax,4), %rax
addq %r15, %rax
jmpq *%rax
incl %r14d
movq 0x8(%rbx,%r12,8), %rdi
callq 0x21b0
movsd %xmm0, 0x8081(%rip)     # 0xb168
jmp 0x315e
incl %r14d
movq 0x8(%rbx,%r12,8), %rax
movq %rax, 0x8098(%rip)      # 0xb190
jmp 0x315e
incl %r14d
movq 0x8(%rbx,%r12,8), %rdi
callq 0x2210
cltq
movq %rax, 0x8048(%rip)      # 0xb158
jmp 0x315e
incl %r14d
movq 0x8(%rbx,%r12,8), %rdi
callq 0x2210
cltq
movq %rax, 0x8070(%rip)      # 0xb198
jmp 0x315e
incl %r14d
movq 0x8(%rbx,%r12,8), %rdi
callq 0x2210
cltq
movq %rax, 0x8020(%rip)      # 0xb160
jmp 0x315e
movb $0x1, 0x8057(%rip)      # 0xb1a0
jmp 0x315e
incl %r14d
movq 0x8(%rbx,%r12,8), %rdi
callq 0x2210
movl %eax, 0x8012(%rip)      # 0xb170
incl %r14d
jmp 0x30a0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0x7e62(%rip), %rdi      # 0xafd8
leaq 0x4045(%rip), %rsi      # 0x71c2
callq 0x2150
movq (%rbx,%r12,8), %rsi
movq %rax, %rdi
callq 0x2150
leaq 0x4038(%rip), %rsi      # 0x71cd
movq %rax, %rdi
callq 0x2150
movq %rax, %rdi
callq 0x20a0
pushq $-0x1
popq %rdi
callq 0x21a0
movq 0x7e24(%rip), %rdi      # 0xafd8
leaq 0x3fe9(%rip), %rsi      # 0x71a4
callq 0x2150
movq (%rbx), %rsi
movq %rax, %rdi
callq 0x2150
leaq 0x3fda(%rip), %rsi      # 0x71ac
jmp 0x3195
movq 0x7dfd(%rip), %rdi      # 0xafd8
leaq 0x3fe0(%rip), %rsi      # 0x71c2
callq 0x2150
movq 0x8(%rbx), %rsi
jmp 0x3186
movq 0x7de4(%rip), %rdi      # 0xafd8
leaq 0x3fdf(%rip), %rsi      # 0x71da
callq 0x2150
movq 0x8(%rbx), %rsi
movq %rax, %rdi
callq 0x2150
leaq 0x4116(%rip), %rsi      # 0x7329
jmp 0x3195
nop