// File: /workspace/github_c_makefile_star2_O2/zenkj[P]luajit-arm64/src/host/minilua.c
// Function: luaD_precall
static int luaD_precall(lua_State*L,StkId func,int nresults){
LClosure*cl;
ptrdiff_t funcr;
if(!ttisfunction(func))
func=tryfuncTM(L,func);
funcr=savestack(L,func);
cl=&clvalue(func)->l;
L->ci->savedpc=L->savedpc;
if(!cl->isC){
CallInfo*ci;
StkId st,base;
Proto*p=cl->p;
luaD_checkstack(L,p->maxstacksize);
func=restorestack(L,funcr);
if(!p->is_vararg){
base=func+1;
if(L->top>base+p->numparams)
L->top=base+p->numparams;
}
else{
int nargs=cast_int(L->top-func)-1;
base=adjust_varargs(L,p,nargs);
func=restorestack(L,funcr);
}
ci=inc_ci(L);
ci->func=func;
L->base=ci->base=base;
ci->top=L->base+p->maxstacksize;
L->savedpc=p->code;
ci->tailcalls=0;
ci->nresults=nresults;
for(st=L->top;st<ci->top;st++)
setnilvalue(st);
L->top=ci->top;
return 0;
}
else{
CallInfo*ci;
int n;
luaD_checkstack(L,20);
ci=inc_ci(L);
ci->func=restorestack(L,funcr);
L->base=ci->base=ci->func+1;
ci->top=L->top+20;
ci->nresults=nresults;
n=(*curr_func(L)->c.f)(L);
if(n<0)
return 2;
else{
luaD_poscall(L,L->top-n);
return 1;
}
}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
cmpl $0x6, 0x8(%rsi)
jne 0x63ae
movq (%r14), %rax
jmp 0x642b
pushq $0x10
popq %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4f59
cmpl $0x6, 0x8(%rax)
jne 0x6619
movq %rax, %r15
movq 0x40(%rbx), %r12
movq 0x10(%rbx), %rax
cmpq %r14, %rax
jbe 0x63e9
movq -0x10(%rax), %rcx
movq %rcx, (%rax)
movl -0x8(%rax), %ecx
movl %ecx, 0x8(%rax)
addq $-0x10, %rax
jmp 0x63d1
movq 0x10(%rbx), %rax
movq 0x38(%rbx), %rcx
subq %rax, %rcx
cmpq $0x10, %rcx
jg 0x6409
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x4b6b
movq 0x10(%rbx), %rax
subq %r12, %r14
addq $0x10, %rax
movq %rax, 0x10(%rbx)
movq 0x40(%rbx), %rcx
movq (%r15), %rax
movq %rax, (%rcx,%r14)
movl 0x8(%r15), %edx
movl %edx, 0x8(%rcx,%r14)
addq %rcx, %r14
movq 0x40(%rbx), %r13
subq %r13, %r14
movq 0x28(%rbx), %rcx
movq 0x30(%rbx), %rdx
movq %rdx, 0x18(%rcx)
cmpb $0x0, 0xa(%rax)
je 0x6476
movq 0x38(%rbx), %rax
subq 0x10(%rbx), %rax
cmpq $0x140, %rax            # imm = 0x140
jg 0x6463
pushq $0x14
popq %rsi
movq %rbx, %rdi
callq 0x4b6b
movq 0x28(%rbx), %rcx
cmpq 0x48(%rbx), %rcx
je 0x64dc
addq $0x28, %rcx
movq %rcx, 0x28(%rbx)
movq %rcx, %rax
jmp 0x64e8
movq 0x20(%rax), %r15
movq 0x38(%rbx), %rax
subq 0x10(%rbx), %rax
movzbl 0x73(%r15), %esi
movl %esi, %ecx
shll $0x4, %ecx
cmpq %rcx, %rax
jg 0x649d
movq %rbx, %rdi
callq 0x4b6b
movq 0x40(%rbx), %r13
addq %r14, %r13
cmpb $0x0, 0x72(%r15)
je 0x658d
movq 0x10(%rbx), %r12
movq %r12, %rcx
subq %r13, %rcx
shrq $0x4, %rcx
decl %ecx
movzbl 0x71(%r15), %edx
movl %ecx, %eax
cmpl %edx, %eax
jge 0x6540
leaq 0x10(%r12), %rsi
movq %rsi, 0x10(%rbx)
andl $0x0, 0x8(%r12)
incl %eax
movq %rsi, %r12
jmp 0x64c2
movq %rbx, %rdi
callq 0x6ac9
movq 0x28(%rbx), %rcx
movq 0x40(%rbx), %rdx
leaq (%rdx,%r14), %rsi
movq %rsi, 0x8(%rax)
addq %r14, %rdx
addq $0x10, %rdx
movq %rdx, (%rax)
movq %rdx, 0x18(%rbx)
movl $0x140, %edx            # imm = 0x140
addq 0x10(%rbx), %rdx
movq %rdx, 0x10(%rax)
movl %ebp, 0x20(%rax)
movq 0x8(%rcx), %rax
movq (%rax), %rax
movq %rbx, %rdi
callq *0x20(%rax)
testl %eax, %eax
js 0x657c
pushq $0x1
popq %rbp
movq 0x10(%rbx), %rsi
movl %eax, %eax
shlq $0x4, %rax
subq %rax, %rsi
movq %rbx, %rdi
callq 0x6b15
jmp 0x6608
movl %edx, %eax
cmpl %edx, %ecx
cmovgl %ecx, %edx
shlq $0x4, %rdx
movq %r12, %rcx
subq %rdx, %rcx
addq $0x8, %rcx
subq $0x1, %rax
jb 0x6584
movq 0x10(%rbx), %rdx
leaq 0x10(%rdx), %rsi
movq %rsi, 0x10(%rbx)
movq -0x8(%rcx), %rsi
movq %rsi, (%rdx)
movl (%rcx), %esi
movl %esi, 0x8(%rdx)
andl $0x0, (%rcx)
addq $0x10, %rcx
jmp 0x6555
pushq $0x2
popq %rbp
jmp 0x6608
addq 0x40(%rbx), %r14
movq %r14, %r13
jmp 0x65aa
leaq 0x10(%r13), %r12
movzbl 0x71(%r15), %eax
shll $0x4, %eax
addq %r13, %rax
addq $0x10, %rax
cmpq %rax, 0x10(%rbx)
jbe 0x65aa
movq %rax, 0x10(%rbx)
movq 0x28(%rbx), %rax
cmpq 0x48(%rbx), %rax
je 0x65be
addq $0x28, %rax
movq %rax, 0x28(%rbx)
jmp 0x65c6
movq %rbx, %rdi
callq 0x6ac9
movq %r13, 0x8(%rax)
movq %r12, (%rax)
movq %r12, 0x18(%rbx)
movzbl 0x73(%r15), %ecx
shll $0x4, %ecx
addq %r12, %rcx
movq %rcx, 0x10(%rax)
movq 0x18(%r15), %rdx
movq %rdx, 0x30(%rbx)
andl $0x0, 0x24(%rax)
movl %ebp, 0x20(%rax)
movq 0x10(%rbx), %rax
cmpq %rcx, %rax
jae 0x6602
andl $0x0, 0x8(%rax)
addq $0x10, %rax
jmp 0x65f3
movq %rcx, 0x10(%rbx)
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xc25b(%rip), %rdx      # 0x1287b
movq %rbx, %rdi
movq %r14, %rsi
callq 0x6b77