// File: /workspace/github_c_makefile_star2_O2/zenkj[P]luajit-arm64/src/host/minilua.c
// Function: auxsort
static void auxsort(lua_State*L,int l,int u){
while(l<u){
int i,j;
lua_rawgeti(L,1,l);
lua_rawgeti(L,1,u);
if(sort_comp(L,-1,-2))
set2(L,l,u);
else
lua_pop(L,2);
if(u-l==1)break;
i=(l+u)/2;
lua_rawgeti(L,1,i);
lua_rawgeti(L,1,l);
if(sort_comp(L,-2,-1))
set2(L,i,l);
else{
lua_pop(L,1);
lua_rawgeti(L,1,u);
if(sort_comp(L,-1,-2))
set2(L,i,u);
else
lua_pop(L,2);
}
if(u-l==2)break;
lua_rawgeti(L,1,i);
lua_pushvalue(L,-1);
lua_rawgeti(L,1,u-1);
set2(L,i,u-1);
i=l;j=u-1;
for(;;){
while(lua_rawgeti(L,1,++i),sort_comp(L,-1,-2)){
if(i>u)luaL_error(L,"invalid order function for sorting");
lua_pop(L,1);
}
while(lua_rawgeti(L,1,--j),sort_comp(L,-3,-1)){
if(j<l)luaL_error(L,"invalid order function for sorting");
lua_pop(L,1);
}
if(j<i){
lua_pop(L,3);
break;
}
set2(L,i,j);
}
lua_rawgeti(L,1,u-1);
lua_rawgeti(L,1,i);
set2(L,u-1,i);
if(i-l<u-i){
j=l;i=i-1;l=i+2;
}
else{
j=i+1;i=u;u=j-2;
}
auxsort(L,j,i);
}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, %ebp
movl %esi, %r12d
movq %rdi, %rbx
pushq $0x1
popq %r13
pushq $-0x1
popq %r14
movl %ebp, %r15d
subl %r12d, %r15d
jle 0xec3b
movq %rbx, %rdi
movl %r13d, %esi
movl %r12d, %edx
callq 0xe3d0
movq %rbx, %rdi
movl %r13d, %esi
movl %ebp, %edx
callq 0xe3d0
movq %rbx, %rdi
movl %r14d, %esi
pushq $-0x2
popq %rdx
callq 0xec5b
testl %eax, %eax
movq %r12, 0x10(%rsp)
je 0xea31
movq %rbx, %rdi
movl %r12d, %esi
movl %ebp, %edx
callq 0xed14
jmp 0xea36
addq $-0x20, 0x10(%rbx)
cmpl $0x1, %r15d
movq 0x10(%rsp), %r12
je 0xec3b
leal (%r12,%rbp), %eax
cltd
pushq $0x2
popq %rcx
idivl %ecx
movq %rbp, 0x8(%rsp)
movl %eax, %ebp
movq %rbx, %rdi
movl %r13d, %esi
movl %eax, %edx
callq 0xe3d0
movq %rbx, %rdi
movl %r13d, %esi
movl %r12d, %edx
callq 0xe3d0
movq %rbx, %rdi
pushq $-0x2
popq %rsi
movl %r14d, %edx
callq 0xec5b
testl %eax, %eax
movl %ebp, 0x4(%rsp)
je 0xea9b
movq %rbx, %rdi
movl %ebp, %esi
movl %r12d, %edx
callq 0xed14
movq 0x8(%rsp), %rbp
jmp 0xead9
addq $-0x10, 0x10(%rbx)
movq %rbx, %rdi
movl %r13d, %esi
movq 0x8(%rsp), %rbp
movl %ebp, %edx
callq 0xe3d0
movq %rbx, %rdi
movl %r14d, %esi
pushq $-0x2
popq %rdx
callq 0xec5b
testl %eax, %eax
je 0xead4
movq %rbx, %rdi
movl 0x4(%rsp), %esi
movl %ebp, %edx
callq 0xed14
jmp 0xead9
addq $-0x20, 0x10(%rbx)
cmpl $0x2, %r15d
movq 0x10(%rsp), %r12
je 0xec3b
movq %rbx, %rdi
movl %r13d, %esi
movl 0x4(%rsp), %r15d
movl %r15d, %edx
callq 0xe3d0
movq %rbx, %rdi
movl %r14d, %esi
callq 0x8917
decl %ebp
movq %rbx, %rdi
movl %r13d, %esi
movl %ebp, %edx
callq 0xe3d0
movq %rbx, %rdi
movl %r15d, %esi
movl %ebp, %edx
callq 0xed14
movl %ebp, 0x4(%rsp)
movl %ebp, %r15d
incl %r12d
leal -0x1(%r12), %ebp
movq %rbx, %rdi
movl %r13d, %esi
movl %r12d, %edx
callq 0xe3d0
movq %rbx, %rdi
movl %r14d, %esi
pushq $-0x2
popq %rdx
callq 0xec5b
testl %eax, %eax
je 0xeb62
cmpl 0x8(%rsp), %ebp
jge 0xec4a
addq $-0x10, 0x10(%rbx)
jmp 0xeb29
movl %r13d, %r14d
leal -0x1(%r15), %r13d
movq %rbx, %rdi
movl %r14d, %esi
movl %r13d, %edx
callq 0xe3d0
movq %rbx, %rdi
pushq $-0x3
popq %rsi
pushq $-0x1
popq %rdx
callq 0xec5b
testl %eax, %eax
je 0xeb9e
cmpl 0x10(%rsp), %r15d
jle 0xec4a
addq $-0x10, 0x10(%rbx)
movl %r13d, %r15d
jmp 0xeb65
cmpl %r12d, %r15d
jle 0xebc0
decl %r15d
movq %rbx, %rdi
movl %r12d, %esi
movl %r15d, %edx
callq 0xed14
movl %r14d, %r13d
pushq $-0x1
popq %r14
jmp 0xeb29
addq $-0x30, 0x10(%rbx)
movq %rbx, %rdi
movl %r14d, %esi
movl 0x4(%rsp), %r15d
movl %r15d, %edx
callq 0xe3d0
movq %rbx, %rdi
movl %r14d, %esi
movl %r12d, %edx
callq 0xe3d0
movq %rbx, %rdi
movl %r15d, %esi
movl %r12d, %edx
callq 0xed14
movl %r12d, %eax
movq 0x10(%rsp), %rsi
subl %esi, %eax
movq 0x8(%rsp), %rdx
movl %edx, %ecx
subl %r12d, %ecx
incl %r12d
cmpl %ecx, %eax
movl %esi, %r15d
cmovll %r12d, %r15d
movl %ebp, %r13d
cmovll %edx, %r13d
cmovll %ebp, %edx
cmovll %esi, %r12d
movq %rbx, %rdi
movl %r12d, %esi
callq 0xe9c6
movl %r15d, %r12d
movl %r13d, %ebp
movl %r14d, %r13d
jmp 0xe9e0
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x4329(%rip), %rsi      # 0x12f7a
movq %rbx, %rdi
xorl %eax, %eax
callq 0x9546