// File: /workspace/github_cpp_makefile_star2_O3/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, 0x40(%rsp)
movq %rsi, %r14
movq %rdi, %r15
movq (%rdi), %rax
movslq 0x94(%rax), %rsi
leaq 0x48(%rsp), %rdi
callq 0xf1ac
movq %r14, %rdi
callq 0xe068
movq 0x13696(%rip), %rdi     # 0x29ff0
leaq 0x8f36(%rip), %rsi      # 0x1f897
movl $0x21, %edx
callq 0x4350
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
xorl %eax, %eax
movq %rax, 0x10(%rsp)
movq %rax, 0x30(%rsp)
movaps %xmm0, 0x20(%rsp)
cmpq %rax, 0x8(%r14)
jle 0x16a8c
xorl %r12d, %r12d
leaq 0x48(%rsp), %rbp
movq 0x10(%r15), %rdi
movq 0x60(%r15), %r8
movl $0x110, %eax            # imm = 0x110
addq %rax, %r8
movq 0x40(%rsp), %rsi
movq %rsp, %rdx
leaq 0x20(%rsp), %rcx
callq 0x8716
movq (%r15), %rax
movq 0x10(%r15), %rdi
movl 0xb4(%rax), %edx
movq %rsp, %rsi
callq 0x82ec
movq %rbp, %rdi
callq 0xf1e8
movq (%rsp), %rbx
cmpq 0x8(%rsp), %rbx
je 0x16a4f
movq %rbx, %r13
negq %r13
movq 0x20(%r15), %rsi
movslq (%rbx), %rdx
movq %rbp, %rdi
callq 0xf302
addq $0x4, %rbx
addq $-0x4, %r13
cmpq 0x8(%rsp), %rbx
jne 0x169e5
movq (%rsp), %rax
cmpq %rax, %rbx
je 0x16a4f
addq %r13, %rax
negq %rax
sarq $0x2, %rax
movq %rax, %xmm0
punpckldq 0x7eed(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x7ef5(%rip), %xmm0     # 0x1e920
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
movsd 0x7eb9(%rip), %xmm0     # 0x1e8f8
divsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movq %rbp, %rdi
callq 0xf238
movq %rbp, %rdi
callq 0xf200
ucomiss 0x82ca(%rip), %xmm0     # 0x1ed28
jne 0x16a62
jnp 0x16a7f
movss 0x871e(%rip), %xmm1     # 0x1f188
divss %xmm0, %xmm1
movq %r14, %rdi
movq %rbp, %rsi
movq %r12, %rdx
movaps %xmm1, %xmm0
callq 0xe1ca
incq %r12
cmpq %r12, 0x8(%r14)
jg 0x16995
movq 0x1355d(%rip), %rbx     # 0x29ff0
leaq 0x8df6(%rip), %rsi      # 0x1f890
movl $0x6, %edx
movq %rbx, %rdi
callq 0x4350
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x42d0
movsbl %al, %esi
movq 0x1352b(%rip), %rdi     # 0x29ff0
callq 0x4040
movq %rax, %rdi
callq 0x4200
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x16ae9
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x4300
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x16aff
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x4300
leaq 0x48(%rsp), %rdi
callq 0xf1d6
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x16b53
jmp 0x16b23
jmp 0x16b23
jmp 0x16b23
movq %rax, %rbx
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x16b3d
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x4300
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x16b53
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x4300
leaq 0x48(%rsp), %rdi
callq 0xf1d6
movq %rbx, %rdi
callq 0x45b0
nop