// File: /workspace/github_cpp_makefile_star2_O2/epfml[P]Bi-Sent2Vec/src/dictionary.cc
// Function: fasttext::Dictionary::addNgrams(std::vector<int, std::allocator<int>>&, int, int, std::linear_congruential_engine<unsigned long, 48271ul, 0ul, 2147483647ul>&) const
void Dictionary::addNgrams(std::vector<int32_t>& line, int32_t n, int32_t k, std::minstd_rand& rng) const {
  int32_t num_discarded = 0;
  int32_t line_size = line.size();
  std::vector<bool> discard;
  discard.resize(line_size, false);
  std::uniform_int_distribution<> uniform(0, line_size - 1);
  while (num_discarded < k && line_size - num_discarded > 2) {
    int32_t token_to_discard = uniform(rng);
    if (!discard[token_to_discard]) {
      discard[token_to_discard] = true;
      num_discarded++;
    }
  }
  for (int32_t i = 0; i < line_size; i++) {
    if (discard[i]) continue;
    uint64_t h = line[i];
    for (int32_t j = i + 1; j < line_size && j < i + n; j++) {
      if (discard[j]) break;
      h = h * 116049371 + line[j];
      line.push_back(nwords_ + (h % args_->bucket));
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %r8, %r12
movl %ecx, (%rsp)
movq %rsi, %rbx
movq 0x8(%rsi), %r13
subq (%rsi), %r13
leaq 0x30(%rsp), %rax
andq $0x0, (%rax)
movq %rdx, 0x20(%rsp)
andl $0x0, 0x8(%rax)
movq %rdi, %r15
andq $0x0, 0x10(%rax)
shrq $0x2, %r13
andl $0x0, 0x18(%rax)
andq $0x0, 0x20(%rax)
movslq %r13d, %rsi
movq %rax, %rdi
xorl %edx, %edx
callq 0x88be
leaq 0x28(%rsp), %rcx
andl $0x0, (%rcx)
leal -0x1(%r13), %eax
movl %eax, 0x4(%rcx)
leaq 0x30(%rsp), %r14
xorl %eax, %eax
movq %r13, 0x8(%rsp)
cmpl (%rsp), %eax
movl %eax, %edx
setl %al
movl %r13d, %ecx
movl %edx, 0x10(%rsp)
subl %edx, %ecx
cmpl $0x3, %ecx
setge %r13b
andb %al, %r13b
testb %r13b, %r13b
je 0x7272
leaq 0x28(%rsp), %rdi
movq %r12, %rsi
callq 0x892c
movslq %eax, %rbp
movq %r14, %rdi
movq %rbp, %rsi
callq 0x8934
testq %rdx, (%rax)
jne 0x7232
movq %r14, %rdi
movq %rbp, %rsi
callq 0x8934
orq %rdx, (%rax)
movl 0x10(%rsp), %eax
incl %eax
movq 0x8(%rsp), %r13
jmp 0x7217
xorl %r12d, %r12d
movq 0x8(%rsp), %rax
testl %eax, %eax
movl $0x0, %ecx
cmovgl %eax, %ecx
movq %rcx, 0x10(%rsp)
pushq $0x1
popq %rax
movq %rax, (%rsp)
cmpq 0x10(%rsp), %r12
je 0x732a
leaq 0x30(%rsp), %rdi
movq %r12, %rsi
callq 0x8934
testq %rdx, (%rax)
je 0x72b6
incq %r12
incq (%rsp)
jmp 0x7290
movq (%rbx), %rax
movslq (%rax,%r12,4), %r14
movq 0x20(%rsp), %rax
leal (%r12,%rax), %r13d
movq 0x8(%rsp), %rax
cmpl %r13d, %eax
cmovll %eax, %r13d
movq (%rsp), %rbp
cmpl %ebp, %r13d
jle 0x72ad
leaq 0x30(%rsp), %rdi
movq %rbp, %rsi
callq 0x8934
testq %rdx, (%rax)
jne 0x72ad
imulq $0x6eac5db, %r14, %rax  # imm = 0x6EAC5DB
movq (%rbx), %rcx
movslq (%rcx,%rbp,4), %r14
addq %rax, %r14
movq (%r15), %rax
movslq 0xc4(%rax), %rcx
movq %r14, %rax
xorl %edx, %edx
divq %rcx
addl 0x5c(%r15), %edx
movl %edx, 0x1c(%rsp)
movq %rbx, %rdi
leaq 0x1c(%rsp), %rsi
callq 0x9292
incq %rbp
jmp 0x72d6
leaq 0x30(%rsp), %rdi
callq 0x896e
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x734f
jmp 0x734f
jmp 0x734f
jmp 0x734f
jmp 0x734f
jmp 0x734f
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x896e
movq %rbx, %rdi
callq 0x45d0