// File: /workspace/github_cpp_makefile_star2_O1/aalto-speech[P]ftk/src/FactorGraph.cc
// Function: FactorGraph::create_nodes(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> 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>>> const&, unsigned int, std::vector<std::unordered_set<unsigned short, std::hash<unsigned short>, std::equal_to<unsigned short>, std::allocator<unsigned short>>, std::allocator<std::unordered_set<unsigned short, std::hash<unsigned short>, std::equal_to<unsigned short>, std::allocator<unsigned short>>>>&)
void
FactorGraph::create_nodes(const string &text,
                          const map<string, flt_type> &vocab,
                          unsigned int maxlen,
                          vector<unordered_set<fg_node_idx_t> > &incoming)
{
    nodes.push_back(Node(0,0));

    vector<unsigned int> char_positions;
    get_character_positions(text, char_positions, utf8);

    for (unsigned int i=0; i<char_positions.size()-1; i++) {

        unsigned int start_pos = char_positions[i];
        if (incoming[start_pos].size() == 0) continue;

        for (unsigned int j=i; j<char_positions.size()-1 && (j-i < maxlen); j++) {
            unsigned int end_pos = text.size();
            if (j < (char_positions.size()-1)) end_pos = char_positions[j+1];
            if (vocab.find(text.substr(start_pos, end_pos-start_pos)) != vocab.end()) {
                nodes.push_back(Node(start_pos, end_pos-start_pos));
                incoming[end_pos].insert(start_pos);
            }
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %r8, -0x58(%rbp)
movl %ecx, -0x30(%rbp)
movq %rdx, -0x60(%rbp)
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x40(%rdi), %rdi
leaq -0xc8(%rbp), %rsi
movw $0x0, (%rsi)
movb $0x0, 0x2(%rsi)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rsi)
movups %xmm0, 0x18(%rsi)
movups %xmm0, 0x28(%rsi)
movq %rdi, -0x70(%rbp)
callq 0x10650
leaq -0xc8(%rbp), %rdi
callq 0xff90
leaq -0x50(%rbp), %rsi
xorps %xmm0, %xmm0
movaps %xmm0, (%rsi)
movq $0x0, 0x10(%rsi)
movzbl 0x70(%rbx), %edx
movq %r14, %rdi
callq 0xe8f2
movq -0x50(%rbp), %rdi
movq -0x48(%rbp), %rax
subq %rdi, %rax
cmpq $0x4, %rax
je 0xe87a
movq %r14, -0x80(%rbp)
movq -0x60(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x78(%rbp)
xorl %esi, %esi
leaq -0xc8(%rbp), %r12
movl (%rdi,%rsi,4), %edi
movq -0x58(%rbp), %rax
movq (%rax), %rax
imulq $0x38, %rdi, %rcx
cmpq $0x0, 0x18(%rax,%rcx)
je 0xe85d
cmpl $0x0, -0x30(%rbp)
je 0xe85d
movq -0x50(%rbp), %rax
movq -0x48(%rbp), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
decq %rcx
movl %esi, %edx
cmpq %rdx, %rcx
jbe 0xe85d
movl $0x1, %r14d
movq %rsi, -0x88(%rbp)
movq %rdi, -0x68(%rbp)
leal (%rsi,%r14), %ecx
movq %rcx, -0x90(%rbp)
movl (%rax,%rcx,4), %ebx
movl %ebx, %r15d
subl %edi, %r15d
movq %rdi, %rdx
movq %r12, %rdi
movq -0x80(%rbp), %rsi
movq %r15, %rcx
callq 0x43b0
movq -0x60(%rbp), %rdi
movq %r12, %r13
movq %r12, %rsi
callq 0xd700
movq %rax, %r12
movq -0xc8(%rbp), %rdi
leaq -0xb8(%rbp), %rax
cmpq %rax, %rdi
je 0xe7bf
callq 0x4350
cmpq -0x78(%rbp), %r12
movq %r13, %r12
movq -0x68(%rbp), %rdi
je 0xe82e
movw %di, -0xc8(%rbp)
movb %r15b, -0xc6(%rbp)
leaq -0xb8(%rbp), %rax
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rax)
movups %xmm0, 0x8(%rax)
movups %xmm0, -0x8(%rax)
movq %rdi, %r15
movq -0x70(%rbp), %rdi
movq %r12, %rsi
callq 0x10650
movq %r12, %rdi
callq 0xff90
imulq $0x38, %rbx, %rdi
movq -0x58(%rbp), %rax
addq (%rax), %rdi
movw %r15w, -0x2a(%rbp)
movq %rdi, -0xc8(%rbp)
leaq -0x2a(%rbp), %rsi
movq %r12, %rdx
callq 0x10a40
movq -0x68(%rbp), %rdi
cmpl -0x30(%rbp), %r14d
movq -0x88(%rbp), %rsi
jae 0xe85d
movq -0x50(%rbp), %rax
movq -0x48(%rbp), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
decq %rcx
incl %r14d
cmpq -0x90(%rbp), %rcx
ja 0xe76f
incl %esi
movq -0x50(%rbp), %rdi
movq -0x48(%rbp), %rax
subq %rdi, %rax
sarq $0x2, %rax
decq %rax
cmpq %rsi, %rax
ja 0xe71d
testq %rdi, %rdi
je 0xe884
callq 0x4350
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xe8bc
movq %rax, %rbx
leaq -0xc8(%rbp), %rdi
callq 0xff90
jmp 0xe8ea
jmp 0xe8bc
movq %rax, %rbx
leaq -0xc8(%rbp), %rdi
callq 0xff90
jmp 0xe8dc
movq %rax, %rbx
jmp 0xe8dc
movq %rax, %rbx
movq -0xc8(%rbp), %rdi
leaq -0xb8(%rbp), %rax
cmpq %rax, %rdi
je 0xe8dc
callq 0x4350
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0xe8ea
callq 0x4350
movq %rbx, %rdi
callq 0x4650