// File: aalto-speech[P]ftk/test/emtest.cc
// Function: TransitionForwardBackwardTest1::test_method()
BOOST_AUTO_TEST_CASE(TransitionForwardBackwardTest1)
{
    string str1("a"); string str2("bc");
    set<string> vocab = {start_end,str1,str2};
    transitions_t transitions;
    transitions[str1][str2] = -1.0;
    transitions[start_end][str1] = -1.0;
    transitions[str2][start_end] = -1.0;
    string sentence("abc");
    FactorGraph fg(sentence, start_end, vocab, 2);
    transitions_t stats;
    flt_type lp = forward_backward(transitions, fg, stats);
    BOOST_CHECK_EQUAL(3, transition_count(stats));
    BOOST_CHECK_EQUAL(1.0, stats[start_end][str1]);
    BOOST_CHECK_EQUAL(1.0, stats[str1][str2]);
    BOOST_CHECK_EQUAL(1.0, stats[str2][start_end]);
    BOOST_CHECK_CLOSE( -3.0, lp, DBL_ACCURACY );
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x590, %rsp            # imm = 0x590
movq %rdi, -0x8(%rbp)
leaq -0x29(%rbp), %rdi
movq %rdi, -0x410(%rbp)
callq 0x67b0
movq -0x410(%rbp), %rdx
leaq 0x30c67(%rip), %rsi     # 0xcbf14
leaq -0x28(%rbp), %rdi
callq 0x65e0
jmp 0x9b2b8
leaq -0x29(%rbp), %rdi
callq 0x6470
leaq -0x61(%rbp), %rdi
movq %rdi, -0x418(%rbp)
callq 0x67b0
movq -0x418(%rbp), %rdx
leaq 0x30901(%rip), %rsi     # 0xcbbe0
leaq -0x60(%rbp), %rdi
callq 0x65e0
jmp 0x9b2ea
leaq -0x61(%rbp), %rdi
callq 0x6470
leaq -0x108(%rbp), %rdi
movq %rdi, -0x110(%rbp)
leaq 0x6c330(%rip), %rsi     # 0x107638
callq 0x61c0
jmp 0x9b30f
leaq -0xe8(%rbp), %rdi
movq %rdi, -0x110(%rbp)
leaq -0x28(%rbp), %rsi
callq 0x61c0
jmp 0x9b328
leaq -0xc8(%rbp), %rdi
movq %rdi, -0x110(%rbp)
leaq -0x60(%rbp), %rsi
callq 0x61c0
jmp 0x9b341
leaq -0x108(%rbp), %rax
movq %rax, -0xa8(%rbp)
movq $0x3, -0xa0(%rbp)
leaq -0x112(%rbp), %rdi
movq %rdi, -0x420(%rbp)
callq 0xdab0
movq -0x420(%rbp), %r8
movq -0xa8(%rbp), %rsi
movq -0xa0(%rbp), %rdx
leaq -0x98(%rbp), %rdi
leaq -0x111(%rbp), %rcx
callq 0xbfde0
jmp 0x9b397
leaq -0x112(%rbp), %rdi
callq 0xdb50
leaq -0x108(%rbp), %rax
movq %rax, -0x430(%rbp)
addq $0x60, %rax
movq %rax, -0x428(%rbp)
movq -0x428(%rbp), %rdi
addq $-0x20, %rdi
movq %rdi, -0x438(%rbp)
callq 0x6908
movq -0x430(%rbp), %rcx
movq -0x438(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x428(%rbp)
jne 0x9b3bc
leaq -0x148(%rbp), %rdi
movq %rdi, -0x448(%rbp)
callq 0x4bd30
movq -0x448(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x4b980
movq %rax, -0x440(%rbp)
jmp 0x9b419
movq -0x440(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x4b030
movq %rax, -0x450(%rbp)
jmp 0x9b432
movq -0x450(%rbp), %rax
movabsq $-0x4010000000000000, %rcx # imm = 0xBFF0000000000000
movq %rcx, (%rax)
leaq 0x6c1eb(%rip), %rsi     # 0x107638
leaq -0x148(%rbp), %rdi
callq 0x4b980
movq %rax, -0x458(%rbp)
jmp 0x9b462
movq -0x458(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x4b030
movq %rax, -0x460(%rbp)
jmp 0x9b47b
movq -0x460(%rbp), %rax
movabsq $-0x4010000000000000, %rcx # imm = 0xBFF0000000000000
movq %rcx, (%rax)
leaq -0x148(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x4b980
movq %rax, -0x468(%rbp)
jmp 0x9b4a8
movq -0x468(%rbp), %rdi
leaq 0x6c182(%rip), %rsi     # 0x107638
callq 0x4b030
movq %rax, -0x470(%rbp)
jmp 0x9b4c4
movq -0x470(%rbp), %rax
movabsq $-0x4010000000000000, %rcx # imm = 0xBFF0000000000000
movq %rcx, (%rax)
leaq -0x169(%rbp), %rdi
movq %rdi, -0x478(%rbp)
callq 0x67b0
movq -0x478(%rbp), %rdx
leaq 0x306e6(%rip), %rsi     # 0xcbbdf
leaq -0x168(%rbp), %rdi
callq 0x65e0
jmp 0x9b507
leaq -0x169(%rbp), %rdi
callq 0x6470
leaq 0x6c11e(%rip), %rdx     # 0x107638
leaq -0x1e8(%rbp), %rdi
leaq -0x168(%rbp), %rsi
leaq -0x98(%rbp), %rcx
movl $0x2, %r8d
xorl %r9d, %r9d
callq 0x239b0
jmp 0x9b53f
leaq -0x218(%rbp), %rdi
movq %rdi, -0x488(%rbp)
callq 0x4bd30
movq -0x488(%rbp), %rdx
leaq -0x148(%rbp), %rdi
leaq -0x1e8(%rbp), %rsi
callq 0x45f80
movsd %xmm0, -0x480(%rbp)
jmp 0x9b576
movsd -0x480(%rbp), %xmm0
movsd %xmm0, -0x220(%rbp)
movq 0x6c063(%rip), %rax     # 0x1075f0
movq %rax, -0x490(%rbp)
leaq 0x305cd(%rip), %rsi     # 0xcbb68
leaq -0x230(%rbp), %rdi
movl $0xe, %edx
callq 0x70bd0
jmp 0x9b5ae
leaq -0x240(%rbp), %rdi
callq 0x70c00
jmp 0x9b5bc
movq -0x490(%rbp), %rdi
leaq -0x230(%rbp), %rsi
movl $0x34d, %edx            # imm = 0x34D
leaq -0x240(%rbp), %rcx
callq 0x6840
jmp 0x9b5dd
callq 0x70e90
movq %rax, -0x498(%rbp)
jmp 0x9b5eb
movq -0x498(%rbp), %rsi
leaq 0x2fd31(%rip), %rdx     # 0xcb32a
leaq -0x268(%rbp), %rdi
callq 0x70e50
jmp 0x9b607
leaq 0x3055a(%rip), %rsi     # 0xcbb68
leaq -0x278(%rbp), %rdi
movl $0xe, %edx
callq 0x70bd0
jmp 0x9b621
movl $0x3, -0x27c(%rbp)
leaq -0x218(%rbp), %rdi
callq 0x90970
movl %eax, -0x280(%rbp)
leaq 0x30bea(%rip), %rcx     # 0xcc22e
movq %rsp, %rax
movq %rcx, 0x10(%rax)
leaq -0x280(%rbp), %rcx
movq %rcx, 0x8(%rax)
leaq 0x30912(%rip), %rcx     # 0xcbf6f
movq %rcx, (%rax)
leaq -0x268(%rbp), %rdi
leaq -0x278(%rbp), %rsi
movl $0x34d, %edx            # imm = 0x34D
movl $0x1, %ecx
movl $0x2, %r8d
leaq -0x27c(%rbp), %r9
callq 0xbf480
jmp 0x9b68c
leaq -0x268(%rbp), %rdi
callq 0x70ea0
callq 0x70ec0
movb %al, -0x499(%rbp)
jmp 0x9b6a5
movb -0x499(%rbp), %al
testb $0x1, %al
jne 0x9b586
jmp 0x9b6b5
jmp 0x9b6b7
movq 0x6bf32(%rip), %rax     # 0x1075f0
movq %rax, -0x4a8(%rbp)
leaq 0x3049c(%rip), %rsi     # 0xcbb68
leaq -0x290(%rbp), %rdi
movl $0xe, %edx
callq 0x70bd0
jmp 0x9b6df
leaq -0x2a0(%rbp), %rdi
callq 0x70c00
jmp 0x9b6ed
movq -0x4a8(%rbp), %rdi
leaq -0x290(%rbp), %rsi
movl $0x34e, %edx            # imm = 0x34E
leaq -0x2a0(%rbp), %rcx
callq 0x6840
jmp 0x9b70e
callq 0x70e90
movq %rax, -0x4b0(%rbp)
jmp 0x9b71c
movq -0x4b0(%rbp), %rsi
leaq 0x2fc00(%rip), %rdx     # 0xcb32a
leaq -0x2c8(%rbp), %rdi
callq 0x70e50
jmp 0x9b738
leaq 0x30429(%rip), %rsi     # 0xcbb68
leaq -0x2d8(%rbp), %rdi
movl $0xe, %edx
callq 0x70bd0
jmp 0x9b752
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq %rax, -0x2e0(%rbp)
leaq 0x6bece(%rip), %rsi     # 0x107638
leaq -0x218(%rbp), %rdi
callq 0x4b980
movq %rax, -0x4b8(%rbp)
jmp 0x9b77f
movq -0x4b8(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x4b030
movq %rax, -0x4c0(%rbp)
jmp 0x9b798
movq -0x4c0(%rbp), %rcx
leaq 0x30aa0(%rip), %rdx     # 0xcc246
movq %rsp, %rax
movq %rdx, 0x10(%rax)
movq %rcx, 0x8(%rax)
leaq 0x304f8(%rip), %rcx     # 0xcbcb0
movq %rcx, (%rax)
leaq -0x2c8(%rbp), %rdi
leaq -0x2d8(%rbp), %rsi
movl $0x34e, %edx            # imm = 0x34E
movl $0x1, %ecx
movl $0x2, %r8d
leaq -0x2e0(%rbp), %r9
callq 0x70c30
jmp 0x9b7e7
leaq -0x2c8(%rbp), %rdi
callq 0x70ea0
callq 0x70ec0
movb %al, -0x4c1(%rbp)
jmp 0x9b800
movb -0x4c1(%rbp), %al
testb $0x1, %al
jne 0x9b6b7
jmp 0x9b810
jmp 0x9b812
movq 0x6bdd7(%rip), %rax     # 0x1075f0
movq %rax, -0x4d0(%rbp)
leaq 0x30341(%rip), %rsi     # 0xcbb68
leaq -0x2f0(%rbp), %rdi
movl $0xe, %edx
callq 0x70bd0
jmp 0x9b83a
leaq -0x300(%rbp), %rdi
callq 0x70c00
jmp 0x9b848
movq -0x4d0(%rbp), %rdi
leaq -0x2f0(%rbp), %rsi
movl $0x34f, %edx            # imm = 0x34F
leaq -0x300(%rbp), %rcx
callq 0x6840
jmp 0x9b869
callq 0x70e90
movq %rax, -0x4d8(%rbp)
jmp 0x9b877
movq -0x4d8(%rbp), %rsi
leaq 0x2faa5(%rip), %rdx     # 0xcb32a
leaq -0x328(%rbp), %rdi
callq 0x70e50
jmp 0x9b893
leaq 0x302ce(%rip), %rsi     # 0xcbb68
leaq -0x338(%rbp), %rdi
movl $0xe, %edx
callq 0x70bd0
jmp 0x9b8ad
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq %rax, -0x340(%rbp)
leaq -0x218(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x4b980
movq %rax, -0x4e0(%rbp)
jmp 0x9b8d7
movq -0x4e0(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x4b030
movq %rax, -0x4e8(%rbp)
jmp 0x9b8f0
movq -0x4e8(%rbp), %rcx
leaq 0x3095f(%rip), %rdx     # 0xcc25d
movq %rsp, %rax
movq %rdx, 0x10(%rax)
movq %rcx, 0x8(%rax)
leaq 0x303a0(%rip), %rcx     # 0xcbcb0
movq %rcx, (%rax)
leaq -0x328(%rbp), %rdi
leaq -0x338(%rbp), %rsi
movl $0x34f, %edx            # imm = 0x34F
movl $0x1, %ecx
movl $0x2, %r8d
leaq -0x340(%rbp), %r9
callq 0x70c30
jmp 0x9b93f
leaq -0x328(%rbp), %rdi
callq 0x70ea0
callq 0x70ec0
movb %al, -0x4e9(%rbp)
jmp 0x9b958
movb -0x4e9(%rbp), %al
testb $0x1, %al
jne 0x9b812
jmp 0x9b968
jmp 0x9b96a
movq 0x6bc7f(%rip), %rax     # 0x1075f0
movq %rax, -0x4f8(%rbp)
leaq 0x301e9(%rip), %rsi     # 0xcbb68
leaq -0x350(%rbp), %rdi
movl $0xe, %edx
callq 0x70bd0
jmp 0x9b992
leaq -0x360(%rbp), %rdi
callq 0x70c00
jmp 0x9b9a0
movq -0x4f8(%rbp), %rdi
leaq -0x350(%rbp), %rsi
movl $0x350, %edx            # imm = 0x350
leaq -0x360(%rbp), %rcx
callq 0x6840
jmp 0x9b9c1
callq 0x70e90
movq %rax, -0x500(%rbp)
jmp 0x9b9cf
movq -0x500(%rbp), %rsi
leaq 0x2f94d(%rip), %rdx     # 0xcb32a
leaq -0x388(%rbp), %rdi
callq 0x70e50
jmp 0x9b9eb
leaq 0x30176(%rip), %rsi     # 0xcbb68
leaq -0x398(%rbp), %rdi
movl $0xe, %edx
callq 0x70bd0
jmp 0x9ba05
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq %rax, -0x3a0(%rbp)
leaq -0x218(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x4b980
movq %rax, -0x508(%rbp)
jmp 0x9ba2f
movq -0x508(%rbp), %rdi
leaq 0x6bbfb(%rip), %rsi     # 0x107638
callq 0x4b030
movq %rax, -0x510(%rbp)
jmp 0x9ba4b
movq -0x510(%rbp), %rcx
leaq 0x30816(%rip), %rdx     # 0xcc26f
movq %rsp, %rax
movq %rdx, 0x10(%rax)
movq %rcx, 0x8(%rax)
leaq 0x30245(%rip), %rcx     # 0xcbcb0
movq %rcx, (%rax)
leaq -0x388(%rbp), %rdi
leaq -0x398(%rbp), %rsi
movl $0x350, %edx            # imm = 0x350
movl $0x1, %ecx
movl $0x2, %r8d
leaq -0x3a0(%rbp), %r9
callq 0x70c30
jmp 0x9ba9a
leaq -0x388(%rbp), %rdi
callq 0x70ea0
callq 0x70ec0
movb %al, -0x511(%rbp)
jmp 0x9bab3
movb -0x511(%rbp), %al
testb $0x1, %al
jne 0x9b96a
jmp 0x9bac3
jmp 0x9bac5
movq 0x6bb24(%rip), %rax     # 0x1075f0
movq %rax, -0x520(%rbp)
leaq 0x3008e(%rip), %rsi     # 0xcbb68
leaq -0x3b0(%rbp), %rdi
movl $0xe, %edx
callq 0x70bd0
jmp 0x9baed
leaq -0x3c0(%rbp), %rdi
callq 0x70c00
jmp 0x9bafb
movq -0x520(%rbp), %rdi
leaq -0x3b0(%rbp), %rsi
movl $0x351, %edx            # imm = 0x351
leaq -0x3c0(%rbp), %rcx
callq 0x6840
jmp 0x9bb1c
callq 0x70e90
movq %rax, -0x528(%rbp)
jmp 0x9bb2a
movq -0x528(%rbp), %rsi
leaq 0x2f7f2(%rip), %rdx     # 0xcb32a
leaq -0x3e8(%rbp), %rdi
callq 0x70e50
jmp 0x9bb46
leaq 0x3001b(%rip), %rsi     # 0xcbb68
leaq -0x3f8(%rbp), %rdi
movl $0xe, %edx
callq 0x70bd0
jmp 0x9bb60
movabsq $-0x3ff8000000000000, %rax # imm = 0xC008000000000000
movq %rax, -0x400(%rbp)
movsd 0x6b937(%rip), %xmm0    # 0x1074b0
callq 0xbf970
movsd %xmm0, -0x530(%rbp)
jmp 0x9bb88
movsd -0x530(%rbp), %xmm0
movsd %xmm0, -0x408(%rbp)
leaq 0x30146(%rip), %rcx     # 0xcbce5
movq %rsp, %rax
movq %rcx, 0x20(%rax)
leaq -0x408(%rbp), %rcx
movq %rcx, 0x18(%rax)
leaq 0x30bbe(%rip), %rcx     # 0xcc776
movq %rcx, 0x10(%rax)
leaq -0x220(%rbp), %rcx
movq %rcx, 0x8(%rax)
leaq 0x2fc7f(%rip), %rcx     # 0xcb84d
movq %rcx, (%rax)
leaq -0x3e8(%rbp), %rdi
leaq -0x3f8(%rbp), %rsi
movl $0x351, %edx            # imm = 0x351
movl $0x1, %ecx
movl $0x8, %r8d
leaq -0x400(%rbp), %r9
callq 0xbf6a0
jmp 0x9bbfd
leaq -0x3e8(%rbp), %rdi
callq 0x70ea0
callq 0x70ec0
movb %al, -0x531(%rbp)
jmp 0x9bc16
movb -0x531(%rbp), %al
testb $0x1, %al
jne 0x9bac5
jmp 0x9bc26
leaq -0x218(%rbp), %rdi
callq 0x4bd50
leaq -0x1e8(%rbp), %rdi
callq 0x26180
leaq -0x168(%rbp), %rdi
callq 0x6908
leaq -0x148(%rbp), %rdi
callq 0x4bd50
leaq -0x98(%rbp), %rdi
callq 0x5c1b0
leaq -0x60(%rbp), %rdi
callq 0x6908
leaq -0x28(%rbp), %rdi
callq 0x6908
addq $0x590, %rsp            # imm = 0x590
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x29(%rbp), %rdi
callq 0x6470
jmp 0x9be92
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x61(%rbp), %rdi
callq 0x6470
jmp 0x9be89
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
movq -0x110(%rbp), %rax
leaq -0x108(%rbp), %rcx
cmpq %rax, %rcx
movq %rax, -0x540(%rbp)
je 0x9bd08
movq -0x540(%rbp), %rdi
addq $-0x20, %rdi
movq %rdi, -0x548(%rbp)
callq 0x6908
movq -0x548(%rbp), %rax
leaq -0x108(%rbp), %rcx
cmpq %rcx, %rax
movq %rax, -0x540(%rbp)
jne 0x9bcd7
jmp 0x9be80
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x112(%rbp), %rdi
callq 0xdb50
leaq -0x108(%rbp), %rax
movq %rax, -0x558(%rbp)
addq $0x60, %rax
movq %rax, -0x550(%rbp)
movq -0x550(%rbp), %rdi
addq $-0x20, %rdi
movq %rdi, -0x560(%rbp)
callq 0x6908
movq -0x558(%rbp), %rcx
movq -0x560(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x550(%rbp)
jne 0x9bd3e
jmp 0x9be80
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x9be68
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x169(%rbp), %rdi
callq 0x6470
jmp 0x9be68
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x9be5c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x9be44
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x268(%rbp), %rdi
callq 0x70ea0
jmp 0x9be44
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x2c8(%rbp), %rdi
callq 0x70ea0
jmp 0x9be44
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x328(%rbp), %rdi
callq 0x70ea0
jmp 0x9be44
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x388(%rbp), %rdi
callq 0x70ea0
jmp 0x9be44
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x3e8(%rbp), %rdi
callq 0x70ea0
leaq -0x218(%rbp), %rdi
callq 0x4bd50
leaq -0x1e8(%rbp), %rdi
callq 0x26180
leaq -0x168(%rbp), %rdi
callq 0x6908
leaq -0x148(%rbp), %rdi
callq 0x4bd50
leaq -0x98(%rbp), %rdi
callq 0x5c1b0
leaq -0x60(%rbp), %rdi
callq 0x6908
leaq -0x28(%rbp), %rdi
callq 0x6908
movq -0x38(%rbp), %rdi
callq 0x67a0
nopl (%rax,%rax)