// File: millanek[P]evo/process_vcf_reorder.cpp
// Function: linkVectors(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&, 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<string,size_t> linkVectors(const std::vector<string>& newOrder, const std::vector<string> oldOrder) {
    std::map<string,size_t> link;
    for (std::vector<string>::size_type i = 0; i != newOrder.size(); i++) {
        std::vector<string>::const_iterator it = std::find(oldOrder.begin(), oldOrder.end(), newOrder[i]);
        if (it == oldOrder.end()) {
            if (opt::sampleNameFile.empty())
                std::cerr << "The column names in NEW_ORDER_FILE.txt do not correspond to names in the VCF header" << std::endl;
            else
                std::cerr << "The column names in NEW_ORDER_FILE.txt do not correspond to names in " << opt::sampleNameFile << std::endl;
            exit(1);
        }
        size_t pos = std::distance(oldOrder.begin(), it);
        link[oldOrder[i]] = pos;
    }
    return link;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movq %rdx, -0x88(%rbp)
movq %rdi, -0x80(%rbp)
movq %rdi, %rax
movq %rax, -0x78(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movb $0x0, -0x19(%rbp)
callq 0xd4280
movq $0x0, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x10(%rbp), %rdi
callq 0x3ffd0
movq %rax, %rcx
movq -0x90(%rbp), %rax
cmpq %rcx, %rax
je 0xd350b
movq -0x88(%rbp), %rdi
callq 0x400f0
movq -0x88(%rbp), %rdi
movq %rax, -0x38(%rbp)
callq 0x40120
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x52960
movq %rax, %rdx
movq -0x38(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0xd42a0
movq %rax, -0x98(%rbp)
jmp 0xd3397
movq -0x88(%rbp), %rdi
movq -0x98(%rbp), %rax
movq %rax, -0x30(%rbp)
callq 0x40120
movq %rax, -0x58(%rbp)
leaq -0x30(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x75ce0
testb $0x1, %al
jne 0xd33c8
jmp 0xd3480
leaq 0xc7a09(%rip), %rdi     # 0x19add8
callq 0xaa70
testb $0x1, %al
jne 0xd33da
jmp 0xd3427
movq 0xc5c0f(%rip), %rdi     # 0x198ff0
leaq 0x73338(%rip), %rsi     # 0x146720
callq 0xa5c0
movq %rax, -0xa0(%rbp)
jmp 0xd33f6
movq -0xa0(%rbp), %rdi
movq 0xc5b84(%rip), %rsi     # 0x198f88
callq 0xa610
jmp 0xd340b
jmp 0xd3476
movq -0x80(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
callq 0xd4410
jmp 0xd352b
movq 0xc5bc2(%rip), %rdi     # 0x198ff0
leaq 0x7333f(%rip), %rsi     # 0x146774
callq 0xa5c0
movq %rax, -0xa8(%rbp)
jmp 0xd3443
movq -0xa8(%rbp), %rdi
leaq 0xc7987(%rip), %rsi     # 0x19add8
callq 0xa520
movq %rax, -0xb0(%rbp)
jmp 0xd345f
movq -0xb0(%rbp), %rdi
movq 0xc5b1b(%rip), %rsi     # 0x198f88
callq 0xa610
jmp 0xd3474
jmp 0xd3476
movl $0x1, %edi
callq 0xa700
movq -0x88(%rbp), %rdi
callq 0x400f0
movq %rax, -0x68(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x68(%rbp), %rdi
movq -0x70(%rbp), %rsi
callq 0xd42f0
movq %rax, -0xb8(%rbp)
jmp 0xd34ae
movq -0x88(%rbp), %rdi
movq -0xb8(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
movq %rax, -0xc8(%rbp)
movq -0x28(%rbp), %rsi
callq 0x52960
movq -0x80(%rbp), %rdi
movq %rax, %rsi
callq 0xd4330
movq %rax, -0xc0(%rbp)
jmp 0xd34e9
movq -0xc0(%rbp), %rax
movq -0xc8(%rbp), %rcx
movq %rcx, (%rax)
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0xd332a
movb $0x1, -0x19(%rbp)
testb $0x1, -0x19(%rbp)
jne 0xd351e
movq -0x80(%rbp), %rdi
callq 0xd4410
movq -0x78(%rbp), %rax
addq $0xd0, %rsp
popq %rbp
retq
movq -0x48(%rbp), %rdi
callq 0xab50
nopw %cs:(%rax,%rax)