// File: drarwood[P]gags/GA.cpp
// Function: ScoreSolution(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>&, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, double, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, double>>>&, std::vector<int, std::allocator<int>>&, std::vector<double, std::allocator<double>>&, std::vector<double, std::allocator<double>>&)
double ScoreSolution(vector<string>& c, map<string, double>& p, vector<int>& n, vector<double>& m, vector<double>& s) {
    vector<double> phenotype;
    int index = 0;
    double score = 0;
    for (int i = 0; i < n.size(); ++i) {
        int count = 0;
        while (count < n[i]) {
            phenotype.push_back(p[c[index]]);
            index++;
            count++;
        }
        double mean = CalcMean(phenotype);
        double sd   = sqrt(CalcVariance(phenotype));
        if (fabs(m[i] - mean) >= 0) {
            score += fabs(m[i] - mean) * 2;
        }
        if (fabs(s[i] - sd) >= 0) {
            score += fabs(s[i] - sd);
        }
        phenotype.clear();
    }
    return score;
}

// Assembly:
subq $0xb8, %rsp
movq %rdi, 0xb0(%rsp)
movq %rsi, 0xa8(%rsp)
movq %rdx, 0xa0(%rsp)
movq %rcx, 0x98(%rsp)
movq %r8, 0x90(%rsp)
leaq 0x78(%rsp), %rdi
callq 0x56f0
movl $0x0, 0x74(%rsp)
xorps %xmm0, %xmm0
movsd %xmm0, 0x68(%rsp)
movl $0x0, 0x64(%rsp)
movslq 0x64(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0xa0(%rsp), %rdi
callq 0x5730
movq %rax, %rcx
movq 0x38(%rsp), %rax
cmpq %rcx, %rax
jae 0x100ac
movl $0x0, 0x60(%rsp)
movl 0x60(%rsp), %eax
movl %eax, 0x34(%rsp)
movq 0xa0(%rsp), %rdi
movslq 0x64(%rsp), %rsi
callq 0x5750
movq %rax, %rcx
movl 0x34(%rsp), %eax
cmpl (%rcx), %eax
jge 0xff83
movq 0xa8(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0xb0(%rsp), %rdi
movslq 0x74(%rsp), %rsi
callq 0xeca0
movq 0x20(%rsp), %rdi
movq %rax, %rsi
callq 0xecc0
movq %rax, 0x28(%rsp)
jmp 0xff3a
movq 0x28(%rsp), %rsi
leaq 0x78(%rsp), %rdi
callq 0x5b80
jmp 0xff4b
movl 0x74(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x74(%rsp)
movl 0x60(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x60(%rsp)
jmp 0xfee2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x58(%rsp)
movl %eax, 0x54(%rsp)
leaq 0x78(%rsp), %rdi
callq 0x61e0
jmp 0x100d0
leaq 0x78(%rsp), %rdi
callq 0xe000
movsd %xmm0, 0x18(%rsp)
jmp 0xff95
movsd 0x18(%rsp), %xmm0
movsd %xmm0, 0x48(%rsp)
leaq 0x78(%rsp), %rdi
callq 0xde60
movsd %xmm0, 0x10(%rsp)
jmp 0xffb3
movsd 0x10(%rsp), %xmm0
callq 0x3250
movsd %xmm0, 0x40(%rsp)
movq 0x98(%rsp), %rdi
movslq 0x64(%rsp), %rsi
callq 0x5bf0
movsd (%rax), %xmm0
subsd 0x48(%rsp), %xmm0
movaps 0xa2e9(%rip), %xmm1     # 0x1a2d0
pand %xmm1, %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x1002f
movq 0x98(%rsp), %rdi
movslq 0x64(%rsp), %rsi
callq 0x5bf0
movsd (%rax), %xmm0
subsd 0x48(%rsp), %xmm0
movaps 0xa2b9(%rip), %xmm1     # 0x1a2d0
pand %xmm1, %xmm0
movsd 0x68(%rsp), %xmm1
addsd %xmm0, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x68(%rsp)
movq 0x90(%rsp), %rdi
movslq 0x64(%rsp), %rsi
callq 0x5bf0
movsd (%rax), %xmm0
subsd 0x40(%rsp), %xmm0
movaps 0xa27e(%rip), %xmm1     # 0x1a2d0
pand %xmm1, %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x10092
movq 0x90(%rsp), %rdi
movslq 0x64(%rsp), %rsi
callq 0x5bf0
movsd (%rax), %xmm0
subsd 0x40(%rsp), %xmm0
movaps 0xa24e(%rip), %xmm1     # 0x1a2d0
pand %xmm1, %xmm0
addsd 0x68(%rsp), %xmm0
movsd %xmm0, 0x68(%rsp)
leaq 0x78(%rsp), %rdi
callq 0x5d90
movl 0x64(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x64(%rsp)
jmp 0xfeb2
movsd 0x68(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
leaq 0x78(%rsp), %rdi
callq 0x61e0
movsd 0x8(%rsp), %xmm0
addq $0xb8, %rsp
retq
movq 0x58(%rsp), %rdi
callq 0x3510
nopw (%rax,%rax)