// File: /workspace/github_c_makefile_star2_O3/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
cmpq %rdx, %rsi
jae 0xe6d73
movq %rdx, %rbx
movq %rdi, %r14
leaq 0x1(%rdx), %r13
leaq -0x1(%rdx), %rbp
movq %r13, %rax
subq %rsi, %rax
cmpq $0x4, %rax
jbe 0xe6d41
movq (%r14,%rsi,8), %rax
movq (%r14,%rbx,8), %rcx
cmpq %rcx, %rax
jbe 0xe6c7c
movq %rcx, (%r14,%rsi,8)
movq %rax, (%r14,%rbx,8)
movq %rax, %rcx
movq (%r14,%rsi,8), %rax
cmpq %rcx, %rax
ja 0xe6d82
leaq 0x1(%rsi), %rdx
cmpq %rbp, %rsi
jae 0xe6cd6
movq %rdx, %r12
movq %rbp, %r15
movq (%r14,%rdx,8), %rdi
cmpq %rax, %rdi
jae 0xe6cae
movq (%r14,%r12,8), %r8
movq %r8, (%r14,%rdx,8)
movq %rdi, (%r14,%r12,8)
incq %r12
jmp 0xe6cc4
cmpq %rdi, %rcx
jae 0xe6cc4
movq (%r14,%r15,8), %r8
movq %r8, (%r14,%rdx,8)
movq %rdi, (%r14,%r15,8)
decq %r15
jmp 0xe6cc7
incq %rdx
cmpq %r15, %rdx
jbe 0xe6c94
testq %r12, %r12
jne 0xe6cdc
jmp 0xe6d87
movq %rdx, %r12
movq %rbp, %r15
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 0xe6d1a
leaq -0x2(%r12), %rdx
movq %r14, %rdi
callq 0xe6c2e
movq 0x8(%r14,%r15,8), %rax
cmpq %rax, -0x8(%r14,%r12,8)
jae 0xe6d2f
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0xe6c2e
addq $0x2, %r15
movq %r15, %rsi
cmpq %rbx, %r15
jb 0xe6c50
jmp 0xe6d73
leaq 0x1(%rsi), %rax
cmpq %rsi, %rax
jbe 0xe6d6b
movq (%r14,%rax,8), %rcx
movq %rax, %rdx
movq -0x8(%r14,%rdx,8), %rdi
cmpq %rcx, %rdi
jbe 0xe6d6b
movq %rdi, (%r14,%rdx,8)
decq %rdx
movq %rcx, (%r14,%rdx,8)
cmpq %rsi, %rdx
ja 0xe6d51
incq %rax
cmpq %rbx, %rax
jbe 0xe6d45
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x270d5
callq 0x2709e