// File: /workspace/github_c_makefile_star2_O3/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 0x131ec(%rip), %rdx     # 0x3426a
leaq 0x28(%rsp), %rcx
movl $0x1, %esi
callq 0xe2d2
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 0x11992(%rip), %rsi     # 0x32a40
cmpq %rsi, %rcx
sete %cl
orb %dl, %cl
jne 0x210cf
testb $0xf, 0x28(%rax)
je 0x210cf
movq 0x8(%rsp), %rdi
movl $0x2, %esi
callq 0xe462
jmp 0x210d6
xorl %edi, %edi
callq 0x6460
movq %rax, 0x10(%rsp)
movq 0x28(%rsp), %r13
addq %r14, %r13
cmpb $0x21, (%r14)
jne 0x21100
leaq 0x10(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x68a0
movq %rax, %r15
incq %r14
jmp 0x21112
leaq 0x10(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x62c0
movq %rax, %r15
testq %r15, %r15
je 0x212cc
cmpb $0x2a, (%r14)
jne 0x21133
cmpb $0x74, 0x1(%r14)
jne 0x21133
cmpb $0x0, 0x2(%r14)
je 0x21282
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 0x21261
movq %r13, 0x20(%rsp)
movq %r15, 0x18(%rsp)
movb (%r14), %al
cmpb $0x25, %al
jne 0x211e5
movl $0xfa, %esi
leaq 0x68(%rsp), %rdi
callq 0xe4f9
incq %r14
subq %r14, %r13
testq %r13, %r13
jle 0x212a3
movq %rax, %rbx
movl $0x1, %r15d
movb $0x61, %al
movl $0x1, %r12d
leaq 0x1311b(%rip), %rbp     # 0x342c8
cmpb $0x7c, %al
jne 0x211b6
incl %r15d
jmp 0x211c8
movq %r14, %rdi
movq %rbp, %rsi
movq %r12, %rdx
callq 0x64d0
testl %eax, %eax
je 0x2121e
movslq %r15d, %r12
movb (%rbp,%r12), %al
testb %al, %al
je 0x212a3
addq %r12, %rbp
cmpq %r12, %r13
jge 0x211ad
jmp 0x212a3
movq 0x78(%rsp), %rcx
cmpq 0x70(%rsp), %rcx
jb 0x21208
movl $0x1, %esi
leaq 0x68(%rsp), %rdi
callq 0xe4f9
movb (%r14), %al
movq 0x78(%rsp), %rcx
incq %r14
movq 0x68(%rsp), %rdx
leaq 0x1(%rcx), %rsi
movq %rsi, 0x78(%rsp)
movb %al, (%rdx,%rcx)
jmp 0x21258
leaq 0x5(%rsp), %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x63f0
movb $0x0, 0x5(%rsp,%r12)
addq %r12, %r14
movl $0xfa, %esi
movq %rbx, %rdi
leaq 0x4(%rsp), %rdx
movq 0x18(%rsp), %rcx
callq 0x63e0
addq %rax, 0x78(%rsp)
movq 0x20(%rsp), %r13
cmpq %r13, %r14
jb 0x21170
leaq 0x68(%rsp), %rdi
callq 0xe72f
movl $0x1, %eax
addq $0x2088, %rsp           # imm = 0x2088
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x8(%rsp), %rbx
movq %rbx, %rdi
xorl %esi, %esi
movl $0x9, %edx
callq 0xb205
movq %rbx, %rdi
movq %r15, %rsi
callq 0x2184a
jmp 0x2126b
leaq 0x1306c(%rip), %rsi     # 0x34316
movq 0x8(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0xab73
movq %rbx, %rdi
movl $0x1, %esi
movq %rax, %rdx
callq 0xdabf
leaq 0x12f9a(%rip), %rsi     # 0x3426d
movq 0x8(%rsp), %rdi
xorl %eax, %eax
callq 0xdb8f