// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/core/msort.c
// Function: setup
static void
setup(unsigned char *list1, unsigned char *list2, size_t n, size_t size,
      void *cmpinfo, GtCompareWithData cmp)
{
  int i, length, size2, tmp, sense;
  unsigned char *f1, *f2, *s, *l2, *last, *p2;

  size2 = size*2;
  if (n <= 5) {
    insertionsort(list1, n, size, cmpinfo, cmp);
    *EVAL(list2) = (unsigned char*) list2 + n*size;
    return;
  }
  /*
   * Avoid running pointers out of bounds; limit n to evens
   * for simplicity.
   */
  i = 4 + (n & 1);
  insertionsort(list1 + (n - i) * size, i, size, cmpinfo, cmp);
  last = list1 + size * (n - i);
  *EVAL(list2 + (last - list1)) = list2 + n * size;

#ifdef NATURAL
  p2 = list2;
  f1 = list1;
  sense = (cmp(f1, f1 + size, cmpinfo) > 0);
  for (; f1 < last; sense = !sense) {
    length = 2;
          /* Find pairs with same sense. */
    for (f2 = f1 + size2; f2 < last; f2 += size2) {
      if ((cmp(f2, f2+ size, cmpinfo) > 0) != sense)
        break;
      length += 2;
    }
    if (length < THRESHOLD) {   /* Pairwise merge */
      do {
        p2 = *EVAL(p2) = f1 + size2 - list1 + list2;
        if (sense > 0)
          msort_swap (f1, f1 + size);
      } while ((f1 += size2) < f2);
    } else {        /* Natural merge */
      l2 = f2;
      for (f2 = f1 + size2; f2 < l2; f2 += size2) {
        if ((cmp(f2-size, f2, cmpinfo) > 0) != sense) {
          p2 = *EVAL(p2) = f2 - list1 + list2;
          if (sense > 0)
            msort_reverse(f1, f2-size);
          f1 = f2;
        }
      }
      if (sense > 0)
        msort_reverse (f1, f2-size);
      f1 = f2;
      if (f2 < last || cmp(f2 - size, f2, cmpinfo) > 0)
        p2 = *EVAL(p2) = f2 - list1 + list2;
      else
        p2 = *EVAL(p2) = list2 + n*size;
    }
  }
#else   /* pairwise merge only. */
  for (f1 = list1, p2 = list2; f1 < last; f1 += size2) {
    p2 = *EVAL(p2) = p2 + size2;
    if (cmp (f1, f1 + size, cmpinfo) > 0)
      msort_swap(f1, f1 + size);
  }
#endif /* NATURAL */
}

