// File: /workspace/github_cpp_makefile_star2_O3/cssartori[P]ga-qap/src/main.cpp
// Function: main
int main(int argc, char **argv){
	/*Read input parameters*/
	read_parameter(argc, argv);

	DataFile data;
	if(data.read(input_file) == -1){
		printf("Error opening file \'%s\'.\n", input_file);
		return -1;
	}

	if(pop_size == 0) pop_size = data.n*0.1;

	if(seed == -1) seed = time(NULL);

	Timer t;
	t.start();

	//create and run GA
	GeneticAlgorithm ga(data, pop_size, max_iterations, tournament_size, cross_p, seed, prints);
	Solution best = ga.run();

	t.stop();
	
	if(prints){
		printf("Initial Solution = %i\n", ga.get_initial_solution().fitness());
		printf("Best Solution Found = %i \n", best.fitness());
		printf("Iterations = %li \n", ga.get_iter_best());
		printf("Time = %.2f \n", t.elapsed_seconds());
	}
	
	if(output_file != NULL){
		if(data.write_solution(output_file, best) < 0){
			printf("Failed to save solution to \'%s\'.\n", output_file);
			return -1;
		}
		if(prints)
			printf("Solution saved to \'%s\'.\n", output_file);
	}
	
	if(prints)
		printf("Success!\n");

	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
callq 0x33c0
leaq 0x58(%rsp), %rdi
callq 0x250c
movq 0x818c(%rip), %rsi      # 0xb1a0
leaq 0x90(%rsp), %rdi
leaq 0x38(%rsp), %rdx
callq 0x3590
leaq 0x58(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0x251c
movl %eax, %ebx
leaq 0xa0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x305b
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x21a0
cmpl $-0x1, %ebx
je 0x3268
cmpq $0x0, 0x8144(%rip)      # 0xb1b0
jne 0x30c0
movsd 0x88(%rsp), %xmm0
unpcklps 0x5042(%rip), %xmm0     # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x504a(%rip), %xmm0     # 0x80d0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
mulsd 0x5046(%rip), %xmm1     # 0x80e0
cvttsd2si %xmm1, %rax
movq %rax, %rcx
subsd 0x503e(%rip), %xmm1     # 0x80e8
cvttsd2si %xmm1, %rdx
sarq $0x3f, %rcx
andq %rcx, %rdx
orq %rax, %rdx
movq %rdx, 0x80f0(%rip)      # 0xb1b0
cmpl $-0x1, 0x80c1(%rip)     # 0xb188
jne 0x30d6
xorl %edi, %edi
callq 0x2150
movl %eax, 0x80b2(%rip)      # 0xb188
callq 0x2050
movq %rax, %rbx
movq 0x80cb(%rip), %rdx      # 0xb1b0
movq 0x8084(%rip), %rcx      # 0xb170
movq 0x8085(%rip), %r8       # 0xb178
movsd 0x8085(%rip), %xmm0     # 0xb180
movslq 0x8086(%rip), %r9       # 0xb188
movzbl 0x80af(%rip), %eax      # 0xb1b8
movl %eax, (%rsp)
leaq 0x90(%rsp), %rdi
leaq 0x58(%rsp), %rsi
callq 0x4f10
leaq 0x38(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0x4fdc
callq 0x2050
cmpb $0x1, 0x807c(%rip)      # 0xb1b8
jne 0x31e1
movq %rax, %r14
leaq 0x18(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0x65d0
leaq 0x18(%rsp), %rdi
callq 0x3746
leaq 0x4fee(%rip), %rdi      # 0x8156
movl %eax, %esi
xorl %eax, %eax
callq 0x2040
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x3188
movq 0x28(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
leaq 0x38(%rsp), %rdi
callq 0x3746
leaq 0x4fd4(%rip), %rdi      # 0x816d
movl %eax, %esi
xorl %eax, %eax
callq 0x2040
leaq 0x90(%rsp), %rdi
callq 0x661c
leaq 0x4fd2(%rip), %rdi      # 0x8188
movq %rax, %rsi
xorl %eax, %eax
callq 0x2040
subq %rbx, %r14
xorps %xmm0, %xmm0
cvtsi2sd %r14, %xmm0
divsd 0x4f1d(%rip), %xmm0     # 0x80f0
leaq 0x4fc1(%rip), %rdi      # 0x819b
movb $0x1, %al
callq 0x2040
movq 0x7fc0(%rip), %rsi      # 0xb1a8
testq %rsi, %rsi
je 0x324f
leaq 0x18(%rsp), %rdi
leaq 0x17(%rsp), %rdx
callq 0x3590
leaq 0x58(%rsp), %rdi
leaq 0x18(%rsp), %rsi
leaq 0x38(%rsp), %rdx
callq 0x2714
movl %eax, %ebx
leaq 0x28(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x322d
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x21a0
testl %ebx, %ebx
js 0x3284
cmpb $0x1, 0x7f80(%rip)      # 0xb1b8
jne 0x324f
movq 0x7f67(%rip), %rsi      # 0xb1a8
leaq 0x4f83(%rip), %rdi      # 0x81cb
xorl %eax, %eax
callq 0x2040
xorl %ebx, %ebx
cmpb $0x1, 0x7f60(%rip)      # 0xb1b8
jne 0x329e
leaq 0x5019(%rip), %rdi      # 0x827a
callq 0x2230
jmp 0x329e
movq 0x7f31(%rip), %rsi      # 0xb1a0
leaq 0x4ec6(%rip), %rdi      # 0x813c
xorl %eax, %eax
callq 0x2040
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jmp 0x32ef
movq 0x7f1d(%rip), %rsi      # 0xb1a8
leaq 0x4f17(%rip), %rdi      # 0x81a9
xorl %eax, %eax
callq 0x2040
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x32b5
movq 0x48(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
movq 0xe8(%rsp), %rdi
testq %rdi, %rdi
je 0x32d2
movq 0xf8(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
movq 0xc8(%rsp), %rdi
testq %rdi, %rdi
je 0x32ef
movq 0xd8(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
leaq 0x70(%rsp), %rdi
callq 0x2d26
leaq 0x58(%rsp), %rdi
callq 0x2d26
movl %ebx, %eax
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r14
retq
movq %rax, %rbx
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x334e
movq 0x28(%rsp), %rsi
subq %rdi, %rsi
jmp 0x3342
jmp 0x334b
movq %rax, %rbx
leaq 0x28(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x334e
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x21a0
jmp 0x334e
jmp 0x334b
movq %rax, %rbx
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x336a
movq 0x48(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
jmp 0x336a
movq %rax, %rbx
leaq 0x90(%rsp), %rdi
callq 0x35ce
jmp 0x33a4
jmp 0x33a1
movq %rax, %rbx
leaq 0xa0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x33a4
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x21a0
jmp 0x33a4
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
callq 0x2d26
leaq 0x58(%rsp), %rdi
callq 0x2d26
movq %rbx, %rdi
callq 0x2280