// File: /workspace/github_c_makefile_star2_O1/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
movslq 0x8(%rsi), %r12
cmpq $0x6, %r12
je 0x66bb
movq %rbx, %rdi
movq %r14, %rsi
movl $0x10, %edx
callq 0x5120
cmpl $0x6, 0x8(%rax)
jne 0x68ca
movq %rax, %r15
movq 0x40(%rbx), %r12
movq 0x10(%rbx), %rax
cmpq %r14, %rax
jbe 0x6681
movq -0x10(%rax), %rcx
movq %rcx, (%rax)
movl -0x8(%rax), %ecx
movl %ecx, 0x8(%rax)
leaq -0x10(%rax), %rcx
movq %rcx, %rax
cmpq %r14, %rcx
ja 0x6668
movq 0x38(%rbx), %rax
subq 0x10(%rbx), %rax
cmpq $0x10, %rax
jg 0x669c
movq %rbx, %rdi
movl $0x1, %esi
callq 0x4d13
addq $0x10, 0x10(%rbx)
subq %r12, %r14
movq 0x40(%rbx), %rax
movq (%r15), %rcx
movq %rcx, (%rax,%r14)
movl 0x8(%r15), %ecx
movl %ecx, 0x8(%rax,%r14)
addq %rax, %r14
movq %r14, %r15
movq (%r14), %rax
movq 0x28(%rbx), %rcx
subq 0x40(%rbx), %r15
movq 0x30(%rbx), %rdx
movq %rdx, 0x18(%rcx)
cmpb $0x0, 0xa(%rax)
je 0x6708
movq 0x38(%rbx), %rax
subq 0x10(%rbx), %rax
cmpq $0x140, %rax            # imm = 0x140
jg 0x66f4
movq %rbx, %rdi
movl $0x14, %esi
callq 0x4d13
movq 0x28(%rbx), %rax
cmpq 0x48(%rbx), %rax
je 0x675f
addq $0x28, %rax
movq %rax, 0x28(%rbx)
jmp 0x6767
movq 0x20(%rax), %r14
movq 0x38(%rbx), %rax
subq 0x10(%rbx), %rax
movzbl 0x73(%r14), %esi
movl %esi, %ecx
shll $0x4, %ecx
cmpq %rcx, %rax
jg 0x672b
movq %rbx, %rdi
callq 0x4d13
movq 0x40(%rbx), %r13
addq %r15, %r13
cmpb $0x0, 0x72(%r14)
je 0x67cf
movq 0x10(%rbx), %rcx
movq %rcx, %rdx
subq %r13, %rdx
shrq $0x4, %rdx
movzbl 0x71(%r14), %eax
cmpl %eax, %edx
jle 0x67ee
decl %edx
jmp 0x6809
movq %rbx, %rdi
callq 0x6dcf
movq 0x40(%rbx), %rcx
leaq (%rcx,%r15), %rdx
movq %rdx, 0x8(%rax)
addq %r15, %rcx
addq $0x10, %rcx
movq %rcx, (%rax)
movq %rcx, 0x18(%rbx)
movl $0x140, %ecx            # imm = 0x140
addq 0x10(%rbx), %rcx
movq %rcx, 0x10(%rax)
movl %ebp, 0x20(%rax)
movq 0x28(%rbx), %rax
movq 0x8(%rax), %rax
movq (%rax), %rax
movq %rbx, %rdi
callq *0x20(%rax)
testl %eax, %eax
js 0x67c5
movq 0x10(%rbx), %rsi
movl %eax, %eax
shlq $0x4, %rax
subq %rax, %rsi
movq %rbx, %rdi
callq 0x6e1d
movl $0x1, %eax
jmp 0x68bb
movl $0x2, %eax
jmp 0x68bb
leaq 0x10(%r13), %r12
movzbl 0x71(%r14), %eax
shll $0x4, %eax
addq %r13, %rax
addq $0x10, %rax
cmpq %rax, 0x10(%rbx)
jbe 0x6857
movq %rax, 0x10(%rbx)
jmp 0x6857
movl %eax, %esi
subl %edx, %esi
incl %esi
movl $0x0, 0x8(%rcx)
addq $0x10, %rcx
decl %esi
jne 0x67f4
movq %rcx, 0x10(%rbx)
movl %eax, %edx
movq 0x10(%rbx), %r12
testl %eax, %eax
je 0x6850
movl %edx, %edx
shll $0x4, %eax
shlq $0x4, %rdx
movq %r12, %rcx
subq %rdx, %rcx
addq $0x8, %rcx
xorl %edx, %edx
movq 0x10(%rbx), %rsi
leaq 0x10(%rsi), %rdi
movq %rdi, 0x10(%rbx)
movq -0x8(%rcx,%rdx), %rdi
movq %rdi, (%rsi)
movl (%rcx,%rdx), %edi
movl %edi, 0x8(%rsi)
movl $0x0, (%rcx,%rdx)
addq $0x10, %rdx
cmpq %rdx, %rax
jne 0x6826
addq 0x40(%rbx), %r15
movq %r15, %r13
movq 0x28(%rbx), %rax
cmpq 0x48(%rbx), %rax
je 0x686b
addq $0x28, %rax
movq %rax, 0x28(%rbx)
jmp 0x6873
movq %rbx, %rdi
callq 0x6dcf
movq %r13, 0x8(%rax)
movq %r12, (%rax)
movq %r12, 0x18(%rbx)
movzbl 0x73(%r14), %ecx
shll $0x4, %ecx
addq %r12, %rcx
movq %rcx, 0x10(%rax)
movq 0x18(%r14), %rdx
movq %rdx, 0x30(%rbx)
movl $0x0, 0x24(%rax)
movl %ebp, 0x20(%rax)
movq 0x10(%rbx), %rax
cmpq %rcx, %rax
jae 0x68b5
movl $0x0, 0x8(%rax)
addq $0x10, %rax
jmp 0x68a3
movq %rcx, 0x10(%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x13f8f(%rip), %rax     # 0x1a860
movq (%rax,%r12,8), %rcx
leaq 0xddbc(%rip), %rsi      # 0x14698
leaq 0xdf70(%rip), %rdx      # 0x14853
movq %rbx, %rdi
xorl %eax, %eax
callq 0x46c4