// File: aalto-speech[P]ftk/src/StringSet.cc
// Function: StringSet::assign_scores(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&)
void
StringSet::assign_scores(const map<string, flt_type> &vocab)
{
    for (auto it = vocab.begin(); it != vocab.end(); ++it) {
        string factor(it->first);
        Node *node = &root_node;
        int i=0;
        for (; i < (int)factor.length()-1; i++)
            node = insert(factor[i], "" , 0.0, node);
        insert(factor[i], factor, it->second, node);
    }

    vector<Arc*> arcs;
    collect_arcs(arcs);

    for (auto ait = arcs.begin(); ait != arcs.end(); ++ait) {
        if (vocab.find((*ait)->factor) == vocab.end()) {
            (*ait)->factor.clear();
            (*ait)->cost = 0.0;
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x120, %rsp            # imm = 0x120
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xc8(%rbp)
movq -0x10(%rbp), %rdi
callq 0x1b450
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x1b480
movq %rax, -0x20(%rbp)
leaq -0x18(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x1b290
testb $0x1, %al
jne 0x1ac1e
jmp 0x1adca
leaq -0x18(%rbp), %rdi
callq 0x1b2f0
movq %rax, %rsi
leaq -0x40(%rbp), %rdi
callq 0x41a0
movq -0xc8(%rbp), %rax
movq %rax, -0x48(%rbp)
movl $0x0, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
movl %eax, -0xcc(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x45e0
movq %rax, %rcx
movl -0xcc(%rbp), %eax
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x1ad55
movslq -0x4c(%rbp), %rsi
leaq -0x40(%rbp), %rdi
callq 0x47f0
movq %rax, -0xd8(%rbp)
jmp 0x1ac81
movq -0xd8(%rbp), %rax
movb (%rax), %al
movb %al, -0xe1(%rbp)
leaq -0x81(%rbp), %rdi
movq %rdi, -0xe0(%rbp)
callq 0x46f0
movq -0xe0(%rbp), %rdx
leaq 0x4b846(%rip), %rsi     # 0x664f7
leaq -0x80(%rbp), %rdi
callq 0x4550
jmp 0x1acbc
movq -0xc8(%rbp), %rdi
movb -0xe1(%rbp), %al
movq -0x48(%rbp), %rcx
movsbl %al, %esi
leaq -0x80(%rbp), %rdx
xorps %xmm0, %xmm0
callq 0x1a500
movq %rax, -0xf0(%rbp)
jmp 0x1ace5
movq -0xf0(%rbp), %rax
movq %rax, -0x48(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x4828
leaq -0x81(%rbp), %rdi
callq 0x4420
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x1ac45
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x1adbc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x1ad47
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x4828
leaq -0x81(%rbp), %rdi
callq 0x4420
jmp 0x1adbc
movslq -0x4c(%rbp), %rsi
leaq -0x40(%rbp), %rdi
callq 0x47f0
movq %rax, -0xf8(%rbp)
jmp 0x1ad6b
movq -0xf8(%rbp), %rax
movsbl (%rax), %eax
movl %eax, -0xfc(%rbp)
leaq -0x18(%rbp), %rdi
callq 0x1b2f0
movq -0xc8(%rbp), %rdi
movl -0xfc(%rbp), %esi
movsd 0x20(%rax), %xmm0
movq -0x48(%rbp), %rcx
leaq -0x40(%rbp), %rdx
callq 0x1a500
jmp 0x1ada5
leaq -0x40(%rbp), %rdi
callq 0x4828
leaq -0x18(%rbp), %rdi
callq 0x1b320
jmp 0x1abfb
leaq -0x40(%rbp), %rdi
callq 0x4828
jmp 0x1af11
leaq -0xa0(%rbp), %rdi
movq %rdi, -0x108(%rbp)
callq 0x1b4b0
movq -0xc8(%rbp), %rdi
movq -0x108(%rbp), %rsi
callq 0x1af20
jmp 0x1adf2
leaq -0xa0(%rbp), %rdi
callq 0x1b4d0
movq %rax, -0xa8(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0x1b540
movq %rax, -0xb0(%rbp)
leaq -0xa8(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
callq 0x1b500
testb $0x1, %al
jne 0x1ae34
jmp 0x1aefc
movq -0x10(%rbp), %rax
movq %rax, -0x118(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0x1b5d0
movq -0x118(%rbp), %rdi
movq (%rax), %rsi
addq $0x8, %rsi
callq 0x1b5a0
movq %rax, -0x110(%rbp)
jmp 0x1ae67
movq -0x110(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq -0x10(%rbp), %rdi
callq 0x1b480
movq %rax, -0xc0(%rbp)
leaq -0xb8(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x1b570
testb $0x1, %al
jne 0x1ae9e
jmp 0x1aee9
leaq -0xa8(%rbp), %rdi
callq 0x1b5d0
movq (%rax), %rdi
addq $0x8, %rdi
callq 0x4510
leaq -0xa8(%rbp), %rdi
callq 0x1b5d0
movq (%rax), %rax
xorps %xmm0, %xmm0
movsd %xmm0, 0x30(%rax)
jmp 0x1aee9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0x1b610
jmp 0x1af11
jmp 0x1aeeb
leaq -0xa8(%rbp), %rdi
callq 0x1b5f0
jmp 0x1ae05
leaq -0xa0(%rbp), %rdi
callq 0x1b610
addq $0x120, %rsp            # imm = 0x120
popq %rbp
retq
movq -0x58(%rbp), %rdi
callq 0x46e0
nopw (%rax,%rax)