// File: /workspace/github_cpp_makefile_star2_O3/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 0x3524
movq 0x8(%rbx), %rax
cmpb $0x2d, (%rax)
jne 0x354b
cmpb $0x66, 0x1(%rax)
jne 0x3564
movl %edi, %ebp
movq 0x10(%rbx), %rax
movq %rax, 0x7da8(%rip)      # 0xb1a0
cmpl $0x3, %edi
je 0x34db
movl $0x3, %r15d
leaq 0x4cea(%rip), %r14      # 0x80f8
movslq %r15d, %r12
movq (%rbx,%r12,8), %rax
cmpb $0x2d, (%rax)
jne 0x34e4
movzbl 0x1(%rax), %eax
addl $-0x63, %eax
cmpl $0x10, %eax
ja 0x34e4
movslq (%r14,%rax,4), %rax
addq %r14, %rax
jmpq *%rax
leal 0x1(%r12), %r15d
movq 0x8(%rbx,%r12,8), %rdi
callq 0x21e0
movsd %xmm0, 0x7d32(%rip)     # 0xb180
jmp 0x34cf
leal 0x1(%r12), %r15d
movq 0x8(%rbx,%r12,8), %rax
movq %rax, 0x7d47(%rip)      # 0xb1a8
jmp 0x34cf
leal 0x1(%r12), %r15d
movq 0x8(%rbx,%r12,8), %rdi
callq 0x2240
cltq
movq %rax, 0x7cf5(%rip)      # 0xb170
jmp 0x34cf
leal 0x1(%r12), %r15d
movq 0x8(%rbx,%r12,8), %rdi
callq 0x2240
cltq
movq %rax, 0x7d1b(%rip)      # 0xb1b0
jmp 0x34cf
leal 0x1(%r12), %r15d
movq 0x8(%rbx,%r12,8), %rdi
callq 0x2240
cltq
movq %rax, 0x7cc9(%rip)      # 0xb178
jmp 0x34cf
movb $0x1, 0x7d00(%rip)      # 0xb1b8
jmp 0x34cf
leal 0x1(%r12), %r15d
movq 0x8(%rbx,%r12,8), %rdi
callq 0x2240
movl %eax, 0x7cb9(%rip)      # 0xb188
incl %r15d
cmpl %ebp, %r15d
jl 0x340e
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0x7aed(%rip), %rdi      # 0xafd8
leaq 0x4d10(%rip), %rsi      # 0x8202
callq 0x2170
movq (%rbx,%r12,8), %rsi
movq %rax, %rdi
callq 0x2170
leaq 0x4d03(%rip), %rsi      # 0x820d
movq %rax, %rdi
callq 0x2170
movq %rax, %rdi
callq 0x20a0
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x21d0
movq 0x7aad(%rip), %rdi      # 0xafd8
leaq 0x4cb2(%rip), %rsi      # 0x81e4
callq 0x2170
movq (%rbx), %rsi
movq %rax, %rdi
callq 0x2170
leaq 0x4ca3(%rip), %rsi      # 0x81ec
jmp 0x350a
movq 0x7a86(%rip), %rdi      # 0xafd8
leaq 0x4ca9(%rip), %rsi      # 0x8202
callq 0x2170
movq 0x8(%rbx), %rsi
jmp 0x34fb
movq 0x7a6d(%rip), %rdi      # 0xafd8
leaq 0x4ca8(%rip), %rsi      # 0x821a
callq 0x2170
movq 0x8(%rbx), %rsi
movq %rax, %rdi
callq 0x2170
leaq 0x4de7(%rip), %rsi      # 0x8371
jmp 0x350a
nop