// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/external/lua-5.1.5/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:
movq 0x8(%rsi), %rax
cmpl $0x6, 0x8(%rax)
jne 0x5ca44
movq (%rax), %rax
cmpb $0x0, 0xa(%rax)
jne 0x5ca44
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movl %edx, %r13d
movq %rsi, %r14
movq %rdi, %r15
movq 0x20(%rax), %r12
callq 0x5c87a
movslq 0x5c(%r12), %rdx
testq %rdx, %rdx
jle 0x5ca12
leal 0x1(%r13), %edi
movq 0x30(%r12), %rsi
shlq $0x4, %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
cmpl %eax, 0x8(%rsi,%r8)
jg 0x5ca1e
cmpl %eax, 0xc(%rsi,%r8)
jle 0x5ca07
decl %edi
je 0x5ca16
addq $0x10, %r8
cmpq %r8, %rdx
jne 0x5c9f5
jmp 0x5ca1e
xorl %ecx, %ecx
jmp 0x5ca1e
movq (%rsi,%r8), %rcx
addq $0x18, %rcx
movq %rcx, (%rbx)
testq %rcx, %rcx
je 0x5ca4a
leaq 0x91d81(%rip), %rcx     # 0xee7ae
movb $0x1, %bpl
testb %bpl, %bpl
leaq 0x8(%rsp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jne 0x5ca46
xorl %ecx, %ecx
movq %rcx, %rax
retq
movq %r12, %rdi
movl %eax, %esi
movl %r13d, %edx
callq 0x5cb67
movl %eax, %ecx
andl $0x3f, %ecx
xorl %ebp, %ebp
cmpl $0xb, %ecx
ja 0x5cabd
leaq 0x90736(%rip), %rdx     # 0xed1a0
movslq (%rdx,%rcx,4), %rsi
addq %rdx, %rsi
jmpq *%rsi
movl %eax, %ecx
shrl $0x6, %ecx
movzbl %cl, %ecx
shrl $0x17, %eax
cmpl %ecx, %eax
setb %bpl
jae 0x5cabd
movq %r15, %rdi
movq %r14, %rsi
movl %eax, %edx
movq %rbx, %rcx
callq 0x5c99e
movq %rax, %rcx
jmp 0x5ca30
movq 0x10(%r12), %rcx
shrl $0xa, %eax
andl $-0x10, %eax
movq (%rcx,%rax), %rax
addq $0x18, %rax
movq %rax, (%rbx)
leaq 0x9130f(%rip), %rcx     # 0xeddc7
jmp 0x5ca2d
jmp 0x5ca30
movq 0x38(%r12), %rcx
testq %rcx, %rcx
je 0x5cb51
shrl $0x17, %eax
movq (%rcx,%rax,8), %rax
addq $0x18, %rax
jmp 0x5cb58
leaq 0x91e19(%rip), %rcx     # 0xee8fd
btl $0x16, %eax
jae 0x5cb08
movq 0x10(%r12), %rdx
shrl $0xa, %eax
andl $0xff0, %eax            # imm = 0xFF0
cmpl $0x4, 0x8(%rdx,%rax)
jne 0x5cb08
addq %rax, %rdx
movq (%rdx), %rcx
addq $0x18, %rcx
movq %rcx, (%rbx)
leaq 0x8a7df(%rip), %rcx     # 0xe72f1
jmp 0x5ca2d
leaq 0x91ddf(%rip), %rcx     # 0xee8fd
btl $0x16, %eax
jae 0x5cb42
movq 0x10(%r12), %rdx
shrl $0xa, %eax
andl $0xff0, %eax            # imm = 0xFF0
cmpl $0x4, 0x8(%rdx,%rax)
jne 0x5cb42
addq %rax, %rdx
movq (%rdx), %rcx
addq $0x18, %rcx
movq %rcx, (%rbx)
leaq 0x9c90f(%rip), %rcx     # 0xf945b
jmp 0x5ca2d
leaq 0x91da5(%rip), %rax     # 0xee8fd
movq %rax, (%rbx)
leaq 0x91c61(%rip), %rcx     # 0xee7c3
jmp 0x5ca2d