// File: /workspace/github_cpp_makefile_star2_O2/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
movl %r8d, %ebx
movsd %xmm0, -0x40(%rbp)
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, -0x48(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x38(%rbp)
movzbl %cl, %eax
movl %eax, -0x2c(%rbp)
leaq -0x78(%rbp), %r12
leaq -0xa8(%rbp), %r13
subl $0x1, %ebx
jb 0x1f3d4
andl $0x0, -0xa0(%rbp)
andq $0x0, -0x98(%rbp)
leaq -0xa0(%rbp), %rax
movq %rax, -0x90(%rbp)
movq %rax, -0x88(%rbp)
andq $0x0, -0x80(%rbp)
andl $0x0, -0x70(%rbp)
andq $0x0, -0x68(%rbp)
leaq -0x70(%rbp), %rax
movq %rax, -0x60(%rbp)
movq %rax, -0x58(%rbp)
andq $0x0, -0x50(%rbp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x17336
movq -0x48(%rbp), %rdi
movq %r15, %rsi
movq %r12, %rdx
movq %r13, %rcx
movl -0x2c(%rbp), %r8d
callq 0x1efe6
movsd %xmm0, -0x38(%rbp)
movq %r12, %rdi
movq %r14, %rsi
movsd -0x40(%rbp), %xmm0
movsd 0x447e(%rip), %xmm1     # 0x23838
callq 0x1f40c
movq %r12, %rdi
callq 0x19564
movq %r13, %rdi
callq 0x543e
jmp 0x1f335
movsd -0x38(%rbp), %xmm0
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x78(%rbp), %rdi
callq 0x19564
leaq -0xa8(%rbp), %rdi
callq 0x543e
movq %rbx, %rdi
callq 0x45f0
nop