// File: /workspace/github_cpp_makefile_star2_O3/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 $0x48, %rsp
movq %r8, 0x38(%rsp)
movq %rcx, 0x30(%rsp)
movq %rsi, 0x40(%rsp)
xorpd %xmm0, %xmm0
movapd %xmm0, (%rsp)
movq $0x0, 0x10(%rsp)
movq (%rdx), %rax
cmpq %rax, 0x8(%rdx)
je 0x79cf
movq %rdx, %r15
movq %rdi, %r13
xorl %ebx, %ebx
movq %rsp, %r12
xorl %ebp, %ebp
xorpd %xmm0, %xmm0
movapd %xmm0, 0x20(%rsp)
cmpl $0x0, (%rax,%rbx,4)
jle 0x78e6
movl %ebp, 0x18(%rsp)
movslq %ebp, %r14
shlq $0x5, %r14
xorl %ebp, %ebp
movq (%r13), %rsi
addq %r14, %rsi
movq 0x40(%rsp), %rdi
callq 0x72f6
movq 0x8(%rsp), %rsi
cmpq 0x10(%rsp), %rsi
je 0x78c5
movsd (%rax), %xmm0
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x8(%rsp)
jmp 0x78d0
movq %r12, %rdi
movq %rax, %rdx
callq 0x6066
incl %ebp
movq (%r15), %rax
addq $0x20, %r14
cmpl (%rax,%rbx,4), %ebp
jl 0x7895
movl 0x18(%rsp), %eax
addl %ebp, %eax
movl %eax, %ebp
movq %r12, %rdi
callq 0x6a87
movsd %xmm0, 0x18(%rsp)
movq %r12, %rdi
callq 0x69ec
ucomisd 0x4a7c(%rip), %xmm0     # 0xc380
jb 0x790c
sqrtsd %xmm0, %xmm0
jmp 0x7911
callq 0x3210
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 (%rsp), %rdi
cmpq %rdi, 0x8(%rsp)
je 0x793b
movq %rdi, 0x8(%rsp)
subsd 0x18(%rsp), %xmm2
movapd %xmm2, %xmm3
movapd 0x49c3(%rip), %xmm4     # 0xc310
andpd %xmm4, %xmm3
addsd %xmm3, %xmm3
movapd 0x20(%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
movapd %xmm1, 0x20(%rsp)
incq %rbx
movq (%r15), %rax
movq 0x8(%r15), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq %rbx, %rcx
ja 0x7882
testq %rdi, %rdi
je 0x79c7
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x3280
movapd 0x20(%rsp), %xmm0
jmp 0x79d3
xorpd %xmm0, %xmm0
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x79e6
jmp 0x79e6
movq %rax, %rbx
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x79ff
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x3280
movq %rbx, %rdi
callq 0x3450