// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/match/rdj-strgraph.c
// Function: gt_strgraph_redsubmax
GtUword gt_strgraph_redsubmax(GtStrgraph *strgraph, bool show_progressbar)
{
  GtStrgraphVnum i;
  GtStrgraphVEdgenum j;
  GtUword counter = 0;
  GtUint64 progress = 0;

  gt_assert(strgraph != NULL);
  gt_assert(strgraph->state == GT_STRGRAPH_SORTED_BY_L);

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

  for (i = 0; i < GT_STRGRAPH_NOFVERTICES(strgraph); i++)
    GT_STRGRAPH_V_SET_MARK(strgraph, i, GT_STRGRAPH_V_VACANT);

  for (i = 0; i < GT_STRGRAPH_NOFVERTICES(strgraph); i++)
  {
    if (GT_STRGRAPH_V_OUTDEG(strgraph, i) > 0)
    {
      for (j = 0; j < GT_STRGRAPH_V_NOFEDGES(strgraph, i); j++)
      {
        if (GT_STRGRAPH_EDGE_IS_REDUCED(strgraph, i, j))
          continue;
        if (GT_STRGRAPH_V_MARK(strgraph, GT_STRGRAPH_EDGE_DEST(strgraph, i, j))
              == GT_STRGRAPH_V_INPLAY)
        {
          counter++;
          GT_STRGRAPH_EDGE_REDUCE(strgraph, i, j);
          GT_STRGRAPH_V_DEC_OUTDEG(strgraph, i);
        }
        GT_STRGRAPH_V_SET_MARK(strgraph, i, GT_STRGRAPH_V_INPLAY);
      }
      for (j = 0; j < GT_STRGRAPH_V_NOFEDGES(strgraph, i); j++)
      {
        GT_STRGRAPH_V_SET_MARK(strgraph, GT_STRGRAPH_EDGE_DEST(strgraph, i, j),
            GT_STRGRAPH_V_VACANT);
      }
    }
    if (show_progressbar)
      progress++;
  }
  if (show_progressbar)
    gt_progressbar_stop();
  gt_log_log("submaximal counter: "GT_WU"", counter);
  /* nonmax spm shoud be found twice, check number is even */
  gt_assert((counter & 1) == 0);
#ifndef NDEBUG
  gt_strgraph_check_outdegs(strgraph);
#endif
  return (counter >> 1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %esi, 0x4(%rsp)
andq $0x0, 0x20(%rsp)
testq %rdi, %rdi
je 0x182ac3
movq %rdi, %rbx
cmpl $0x2, 0x10(%rdi)
jne 0x182af1
cmpb $0x0, 0x4(%rsp)
je 0x1827b7
movq 0x80(%rbx), %rsi
leaq 0x20(%rsp), %rdi
callq 0x9c79c
xorl %r14d, %r14d
movq 0x80(%rbx), %rax
cmpq %rax, %r14
jae 0x1827d9
movq 0x58(%rbx), %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x180026
incq %r14
jmp 0x1827ba
xorl %r15d, %r15d
pushq $-0x1
popq %r14
movq $0x0, 0x10(%rsp)
cmpq %rax, %r15
jae 0x182a7e
movq 0x70(%rbx), %rdi
movq %r15, %rsi
callq 0x17ffcd
testq %rax, %rax
je 0x182a63
leaq 0x1(%r15), %rax
movq %rax, 0x18(%rsp)
xorl %r13d, %r13d
movq 0x60(%rbx), %rdi
movq 0x18(%rsp), %rsi
callq 0x17ffcd
movq %rax, %r12
movq 0x60(%rbx), %rdi
movq %r15, %rsi
callq 0x17ffcd
subq %rax, %r12
cmpq %r12, %r13
jae 0x1829ba
movq 0x60(%rbx), %rdi
movq 0x88(%rbx), %r12
movq %r15, %rsi
callq 0x17ffcd
leaq (%rax,%r13), %rsi
movq %r12, %rdi
callq 0x17ffcd
movq %rax, %r12
movq 0x90(%rbx), %rdi
callq 0x28a939
movl %r14d, %edx
movl %eax, %ecx
shll %cl, %edx
notl %edx
addl %edx, %edx
movslq %edx, %rax
andq %r12, %rax
shrq %rax
cmpq 0x90(%rbx), %rax
je 0x1829b2
movq 0x88(%rbx), %r12
movq 0x58(%rbx), %rax
movq %rax, 0x8(%rsp)
movq 0x60(%rbx), %rdi
movq %r15, %rsi
callq 0x17ffcd
leaq (%rax,%r13), %rsi
movq %r12, %rdi
callq 0x17ffcd
movq %rax, %r12
movq 0x80(%rbx), %rdi
callq 0x28a939
movl %r14d, %ebp
movl %eax, %ecx
shll %cl, %r14d
notl %r14d
movq 0x90(%rbx), %rdi
callq 0x28a939
leal 0x1(%rax), %ecx
shll %cl, %r14d
movslq %r14d, %r14
andq %r12, %r14
movq 0x90(%rbx), %rdi
callq 0x28a939
leal 0x1(%rax), %ecx
shrq %cl, %r14
movq 0x8(%rsp), %rdi
movq %r14, %rsi
callq 0x17ffcd
cmpl $0x1, %eax
jne 0x18299f
incq 0x10(%rsp)
movq 0x60(%rbx), %rdi
movq 0x88(%rbx), %rax
movq %rax, 0x8(%rsp)
movq %r15, %rsi
callq 0x17ffcd
leaq (%rax,%r13), %r12
movq 0x90(%rbx), %rdi
callq 0x28a939
movl %eax, %ecx
shll %cl, %ebp
notl %ebp
addl %ebp, %ebp
notl %ebp
movslq %ebp, %rbp
movq 0x60(%rbx), %rdi
movq 0x88(%rbx), %r14
movq %r15, %rsi
callq 0x17ffcd
leaq (%rax,%r13), %rsi
movq %r14, %rdi
callq 0x17ffcd
andq %rbp, %rax
movq 0x90(%rbx), %rcx
leaq (%rax,%rcx,2), %rdx
movq 0x8(%rsp), %rdi
movq %r12, %rsi
callq 0x180026
movq 0x70(%rbx), %r14
movq %r14, %rdi
movq %r15, %rsi
callq 0x17ffcd
leaq -0x1(%rax), %rdx
movq %r14, %rdi
movq %r15, %rsi
callq 0x180026
movq 0x58(%rbx), %rdi
movq %r15, %rsi
pushq $0x1
popq %rdx
callq 0x180026
pushq $-0x1
popq %r14
incq %r13
jmp 0x182813
xorl %r13d, %r13d
movq 0x60(%rbx), %rdi
movq 0x18(%rsp), %rsi
callq 0x17ffcd
movq %rax, %r14
movq 0x60(%rbx), %rdi
movq %r15, %rsi
callq 0x17ffcd
subq %rax, %r14
cmpq %r14, %r13
jae 0x182a5f
movq 0x88(%rbx), %r14
movq 0x58(%rbx), %rbp
movq 0x60(%rbx), %rdi
movq %r15, %rsi
callq 0x17ffcd
leaq (%rax,%r13), %rsi
movq %r14, %rdi
callq 0x17ffcd
movq %rax, %r14
movq 0x80(%rbx), %rdi
callq 0x28a939
pushq $-0x1
popq %r12
movl %eax, %ecx
shll %cl, %r12d
notl %r12d
movq 0x90(%rbx), %rdi
callq 0x28a939
leal 0x1(%rax), %ecx
shll %cl, %r12d
movslq %r12d, %r12
andq %r14, %r12
movq 0x90(%rbx), %rdi
callq 0x28a939
leal 0x1(%rax), %ecx
shrq %cl, %r12
movq %rbp, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x180026
incq %r13
jmp 0x1829bd
pushq $-0x1
popq %r14
cmpb $0x0, 0x4(%rsp)
je 0x182a6f
incq 0x20(%rsp)
incq %r15
movq 0x80(%rbx), %rax
jmp 0x1827e9
cmpb $0x0, 0x4(%rsp)
je 0x182a8a
callq 0x9cce9
leaq 0x1cd2ab(%rip), %rdi    # 0x34fd3c
movq 0x10(%rsp), %r14
movq %r14, %rsi
xorl %eax, %eax
callq 0x92a82
testb $0x1, %r14b
jne 0x182b1f
movq %rbx, %rdi
callq 0x181ac4
shrq %r14
movq %r14, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x2b549e(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x16253f(%rip), %rsi    # 0x2e5013
leaq 0x1ccd5e(%rip), %rdx    # 0x34f839
leaq 0x1cd244(%rip), %rcx    # 0x34fd26
leaq 0x1ccc8c(%rip), %r8     # 0x34f775
movl $0x42a, %r9d            # imm = 0x42A
jmp 0x182b4b
movq 0x2b5470(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x162511(%rip), %rsi    # 0x2e5013
leaq 0x1cd1da(%rip), %rdx    # 0x34fce3
leaq 0x1cd216(%rip), %rcx    # 0x34fd26
leaq 0x1ccc5e(%rip), %r8     # 0x34f775
movl $0x42b, %r9d            # imm = 0x42B
jmp 0x182b4b
movq 0x2b5442(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1624e3(%rip), %rsi    # 0x2e5013
leaq 0x1cd152(%rip), %rdx    # 0x34fc89
leaq 0x1cd1e8(%rip), %rcx    # 0x34fd26
leaq 0x1ccc30(%rip), %r8     # 0x34f775
movl $0x452, %r9d            # imm = 0x452
xorl %eax, %eax
callq 0x17a50
callq 0x17390