// File: aalto-speech[P]ftk/src/Bigrams.cc
// Function: Bigrams::collect_trans_stats(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>>, 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&, 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*>>>&, 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>>, 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>>>&, bool)
void
Bigrams::collect_trans_stats(transitions_t &transitions,
                             const map<string, flt_type> &words,
                             map<string, FactorGraph*> &fg_words,
                             transitions_t &trans_stats,
                             map<string, flt_type> &unigram_stats,
                             bool fb)
{
    trans_stats.clear();
    unigram_stats.clear();

    for (auto it = fg_words.begin(); it != fg_words.end(); ++it) {
        transitions_t word_stats;
        if (fb)
            forward_backward(transitions, *it->second, word_stats);
        else
            viterbi(transitions, *it->second, word_stats);
        update_trans_stats(word_stats, words.at(it->first), trans_stats, unigram_stats);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movb %r9b, %al
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
andb $0x1, %al
movb %al, -0x29(%rbp)
movq -0x20(%rbp), %rdi
callq 0x48490
movq -0x28(%rbp), %rdi
callq 0x47d90
movq -0x18(%rbp), %rdi
callq 0x60840
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rdi
callq 0x608a0
movq %rax, -0x40(%rbp)
leaq -0x38(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x60870
testb $0x1, %al
jne 0x5d979
jmp 0x5da63
leaq -0x70(%rbp), %rdi
callq 0x48ab0
testb $0x1, -0x29(%rbp)
je 0x5d9ce
movq -0x8(%rbp), %rax
movq %rax, -0x88(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x608d0
movq -0x88(%rbp), %rdi
movq 0x20(%rax), %rsi
leaq -0x70(%rbp), %rdx
callq 0x42d00
jmp 0x5d9b2
jmp 0x5da02
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x48ad0
jmp 0x5da6c
movq -0x8(%rbp), %rax
movq %rax, -0x90(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x608d0
movq -0x90(%rbp), %rdi
movq 0x20(%rax), %rsi
leaq -0x70(%rbp), %rdx
movsd 0x8d87(%rip), %xmm0     # 0x66780
callq 0x424b0
jmp 0x5da00
jmp 0x5da02
movq -0x10(%rbp), %rax
movq %rax, -0xa0(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x608d0
movq -0xa0(%rbp), %rdi
movq %rax, %rsi
callq 0x48880
movq %rax, -0x98(%rbp)
jmp 0x5da2e
movq -0x98(%rbp), %rax
movsd (%rax), %xmm0
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
leaq -0x70(%rbp), %rdi
callq 0x5d670
jmp 0x5da4c
leaq -0x70(%rbp), %rdi
callq 0x48ad0
leaq -0x38(%rbp), %rdi
callq 0x60900
jmp 0x5d956
addq $0xa0, %rsp
popq %rbp
retq
movq -0x78(%rbp), %rdi
callq 0x46e0
nopw %cs:(%rax,%rax)