// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/match/pck-count-nodes.c
// Function: gt_pck_count_nodes_dfs
void gt_pck_count_nodes_dfs(const FMindex *index,
                        GtUword totallength,
                        unsigned int numofchars)
{
  GtStackNodecount stack;
  Nodecount root;
  Nodecount *current;
  Mbtab *tmpmbtab;
  GtUword *rangeOccs;
  GtUword resize = 128UL; /* TODO DW make this user definable, or dependable
                             on input data */

  GT_STACK_INIT(&stack, resize);
  rangeOccs = gt_malloc(sizeof (*rangeOccs) * GT_MULT2(numofchars));
  tmpmbtab = gt_malloc(sizeof (*tmpmbtab) * numofchars);

  root.lower = 0UL;
  root.upper = totallength + 1;
  root.leaves = 0UL;
  root.branching = 1UL;
  root.parentOffset = 0U;
  root.visited = false;
  root.on_branch = false;

  GT_STACK_PUSH(&stack, root);

  while (!GT_STACK_ISEMPTY(&stack))
  {
    current = &(stack.space[stack.nextfree -1]);
    if (current->visited)
    {
      current = &(GT_STACK_POP(&stack));
      if GT_STACK_ISEMPTY(&stack)
      {
        /* TODO DW change to gt_loger_log */
        gt_log_log("on root:\n "GT_WU" branching nodes\n "GT_WU" leaves\n",
           current->branching, current->leaves);
      }
      else
      {
        process_count_node(&stack, current);
      }
    }
    else
    {
      visit_count_children(index, current, &stack,
                     tmpmbtab, rangeOccs, numofchars);
      current->visited = true;
    }
  }
  gt_free(rangeOccs);
  gt_free(tmpmbtab);
  GT_STACK_DELETE(&stack);
}

