// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/match/pckdfs.c
// Function: gt_fmindex_dfstraverse
int gt_fmindex_dfstraverse(const FMindex *fmindex,
                           unsigned int numofchars,
                           GtUword totallength,
                           Processlcp processlcp,
                           void *processlcpdata,
                           GtError *err)
{
  GtArrayDfs_Boundsatdepth stack;
  GtArrayBoundswithchar bwci;
  Boundswithchar *bwciptr;
  Dfs_Boundsatdepth parent, child;
  GtArrayGtUchar currentpath;
  GtUword nonspecialwidth, parentwidth, *rangeOccs;
  bool haserr = false, firstleaf = true;

  GT_INITARRAY(&stack,Dfs_Boundsatdepth);
  GT_INITARRAY(&currentpath,GtUchar);
  bwci.spaceBoundswithchar = gt_malloc(sizeof (*bwci.spaceBoundswithchar) *
                                       (numofchars+1));
  bwci.nextfreeBoundswithchar = 0;
  bwci.allocatedBoundswithchar = (GtUword) (numofchars+1);
  child.isinterval = true;
  child.depth = 0;
  child.lcpnodedepth = 0;
  child.either.pckitv.lowerbound = 0;
  child.either.pckitv.upperbound = totallength+1;
  child.either.pckitv.inchar = (GtUchar) numofchars; /* undefined */
#ifdef SKDEBUG
  showDfs_Boundsatdepth("push",&child);
#endif
  GT_STOREINARRAY(&stack,Dfs_Boundsatdepth,128,child);
  rangeOccs = gt_malloc(sizeof (*rangeOccs) * GT_MULT2(numofchars));
  while (!haserr && stack.nextfreeDfs_Boundsatdepth > 0)
  {
    parent = stack.spaceDfs_Boundsatdepth[--stack.nextfreeDfs_Boundsatdepth];
#ifdef SKDEBUG
    showDfs_Boundsatdepth("pop",&parent);
#endif
    if (!parent.isinterval)
    {

      gt_assert(parent.depth > 0);
      if (processlcp != NULL)
      {
        GtUword idx;

        for (idx = 0; idx<parent.either.remainingspecial; idx++)
        {
          if (!firstleaf)
          {
            if (processlcp(processlcpdata,(idx == 0)
                                          ? parent.lcpnodedepth
                                          : parent.depth - 1,
                                          err) != 0)
            {
              haserr = true;
              break;
            }
          } else
          {
            firstleaf = false;
          }
        }
      }
    } else
    {
      gt_assert(parent.either.pckitv.lowerbound <
                parent.either.pckitv.upperbound);
      if (parent.depth > 0)
      {
        gt_assert(parent.either.pckitv.inchar < (GtUchar) numofchars);
        if (parent.depth - 1 >= currentpath.allocatedGtUchar)
        {
          currentpath.allocatedGtUchar += 32UL;
          currentpath.spaceGtUchar
            = gt_realloc(currentpath.spaceGtUchar,
                         sizeof (*currentpath.spaceGtUchar) *
                         currentpath.allocatedGtUchar);
        }
        gt_assert(currentpath.spaceGtUchar != NULL);
        currentpath.spaceGtUchar[parent.depth - 1]
          = parent.either.pckitv.inchar;
        currentpath.nextfreeGtUchar = parent.depth;
#ifdef SKDEBUG
        showcurrentpath(&currentpath);
#endif
      }
      parentwidth = parent.either.pckitv.upperbound -
                    parent.either.pckitv.lowerbound;
      if (parentwidth == 1UL)
      {
        if (!firstleaf)
        {
          if (processlcp != NULL)
          {
            if (processlcp(processlcpdata,parent.lcpnodedepth,err) != 0)
            {
              haserr = true;
            }
          }
        } else
        {
          firstleaf = false;
        }
      } else
      {
        gt_assert(parentwidth >= 2UL);
        gt_bwtrangesplitwithoutspecial(&bwci,rangeOccs,fmindex,
                                       parent.either.pckitv.lowerbound,
                                       parent.either.pckitv.upperbound);
        nonspecialwidth = dfsnonspecialwidth(&bwci);
#ifdef SKDEBUG
        printf("split "GT_WU" "GT_WU" into "GT_WU" intervals of width "
               GT_WU"\n", parent.either.pckitv.lowerbound,
               parent.either.pckitv.upperbound, bwci.nextfreeBoundswithchar,
               nonspecialwidth);
#endif
        gt_assert(nonspecialwidth <= parentwidth);
        if (nonspecialwidth < parentwidth)
        {
          child.isinterval = false;
          child.depth = parent.depth + 1;
          child.either.remainingspecial = parentwidth - nonspecialwidth;
          if (bwci.nextfreeBoundswithchar > 0)
          {
            child.lcpnodedepth = parent.depth;
          } else
          {
            child.lcpnodedepth = parent.lcpnodedepth;
          }
#ifdef SKDEBUG
          showDfs_Boundsatdepth("special push",&child);
#endif
          GT_STOREINARRAY(&stack,Dfs_Boundsatdepth,128,child);
        }
        gt_assert(bwci.spaceBoundswithchar != NULL);
        for (bwciptr = bwci.spaceBoundswithchar+bwci.nextfreeBoundswithchar-1;
             bwciptr >= bwci.spaceBoundswithchar;
             bwciptr--)
        {
          child.isinterval = true;
          child.depth = parent.depth + 1;
          child.either.pckitv.lowerbound = bwciptr->lbound;
          child.either.pckitv.upperbound = bwciptr->rbound;
          if (bwciptr > bwci.spaceBoundswithchar)
          {
            child.lcpnodedepth = parent.depth;
          } else
          {
            child.lcpnodedepth = parent.lcpnodedepth;
          }
          gt_assert(bwciptr->inchar < (GtUchar) numofchars);
          child.either.pckitv.inchar = bwciptr->inchar;
          gt_assert(child.either.pckitv.lowerbound <
                    child.either.pckitv.upperbound);
#ifdef SKDEBUG
          showDfs_Boundsatdepth("push",&child);
#endif
          GT_STOREINARRAY(&stack,Dfs_Boundsatdepth,128,child);
        }
      }
    }
  }
  GT_FREEARRAY(&stack,Dfs_Boundsatdepth);
  GT_FREEARRAY(&bwci,Boundswithchar);
  GT_FREEARRAY(&currentpath,GtUchar);
  gt_free(rangeOccs);
  return haserr ? -1 : 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %r9, %r12
movq %r8, %r13
movq %rcx, 0x98(%rsp)
movq %rdx, %rbx
movq %rdi, 0xa0(%rsp)
movq %rsi, %r15
leal 0x1(%rsi), %r14d
leaq (,%r14,8), %rax
leaq (%rax,%rax,2), %rdi
leaq 0x1f1d41(%rip), %rbp    # 0x3b30f5
movq %rbp, %rsi
movl $0x66, %edx
callq 0x1092b2
movq %rax, 0x70(%rsp)
movq $0x0, 0x80(%rsp)
movq %r14, 0x78(%rsp)
movl $0x1800, %esi           # imm = 0x1800
xorl %edi, %edi
movq %rbp, %rdx
movl $0x72, %ecx
callq 0x1094e6
testq %rax, %rax
je 0x1c1a10
incq %rbx
movq $0x0, (%rax)
movq %rbx, 0x50(%rsp)
movq %rbx, 0x8(%rax)
movb %r15b, 0x10(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rax)
movb $0x1, 0x28(%rax)
movq %rax, %rbx
movl %r15d, %edi
addl %edi, %edi
shlq $0x3, %rdi
leaq 0x1f1ccc(%rip), %rsi    # 0x3b30f5
movl $0x73, %edx
callq 0x1092b2
movq %rbx, %rdi
movq %rax, 0x90(%rsp)
movb $0x1, %r8b
movl $0x80, %ebx
movl $0x1, %r10d
movq $0x0, 0x38(%rsp)
movq $0x0, 0x30(%rsp)
xorl %esi, %esi
movb %r15b, 0x3(%rsp)
movq %r12, 0x88(%rsp)
movq %r15, %r9
movq %r15, 0x20(%rsp)
movq %r12, %rdx
movq %r13, 0x40(%rsp)
leaq -0x1(%r10), %rax
movq %rax, 0x8(%rsp)
leaq (%rax,%rax,2), %r15
shlq $0x4, %r15
movq (%rdi,%r15), %r14
movq 0x18(%rdi,%r15), %rcx
movq 0x20(%rdi,%r15), %rax
movq %rax, 0x58(%rsp)
testb $0x1, 0x28(%rdi,%r15)
movq %rdi, 0x10(%rsp)
movq %rsi, 0x18(%rsp)
je 0x1c14f7
movq 0x8(%rdi,%r15), %rbp
movq %rbp, %r13
subq %r14, %r13
jbe 0x1c19ed
testq %rcx, %rcx
movq %rcx, 0x48(%rsp)
je 0x1c15f1
movb 0x10(%rdi,%r15), %r12b
cmpb %r9b, %r12b
jae 0x1c19f2
leaq -0x1(%rcx), %rdx
cmpq %rsi, %rdx
jae 0x1c1590
movq 0x30(%rsp), %rax
jmp 0x1c15d7
testq %rcx, %rcx
je 0x1c19e8
movq 0x98(%rsp), %rax
testq %rax, %rax
je 0x1c16d7
testq %r14, %r14
je 0x1c16d7
movq %rbx, 0x28(%rsp)
decq %rcx
xorl %ebx, %ebx
testb $0x1, %r8b
je 0x1c152f
xorl %r8d, %r8d
jmp 0x1c1579
movl %r8d, 0x4(%rsp)
testq %rbx, %rbx
movq %rcx, %r15
movq %rcx, %rsi
cmoveq 0x58(%rsp), %rsi
movq %r13, %rbp
movq %r13, %rdi
movq %rdx, %r13
movq %rax, %r12
callq *%rax
testl %eax, %eax
jne 0x1c190c
movq 0x20(%rsp), %r9
movq 0x10(%rsp), %rdi
movl 0x4(%rsp), %r8d
movq 0x18(%rsp), %rsi
movq %r13, %rdx
movq %r15, %rcx
movq %rbp, %r13
movq %r12, %rax
incq %rbx
cmpq %rbx, %r14
jne 0x1c1524
movq 0x8(%rsp), %r10
movq 0x28(%rsp), %rbx
jmp 0x1c1937
addq $0x20, %rsi
movq 0x30(%rsp), %rdi
movl %r8d, 0x4(%rsp)
movq %rsi, 0x18(%rsp)
movq %rdx, 0x30(%rsp)
leaq 0x1f1b46(%rip), %rdx    # 0x3b30f5
movl $0xa1, %ecx
movq %r10, 0x28(%rsp)
callq 0x1094e6
movq 0x30(%rsp), %rdx
movq 0x28(%rsp), %r10
movl 0x4(%rsp), %r8d
movq 0x10(%rsp), %rdi
movq 0x20(%rsp), %r9
testq %rax, %rax
je 0x1c19f7
movq %rax, 0x30(%rsp)
movb %r12b, (%rax,%rdx)
movq 0x88(%rsp), %rdx
cmpq $0x1, %r13
jne 0x1c1618
testb $0x1, %r8b
movq 0x18(%rsp), %rsi
je 0x1c1689
xorl %r8d, %r8d
movq 0x8(%rsp), %r10
movq 0x40(%rsp), %r13
jmp 0x1c1937
movl %r8d, 0x4(%rsp)
cmpq %r14, %rbp
je 0x1c1a06
movq %r10, %r12
leaq 0x70(%rsp), %rdi
movq 0x90(%rsp), %rsi
movq 0xa0(%rsp), %rdx
movq %r14, %rcx
movq %rbp, %r8
callq 0x1a8863
movq 0x80(%rsp), %rax
testq %rax, %rax
je 0x1c16e1
movq 0x70(%rsp), %rcx
addq $0x8, %rcx
movq %rax, %rsi
xorl %edx, %edx
movq 0x10(%rsp), %rdi
movb 0x3(%rsp), %r8b
movq 0x48(%rsp), %r11
addq (%rcx), %rdx
subq -0x8(%rcx), %rdx
addq $0x18, %rcx
decq %rsi
jne 0x1c1677
jmp 0x1c16f2
movq 0x98(%rsp), %rax
testq %rax, %rax
movq 0x40(%rsp), %r13
je 0x1c16d7
movq %r13, %rdi
movl %r8d, %r14d
movq 0x58(%rsp), %rsi
movq %rdx, %r12
callq *%rax
movl %r14d, %r8d
movq 0x10(%rsp), %rdi
movq 0x20(%rsp), %r9
testl %eax, %eax
movq 0x38(%rsp), %rax
movzbl %al, %eax
movl $0x1, %ecx
cmovnel %ecx, %eax
movq %rax, 0x38(%rsp)
movq %r12, %rdx
movq 0x18(%rsp), %rsi
movq 0x8(%rsp), %r10
jmp 0x1c1937
xorl %edx, %edx
movq 0x10(%rsp), %rdi
movb 0x3(%rsp), %r8b
movq 0x48(%rsp), %r11
subq %rdx, %r13
jb 0x1c1a01
jbe 0x1c179a
testq %rax, %rax
movq %r11, %r14
cmoveq 0x58(%rsp), %r14
cmpq %rbx, 0x8(%rsp)
jb 0x1c1741
subq $-0x80, %rbx
movq %rbx, %rax
shlq $0x4, %rax
leaq (%rax,%rax,2), %rsi
leaq 0x1f19cb(%rip), %rdx    # 0x3b30f5
movl $0xd9, %ecx
callq 0x1094e6
movq 0x48(%rsp), %r11
movb 0x3(%rsp), %r8b
movq %rax, %rdi
movq %r12, %r10
testq %rdi, %rdi
je 0x1c1a0b
leaq 0x1(%r11), %rax
movq %r13, (%rdi,%r15)
movq 0x50(%rsp), %rcx
movq %rcx, 0x8(%rdi,%r15)
movb %r8b, 0x10(%rdi,%r15)
movl 0x69(%rsp), %ecx
movl 0x6c(%rsp), %edx
movl %ecx, 0x11(%rdi,%r15)
movl %edx, 0x14(%rdi,%r15)
movq %rax, 0x18(%rdi,%r15)
movq %r14, 0x20(%rdi,%r15)
movb $0x0, 0x28(%rdi,%r15)
movl 0x62(%rsp), %eax
movl 0x65(%rsp), %ecx
movl %eax, 0x29(%rdi,%r15)
movl %ecx, 0x2c(%rdi,%r15)
jmp 0x1c179f
movq 0x8(%rsp), %r10
movq 0x70(%rsp), %rcx
testq %rcx, %rcx
je 0x1c19fc
movq 0x70(%rsp), %rax
movq 0x80(%rsp), %rdx
leaq (%rdx,%rdx,2), %rdx
leaq (%rcx,%rdx,8), %r14
addq $-0x18, %r14
cmpq %rax, %r14
jae 0x1c17ec
movq 0x40(%rsp), %r13
movq 0x20(%rsp), %r9
movl 0x4(%rsp), %r8d
movq 0x18(%rsp), %rsi
movq 0x88(%rsp), %rdx
jmp 0x1c1937
leaq 0x1(%r11), %rdx
leaq (%r10,%r10,2), %r13
shlq $0x4, %r13
addq $0x29, %r13
movq 0x20(%rsp), %r9
movq %rdx, 0x10(%rsp)
cmpq %rax, %r14
movq 0x58(%rsp), %r15
cmovaq %r11, %r15
movb 0x10(%r14), %bpl
cmpb %r9b, %bpl
jae 0x1c19e3
movq (%r14), %r12
movq 0x8(%r14), %rax
cmpq %rax, %r12
jae 0x1c19de
cmpq %rbx, %r10
jb 0x1c1882
subq $-0x80, %rbx
movq %rbx, 0x28(%rsp)
movq %rax, 0x50(%rsp)
movq 0x28(%rsp), %rax
shlq $0x4, %rax
leaq (%rax,%rax,2), %rsi
leaq 0x1f189f(%rip), %rdx    # 0x3b30f5
movl $0xf2, %ecx
movq %r10, %rbx
callq 0x1094e6
movq 0x10(%rsp), %rdx
movq 0x48(%rsp), %r11
movq %rbx, %r10
movq 0x20(%rsp), %r9
movq %rax, %rdi
movq 0x50(%rsp), %rax
movq 0x28(%rsp), %rbx
testq %rdi, %rdi
je 0x1c19d9
incq %r10
movq %r12, -0x29(%rdi,%r13)
movq %rax, -0x21(%rdi,%r13)
movb %bpl, -0x19(%rdi,%r13)
movq %rax, %rsi
movl 0x69(%rsp), %eax
movl 0x6c(%rsp), %ecx
movl %eax, -0x18(%rdi,%r13)
movl %ecx, -0x15(%rdi,%r13)
movq %rdx, -0x11(%rdi,%r13)
movq %r15, -0x9(%rdi,%r13)
movb $0x1, -0x1(%rdi,%r13)
movl 0x62(%rsp), %eax
movl 0x65(%rsp), %ecx
movl %ecx, 0x3(%rdi,%r13)
movl %eax, (%rdi,%r13)
addq $-0x18, %r14
movq 0x70(%rsp), %rax
addq $0x30, %r13
cmpq %rax, %r14
jae 0x1c1806
movb %bpl, 0x3(%rsp)
movq %rsi, 0x50(%rsp)
movq 0x88(%rsp), %rdx
movq 0x40(%rsp), %r13
movl 0x4(%rsp), %r8d
movq 0x18(%rsp), %rsi
jmp 0x1c1937
movb $0x1, %al
movq %rax, 0x38(%rsp)
movq 0x8(%rsp), %r10
movq 0x20(%rsp), %r9
movq 0x28(%rsp), %rbx
movq 0x10(%rsp), %rdi
movl 0x4(%rsp), %r8d
movq 0x18(%rsp), %rsi
movq %r13, %rdx
movq %rbp, %r13
testb $0x1, 0x38(%rsp)
jne 0x1c1947
testq %r10, %r10
jne 0x1c147d
leaq 0x1f17a7(%rip), %rsi    # 0x3b30f5
movl $0xf7, %edx
callq 0x109670
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x1c1987
leaq 0x1f178c(%rip), %rsi    # 0x3b30f5
movl $0xf8, %edx
callq 0x109670
xorps %xmm0, %xmm0
movaps %xmm0, 0x70(%rsp)
movq $0x0, 0x80(%rsp)
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x1c19a2
leaq 0x1f175d(%rip), %rsi    # 0x3b30f5
movl $0xf9, %edx
callq 0x109670
movzbl 0x38(%rsp), %ebx
leaq 0x1f1747(%rip), %rsi    # 0x3b30f5
movq 0x90(%rsp), %rdi
movl $0xfa, %edx
callq 0x109670
andl $0x1, %ebx
negl %ebx
movl %ebx, %eax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x68afd
callq 0x68ac4
callq 0x68a8b
callq 0x689a9
callq 0x689e0
callq 0x68a19
callq 0x68a52
callq 0x68b36
callq 0x68ba8
callq 0x68be1
callq 0x68b6f
callq 0x68c1a
nopl (%rax)