// File: /workspace/github_c_makefile_star2_O0/tylerneylon[P]APIsWithLua/lua/ldebug.c
// Function: getfuncname
static const char *getfuncname (lua_State *L, CallInfo *ci, const char **name) {
  TMS tm = (TMS)0;  /* to avoid warnings */
  Proto *p = ci_func(ci)->p;  /* calling function */
  int pc = currentpc(ci);  /* calling instruction index */
  Instruction i = p->code[pc];  /* calling instruction */
  if (ci->callstatus & CIST_HOOKED) {  /* was it called inside a hook? */
    *name = "?";
    return "hook";
  }
  switch (GET_OPCODE(i)) {
    case OP_CALL:
    case OP_TAILCALL:  /* get function name */
      return getobjname(p, pc, GETARG_A(i), name);
    case OP_TFORCALL: {  /* for iterator */
      *name = "for iterator";
       return "for iterator";
    }
    /* all other instructions can call only through metamethods */
    case OP_SELF: case OP_GETTABUP: case OP_GETTABLE:
      tm = TM_INDEX;
      break;
    case OP_SETTABUP: case OP_SETTABLE:
      tm = TM_NEWINDEX;
      break;
    case OP_ADD: case OP_SUB: case OP_MUL: case OP_MOD:
    case OP_POW: case OP_DIV: case OP_IDIV: case OP_BAND:
    case OP_BOR: case OP_BXOR: case OP_SHL: case OP_SHR: {
      int offset = cast_int(GET_OPCODE(i)) - cast_int(OP_ADD);  /* ORDER OP */
      tm = cast(TMS, offset + cast_int(TM_ADD));  /* ORDER TM */
      break;
    }
    case OP_UNM: tm = TM_UNM; break;
    case OP_BNOT: tm = TM_BNOT; break;
    case OP_LEN: tm = TM_LEN; break;
    case OP_CONCAT: tm = TM_CONCAT; break;
    case OP_EQ: tm = TM_EQ; break;
    case OP_LT: tm = TM_LT; break;
    case OP_LE: tm = TM_LE; break;
    default: lua_assert(0);  /* other instructions cannot call a function */
  }
  *name = getstr(G(L)->tmname[tm]);
  return "metamethod";
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq (%rax), %rax
movq 0x18(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rdi
callq 0xa110
movl %eax, -0x34(%rbp)
movq -0x30(%rbp), %rax
movq 0x38(%rax), %rax
movslq -0x34(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x38(%rbp)
movq -0x18(%rbp), %rax
movzbl 0x42(%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0xa2b9
movq -0x20(%rbp), %rax
leaq 0x2a290(%rip), %rcx     # 0x34536
movq %rcx, (%rax)
leaq 0x2c20d(%rip), %rax     # 0x364bd
movq %rax, -0x8(%rbp)
jmp 0xa3be
movl -0x38(%rbp), %eax
andl $0x3f, %eax
addl $-0x6, %eax
movl %eax, %ecx
movq %rcx, -0x48(%rbp)
subl $0x23, %eax
ja 0xa393
movq -0x48(%rbp), %rax
leaq 0x2a048(%rip), %rcx     # 0x34324
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x30(%rbp), %rdi
movl -0x34(%rbp), %esi
movl -0x38(%rbp), %edx
shrl $0x6, %edx
andl $0xff, %edx
movq -0x20(%rbp), %rcx
callq 0xa3d0
movq %rax, -0x8(%rbp)
jmp 0xa3be
movq -0x20(%rbp), %rax
leaq 0x2a228(%rip), %rcx     # 0x3453d
movq %rcx, (%rax)
leaq 0x2a21e(%rip), %rax     # 0x3453d
movq %rax, -0x8(%rbp)
jmp 0xa3be
movl $0x0, -0x24(%rbp)
jmp 0xa395
movl $0x1, -0x24(%rbp)
jmp 0xa395
movl -0x38(%rbp), %eax
shrl $0x0, %eax
andl $0x3f, %eax
subl $0xd, %eax
movl %eax, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
addl $0x6, %eax
movl %eax, -0x24(%rbp)
jmp 0xa395
movl $0x12, -0x24(%rbp)
jmp 0xa395
movl $0x13, -0x24(%rbp)
jmp 0xa395
movl $0x4, -0x24(%rbp)
jmp 0xa395
movl $0x16, -0x24(%rbp)
jmp 0xa395
movl $0x5, -0x24(%rbp)
jmp 0xa395
movl $0x14, -0x24(%rbp)
jmp 0xa395
movl $0x15, -0x24(%rbp)
jmp 0xa395
jmp 0xa395
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x24(%rbp), %ecx
movq 0xe0(%rax,%rcx,8), %rcx
addq $0x18, %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
leaq 0x2a190(%rip), %rax     # 0x3454a
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax,%rax)