// File: /workspace/github_c_makefile_star2_O0/tylerneylon[P]APIsWithLua/lua/lstrlib.c
// Function: addliteral
static void addliteral (lua_State *L, luaL_Buffer *b, int arg) {
  switch (lua_type(L, arg)) {
    case LUA_TSTRING: {
      size_t len;
      const char *s = lua_tolstring(L, arg, &len);
      addquoted(b, s, len);
      break;
    }
    case LUA_TNUMBER: {
      char *buff = luaL_prepbuffsize(b, MAX_ITEM);
      int nb;
      if (!lua_isinteger(L, arg)) {  /* float? */
        lua_Number n = lua_tonumber(L, arg);  /* write as hexa ('%a') */
        nb = lua_number2strx(L, buff, MAX_ITEM, "%" LUA_NUMBER_FRMLEN "a", n);
        checkdp(buff, nb);  /* ensure it uses a dot */
      }
      else {  /* integers */
        lua_Integer n = lua_tointeger(L, arg);
        const char *format = (n == LUA_MININTEGER)  /* corner case? */
                           ? "0x%" LUA_INTEGER_FRMLEN "x"  /* use hexa */
                           : LUA_INTEGER_FMT;  /* else use default format */
        nb = l_sprintf(buff, MAX_ITEM, format, n);
      }
      luaL_addsize(b, nb);
      break;
    }
    case LUA_TNIL: case LUA_TBOOLEAN: {
      luaL_tolstring(L, arg, NULL);
      luaL_addvalue(b);
      break;
    }
    default: {
      luaL_argerror(L, arg, "value has no literal form");
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x61f0
movl %eax, %ecx
movl %ecx, -0x54(%rbp)
subl $0x2, %eax
jb 0x2f64e
jmp 0x2f53f
movl -0x54(%rbp), %eax
subl $0x3, %eax
je 0x2f581
jmp 0x2f549
movl -0x54(%rbp), %eax
subl $0x4, %eax
jne 0x2f669
jmp 0x2f557
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %esi
leaq -0x20(%rbp), %rdx
callq 0x67d0
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x2f690
jmp 0x2f67c
movq -0x10(%rbp), %rdi
movl $0x1ac, %esi            # imm = 0x1AC
callq 0x20630
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x62c0
cmpl $0x0, %eax
jne 0x2f5e6
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x6650
movsd %xmm0, -0x40(%rbp)
movq -0x30(%rbp), %rdi
movsd -0x40(%rbp), %xmm0
movl $0x1ac, %esi            # imm = 0x1AC
leaq 0x7a54(%rip), %rdx      # 0x37022
movb $0x1, %al
callq 0x5190
movl %eax, -0x34(%rbp)
movq -0x30(%rbp), %rdi
movl -0x34(%rbp), %esi
callq 0x2f930
jmp 0x2f63c
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x66e0
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rdx
movabsq $-0x8000000000000000, %rsi # imm = 0x8000000000000000
leaq 0x55c1(%rip), %rax      # 0x34bd0
leaq 0x7a0f(%rip), %rcx      # 0x37025
cmpq %rsi, %rdx
cmoveq %rcx, %rax
movq %rax, -0x50(%rbp)
movq -0x30(%rbp), %rdi
movq -0x50(%rbp), %rdx
movq -0x48(%rbp), %rcx
movl $0x1ac, %esi            # imm = 0x1AC
movb $0x0, %al
callq 0x5190
movl %eax, -0x34(%rbp)
movslq -0x34(%rbp), %rcx
movq -0x10(%rbp), %rax
addq 0x10(%rax), %rcx
movq %rcx, 0x10(%rax)
jmp 0x2f67c
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x21320
movq -0x10(%rbp), %rdi
callq 0x209f0
jmp 0x2f67c
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %esi
leaq 0x79b5(%rip), %rdx      # 0x3702c
callq 0x1fab0
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)