// File: /workspace/github_c_makefile_star2_O3/tylerneylon[P]APIsWithLua/lua/ldebug.c
// Function: luaG_traceexec
void luaG_traceexec (lua_State *L) {
  CallInfo *ci = L->ci;
  lu_byte mask = L->hookmask;
  int counthook = (--L->hookcount == 0 && (mask & LUA_MASKCOUNT));
  if (counthook)
    resethookcount(L);  /* reset count */
  else if (!(mask & LUA_MASKLINE))
    return;  /* no line hook and count != 0; nothing to be done */
  if (ci->callstatus & CIST_HOOKYIELD) {  /* called hook last time? */
    ci->callstatus &= ~CIST_HOOKYIELD;  /* erase mark */
    return;  /* do not call hook again (VM yielded, so it did not move) */
  }
  if (counthook)
    luaD_hook(L, LUA_HOOKCOUNT, -1);  /* call count hook */
  if (mask & LUA_MASKLINE) {
    Proto *p = ci_func(ci)->p;
    int npc = pcRel(ci->u.l.savedpc, p);
    int newline = getfuncline(p, npc);
    if (npc == 0 ||  /* call linehook when enter a new function, */
        ci->u.l.savedpc <= L->oldpc ||  /* when jump back (loop), or when */
        newline != getfuncline(p, pcRel(L->oldpc, p)))  /* enter a new line */
      luaD_hook(L, LUA_HOOKLINE, newline);  /* call line hook */
  }
  L->oldpc = ci->u.l.savedpc;
  if (L->status == LUA_YIELD) {  /* did hook yield? */
    if (counthook)
      L->hookcount = 1;  /* undo decrement to zero */
    ci->u.l.savedpc--;  /* undo increment (resume will increment it again) */
    ci->callstatus |= CIST_HOOKYIELD;  /* mark that it yielded */
    ci->func = L->top - 1;  /* protect stack below results */
    luaD_throw(L, LUA_YIELD);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x20(%rdi), %r14
movl 0xc8(%rdi), %r15d
decl 0xc0(%rdi)
sete %al
movl %r15d, %ebp
andl $0x8, %ebp
shrl $0x3, %ebp
andb %al, %bpl
je 0x81b3
movl 0xbc(%rbx), %eax
movl %eax, 0xc0(%rbx)
movb 0x42(%r14), %al
testb $0x40, %al
jne 0x81f4
movq %rbx, %rdi
movl $0x3, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x89ed
testb $0x4, %r15b
jne 0x81c5
movq 0x28(%r14), %rax
movq %rax, 0x28(%rbx)
cmpb $0x1, 0xc(%rbx)
jne 0x8257
jmp 0x8267
testb $0x4, %r15b
je 0x8257
movb 0x42(%r14), %al
testb $0x40, %al
jne 0x81f4
movq (%r14), %rax
movq 0x28(%r14), %rsi
movq (%rax), %rax
movq 0x18(%rax), %rax
movq 0x38(%rax), %rcx
movq 0x48(%rax), %rax
movq %rsi, %rdi
subq %rcx, %rdi
shrq $0x2, %rdi
decl %edi
testq %rax, %rax
je 0x81ff
movslq %edi, %rdx
movl (%rax,%rdx,4), %edx
jmp 0x8204
addq $0x42, %r14
andb $-0x41, %al
movb %al, (%r14)
jmp 0x8257
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
testl %edi, %edi
je 0x823c
movq 0x28(%rbx), %rdi
cmpq %rdi, %rsi
jbe 0x823c
testq %rax, %rax
je 0x8233
subq %rcx, %rdi
shlq $0x1e, %rdi
movabsq $-0x100000000, %rcx     # imm = 0xFFFFFFFF00000000
addq %rdi, %rcx
sarq $0x20, %rcx
movl (%rax,%rcx,4), %eax
jmp 0x8238
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl %eax, %edx
je 0x8249
movq %rbx, %rdi
movl $0x2, %esi
callq 0x89ed
movq 0x28(%r14), %rax
movq %rax, 0x28(%rbx)
cmpb $0x1, 0xc(%rbx)
je 0x8262
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
testb %bpl, %bpl
je 0x8278
leaq 0x28(%r14), %rax
movl $0x1, 0xc0(%rbx)
movq (%rax), %rax
addq $-0x4, %rax
movq %rax, 0x28(%r14)
orb $0x40, 0x42(%r14)
movq 0x10(%rbx), %rax
addq $-0x10, %rax
movq %rax, (%r14)
movq %rbx, %rdi
movl $0x1, %esi
callq 0x8578