// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/match/pck-count-nodes.c
// Function: visit_count_children
static void visit_count_children(const FMindex *index,
                           Nodecount *parent,
                           GtStackNodecount *stack,
                           Mbtab *tmpmbtab,
                           GtUword *rangeOccs,
                           GT_UNUSED unsigned int numofchars)
{
  GtUword rangesize, idx, num_special;
  unsigned int offset;
  Nodecount child;

  gt_assert(parent->lower < parent->upper);
  rangesize = gt_bwtrangesplitallwithoutspecial(tmpmbtab,
                                             rangeOccs,
                                             index,
                                             parent->lower,
                                             parent->upper);
  gt_assert(rangesize <= (GtUword) numofchars);

  offset = 0U;
  num_special = parent->upper - parent->lower;
  for (idx = 0; idx < rangesize; idx++)
  {
    child.lower = tmpmbtab[idx].lowerbound;
    child.upper = tmpmbtab[idx].upperbound;
    child.leaves = 0UL;
    child.branching = 1UL;
    child.parentOffset = offset + 1U;
    child.visited = false;
    child.on_branch = false;

    /* check if child is part of a branch */
    if (child.upper - child.lower == parent->upper - parent->lower)
    {
      /* TODO DW do sth with non branching nodes */
      child.on_branch = true;
      parent->branching--;
      GT_STACK_PUSH(stack, child);
      num_special = 0UL;
      offset++;
    }
    else
    {
      /* we found a leave on parent*/
      if (child.lower + 1 == child.upper)
      {
        parent->leaves++;
        num_special--;
      }
      else
        /* child is a branch of parent node */
      {
        if (child.lower == child.upper)
        {
          /* do nothing, this is no node, this is a missing char */
        }
        else
        {
          GT_STACK_PUSH(stack, child);
          offset++;
          num_special -= (child.upper - child.lower);
        }
      }
    }
  }
  parent->leaves += num_special;
}

