// File: 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
movq %rsp, %rbp
subq $0x110, %rsp            # imm = 0x110
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xa8(%rbp)
movq $0x0, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0xb0(%rbp)
movq -0x10(%rbp), %rdi
callq 0x10740
movq %rax, %rcx
movq -0xb0(%rbp), %rax
cmpq %rcx, %rax
je 0x7f599
movq -0xa8(%rbp), %rax
addq $0x18, %rax
movq %rax, -0xc0(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x10720
movq -0xc0(%rbp), %rdi
movq %rax, %rsi
callq 0x806c0
movq %rax, -0xb8(%rbp)
jmp 0x7f494
movq -0xa8(%rbp), %rdi
addq $0xa8, %rdi
leaq -0x18(%rbp), %rsi
callq 0x80760
movq %rax, -0xc8(%rbp)
jmp 0x7f4b4
movq -0xb8(%rbp), %rsi
movq -0xc8(%rbp), %rdi
callq 0x8070
jmp 0x7f4c9
jmp 0x7f56e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0x7f7b3
movq -0x20(%rbp), %rdi
callq 0x8220
movq %rax, -0x30(%rbp)
movq 0x3faf2(%rip), %rdi     # 0xbeff0
leaq 0xde29(%rip), %rsi      # 0x8d32e
callq 0x8590
movq %rax, -0xd0(%rbp)
jmp 0x7f513
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x10720
movq -0xd0(%rbp), %rdi
movq %rax, %rsi
callq 0x8520
movq %rax, -0xd8(%rbp)
jmp 0x7f538
movq -0xd8(%rbp), %rdi
leaq 0xddfd(%rip), %rsi      # 0x8d343
callq 0x8590
movq %rax, -0xe0(%rbp)
jmp 0x7f554
movq -0xe0(%rbp), %rdi
movq 0x3f9fe(%rip), %rsi     # 0xbef60
callq 0x85f0
jmp 0x7f569
callq 0x8950
jmp 0x7f570
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x7f436
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
callq 0x8950
jmp 0x7f594
jmp 0x7f7b3
movq -0xa8(%rbp), %rdi
addq $0x48, %rdi
callq 0x22380
movq %rax, -0x40(%rbp)
leaq -0x38(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x22ac0
movq -0xa8(%rbp), %rdi
addq $0x48, %rdi
callq 0x223e0
movq %rax, -0x50(%rbp)
leaq -0x48(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x22ac0
leaq -0x38(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x80840
testb $0x1, %al
jne 0x7f5f1
jmp 0x7f7aa
leaq -0x38(%rbp), %rdi
movq %rdi, -0xe8(%rbp)
callq 0x80870
movq %rax, %rsi
leaq -0x70(%rbp), %rdi
callq 0x8250
movq -0xe8(%rbp), %rdi
callq 0x80870
movq %rax, %rsi
addq $0x20, %rsi
leaq -0x88(%rbp), %rdi
callq 0x11fc0
jmp 0x7f62e
movq -0x10(%rbp), %rsi
leaq -0xa0(%rbp), %rdi
leaq -0x88(%rbp), %rdx
callq 0xfa20
jmp 0x7f647
leaq -0xa0(%rbp), %rdi
callq 0x808a0
testb $0x1, %al
jne 0x7f65c
jmp 0x7f732
movq 0x3f98d(%rip), %rdi     # 0xbeff0
leaq 0xdd0e(%rip), %rsi      # 0x8d378
callq 0x8590
movq %rax, -0xf0(%rbp)
jmp 0x7f678
movq -0xf0(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x8520
movq %rax, -0xf8(%rbp)
jmp 0x7f691
movq -0xf8(%rbp), %rdi
leaq 0x90b8(%rip), %rsi      # 0x88757
callq 0x8590
movq %rax, -0x100(%rbp)
jmp 0x7f6ad
movq -0x100(%rbp), %rdi
movq 0x3f8a5(%rip), %rsi     # 0xbef60
callq 0x85f0
jmp 0x7f6c2
leaq -0xa0(%rbp), %rdi
callq 0x808a0
xorb $-0x1, %al
testb $0x1, %al
jne 0x7f6d6
jmp 0x7f6d8
jmp 0x7f730
leaq 0xdcc3(%rip), %rdi      # 0x8d3a2
leaq 0xdccb(%rip), %rsi      # 0x8d3b1
movl $0x1c, %edx
leaq 0xdcd1(%rip), %rcx      # 0x8d3c3
callq 0x83b0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x7f79f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x7f793
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0x12160
jmp 0x7f793
jmp 0x7f732
movq -0xa8(%rbp), %rdi
addq $0x78, %rdi
leaq -0x70(%rbp), %rsi
callq 0x808e0
movq %rax, -0x108(%rbp)
jmp 0x7f74f
movq -0x108(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x809c0
jmp 0x7f764
leaq -0xa0(%rbp), %rdi
callq 0x12160
leaq -0x88(%rbp), %rdi
callq 0x10760
leaq -0x70(%rbp), %rdi
callq 0x8c08
leaq -0x38(%rbp), %rdi
callq 0x80c10
jmp 0x7f5ba
leaq -0x88(%rbp), %rdi
callq 0x10760
leaq -0x70(%rbp), %rdi
callq 0x8c08
jmp 0x7f7b3
addq $0x110, %rsp            # imm = 0x110
popq %rbp
retq
movq -0x20(%rbp), %rdi
callq 0x8a50
movq %rax, %rdi
callq 0x9d40
nopw %cs:(%rax,%rax)