// File: /workspace/github_c_makefile_star2_O1/tylerneylon[P]APIsWithLua/lua/ldblib.c
// Function: db_getinfo
static int db_getinfo (lua_State *L) {
  lua_Debug ar;
  int arg;
  lua_State *L1 = getthread(L, &arg);
  const char *options = luaL_optstring(L, arg+2, "flnStu");
  checkstack(L, L1, 3);
  if (lua_isfunction(L, arg + 1)) {  /* info about a function? */
    options = lua_pushfstring(L, ">%s", options);  /* add '>' to 'options' */
    lua_pushvalue(L, arg + 1);  /* move function to 'L1' stack */
    lua_xmove(L, L1, 1);
  }
  else {  /* stack level */
    if (!lua_getstack(L1, (int)luaL_checkinteger(L, arg + 1), &ar)) {
      lua_pushnil(L);  /* level out of range */
      return 1;
    }
  }
  if (!lua_getinfo(L1, options, &ar))
    return luaL_argerror(L, arg+2, "invalid option");
  lua_newtable(L);  /* table to collect results */
  if (strchr(options, 'S')) {
    settabss(L, "source", ar.source);
    settabss(L, "short_src", ar.short_src);
    settabsi(L, "linedefined", ar.linedefined);
    settabsi(L, "lastlinedefined", ar.lastlinedefined);
    settabss(L, "what", ar.what);
  }
  if (strchr(options, 'l'))
    settabsi(L, "currentline", ar.currentline);
  if (strchr(options, 'u')) {
    settabsi(L, "nups", ar.nups);
    settabsi(L, "nparams", ar.nparams);
    settabsb(L, "isvararg", ar.isvararg);
  }
  if (strchr(options, 'n')) {
    settabss(L, "name", ar.name);
    settabss(L, "namewhat", ar.namewhat);
  }
  if (strchr(options, 't'))
    settabsb(L, "istailcall", ar.istailcall);
  if (strchr(options, 'L'))
    treatstackoption(L, L1, "activelines");
  if (strchr(options, 'f'))
    treatstackoption(L, L1, "func");
  return 1;  /* return table */
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x90, %rsp
movq %rdi, %rbx
leaq 0xc(%rsp), %r15
movq %r15, %rsi
callq 0x19a2b
movq %rax, %r14
movl (%r15), %r12d
leal 0x2(%r12), %ebp
leaq 0x9c59(%rip), %rdx      # 0x22d4c
movq %rbx, %rdi
movl %ebp, %esi
xorl %ecx, %ecx
callq 0x144dc
movq %rax, %r15
movq %rbx, %rdi
movq %r14, %rsi
movl $0x3, %edx
callq 0x19afa
incl %r12d
movq %rbx, %rdi
movl %r12d, %esi
callq 0x5f7f
cmpl $0x6, %eax
jne 0x19159
leaq 0x9c27(%rip), %rsi      # 0x22d53
movq %rbx, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x64e8
movq %rax, %r15
movq %rbx, %rdi
movl %r12d, %esi
callq 0x5f5b
movq %rbx, %rdi
movq %r14, %rsi
movl $0x1, %edx
callq 0x5cb2
jmp 0x1917b
movq %rbx, %rdi
movl %r12d, %esi
callq 0x1465a
leaq 0x10(%rsp), %rdx
movq %r14, %rdi
movl %eax, %esi
callq 0x75ba
testl %eax, %eax
je 0x193f0
leaq 0x10(%rsp), %rdx
movq %r14, %rdi
movq %r15, %rsi
callq 0x782a
testl %eax, %eax
je 0x193db
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x68d6
movq %r15, %rdi
movl $0x53, %esi
callq 0x5170
testq %rax, %rax
je 0x1925d
leaq 0x48(%rsp), %r12
movq -0x18(%r12), %rsi
movq %rbx, %rdi
callq 0x645b
leaq 0x9b98(%rip), %rdx      # 0x22d66
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x6b3f
movq %rbx, %rdi
movq %r12, %rsi
callq 0x645b
leaq 0x9b80(%rip), %rdx      # 0x22d6d
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x6b3f
movslq -0xc(%r12), %rsi
movq %rbx, %rdi
callq 0x63e6
leaq 0x9b6d(%rip), %rdx      # 0x22d7b
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x6b3f
movslq -0x8(%r12), %rsi
movq %rbx, %rdi
callq 0x63e6
leaq 0x9b48(%rip), %rdx      # 0x22d77
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x6b3f
movq -0x20(%r12), %rsi
movq %rbx, %rdi
callq 0x645b
leaq 0x9b5d(%rip), %rdx      # 0x22dad
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x6b3f
movq %r15, %rdi
movl $0x6c, %esi
callq 0x5170
testq %rax, %rax
je 0x19290
movslq 0x38(%rsp), %rsi
movq %rbx, %rdi
callq 0x63e6
leaq 0x9b04(%rip), %rdx      # 0x22d87
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x6b3f
movq %r15, %rdi
movl $0x75, %esi
callq 0x5170
testq %rax, %rax
je 0x19305
movzbl 0x44(%rsp), %esi
movq %rbx, %rdi
callq 0x63e6
leaq 0x9add(%rip), %rdx      # 0x22d93
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x6b3f
movzbl 0x45(%rsp), %esi
movq %rbx, %rdi
callq 0x63e6
leaq 0x9ac1(%rip), %rdx      # 0x22d98
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x6b3f
movsbl 0x46(%rsp), %esi
movq %rbx, %rdi
callq 0x660e
leaq 0x9aa8(%rip), %rdx      # 0x22da0
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x6b3f
movq %r15, %rdi
movl $0x6e, %esi
callq 0x5170
testq %rax, %rax
je 0x19359
movq 0x18(%rsp), %rsi
movq %rbx, %rdi
callq 0x645b
leaq 0x8a44(%rip), %rdx      # 0x21d6f
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x6b3f
movq 0x20(%rsp), %rsi
movq %rbx, %rdi
callq 0x645b
leaq 0x9a5d(%rip), %rdx      # 0x22da9
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x6b3f
movq %r15, %rdi
movl $0x74, %esi
callq 0x5170
testq %rax, %rax
je 0x1938c
movsbl 0x47(%rsp), %esi
movq %rbx, %rdi
callq 0x660e
leaq 0x9a33(%rip), %rdx      # 0x22db2
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x6b3f
movq %r15, %rdi
movl $0x4c, %esi
callq 0x5170
testq %rax, %rax
je 0x193b0
leaq 0x9a18(%rip), %rdx      # 0x22dbd
movq %rbx, %rdi
movq %r14, %rsi
callq 0x19b25
movq %r15, %rdi
movl $0x66, %esi
callq 0x5170
movl $0x1, %ebp
testq %rax, %rax
je 0x193fd
leaq 0x99fb(%rip), %rdx      # 0x22dc9
movq %rbx, %rdi
movq %r14, %rsi
callq 0x19b25
jmp 0x193fd
leaq 0x9975(%rip), %rdx      # 0x22d57
movq %rbx, %rdi
movl %ebp, %esi
callq 0x13ea8
movl %eax, %ebp
jmp 0x193fd
movq %rbx, %rdi
callq 0x63bd
movl $0x1, %ebp
movl %ebp, %eax
addq $0x90, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq