// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2088, %rsp           # imm = 0x2088
movq %rdi, %rbx
leaq 0x14172(%rip), %rdx     # 0x311d6
leaq 0x28(%rsp), %rcx
movl $0x1, %esi
callq 0xc3de
movq %rax, %r14
movq 0x20(%rbx), %rax
movq (%rax), %rax
leaq 0x20(%rax), %rcx
movq %rbx, 0x8(%rsp)
cmpq 0x10(%rbx), %rcx
setae %dl
leaq 0x128cc(%rip), %rsi     # 0x2f960
cmpq %rsi, %rcx
sete %cl
orb %dl, %cl
jne 0x1d0b5
testb $0xf, 0x28(%rax)
je 0x1d0b5
movq 0x8(%rsp), %rdi
movl $0x2, %esi
callq 0xc56e
jmp 0x1d0bc
xorl %edi, %edi
callq 0x6470
movq %rax, 0x10(%rsp)
movq 0x28(%rsp), %r13
addq %r14, %r13
cmpb $0x21, (%r14)
jne 0x1d0e6
leaq 0x10(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x68b0
movq %rax, %r15
incq %r14
jmp 0x1d0f8
leaq 0x10(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x62d0
movq %rax, %r15
testq %r15, %r15
je 0x1d2ac
leaq 0x14108(%rip), %rsi     # 0x31210
movq %r14, %rdi
callq 0x6680
testl %eax, %eax
je 0x1d24d
movb $0x25, 0x4(%rsp)
leaq 0x88(%rsp), %rax
movq 0x8(%rsp), %rcx
movq %rcx, -0x8(%rax)
movq %rax, -0x20(%rax)
movq $0x0, -0x10(%rax)
movq $0x2000, -0x18(%rax)    # imm = 0x2000
cmpq %r13, %r14
jae 0x1d241
movq %r13, 0x20(%rsp)
movq %r15, 0x18(%rsp)
cmpb $0x25, (%r14)
jne 0x1d1c6
movl $0xfa, %esi
leaq 0x68(%rsp), %rdi
callq 0xc605
incq %r14
subq %r14, %r13
testq %r13, %r13
jle 0x1d283
movq %rax, %r12
movl $0x1, %r15d
movb $0x61, %al
movl $0x1, %ebp
leaq 0x140a7(%rip), %rbx     # 0x31237
cmpb $0x7c, %al
jne 0x1d199
incl %r15d
jmp 0x1d1ab
movq %r14, %rdi
movq %rbx, %rsi
movq %rbp, %rdx
callq 0x64e0
testl %eax, %eax
je 0x1d1ff
movslq %r15d, %rbp
movb (%rbx,%rbp), %al
testb %al, %al
je 0x1d283
addq %rbp, %rbx
cmpq %rbp, %r13
jge 0x1d190
jmp 0x1d283
movq 0x78(%rsp), %rax
cmpq 0x70(%rsp), %rax
jb 0x1d1e1
movl $0x1, %esi
leaq 0x68(%rsp), %rdi
callq 0xc605
movb (%r14), %al
incq %r14
movq 0x68(%rsp), %rcx
movq 0x78(%rsp), %rdx
leaq 0x1(%rdx), %rsi
movq %rsi, 0x78(%rsp)
movb %al, (%rcx,%rdx)
jmp 0x1d238
leaq 0x5(%rsp), %rdi
movq %r14, %rsi
movq %rbp, %rdx
callq 0x6400
movb $0x0, 0x5(%rsp,%rbp)
addq %rbp, %r14
movl $0xfa, %esi
movq %r12, %rdi
leaq 0x4(%rsp), %rdx
movq 0x18(%rsp), %rcx
callq 0x63f0
addq %rax, 0x78(%rsp)
movq 0x20(%rsp), %r13
cmpq %r13, %r14
jb 0x1d155
leaq 0x68(%rsp), %rdi
callq 0xc830
jmp 0x1d26c
movq 0x8(%rsp), %rbx
movq %rbx, %rdi
xorl %esi, %esi
movl $0x9, %edx
callq 0x946f
movq %rbx, %rdi
movq %r15, %rsi
callq 0x1d734
movl $0x1, %eax
addq $0x2088, %rsp           # imm = 0x2088
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x13ffb(%rip), %rsi     # 0x31285
movq 0x8(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x8dcc
movq %rbx, %rdi
movl $0x1, %esi
movq %rax, %rdx
callq 0xbccb
leaq 0x13f26(%rip), %rsi     # 0x311d9
movq 0x8(%rsp), %rdi
xorl %eax, %eax
callq 0xbda0