// File: millanek[P]evo/process_vcf_stats_functions.cpp
// Function: initialisePopulationMap(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>>>&)
std::vector<string> initialisePopulationMap(const std::vector<std::string> populations, std::map<std::string,int>& fp_map) {
    std::vector<std::string> pop_unique = populations;
    std::sort(pop_unique.begin(), pop_unique.end());
    std::vector<std::string>::iterator it = std::unique(pop_unique.begin(), pop_unique.end());
    pop_unique.resize(std::distance(pop_unique.begin(), it));
    std::vector<std::string>::size_type n_pop = pop_unique.size();
    // Initialize fields to populations map
    for (int i = 0; i < n_pop; i++) {
        fp_map[pop_unique[i]] = i;
    }
    std::cerr << "Initialised the population map; there are " << n_pop << " populations" << std::endl;
    return pop_unique;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movq %rdi, -0x80(%rbp)
movq %rdi, %rax
movq %rax, -0x88(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movb $0x0, -0x19(%rbp)
callq 0x3fee0
movq -0x80(%rbp), %rdi
callq 0x44030
movq -0x80(%rbp), %rdi
movq %rax, -0x28(%rbp)
callq 0x44060
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x9d660
jmp 0x9bb07
movq -0x80(%rbp), %rdi
callq 0x44030
movq -0x80(%rbp), %rdi
movq %rax, -0x50(%rbp)
callq 0x44060
movq %rax, -0x58(%rbp)
movq -0x50(%rbp), %rdi
movq -0x58(%rbp), %rsi
callq 0x9d6a0
movq %rax, -0x90(%rbp)
jmp 0x9bb37
movq -0x80(%rbp), %rdi
movq -0x90(%rbp), %rax
movq %rax, -0x48(%rbp)
callq 0x44030
movq %rax, -0x60(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x60(%rbp), %rdi
movq -0x68(%rbp), %rsi
callq 0x75450
movq %rax, -0x98(%rbp)
jmp 0x9bb6d
movq -0x98(%rbp), %rsi
movq -0x80(%rbp), %rdi
callq 0x5f8f0
jmp 0x9bb7f
movq -0x80(%rbp), %rdi
callq 0x3ffd0
movq %rax, -0x70(%rbp)
movl $0x0, -0x74(%rbp)
movslq -0x74(%rbp), %rax
cmpq -0x70(%rbp), %rax
jae 0x9bc09
movq -0x80(%rbp), %rdi
movl -0x74(%rbp), %eax
movl %eax, -0xac(%rbp)
movq -0x18(%rbp), %rcx
movq %rcx, -0xa8(%rbp)
movslq %eax, %rsi
callq 0x3d940
movq -0xa8(%rbp), %rdi
movq %rax, %rsi
callq 0x59b00
movq %rax, -0xa0(%rbp)
jmp 0x9bbd5
movq -0xa0(%rbp), %rax
movl -0xac(%rbp), %ecx
movl %ecx, (%rax)
movl -0x74(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x74(%rbp)
jmp 0x9bb93
movq -0x80(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
callq 0x3dfa0
jmp 0x9bc92
movq 0xfd3e0(%rip), %rdi     # 0x198ff0
leaq 0xa1a29(%rip), %rsi     # 0x13d640
callq 0xa5c0
movq %rax, -0xb8(%rbp)
jmp 0x9bc25
movq -0xb8(%rbp), %rdi
movq -0x70(%rbp), %rsi
callq 0xa140
movq %rax, -0xc0(%rbp)
jmp 0x9bc3e
movq -0xc0(%rbp), %rdi
leaq 0xa1a1f(%rip), %rsi     # 0x13d66b
callq 0xa5c0
movq %rax, -0xc8(%rbp)
jmp 0x9bc5a
movq -0xc8(%rbp), %rdi
movq 0xfd320(%rip), %rsi     # 0x198f88
callq 0xa610
jmp 0x9bc6f
movb $0x1, -0x19(%rbp)
testb $0x1, -0x19(%rbp)
jne 0x9bc82
movq -0x80(%rbp), %rdi
callq 0x3dfa0
movq -0x88(%rbp), %rax
addq $0xd0, %rsp
popq %rbp
retq
movq -0x38(%rbp), %rdi
callq 0xab50
nopl (%rax,%rax)