// File: /workspace/github_cpp_makefile_star2_O1/epfml[P]Bi-Sent2Vec/src/fasttext.cc
// Function: fasttext::FastText::findNN(fasttext::Matrix const&, fasttext::Vector const&, 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&)
void FastText::findNN(const Matrix& wordVectors, const Vector& queryVec,
                      int32_t k, const std::set<std::string>& banSet) {
  real queryNorm = queryVec.norm();
  if (std::abs(queryNorm) < 1e-8) {
    queryNorm = 1;
  }
  std::priority_queue<std::pair<real, std::string>> heap;
  Vector vec(args_->dim);
  for (int32_t i = 0; i < dict_->nwords(); i++) {
    std::string word = dict_->getWord(i);
    real dp = wordVectors.dotRow(queryVec, i);
    heap.push(std::make_pair(dp / queryNorm, word));
  }
  int32_t i = 0;
  while (i < k && heap.size() > 0) {
    auto it = banSet.find(heap.top().second);
    if (it == banSet.end()) {
      std::cout << heap.top().second << " " << heap.top().first << std::endl;
      i++;
    }
    heap.pop();
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %r8, 0x30(%rsp)
movl %ecx, 0xc(%rsp)
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
movq %rdx, %rdi
callq 0xefe4
movaps 0x89ec(%rip), %xmm1     # 0x1f490
movaps %xmm0, 0x80(%rsp)
andps %xmm0, %xmm1
xorps %xmm0, %xmm0
cvtss2sd %xmm1, %xmm0
movsd 0x8c42(%rip), %xmm1     # 0x1f700
ucomisd %xmm0, %xmm1
jbe 0x16ad4
movss 0x86a4(%rip), %xmm0     # 0x1f170
movaps %xmm0, 0x80(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
movq (%r12), %rax
movslq 0x94(%rax), %rsi
leaq 0x98(%rsp), %rdi
callq 0xef90
leaq 0x70(%rsp), %r13
xorl %ebx, %ebx
leaq 0x58(%rsp), %rbp
movq 0x10(%r12), %rdi
callq 0x6550
cltq
cmpq %rax, %rbx
jge 0x16bbf
movq 0x10(%r12), %rsi
leaq 0x38(%rsp), %rdi
movl %ebx, %edx
callq 0x6d2a
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0xde92
divss 0x80(%rsp), %xmm0
movss %xmm0, 0x58(%rsp)
movq %r13, 0x60(%rsp)
movq 0x38(%rsp), %rsi
movq 0x40(%rsp), %rdx
addq %rsi, %rdx
leaq 0x60(%rsp), %rdi
callq 0xa8dc
leaq 0x10(%rsp), %rdi
movq %rbp, %rsi
callq 0x1af6c
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
callq 0x1b429
movq 0x60(%rsp), %rdi
cmpq %r13, %rdi
je 0x16b9b
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x4300
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x16bb7
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x4300
incq %rbx
jmp 0x16b09
movq 0x30(%rsp), %rax
leaq 0x8(%rax), %r13
xorl %ebp, %ebp
movq 0x133ef(%rip), %r14     # 0x29fc0
leaq 0x7f8a(%rip), %r15      # 0x1eb62
leaq 0x10(%rsp), %r12
cmpl 0xc(%rsp), %ebp
jge 0x16c7f
movq 0x10(%rsp), %rsi
cmpq %rsi, 0x18(%rsp)
je 0x16c7f
addq $0x8, %rsi
movq 0x30(%rsp), %rdi
callq 0x1b656
cmpq %r13, %rax
jne 0x16c72
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rsi
movq 0x10(%rax), %rdx
movq %r14, %rdi
callq 0x4350
movq %rax, %rbx
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x4350
movq 0x10(%rsp), %rax
xorps %xmm0, %xmm0
cvtss2sd (%rax), %xmm0
movq %rbx, %rdi
callq 0x44e0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x42d0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x4040
movq %rax, %rdi
callq 0x4200
incl %ebp
movq %r12, %rdi
callq 0x1a0f6
jmp 0x16bdd
leaq 0x98(%rsp), %rdi
callq 0xefba
leaq 0x10(%rsp), %rdi
callq 0x1a09a
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x16d00
jmp 0x16caf
movq %rax, %rbx
jmp 0x16cd2
jmp 0x16cf0
jmp 0x16cf0
movq %rax, %rbx
movq 0x60(%rsp), %rdi
cmpq %r13, %rdi
je 0x16cd2
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x4300
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x16cf3
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x4300
jmp 0x16cf3
movq %rax, %rbx
leaq 0x98(%rsp), %rdi
callq 0xefba
leaq 0x10(%rsp), %rdi
callq 0x1a09a
movq %rbx, %rdi
callq 0x45b0