// File: /workspace/github_cpp_makefile_star2_O2/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %r8, 0x38(%rsp)
movq %rcx, 0x30(%rsp)
movq %rdx, %r15
movq %rsi, 0x50(%rsp)
movq %rdi, %r13
xorpd %xmm0, %xmm0
leaq 0x10(%rsp), %r12
movapd %xmm0, (%r12)
andq $0x0, 0x10(%r12)
xorl %ebx, %ebx
xorpd %xmm0, %xmm0
movapd %xmm0, (%rsp)
xorl %edx, %edx
movq (%r15), %rax
movq 0x8(%r15), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq %rbx, %rcx
jbe 0x6db7
movslq %edx, %rdx
movq %rdx, 0x48(%rsp)
movq %rdx, %rbp
shlq $0x5, %rbp
xorl %r14d, %r14d
cmpl (%rax,%rbx,4), %r14d
jge 0x6cf3
movq (%r13), %rsi
addq %rbp, %rsi
movq 0x50(%rsp), %rdi
callq 0x670e
movq %r12, %rdi
movq %rax, %rsi
callq 0x4a12
movq (%r15), %rax
incq %r14
addq $0x20, %rbp
jmp 0x6cc5
movq %r12, %rdi
callq 0x60da
movsd %xmm0, 0x40(%rsp)
movq %r12, %rdi
callq 0x6064
ucomisd 0x363f(%rip), %xmm0     # 0xa350
jb 0x6d19
sqrtsd %xmm0, %xmm0
jmp 0x6d1e
callq 0x3200
movq 0x30(%rsp), %rax
movq (%rax), %rax
movsd (%rax,%rbx,8), %xmm2
movq 0x38(%rsp), %rax
movq (%rax), %rax
movsd (%rax,%rbx,8), %xmm1
movq 0x10(%rsp), %rax
cmpq %rax, 0x18(%rsp)
je 0x6d49
movq %rax, 0x18(%rsp)
movq 0x48(%rsp), %rdx
addq %r14, %rdx
subsd 0x40(%rsp), %xmm2
movapd %xmm2, %xmm3
movapd 0x357d(%rip), %xmm4     # 0xa2e0
andpd %xmm4, %xmm3
addsd %xmm3, %xmm3
movapd (%rsp), %xmm5
addsd %xmm5, %xmm3
cmpordsd %xmm2, %xmm2
andpd %xmm2, %xmm3
andnpd %xmm5, %xmm2
orpd %xmm3, %xmm2
subsd %xmm0, %xmm1
movapd %xmm1, %xmm0
andpd %xmm4, %xmm0
addsd %xmm2, %xmm0
cmpordsd %xmm1, %xmm1
movapd %xmm1, %xmm3
andnpd %xmm2, %xmm3
andpd %xmm0, %xmm1
orpd %xmm3, %xmm1
incq %rbx
movapd %xmm1, (%rsp)
jmp 0x6c9c
leaq 0x10(%rsp), %rdi
callq 0x4eae
movaps (%rsp), %xmm0
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x6dd8
jmp 0x6dd8
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x4eae
movq %rbx, %rdi
callq 0x3410