// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/match/rdj-strgraph.c
// Function: gt_strgraph_compact
void gt_strgraph_compact(GtStrgraph *strgraph, bool show_progressbar)
{
  GtStrgraphVnum i;
  GtStrgraphEdgenum old_offset, next_free_edge, new_offset;
  GtStrgraphVEdgenum old_nofedges, j;
  GtUint64 progress = 0;

  gt_assert(strgraph != NULL);

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

  next_free_edge = 0;
  for (i = 0; i < GT_STRGRAPH_NOFVERTICES(strgraph); i++)
  {
    new_offset = next_free_edge;
    old_offset = GT_STRGRAPH_V_OFFSET(strgraph, i);
    old_nofedges = GT_STRGRAPH_V_NOFEDGES(strgraph, i);
    for (j = 0; j < old_nofedges; j++)
    {
      if (!GT_STRGRAPH_EDGE_IS_REDUCED(strgraph, i, j))
      {
        GT_STRGRAPH_COPY_EDGE(strgraph, old_offset + j, next_free_edge);
        next_free_edge++;
      }
    }
    GT_STRGRAPH_V_SET_OFFSET(strgraph, i, new_offset);
    gt_assert(next_free_edge - GT_STRGRAPH_V_OFFSET(strgraph, i) ==
        (GtStrgraphEdgenum)GT_STRGRAPH_V_OUTDEG(strgraph, i));
    if (show_progressbar)
      progress++;
  }
  GT_STRGRAPH_V_SET_OFFSET(strgraph, GT_STRGRAPH_NOFVERTICES(strgraph),
      next_free_edge);
  if (next_free_edge < GT_STRGRAPH_NOFEDGES(strgraph))
  {
    GT_STRGRAPH_SHRINK_EDGES(strgraph, next_free_edge);
  }

  if (show_progressbar)
    gt_progressbar_stop();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
andq $0x0, 0x8(%rsp)
testq %rdi, %rdi
je 0x17ff9f
movl %esi, %ebx
movq %rdi, %r14
testb %bl, %bl
je 0x17fdeb
movq 0x80(%r14), %rsi
leaq 0x8(%rsp), %rdi
callq 0x9c79c
xorl %r15d, %r15d
xorl %r12d, %r12d
movl %ebx, 0x4(%rsp)
movq 0x60(%r14), %rdi
movq 0x80(%r14), %rsi
cmpq %rsi, %r12
jae 0x17ff1e
movq %r12, %rsi
callq 0x17ffcd
movq %rax, 0x20(%rsp)
movq 0x60(%r14), %rdi
leaq 0x1(%r12), %rsi
movq %rsi, 0x10(%rsp)
callq 0x17ffcd
movq %r15, %rbp
movq %rax, %r15
movq 0x60(%r14), %rdi
movq %r12, %rsi
callq 0x17ffcd
subq %rax, %r15
movq %rbp, 0x18(%rsp)
xorl %ebx, %ebx
cmpq %rbx, %r15
je 0x17fec3
movq 0x60(%r14), %rdi
movq 0x88(%r14), %r13
movq %r12, %rsi
callq 0x17ffcd
leaq (%rax,%rbx), %rsi
movq %r13, %rdi
callq 0x17ffcd
movq %rax, %r13
movq 0x90(%r14), %rdi
callq 0x28a939
pushq $-0x1
popq %rdx
movl %eax, %ecx
shll %cl, %edx
notl %edx
addl %edx, %edx
movslq %edx, %rax
andq %r13, %rax
shrq %rax
cmpq 0x90(%r14), %rax
je 0x17febe
movq 0x88(%r14), %r13
movq 0x20(%rsp), %rax
leaq (%rax,%rbx), %rsi
movq %r13, %rdi
callq 0x17ffcd
movq %r13, %rdi
movq %rbp, %rsi
movq %rax, %rdx
callq 0x180026
incq %rbp
incq %rbx
jmp 0x17fe45
movq 0x60(%r14), %rdi
movq %r12, %rsi
movq 0x18(%rsp), %rdx
callq 0x180026
movq 0x60(%r14), %rdi
movq %r12, %rsi
callq 0x17ffcd
movq %rbp, %rbx
subq %rax, %rbx
movq 0x70(%r14), %rdi
movq %r12, %rsi
callq 0x17ffcd
cmpq %rax, %rbx
jne 0x17ff67
movq %rbp, %r15
movq 0x10(%rsp), %rax
movq %rax, %r12
movl 0x4(%rsp), %ebx
testb %bl, %bl
je 0x17fdf5
incq 0x8(%rsp)
movq %rbp, %r15
movq %rax, %r12
jmp 0x17fdf5
movq %r15, %rdx
callq 0x180026
cmpq 0x98(%r14), %r15
jae 0x17ff4f
movq %r15, 0x98(%r14)
testq %r15, %r15
jne 0x17ff4f
movq 0x88(%r14), %rdi
callq 0x17fcec
andq $0x0, 0x88(%r14)
testb %bl, %bl
je 0x17ff58
callq 0x9cce9
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x2b7ffa(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x16509b(%rip), %rsi    # 0x2e5013
leaq 0x1cf988(%rip), %rdx    # 0x34f907
leaq 0x1cf96d(%rip), %rcx    # 0x34f8f3
leaq 0x1cf7e8(%rip), %r8     # 0x34f775
movl $0x208, %r9d            # imm = 0x208
xorl %eax, %eax
callq 0x17a50
callq 0x17390
movq 0x2b7fc2(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x165063(%rip), %rsi    # 0x2e5013
leaq 0x1cf882(%rip), %rdx    # 0x34f839
leaq 0x1cf935(%rip), %rcx    # 0x34f8f3
leaq 0x1cf7b0(%rip), %r8     # 0x34f775
movl $0x1f2, %r9d            # imm = 0x1F2
jmp 0x17ff93