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

  gt_assert(strgraph != NULL);

  counter = 0;
  if (show_progressbar)
    gt_progressbar_start(&(progress),
        (GtUint64)GT_STRGRAPH_NOFVERTICES(strgraph));
  for (vnum = 0; vnum < GT_STRGRAPH_NOFVERTICES(strgraph); vnum++)
  {
    if (GT_STRGRAPH_V_OUTDEG(strgraph, vnum) > 0)
    {
      for (edgenum = 0; edgenum < GT_STRGRAPH_V_NOFEDGES(strgraph, vnum);
          edgenum++)
      {
        if (!GT_STRGRAPH_EDGE_IS_REDUCED(strgraph, vnum, edgenum) &&
            GT_STRGRAPH_EDGE_DEST(strgraph, vnum, edgenum) == vnum)
        {
          counter++;
          GT_STRGRAPH_EDGE_REDUCE(strgraph, vnum, edgenum);
          GT_STRGRAPH_V_DEC_OUTDEG(strgraph, vnum);
        }
      }
    }
    if (show_progressbar)
      progress++;
  }
  if (show_progressbar)
    gt_progressbar_stop();

  gt_log_log("self-matches counter: "GT_WU"", counter);
  /* self matches 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 $0x38, %rsp
andq $0x0, 0x20(%rsp)
testq %rdi, %rdi
je 0x181a5e
movl %esi, %ebp
movq %rdi, %rbx
testb %bpl, %bpl
je 0x181831
movq 0x80(%rbx), %rsi
leaq 0x20(%rsp), %rdi
callq 0x9c79c
xorl %r15d, %r15d
pushq $-0x1
popq %r14
movq $0x0, 0x10(%rsp)
movl %ebp, 0xc(%rsp)
cmpq 0x80(%rbx), %r15
jae 0x181a1b
movq 0x70(%rbx), %rdi
movq %r15, %rsi
callq 0x17ffcd
testq %rax, %rax
je 0x181a09
leaq 0x1(%r15), %rbp
xorl %r12d, %r12d
movq %rbp, 0x18(%rsp)
movq 0x60(%rbx), %rdi
movq %rbp, %rsi
callq 0x17ffcd
movq %rax, %r13
movq 0x60(%rbx), %rdi
movq %r15, %rsi
callq 0x17ffcd
subq %rax, %r13
cmpq %r13, %r12
jae 0x181a05
movq 0x60(%rbx), %rdi
movq 0x88(%rbx), %r13
movq %r15, %rsi
callq 0x17ffcd
leaq (%rax,%r12), %rsi
movq %r13, %rdi
callq 0x17ffcd
movq %rax, %r13
movq 0x90(%rbx), %rdi
callq 0x28a939
movl %r14d, %edx
movl %eax, %ecx
shll %cl, %edx
notl %edx
addl %edx, %edx
movslq %edx, %rax
andq %r13, %rax
shrq %rax
cmpq 0x90(%rbx), %rax
je 0x1819fd
movq 0x60(%rbx), %rdi
movq 0x88(%rbx), %r13
movq %r15, %rsi
callq 0x17ffcd
leaq (%rax,%r12), %rsi
movq %r13, %rdi
callq 0x17ffcd
movq %rax, %r13
movq 0x80(%rbx), %rdi
callq 0x28a939
movl %r14d, %ebp
movl %eax, %ecx
shll %cl, %ebp
notl %ebp
movq 0x90(%rbx), %rdi
callq 0x28a939
leal 0x1(%rax), %ecx
shll %cl, %ebp
movslq %ebp, %r14
andq %r13, %r14
movq 0x90(%rbx), %rdi
callq 0x28a939
leal 0x1(%rax), %ecx
shrq %cl, %r14
cmpq %r15, %r14
jne 0x1819f4
incq 0x10(%rsp)
movq 0x60(%rbx), %rdi
movq 0x88(%rbx), %rax
movq %rax, 0x30(%rsp)
movq %r15, %rsi
callq 0x17ffcd
addq %r12, %rax
movq %rax, 0x28(%rsp)
movq 0x90(%rbx), %rdi
callq 0x28a939
pushq $-0x1
popq %rbp
movl %ebp, %edx
movl %eax, %ecx
shll %cl, %edx
notl %edx
addl %edx, %edx
notl %edx
movslq %edx, %r13
movq 0x60(%rbx), %rdi
movq 0x88(%rbx), %r14
movq %r15, %rsi
callq 0x17ffcd
leaq (%rax,%r12), %rsi
movq %r14, %rdi
callq 0x17ffcd
andq %r13, %rax
movq 0x90(%rbx), %rcx
leaq (%rax,%rcx,2), %rdx
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %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
movl %ebp, %r14d
jmp 0x1819f8
pushq $-0x1
popq %r14
movq 0x18(%rsp), %rbp
incq %r12
jmp 0x181873
movl 0xc(%rsp), %ebp
testb %bpl, %bpl
je 0x181a13
incq 0x20(%rsp)
incq %r15
jmp 0x181845
testb %bpl, %bpl
je 0x181a25
callq 0x9cce9
leaq 0x1ce243(%rip), %rdi    # 0x34fc6f
movq 0x10(%rsp), %r14
movq %r14, %rsi
xorl %eax, %eax
callq 0x92a82
testb $0x1, %r14b
jne 0x181a8c
movq %rbx, %rdi
callq 0x181ac4
shrq %r14
movq %r14, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x2b6503(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1635a4(%rip), %rsi    # 0x2e5013
leaq 0x1cddc3(%rip), %rdx    # 0x34f839
leaq 0x1ce1de(%rip), %rcx    # 0x34fc5b
leaq 0x1cdcf1(%rip), %r8     # 0x34f775
movl $0x384, %r9d            # imm = 0x384
jmp 0x181ab8
movq 0x2b64d5(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x163576(%rip), %rsi    # 0x2e5013
leaq 0x1ce1e5(%rip), %rdx    # 0x34fc89
leaq 0x1ce1b0(%rip), %rcx    # 0x34fc5b
leaq 0x1cdcc3(%rip), %r8     # 0x34f775
movl $0x3a2, %r9d            # imm = 0x3A2
xorl %eax, %eax
callq 0x17a50
callq 0x17390