// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/deps/lua/src/ldo.c
// Function: luaD_precall
int luaD_precall (lua_State *L, StkId func, int nresults) {
  LClosure *cl;
  ptrdiff_t funcr;
  if (!ttisfunction(func)) /* `func' is not a function? */
    func = tryfuncTM(L, func);  /* check the `function' tag method */
  funcr = savestack(L, func);
  cl = &clvalue(func)->l;
  L->ci->savedpc = L->savedpc;
  if (!cl->isC) {  /* Lua function? prepare its call */
    CallInfo *ci;
    StkId st, base;
    Proto *p = cl->p;
    luaD_checkstack(L, p->maxstacksize);
    func = restorestack(L, funcr);
    if (!p->is_vararg) {  /* no varargs? */
      base = func + 1;
      if (L->top > base + p->numparams)
        L->top = base + p->numparams;
    }
    else {  /* vararg function */
      int nargs = cast_int(L->top - func) - 1;
      base = adjust_varargs(L, p, nargs);
      func = restorestack(L, funcr);  /* previous call may change the stack */
    }
    ci = inc_ci(L);  /* now `enter' new function */
    ci->func = func;
    L->base = ci->base = base;
    ci->top = L->base + p->maxstacksize;
    lua_assert(ci->top <= L->stack_last);
    L->savedpc = p->code;  /* starting point */
    ci->tailcalls = 0;
    ci->nresults = nresults;
    for (st = L->top; st < ci->top; st++)
      setnilvalue(st);
    L->top = ci->top;
    if (L->hookmask & LUA_MASKCALL) {
      L->savedpc++;  /* hooks assume 'pc' is already incremented */
      luaD_callhook(L, LUA_HOOKCALL, -1);
      L->savedpc--;  /* correct 'pc' */
    }
    return PCRLUA;
  }
  else {  /* if is a C function, call it */
    CallInfo *ci;
    int n;
    luaD_checkstack(L, LUA_MINSTACK);  /* ensure minimum stack size */
    ci = inc_ci(L);  /* now `enter' new function */
    ci->func = restorestack(L, funcr);
    L->base = ci->base = ci->func + 1;
    ci->top = L->top + LUA_MINSTACK;
    lua_assert(ci->top <= L->stack_last);
    ci->nresults = nresults;
    if (L->hookmask & LUA_MASKCALL)
      luaD_callhook(L, LUA_HOOKCALL, -1);
    lua_unlock(L);
    n = (*curr_func(L)->c.f)(L);  /* do the actual call */
    lua_lock(L);
    if (n < 0)  /* yielding? */
      return PCRYIELD;
    else {
      luaD_poscall(L, L->top - n);
      return PCRC;
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
cmpl $0x6, 0x8(%rsi)
jne 0x782a
movq (%r14), %rcx
jmp 0x78b5
pushq $0x10
popq %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0xd1ef
movq %rax, %r15
movq 0x40(%rbx), %r12
cmpl $0x6, 0x8(%rax)
je 0x7857
leaq 0x1247d(%rip), %rdx     # 0x19cc9
movq %rbx, %rdi
movq %r14, %rsi
callq 0x6f53
movq 0x10(%rbx), %rax
cmpq %r14, %rax
jbe 0x7873
movq -0x10(%rax), %rcx
movq %rcx, (%rax)
movl -0x8(%rax), %ecx
movl %ecx, 0x8(%rax)
addq $-0x10, %rax
jmp 0x785b
movq 0x10(%rbx), %rax
movq 0x38(%rbx), %rcx
subq %rax, %rcx
cmpq $0x10, %rcx
jg 0x7893
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x7732
movq 0x10(%rbx), %rax
subq %r12, %r14
addq $0x10, %rax
movq %rax, 0x10(%rbx)
movq 0x40(%rbx), %rax
movq (%r15), %rcx
movq %rcx, (%rax,%r14)
movl 0x8(%r15), %edx
movl %edx, 0x8(%rax,%r14)
addq %rax, %r14
movq 0x40(%rbx), %r12
subq %r12, %r14
movq 0x28(%rbx), %rax
movq 0x30(%rbx), %rdx
movq %rdx, 0x18(%rax)
cmpb $0x0, 0xa(%rcx)
je 0x78fe
movq 0x38(%rbx), %rcx
subq 0x10(%rbx), %rcx
cmpq $0x140, %rcx            # imm = 0x140
jg 0x78ee
pushq $0x14
popq %rsi
movq %rbx, %rdi
callq 0x7732
movq 0x28(%rbx), %rax
cmpq 0x48(%rbx), %rax
je 0x7969
addq $0x28, %rax
movq %rax, 0x28(%rbx)
jmp 0x7971
movq 0x20(%rcx), %r15
movq 0x38(%rbx), %rax
subq 0x10(%rbx), %rax
movzbl 0x73(%r15), %esi
movl %esi, %ecx
shll $0x4, %ecx
cmpq %rcx, %rax
jg 0x7925
movq %rbx, %rdi
callq 0x7732
movq 0x40(%rbx), %r12
addq %r14, %r12
movb 0x72(%r15), %al
testb %al, %al
je 0x7a06
movq 0x10(%rbx), %r13
movq %r13, %rdx
subq %r12, %rdx
shrq $0x4, %rdx
decl %edx
movzbl 0x71(%r15), %r12d
addq $0x10, %r13
movl %edx, %ecx
cmpl %r12d, %ecx
jge 0x79e0
movq %r13, 0x10(%rbx)
andl $0x0, -0x8(%r13)
incl %ecx
addq $0x10, %r13
jmp 0x794f
movq %rbx, %rdi
callq 0x7c2f
movq 0x40(%rbx), %rcx
leaq (%rcx,%r14), %rdx
movq %rdx, 0x8(%rax)
addq %r14, %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)
testb $0x1, 0x64(%rbx)
je 0x79ae
pushq $-0x1
popq %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x7747
movq 0x28(%rbx), %rax
movq 0x8(%rax), %rax
movq (%rax), %rax
movq %rbx, %rdi
callq *0x20(%rax)
testl %eax, %eax
js 0x79fe
pushq $0x1
popq %rbp
movq 0x10(%rbx), %rsi
movl %eax, %eax
shlq $0x4, %rax
subq %rax, %rsi
movq %rbx, %rdi
callq 0x7c7b
jmp 0x7c1e
movl %ebp, (%rsp)
cmpl %r12d, %edx
movl %r12d, %ebp
cmovgl %edx, %ebp
addq $-0x10, %r13
testb $0x4, %al
jne 0x7a2d
xorl %edi, %edi
movl (%rsp), %ebp
jmp 0x7b36
pushq $0x2
popq %rbp
jmp 0x7c1e
leaq 0x10(%r12), %r13
movzbl 0x71(%r15), %eax
shll $0x4, %eax
addq %r12, %rax
addq $0x10, %rax
cmpq %rax, 0x10(%rbx)
jbe 0x7b9e
movq %rax, 0x10(%rbx)
jmp 0x7b9e
movq %rdx, 0x8(%rsp)
movq 0x20(%rbx), %rax
movq 0x78(%rax), %rcx
cmpq 0x70(%rax), %rcx
jb 0x7a4c
movq %rbx, %rdi
callq 0x8b89
movq 0x10(%rbx), %r13
subl %r12d, %ebp
movq 0x38(%rbx), %rax
subq %r13, %rax
movq %r15, 0x18(%rsp)
movzbl 0x73(%r15), %esi
movl %esi, %ecx
shll $0x4, %ecx
cmpq %rcx, %rax
jg 0x7a72
movq %rbx, %rdi
callq 0x7732
pushq $0x1
popq %rdx
movq %rbx, %rdi
movl %ebp, %esi
callq 0xc90c
xorl %r13d, %r13d
testl %ebp, %ebp
movl $0x0, %ecx
movl %ebp, 0x4(%rsp)
cmovgl %ebp, %ecx
movq %rcx, 0x20(%rsp)
movl %r12d, %ebp
shll $0x4, %ebp
movq 0x8(%rsp), %rdx
cmpl %r12d, %edx
movl %r12d, %ecx
cmovgl %edx, %ecx
movq %rax, 0x10(%rsp)
shlq $0x4, %rcx
subq %rcx, %rbp
orq $0x8, %rbp
cmpq %r13, 0x20(%rsp)
je 0x7aec
movq 0x10(%rbx), %r15
incq %r13
movq %rbx, %rdi
movq 0x10(%rsp), %rsi
movl %r13d, %edx
callq 0xcf9d
movq -0x8(%r15,%rbp), %rcx
movq %rcx, (%rax)
movl (%r15,%rbp), %ecx
movl %ecx, 0x8(%rax)
addq $0x10, %rbp
jmp 0x7ab9
leaq 0x1214f(%rip), %rsi     # 0x19c42
pushq $0x1
popq %rdx
movq %rbx, %rdi
callq 0xc466
movq %rbx, %rdi
movq 0x10(%rsp), %r15
movq %r15, %rsi
movq %rax, %rdx
callq 0xcfe9
movq %r15, %rdi
cvtsi2sdl 0x4(%rsp), %xmm0
movsd %xmm0, (%rax)
movl $0x3, 0x8(%rax)
movq 0x10(%rbx), %r13
movl (%rsp), %ebp
movq 0x18(%rsp), %r15
movq 0x8(%rsp), %rdx
cmpl %r12d, %edx
movl %r12d, %ecx
cmovgl %edx, %ecx
shlq $0x4, %rcx
movq %r13, %rax
subq %rcx, %rax
addq $0x8, %rax
shll $0x4, %r12d
xorl %ecx, %ecx
cmpq %rcx, %r12
je 0x7b7c
movq 0x10(%rbx), %rdx
leaq 0x10(%rdx), %rsi
movq %rsi, 0x10(%rbx)
movq -0x8(%rax,%rcx), %rsi
movq %rsi, (%rdx)
movl (%rax,%rcx), %esi
movl %esi, 0x8(%rdx)
andl $0x0, (%rax,%rcx)
addq $0x10, %rcx
jmp 0x7b53
testq %rdi, %rdi
je 0x7b97
movq 0x10(%rbx), %rax
leaq 0x10(%rax), %rcx
movq %rcx, 0x10(%rbx)
movq %rdi, (%rax)
movl $0x5, 0x8(%rax)
addq 0x40(%rbx), %r14
movq %r14, %r12
movq 0x28(%rbx), %rax
cmpq 0x48(%rbx), %rax
je 0x7bb2
addq $0x28, %rax
movq %rax, 0x28(%rbx)
jmp 0x7bba
movq %rbx, %rdi
callq 0x7c2f
movq %r12, 0x8(%rax)
movq %r13, (%rax)
movq %r13, 0x18(%rbx)
movzbl 0x73(%r15), %edx
shll $0x4, %edx
addq %r13, %rdx
movq %rdx, 0x10(%rax)
movq 0x18(%r15), %rcx
movq %rcx, 0x30(%rbx)
andl $0x0, 0x24(%rax)
movl %ebp, 0x20(%rax)
movq 0x10(%rbx), %rax
cmpq %rdx, %rax
jae 0x7bf6
andl $0x0, 0x8(%rax)
addq $0x10, %rax
jmp 0x7be7
movq %rdx, 0x10(%rbx)
xorl %ebp, %ebp
testb $0x1, 0x64(%rbx)
je 0x7c1e
addq $0x4, %rcx
movq %rcx, 0x30(%rbx)
xorl %ebp, %ebp
pushq $-0x1
popq %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x7747
addq $-0x4, 0x30(%rbx)
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq