// File: /workspace/github_c_makefile_star2_O0/tylerneylon[P]APIsWithLua/lua/ldo.c
// Function: luaD_precall
int luaD_precall (lua_State *L, StkId func, int nresults) {
  lua_CFunction f;
  CallInfo *ci;
  switch (ttype(func)) {
    case LUA_TCCL:  /* C closure */
      f = clCvalue(func)->f;
      goto Cfunc;
    case LUA_TLCF:  /* light C function */
      f = fvalue(func);
     Cfunc: {
      int n;  /* number of returns */
      checkstackp(L, LUA_MINSTACK, func);  /* ensure minimum stack size */
      ci = next_ci(L);  /* now 'enter' new function */
      ci->nresults = nresults;
      ci->func = func;
      ci->top = L->top + LUA_MINSTACK;
      lua_assert(ci->top <= L->stack_last);
      ci->callstatus = 0;
      if (L->hookmask & LUA_MASKCALL)
        luaD_hook(L, LUA_HOOKCALL, -1);
      lua_unlock(L);
      n = (*f)(L);  /* do the actual call */
      lua_lock(L);
      api_checknelems(L, n);
      luaD_poscall(L, ci, L->top - n, n);
      return 1;
    }
    case LUA_TLCL: {  /* Lua function: prepare its call */
      StkId base;
      Proto *p = clLvalue(func)->p;
      int n = cast_int(L->top - func) - 1;  /* number of real arguments */
      int fsize = p->maxstacksize;  /* frame size */
      checkstackp(L, fsize, func);
      if (p->is_vararg != 1) {  /* do not use vararg? */
        for (; n < p->numparams; n++)
          setnilvalue(L->top++);  /* complete missing arguments */
        base = func + 1;
      }
      else
        base = adjust_varargs(L, p, n);
      ci = next_ci(L);  /* now 'enter' new function */
      ci->nresults = nresults;
      ci->func = func;
      ci->u.l.base = base;
      L->top = ci->top = base + fsize;
      lua_assert(ci->top <= L->stack_last);
      ci->u.l.savedpc = p->code;  /* starting point */
      ci->callstatus = CIST_LUA;
      if (L->hookmask & LUA_MASKCALL)
        callhook(L, ci);
      return 0;
    }
    default: {  /* not a function */
      checkstackp(L, 1, func);  /* ensure space for metamethod */
      tryfuncTM(L, func);  /* try to get '__call' metamethod */
      return luaD_precall(L, func, nresults);  /* now it must be a function */
    }
  }
}

