// File: /workspace/github_cpp_makefile_star2_O1/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 0x2390f(%rip), %rsi     # 0x3158a
movl $0x9, %edx
callq 0x5440
leaq 0x23908(%rip), %rsi     # 0x31594
movl $0x14, %edx
movq %rbx, %rdi
callq 0x5440
movl %r15d, %esi
movq %rbx, %rdi
callq 0x5280
leaq 0x24b58(%rip), %r15     # 0x32803
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x5440
leaq 0x238e7(%rip), %rsi     # 0x315a9
movl $0xa, %edx
movq %rbx, %rdi
callq 0x5440
movl %ebp, %esi
movq %rbx, %rdi
callq 0x5280
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x5440
leaq 0x238c4(%rip), %rsi     # 0x315b4
movl $0x14, %edx
movq %rbx, %rdi
callq 0x5440
movq %r14, %rdi
callq 0xead8
movq %rbx, %rdi
movl %eax, %esi
callq 0x5640
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x5440
leaq 0x238a3(%rip), %rsi     # 0x315c9
movl $0x14, %edx
movq %rbx, %rdi
callq 0x5440
leaq 0x34baa(%rip), %rax     # 0x428e4
movl (%rax), %ebp
movl $0x1, %eax
cmpl $0xa, %ebp
jb 0xdd8a
movl $0x4, %eax
movl $0xd1b71759, %ecx       # imm = 0xD1B71759
movl %ebp, %edx
cmpl $0x63, %edx
jbe 0xdd83
cmpl $0x3e7, %edx            # imm = 0x3E7
jbe 0xdd88
cmpl $0x2710, %edx           # imm = 0x2710
jb 0xdd8a
movl %edx, %esi
imulq %rcx, %rsi
shrq $0x2d, %rsi
addl $0x4, %eax
cmpl $0x1869f, %edx          # imm = 0x1869F
movl %esi, %edx
ja 0xdd52
addl $-0x3, %eax
jmp 0xdd8a
addl $-0x2, %eax
jmp 0xdd8a
decl %eax
movl %eax, %esi
leaq 0x18(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x8(%rsp), %r15
movq %r15, %rdi
xorl %edx, %edx
callq 0x5470
movq (%r15), %rdi
movl 0x8(%r15), %esi
movl %ebp, %edx
callq 0xe9a5
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq %rbx, %rdi
callq 0x5440
leaq 0x24a3a(%rip), %rsi     # 0x32803
movl $0x1, %edx
movq %rax, %rdi
callq 0x5440
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0xdded
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x53c0
leaq 0x237ea(%rip), %rsi     # 0x315de
movl $0x19, %edx
movq %rbx, %rdi
callq 0x5440
leaq 0x249fb(%rip), %rsi     # 0x32803
movl $0x1, %edx
movq %rbx, %rdi
callq 0x5440
movq %r14, %rdi
callq 0xead4
movq (%rax), %r12
movq %r14, %rdi
callq 0xead4
movq 0x8(%rax), %r15
cmpq %r15, %r12
je 0xde9e
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 0xe226
cmpq $0x181, %r13            # imm = 0x181
jl 0xde93
leaq 0x180(%r12), %r13
movq %r12, %rdi
movq %r13, %rsi
callq 0xe772
cmpq %r15, %r13
je 0xde9e
movq %r13, %rdi
callq 0xe877
addq $0x18, %r13
jmp 0xde80
movq %r12, %rdi
movq %r15, %rsi
callq 0xe772
leaq 0x23753(%rip), %rsi     # 0x315f8
movl $0x11, %edx
movq %rbx, %rdi
callq 0x5440
movq %r14, %rdi
callq 0xead4
movq (%rax), %r14
movq 0x8(%rax), %r13
cmpq %r13, %r14
je 0xdf18
leaq 0x8(%rsp), %r15
leaq 0x24931(%rip), %r12     # 0x32803
movq %r15, %rdi
movq %r14, %rsi
callq 0xb05c
movq %r15, %rdi
movq %rbx, %rsi
callq 0xf261
movl $0x1, %edx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x5440
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0xdf0f
movq 0x18(%rsp), %rsi
subq %rdi, %rsi
callq 0x53c0
addq $0x18, %r14
cmpq %r13, %r14
jne 0xded2
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 0xdf60
movq 0x18(%rsp), %rsi
incq %rsi
jmp 0xdf5b
movq %rax, %rbx
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0xdf60
movq 0x18(%rsp), %rsi
subq %rdi, %rsi
callq 0x53c0
movq %rbx, %rdi
callq 0x5670