// File: /workspace/github_cpp_makefile_star2_O3/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %ecx, %r15d
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x2396f(%rip), %rsi     # 0x3158a
movl $0x9, %edx
callq 0x5430
leaq 0x23968(%rip), %rsi     # 0x31594
movl $0x14, %edx
movq %rbx, %rdi
callq 0x5430
movl %r15d, %esi
movq %rbx, %rdi
callq 0x5280
leaq 0x24bb8(%rip), %r15     # 0x32803
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x5430
leaq 0x23947(%rip), %rsi     # 0x315a9
movl $0xa, %edx
movq %rbx, %rdi
callq 0x5430
movl %ebp, %esi
movq %rbx, %rdi
callq 0x5280
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x5430
leaq 0x23924(%rip), %rsi     # 0x315b4
movl $0x14, %edx
movq %rbx, %rdi
callq 0x5430
movq %r14, %rdi
callq 0xeac0
movq %rbx, %rdi
movl %eax, %esi
callq 0x5630
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x5430
leaq 0x23903(%rip), %rsi     # 0x315c9
movl $0x14, %edx
movq %rbx, %rdi
callq 0x5430
leaq 0x34bfa(%rip), %rax     # 0x428d4
movl (%rax), %ebp
movl $0x1, %eax
cmpl $0xa, %ebp
jb 0xdd2a
movl $0x4, %eax
movl $0xd1b71759, %ecx       # imm = 0xD1B71759
movl %ebp, %edx
cmpl $0x63, %edx
jbe 0xdd23
cmpl $0x3e7, %edx            # imm = 0x3E7
jbe 0xdd28
cmpl $0x2710, %edx           # imm = 0x2710
jb 0xdd2a
movl %edx, %esi
imulq %rcx, %rsi
shrq $0x2d, %rsi
addl $0x4, %eax
cmpl $0x1869f, %edx          # imm = 0x1869F
movl %esi, %edx
ja 0xdcf2
addl $-0x3, %eax
jmp 0xdd2a
addl $-0x2, %eax
jmp 0xdd2a
decl %eax
movl %eax, %esi
leaq 0x18(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x8(%rsp), %r15
movq %r15, %rdi
xorl %edx, %edx
callq 0x5460
movq (%r15), %rdi
movl 0x8(%r15), %esi
movl %ebp, %edx
callq 0xe98e
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq %rbx, %rdi
callq 0x5430
leaq 0x24a9a(%rip), %rsi     # 0x32803
movl $0x1, %edx
movq %rax, %rdi
callq 0x5430
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0xdd8d
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x53b0
leaq 0x2384a(%rip), %rsi     # 0x315de
movl $0x19, %edx
movq %rbx, %rdi
callq 0x5430
leaq 0x24a5b(%rip), %rsi     # 0x32803
movl $0x1, %edx
movq %rbx, %rdi
callq 0x5430
movq %r14, %rdi
callq 0xeabc
movq (%rax), %r12
movq %r14, %rdi
callq 0xeabc
movq 0x8(%rax), %r15
cmpq %r15, %r12
je 0xde3e
movq %r15, %r13
subq %r12, %r13
movq %r13, %rax
sarq $0x3, %rax
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rax, %rcx
bsrq %rcx, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
movq %r12, %rdi
movq %r15, %rsi
callq 0xe1bf
cmpq $0x181, %r13            # imm = 0x181
jl 0xde33
leaq 0x180(%r12), %r13
movq %r12, %rdi
movq %r13, %rsi
callq 0xe738
cmpq %r15, %r13
je 0xde3e
movq %r13, %rdi
callq 0xe839
addq $0x18, %r13
jmp 0xde20
movq %r12, %rdi
movq %r15, %rsi
callq 0xe738
leaq 0x237b3(%rip), %rsi     # 0x315f8
movl $0x11, %edx
movq %rbx, %rdi
callq 0x5430
movq %r14, %rdi
callq 0xeabc
movq (%rax), %r14
movq 0x8(%rax), %r13
cmpq %r13, %r14
je 0xdeb8
leaq 0x8(%rsp), %r15
leaq 0x24991(%rip), %r12     # 0x32803
movq %r15, %rdi
movq %r14, %rsi
callq 0xb078
movq %r15, %rdi
movq %rbx, %rsi
callq 0xf26d
movl $0x1, %edx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x5430
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0xdeaf
movq 0x18(%rsp), %rsi
subq %rdi, %rsi
callq 0x53b0
addq $0x18, %r14
cmpq %r13, %r14
jne 0xde72
movq %rbx, %rdi
callq 0x5290
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0xdf00
movq 0x18(%rsp), %rsi
incq %rsi
jmp 0xdefb
movq %rax, %rbx
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0xdf00
movq 0x18(%rsp), %rsi
subq %rdi, %rsi
callq 0x53b0
movq %rbx, %rdi
callq 0x5660