// File: /workspace/github_cpp_makefile_star2_O3/epfml[P]Bi-Sent2Vec/src/fasttext.cc
// Function: fasttext::FastText::selectEmbeddings(int) const
std::vector<int32_t> FastText::selectEmbeddings(int32_t cutoff) const {
  Vector norms(input_->m_);
  input_->l2NormRow(norms);
  std::vector<int32_t> idx(input_->m_, 0);
  std::iota(idx.begin(), idx.end(), 0);
  auto eosid = dict_->getId(Dictionary::EOS);
  std::sort(idx.begin(), idx.end(),
      [&norms, eosid] (size_t i1, size_t i2) {
      return eosid ==i1 || (eosid != i2 && norms[i1] > norms[i2]);
      });
  idx.erase(idx.begin() + cutoff, idx.end());
  return idx;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movq 0x20(%rsi), %rax
movq 0x8(%rax), %rsi
leaq 0x10(%rsp), %r15
movq %r15, %rdi
callq 0xf1ac
movq 0x20(%r14), %rdi
movq %r15, %rsi
callq 0xe472
movq 0x20(%r14), %rax
movq 0x8(%rax), %rsi
leaq 0x24(%rsp), %rdx
movl $0x0, (%rdx)
leaq 0xf(%rsp), %rcx
movq %rbx, %rdi
callq 0xdafc
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
cmpq %rcx, %rax
je 0x13ec4
subq %rax, %rcx
addq $-0x4, %rcx
movq %rcx, %xmm0
shrq $0x2, %rcx
addq $0x4, %rcx
andq $-0x4, %rcx
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
psrlq $0x2, %xmm0
xorl %edx, %edx
movdqa 0xaecb(%rip), %xmm1     # 0x1ecc0
movdqa 0xaed3(%rip), %xmm2     # 0x1ecd0
movdqa 0xaedb(%rip), %xmm3     # 0x1ece0
pxor %xmm3, %xmm0
pcmpeqd %xmm4, %xmm4
movq %rdx, %xmm5
pshufd $0x44, %xmm5, %xmm5     # xmm5 = xmm5[0,1,0,1]
movdqa %xmm5, %xmm6
por %xmm2, %xmm6
pxor %xmm3, %xmm6
movdqa %xmm6, %xmm7
pcmpgtd %xmm0, %xmm7
pcmpeqd %xmm0, %xmm6
pshufd $0xf5, %xmm6, %xmm8     # xmm8 = xmm6[1,1,3,3]
pand %xmm7, %xmm8
pshufd $0xf5, %xmm7, %xmm6     # xmm6 = xmm7[1,1,3,3]
por %xmm8, %xmm6
movd %xmm6, %esi
notl %esi
testb $0x1, %sil
je 0x13e53
movl %edx, (%rax,%rdx,4)
pxor %xmm4, %xmm6
pextrw $0x4, %xmm6, %esi
testb $0x1, %sil
je 0x13e69
leal 0x1(%rdx), %esi
movl %esi, 0x4(%rax,%rdx,4)
por %xmm1, %xmm5
pxor %xmm3, %xmm5
movdqa %xmm5, %xmm6
pcmpgtd %xmm0, %xmm6
pcmpeqd %xmm0, %xmm5
pshufd $0xf5, %xmm5, %xmm7     # xmm7 = xmm5[1,1,3,3]
pand %xmm6, %xmm7
pshufd $0xf5, %xmm6, %xmm5     # xmm5 = xmm6[1,1,3,3]
por %xmm7, %xmm5
pxor %xmm4, %xmm5
pextrw $0x0, %xmm5, %esi
testb $0x1, %sil
je 0x13ea5
leal 0x2(%rdx), %esi
movl %esi, 0x8(%rax,%rdx,4)
pextrw $0x4, %xmm5, %esi
testb $0x1, %sil
je 0x13eb7
leal 0x3(%rdx), %esi
movl %esi, 0xc(%rax,%rdx,4)
addq $0x4, %rdx
cmpq %rdx, %rcx
jne 0x13e0d
movq 0x10(%r14), %rdi
leaq 0x164a1(%rip), %rsi     # 0x2a370
callq 0x6724
movq (%rbx), %r12
movq 0x8(%rbx), %r15
cmpq %r15, %r12
je 0x13f68
movl %eax, %r14d
movq %r15, %r13
subq %r12, %r13
movq %r13, %rax
sarq $0x2, %rax
bsrq %rax, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
leaq 0x10(%rsp), %rcx
movq %r12, %rdi
movq %r15, %rsi
movl %r14d, %r8d
callq 0x19a12
cmpq $0x41, %r13
jl 0x13f55
leaq 0x40(%r12), %r13
leaq 0x10(%rsp), %rdx
movq %r12, %rdi
movq %r13, %rsi
movl %r14d, %ecx
callq 0x19e37
cmpq %r15, %r13
je 0x13f68
leaq 0x10(%rsp), %r12
movq %r13, %rdi
movq %r12, %rsi
movl %r14d, %edx
callq 0x19ed3
addq $0x4, %r13
cmpq %r15, %r13
jne 0x13f3c
jmp 0x13f68
leaq 0x10(%rsp), %rdx
movq %r12, %rdi
movq %r15, %rsi
movl %r14d, %ecx
callq 0x19e37
movslq %ebp, %rax
shlq $0x2, %rax
addq (%rbx), %rax
cmpq 0x8(%rbx), %rax
je 0x13f7c
movq %rax, 0x8(%rbx)
leaq 0x10(%rsp), %rdi
callq 0xf1d6
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x13f9a
movq %rax, %r14
jmp 0x13fb8
jmp 0x13fa1
movq %rax, %r14
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x13fb8
movq 0x10(%rbx), %rsi
subq %rdi, %rsi
callq 0x4300
leaq 0x10(%rsp), %rdi
callq 0xf1d6
movq %r14, %rdi
callq 0x45b0