// File: aalto-speech[P]ftk/src/Bigrams.cc
// Function: Bigrams::remove_transitions(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>>, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, double, 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, double>>>, 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, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, double, 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, double>>>>>>&)
void
Bigrams::remove_transitions(vector<string> &to_remove,
                            transitions_t &transitions)
{
    for (auto it = to_remove.begin(); it != to_remove.end(); ++it)
        transitions.erase(*it);

    for (auto srcit = transitions.begin(); srcit != transitions.end(); ++srcit)
        for (auto it = to_remove.begin(); it != to_remove.end(); ++it)
            srcit->second.erase(*it);

    for (auto srcit = transitions.begin(); srcit != transitions.end();)
        if (srcit->second.size() == 0) transitions.erase(srcit++);
        else ++srcit;

    normalize(transitions);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0xb2f0
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
callq 0xb320
movq %rax, -0x20(%rbp)
leaq -0x18(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x11960
testb $0x1, %al
jne 0x5e860
jmp 0x5e888
movq -0x10(%rbp), %rax
movq %rax, -0x68(%rbp)
leaq -0x18(%rbp), %rdi
callq 0x119d0
movq -0x68(%rbp), %rdi
movq %rax, %rsi
callq 0x60a30
leaq -0x18(%rbp), %rdi
callq 0x117f0
jmp 0x5e840
movq -0x10(%rbp), %rdi
callq 0x48b10
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rdi
callq 0x31360
movq %rax, -0x30(%rbp)
leaq -0x28(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x48b40
testb $0x1, %al
jne 0x5e8b5
jmp 0x5e923
movq -0x8(%rbp), %rdi
callq 0xb2f0
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rdi
callq 0xb320
movq %rax, -0x40(%rbp)
leaq -0x38(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x11960
testb $0x1, %al
jne 0x5e8e2
jmp 0x5e913
leaq -0x28(%rbp), %rdi
callq 0x48c10
addq $0x20, %rax
movq %rax, -0x70(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x119d0
movq -0x70(%rbp), %rdi
movq %rax, %rsi
callq 0x60a60
leaq -0x38(%rbp), %rdi
callq 0x117f0
jmp 0x5e8c2
jmp 0x5e915
leaq -0x28(%rbp), %rdi
callq 0x48d60
jmp 0x5e895
movq -0x10(%rbp), %rdi
callq 0x48b10
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rdi
callq 0x31360
movq %rax, -0x50(%rbp)
leaq -0x48(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x48b40
testb $0x1, %al
jne 0x5e950
jmp 0x5e9a0
leaq -0x48(%rbp), %rdi
callq 0x48c10
movq %rax, %rdi
addq $0x20, %rdi
callq 0x5fd0
cmpq $0x0, %rax
jne 0x5e995
movq -0x10(%rbp), %rax
movq %rax, -0x78(%rbp)
leaq -0x48(%rbp), %rdi
xorl %esi, %esi
callq 0x60ad0
movq -0x78(%rbp), %rdi
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rsi
callq 0x60a90
movq %rax, -0x60(%rbp)
jmp 0x5e99e
leaq -0x48(%rbp), %rdi
callq 0x48d60
jmp 0x5e930
movq -0x10(%rbp), %rdi
callq 0x5de90
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)