// 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
movl 0x8(%rax), %eax
andl $0x3f, %eax
movl %eax, -0x6c(%rbp)
subl $0x6, %eax
je 0xb415
jmp 0xb29e
movl -0x6c(%rbp), %eax
subl $0x16, %eax
je 0xb2c7
jmp 0xb2a8
movl -0x6c(%rbp), %eax
subl $0x26, %eax
jne 0xb5dd
jmp 0xb2b6
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq 0x18(%rax), %rax
movq %rax, -0x28(%rbp)
jmp 0xb2d2
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x10(%rcx), %rcx
subq %rcx, %rax
sarq $0x4, %rax
cmpq $0x14, %rax
jg 0xb33a
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
movq 0x38(%rcx), %rcx
subq %rcx, %rax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
cmpq $0x0, 0x18(%rax)
jle 0xb31a
movq -0x10(%rbp), %rdi
callq 0xe0b0
movq -0x10(%rbp), %rdi
movl $0x14, %esi
callq 0xaee0
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
addq -0x40(%rbp), %rax
movq %rax, -0x18(%rbp)
jmp 0xb33c
jmp 0xb33c
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
cmpq $0x0, 0x18(%rax)
je 0xb35d
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq 0x18(%rax), %rax
movq %rax, -0x78(%rbp)
jmp 0xb36a
movq -0x10(%rbp), %rdi
callq 0x15930
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rax
movq -0x10(%rbp), %rcx
movq %rax, 0x20(%rcx)
movq %rax, -0x30(%rbp)
movl -0x1c(%rbp), %eax
movw %ax, %cx
movq -0x30(%rbp), %rax
movw %cx, 0x40(%rax)
movq -0x18(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rcx
addq $0x140, %rcx            # imm = 0x140
movq -0x30(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x30(%rbp), %rax
movb $0x0, 0x42(%rax)
movq -0x10(%rbp), %rax
movl 0xc8(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0xb3d4
movq -0x10(%rbp), %rdi
xorl %esi, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0xb110
movq -0x28(%rbp), %rax
movq -0x10(%rbp), %rdi
callq *%rax
movl %eax, -0x34(%rbp)
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdx
movslq -0x34(%rbp), %rcx
xorl %eax, %eax
subq %rcx, %rax
shlq $0x4, %rax
addq %rax, %rdx
movl -0x34(%rbp), %ecx
callq 0xb680
movl $0x1, -0x4(%rbp)
jmp 0xb667
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq 0x18(%rax), %rax
movq %rax, -0x50(%rbp)
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 -0x50(%rbp), %rax
movzbl 0xc(%rax), %eax
movl %eax, -0x58(%rbp)
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x10(%rcx), %rcx
subq %rcx, %rax
sarq $0x4, %rax
movslq -0x58(%rbp), %rcx
cmpq %rcx, %rax
jg 0xb4b1
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
movq 0x38(%rcx), %rcx
subq %rcx, %rax
movq %rax, -0x60(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
cmpq $0x0, 0x18(%rax)
jle 0xb493
movq -0x10(%rbp), %rdi
callq 0xe0b0
movq -0x10(%rbp), %rdi
movl -0x58(%rbp), %esi
callq 0xaee0
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
addq -0x60(%rbp), %rax
movq %rax, -0x18(%rbp)
jmp 0xb4b3
jmp 0xb4b3
movq -0x50(%rbp), %rax
movzbl 0xb(%rax), %eax
cmpl $0x1, %eax
je 0xb504
jmp 0xb4c2
movl -0x54(%rbp), %eax
movq -0x50(%rbp), %rcx
movzbl 0xa(%rcx), %ecx
cmpl %ecx, %eax
jge 0xb4f6
movq -0x10(%rbp), %rcx
movq 0x10(%rcx), %rax
movq %rax, %rdx
addq $0x10, %rdx
movq %rdx, 0x10(%rcx)
movl $0x0, 0x8(%rax)
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0xb4c2
movq -0x18(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x48(%rbp)
jmp 0xb518
movq -0x10(%rbp), %rdi
movq -0x50(%rbp), %rsi
movl -0x54(%rbp), %edx
callq 0xb750
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
cmpq $0x0, 0x18(%rax)
je 0xb539
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq 0x18(%rax), %rax
movq %rax, -0x80(%rbp)
jmp 0xb546
movq -0x10(%rbp), %rdi
callq 0x15930
movq %rax, -0x80(%rbp)
movq -0x80(%rbp), %rax
movq -0x10(%rbp), %rcx
movq %rax, 0x20(%rcx)
movq %rax, -0x30(%rbp)
movl -0x1c(%rbp), %eax
movw %ax, %cx
movq -0x30(%rbp), %rax
movw %cx, 0x40(%rax)
movq -0x18(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
movq -0x48(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x48(%rbp), %rcx
movslq -0x58(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x50(%rbp), %rax
movq 0x38(%rax), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x30(%rbp), %rax
movb $0x2, 0x42(%rax)
movq -0x10(%rbp), %rax
movl 0xc8(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0xb5d1
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0xb850
movl $0x0, -0x4(%rbp)
jmp 0xb667
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x10(%rcx), %rcx
subq %rcx, %rax
sarq $0x4, %rax
cmpq $0x1, %rax
jg 0xb645
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
movq 0x38(%rcx), %rcx
subq %rcx, %rax
movq %rax, -0x68(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
cmpq $0x0, 0x18(%rax)
jle 0xb625
movq -0x10(%rbp), %rdi
callq 0xe0b0
movq -0x10(%rbp), %rdi
movl $0x1, %esi
callq 0xaee0
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
addq -0x68(%rbp), %rax
movq %rax, -0x18(%rbp)
jmp 0xb647
jmp 0xb647
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0xb8f0
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl -0x1c(%rbp), %edx
callq 0xb270
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)