// File: nilnilnil[P]autocomplete/deps/mongoose/mongoose.c
// Function: parse_date_string
static time_t parse_date_string(const char *s) {
  time_t current_time;
  struct tm tm, *tmp;
  char mon[32];
  int sec, min, hour, mday, month, year;

  (void) memset(&tm, 0, sizeof(tm));
  sec = min = hour = mday = month = year = 0;

  if (((sscanf(s, "%d/%3s/%d %d:%d:%d",
            &mday, mon, &year, &hour, &min, &sec) == 6) ||
        (sscanf(s, "%d %3s %d %d:%d:%d",
                &mday, mon, &year, &hour, &min, &sec) == 6) ||
        (sscanf(s, "%*3s, %d %3s %d %d:%d:%d",
                &mday, mon, &year, &hour, &min, &sec) == 6) ||
        (sscanf(s, "%d-%3s-%d %d:%d:%d",
                &mday, mon, &year, &hour, &min, &sec) == 6)) &&
      (month = month_number_to_month_name(mon)) != -1) {
    tm.tm_mday = mday;
    tm.tm_mon = month;
    tm.tm_year = year;
    tm.tm_hour = hour;
    tm.tm_min = min;
    tm.tm_sec = sec;
  }

  if (tm.tm_year > 1900) {
    tm.tm_year -= 1900;
  } else if (tm.tm_year < 70) {
    tm.tm_year += 100;
  }

  // Set Daylight Saving Time field
  current_time = time(NULL);
  tmp = localtime(&current_time);
  tm.tm_isdst = tmp->tm_isdst;

  return mktime(&tm);
}

// Assembly:
subq $0xa8, %rsp
movq %rdi, 0xa0(%rsp)
leaq 0x60(%rsp), %rdi
xorl %esi, %esi
movl $0x38, %edx
callq 0x52a0
movl $0x0, 0x18(%rsp)
movl $0x0, 0x1c(%rsp)
movl $0x0, 0x20(%rsp)
movl $0x0, 0x24(%rsp)
movl $0x0, 0x28(%rsp)
movl $0x0, 0x2c(%rsp)
movq 0xa0(%rsp), %rdi
leaq 0x30(%rsp), %rcx
leaq 0x2791(%rip), %rsi      # 0x23945
leaq 0x20(%rsp), %rdx
leaq 0x18(%rsp), %r8
leaq 0x24(%rsp), %r9
leaq 0x28(%rsp), %r10
leaq 0x2c(%rsp), %rax
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
movb $0x0, %al
callq 0x5540
cmpl $0x6, %eax
je 0x212b0
movq 0xa0(%rsp), %rdi
leaq 0x30(%rsp), %rcx
leaq 0x2764(%rip), %rsi      # 0x2395e
leaq 0x20(%rsp), %rdx
leaq 0x18(%rsp), %r8
leaq 0x24(%rsp), %r9
leaq 0x28(%rsp), %r10
leaq 0x2c(%rsp), %rax
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
movb $0x0, %al
callq 0x5540
cmpl $0x6, %eax
je 0x212b0
movq 0xa0(%rsp), %rdi
leaq 0x30(%rsp), %rcx
leaq 0x2718(%rip), %rsi      # 0x23958
leaq 0x20(%rsp), %rdx
leaq 0x18(%rsp), %r8
leaq 0x24(%rsp), %r9
leaq 0x28(%rsp), %r10
leaq 0x2c(%rsp), %rax
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
movb $0x0, %al
callq 0x5540
cmpl $0x6, %eax
je 0x212b0
movq 0xa0(%rsp), %rdi
leaq 0x30(%rsp), %rcx
leaq 0x26ef(%rip), %rsi      # 0x23971
leaq 0x20(%rsp), %rdx
leaq 0x18(%rsp), %r8
leaq 0x24(%rsp), %r9
leaq 0x28(%rsp), %r10
leaq 0x2c(%rsp), %rax
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
movb $0x0, %al
callq 0x5540
cmpl $0x6, %eax
jne 0x212f3
leaq 0x30(%rsp), %rdi
callq 0x21370
movl %eax, 0x1c(%rsp)
cmpl $-0x1, %eax
je 0x212f3
movl 0x20(%rsp), %eax
movl %eax, 0x6c(%rsp)
movl 0x1c(%rsp), %eax
movl %eax, 0x70(%rsp)
movl 0x18(%rsp), %eax
movl %eax, 0x74(%rsp)
movl 0x24(%rsp), %eax
movl %eax, 0x68(%rsp)
movl 0x28(%rsp), %eax
movl %eax, 0x64(%rsp)
movl 0x2c(%rsp), %eax
movl %eax, 0x60(%rsp)
cmpl $0x76c, 0x74(%rsp)      # imm = 0x76C
jle 0x2130c
movl 0x74(%rsp), %eax
subl $0x76c, %eax            # imm = 0x76C
movl %eax, 0x74(%rsp)
jmp 0x21320
cmpl $0x46, 0x74(%rsp)
jge 0x2131e
movl 0x74(%rsp), %eax
addl $0x64, %eax
movl %eax, 0x74(%rsp)
jmp 0x21320
xorl %eax, %eax
movl %eax, %edi
callq 0x54f0
movq %rax, 0x98(%rsp)
leaq 0x98(%rsp), %rdi
callq 0x53c0
movq %rax, 0x58(%rsp)
movq 0x58(%rsp), %rax
movl 0x20(%rax), %eax
movl %eax, 0x80(%rsp)
leaq 0x60(%rsp), %rdi
callq 0x5360
addq $0xa8, %rsp
retq
nopw %cs:(%rax,%rax)