// File: aalto-speech[P]ftk/src/Unigrams.cc
// Function: Unigrams::resegment_sents(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>>>> 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>>>&)
flt_type
Unigrams::resegment_sents(const vector<string> &sents,
                          const StringSet &vocab,
                          map<string, flt_type> &new_freqs)
{
    new_freqs.clear();
    flt_type ll = 0.0;

    for (auto sent = sents.begin(); sent != sents.end(); ++sent) {

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

        if (stats.size() == 0) {
            cerr << "warning, no segmentation for sentence: " << *sent << endl;
            continue;
        }

        ll += curr_ll;

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

    return ll;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xf0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x98(%rbp)
movq -0x20(%rbp), %rdi
callq 0x47d90
xorps %xmm0, %xmm0
movsd %xmm0, -0x28(%rbp)
movq -0x10(%rbp), %rdi
callq 0x2c300
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rdi
callq 0x2c330
movq %rax, -0x38(%rbp)
leaq -0x30(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x2c520
testb $0x1, %al
jne 0x56207
jmp 0x563ec
leaq -0x68(%rbp), %rdi
movq %rdi, -0xb0(%rbp)
callq 0x5fb0
movq -0x98(%rbp), %rax
movq (%rax), %rax
movq %rax, -0xa8(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0xb8(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x2c590
movq -0x98(%rbp), %rcx
movq -0xb8(%rbp), %rdi
movq -0xb0(%rbp), %rdx
movq %rax, %rsi
movq -0xa8(%rbp), %rax
movzbl 0x8(%rcx), %ecx
andl $0x1, %ecx
callq *%rax
movsd %xmm0, -0xa0(%rbp)
jmp 0x5626e
movsd -0xa0(%rbp), %xmm0
movsd %xmm0, -0x70(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x5fd0
cmpq $0x0, %rax
jne 0x56302
movq 0x3dd57(%rip), %rdi     # 0x93fe8
leaq 0x105cc(%rip), %rsi     # 0x66864
callq 0x43c0
movq %rax, -0xc0(%rbp)
jmp 0x562a6
leaq -0x30(%rbp), %rdi
callq 0x2c590
movq -0xc0(%rbp), %rdi
movq %rax, %rsi
callq 0x4380
movq %rax, -0xc8(%rbp)
jmp 0x562c7
movq -0xc8(%rbp), %rdi
movq 0x3dcc3(%rip), %rsi     # 0x93f98
callq 0x4400
jmp 0x562dc
movl $0x4, -0x80(%rbp)
jmp 0x563c8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x6090
jmp 0x563fa
movsd -0x70(%rbp), %xmm0
addsd -0x28(%rbp), %xmm0
movsd %xmm0, -0x28(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x58790
movq %rax, -0x88(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x48c90
movq %rax, -0x90(%rbp)
leaq -0x88(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x48c30
testb $0x1, %al
jne 0x5634a
jmp 0x563c1
leaq -0x88(%rbp), %rdi
movq %rdi, -0xe8(%rbp)
callq 0x587c0
movq -0xe8(%rbp), %rdi
movsd 0x20(%rax), %xmm0
movsd %xmm0, -0xe0(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0xd8(%rbp)
callq 0x587c0
movq -0xd8(%rbp), %rdi
movq %rax, %rsi
callq 0x47db0
movq %rax, -0xd0(%rbp)
jmp 0x56399
movq -0xd0(%rbp), %rax
movsd -0xe0(%rbp), %xmm0
addsd (%rax), %xmm0
movsd %xmm0, (%rax)
leaq -0x88(%rbp), %rdi
callq 0x4bba0
jmp 0x56321
movl $0x0, -0x80(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x6090
movl -0x80(%rbp), %eax
testl %eax, %eax
je 0x563dc
jmp 0x563da
jmp 0x563de
jmp 0x563de
leaq -0x30(%rbp), %rdi
callq 0x2c5b0
jmp 0x561e4
movsd -0x28(%rbp), %xmm0
addq $0xf0, %rsp
popq %rbp
retq
movq -0x78(%rbp), %rdi
callq 0x46e0
nopw %cs:(%rax,%rax)