// File: /workspace/github_cpp_makefile_star2_O2/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 $0x48, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, -0x40(%rbp)
testl %ecx, %ecx
je 0x17a55
xorpd %xmm0, %xmm0
leaq -0x70(%rbp), %r15
movapd %xmm0, (%r15)
andq $0x0, 0x10(%r15)
movq %r14, %rdi
movq %r15, %rsi
callq 0x17729
movq 0x18(%rbx), %r13
addq $0x8, %rbx
addq $0x38, %r14
xorpd %xmm0, %xmm0
movsd %xmm0, -0x30(%rbp)
cmpq %rbx, %r13
je 0x17add
leaq 0x20(%r13), %r12
movq -0x40(%rbp), %rdi
movq %r12, %rsi
callq 0x19102
movsd (%rax), %xmm0
movsd %xmm0, -0x38(%rbp)
movq %r14, %rdi
movq %r12, %rsi
callq 0x11d8e
movl (%rax), %esi
movq %r15, %rdi
callq 0x19370
movsd -0x38(%rbp), %xmm1
mulsd (%rax), %xmm1
movsd -0x30(%rbp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x30(%rbp)
movq %r13, %rdi
callq 0x43b0
movq %rax, %r13
jmp 0x179fa
movq 0x18(%rbx), %r12
addq $0x8, %rbx
xorpd %xmm0, %xmm0
movsd %xmm0, -0x30(%rbp)
leaq -0x70(%rbp), %r13
cmpq %rbx, %r12
je 0x17ae6
andl $0x0, -0x68(%rbp)
andq $0x0, -0x60(%rbp)
leaq -0x68(%rbp), %rax
movq %rax, -0x58(%rbp)
movq %rax, -0x50(%rbp)
andq $0x0, -0x48(%rbp)
leaq 0x20(%r12), %r15
movq -0x40(%rbp), %rdi
movq %r15, %rsi
callq 0x19102
movsd (%rax), %xmm0
movsd %xmm0, -0x38(%rbp)
movq %r15, %rdi
movq %r14, %rsi
movq %r13, %rdx
callq 0x177fd
movsd -0x38(%rbp), %xmm1
mulsd %xmm0, %xmm1
movsd -0x30(%rbp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x30(%rbp)
movq %r13, %rdi
callq 0x19654
movq %r12, %rdi
callq 0x43b0
movq %rax, %r12
jmp 0x17a6a
leaq -0x70(%rbp), %rdi
callq 0x1a10a
movsd -0x30(%rbp), %xmm0
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x70(%rbp), %rdi
callq 0x19654
jmp 0x17b14
movq %rax, %rbx
leaq -0x70(%rbp), %rdi
callq 0x1a10a
movq %rbx, %rdi
callq 0x45f0