// File: /workspace/github_cpp_makefile_star2_O3/aalto-speech[P]ftk/src/EM.cc
// Function: forward(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 const&, std::set<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>> const&, bool)
flt_type
forward(const map<string, flt_type> &words,
        const MultiStringFactorGraph &msfg,
        const set<string> &words_to_fb,
        bool full_forward_pass)
{
    flt_type total_lp = 0.0;

    if (full_forward_pass) {
        vector<flt_type> fw;
        forward(msfg, fw);
        for (auto wit = words_to_fb.cbegin(); wit != words_to_fb.cend(); ++wit)
            total_lp += words.at(*wit) * fw.at(msfg.string_end_nodes.at(*wit));
    }
    else {
        for (auto wit = words_to_fb.cbegin(); wit != words_to_fb.cend(); ++wit) {
            map<msfg_node_idx_t, flt_type> fw;
            total_lp += words.at(*wit) * forward(*wit, msfg, fw);
        }
    }

    return total_lp;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
testl %ecx, %ecx
je 0x19811
xorpd %xmm0, %xmm0
leaq -0x70(%rbp), %rsi
movapd %xmm0, (%rsi)
movq $0x0, 0x10(%rsi)
movq %r14, %rdi
callq 0x193e4
movq 0x18(%rbx), %r12
addq $0x8, %rbx
cmpq %rbx, %r12
je 0x198a9
addq $0x38, %r14
xorpd %xmm0, %xmm0
movsd %xmm0, -0x30(%rbp)
leaq 0x20(%r12), %r13
movq %r15, %rdi
movq %r13, %rsi
callq 0x1b3f6
movsd (%rax), %xmm0
movsd %xmm0, -0x38(%rbp)
movq %r14, %rdi
movq %r13, %rsi
callq 0x138da
movl (%rax), %esi
movq -0x70(%rbp), %r13
movq -0x68(%rbp), %rdx
subq %r13, %rdx
sarq $0x3, %rdx
cmpq %rsi, %rdx
jbe 0x198c6
movsd -0x38(%rbp), %xmm1
mulsd (%r13,%rsi,8), %xmm1
movsd -0x30(%rbp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x30(%rbp)
movq %r12, %rdi
callq 0x4410
movq %rax, %r12
cmpq %rbx, %rax
jne 0x1979c
movq %r13, %rdi
callq 0x4350
jmp 0x198b2
movq 0x18(%rbx), %r12
addq $0x8, %rbx
cmpq %rbx, %r12
je 0x198a9
movq %r15, -0x78(%rbp)
xorpd %xmm0, %xmm0
movsd %xmm0, -0x30(%rbp)
leaq -0x70(%rbp), %r13
movl $0x0, -0x68(%rbp)
xorl %ecx, %ecx
movq %rcx, -0x60(%rbp)
leaq -0x68(%rbp), %rax
movq %rax, -0x58(%rbp)
movq %rax, -0x50(%rbp)
movq %rcx, -0x48(%rbp)
leaq 0x20(%r12), %r15
movq -0x78(%rbp), %rdi
movq %r15, %rsi
callq 0x1b3f6
movsd (%rax), %xmm0
movsd %xmm0, -0x38(%rbp)
movq %r15, %rdi
movq %r14, %rsi
movq %r13, %rdx
callq 0x19512
movsd -0x38(%rbp), %xmm1
mulsd %xmm0, %xmm1
movsd -0x30(%rbp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x30(%rbp)
movq %r13, %rdi
callq 0x1ba0a
movq %r12, %rdi
callq 0x4410
movq %rax, %r12
cmpq %rbx, %rax
jne 0x19833
jmp 0x198b2
xorpd %xmm0, %xmm0
movsd %xmm0, -0x30(%rbp)
movsd -0x30(%rbp), %xmm0
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xcf89(%rip), %rdi      # 0x26856
xorl %eax, %eax
callq 0x4530
movq %rax, %rbx
jmp 0x198e0
movq %rax, %rbx
movq -0x70(%rbp), %r13
testq %r13, %r13
je 0x198fb
movq %r13, %rdi
callq 0x4350
jmp 0x198fb
movq %rax, %rbx
leaq -0x70(%rbp), %rdi
callq 0x1ba0a
movq %rbx, %rdi
callq 0x4650