// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/external/lua-5.1.5/src/ldblib.c
// Function: db_errorfb
static int db_errorfb (lua_State *L) {
  int level;
  int firstpart = 1;  /* still before eventual `...' */
  int arg;
  lua_State *L1 = getthread(L, &arg);
  lua_Debug ar;
  if (lua_isnumber(L, arg+2)) {
    level = (int)lua_tointeger(L, arg+2);
    lua_pop(L, 1);
  }
  else
    level = (L == L1) ? 1 : 0;  /* level 0 may be this own function */
  if (lua_gettop(L) == arg)
    lua_pushliteral(L, "");
  else if (!lua_isstring(L, arg+1)) return 1;  /* message is not a string */
  else lua_pushliteral(L, "\n");
  lua_pushliteral(L, "stack traceback:");
  while (lua_getstack(L1, level++, &ar)) {
    if (level > LEVELS1 && firstpart) {
      /* no more than `LEVELS2' more levels? */
      if (!lua_getstack(L1, level+LEVELS2, &ar))
        level--;  /* keep going */
      else {
        lua_pushliteral(L, "\n\t...");  /* too many levels */
        while (lua_getstack(L1, level+LEVELS2, &ar))  /* find last levels */
          level++;
      }
      firstpart = 0;
      continue;
    }
    lua_pushliteral(L, "\n\t");
    lua_getinfo(L1, "Snl", &ar);
    lua_pushfstring(L, "%s:", ar.short_src);
    if (ar.currentline > 0)
      lua_pushfstring(L, "%d:", ar.currentline);
    if (*ar.namewhat != '\0')  /* is there a name? */
        lua_pushfstring(L, " in function " LUA_QS, ar.name);
    else {
      if (*ar.what == 'm')  /* main? */
        lua_pushfstring(L, " in main chunk");
      else if (*ar.what == 'C' || *ar.what == 't')
        lua_pushliteral(L, " ?");  /* C function or tail call */
      else
        lua_pushfstring(L, " in function <%s:%d>",
                           ar.short_src, ar.linedefined);
    }
    lua_concat(L, lua_gettop(L) - arg);
  }
  lua_concat(L, lua_gettop(L) - arg);
  return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rdi, %rbx
movq 0x18(%rdi), %rax
xorl %r12d, %r12d
cmpq 0xe7f38(%rip), %rax     # 0x150fd0
je 0x690b4
cmpq 0x10(%rbx), %rax
jae 0x690b4
cmpl $0x8, 0x8(%rax)
movq %rbx, %r14
jne 0x690b7
movq (%rax), %r14
movl $0x1, %r12d
jmp 0x690b7
movq %rbx, %r14
leal 0x2(%r12), %ebp
movq %rbx, %rdi
movl %ebp, %esi
callq 0x57cb2
testl %eax, %eax
je 0x690de
movq %rbx, %rdi
movl %ebp, %esi
callq 0x57fed
movq %rax, %r15
addq $-0x10, 0x10(%rbx)
jmp 0x690e8
xorl %r15d, %r15d
cmpq %rbx, %r14
sete %r15b
movq 0x10(%rbx), %rax
subq 0x18(%rbx), %rax
shrq $0x4, %rax
cmpl %eax, %r12d
jne 0x69107
leaq 0x85a7f(%rip), %rsi     # 0xeeb7f
movq %rbx, %rdi
xorl %edx, %edx
jmp 0x6913f
leal 0x1(%r12), %esi
movq %rbx, %rdi
callq 0x57945
cmpq 0xe7eb5(%rip), %rax     # 0x150fd0
je 0x692f8
movl 0x8(%rax), %eax
addl $-0x5, %eax
cmpl $-0x2, %eax
jb 0x692f8
leaq 0x8e772(%rip), %rsi     # 0xf78a9
movl $0x1, %edx
movq %rbx, %rdi
callq 0x58391
leaq 0x8576a(%rip), %rsi     # 0xee8b5
movl $0x10, %edx
movq %rbx, %rdi
callq 0x58391
movq %rsp, %rdx
movq %r14, %rdi
movl %r15d, %esi
callq 0x5a0bf
testl %eax, %eax
je 0x692e1
movb $0x1, %bpl
movq %rsp, %r13
notb %bpl
cmpl $0xc, %r15d
setl %al
orb %bpl, %al
testb $0x1, %al
je 0x6928c
movl $0x2, %edx
movq %rbx, %rdi
leaq 0x85734(%rip), %rsi     # 0xee8cc
callq 0x58391
movq %r14, %rdi
leaq 0x85728(%rip), %rsi     # 0xee8cf
movq %r13, %rdx
callq 0x5a270
movq %rbx, %rdi
leaq 0x8571a(%rip), %rsi     # 0xee8d3
leaq 0x38(%rsp), %rdx
xorl %eax, %eax
callq 0x58880
movl 0x28(%rsp), %edx
testl %edx, %edx
jle 0x691de
movq %rbx, %rdi
leaq 0x85700(%rip), %rsi     # 0xee8d7
xorl %eax, %eax
callq 0x58880
movq 0x10(%rsp), %rax
cmpb $0x0, (%rax)
je 0x69200
movq 0x8(%rsp), %rdx
movq %rbx, %rdi
leaq 0x856e4(%rip), %rsi     # 0xee8db
xorl %eax, %eax
callq 0x58880
jmp 0x6925a
movq 0x18(%rsp), %rax
movzbl (%rax), %eax
cmpl $0x43, %eax
je 0x6922a
cmpl $0x74, %eax
je 0x6922a
cmpl $0x6d, %eax
jne 0x69240
movq %rbx, %rdi
leaq 0x856cc(%rip), %rsi     # 0xee8ed
xorl %eax, %eax
callq 0x58880
jmp 0x6925a
movl $0x2, %edx
movq %rbx, %rdi
leaq 0x856c3(%rip), %rsi     # 0xee8fc
callq 0x58391
jmp 0x6925a
movl 0x30(%rsp), %ecx
movq %rbx, %rdi
leaq 0x856b1(%rip), %rsi     # 0xee8ff
leaq 0x38(%rsp), %rdx
xorl %eax, %eax
callq 0x58880
incl %r15d
movq 0x10(%rbx), %rsi
subq 0x18(%rbx), %rsi
shrq $0x4, %rsi
subl %r12d, %esi
movq %rbx, %rdi
callq 0x59be2
movq %r14, %rdi
movl %r15d, %esi
movq %r13, %rdx
callq 0x5a0bf
testl %eax, %eax
jne 0x69177
jmp 0x692e1
leal 0xb(%r15), %esi
movq %r14, %rdi
movq %r13, %rdx
callq 0x5a0bf
testl %eax, %eax
je 0x692c9
movl $0x5, %edx
movq %rbx, %rdi
leaq 0x85618(%rip), %rsi     # 0xee8c6
callq 0x58391
leal 0xb(%r15), %esi
movq %r14, %rdi
movq %r13, %rdx
callq 0x5a0bf
incl %r15d
testl %eax, %eax
jne 0x692b3
movq %r14, %rdi
movl %r15d, %esi
movq %r13, %rdx
callq 0x5a0bf
xorl %ebp, %ebp
testl %eax, %eax
jne 0x69174
movq 0x10(%rbx), %rsi
subq 0x18(%rbx), %rsi
shrq $0x4, %rsi
subl %r12d, %esi
movq %rbx, %rdi
callq 0x59be2
movl $0x1, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq