// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/pqsort.c
// Function: pqsort
static void
_pqsort(void *a, size_t n, size_t es,
    int (*cmp) (const void *, const void *), void *lrange, void *rrange)
{
	char *pa, *pb, *pc, *pd, *pl, *pm, *pn;
	size_t d, r;
	int swaptype, cmp_result;

loop:	SWAPINIT(a, es);
	if (n < 7) {
		for (pm = (char *) a + es; pm < (char *) a + n * es; pm += es)
			for (pl = pm; pl > (char *) a && cmp(pl - es, pl) > 0;
			     pl -= es)
				swap(pl, pl - es);
		return;
	}
	pm = (char *) a + (n / 2) * es;
	if (n > 7) {
		pl = (char *) a;
		pn = (char *) a + (n - 1) * es;
		if (n > 40) {
			d = (n / 8) * es;
			pl = med3(pl, pl + d, pl + 2 * d, cmp);
			pm = med3(pm - d, pm, pm + d, cmp);
			pn = med3(pn - 2 * d, pn - d, pn, cmp);
		}
		pm = med3(pl, pm, pn, cmp);
	}
	swap(a, pm);
	pa = pb = (char *) a + es;

	pc = pd = (char *) a + (n - 1) * es;
	for (;;) {
		while (pb <= pc && (cmp_result = cmp(pb, a)) <= 0) {
			if (cmp_result == 0) {
				swap(pa, pb);
				pa += es;
			}
			pb += es;
		}
		while (pb <= pc && (cmp_result = cmp(pc, a)) >= 0) {
			if (cmp_result == 0) {
				swap(pc, pd);
				pd -= es;
			}
			pc -= es;
		}
		if (pb > pc)
			break;
		swap(pb, pc);
		pb += es;
		pc -= es;
	}

	pn = (char *) a + n * es;
	r = min(pa - (char *) a, pb - pa);
	vecswap(a, pb - r, r);
	r = min((size_t)(pd - pc), pn - pd - es);
	vecswap(pb, pn - r, r);
	if ((r = pb - pa) > es) {
                void *_l = a, *_r = ((unsigned char*)a)+r-1;
                if (!((lrange < _l && rrange < _l) ||
                    (lrange > _r && rrange > _r)))
		    _pqsort(a, r / es, es, cmp, lrange, rrange);
        }
	if ((r = pd - pc) > es) {
                void *_l, *_r;

		/* Iterate rather than recurse to save stack space */
		a = pn - r;
		n = r / es;

                _l = a;
                _r = ((unsigned char*)a)+r-1;
                if (!((lrange < _l && rrange < _l) ||
                    (lrange > _r && rrange > _r)))
		    goto loop;
	}
/*		qsort(pn - r, r / es, es, cmp);*/
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rcx, 0x10(%rsp)
movq %rdx, %r14
movq %rsi, %rbp
movq %rdi, %rsi
movq %rdx, %rdi
negq %rdi
xorl %eax, %eax
cmpq $0x8, %rdx
setne %al
movl %eax, 0x5c(%rsp)
movq %rdx, %rbx
shrq $0x3, %rbx
movq %rdi, 0x30(%rsp)
movq %r9, 0x70(%rsp)
movq %r8, 0x68(%rsp)
movq %rsi, %rax
orq %r14, %rax
movq %rax, 0x28(%rsp)
testb $0x7, %al
movl $0x2, %eax
cmovel 0x5c(%rsp), %eax
movl %eax, 0x24(%rsp)
cmpq $0x6, %rbp
movq %rsi, 0x8(%rsp)
jbe 0x39036
movq %rbp, %r13
shrq %r13
imulq %r14, %r13
addq %rsi, %r13
cmpq $0x7, %rbp
movq %rbp, 0x48(%rsp)
je 0x38cb8
leaq -0x1(%rbp), %r12
imulq %r14, %r12
addq %rsi, %r12
cmpq $0x29, %rbp
jb 0x38b36
movq %r12, 0x40(%rsp)
shrq $0x3, %rbp
imulq %r14, %rbp
leaq (%rsi,%rbp), %r15
leaq (%rsi,%rbp,2), %rax
movq %rax, 0x38(%rsp)
movq %rsi, %rdi
movq %r15, %rsi
movq 0x10(%rsp), %r12
callq *%r12
movl %eax, 0x50(%rsp)
movq %r15, 0x18(%rsp)
movq %r15, %rdi
movq 0x38(%rsp), %rsi
movq %rsi, %r15
callq *%r12
cmpl $0x0, 0x50(%rsp)
js 0x38b3e
testl %eax, %eax
jg 0x38b5b
movq 0x8(%rsp), %rdi
movq %r15, %rsi
callq *0x10(%rsp)
testl %eax, %eax
cmovsq 0x8(%rsp), %r15
jmp 0x38b56
movq %rsi, %rdi
jmp 0x38c44
testl %eax, %eax
js 0x38b5b
movq 0x8(%rsp), %rdi
movq %r15, %rsi
callq *0x10(%rsp)
testl %eax, %eax
cmovnsq 0x8(%rsp), %r15
movq %r15, 0x18(%rsp)
movq %r13, %rdi
subq %rbp, %rdi
movq %r13, %r15
addq %rbp, %r15
movq %rdi, 0x60(%rsp)
movq %r13, %rsi
movq 0x10(%rsp), %r12
callq *%r12
movl %eax, 0x38(%rsp)
movq %r13, %rdi
movq %r15, 0x50(%rsp)
movq %r15, %rsi
callq *%r12
cmpl $0x0, 0x38(%rsp)
js 0x38bab
testl %eax, %eax
movq 0x40(%rsp), %r12
jg 0x38bce
movq 0x60(%rsp), %r15
movq %r15, %rdi
movq 0x50(%rsp), %r13
movq %r13, %rsi
jmp 0x38bc4
testl %eax, %eax
movq 0x40(%rsp), %r12
js 0x38bce
movq 0x60(%rsp), %r13
movq %r13, %rdi
movq 0x50(%rsp), %r15
movq %r15, %rsi
callq *0x10(%rsp)
testl %eax, %eax
cmovsq %r15, %r13
leaq (,%rbp,2), %rax
negq %rbp
movq %r12, %r15
subq %rax, %r15
addq %r12, %rbp
movq %r15, %rdi
movq %rbp, %rsi
movq 0x10(%rsp), %r12
callq *%r12
movl %eax, 0x38(%rsp)
movq %rbp, %rdi
movq 0x40(%rsp), %rsi
callq *%r12
cmpl $0x0, 0x38(%rsp)
js 0x38c21
testl %eax, %eax
jg 0x38c3c
movq %r15, %rdi
movq 0x40(%rsp), %r12
movq %r12, %rsi
callq *0x10(%rsp)
testl %eax, %eax
cmovsq %r15, %r12
jmp 0x38c3f
testl %eax, %eax
js 0x38c3c
movq %r15, %rdi
movq 0x40(%rsp), %r12
movq %r12, %rsi
callq *0x10(%rsp)
testl %eax, %eax
cmovnsq %r15, %r12
jmp 0x38c3f
movq %rbp, %r12
movq 0x18(%rsp), %rdi
movq %rdi, 0x18(%rsp)
movq %r13, %rsi
movq 0x10(%rsp), %r15
callq *%r15
movl %eax, %ebp
movq %r13, %rdi
movq %r12, %rsi
callq *%r15
testl %ebp, %ebp
js 0x38c90
testl %eax, %eax
movq 0x48(%rsp), %rbp
movq 0x8(%rsp), %rsi
jg 0x38cb8
movq 0x18(%rsp), %r15
movq %r15, %rdi
movq %r12, %rsi
callq *0x10(%rsp)
movq 0x8(%rsp), %rsi
testl %eax, %eax
cmovsq %r15, %r12
movq %r12, %r13
jmp 0x38cb8
testl %eax, %eax
movq 0x48(%rsp), %rbp
movq 0x8(%rsp), %rsi
js 0x38cb8
movq 0x18(%rsp), %r13
movq %r13, %rdi
movq %r12, %rsi
callq *0x10(%rsp)
movq 0x8(%rsp), %rsi
testl %eax, %eax
cmovsq %r12, %r13
cmpl $0x0, 0x24(%rsp)
je 0x38ce2
testb $0x7, 0x28(%rsp)
je 0x38cf2
xorl %eax, %eax
movb (%rsi,%rax), %cl
movb (%r13,%rax), %dl
movb %dl, (%rsi,%rax)
movb %cl, (%r13,%rax)
incq %rax
cmpq %rax, %r14
jne 0x38cc8
jmp 0x38d0e
movq (%rsi), %rax
movq (%r13), %rcx
movq %rcx, (%rsi)
movq %rax, (%r13)
jmp 0x38d0e
xorl %eax, %eax
movq (%rsi,%rax,8), %rcx
movq (%r13,%rax,8), %rdx
movq %rdx, (%rsi,%rax,8)
movq %rcx, (%r13,%rax,8)
incq %rax
cmpq %rax, %rbx
jne 0x38cf4
leaq (%rsi,%r14), %r13
leaq -0x1(%rbp), %r15
imulq %r14, %r15
addq %rsi, %r15
movq %r15, %rbp
movq %r13, %r12
cmpq %rbp, %r13
ja 0x38e25
movq %r13, %rdi
callq *0x10(%rsp)
testl %eax, %eax
jg 0x38daa
je 0x38d40
movq 0x8(%rsp), %rsi
jmp 0x38da2
cmpl $0x0, 0x24(%rsp)
movq 0x8(%rsp), %rsi
je 0x38d71
testb $0x7, 0x28(%rsp)
je 0x38d83
xorl %eax, %eax
movb (%r12,%rax), %cl
movb (%r13,%rax), %dl
movb %dl, (%r12,%rax)
movb %cl, (%r13,%rax)
incq %rax
cmpq %rax, %r14
jne 0x38d55
jmp 0x38d9f
movq (%r12), %rax
movq (%r13), %rcx
movq %rcx, (%r12)
movq %rax, (%r13)
jmp 0x38d9f
xorl %eax, %eax
movq (%r12,%rax,8), %rcx
movq (%r13,%rax,8), %rdx
movq %rdx, (%r12,%rax,8)
movq %rcx, (%r13,%rax,8)
incq %rax
cmpq %rax, %rbx
jne 0x38d85
addq %r14, %r12
addq %r14, %r13
jmp 0x38d23
movq 0x8(%rsp), %rsi
jmp 0x38e25
je 0x38dbf
movq 0x30(%rsp), %rdi
movq 0x8(%rsp), %rsi
jmp 0x38e22
cmpl $0x0, 0x24(%rsp)
movq 0x30(%rsp), %rdi
movq 0x8(%rsp), %rsi
je 0x38df3
testb $0x7, 0x28(%rsp)
je 0x38e03
xorl %eax, %eax
movb (%rbp,%rax), %cl
movb (%r15,%rax), %dl
movb %dl, (%rbp,%rax)
movb %cl, (%r15,%rax)
incq %rax
cmpq %rax, %r14
jne 0x38dd9
jmp 0x38e1f
movq (%rbp), %rax
movq (%r15), %rcx
movq %rcx, (%rbp)
movq %rax, (%r15)
jmp 0x38e1f
xorl %eax, %eax
movq (%rbp,%rax,8), %rcx
movq (%r15,%rax,8), %rdx
movq %rdx, (%rbp,%rax,8)
movq %rcx, (%r15,%rax,8)
incq %rax
cmpq %rax, %rbx
jne 0x38e05
addq %rdi, %r15
addq %rdi, %rbp
cmpq %rbp, %r13
ja 0x38eb8
movq %rbp, %rdi
callq *0x10(%rsp)
testl %eax, %eax
jns 0x38db1
cmpl $0x0, 0x24(%rsp)
je 0x38e73
testb $0x7, 0x28(%rsp)
movq 0x30(%rsp), %rdi
movq 0x8(%rsp), %rsi
je 0x38e8f
xorl %eax, %eax
movb (%r13,%rax), %cl
movb (%rbp,%rax), %dl
movb %dl, (%r13,%rax)
movb %cl, (%rbp,%rax)
incq %rax
cmpq %rax, %r14
jne 0x38e57
jmp 0x38ead
movq (%r13), %rax
movq (%rbp), %rcx
movq %rcx, (%r13)
movq %rax, (%rbp)
movq 0x30(%rsp), %rdi
movq 0x8(%rsp), %rsi
jmp 0x38ead
xorl %eax, %eax
movq (%r13,%rax,8), %rcx
movq (%rbp,%rax,8), %rdx
movq %rdx, (%r13,%rax,8)
movq %rcx, (%rbp,%rax,8)
incq %rax
cmpq %rax, %rbx
jne 0x38e91
addq %r14, %r13
addq %rdi, %rbp
jmp 0x38d23
movq %r13, %rax
subq %r12, %rax
subq %rsi, %r12
cmpq %rax, %r12
cmovgeq %rax, %r12
testq %r12, %r12
je 0x38f14
movq %r13, %rcx
subq %r12, %rcx
testb $0x7, 0x28(%rsp)
je 0x38ef6
xorl %edx, %edx
movb (%rsi,%rdx), %r8b
movb (%rcx,%rdx), %dil
movb %dil, (%rsi,%rdx)
movb %r8b, (%rcx,%rdx)
incq %rdx
cmpq %rdx, %r12
jne 0x38edc
jmp 0x38f14
shrq $0x3, %r12
xorl %edx, %edx
movq (%rsi,%rdx,8), %r8
movq (%rcx,%rdx,8), %rdi
movq %rdi, (%rsi,%rdx,8)
movq %r8, (%rcx,%rdx,8)
incq %rdx
cmpq %rdx, %r12
jne 0x38efc
movq 0x48(%rsp), %r12
imulq %r14, %r12
addq %rsi, %r12
movq %r15, %r10
subq %rbp, %r10
addq %r14, %r15
movq %r12, %rcx
subq %r15, %rcx
cmpq %rcx, %r10
cmovbq %r10, %rcx
testq %rcx, %rcx
je 0x38f88
movq %r12, %rdx
subq %rcx, %rdx
testb $0x7, 0x28(%rsp)
je 0x38f67
xorl %r9d, %r9d
movb (%r13,%r9), %dil
movb (%rdx,%r9), %r8b
movb %r8b, (%r13,%r9)
movb %dil, (%rdx,%r9)
incq %r9
cmpq %r9, %rcx
jne 0x38f4b
jmp 0x38f88
shrq $0x3, %rcx
xorl %r9d, %r9d
movq (%r13,%r9,8), %rdi
movq (%rdx,%r9,8), %r8
movq %r8, (%r13,%r9,8)
movq %rdi, (%rdx,%r9,8)
incq %r9
cmpq %r9, %rcx
jne 0x38f6e
cmpq %r14, %rax
movq 0x30(%rsp), %rdi
movq 0x70(%rsp), %r15
movq 0x68(%rsp), %r13
jbe 0x38fec
cmpq %r13, %rsi
seta %cl
cmpq %r15, %rsi
seta %dl
testb %dl, %cl
jne 0x38fec
leaq (%rsi,%rax), %rcx
decq %rcx
cmpq %r13, %rcx
setb %dl
cmpq %r15, %rcx
setb %cl
testb %cl, %dl
jne 0x38fec
xorl %edx, %edx
divq %r14
movq %rsi, %rdi
movq %rax, %rsi
movq %r14, %rdx
movq 0x10(%rsp), %rcx
movq %r13, %r8
movq %r15, %r9
movq %r10, %rbp
callq 0x38a3a
movq %rbp, %r10
movq 0x30(%rsp), %rdi
cmpq %r14, %r10
jbe 0x39104
movq %r12, %rsi
subq %r10, %rsi
cmpq %r13, %rsi
seta %al
cmpq %r15, %rsi
seta %cl
testb %cl, %al
jne 0x39104
decq %r12
movq %r10, %rax
xorl %edx, %edx
divq %r14
cmpq %r13, %r12
setae %cl
cmpq %r15, %r12
setae %dl
orb %cl, %dl
movq %rax, %rbp
jne 0x38a7f
jmp 0x39104
imulq %r14, %rbp
cmpq %r14, %rbp
jle 0x39104
addq %rsi, %rbp
leaq (%rsi,%r14), %r12
movq %rsi, 0x18(%rsp)
movq %rbp, 0x48(%rsp)
cmpq %rsi, %r12
jbe 0x390ee
movq 0x18(%rsp), %rbp
movq %r12, %r15
movq %r15, %r13
addq %rdi, %r15
movq %r15, %rdi
movq %r13, %rsi
callq *0x10(%rsp)
movq 0x8(%rsp), %rsi
movq 0x30(%rsp), %rdi
testl %eax, %eax
jle 0x390ee
cmpl $0x0, 0x24(%rsp)
je 0x390b2
testb $0x7, 0x28(%rsp)
je 0x390c2
xorl %eax, %eax
movb (%r13,%rax), %cl
movb (%rbp,%rax), %dl
movb %dl, (%r13,%rax)
movb %cl, (%rbp,%rax)
incq %rax
movq %rdi, %rcx
addq %rax, %rcx
jne 0x39093
jmp 0x390e2
movq (%r13), %rax
movq (%r15), %rcx
movq %rcx, (%r13)
movq %rax, (%r15)
jmp 0x390e2
leaq (%r14,%rbp), %rax
xorl %ecx, %ecx
movq (%rax,%rcx,8), %rdx
movq (%rbp,%rcx,8), %r8
movq %r8, (%rax,%rcx,8)
movq %rdx, (%rbp,%rcx,8)
incq %rcx
cmpq %rcx, %rbx
jne 0x390c8
addq %rdi, %rbp
cmpq %rsi, %r15
ja 0x39065
addq %r14, %r12
addq %r14, 0x18(%rsp)
movq 0x48(%rsp), %rbp
cmpq %rbp, %r12
jb 0x39054
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop