// File: /workspace/github_c_makefile_star2_O2/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
subq $0x18, %rsp
movq %rcx, 0x10(%rsp)
movl %edx, %r15d
movq %rsi, %r12
movq %rdi, %r13
movq $0x0, 0x8(%rsp)
leaq 0x123ec(%rip), %rbx     # 0x19410
movq 0x8(%r12), %rax
cmpl $0x6, 0x8(%rax)
jne 0x7148
movq (%rax), %rax
cmpb $0x0, 0xa(%rax)
jne 0x7148
movq 0x20(%rax), %rbp
movq %r13, %rdi
movq %r12, %rsi
callq 0x73bc
movl %eax, %r14d
leal 0x1(%r15), %esi
movq %rbp, %rdi
movl %eax, %edx
callq 0x8810
movq 0x10(%rsp), %rcx
movq %rax, (%rcx)
testq %rax, %rax
jne 0x70ae
movq %rbp, %rdi
movl %r14d, %esi
movl %r15d, %edx
callq 0x6955
movl %eax, %r15d
andl $0x3f, %eax
cmpl $0xb, %eax
ja 0x7148
movslq (%rbx,%rax,4), %rax
addq %rbx, %rax
jmpq *%rax
movl %r15d, %eax
shrl $0x6, %eax
movzbl %al, %eax
shrl $0x17, %r15d
cmpl %eax, %r15d
jb 0x7024
jmp 0x7148
leaq 0x13632(%rip), %rax     # 0x1a6e7
movq %rax, 0x8(%rsp)
jmp 0x7148
shrl $0xe, %r15d
andl $0x1ff, %r15d           # imm = 0x1FF
movq %rbp, %rdi
movl %r15d, %esi
callq 0x745e
leaq 0x12437(%rip), %rcx     # 0x19513
jmp 0x713b
movq 0x38(%rbp), %rax
leaq 0x13613(%rip), %rcx     # 0x1a6fc
movq %rcx, 0x8(%rsp)
testq %rax, %rax
je 0x715c
shrl $0x17, %r15d
movq (%rax,%r15,8), %rax
addq $0x18, %rax
jmp 0x7140
shrl $0xe, %r15d
andl $0x1ff, %r15d           # imm = 0x1FF
movq %rbp, %rdi
movl %r15d, %esi
callq 0x745e
leaq 0x123fb(%rip), %rcx     # 0x19519
jmp 0x713b
movq 0x10(%rbp), %rax
shrl $0xa, %r15d
andl $-0x10, %r15d
movq (%rax,%r15), %rax
addq $0x18, %rax
leaq 0x123d1(%rip), %rcx     # 0x1950c
movq %rcx, 0x8(%rsp)
movq 0x10(%rsp), %rcx
movq %rax, (%rcx)
movq 0x8(%rsp), %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x136d5(%rip), %rax     # 0x1a838
jmp 0x7140