// File: /workspace/github_cpp_makefile_star2_O1/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
movq %rdi, -0x40(%rbp)
testl %r8d, %r8d
je 0x215eb
movl %r8d, %ebx
movq %rsi, %r14
movzbl %cl, %eax
movl %eax, -0x2c(%rbp)
xorl %ecx, %ecx
movl %ecx, -0x98(%rbp)
movq %rcx, -0x90(%rbp)
leaq -0x98(%rbp), %rax
movq %rax, -0x88(%rbp)
movq %rax, -0x80(%rbp)
movq %rcx, -0x78(%rbp)
movl %ecx, -0x68(%rbp)
movq %rcx, -0x60(%rbp)
leaq -0x68(%rbp), %rax
movq %rax, -0x58(%rbp)
movq %rax, -0x50(%rbp)
movq %rcx, -0x48(%rbp)
movq %rdx, %r13
movq %rdx, %rdi
movq %r14, %rsi
callq 0x19083
leaq -0xa0(%rbp), %r12
leaq -0x70(%rbp), %r15
movq -0x40(%rbp), %rdi
movq %r14, %rsi
movq %r15, %rdx
movq %r12, %rcx
movl -0x2c(%rbp), %r8d
callq 0x2161e
movsd %xmm0, -0x38(%rbp)
movq %r13, %rdi
movq %r15, %rsi
callq 0x23e12
movq %r13, %rdi
movsd 0x52e4(%rip), %xmm0     # 0x268a8
callq 0x217e8
movq %r15, %rdi
callq 0x1b9da
movq %r12, %rdi
callq 0x5cea
decl %ebx
movq %r13, %rdx
jne 0x2153e
movsd -0x38(%rbp), %xmm0
jmp 0x215ee
xorps %xmm0, %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 0x1b9da
leaq -0xa0(%rbp), %rdi
callq 0x5cea
movq %rbx, %rdi
callq 0x4650
nop