// File: /workspace/github_c_makefile_star2_O3/kieselsteini[P]PiXL-old/lua53.c
// Function: lua_resume
LUA_API int lua_resume (lua_State *L, lua_State *from, int nargs) {
  int status;
  unsigned short oldnny = L->nny;  /* save "number of non-yieldable" calls */
  lua_lock(L);
  if (L->status == LUA_OK) {  /* may be starting a coroutine */
    if (L->ci != &L->base_ci)  /* not in base level? */
      return resume_error(L, "cannot resume non-suspended coroutine", nargs);
  }
  else if (L->status != LUA_YIELD)
    return resume_error(L, "cannot resume dead coroutine", nargs);
  L->nCcalls = (from) ? from->nCcalls + 1 : 1;
  if (L->nCcalls >= LUAI_MAXCCALLS)
    return resume_error(L, "C stack overflow", nargs);
  luai_userstateresume(L, nargs);
  L->nny = 0;  /* allow yields */
  api_checknelems(L, (L->status == LUA_OK) ? nargs + 1 : nargs);
  status = luaD_rawrunprotected(L, resume, &nargs);
  if (status == -1)  /* error calling 'lua_resume'? */
    status = LUA_ERRRUN;
  else {  /* continue running after recoverable errors */
    while (errorstatus(status) && recover(L, status)) {
      /* unroll continuation */
      status = luaD_rawrunprotected(L, unroll, &status);
    }
    if (errorstatus(status)) {  /* unrecoverable error? */
      L->status = cast_byte(status);  /* mark thread as 'dead' */
      seterrorobj(L, status, L->top);  /* push error message */
      L->ci->top = L->top;
    }
    else lua_assert(status == L->status);  /* normal end or yield */
  }
  L->nny = oldnny;  /* restore 'nny' */
  L->nCcalls--;
  lua_assert(L->nCcalls == ((from) ? from->nCcalls : 0));
  lua_unlock(L);
  return status;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl %edx, 0x4(%rsp)
movzwl 0xc4(%rdi), %r13d
movzbl 0xc(%rdi), %eax
cmpl $0x1, %eax
je 0x144ea
testl %eax, %eax
jne 0x14527
leaq 0x60(%rbx), %rax
cmpq %rax, 0x20(%rbx)
je 0x144ea
movq 0x10(%rbx), %r14
movslq %edx, %r15
shlq $0x4, %r15
movq %r14, %r12
subq %r15, %r12
movq %r12, 0x10(%rbx)
leaq 0x1ec5e(%rip), %rsi     # 0x33146
jmp 0x14543
testq %rsi, %rsi
je 0x1456d
movzwl 0xc6(%rsi), %eax
incl %eax
movw %ax, 0xc6(%rbx)
movzwl %ax, %eax
cmpl $0xc8, %eax
jb 0x14576
movq 0x10(%rbx), %r14
movslq %edx, %r15
shlq $0x4, %r15
movq %r14, %r12
subq %r15, %r12
movq %r12, 0x10(%rbx)
leaq 0x1ec64(%rip), %rsi     # 0x33189
jmp 0x14543
movq 0x10(%rbx), %r14
movslq %edx, %r15
shlq $0x4, %r15
movq %r14, %r12
subq %r15, %r12
movq %r12, 0x10(%rbx)
leaq 0x1ec29(%rip), %rsi     # 0x3316c
movq %rbx, %rdi
callq 0xa533
movq %rax, (%r12)
movzbl 0x8(%rax), %eax
orl $0x40, %eax
negq %r15
movl %eax, 0x8(%r14,%r15)
addq $0x10, 0x10(%rbx)
movl $0x2, %ebp
jmp 0x1467f
movw $0x1, 0xc6(%rbx)
movw $0x0, 0xc4(%rbx)
leaq 0x10a(%rip), %rsi       # 0x14690
leaq 0x4(%rsp), %rdx
movq %rbx, %rdi
callq 0x8e44
movl %eax, (%rsp)
cmpl $-0x1, %eax
je 0x14643
movl %eax, %ebp
cmpl $0x2, %eax
jl 0x14670
leaq 0x18f(%rip), %r12       # 0x14740
movq 0x20(%rbx), %r14
testq %r14, %r14
je 0x1464f
testb $0x10, 0x42(%r14)
jne 0x145d0
movq 0x10(%r14), %r14
testq %r14, %r14
jne 0x145be
jmp 0x1464a
movq %r12, %r15
movq 0x38(%rbx), %r12
addq 0x38(%r14), %r12
movq %rbx, %rdi
movq %r12, %rsi
callq 0x1481b
movq %rbx, %rdi
movl %ebp, %esi
movq %r12, %rdx
movq %r15, %r12
movq %rsp, %r15
callq 0x11aca
movq %r14, 0x20(%rbx)
movb 0x42(%r14), %al
andb $0x1, %al
movb %al, 0xcc(%rbx)
movw $0x0, 0xc4(%rbx)
movq %rbx, %rdi
callq 0x11df6
movq 0x28(%r14), %rax
movq %rax, 0xb0(%rbx)
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x8e44
movl %eax, %ebp
movl %eax, (%rsp)
cmpl $0x1, %eax
jg 0x145b1
jmp 0x14670
movl $0x2, %ebp
jmp 0x14670
cmpl $0x2, %ebp
jl 0x14670
movb %bpl, 0xc(%rbx)
movq 0x10(%rbx), %rdx
movq %rbx, %rdi
movl %ebp, %esi
callq 0x11aca
movq 0x10(%rbx), %rax
movq 0x20(%rbx), %rcx
movq %rax, 0x8(%rcx)
movl (%rsp), %ebp
movw %r13w, 0xc4(%rbx)
decw 0xc6(%rbx)
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq