// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/core/radix_sort.c
// Function: gt_evenly_divide_lentab
static void gt_evenly_divide_lentab(GtUword *endindexes,
                                    GtUword *lentab,
                                    GtUword numofelems,
                                    GtUword len,
                                    unsigned int numofparts)
{
  GtUword *leftborder, widthofpart, idx, previousvalue, offset = 0;
  unsigned int part, remainder;

  gt_assert(numofparts >= 2U);
  leftborder = lentab; /* reuse space for lentab */
  previousvalue = leftborder[0];
  for (idx = 1UL; idx < numofelems; idx++)
  {
    GtUword tmp = leftborder[idx-1] + previousvalue;
    previousvalue = leftborder[idx];
    leftborder[idx] = tmp;
  }
  widthofpart = len/numofparts;
  remainder = (unsigned int) (len % (GtUword) numofparts);
  for (part=0; part < numofparts; part++)
  {
    if (remainder > 0)
    {
      offset += widthofpart + 1;
      remainder--;
    } else
    {
      offset += widthofpart;
    }
    if (part == numofparts - 1)
    {
      endindexes[part] = numofelems-1;
    } else
    {
      GtUword start = part == 0 ? 0 : endindexes[part-1] + 1;

      endindexes[part] = gt_radixsort_findfirstlarger(leftborder,start,
                                                      numofelems-1,offset);
    }
  }
}

// Assembly:
subq $0x78, %rsp
movq %rdi, 0x70(%rsp)
movq %rsi, 0x68(%rsp)
movq %rdx, 0x60(%rsp)
movq %rcx, 0x58(%rsp)
movl %r8d, 0x54(%rsp)
movq $0x0, 0x28(%rsp)
cmpl $0x2, 0x54(%rsp)
jae 0x1032c5
movq 0x538d0c(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x412d75(%rip), %rsi    # 0x516013
leaq 0x4758cf(%rip), %rdx    # 0x578b74
leaq 0x43d9e5(%rip), %rcx    # 0x540c91
leaq 0x43d538(%rip), %r8     # 0x5407eb
movl $0xbf, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x1032c7
movq 0x68(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0x48(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x30(%rsp)
movq $0x1, 0x38(%rsp)
movq 0x38(%rsp), %rax
cmpq 0x60(%rsp), %rax
jae 0x103345
movq 0x48(%rsp), %rax
movq 0x38(%rsp), %rcx
subq $0x1, %rcx
movq (%rax,%rcx,8), %rax
addq 0x30(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x48(%rsp), %rax
movq 0x38(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x30(%rsp)
movq 0x18(%rsp), %rdx
movq 0x48(%rsp), %rax
movq 0x38(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
movq 0x38(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x38(%rsp)
jmp 0x1032e7
movq 0x58(%rsp), %rax
movl 0x54(%rsp), %ecx
xorl %edx, %edx
divq %rcx
movq %rax, 0x40(%rsp)
movq 0x58(%rsp), %rax
movl 0x54(%rsp), %ecx
xorl %edx, %edx
divq %rcx
movl %edx, %eax
movl %eax, 0x20(%rsp)
movl $0x0, 0x24(%rsp)
movl 0x24(%rsp), %eax
cmpl 0x54(%rsp), %eax
jae 0x103453
cmpl $0x0, 0x20(%rsp)
jbe 0x1033a9
movq 0x40(%rsp), %rax
addq $0x1, %rax
addq 0x28(%rsp), %rax
movq %rax, 0x28(%rsp)
movl 0x20(%rsp), %eax
addl $-0x1, %eax
movl %eax, 0x20(%rsp)
jmp 0x1033b8
movq 0x40(%rsp), %rax
addq 0x28(%rsp), %rax
movq %rax, 0x28(%rsp)
movl 0x24(%rsp), %eax
movl 0x54(%rsp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jne 0x1033df
movq 0x60(%rsp), %rdx
subq $0x1, %rdx
movq 0x70(%rsp), %rax
movl 0x24(%rsp), %ecx
movq %rdx, (%rax,%rcx,8)
jmp 0x103441
cmpl $0x0, 0x24(%rsp)
jne 0x1033ef
xorl %eax, %eax
movq %rax, 0x8(%rsp)
jmp 0x10340a
movq 0x70(%rsp), %rax
movl 0x24(%rsp), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
addq $0x1, %rax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x48(%rsp), %rdi
movq 0x10(%rsp), %rsi
movq 0x60(%rsp), %rdx
subq $0x1, %rdx
movq 0x28(%rsp), %rcx
callq 0x106dd0
movq %rax, %rdx
movq 0x70(%rsp), %rax
movl 0x24(%rsp), %ecx
movq %rdx, (%rax,%rcx,8)
jmp 0x103443
movl 0x24(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x24(%rsp)
jmp 0x103374
addq $0x78, %rsp
retq
nopl (%rax,%rax)