// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/deps/lua/src/ldebug.c
// Function: getobjname
static const char *getobjname (lua_State *L, CallInfo *ci, int stackpos,
                               const char **name) {
  if (isLua(ci)) {  /* a Lua function? */
    Proto *p = ci_func(ci)->l.p;
    int pc = currentpc(L, ci);
    Instruction i;
    *name = luaF_getlocalname(p, stackpos+1, pc);
    if (*name)  /* is a local? */
      return "local";
    i = symbexec(p, pc, stackpos);  /* try symbolic execution */
    lua_assert(pc != -1);
    switch (GET_OPCODE(i)) {
      case OP_GETGLOBAL: {
        int g = GETARG_Bx(i);  /* global index */
        lua_assert(ttisstring(&p->k[g]));
        *name = svalue(&p->k[g]);
        return "global";
      }
      case OP_MOVE: {
        int a = GETARG_A(i);
        int b = GETARG_B(i);  /* move from `b' to `a' */
        if (b < a)
          return getobjname(L, ci, b, name);  /* get name for `b' */
        break;
      }
      case OP_GETTABLE: {
        int k = GETARG_C(i);  /* key index */
        *name = kname(p, k);
        return "field";
      }
      case OP_GETUPVAL: {
        int u = GETARG_B(i);  /* upvalue index */
        *name = p->upvalues ? getstr(p->upvalues[u]) : "?";
        return "upvalue";
      }
      case OP_SELF: {
        int k = GETARG_C(i);  /* key index */
        *name = kname(p, k);
        return "method";
      }
      default: break;
    }
  }
  return NULL;  /* no useful name found */
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movl %edx, %r15d
movq %rsi, %r13
movq %rdi, %rbp
movq 0x8(%r13), %rax
cmpl $0x6, 0x8(%rax)
jne 0x75b7
movq (%rax), %rax
cmpb $0x0, 0xa(%rax)
jne 0x75b7
movq 0x20(%rax), %r12
movq %rbp, %rdi
movq %r13, %rsi
callq 0x78d6
movl %eax, %r14d
leal 0x1(%r15), %esi
movq %r12, %rdi
movl %eax, %edx
callq 0x9047
movq %rax, (%rbx)
testq %rax, %rax
jne 0x75be
movq %r12, %rdi
movl %r14d, %esi
movl %r15d, %edx
callq 0x6e45
movl %eax, %r15d
andl $0x3f, %eax
jne 0x757b
movl %r15d, %eax
shrl $0x6, %eax
movzbl %al, %eax
shrl $0x17, %r15d
cmpl %eax, %r15d
jb 0x750e
jmp 0x75b7
addl $-0x4, %eax
cmpl $0x7, %eax
ja 0x75b7
leaq 0x13eb6(%rip), %rcx     # 0x1b440
movslq (%rcx,%rax,4), %rdx
addq %rcx, %rdx
xorl %eax, %eax
jmpq *%rdx
movq 0x38(%r12), %rax
testq %rax, %rax
je 0x7662
shrl $0x17, %r15d
leaq (%rax,%r15,8), %r15
leaq 0x1518a(%rip), %rax     # 0x1c73c
jmp 0x7649
xorl %eax, %eax
jmp 0x7653
leaq 0x15162(%rip), %rax     # 0x1c727
jmp 0x7653
shrl $0xa, %r15d
andl $-0x10, %r15d
addq 0x10(%r12), %r15
leaq 0x13f4e(%rip), %rax     # 0x1b52c
jmp 0x7649
leaq 0x15291(%rip), %rdx     # 0x1c878
btl $0x16, %r15d
jb 0x760e
leaq 0x13f3e(%rip), %rax     # 0x1b533
jmp 0x7650
leaq 0x1527a(%rip), %rdx     # 0x1c878
btl $0x16, %r15d
jb 0x7627
leaq 0x13f2d(%rip), %rax     # 0x1b539
jmp 0x7650
movq 0x10(%r12), %rcx
shrl $0xa, %r15d
andl $0xff0, %r15d           # imm = 0xFF0
leaq 0x13f0e(%rip), %rax     # 0x1b533
jmp 0x763e
movq 0x10(%r12), %rcx
shrl $0xa, %r15d
andl $0xff0, %r15d           # imm = 0xFF0
leaq 0x13efb(%rip), %rax     # 0x1b539
cmpl $0x4, 0x8(%rcx,%r15)
jne 0x7650
addq %rcx, %r15
movq (%r15), %rdx
addq $0x18, %rdx
movq %rdx, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x150d3(%rip), %rax     # 0x1c73c
leaq 0x15208(%rip), %rdx     # 0x1c878
jmp 0x7650