user: Converte this assembly snippet into its equivalent C code:

```asm
<parse_cvs_date>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x60,%rsp
  mov    %rdi,-0x48(%rbp)
  mov    %rsi,-0x50(%rbp)
  mov    %rdx,-0x58(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x58(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <is_digit@plt>
  test   %eax,%eax
  je     L64
  mov    -0x58(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <is_digit@plt>
  test   %eax,%eax
  jne    L286
L64:
  mov    $0x0,%eax
  jmp    L368
L286:
  movl   $0x0,-0x20(%rbp)
  mov    -0x58(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  cmp    $0x3a,%al
  je     L421
  movl   $0xfffff894,-0x20(%rbp)
L421:
  lea    -0x30(%rbp),%rcx
  mov    -0x58(%rbp),%rax
  mov    $0xa,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strtoul@plt>
  cltq
  mov    %rax,-0x28(%rbp)
  cmpq   $0x270f,-0x28(%rbp)
  ja     L381
  mov    -0x30(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2d,%al
  je     L154
  mov    -0x30(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  je     L154
L381:
  mov    $0x0,%eax
  jmp    L368
L154:
  mov    -0x30(%rbp),%rax
  add    $0x1,%rax
  mov    %rax,-0x30(%rbp)
  mov    -0x20(%rbp),%eax
  mov    %eax,%edx
  mov    -0x28(%rbp),%rax
  add    %edx,%eax
  mov    %eax,-0x20(%rbp)
  mov    -0x30(%rbp),%rax
  lea    -0x30(%rbp),%rcx
  mov    $0xa,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strtoul@plt>
  sub    $0x1,%eax
  mov    %eax,-0x1c(%rbp)
  mov    -0x1c(%rbp),%eax
  test   %eax,%eax
  js     L171
  mov    -0x1c(%rbp),%eax
  cmp    $0xb,%eax
  jg     L171
  mov    -0x30(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2d,%al
  je     L27
  mov    -0x30(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  je     L27
L171:
  mov    $0x0,%eax
  jmp    L368
L27:
  mov    -0x30(%rbp),%rax
  add    $0x1,%rax
  mov    %rax,-0x30(%rbp)
  mov    -0x30(%rbp),%rax
  lea    -0x30(%rbp),%rcx
  mov    $0xa,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strtoul@plt>
  mov    %eax,-0x18(%rbp)
  mov    -0x18(%rbp),%eax
  test   %eax,%eax
  jle    L230
  mov    -0x18(%rbp),%eax
  cmp    $0x1f,%eax
  jg     L230
  mov    -0x30(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x30(%rbp)
  movzbl (%rax),%eax
  cmp    $0x20,%al
  je     L109
L230:
  mov    $0x0,%eax
  jmp    L368
L109:
  mov    -0x30(%rbp),%rax
  lea    -0x30(%rbp),%rcx
  mov    $0xa,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strtoul@plt>
  mov    %eax,-0x14(%rbp)
  mov    -0x14(%rbp),%eax
  test   %eax,%eax
  js     L427
  mov    -0x14(%rbp),%eax
  cmp    $0x18,%eax
  jg     L427
  mov    -0x30(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x30(%rbp)
  movzbl (%rax),%eax
  cmp    $0x3a,%al
  je     L425
L427:
  mov    $0x0,%eax
  jmp    L368
L425:
  mov    -0x30(%rbp),%rax
  lea    -0x30(%rbp),%rcx
  mov    $0xa,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strtoul@plt>
  mov    %eax,-0x10(%rbp)
  mov    -0x10(%rbp),%eax
  test   %eax,%eax
  js     L362
  mov    -0x10(%rbp),%eax
  cmp    $0x3b,%eax
  jle    L162
L362:
  mov    $0x0,%eax
  jmp    L368
L162:
  mov    -0x30(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x3a,%al
  jne    L10
  mov    -0x30(%rbp),%rax
  add    $0x1,%rax
  mov    %rax,-0x30(%rbp)
  mov    -0x30(%rbp),%rax
  lea    -0x30(%rbp),%rcx
  mov    $0xa,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strtoul@plt>
  mov    %eax,-0xc(%rbp)
  mov    -0xc(%rbp),%eax
  test   %eax,%eax
  js     L314
  mov    -0xc(%rbp),%eax
  cmp    $0x3c,%eax
  jle    L121
L314:
  mov    $0x0,%eax
  jmp    L368
L10:
  movl   $0x0,-0xc(%rbp)
L121:
  mov    -0x30(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L454
  lea    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <timegm@plt>
  mov    -0x48(%rbp),%rdx
  mov    %al,(%rdx)
  mov    -0x50(%rbp),%rax
  movb   $0x0,(%rax)
  mov    $0x1,%eax
  jmp    L368
L454:
  mov    -0x30(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x30(%rbp)
  movzbl (%rax),%eax
  cmp    $0x20,%al
  je     L242
  mov    $0x0,%eax
  jmp    L368
L242:
  mov    -0x30(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2b,%al
  jne    L319
  movl   $0x1,-0x34(%rbp)
  jmp    L94
L319:
  mov    -0x30(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2d,%al
  jne    L268
  movl   $0xffffffff,-0x34(%rbp)
  jmp    L94
L268:
  mov    $0x0,%eax
  jmp    L368
L94:
  mov    -0x30(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <is_digit@plt>
  test   %eax,%eax
  je     L323
  mov    -0x30(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <is_digit@plt>
  test   %eax,%eax
  jne    L353
L323:
  mov    $0x0,%eax
  jmp    L368
L353:
  mov    -0x30(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  sub    $0x30,%eax
  mov    %eax,%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  add    %eax,%eax
  mov    %eax,%edx
  mov    -0x30(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  sub    $0x30,%eax
  add    %edx,%eax
  shl    $0x4,%eax
  mov    %al,-0x35(%rbp)
  mov    -0x30(%rbp),%rax
  add    $0x3,%rax
  mov    %rax,-0x30(%rbp)
  mov    -0x30(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L209
  mov    -0x30(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <is_digit@plt>
  test   %eax,%eax
  je     L51
  mov    -0x30(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <is_digit@plt>
  test   %eax,%eax
  jne    L357
L51:
  mov    $0x0,%eax
  jmp    L368
L357:
  mov    -0x30(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  sub    $0x30,%eax
  mov    $0x58,%edx
  imul   %edx,%eax
  mov    %eax,%edx
  mov    -0x30(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  sub    $0x30,%eax
  mov    $0x3c,%ecx
  imul   %ecx,%eax
  add    %eax,%edx
  movzbl -0x35(%rbp),%eax
  add    %edx,%eax
  mov    %al,-0x35(%rbp)
  mov    -0x30(%rbp),%rax
  add    $0x2,%rax
  mov    %rax,-0x30(%rbp)
L209:
  mov    -0x30(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L297
  mov    $0x0,%eax
  jmp    L368
L297:
  lea    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <timegm@plt>
  mov    %eax,%ecx
  mov    -0x34(%rbp),%eax
  movzbl -0x35(%rbp),%edx
  imul   %edx,%eax
  sub    %eax,%ecx
  mov    %ecx,%edx
  mov    -0x48(%rbp),%rax
  mov    %dl,(%rax)
  mov    -0x50(%rbp),%rax
  movzbl -0x35(%rbp),%edx
  mov    %dl,(%rax)
  mov    $0x1,%eax
L368:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L148
  call   <__stack_chk_fail@plt>
L148:
  leave
  ret
```

