// File: /workspace/github_cpp_makefile_star2_O2/ALSchwalm[P]cppEvolve/include/cppEvolve/TreeGA.hpp
// Function: evolve::TreeGA<int, 100ul>::run(unsigned int, unsigned int)
virtual void run(unsigned int generations,
                     unsigned int logFrequency = 100) {
        for (auto i = 0U; i < PopSize; ++i) {
            population.push_back(generator.make());
        }

        for (auto generation = 0U; generation < generations; ++generation) {
            selector(population, evaluator);

            auto popSizePostSelection = population.size();

            while (population.size() < PopSize) {
                population.push_back(
                    crossover(population[random_uint(popSizePostSelection)],
                              population[random_uint(popSizePostSelection)]));
            }

            for (size_t i = 0; i < PopSize * mutationRate; ++i) {
                auto index = random_uint(PopSize);
                mutator(population[index], generator);
            }

            auto score = evaluator(population[0]);
            if (score > bestScore) {
                delete bestIndividual;
                bestIndividual = population[0]->clone();
                bestScore = score;
            }

            if (generation % logFrequency == 0) {
                std::cout << "Generation(" << generation
                          << ") - Fitness:" << bestScore << std::endl;
            }
        }
        std::cout << "Best: " << *bestIndividual << std::endl;
        std::cout << "Fitness: " << bestScore << std::endl;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movl %edx, -0x34(%rbp)
movl %esi, %r12d
movq %rdi, %rbx
leaq 0x8(%rdi), %r15
leaq 0x20(%rdi), %rax
movq %rax, -0x40(%rbp)
pushq $0x64
popq %r13
leaq -0x30(%rbp), %r14
subl $0x1, %r13d
jb 0x2e1a
movq -0x40(%rbp), %rdi
callq 0x61a6
movq %rax, -0x30(%rbp)
movq %r15, %rdi
movq %r14, %rsi
callq 0x630a
jmp 0x2dfa
leaq 0xf8(%rbx), %rax
movq %rax, -0x58(%rbp)
leaq 0x98(%rbx), %r13
leaq 0xb8(%rbx), %rax
movq %rax, -0x70(%rbp)
leaq 0xd8(%rbx), %r14
movl %r12d, %eax
movq %rax, -0x60(%rbp)
xorl %r12d, %r12d
movq %r13, -0x50(%rbp)
cmpq -0x60(%rbp), %r12
je 0x3009
movq %r12, -0x68(%rbp)
leaq -0x90(%rbp), %r12
movq %r12, %rdi
movq %r13, %rsi
callq 0x6228
movq -0x58(%rbp), %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x6212
movq %r12, %rdi
callq 0x5e42
movq 0x8(%rbx), %rax
movq 0x10(%rbx), %rcx
movq %rcx, %r12
subq %rax, %r12
sarq $0x3, %r12
subq %rax, %rcx
cmpq $0x320, %rcx            # imm = 0x320
jae 0x2ee7
movq %r12, %rdi
callq 0x23b3
movq 0x8(%rbx), %rcx
movq (%rcx,%rax,8), %r13
movq %r12, %rdi
callq 0x23b3
movq 0x8(%rbx), %rcx
movq (%rcx,%rax,8), %rdx
movq -0x70(%rbp), %rdi
movq %r13, %rsi
callq 0x6276
movq %rax, -0x30(%rbp)
movq %r15, %rdi
leaq -0x30(%rbp), %rsi
callq 0x630a
movq 0x8(%rbx), %rax
movq 0x10(%rbx), %rcx
jmp 0x2e95
xorl %r12d, %r12d
movq -0x50(%rbp), %r13
testq %r12, %r12
js 0x2efa
cvtsi2ss %r12, %xmm0
jmp 0x2f12
movq %r12, %rax
shrq %rax
movl %r12d, %ecx
andl $0x1, %ecx
orq %rax, %rcx
cvtsi2ss %rcx, %xmm0
addss %xmm0, %xmm0
movss 0x118(%rbx), %xmm1
mulss 0x40ee(%rip), %xmm1     # 0x7010
ucomiss %xmm0, %xmm1
jbe 0x2f47
pushq $0x64
popq %rdi
callq 0x23b3
movq (%r15), %rcx
movq (%rcx,%rax,8), %rsi
movq %r14, %rdi
movq -0x40(%rbp), %rdx
callq 0x62a4
incq %r12
jmp 0x2eee
movq 0x8(%rbx), %rax
movq (%rax), %rsi
movq %r13, %rdi
callq 0x62ca
cvtss2sd %xmm0, %xmm0
ucomisd 0x90(%rbx), %xmm0
jbe 0x2fac
movsd %xmm0, -0x48(%rbp)
movq 0x88(%rbx), %r12
testq %r12, %r12
je 0x2f84
movq (%r12), %rdi
testq %rdi, %rdi
je 0x2f84
movq (%rdi), %rax
callq *0x8(%rax)
movq %r12, %rdi
callq 0x2140
movq 0x8(%rbx), %rax
movq (%rax), %rdi
callq 0x4c86
movq %rax, 0x88(%rbx)
movsd -0x48(%rbp), %xmm0
movsd %xmm0, 0x90(%rbx)
movq -0x68(%rbp), %r12
movl %r12d, %eax
xorl %edx, %edx
divl -0x34(%rbp)
testl %edx, %edx
jne 0x3001
movq 0x9015(%rip), %rdi      # 0xbfd8
leaq 0x4383(%rip), %rsi      # 0x734d
callq 0x2150
movq %rax, %rdi
movq %r12, %rsi
callq 0x20f0
movq %rax, %rdi
leaq 0x4375(%rip), %rsi      # 0x7359
callq 0x2150
movsd 0x90(%rbx), %xmm0
movq %rax, %rdi
callq 0x21c0
movq %rax, %rdi
callq 0x20a0
incq %r12
jmp 0x2e4c
movq 0x8fc8(%rip), %r14      # 0xbfd8
leaq 0x434f(%rip), %rsi      # 0x7366
movq %r14, %rdi
callq 0x2150
movq 0x88(%rbx), %rsi
movq %rax, %rdi
callq 0x62ef
movq %rax, %rdi
callq 0x20a0
leaq 0x4330(%rip), %rsi      # 0x736d
movq %r14, %rdi
callq 0x2150
movsd 0x90(%rbx), %xmm0
movq %rax, %rdi
callq 0x21c0
movq %rax, %rdi
callq 0x20a0
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x90(%rbp), %rdi
callq 0x5e42
movq %rbx, %rdi
callq 0x21f0
nop