user: What is the c source code of the assembly code below?

```asm
<mg_parse_date_string>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x78,%rsp
  mov    %rdi,-0x78(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x18(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0x50(%rbp)
  lea    -0x5c(%rbp),%r8
  lea    -0x54(%rbp),%rdi
  lea    -0x40(%rbp),%rcx
  lea    -0x58(%rbp),%rdx
  mov    -0x78(%rbp),%rax
  lea    -0x64(%rbp),%rsi
  push   %rsi
  lea    -0x60(%rbp),%rsi
  push   %rsi
  mov    %r8,%r9
  mov    %rdi,%r8
  lea    D40(%rip),%rsi
  mov    %rax,%rdi
  call   <sscanf@plt>
  add    $0x10,%rsp
  cmp    $0x6,%eax
  je     L58
  lea    -0x5c(%rbp),%r8
  lea    -0x54(%rbp),%rdi
  lea    -0x40(%rbp),%rcx
  lea    -0x58(%rbp),%rdx
  mov    -0x78(%rbp),%rax
  lea    -0x64(%rbp),%rsi
  push   %rsi
  lea    -0x60(%rbp),%rsi
  push   %rsi
  mov    %r8,%r9
  mov    %rdi,%r8
  lea    D4(%rip),%rsi
  mov    %rax,%rdi
  call   <sscanf@plt>
  add    $0x10,%rsp
  cmp    $0x6,%eax
  je     L58
  lea    -0x5c(%rbp),%r8
  lea    -0x54(%rbp),%rdi
  lea    -0x40(%rbp),%rcx
  lea    -0x58(%rbp),%rdx
  mov    -0x78(%rbp),%rax
  lea    -0x64(%rbp),%rsi
  push   %rsi
  lea    -0x60(%rbp),%rsi
  push   %rsi
  mov    %r8,%r9
  mov    %rdi,%r8
  lea    D7(%rip),%rsi
  mov    %rax,%rdi
  call   <sscanf@plt>
  add    $0x10,%rsp
  cmp    $0x6,%eax
  je     L58
  lea    -0x5c(%rbp),%r8
  lea    -0x54(%rbp),%rdi
  lea    -0x40(%rbp),%rcx
  lea    -0x58(%rbp),%rdx
  mov    -0x78(%rbp),%rax
  lea    -0x64(%rbp),%rsi
  push   %rsi
  lea    -0x60(%rbp),%rsi
  push   %rsi
  mov    %r8,%r9
  mov    %rdi,%r8
  lea    D13(%rip),%rsi
  mov    %rax,%rdi
  call   <sscanf@plt>
  add    $0x10,%rsp
  cmp    $0x6,%eax
  jne    L42
L58:
  mov    -0x54(%rbp),%eax
  cmp    $0x7b2,%eax
  jle    L42
  lea    -0x40(%rbp),%rax
  mov    %rax,%rdi
  call   <mg_get_month_index@plt>
  mov    %eax,-0x4c(%rbp)
  cmpl   $0xffffffff,-0x4c(%rbp)
  je     L42
  mov    -0x54(%rbp),%eax
  mov    %eax,%edi
  call   <mg_num_leap_years@plt>
  mov    %eax,%ebx
  mov    $0x7b2,%edi
  call   <mg_num_leap_years@plt>
  mov    %eax,%edx
  mov    %ebx,%eax
  sub    %edx,%eax
  mov    %eax,-0x48(%rbp)
  mov    -0x54(%rbp),%eax
  sub    $0x7b2,%eax
  mov    %eax,-0x54(%rbp)
  mov    -0x54(%rbp),%eax
  imul   $0x16d,%eax,%ecx
  mov    -0x4c(%rbp),%eax
  cltq
  lea    (%rax,%rax,1),%rdx
  lea    D10(%rip),%rax
  movzwl (%rdx,%rax,1),%eax
  movzwl %ax,%eax
  lea    (%rcx,%rax,1),%edx
  mov    -0x58(%rbp),%eax
  sub    $0x1,%eax
  add    %eax,%edx
  mov    -0x48(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x44(%rbp)
  mov    -0x44(%rbp),%eax
  imul   $0x15180,%eax,%edx
  mov    -0x5c(%rbp),%eax
  imul   $0xe10,%eax,%eax
  add    %eax,%edx
  mov    -0x60(%rbp),%eax
  imul   $0x3c,%eax,%eax
  add    %eax,%edx
  mov    -0x64(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x50(%rbp)
L42:
  mov    -0x50(%rbp),%eax
  mov    -0x18(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L13
  call   <__stack_chk_fail@plt>
L13:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

tool_calls: name: read_data
arguments: data_tag: D40
type_infered: string
name: read_data
arguments: data_tag: D4
type_infered: string
name: read_data
arguments: data_tag: D7
type_infered: string
name: read_data
arguments: data_tag: D13
type_infered: string
name: read_data
arguments: data_tag: D10
type_infered: string

tool: D40: %d/%3s/%d %d:%d:%d

tool: D4: %d %3s %d %d:%d:%d

tool: D7: %*3s, %d %3s %d %d:%d:%d

tool: D13: %d-%3s-%d %d:%d:%d

tool: 

assistant: ```c
time_t mg_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 = mg_get_month_index(month_str)) != -1) {
    leap_days = mg_num_leap_years(year) - mg_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;
}
```