// File: /workspace/github_cpp_makefile_star2_O1/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 0x3b608
movq (%rsp), %rcx
leaq 0x18(%rcx), %r15
leaq 0xa8(%rcx), %r12
xorl %esi, %esi
leaq 0x8(%rsp), %r13
leaq 0x9ada(%rip), %rbp      # 0x45026
shlq $0x5, %rsi
addq %rax, %rsi
movq %r15, %rdi
callq 0x3c7bc
movq %rax, %r14
movq %r12, %rdi
movq %r13, %rsi
callq 0x3c810
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 0x3b54c
jmp 0x3b608
movq %rax, %r14
cmpl $0x1, %edx
jne 0x3b7db
movq %r14, %rdi
callq 0x7170
movl $0x14, %edx
movq 0x1ba32(%rip), %rdi     # 0x56fe8
leaq 0x9a54(%rip), %rsi      # 0x45011
callq 0x74b0
movq 0x8(%rsp), %rax
movq (%rbx), %rcx
shlq $0x5, %rax
movq (%rcx,%rax), %rsi
movq 0x8(%rcx,%rax), %rdx
movq 0x1ba0a(%rip), %rdi     # 0x56fe8
callq 0x74b0
movq %rax, %r14
movl $0x34, %edx
movq %rax, %rdi
movq %rbp, %rsi
callq 0x74b0
movq %r14, %rdi
callq 0x71b0
callq 0x76a0
jmp 0x3b574
movq (%rsp), %rax
movq 0x60(%rax), %r15
leaq 0x50(%rax), %r12
cmpq %r12, %r15
je 0x3b751
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 0xdfb6
leaq 0x40(%r15), %rsi
movq %r13, %rdi
callq 0xda38
movq %rbp, %rdi
movq %rbx, %rsi
movq %r13, %rdx
callq 0xcbe4
movq 0x28(%rsp), %rax
cmpq 0x30(%rsp), %rax
jne 0x3b6e9
movl $0x29, %edx
movq 0x1b96b(%rip), %rdi     # 0x56fe8
leaq 0x99d7(%rip), %rsi      # 0x4505b
callq 0x74b0
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq 0x1b94e(%rip), %rdi     # 0x56fe8
callq 0x74b0
movq %rax, %r14
movl $0x1, %edx
movq %rax, %rdi
leaq 0x509e(%rip), %rsi      # 0x4074f
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 0x3b760
movq (%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x3c876
movq %rax, %rdi
movq %rbp, %rsi
callq 0x3c8f2
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x3b719
movq 0x38(%rsp), %rsi
subq %rdi, %rsi
callq 0x7420
movq %r13, %rdi
callq 0xd250
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x3b73d
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x7420
movq %r15, %rdi
callq 0x74d0
movq %rax, %r15
cmpq %r12, %rax
jne 0x3b62c
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x991e(%rip), %rdi      # 0x45085
leaq 0x9926(%rip), %rsi      # 0x45094
leaq 0x9931(%rip), %rcx      # 0x450a6
movl $0x1c, %edx
callq 0x7290
movq %rax, %r14
callq 0x76a0
jmp 0x3b7db
movq %rax, %rdi
callq 0xd650
movq %rax, %r14
jmp 0x3b7bf
movq %rax, %r14
jmp 0x3b7b5
movq %rax, %r14
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x3b7b5
movq 0x38(%rsp), %rsi
subq %rdi, %rsi
callq 0x7420
leaq 0x40(%rsp), %rdi
callq 0xd250
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x3b7db
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x7420
movq %r14, %rdi
callq 0x7740
nop