user: Please show me the C implementation that matches the assembly code listed below:

```asm
<ns_datetosecs>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x38(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  cmp    $0xe,%eax
  je     L155
  mov    -0x40(%rbp),%rax
  movl   $0x1,(%rax)
  mov    $0x0,%eax
  jmp    L43
L155:
  mov    -0x40(%rbp),%rax
  movl   $0x0,(%rax)
  lea    -0x20(%rbp),%rax
  mov    $0x18,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  mov    -0x40(%rbp),%rdx
  mov    -0x38(%rbp),%rax
  mov    %rdx,%r8
  mov    $0x270f,%ecx
  mov    $0x7c6,%edx
  mov    $0x4,%esi
  mov    %rax,%rdi
  call   <datepart@plt>
  sub    $0x76c,%rax
  mov    %eax,-0x20(%rbp)
  mov    -0x38(%rbp),%rax
  add    $0x4,%rax
  mov    -0x40(%rbp),%rdx
  mov    %rdx,%r8
  mov    $0xc,%ecx
  mov    $0x1,%edx
  mov    $0x2,%esi
  mov    %rax,%rdi
  call   <datepart@plt>
  sub    $0x1,%rax
  mov    %eax,-0x1c(%rbp)
  mov    -0x38(%rbp),%rax
  add    $0x6,%rax
  mov    -0x40(%rbp),%rdx
  mov    %rdx,%r8
  mov    $0x1f,%ecx
  mov    $0x1,%edx
  mov    $0x2,%esi
  mov    %rax,%rdi
  call   <datepart@plt>
  mov    %eax,-0x18(%rbp)
  mov    -0x38(%rbp),%rax
  add    $0x8,%rax
  mov    -0x40(%rbp),%rdx
  mov    %rdx,%r8
  mov    $0x17,%ecx
  mov    $0x0,%edx
  mov    $0x2,%esi
  mov    %rax,%rdi
  call   <datepart@plt>
  mov    %eax,-0x14(%rbp)
  mov    -0x38(%rbp),%rax
  add    $0xa,%rax
  mov    -0x40(%rbp),%rdx
  mov    %rdx,%r8
  mov    $0x3b,%ecx
  mov    $0x0,%edx
  mov    $0x2,%esi
  mov    %rax,%rdi
  call   <datepart@plt>
  mov    %eax,-0x10(%rbp)
  mov    -0x38(%rbp),%rax
  add    $0xc,%rax
  mov    -0x40(%rbp),%rdx
  mov    %rdx,%r8
  mov    $0x3b,%ecx
  mov    $0x0,%edx
  mov    $0x2,%esi
  mov    %rax,%rdi
  call   <datepart@plt>
  mov    %eax,-0xc(%rbp)
  mov    -0x40(%rbp),%rax
  mov    (%rax),%eax
  test   %eax,%eax
  je     L31
  mov    $0x0,%eax
  jmp    L43
L31:
  mov    -0xc(%rbp),%eax
  mov    %eax,-0x2c(%rbp)
  mov    -0x10(%rbp),%eax
  imul   $0x3c,%eax,%eax
  add    %eax,-0x2c(%rbp)
  mov    -0x14(%rbp),%eax
  imul   $0xe10,%eax,%eax
  add    %eax,-0x2c(%rbp)
  mov    -0x18(%rbp),%eax
  sub    $0x1,%eax
  imul   $0x15180,%eax,%eax
  add    %eax,-0x2c(%rbp)
  movl   $0x0,-0x28(%rbp)
  movl   $0x0,-0x24(%rbp)
  jmp    L24
L52:
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  lea    D7(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  add    %eax,-0x28(%rbp)
  addl   $0x1,-0x24(%rbp)
L24:
  mov    -0x1c(%rbp),%eax
  cmp    %eax,-0x24(%rbp)
  jl     L52
  mov    -0x28(%rbp),%eax
  imul   $0x15180,%eax,%eax
  add    %eax,-0x2c(%rbp)
  mov    -0x1c(%rbp),%eax
  cmp    $0x1,%eax
  jle    L13
  mov    -0x20(%rbp),%eax
  add    $0x76c,%eax
  and    $0x3,%eax
  test   %eax,%eax
  jne    L20
  mov    -0x20(%rbp),%eax
  lea    0x76c(%rax),%edx
  movslq %edx,%rax
  imul   $0x51eb851f,%rax,%rax
  shr    $0x20,%rax
  sar    $0x5,%eax
  mov    %edx,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%eax
  imul   $0x64,%eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  test   %eax,%eax
  jne    L19
L20:
  mov    -0x20(%rbp),%eax
  lea    0x76c(%rax),%edx
  movslq %edx,%rax
  imul   $0x51eb851f,%rax,%rax
  shr    $0x20,%rax
  sar    $0x7,%eax
  mov    %edx,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%eax
  imul   $0x190,%eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  test   %eax,%eax
  jne    L13
L19:
  addl   $0x15180,-0x2c(%rbp)
L13:
  mov    -0x20(%rbp),%eax
  sub    $0x46,%eax
  imul   $0x1e13380,%eax,%eax
  add    %eax,-0x2c(%rbp)
  movl   $0x46,-0x24(%rbp)
  jmp    L66
L94:
  mov    -0x24(%rbp),%eax
  add    $0x76c,%eax
  and    $0x3,%eax
  test   %eax,%eax
  jne    L45
  mov    -0x24(%rbp),%eax
  lea    0x76c(%rax),%edx
  movslq %edx,%rax
  imul   $0x51eb851f,%rax,%rax
  shr    $0x20,%rax
  sar    $0x5,%eax
  mov    %edx,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%eax
  imul   $0x64,%eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  test   %eax,%eax
  jne    L106
L45:
  mov    -0x24(%rbp),%eax
  lea    0x76c(%rax),%edx
  movslq %edx,%rax
  imul   $0x51eb851f,%rax,%rax
  shr    $0x20,%rax
  sar    $0x7,%eax
  mov    %edx,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%eax
  imul   $0x190,%eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  test   %eax,%eax
  jne    L55
L106:
  addl   $0x15180,-0x2c(%rbp)
L55:
  addl   $0x1,-0x24(%rbp)
L66:
  mov    -0x20(%rbp),%eax
  cmp    %eax,-0x24(%rbp)
  jl     L94
  mov    -0x2c(%rbp),%eax
L43:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L59
  call   <__stack_chk_fail@plt>
L59:
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D7
type: string

tool: D7: 

assistant: ```c
u_int32_t ns_datetosecs(const char *cp, int *errp) {
  struct tm time;
  u_int32_t result;
  int mdays, i;
  static const int days_per_month[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
  if (strlen(cp) != 14U) {
    *errp = 1;
    return (0);
  }
  *errp = 0;
  memset(&time, 0, sizeof time);
  time.tm_year = datepart(cp + 0, 4, 1990, 9999, errp) - 1900;
  time.tm_mon = datepart(cp + 4, 2, 01, 12, errp) - 1;
  time.tm_mday = datepart(cp + 6, 2, 01, 31, errp);
  time.tm_hour = datepart(cp + 8, 2, 00, 23, errp);
  time.tm_min = datepart(cp + 10, 2, 00, 59, errp);
  time.tm_sec = datepart(cp + 12, 2, 00, 59, errp);
  if (*errp)
    return (0);
  result = time.tm_sec;
  result += time.tm_min * 60;
  result += time.tm_hour * (60 * 60);
  result += (time.tm_mday - 1) * ((u_int32_t)24 * 60 * 60);
  mdays = 0;
  for (i = 0; i < time.tm_mon; i++)
    mdays += days_per_month[i];
  result += mdays * ((u_int32_t)24 * 60 * 60);
  if (time.tm_mon > 1 && ((((1900 + time.tm_year) % 4) == 0 && ((1900 + time.tm_year) % 100) != 0) || ((1900 + time.tm_year) % 400) == 0))
    result += ((u_int32_t)24 * 60 * 60);
  result += (time.tm_year - 70) * (((u_int32_t)24 * 60 * 60) * 365);
  for (i = 70; i < time.tm_year; i++)
    if (((((1900 + i) % 4) == 0 && ((1900 + i) % 100) != 0) || ((1900 + i) % 400) == 0))
      result += ((u_int32_t)24 * 60 * 60);
  return (result);
}
```