// File: epfml[P]sent2vec/src/fasttext.cc
// Function: fasttext::FastText::textVector(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, fasttext::Vector&, std::vector<int, std::allocator<int>>&, std::vector<int, std::allocator<int>>&)
void FastText::textVector(std::string text, Vector& vec, std::vector<int32_t>& line, std::vector<int32_t>& labels) {
  std::istringstream text_stream(text);
  dict_->getLine(text_stream, line, labels, model_->rng);
  vec.zero();
  if (args_->model == model_name::cbowCWNgrams){
    Vector buff(args_->dim);
    for (int i=0; i< line.size(); ++i) {
        getVector(buff, line[i]);
        vec.addVector(buff);
    }
    if (!line.empty()) {
      vec.mul(1.0 / line.size());
    }
  } else {
    if (args_->model == model_name::sent2vec){
      dict_->addNgrams(line, args_->wordNgrams);
    }
    for (auto it = line.cbegin(); it != line.cend(); ++it) {
      vec.addRow(*input_, *it);
    }
    if (!line.empty()) {
      vec.mul(1.0 / line.size());
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x240, %rsp            # imm = 0x240
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x208(%rbp)
leaq -0x1a8(%rbp), %rdi
movq %rdi, -0x1f8(%rbp)
movl $0x8, %edx
callq 0x5720
movq -0x208(%rbp), %rdi
addq $0x10, %rdi
callq 0x33af0
movq -0x208(%rbp), %rdi
movq %rax, -0x200(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x1f0(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x1e8(%rbp)
addq $0x60, %rdi
callq 0x340d0
movq -0x200(%rbp), %rdi
movq -0x1f8(%rbp), %rsi
movq -0x1f0(%rbp), %rdx
movq -0x1e8(%rbp), %rcx
movq %rax, %r8
addq $0x110, %r8             # imm = 0x110
callq 0xafc0
jmp 0x2d01c
movq -0x18(%rbp), %rdi
callq 0x21040
jmp 0x2d027
movq -0x208(%rbp), %rdi
callq 0xea70
cmpl $0x5, 0xc0(%rax)
jne 0x2d194
movq -0x208(%rbp), %rdi
callq 0xea70
movslq 0x94(%rax), %rsi
leaq -0x1c8(%rbp), %rdi
callq 0x20f90
jmp 0x2d061
movl $0x0, -0x1cc(%rbp)
movslq -0x1cc(%rbp), %rax
movq %rax, -0x210(%rbp)
movq -0x20(%rbp), %rdi
callq 0xf0e0
movq %rax, %rcx
movq -0x210(%rbp), %rax
cmpq %rcx, %rax
jae 0x2d11b
movq -0x20(%rbp), %rdi
movslq -0x1cc(%rbp), %rsi
callq 0xe5d0
movq -0x208(%rbp), %rdi
movl (%rax), %edx
leaq -0x1c8(%rbp), %rsi
callq 0x2d720
jmp 0x2d0bc
movq -0x18(%rbp), %rdi
leaq -0x1c8(%rbp), %rsi
callq 0x21170
jmp 0x2d0ce
jmp 0x2d0d0
movl -0x1cc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1cc(%rbp)
jmp 0x2d06b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1b0(%rbp)
movl %eax, -0x1b4(%rbp)
jmp 0x2d302
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1b0(%rbp)
movl %eax, -0x1b4(%rbp)
leaq -0x1c8(%rbp), %rdi
callq 0x20ff0
jmp 0x2d302
movq -0x20(%rbp), %rdi
callq 0x34aa0
testb $0x1, %al
jne 0x2d183
movq -0x18(%rbp), %rax
movq %rax, -0x218(%rbp)
movq -0x20(%rbp), %rdi
callq 0xf0e0
movq -0x218(%rbp), %rdi
movq %rax, %xmm1
movaps 0x15811(%rip), %xmm0    # 0x42960
punpckldq %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
movapd 0x15815(%rip), %xmm0    # 0x42970
subpd %xmm0, %xmm1
movaps %xmm1, %xmm0
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm0, %xmm1
movsd 0x157be(%rip), %xmm0    # 0x42930
divsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
callq 0x21110
jmp 0x2d181
jmp 0x2d183
leaq -0x1c8(%rbp), %rdi
callq 0x20ff0
jmp 0x2d2ed
movq -0x208(%rbp), %rdi
callq 0xea70
cmpl $0x4, 0xc0(%rax)
jne 0x2d1f4
movq -0x208(%rbp), %rdi
addq $0x10, %rdi
callq 0x33af0
movq -0x208(%rbp), %rdi
movq %rax, -0x228(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x220(%rbp)
callq 0xea70
movq -0x228(%rbp), %rdi
movq -0x220(%rbp), %rsi
movl 0xb4(%rax), %edx
callq 0xab20
jmp 0x2d1f2
jmp 0x2d1f4
movq -0x20(%rbp), %rdi
callq 0xf700
movq %rax, -0x1d8(%rbp)
movq -0x20(%rbp), %rdi
callq 0xf770
movq %rax, -0x1e0(%rbp)
leaq -0x1d8(%rbp), %rdi
leaq -0x1e0(%rbp), %rsi
callq 0xf730
testb $0x1, %al
jne 0x2d22d
jmp 0x2d283
movq -0x208(%rbp), %rdi
movq -0x18(%rbp), %rax
movq %rax, -0x238(%rbp)
addq $0x20, %rdi
callq 0x23c20
movq %rax, -0x230(%rbp)
leaq -0x1d8(%rbp), %rdi
callq 0xf7a0
movq -0x238(%rbp), %rdi
movq -0x230(%rbp), %rsi
movslq (%rax), %rdx
callq 0x212c0
jmp 0x2d273
jmp 0x2d275
leaq -0x1d8(%rbp), %rdi
callq 0xf7c0
jmp 0x2d204
movq -0x20(%rbp), %rdi
callq 0x34aa0
testb $0x1, %al
jne 0x2d2eb
movq -0x18(%rbp), %rax
movq %rax, -0x240(%rbp)
movq -0x20(%rbp), %rdi
callq 0xf0e0
movq -0x240(%rbp), %rdi
movq %rax, %xmm1
movaps 0x156a9(%rip), %xmm0    # 0x42960
punpckldq %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
movapd 0x156ad(%rip), %xmm0    # 0x42970
subpd %xmm0, %xmm1
movaps %xmm1, %xmm0
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm0, %xmm1
movsd 0x15656(%rip), %xmm0    # 0x42930
divsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
callq 0x21110
jmp 0x2d2e9
jmp 0x2d2eb
jmp 0x2d2ed
leaq -0x1a8(%rbp), %rdi
callq 0x5220
addq $0x240, %rsp            # imm = 0x240
popq %rbp
retq
leaq -0x1a8(%rbp), %rdi
callq 0x5220
movq -0x1b0(%rbp), %rdi
callq 0x57a0
nopw (%rax,%rax)