// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/deps/lua/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 *stm;
  if (*s == '!') {  /* UTC? */
    stm = gmtime(&t);
    s++;  /* skip `!' */
  }
  else
    stm = localtime(&t);
  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[3];
    luaL_Buffer b;
    cc[0] = '%'; cc[2] = '\0';
    luaL_buffinit(L, &b);
    for (; *s; s++) {
      if (*s != '%' || *(s + 1) == '\0')  /* no conversion specifier? */
        luaL_addchar(&b, *s);
      else {
        size_t reslen;
        char buff[200];  /* should be big enough for any conversion result */
        cc[1] = *(++s);
        reslen = strftime(buff, sizeof(buff), cc, stm);
        luaL_addlstring(&b, buff, reslen);
      }
    }
    luaL_pushresult(&b);
  }
  return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2120, %rsp           # imm = 0x2120
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movl $0x1, %esi
leaq 0x7388(%rip), %rdx      # 0x2c247
xorl %eax, %eax
movl %eax, %ecx
callq 0x1ab60
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movl $0x2, %esi
callq 0x6fe0
cmpl $0x0, %eax
jg 0x24ef1
xorl %eax, %eax
movl %eax, %edi
callq 0x5330
movq %rax, -0x2118(%rbp)
jmp 0x24f0b
movq -0x8(%rbp), %rdi
movl $0x2, %esi
callq 0x1ae80
cvttsd2si %xmm0, %rax
movq %rax, -0x2118(%rbp)
movq -0x2118(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x21, %eax
jne 0x24f3d
leaq -0x18(%rbp), %rdi
callq 0x5450
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x24f4a
leaq -0x18(%rbp), %rdi
callq 0x5050
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x24f5f
movq -0x8(%rbp), %rdi
callq 0x7800
jmp 0x2517c
movq -0x10(%rbp), %rdi
leaq 0x7b76(%rip), %rsi      # 0x2cae0
callq 0x52a0
cmpl $0x0, %eax
jne 0x2506a
movq -0x8(%rbp), %rdi
xorl %esi, %esi
movl $0x9, %edx
callq 0x7f20
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl (%rax), %edx
leaq 0x7b4a(%rip), %rsi      # 0x2cae3
callq 0x255a0
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl 0x4(%rax), %edx
leaq 0x7a84(%rip), %rsi      # 0x2ca34
callq 0x255a0
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl 0x8(%rax), %edx
leaq 0x7b20(%rip), %rsi      # 0x2cae7
callq 0x255a0
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl 0xc(%rax), %edx
leaq 0x7b1a(%rip), %rsi      # 0x2caf8
callq 0x255a0
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl 0x10(%rax), %edx
addl $0x1, %edx
leaq 0x7af4(%rip), %rsi      # 0x2caec
callq 0x255a0
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl 0x14(%rax), %edx
addl $0x76c, %edx            # imm = 0x76C
leaq 0x7add(%rip), %rsi      # 0x2caf2
callq 0x255a0
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl 0x18(%rax), %edx
addl $0x1, %edx
leaq 0x7ac8(%rip), %rsi      # 0x2caf7
callq 0x255a0
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl 0x1c(%rax), %edx
addl $0x1, %edx
leaq 0x7ab3(%rip), %rsi      # 0x2cafc
callq 0x255a0
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl 0x20(%rax), %edx
leaq 0x7aa1(%rip), %rsi      # 0x2cb01
callq 0x255e0
jmp 0x2517a
movb $0x25, -0x23(%rbp)
movb $0x0, -0x21(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x2040(%rbp), %rsi
callq 0x1b530
movq -0x10(%rbp), %rax
cmpb $0x0, (%rax)
je 0x2516e
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x25, %eax
jne 0x250a8
movq -0x10(%rbp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x0, %eax
jne 0x2510c
movq -0x2040(%rbp), %rcx
leaq -0x2040(%rbp), %rdx
addq $0x18, %rdx
addq $0x2000, %rdx           # imm = 0x2000
movb $0x1, %al
cmpq %rdx, %rcx
movb %al, -0x2119(%rbp)
jb 0x250e7
leaq -0x2040(%rbp), %rdi
callq 0x1b680
cmpq $0x0, %rax
setne %al
movb %al, -0x2119(%rbp)
movb -0x2119(%rbp), %al
movq -0x10(%rbp), %rax
movb (%rax), %cl
movq -0x2040(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x2040(%rbp)
movb %cl, (%rax)
jmp 0x2515b
movq -0x10(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x10(%rbp)
movb 0x1(%rax), %al
movb %al, -0x22(%rbp)
leaq -0x2110(%rbp), %rdi
leaq -0x23(%rbp), %rdx
movq -0x20(%rbp), %rcx
movl $0xc8, %esi
callq 0x5420
movq %rax, -0x2048(%rbp)
leaq -0x2110(%rbp), %rsi
movq -0x2048(%rbp), %rdx
leaq -0x2040(%rbp), %rdi
callq 0x1b570
jmp 0x2515d
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x25082
leaq -0x2040(%rbp), %rdi
callq 0x1b640
jmp 0x2517c
movl $0x1, %eax
addq $0x2120, %rsp           # imm = 0x2120
popq %rbp
retq
nopw (%rax,%rax)