// File: /workspace/github_cpp_makefile_star2_O3/ALSchwalm[P]cppEvolve/examples/readme_sample.cpp
// Function: main
int main() {
    auto generator = []() -> Genome {return {1, 2, 3};};

    auto fitness = [](const Genome& g) -> double {
        return std::count_if(g.begin(), g.end(),
                             [](int allele) {return allele % 2 == 0;});
    };

    SimpleGA<Genome, 100> ga(generator,
                             fitness,
                             list1d::crossover::singlePoint<Genome>,
                             list1d::mutator::swap<Genome>,
                             selector::top<Genome, 3>);

    ga.run(1000);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x188, %rsp            # imm = 0x188
xorps %xmm0, %xmm0
leaq -0x50(%rbp), %rsi
movaps %xmm0, (%rsi)
leaq 0x226(%rip), %rax       # 0x25a6
movq %rax, 0x18(%rsi)
leaq 0x231(%rip), %rax       # 0x25bc
movq %rax, 0x10(%rsi)
leaq -0x30(%rbp), %rdx
movaps %xmm0, (%rdx)
leaq 0x23d(%rip), %rax       # 0x25da
movq %rax, 0x18(%rdx)
leaq 0x256(%rip), %rax       # 0x25fe
movq %rax, 0x10(%rdx)
xorl %eax, %eax
leaq -0xb0(%rbp), %rcx
movq %rax, 0x8(%rcx)
leaq 0x25b(%rip), %rdi       # 0x261b
movq %rdi, (%rcx)
leaq 0xb56(%rip), %rdi       # 0x2f20
movq %rdi, 0x18(%rcx)
leaq 0xb5b(%rip), %rdi       # 0x2f30
movq %rdi, 0x10(%rcx)
leaq -0x90(%rbp), %r8
movq %rax, 0x8(%r8)
leaq 0x23a(%rip), %rdi       # 0x2625
movq %rdi, (%r8)
leaq 0xb63(%rip), %rdi       # 0x2f58
movq %rdi, 0x18(%r8)
leaq 0xb66(%rip), %rdi       # 0x2f66
movq %rdi, 0x10(%r8)
leaq -0x70(%rbp), %r9
movq %rax, 0x8(%r9)
leaq 0x24d(%rip), %rax       # 0x2660
movq %rax, (%r9)
leaq 0x1b7f(%rip), %rax      # 0x3f9c
movq %rax, 0x18(%r9)
leaq 0x1b7e(%rip), %rax      # 0x3fa6
movq %rax, 0x10(%r9)
leaq -0x190(%rbp), %rdi
callq 0x26ca
movq -0x60(%rbp), %rax
testq %rax, %rax
je 0x244f
leaq -0x70(%rbp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq -0x80(%rbp), %rax
testq %rax, %rax
je 0x2469
leaq -0x90(%rbp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq -0xa0(%rbp), %rax
testq %rax, %rax
je 0x2486
leaq -0xb0(%rbp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq -0x20(%rbp), %rax
testq %rax, %rax
je 0x249d
leaq -0x30(%rbp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq -0x40(%rbp), %rax
testq %rax, %rax
je 0x24b4
leaq -0x50(%rbp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
leaq -0x190(%rbp), %rdi
movl $0x3e8, %esi            # imm = 0x3E8
movl $0x64, %edx
callq 0x2816
leaq -0x190(%rbp), %rdi
callq 0x2c7e
xorl %eax, %eax
addq $0x188, %rsp            # imm = 0x188
popq %rbx
popq %rbp
retq
jmp 0x259e
jmp 0x259e
jmp 0x259e
jmp 0x259e
jmp 0x259e
movq %rax, %rbx
leaq -0x190(%rbp), %rdi
callq 0x2c7e
movq %rbx, %rdi
callq 0x2170
movq %rax, %rbx
movq -0x60(%rbp), %rax
testq %rax, %rax
je 0x252c
leaq -0x70(%rbp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq -0x80(%rbp), %rax
testq %rax, %rax
je 0x2546
leaq -0x90(%rbp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq -0xa0(%rbp), %rax
testq %rax, %rax
je 0x2563
leaq -0xb0(%rbp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq -0x20(%rbp), %rax
testq %rax, %rax
je 0x257a
leaq -0x30(%rbp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq -0x40(%rbp), %rax
testq %rax, %rax
je 0x250a
leaq -0x50(%rbp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
jmp 0x250a
jmp 0x259e
jmp 0x259e
jmp 0x259e
jmp 0x259e
movq %rax, %rdi
callq 0x2d37