// File: /workspace/github_cpp_makefile_star2_O2/drarwood[P]gags/GA.cpp
// Function: InitializeSolutions(int, 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::vector<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::allocator<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>>, int, 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, int>>>&)
void InitializeSolutions(int n, vector<string>& s, vector<vector<string> >& p, map<string,int>& e) {
    // solutions will be a hash containing arrays of subject IDs. 
    // We will score these later by referencing ID to phenotype value
    // Note that N in each solution will be the total N across the groups in which to find specific distributions for. 
    // We will break each solution up into the relevant subsets for scoring and returning. 
    map<string, int> idsSelected;
    int randomIndex;
    for (int i = 0; i < p.size(); ++i) {
        for (int j = 0; j < n; ++j) {
            do {
                randomIndex = rand() % s.size(); // 0 to vector-size -1
            } while (!((idsSelected.find(s[randomIndex]) == idsSelected.end()) && (e.find(s[randomIndex]) == e.end())));
            p[i].push_back(s[randomIndex]);
            idsSelected[s[randomIndex]] = 0;
        }        
        idsSelected.clear();
    }     
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rcx, %rbx
movq %rdx, 0x10(%rsp)
movq %rsi, %r15
leaq 0x30(%rsp), %r14
andl $0x0, (%r14)
andq $0x0, 0x8(%r14)
movq %r14, 0x10(%r14)
movq %r14, 0x18(%r14)
andq $0x0, 0x20(%r14)
leaq 0x8(%rcx), %rbp
xorl %esi, %esi
testl %edi, %edi
cmovlel %esi, %edi
movl %edi, 0x8(%rsp)
leaq 0x28(%rsp), %r12
movq 0x10(%rsp), %rcx
movq 0x8(%rcx), %rax
subq (%rcx), %rax
cqto
pushq $0x18
popq %rcx
idivq %rcx
cmpq %rsi, %rax
jbe 0x6c25
xorl %eax, %eax
movq %rsi, 0x18(%rsp)
imulq $0x18, %rsi, %rcx
movq %rcx, 0x20(%rsp)
movl %eax, 0xc(%rsp)
cmpl 0x8(%rsp), %eax
je 0x6c10
callq 0x30b0
cltq
movq (%r15), %rsi
movq 0x8(%r15), %rcx
subq %rsi, %rcx
sarq $0x5, %rcx
xorl %edx, %edx
divq %rcx
movslq %edx, %r13
shlq $0x5, %r13
addq %r13, %rsi
movq %r12, %rdi
callq 0x7d4e
cmpq %r14, %rax
jne 0x6b9b
movq (%r15), %rsi
addq %r13, %rsi
movq %rbx, %rdi
callq 0x7d4e
cmpq %rbp, %rax
jne 0x6b9b
movq 0x10(%rsp), %rax
movq (%rax), %rdi
addq 0x20(%rsp), %rdi
movq (%r15), %rsi
addq %r13, %rsi
callq 0x7c16
addq (%r15), %r13
movq %r12, %rdi
movq %r13, %rsi
callq 0x4b44
andl $0x0, (%rax)
movl 0xc(%rsp), %eax
incl %eax
jmp 0x6b91
movq %r12, %rdi
callq 0x7f2a
movq 0x18(%rsp), %rsi
incq %rsi
jmp 0x6b64
leaq 0x28(%rsp), %rdi
callq 0x4d5a
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x6c42
jmp 0x6c42
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x4d5a
movq %rbx, %rdi
callq 0x3410