// File: Quinny[P]IteratedPrisoners/./ipd/genetic.h
// Function: ipd::genetic::evaluate_async(std::vector<ipd::prisoner_t, std::allocator<ipd::prisoner_t>> const&)
std::vector<score_t> evaluate_async(const std::vector<prisoner_t>& v) {
    qp::profiler fit_prof("fitness evaluation");
    std::vector<std::future<int>> futs;
    std::vector<score_t> ret(v.size());
    auto fitness = std::bind(total_score, _1, bots::all, ipd::config::rounds);

    for (const auto& i: v) {
        futs.emplace_back(std::async(fitness, i));
    }

    for (auto i = 0UL; i < v.size(); ++i) {
        ret.emplace_back(v[i], futs[i].get());
    }

    return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x150, %rsp            # imm = 0x150
movq %rdi, -0x120(%rbp)
movq %rdi, %rax
movq %rax, -0x118(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x69(%rbp), %rdi
movq %rdi, -0x110(%rbp)
callq 0x45d0
movq -0x110(%rbp), %rdx
leaq 0x19708(%rip), %rsi     # 0x201ca
leaq -0x68(%rbp), %rdi
callq 0x44d0
jmp 0x6acd
leaq -0x48(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0xa440
jmp 0x6adc
leaq -0x68(%rbp), %rdi
callq 0x4230
leaq -0x69(%rbp), %rdi
callq 0x4430
leaq -0x98(%rbp), %rdi
callq 0xa490
movb $0x0, -0x99(%rbp)
movq -0x10(%rbp), %rdi
callq 0xa4b0
movq %rax, -0x130(%rbp)
leaq -0x9a(%rbp), %rdi
movq %rdi, -0x128(%rbp)
callq 0xa4d0
movq -0x120(%rbp), %rdi
movq -0x130(%rbp), %rsi
movq -0x128(%rbp), %rdx
callq 0xa4f0
jmp 0x6b40
leaq -0x9a(%rbp), %rdi
callq 0xa560
leaq -0x1283(%rip), %rsi     # 0x58d0
movq 0x2b446(%rip), %rdx     # 0x31fa0
leaq 0x2b7ff(%rip), %rcx     # 0x32360
leaq 0x2b840(%rip), %r8      # 0x323a8
leaq -0xc8(%rbp), %rdi
callq 0xa580
jmp 0x6b76
movq -0x10(%rbp), %rax
movq %rax, -0xd0(%rbp)
movq -0xd0(%rbp), %rdi
callq 0x9260
movq %rax, -0xd8(%rbp)
movq -0xd0(%rbp), %rdi
callq 0x9290
movq %rax, -0xe0(%rbp)
leaq -0xd8(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
callq 0x92c0
testb $0x1, %al
jne 0x6bc3
jmp 0x6cae
leaq -0xd8(%rbp), %rdi
callq 0x9300
movq %rax, -0xe8(%rbp)
movq -0xe8(%rbp), %rdx
leaq -0xf8(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
callq 0xa640
jmp 0x6bf2
leaq -0x98(%rbp), %rdi
leaq -0xf8(%rbp), %rsi
callq 0xa5d0
jmp 0x6c07
leaq -0xf8(%rbp), %rdi
callq 0xa690
leaq -0xd8(%rbp), %rdi
callq 0x9320
jmp 0x6ba7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x6c44
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x4230
leaq -0x69(%rbp), %rdi
callq 0x4430
jmp 0x6dd8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0x9a(%rbp), %rdi
callq 0xa560
jmp 0x6dc3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x6db7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x6d78
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0xf8(%rbp), %rdi
callq 0xa690
jmp 0x6d78
movq $0x0, -0x100(%rbp)
movq -0x100(%rbp), %rax
movq %rax, -0x138(%rbp)
movq -0x10(%rbp), %rdi
callq 0xa4b0
movq %rax, %rcx
movq -0x138(%rbp), %rax
cmpq %rcx, %rax
jae 0x6d5a
movq -0x10(%rbp), %rdi
movq -0x100(%rbp), %rsi
callq 0xa730
movq %rax, -0x148(%rbp)
movq -0x100(%rbp), %rsi
leaq -0x98(%rbp), %rdi
callq 0xa750
movq %rax, %rdi
callq 0xa770
movl %eax, -0x13c(%rbp)
jmp 0x6d19
movq -0x148(%rbp), %rsi
movq -0x120(%rbp), %rdi
movl -0x13c(%rbp), %eax
movl %eax, -0x104(%rbp)
leaq -0x104(%rbp), %rdx
callq 0xa6b0
jmp 0x6d41
jmp 0x6d43
movq -0x100(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x100(%rbp)
jmp 0x6cb9
movb $0x1, -0x99(%rbp)
leaq -0xc8(%rbp), %rdi
callq 0xa7e0
testb $0x1, -0x99(%rbp)
jne 0x6d92
jmp 0x6d86
leaq -0xc8(%rbp), %rdi
callq 0xa7e0
jmp 0x6db7
movq -0x120(%rbp), %rdi
callq 0x9520
leaq -0x98(%rbp), %rdi
callq 0xa800
leaq -0x48(%rbp), %rdi
callq 0xa860
movq -0x118(%rbp), %rax
addq $0x150, %rsp            # imm = 0x150
popq %rbp
retq
movq -0x120(%rbp), %rdi
callq 0x9520
leaq -0x98(%rbp), %rdi
callq 0xa800
leaq -0x48(%rbp), %rdi
callq 0xa860
movq -0x78(%rbp), %rdi
callq 0x45c0
nopw %cs:(%rax,%rax)