// File: /workspace/github_c_makefile_star2_O0/kieselsteini[P]PiXL-old/lua53.c
// Function: os_date
static int os_date (lua_State *L) {
  size_t slen;
  const char *s = luaL_optlstring(L, 1, "%c", &slen);
  time_t t = luaL_opt(L, l_checktime, 2, time(NULL));
  const char *se = s + slen;  /* 's' end */
  struct tm tmr, *stm;
  if (*s == '!') {  /* UTC? */
    stm = l_gmtime(&t, &tmr);
    s++;  /* skip '!' */
  }
  else
    stm = l_localtime(&t, &tmr);
  if (stm == NULL)  /* invalid date? */
    luaL_error(L, "time result cannot be represented in this installation");
  if (strcmp(s, "*t") == 0) {
    lua_createtable(L, 0, 9);  /* 9 = number of fields */
    setallfields(L, stm);
  }
  else {
    char cc[4];  /* buffer for individual conversion specifiers */
    luaL_Buffer b;
    cc[0] = '%';
    luaL_buffinit(L, &b);
    while (s < se) {
      if (*s != '%')  /* not a conversion specifier? */
        luaL_addchar(&b, *s++);
      else {
        size_t reslen;
        char *buff = luaL_prepbuffsize(&b, SIZETIMEFMT);
        s++;  /* skip '%' */
        s = checkoption(L, s, se - s, cc + 1);  /* copy specifier to 'cc' */
        reslen = strftime(buff, SIZETIMEFMT, cc, stm);
        luaL_addsize(&b, reslen);
      }
    }
    luaL_pushresult(&b);
  }
  return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20b0, %rsp           # imm = 0x20B0
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movl $0x1, %esi
leaq 0x2b1d2(%rip), %rdx     # 0x56b91
leaq -0x10(%rbp), %rcx
callq 0xefe0
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movl $0x2, %esi
callq 0x7400
cmpl $0x0, %eax
jg 0x2b9f1
xorl %eax, %eax
movl %eax, %edi
callq 0x6480
movq %rax, -0x20a8(%rbp)
jmp 0x2ba06
movq -0x8(%rbp), %rdi
movl $0x2, %esi
callq 0x2c0d0
movq %rax, -0x20a8(%rbp)
movq -0x20a8(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
addq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x21, %eax
jne 0x2ba48
leaq -0x20(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x68c0
movq %rax, -0x68(%rbp)
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x2ba59
leaq -0x20(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x62d0
movq %rax, -0x68(%rbp)
cmpq $0x0, -0x68(%rbp)
jne 0x2ba72
movq -0x8(%rbp), %rdi
leaq 0x2b129(%rip), %rsi     # 0x56b94
movb $0x0, %al
callq 0xe880
movq -0x18(%rbp), %rdi
leaq 0x2b14e(%rip), %rsi     # 0x56bcb
callq 0x6670
cmpl $0x0, %eax
jne 0x2baa9
movq -0x8(%rbp), %rdi
xorl %esi, %esi
movl $0x9, %edx
callq 0xa7f0
movq -0x8(%rbp), %rdi
movq -0x68(%rbp), %rsi
callq 0x2c130
jmp 0x2bbd3
movb $0x25, -0x6c(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x2090(%rbp), %rsi
callq 0xf770
movq -0x18(%rbp), %rax
cmpq -0x28(%rbp), %rax
jae 0x2bbc7
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x25, %eax
je 0x2bb45
movq -0x2080(%rbp), %rcx
movb $0x1, %al
cmpq -0x2088(%rbp), %rcx
movb %al, -0x20a9(%rbp)
jb 0x2bb0d
leaq -0x2090(%rbp), %rdi
movl $0x1, %esi
callq 0xf300
cmpq $0x0, %rax
setne %al
movb %al, -0x20a9(%rbp)
movb -0x20a9(%rbp), %al
movq -0x18(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x18(%rbp)
movb (%rax), %dl
movq -0x2090(%rbp), %rax
movq -0x2080(%rbp), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, -0x2080(%rbp)
movb %dl, (%rax,%rcx)
jmp 0x2bbc2
leaq -0x2090(%rbp), %rdi
movl $0xfa, %esi
callq 0xf300
movq %rax, -0x20a0(%rbp)
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x28(%rbp), %rdx
movq -0x18(%rbp), %rax
subq %rax, %rdx
leaq -0x6c(%rbp), %rcx
addq $0x1, %rcx
callq 0x2c230
movq %rax, -0x18(%rbp)
movq -0x20a0(%rbp), %rdi
leaq -0x6c(%rbp), %rdx
movq -0x68(%rbp), %rcx
movl $0xfa, %esi
callq 0x6400
movq %rax, -0x2098(%rbp)
movq -0x2098(%rbp), %rax
addq -0x2080(%rbp), %rax
movq %rax, -0x2080(%rbp)
jmp 0x2babd
leaq -0x2090(%rbp), %rdi
callq 0xf610
movl $0x1, %eax
addq $0x20b0, %rsp           # imm = 0x20B0
popq %rbp
retq
nopw %cs:(%rax,%rax)