// Assembly:
subq $0x78, %rsp
movq %rdi, 0x70(%rsp)
movq %rsi, 0x68(%rsp)
movq %rdx, 0x60(%rsp)
movq %rcx, 0x58(%rsp)
movq %r8, 0x50(%rsp)
movq %r9, 0x48(%rsp)
movq 0x58(%rsp), %rax
shlq %rax
movl %eax, 0x3c(%rsp)
cmpq $0x5, 0x60(%rsp)
ja 0x8ec84
movq 0x70(%rsp), %rdi
movq 0x60(%rsp), %rsi
movq 0x58(%rsp), %rdx
movq 0x50(%rsp), %rcx
movq 0x48(%rsp), %r8
callq 0x8f180
movq 0x68(%rsp), %rcx
movq 0x60(%rsp), %rax
imulq 0x58(%rsp), %rax
addq %rax, %rcx
movq 0x68(%rsp), %rax
addq $0x8, %rax
addq $-0x1, %rax
subq $0x0, %rax
andq $-0x8, %rax
movq %rcx, (%rax)
jmp 0x8f179
movq 0x60(%rsp), %rax
andq $0x1, %rax
addq $0x4, %rax
movl %eax, 0x44(%rsp)
movq 0x70(%rsp), %rdi
movq 0x60(%rsp), %rax
movslq 0x44(%rsp), %rcx
subq %rcx, %rax
imulq 0x58(%rsp), %rax
addq %rax, %rdi
movslq 0x44(%rsp), %rsi
movq 0x58(%rsp), %rdx
movq 0x50(%rsp), %rcx
movq 0x48(%rsp), %r8
callq 0x8f180
movq 0x70(%rsp), %rax
movq 0x58(%rsp), %rcx
movq 0x60(%rsp), %rdx
movslq 0x44(%rsp), %rsi
subq %rsi, %rdx
imulq %rdx, %rcx
addq %rcx, %rax
movq %rax, 0x8(%rsp)
movq 0x68(%rsp), %rcx
movq 0x60(%rsp), %rax
imulq 0x58(%rsp), %rax
addq %rax, %rcx
movq 0x68(%rsp), %rax
movq 0x8(%rsp), %rdx
movq 0x70(%rsp), %rsi
subq %rsi, %rdx
addq %rdx, %rax
addq $0x8, %rax
addq $-0x1, %rax
subq $0x0, %rax
andq $-0x8, %rax
movq %rcx, (%rax)
movq 0x68(%rsp), %rax
movq %rax, (%rsp)
movq 0x70(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x48(%rsp), %rax
movq 0x28(%rsp), %rdi
movq 0x28(%rsp), %rsi
addq 0x58(%rsp), %rsi
movq 0x50(%rsp), %rdx
callq *%rax
cmpl $0x0, %eax
setg %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, 0x34(%rsp)
movq 0x28(%rsp), %rax
cmpq 0x8(%rsp), %rax
jae 0x8f179
movl $0x2, 0x40(%rsp)
movq 0x28(%rsp), %rax
movslq 0x3c(%rsp), %rcx
addq %rcx, %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
cmpq 0x8(%rsp), %rax
jae 0x8ede9
movq 0x48(%rsp), %rax
movq 0x20(%rsp), %rdi
movq 0x20(%rsp), %rsi
addq 0x58(%rsp), %rsi
movq 0x50(%rsp), %rdx
callq *%rax
cmpl $0x0, %eax
setg %al
andb $0x1, %al
movzbl %al, %eax
cmpl 0x34(%rsp), %eax
je 0x8edc8
jmp 0x8ede9
movl 0x40(%rsp), %eax
addl $0x2, %eax
movl %eax, 0x40(%rsp)
movl 0x3c(%rsp), %ecx
movq 0x20(%rsp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, 0x20(%rsp)
jmp 0x8ed8e
cmpl $0x10, 0x40(%rsp)
jge 0x8eed6
jmp 0x8edf6
movq 0x28(%rsp), %rax
movslq 0x3c(%rsp), %rcx
addq %rcx, %rax
movq 0x70(%rsp), %rcx
subq %rcx, %rax
addq 0x68(%rsp), %rax
movq (%rsp), %rcx
addq $0x8, %rcx
addq $-0x1, %rcx
subq $0x0, %rcx
andq $-0x8, %rcx
movq %rax, (%rcx)
movq %rax, (%rsp)
cmpl $0x0, 0x34(%rsp)
jle 0x8eeb0
movq 0x28(%rsp), %rax
addq 0x58(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x58(%rsp), %rax
movl %eax, 0x44(%rsp)
movq 0x28(%rsp), %rax
movzbl (%rax), %eax
movl %eax, 0x38(%rsp)
movq 0x18(%rsp), %rax
movb (%rax), %cl
movq 0x28(%rsp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, 0x28(%rsp)
movb %cl, (%rax)
movl 0x38(%rsp), %eax
movb %al, %cl
movq 0x18(%rsp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, 0x18(%rsp)
movb %cl, (%rax)
movl 0x44(%rsp), %eax
addl $-0x1, %eax
movl %eax, 0x44(%rsp)
cmpl $0x0, %eax
jne 0x8ee4a
movq 0x58(%rsp), %rdx
movq 0x28(%rsp), %rax
xorl %ecx, %ecx
subq %rdx, %rcx
addq %rcx, %rax
movq %rax, 0x28(%rsp)
jmp 0x8eeb2
movl 0x3c(%rsp), %ecx
movq 0x28(%rsp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, 0x28(%rsp)
cmpq 0x20(%rsp), %rax
jb 0x8edf6
jmp 0x8f15f
movq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x28(%rsp), %rax
movslq 0x3c(%rsp), %rcx
addq %rcx, %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
cmpq 0x10(%rsp), %rax
jae 0x8f027
movq 0x48(%rsp), %rax
movq 0x20(%rsp), %rdi
xorl %ecx, %ecx
subq 0x58(%rsp), %rcx
addq %rcx, %rdi
movq 0x20(%rsp), %rsi
movq 0x50(%rsp), %rdx
callq *%rax
cmpl $0x0, %eax
setg %al
andb $0x1, %al
movzbl %al, %eax
cmpl 0x34(%rsp), %eax
je 0x8f00c
movq 0x20(%rsp), %rax
movq 0x70(%rsp), %rcx
subq %rcx, %rax
addq 0x68(%rsp), %rax
movq (%rsp), %rcx
addq $0x8, %rcx
addq $-0x1, %rcx
subq $0x0, %rcx
andq $-0x8, %rcx
movq %rax, (%rcx)
movq %rax, (%rsp)
cmpl $0x0, 0x34(%rsp)
jle 0x8f002
movq 0x20(%rsp), %rax
xorl %ecx, %ecx
subq 0x58(%rsp), %rcx
addq %rcx, %rax
movq %rax, 0x18(%rsp)
movq 0x58(%rsp), %rax
movl %eax, 0x44(%rsp)
movq 0x28(%rsp), %rax
movzbl (%rax), %eax
movl %eax, 0x38(%rsp)
movq 0x18(%rsp), %rax
movb (%rax), %cl
movq 0x28(%rsp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, 0x28(%rsp)
movb %cl, (%rax)
movl 0x38(%rsp), %eax
movb %al, %cl
movq 0x18(%rsp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, 0x18(%rsp)
movb %cl, (%rax)
movl 0x44(%rsp), %eax
addl $-0x1, %eax
movl %eax, 0x44(%rsp)
cmpl $0x0, %eax
jne 0x8ef8c
movl 0x3c(%rsp), %ecx
movq 0x18(%rsp), %rax
movslq %ecx, %rdx
xorl %ecx, %ecx
subq %rdx, %rcx
addq %rcx, %rax
movq %rax, 0x18(%rsp)
movq 0x28(%rsp), %rax
cmpq 0x18(%rsp), %rax
jb 0x8ef83
jmp 0x8f002
movq 0x20(%rsp), %rax
movq %rax, 0x28(%rsp)
jmp 0x8f00e
movl 0x3c(%rsp), %ecx
movq 0x20(%rsp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, 0x20(%rsp)
jmp 0x8eef2
cmpl $0x0, 0x34(%rsp)
jle 0x8f0c5
movq 0x20(%rsp), %rax
xorl %ecx, %ecx
subq 0x58(%rsp), %rcx
addq %rcx, %rax
movq %rax, 0x18(%rsp)
movq 0x58(%rsp), %rax
movl %eax, 0x44(%rsp)
movq 0x28(%rsp), %rax
movzbl (%rax), %eax
movl %eax, 0x38(%rsp)
movq 0x18(%rsp), %rax
movb (%rax), %cl
movq 0x28(%rsp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, 0x28(%rsp)
movb %cl, (%rax)
movl 0x38(%rsp), %eax
movb %al, %cl
movq 0x18(%rsp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, 0x18(%rsp)
movb %cl, (%rax)
movl 0x44(%rsp), %eax
addl $-0x1, %eax
movl %eax, 0x44(%rsp)
cmpl $0x0, %eax
jne 0x8f04f
movl 0x3c(%rsp), %ecx
movq 0x18(%rsp), %rax
movslq %ecx, %rdx
xorl %ecx, %ecx
subq %rdx, %rcx
addq %rcx, %rax
movq %rax, 0x18(%rsp)
movq 0x28(%rsp), %rax
cmpq 0x18(%rsp), %rax
jb 0x8f046
jmp 0x8f0c5
movq 0x20(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x20(%rsp), %rax
cmpq 0x8(%rsp), %rax
jb 0x8f100
movq 0x48(%rsp), %rax
movq 0x20(%rsp), %rdi
xorl %ecx, %ecx
subq 0x58(%rsp), %rcx
addq %rcx, %rdi
movq 0x20(%rsp), %rsi
movq 0x50(%rsp), %rdx
callq *%rax
cmpl $0x0, %eax
jle 0x8f12f
movq 0x20(%rsp), %rax
movq 0x70(%rsp), %rcx
subq %rcx, %rax
addq 0x68(%rsp), %rax
movq (%rsp), %rcx
addq $0x8, %rcx
addq $-0x1, %rcx
subq $0x0, %rcx
andq $-0x8, %rcx
movq %rax, (%rcx)
movq %rax, (%rsp)
jmp 0x8f15d
movq 0x68(%rsp), %rax
movq 0x60(%rsp), %rcx
imulq 0x58(%rsp), %rcx
addq %rcx, %rax
movq (%rsp), %rcx
addq $0x8, %rcx
addq $-0x1, %rcx
subq $0x0, %rcx
andq $-0x8, %rcx
movq %rax, (%rcx)
movq %rax, (%rsp)
jmp 0x8f15f
jmp 0x8f161
cmpl $0x0, 0x34(%rsp)
setne %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, 0x34(%rsp)
jmp 0x8ed64
addq $0x78, %rsp
retq
nop