// File: /workspace/github_c_makefile_star2_O0/bhk[P]tooltree/lua/../opensource/lua-5.2.3/src/loslib.c
// Function: os_date
static int os_date (lua_State *L) {
  const char *s = luaL_optstring(L, 1, "%c");
  time_t t = luaL_opt(L, (time_t)luaL_checknumber, 2, time(NULL));
  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? */
    lua_pushnil(L);
  else if (strcmp(s, "*t") == 0) {
    lua_createtable(L, 0, 9);  /* 9 = number of fields */
    setfield(L, "sec", stm->tm_sec);
    setfield(L, "min", stm->tm_min);
    setfield(L, "hour", stm->tm_hour);
    setfield(L, "day", stm->tm_mday);
    setfield(L, "month", stm->tm_mon+1);
    setfield(L, "year", stm->tm_year+1900);
    setfield(L, "wday", stm->tm_wday+1);
    setfield(L, "yday", stm->tm_yday+1);
    setboolfield(L, "isdst", stm->tm_isdst);
  }
  else {
    char cc[4];
    luaL_Buffer b;
    cc[0] = '%';
    luaL_buffinit(L, &b);
    while (*s) {
      if (*s != '%')  /* no conversion specifier? */
        luaL_addchar(&b, *s++);
      else {
        size_t reslen;
        char buff[200];  /* should be big enough for any conversion result */
        s = checkoption(L, s + 1, cc);
        reslen = strftime(buff, sizeof(buff), cc, stm);
        luaL_addlstring(&b, buff, reslen);
      }
    }
    luaL_pushresult(&b);
  }
  return 1;
}

// Assembly:
subq $0x2168, %rsp           # imm = 0x2168
movq %rdi, 0x2160(%rsp)
movq 0x2160(%rsp), %rdi
movl $0x1, %esi
leaq 0x1bee0(%rip), %rdx     # 0x36553
xorl %eax, %eax
movl %eax, %ecx
callq 0xcc70
movq %rax, 0x2158(%rsp)
movq 0x2160(%rsp), %rdi
movl $0x2, %esi
callq 0x9350
cmpl $0x0, %eax
jg 0x1a6ab
xorl %eax, %eax
movl %eax, %edi
callq 0x7380
movq %rax, 0x8(%rsp)
jmp 0x1a6c7
movq 0x2160(%rsp), %rdi
movl $0x2, %esi
callq 0xce90
cvttsd2si %xmm0, %rax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rax
movq %rax, 0x2150(%rsp)
movq 0x2158(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x21, %eax
jne 0x1a717
leaq 0x2150(%rsp), %rdi
leaq 0x2118(%rsp), %rsi
callq 0x71d0
movq %rax, 0x2110(%rsp)
movq 0x2158(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x2158(%rsp)
jmp 0x1a734
leaq 0x2150(%rsp), %rdi
leaq 0x2118(%rsp), %rsi
callq 0x70a0
movq %rax, 0x2110(%rsp)
cmpq $0x0, 0x2110(%rsp)
jne 0x1a751
movq 0x2160(%rsp), %rdi
callq 0x9df0
jmp 0x1a9de
movq 0x2158(%rsp), %rdi
leaq 0x1bdf6(%rip), %rsi     # 0x36556
callq 0x72d0
cmpl $0x0, %eax
jne 0x1a8ac
movq 0x2160(%rsp), %rdi
xorl %esi, %esi
movl $0x9, %edx
callq 0xa780
movq 0x2160(%rsp), %rdi
movq 0x2110(%rsp), %rax
movl (%rax), %edx
leaq 0x1bdbe(%rip), %rsi     # 0x36559
callq 0x1aed0
movq 0x2160(%rsp), %rdi
movq 0x2110(%rsp), %rax
movl 0x4(%rax), %edx
leaq 0x1b7d4(%rip), %rsi     # 0x35f8e
callq 0x1aed0
movq 0x2160(%rsp), %rdi
movq 0x2110(%rsp), %rax
movl 0x8(%rax), %edx
leaq 0x1bd84(%rip), %rsi     # 0x3655d
callq 0x1aed0
movq 0x2160(%rsp), %rdi
movq 0x2110(%rsp), %rax
movl 0xc(%rax), %edx
leaq 0x1bd76(%rip), %rsi     # 0x3656e
callq 0x1aed0
movq 0x2160(%rsp), %rdi
movq 0x2110(%rsp), %rax
movl 0x10(%rax), %edx
addl $0x1, %edx
leaq 0x1bd48(%rip), %rsi     # 0x36562
callq 0x1aed0
movq 0x2160(%rsp), %rdi
movq 0x2110(%rsp), %rax
movl 0x14(%rax), %edx
addl $0x76c, %edx            # imm = 0x76C
leaq 0x1bd29(%rip), %rsi     # 0x36568
callq 0x1aed0
movq 0x2160(%rsp), %rdi
movq 0x2110(%rsp), %rax
movl 0x18(%rax), %edx
addl $0x1, %edx
leaq 0x1bd0c(%rip), %rsi     # 0x3656d
callq 0x1aed0
movq 0x2160(%rsp), %rdi
movq 0x2110(%rsp), %rax
movl 0x1c(%rax), %edx
addl $0x1, %edx
leaq 0x1bcef(%rip), %rsi     # 0x36572
callq 0x1aed0
movq 0x2160(%rsp), %rdi
movq 0x2110(%rsp), %rax
movl 0x20(%rax), %edx
leaq 0x1bcd5(%rip), %rsi     # 0x36577
callq 0x1af10
jmp 0x1a9dc
movb $0x25, 0x210c(%rsp)
movq 0x2160(%rsp), %rdi
leaq 0xe8(%rsp), %rsi
callq 0xd390
movq 0x2158(%rsp), %rax
cmpb $0x0, (%rax)
je 0x1a9cf
movq 0x2158(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x25, %eax
je 0x1a960
movq 0xf8(%rsp), %rcx
movb $0x1, %al
cmpq 0xf0(%rsp), %rcx
movb %al, 0x7(%rsp)
jb 0x1a91f
leaq 0xe8(%rsp), %rdi
movl $0x1, %esi
callq 0xd080
cmpq $0x0, %rax
setne %al
movb %al, 0x7(%rsp)
movb 0x7(%rsp), %al
movq 0x2158(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x2158(%rsp)
movb (%rax), %dl
movq 0xe8(%rsp), %rax
movq 0xf8(%rsp), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, 0xf8(%rsp)
movb %dl, (%rax,%rcx)
jmp 0x1a9ca
movq 0x2160(%rsp), %rdi
movq 0x2158(%rsp), %rsi
addq $0x1, %rsi
leaq 0x210c(%rsp), %rdx
callq 0x1af60
movq %rax, 0x2158(%rsp)
leaq 0x10(%rsp), %rdi
leaq 0x210c(%rsp), %rdx
movq 0x2110(%rsp), %rcx
movl $0xc8, %esi
callq 0x7480
movq %rax, 0xe0(%rsp)
leaq 0x10(%rsp), %rsi
movq 0xe0(%rsp), %rdx
leaq 0xe8(%rsp), %rdi
callq 0xd1b0
jmp 0x1a8c9
leaq 0xe8(%rsp), %rdi
callq 0xd260
jmp 0x1a9de
movl $0x1, %eax
addq $0x2168, %rsp           # imm = 0x2168
retq
nopl (%rax,%rax)