// File: /workspace/github_cpp_makefile_star2_O2/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, %rbx
movl %ecx, 0xc(%rsp)
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
movq %rdx, %rdi
callq 0xd090
movaps 0x82f4(%rip), %xmm1     # 0x1b480
movaps %xmm0, 0x40(%rsp)
andps %xmm0, %xmm1
cvtss2sd %xmm1, %xmm0
movsd 0x8568(%rip), %xmm1     # 0x1b708
ucomisd %xmm0, %xmm1
jbe 0x131b3
movss 0x7fc2(%rip), %xmm0     # 0x1b170
movaps %xmm0, 0x40(%rsp)
movq %rbx, 0x38(%rsp)
andq $0x0, 0x20(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq (%r12), %rax
movslq 0x94(%rax), %rsi
leaq 0x50(%rsp), %rdi
callq 0xd03c
leaq 0x68(%rsp), %r13
xorl %ebx, %ebx
leaq 0x88(%rsp), %rbp
movq 0x10(%r12), %rdi
callq 0x5e34
cltq
cmpq %rax, %rbx
jge 0x13253
movq 0x10(%r12), %rsi
movq %rbp, %rdi
movl %ebx, %edx
callq 0x63b2
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0xbf6c
divss 0x40(%rsp), %xmm0
movss %xmm0, 0x60(%rsp)
movq %r13, %rdi
movq %rbp, %rsi
callq 0x4460
leaq 0x10(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0x15d4c
movq %r13, %rdi
callq 0x46c8
movq %rbp, %rdi
callq 0x46c8
incq %rbx
jmp 0x131ea
movq 0x38(%rsp), %r13
leaq 0x8(%r13), %rbx
xorl %ebp, %ebp
movq 0x14d5b(%rip), %r14     # 0x27fc0
leaq 0x78fd(%rip), %r15      # 0x1ab69
leaq 0x10(%rsp), %r12
cmpl 0xc(%rsp), %ebp
jge 0x132d5
movq 0x10(%rsp), %rsi
cmpq %rsi, 0x18(%rsp)
je 0x132d5
addq $0x8, %rsi
movq %r13, %rdi
callq 0x17714
cmpq %rbx, %rax
jne 0x132cb
movq 0x10(%rsp), %rsi
addq $0x8, %rsi
movq %r14, %rdi
callq 0x42f0
movq %rax, %rdi
movq %r15, %rsi
callq 0x4330
movq 0x10(%rsp), %rcx
movss (%rcx), %xmm0
movq %rax, %rdi
callq 0x4270
movq %rax, %rdi
callq 0x4190
incl %ebp
movq %r12, %rdi
callq 0x15d62
jmp 0x13271
leaq 0x50(%rsp), %rdi
callq 0xd066
leaq 0x10(%rsp), %rdi
callq 0x15d0c
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x13332
movq %rax, %rbx
movq %r13, %rdi
callq 0x46c8
jmp 0x13314
jmp 0x13311
jmp 0x13325
movq %rax, %rbx
leaq 0x88(%rsp), %rdi
callq 0x46c8
jmp 0x13328
jmp 0x13325
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0xd066
leaq 0x10(%rsp), %rdi
callq 0x15d0c
movq %rbx, %rdi
callq 0x45d0