// File: epfml[P]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()))) {
        if (args_->model == model_name::cbowCWNgrams) {
          int32_t h = hash(ngram) % args_->bucketChar;
          ngrams.push_back(nwords_ + args_->bucket + h);
        } else {
          int32_t h = hash(ngram) % args_->bucket;
          ngrams.push_back(nwords_ + h);
        }
      }
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x80(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x10(%rbp), %rdi
callq 0x5300
movq %rax, %rcx
movq -0x88(%rbp), %rax
cmpq %rcx, %rax
jae 0x8af9
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 0x882f
movl $0x4, -0x44(%rbp)
jmp 0x8ad2
movq -0x20(%rbp), %rax
movq %rax, -0x50(%rbp)
movq $0x1, -0x58(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x98(%rbp)
movq -0x10(%rbp), %rdi
callq 0x5300
movq -0x98(%rbp), %rcx
movq %rax, %rdx
xorl %eax, %eax
cmpq %rdx, %rcx
movb %al, -0x89(%rbp)
jae 0x889b
movq -0x80(%rbp), %rdi
movq -0x58(%rbp), %rax
movq %rax, -0xa0(%rbp)
callq 0xea70
movq %rax, %rcx
movq -0xa0(%rbp), %rax
movslq 0xd0(%rcx), %rcx
cmpq %rcx, %rax
setbe %al
movb %al, -0x89(%rbp)
movb -0x89(%rbp), %al
testb $0x1, %al
jne 0x88aa
jmp 0x8acb
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 0x88cf
jmp 0x88d1
movq -0x50(%rbp), %rax
movq %rax, -0xb0(%rbp)
movq -0x10(%rbp), %rdi
callq 0x5300
movq -0xb0(%rbp), %rcx
movq %rax, %rdx
xorl %eax, %eax
cmpq %rdx, %rcx
movb %al, -0xa1(%rbp)
jae 0x891f
movq -0x10(%rbp), %rdi
movq -0x50(%rbp), %rsi
callq 0x54a0
movsbl (%rax), %eax
andl $0xc0, %eax
cmpl $0x80, %eax
sete %al
movb %al, -0xa1(%rbp)
movb -0xa1(%rbp), %al
testb $0x1, %al
jne 0x892b
jmp 0x896f
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 0x8950
jmp 0x88d1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x58d8
jmp 0x8b02
movq -0x80(%rbp), %rdi
movq -0x58(%rbp), %rax
movq %rax, -0xb8(%rbp)
callq 0xea70
movq %rax, %rcx
movq -0xb8(%rbp), %rax
movslq 0xcc(%rcx), %rcx
cmpq %rcx, %rax
jb 0x8ab8
cmpq $0x1, -0x58(%rbp)
jne 0x89d6
cmpq $0x0, -0x20(%rbp)
je 0x8ab8
movq -0x50(%rbp), %rax
movq %rax, -0xc0(%rbp)
movq -0x10(%rbp), %rdi
callq 0x5300
movq %rax, %rcx
movq -0xc0(%rbp), %rax
cmpq %rcx, %rax
je 0x8ab8
movq -0x80(%rbp), %rdi
callq 0xea70
cmpl $0x5, 0xc0(%rax)
jne 0x8a64
movq -0x80(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x8320
movq -0x80(%rbp), %rdi
movl %eax, -0xd4(%rbp)
callq 0xea70
movq -0x80(%rbp), %rdi
movq %rax, %rcx
movl -0xd4(%rbp), %eax
movl 0xc8(%rcx), %ecx
xorl %edx, %edx
divl %ecx
movl %edx, -0x68(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0xd0(%rbp)
movl 0x5c(%rdi), %eax
movl %eax, -0xc4(%rbp)
callq 0xea70
movq -0xd0(%rbp), %rdi
movq %rax, %rcx
movl -0xc4(%rbp), %eax
movl 0xc4(%rcx), %ecx
addl %ecx, %eax
movl -0x68(%rbp), %ecx
addl %ecx, %eax
movl %eax, -0x6c(%rbp)
leaq -0x6c(%rbp), %rsi
callq 0xea40
jmp 0x8a62
jmp 0x8ab6
movq -0x80(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x8320
movq -0x80(%rbp), %rdi
movl %eax, -0xd8(%rbp)
callq 0xea70
movq %rax, %rcx
movl -0xd8(%rbp), %eax
movl 0xc4(%rcx), %ecx
xorl %edx, %edx
divl %ecx
movq -0x80(%rbp), %rax
movl %edx, -0x70(%rbp)
movq -0x18(%rbp), %rdi
movl 0x5c(%rax), %eax
movl -0x70(%rbp), %ecx
addl %ecx, %eax
movl %eax, -0x74(%rbp)
leaq -0x74(%rbp), %rsi
callq 0xea40
jmp 0x8ab4
jmp 0x8ab6
jmp 0x8ab8
jmp 0x8aba
movq -0x58(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x58(%rbp)
jmp 0x883f
movl $0x0, -0x44(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x58d8
movl -0x44(%rbp), %eax
testl %eax, %eax
je 0x8ae6
jmp 0x8ae4
jmp 0x8ae8
jmp 0x8ae8
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x87d7
addq $0xe0, %rsp
popq %rbp
retq
movq -0x60(%rbp), %rdi
callq 0x57a0
nopl (%rax,%rax)