// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x6, 0x8(%rax)
je 0xb551
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0xb8f0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
movq 0x40(%rcx), %rcx
subq %rcx, %rax
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rcx
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq %rcx, 0x18(%rax)
movq -0x28(%rbp), %rax
cmpb $0x0, 0xa(%rax)
jne 0xb7ae
movq -0x28(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x10(%rcx), %rcx
subq %rcx, %rax
movq -0x50(%rbp), %rcx
movzbl 0x73(%rcx), %ecx
shll $0x4, %ecx
movslq %ecx, %rcx
cmpq %rcx, %rax
jg 0xb5d6
movq -0x10(%rbp), %rdi
movq -0x50(%rbp), %rax
movzbl 0x73(%rax), %esi
callq 0xb380
jmp 0xb5d8
jmp 0xb5d8
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
addq -0x30(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x50(%rbp), %rax
cmpb $0x0, 0x72(%rax)
jne 0xb640
movq -0x18(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x48(%rbp), %rcx
movq -0x50(%rbp), %rdx
movzbl 0x71(%rdx), %edx
movslq %edx, %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
cmpq %rcx, %rax
jbe 0xb63e
movq -0x48(%rbp), %rcx
movq -0x50(%rbp), %rax
movzbl 0x71(%rax), %eax
cltq
shlq $0x4, %rax
addq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x10(%rax)
jmp 0xb67d
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x18(%rbp), %rcx
subq %rcx, %rax
sarq $0x4, %rax
subl $0x1, %eax
movl %eax, -0x54(%rbp)
movq -0x10(%rbp), %rdi
movq -0x50(%rbp), %rsi
movl -0x54(%rbp), %edx
callq 0xba20
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
addq -0x30(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x10(%rbp), %rcx
cmpq 0x48(%rcx), %rax
jne 0xb69e
movq -0x10(%rbp), %rdi
callq 0xbcb0
movq %rax, -0x70(%rbp)
jmp 0xb6b2
movq -0x10(%rbp), %rcx
movq 0x28(%rcx), %rax
addq $0x28, %rax
movq %rax, 0x28(%rcx)
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x48(%rbp), %rcx
movq -0x38(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rcx
movq -0x50(%rbp), %rax
movzbl 0x73(%rax), %eax
cltq
shlq $0x4, %rax
addq %rax, %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x50(%rbp), %rax
movq 0x18(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x38(%rbp), %rax
movl $0x0, 0x24(%rax)
movl -0x1c(%rbp), %ecx
movq -0x38(%rbp), %rax
movl %ecx, 0x20(%rax)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq -0x38(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jae 0xb752
movq -0x40(%rbp), %rax
movl $0x0, 0x8(%rax)
movq -0x40(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x40(%rbp)
jmp 0xb72b
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x10(%rbp), %rax
movzbl 0x64(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0xb7a2
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rcx
addq $0x4, %rcx
movq %rcx, 0x30(%rax)
movq -0x10(%rbp), %rdi
xorl %esi, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0xb3d0
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rcx
addq $-0x4, %rcx
movq %rcx, 0x30(%rax)
movl $0x0, -0x4(%rbp)
jmp 0xb8db
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x10(%rcx), %rcx
subq %rcx, %rax
cmpq $0x140, %rax            # imm = 0x140
jg 0xb7d9
movq -0x10(%rbp), %rdi
movl $0x14, %esi
callq 0xb380
jmp 0xb7db
jmp 0xb7db
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x10(%rbp), %rcx
cmpq 0x48(%rcx), %rax
jne 0xb7fc
movq -0x10(%rbp), %rdi
callq 0xbcb0
movq %rax, -0x78(%rbp)
jmp 0xb810
movq -0x10(%rbp), %rcx
movq 0x28(%rcx), %rax
addq $0x28, %rax
movq %rax, 0x28(%rcx)
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rcx
addq -0x30(%rbp), %rcx
movq -0x60(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x60(%rbp), %rax
movq 0x8(%rax), %rcx
addq $0x10, %rcx
movq -0x60(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rcx
addq $0x140, %rcx            # imm = 0x140
movq -0x60(%rbp), %rax
movq %rcx, 0x10(%rax)
movl -0x1c(%rbp), %ecx
movq -0x60(%rbp), %rax
movl %ecx, 0x20(%rax)
movq -0x10(%rbp), %rax
movzbl 0x64(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0xb888
movq -0x10(%rbp), %rdi
xorl %esi, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0xb3d0
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq 0x8(%rax), %rax
movq (%rax), %rax
movq 0x20(%rax), %rax
movq -0x10(%rbp), %rdi
callq *%rax
movl %eax, -0x64(%rbp)
cmpl $0x0, -0x64(%rbp)
jge 0xb8b3
movl $0x2, -0x4(%rbp)
jmp 0xb8db
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rsi
movslq -0x64(%rbp), %rcx
xorl %eax, %eax
subq %rcx, %rax
shlq $0x4, %rax
addq %rax, %rsi
callq 0xbd30
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x80, %rsp
popq %rbp
retq
nopw (%rax,%rax)