// File: /workspace/github_cpp_makefile_star2_O1/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 %rsi, 0x20(%rsp)
xorpd %xmm0, %xmm0
movapd %xmm0, (%rsp)
movq $0x0, 0x10(%rsp)
movq 0x8(%rdx), %rax
cmpq (%rdx), %rax
je 0x79d7
movq %rdx, %r15
movq %rdi, %r13
xorl %ebx, %ebx
movq %rsp, %r12
xorl %ebp, %ebp
xorpd %xmm0, %xmm0
movapd %xmm0, 0x40(%rsp)
movq (%r15), %rax
cmpl $0x0, (%rax,%rbx,4)
jle 0x7909
movl %ebp, 0x18(%rsp)
movslq %ebp, %r14
shlq $0x5, %r14
xorl %ebp, %ebp
movq (%r13), %rsi
addq %r14, %rsi
movq 0x20(%rsp), %rdi
callq 0x7314
movq 0x8(%rsp), %rsi
cmpq 0x10(%rsp), %rsi
je 0x78e8
movsd (%rax), %xmm0
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x8(%rsp)
jmp 0x78f3
movq %r12, %rdi
movq %rax, %rdx
callq 0x605a
incl %ebp
movq (%r15), %rax
addq $0x20, %r14
cmpl (%rax,%rbx,4), %ebp
jl 0x78b8
movl 0x18(%rsp), %eax
addl %ebp, %eax
movl %eax, %ebp
movq %r12, %rdi
callq 0x6a99
movsd %xmm0, 0x18(%rsp)
movq %r12, %rdi
callq 0x69e4
ucomisd 0x5a59(%rip), %xmm0     # 0xd380
jb 0x792f
sqrtsd %xmm0, %xmm0
jmp 0x7934
callq 0x3210
movq 0x30(%rsp), %rax
movq (%rax), %rax
movsd (%rax,%rbx,8), %xmm1
movq 0x38(%rsp), %rax
movq (%rax), %rax
movsd (%rax,%rbx,8), %xmm5
movq (%rsp), %rax
cmpq %rax, 0x8(%rsp)
je 0x795e
movq %rax, 0x8(%rsp)
subsd 0x18(%rsp), %xmm1
movapd %xmm1, %xmm2
movapd 0x59a0(%rip), %xmm3     # 0xd310
andpd %xmm3, %xmm2
addsd %xmm2, %xmm2
movapd 0x40(%rsp), %xmm4
addsd %xmm4, %xmm2
cmpordsd %xmm1, %xmm1
andpd %xmm1, %xmm2
andnpd %xmm4, %xmm1
orpd %xmm2, %xmm1
subsd %xmm0, %xmm5
movapd %xmm5, %xmm0
andpd %xmm3, %xmm0
addsd %xmm1, %xmm0
cmpordsd %xmm5, %xmm5
movapd %xmm5, %xmm2
andnpd %xmm1, %xmm2
andpd %xmm0, %xmm5
orpd %xmm2, %xmm5
movq 0x8(%r15), %rax
subq (%r15), %rax
incq %rbx
sarq $0x2, %rax
movapd %xmm5, 0x40(%rsp)
cmpq %rbx, %rax
ja 0x78a2
jmp 0x79db
xorpd %xmm5, %xmm5
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x79fd
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
movapd %xmm5, 0x20(%rsp)
callq 0x3280
movapd 0x20(%rsp), %xmm5
movapd %xmm5, %xmm0
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x7a14
jmp 0x7a14
movq %rax, %rbx
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x7a2d
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x3280
movq %rbx, %rdi
callq 0x3450