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

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

      gt_dual_pivots_get(&pivot1,&pivot2,input,lowindex,highindex);
      gt_assert(pivot1 <= pivot2);
      lt = lowindex + 1;
      gt_assert(highindex > 0);
      gt = highindex - 1;
      for (idx = lowindex + 1; idx <= gt; idx++)
      {
        GtUword currentvalue = input[idx];

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdx, %rbx
movq %rsi, %r13
movq %rdi, %r14
leaq -0x1(%rdx), %rax
movq %rax, 0x8(%rsp)
leaq 0x8(%rdi), %r12
movq %rbx, %rax
subq %r13, %rax
jbe 0x6f44b
incq %rax
cmpq $0x6, %rax
jbe 0x6f45a
movq %rax, %rdx
shrq $0x3, %rdx
movq %rax, %rcx
shrq $0x6, %rcx
addq %rdx, %rcx
leaq (%rbx,%r13), %r15
shrq %r15
movq %r15, 0x28(%rsp)
cmpq %rcx, %r15
jbe 0x6f4ae
leaq 0x1(%rcx), %rdx
leaq (%rcx,%r15), %rbp
incq %rbp
subq %rdx, %r15
movq %r15, 0x20(%rsp)
leaq (%rcx,%rbp), %rdx
incq %rdx
notq %rcx
xorl %esi, %esi
cmpq $0x8, %rax
sete %sil
addq %rcx, %rsi
addq %r15, %rsi
movq %rsi, 0x18(%rsp)
movq %rbp, 0x30(%rsp)
movq %rdx, 0x38(%rsp)
pushq $0x1
popq %rax
cmpq $0x6, %rax
je 0x6f341
movq 0x10(%rsp,%rax,8), %rcx
cmpq %r13, %rcx
jb 0x6f476
cmpq %rbx, %rcx
ja 0x6f476
movq (%r14,%rcx,8), %rcx
movq %rcx, 0x38(%rsp,%rax,8)
incq %rax
jmp 0x6f316
leaq 0x40(%rsp), %rdi
xorl %esi, %esi
pushq $0x4
popq %rdx
callq 0x6f539
pushq $0x1
popq %rax
cmpq $0x6, %rax
je 0x6f36c
movq 0x38(%rsp,%rax,8), %rcx
movq 0x10(%rsp,%rax,8), %rdx
movq %rcx, (%r14,%rdx,8)
incq %rax
jmp 0x6f353
movq (%r14,%r15,8), %rcx
movq (%r14,%rbp,8), %rax
movq %rcx, (%r14,%r13,8)
movq %rax, (%r14,%rbx,8)
cmpq %rax, %rcx
ja 0x6f4da
leaq 0x1(%r13), %rdx
movq 0x8(%rsp), %r15
movq %rdx, %rsi
cmpq %r15, %rsi
ja 0x6f3f4
movq (%r14,%rsi,8), %rdi
cmpq %rcx, %rdi
jae 0x6f3b2
leaq (%r14,%rdx,8), %r8
movq (%r8), %r9
movq %r9, (%r14,%rsi,8)
incq %rdx
movq %rdi, (%r8)
jmp 0x6f3b7
cmpq %rax, %rdi
jae 0x6f3bc
incq %rsi
jmp 0x6f391
leaq (%r12,%r15,8), %r8
movq %r15, %r10
movq -0x8(%r8), %r9
addq $-0x8, %r8
decq %r15
cmpq %r10, %rsi
jae 0x6f3d8
cmpq %rax, %r9
ja 0x6f3c0
cmpq %rcx, %r9
jae 0x6f3ee
movq (%r14,%rdx,8), %r9
movq %r9, (%r14,%rsi,8)
movq (%r8), %r9
movq %r9, (%r14,%rdx,8)
jmp 0x6f3aa
movq %r9, (%r14,%rsi,8)
jmp 0x6f3ad
testq %rdx, %rdx
je 0x6f508
movq %rdx, %rbp
movq -0x8(%r14,%rdx,8), %rsi
movq %rsi, (%r14,%r13,8)
movq %rcx, -0x8(%r14,%rdx,8)
movq 0x8(%r14,%r15,8), %rcx
movq %rcx, (%r14,%rbx,8)
movq %rax, 0x8(%r14,%r15,8)
decq %rbp
je 0x6f430
addq $-0x2, %rdx
movq %r14, %rdi
movq %r13, %rsi
callq 0x6f274
leaq 0x1(%r15), %rdx
movq %r14, %rdi
movq %rbp, %rsi
callq 0x6f274
addq $0x2, %r15
movq %r15, %r13
jmp 0x6f298
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r14, %rdi
movq %r13, %rsi
movq %rbx, %rdx
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x6f539
movq 0x3c8aeb(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x275b8c(%rip), %rsi    # 0x2e5013
leaq 0x2940bc(%rip), %rdx    # 0x30354a
leaq 0x2940a2(%rip), %rcx    # 0x303537
leaq 0x29406d(%rip), %r8     # 0x303509
movl $0x84, %r9d
xorl %eax, %eax
callq 0x17a50
callq 0x17390
movq 0x3c8ab3(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x275b54(%rip), %rsi    # 0x2e5013
leaq 0x294066(%rip), %rdx    # 0x30352c
leaq 0x29406a(%rip), %rcx    # 0x303537
leaq 0x294035(%rip), %r8     # 0x303509
pushq $0x79
popq %r9
jmp 0x6f4a2
movq 0x3c8a87(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x275b28(%rip), %rsi    # 0x2e5013
leaq 0x293fe5(%rip), %rdx    # 0x3034d7
leaq 0x293fef(%rip), %rcx    # 0x3034e8
leaq 0x294009(%rip), %r8     # 0x303509
movl $0xa6, %r9d
jmp 0x6f4a2
movq 0x3c8a59(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x275afa(%rip), %rsi    # 0x2e5013
leaq 0x294005(%rip), %rdx    # 0x303525
leaq 0x293fc1(%rip), %rcx    # 0x3034e8
leaq 0x293fdb(%rip), %r8     # 0x303509
movl $0xc7, %r9d
jmp 0x6f4a2