// File: /workspace/github_cpp_makefile_star2_O2/aalto-speech[P]ftk/test/emtest.cc
// Function: TransitionForwardBackwardTest2::test_method()
BOOST_AUTO_TEST_CASE(TransitionForwardBackwardTest2)
{
    string str1("a"); string str2("bc");
    string str3("ab"); string str4("c");
    set<string> vocab = {start_end,str1,str2,str3,str4};
    transitions_t transitions;
    transitions[start_end][str1] = -1.0;
    transitions[start_end][str3] = -1.0;
    transitions[str2][start_end] = -1.0;
    transitions[str4][start_end] = -1.0;
    transitions[str1][str2] = -2.0;
    transitions[str3][str4] = -1.0;
    string sentence("abc");
    FactorGraph fg(sentence, start_end, vocab, 2);
    transitions_t stats;
    flt_type lp = forward_backward(transitions, fg, stats);
    flt_type path_1_score = exp(-4)/(exp(-3) + exp(-4));
    flt_type path_2_score = exp(-3)/(exp(-3) + exp(-4));
    BOOST_CHECK_EQUAL(6, transition_count(stats));
    BOOST_CHECK_CLOSE( path_1_score, stats[str2][start_end], DBL_ACCURACY );
    BOOST_CHECK_CLOSE( path_2_score, stats[str4][start_end], DBL_ACCURACY );
    BOOST_CHECK_CLOSE( path_1_score, stats[start_end][str1], DBL_ACCURACY );
    BOOST_CHECK_CLOSE( path_2_score, stats[start_end][str3], DBL_ACCURACY );
    BOOST_CHECK_CLOSE( path_1_score, stats[str1][str2], DBL_ACCURACY );
    BOOST_CHECK_CLOSE( path_2_score, stats[str3][str4], DBL_ACCURACY );
    BOOST_CHECK_CLOSE( -2.68673831248, lp, DBL_ACCURACY );
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x398, %rsp            # imm = 0x398
leaq 0x15795(%rip), %rsi     # 0x53f2c
leaq -0x120(%rbp), %rdi
leaq -0x270(%rbp), %rdx
callq 0x5160
leaq 0x15447(%rip), %rsi     # 0x53bf8
leaq -0x100(%rbp), %rdi
leaq -0x270(%rbp), %rdx
callq 0x5160
leaq 0x1543d(%rip), %rsi     # 0x53c08
leaq -0xe0(%rbp), %rdi
leaq -0x270(%rbp), %rdx
callq 0x5160
leaq 0x15414(%rip), %rsi     # 0x53bf9
leaq -0xc0(%rbp), %rdi
leaq -0x270(%rbp), %rdx
callq 0x5160
leaq 0x31d89(%rip), %rsi     # 0x70588
leaq -0x270(%rbp), %r14
movq %r14, %rdi
callq 0x54f0
leaq -0x250(%rbp), %r15
leaq -0x120(%rbp), %rsi
movq %r15, %rdi
callq 0x54f0
leaq -0x230(%rbp), %r15
leaq -0x100(%rbp), %rsi
movq %r15, %rdi
callq 0x54f0
leaq -0x210(%rbp), %r15
leaq -0xe0(%rbp), %rsi
movq %r15, %rdi
callq 0x54f0
leaq -0x1f0(%rbp), %r15
leaq -0xc0(%rbp), %rsi
movq %r15, %rdi
callq 0x54f0
leaq -0x2a0(%rbp), %rdi
leaq -0x270(%rbp), %rsi
pushq $0x5
popq %rdx
leaq -0x150(%rbp), %rcx
leaq -0xa0(%rbp), %r8
callq 0x4ed0a
movl $0x80, %ebx
leaq (%rbx,%rbp), %rdi
addq $-0x270, %rdi           # imm = 0xFD90
callq 0x57b8
addq $-0x20, %rbx
cmpq $-0x20, %rbx
jne 0x3e88f
leaq -0x148(%rbp), %rax
andl $0x0, (%rax)
andq $0x0, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
andq $0x0, 0x20(%rax)
leaq 0x31cbc(%rip), %rsi     # 0x70588
leaq -0x150(%rbp), %rdi
callq 0x1b5f0
leaq -0x120(%rbp), %rsi
movq %rax, %rdi
callq 0x1b338
movabsq $-0x4010000000000000, %rbx # imm = 0xBFF0000000000000
movq %rbx, (%rax)
leaq 0x31c8d(%rip), %rsi     # 0x70588
leaq -0x150(%rbp), %rdi
callq 0x1b5f0
leaq -0xe0(%rbp), %rsi
movq %rax, %rdi
callq 0x1b338
movq %rbx, (%rax)
leaq -0x150(%rbp), %rdi
leaq -0x100(%rbp), %rsi
callq 0x1b5f0
leaq 0x31c55(%rip), %rsi     # 0x70588
movq %rax, %rdi
callq 0x1b338
movq %rbx, (%rax)
leaq -0x150(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x1b5f0
leaq 0x31c30(%rip), %rsi     # 0x70588
movq %rax, %rdi
callq 0x1b338
movq %rbx, (%rax)
leaq -0x150(%rbp), %rdi
leaq -0x120(%rbp), %rsi
callq 0x1b5f0
leaq -0x100(%rbp), %rsi
movq %rax, %rdi
callq 0x1b338
movabsq $-0x4000000000000000, %rcx # imm = 0xC000000000000000
movq %rcx, (%rax)
leaq -0x150(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
callq 0x1b5f0
leaq -0xc0(%rbp), %rsi
movq %rax, %rdi
callq 0x1b338
movq %rbx, (%rax)
leaq 0x15239(%rip), %rsi     # 0x53bf7
leaq -0x1d0(%rbp), %rdi
leaq -0x270(%rbp), %rdx
callq 0x5160
leaq 0x31bb0(%rip), %rdx     # 0x70588
leaq -0x270(%rbp), %rdi
leaq -0x1d0(%rbp), %rsi
leaq -0x2a0(%rbp), %rcx
pushq $0x2
popq %r8
xorl %r9d, %r9d
callq 0xf742
leaq -0x98(%rbp), %rax
andl $0x0, (%rax)
andq $0x0, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
andq $0x0, 0x20(%rax)
leaq -0x150(%rbp), %rdi
leaq -0x270(%rbp), %rsi
leaq -0xa0(%rbp), %rdx
callq 0x18d71
movsd %xmm0, -0x70(%rbp)
movabsq $0x3fd136561454ba86, %rax # imm = 0x3FD136561454BA86
movq %rax, -0x60(%rbp)
movabsq $0x3fe764d4f5d5a2be, %rax # imm = 0x3FE764D4F5D5A2BE
movq %rax, -0x58(%rbp)
movq 0x31ae9(%rip), %rdi     # 0x70540
leaq 0x15122(%rip), %r13     # 0x53b80
leaq -0x3c0(%rbp), %rsi
movq %r13, (%rsi)
leaq 0x1511f(%rip), %rbx     # 0x53b8e
movq %rbx, 0x8(%rsi)
leaq 0x14f9b(%rip), %rax     # 0x53a15
leaq -0x3b0(%rbp), %rcx
movq %rax, (%rcx)
movq %rax, 0x8(%rcx)
movl $0x366, %edx            # imm = 0x366
callq 0x5710
leaq -0x50(%rbp), %r14
movb $0x0, 0x8(%r14)
leaq 0x3103e(%rip), %rax     # 0x6fae0
movq %rax, (%r14)
movq 0x31504(%rip), %rax     # 0x6ffb0
movq %rax, 0x10(%r14)
leaq 0x148a0(%rip), %rax     # 0x53357
movq %rax, 0x18(%r14)
leaq -0x3a0(%rbp), %r15
movq %r13, (%r15)
movq %rbx, 0x8(%r15)
leaq -0x30(%rbp), %r12
movl $0x6, (%r12)
leaq -0xa0(%rbp), %rdi
callq 0x38334
leaq -0x68(%rbp), %r11
movl %eax, (%r11)
subq $0x8, %rsp
leaq 0x15753(%rip), %rax     # 0x54246
leaq 0x15bdb(%rip), %r10     # 0x546d5
pushq $0x1
popq %rcx
pushq $0x2
popq %r8
movl $0x366, %edx            # imm = 0x366
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %r9
pushq %rax
pushq %r11
pushq %r10
callq 0x4ea09
addq $0x20, %rsp
movq 0x31a1c(%rip), %rdi     # 0x70540
leaq -0x390(%rbp), %rsi
movq %r13, (%rsi)
movq %rbx, 0x8(%rsi)
leaq -0x380(%rbp), %rcx
leaq 0x14ed5(%rip), %rax     # 0x53a15
movq %rax, (%rcx)
movq %rax, 0x8(%rcx)
movl $0x367, %edx            # imm = 0x367
callq 0x5710
movb $0x0, -0x48(%rbp)
leaq 0x30f84(%rip), %rax     # 0x6fae0
movq %rax, -0x50(%rbp)
movq 0x31449(%rip), %rax     # 0x6ffb0
movq %rax, -0x40(%rbp)
leaq 0x147e5(%rip), %rax     # 0x53357
movq %rax, -0x38(%rbp)
movq %r13, -0x1b0(%rbp)
movq %rbx, -0x1a8(%rbp)
leaq -0xa0(%rbp), %rdi
leaq -0x100(%rbp), %rsi
callq 0x1b5f0
leaq 0x319ea(%rip), %rsi     # 0x70588
movq %rax, %rdi
callq 0x1b338
movsd 0x31852(%rip), %xmm0    # 0x70400
movsd %xmm0, -0x30(%rbp)
subq $0x8, %rsp
leaq 0x1513f(%rip), %r14     # 0x53cfd
leaq 0x156c2(%rip), %r10     # 0x54287
leaq 0x156f1(%rip), %r15     # 0x542bd
leaq -0x50(%rbp), %rdi
leaq -0x1b0(%rbp), %rsi
pushq $0x1
popq %rcx
pushq $0x8
popq %r8
leaq -0x60(%rbp), %r9
movl $0x367, %edx            # imm = 0x367
pushq %r14
leaq -0x30(%rbp), %r11
pushq %r11
pushq %r10
pushq %rax
pushq %r15
callq 0x4eaf1
addq $0x30, %rsp
movq 0x3193c(%rip), %rdi     # 0x70540
leaq -0x370(%rbp), %rsi
movq %r13, (%rsi)
movq %rbx, 0x8(%rsi)
leaq -0x360(%rbp), %rcx
leaq 0x14df5(%rip), %rax     # 0x53a15
movq %rax, (%rcx)
movq %rax, 0x8(%rcx)
movl $0x368, %edx            # imm = 0x368
callq 0x5710
movb $0x0, -0x48(%rbp)
leaq 0x30ea4(%rip), %rax     # 0x6fae0
movq %rax, -0x50(%rbp)
movq 0x31369(%rip), %rax     # 0x6ffb0
movq %rax, -0x40(%rbp)
leaq 0x14705(%rip), %rax     # 0x53357
movq %rax, -0x38(%rbp)
movq %r13, %r12
movq %r13, -0x1a0(%rbp)
movq %rbx, %r15
movq %rbx, -0x198(%rbp)
leaq -0xa0(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x1b5f0
leaq 0x31904(%rip), %rsi     # 0x70588
movq %rax, %rdi
callq 0x1b338
movsd 0x3176c(%rip), %xmm0    # 0x70400
movsd %xmm0, -0x30(%rbp)
subq $0x8, %rsp
leaq 0x15633(%rip), %r10     # 0x542d7
leaq 0x1561f(%rip), %rbx     # 0x542ca
leaq -0x50(%rbp), %rdi
leaq -0x1a0(%rbp), %rsi
pushq $0x1
popq %rcx
pushq $0x8
popq %r8
leaq -0x58(%rbp), %r9
movl $0x368, %edx            # imm = 0x368
pushq %r14
leaq -0x30(%rbp), %r11
pushq %r11
pushq %r10
pushq %rax
pushq %rbx
callq 0x4eaf1
addq $0x30, %rsp
movq 0x3185e(%rip), %rdi     # 0x70540
leaq -0x350(%rbp), %rsi
movq %r12, %r13
movq %r12, (%rsi)
movq %r15, %rbx
movq %r15, 0x8(%rsi)
leaq -0x340(%rbp), %rcx
leaq 0x14d11(%rip), %rax     # 0x53a15
movq %rax, (%rcx)
movq %rax, 0x8(%rcx)
movl $0x369, %edx            # imm = 0x369
callq 0x5710
movb $0x0, -0x48(%rbp)
leaq 0x30dc0(%rip), %rax     # 0x6fae0
movq %rax, -0x50(%rbp)
movq 0x31285(%rip), %rax     # 0x6ffb0
movq %rax, -0x40(%rbp)
leaq 0x14621(%rip), %rax     # 0x53357
movq %rax, -0x38(%rbp)
movq %r13, -0x190(%rbp)
movq %rbx, -0x188(%rbp)
leaq 0x31839(%rip), %rsi     # 0x70588
leaq -0xa0(%rbp), %rdi
callq 0x1b5f0
leaq -0x120(%rbp), %rsi
movq %rax, %rdi
callq 0x1b338
movsd 0x3168e(%rip), %xmm0    # 0x70400
movsd %xmm0, -0x30(%rbp)
subq $0x8, %rsp
leaq 0x154dc(%rip), %r10     # 0x5425e
leaq -0x50(%rbp), %rdi
leaq -0x190(%rbp), %rsi
pushq $0x1
popq %rcx
pushq $0x8
popq %r8
leaq -0x60(%rbp), %r9
movl $0x369, %edx            # imm = 0x369
pushq %r14
leaq -0x30(%rbp), %r11
pushq %r11
pushq %r10
pushq %rax
leaq 0x1550e(%rip), %rax     # 0x542bd
pushq %rax
callq 0x4eaf1
addq $0x30, %rsp
movq 0x31780(%rip), %rdi     # 0x70540
leaq -0x330(%rbp), %rsi
movq %r12, %r13
movq %r12, (%rsi)
movq %r15, %rbx
movq %r15, 0x8(%rsi)
leaq -0x320(%rbp), %rcx
leaq 0x14c33(%rip), %rax     # 0x53a15
movq %rax, (%rcx)
movq %rax, 0x8(%rcx)
movl $0x36a, %edx            # imm = 0x36A
callq 0x5710
movb $0x0, -0x48(%rbp)
leaq 0x30ce2(%rip), %rax     # 0x6fae0
movq %rax, -0x50(%rbp)
movq 0x311a7(%rip), %rax     # 0x6ffb0
movq %rax, -0x40(%rbp)
leaq 0x14543(%rip), %rax     # 0x53357
movq %rax, -0x38(%rbp)
movq %r13, -0x180(%rbp)
movq %rbx, -0x178(%rbp)
leaq 0x3175b(%rip), %rsi     # 0x70588
leaq -0xa0(%rbp), %rdi
callq 0x1b5f0
leaq -0xe0(%rbp), %rsi
movq %rax, %rdi
callq 0x1b338
movsd 0x315b0(%rip), %xmm0    # 0x70400
movsd %xmm0, -0x30(%rbp)
subq $0x8, %rsp
leaq 0x1548e(%rip), %r10     # 0x542ee
leaq -0x50(%rbp), %rdi
leaq -0x180(%rbp), %rsi
pushq $0x1
popq %rcx
pushq $0x8
popq %r8
leaq -0x58(%rbp), %r9
movl $0x36a, %edx            # imm = 0x36A
pushq %r14
leaq -0x30(%rbp), %r11
pushq %r11
pushq %r10
pushq %rax
leaq 0x1543d(%rip), %rax     # 0x542ca
pushq %rax
callq 0x4eaf1
addq $0x30, %rsp
movq 0x316a2(%rip), %rdi     # 0x70540
leaq -0x310(%rbp), %rsi
movq %r12, %r13
movq %r12, (%rsi)
movq %r15, %rbx
movq %r15, 0x8(%rsi)
leaq -0x300(%rbp), %rcx
leaq 0x14b55(%rip), %rax     # 0x53a15
movq %rax, (%rcx)
movq %rax, 0x8(%rcx)
movl $0x36b, %edx            # imm = 0x36B
callq 0x5710
movb $0x0, -0x48(%rbp)
leaq 0x30c04(%rip), %rax     # 0x6fae0
movq %rax, -0x50(%rbp)
movq 0x310c9(%rip), %rax     # 0x6ffb0
movq %rax, -0x40(%rbp)
leaq 0x14465(%rip), %rax     # 0x53357
movq %rax, -0x38(%rbp)
movq %r13, -0x170(%rbp)
movq %rbx, -0x168(%rbp)
leaq -0xa0(%rbp), %rdi
leaq -0x120(%rbp), %rsi
callq 0x1b5f0
leaq -0x100(%rbp), %rsi
movq %rax, %rdi
callq 0x1b338
movsd 0x314d2(%rip), %xmm0    # 0x70400
movsd %xmm0, -0x30(%rbp)
subq $0x8, %rsp
leaq 0x15337(%rip), %r10     # 0x54275
leaq -0x50(%rbp), %rdi
leaq -0x170(%rbp), %rsi
pushq $0x1
popq %rcx
pushq $0x8
popq %r8
leaq -0x60(%rbp), %r9
movl $0x36b, %edx            # imm = 0x36B
pushq %r14
leaq -0x30(%rbp), %r11
pushq %r11
pushq %r10
pushq %rax
leaq 0x15352(%rip), %rax     # 0x542bd
pushq %rax
callq 0x4eaf1
addq $0x30, %rsp
movq 0x315c4(%rip), %rdi     # 0x70540
leaq -0x2f0(%rbp), %rsi
movq %r12, %r13
movq %r12, (%rsi)
movq %r15, %rbx
movq %r15, 0x8(%rsi)
leaq -0x2e0(%rbp), %rcx
leaq 0x14a77(%rip), %rax     # 0x53a15
movq %rax, (%rcx)
movq %rax, 0x8(%rcx)
movl $0x36c, %edx            # imm = 0x36C
callq 0x5710
movb $0x0, -0x48(%rbp)
leaq 0x30b26(%rip), %rax     # 0x6fae0
movq %rax, -0x50(%rbp)
movq 0x30feb(%rip), %rax     # 0x6ffb0
movq %rax, -0x40(%rbp)
leaq 0x14387(%rip), %rax     # 0x53357
movq %rax, -0x38(%rbp)
movq %r13, -0x160(%rbp)
movq %rbx, -0x158(%rbp)
leaq -0xa0(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
callq 0x1b5f0
leaq -0xc0(%rbp), %rsi
movq %rax, %rdi
callq 0x1b338
movsd 0x313f4(%rip), %xmm0    # 0x70400
movsd %xmm0, -0x30(%rbp)
subq $0x8, %rsp
leaq 0x152e9(%rip), %r10     # 0x54305
leaq -0x50(%rbp), %rdi
leaq -0x160(%rbp), %rsi
pushq $0x1
popq %rcx
pushq $0x8
popq %r8
leaq -0x58(%rbp), %r9
movl $0x36c, %edx            # imm = 0x36C
pushq %r14
leaq -0x30(%rbp), %r11
pushq %r11
pushq %r10
pushq %rax
leaq 0x15281(%rip), %rax     # 0x542ca
pushq %rax
callq 0x4eaf1
addq $0x30, %rsp
movq 0x314e6(%rip), %rdi     # 0x70540
leaq -0x2d0(%rbp), %rsi
movq %r12, (%rsi)
movq %r15, 0x8(%rsi)
leaq -0x2c0(%rbp), %rcx
leaq 0x1499f(%rip), %rax     # 0x53a15
movq %rax, (%rcx)
movq %rax, 0x8(%rcx)
movl $0x36d, %edx            # imm = 0x36D
callq 0x5710
leaq -0x50(%rbp), %rdi
movb $0x0, 0x8(%rdi)
leaq 0x30a4a(%rip), %rax     # 0x6fae0
movq %rax, (%rdi)
movq 0x30f10(%rip), %rax     # 0x6ffb0
movq %rax, 0x10(%rdi)
leaq 0x142ac(%rip), %rax     # 0x53357
movq %rax, 0x18(%rdi)
leaq -0x2b0(%rbp), %rsi
movq %r12, (%rsi)
movq %r15, 0x8(%rsi)
movabsq $-0x3ffa818f57f7e7c6, %rax # imm = 0xC0057E70A808183A
leaq -0x30(%rbp), %r9
movq %rax, (%r9)
movsd 0x3132a(%rip), %xmm0    # 0x70400
movsd %xmm0, -0x68(%rbp)
subq $0x8, %rsp
leaq 0x156a8(%rip), %rax     # 0x5478e
leaq -0x70(%rbp), %r10
leaq 0x15226(%rip), %r11     # 0x54317
pushq $0x1
popq %rcx
pushq $0x8
popq %r8
movl $0x36d, %edx            # imm = 0x36D
pushq %r14
leaq -0x68(%rbp), %rbx
pushq %rbx
pushq %rax
pushq %r10
pushq %r11
callq 0x4eaf1
addq $0x30, %rsp
leaq -0xa0(%rbp), %rdi
callq 0x1bb0c
leaq -0x270(%rbp), %rdi
callq 0x10c24
leaq -0x1d0(%rbp), %rdi
callq 0x57b8
leaq -0x150(%rbp), %rdi
callq 0x1bb0c
leaq -0x2a0(%rbp), %rdi
callq 0x200e8
leaq -0xc0(%rbp), %rdi
callq 0x57b8
leaq -0xe0(%rbp), %rdi
callq 0x57b8
leaq -0x100(%rbp), %rdi
callq 0x57b8
leaq -0x120(%rbp), %rdi
callq 0x57b8
addq $0x398, %rsp            # imm = 0x398
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3f21f
jmp 0x3f21f
jmp 0x3f21f
jmp 0x3f21f
jmp 0x3f21f
jmp 0x3f21f
jmp 0x3f21f
jmp 0x3f21f
jmp 0x3f21f
movq %rax, %rbx
jmp 0x3f23a
jmp 0x3f248
movq %rax, %rbx
movl $0x80, %r14d
leaq (%r14,%rbp), %rdi
addq $-0x270, %rdi           # imm = 0xFD90
callq 0x57b8
addq $-0x20, %r14
cmpq $-0x20, %r14
jne 0x3f1c1
jmp 0x3f263
movq %rax, %rbx
jmp 0x3f263
movq %rax, %rbx
jmp 0x3f26f
movq %rax, %rbx
jmp 0x3f27b
movq %rax, %rbx
jmp 0x3f287
jmp 0x3f21f
jmp 0x3f21f
jmp 0x3f21f
jmp 0x3f21f
jmp 0x3f21f
jmp 0x3f21f
movq %rax, %rbx
addq $-0x20, %r15
movq %r15, %rdi
callq 0x57b8
cmpq %r14, %r15
jne 0x3f20c
jmp 0x3f263
movq %rax, %rbx
leaq -0xa0(%rbp), %rdi
callq 0x1bb0c
leaq -0x270(%rbp), %rdi
callq 0x10c24
leaq -0x1d0(%rbp), %rdi
callq 0x57b8
jmp 0x3f24b
movq %rax, %rbx
leaq -0x150(%rbp), %rdi
callq 0x1bb0c
leaq -0x2a0(%rbp), %rdi
callq 0x200e8
leaq -0xc0(%rbp), %rdi
callq 0x57b8
leaq -0xe0(%rbp), %rdi
callq 0x57b8
leaq -0x100(%rbp), %rdi
callq 0x57b8
leaq -0x120(%rbp), %rdi
callq 0x57b8
movq %rbx, %rdi
callq 0x56b0