// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/core/dual-pivot-qsort.c
// Function: gt_rec_dual_pivot_quicksort
static void gt_rec_dual_pivot_quicksort(GtUword *input,GtUword lowindex,
                                        GtUword highindex)
{
  if (lowindex >= highindex)
  {
    return;
  } else
  {
    GtUword len = highindex - lowindex + 1;

    if (len < 5UL)
    {
      gt_dual_insertion_sort(input,lowindex,highindex);
    } else
    {
      GtUword i, lt, gt, pivot1, pivot2;

      if (input[lowindex] > input[highindex])
      {
        gt_dpqs_exchange(input, lowindex, highindex);
      }
      pivot1 = input[lowindex];
      pivot2 = input[highindex];
      gt_assert(pivot1 <= pivot2);
      i = lowindex + 1;
      lt = lowindex + 1;
      gt_assert(highindex > 0);
      gt = highindex - 1;
      while (i <= gt)
      {
        if (input[i] < pivot1)
        {
          gt_dpqs_exchange(input, i++, lt++);
        } else
        {
          if (pivot2 < input[i])
          {
            gt_dpqs_exchange(input, i, gt--);
          } else
          {
            i++;
          }
        }
      }
      gt_assert(lt > 0);
      gt_dpqs_exchange(input, lowindex, --lt);
      gt_dpqs_exchange(input, highindex, ++gt);
      if (lt >= 1UL)
      {
        gt_rec_dual_pivot_quicksort(input, lowindex, lt - 1);
      }
      if (gt >= 1UL && input[lt] < input[gt])
      {
        gt_rec_dual_pivot_quicksort(input, lt + 1, gt - 1);
      }
      gt_rec_dual_pivot_quicksort(input, gt + 1, highindex);
    }
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rdi, %r14
leaq -0x1(%rdx), %r13
movq %rbx, %rax
subq %rsi, %rax
jbe 0xeb2fa
incq %rax
cmpq $0x4, %rax
jbe 0xeb2c6
movq (%r14,%rsi,8), %rax
movq (%r14,%rbx,8), %rcx
cmpq %rcx, %rax
jbe 0xeb1f6
movq %rcx, (%r14,%rsi,8)
movq %rax, (%r14,%rbx,8)
movq (%r14,%rsi,8), %rax
movq (%r14,%rbx,8), %rcx
cmpq %rcx, %rax
ja 0xeb304
leaq 0x1(%rsi), %rdx
cmpq %r13, %rdx
jbe 0xeb218
movq %r13, %r15
movq %rdx, %r12
jmp 0xeb256
movq %rdx, %r12
movq %r13, %r15
movq (%r14,%rdx,8), %rdi
cmpq %rax, %rdi
jae 0xeb238
movq (%r14,%r12,8), %r8
movq %r8, (%r14,%rdx,8)
movq %rdi, (%r14,%r12,8)
incq %r12
jmp 0xeb24e
cmpq %rdi, %rcx
jae 0xeb24e
movq (%r14,%r15,8), %r8
movq %r8, (%r14,%rdx,8)
movq %rdi, (%r14,%r15,8)
decq %r15
jmp 0xeb251
incq %rdx
cmpq %r15, %rdx
jbe 0xeb21e
testq %r12, %r12
je 0xeb309
movq (%r14,%rsi,8), %rax
movq -0x8(%r14,%r12,8), %rcx
movq %rcx, (%r14,%rsi,8)
movq %rax, -0x8(%r14,%r12,8)
movq (%r14,%rbx,8), %rax
movq 0x8(%r14,%r15,8), %rcx
movq %rcx, (%r14,%rbx,8)
movq %r12, %rcx
movq %rax, 0x8(%r14,%r15,8)
decq %rcx
je 0xeb298
leaq -0x2(%r12), %rdx
movq %r14, %rdi
callq 0xeb1b5
movq %r15, %rax
incq %rax
je 0xeb2ba
movq -0x8(%r14,%r12,8), %rax
cmpq 0x8(%r14,%r15,8), %rax
jae 0xeb2ba
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0xeb1b5
addq $0x2, %r15
movq %r15, %rsi
jmp 0xeb1c8
leaq 0x1(%rsi), %rax
cmpq %rbx, %rax
ja 0xeb2fa
cmpq %rsi, %rax
jbe 0xeb2f5
movq %rax, %rcx
movq -0x8(%r14,%rcx,8), %rdi
movq (%r14,%rcx,8), %rdx
cmpq %rdx, %rdi
jbe 0xeb2f5
movq %rdi, (%r14,%rcx,8)
decq %rcx
movq %rdx, (%r14,%rcx,8)
cmpq %rsi, %rcx
ja 0xeb2d7
incq %rax
jmp 0xeb2ca
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
callq 0x27625
callq 0x275ee
nop