// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/match/randomcodes-sfx-partssuf.c
// Function: gt_suftabparts_rc_removeemptyparts
static void gt_suftabparts_rc_removeemptyparts(GtSuftabparts_rc *suftabparts_rc,
                                            GT_UNUSED GtUword totalwidth,
                                            GtLogger *logger)
{
#undef SKDEBUG
#ifdef SKDEBUG
  gt_log_log("before removal");
  gt_suftabparts_rc_showallrecords(suftabparts_rc,false);
#endif
  gt_assert(suftabparts_rc != NULL);
  if (suftabparts_rc->numofparts > 0)
  {
    unsigned int destpart, srcpart;
    GtUword GT_UNUSED sumwidth = 0;

    for (destpart = 0, srcpart = 0; srcpart < suftabparts_rc->numofparts;
         srcpart++)
    {
      if (suftabparts_rc->components[srcpart].widthofpart > 0)
      {
        if (destpart < srcpart)
        {
          suftabparts_rc->components[destpart] =
            suftabparts_rc->components[srcpart];
        }
        destpart++;
      }
    }
    if (destpart < srcpart)
    {
      suftabparts_rc->components[destpart-1].nextidx
        = suftabparts_rc->components[suftabparts_rc->numofparts-1].nextidx;
      suftabparts_rc->numofparts -= (srcpart - destpart);
      gt_assert(suftabparts_rc->numofparts == destpart);
    }
    for (srcpart = 0; srcpart < suftabparts_rc->numofparts; srcpart++)
    {
      gt_assert(suftabparts_rc->components[srcpart].widthofpart > 0);
      sumwidth+=suftabparts_rc->components[srcpart].widthofpart;
      gt_logger_log(logger,"widthofpart[%u]=" GT_WU "",
                    srcpart,
                    suftabparts_rc->components[srcpart].widthofpart);
    }
    gt_assert(sumwidth == totalwidth);
  }
#ifdef SKDEBUG
  gt_log_log("after removal");
  gt_suftabparts_rc_showallrecords(suftabparts_rc,true);
#endif
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq %rdx, 0x10(%rsp)
cmpq $0x0, 0x20(%rsp)
jne 0x4d9f73
movq 0x16205e(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x3c0c7(%rip), %rsi     # 0x516013
leaq 0xa4c2d(%rip), %rdx     # 0x57eb80
leaq 0xe0537(%rip), %rcx     # 0x5ba491
leaq 0xe02a3(%rip), %r8      # 0x5ba204
movl $0x80, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x4d9f75
movq 0x20(%rsp), %rax
cmpl $0x0, 0xc(%rax)
jbe 0x4da1d5
movq $0x0, (%rsp)
movl $0x0, 0xc(%rsp)
movl $0x0, 0x8(%rsp)
movl 0x8(%rsp), %eax
movq 0x20(%rsp), %rcx
cmpl 0xc(%rcx), %eax
jae 0x4da018
movq 0x20(%rsp), %rax
movq (%rax), %rax
movl 0x8(%rsp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
cmpq $0x0, 0x8(%rax)
jbe 0x4da009
movl 0xc(%rsp), %eax
cmpl 0x8(%rsp), %eax
jae 0x4d9ffe
movq 0x20(%rsp), %rax
movq (%rax), %rdi
movl 0xc(%rsp), %eax
imulq $0x30, %rax, %rax
addq %rax, %rdi
movq 0x20(%rsp), %rax
movq (%rax), %rsi
movl 0x8(%rsp), %eax
imulq $0x30, %rax, %rax
addq %rax, %rsi
movl $0x30, %edx
callq 0x19610
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0x4da00b
movl 0x8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x8(%rsp)
jmp 0x4d9f9c
movl 0xc(%rsp), %eax
cmpl 0x8(%rsp), %eax
jae 0x4da0bf
movq 0x20(%rsp), %rax
movq (%rax), %rax
movq 0x20(%rsp), %rcx
movl 0xc(%rcx), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rcx
movq 0x20(%rsp), %rax
movq (%rax), %rax
movl 0xc(%rsp), %edx
subl $0x1, %edx
movl %edx, %edx
imulq $0x30, %rdx, %rdx
addq %rdx, %rax
movq %rcx, (%rax)
movl 0x8(%rsp), %edx
subl 0xc(%rsp), %edx
movq 0x20(%rsp), %rax
movl 0xc(%rax), %ecx
subl %edx, %ecx
movl %ecx, 0xc(%rax)
movq 0x20(%rsp), %rax
movl 0xc(%rax), %eax
cmpl 0xc(%rsp), %eax
je 0x4da0bb
movq 0x161f16(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x3bf7f(%rip), %rsi     # 0x516013
leaq 0xe0419(%rip), %rdx     # 0x5ba4b4
leaq 0xe03ef(%rip), %rcx     # 0x5ba491
leaq 0xe015b(%rip), %r8      # 0x5ba204
movl $0x98, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x4da0bd
jmp 0x4da0bf
movl $0x0, 0x8(%rsp)
movl 0x8(%rsp), %eax
movq 0x20(%rsp), %rcx
cmpl 0xc(%rcx), %eax
jae 0x4da18c
jmp 0x4da0db
movq 0x20(%rsp), %rax
movq (%rax), %rax
movl 0x8(%rsp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
cmpq $0x0, 0x8(%rax)
ja 0x4da12d
movq 0x161ea4(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x3bf0d(%rip), %rsi     # 0x516013
leaq 0xe03ce(%rip), %rdx     # 0x5ba4db
leaq 0xe037d(%rip), %rcx     # 0x5ba491
leaq 0xe00e9(%rip), %r8      # 0x5ba204
movl $0x9c, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x4da12f
movq 0x20(%rsp), %rax
movq (%rax), %rax
movl 0x8(%rsp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
addq (%rsp), %rax
movq %rax, (%rsp)
movq 0x10(%rsp), %rdi
movl 0x8(%rsp), %edx
movq 0x20(%rsp), %rax
movq (%rax), %rax
movl 0x8(%rsp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rcx
leaq 0xb1aeb(%rip), %rsi     # 0x58bc60
movb $0x0, %al
callq 0xe7cd0
movl 0x8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x8(%rsp)
jmp 0x4da0c7
jmp 0x4da18e
movq (%rsp), %rax
cmpq 0x18(%rsp), %rax
je 0x4da1d1
movq 0x161e00(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x3be69(%rip), %rsi     # 0x516013
leaq 0xb1ac3(%rip), %rdx     # 0x58bc74
leaq 0xe02d9(%rip), %rcx     # 0x5ba491
leaq 0xe0045(%rip), %r8      # 0x5ba204
movl $0xa2, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x4da1d3
jmp 0x4da1d5
addq $0x28, %rsp
retq
nopw (%rax,%rax)