// Assembly:
subq $0xb8, %rsp
movq %rdi, 0xb0(%rsp)
movq %rsi, 0xa8(%rsp)
movq %rdx, 0xa0(%rsp)
movq %rcx, 0x98(%rsp)
movq %r8, 0x90(%rsp)
movl %r9d, 0x8c(%rsp)
movq 0xa8(%rsp), %rax
movq 0x10(%rax), %rax
movq 0xa8(%rsp), %rcx
cmpq 0x18(%rcx), %rax
jb 0x334959
movq 0x2c76a0(%rip), %rax    # 0x5fbfc8
movq (%rax), %rdi
leaq 0x1c6c6b(%rip), %rsi    # 0x4fb59d
leaq 0x21fdb8(%rip), %rdx    # 0x5546f1
leaq 0x21fdcf(%rip), %rcx    # 0x55470f
leaq 0x21fd63(%rip), %r8     # 0x5546aa
movl $0x2b, %r9d
movb $0x0, %al
callq 0x33960
callq 0x2f830
jmp 0x33495b
movq 0x98(%rsp), %rdi
movq 0x90(%rsp), %rsi
movq 0xb0(%rsp), %rdx
movq 0xa8(%rsp), %rax
movq 0x10(%rax), %rcx
movq 0xa8(%rsp), %rax
movq 0x18(%rax), %r8
callq 0x2e06d0
movq %rax, 0x80(%rsp)
movq 0x80(%rsp), %rax
movl 0x8c(%rsp), %ecx
cmpq %rcx, %rax
jbe 0x3349e4
movq 0x2c7615(%rip), %rax    # 0x5fbfc8
movq (%rax), %rdi
leaq 0x1c6be0(%rip), %rsi    # 0x4fb59d
leaq 0x21fd60(%rip), %rdx    # 0x554724
leaq 0x21fd44(%rip), %rcx    # 0x55470f
leaq 0x21fcd8(%rip), %r8     # 0x5546aa
movl $0x31, %r9d
movb $0x0, %al
callq 0x33960
callq 0x2f830
jmp 0x3349e6
movl $0x0, 0x6c(%rsp)
movq 0xa8(%rsp), %rax
movq 0x18(%rax), %rax
movq 0xa8(%rsp), %rcx
subq 0x10(%rcx), %rax
movq %rax, 0x70(%rsp)
movq $0x0, 0x78(%rsp)
movq 0x78(%rsp), %rax
cmpq 0x80(%rsp), %rax
jae 0x334f54
movq 0x98(%rsp), %rax
movq 0x78(%rsp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq %rax, 0x50(%rsp)
movq 0x98(%rsp), %rax
movq 0x78(%rsp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq %rax, 0x58(%rsp)
movq $0x0, 0x40(%rsp)
movq $0x1, 0x48(%rsp)
movl 0x6c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x60(%rsp)
movb $0x0, 0x64(%rsp)
movb $0x0, 0x65(%rsp)
movq 0x58(%rsp), %rax
subq 0x50(%rsp), %rax
movq 0xa8(%rsp), %rcx
movq 0x18(%rcx), %rcx
movq 0xa8(%rsp), %rdx
subq 0x10(%rdx), %rcx
cmpq %rcx, %rax
jne 0x334cdd
movb $0x1, 0x65(%rsp)
movq 0xa8(%rsp), %rax
movq 0x8(%rax), %rcx
addq $-0x1, %rcx
movq %rcx, 0x8(%rax)
movq 0xa0(%rsp), %rax
movq 0x10(%rax), %rax
movq 0xa0(%rsp), %rcx
cmpq (%rcx), %rax
jne 0x334c56
movq $0x28, 0x38(%rsp)
movq 0x38(%rsp), %rax
movq 0xa0(%rsp), %rcx
movq (%rcx), %rcx
movq 0xa0(%rsp), %rdx
addq 0x20(%rdx), %rcx
imulq %rcx, %rax
movq %rax, 0x30(%rsp)
movq 0xa0(%rsp), %rax
movq (%rax), %rax
movq 0xa0(%rsp), %rcx
cmpq 0x18(%rcx), %rax
jne 0x334b38
xorl %eax, %eax
movq %rax, 0x8(%rsp)
jmp 0x334b4c
movq 0xa0(%rsp), %rax
movq 0x2828(%rax), %rax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rdi
movq 0x30(%rsp), %rsi
leaq 0x21fb4d(%rip), %rdx    # 0x5546aa
movl $0x45, %ecx
callq 0x2f910
movq %rax, %rcx
movq 0xa0(%rsp), %rax
movq %rcx, 0x2828(%rax)
movq 0xa0(%rsp), %rax
movq (%rax), %rax
movq 0xa0(%rsp), %rcx
cmpq 0x18(%rcx), %rax
jne 0x334bc4
movq 0xa0(%rsp), %rax
movq 0x2828(%rax), %rdi
movq 0xa0(%rsp), %rsi
addq $0x28, %rsi
movq 0x38(%rsp), %rdx
movq 0xa0(%rsp), %rax
imulq 0x18(%rax), %rdx
callq 0x33ca0
movq 0xa0(%rsp), %rax
cmpq $0x0, 0x2830(%rax)
je 0x334c3c
movq $0x0, 0x28(%rsp)
movq 0x28(%rsp), %rax
movq 0xa0(%rsp), %rcx
cmpq 0x20(%rcx), %rax
jae 0x334c3a
movq 0xa0(%rsp), %rax
movq 0x2830(%rax), %rax
movq 0xa0(%rsp), %rcx
movq 0x2828(%rcx), %rdi
movq 0xa0(%rsp), %rcx
imulq $0x28, (%rcx), %rcx
addq %rcx, %rdi
imulq $0x28, 0x28(%rsp), %rcx
addq %rcx, %rdi
callq *%rax
movq 0x28(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x28(%rsp)
jmp 0x334bdf
jmp 0x334c3c
movq 0xa0(%rsp), %rax
movq 0x20(%rax), %rcx
movq 0xa0(%rsp), %rax
addq (%rax), %rcx
movq %rcx, (%rax)
movq 0xa0(%rsp), %rax
movq 0x2828(%rax), %rdi
movq 0xa0(%rsp), %rcx
movq 0x10(%rcx), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, 0x10(%rcx)
imulq $0x28, %rax, %rax
addq %rax, %rdi
leaq 0x40(%rsp), %rsi
movl $0x28, %edx
callq 0x33ca0
movq 0xa0(%rsp), %rax
movq 0x8(%rax), %rax
movq 0xa0(%rsp), %rcx
cmpq 0x10(%rcx), %rax
jae 0x334cc4
movq 0xa0(%rsp), %rax
movq 0x10(%rax), %rcx
movq 0xa0(%rsp), %rax
movq %rcx, 0x8(%rax)
movq $0x0, 0x70(%rsp)
movl 0x6c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x6c(%rsp)
jmp 0x334f3f
movq 0x50(%rsp), %rax
addq $0x1, %rax
cmpq 0x58(%rsp), %rax
jne 0x334d12
movq 0xa8(%rsp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
movq 0x70(%rsp), %rax
addq $-0x1, %rax
movq %rax, 0x70(%rsp)
jmp 0x334f3d
movq 0x50(%rsp), %rax
cmpq 0x58(%rsp), %rax
jne 0x334d23
jmp 0x334f3b
movq 0xa0(%rsp), %rax
movq 0x10(%rax), %rax
movq 0xa0(%rsp), %rcx
cmpq (%rcx), %rax
jne 0x334eab
movq $0x28, 0x20(%rsp)
movq 0x20(%rsp), %rax
movq 0xa0(%rsp), %rcx
movq (%rcx), %rcx
movq 0xa0(%rsp), %rdx
addq 0x20(%rdx), %rcx
imulq %rcx, %rax
movq %rax, 0x18(%rsp)
movq 0xa0(%rsp), %rax
movq (%rax), %rax
movq 0xa0(%rsp), %rcx
cmpq 0x18(%rcx), %rax
jne 0x334d8f
xorl %eax, %eax
movq %rax, (%rsp)
jmp 0x334da2
movq 0xa0(%rsp), %rax
movq 0x2828(%rax), %rax
movq %rax, (%rsp)
movq (%rsp), %rdi
movq 0x18(%rsp), %rsi
leaq 0x21f8f8(%rip), %rdx    # 0x5546aa
movl $0x5a, %ecx
callq 0x2f910
movq %rax, %rcx
movq 0xa0(%rsp), %rax
movq %rcx, 0x2828(%rax)
movq 0xa0(%rsp), %rax
movq (%rax), %rax
movq 0xa0(%rsp), %rcx
cmpq 0x18(%rcx), %rax
jne 0x334e19
movq 0xa0(%rsp), %rax
movq 0x2828(%rax), %rdi
movq 0xa0(%rsp), %rsi
addq $0x28, %rsi
movq 0x20(%rsp), %rdx
movq 0xa0(%rsp), %rax
imulq 0x18(%rax), %rdx
callq 0x33ca0
movq 0xa0(%rsp), %rax
cmpq $0x0, 0x2830(%rax)
je 0x334e91
movq $0x0, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq 0xa0(%rsp), %rcx
cmpq 0x20(%rcx), %rax
jae 0x334e8f
movq 0xa0(%rsp), %rax
movq 0x2830(%rax), %rax
movq 0xa0(%rsp), %rcx
movq 0x2828(%rcx), %rdi
movq 0xa0(%rsp), %rcx
imulq $0x28, (%rcx), %rcx
addq %rcx, %rdi
imulq $0x28, 0x10(%rsp), %rcx
addq %rcx, %rdi
callq *%rax
movq 0x10(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x10(%rsp)
jmp 0x334e34
jmp 0x334e91
movq 0xa0(%rsp), %rax
movq 0x20(%rax), %rcx
movq 0xa0(%rsp), %rax
addq (%rax), %rcx
movq %rcx, (%rax)
movq 0xa0(%rsp), %rax
movq 0x2828(%rax), %rdi
movq 0xa0(%rsp), %rcx
movq 0x10(%rcx), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, 0x10(%rcx)
imulq $0x28, %rax, %rax
addq %rax, %rdi
leaq 0x40(%rsp), %rsi
movl $0x28, %edx
callq 0x33ca0
movq 0xa0(%rsp), %rax
movq 0x8(%rax), %rax
movq 0xa0(%rsp), %rcx
cmpq 0x10(%rcx), %rax
jae 0x334f19
movq 0xa0(%rsp), %rax
movq 0x10(%rax), %rcx
movq 0xa0(%rsp), %rax
movq %rcx, 0x8(%rax)
movl 0x6c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x6c(%rsp)
movq 0x58(%rsp), %rcx
subq 0x50(%rsp), %rcx
movq 0x70(%rsp), %rax
subq %rcx, %rax
movq %rax, 0x70(%rsp)
jmp 0x334f3d
jmp 0x334f3f
jmp 0x334f41
movq 0x78(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x78(%rsp)
jmp 0x334a14
movq 0x70(%rsp), %rcx
movq 0xa8(%rsp), %rax
addq (%rax), %rcx
movq %rcx, (%rax)
addq $0xb8, %rsp
retq
nop