// File: /workspace/github_cpp_makefile_star2_O1/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 0xef90
movq %r14, %rdi
callq 0xddee
movq 0x1377e(%rip), %rdi     # 0x29ff0
leaq 0x900e(%rip), %rsi      # 0x1f887
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 0x16998
xorl %r12d, %r12d
movq %rsp, %r13
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 %r13, %rdx
leaq 0x20(%rsp), %rcx
callq 0x86f4
movq (%r15), %rax
movq 0x10(%r15), %rdi
movl 0xb4(%rax), %edx
movq %r13, %rsi
callq 0x82ba
movq %rbp, %rdi
callq 0xefcc
movq (%rsp), %rbx
movq 0x8(%rsp), %rax
cmpq %rax, %rbx
je 0x16912
movq 0x20(%r15), %rsi
movslq (%rbx), %rdx
movq %rbp, %rdi
callq 0xf0e6
addq $0x4, %rbx
jmp 0x168f3
movq (%rsp), %rcx
cmpq %rax, %rcx
je 0x1695b
subq %rcx, %rax
sarq $0x2, %rax
movq %rax, %xmm0
punpckldq 0x7fe1(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x7fe9(%rip), %xmm0     # 0x1e920
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
movsd 0x7fa5(%rip), %xmm0     # 0x1e8f0
divsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movq %rbp, %rdi
callq 0xf01c
movq %rbp, %rdi
callq 0xefe4
ucomiss 0x83a6(%rip), %xmm0     # 0x1ed10
jne 0x1696e
jnp 0x1698b
movss 0x87fa(%rip), %xmm1     # 0x1f170
divss %xmm0, %xmm1
movq %r14, %rdi
movq %rbp, %rsi
movq %r12, %rdx
movaps %xmm1, %xmm0
callq 0xdf54
incq %r12
cmpq %r12, 0x8(%r14)
jg 0x168b0
movq 0x13651(%rip), %rbx     # 0x29ff0
leaq 0x8eda(%rip), %rsi      # 0x1f880
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 0x1361f(%rip), %rdi     # 0x29ff0
callq 0x4040
movq %rax, %rdi
callq 0x4200
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x169f5
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x4300
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x16a0b
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x4300
leaq 0x48(%rsp), %rdi
callq 0xefba
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x16a5f
jmp 0x16a2f
jmp 0x16a2f
jmp 0x16a2f
movq %rax, %rbx
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x16a49
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x4300
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x16a5f
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x4300
leaq 0x48(%rsp), %rdi
callq 0xefba
movq %rbx, %rdi
callq 0x45b0
nop