assistant: ```c
bool parse_cvs_date(time_t *time, time_t *offset, const char *date) {
  if (!is_digit(date[0]) || !is_digit(date[1]))
    return false;
  struct tm dtm;
  dtm.tm_year = 0;
  if (date[2] != ':')
    dtm.tm_year = -1900;
  char *d;
  unsigned long year = strtoul(date, &d, 10);
  if (year >= 10000 || (*d != '-' && *d != '/'))
    return false;
  ++d;
  dtm.tm_year += year;
  dtm.tm_mon = strtoul(d, &d, 10) - 1;
  if (dtm.tm_mon < 0 || dtm.tm_mon > 11 || (*d != '-' && *d != '/'))
    return false;
  ++d;
  dtm.tm_mday = strtoul(d, &d, 10);
  if (dtm.tm_mday < 1 || dtm.tm_mday > 31 || *d++ != ' ')
    return false;
  dtm.tm_hour = strtoul(d, &d, 10);
  if (dtm.tm_hour < 0 || dtm.tm_hour > 24 || *d++ != ':')
    return false;
  dtm.tm_min = strtoul(d, &d, 10);
  if (dtm.tm_min < 0 || dtm.tm_min > 59)
    return false;
  if (*d == ':') {
    ++d;
    dtm.tm_sec = strtoul(d, &d, 10);
    if (dtm.tm_sec < 0 || dtm.tm_sec > 60)
      return false;
  } else
    dtm.tm_sec = 0;
  if (*d == 0) {
    *time = timegm(&dtm);
    *offset = 0;
    return true;
  }
  if (*d++ != ' ')
    return false;
  int sign;
  if (*d == '+')
    sign = 1;
  else if (*d == '-')
    sign = -1;
  else
    return false;
  if (!is_digit(d[1]) || !is_digit(d[2]))
    return false;
  time_t off = (d[1] - '0') * 36000 + (d[2] - '0') * 3600;
  d += 3;
  if (*d != 0) {
    if (!is_digit(d[0]) || !is_digit(d[1]))
      return false;
    off += (d[0] - '0') * 600 + (d[1] - '0') * 60;
    d += 2;
  }
  if (*d != 0)
    return false;
  *time = timegm(&dtm) - sign * off;
  *offset = off;
  return true;
}
```