// File: /workspace/github_cpp_makefile_star2_O3/millanek[P]Dsuite/Dsuite_common.cpp
// Function: SetInformation::linkSetsAndVCFpositions(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>>>> const&)
void SetInformation::linkSetsAndVCFpositions(const std::vector<std::string>& sampleNames) {
    // print_vector_stream(sampleNames, std::cerr);
    for (std::vector<std::string>::size_type i = 0; i != sampleNames.size(); i++) {
        try { posToPopMap[i] = IDsToPopMap.at(sampleNames[i]); } catch (const std::out_of_range& oor) {
            std::cerr << "WARNING: The sample " << sampleNames[i] << " is in the VCF but not assigned in the SETS.txt file" << std::endl;
        }
    }
    // Iterate over all the keys in the map to find the samples in the VCF:
    // Give an error if no sample is found for a species:
    for(std::map<string, std::vector<string>>::const_iterator it = popToIDsMap.begin(); it != popToIDsMap.end(); ++it) {
        string sp =  it->first;
        //std::cerr << "sp " << sp << std::endl;
        std::vector<string> IDs = it->second;
        std::vector<size_t> spPos = locateSet(sampleNames, IDs); 
        if (spPos.empty()) {
            std::cerr << "Did not find any samples in the VCF for \"" << sp << "\"" << std::endl;
            assert(!spPos.empty());
        }
        popToPosMap[sp] = spPos;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rsi, %rbx
movq %rdi, (%rsp)
movq $0x0, 0x8(%rsp)
movq (%rsi), %rax
cmpq %rax, 0x8(%rsi)
je 0x3bfc0
movq (%rsp), %rcx
leaq 0x18(%rcx), %r15
leaq 0xa8(%rcx), %r12
xorl %esi, %esi
leaq 0x8(%rsp), %r13
leaq 0xa1b2(%rip), %rbp      # 0x460b6
shlq $0x5, %rsi
addq %rax, %rsi
movq %r15, %rdi
callq 0x3d16c
movq %rax, %r14
movq %r12, %rdi
movq %r13, %rsi
callq 0x3d1c0
movq %rax, %rdi
movq %r14, %rsi
callq 0x7210
movq 0x8(%rsp), %rsi
incq %rsi
movq %rsi, 0x8(%rsp)
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
subq %rax, %rcx
sarq $0x5, %rcx
cmpq %rcx, %rsi
jne 0x3bf04
jmp 0x3bfc0
movq %rax, %r14
cmpl $0x1, %edx
jne 0x3c193
movq %r14, %rdi
callq 0x7170
movl $0x14, %edx
movq 0x1c07a(%rip), %rdi     # 0x57fe8
leaq 0xa12c(%rip), %rsi      # 0x460a1
callq 0x74b0
movq 0x8(%rsp), %rax
movq (%rbx), %rcx
shlq $0x5, %rax
movq (%rcx,%rax), %rsi
movq 0x8(%rcx,%rax), %rdx
movq 0x1c052(%rip), %rdi     # 0x57fe8
callq 0x74b0
movq %rax, %r14
movl $0x34, %edx
movq %rax, %rdi
movq %rbp, %rsi
callq 0x74b0
movq %r14, %rdi
callq 0x71b0
callq 0x76a0
jmp 0x3bf2c
movq (%rsp), %rax
movq 0x60(%rax), %r15
leaq 0x50(%rax), %r12
cmpq %r12, %r15
je 0x3c109
addq $0x78, (%rsp)
leaq 0x40(%rsp), %r13
leaq 0x28(%rsp), %rbp
leaq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x20(%r15), %rsi
movq 0x28(%r15), %rdx
addq %rsi, %rdx
leaq 0x8(%rsp), %rdi
callq 0xdf1c
leaq 0x40(%r15), %rsi
movq %r13, %rdi
callq 0xd99e
movq %rbp, %rdi
movq %rbx, %rsi
movq %r13, %rdx
callq 0xcb41
movq 0x28(%rsp), %rax
cmpq 0x30(%rsp), %rax
jne 0x3c0a1
movl $0x29, %edx
movq 0x1bfb3(%rip), %rdi     # 0x57fe8
leaq 0xa0af(%rip), %rsi      # 0x460eb
callq 0x74b0
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq 0x1bf96(%rip), %rdi     # 0x57fe8
callq 0x74b0
movq %rax, %r14
movl $0x1, %edx
movq %rax, %rdi
leaq 0x5736(%rip), %rsi      # 0x4179f
callq 0x74b0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x73f0
movsbl %al, %esi
movq %r14, %rdi
callq 0x7040
movq %rax, %rdi
callq 0x72e0
movq 0x28(%rsp), %rax
cmpq 0x30(%rsp), %rax
je 0x3c118
movq (%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x3d226
movq %rax, %rdi
movq %rbp, %rsi
callq 0x3d2a2
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x3c0d1
movq 0x38(%rsp), %rsi
subq %rdi, %rsi
callq 0x7420
movq %r13, %rdi
callq 0xd1ac
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x3c0f5
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x7420
movq %r15, %rdi
callq 0x74d0
movq %rax, %r15
cmpq %r12, %rax
jne 0x3bfe4
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x9ff6(%rip), %rdi      # 0x46115
leaq 0x9ffe(%rip), %rsi      # 0x46124
leaq 0xa009(%rip), %rcx      # 0x46136
movl $0x1c, %edx
callq 0x7290
movq %rax, %r14
callq 0x76a0
jmp 0x3c193
movq %rax, %rdi
callq 0xd5b6
movq %rax, %r14
jmp 0x3c177
movq %rax, %r14
jmp 0x3c16d
movq %rax, %r14
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x3c16d
movq 0x38(%rsp), %rsi
subq %rdi, %rsi
callq 0x7420
leaq 0x40(%rsp), %rdi
callq 0xd1ac
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x3c193
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x7420
movq %r14, %rdi
callq 0x7740
nop