// File: /workspace/github_cpp_makefile_star2_O2/aalto-speech[P]ftk/src/EM.cc
// Function: forward_backward(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>>>>>> const&, FactorGraph&, 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>>>>>>&)
flt_type forward_backward(const transitions_t &transitions,
                          FactorGraph &text,
                          transitions_t &stats)
{
    if (text.nodes.size() == 0) return MIN_FLOAT;

    vector<flt_type> fw(text.nodes.size(), MIN_FLOAT);
    vector<flt_type> bw(text.nodes.size(), MIN_FLOAT);
    fw[0] = 0.0; bw[text.nodes.size()-1] = 0.0;

    forward(transitions, text, fw);
    backward(text, fw, bw, stats);

    return fw.back();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq 0x48(%rsi), %rax
subq 0x40(%rsi), %rax
je 0x168b5
movq %rsi, %r14
movq %rdi, %r15
movq %rdx, -0x38(%rbp)
pushq $0x38
popq %r13
cqto
idivq %r13
movabsq $-0x10000000000001, %rbx # imm = 0xFFEFFFFFFFFFFFFF
leaq -0x58(%rbp), %rdx
movq %rbx, (%rdx)
leaq -0x70(%rbp), %rdi
leaq -0x40(%rbp), %r12
movq %rax, %rsi
movq %r12, %rcx
callq 0x18ee6
movq 0x48(%r14), %rax
subq 0x40(%r14), %rax
cqto
idivq %r13
movq %rbx, (%r12)
leaq -0x58(%rbp), %rdi
leaq -0x40(%rbp), %rdx
leaq -0x29(%rbp), %rcx
movq %rax, %rsi
callq 0x18ee6
leaq -0x70(%rbp), %rcx
movq (%rcx), %rax
andq $0x0, (%rax)
movq 0x48(%r14), %rax
subq 0x40(%r14), %rax
movq -0x58(%rbp), %rsi
pushq $0x7
popq %rdi
cqto
idivq %rdi
andq $0x0, -0x8(%rsi,%rax)
movq %r15, %rdi
movq %r14, %rsi
movq %rcx, %rdx
callq 0x16453
leaq -0x70(%rbp), %rsi
leaq -0x58(%rbp), %rdx
movq %r14, %rdi
movq -0x38(%rbp), %rcx
callq 0x165fe
leaq -0x70(%rbp), %rbx
movq 0x8(%rbx), %rax
movsd -0x8(%rax), %xmm0
movsd %xmm0, -0x38(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x1a10a
movq %rbx, %rdi
callq 0x1a10a
movsd -0x38(%rbp), %xmm0
jmp 0x168bd
movsd 0xced3(%rip), %xmm0     # 0x23790
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x168dd
movq %rax, %rbx
leaq -0x58(%rbp), %rdi
callq 0x1a10a
leaq -0x70(%rbp), %rdi
callq 0x1a10a
movq %rbx, %rdi
callq 0x45f0