// File: /workspace/github_cpp_makefile_star2_O1/aalto-speech[P]ftk/src/Bigrams.cc
// Function: Bigrams::iterate_kn(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, double, unsigned int)
flt_type
Bigrams::iterate_kn(const map<string, flt_type> &words,
                    MultiStringFactorGraph &msfg,
                    transitions_t &transitions,
                    bool forward_backward,
                    flt_type D,
                    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);
        kn_smooth(trans_stats, transitions, D);
    }
    return lp;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movsd %xmm0, -0x40(%rbp)
movq %rdi, -0x48(%rbp)
testl %r8d, %r8d
je 0x21a79
movl %r8d, %ebx
movq %rdx, %r14
movq %rsi, %r15
xorl %r13d, %r13d
movzbl %cl, %eax
movl %eax, -0x2c(%rbp)
leaq -0xa8(%rbp), %r12
movl %r13d, -0x70(%rbp)
movq %r13, -0x68(%rbp)
leaq -0x70(%rbp), %rax
movq %rax, -0x60(%rbp)
movq %rax, -0x58(%rbp)
movq %r13, -0x50(%rbp)
movl %r13d, -0xa0(%rbp)
movq %r13, -0x98(%rbp)
leaq -0xa0(%rbp), %rax
movq %rax, -0x90(%rbp)
movq %rax, -0x88(%rbp)
movq %r13, -0x80(%rbp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x19083
movq -0x48(%rbp), %rdi
movq %r15, %rsi
movq %r12, %rdx
leaq -0x78(%rbp), %rcx
movl -0x2c(%rbp), %r8d
callq 0x2161e
movsd %xmm0, -0x38(%rbp)
movq %r12, %rdi
movq %r14, %rsi
movsd -0x40(%rbp), %xmm0
movsd 0x4e54(%rip), %xmm1     # 0x268a8
callq 0x21aae
movq %r12, %rdi
callq 0x1b9da
leaq -0x78(%rbp), %rdi
callq 0x5cea
decl %ebx
jne 0x219db
movsd -0x38(%rbp), %xmm0
jmp 0x21a7c
xorps %xmm0, %xmm0
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0xa8(%rbp), %rdi
callq 0x1b9da
leaq -0x78(%rbp), %rdi
callq 0x5cea
movq %rbx, %rdi
callq 0x4650