// File: aalto-speech[P]ftk/src/iterate12.cc
// Function: prune_msfg(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>>> const&, MultiStringFactorGraph&)
void prune_msfg(const map<string, flt_type> &vocab,
                MultiStringFactorGraph &msfg)
{
    if (vocab.size() < msfg.factor_node_map.size()) {
        vector<string> to_remove;
        cerr << "Pruning " << msfg.factor_node_map.size()-vocab.size() << " unused transitions from msfg." << endl;
        for (auto it = msfg.factor_node_map.begin(); it != msfg.factor_node_map.end(); ++it)
            if (vocab.find(it->first) == vocab.end())
                to_remove.push_back(it->first);
        for (auto it = to_remove.begin(); it != to_remove.end(); ++it)
            msfg.remove_arcs(*it);
        cerr << "Removed " << to_remove.size() << " subwords" << endl;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0x7f60
movq %rax, -0x70(%rbp)
movq -0x10(%rbp), %rdi
addq $0x98, %rdi
callq 0x7f80
movq %rax, %rcx
movq -0x70(%rbp), %rax
cmpq %rcx, %rax
jae 0x6227
leaq -0x28(%rbp), %rdi
callq 0x7fa0
movq 0x90fe8(%rip), %rdi     # 0x96fe8
leaq 0x62013(%rip), %rsi     # 0x6801a
callq 0x53d0
movq %rax, -0x78(%rbp)
jmp 0x6012
movq -0x10(%rbp), %rdi
addq $0x98, %rdi
callq 0x7f80
movq %rax, -0x88(%rbp)
movq -0x8(%rbp), %rdi
callq 0x7f60
movq -0x88(%rbp), %rsi
movq -0x78(%rbp), %rdi
subq %rax, %rsi
callq 0x50f0
movq %rax, -0x80(%rbp)
jmp 0x604b
movq -0x80(%rbp), %rdi
leaq 0x61fcd(%rip), %rsi     # 0x68023
callq 0x53d0
movq %rax, -0x90(%rbp)
jmp 0x6064
movq -0x90(%rbp), %rdi
movq 0x90f26(%rip), %rsi     # 0x96f98
callq 0x5410
jmp 0x6079
movq -0x10(%rbp), %rdi
addq $0x98, %rdi
callq 0x7fc0
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rdi
addq $0x98, %rdi
callq 0x8020
movq %rax, -0x48(%rbp)
leaq -0x40(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x7ff0
testb $0x1, %al
jne 0x60b7
jmp 0x6151
movq -0x8(%rbp), %rax
movq %rax, -0xa0(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x80b0
movq -0xa0(%rbp), %rdi
movq %rax, %rsi
callq 0x8080
movq %rax, -0x98(%rbp)
jmp 0x60e3
movq -0x98(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x8(%rbp), %rdi
callq 0x80d0
movq %rax, -0x58(%rbp)
leaq -0x50(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x8050
testb $0x1, %al
jne 0x610e
jmp 0x6141
leaq -0x40(%rbp), %rdi
callq 0x80b0
movq %rax, %rsi
leaq -0x28(%rbp), %rdi
callq 0x8100
jmp 0x6125
jmp 0x6141
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x82a0
jmp 0x6230
jmp 0x6143
leaq -0x40(%rbp), %rdi
callq 0x8170
jmp 0x608d
leaq -0x28(%rbp), %rdi
callq 0x81a0
movq %rax, -0x60(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x8210
movq %rax, -0x68(%rbp)
leaq -0x60(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x81d0
testb $0x1, %al
jne 0x617e
jmp 0x61b0
movq -0x10(%rbp), %rax
movq %rax, -0xa8(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x8240
movq -0xa8(%rbp), %rdi
movq %rax, %rsi
callq 0x34e40
jmp 0x61a3
jmp 0x61a5
leaq -0x60(%rbp), %rdi
callq 0x8260
jmp 0x615e
movq 0x90e31(%rip), %rdi     # 0x96fe8
leaq 0x61e84(%rip), %rsi     # 0x68042
callq 0x53d0
movq %rax, -0xb0(%rbp)
jmp 0x61cc
leaq -0x28(%rbp), %rdi
callq 0x8280
movq -0xb0(%rbp), %rdi
movq %rax, %rsi
callq 0x50f0
movq %rax, -0xb8(%rbp)
jmp 0x61ed
movq -0xb8(%rbp), %rdi
leaq 0x61e50(%rip), %rsi     # 0x6804b
callq 0x53d0
movq %rax, -0xc0(%rbp)
jmp 0x6209
movq -0xc0(%rbp), %rdi
movq 0x90d81(%rip), %rsi     # 0x96f98
callq 0x5410
jmp 0x621e
leaq -0x28(%rbp), %rdi
callq 0x82a0
addq $0xc0, %rsp
popq %rbp
retq
movq -0x30(%rbp), %rdi
callq 0x5700
nopl (%rax)