// File: /workspace/github_c_makefile_star2_O2/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 $0xb8, %rsp
movq %r9, 0x98(%rsp)
movq %r8, 0x90(%rsp)
movq %rcx, 0x10(%rsp)
movq %rdx, %r15
movl %esi, %r14d
movq %rdi, 0xb0(%rsp)
leal 0x1(%r14), %ebx
imulq $0x18, %rbx, %rdi
leaq 0x1e2776(%rip), %r12    # 0x349ea5
pushq $0x66
popq %rdx
movq %r12, %rsi
callq 0x93160
movq %rax, 0x60(%rsp)
andq $0x0, 0x70(%rsp)
movq %rbx, 0x68(%rsp)
pushq $0x72
popq %rcx
movl $0x1800, %esi           # imm = 0x1800
xorl %edi, %edi
movq %r12, %rdx
callq 0x93472
testq %rax, %rax
je 0x167cd3
movq %rax, %r13
incq %r15
andq $0x0, (%rax)
movq %r15, 0x30(%rsp)
movq %r15, 0x8(%rax)
movb %r14b, 0x10(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rax)
movb $0x1, 0x28(%rax)
movl %r14d, %edi
addl %edi, %edi
shlq $0x3, %rdi
leaq 0x1e270e(%rip), %rsi    # 0x349ea5
pushq $0x73
popq %rdx
callq 0x93160
movq %rax, 0x88(%rsp)
pushq $0x1
popq %rbp
movl $0x80, %eax
movq %rax, 0x48(%rsp)
movb $0x1, %cl
xorl %ebx, %ebx
movq %r14, 0x80(%rsp)
movb %r14b, 0xf(%rsp)
movq $0x0, 0x38(%rsp)
movq 0x10(%rsp), %r11
xorl %r15d, %r15d
movl %ecx, %eax
movq %rbp, 0x18(%rsp)
movq %rbx, 0x40(%rsp)
movl %eax, %esi
movq 0x18(%rsp), %rbp
imulq $0x30, %rbp, %rbx
addq $-0x7, %rbx
testb $0x1, %r15b
jne 0x167c11
testq %rbp, %rbp
je 0x167c11
leaq -0x1(%rbp), %rax
movq -0x11(%r13,%rbx), %r10
testb $0x1, -0x1(%r13,%rbx)
jne 0x1678ac
testq %r10, %r10
je 0x167c9d
addq $-0x30, %rbx
xorl %r15d, %r15d
movq %rax, %rbp
testq %r11, %r11
je 0x1677f1
movq %rax, 0x18(%rsp)
movq 0x7(%r13,%rbx), %r14
movq 0x27(%r13,%rbx), %rcx
movq %rcx, 0x20(%rsp)
decq %r10
xorl %ebx, %ebx
cmpq %rbx, %r14
setne %r15b
je 0x1677e4
testb $0x1, %sil
je 0x16785d
xorl %esi, %esi
jmp 0x167897
movq %r13, %rbp
movl %esi, %r13d
testq %rbx, %rbx
movq %r10, %r12
movq %r10, %rsi
cmoveq 0x20(%rsp), %rsi
movq 0x90(%rsp), %rdi
movq 0x98(%rsp), %rdx
callq *%r11
testl %eax, %eax
jne 0x16789c
movq 0x10(%rsp), %r11
movl %r13d, %esi
movq %rbp, %r13
movq %r12, %r10
incq %rbx
jmp 0x16784a
movq 0x10(%rsp), %r11
movl %r13d, %esi
movq %rbp, %r13
jmp 0x1677e4
movq %rax, 0x18(%rsp)
movq -0x29(%r13,%rbx), %rcx
movq -0x21(%r13,%rbx), %r8
movq %r8, %r15
subq %rcx, %r15
movq 0x38(%rsp), %rax
jbe 0x167cfd
movq -0x9(%r13,%rbx), %r9
testq %r10, %r10
je 0x16796c
movl %esi, 0x20(%rsp)
movb -0x19(%r13,%rbx), %r12b
cmpb 0x80(%rsp), %r12b
jae 0x167dbe
leaq -0x1(%r10), %rdx
movq 0x40(%rsp), %rsi
cmpq %rsi, %rdx
jb 0x16795b
addq $0x20, %rsi
movq %rax, %rdi
movq %rsi, 0x40(%rsp)
movq %rdx, 0xa0(%rsp)
leaq 0x1e258b(%rip), %rdx    # 0x349ea5
movq %rcx, 0x38(%rsp)
movl $0xa1, %ecx
movq %r9, 0x28(%rsp)
movq %r8, 0xa8(%rsp)
movq %r10, %r14
callq 0x93472
movq 0xa0(%rsp), %rdx
movq %r14, %r10
movq 0xa8(%rsp), %r8
movq 0x38(%rsp), %rcx
movq 0x28(%rsp), %r9
movq 0x10(%rsp), %r11
movl 0x20(%rsp), %esi
testq %rax, %rax
je 0x167def
movb %r12b, (%rax,%rdx)
movq %rax, 0x38(%rsp)
cmpq $0x1, %r15
jne 0x1679c6
testq %r11, %r11
setne %cl
movl %esi, %edx
notb %dl
movzbl %sil, %eax
xorl %r15d, %r15d
testb $0x1, %al
cmovnel %r15d, %eax
testb %cl, %dl
movq 0x40(%rsp), %rbx
je 0x1677dd
movq 0x90(%rsp), %rdi
movl %esi, %ebp
movq %r9, %rsi
movq 0x98(%rsp), %rdx
callq *0x10(%rsp)
movq 0x10(%rsp), %r11
testl %eax, %eax
setne %r15b
movl %ebp, %eax
jmp 0x1677dd
movq %r9, 0x28(%rsp)
movl %esi, 0x20(%rsp)
leaq 0x60(%rsp), %rdi
movq 0x88(%rsp), %rsi
movq 0xb0(%rsp), %rdx
movq %r10, %r14
callq 0x14b80d
movq %r14, %r8
movq 0x60(%rsp), %rax
movq 0x70(%rsp), %rcx
leaq 0x8(%rax), %rdx
movq %rcx, %rdi
xorl %esi, %esi
subq $0x1, %rdi
jb 0x167a15
addq (%rdx), %rsi
subq -0x8(%rdx), %rsi
addq $0x18, %rdx
jmp 0x167a02
subq %rsi, %r15
jb 0x167e51
movq 0x10(%rsp), %r11
movq 0x28(%rsp), %rdi
jbe 0x167ad5
testq %rcx, %rcx
movq %r8, %r12
cmoveq %rdi, %r12
movq 0x48(%rsp), %rax
cmpq %rax, 0x18(%rsp)
jb 0x167a75
subq $-0x80, %rax
movq %rax, 0x48(%rsp)
imulq $0x30, %rax, %rsi
movq %r13, %rdi
leaq 0x1e244a(%rip), %rdx    # 0x349ea5
movl $0xd9, %ecx
callq 0x93472
movq %r14, %r8
movq 0x28(%rsp), %rdi
movq 0x10(%rsp), %r11
movq %rax, %r13
testq %r13, %r13
je 0x167e82
leaq 0x1(%r8), %rax
movq %r15, -0x29(%r13,%rbx)
movq 0x30(%rsp), %rsi
movq %rsi, -0x21(%r13,%rbx)
movb 0xf(%rsp), %cl
movb %cl, -0x19(%r13,%rbx)
movl 0x59(%rsp), %ecx
movl 0x5c(%rsp), %edx
movl %ecx, -0x18(%r13,%rbx)
movl %edx, -0x15(%r13,%rbx)
movq %rax, -0x11(%r13,%rbx)
movq %r12, -0x9(%r13,%rbx)
movb $0x0, -0x1(%r13,%rbx)
movl 0x52(%rsp), %eax
movl 0x55(%rsp), %ecx
movl %ecx, 0x3(%r13,%rbx)
movl %eax, (%r13,%rbx)
movq 0x60(%rsp), %rax
jmp 0x167adf
movq 0x18(%rsp), %rbp
movq 0x30(%rsp), %rsi
testq %rax, %rax
movq 0x80(%rsp), %rdx
movq 0x40(%rsp), %rbx
je 0x167e20
imulq $0x18, 0x70(%rsp), %rcx
leaq 0x1(%r8), %r9
leaq (%rax,%rcx), %r10
addq $-0x18, %r10
imulq $0x30, %rbp, %r12
addq $0x29, %r12
movq %r9, 0x18(%rsp)
cmpq %rax, %r10
jb 0x167c03
movq %rdi, %rbx
cmovaq %r14, %rbx
movb 0x10(%r10), %al
movb %al, 0xf(%rsp)
cmpb %dl, %al
jae 0x167d2b
movq (%r10), %r15
movq 0x8(%r10), %rax
movq %rax, 0x30(%rsp)
cmpq %rax, %r15
jae 0x167d5c
movq 0x48(%rsp), %rax
cmpq %rax, %rbp
jb 0x167b8c
subq $-0x80, %rax
movq %rax, 0x48(%rsp)
imulq $0x30, %rax, %rsi
movq %r13, %rdi
leaq 0x1e233b(%rip), %rdx    # 0x349ea5
movl $0xf2, %ecx
movq %r10, %r13
callq 0x93472
movq %r13, %r10
movq 0x18(%rsp), %r9
movq 0x28(%rsp), %rdi
movq 0x10(%rsp), %r11
movq %rax, %r13
testq %r13, %r13
je 0x167d8d
incq %rbp
movq %r15, -0x29(%r13,%r12)
movq 0x30(%rsp), %rsi
movq %rsi, -0x21(%r13,%r12)
movb 0xf(%rsp), %al
movb %al, -0x19(%r13,%r12)
movl 0x59(%rsp), %eax
movl 0x5c(%rsp), %ecx
movl %eax, -0x18(%r13,%r12)
movl %ecx, -0x15(%r13,%r12)
movq %r9, -0x11(%r13,%r12)
movq %rbx, -0x9(%r13,%r12)
movb $0x1, -0x1(%r13,%r12)
movl 0x52(%rsp), %eax
movl 0x55(%rsp), %ecx
movl %ecx, 0x3(%r13,%r12)
movl %eax, (%r13,%r12)
movq 0x60(%rsp), %rax
addq $-0x18, %r10
addq $0x30, %r12
movq 0x80(%rsp), %rdx
movq 0x40(%rsp), %rbx
jmp 0x167b14
movq %rsi, 0x30(%rsp)
movl 0x20(%rsp), %ecx
jmp 0x1677d3
leaq 0x1e228d(%rip), %rsi    # 0x349ea5
movq %r13, %rdi
movl $0xf7, %edx
callq 0x936f9
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x167c4e
leaq 0x1e226f(%rip), %rsi    # 0x349ea5
movl $0xf8, %edx
callq 0x936f9
xorps %xmm0, %xmm0
movaps %xmm0, 0x60(%rsp)
andq $0x0, 0x70(%rsp)
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x167c69
leaq 0x1e2246(%rip), %rsi    # 0x349ea5
movl $0xf9, %edx
callq 0x936f9
leaq 0x1e2235(%rip), %rsi    # 0x349ea5
movq 0x88(%rsp), %rdi
movl $0xfa, %edx
callq 0x936f9
movzbl %r15b, %eax
andl $0x1, %eax
negl %eax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x2d02c4(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x17d365(%rip), %rsi    # 0x2e5013
leaq 0x1e2243(%rip), %rdx    # 0x349ef8
leaq 0x1e21fc(%rip), %rcx    # 0x349eb8
leaq 0x1e21e2(%rip), %r8     # 0x349ea5
pushq $0x7d
popq %r9
xorl %eax, %eax
callq 0x17a50
callq 0x17390
movq 0x2d028e(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x17d32f(%rip), %rsi    # 0x2e5013
leaq 0x1e21e4(%rip), %rdx    # 0x349ecf
leaq 0x1e21c6(%rip), %rcx    # 0x349eb8
leaq 0x1e21ac(%rip), %r8     # 0x349ea5
pushq $0x72
jmp 0x167cc5
movq 0x2d0264(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x17d305(%rip), %rsi    # 0x2e5013
leaq 0x1e21f4(%rip), %rdx    # 0x349f09
leaq 0x1e219c(%rip), %rcx    # 0x349eb8
leaq 0x1e2182(%rip), %r8     # 0x349ea5
movl $0x97, %r9d
jmp 0x167cc7
movq 0x2d0236(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x17d2d7(%rip), %rsi    # 0x2e5013
leaq 0x1e229c(%rip), %rdx    # 0x349fdf
leaq 0x1e216e(%rip), %rcx    # 0x349eb8
leaq 0x1e2154(%rip), %r8     # 0x349ea5
movl $0xeb, %r9d
jmp 0x167cc7
movq 0x2d0205(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x17d2a6(%rip), %rsi    # 0x2e5013
leaq 0x1e2292(%rip), %rdx    # 0x34a006
leaq 0x1e213d(%rip), %rcx    # 0x349eb8
leaq 0x1e2123(%rip), %r8     # 0x349ea5
movl $0xee, %r9d
jmp 0x167cc7
movq 0x2d01d4(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x17d275(%rip), %rsi    # 0x2e5013
leaq 0x1e212a(%rip), %rdx    # 0x349ecf
leaq 0x1e210c(%rip), %rcx    # 0x349eb8
leaq 0x1e20f2(%rip), %r8     # 0x349ea5
movl $0xf2, %r9d
jmp 0x167cc7
movq 0x2d01a3(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x17d244(%rip), %rsi    # 0x2e5013
leaq 0x1e2175(%rip), %rdx    # 0x349f4b
leaq 0x1e20db(%rip), %rcx    # 0x349eb8
leaq 0x1e20c1(%rip), %r8     # 0x349ea5
movl $0x9a, %r9d
jmp 0x167cc7
movq 0x2d0172(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x17d213(%rip), %rsi    # 0x2e5013
leaq 0x1e2177(%rip), %rdx    # 0x349f7e
leaq 0x1e20aa(%rip), %rcx    # 0x349eb8
leaq 0x1e2090(%rip), %r8     # 0x349ea5
movl $0xa3, %r9d
jmp 0x167cc7
movq 0x2d0141(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x17d1e2(%rip), %rsi    # 0x2e5013
leaq 0x1e2186(%rip), %rdx    # 0x349fbe
leaq 0x1e2079(%rip), %rcx    # 0x349eb8
leaq 0x1e205f(%rip), %r8     # 0x349ea5
movl $0xdb, %r9d
jmp 0x167cc7
movq 0x2d0110(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x17d1b1(%rip), %rsi    # 0x2e5013
leaq 0x1e2136(%rip), %rdx    # 0x349f9f
leaq 0x1e2048(%rip), %rcx    # 0x349eb8
leaq 0x1e202e(%rip), %r8     # 0x349ea5
movl $0xc9, %r9d
jmp 0x167cc7
movq 0x2d00df(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x17d180(%rip), %rsi    # 0x2e5013
leaq 0x1e2035(%rip), %rdx    # 0x349ecf
leaq 0x1e2017(%rip), %rcx    # 0x349eb8
leaq 0x1e1ffd(%rip), %r8     # 0x349ea5
movl $0xd9, %r9d
jmp 0x167cc7
nop