// File: /workspace/github_cpp_makefile_star2_O3/aalto-speech[P]ftk/src/Unigrams.cc
// Function: Unigrams::resegment_words(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&, StringSet const&, 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>>>&, std::set<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::less<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>>>>)
flt_type
Unigrams::resegment_words(const map<string, flt_type> &words,
                          const StringSet &vocab,
                          map<string, flt_type> &new_freqs,
                          set<string> special_words)
{
    new_freqs.clear();
    flt_type ll = 0.0;

    for (auto worditer = words.cbegin(); worditer != words.cend(); ++worditer) {

        // Special symbols like 
 
 etc. which should not be segmented
        if (special_words.size() > 0 && special_words.find(worditer->first) != special_words.end()) {
            new_freqs[worditer->first] += worditer->second;
            continue;
        }

        map<string, flt_type> stats;
        flt_type curr_ll = worditer->second * segf(vocab, worditer->first, stats, this->utf8);

        if (stats.size() == 0) {
            cerr << "warning, no segmentation for word: " << worditer->first << endl;
            continue;
        }

        ll += curr_ll;

        // Update statistics
        for (auto it = stats.begin(); it != stats.end(); ++it)
            new_freqs[it->first] += worditer->second * it->second;
    }

    return ll;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %r8, %rbx
movq %rcx, %r14
movq %rdx, -0x50(%rbp)
movq %rsi, %r12
movq %rdi, -0x48(%rbp)
movq %rcx, %rdi
callq 0x1bf52
movq 0x18(%r12), %r15
addq $0x8, %r12
movq %r12, -0x58(%rbp)
cmpq %r12, %r15
je 0x1e400
leaq 0x8(%rbx), %rax
movq %rax, -0x40(%rbp)
xorpd %xmm0, %xmm0
movsd %xmm0, -0x38(%rbp)
leaq -0x88(%rbp), %r13
cmpq $0x0, 0x28(%rbx)
je 0x1e2d4
leaq 0x20(%r15), %r12
movq %rbx, %rdi
movq %r12, %rsi
callq 0x2125c
cmpq -0x40(%rbp), %rax
je 0x1e2d4
movsd 0x40(%r15), %xmm0
movsd %xmm0, -0x30(%rbp)
movq %r14, %rdi
movq %r12, %rsi
callq 0x1af86
movsd -0x30(%rbp), %xmm0
addsd (%rax), %xmm0
movsd %xmm0, (%rax)
jmp 0x1e3e9
movl $0x0, -0x88(%rbp)
xorl %eax, %eax
movq %rax, -0x80(%rbp)
movq %r13, -0x78(%rbp)
movq %r13, -0x70(%rbp)
movq %rax, -0x68(%rbp)
leaq 0x20(%r15), %rsi
movsd 0x40(%r15), %xmm0
movsd %xmm0, -0x30(%rbp)
movq -0x48(%rbp), %rax
movzbl 0x8(%rax), %ecx
movq -0x50(%rbp), %rdi
leaq -0x90(%rbp), %rdx
callq *(%rax)
cmpq $0x0, -0x68(%rbp)
je 0x1e387
movsd -0x30(%rbp), %xmm1
mulsd %xmm0, %xmm1
movsd -0x38(%rbp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x38(%rbp)
movq -0x78(%rbp), %r12
cmpq %r13, %r12
je 0x1e3dd
movsd 0x40(%r15), %xmm0
movsd %xmm0, -0x30(%rbp)
leaq 0x20(%r12), %rsi
movsd 0x40(%r12), %xmm0
movsd %xmm0, -0x60(%rbp)
movq %r14, %rdi
callq 0x1af86
movsd -0x30(%rbp), %xmm0
mulsd -0x60(%rbp), %xmm0
addsd (%rax), %xmm0
movsd %xmm0, (%rax)
movq %r12, %rdi
callq 0x4280
movq %rax, %r12
cmpq %r13, %rax
jne 0x1e33f
jmp 0x1e3dd
movl $0x23, %edx
movq 0x15c55(%rip), %rdi     # 0x33fe8
leaq 0x8536(%rip), %rsi      # 0x268d0
callq 0x4400
movq 0x20(%r15), %rsi
movq 0x28(%r15), %rdx
movq 0x15c3a(%rip), %rdi     # 0x33fe8
callq 0x4400
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x4370
movsbl %al, %esi
movq %r12, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x4260
leaq -0x90(%rbp), %rdi
callq 0x5ce4
movq %r15, %rdi
callq 0x4410
movq %rax, %r15
cmpq -0x58(%rbp), %rax
jne 0x1e290
jmp 0x1e409
xorpd %xmm0, %xmm0
movsd %xmm0, -0x38(%rbp)
movsd -0x38(%rbp), %xmm0
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1e41f
movq %rax, %rbx
leaq -0x90(%rbp), %rdi
callq 0x5ce4
movq %rbx, %rdi
callq 0x4650