// File: /workspace/github_cpp_makefile_star2_O1/epfml[P]Bi-Sent2Vec/src/fasttext.cc
// Function: fasttext::FastText::transgram(fasttext::Model&, float, std::vector<int, std::allocator<int>> const&)
void FastText::transgram(Model& model, real lr,
                        const std::vector<int32_t>& line) {
  if (line.size() <= 1) return;
  std::uniform_int_distribution<> uniform(1, args_->ws);
  std::vector<int32_t> line1;
  std::vector<int32_t> line2;
  int32_t flag = 0;
  for (int32_t i=0; i<line.size(); ++i){
    if (line[i] == dict_->getId("<<split>>")){
      flag = 1;
      continue;
    }
    if (flag==0)
      line1.push_back(line[i]);
    else
      line2.push_back(line[i]);
  }
  for (int32_t w = 0; w < line1.size(); w++) {
    int32_t boundary = uniform(model.rng);
    std::vector<int32_t> word;
    word.push_back(line1[w]);
    for (int32_t c = -boundary; c <= boundary; c++) {
      if (c != 0 && w + c >= 0 && w + c < line1.size()) {
        model.update(word, line1[w + c], lr);
      }
    }
    for (int32_t i=0; i<line2.size(); ++i){
        model.update(word, line2[i], lr);
    }
  }
  for (int32_t w = 0; w < line2.size(); w++) {
    int32_t boundary = uniform(model.rng);
    std::vector<int32_t> word;
    word.push_back(line2[w]);
    for (int32_t c = -boundary; c <= boundary; c++) {
      if (c != 0 && w + c >= 0 && w + c < line2.size()) {
        model.update(word, line2[w + c], lr);
      }
    }
    for (int32_t i=0; i<line1.size(); ++i){
        model.update(word, line1[i], lr);
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movss %xmm0, 0x4(%rsp)
movq 0x8(%rdx), %rax
subq (%rdx), %rax
cmpq $0x5, %rax
jb 0x147c3
movq %rdx, %rbp
movq %rsi, %rbx
movq (%rdi), %rax
movl 0x98(%rax), %eax
movl $0x1, 0x78(%rsp)
movl %eax, 0x7c(%rsp)
xorl %edx, %edx
movq %rdx, 0x40(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
movq %rdx, 0x60(%rsp)
movaps %xmm0, 0x50(%rsp)
movq (%rbp), %rax
cmpq %rax, 0x8(%rbp)
je 0x14505
leaq 0x10(%rsp), %rcx
xorl %r12d, %r12d
xorl %r13d, %r13d
movq %rdi, 0x80(%rsp)
movq %rdx, 0x70(%rsp)
movq %r12, 0x8(%rsp)
movl (%rax,%r12), %r14d
movq 0x10(%rdi), %r12
leaq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
movq %rcx, %rdi
movq %rcx, %r15
leaq 0xb405(%rip), %rsi      # 0x1f839
leaq 0xb407(%rip), %rdx      # 0x1f842
callq 0x61b8
movq %r12, %rdi
movq %r15, %rsi
callq 0x6720
movl %eax, %r12d
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x1446a
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x4300
movl $0x1, %edi
cmpl %r12d, %r14d
movq 0x8(%rsp), %r12
je 0x144d7
movq (%rbp), %rdx
addq %r12, %rdx
cmpl $0x0, 0x70(%rsp)
je 0x1449a
movq 0x58(%rsp), %rsi
cmpq 0x60(%rsp), %rsi
je 0x144ba
leaq 0x58(%rsp), %rax
jmp 0x144ad
movq 0x38(%rsp), %rsi
xorl %edi, %edi
cmpq 0x40(%rsp), %rsi
je 0x144cb
leaq 0x38(%rsp), %rax
movl (%rdx), %ecx
movl %ecx, (%rsi)
addq $0x4, %rsi
movq %rsi, (%rax)
jmp 0x144d7
leaq 0x50(%rsp), %rdi
callq 0xad24
movl $0x1, %edi
jmp 0x144d7
leaq 0x30(%rsp), %rdi
callq 0xad24
xorl %edi, %edi
incq %r13
movq (%rbp), %rax
movq 0x8(%rbp), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
addq $0x4, %r12
movl %edi, %edx
cmpq %r13, %rcx
movq 0x80(%rsp), %rdi
leaq 0x10(%rsp), %rcx
ja 0x1440b
movq 0x38(%rsp), %rax
cmpq 0x30(%rsp), %rax
je 0x1464e
leaq 0x110(%rbx), %rax
movq %rax, 0x70(%rsp)
xorl %r14d, %r14d
leaq 0x10(%rsp), %r12
leaq 0x78(%rsp), %rdi
movq 0x70(%rsp), %rsi
movq %rdi, %rdx
callq 0xc0d8
movl %eax, %r13d
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
leaq (,%r14,4), %rdx
addq 0x30(%rsp), %rdx
movq 0x18(%rsp), %rsi
testq %rsi, %rsi
movq %r14, 0x8(%rsp)
je 0x1457a
movl (%rdx), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x18(%rsp)
jmp 0x14582
movq %r12, %rdi
callq 0xad24
testl %r13d, %r13d
js 0x145db
leal 0x1(,%r13,2), %r14d
movq 0x8(%rsp), %rax
movl %eax, %r15d
subl %r13d, %r15d
xorl %ebp, %ebp
cmpl %ebp, %r13d
je 0x145d4
movl %r15d, %eax
addl %ebp, %eax
js 0x145d4
movl %eax, %eax
movq 0x30(%rsp), %rcx
movq 0x38(%rsp), %rdx
subq %rcx, %rdx
sarq $0x2, %rdx
cmpq %rax, %rdx
jbe 0x145d4
movl (%rcx,%rax,4), %edx
movq %rbx, %rdi
movq %r12, %rsi
movss 0x4(%rsp), %xmm0
callq 0x105e0
incl %ebp
cmpl %ebp, %r14d
jne 0x1459c
movq 0x50(%rsp), %rax
cmpq %rax, 0x58(%rsp)
je 0x14618
xorl %r14d, %r14d
movl (%rax,%r14,4), %edx
movq %rbx, %rdi
movq %r12, %rsi
movss 0x4(%rsp), %xmm0
callq 0x105e0
incq %r14
movq 0x50(%rsp), %rax
movq 0x58(%rsp), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq %r14, %rcx
ja 0x145ea
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x1462f
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x4300
movq 0x8(%rsp), %r14
incq %r14
movq 0x38(%rsp), %rax
subq 0x30(%rsp), %rax
sarq $0x2, %rax
cmpq %r14, %rax
ja 0x14529
movq 0x50(%rsp), %rdi
cmpq %rdi, 0x58(%rsp)
je 0x1479a
leaq 0x110(%rbx), %rax
movq %rax, 0x70(%rsp)
xorl %r14d, %r14d
leaq 0x10(%rsp), %r12
leaq 0x78(%rsp), %rdi
movq 0x70(%rsp), %rsi
movq %rdi, %rdx
callq 0xc0d8
movl %eax, %r13d
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
leaq (,%r14,4), %rdx
addq 0x50(%rsp), %rdx
movq 0x18(%rsp), %rsi
testq %rsi, %rsi
movq %r14, 0x8(%rsp)
je 0x146c3
movl (%rdx), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x18(%rsp)
jmp 0x146cb
movq %r12, %rdi
callq 0xad24
testl %r13d, %r13d
js 0x14724
leal 0x1(,%r13,2), %r14d
movq 0x8(%rsp), %rax
movl %eax, %r15d
subl %r13d, %r15d
xorl %ebp, %ebp
cmpl %ebp, %r13d
je 0x1471d
movl %r15d, %eax
addl %ebp, %eax
js 0x1471d
movl %eax, %eax
movq 0x50(%rsp), %rcx
movq 0x58(%rsp), %rdx
subq %rcx, %rdx
sarq $0x2, %rdx
cmpq %rax, %rdx
jbe 0x1471d
movl (%rcx,%rax,4), %edx
movq %rbx, %rdi
movq %r12, %rsi
movss 0x4(%rsp), %xmm0
callq 0x105e0
incl %ebp
cmpl %ebp, %r14d
jne 0x146e5
movq 0x30(%rsp), %rax
cmpq %rax, 0x38(%rsp)
je 0x14761
xorl %r14d, %r14d
movl (%rax,%r14,4), %edx
movq %rbx, %rdi
movq %r12, %rsi
movss 0x4(%rsp), %xmm0
callq 0x105e0
incq %r14
movq 0x30(%rsp), %rax
movq 0x38(%rsp), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq %r14, %rcx
ja 0x14733
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x14778
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x4300
movq 0x8(%rsp), %r14
incq %r14
movq 0x50(%rsp), %rdi
movq 0x58(%rsp), %rax
subq %rdi, %rax
sarq $0x2, %rax
cmpq %r14, %rax
ja 0x14672
testq %rdi, %rdi
je 0x147ac
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x4300
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x147c3
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x4300
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x147df
jmp 0x14806
jmp 0x14806
jmp 0x147df
jmp 0x147df
movq %rax, %rbx
jmp 0x14820
movq %rax, %rbx
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x14820
movq 0x20(%rsp), %rsi
incq %rsi
jmp 0x1481b
jmp 0x14806
jmp 0x14806
jmp 0x14806
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x14820
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x4300
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x14837
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x4300
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x1484e
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x4300
movq %rbx, %rdi
callq 0x45b0