// File: /workspace/github_cpp_makefile_star2_O1/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 -0xb0(%rbp), %rsi
movaps %xmm0, (%rsi)
leaq 0x22f(%rip), %rax       # 0x25b2
movq %rax, 0x18(%rsi)
leaq 0x23a(%rip), %rax       # 0x25c8
movq %rax, 0x10(%rsi)
leaq -0x90(%rbp), %rdx
movaps %xmm0, (%rdx)
leaq 0x243(%rip), %rax       # 0x25e6
movq %rax, 0x18(%rdx)
leaq 0x25c(%rip), %rax       # 0x260a
movq %rax, 0x10(%rdx)
leaq -0x70(%rbp), %rcx
movaps %xmm0, (%rcx)
movaps %xmm0, 0x10(%rcx)
leaq 0x263(%rip), %rax       # 0x2627
movq %rax, (%rcx)
leaq 0xb28(%rip), %rax       # 0x2ef6
movq %rax, 0x18(%rcx)
leaq 0xb2d(%rip), %rax       # 0x2f06
movq %rax, 0x10(%rcx)
leaq -0x50(%rbp), %r8
movaps %xmm0, (%r8)
movaps %xmm0, 0x10(%r8)
leaq 0x240(%rip), %rax       # 0x2631
movq %rax, (%r8)
leaq 0xb33(%rip), %rax       # 0x2f2e
movq %rax, 0x18(%r8)
leaq 0xb36(%rip), %rax       # 0x2f3c
movq %rax, 0x10(%r8)
leaq -0x30(%rbp), %r9
movaps %xmm0, (%r9)
movaps %xmm0, 0x10(%r9)
leaq 0x24e(%rip), %rax       # 0x266c
movq %rax, (%r9)
leaq 0x1bbe(%rip), %rax      # 0x3fe6
movq %rax, 0x18(%r9)
leaq 0x1bbd(%rip), %rax      # 0x3ff0
movq %rax, 0x10(%r9)
leaq -0x190(%rbp), %rdi
callq 0x26b2
movq -0x20(%rbp), %rax
testq %rax, %rax
je 0x245a
leaq -0x30(%rbp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq -0x40(%rbp), %rax
testq %rax, %rax
je 0x2471
leaq -0x50(%rbp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq -0x60(%rbp), %rax
testq %rax, %rax
je 0x2488
leaq -0x70(%rbp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq -0x80(%rbp), %rax
testq %rax, %rax
je 0x24a2
leaq -0x90(%rbp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq -0xa0(%rbp), %rax
testq %rax, %rax
je 0x24bf
leaq -0xb0(%rbp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
leaq -0x190(%rbp), %rdi
movl $0x3e8, %esi            # imm = 0x3E8
movl $0x64, %edx
callq 0x27fe
leaq -0x190(%rbp), %rdi
callq 0x2c5c
xorl %eax, %eax
addq $0x188, %rsp            # imm = 0x188
popq %rbx
popq %rbp
retq
jmp 0x25a9
jmp 0x25a9
jmp 0x25a9
jmp 0x25a9
jmp 0x25a9
movq %rax, %rbx
leaq -0x190(%rbp), %rdi
callq 0x2c5c
movq %rbx, %rdi
callq 0x2170
movq %rax, %rbx
movq -0x20(%rbp), %rax
testq %rax, %rax
je 0x2537
leaq -0x30(%rbp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq -0x40(%rbp), %rax
testq %rax, %rax
je 0x254e
leaq -0x50(%rbp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq -0x60(%rbp), %rax
testq %rax, %rax
je 0x2565
leaq -0x70(%rbp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq -0x80(%rbp), %rax
testq %rax, %rax
je 0x257f
leaq -0x90(%rbp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq -0xa0(%rbp), %rax
testq %rax, %rax
je 0x2515
leaq -0xb0(%rbp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
jmp 0x2515
jmp 0x25a9
jmp 0x25a9
jmp 0x25a9
jmp 0x25a9
movq %rax, %rdi
callq 0x2d15
nop