// File: /workspace/github_c_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
pushq $0x1
popq %r15
pushq $0x17
popq %r12
movl 0x8(%r14), %eax
andl $0x3f, %eax
cmpl $0x6, %eax
je 0x85ec
cmpl $0x16, %eax
je 0x86c6
cmpl $0x26, %eax
je 0x86bd
movq 0x30(%rbx), %rax
subq 0x10(%rbx), %rax
cmpq $0x10, %rax
jg 0x85a8
movq 0x18(%rbx), %rax
subq 0x38(%rbx), %r14
cmpq $0x0, 0x18(%rax)
jle 0x8599
movq %rbx, %rdi
callq 0x9f05
movq %rbx, %rdi
movl %r15d, %esi
callq 0x8349
addq 0x38(%rbx), %r14
movq %rbx, %rdi
movq %r14, %rsi
movl %r12d, %edx
callq 0xf4b4
movl 0x8(%rax), %ecx
andl $0xf, %ecx
cmpl $0x6, %ecx
jne 0x8847
movq 0x10(%rbx), %rcx
cmpq %r14, %rcx
jbe 0x85db
movups -0x10(%rcx), %xmm0
movups %xmm0, (%rcx)
addq $-0x10, %rcx
jmp 0x85c9
addq $0x10, 0x10(%rbx)
movups (%rax), %xmm0
movups %xmm0, (%r14)
jmp 0x8552
movq (%r14), %rax
movq 0x18(%rax), %r13
movq 0x10(%rbx), %r12
movq 0x30(%rbx), %rax
subq %r12, %rax
subq %r14, %r12
shrq $0x4, %r12
movzbl 0xc(%r13), %r15d
sarq $0x4, %rax
cmpq %r15, %rax
jg 0x8639
movq 0x18(%rbx), %rax
subq 0x38(%rbx), %r14
cmpq $0x0, 0x18(%rax)
jle 0x862a
movq %rbx, %rdi
callq 0x9f05
movq %rbx, %rdi
movl %r15d, %esi
callq 0x8349
addq 0x38(%rbx), %r14
decl %r12d
cmpb $0x1, 0xb(%r13)
movzbl 0xa(%r13), %eax
movl %ebp, 0x4(%rsp)
jne 0x869f
movq 0x10(%rbx), %rbp
movslq %r12d, %rsi
xorl %ecx, %ecx
testl %esi, %esi
movl $0x0, %edx
cmovgl %esi, %edx
cmpl %eax, %edx
cmovgel %eax, %edx
shlq $0x4, %rsi
negq %rsi
addq %rbp, %rsi
addq $0x8, %rsi
movl %edx, %edi
shll $0x4, %edi
cmpq %rcx, %rdi
je 0x8779
movq 0x10(%rbx), %r8
leaq 0x10(%r8), %r9
movq %r9, 0x10(%rbx)
movups -0x8(%rsi,%rcx), %xmm0
movups %xmm0, (%r8)
andl $0x0, (%rsi,%rcx)
addq $0x10, %rcx
jmp 0x8677
cmpl %eax, %r12d
jge 0x8792
movq 0x10(%rbx), %rcx
leaq 0x10(%rcx), %rdx
movq %rdx, 0x10(%rbx)
andl $0x0, 0x8(%rcx)
incl %r12d
jmp 0x869f
movq (%r14), %rax
addq $0x18, %rax
jmp 0x86c9
movq %r14, %rax
movq (%rax), %r13
movq 0x30(%rbx), %rax
subq 0x10(%rbx), %rax
cmpq $0x14f, %rax            # imm = 0x14F
jg 0x8702
movq 0x18(%rbx), %rax
subq 0x38(%rbx), %r14
cmpq $0x0, 0x18(%rax)
jle 0x86f3
movq %rbx, %rdi
callq 0x9f05
pushq $0x14
popq %rsi
movq %rbx, %rdi
callq 0x8349
addq 0x38(%rbx), %r14
movq 0x20(%rbx), %rax
movq 0x18(%rax), %r12
testq %r12, %r12
jne 0x871a
movq %rbx, %rdi
callq 0xded0
movq %rax, %r12
movq %r12, 0x20(%rbx)
movw %bp, 0x40(%r12)
movq %r14, (%r12)
movl $0x140, %eax            # imm = 0x140
addq 0x10(%rbx), %rax
movq %rax, 0x8(%r12)
movb $0x0, 0x42(%r12)
testb $0x1, 0xc8(%rbx)
je 0x8752
pushq $-0x1
popq %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x8475
movq %rbx, %rdi
callq *%r13
movq 0x10(%rbx), %rdx
movslq %eax, %rcx
movq %rcx, %rax
shlq $0x4, %rax
subq %rax, %rdx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x8859
jmp 0x8835
subl %edx, %eax
subl $0x1, %eax
jb 0x8796
movq 0x10(%rbx), %rcx
leaq 0x10(%rcx), %rdx
movq %rdx, 0x10(%rbx)
andl $0x0, 0x8(%rcx)
jmp 0x877b
leaq 0x10(%r14), %rbp
movq 0x20(%rbx), %rax
movq 0x18(%rax), %r12
testq %r12, %r12
jne 0x87ae
movq %rbx, %rdi
callq 0xded0
movq %rax, %r12
movq %r12, 0x20(%rbx)
movl 0x4(%rsp), %eax
movw %ax, 0x40(%r12)
movq %r14, (%r12)
movq %rbp, 0x20(%r12)
shll $0x4, %r15d
addq %rbp, %r15
movq %r15, 0x8(%r12)
movq %r15, 0x10(%rbx)
movq 0x38(%r13), %rax
movq %rax, 0x28(%r12)
movb $0x2, 0x42(%r12)
xorl %r15d, %r15d
testb $0x1, 0xc8(%rbx)
je 0x8835
addq $0x4, %rax
movq %rax, 0x28(%r12)
movq 0x10(%r12), %rax
xorl %r15d, %r15d
testb $0x2, 0x42(%rax)
movl $0x0, %esi
je 0x8824
movq 0x28(%rax), %rax
movl -0x4(%rax), %eax
andl $0x3f, %eax
cmpl $0x25, %eax
jne 0x8824
movb $0x22, 0x42(%r12)
pushq $0x4
popq %rsi
pushq $-0x1
popq %rdx
movq %rbx, %rdi
callq 0x8475
addq $-0x4, 0x28(%r12)
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x18619(%rip), %rdx     # 0x20e67
movq %rbx, %rdi
movq %r14, %rsi
callq 0x78f2