// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
cmpl $0x6, 0x8(%rax)
jne 0xa3f8
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rax
cmpb $0x0, 0xa(%rax)
jne 0xa3f8
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rax
movq 0x20(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0xa820
movl %eax, -0x34(%rbp)
movq -0x30(%rbp), %rdi
movl -0x1c(%rbp), %esi
addl $0x1, %esi
movl -0x34(%rbp), %edx
callq 0xd360
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movq -0x28(%rbp), %rax
cmpq $0x0, (%rax)
je 0xa277
leaq 0x22499(%rip), %rax     # 0x2c707
movq %rax, -0x8(%rbp)
jmp 0xa400
movq -0x30(%rbp), %rdi
movl -0x34(%rbp), %esi
movl -0x1c(%rbp), %edx
callq 0x9900
movl %eax, -0x38(%rbp)
movl -0x38(%rbp), %eax
andl $0x3f, %eax
movl %eax, %ecx
movq %rcx, -0x58(%rbp)
subl $0xb, %eax
ja 0xa3f4
movq -0x58(%rbp), %rax
leaq 0x211ff(%rip), %rcx     # 0x2b4a8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl -0x38(%rbp), %eax
shrl $0xe, %eax
andl $0x3ffff, %eax          # imm = 0x3FFFF
movl %eax, -0x3c(%rbp)
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x3c(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rcx
addq $0x18, %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
leaq 0x212c8(%rip), %rax     # 0x2b5b0
movq %rax, -0x8(%rbp)
jmp 0xa400
movl -0x38(%rbp), %eax
shrl $0x6, %eax
andl $0xff, %eax
movl %eax, -0x40(%rbp)
movl -0x38(%rbp), %eax
shrl $0x17, %eax
andl $0x1ff, %eax            # imm = 0x1FF
movl %eax, -0x44(%rbp)
movl -0x44(%rbp), %eax
cmpl -0x40(%rbp), %eax
jge 0xa332
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl -0x44(%rbp), %edx
movq -0x28(%rbp), %rcx
callq 0xa1e0
movq %rax, -0x8(%rbp)
jmp 0xa400
jmp 0xa3f6
movl -0x38(%rbp), %eax
shrl $0xe, %eax
andl $0x1ff, %eax            # imm = 0x1FF
movl %eax, -0x48(%rbp)
movq -0x30(%rbp), %rdi
movl -0x48(%rbp), %esi
callq 0xad50
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
leaq 0x21255(%rip), %rax     # 0x2b5b7
movq %rax, -0x8(%rbp)
jmp 0xa400
movl -0x38(%rbp), %eax
shrl $0x17, %eax
andl $0x1ff, %eax            # imm = 0x1FF
movl %eax, -0x4c(%rbp)
movq -0x30(%rbp), %rax
cmpq $0x0, 0x38(%rax)
je 0xa39e
movq -0x30(%rbp), %rax
movq 0x38(%rax), %rax
movslq -0x4c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
addq $0x18, %rax
movq %rax, -0x60(%rbp)
jmp 0xa3ab
leaq 0x224b3(%rip), %rax     # 0x2c858
movq %rax, -0x60(%rbp)
jmp 0xa3ab
movq -0x60(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
leaq 0x2235f(%rip), %rax     # 0x2c71c
movq %rax, -0x8(%rbp)
jmp 0xa400
movl -0x38(%rbp), %eax
shrl $0xe, %eax
andl $0x1ff, %eax            # imm = 0x1FF
movl %eax, -0x50(%rbp)
movq -0x30(%rbp), %rdi
movl -0x50(%rbp), %esi
callq 0xad50
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
leaq 0x211cf(%rip), %rax     # 0x2b5bd
movq %rax, -0x8(%rbp)
jmp 0xa400
jmp 0xa3f6
jmp 0xa3f8
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
nopw (%rax,%rax)