// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x58, %rsp
movq %rdi, 0x50(%rsp)
movq %rsi, 0x48(%rsp)
movq %rdx, 0x40(%rsp)
movq 0x48(%rsp), %rax
cmpq 0x40(%rsp), %rax
jb 0xa79c4
jmp 0xa7d4a
movq 0x40(%rsp), %rax
subq 0x48(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x38(%rsp)
cmpq $0x6, 0x38(%rsp)
ja 0xa79f8
movq 0x50(%rsp), %rdi
movq 0x48(%rsp), %rsi
movq 0x40(%rsp), %rdx
callq 0xa7d50
jmp 0xa7d48
movq 0x50(%rsp), %rdx
movq 0x48(%rsp), %rcx
movq 0x40(%rsp), %r8
leaq 0x18(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0xa7e10
movq 0x18(%rsp), %rax
cmpq 0x10(%rsp), %rax
jbe 0xa7a5a
movq 0x594577(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x46e5e0(%rip), %rsi    # 0x516013
leaq 0x48cd92(%rip), %rdx    # 0x5347cc
leaq 0x48cd9c(%rip), %rcx    # 0x5347dd
leaq 0x48cdb6(%rip), %r8     # 0x5347fe
movl $0xa6, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0xa7a5c
movq 0x48(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x28(%rsp)
cmpq $0x0, 0x40(%rsp)
ja 0xa7aaa
movq 0x594527(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x46e590(%rip), %rsi    # 0x516013
leaq 0x48cd90(%rip), %rdx    # 0x53481a
leaq 0x48cd4c(%rip), %rcx    # 0x5347dd
leaq 0x48cd66(%rip), %r8     # 0x5347fe
movl $0xa8, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0xa7aac
movq 0x40(%rsp), %rax
subq $0x1, %rax
movq %rax, 0x20(%rsp)
movq 0x48(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rax
cmpq 0x20(%rsp), %rax
ja 0xa7c3e
movq 0x50(%rsp), %rax
movq 0x30(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rax
cmpq 0x18(%rsp), %rax
jae 0xa7b37
movq 0x50(%rsp), %rax
movq 0x28(%rsp), %rcx
movq (%rax,%rcx,8), %rdx
movq 0x50(%rsp), %rax
movq 0x30(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
movq 0x8(%rsp), %rdx
movq 0x50(%rsp), %rax
movq 0x28(%rsp), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, 0x28(%rsp)
movq %rdx, (%rax,%rcx,8)
jmp 0xa7c29
movq 0x8(%rsp), %rax
cmpq 0x10(%rsp), %rax
jb 0xa7c27
jmp 0xa7b49
movq 0x50(%rsp), %rax
movq 0x20(%rsp), %rcx
movq (%rax,%rcx,8), %rcx
xorl %eax, %eax
cmpq 0x10(%rsp), %rcx
movb %al, 0x7(%rsp)
jbe 0xa7b75
movq 0x30(%rsp), %rax
cmpq 0x20(%rsp), %rax
setb %al
movb %al, 0x7(%rsp)
movb 0x7(%rsp), %al
testb $0x1, %al
jne 0xa7b7f
jmp 0xa7b8f
movq 0x20(%rsp), %rax
addq $-0x1, %rax
movq %rax, 0x20(%rsp)
jmp 0xa7b49
movq 0x50(%rsp), %rax
movq 0x20(%rsp), %rcx
movq (%rax,%rcx,8), %rax
cmpq 0x18(%rsp), %rax
jae 0xa7bea
movq 0x50(%rsp), %rax
movq 0x28(%rsp), %rcx
movq (%rax,%rcx,8), %rdx
movq 0x50(%rsp), %rax
movq 0x30(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
movq 0x50(%rsp), %rax
movq 0x20(%rsp), %rcx
movq (%rax,%rcx,8), %rdx
movq 0x50(%rsp), %rax
movq 0x28(%rsp), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, 0x28(%rsp)
movq %rdx, (%rax,%rcx,8)
jmp 0xa7c06
movq 0x50(%rsp), %rax
movq 0x20(%rsp), %rcx
movq (%rax,%rcx,8), %rdx
movq 0x50(%rsp), %rax
movq 0x30(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
movq 0x8(%rsp), %rdx
movq 0x50(%rsp), %rax
movq 0x20(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
movq 0x20(%rsp), %rax
addq $-0x1, %rax
movq %rax, 0x20(%rsp)
jmp 0xa7c29
jmp 0xa7c2b
movq 0x30(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x30(%rsp)
jmp 0xa7ac8
jmp 0xa7c40
cmpq $0x0, 0x28(%rsp)
ja 0xa7c80
movq 0x594351(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x46e3ba(%rip), %rsi    # 0x516013
leaq 0x48cbc8(%rip), %rdx    # 0x534828
leaq 0x48cb76(%rip), %rcx    # 0x5347dd
leaq 0x48cb90(%rip), %r8     # 0x5347fe
movl $0xc7, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0xa7c82
movq 0x28(%rsp), %rax
addq $-0x1, %rax
movq %rax, 0x28(%rsp)
movq 0x20(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x20(%rsp)
movq 0x50(%rsp), %rax
movq 0x28(%rsp), %rcx
movq (%rax,%rcx,8), %rdx
movq 0x50(%rsp), %rax
movq 0x48(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
movq 0x18(%rsp), %rdx
movq 0x50(%rsp), %rax
movq 0x28(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
movq 0x50(%rsp), %rax
movq 0x20(%rsp), %rcx
movq (%rax,%rcx,8), %rdx
movq 0x50(%rsp), %rax
movq 0x40(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
movq 0x10(%rsp), %rdx
movq 0x50(%rsp), %rax
movq 0x20(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
cmpq $0x1, 0x28(%rsp)
jb 0xa7d1c
movq 0x50(%rsp), %rdi
movq 0x48(%rsp), %rsi
movq 0x28(%rsp), %rdx
subq $0x1, %rdx
callq 0xa79a0
movq 0x50(%rsp), %rdi
movq 0x28(%rsp), %rsi
movq 0x20(%rsp), %rdx
callq 0xa79a0
movq 0x50(%rsp), %rdi
movq 0x20(%rsp), %rsi
addq $0x1, %rsi
movq 0x40(%rsp), %rdx
callq 0xa79a0
jmp 0xa7d4a
addq $0x58, %rsp
retq
nop