// File: /workspace/github_c_makefile_star2_O2/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
subq $0x18, %rsp
movq %rdi, %rbx
movl %edx, 0xc(%rsp)
movzwl 0xc4(%rdi), %r13d
movzbl 0xc(%rdi), %eax
cmpl $0x1, %eax
je 0x10099
testl %eax, %eax
jne 0x100bd
leaq 0x60(%rbx), %rax
cmpq %rax, 0x20(%rbx)
je 0x10099
leaq 0x1a0e7(%rip), %rsi     # 0x2a17e
jmp 0x100c4
testq %rsi, %rsi
je 0x100d4
movzwl 0xc6(%rsi), %eax
incl %eax
movw %ax, 0xc6(%rbx)
cmpw $0xc8, %ax
jb 0x100dd
leaq 0x1a106(%rip), %rsi     # 0x2a1c1
jmp 0x100c4
leaq 0x1a0e0(%rip), %rsi     # 0x2a1a4
movq %rbx, %rdi
callq 0x1020f
pushq $0x2
popq %rbp
jmp 0x101fe
movw $0x1, 0xc6(%rbx)
andw $0x0, 0xc4(%rbx)
leaq 0x16c(%rip), %rsi       # 0x10258
leaq 0xc(%rsp), %rdx
movq %rbx, %rdi
callq 0x6a32
movl %eax, 0x4(%rsp)
cmpl $-0x1, %eax
je 0x101ec
movl %eax, %ebp
leaq 0x20(%rbx), %rax
leaq 0x1f6(%rip), %r12       # 0x10309
leaq 0x4(%rsp), %r15
cmpl $0x2, %ebp
jl 0x101ef
movq %rax, %r14
movq (%r14), %r14
testq %r14, %r14
je 0x101c3
testb $0x10, 0x42(%r14)
jne 0x1013d
addq $0x10, %r14
jmp 0x10124
movw %r13w, 0xa(%rsp)
movq %r15, %r13
movq %r12, %r15
movq 0x38(%rbx), %r12
addq 0x38(%r14), %r12
movq %rbx, %rdi
movq %r12, %rsi
movq %rax, 0x10(%rsp)
callq 0x103df
movq %rbx, %rdi
movl %ebp, %esi
movq %r12, %rdx
movq %r15, %r12
movq %r13, %r15
movzwl 0xa(%rsp), %r13d
callq 0xdd4f
movq %r14, 0x20(%rbx)
movb 0x42(%r14), %al
andb $0x1, %al
movb %al, 0xcc(%rbx)
andw $0x0, 0xc4(%rbx)
movq %rbx, %rdi
callq 0xdf83
movq 0x28(%r14), %rax
movq %rax, 0xb0(%rbx)
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x6a32
movl %eax, %ebp
movq 0x10(%rsp), %rax
movl %ebp, 0x4(%rsp)
jmp 0x10118
cmpl $0x2, %ebp
jl 0x101ef
movb %bpl, 0xc(%rbx)
movq 0x10(%rbx), %rdx
movq %rbx, %rdi
movl %ebp, %esi
callq 0xdd4f
movq 0x10(%rbx), %rax
movq 0x20(%rbx), %rcx
movq %rax, 0x8(%rcx)
movl 0x4(%rsp), %ebp
jmp 0x101ef
pushq $0x2
popq %rbp
movw %r13w, 0xc4(%rbx)
decw 0xc6(%rbx)
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq