// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/match/randomcodes.c
// Function: gt_randomcodes_evenly_divide_part
static GtUword *gt_randomcodes_evenly_divide_part(
    const GtRandomcodestab *rct, GtUword partminindex,
    GtUword partmaxindex, GtUword numofsuffixes,
    unsigned int numofparts)
{
  GtUword *endindexes, widthofpart, offset;
  unsigned int part, remainder;

  gt_assert(partminindex < partmaxindex && numofparts >= 2U);
  widthofpart = numofsuffixes/numofparts;
  endindexes = gt_malloc(sizeof (*endindexes) * numofparts);
  offset = gt_randomcodes_get_leftborder(rct, partminindex);
  remainder = (unsigned int) (numofsuffixes % (GtUword) numofparts);
  for (part=0; part < numofparts; part++)
  {
    if (remainder > 0)
    {
      offset += widthofpart + 1;
      remainder--;
    } else
    {
      offset += widthofpart;
    }
    if (part == numofparts - 1)
    {
      endindexes[part] = partmaxindex;
    } else
    {
      GtUword start = (part == 0) ? partminindex : endindexes[part-1] + 1;

      endindexes[part] = gt_randomcodes_findfirstlarger(rct, start,
                                                        partmaxindex, offset);
      gt_assert(endindexes[part] <= partmaxindex);
    }
  }
  return endindexes;
}

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x50(%rsp)
movq %rsi, 0x48(%rsp)
movq %rdx, 0x40(%rsp)
movq %rcx, 0x38(%rsp)
movl %r8d, 0x34(%rsp)
movq 0x48(%rsp), %rax
cmpq 0x40(%rsp), %rax
jae 0x274870
cmpl $0x2, 0x34(%rsp)
jae 0x2748a8
movq 0x3c7729(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x2a1792(%rip), %rsi    # 0x516013
leaq 0x3042cd(%rip), %rdx    # 0x578b55
leaq 0x30ab12(%rip), %rcx    # 0x57f3a1
leaq 0x30a23f(%rip), %r8     # 0x57ead5
movl $0x26b, %r9d            # imm = 0x26B
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2748aa
movq 0x38(%rsp), %rax
movl 0x34(%rsp), %ecx
xorl %edx, %edx
divq %rcx
movq %rax, 0x20(%rsp)
movl 0x34(%rsp), %eax
movl %eax, %edi
shlq $0x3, %rdi
leaq 0x30a207(%rip), %rsi    # 0x57ead5
movl $0x26d, %edx            # imm = 0x26D
callq 0xe80f0
movq %rax, 0x28(%rsp)
movq 0x50(%rsp), %rdi
movq 0x48(%rsp), %rsi
callq 0x4dbbd0
movq %rax, 0x18(%rsp)
movq 0x38(%rsp), %rax
movl 0x34(%rsp), %ecx
xorl %edx, %edx
divq %rcx
movl %edx, %eax
movl %eax, 0x10(%rsp)
movl $0x0, 0x14(%rsp)
movl 0x14(%rsp), %eax
cmpl 0x34(%rsp), %eax
jae 0x274a37
cmpl $0x0, 0x10(%rsp)
jbe 0x274942
movq 0x20(%rsp), %rax
addq $0x1, %rax
addq 0x18(%rsp), %rax
movq %rax, 0x18(%rsp)
movl 0x10(%rsp), %eax
addl $-0x1, %eax
movl %eax, 0x10(%rsp)
jmp 0x274951
movq 0x20(%rsp), %rax
addq 0x18(%rsp), %rax
movq %rax, 0x18(%rsp)
movl 0x14(%rsp), %eax
movl 0x34(%rsp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jne 0x274977
movq 0x40(%rsp), %rdx
movq 0x28(%rsp), %rax
movl 0x14(%rsp), %ecx
movq %rdx, (%rax,%rcx,8)
jmp 0x274a25
cmpl $0x0, 0x14(%rsp)
jne 0x274989
movq 0x48(%rsp), %rax
movq %rax, (%rsp)
jmp 0x2749a3
movq 0x28(%rsp), %rax
movl 0x14(%rsp), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
addq $0x1, %rax
movq %rax, (%rsp)
movq (%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x50(%rsp), %rdi
movq 0x8(%rsp), %rsi
movq 0x40(%rsp), %rdx
movq 0x18(%rsp), %rcx
callq 0x274bc0
movq %rax, %rdx
movq 0x28(%rsp), %rax
movl 0x14(%rsp), %ecx
movq %rdx, (%rax,%rcx,8)
movq 0x28(%rsp), %rax
movl 0x14(%rsp), %ecx
movq (%rax,%rcx,8), %rax
cmpq 0x40(%rsp), %rax
jbe 0x274a21
movq 0x3c75b0(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x2a1619(%rip), %rsi    # 0x516013
leaq 0x30419a(%rip), %rdx    # 0x578b9b
leaq 0x30a999(%rip), %rcx    # 0x57f3a1
leaq 0x30a0c6(%rip), %r8     # 0x57ead5
movl $0x283, %r9d            # imm = 0x283
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x274a23
jmp 0x274a25
jmp 0x274a27
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
jmp 0x27490d
movq 0x28(%rsp), %rax
addq $0x58, %rsp
retq
nopw %cs:(%rax,%rax)