// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/match/randomcodes-sfx-partssuf.c
// Function: gt_suftabparts_rc_new
GtSuftabparts_rc *gt_suftabparts_rc_new(unsigned int numofparts,
                                  const GtBcktab *bcktab,
                                  const GtRandomcodestab *fct,
                                  const GtSfxmappedrangelist *sfxmrlist,
                                  GtUword numofsuffixestoinsert,
                                  GtUword fullspecials,
                                  GtLogger *logger)
{
  GtSuftabparts_rc *suftabparts_rc;
  GtUword size_mapped;
  unsigned int part;

  gt_assert((bcktab == NULL && fct != NULL) ||
            (bcktab != NULL && fct == NULL));
  suftabparts_rc = gt_malloc(sizeof *suftabparts_rc);
  suftabparts_rc->largestsizemappedpartwise = 0;
  suftabparts_rc->fct = fct;
  gt_assert(suftabparts_rc != NULL);
  if (numofsuffixestoinsert == 0)
  {
    suftabparts_rc->numofparts = 0;
  } else
  {
    if (numofsuffixestoinsert < (GtUword) numofparts ||
        (bcktab != NULL && gt_bcktab_prefixlength(bcktab) == 1U))
    {
      suftabparts_rc->numofparts = 1U;
    } else
    {
      suftabparts_rc->numofparts = numofparts;
    }
  }
  if (suftabparts_rc->numofparts == 0)
  {
    gt_assert(numofparts != 0);
    suftabparts_rc->largestsuftabwidth = fullspecials/numofparts+1;
    suftabparts_rc->largestsizemappedpartwise
      = gt_Sfxmappedrangelist_size_entire(sfxmrlist);
    suftabparts_rc->components = NULL;
  } else
  {
    unsigned int remainder;
    GtUword secondidx, randombound = 0, secondbound,
                  suftaboffset = 0, sumofwidth = 0;
    const GtUword widthofsuftabpart
      = numofsuffixestoinsert/suftabparts_rc->numofparts;

    suftabparts_rc->components
      = gt_malloc(sizeof (*suftabparts_rc->components) *
          suftabparts_rc->numofparts);
    remainder = (unsigned int) (numofsuffixestoinsert %
                                (GtUword) suftabparts_rc->numofparts);
    suftabparts_rc->largestsuftabwidth = 0;
    for (part=0; part < suftabparts_rc->numofparts; part++)
    {
      if (remainder > 0)
      {
        suftaboffset += widthofsuftabpart + 1;
        remainder--;
      } else
      {
        suftaboffset += widthofsuftabpart;
      }
      if (part == suftabparts_rc->numofparts - 1)
      {
        secondidx = bcktab != NULL ? gt_bcktab_numofallcodes(bcktab)
                                   : gt_randomcodes_numofsamples(fct);
      } else
      {
        secondidx = bcktab != NULL
                      ? gt_bcktab_findfirstlarger(bcktab,(GtCodetype) 1,
                                                  (GtCodetype) 0,suftaboffset)
                      : gt_randomcodes_findfirstsamplelarger(fct,suftaboffset);
      }
      suftabparts_rc->components[part].nextidx = secondidx;
      secondbound = bcktab != NULL
                      ? gt_bcktab_get_leftborder(bcktab,secondidx)
                      : gt_randomcodes_get_sample(fct,secondidx);
      if (part == 0)
      {
        suftabparts_rc->components[part].widthofpart = secondbound;
        suftabparts_rc->components[part].suftaboffset = 0;
      } else
      {
        gt_assert(secondbound >= randombound);
        suftabparts_rc->components[part].widthofpart = secondbound -
          randombound;
        suftabparts_rc->components[part].suftaboffset = randombound;
      }
      if (suftabparts_rc->largestsuftabwidth <
          suftabparts_rc->components[part].widthofpart)
      {
        suftabparts_rc->largestsuftabwidth
          = suftabparts_rc->components[part].widthofpart;
      }
      sumofwidth += suftabparts_rc->components[part].widthofpart;
      suftabparts_rc->components[part].sumofwidth = sumofwidth;
      randombound = secondbound;
    }
    gt_assert(sumofwidth == numofsuffixestoinsert);
  }
  gt_suftabparts_rc_removeemptyparts(suftabparts_rc,numofsuffixestoinsert,
      logger);
  if (suftabparts_rc->numofparts > 0)
  {
    gt_assert(suftabparts_rc->components != NULL);
    for (part=0; part < suftabparts_rc->numofparts; part++)
    {
      suftabparts_rc->components[part].minindex
        = gt_suftabparts_rc_minindex_raw(part,suftabparts_rc);
      suftabparts_rc->components[part].maxindex
        = gt_suftabparts_rc_maxindex_raw(part,suftabparts_rc);
    }
    for (part=1U; part < suftabparts_rc->numofparts; part++)
    {
      if (suftabparts_rc->components[part].minindex !=
            suftabparts_rc->components[part-1].maxindex + 1)
      {
        suftabparts_rc->components[part].minindex
          = suftabparts_rc->components[part-1].maxindex + 1;
      }
    }
    for (part=0; part < suftabparts_rc->numofparts; part++)
    {
      size_mapped = gt_Sfxmappedrangelist_size_mapped(sfxmrlist,
          gt_suftabparts_rc_minindex(part,suftabparts_rc),
          gt_suftabparts_rc_maxindex(part,suftabparts_rc));
      if (suftabparts_rc->largestsizemappedpartwise < size_mapped)
      {
        suftabparts_rc->largestsizemappedpartwise = size_mapped;
      }
    }
  }
  return suftabparts_rc;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %r9, %r12
movq %r8, %r13
movq %rcx, %r14
movq %rdx, %rbp
movl %edi, %ebx
testq %rsi, %rsi
sete %al
testq %rdx, %rdx
setne %cl
testb %cl, %al
jne 0x2c4de3
testq %rsi, %rsi
je 0x2c534f
testq %rbp, %rbp
jne 0x2c534f
movq %rsi, 0x8(%rsp)
leaq 0xbfeb5(%rip), %rsi     # 0x384ca4
pushq $0x28
popq %rdi
movl $0xb8, %edx
callq 0x93160
movq %rax, %r15
andq $0x0, 0x10(%rax)
movq %rbp, 0x20(%rax)
movl %ebx, %ecx
testq %r13, %r13
movq %r14, 0x28(%rsp)
movq %r13, 0x10(%rsp)
je 0x2c4e47
cmpq %r13, %rcx
movq %rbp, 0x18(%rsp)
ja 0x2c4e3a
cmpq $0x0, 0x8(%rsp)
je 0x2c4e87
movq 0x8(%rsp), %rdi
callq 0x1356a1
cmpl $0x1, %eax
jne 0x2c4e87
movl $0x1, 0xc(%r15)
pushq $0x1
popq %rbx
jmp 0x2c4e93
andl $0x0, 0xc(%r15)
testl %ebx, %ebx
je 0x2c531e
movq %r15, %rax
addq $0xc, %rax
movq %rax, (%rsp)
movq %r12, %rax
xorl %edx, %edx
divq %rcx
incq %rax
movq %rax, 0x18(%r15)
movq %r14, %rdi
callq 0x1a067e
movq %rax, 0x10(%r15)
andq $0x0, (%r15)
movl 0xc(%r15), %esi
jmp 0x2c500b
movl %ebx, 0xc(%r15)
testl %ebx, %ebx
je 0x2c531e
movq %r15, %rax
addq $0xc, %rax
movq %rax, (%rsp)
movl %ebx, %ecx
movq %r13, %rax
xorl %edx, %edx
divq %rcx
movq %rax, 0x38(%rsp)
imulq $0x30, %rcx, %rdi
leaq 0xbfdec(%rip), %rsi     # 0x384ca4
movl $0xdb, %edx
callq 0x93160
movq %rax, (%r15)
movl 0xc(%r15), %esi
movq %r13, %rax
xorl %edx, %edx
divq %rsi
movq %rdx, %rbx
andq $0x0, 0x18(%r15)
xorl %r12d, %r12d
xorl %r14d, %r14d
xorl %ecx, %ecx
xorl %r13d, %r13d
xorl %ebp, %ebp
movq %r15, 0x30(%rsp)
movl %esi, %eax
cmpq %rax, %r14
jae 0x2c4ffd
movq %rcx, 0x40(%rsp)
addq 0x38(%rsp), %r13
subl $0x1, %ebx
movl $0x0, %eax
cmovbl %eax, %ebx
sbbq $-0x1, %r13
decl %esi
cmpq %rsi, %r14
jne 0x2c4f2f
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x2c4f67
movq %rbp, 0x20(%rsp)
movq %rdi, %rbp
callq 0x1359e8
jmp 0x2c4f4e
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x2c4f76
movq %rbp, 0x20(%rsp)
movq %rdi, %rbp
pushq $0x1
popq %rsi
xorl %edx, %edx
movq %r13, %rcx
callq 0x135ad5
movq (%r15), %rcx
movq %rax, (%rcx,%r12)
movq %rbp, %rdi
movq %rax, %rsi
callq 0x134141
movq 0x20(%rsp), %rbp
jmp 0x2c4fa0
movq 0x18(%rsp), %r15
movq %r15, %rdi
callq 0x2c62cd
jmp 0x2c4f86
movq 0x18(%rsp), %r15
movq %r15, %rdi
movq %r13, %rsi
callq 0x2c62d2
movq 0x30(%rsp), %rdx
movq (%rdx), %rcx
movq %rax, (%rcx,%r12)
movq %r15, %rdi
movq %rdx, %r15
movq %rax, %rsi
callq 0x2c6251
testq %r12, %r12
movq 0x40(%rsp), %rsi
je 0x2c4fc5
movq %rax, %rdx
subq %rsi, %rdx
jb 0x2c525e
movq (%r15), %rcx
movq %rdx, 0x8(%rcx,%r12)
movq %rsi, 0x10(%rcx,%r12)
jmp 0x2c4fd4
movq (%r15), %rcx
movq %rax, 0x8(%rcx)
andq $0x0, 0x10(%rcx)
movq %rax, %rdx
cmpq %rdx, 0x18(%r15)
jae 0x2c4fde
movq %rdx, 0x18(%r15)
addq 0x8(%rcx,%r12), %rbp
movq %rbp, 0x18(%rcx,%r12)
incq %r14
movq (%rsp), %rcx
movl (%rcx), %esi
addq $0x30, %r12
movq %rax, %rcx
jmp 0x2c4eeb
movq 0x10(%rsp), %r13
cmpq %r13, %rbp
jne 0x2c52c2
testl %esi, %esi
je 0x2c521e
pushq $0x1
popq %rbp
xorl %eax, %eax
pushq $0x8
popq %rdx
xorl %ecx, %ecx
movl %esi, %edi
cmpq %rdi, %rax
jae 0x2c506f
movq (%r15), %rdi
cmpq $0x0, (%rdi,%rdx)
je 0x2c5066
movl %ecx, %r8d
cmpq %r8, %rax
jbe 0x2c5064
leaq (%rdi,%rdx), %rsi
addq $-0x8, %rsi
imulq $0x30, %r8, %r8
movups (%rsi), %xmm0
movups 0x10(%rsi), %xmm1
movups 0x20(%rsi), %xmm2
movups %xmm2, 0x20(%rdi,%r8)
movups %xmm1, 0x10(%rdi,%r8)
movups %xmm0, (%rdi,%r8)
movq (%rsp), %rsi
movl (%rsi), %esi
incl %ecx
incq %rax
addq $0x30, %rdx
jmp 0x2c501d
cmpl %eax, %ecx
jae 0x2c50cc
movq (%r15), %rdx
leal -0x1(%rsi), %edi
imulq $0x30, %rdi, %rdi
movq (%rdx,%rdi), %rdi
leal -0x1(%rcx), %r8d
imulq $0x30, %r8, %r8
movq %rdi, (%rdx,%r8)
addl %ecx, %esi
subl %eax, %esi
movl %esi, 0xc(%r15)
cmpl %ecx, %esi
movl %ecx, %esi
je 0x2c50ce
movq 0x172ec6(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1ff67(%rip), %rsi     # 0x2e5013
leaq 0xbfea1(%rip), %rdx     # 0x384f54
leaq 0xbfe77(%rip), %rcx     # 0x384f31
leaq 0xbfbe3(%rip), %r8      # 0x384ca4
movl $0x98, %r9d
jmp 0x2c52b6
movl %esi, %ecx
pushq $0x8
popq %r14
leaq 0x9405d(%rip), %r12     # 0x359136
xorl %r13d, %r13d
xorl %ebx, %ebx
movl %esi, %eax
cmpq %rax, %r13
jae 0x2c511e
movq (%r15), %rax
movq (%rax,%r14), %rcx
testq %rcx, %rcx
je 0x2c5230
addq %rcx, %rbx
movq 0x80(%rsp), %rdi
movq %r12, %rsi
movl %r13d, %edx
xorl %eax, %eax
callq 0x92e71
incq %r13
movq (%rsp), %rax
movl (%rax), %ecx
addq $0x30, %r14
movl %ecx, %esi
jmp 0x2c50de
cmpq 0x10(%rsp), %rbx
jne 0x2c52f0
testl %ecx, %ecx
movq 0x28(%rsp), %r12
pushq $0x28
popq %r13
je 0x2c521e
movq (%r15), %rdx
testq %rdx, %rdx
je 0x2c5380
xorl %ebx, %ebx
xorl %r14d, %r14d
movl %ecx, %esi
cmpq %rsi, %r14
jae 0x2c51c7
testq %rbx, %rbx
je 0x2c5161
movq -0x30(%rdx,%rbx), %rax
incq %rax
jmp 0x2c5163
xorl %eax, %eax
movq 0x20(%r15), %rdi
testq %rdi, %rdi
je 0x2c517d
movq %rax, %rsi
callq 0x2c637f
movq (%r15), %rdx
movl 0xc(%r15), %esi
movl %esi, %ecx
movq %rax, 0x20(%rdx,%rbx)
cmpq %r14, %rsi
jbe 0x2c528c
movq 0x20(%r15), %rdi
testq %rdi, %rdi
je 0x2c51a6
movq (%rdx,%rbx), %rsi
callq 0x2c637f
movq (%r15), %rdx
movl 0xc(%r15), %ecx
jmp 0x2c51b9
leal -0x1(%rcx), %eax
xorl %esi, %esi
cmpq %rax, %r14
sete %sil
movq (%rdx,%rbx), %rax
subq %rsi, %rax
movq %rax, 0x28(%rdx,%rbx)
incq %r14
addq $0x30, %rbx
jmp 0x2c514b
addq $0x50, %rdx
cmpq %rsi, %rbp
jae 0x2c51e8
movq -0x28(%rdx), %rax
incq %rax
cmpq %rax, (%rdx)
je 0x2c51df
movq %rax, (%rdx)
incq %rbp
addq $0x30, %rdx
jmp 0x2c51cb
xorl %ebx, %ebx
movl %ecx, %eax
cmpq %rax, %rbx
jae 0x2c521e
movq (%r15), %rax
movq -0x8(%rax,%r13), %rsi
movq (%rax,%r13), %rdx
movq %r12, %rdi
callq 0x1a05ec
cmpq %rax, 0x10(%r15)
jae 0x2c520f
movq %rax, 0x10(%r15)
incq %rbx
movq (%rsp), %rax
movl (%rax), %ecx
addq $0x30, %r13
jmp 0x2c51ea
movq %r15, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x172d31(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1fdd2(%rip), %rsi     # 0x2e5013
leaq 0xbfd33(%rip), %rdx     # 0x384f7b
leaq 0xbfce2(%rip), %rcx     # 0x384f31
leaq 0xbfa4e(%rip), %r8      # 0x384ca4
movl $0x9c, %r9d
jmp 0x2c52b6
movq 0x172d03(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1fda4(%rip), %rsi     # 0x2e5013
leaq 0xbfb0b(%rip), %rdx     # 0x384d81
leaq 0xbfaee(%rip), %rcx     # 0x384d6b
leaq 0xbfa20(%rip), %r8      # 0x384ca4
movl $0xfe, %r9d
jmp 0x2c52b6
movq 0x172cd5(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1fd76(%rip), %rsi     # 0x2e5013
leaq 0xbfb75(%rip), %rdx     # 0x384e19
leaq 0xbfd04(%rip), %rcx     # 0x384faf
leaq 0xbf9f2(%rip), %r8      # 0x384ca4
pushq $0x6b
popq %r9
xorl %eax, %eax
callq 0x17a50
callq 0x17390
movq 0x172c9f(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1fd40(%rip), %rsi     # 0x2e5013
leaq 0x93b5a(%rip), %rdx     # 0x358e34
leaq 0xbfa8a(%rip), %rcx     # 0x384d6b
leaq 0xbf9bc(%rip), %r8      # 0x384ca4
movl $0x10d, %r9d            # imm = 0x10D
jmp 0x2c52b6
movq 0x172c71(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1fd12(%rip), %rsi     # 0x2e5013
leaq 0x93e42(%rip), %rdx     # 0x35914a
leaq 0xbfc22(%rip), %rcx     # 0x384f31
leaq 0xbf98e(%rip), %r8      # 0x384ca4
movl $0xa2, %r9d
jmp 0x2c52b6
movq 0x172c43(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1fce4(%rip), %rsi     # 0x2e5013
leaq 0x93a5e(%rip), %rdx     # 0x358d94
leaq 0xbfa2e(%rip), %rcx     # 0x384d6b
leaq 0xbf960(%rip), %r8      # 0x384ca4
movl $0xcc, %r9d
jmp 0x2c52b6
movq 0x172c12(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1fcb3(%rip), %rsi     # 0x2e5013
leaq 0x939d7(%rip), %rdx     # 0x358d3e
leaq 0xbf9fd(%rip), %rcx     # 0x384d6b
leaq 0xbf92f(%rip), %r8      # 0x384ca4
movl $0xb7, %r9d
jmp 0x2c52b6
movq 0x172be1(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1fc82(%rip), %rsi     # 0x2e5013
leaq 0xbfa04(%rip), %rdx     # 0x384d9c
leaq 0xbf9cc(%rip), %rcx     # 0x384d6b
leaq 0xbf8fe(%rip), %r8      # 0x384ca4
movl $0x113, %r9d            # imm = 0x113
jmp 0x2c52b6