// File: /workspace/github_cpp_makefile_star2_O2/aalto-speech[P]ftk/test/emtest.cc
// Function: MSFGForwardBackwardTest1::test_method()
BOOST_AUTO_TEST_CASE(MSFGForwardBackwardTest1)
{
    set<string> vocab = {"k","i","s","a","sa","ki","kis","kissa"};

    transitions_t transitions;
    transitions[start_end]["k"] = log(0.5);
    transitions[start_end]["ki"] = log(0.25);
    transitions[start_end]["kis"] = log(0.4);
    transitions[start_end]["kissa"] = log(0.1);
    transitions["a"][start_end] = log(0.5);
    transitions["kissa"][start_end] = log(0.10);
    transitions["sa"][start_end] = log(0.4);
    transitions["ki"]["s"] = log(0.25);
    transitions["k"]["i"] = log(0.5);
    transitions["i"]["s"] = log(0.5);
    transitions["s"]["s"] = log(0.5);
    transitions["s"]["sa"] = log(0.5);
    transitions["s"]["a"] = log(0.5);
    transitions["kis"]["sa"] = log(0.4);
    transitions["kis"]["s"] = log(0.4);

    string sentence("kissa");
    FactorGraph fg(sentence, start_end, vocab, 5);
    transitions_t stats;
    flt_type lp = forward_backward(transitions, fg, stats);

    MultiStringFactorGraph msfg(start_end);
    msfg.add(fg);
    msfg.update_factor_node_map();
    assign_scores(transitions, msfg);
    transitions_t msfg_stats;
    flt_type msfg_lp = forward_backward(msfg, sentence, msfg_stats);

    BOOST_CHECK_CLOSE( lp, msfg_lp, DBL_ACCURACY );
    BOOST_CHECK( stats == msfg_stats );
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x318, %rsp            # imm = 0x318
leaq 0xb13f(%rip), %rsi      # 0x53c52
leaq -0x1d8(%rbp), %r12
leaq -0xd8(%rbp), %rdx
movq %r12, %rdi
callq 0x5160
leaq -0x1b8(%rbp), %r13
leaq 0xac31(%rip), %rsi      # 0x53768
leaq -0x58(%rbp), %rdx
movq %r13, %rdi
callq 0x5160
leaq -0x198(%rbp), %r13
leaq 0xa4bd(%rip), %rsi      # 0x5300e
leaq -0x238(%rbp), %rdx
movq %r13, %rdi
callq 0x5160
leaq -0x178(%rbp), %r13
leaq 0xb3be(%rip), %rsi      # 0x53f2c
leaq -0x208(%rbp), %rdx
movq %r13, %rdi
callq 0x5160
leaq -0x158(%rbp), %r13
leaq 0xbc35(%rip), %rsi      # 0x547c0
leaq -0x288(%rbp), %rdx
movq %r13, %rdi
callq 0x5160
leaq -0x138(%rbp), %r13
leaq 0xb1dc(%rip), %rsi      # 0x53d84
leaq -0x2a8(%rbp), %rdx
movq %r13, %rdi
callq 0x5160
leaq -0x118(%rbp), %r13
leaq 0xb1c2(%rip), %rsi      # 0x53d87
leaq -0x260(%rbp), %rdx
movq %r13, %rdi
callq 0x5160
leaq -0xf8(%rbp), %r13
leaq 0xb072(%rip), %rsi      # 0x53c54
leaq -0x248(%rbp), %rdx
movq %r13, %rdi
callq 0x5160
leaq -0x2d8(%rbp), %rdi
leaq -0x1d8(%rbp), %rsi
pushq $0x8
popq %rdx
leaq -0x60(%rbp), %rcx
leaq -0x268(%rbp), %r15
movq %r15, %r8
callq 0x4ed0a
movl $0xe0, %ebx
leaq (%rbx,%rbp), %rdi
addq $-0x1d8, %rdi           # imm = 0xFE28
callq 0x57b8
addq $-0x20, %rbx
cmpq $-0x20, %rbx
jne 0x48c1a
leaq -0x50(%rbp), %rax
andl $0x0, (%rax)
andq $0x0, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
andq $0x0, 0x20(%rax)
leaq 0x27934(%rip), %rsi     # 0x70588
leaq -0x58(%rbp), %rdi
callq 0x1b5f0
movq %rax, %r12
leaq 0xafeb(%rip), %rsi      # 0x53c52
leaq -0x1d8(%rbp), %rdi
leaq -0xd8(%rbp), %rdx
callq 0x5160
leaq -0x1d8(%rbp), %rsi
movq %r12, %rdi
callq 0x1b3d2
movabsq $-0x4019d1bd0105c611, %rbx # imm = 0xBFE62E42FEFA39EF
movq %rbx, (%rax)
leaq -0x1d8(%rbp), %rdi
callq 0x57b8
leaq 0x278df(%rip), %rsi     # 0x70588
leaq -0x58(%rbp), %rdi
callq 0x1b5f0
movq %rax, %r12
leaq 0xb0c8(%rip), %rsi      # 0x53d84
leaq -0x1d8(%rbp), %rdi
leaq -0xd8(%rbp), %rdx
callq 0x5160
leaq -0x1d8(%rbp), %rsi
movq %r12, %rdi
callq 0x1b3d2
movabsq $-0x4009d1bd0105c611, %r14 # imm = 0xBFF62E42FEFA39EF
movq %r14, (%rax)
leaq -0x1d8(%rbp), %rdi
callq 0x57b8
leaq 0x2788a(%rip), %rsi     # 0x70588
leaq -0x58(%rbp), %rdi
callq 0x1b5f0
movq %rax, %r12
leaq 0xb076(%rip), %rsi      # 0x53d87
leaq -0x1d8(%rbp), %rdi
leaq -0xd8(%rbp), %rdx
callq 0x5160
leaq -0x1d8(%rbp), %rsi
movq %r12, %rdi
callq 0x1b3d2
movabsq $-0x4012adbf0f1f1f89, %r13 # imm = 0xBFED5240F0E0E077
movq %r13, (%rax)
leaq -0x1d8(%rbp), %rdi
callq 0x57b8
leaq 0x27835(%rip), %rsi     # 0x70588
leaq -0x58(%rbp), %rdi
callq 0x1b5f0
movq %rax, %r12
leaq 0xaeee(%rip), %rsi      # 0x53c54
leaq -0x1d8(%rbp), %rdi
leaq -0xd8(%rbp), %rdx
callq 0x5160
leaq -0x1d8(%rbp), %rsi
movq %r12, %rdi
callq 0x1b3d2
movabsq $-0x3ffd944e444aaaeb, %r12 # imm = 0xC0026BB1BBB55515
movq %r12, (%rax)
leaq -0x1d8(%rbp), %rdi
callq 0x57b8
leaq 0xb184(%rip), %rsi      # 0x53f2c
leaq -0x1d8(%rbp), %rdi
leaq -0xd8(%rbp), %rdx
callq 0x5160
leaq -0x58(%rbp), %rdi
leaq -0x1d8(%rbp), %rsi
callq 0x1b6fa
leaq 0x277b6(%rip), %rsi     # 0x70588
movq %rax, %rdi
callq 0x1b338
movq %rbx, (%rax)
leaq -0x1d8(%rbp), %rdi
callq 0x57b8
leaq 0xae64(%rip), %rsi      # 0x53c54
leaq -0x1d8(%rbp), %rdi
leaq -0xd8(%rbp), %rdx
callq 0x5160
leaq -0x58(%rbp), %rdi
leaq -0x1d8(%rbp), %rsi
callq 0x1b6fa
leaq 0x2776e(%rip), %rsi     # 0x70588
movq %rax, %rdi
callq 0x1b338
movq %r12, (%rax)
leaq -0x1d8(%rbp), %rdi
callq 0x57b8
leaq 0xb988(%rip), %rsi      # 0x547c0
leaq -0x1d8(%rbp), %rdi
leaq -0xd8(%rbp), %rdx
callq 0x5160
leaq -0x58(%rbp), %rdi
leaq -0x1d8(%rbp), %rsi
callq 0x1b6fa
leaq 0x27726(%rip), %rsi     # 0x70588
movq %rax, %rdi
callq 0x1b338
movq %r13, (%rax)
leaq -0x1d8(%rbp), %rdi
callq 0x57b8
leaq 0xaf04(%rip), %rsi      # 0x53d84
leaq -0x1d8(%rbp), %rdi
leaq -0x238(%rbp), %rdx
callq 0x5160
leaq -0x58(%rbp), %rdi
leaq -0x1d8(%rbp), %rsi
callq 0x1b6fa
movq %rax, %r12
leaq 0xa161(%rip), %rsi      # 0x5300e
leaq -0xd8(%rbp), %rdi
leaq -0x208(%rbp), %rdx
callq 0x5160
leaq -0xd8(%rbp), %rsi
movq %r12, %rdi
callq 0x1b3d2
movq %r14, (%rax)
leaq -0xd8(%rbp), %rdi
callq 0x57b8
leaq -0x1d8(%rbp), %rdi
callq 0x57b8
leaq 0xad61(%rip), %rsi      # 0x53c52
leaq -0x1d8(%rbp), %rdi
leaq -0x238(%rbp), %rdx
callq 0x5160
leaq -0x58(%rbp), %rdi
leaq -0x1d8(%rbp), %rsi
callq 0x1b6fa
movq %rax, %r12
leaq 0xa84a(%rip), %rsi      # 0x53768
leaq -0xd8(%rbp), %rdi
leaq -0x208(%rbp), %rdx
callq 0x5160
leaq -0xd8(%rbp), %rsi
movq %r12, %rdi
callq 0x1b3d2
movq %rbx, (%rax)
leaq -0xd8(%rbp), %rdi
callq 0x57b8
leaq -0x1d8(%rbp), %rdi
callq 0x57b8
leaq 0xa806(%rip), %rsi      # 0x53768
leaq -0x1d8(%rbp), %rdi
leaq -0x238(%rbp), %rdx
callq 0x5160
leaq -0x58(%rbp), %rdi
leaq -0x1d8(%rbp), %rsi
callq 0x1b6fa
movq %rax, %r12
leaq 0xa07f(%rip), %rsi      # 0x5300e
leaq -0xd8(%rbp), %rdi
leaq -0x208(%rbp), %rdx
callq 0x5160
leaq -0xd8(%rbp), %rsi
movq %r12, %rdi
callq 0x1b3d2
movq %rbx, (%rax)
leaq -0xd8(%rbp), %rdi
callq 0x57b8
leaq -0x1d8(%rbp), %rdi
callq 0x57b8
leaq 0xa03b(%rip), %rsi      # 0x5300e
leaq -0x1d8(%rbp), %rdi
leaq -0x238(%rbp), %rdx
callq 0x5160
leaq -0x58(%rbp), %rdi
leaq -0x1d8(%rbp), %rsi
callq 0x1b6fa
movq %rax, %r12
leaq 0xa00e(%rip), %rsi      # 0x5300e
leaq -0xd8(%rbp), %rdi
leaq -0x208(%rbp), %rdx
callq 0x5160
leaq -0xd8(%rbp), %rsi
movq %r12, %rdi
callq 0x1b3d2
movq %rbx, (%rax)
leaq -0xd8(%rbp), %rdi
callq 0x57b8
leaq -0x1d8(%rbp), %rdi
callq 0x57b8
leaq 0x9fca(%rip), %rsi      # 0x5300e
leaq -0x1d8(%rbp), %rdi
leaq -0x238(%rbp), %rdx
callq 0x5160
leaq -0x58(%rbp), %rdi
leaq -0x1d8(%rbp), %rsi
callq 0x1b6fa
movq %rax, %r12
leaq 0xb74f(%rip), %rsi      # 0x547c0
leaq -0xd8(%rbp), %rdi
leaq -0x208(%rbp), %rdx
callq 0x5160
leaq -0xd8(%rbp), %rsi
movq %r12, %rdi
callq 0x1b3d2
movq %rbx, (%rax)
leaq -0xd8(%rbp), %rdi
callq 0x57b8
leaq -0x1d8(%rbp), %rdi
callq 0x57b8
leaq 0x9f59(%rip), %rsi      # 0x5300e
leaq -0x1d8(%rbp), %rdi
leaq -0x238(%rbp), %rdx
callq 0x5160
leaq -0x58(%rbp), %rdi
leaq -0x1d8(%rbp), %rsi
callq 0x1b6fa
movq %rax, %r12
leaq 0xae4a(%rip), %rsi      # 0x53f2c
leaq -0xd8(%rbp), %rdi
leaq -0x208(%rbp), %rdx
callq 0x5160
leaq -0xd8(%rbp), %rsi
movq %r12, %rdi
callq 0x1b3d2
movq %rbx, (%rax)
leaq -0xd8(%rbp), %rdi
callq 0x57b8
leaq -0x1d8(%rbp), %rdi
callq 0x57b8
leaq 0xac61(%rip), %rsi      # 0x53d87
leaq -0x1d8(%rbp), %rdi
leaq -0x238(%rbp), %rdx
callq 0x5160
leaq -0x58(%rbp), %rdi
leaq -0x1d8(%rbp), %rsi
callq 0x1b6fa
movq %rax, %r12
leaq 0xb66d(%rip), %rsi      # 0x547c0
leaq -0xd8(%rbp), %rdi
leaq -0x208(%rbp), %rdx
callq 0x5160
leaq -0xd8(%rbp), %rsi
movq %r12, %rdi
callq 0x1b3d2
movq %r13, (%rax)
leaq -0xd8(%rbp), %rdi
callq 0x57b8
leaq -0x1d8(%rbp), %rdi
callq 0x57b8
leaq 0xabf0(%rip), %rsi      # 0x53d87
leaq -0x1d8(%rbp), %rdi
leaq -0x238(%rbp), %rdx
callq 0x5160
leaq -0x58(%rbp), %rdi
leaq -0x1d8(%rbp), %rsi
callq 0x1b6fa
movq %rax, %r12
leaq 0x9e4a(%rip), %rsi      # 0x5300e
leaq -0xd8(%rbp), %rdi
leaq -0x208(%rbp), %rdx
callq 0x5160
leaq -0xd8(%rbp), %rsi
movq %r12, %rdi
callq 0x1b3d2
movq %r13, (%rax)
leaq -0xd8(%rbp), %rdi
callq 0x57b8
leaq -0x1d8(%rbp), %rdi
callq 0x57b8
leaq 0xaa4c(%rip), %rsi      # 0x53c54
leaq -0x288(%rbp), %rdi
leaq -0x1d8(%rbp), %rdx
callq 0x5160
leaq 0x27366(%rip), %rdx     # 0x70588
leaq -0xd8(%rbp), %rdi
leaq -0x288(%rbp), %rsi
leaq -0x2d8(%rbp), %rcx
pushq $0x5
popq %r8
xorl %r9d, %r9d
callq 0xf742
leaq -0x230(%rbp), %rax
andl $0x0, (%rax)
andq $0x0, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
andq $0x0, 0x20(%rax)
leaq -0x58(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
leaq -0x238(%rbp), %rdx
callq 0x18d71
movsd %xmm0, -0x60(%rbp)
leaq 0x27306(%rip), %rsi     # 0x70588
leaq -0x1d8(%rbp), %rdi
callq 0x4ee8c
leaq -0x1d8(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
pushq $0x1
popq %rdx
callq 0x129ea
leaq -0x1d8(%rbp), %rdi
callq 0x13b90
leaq -0x58(%rbp), %rdi
leaq -0x1d8(%rbp), %rsi
callq 0x198de
leaq -0x200(%rbp), %rax
andl $0x0, (%rax)
andq $0x0, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
andq $0x0, 0x20(%rax)
leaq -0x1d8(%rbp), %rdi
leaq -0x288(%rbp), %rsi
leaq -0x208(%rbp), %rdx
callq 0x1ac1c
movsd %xmm0, -0x268(%rbp)
movq 0x2723b(%rip), %rdi     # 0x70540
leaq 0xa874(%rip), %rbx      # 0x53b80
leaq -0x338(%rbp), %rsi
movq %rbx, (%rsi)
leaq 0xa871(%rip), %r14      # 0x53b8e
movq %r14, 0x8(%rsi)
leaq 0xa6ed(%rip), %r13      # 0x53a15
leaq -0x328(%rbp), %rcx
movq %r13, (%rcx)
movq %r13, 0x8(%rcx)
movl $0x488, %edx            # imm = 0x488
callq 0x5710
leaq -0x2a8(%rbp), %rdi
movb $0x0, 0x8(%rdi)
leaq 0x2678e(%rip), %rax     # 0x6fae0
movq %rax, (%rdi)
movq 0x26c54(%rip), %r12     # 0x6ffb0
movq %r12, 0x10(%rdi)
leaq 0x9ff0(%rip), %rax      # 0x53357
movq %rax, 0x18(%rdi)
leaq -0x318(%rbp), %rsi
movq %rbx, (%rsi)
movq %r14, 0x8(%rsi)
movsd 0x2707f(%rip), %xmm0    # 0x70400
movsd %xmm0, -0x260(%rbp)
subq $0x8, %rsp
leaq 0xa969(%rip), %rax      # 0x53cfd
leaq 0xb3ee(%rip), %r10      # 0x54789
leaq 0xb3ec(%rip), %r11      # 0x5478e
pushq $0x1
popq %rcx
pushq $0x8
popq %r8
leaq -0x60(%rbp), %r9
movl $0x488, %edx            # imm = 0x488
pushq %rax
leaq -0x260(%rbp), %rax
pushq %rax
pushq %r10
pushq %r15
pushq %r11
callq 0x4eaf1
addq $0x30, %rsp
movq 0x2716f(%rip), %rdi     # 0x70540
leaq -0x308(%rbp), %rsi
movq %rbx, (%rsi)
movq %r14, 0x8(%rsi)
leaq -0x2f8(%rbp), %rcx
movq %r13, (%rcx)
movq %r13, 0x8(%rcx)
movl $0x489, %edx            # imm = 0x489
callq 0x5710
leaq -0x238(%rbp), %rdi
leaq -0x208(%rbp), %rsi
callq 0x4fc18
leaq -0x260(%rbp), %rdi
movb %al, (%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rdi)
leaq 0xb370(%rip), %rax      # 0x54791
movq %rax, -0x248(%rbp)
leaq 0xb375(%rip), %rax      # 0x547a4
movq %rax, -0x240(%rbp)
leaq -0x2a8(%rbp), %rsi
movb $0x0, 0x8(%rsi)
leaq 0x26728(%rip), %rax     # 0x6fb70
movq %rax, (%rsi)
movq %r12, 0x10(%rsi)
leaq -0x248(%rbp), %rax
movq %rax, 0x18(%rsi)
leaq -0x2e8(%rbp), %rdx
movq %rbx, (%rdx)
movq %r14, 0x8(%rdx)
subq $0x10, %rsp
andq $0x0, (%rsp)
pushq $0x1
popq %r8
movl $0x489, %ecx            # imm = 0x489
xorl %r9d, %r9d
xorl %eax, %eax
callq 0x56f0
popq %rcx
popq %rdx
leaq -0x250(%rbp), %rdi
callq 0x291f6
leaq -0x208(%rbp), %rdi
callq 0x1bb0c
leaq -0x1d8(%rbp), %rdi
callq 0x128f4
leaq -0x238(%rbp), %rdi
callq 0x1bb0c
leaq -0xd8(%rbp), %rdi
callq 0x10c24
leaq -0x288(%rbp), %rdi
callq 0x57b8
leaq -0x58(%rbp), %rdi
callq 0x1bb0c
leaq -0x2d8(%rbp), %rdi
callq 0x200e8
addq $0x318, %rsp            # imm = 0x318
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x250(%rbp), %rdi
callq 0x291f6
jmp 0x49672
jmp 0x4966f
jmp 0x4966f
jmp 0x49515
movq %rax, %rbx
jmp 0x4968f
movq %rax, %rbx
jmp 0x496a7
jmp 0x496b5
jmp 0x49590
jmp 0x49663
jmp 0x49663
jmp 0x496b5
jmp 0x49590
jmp 0x49663
jmp 0x49663
jmp 0x496b5
jmp 0x49590
jmp 0x49663
jmp 0x49663
jmp 0x496b5
jmp 0x49590
jmp 0x49663
jmp 0x49663
jmp 0x496b5
jmp 0x49590
jmp 0x49663
jmp 0x49663
jmp 0x496b5
jmp 0x49590
jmp 0x49663
jmp 0x49663
jmp 0x496b5
movq %rax, %rbx
leaq -0xd8(%rbp), %rdi
callq 0x57b8
jmp 0x49666
jmp 0x49663
jmp 0x49663
jmp 0x496b5
movq %rax, %rbx
leaq -0xd8(%rbp), %rdi
callq 0x57b8
jmp 0x495c9
jmp 0x495c6
movq %rax, %rbx
jmp 0x49666
jmp 0x496b5
jmp 0x496b5
jmp 0x496b5
jmp 0x496b5
jmp 0x49663
jmp 0x496b5
jmp 0x49663
jmp 0x496b5
jmp 0x49663
jmp 0x496b5
jmp 0x49663
jmp 0x496b5
movq %rax, %rbx
movl $0xe0, %r14d
leaq (%r14,%rbp), %rdi
addq $-0x1d8, %rdi           # imm = 0xFE28
callq 0x57b8
addq $-0x20, %r14
cmpq $-0x20, %r14
jne 0x49607
movb $0x1, %al
jmp 0x49636
jmp 0x49631
jmp 0x49631
jmp 0x49631
jmp 0x49631
jmp 0x49631
jmp 0x49631
movq %rax, %rbx
xorl %eax, %eax
cmpq %r13, %r12
je 0x496cd
testb %al, %al
jne 0x496cd
addq $-0x20, %r13
movq %r13, %rdi
callq 0x57b8
cmpq %r12, %r13
jne 0x49647
jmp 0x496cd
movq %rax, %rbx
jmp 0x496cd
jmp 0x49663
jmp 0x49663
movq %rax, %rbx
leaq -0x1d8(%rbp), %rdi
jmp 0x496ae
movq %rax, %rbx
leaq -0x208(%rbp), %rdi
callq 0x1bb0c
jmp 0x49683
movq %rax, %rbx
leaq -0x1d8(%rbp), %rdi
callq 0x128f4
leaq -0x238(%rbp), %rdi
callq 0x1bb0c
leaq -0xd8(%rbp), %rdi
callq 0x10c24
leaq -0x288(%rbp), %rdi
callq 0x57b8
jmp 0x496b8
movq %rax, %rbx
leaq -0x58(%rbp), %rdi
callq 0x1bb0c
leaq -0x2d8(%rbp), %rdi
callq 0x200e8
movq %rbx, %rdi
callq 0x56b0