// File: /workspace/github_cpp_makefile_star2_O3/gabrielfelipeg[P]TravellingSalesman-GeneticAlgo/src/main.cpp
// Function: main
int main(int argc, char *argv[]){
    if(argc != 4){
        std::cout << "./run graphSize populationSize epochs" << std::endl;
        exit(0);
    }
    int graphSize = atoi(argv[1]);
    int populationSize = atoi(argv[2]);
    int epochs = atoi(argv[3]);
    srand(time(NULL));
    Population p;
    p.start(graphSize, populationSize);
    std::vector <long long> parcialResults;
    for(int i = 0; i < epochs; i++){
        if(i%100 == 0){
            parcialResults.emplace_back(p.currentBest);
        }
        p.nextGeneration();
    }
    parcialResults.emplace_back(p.currentBest);
    std::cout << "Epochs, bestAnswer, Size" << std::endl;
    for(int i = 1; i < parcialResults.size(); i++){
        std::cout << (i * 100) << ", " << parcialResults[i] << ", " << graphSize << std::endl;
    }
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
cmpl $0x4, %edi
jne 0x1632
movq %rsi, %r14
movq 0x8(%rsi), %rdi
callq 0x1180
movl %eax, %ebx
movq 0x10(%r14), %rdi
callq 0x1180
movl %eax, %r15d
movq 0x18(%r14), %rdi
callq 0x1180
movl %eax, %ebp
xorl %edi, %edi
callq 0x10e0
movl %eax, %edi
callq 0x10f0
leaq 0x18(%rsp), %r14
movq %r14, %rdi
callq 0x1c4c
movq %r14, %rdi
movl %ebx, %esi
movl %r15d, %edx
callq 0x1ca4
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movq $0x0, 0x10(%rsp)
xorl %r14d, %r14d
leaq 0x20(%rsp), %r15
testl %ebp, %ebp
jle 0x14e5
leaq 0x18(%rsp), %r13
xorl %r12d, %r12d
movl %r12d, %eax
imulq $0x51eb851f, %rax, %rax # imm = 0x51EB851F
shrq $0x25, %rax
imull $0x64, %eax, %eax
addl %r14d, %eax
jne 0x14b4
movq 0x8(%rsp), %rsi
cmpq 0x10(%rsp), %rsi
je 0x14a9
movq 0x20(%rsp), %rax
movq %rax, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x8(%rsp)
jmp 0x14b4
movq %rsp, %rdi
movq %r15, %rdx
callq 0x173a
movq %r13, %rdi
callq 0x2a90
incl %r12d
decl %r14d
decl %ebp
jne 0x1474
movq 0x8(%rsp), %r14
cmpq 0x10(%rsp), %r14
je 0x14e5
movq 0x20(%rsp), %rax
movq %rax, (%r14)
addq $0x8, %r14
movq %r14, 0x8(%rsp)
jmp 0x14f3
movq %rsp, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x173a
movq 0x6ade(%rip), %r14      # 0x7fd8
leaq 0x3b29(%rip), %rsi      # 0x502a
movl $0x18, %edx
movq %r14, %rdi
callq 0x1140
movq (%r14), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x1100
movsbl %al, %esi
movq 0x6aac(%rip), %rdi      # 0x7fd8
callq 0x1030
movq %rax, %rdi
callq 0x10b0
movq (%rsp), %rdi
movq 0x8(%rsp), %rax
subq %rdi, %rax
cmpq $0x9, %rax
jb 0x15fb
movl $0x1, %r13d
movl $0x64, %ebp
movq 0x6a77(%rip), %r14      # 0x7fd8
leaq 0x3adb(%rip), %r15      # 0x5043
movq %r14, %rdi
movl %ebp, %esi
callq 0x11b0
movq %rax, %r12
movl $0x2, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x1140
movq (%rsp), %rax
movq (%rax,%r13,8), %rsi
movq %r12, %rdi
callq 0x1070
movq %rax, %r12
movl $0x2, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x1140
movq %r12, %rdi
movl %ebx, %esi
callq 0x11b0
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x1100
movsbl %al, %esi
movq %r12, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x10b0
incq %r13
movq (%rsp), %rdi
movq 0x8(%rsp), %rax
subq %rdi, %rax
sarq $0x3, %rax
addl $0x64, %ebp
cmpq %r13, %rax
ja 0x1568
testq %rdi, %rdi
je 0x160d
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x1130
leaq 0x40(%rsp), %rdi
callq 0x1692
leaq 0x28(%rsp), %rdi
callq 0x16e6
xorl %eax, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x699f(%rip), %rdi      # 0x7fd8
leaq 0x39c4(%rip), %rsi      # 0x5004
callq 0x1110
movq %rax, %rdi
callq 0x1090
xorl %edi, %edi
callq 0x1150
movq %rax, %rbx
jmp 0x1676
jmp 0x165d
jmp 0x165d
movq %rax, %rbx
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x1676
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x1130
leaq 0x40(%rsp), %rdi
callq 0x1692
leaq 0x28(%rsp), %rdi
callq 0x16e6
movq %rbx, %rdi
callq 0x11c0