// File: aalto-speech[P]ftk/test/emtest.cc
// Function: ForwardBackwardTest5::test_method()
BOOST_AUTO_TEST_CASE(ForwardBackwardTest5)
{
    map<string, flt_type> vocab;
    vocab["a"] = -1.0;
    vocab["b"] = -1.0;
    vocab["ab"] = -2.0;
    string sentence("ab");
    map<string, flt_type> stats;
    flt_type lp = forward_backward(vocab, sentence, stats);
    BOOST_CHECK_EQUAL(3, (int)stats.size());
    BOOST_CHECK_CLOSE( (flt_type)0.50, stats["ab"], DBL_ACCURACY );
    BOOST_CHECK_CLOSE( (flt_type)0.50, stats["b"], DBL_ACCURACY );
    BOOST_CHECK_CLOSE( (flt_type)0.50, stats["a"], DBL_ACCURACY );
    // -2.0 + math.log(1+math.exp(-2.0-(-2.0)))
    BOOST_CHECK_CLOSE( (flt_type)-1.3068528194400546, lp, DBL_ACCURACY );
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x4d0, %rsp            # imm = 0x4D0
movq %rdi, -0x8(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x530a0
leaq -0x59(%rbp), %rdi
movq %rdi, -0x3a0(%rbp)
callq 0x67b0
movq -0x3a0(%rbp), %rdx
leaq 0x50d0e(%rip), %rsi     # 0xcbf14
leaq -0x58(%rbp), %rdi
callq 0x65e0
jmp 0x7b211
leaq -0x38(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x4b2f0
movq %rax, -0x3a8(%rbp)
jmp 0x7b227
movq -0x3a8(%rbp), %rax
movabsq $-0x4010000000000000, %rcx # imm = 0xBFF0000000000000
movq %rcx, (%rax)
leaq -0x58(%rbp), %rdi
callq 0x6908
leaq -0x59(%rbp), %rdi
callq 0x6470
leaq -0x91(%rbp), %rdi
movq %rdi, -0x3b0(%rbp)
callq 0x67b0
movq -0x3b0(%rbp), %rdx
leaq 0x50983(%rip), %rsi     # 0xcbbf1
leaq -0x90(%rbp), %rdi
callq 0x65e0
jmp 0x7b27c
leaq -0x38(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x4b2f0
movq %rax, -0x3b8(%rbp)
jmp 0x7b295
movq -0x3b8(%rbp), %rax
movabsq $-0x4010000000000000, %rcx # imm = 0xBFF0000000000000
movq %rcx, (%rax)
leaq -0x90(%rbp), %rdi
callq 0x6908
leaq -0x91(%rbp), %rdi
callq 0x6470
leaq -0xb9(%rbp), %rdi
movq %rdi, -0x3c0(%rbp)
callq 0x67b0
movq -0x3c0(%rbp), %rdx
leaq 0x5090e(%rip), %rsi     # 0xcbbf0
leaq -0xb8(%rbp), %rdi
callq 0x65e0
jmp 0x7b2f0
leaq -0x38(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x4b2f0
movq %rax, -0x3c8(%rbp)
jmp 0x7b309
movq -0x3c8(%rbp), %rax
movabsq $-0x4000000000000000, %rcx # imm = 0xC000000000000000
movq %rcx, (%rax)
leaq -0xb8(%rbp), %rdi
callq 0x6908
leaq -0xb9(%rbp), %rdi
callq 0x6470
leaq -0xe1(%rbp), %rdi
movq %rdi, -0x3d0(%rbp)
callq 0x67b0
movq -0x3d0(%rbp), %rdx
leaq 0x5089a(%rip), %rsi     # 0xcbbf0
leaq -0xe0(%rbp), %rdi
callq 0x65e0
jmp 0x7b364
leaq -0xe1(%rbp), %rdi
callq 0x6470
leaq -0x118(%rbp), %rdi
movq %rdi, -0x3e0(%rbp)
callq 0x530a0
movq -0x3e0(%rbp), %rdx
leaq -0x38(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
xorl %ecx, %ecx
callq 0x44ea0
movsd %xmm0, -0x3d8(%rbp)
jmp 0x7b3a6
movsd -0x3d8(%rbp), %xmm0
movsd %xmm0, -0x120(%rbp)
movq 0x8c233(%rip), %rax     # 0x1075f0
movq %rax, -0x3e8(%rbp)
leaq 0x5079d(%rip), %rsi     # 0xcbb68
leaq -0x130(%rbp), %rdi
movl $0xe, %edx
callq 0x70bd0
jmp 0x7b3de
leaq -0x140(%rbp), %rdi
callq 0x70c00
jmp 0x7b3ec
movq -0x3e8(%rbp), %rdi
leaq -0x130(%rbp), %rsi
movl $0x101, %edx            # imm = 0x101
leaq -0x140(%rbp), %rcx
callq 0x6840
jmp 0x7b40d
callq 0x70e90
movq %rax, -0x3f0(%rbp)
jmp 0x7b41b
movq -0x3f0(%rbp), %rsi
leaq 0x4ff01(%rip), %rdx     # 0xcb32a
leaq -0x168(%rbp), %rdi
callq 0x70e50
jmp 0x7b437
leaq 0x5072a(%rip), %rsi     # 0xcbb68
leaq -0x178(%rbp), %rdi
movl $0xe, %edx
callq 0x70bd0
jmp 0x7b451
movl $0x3, -0x17c(%rbp)
leaq -0x118(%rbp), %rdi
callq 0x5bdf0
movl %eax, -0x180(%rbp)
leaq 0x507fa(%rip), %rcx     # 0xcbc6e
movq %rsp, %rax
movq %rcx, 0x10(%rax)
leaq -0x180(%rbp), %rcx
movq %rcx, 0x8(%rax)
leaq 0x50ae2(%rip), %rcx     # 0xcbf6f
movq %rcx, (%rax)
leaq -0x168(%rbp), %rdi
leaq -0x178(%rbp), %rsi
movl $0x101, %edx            # imm = 0x101
movl $0x1, %ecx
movl $0x2, %r8d
leaq -0x17c(%rbp), %r9
callq 0xbf480
jmp 0x7b4bc
leaq -0x168(%rbp), %rdi
callq 0x70ea0
callq 0x70ec0
movb %al, -0x3f1(%rbp)
jmp 0x7b4d5
movb -0x3f1(%rbp), %al
testb $0x1, %al
jne 0x7b3b6
jmp 0x7b4e5
jmp 0x7b4e7
movq 0x8c102(%rip), %rax     # 0x1075f0
movq %rax, -0x400(%rbp)
leaq 0x5066c(%rip), %rsi     # 0xcbb68
leaq -0x190(%rbp), %rdi
movl $0xe, %edx
callq 0x70bd0
jmp 0x7b50f
leaq -0x1a0(%rbp), %rdi
callq 0x70c00
jmp 0x7b51d
movq -0x400(%rbp), %rdi
leaq -0x190(%rbp), %rsi
movl $0x102, %edx            # imm = 0x102
leaq -0x1a0(%rbp), %rcx
callq 0x6840
jmp 0x7b53e
callq 0x70e90
movq %rax, -0x408(%rbp)
jmp 0x7b54c
movq -0x408(%rbp), %rsi
leaq 0x4fdd0(%rip), %rdx     # 0xcb32a
leaq -0x1c8(%rbp), %rdi
callq 0x70e50
jmp 0x7b568
leaq 0x505f9(%rip), %rsi     # 0xcbb68
leaq -0x1d8(%rbp), %rdi
movl $0xe, %edx
callq 0x70bd0
jmp 0x7b582
movabsq $0x3fe0000000000000, %rax # imm = 0x3FE0000000000000
movq %rax, -0x1e0(%rbp)
leaq -0x201(%rbp), %rdi
movq %rdi, -0x410(%rbp)
callq 0x67b0
movq -0x410(%rbp), %rdx
leaq 0x5063c(%rip), %rsi     # 0xcbbf0
leaq -0x200(%rbp), %rdi
callq 0x65e0
jmp 0x7b5c2
leaq -0x118(%rbp), %rdi
leaq -0x200(%rbp), %rsi
callq 0x4b2f0
movq %rax, -0x418(%rbp)
jmp 0x7b5de
movsd 0x8beca(%rip), %xmm0    # 0x1074b0
callq 0xbf970
movsd %xmm0, -0x420(%rbp)
jmp 0x7b5f5
movq -0x418(%rbp), %rcx
movsd -0x420(%rbp), %xmm0
movsd %xmm0, -0x210(%rbp)
leaq 0x506d2(%rip), %rdx     # 0xcbce5
movq %rsp, %rax
movq %rdx, 0x20(%rax)
leaq -0x210(%rbp), %rdx
movq %rdx, 0x18(%rax)
leaq 0x506ad(%rip), %rdx     # 0xcbcd9
movq %rdx, 0x10(%rax)
movq %rcx, 0x8(%rax)
leaq 0x5068f(%rip), %rcx     # 0xcbcca
movq %rcx, (%rax)
leaq -0x1c8(%rbp), %rdi
leaq -0x1d8(%rbp), %rsi
movl $0x102, %edx            # imm = 0x102
movl $0x1, %ecx
movl $0x8, %r8d
leaq -0x1e0(%rbp), %r9
callq 0xbf6a0
jmp 0x7b66a
leaq -0x200(%rbp), %rdi
callq 0x6908
leaq -0x201(%rbp), %rdi
callq 0x6470
leaq -0x1c8(%rbp), %rdi
callq 0x70ea0
callq 0x70ec0
movb %al, -0x421(%rbp)
jmp 0x7b69b
movb -0x421(%rbp), %al
testb $0x1, %al
jne 0x7b4e7
jmp 0x7b6ab
jmp 0x7b6ad
movq 0x8bf3c(%rip), %rax     # 0x1075f0
movq %rax, -0x430(%rbp)
leaq 0x504a6(%rip), %rsi     # 0xcbb68
leaq -0x220(%rbp), %rdi
movl $0xe, %edx
callq 0x70bd0
jmp 0x7b6d5
leaq -0x230(%rbp), %rdi
callq 0x70c00
jmp 0x7b6e3
movq -0x430(%rbp), %rdi
leaq -0x220(%rbp), %rsi
movl $0x103, %edx            # imm = 0x103
leaq -0x230(%rbp), %rcx
callq 0x6840
jmp 0x7b704
callq 0x70e90
movq %rax, -0x438(%rbp)
jmp 0x7b712
movq -0x438(%rbp), %rsi
leaq 0x4fc0a(%rip), %rdx     # 0xcb32a
leaq -0x258(%rbp), %rdi
callq 0x70e50
jmp 0x7b72e
leaq 0x50433(%rip), %rsi     # 0xcbb68
leaq -0x268(%rbp), %rdi
movl $0xe, %edx
callq 0x70bd0
jmp 0x7b748
movabsq $0x3fe0000000000000, %rax # imm = 0x3FE0000000000000
movq %rax, -0x270(%rbp)
leaq -0x291(%rbp), %rdi
movq %rdi, -0x440(%rbp)
callq 0x67b0
movq -0x440(%rbp), %rdx
leaq 0x50477(%rip), %rsi     # 0xcbbf1
leaq -0x290(%rbp), %rdi
callq 0x65e0
jmp 0x7b788
leaq -0x118(%rbp), %rdi
leaq -0x290(%rbp), %rsi
callq 0x4b2f0
movq %rax, -0x448(%rbp)
jmp 0x7b7a4
movsd 0x8bd04(%rip), %xmm0    # 0x1074b0
callq 0xbf970
movsd %xmm0, -0x450(%rbp)
jmp 0x7b7bb
movq -0x448(%rbp), %rcx
movsd -0x450(%rbp), %xmm0
movsd %xmm0, -0x2a0(%rbp)
leaq 0x5050c(%rip), %rdx     # 0xcbce5
movq %rsp, %rax
movq %rdx, 0x20(%rax)
leaq -0x2a0(%rbp), %rdx
movq %rdx, 0x18(%rax)
leaq 0x504cd(%rip), %rdx     # 0xcbcbf
movq %rdx, 0x10(%rax)
movq %rcx, 0x8(%rax)
leaq 0x504c9(%rip), %rcx     # 0xcbcca
movq %rcx, (%rax)
leaq -0x258(%rbp), %rdi
leaq -0x268(%rbp), %rsi
movl $0x103, %edx            # imm = 0x103
movl $0x1, %ecx
movl $0x8, %r8d
leaq -0x270(%rbp), %r9
callq 0xbf6a0
jmp 0x7b830
leaq -0x290(%rbp), %rdi
callq 0x6908
leaq -0x291(%rbp), %rdi
callq 0x6470
leaq -0x258(%rbp), %rdi
callq 0x70ea0
callq 0x70ec0
movb %al, -0x451(%rbp)
jmp 0x7b861
movb -0x451(%rbp), %al
testb $0x1, %al
jne 0x7b6ad
jmp 0x7b871
jmp 0x7b873
movq 0x8bd76(%rip), %rax     # 0x1075f0
movq %rax, -0x460(%rbp)
leaq 0x502e0(%rip), %rsi     # 0xcbb68
leaq -0x2b0(%rbp), %rdi
movl $0xe, %edx
callq 0x70bd0
jmp 0x7b89b
leaq -0x2c0(%rbp), %rdi
callq 0x70c00
jmp 0x7b8a9
movq -0x460(%rbp), %rdi
leaq -0x2b0(%rbp), %rsi
movl $0x104, %edx            # imm = 0x104
leaq -0x2c0(%rbp), %rcx
callq 0x6840
jmp 0x7b8ca
callq 0x70e90
movq %rax, -0x468(%rbp)
jmp 0x7b8d8
movq -0x468(%rbp), %rsi
leaq 0x4fa44(%rip), %rdx     # 0xcb32a
leaq -0x2e8(%rbp), %rdi
callq 0x70e50
jmp 0x7b8f4
leaq 0x5026d(%rip), %rsi     # 0xcbb68
leaq -0x2f8(%rbp), %rdi
movl $0xe, %edx
callq 0x70bd0
jmp 0x7b90e
movabsq $0x3fe0000000000000, %rax # imm = 0x3FE0000000000000
movq %rax, -0x300(%rbp)
leaq -0x321(%rbp), %rdi
movq %rdi, -0x470(%rbp)
callq 0x67b0
movq -0x470(%rbp), %rdx
leaq 0x505d4(%rip), %rsi     # 0xcbf14
leaq -0x320(%rbp), %rdi
callq 0x65e0
jmp 0x7b94e
leaq -0x118(%rbp), %rdi
leaq -0x320(%rbp), %rsi
callq 0x4b2f0
movq %rax, -0x478(%rbp)
jmp 0x7b96a
movsd 0x8bb3e(%rip), %xmm0    # 0x1074b0
callq 0xbf970
movsd %xmm0, -0x480(%rbp)
jmp 0x7b981
movq -0x478(%rbp), %rcx
movsd -0x480(%rbp), %xmm0
movsd %xmm0, -0x330(%rbp)
leaq 0x50346(%rip), %rdx     # 0xcbce5
movq %rsp, %rax
movq %rdx, 0x20(%rax)
leaq -0x330(%rbp), %rdx
movq %rdx, 0x18(%rax)
leaq 0x502fc(%rip), %rdx     # 0xcbcb4
movq %rdx, 0x10(%rax)
movq %rcx, 0x8(%rax)
leaq 0x50303(%rip), %rcx     # 0xcbcca
movq %rcx, (%rax)
leaq -0x2e8(%rbp), %rdi
leaq -0x2f8(%rbp), %rsi
movl $0x104, %edx            # imm = 0x104
movl $0x1, %ecx
movl $0x8, %r8d
leaq -0x300(%rbp), %r9
callq 0xbf6a0
jmp 0x7b9f6
leaq -0x320(%rbp), %rdi
callq 0x6908
leaq -0x321(%rbp), %rdi
callq 0x6470
leaq -0x2e8(%rbp), %rdi
callq 0x70ea0
callq 0x70ec0
movb %al, -0x481(%rbp)
jmp 0x7ba27
movb -0x481(%rbp), %al
testb $0x1, %al
jne 0x7b873
jmp 0x7ba37
jmp 0x7ba39
movq 0x8bbb0(%rip), %rax     # 0x1075f0
movq %rax, -0x490(%rbp)
leaq 0x5011a(%rip), %rsi     # 0xcbb68
leaq -0x340(%rbp), %rdi
movl $0xe, %edx
callq 0x70bd0
jmp 0x7ba61
leaq -0x350(%rbp), %rdi
callq 0x70c00
jmp 0x7ba6f
movq -0x490(%rbp), %rdi
leaq -0x340(%rbp), %rsi
movl $0x106, %edx            # imm = 0x106
leaq -0x350(%rbp), %rcx
callq 0x6840
jmp 0x7ba90
callq 0x70e90
movq %rax, -0x498(%rbp)
jmp 0x7ba9e
movq -0x498(%rbp), %rsi
leaq 0x4f87e(%rip), %rdx     # 0xcb32a
leaq -0x378(%rbp), %rdi
callq 0x70e50
jmp 0x7baba
leaq 0x500a7(%rip), %rsi     # 0xcbb68
leaq -0x388(%rbp), %rdi
movl $0xe, %edx
callq 0x70bd0
jmp 0x7bad4
movabsq $-0x400b17217f7d1cf8, %rax # imm = 0xBFF4E8DE8082E308
movq %rax, -0x390(%rbp)
movsd 0x8b9c3(%rip), %xmm0    # 0x1074b0
callq 0xbf970
movsd %xmm0, -0x4a0(%rbp)
jmp 0x7bafc
movsd -0x4a0(%rbp), %xmm0
movsd %xmm0, -0x398(%rbp)
leaq 0x501d2(%rip), %rcx     # 0xcbce5
movq %rsp, %rax
movq %rcx, 0x20(%rax)
leaq -0x398(%rbp), %rcx
movq %rcx, 0x18(%rax)
leaq 0x50c4a(%rip), %rcx     # 0xcc776
movq %rcx, 0x10(%rax)
leaq -0x120(%rbp), %rcx
movq %rcx, 0x8(%rax)
leaq 0x501d7(%rip), %rcx     # 0xcbd19
movq %rcx, (%rax)
leaq -0x378(%rbp), %rdi
leaq -0x388(%rbp), %rsi
movl $0x106, %edx            # imm = 0x106
movl $0x1, %ecx
movl $0x8, %r8d
leaq -0x390(%rbp), %r9
callq 0xbf6a0
jmp 0x7bb71
leaq -0x378(%rbp), %rdi
callq 0x70ea0
callq 0x70ec0
movb %al, -0x4a1(%rbp)
jmp 0x7bb8a
movb -0x4a1(%rbp), %al
testb $0x1, %al
jne 0x7ba39
jmp 0x7bb9a
leaq -0x118(%rbp), %rdi
callq 0x4cf70
leaq -0xe0(%rbp), %rdi
callq 0x6908
leaq -0x38(%rbp), %rdi
callq 0x4cf70
addq $0x4d0, %rsp            # imm = 0x4D0
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x7bbe7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x6908
leaq -0x59(%rbp), %rdi
callq 0x6470
jmp 0x7bdcb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x7bc1b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x6908
leaq -0x91(%rbp), %rdi
callq 0x6470
jmp 0x7bdcb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x7bc52
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0xb8(%rbp), %rdi
callq 0x6908
leaq -0xb9(%rbp), %rdi
callq 0x6470
jmp 0x7bdcb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0xe1(%rbp), %rdi
callq 0x6470
jmp 0x7bdcb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x7bdb3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x168(%rbp), %rdi
callq 0x70ea0
jmp 0x7bdb3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x7bcee
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x7bce2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x200(%rbp), %rdi
callq 0x6908
leaq -0x201(%rbp), %rdi
callq 0x6470
leaq -0x1c8(%rbp), %rdi
callq 0x70ea0
jmp 0x7bdb3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x7bd3f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x7bd33
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x290(%rbp), %rdi
callq 0x6908
leaq -0x291(%rbp), %rdi
callq 0x6470
leaq -0x258(%rbp), %rdi
callq 0x70ea0
jmp 0x7bdb3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x7bd8d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x7bd81
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x320(%rbp), %rdi
callq 0x6908
leaq -0x321(%rbp), %rdi
callq 0x6470
leaq -0x2e8(%rbp), %rdi
callq 0x70ea0
jmp 0x7bdb3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x378(%rbp), %rdi
callq 0x70ea0
leaq -0x118(%rbp), %rdi
callq 0x4cf70
leaq -0xe0(%rbp), %rdi
callq 0x6908
leaq -0x38(%rbp), %rdi
callq 0x4cf70
movq -0x68(%rbp), %rdi
callq 0x67a0
nopl (%rax)