// File: /workspace/github_cpp_makefile_star2_O3/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 0xf200
movaps 0x8908(%rip), %xmm1     # 0x1f4a0
movaps %xmm0, 0x80(%rsp)
andps %xmm0, %xmm1
xorps %xmm0, %xmm0
cvtss2sd %xmm1, %xmm0
movsd 0x8b5e(%rip), %xmm1     # 0x1f710
ucomisd %xmm0, %xmm1
jbe 0x16bc8
movss 0x85c8(%rip), %xmm0     # 0x1f188
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 0xf1ac
leaq 0x70(%rsp), %r13
xorl %ebx, %ebx
leaq 0x58(%rsp), %rbp
movq 0x10(%r12), %rdi
callq 0x6554
cltq
cmpq %rax, %rbx
jge 0x16cb3
movq 0x10(%r12), %rsi
leaq 0x38(%rsp), %rdi
movl %ebx, %edx
callq 0x6d5e
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0xe10c
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 0xa910
leaq 0x10(%rsp), %rdi
movq %rbp, %rsi
callq 0x1afc8
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
callq 0x1b487
movq 0x60(%rsp), %rdi
cmpq %r13, %rdi
je 0x16c8f
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x4300
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x16cab
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x4300
incq %rbx
jmp 0x16bfd
movq 0x30(%rsp), %rax
leaq 0x8(%rax), %r13
xorl %ebp, %ebp
movq 0x132fb(%rip), %r14     # 0x29fc0
leaq 0x7e96(%rip), %r15      # 0x1eb62
leaq 0x10(%rsp), %r12
cmpl 0xc(%rsp), %ebp
jge 0x16d73
movq 0x10(%rsp), %rsi
cmpq %rsi, 0x18(%rsp)
je 0x16d73
addq $0x8, %rsi
movq 0x30(%rsp), %rdi
callq 0x1b6a8
cmpq %r13, %rax
jne 0x16d66
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 0x1a19e
jmp 0x16cd1
leaq 0x98(%rsp), %rdi
callq 0xf1d6
leaq 0x10(%rsp), %rdi
callq 0x1a140
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x16df4
jmp 0x16da3
movq %rax, %rbx
jmp 0x16dc6
jmp 0x16de4
jmp 0x16de4
movq %rax, %rbx
movq 0x60(%rsp), %rdi
cmpq %r13, %rdi
je 0x16dc6
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x4300
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x16de7
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x4300
jmp 0x16de7
movq %rax, %rbx
leaq 0x98(%rsp), %rdi
callq 0xf1d6
leaq 0x10(%rsp), %rdi
callq 0x1a140
movq %rbx, %rdi
callq 0x45b0