// File: /workspace/github_cpp_makefile_star2_O2/epfml[P]Bi-Sent2Vec/src/fasttext.cc
// Function: fasttext::FastText::precomputeSentenceVectors(fasttext::Matrix&, std::basic_ifstream<char, std::char_traits<char>>&)
void FastText::precomputeSentenceVectors(Matrix& sentenceVectors,std::ifstream& in) {
  Vector vec(args_->dim);
  sentenceVectors.zero();
  std::cerr << "Pre-computing sentence vectors...";
  std::vector<int32_t> line;
  std::vector<int32_t> labels;
  int32_t i = 0;
  while (i < sentenceVectors.m_) {

    dict_->getLine(in, line, labels, model_->rng);
    dict_->addNgrams(line, args_->wordNgrams);

    vec.zero();
    for (auto it = line.cbegin(); it != line.cend(); ++it) {
      vec.addRow(*input_, *it);
    }
    if (!line.empty()) {
      vec.mul(1.0 / line.size());
    }
    real norm = vec.norm();
    if(norm != 0)
        sentenceVectors.addRow(vec, i, 1.0 / norm);
    i++;
  }
  std::cerr << " done." << std::endl;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdx, 0x28(%rsp)
movq %rsi, %rbx
movq %rdi, %r15
movq (%rdi), %rax
movslq 0x94(%rax), %rsi
leaq 0x30(%rsp), %rdi
callq 0xd03c
movq %rbx, 0x8(%rsp)
movq %rbx, %rdi
callq 0xbee0
movq 0x15041(%rip), %rdi     # 0x27ff0
leaq 0x88d9(%rip), %rsi      # 0x1b88f
callq 0x4330
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %r14
movaps %xmm0, (%r14)
andq $0x0, 0x10(%r14)
leaq 0x40(%rsp), %rax
movaps %xmm0, (%rax)
andq $0x0, 0x10(%rax)
xorl %ebp, %ebp
leaq 0x30(%rsp), %r13
movq 0x8(%rsp), %rax
cmpq %rbp, 0x8(%rax)
jle 0x130e0
movq 0x10(%r15), %rdi
movq 0x60(%r15), %r8
movl $0x110, %eax            # imm = 0x110
addq %rax, %r8
movq 0x28(%rsp), %rsi
movq %r14, %rdx
leaq 0x40(%rsp), %rcx
callq 0x7650
movq (%r15), %rax
movq 0x10(%r15), %rdi
movl 0xb4(%rax), %edx
movq %r14, %rsi
callq 0x7364
movq %r13, %rdi
callq 0xd078
movq 0x10(%rsp), %rbx
movq %rbx, %r12
negq %r12
cmpq 0x18(%rsp), %rbx
je 0x13059
movq 0x20(%r15), %rsi
movslq (%rbx), %rdx
movq %r13, %rdi
callq 0xd19e
addq $0x4, %rbx
addq $-0x4, %r12
jmp 0x13039
movq 0x10(%rsp), %rax
cmpq %rax, %rbx
je 0x130a6
addq %r12, %rax
negq %rax
sarq $0x2, %rax
movq %rax, %xmm0
punpckldq 0x7896(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x789e(%rip), %xmm0     # 0x1a920
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
movsd 0x7852(%rip), %xmm0     # 0x1a8e8
divsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movq %r13, %rdi
callq 0xd0cc
movq %r13, %rdi
callq 0xd090
ucomiss 0x7c5b(%rip), %xmm0     # 0x1ad10
jne 0x130b9
jnp 0x130d8
movss 0x80af(%rip), %xmm1     # 0x1b170
divss %xmm0, %xmm1
movq 0x8(%rsp), %rdi
movq %r13, %rsi
movq %rbp, %rdx
movaps %xmm1, %xmm0
callq 0xc01c
incq %rbp
jmp 0x12fe0
movq 0x14f09(%rip), %rdi     # 0x27ff0
leaq 0x879a(%rip), %rsi      # 0x1b888
callq 0x4330
movq %rax, %rdi
callq 0x4190
leaq 0x40(%rsp), %rdi
callq 0x8c0e
leaq 0x10(%rsp), %rdi
callq 0x8c0e
leaq 0x30(%rsp), %rdi
callq 0xd066
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x13133
movq %rax, %rbx
jmp 0x1314a
jmp 0x13133
jmp 0x13133
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x8c0e
leaq 0x10(%rsp), %rdi
callq 0x8c0e
leaq 0x30(%rsp), %rdi
callq 0xd066
movq %rbx, %rdi
callq 0x45d0