// File: epfml[P]Bi-Sent2Vec/src/dictionary.cc
// Function: fasttext::Dictionary::computeNgrams(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::vector<int, std::allocator<int>>&) const
void Dictionary::computeNgrams(const std::string& word,
                               std::vector<int32_t>& ngrams) const {
  for (size_t i = 0; i < word.size(); i++) {
    std::string ngram;
    if ((word[i] & 0xC0) == 0x80) continue;
    for (size_t j = i, n = 1; j < word.size() && n <= args_->maxn; n++) {
      ngram.push_back(word[j++]);
      while (j < word.size() && (word[j] & 0xC0) == 0x80) {
        ngram.push_back(word[j++]);
      }
      if (n >= args_->minn && !(n == 1 && (i == 0 || j == word.size()))) {
        int32_t h = hash(ngram) % args_->bucket;
        ngrams.push_back(nwords_ + h);
      }
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x78(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x10(%rbp), %rdi
callq 0x5300
movq %rax, %rcx
movq -0x80(%rbp), %rax
cmpq %rcx, %rax
jae 0x885b
leaq -0x40(%rbp), %rdi
callq 0x5600
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x54a0
movsbl (%rax), %eax
andl $0xc0, %eax
cmpl $0x80, %eax
jne 0x8629
movl $0x4, -0x44(%rbp)
jmp 0x8834
movq -0x20(%rbp), %rax
movq %rax, -0x50(%rbp)
movq $0x1, -0x58(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x10(%rbp), %rdi
callq 0x5300
movq -0x90(%rbp), %rcx
movq %rax, %rdx
xorl %eax, %eax
cmpq %rdx, %rcx
movb %al, -0x81(%rbp)
jae 0x8695
movq -0x78(%rbp), %rdi
movq -0x58(%rbp), %rax
movq %rax, -0x98(%rbp)
callq 0xe6e0
movq %rax, %rcx
movq -0x98(%rbp), %rax
movslq 0xd0(%rcx), %rcx
cmpq %rcx, %rax
setbe %al
movb %al, -0x81(%rbp)
movb -0x81(%rbp), %al
testb $0x1, %al
jne 0x86a4
jmp 0x882d
movq -0x10(%rbp), %rdi
movq -0x50(%rbp), %rsi
movq %rsi, %rax
incq %rax
movq %rax, -0x50(%rbp)
callq 0x54a0
movsbl (%rax), %esi
leaq -0x40(%rbp), %rdi
callq 0x53c0
jmp 0x86c9
jmp 0x86cb
movq -0x50(%rbp), %rax
movq %rax, -0xa8(%rbp)
movq -0x10(%rbp), %rdi
callq 0x5300
movq -0xa8(%rbp), %rcx
movq %rax, %rdx
xorl %eax, %eax
cmpq %rdx, %rcx
movb %al, -0x99(%rbp)
jae 0x8719
movq -0x10(%rbp), %rdi
movq -0x50(%rbp), %rsi
callq 0x54a0
movsbl (%rax), %eax
andl $0xc0, %eax
cmpl $0x80, %eax
sete %al
movb %al, -0x99(%rbp)
movb -0x99(%rbp), %al
testb $0x1, %al
jne 0x8725
jmp 0x8769
movq -0x10(%rbp), %rdi
movq -0x50(%rbp), %rsi
movq %rsi, %rax
incq %rax
movq %rax, -0x50(%rbp)
callq 0x54a0
movsbl (%rax), %esi
leaq -0x40(%rbp), %rdi
callq 0x53c0
jmp 0x874a
jmp 0x86cb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x58d8
jmp 0x8864
movq -0x78(%rbp), %rdi
movq -0x58(%rbp), %rax
movq %rax, -0xb0(%rbp)
callq 0xe6e0
movq %rax, %rcx
movq -0xb0(%rbp), %rax
movslq 0xcc(%rcx), %rcx
cmpq %rcx, %rax
jb 0x881a
cmpq $0x1, -0x58(%rbp)
jne 0x87c8
cmpq $0x0, -0x20(%rbp)
je 0x881a
movq -0x50(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq -0x10(%rbp), %rdi
callq 0x5300
movq %rax, %rcx
movq -0xb8(%rbp), %rax
cmpq %rcx, %rax
je 0x881a
movq -0x78(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x8120
movq -0x78(%rbp), %rdi
movl %eax, -0xbc(%rbp)
callq 0xe6e0
movq %rax, %rcx
movl -0xbc(%rbp), %eax
movl 0xc4(%rcx), %ecx
xorl %edx, %edx
divl %ecx
movq -0x78(%rbp), %rax
movl %edx, -0x68(%rbp)
movq -0x18(%rbp), %rdi
movl 0x5c(%rax), %eax
movl -0x68(%rbp), %ecx
addl %ecx, %eax
movl %eax, -0x6c(%rbp)
leaq -0x6c(%rbp), %rsi
callq 0xe6b0
jmp 0x8818
jmp 0x881a
jmp 0x881c
movq -0x58(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x58(%rbp)
jmp 0x8639
movl $0x0, -0x44(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x58d8
movl -0x44(%rbp), %eax
testl %eax, %eax
je 0x8848
jmp 0x8846
jmp 0x884a
jmp 0x884a
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x85d7
addq $0xc0, %rsp
popq %rbp
retq
movq -0x60(%rbp), %rdi
callq 0x57a0
nopl (%rax)