// File: /workspace/github_cpp_makefile_star2_O1/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 0x3294
leaq 0x58(%rsp), %rdi
callq 0x24dc
movq 0x72b8(%rip), %rsi      # 0xa1a0
leaq 0x90(%rsp), %rdi
leaq 0x38(%rsp), %rdx
callq 0x3464
leaq 0x58(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0x24ec
movl %eax, %ebx
leaq 0xa0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2f2f
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x21a0
cmpl $-0x1, %ebx
je 0x313c
cmpq $0x0, 0x7270(%rip)      # 0xa1b0
jne 0x2f94
movsd 0x88(%rsp), %xmm0
unpcklps 0x412e(%rip), %xmm0     # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x4136(%rip), %xmm0     # 0x7090
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
mulsd 0x4132(%rip), %xmm1     # 0x70a0
cvttsd2si %xmm1, %rax
movq %rax, %rcx
subsd 0x412a(%rip), %xmm1     # 0x70a8
cvttsd2si %xmm1, %rdx
sarq $0x3f, %rcx
andq %rcx, %rdx
orq %rax, %rdx
movq %rdx, 0x721c(%rip)      # 0xa1b0
cmpl $-0x1, 0x71ed(%rip)     # 0xa188
jne 0x2faa
xorl %edi, %edi
callq 0x2150
movl %eax, 0x71de(%rip)      # 0xa188
callq 0x2050
movq %rax, %rbx
movq 0x71f7(%rip), %rdx      # 0xa1b0
movq 0x71b0(%rip), %rcx      # 0xa170
movq 0x71b1(%rip), %r8       # 0xa178
movsd 0x71b1(%rip), %xmm0     # 0xa180
movslq 0x71b2(%rip), %r9       # 0xa188
movzbl 0x71db(%rip), %eax      # 0xa1b8
movl %eax, (%rsp)
leaq 0x90(%rsp), %rdi
leaq 0x58(%rsp), %rsi
callq 0x4b98
leaq 0x38(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0x4c64
callq 0x2050
cmpb $0x1, 0x71a8(%rip)      # 0xa1b8
jne 0x30b5
movq %rax, %r14
leaq 0x18(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0x6244
leaq 0x18(%rsp), %rdi
callq 0x3612
leaq 0x40da(%rip), %rdi      # 0x7116
movl %eax, %esi
xorl %eax, %eax
callq 0x2040
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x305c
movq 0x28(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
leaq 0x38(%rsp), %rdi
callq 0x3612
leaq 0x40c0(%rip), %rdi      # 0x712d
movl %eax, %esi
xorl %eax, %eax
callq 0x2040
leaq 0x90(%rsp), %rdi
callq 0x6290
leaq 0x40be(%rip), %rdi      # 0x7148
movq %rax, %rsi
xorl %eax, %eax
callq 0x2040
subq %rbx, %r14
xorps %xmm0, %xmm0
cvtsi2sd %r14, %xmm0
divsd 0x4009(%rip), %xmm0     # 0x70b0
leaq 0x40ad(%rip), %rdi      # 0x715b
movb $0x1, %al
callq 0x2040
movq 0x70ec(%rip), %rsi      # 0xa1a8
testq %rsi, %rsi
je 0x3123
leaq 0x18(%rsp), %rdi
leaq 0x17(%rsp), %rdx
callq 0x3464
leaq 0x58(%rsp), %rdi
leaq 0x18(%rsp), %rsi
leaq 0x38(%rsp), %rdx
callq 0x26ea
movl %eax, %ebx
leaq 0x28(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3101
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x21a0
testl %ebx, %ebx
js 0x3158
cmpb $0x1, 0x70ac(%rip)      # 0xa1b8
jne 0x3123
movq 0x7093(%rip), %rsi      # 0xa1a8
leaq 0x406f(%rip), %rdi      # 0x718b
xorl %eax, %eax
callq 0x2040
xorl %ebx, %ebx
cmpb $0x1, 0x708c(%rip)      # 0xa1b8
jne 0x3172
leaq 0x4105(%rip), %rdi      # 0x723a
callq 0x2230
jmp 0x3172
movq 0x705d(%rip), %rsi      # 0xa1a0
leaq 0x3fb2(%rip), %rdi      # 0x70fc
xorl %eax, %eax
callq 0x2040
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jmp 0x31c3
movq 0x7049(%rip), %rsi      # 0xa1a8
leaq 0x4003(%rip), %rdi      # 0x7169
xorl %eax, %eax
callq 0x2040
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x3189
movq 0x48(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
movq 0xe8(%rsp), %rdi
testq %rdi, %rdi
je 0x31a6
movq 0xf8(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
movq 0xc8(%rsp), %rdi
testq %rdi, %rdi
je 0x31c3
movq 0xd8(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
leaq 0x70(%rsp), %rdi
callq 0x2c0c
leaq 0x58(%rsp), %rdi
callq 0x2c0c
movl %ebx, %eax
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r14
retq
movq %rax, %rbx
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x3222
movq 0x28(%rsp), %rsi
subq %rdi, %rsi
jmp 0x3216
jmp 0x321f
movq %rax, %rbx
leaq 0x28(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3222
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x21a0
jmp 0x3222
jmp 0x321f
movq %rax, %rbx
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x323e
movq 0x48(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
jmp 0x323e
movq %rax, %rbx
leaq 0x90(%rsp), %rdi
callq 0x34a2
jmp 0x3278
jmp 0x3275
movq %rax, %rbx
leaq 0xa0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3278
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x21a0
jmp 0x3278
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
callq 0x2c0c
leaq 0x58(%rsp), %rdi
callq 0x2c0c
movq %rbx, %rdi
callq 0x2280