// File: /workspace/github_c_makefile_star2_O0/coyove[P]chann/./lib/mongoose/mongoose.c
// Function: parse_date_string
static time_t parse_date_string(const char *datetime) {
  static const unsigned short days_before_month[] = {
    0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334
  };
  char month_str[32];
  int second, minute, hour, day, month, year, leap_days, days;
  time_t result = (time_t) 0;

  if (((sscanf(datetime, "%d/%3s/%d %d:%d:%d",
               &day, month_str, &year, &hour, &minute, &second) == 6) ||
       (sscanf(datetime, "%d %3s %d %d:%d:%d",
               &day, month_str, &year, &hour, &minute, &second) == 6) ||
       (sscanf(datetime, "%*3s, %d %3s %d %d:%d:%d",
               &day, month_str, &year, &hour, &minute, &second) == 6) ||
       (sscanf(datetime, "%d-%3s-%d %d:%d:%d",
               &day, month_str, &year, &hour, &minute, &second) == 6)) &&
      year > 1970 &&
      (month = get_month_index(month_str)) != -1) {
    leap_days = num_leap_years(year) - num_leap_years(1970);
    year -= 1970;
    days = year * 365 + days_before_month[month] + (day - 1) + leap_days;
    result = days * 24 * 3600 + hour * 3600 + minute * 60 + second;
  }

  return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq $0x0, -0x58(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x30(%rbp), %rcx
leaq 0xefa9(%rip), %rsi      # 0xc7c0c
leaq -0x40(%rbp), %rdx
leaq -0x48(%rbp), %r8
leaq -0x3c(%rbp), %r9
leaq -0x38(%rbp), %r10
leaq -0x34(%rbp), %rax
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
movb $0x0, %al
callq 0xd130
cmpl $0x6, %eax
je 0xb8d3c
movq -0x8(%rbp), %rdi
leaq -0x30(%rbp), %rcx
leaq 0xef86(%rip), %rsi      # 0xc7c25
leaq -0x40(%rbp), %rdx
leaq -0x48(%rbp), %r8
leaq -0x3c(%rbp), %r9
leaq -0x38(%rbp), %r10
leaq -0x34(%rbp), %rax
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
movb $0x0, %al
callq 0xd130
cmpl $0x6, %eax
je 0xb8d3c
movq -0x8(%rbp), %rdi
leaq -0x30(%rbp), %rcx
leaq 0xef48(%rip), %rsi      # 0xc7c1f
leaq -0x40(%rbp), %rdx
leaq -0x48(%rbp), %r8
leaq -0x3c(%rbp), %r9
leaq -0x38(%rbp), %r10
leaq -0x34(%rbp), %rax
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
movb $0x0, %al
callq 0xd130
cmpl $0x6, %eax
je 0xb8d3c
movq -0x8(%rbp), %rdi
leaq -0x30(%rbp), %rcx
leaq 0xef29(%rip), %rsi      # 0xc7c38
leaq -0x40(%rbp), %rdx
leaq -0x48(%rbp), %r8
leaq -0x3c(%rbp), %r9
leaq -0x38(%rbp), %r10
leaq -0x34(%rbp), %rax
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
movb $0x0, %al
callq 0xd130
cmpl $0x6, %eax
jne 0xb8dcc
cmpl $0x7b2, -0x48(%rbp)     # imm = 0x7B2
jle 0xb8dcc
leaq -0x30(%rbp), %rdi
callq 0xb8de0
movl %eax, -0x44(%rbp)
cmpl $-0x1, %eax
je 0xb8dcc
movl -0x48(%rbp), %edi
callq 0xb8e40
movl %eax, -0x5c(%rbp)
movl $0x7b2, %edi            # imm = 0x7B2
callq 0xb8e40
movl %eax, %ecx
movl -0x5c(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x4c(%rbp)
movl -0x48(%rbp), %eax
subl $0x7b2, %eax            # imm = 0x7B2
movl %eax, -0x48(%rbp)
imull $0x16d, -0x48(%rbp), %eax # imm = 0x16D
movslq -0x44(%rbp), %rdx
leaq 0xdcaa(%rip), %rcx      # 0xc6a40
movzwl (%rcx,%rdx,2), %ecx
addl %ecx, %eax
movl -0x40(%rbp), %ecx
subl $0x1, %ecx
addl %ecx, %eax
addl -0x4c(%rbp), %eax
movl %eax, -0x50(%rbp)
imull $0x18, -0x50(%rbp), %eax
imull $0xe10, %eax, %eax      # imm = 0xE10
imull $0xe10, -0x3c(%rbp), %ecx # imm = 0xE10
addl %ecx, %eax
imull $0x3c, -0x38(%rbp), %ecx
addl %ecx, %eax
addl -0x34(%rbp), %eax
cltq
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)