// File: /workspace/github_cpp_makefile_star2_O1/ddu1[P]polarizedtext/src/model.cc
// Function: fasttext::Model::dfs(int, int, float, std::vector<std::pair<float, int>, std::allocator<std::pair<float, int>>>&, fasttext::Vector&) const
void Model::dfs(int32_t k, int32_t node, real score,
                std::vector<std::pair<real, int32_t>>& heap,
                Vector& hidden) const {
  if (heap.size() == k && score < heap.front().first) {
    return;
  }

  if (tree[node].left == -1 && tree[node].right == -1) {
    heap.push_back(std::make_pair(score, node));
    std::push_heap(heap.begin(), heap.end(), comparePairs);
    if (heap.size() > k) {
      std::pop_heap(heap.begin(), heap.end(), comparePairs);
      heap.pop_back();
    }
    return;
  }

  real f = sigmoid(wo_->dotRow(hidden, node - osz_));
  dfs(k, tree[node].left, score + log(1.0 - f), heap, hidden);
  dfs(k, tree[node].right, score + log(f), heap, hidden);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, %r14
movq %rcx, %rbx
movss %xmm0, 0x8(%rsp)
movl %esi, %ebp
movq %rdi, %r15
movslq %esi, %r12
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %r12, %rcx
jne 0xa63e
movss (%rax), %xmm0
ucomiss 0x8(%rsp), %xmm0
ja 0xa913
movslq %edx, %rax
movq 0xf0(%r15), %rcx
movq %rax, %r13
shlq $0x5, %r13
cmpl $-0x1, 0x4(%rcx,%r13)
jne 0xa664
addq %r13, %rcx
cmpl $-0x1, 0x8(%rcx)
je 0xa779
movq 0x10(%r15), %rdi
movslq 0x80(%r15), %rcx
subq %rcx, %rax
movq %r14, %rsi
movq %rax, %rdx
callq 0x9398
movaps %xmm0, %xmm1
xorps %xmm0, %xmm0
movss 0x7469(%rip), %xmm2     # 0x11af4
ucomiss %xmm1, %xmm2
xorps %xmm3, %xmm3
ja 0xa6d6
ucomiss 0x7462(%rip), %xmm1     # 0x11afc
movss 0x7456(%rip), %xmm3     # 0x11af8
ja 0xa6d6
addss 0x7450(%rip), %xmm1     # 0x11afc
mulss 0x744c(%rip), %xmm1     # 0x11b00
mulss 0x7448(%rip), %xmm1     # 0x11b04
mulss 0x7444(%rip), %xmm1     # 0x11b08
cvttss2si %xmm1, %eax
movq 0x90(%r15), %rcx
cltq
movss (%rcx,%rax,4), %xmm3
movq 0xf0(%r15), %rax
movl 0x4(%rax,%r13), %edx
movss 0x740e(%rip), %xmm2     # 0x11af8
movaps %xmm2, %xmm1
movss %xmm3, 0xc(%rsp)
subss %xmm3, %xmm1
ucomiss %xmm2, %xmm1
ja 0xa716
mulss 0x73fc(%rip), %xmm1     # 0x11b00
cvttss2si %xmm1, %eax
movq 0x98(%r15), %rcx
cltq
movss (%rcx,%rax,4), %xmm0
addss 0x8(%rsp), %xmm0
movq %r15, %rdi
movl %ebp, %esi
movq %rbx, %rcx
movq %r14, %r8
callq 0xa5fa
movq 0xf0(%r15), %rax
movl 0x8(%rax,%r13), %edx
xorps %xmm0, %xmm0
movss 0xc(%rsp), %xmm1
ucomiss 0x73b0(%rip), %xmm1     # 0x11af8
ja 0xa764
mulss 0x73ae(%rip), %xmm1     # 0x11b00
cvttss2si %xmm1, %eax
movq 0x98(%r15), %rcx
cltq
movss (%rcx,%rax,4), %xmm0
movss 0x8(%rsp), %xmm1
addss %xmm0, %xmm1
movss %xmm1, 0x8(%rsp)
jmp 0xa61c
leaq 0x10(%rsp), %rsi
movss 0x8(%rsp), %xmm0
movss %xmm0, (%rsi)
movl %edx, 0x4(%rsi)
movq %rbx, %rdi
callq 0xb924
movq (%rbx), %rax
movq 0x8(%rbx), %rsi
movss -0x8(%rsi), %xmm0
movl -0x4(%rsi), %ecx
movq %rsi, %rdx
subq %rax, %rdx
movq %rdx, %rdi
sarq $0x3, %rdi
leaq -0x1(%rdi), %r8
cmpq $0x2, %rdi
jl 0xa7f0
leaq -0x1(%r8), %r9
shrq $0x3f, %r9
addq %r8, %r9
decq %r9
sarq %r9
movss (%rax,%r9,8), %xmm1
ucomiss %xmm0, %xmm1
jbe 0xa7f0
movss %xmm1, (%rax,%r8,8)
movl 0x4(%rax,%r9,8), %r10d
movl %r10d, 0x4(%rax,%r8,8)
cmpq $0x2, %r8
movq %r9, %r8
jg 0xa7b9
jmp 0xa7f3
movq %r8, %r9
movss %xmm0, (%rax,%r9,8)
movl %ecx, 0x4(%rax,%r9,8)
cmpq %r12, %rdi
jbe 0xa913
leaq -0x8(%rsi), %rcx
cmpq $0x9, %rdx
jl 0xa90f
movss -0x8(%rsi), %xmm0
movl -0x4(%rsi), %edx
movss (%rax), %xmm1
movss %xmm1, -0x8(%rsi)
movl 0x4(%rax), %edi
movl %edi, -0x4(%rsi)
movq %rcx, %r8
subq %rax, %r8
movq %r8, %rdi
sarq $0x3, %rdi
cmpq $0x3, %rdi
jl 0xa896
leaq -0x1(%rdi), %rsi
shrq $0x3f, %rsi
leaq (%rdi,%rsi), %r9
decq %r9
sarq %r9
xorl %r10d, %r10d
leaq (%r10,%r10), %rsi
movss 0x10(%rax,%rsi,8), %xmm1
ucomiss 0x8(%rax,%rsi,8), %xmm1
ja 0xa86f
leaq 0x2(,%r10,2), %rsi
jmp 0xa877
leaq 0x1(,%r10,2), %rsi
movss (%rax,%rsi,8), %xmm1
movss %xmm1, (%rax,%r10,8)
movl 0x4(%rax,%rsi,8), %r11d
movl %r11d, 0x4(%rax,%r10,8)
movq %rsi, %r10
cmpq %r9, %rsi
jl 0xa854
jmp 0xa898
xorl %esi, %esi
testb $0x8, %r8b
jne 0xa8c9
addq $-0x2, %rdi
sarq %rdi
cmpq %rdi, %rsi
jne 0xa8c9
leaq (%rsi,%rsi), %rdi
movss 0x8(%rax,%rdi,8), %xmm1
movss %xmm1, (%rax,%rsi,8)
movl 0xc(%rax,%rdi,8), %edi
movl %edi, 0x4(%rax,%rsi,8)
leaq 0x1(,%rsi,2), %rsi
testq %rsi, %rsi
jle 0xa903
leaq -0x1(%rsi), %rdi
shrq $0x3f, %rdi
addq %rsi, %rdi
decq %rdi
sarq %rdi
movss (%rax,%rdi,8), %xmm1
ucomiss %xmm0, %xmm1
jbe 0xa903
movss %xmm1, (%rax,%rsi,8)
movl 0x4(%rax,%rdi,8), %r8d
movl %r8d, 0x4(%rax,%rsi,8)
cmpq $0x2, %rsi
movq %rdi, %rsi
jg 0xa8ce
jmp 0xa906
movq %rsi, %rdi
movss %xmm0, (%rax,%rdi,8)
movl %edx, 0x4(%rax,%rdi,8)
movq %rcx, 0x8(%rbx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq