// File: /workspace/github_cpp_makefile_star2_O3/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 $0x68, %rsp
movq %r9, 0x60(%rsp)
movq %r8, 0x50(%rsp)
movq %rcx, 0x58(%rsp)
xorpd %xmm0, %xmm0
movapd %xmm0, 0x20(%rsp)
movq $0x0, 0x30(%rsp)
movq (%rdx), %rax
cmpq %rax, 0x8(%rdx)
je 0x7c9d
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %rbp
xorl %ebx, %ebx
movl $0x0, 0x1c(%rsp)
cmpl $0x0, (%rax,%rbx,4)
jle 0x7b0c
movslq 0x1c(%rsp), %r15
shlq $0x5, %r15
xorl %r14d, %r14d
movq (%rbp), %rsi
addq %r15, %rsi
movq %r13, %rdi
callq 0x72f6
movq 0x28(%rsp), %rsi
cmpq 0x30(%rsp), %rsi
je 0x7ae9
movsd (%rax), %xmm0
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x28(%rsp)
jmp 0x7af6
leaq 0x20(%rsp), %rdi
movq %rax, %rdx
callq 0x6066
incl %r14d
movq (%r12), %rax
addq $0x20, %r15
cmpl (%rax,%rbx,4), %r14d
jl 0x7abb
addl %r14d, 0x1c(%rsp)
leaq 0x20(%rsp), %r15
movq %r15, %rdi
callq 0x6a87
movsd %xmm0, 0x10(%rsp)
movq 0x60(%rsp), %r14
movq (%r14), %rax
xorps %xmm1, %xmm1
cvtsi2sdl (%rax,%rbx,4), %xmm1
movsd 0x4859(%rip), %xmm0     # 0xc390
callq 0x3440
movsd %xmm0, 0x8(%rsp)
movq (%r14), %rax
xorps %xmm1, %xmm1
cvtsi2sdl (%rax,%rbx,4), %xmm1
movsd 0x483b(%rip), %xmm0     # 0xc390
callq 0x3440
movsd %xmm0, 0x48(%rsp)
movq %r15, %rdi
callq 0x69ec
movsd %xmm0, 0x40(%rsp)
movsd 0x10(%rsp), %xmm0
mulsd 0x8(%rsp), %xmm0
cvtsd2ss %xmm0, %xmm0
callq 0x3290
movaps %xmm0, %xmm1
movsd 0x40(%rsp), %xmm0
ucomisd 0x47ec(%rip), %xmm0     # 0xc380
jb 0x7b9c
sqrtsd %xmm0, %xmm0
jmp 0x7bad
movss %xmm1, 0x10(%rsp)
callq 0x3210
movss 0x10(%rsp), %xmm1
movsd %xmm0, 0x8(%rsp)
movsd 0x48(%rsp), %xmm0
cvtss2sd %xmm1, %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, 0x10(%rsp)
movq 0xa0(%rsp), %r14
movq (%r14), %rax
xorps %xmm1, %xmm1
cvtsi2sdl (%rax,%rbx,4), %xmm1
movsd 0x47ae(%rip), %xmm0     # 0xc390
callq 0x3440
mulsd 0x8(%rsp), %xmm0
cvtsd2ss %xmm0, %xmm0
callq 0x3290
movss %xmm0, 0x8(%rsp)
movq (%r14), %rax
xorps %xmm1, %xmm1
cvtsi2sdl (%rax,%rbx,4), %xmm1
movsd 0x4781(%rip), %xmm0     # 0xc390
callq 0x3440
movsd %xmm0, 0x40(%rsp)
movq 0x58(%rsp), %rax
movq (%rax), %rax
movsd (%rax,%rbx,8), %xmm1
movsd 0x10(%rsp), %xmm0
movsd 0x4763(%rip), %xmm2     # 0xc398
callq 0x6afb
testb %al, %al
je 0x7ca2
xorps %xmm0, %xmm0
cvtss2sd 0x8(%rsp), %xmm0
divsd 0x40(%rsp), %xmm0
movq 0x50(%rsp), %rax
movq (%rax), %rax
movsd (%rax,%rbx,8), %xmm1
movsd 0x4736(%rip), %xmm2     # 0xc398
callq 0x6afb
movl %eax, %r15d
movq 0x20(%rsp), %rdi
testb %al, %al
je 0x7caa
cmpq %rdi, 0x28(%rsp)
je 0x7c7f
movq %rdi, 0x28(%rsp)
incq %rbx
movq (%r12), %rax
movq 0x8(%r12), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq %rbx, %rcx
ja 0x7aa9
jmp 0x7caa
movb $0x1, %r15b
jmp 0x7cbc
movq 0x20(%rsp), %rdi
xorl %r15d, %r15d
testq %rdi, %rdi
je 0x7cbc
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x3280
movl %r15d, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x7cd2
jmp 0x7cd2
movq %rax, %rbx
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x7cec
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x3280
movq %rbx, %rdi
callq 0x3450