// File: /workspace/github_c_makefile_star2_O1/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 0x11ee3
testl %eax, %eax
jne 0x11ef3
leaq 0x60(%rbx), %rax
cmpq %rax, 0x20(%rbx)
je 0x11ee3
movq 0x10(%rbx), %r14
movslq %edx, %r15
shlq $0x4, %r15
movq %r14, %r12
subq %r15, %r12
movq %r12, 0x10(%rbx)
leaq 0x1e1cd(%rip), %rsi     # 0x300ae
jmp 0x11f42
testq %rsi, %rsi
je 0x11f11
movzwl 0xc6(%rsi), %eax
incl %eax
jmp 0x11f15
movq 0x10(%rbx), %r14
movslq %edx, %r15
shlq $0x4, %r15
movq %r14, %r12
subq %r15, %r12
movq %r12, 0x10(%rbx)
leaq 0x1e1c5(%rip), %rsi     # 0x300d4
jmp 0x11f42
movw $0x1, %ax
movw %ax, 0xc6(%rbx)
movzwl %ax, %eax
cmpl $0xc8, %eax
jb 0x11f6c
movq 0x10(%rbx), %r14
movslq %edx, %r15
shlq $0x4, %r15
movq %r14, %r12
subq %r15, %r12
movq %r12, 0x10(%rbx)
leaq 0x1e1af(%rip), %rsi     # 0x300f1
movq %rbx, %rdi
callq 0x87e2
movq %rax, (%r12)
movzbl 0x8(%rax), %eax
orl $0x40, %eax
negq %r15
movl %eax, 0x8(%r14,%r15)
addq $0x10, 0x10(%rbx)
movl $0x2, %eax
jmp 0x1206d
movw $0x0, 0xc4(%rbx)
leaq 0x100(%rip), %rsi       # 0x1207c
leaq 0x4(%rsp), %rdx
movq %rbx, %rdi
callq 0x715f
movl %eax, (%rsp)
cmpl $-0x1, %eax
je 0x12054
movl (%rsp), %ebp
cmpl $0x2, %ebp
jl 0x1202e
movq %rsp, %r15
movq 0x20(%rbx), %r14
testq %r14, %r14
je 0x11fba
testb $0x10, 0x42(%r14)
jne 0x11fbd
movq 0x10(%r14), %r14
jmp 0x11fa8
xorl %r14d, %r14d
testq %r14, %r14
je 0x1202e
movq 0x38(%rbx), %r12
addq 0x38(%r14), %r12
movq %rbx, %rdi
movq %r12, %rsi
callq 0x12207
movq %rbx, %rdi
movl %ebp, %esi
movq %r12, %rdx
callq 0xf8dd
movq %r14, 0x20(%rbx)
movb 0x42(%r14), %al
andb $0x1, %al
movb %al, 0xcc(%rbx)
movw $0x0, 0xc4(%rbx)
movq %rbx, %rdi
callq 0xfb23
movq 0x28(%r14), %rax
movq %rax, 0xb0(%rbx)
movq %rbx, %rdi
leaq 0x114(%rip), %rsi       # 0x1212c
movq %r15, %rdx
callq 0x715f
movl %eax, %ebp
movl %eax, (%rsp)
cmpl $0x1, %eax
jg 0x11fa4
movl (%rsp), %esi
cmpl $0x2, %esi
jl 0x1205b
movb %sil, 0xc(%rbx)
movq 0x10(%rbx), %rdx
movq %rbx, %rdi
callq 0xf8dd
movq 0x10(%rbx), %rax
movq 0x20(%rbx), %rcx
movq %rax, 0x8(%rcx)
jmp 0x1205b
movl $0x2, (%rsp)
movw %r13w, 0xc4(%rbx)
decw 0xc6(%rbx)
movl (%rsp), %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq