// File: /workspace/github_cpp_makefile_star2_O1/aalto-speech[P]ftk/src/Unigrams.cc
// Function: Unigrams::init_candidates(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&, 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>>>>&, unsigned int, 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>>>> const&, unsigned int)
int
Unigrams::init_candidates(const map<string, flt_type> &vocab,
                          set<string> &candidates,
                          unsigned int n_candidates,
                          const set<string> &stoplist,
                          unsigned int min_length)
{

    vector<pair<string, flt_type> > sorted_vocab;
    sort_vocab(vocab, sorted_vocab, false);

    int selected_candidates = 0;
    for (auto it = sorted_vocab.cbegin(); it != sorted_vocab.cend(); ++it) {
        const string &subword = it->first;
        if (get_factor_length(subword, this->utf8) < min_length) continue;
        if (candidates.find(subword) != candidates.end()) continue;
        if (stoplist.find(subword) != stoplist.end()) continue;
        candidates.insert(subword);
        selected_candidates++;
        if (candidates.size() >= n_candidates) break;
    }

    return selected_candidates;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %r9d, %ebx
movq %r8, -0x38(%rbp)
movl %ecx, %r13d
movq %rdx, %r15
movq %rsi, %rax
movq %rdi, %r12
xorps %xmm0, %xmm0
leaq -0x50(%rbp), %rsi
movaps %xmm0, (%rsi)
movq $0x0, 0x10(%rsi)
movl $0x0, -0x2c(%rbp)
movq %rax, %rdi
xorl %edx, %edx
callq 0x1dd68
movq -0x50(%rbp), %r14
cmpq -0x48(%rbp), %r14
je 0x1ea7e
leaq 0x8(%r15), %rax
movq %rax, -0x68(%rbp)
movq -0x38(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x60(%rbp)
movl %r13d, %eax
movq %rax, -0x58(%rbp)
movl $0x0, -0x2c(%rbp)
movq 0x8(%r14), %rax
cmpb $0x1, 0x8(%r12)
jne 0x1ea17
testq %rax, %rax
je 0x1ea1b
movq (%r14), %rdx
xorl %esi, %esi
xorl %ecx, %ecx
movb (%rdx,%rsi), %r8b
movl $0x1, %edi
testb %r8b, %r8b
jns 0x1ea0c
movl $0x4, %edi
cmpb $-0x11, %r8b
ja 0x1ea0c
cmpb $-0x20, %r8b
movl $0x2, %edi
sbbl $-0x1, %edi
addl %edi, %esi
incl %ecx
cmpq %rsi, %rax
ja 0x1e9e7
jmp 0x1ea1d
movl %eax, %ecx
jmp 0x1ea1d
xorl %ecx, %ecx
movl $0x4, %r13d
cmpl %ebx, %ecx
jb 0x1ea6a
movq %r15, %rdi
movq %r14, %rsi
callq 0x21436
cmpq -0x68(%rbp), %rax
jne 0x1ea6a
movq -0x38(%rbp), %rdi
movq %r14, %rsi
callq 0x10d38
cmpq -0x60(%rbp), %rax
jne 0x1ea6a
movq %r15, %rdi
movq %r14, %rsi
callq 0x14092
incl -0x2c(%rbp)
xorl %r13d, %r13d
movq -0x58(%rbp), %rax
cmpq %rax, 0x28(%r15)
setae %r13b
addl %r13d, %r13d
testb $0x3, %r13b
jne 0x1ea7e
addq $0x28, %r14
cmpq -0x48(%rbp), %r14
jne 0x1e9cf
leaq -0x50(%rbp), %rdi
callq 0x1fd8a
movl -0x2c(%rbp), %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1ea9f
jmp 0x1ea9f
jmp 0x1ea9f
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x1fd8a
movq %rbx, %rdi
callq 0x4650
nop