// File: /workspace/github_c_makefile_star2_O3/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, 0x18(%rsp)
movq %r8, %r12
movq %rcx, 0x88(%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 0x1f1212(%rip), %r13    # 0x3a9af8
movq %r13, %rsi
movl $0x66, %edx
callq 0x104226
movq %rax, 0x60(%rsp)
movq $0x0, 0x70(%rsp)
movq %r14, 0x68(%rsp)
movl $0x1800, %esi           # imm = 0x1800
xorl %edi, %edi
movq %r13, %rdx
movl $0x72, %ecx
callq 0x104461
testq %rax, %rax
je 0x1b8eb8
incq %rbx
movq $0x0, (%rax)
movq %rbx, 0x40(%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 0x1f11a0(%rip), %rsi    # 0x3a9af8
movl $0x73, %edx
callq 0x104226
movq %rbx, %rdi
movq %rax, 0x80(%rsp)
movb $0x1, %cl
movl $0x80, %ebx
movl $0x1, %esi
movq $0x0, 0x20(%rsp)
xorl %ebp, %ebp
movq %r15, 0x90(%rsp)
movl %r15d, %r13d
movq %r12, 0x78(%rsp)
movq 0x18(%rsp), %rdx
movb %r13b, 0x3(%rsp)
leaq -0x1(%rsi), %rax
movq %rax, 0x8(%rsp)
leaq (%rax,%rax,2), %r15
shlq $0x4, %r15
movq (%rdi,%r15), %r11
movq 0x18(%rdi,%r15), %r9
movq 0x20(%rdi,%r15), %rax
movq %rax, 0x48(%rsp)
testb $0x1, 0x28(%rdi,%r15)
movq %rdi, 0x38(%rsp)
je 0x1b8a7e
movq 0x8(%rdi,%r15), %r8
movq %r8, %r14
subq %r11, %r14
jbe 0x1b8e9a
testq %r9, %r9
movq 0x90(%rsp), %rax
movq %r9, 0x30(%rsp)
je 0x1b8b0d
movb 0x10(%rdi,%r15), %r13b
cmpb %al, %r13b
jae 0x1b8e9f
leaq -0x1(%r9), %r12
cmpq %rbp, %r12
movq 0x20(%rsp), %rax
jb 0x1b8a62
addq $0x20, %rbp
movq %rbp, 0x28(%rsp)
movq %rax, %rdi
movq %rsi, 0x10(%rsp)
movq %rbp, %rsi
movl %ecx, 0x4(%rsp)
leaq 0x1f10c3(%rip), %rdx    # 0x3a9af8
movl $0xa1, %ecx
movq %r11, 0x20(%rsp)
movq %r8, %rbp
callq 0x104461
movq %rbp, %r8
movq 0x20(%rsp), %r11
movq 0x10(%rsp), %rsi
movq 0x28(%rsp), %rbp
movl 0x4(%rsp), %ecx
movq 0x38(%rsp), %rdi
testq %rax, %rax
je 0x1b8ea4
movb %r13b, (%rax,%r12)
movq 0x18(%rsp), %rdx
movq 0x78(%rsp), %r12
jmp 0x1b8b12
testq %r9, %r9
je 0x1b8e95
xorl %eax, %eax
movq 0x88(%rsp), %r15
testq %r15, %r15
je 0x1b8dde
testq %r11, %r11
je 0x1b8dde
movq %rbx, 0x10(%rsp)
decq %r9
xorl %ebx, %ebx
testb $0x1, %cl
je 0x1b8ab6
xorl %ecx, %ecx
jmp 0x1b8af4
testq %rbx, %rbx
movq %r9, %rsi
cmoveq 0x48(%rsp), %rsi
movq %r12, %rdi
movl %ecx, 0x4(%rsp)
movq %rdx, %r13
movq %r9, %r14
movq %r11, %r12
callq *%r15
movq %r12, %r11
movq %r14, %r9
movq %r13, %rdx
movq 0x78(%rsp), %r12
movl 0x4(%rsp), %ecx
movq 0x38(%rsp), %rdi
testl %eax, %eax
jne 0x1b8dfc
incq %rbx
cmpq %rbx, %r11
jne 0x1b8aad
xorl %eax, %eax
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rbx
jmp 0x1b8de3
movq 0x20(%rsp), %rax
movq %rax, 0x20(%rsp)
cmpq $0x1, %r14
jne 0x1b8b2b
xorl %eax, %eax
testb $0x1, %cl
je 0x1b8b93
xorl %ecx, %ecx
jmp 0x1b8dde
movq %rsi, 0x10(%rsp)
movq %rbp, 0x28(%rsp)
movl %ecx, 0x4(%rsp)
leaq 0x60(%rsp), %rdi
movq 0x80(%rsp), %rsi
movq 0xa0(%rsp), %rdx
movq %r11, %rcx
callq 0x1a00a9
movq 0x60(%rsp), %rax
movq 0x70(%rsp), %rcx
testq %rcx, %rcx
je 0x1b8bca
leaq 0x8(%rax), %rsi
movq %rcx, %rdi
xorl %r8d, %r8d
movq 0x30(%rsp), %r9
addq (%rsi), %r8
subq -0x8(%rsi), %r8
addq $0x18, %rsi
decq %rdi
jne 0x1b8b74
cmpq %r14, %r8
movq 0x18(%rsp), %rdx
jbe 0x1b8bd7
jmp 0x1b8eae
movq 0x88(%rsp), %r15
testq %r15, %r15
je 0x1b8ddc
movq %r12, %rdi
movq 0x48(%rsp), %rsi
movl %ecx, %r14d
movq %rdx, %r13
callq *%r15
movq %r13, %rdx
movl %r14d, %ecx
movq 0x38(%rsp), %rdi
testl %eax, %eax
setne %al
jmp 0x1b8dde
xorl %r8d, %r8d
movq 0x18(%rsp), %rdx
movq 0x30(%rsp), %r9
subq %r8, %r14
movq 0x38(%rsp), %rdi
jbe 0x1b8c9a
movq %r14, 0x98(%rsp)
testq %rcx, %rcx
movq %r9, %r14
cmoveq 0x48(%rsp), %r14
cmpq %rbx, 0x8(%rsp)
movb 0x3(%rsp), %r13b
jb 0x1b8c32
subq $-0x80, %rbx
movq %rbx, %rax
shlq $0x4, %rax
leaq (%rax,%rax,2), %rsi
leaq 0x1f0edd(%rip), %rdx    # 0x3a9af8
movl $0xd9, %ecx
callq 0x104461
movq 0x30(%rsp), %r9
movq 0x18(%rsp), %rdx
movq %rax, %rdi
testq %rdi, %rdi
je 0x1b8eb3
leaq 0x1(%r9), %rax
movq 0x98(%rsp), %rcx
movq %rcx, (%rdi,%r15)
movq 0x40(%rsp), %rcx
movq %rcx, 0x8(%rdi,%r15)
movb %r13b, 0x10(%rdi,%r15)
movl 0x59(%rsp), %ecx
movl 0x5c(%rsp), %esi
movl %ecx, 0x11(%rdi,%r15)
movl %esi, 0x14(%rdi,%r15)
movq %rax, 0x18(%rdi,%r15)
movq %r14, 0x20(%rdi,%r15)
movb $0x0, 0x28(%rdi,%r15)
movl 0x52(%rsp), %eax
movl 0x55(%rsp), %ecx
movl %ecx, 0x2c(%rdi,%r15)
movl %eax, 0x29(%rdi,%r15)
movq 0x60(%rsp), %rax
movq 0x10(%rsp), %rsi
jmp 0x1b8ca4
movq 0x8(%rsp), %rsi
movb 0x3(%rsp), %r13b
testq %rax, %rax
je 0x1b8ea9
movq 0x70(%rsp), %rcx
leaq (%rcx,%rcx,2), %rcx
leaq (%rax,%rcx,8), %r14
addq $-0x18, %r14
cmpq %rax, %r14
jae 0x1b8cca
xorl %eax, %eax
jmp 0x1b8dd1
leaq 0x1(%r9), %r8
leaq (%rsi,%rsi,2), %r15
shlq $0x4, %r15
addq $0x29, %r15
cmpq %rax, %r14
movq 0x48(%rsp), %rbp
cmovaq %r9, %rbp
movb 0x10(%r14), %r13b
cmpb 0x90(%rsp), %r13b
jae 0x1b8e86
movq (%r14), %r12
movq 0x8(%r14), %rax
cmpq %rax, %r12
jae 0x1b8e8b
cmpq %rbx, %rsi
jb 0x1b8d59
subq $-0x80, %rbx
movb %r13b, 0x3(%rsp)
movq %rax, 0x40(%rsp)
movq %rbx, %rax
shlq $0x4, %rax
movq %rsi, 0x10(%rsp)
leaq (%rax,%rax,2), %rsi
leaq 0x1f0dc6(%rip), %rdx    # 0x3a9af8
movl $0xf2, %ecx
movq %r8, %r13
callq 0x104461
movq %r13, %r8
movq 0x30(%rsp), %r9
movq 0x10(%rsp), %rsi
movq %rax, %rdi
movq 0x40(%rsp), %rax
movb 0x3(%rsp), %r13b
testq %rdi, %rdi
je 0x1b8e90
incq %rsi
movq %r12, -0x29(%rdi,%r15)
movq %rax, -0x21(%rdi,%r15)
movb %r13b, -0x19(%rdi,%r15)
movq %rax, %rdx
movl 0x59(%rsp), %eax
movl 0x5c(%rsp), %ecx
movl %eax, -0x18(%rdi,%r15)
movl %ecx, -0x15(%rdi,%r15)
movq %r8, -0x11(%rdi,%r15)
movq %rbp, -0x9(%rdi,%r15)
movb $0x1, -0x1(%rdi,%r15)
movl 0x52(%rsp), %eax
movl 0x55(%rsp), %ecx
movl %ecx, 0x3(%rdi,%r15)
movl %eax, (%rdi,%r15)
addq $-0x18, %r14
movq 0x60(%rsp), %rax
addq $0x30, %r15
cmpq %rax, %r14
jae 0x1b8cda
movq %rdx, 0x40(%rsp)
xorl %eax, %eax
movq 0x18(%rsp), %rdx
movq 0x78(%rsp), %r12
movl 0x4(%rsp), %ecx
movq 0x28(%rsp), %rbp
jmp 0x1b8de8
xorl %eax, %eax
movq 0x8(%rsp), %rsi
movb 0x3(%rsp), %r13b
testb %al, %al
jne 0x1b8df5
testq %rsi, %rsi
jne 0x1b8999
movzbl %al, %ebx
negl %ebx
jmp 0x1b8e01
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
leaq 0x1f0cf0(%rip), %rsi    # 0x3a9af8
movl $0xf7, %edx
callq 0x1045eb
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x1b8e3e
leaq 0x1f0cd5(%rip), %rsi    # 0x3a9af8
movl $0xf8, %edx
callq 0x1045eb
xorps %xmm0, %xmm0
movaps %xmm0, 0x60(%rsp)
movq $0x0, 0x70(%rsp)
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x1b8e59
leaq 0x1f0ca9(%rip), %rsi    # 0x3a9af8
movl $0xf9, %edx
callq 0x1045eb
leaq 0x1f0c98(%rip), %rsi    # 0x3a9af8
movq 0x80(%rsp), %rdi
movl $0xfa, %edx
callq 0x1045eb
movl %ebx, %eax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x67295
callq 0x672ce
callq 0x67307
callq 0x6717a
callq 0x671b1
callq 0x671ea
callq 0x67223
callq 0x67340
callq 0x6725c
callq 0x67379
callq 0x673b2
nopl (%rax)