// File: /workspace/github_cpp_makefile_star2_O2/aalto-speech[P]ftk/src/Bigrams.cc
// Function: Bigrams::iterate(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&, 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>>>>>>&, bool, unsigned int)
flt_type
Bigrams::iterate(const map<string, flt_type> &words,
                 MultiStringFactorGraph &msfg,
                 transitions_t &transitions,
                 bool forward_backward,
                 unsigned int iterations)
{
    flt_type lp=0.0;
    for (unsigned int i=0; i<iterations; i++) {
        map<string, flt_type> unigram_stats;
        transitions_t trans_stats;
        assign_scores(transitions, msfg);
        lp = collect_trans_stats(words, msfg, trans_stats, unigram_stats, forward_backward);
        transitions.swap(trans_stats);
        Bigrams::freqs_to_logprobs(transitions);
    }
    return lp;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movl %r8d, %ebx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, -0x40(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x38(%rbp)
movzbl %cl, %eax
movl %eax, -0x2c(%rbp)
leaq -0x70(%rbp), %r12
leaq -0xa0(%rbp), %r13
subl $0x1, %ebx
jb 0x1efb2
andl $0x0, -0x98(%rbp)
andq $0x0, -0x90(%rbp)
leaq -0x98(%rbp), %rax
movq %rax, -0x88(%rbp)
movq %rax, -0x80(%rbp)
andq $0x0, -0x78(%rbp)
andl $0x0, -0x68(%rbp)
andq $0x0, -0x60(%rbp)
leaq -0x68(%rbp), %rax
movq %rax, -0x58(%rbp)
movq %rax, -0x50(%rbp)
andq $0x0, -0x48(%rbp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x17336
movq -0x40(%rbp), %rdi
movq %r15, %rsi
movq %r12, %rdx
movq %r13, %rcx
movl -0x2c(%rbp), %r8d
callq 0x1efe6
movsd %xmm0, -0x38(%rbp)
movq %r14, %rdi
movq %r12, %rsi
callq 0x213a6
movq %r14, %rdi
movsd 0x48a0(%rip), %xmm0     # 0x23838
callq 0x1f19c
movq %r12, %rdi
callq 0x19564
movq %r13, %rdi
callq 0x543e
jmp 0x1ef13
movsd -0x38(%rbp), %xmm0
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x70(%rbp), %rdi
callq 0x19564
leaq -0xa0(%rbp), %rdi
callq 0x543e
movq %rbx, %rdi
callq 0x45f0