// File: /workspace/github_cpp_makefile_star2_O3/aalto-speech[P]ftk/src/Bigrams.cc
// Function: Bigrams::cutoff(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&, double, 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>>>>>>&, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, FactorGraph*, 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, FactorGraph*>>>&)
int
Bigrams::cutoff(const map<string, flt_type> &unigram_stats,
                flt_type cutoff,
                transitions_t &transitions,
                map<string, FactorGraph*> &fg_words)
{
    vector<string> to_remove;
    for (auto it = unigram_stats.begin(); it != unigram_stats.end(); ++it)
        if (it->second < cutoff && it->first.length() > 2) to_remove.push_back(it->first);

    remove_transitions(to_remove, transitions);

    for (auto fgit = fg_words.begin(); fgit != fg_words.end(); ++fgit) {
        for (unsigned int i=0; i<to_remove.size(); i++) {
            size_t found = fgit->first.find(to_remove[i]);
            if (found != std::string::npos) fgit->second->remove_arcs(to_remove[i]);
        }
    }

    return to_remove.size();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movsd %xmm0, -0x30(%rbp)
movq %rdi, %r15
xorpd %xmm0, %xmm0
movapd %xmm0, -0x50(%rbp)
movq $0x0, -0x40(%rbp)
movq 0x18(%rdi), %r12
addq $0x8, %r15
cmpq %r15, %r12
je 0x228fa
leaq -0x50(%rbp), %r13
movsd -0x30(%rbp), %xmm0
ucomisd 0x40(%r12), %xmm0
jbe 0x228ea
cmpq $0x3, 0x28(%r12)
jb 0x228ea
leaq 0x20(%r12), %rsi
movq %r13, %rdi
callq 0x7f60
movq %r12, %rdi
callq 0x4410
movq %rax, %r12
cmpq %r15, %rax
jne 0x228c7
leaq -0x50(%rbp), %rdi
movq %r14, %rsi
callq 0x227ac
movq %rbx, %rax
movq 0x18(%rbx), %rcx
addq $0x8, %rax
movq -0x50(%rbp), %r15
movq -0x48(%rbp), %rbx
movq %rax, -0x58(%rbp)
movq %rcx, -0x30(%rbp)
cmpq %rax, %rcx
je 0x229a2
cmpq %r15, %rbx
je 0x2298c
movq -0x30(%rbp), %rax
leaq 0x20(%rax), %r12
movl $0x1, %r14d
xorl %r13d, %r13d
shlq $0x5, %r13
movq (%r15,%r13), %rsi
movq 0x8(%r15,%r13), %rcx
movq %r12, %rdi
xorl %edx, %edx
callq 0x4630
cmpq $-0x1, %rax
je 0x2296d
movq -0x30(%rbp), %rax
movq 0x40(%rax), %rdi
addq -0x50(%rbp), %r13
movq %r13, %rsi
callq 0xf898
movl %r14d, %r13d
movq -0x50(%rbp), %r15
movq -0x48(%rbp), %rbx
movq %rbx, %rax
subq %r15, %rax
sarq $0x5, %rax
incl %r14d
cmpq %r13, %rax
ja 0x2293c
jmp 0x2298f
movq %r15, %rbx
movq -0x30(%rbp), %rdi
callq 0x4280
movq %rax, -0x30(%rbp)
cmpq -0x58(%rbp), %rax
jne 0x22926
subq %r15, %rbx
shrq $0x5, %rbx
leaq -0x50(%rbp), %rdi
callq 0x5d4e
movl %ebx, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x229c7
jmp 0x229c7
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x5d4e
movq %rbx, %rdi
callq 0x4650
nop