// File: /workspace/github_c_makefile_star2_O3/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
cmpl %edx, %esi
jge 0x11182
movl %edx, %r14d
movl %esi, %ebp
movq %rdi, %rbx
movq %rbx, %rdi
movl $0x1, %esi
movl %ebp, %edx
callq 0x106bf
movq %rbx, %rdi
movl $0x1, %esi
movl %r14d, %edx
callq 0x106bf
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movl $0xfffffffe, %edx       # imm = 0xFFFFFFFE
callq 0x111a2
testl %eax, %eax
je 0x10ebc
movq %rbx, %rdi
movl $0x1, %esi
movl %ebp, %edx
callq 0x3930
movq %rbx, %rdi
movl $0x1, %esi
movl %r14d, %edx
callq 0x3930
jmp 0x10ec1
addq $-0x20, 0x10(%rbx)
movl %r14d, %r12d
subl %ebp, %r12d
cmpl $0x1, %r12d
je 0x11182
leal (%r14,%rbp), %eax
movl %eax, %r13d
shrl $0x1f, %r13d
addl %eax, %r13d
sarl %r13d
movq %rbx, %rdi
movl $0x1, %esi
movl %r13d, %edx
callq 0x106bf
movq %rbx, %rdi
movl $0x1, %esi
movl %ebp, %edx
callq 0x106bf
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x111a2
testl %eax, %eax
je 0x10f36
movq %rbx, %rdi
movl $0x1, %esi
movl %r13d, %r15d
movl %r13d, %edx
callq 0x3930
movq %rbx, %rdi
movl $0x1, %esi
movl %ebp, %edx
jmp 0x10f83
movl %r13d, %r15d
addq $-0x10, 0x10(%rbx)
movq %rbx, %rdi
movl $0x1, %esi
movl %r14d, %edx
callq 0x106bf
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movl $0xfffffffe, %edx       # imm = 0xFFFFFFFE
callq 0x111a2
testl %eax, %eax
je 0x11178
movq %rbx, %rdi
movl $0x1, %esi
movl %r15d, %edx
callq 0x3930
movq %rbx, %rdi
movl $0x1, %esi
movl %r14d, %edx
callq 0x3930
cmpl $0x2, %r12d
je 0x11182
movq %rbx, %rdi
movl $0x1, %esi
movl %r15d, %edx
callq 0x106bf
movq 0x10(%rbx), %rax
movq -0x10(%rax), %rcx
movq %rcx, (%rax)
movl -0x8(%rax), %ecx
movl %ecx, 0x8(%rax)
addq $0x10, 0x10(%rbx)
leal -0x1(%r14), %r12d
movq %rbx, %rdi
movl $0x1, %esi
movl %r12d, %edx
callq 0x106bf
movl %r15d, %edx
movl %r12d, 0xc(%rsp)
movl %r12d, %r13d
movl %ebp, %r15d
movq %rbx, %rdi
movl $0x1, %esi
callq 0x3930
movq %rbx, %rdi
movl $0x1, %esi
movl %r13d, %edx
callq 0x3930
leal 0x1(%r15), %edx
movq %rbx, %rdi
movl $0x1, %esi
movl %edx, 0x8(%rsp)
callq 0x106bf
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movl $0xfffffffe, %edx       # imm = 0xFFFFFFFE
callq 0x111a2
movl %r15d, %ecx
testl %eax, %eax
je 0x11068
cmpl %r14d, %r15d
jge 0x11191
addq $-0x10, 0x10(%rbx)
leal 0x2(%r15), %edx
movq %rbx, %rdi
movl $0x1, %esi
callq 0x106bf
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movl $0xfffffffe, %edx       # imm = 0xFFFFFFFE
callq 0x111a2
incl %r15d
testl %eax, %eax
jne 0x11025
leal 0x1(%r15), %eax
movl %eax, 0x8(%rsp)
movl %r15d, %ecx
movq %rcx, 0x10(%rsp)
leal -0x1(%r13), %r12d
movq %rbx, %rdi
movl $0x1, %esi
movl %r12d, %edx
callq 0x106bf
movq %rbx, %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x111a2
testl %eax, %eax
je 0x110d3
cmpl %ebp, %r13d
jle 0x11191
addq $-0x10, 0x10(%rbx)
leal -0x2(%r13), %edx
movq %rbx, %rdi
movl $0x1, %esi
callq 0x106bf
movq %rbx, %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x111a2
decl %r13d
testl %eax, %eax
jne 0x11097
leal -0x1(%r13), %r12d
movl 0x8(%rsp), %edx
movl %edx, %r15d
cmpl %edx, %r13d
movl %r12d, %r13d
jg 0x10fda
addq $-0x30, 0x10(%rbx)
movq %rbx, %rdi
movl $0x1, %esi
movl %edx, %r15d
movl 0xc(%rsp), %r12d
movl %r12d, %edx
callq 0x106bf
movq %rbx, %rdi
movl $0x1, %esi
movl %r15d, %edx
callq 0x106bf
movq %rbx, %rdi
movl $0x1, %esi
movl %r12d, %edx
callq 0x3930
movq %rbx, %rdi
movl $0x1, %esi
movl %r15d, %edx
callq 0x3930
movl %r14d, %eax
subl %r15d, %eax
subl %ebp, %r15d
movq 0x10(%rsp), %rcx
leal 0x2(%rcx), %esi
cmpl %eax, %r15d
movl %ebp, %r15d
cmovll %esi, %r15d
movl %ecx, %r12d
cmovll %r14d, %r12d
cmovll %ecx, %r14d
cmovll %ebp, %esi
movq %rbx, %rdi
movl %r14d, %edx
callq 0x10e48
movl %r12d, %r14d
movl %r15d, %ebp
cmpl %r12d, %r15d
jl 0x10e66
jmp 0x11182
addq $-0x20, 0x10(%rbx)
jmp 0x10f88
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x4de2(%rip), %rsi      # 0x15f7a
movq %rbx, %rdi
xorl %eax, %eax
callq 0xa940