// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movl 0xc8(%rax), %eax
movb %al, -0x11(%rbp)
movq -0x8(%rbp), %rax
movl 0xc0(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0xc0(%rax)
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x29(%rbp)
jne 0x9ea2
movzbl -0x11(%rbp), %eax
andl $0x8, %eax
cmpl $0x0, %eax
setne %al
movb %al, -0x29(%rbp)
movb -0x29(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x18(%rbp)
cmpl $0x0, -0x18(%rbp)
je 0x9ec9
movq -0x8(%rbp), %rax
movl 0xbc(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0xc0(%rax)
jmp 0x9edc
movzbl -0x11(%rbp), %eax
andl $0x4, %eax
cmpl $0x0, %eax
jne 0x9eda
jmp 0xa073
jmp 0x9edc
movq -0x10(%rbp), %rax
movzbl 0x42(%rax), %eax
andl $0x40, %eax
cmpl $0x0, %eax
je 0x9eff
movq -0x10(%rbp), %rax
movzbl 0x42(%rax), %ecx
andl $-0x41, %ecx
movb %cl, 0x42(%rax)
jmp 0xa073
cmpl $0x0, -0x18(%rbp)
je 0x9f18
movq -0x8(%rbp), %rdi
movl $0x3, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0xb110
movzbl -0x11(%rbp), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0xa003
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq (%rax), %rax
movq 0x18(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x20(%rbp), %rcx
movq 0x38(%rcx), %rcx
subq %rcx, %rax
sarq $0x2, %rax
subl $0x1, %eax
movl %eax, -0x24(%rbp)
movq -0x20(%rbp), %rax
cmpq $0x0, 0x48(%rax)
je 0x9f76
movq -0x20(%rbp), %rax
movq 0x48(%rax), %rax
movslq -0x24(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x30(%rbp)
jmp 0x9f80
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, -0x30(%rbp)
jmp 0x9f80
movl -0x30(%rbp), %eax
movl %eax, -0x28(%rbp)
cmpl $0x0, -0x24(%rbp)
je 0x9ff0
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x8(%rbp), %rcx
cmpq 0x28(%rcx), %rax
jbe 0x9ff0
movl -0x28(%rbp), %eax
movl %eax, -0x34(%rbp)
movq -0x20(%rbp), %rax
cmpq $0x0, 0x48(%rax)
je 0x9fdc
movq -0x20(%rbp), %rax
movq 0x48(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x28(%rcx), %rcx
movq -0x20(%rbp), %rdx
movq 0x38(%rdx), %rdx
subq %rdx, %rcx
sarq $0x2, %rcx
subl $0x1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x38(%rbp)
jmp 0x9fe6
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, -0x38(%rbp)
jmp 0x9fe6
movl -0x34(%rbp), %eax
movl -0x38(%rbp), %ecx
cmpl %ecx, %eax
je 0xa001
movq -0x8(%rbp), %rdi
movl -0x28(%rbp), %edx
movl $0x2, %esi
callq 0xb110
jmp 0xa003
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x8(%rbp), %rax
movzbl 0xc(%rax), %eax
cmpl $0x1, %eax
jne 0xa073
cmpl $0x0, -0x18(%rbp)
je 0xa034
movq -0x8(%rbp), %rax
movl $0x1, 0xc0(%rax)
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rcx
addq $-0x4, %rcx
movq %rcx, 0x28(%rax)
movq -0x10(%rbp), %rax
movzbl 0x42(%rax), %ecx
orl $0x40, %ecx
movb %cl, 0x42(%rax)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rcx
addq $-0x10, %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0xaa40
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)