// Assembly:
subq $0x28c8, %rsp           # imm = 0x28C8
movq %rdi, 0x28c0(%rsp)
movq %rsi, 0x28b8(%rsp)
movl %edx, 0x28b4(%rsp)
movq $0x80, 0x30(%rsp)
movq $0x100, 0x90(%rsp) # imm = 0x100
movq 0x30(%rsp), %rax
movq %rax, 0x98(%rsp)
movq 0x90(%rsp), %rax
movq %rax, 0x78(%rsp)
movq $0x0, 0x88(%rsp)
movq $0x0, 0x80(%rsp)
leaq 0x78(%rsp), %rax
addq $0x28, %rax
movq %rax, 0x28a0(%rsp)
movq $0x0, 0x28a8(%rsp)
cmpq $0x0, 0x28a8(%rsp)
je 0x3344fe
movq $0x0, 0x28a8(%rsp)
movq $0x0, 0x28(%rsp)
movq 0x28(%rsp), %rax
cmpq 0x90(%rsp), %rax
jae 0x3344fc
movq 0x28a8(%rsp), %rax
movq 0x28a0(%rsp), %rdi
imulq $0x28, 0x28(%rsp), %rcx
addq %rcx, %rdi
callq *%rax
movq 0x28(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x28(%rsp)
jmp 0x3344c2
jmp 0x3344fe
movl 0x28b4(%rsp), %eax
shll %eax
movl %eax, %eax
movl %eax, %edi
shlq $0x3, %rdi
leaq 0x220194(%rip), %rsi    # 0x5546aa
movl $0x7b, %edx
callq 0x2f600
movq %rax, 0x38(%rsp)
movl 0x28b4(%rsp), %eax
movl %eax, %edi
shlq $0x4, %rdi
leaq 0x220171(%rip), %rsi    # 0x5546aa
movl $0x7c, %edx
callq 0x2f600
movq %rax, 0x40(%rsp)
movq $0x0, 0x60(%rsp)
movq 0x28b8(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x68(%rsp)
movq $0x0, 0x50(%rsp)
movq $0x1, 0x58(%rsp)
movl $0x0, 0x70(%rsp)
movb $0x0, 0x74(%rsp)
movb $0x0, 0x75(%rsp)
movq 0x88(%rsp), %rax
cmpq 0x78(%rsp), %rax
jne 0x3346a3
movq $0x28, 0x20(%rsp)
movq 0x20(%rsp), %rax
movq 0x78(%rsp), %rcx
addq 0x98(%rsp), %rcx
imulq %rcx, %rax
movq %rax, 0x18(%rsp)
movq 0x78(%rsp), %rax
cmpq 0x90(%rsp), %rax
jne 0x3345d5
xorl %eax, %eax
movq %rax, 0x8(%rsp)
jmp 0x3345e2
movq 0x28a0(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rdi
movq 0x18(%rsp), %rsi
leaq 0x2200b7(%rip), %rdx    # 0x5546aa
movl $0x86, %ecx
callq 0x2f910
movq %rax, 0x28a0(%rsp)
movq 0x78(%rsp), %rax
cmpq 0x90(%rsp), %rax
jne 0x334638
movq 0x28a0(%rsp), %rdi
leaq 0x78(%rsp), %rsi
addq $0x28, %rsi
movq 0x20(%rsp), %rdx
imulq 0x90(%rsp), %rdx
callq 0x33ca0
cmpq $0x0, 0x28a8(%rsp)
je 0x334691
movq $0x0, 0x10(%rsp)
movq 0x10(%rsp), %rax
cmpq 0x98(%rsp), %rax
jae 0x33468f
movq 0x28a8(%rsp), %rax
movq 0x28a0(%rsp), %rdi
imulq $0x28, 0x78(%rsp), %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 0x33464c
jmp 0x334691
movq 0x98(%rsp), %rax
addq 0x78(%rsp), %rax
movq %rax, 0x78(%rsp)
movq 0x28a0(%rsp), %rdi
movq 0x88(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x88(%rsp)
imulq $0x28, %rax, %rax
addq %rax, %rdi
leaq 0x50(%rsp), %rsi
movl $0x28, %edx
callq 0x33ca0
movq 0x80(%rsp), %rax
cmpq 0x88(%rsp), %rax
jae 0x3346fa
movq 0x88(%rsp), %rax
movq %rax, 0x80(%rsp)
jmp 0x3346fc
movq 0x88(%rsp), %rdx
xorl %eax, %eax
movl $0x1, %ecx
cmpq $0x0, %rdx
cmovel %ecx, %eax
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x334723
jmp 0x3347fa
movq 0x28a0(%rsp), %rax
movq 0x88(%rsp), %rcx
subq $0x1, %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, 0x48(%rsp)
movq 0x48(%rsp), %rax
testb $0x1, 0x24(%rax)
je 0x3347c3
movq 0x28a0(%rsp), %rax
movq 0x88(%rsp), %rcx
addq $-0x1, %rcx
movq %rcx, 0x88(%rsp)
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, 0x48(%rsp)
cmpq $0x0, 0x88(%rsp)
jne 0x334789
movb $0x1, %al
testb $0x1, %al
jne 0x334791
jmp 0x3347b2
xorl %eax, %eax
testb $0x1, %al
jne 0x334791
jmp 0x3347b2
movq 0x48(%rsp), %rax
movq 0x8(%rax), %rsi
movq 0x48(%rsp), %rax
movq (%rax), %rdx
leaq 0x21ff1d(%rip), %rdi    # 0x5546c6
movb $0x0, %al
callq 0x30fa0
jmp 0x3347c1
movq 0x48(%rsp), %rsi
leaq 0x78(%rsp), %rdi
callq 0x334870
jmp 0x3347f5
movq 0x28c0(%rsp), %rdi
movq 0x48(%rsp), %rsi
movq 0x40(%rsp), %rcx
movq 0x38(%rsp), %r8
movl 0x28b4(%rsp), %r9d
leaq 0x78(%rsp), %rdx
callq 0x3348d0
movq 0x48(%rsp), %rax
movb $0x1, 0x24(%rax)
jmp 0x3346fc
movq 0x38(%rsp), %rdi
leaq 0x21fea4(%rip), %rsi    # 0x5546aa
movl $0xa0, %edx
callq 0x31f10
movq 0x40(%rsp), %rdi
leaq 0x21fe8e(%rip), %rsi    # 0x5546aa
movl $0xa1, %edx
callq 0x31f10
movq 0x78(%rsp), %rax
cmpq 0x90(%rsp), %rax
jbe 0x33485a
movq 0x28a0(%rsp), %rdi
leaq 0x21fe66(%rip), %rsi    # 0x5546aa
movl $0xa2, %edx
callq 0x31f10
movq $0x0, 0x28a0(%rsp)
addq $0x28c8, %rsp           # imm = 0x28C8
retq
nopw %cs:(%rax,%rax)