// File: /workspace/github_cpp_makefile_star2_O3/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 0x21413
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 0x18f66
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 0x21446
movsd %xmm0, -0x38(%rbp)
movq %r13, %rdi
movq %r15, %rsi
callq 0x23c88
movq %r13, %rdi
movsd 0x54bc(%rip), %xmm0     # 0x268a8
callq 0x21610
movq %r15, %rdi
callq 0x1b8ec
movq %r12, %rdi
callq 0x5ce4
decl %ebx
movq %r13, %rdx
jne 0x21366
movsd -0x38(%rbp), %xmm0
jmp 0x21416
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 0x1b8ec
leaq -0xa0(%rbp), %rdi
callq 0x5ce4
movq %rbx, %rdi
callq 0x4650
nop