// File: /workspace/github_cpp_makefile_star2_O3/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 %rsi, %r14
movq 0x48(%rsi), %rsi
subq 0x40(%r14), %rsi
je 0x18261
movq %rdi, %r15
movq %rdx, -0x38(%rbp)
sarq $0x3, %rsi
movabsq $0x6db6db6db6db6db7, %r13 # imm = 0x6DB6DB6DB6DB6DB7
imulq %r13, %rsi
movabsq $-0x10000000000001, %rbx # imm = 0xFFEFFFFFFFFFFFFF
leaq -0x58(%rbp), %rdx
movq %rbx, (%rdx)
leaq -0x70(%rbp), %rdi
leaq -0x40(%rbp), %r12
movq %r12, %rcx
callq 0x1b134
movq 0x48(%r14), %rsi
subq 0x40(%r14), %rsi
sarq $0x3, %rsi
imulq %r13, %rsi
movq %rbx, (%r12)
leaq -0x58(%rbp), %rdi
leaq -0x40(%rbp), %rdx
leaq -0x29(%rbp), %rcx
callq 0x1b134
leaq -0x70(%rbp), %rdx
movq (%rdx), %rax
xorl %ecx, %ecx
movq %rcx, (%rax)
movq 0x48(%r14), %rax
subq 0x40(%r14), %rax
movq -0x58(%rbp), %rsi
imulq %r13, %rax
movq %rcx, -0x8(%rsi,%rax)
movq %r15, %rdi
movq %r14, %rsi
callq 0x17d10
leaq -0x70(%rbp), %rsi
leaq -0x58(%rbp), %rdx
movq %r14, %rdi
movq -0x38(%rbp), %rcx
callq 0x17f51
movq -0x68(%rbp), %rax
movsd -0x8(%rax), %xmm0
movq -0x58(%rbp), %rdi
testq %rdi, %rdi
movsd %xmm0, -0x38(%rbp)
je 0x1824c
callq 0x4350
movsd -0x38(%rbp), %xmm0
movq -0x70(%rbp), %rdi
testq %rdi, %rdi
je 0x18269
callq 0x4350
movsd -0x38(%rbp), %xmm0
jmp 0x18269
movsd 0xe597(%rip), %xmm0     # 0x26800
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x1828e
movq %rax, %rbx
movq -0x58(%rbp), %rdi
testq %rdi, %rdi
je 0x1828e
callq 0x4350
movq -0x70(%rbp), %rdi
testq %rdi, %rdi
je 0x1829c
callq 0x4350
movq %rbx, %rdi
callq 0x4650