// File: 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:
subq $0x108, %rsp            # imm = 0x108
movq 0x110(%rsp), %rax
movq %rdi, 0x100(%rsp)
movq %rsi, 0xf8(%rsp)
movq %rdx, 0xf0(%rsp)
movq %rcx, 0xe8(%rsp)
movq %r8, 0xe0(%rsp)
movq %r9, 0xd8(%rsp)
leaq 0xc0(%rsp), %rdi
callq 0x56f0
movl $0x0, 0xbc(%rsp)
movl $0x0, 0xb4(%rsp)
movslq 0xb4(%rsp), %rax
movq %rax, 0x88(%rsp)
movq 0xf0(%rsp), %rdi
callq 0x5730
movq %rax, %rcx
movq 0x88(%rsp), %rax
cmpq %rcx, %rax
jae 0x1052e
movl $0x0, 0xb0(%rsp)
movl 0xb0(%rsp), %eax
movl %eax, 0x84(%rsp)
movq 0xf0(%rsp), %rdi
movslq 0xb4(%rsp), %rsi
callq 0x5750
movq %rax, %rcx
movl 0x84(%rsp), %eax
cmpl (%rcx), %eax
jge 0x1030a
movq 0xf8(%rsp), %rax
movq %rax, 0x70(%rsp)
movq 0x100(%rsp), %rdi
movslq 0xbc(%rsp), %rsi
callq 0xeca0
movq 0x70(%rsp), %rdi
movq %rax, %rsi
callq 0xecc0
movq %rax, 0x78(%rsp)
jmp 0x102a9
movq 0x78(%rsp), %rsi
leaq 0xc0(%rsp), %rdi
callq 0x5b80
jmp 0x102bd
movl 0xbc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xbc(%rsp)
movl 0xb0(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xb0(%rsp)
jmp 0x1023e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xa8(%rsp)
movl %eax, 0xa4(%rsp)
leaq 0xc0(%rsp), %rdi
callq 0x61e0
jmp 0x10554
leaq 0xc0(%rsp), %rdi
callq 0xe000
movsd %xmm0, 0x68(%rsp)
jmp 0x1031f
movq 0xd8(%rsp), %rdi
movslq 0xb4(%rsp), %rsi
callq 0x5750
movl (%rax), %esi
movl $0xa, %edi
callq 0x120f0
movsd %xmm0, 0x60(%rsp)
jmp 0x10348
movsd 0x60(%rsp), %xmm1
movsd 0x68(%rsp), %xmm0
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
callq 0x32f0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, 0x50(%rsp)
movq 0xd8(%rsp), %rdi
movslq 0xb4(%rsp), %rsi
callq 0x5750
movl (%rax), %esi
movl $0xa, %edi
callq 0x120f0
movsd %xmm0, 0x58(%rsp)
jmp 0x10394
movsd 0x58(%rsp), %xmm1
movsd 0x50(%rsp), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, 0x98(%rsp)
leaq 0xc0(%rsp), %rdi
callq 0xde60
movsd %xmm0, 0x48(%rsp)
jmp 0x103c2
movsd 0x48(%rsp), %xmm0
callq 0x3250
movsd %xmm0, 0x38(%rsp)
movq 0x110(%rsp), %rdi
movslq 0xb4(%rsp), %rsi
callq 0x5750
movl (%rax), %esi
movl $0xa, %edi
callq 0x120f0
movsd %xmm0, 0x40(%rsp)
jmp 0x103fc
movsd 0x40(%rsp), %xmm1
movsd 0x38(%rsp), %xmm0
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
callq 0x32f0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, 0x28(%rsp)
movq 0x110(%rsp), %rdi
movslq 0xb4(%rsp), %rsi
callq 0x5750
movl (%rax), %esi
movl $0xa, %edi
callq 0x120f0
movsd %xmm0, 0x30(%rsp)
jmp 0x10448
movsd 0x30(%rsp), %xmm1
movsd 0x28(%rsp), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, 0x90(%rsp)
movsd 0x98(%rsp), %xmm0
movsd %xmm0, 0x18(%rsp)
movq 0xe8(%rsp), %rdi
movslq 0xb4(%rsp), %rsi
callq 0x5bf0
movsd 0x18(%rsp), %xmm0
movsd (%rax), %xmm1
movsd 0x9eb1(%rip), %xmm2     # 0x1a348
callq 0xe140
movb %al, 0x27(%rsp)
jmp 0x104a2
movb 0x27(%rsp), %al
testb $0x1, %al
jne 0x104ac
jmp 0x10501
movsd 0x90(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
movq 0xe0(%rsp), %rdi
movslq 0xb4(%rsp), %rsi
callq 0x5bf0
movsd 0x8(%rsp), %xmm0
movsd (%rax), %xmm1
movsd 0x9e66(%rip), %xmm2     # 0x1a348
callq 0xe140
movb %al, 0x17(%rsp)
jmp 0x104ed
movb 0x17(%rsp), %al
testb $0x1, %al
jne 0x104f7
jmp 0x10501
movb $0x1, 0xbb(%rsp)
jmp 0x1050b
movb $0x0, 0xbb(%rsp)
jmp 0x1052e
leaq 0xc0(%rsp), %rdi
callq 0x5d90
movl 0xb4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xb4(%rsp)
jmp 0x10202
movb 0xbb(%rsp), %al
movb %al, 0x7(%rsp)
leaq 0xc0(%rsp), %rdi
callq 0x61e0
movb 0x7(%rsp), %al
andb $0x1, %al
addq $0x108, %rsp            # imm = 0x108
retq
movq 0xa8(%rsp), %rdi
callq 0x3510
nopw %cs:(%rax,%rax)