// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/match/rdj-strgraph.c
// Function: gt_strgraph_reddepaths
GtUword gt_strgraph_reddepaths(GtStrgraph *strgraph,
    GtUword maxdepth, bool show_progressbar)
{
  GtStrgraphVnum i, from, to;
  GtStrgraphVEdgenum j, from_to;
  GtUword depth, d;
  GtUword counter = 0, nofdepaths = 0;
  GtUint64 progress = 0;
  bool i_branching;
  GtStrgraphEdgeID *edges;

  gt_assert(strgraph != NULL);

  edges = gt_malloc(sizeof (GtStrgraphEdgeID) * (maxdepth + 1));

  if (show_progressbar)
    gt_progressbar_start(&progress,
        (GtUint64)GT_STRGRAPH_NOFVERTICES(strgraph));

  for (i = 0; i < GT_STRGRAPH_NOFVERTICES(strgraph); i++)
  {
    if (GT_STRGRAPH_V_OUTDEG(strgraph, i) > 0)
    {
      if (GT_STRGRAPH_V_IS_INTERNAL(strgraph, i))
        continue;
      i_branching =
        (GT_STRGRAPH_V_OUTDEG(strgraph, i) > (GtStrgraphVEdgenum)1 &&
         GT_STRGRAPH_V_INDEG(strgraph, i) > 0) ||
        (GT_STRGRAPH_V_OUTDEG(strgraph, i) == (GtStrgraphVEdgenum)1 &&
         GT_STRGRAPH_V_INDEG(strgraph, i) > (GtStrgraphVEdgenum)1);
      for (j = 0; j < GT_STRGRAPH_V_NOFEDGES(strgraph, i); j++)
      {
        if (!GT_STRGRAPH_EDGE_IS_REDUCED(strgraph, i, j) &&
            !GT_STRGRAPH_EDGE_HAS_MARK(strgraph, i, j))
        {
          from = i;
          from_to = j;
          to = GT_STRGRAPH_EDGE_DEST(strgraph, from, from_to);
          edges->vnum = from;
          edges->edgenum = from_to;
          depth = 1UL;
          while (GT_STRGRAPH_V_IS_INTERNAL(strgraph, to) &&
              depth <= maxdepth)
          {
            depth++;
            from = to;
            from_to = gt_strgraph_find_only_edge(strgraph, from);
            to = GT_STRGRAPH_EDGE_DEST(strgraph, from, from_to);
            gt_assert(depth >= 1UL);
            gt_assert(depth - 1UL <= maxdepth);
            edges[depth - 1UL].vnum = from;
            edges[depth - 1UL].edgenum = from_to;
          }
          if (depth <= maxdepth &&
              (!i_branching || GT_STRGRAPH_V_OUTDEG(strgraph, to) == 0))
          {
            nofdepaths++;
            for (d = 0; d < depth; d++)
            {
              GT_STRGRAPH_EDGE_SET_MARK(strgraph, edges[d].vnum,
                  edges[d].edgenum);
            }
          }
        }
      }
    }
    if (show_progressbar)
      progress++;
  }
  gt_free(edges);
  counter = gt_strgraph_reduce_marked_edges(strgraph);
  if (show_progressbar)
    gt_progressbar_stop();
  gt_log_log("dead-paths = "GT_WU"", nofdepaths);
  gt_log_log("dead-path edges = "GT_WU"", counter);
#ifndef NDEBUG
  gt_strgraph_check_outdegs(strgraph);
#endif
  return counter;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
andq $0x0, 0x30(%rsp)
testq %rdi, %rdi
je 0x183066
movl %edx, %ebx
movq %rsi, %rbp
movq %rdi, %r12
movq %rsi, %rdi
shlq $0x4, %rdi
addq $0x10, %rdi
leaq 0x1ccbe7(%rip), %rsi    # 0x34f775
movl $0x479, %edx            # imm = 0x479
callq 0x93160
movq %rax, 0x8(%rsp)
testb %bl, %bl
je 0x182bb3
movq 0x80(%r12), %rsi
leaq 0x30(%rsp), %rdi
callq 0x9c79c
movq 0x8(%rsp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x38(%rsp)
addq $0x18, %rax
movq %rax, 0x40(%rsp)
movq $0x0, 0x20(%rsp)
xorl %eax, %eax
movq %r12, 0x18(%rsp)
movl %ebx, 0x4(%rsp)
movq %rbp, 0x50(%rsp)
cmpq 0x80(%r12), %rax
jae 0x182fc3
movq %rax, %rbx
movq 0x70(%r12), %rdi
movq %rax, %rsi
callq 0x17ffcd
testq %rax, %rax
je 0x182fab
movq 0x70(%r12), %rdi
movq %rbx, %rsi
callq 0x17ffcd
cmpq $0x1, %rax
jne 0x182c44
movq 0x70(%r12), %rdi
movl %ebx, %esi
andl $0x1, %esi
negq %rsi
orq $0x1, %rsi
addq %rbx, %rsi
callq 0x17ffcd
cmpq $0x1, %rax
jne 0x182c44
movq %rbx, %rax
jmp 0x182fbb
movq 0x70(%r12), %rdi
movq %rbx, %rsi
callq 0x17ffcd
cmpq $0x2, %rax
jb 0x182c7a
movq 0x70(%r12), %rdi
movl %ebx, %esi
andl $0x1, %esi
negq %rsi
orq $0x1, %rsi
addq %rbx, %rsi
callq 0x17ffcd
movb $0x1, %cl
movl %ecx, (%rsp)
testq %rax, %rax
jne 0x182cb9
movq 0x70(%r12), %rdi
movq %rbx, %rsi
callq 0x17ffcd
cmpq $0x1, %rax
jne 0x182cb2
movq 0x70(%r12), %rdi
movl %ebx, %esi
andl $0x1, %esi
negq %rsi
orq $0x1, %rsi
addq %rbx, %rsi
callq 0x17ffcd
cmpq $0x2, %rax
setae %al
movl %eax, (%rsp)
jmp 0x182cb9
movl $0x0, (%rsp)
leaq 0x1(%rbx), %rax
movq %rax, 0x48(%rsp)
xorl %r13d, %r13d
movq %rbx, 0x10(%rsp)
movq 0x60(%r12), %rdi
movq 0x48(%rsp), %rsi
callq 0x17ffcd
movq %rax, %r14
movq 0x60(%r12), %rdi
movq %rbx, %rsi
callq 0x17ffcd
subq %rax, %r14
cmpq %r14, %r13
jae 0x182fab
movq 0x60(%r12), %rdi
movq 0x88(%r12), %r14
movq %rbx, %rsi
callq 0x17ffcd
leaq (%rax,%r13), %rsi
movq %r14, %rdi
callq 0x17ffcd
movq %rax, %r14
movq 0x90(%r12), %rdi
callq 0x28a939
pushq $-0x1
popq %rdx
movl %eax, %ecx
shll %cl, %edx
notl %edx
addl %edx, %edx
movslq %edx, %rax
andq %r14, %rax
shrq %rax
cmpq 0x90(%r12), %rax
je 0x182fa3
movq 0x60(%r12), %rdi
movq 0x88(%r12), %r14
movq %rbx, %rsi
callq 0x17ffcd
leaq (%rax,%r13), %rsi
movq %r14, %rdi
callq 0x17ffcd
testb $0x1, %al
jne 0x182fa3
movq 0x60(%r12), %rdi
movq 0x88(%r12), %r14
movq %rbx, %rsi
callq 0x17ffcd
leaq (%rax,%r13), %rsi
movq %r14, %rdi
callq 0x17ffcd
movq %rax, %r14
movq 0x80(%r12), %rdi
callq 0x28a939
movq %rbx, %r15
pushq $-0x1
popq %rbx
movl %eax, %ecx
shll %cl, %ebx
notl %ebx
movq 0x90(%r12), %rdi
callq 0x28a939
leal 0x1(%rax), %ecx
shll %cl, %ebx
movslq %ebx, %rbx
andq %r14, %rbx
movq 0x90(%r12), %rdi
callq 0x28a939
leal 0x1(%rax), %ecx
shrq %cl, %rbx
movq 0x8(%rsp), %rax
movq %r15, (%rax)
movq %rbx, %r15
movq %r13, 0x8(%rax)
movq 0x40(%rsp), %r14
pushq $0x1
popq %rbx
movq %r13, 0x28(%rsp)
movq 0x70(%r12), %rdi
movq %r15, %rsi
callq 0x17ffcd
cmpq $0x1, %rax
jne 0x182f02
movq 0x70(%r12), %rdi
movl %r15d, %esi
andl $0x1, %esi
negq %rsi
orq $0x1, %rsi
addq %r15, %rsi
callq 0x17ffcd
cmpq $0x1, %rax
jne 0x182f02
cmpq %rbp, %rbx
ja 0x182f02
movq %r12, %rdi
movq %r15, %rsi
callq 0x183094
movq %rax, %r13
movq 0x60(%r12), %rdi
movq %rbx, %rbp
movq %r14, %rbx
movq 0x88(%r12), %r14
movq %r15, %rsi
callq 0x17ffcd
movq %r13, 0x60(%rsp)
leaq (%rax,%r13), %rsi
movq %r14, %rdi
callq 0x17ffcd
movq %r15, 0x58(%rsp)
movq %rax, %r15
movq 0x80(%r12), %rdi
callq 0x28a939
movl %eax, %r14d
movq 0x90(%r12), %rdi
callq 0x28a939
movl %eax, %r13d
movq 0x90(%r12), %rdi
callq 0x28a939
incq %rbp
je 0x18302e
movq %rbp, %rsi
pushq $-0x1
popq %rdx
movl %r14d, %ecx
shll %cl, %edx
notl %edx
incb %r13b
movl %r13d, %ecx
shll %cl, %edx
movslq %edx, %rcx
andq %rcx, %r15
incb %al
movl %eax, %ecx
shrq %cl, %r15
movq 0x58(%rsp), %rax
movq %rax, -0x8(%rbx)
movq 0x60(%rsp), %rax
movq %rax, (%rbx)
addq $0x10, %rbx
movq 0x18(%rsp), %r12
movq 0x50(%rsp), %rbp
movq 0x28(%rsp), %r13
movq %rbx, %r14
movq %rsi, %rbx
jmp 0x182df5
cmpq %rbp, %rbx
ja 0x182f1f
cmpb $0x0, (%rsp)
je 0x182f26
movq 0x70(%r12), %rdi
movq %r15, %rsi
callq 0x17ffcd
testq %rax, %rax
je 0x182f26
movq 0x10(%rsp), %rbx
jmp 0x182fa3
movq 0x38(%rsp), %r13
subq $0x1, %rbx
jb 0x182f94
movq 0x60(%r12), %rdi
movq 0x88(%r12), %r14
movq -0x8(%r13), %rsi
callq 0x17ffcd
movq %rax, %r15
addq (%r13), %r15
movq 0x60(%r12), %rdi
movq 0x18(%rsp), %rax
movq 0x88(%rax), %r12
movq -0x8(%r13), %rsi
callq 0x17ffcd
addq (%r13), %rax
movq %r12, %rdi
movq 0x18(%rsp), %r12
movq %rax, %rsi
callq 0x17ffcd
orq $0x1, %rax
movq %r14, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x180026
addq $0x10, %r13
jmp 0x182f2b
incq 0x20(%rsp)
movq 0x10(%rsp), %rbx
movq 0x28(%rsp), %r13
incq %r13
jmp 0x182cca
movq %rbx, %rax
movl 0x4(%rsp), %ebx
testb %bl, %bl
je 0x182fbb
incq 0x30(%rsp)
incq %rax
jmp 0x182be3
leaq 0x1cc7ab(%rip), %rsi    # 0x34f775
movq 0x8(%rsp), %rdi
movl $0x4b1, %edx            # imm = 0x4B1
callq 0x936f9
movq %r12, %rdi
callq 0x1825cd
movq %rax, %r14
cmpb $0x0, 0x4(%rsp)
je 0x182ff0
callq 0x9cce9
leaq 0x1ccd81(%rip), %rdi    # 0x34fd78
movq 0x20(%rsp), %rsi
xorl %eax, %eax
callq 0x92a82
leaq 0x1ccd7f(%rip), %rdi    # 0x34fd89
movq %r14, %rsi
xorl %eax, %eax
callq 0x92a82
movq %r12, %rdi
callq 0x181ac4
movq %r14, %rax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x2b4f33(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x161fd4(%rip), %rsi    # 0x2e5013
leaq 0x1ccd25(%rip), %rdx    # 0x34fd6b
leaq 0x1ccd07(%rip), %rcx    # 0x34fd54
leaq 0x1cc721(%rip), %r8     # 0x34f775
movl $0x49c, %r9d            # imm = 0x49C
xorl %eax, %eax
callq 0x17a50
callq 0x17390
movq 0x2b4efb(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x161f9c(%rip), %rsi    # 0x2e5013
leaq 0x1cc7bb(%rip), %rdx    # 0x34f839
leaq 0x1ccccf(%rip), %rcx    # 0x34fd54
leaq 0x1cc6e9(%rip), %r8     # 0x34f775
movl $0x477, %r9d            # imm = 0x477
jmp 0x18305a