// File: /workspace/github_c_makefile_star2_O1/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, %r14d
movl %esi, %ebp
movq %rdi, %rbx
movl %r14d, %r12d
subl %ebp, %r12d
jle 0x104b3
movq %rbx, %rdi
movl $0x1, %esi
movl %ebp, %edx
callq 0xfb01
movq %rbx, %rdi
movl $0x1, %esi
movl %r14d, %edx
callq 0xfb01
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movl $0xfffffffe, %edx       # imm = 0xFFFFFFFE
callq 0x104d3
testl %eax, %eax
je 0x101ef
movq %rbx, %rdi
movl $0x1, %esi
movl %ebp, %edx
callq 0x3933
movq %rbx, %rdi
movl $0x1, %esi
movl %r14d, %edx
callq 0x3933
jmp 0x101f4
addq $-0x20, 0x10(%rbx)
cmpl $0x1, %r12d
je 0x102bb
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 0xfb01
movq %rbx, %rdi
movl $0x1, %esi
movl %ebp, %edx
callq 0xfb01
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x104d3
testl %eax, %eax
je 0x10263
movq %rbx, %rdi
movl $0x1, %esi
movl %r13d, %r15d
movl %r13d, %edx
callq 0x3933
movq %rbx, %rdi
movl $0x1, %esi
movl %ebp, %edx
jmp 0x102b0
movl %r13d, %r15d
addq $-0x10, 0x10(%rbx)
movq %rbx, %rdi
movl $0x1, %esi
movl %r14d, %edx
callq 0xfb01
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movl $0xfffffffe, %edx       # imm = 0xFFFFFFFE
callq 0x104d3
testl %eax, %eax
je 0x104a9
movq %rbx, %rdi
movl $0x1, %esi
movl %r15d, %edx
callq 0x3933
movq %rbx, %rdi
movl $0x1, %esi
movl %r14d, %edx
callq 0x3933
cmpl $0x2, %r12d
jne 0x102c2
xorl %eax, %eax
jmp 0x1049f
movq %rbx, %rdi
movl $0x1, %esi
movl %r15d, %edx
callq 0xfb01
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 0xfb01
movl %r15d, %edx
movl %r12d, 0xc(%rsp)
movl %r12d, %r13d
movl %ebp, %r15d
movq %rbx, %rdi
movl $0x1, %esi
callq 0x3933
movq %rbx, %rdi
movl $0x1, %esi
movl %r13d, %edx
callq 0x3933
leal 0x1(%r15), %edx
movq %rbx, %rdi
movl $0x1, %esi
movl %edx, 0x8(%rsp)
callq 0xfb01
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movl $0xfffffffe, %edx       # imm = 0xFFFFFFFE
callq 0x104d3
movl %r15d, %ecx
testl %eax, %eax
je 0x10398
cmpl %r14d, %r15d
jge 0x104c2
addq $-0x10, 0x10(%rbx)
leal 0x2(%r15), %edx
movq %rbx, %rdi
movl $0x1, %esi
callq 0xfb01
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movl $0xfffffffe, %edx       # imm = 0xFFFFFFFE
callq 0x104d3
incl %r15d
testl %eax, %eax
jne 0x10355
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 0xfb01
movq %rbx, %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x104d3
testl %eax, %eax
je 0x10403
cmpl %ebp, %r13d
jle 0x104c2
addq $-0x10, 0x10(%rbx)
leal -0x2(%r13), %edx
movq %rbx, %rdi
movl $0x1, %esi
callq 0xfb01
movq %rbx, %rdi
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x104d3
decl %r13d
testl %eax, %eax
jne 0x103c7
leal -0x1(%r13), %r12d
movl 0x8(%rsp), %edx
movl %edx, %r15d
cmpl %edx, %r13d
movl %r12d, %r13d
jg 0x1030a
addq $-0x30, 0x10(%rbx)
movq %rbx, %rdi
movl $0x1, %esi
movl %edx, %r15d
movl 0xc(%rsp), %r12d
movl %r12d, %edx
callq 0xfb01
movq %rbx, %rdi
movl $0x1, %esi
movl %r15d, %edx
callq 0xfb01
movq %rbx, %rdi
movl $0x1, %esi
movl %r12d, %edx
callq 0x3933
movq %rbx, %rdi
movl $0x1, %esi
movl %r15d, %edx
callq 0x3933
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 0x10177
movb $0x1, %al
movl %r15d, %ebp
movl %r12d, %r14d
testb %al, %al
jne 0x1018d
jmp 0x104b3
addq $-0x20, 0x10(%rbx)
jmp 0x102b5
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x4a89(%rip), %rsi      # 0x14f52
movq %rbx, %rdi
xorl %eax, %eax
callq 0xa049