// File: /workspace/github_c_makefile_star2_O3/kieselsteini[P]PiXL-old/lua53.c
// Function: luaL_tolstring
LUALIB_API const char *luaL_tolstring (lua_State *L, int idx, size_t *len) {
  if (luaL_callmeta(L, idx, "__tostring")) {  /* metafield? */
    if (!lua_isstring(L, -1))
      luaL_error(L, "'__tostring' must return a string");
  }
  else {
    switch (lua_type(L, idx)) {
      case LUA_TNUMBER: {
        if (lua_isinteger(L, idx))
          lua_pushfstring(L, "%I", (LUAI_UACINT)lua_tointeger(L, idx));
        else
          lua_pushfstring(L, "%f", (LUAI_UACNUMBER)lua_tonumber(L, idx));
        break;
      }
      case LUA_TSTRING:
        lua_pushvalue(L, idx);
        break;
      case LUA_TBOOLEAN:
        lua_pushstring(L, (lua_toboolean(L, idx) ? "true" : "false"));
        break;
      case LUA_TNIL:
        lua_pushliteral(L, "nil");
        break;
      default: {
        int tt = luaL_getmetafield(L, idx, "__name");  /* try name */
        const char *kind = (tt == LUA_TSTRING) ? lua_tostring(L, -1) :
                                                 luaL_typename(L, idx);
        lua_pushfstring(L, "%s: %p", kind, lua_topointer(L, idx));
        if (tt != LUA_TNIL)
          lua_remove(L, -2);  /* remove '__name' */
        break;
      }
    }
  }
  return lua_tolstring(L, -1, len);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %r14
movl %esi, %ebp
movq %rdi, %rbx
leaq 0x23f0d(%rip), %rdx     # 0x32f6a
callq 0xef5a
testl %eax, %eax
je 0xf094
movq 0x10(%rbx), %rax
movl -0x8(%rax), %eax
andl $0xf, %eax
addl $-0x5, %eax
cmpl $-0x3, %eax
jbe 0xf202
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movq %r14, %rdx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x9ffc
movq %rbx, %rdi
movl %ebp, %esi
callq 0x916a
leaq 0x2399b(%rip), %r12     # 0x32a40
cmpq %r12, %rax
je 0xf0d3
movl 0x8(%rax), %ecx
movl %ecx, %edx
andl $0xf, %edx
cmpl $0x4, %edx
ja 0xf0d3
leaq 0x2318a(%rip), %rsi     # 0x32248
movslq (%rsi,%rdx,4), %rdx
addq %rsi, %rdx
jmpq *%rdx
leaq 0x24450(%rip), %rsi     # 0x3351e
jmp 0xf168
leaq 0x23e07(%rip), %rdx     # 0x32ee1
movq %rbx, %rdi
movl %ebp, %esi
callq 0xeee6
movl %eax, %r15d
movq %rbx, %rdi
cmpl $0x4, %eax
jne 0xf103
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %edx, %edx
callq 0x9ffc
movq %rax, %r12
jmp 0xf1a1
movl %ebp, %esi
callq 0x916a
cmpq %r12, %rax
je 0xf194
movl 0x8(%rax), %eax
andl $0xf, %eax
incq %rax
jmp 0xf196
movq %rbx, %rdi
movl %ebp, %esi
xorl %edx, %edx
cmpl $0x13, %ecx
jne 0xf1e7
callq 0x9e85
leaq 0x23e5d(%rip), %rsi     # 0x32f97
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xab73
jmp 0xf07c
testl %ecx, %ecx
je 0xf161
leaq 0x23e43(%rip), %rsi     # 0x32f9a
cmpl $0x1, %ecx
jne 0xf168
cmpl $0x0, (%rax)
jne 0xf168
leaq 0x23e37(%rip), %rsi     # 0x32f9f
movq %rbx, %rdi
callq 0xa67f
jmp 0xf07c
movq 0x10(%rbx), %r15
movq %rbx, %rdi
movl %ebp, %esi
callq 0x916a
movups (%rax), %xmm0
movups %xmm0, (%r15)
addq $0x10, 0x10(%rbx)
jmp 0xf07c
xorl %eax, %eax
leaq 0x31bd3(%rip), %rcx     # 0x40d70
movq (%rcx,%rax,8), %r12
movq %rbx, %rdi
movl %ebp, %esi
callq 0xa452
leaq 0x23df3(%rip), %rsi     # 0x32fa5
movq %rbx, %rdi
movq %r12, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0xab73
testl %r15d, %r15d
je 0xf07c
movq %rbx, %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x90c6
addq $-0x10, 0x10(%rbx)
jmp 0xf07c
callq 0x9e2d
leaq 0x23e51(%rip), %rsi     # 0x33044
movq %rbx, %rdi
movb $0x1, %al
callq 0xab73
jmp 0xf07c
leaq 0x23d6c(%rip), %rsi     # 0x32f75
movq %rbx, %rdi
xorl %eax, %eax
callq 0xdb8f