// File: aalto-speech[P]ftk/test/emtest.cc
// Function: viterbiChecks(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&, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>&, double, bool)
void
viterbiChecks(const map<string, flt_type> &vocab,
              int maxlen,
              string &sentence,
              vector<string> &correct_path,
              flt_type correct_lp,
              bool utf8=true)
{
    vector<string> result_path;
    flt_type result_lp = viterbi(vocab, maxlen, sentence, result_path, true, utf8);
    BOOST_CHECK_EQUAL( correct_path.size(), result_path.size() );
    BOOST_CHECK_EQUAL( correct_lp, result_lp );
    for (unsigned int i=0; i<correct_path.size(); i++)
        BOOST_CHECK_EQUAL( correct_path[i], result_path[i] );

    result_path.clear();
    StringSet ssvocab(vocab);
    result_lp = viterbi(ssvocab, sentence, result_path, true, utf8);
    BOOST_CHECK_EQUAL( correct_path.size(), result_path.size() );
    BOOST_CHECK_EQUAL( correct_lp, result_lp );
    for (unsigned int i=0; i<correct_path.size(); i++)
        BOOST_CHECK_EQUAL( correct_path[i], result_path[i] );
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x4a0, %rsp            # imm = 0x4A0
movb %r8b, %al
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movsd %xmm0, -0x28(%rbp)
andb $0x1, %al
movb %al, -0x29(%rbp)
leaq -0x48(%rbp), %rdi
movq %rdi, -0x3d0(%rbp)
callq 0xc7d0
movq -0x3d0(%rbp), %rcx
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movq -0x18(%rbp), %rdx
movzbl -0x29(%rbp), %r9d
andl $0x1, %r9d
movl $0x1, %r8d
callq 0x43490
movsd %xmm0, -0x3c8(%rbp)
jmp 0x72387
movsd -0x3c8(%rbp), %xmm0
movsd %xmm0, -0x50(%rbp)
movq 0x95255(%rip), %rax     # 0x1075f0
movq %rax, -0x3d8(%rbp)
leaq 0x597bf(%rip), %rsi     # 0xcbb68
leaq -0x70(%rbp), %rdi
movl $0xe, %edx
callq 0x70bd0
jmp 0x723b9
leaq -0x80(%rbp), %rdi
callq 0x70c00
jmp 0x723c4
movq -0x3d8(%rbp), %rdi
leaq -0x70(%rbp), %rsi
movl $0x16, %edx
leaq -0x80(%rbp), %rcx
callq 0x6840
jmp 0x723df
callq 0x70e90
movq %rax, -0x3e0(%rbp)
jmp 0x723ed
movq -0x3e0(%rbp), %rsi
leaq 0x58f2f(%rip), %rdx     # 0xcb32a
leaq -0xa8(%rbp), %rdi
callq 0x70e50
jmp 0x72409
leaq 0x59758(%rip), %rsi     # 0xcbb68
leaq -0xb8(%rbp), %rdi
movl $0xe, %edx
callq 0x70bd0
jmp 0x72423
movq -0x20(%rbp), %rdi
callq 0xcba0
movq %rax, -0xc0(%rbp)
leaq -0x48(%rbp), %rdi
callq 0xcba0
movq %rax, -0xc8(%rbp)
leaq 0x59741(%rip), %rcx     # 0xcbb8b
movq %rsp, %rax
movq %rcx, 0x10(%rax)
leaq -0xc8(%rbp), %rcx
movq %rcx, 0x8(%rax)
leaq 0x59714(%rip), %rcx     # 0xcbb77
movq %rcx, (%rax)
leaq -0xa8(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
movl $0x16, %edx
movl $0x1, %ecx
movl $0x2, %r8d
leaq -0xc0(%rbp), %r9
callq 0xbf040
jmp 0x72492
leaq -0xa8(%rbp), %rdi
callq 0x70ea0
callq 0x70ec0
movb %al, -0x3e1(%rbp)
jmp 0x724ab
movb -0x3e1(%rbp), %al
testb $0x1, %al
jne 0x72394
jmp 0x724bb
jmp 0x724bd
movq 0x9512c(%rip), %rax     # 0x1075f0
movq %rax, -0x3f0(%rbp)
leaq 0x59696(%rip), %rsi     # 0xcbb68
leaq -0xd8(%rbp), %rdi
movl $0xe, %edx
callq 0x70bd0
jmp 0x724e5
leaq -0xe8(%rbp), %rdi
callq 0x70c00
jmp 0x724f3
movq -0x3f0(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
movl $0x17, %edx
leaq -0xe8(%rbp), %rcx
callq 0x6840
jmp 0x72514
callq 0x70e90
movq %rax, -0x3f8(%rbp)
jmp 0x72522
movq -0x3f8(%rbp), %rsi
leaq 0x58dfa(%rip), %rdx     # 0xcb32a
leaq -0x110(%rbp), %rdi
callq 0x70e50
jmp 0x7253e
leaq 0x59623(%rip), %rsi     # 0xcbb68
leaq -0x120(%rbp), %rdi
movl $0xe, %edx
callq 0x70bd0
jmp 0x72558
leaq 0x5964a(%rip), %rcx     # 0xcbba9
movq %rsp, %rax
movq %rcx, 0x10(%rax)
leaq -0x50(%rbp), %rcx
movq %rcx, 0x8(%rax)
leaq 0x59629(%rip), %rcx     # 0xcbb9e
movq %rcx, (%rax)
leaq -0x110(%rbp), %rdi
leaq -0x120(%rbp), %rsi
movl $0x17, %edx
movl $0x1, %ecx
movl $0x2, %r8d
leaq -0x28(%rbp), %r9
callq 0x70c30
jmp 0x725a1
leaq -0x110(%rbp), %rdi
callq 0x70ea0
callq 0x70ec0
movb %al, -0x3f9(%rbp)
jmp 0x725ba
movb -0x3f9(%rbp), %al
testb $0x1, %al
jne 0x724bd
jmp 0x725ca
movl $0x0, -0x124(%rbp)
movl -0x124(%rbp), %eax
movq %rax, -0x408(%rbp)
movq -0x20(%rbp), %rdi
callq 0xcba0
movq %rax, %rcx
movq -0x408(%rbp), %rax
cmpq %rcx, %rax
jae 0x727b5
jmp 0x725ff
movq 0x94fea(%rip), %rax     # 0x1075f0
movq %rax, -0x410(%rbp)
leaq 0x59554(%rip), %rsi     # 0xcbb68
leaq -0x138(%rbp), %rdi
movl $0xe, %edx
callq 0x70bd0
jmp 0x72627
leaq -0x148(%rbp), %rdi
callq 0x70c00
jmp 0x72635
movq -0x410(%rbp), %rdi
leaq -0x138(%rbp), %rsi
movl $0x19, %edx
leaq -0x148(%rbp), %rcx
callq 0x6840
jmp 0x72656
callq 0x70e90
movq %rax, -0x418(%rbp)
jmp 0x72664
movq -0x418(%rbp), %rsi
leaq 0x58cb8(%rip), %rdx     # 0xcb32a
leaq -0x170(%rbp), %rdi
callq 0x70e50
jmp 0x72680
leaq 0x594e1(%rip), %rsi     # 0xcbb68
leaq -0x180(%rbp), %rdi
movl $0xe, %edx
callq 0x70bd0
jmp 0x7269a
movq -0x20(%rbp), %rdi
movl -0x124(%rbp), %eax
movl %eax, %esi
callq 0xcbf0
movq %rax, -0x420(%rbp)
movl -0x124(%rbp), %eax
movl %eax, %esi
leaq -0x48(%rbp), %rdi
callq 0xcbf0
movq -0x420(%rbp), %r9
movq %rax, %rcx
leaq 0x594ef(%rip), %rdx     # 0xcbbc3
movq %rsp, %rax
movq %rdx, 0x10(%rax)
movq %rcx, 0x8(%rax)
leaq 0x594cd(%rip), %rcx     # 0xcbbb3
movq %rcx, (%rax)
leaq -0x170(%rbp), %rdi
leaq -0x180(%rbp), %rsi
movl $0x19, %edx
movl $0x1, %ecx
movl $0x2, %r8d
callq 0xbf260
jmp 0x7270e
leaq -0x170(%rbp), %rdi
callq 0x70ea0
callq 0x70ec0
movb %al, -0x421(%rbp)
jmp 0x72727
movb -0x421(%rbp), %al
testb $0x1, %al
jne 0x725ff
jmp 0x72737
jmp 0x72739
movl -0x124(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x124(%rbp)
jmp 0x725d4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x72c54
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0x70ea0
jmp 0x72c54
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x110(%rbp), %rdi
callq 0x70ea0
jmp 0x72c54
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x170(%rbp), %rdi
callq 0x70ea0
jmp 0x72c54
leaq -0x48(%rbp), %rdi
callq 0xdfd0
movq -0x8(%rbp), %rsi
leaq -0x2a0(%rbp), %rdi
callq 0x1ce60
jmp 0x727d0
movq -0x18(%rbp), %rsi
movzbl -0x29(%rbp), %r8d
andl $0x1, %r8d
leaq -0x2a0(%rbp), %rdi
leaq -0x48(%rbp), %rdx
movl $0x1, %ecx
callq 0x43ae0
movsd %xmm0, -0x430(%rbp)
jmp 0x727fc
movsd -0x430(%rbp), %xmm0
movsd %xmm0, -0x50(%rbp)
movq 0x94de0(%rip), %rax     # 0x1075f0
movq %rax, -0x438(%rbp)
leaq 0x5934a(%rip), %rsi     # 0xcbb68
leaq -0x2b0(%rbp), %rdi
movl $0xe, %edx
callq 0x70bd0
jmp 0x72831
leaq -0x2c0(%rbp), %rdi
callq 0x70c00
jmp 0x7283f
movq -0x438(%rbp), %rdi
leaq -0x2b0(%rbp), %rsi
movl $0x1e, %edx
leaq -0x2c0(%rbp), %rcx
callq 0x6840
jmp 0x72860
callq 0x70e90
movq %rax, -0x440(%rbp)
jmp 0x7286e
movq -0x440(%rbp), %rsi
leaq 0x58aae(%rip), %rdx     # 0xcb32a
leaq -0x2e8(%rbp), %rdi
callq 0x70e50
jmp 0x7288a
leaq 0x592d7(%rip), %rsi     # 0xcbb68
leaq -0x2f8(%rbp), %rdi
movl $0xe, %edx
callq 0x70bd0
jmp 0x728a4
movq -0x20(%rbp), %rdi
callq 0xcba0
movq %rax, -0x300(%rbp)
leaq -0x48(%rbp), %rdi
callq 0xcba0
movq %rax, -0x308(%rbp)
leaq 0x592c0(%rip), %rcx     # 0xcbb8b
movq %rsp, %rax
movq %rcx, 0x10(%rax)
leaq -0x308(%rbp), %rcx
movq %rcx, 0x8(%rax)
leaq 0x59293(%rip), %rcx     # 0xcbb77
movq %rcx, (%rax)
leaq -0x2e8(%rbp), %rdi
leaq -0x2f8(%rbp), %rsi
movl $0x1e, %edx
movl $0x1, %ecx
movl $0x2, %r8d
leaq -0x300(%rbp), %r9
callq 0xbf040
jmp 0x72913
leaq -0x2e8(%rbp), %rdi
callq 0x70ea0
callq 0x70ec0
movb %al, -0x441(%rbp)
jmp 0x7292c
movb -0x441(%rbp), %al
testb $0x1, %al
jne 0x72809
jmp 0x7293c
jmp 0x7293e
movq 0x94cab(%rip), %rax     # 0x1075f0
movq %rax, -0x450(%rbp)
leaq 0x59215(%rip), %rsi     # 0xcbb68
leaq -0x318(%rbp), %rdi
movl $0xe, %edx
callq 0x70bd0
jmp 0x72966
leaq -0x328(%rbp), %rdi
callq 0x70c00
jmp 0x72974
movq -0x450(%rbp), %rdi
leaq -0x318(%rbp), %rsi
movl $0x1f, %edx
leaq -0x328(%rbp), %rcx
callq 0x6840
jmp 0x72995
callq 0x70e90
movq %rax, -0x458(%rbp)
jmp 0x729a3
movq -0x458(%rbp), %rsi
leaq 0x58979(%rip), %rdx     # 0xcb32a
leaq -0x350(%rbp), %rdi
callq 0x70e50
jmp 0x729bf
leaq 0x591a2(%rip), %rsi     # 0xcbb68
leaq -0x360(%rbp), %rdi
movl $0xe, %edx
callq 0x70bd0
jmp 0x729d9
leaq 0x591c9(%rip), %rcx     # 0xcbba9
movq %rsp, %rax
movq %rcx, 0x10(%rax)
leaq -0x50(%rbp), %rcx
movq %rcx, 0x8(%rax)
leaq 0x591a8(%rip), %rcx     # 0xcbb9e
movq %rcx, (%rax)
leaq -0x350(%rbp), %rdi
leaq -0x360(%rbp), %rsi
movl $0x1f, %edx
movl $0x1, %ecx
movl $0x2, %r8d
leaq -0x28(%rbp), %r9
callq 0x70c30
jmp 0x72a22
leaq -0x350(%rbp), %rdi
callq 0x70ea0
callq 0x70ec0
movb %al, -0x459(%rbp)
jmp 0x72a3b
movb -0x459(%rbp), %al
testb $0x1, %al
jne 0x7293e
jmp 0x72a4b
movl $0x0, -0x364(%rbp)
movl -0x364(%rbp), %eax
movq %rax, -0x468(%rbp)
movq -0x20(%rbp), %rdi
callq 0xcba0
movq %rax, %rcx
movq -0x468(%rbp), %rax
cmpq %rcx, %rax
jae 0x72c2a
jmp 0x72a80
movq 0x94b69(%rip), %rax     # 0x1075f0
movq %rax, -0x470(%rbp)
leaq 0x590d3(%rip), %rsi     # 0xcbb68
leaq -0x378(%rbp), %rdi
movl $0xe, %edx
callq 0x70bd0
jmp 0x72aa8
leaq -0x388(%rbp), %rdi
callq 0x70c00
jmp 0x72ab6
movq -0x470(%rbp), %rdi
leaq -0x378(%rbp), %rsi
movl $0x21, %edx
leaq -0x388(%rbp), %rcx
callq 0x6840
jmp 0x72ad7
callq 0x70e90
movq %rax, -0x478(%rbp)
jmp 0x72ae5
movq -0x478(%rbp), %rsi
leaq 0x58837(%rip), %rdx     # 0xcb32a
leaq -0x3b0(%rbp), %rdi
callq 0x70e50
jmp 0x72b01
leaq 0x59060(%rip), %rsi     # 0xcbb68
leaq -0x3c0(%rbp), %rdi
movl $0xe, %edx
callq 0x70bd0
jmp 0x72b1b
movq -0x20(%rbp), %rdi
movl -0x364(%rbp), %eax
movl %eax, %esi
callq 0xcbf0
movq %rax, -0x480(%rbp)
movl -0x364(%rbp), %eax
movl %eax, %esi
leaq -0x48(%rbp), %rdi
callq 0xcbf0
movq -0x480(%rbp), %r9
movq %rax, %rcx
leaq 0x5906e(%rip), %rdx     # 0xcbbc3
movq %rsp, %rax
movq %rdx, 0x10(%rax)
movq %rcx, 0x8(%rax)
leaq 0x5904c(%rip), %rcx     # 0xcbbb3
movq %rcx, (%rax)
leaq -0x3b0(%rbp), %rdi
leaq -0x3c0(%rbp), %rsi
movl $0x21, %edx
movl $0x1, %ecx
movl $0x2, %r8d
callq 0xbf260
jmp 0x72b8f
leaq -0x3b0(%rbp), %rdi
callq 0x70ea0
callq 0x70ec0
movb %al, -0x481(%rbp)
jmp 0x72ba8
movb -0x481(%rbp), %al
testb $0x1, %al
jne 0x72a80
jmp 0x72bb8
jmp 0x72bba
movl -0x364(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x364(%rbp)
jmp 0x72a55
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x72c48
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x2e8(%rbp), %rdi
callq 0x70ea0
jmp 0x72c48
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x350(%rbp), %rdi
callq 0x70ea0
jmp 0x72c48
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x3b0(%rbp), %rdi
callq 0x70ea0
jmp 0x72c48
leaq -0x2a0(%rbp), %rdi
callq 0x1d3d0
leaq -0x48(%rbp), %rdi
callq 0xcfc0
addq $0x4a0, %rsp            # imm = 0x4A0
popq %rbp
retq
leaq -0x2a0(%rbp), %rdi
callq 0x1d3d0
leaq -0x48(%rbp), %rdi
callq 0xcfc0
movq -0x58(%rbp), %rdi
callq 0x67a0
nopw %cs:(%rax,%rax)