// File: epfml[P]Bi-Sent2Vec/src/fasttext.cc
// Function: fasttext::FastText::printVocabularyVectors(bool)
void FastText::printVocabularyVectors(bool input_matrix) {
  std::vector<std::string> words = getVocab();
  std::shared_ptr<Matrix> matrix = input_matrix ? input_ : output_;
  Vector vec(args_->dim);
  std::string word;
  for(int i = 0; i < words.size(); i++) {
    word = words[i];
    const std::vector<int32_t> &ngrams = dict_->getNgrams(word);
    vec.zero();
    for (auto it = ngrams.begin(); it != ngrams.end(); ++it) {
      vec.addRow(*matrix, *it);
    }
    if (ngrams.size() > 0) {
      vec.mul(1.0 / ngrams.size());
    }
    std::cout << word << " " << " " << vec << std::endl;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xf0, %rsp
movb %sil, %al
movq %rdi, -0x8(%rbp)
andb $0x1, %al
movb %al, -0x9(%rbp)
movq -0x8(%rbp), %rsi
movq %rsi, -0xb8(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x27e40
testb $0x1, -0x9(%rbp)
je 0x2d975
movq -0xb8(%rbp), %rax
addq $0x20, %rax
movq %rax, -0xc0(%rbp)
jmp 0x2d987
movq -0xb8(%rbp), %rax
addq $0x30, %rax
movq %rax, -0xc0(%rbp)
movq -0xc0(%rbp), %rsi
leaq -0x38(%rbp), %rdi
callq 0x352c0
movq -0xb8(%rbp), %rdi
callq 0xe6e0
movslq 0x94(%rax), %rsi
leaq -0x48(%rbp), %rdi
callq 0x20c00
jmp 0x2d9b5
leaq -0x78(%rbp), %rdi
callq 0x5600
movl $0x0, -0x7c(%rbp)
movslq -0x7c(%rbp), %rax
movq %rax, -0xc8(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x122c0
movq %rax, %rcx
movq -0xc8(%rbp), %rax
cmpq %rcx, %rax
jae 0x2dc02
movslq -0x7c(%rbp), %rsi
leaq -0x28(%rbp), %rdi
callq 0x35170
movq %rax, %rsi
leaq -0x78(%rbp), %rdi
callq 0x5070
jmp 0x2da07
movq -0xb8(%rbp), %rdi
addq $0x10, %rdi
callq 0x34050
movq %rax, %rsi
leaq -0xa0(%rbp), %rdi
leaq -0x78(%rbp), %rdx
callq 0x8430
jmp 0x2da2c
leaq -0xa0(%rbp), %rax
movq %rax, -0x88(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x20cb0
jmp 0x2da45
movq -0x88(%rbp), %rdi
callq 0x113e0
movq %rax, -0xa8(%rbp)
movq -0x88(%rbp), %rdi
callq 0x11410
movq %rax, -0xb0(%rbp)
leaq -0xa8(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
callq 0xf3a0
testb $0x1, %al
jne 0x2da87
jmp 0x2db07
leaq -0x38(%rbp), %rdi
callq 0x23880
movq %rax, -0xd0(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0xf410
movq -0xd0(%rbp), %rsi
movslq (%rax), %rdx
leaq -0x48(%rbp), %rdi
callq 0x20f30
jmp 0x2dab8
jmp 0x2daba
leaq -0xa8(%rbp), %rdi
callq 0xf430
jmp 0x2da58
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x2dc41
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x2dc2f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0xe530
jmp 0x2dc2f
movq -0x88(%rbp), %rdi
callq 0xed50
cmpq $0x0, %rax
jbe 0x2db69
movq -0x88(%rbp), %rdi
callq 0xed50
movq %rax, %xmm1
movaps 0x14dbf(%rip), %xmm0    # 0x428f0
punpckldq %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
movapd 0x14dc3(%rip), %xmm0    # 0x42900
subpd %xmm0, %xmm1
movaps %xmm1, %xmm0
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm0, %xmm1
movsd 0x14d64(%rip), %xmm0    # 0x428b8
divsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
leaq -0x48(%rbp), %rdi
callq 0x20d80
jmp 0x2db67
jmp 0x2db69
movq 0x31448(%rip), %rdi     # 0x5efb8
leaq -0x78(%rbp), %rsi
callq 0x53e0
movq %rax, -0xd8(%rbp)
jmp 0x2db82
movq -0xd8(%rbp), %rdi
leaq 0x14fb1(%rip), %rsi     # 0x42b41
callq 0x5420
movq %rax, -0xe0(%rbp)
jmp 0x2db9e
movq -0xe0(%rbp), %rdi
leaq 0x14f95(%rip), %rsi     # 0x42b41
callq 0x5420
movq %rax, -0xe8(%rbp)
jmp 0x2dbba
movq -0xe8(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x21440
movq %rax, -0xf0(%rbp)
jmp 0x2dbd3
movq -0xf0(%rbp), %rdi
movq 0x313af(%rip), %rsi     # 0x5ef90
callq 0x5460
jmp 0x2dbe8
leaq -0xa0(%rbp), %rdi
callq 0xe530
movl -0x7c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x7c(%rbp)
jmp 0x2d9c5
leaq -0x78(%rbp), %rdi
callq 0x58d8
leaq -0x48(%rbp), %rdi
callq 0x20c60
leaq -0x38(%rbp), %rdi
callq 0x23810
leaq -0x28(%rbp), %rdi
callq 0xe820
addq $0xf0, %rsp
popq %rbp
retq
leaq -0x78(%rbp), %rdi
callq 0x58d8
leaq -0x48(%rbp), %rdi
callq 0x20c60
leaq -0x38(%rbp), %rdi
callq 0x23810
leaq -0x28(%rbp), %rdi
callq 0xe820
movq -0x50(%rbp), %rdi
callq 0x57a0
nopl (%rax)