// File: epfml[P]Bi-Sent2Vec/src/fasttext.cc
// Function: fasttext::FastText::cbow(fasttext::Model&, float, std::vector<int, std::allocator<int>> const&)
void FastText::cbow(Model& model, real lr,
                    const std::vector<int32_t>& line) {
  std::vector<int32_t> bow;
  std::uniform_int_distribution<> uniform(1, args_->ws);
  for (int32_t w = 0; w < line.size(); w++) {
    int32_t boundary = uniform(model.rng);
    bow.clear();
    for (int32_t c = -boundary; c <= boundary; c++) {
      if (c != 0 && w + c >= 0 && w + c < line.size()) {
        const std::vector<int32_t>& ngrams = dict_->getNgrams(line[w + c]);
        bow.insert(bow.end(), ngrams.cbegin(), ngrams.cend());
      }
    }
    model.update(bow, line[w], lr);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movss %xmm0, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x90(%rbp)
leaq -0x38(%rbp), %rdi
callq 0xe440
movq -0x90(%rbp), %rdi
callq 0xe6e0
movl 0x98(%rax), %edx
leaq -0x40(%rbp), %rdi
movl $0x1, %esi
callq 0xef10
jmp 0x2b492
movl $0x0, -0x50(%rbp)
movslq -0x50(%rbp), %rax
movq %rax, -0x98(%rbp)
movq -0x20(%rbp), %rdi
callq 0xed50
movq %rax, %rcx
movq -0x98(%rbp), %rax
cmpq %rcx, %rax
jae 0x2b667
movq -0x10(%rbp), %rsi
addq $0x110, %rsi            # imm = 0x110
leaq -0x40(%rbp), %rdi
callq 0xef40
movl %eax, -0x9c(%rbp)
jmp 0x2b4dc
movl -0x9c(%rbp), %eax
movl %eax, -0x54(%rbp)
leaq -0x38(%rbp), %rdi
callq 0xe590
xorl %eax, %eax
subl -0x54(%rbp), %eax
movl %eax, -0x58(%rbp)
movl -0x58(%rbp), %eax
cmpl -0x54(%rbp), %eax
jg 0x2b626
cmpl $0x0, -0x58(%rbp)
je 0x2b616
movl -0x50(%rbp), %eax
addl -0x58(%rbp), %eax
cmpl $0x0, %eax
jl 0x2b616
movl -0x50(%rbp), %eax
addl -0x58(%rbp), %eax
cltq
movq %rax, -0xa8(%rbp)
movq -0x20(%rbp), %rdi
callq 0xed50
movq %rax, %rcx
movq -0xa8(%rbp), %rax
cmpq %rcx, %rax
jae 0x2b616
movq -0x90(%rbp), %rdi
addq $0x10, %rdi
callq 0x34050
movq %rax, -0xb8(%rbp)
movq -0x20(%rbp), %rdi
movl -0x50(%rbp), %eax
movl -0x58(%rbp), %ecx
addl %ecx, %eax
movslq %eax, %rsi
callq 0xe1d0
movq -0xb8(%rbp), %rdi
movl (%rax), %esi
callq 0x83a0
movq %rax, -0xb0(%rbp)
jmp 0x2b588
movq -0xb0(%rbp), %rax
movq %rax, -0x60(%rbp)
leaq -0x38(%rbp), %rdi
movq %rdi, -0xc8(%rbp)
callq 0xea40
movq %rax, -0x70(%rbp)
leaq -0x68(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0xf840
movq -0x60(%rbp), %rdi
callq 0xf370
movq %rax, -0x78(%rbp)
movq -0x60(%rbp), %rdi
callq 0xf3e0
movq -0xc8(%rbp), %rdi
movq %rax, -0x80(%rbp)
movq -0x68(%rbp), %rsi
movq -0x78(%rbp), %rdx
movq -0x80(%rbp), %rcx
callq 0x34c40
movq %rax, -0xc0(%rbp)
jmp 0x2b5ef
movq -0xc0(%rbp), %rax
movq %rax, -0x88(%rbp)
jmp 0x2b616
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x38(%rbp), %rdi
callq 0xe530
jmp 0x2b679
jmp 0x2b618
movl -0x58(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x58(%rbp)
jmp 0x2b4f6
movq -0x10(%rbp), %rax
movq %rax, -0xd0(%rbp)
movq -0x20(%rbp), %rdi
movslq -0x50(%rbp), %rsi
callq 0xe1d0
movq -0xd0(%rbp), %rdi
movl (%rax), %edx
movss -0x14(%rbp), %xmm0
leaq -0x38(%rbp), %rsi
callq 0x22990
jmp 0x2b657
jmp 0x2b659
movl -0x50(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x50(%rbp)
jmp 0x2b499
leaq -0x38(%rbp), %rdi
callq 0xe530
addq $0xd0, %rsp
popq %rbp
retq
movq -0x48(%rbp), %rdi
callq 0x57a0
nopw %cs:(%rax,%rax)