// File: GAStudyGroup[P]GPX2/src/base/sources/Log.cpp
// Function: Log::printFooter(std::ostream&, Population&, unsigned int, unsigned int)
void Log::printFooter(ostream &out,Population &pop,unsigned gen,unsigned best){
    out << "\nTHE END\n";
    out << "First best fitness: " << best << "\n";
    out << "Last gen: " << gen << "\n";
    out << "Best fitness found: " << pop.bestFitness() << "\n";
    out << "Best know solution: "<< to_string(Config::BEST_FITNESS) << "\n";
    out << "=========================" << "\n";

    sort(pop.getPopulation().begin(),pop.getPopulation().end(),[](vector<int> &a, vector<int> &b) { return getFitness(a) < getFitness(b);});

    out << "\nLast population\n";
    for(vector<int> t : pop.getPopulation()){
        printTour(t,out);
        out<<"\n";
    }
    out.flush();
}

// Assembly:
subq $0xc8, %rsp
movq %rdi, 0xc0(%rsp)
movq %rsi, 0xb8(%rsp)
movl %edx, 0xb4(%rsp)
movl %ecx, 0xb0(%rsp)
movq 0xc0(%rsp), %rdi
leaq 0x5d7ee(%rip), %rsi     # 0x74542
callq 0x64a0
movq 0xc0(%rsp), %rdi
leaq 0x5d7e4(%rip), %rsi     # 0x7454c
callq 0x64a0
movq %rax, %rdi
movl 0xb0(%rsp), %esi
callq 0x6660
movq %rax, %rdi
leaq 0x5eac8(%rip), %rsi     # 0x7584e
movq %rsi, 0x18(%rsp)
callq 0x64a0
movq 0xc0(%rsp), %rdi
leaq 0x5d7c2(%rip), %rsi     # 0x74561
callq 0x64a0
movq %rax, %rdi
movl 0xb4(%rsp), %esi
callq 0x6660
movq 0x18(%rsp), %rsi
movq %rax, %rdi
callq 0x64a0
movq 0xc0(%rsp), %rdi
leaq 0x5d79d(%rip), %rsi     # 0x7456c
callq 0x64a0
movq %rax, 0x10(%rsp)
movq 0xb8(%rsp), %rdi
callq 0x19240
movq 0x10(%rsp), %rdi
movl %eax, %esi
callq 0x6820
movq 0x18(%rsp), %rsi
movq %rax, %rdi
callq 0x64a0
movq 0xc0(%rsp), %rdi
leaq 0x5d773(%rip), %rsi     # 0x74581
callq 0x64a0
movq %rax, 0x20(%rsp)
leaq 0x85be5(%rip), %rax     # 0x9ca04
movl (%rax), %esi
leaq 0x90(%rsp), %rdi
movq %rdi, 0x28(%rsp)
callq 0x188a0
movq 0x20(%rsp), %rdi
movq 0x28(%rsp), %rsi
callq 0x6440
movq %rax, 0x30(%rsp)
jmp 0x16e49
movq 0x30(%rsp), %rdi
leaq 0x5e9f9(%rip), %rsi     # 0x7584e
callq 0x64a0
jmp 0x16e5c
leaq 0x90(%rsp), %rdi
callq 0x6988
movq 0xc0(%rsp), %rdi
leaq 0x5d71e(%rip), %rsi     # 0x74596
callq 0x64a0
movq %rax, %rdi
leaq 0x5e9c7(%rip), %rsi     # 0x7584e
callq 0x64a0
movq 0xb8(%rsp), %rdi
callq 0x19230
movq %rax, %rdi
callq 0xfc20
movq %rax, 0x78(%rsp)
movq 0xb8(%rsp), %rdi
callq 0x19230
movq %rax, %rdi
callq 0xfc50
movq %rax, 0x70(%rsp)
movq 0x78(%rsp), %rdi
movq 0x70(%rsp), %rsi
callq 0x16ff0
movq 0xc0(%rsp), %rdi
leaq 0x5d6d2(%rip), %rsi     # 0x745b0
callq 0x64a0
movq 0xb8(%rsp), %rdi
callq 0x19230
movq %rax, 0x60(%rsp)
movq 0x60(%rsp), %rdi
callq 0xfc20
movq %rax, 0x58(%rsp)
movq 0x60(%rsp), %rdi
callq 0xfc50
movq %rax, 0x50(%rsp)
leaq 0x58(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0xfc80
testb $0x1, %al
jne 0x16f2b
jmp 0x16fca
leaq 0x58(%rsp), %rdi
callq 0xfcc0
movq %rax, %rsi
leaq 0x38(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0xfcd0
movq 0x8(%rsp), %rdi
movq 0xc0(%rsp), %rsi
callq 0x1b360
jmp 0x16f5b
movq 0xc0(%rsp), %rdi
leaq 0x5e8e4(%rip), %rsi     # 0x7584e
callq 0x64a0
jmp 0x16f71
leaq 0x38(%rsp), %rdi
callq 0x9af0
leaq 0x58(%rsp), %rdi
callq 0xfdd0
jmp 0x16f13
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x88(%rsp)
movl %eax, 0x84(%rsp)
leaq 0x90(%rsp), %rdi
callq 0x6988
jmp 0x16fdf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x88(%rsp)
movl %eax, 0x84(%rsp)
leaq 0x38(%rsp), %rdi
callq 0x9af0
jmp 0x16fdf
movq 0xc0(%rsp), %rdi
callq 0x6340
addq $0xc8, %rsp
retq
movq 0x88(%rsp), %rdi
callq 0x6850
nopl (%rax)