// File: /workspace/github_cpp_makefile_star2_O1/drarwood[P]gags/GA.cpp
// Function: TestBestSolution(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>>&, std::vector<int, std::allocator<int>>&, std::vector<int, std::allocator<int>>&)
bool TestBestSolution(vector<string>& c, map<string, double>& p, vector<int>& n, vector<double>& m, vector<double>& s, vector<int>& mp, vector<int>& sp) {
    vector<double> values;
    int index = 0;
    bool solutionFound;
    for (int i = 0; i < n.size(); ++i) {
        int count = 0;
        while (count < n[i]) {
            values.push_back(p[c[index]]);
            index++;
            count++;
        }
        
        double mean = roundf(CalcMean(values) * pow(10,mp[i])) / pow(10,mp[i]);
        double sd   = roundf(sqrt(CalcVariance(values)) * pow(10,sp[i])) / pow(10,sp[i]);
        if (doubleEqual(mean, m[i], 0.00001) && doubleEqual(sd, s[i], 0.00001)) {
            solutionFound = true;
        }
        else {
            solutionFound = false;
            break;
        }
        values.clear();
    }
    return solutionFound;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %r9, 0x48(%rsp)
movq %r8, 0x38(%rsp)
movq %rcx, 0x40(%rsp)
xorpd %xmm0, %xmm0
movapd %xmm0, 0x20(%rsp)
movq $0x0, 0x30(%rsp)
movq 0x8(%rdx), %rax
cmpq (%rdx), %rax
je 0x7cd0
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %rbp
xorl %ebx, %ebx
movl $0x0, 0x14(%rsp)
movq (%r12), %rax
cmpl $0x0, (%rax,%rbx,4)
jle 0x7b3e
movslq 0x14(%rsp), %r15
shlq $0x5, %r15
xorl %r14d, %r14d
movq (%rbp), %rsi
addq %r15, %rsi
movq %r13, %rdi
callq 0x7314
movq 0x28(%rsp), %rsi
cmpq 0x30(%rsp), %rsi
je 0x7b1b
movsd (%rax), %xmm0
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x28(%rsp)
jmp 0x7b28
leaq 0x20(%rsp), %rdi
movq %rax, %rdx
callq 0x605a
incl %r14d
movq (%r12), %rax
addq $0x20, %r15
cmpl (%rax,%rbx,4), %r14d
jl 0x7aed
addl %r14d, 0x14(%rsp)
leaq 0x20(%rsp), %r15
movq %r15, %rdi
callq 0x6a99
movsd %xmm0, 0x8(%rsp)
movq 0x48(%rsp), %r14
movq (%r14), %rax
xorps %xmm1, %xmm1
cvtsi2sdl (%rax,%rbx,4), %xmm1
movsd 0x5827(%rip), %xmm0     # 0xd390
callq 0x3440
movsd %xmm0, (%rsp)
movq (%r14), %rax
xorps %xmm1, %xmm1
cvtsi2sdl (%rax,%rbx,4), %xmm1
movsd 0x580a(%rip), %xmm0     # 0xd390
callq 0x3440
movsd %xmm0, 0x18(%rsp)
movq %r15, %rdi
callq 0x69e4
movsd %xmm0, 0x50(%rsp)
movsd 0x8(%rsp), %xmm0
mulsd (%rsp), %xmm0
cvtsd2ss %xmm0, %xmm0
callq 0x3290
movaps %xmm0, %xmm1
movsd 0x50(%rsp), %xmm0
ucomisd 0x57bc(%rip), %xmm0     # 0xd380
jb 0x7bcc
sqrtsd %xmm0, %xmm0
jmp 0x7bdd
movss %xmm1, 0x8(%rsp)
callq 0x3210
movss 0x8(%rsp), %xmm1
movsd %xmm0, (%rsp)
movsd 0x18(%rsp), %xmm0
cvtss2sd %xmm1, %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rsp)
movq 0x90(%rsp), %r14
movq (%r14), %rax
xorps %xmm1, %xmm1
cvtsi2sdl (%rax,%rbx,4), %xmm1
movsd 0x577f(%rip), %xmm0     # 0xd390
callq 0x3440
mulsd (%rsp), %xmm0
cvtsd2ss %xmm0, %xmm0
callq 0x3290
movss %xmm0, 0x18(%rsp)
movq (%r14), %rax
xorps %xmm1, %xmm1
cvtsi2sdl (%rax,%rbx,4), %xmm1
movsd 0x5753(%rip), %xmm0     # 0xd390
callq 0x3440
movsd %xmm0, (%rsp)
movq 0x40(%rsp), %rax
movq (%rax), %rax
movsd (%rax,%rbx,8), %xmm1
movsd 0x8(%rsp), %xmm0
movsd 0x5736(%rip), %xmm2     # 0xd398
callq 0x6b29
testb %al, %al
je 0x7cad
xorps %xmm0, %xmm0
cvtss2sd 0x18(%rsp), %xmm0
divsd (%rsp), %xmm0
movq 0x38(%rsp), %rax
movq (%rax), %rax
movsd (%rax,%rbx,8), %xmm1
movsd 0x570a(%rip), %xmm2     # 0xd398
callq 0x6b29
testb %al, %al
je 0x7cad
movq 0x20(%rsp), %rax
movb $0x1, %r15b
cmpq %rax, 0x28(%rsp)
je 0x7cb0
movq %rax, 0x28(%rsp)
jmp 0x7cb0
xorl %r15d, %r15d
testb %r15b, %r15b
je 0x7cd0
incq %rbx
movq 0x8(%r12), %rax
subq (%r12), %rax
sarq $0x2, %rax
cmpq %rbx, %rax
ja 0x7ad7
jmp 0x7cd0
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x7ce7
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x3280
andb $0x1, %r15b
movl %r15d, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x7d01
jmp 0x7d01
movq %rax, %rbx
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x7d1b
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x3280
movq %rbx, %rdi
callq 0x3450