user: 请将以下的汇编代码转换成C语言代码:

```asm
<readstat_sav_date_parse>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x488,%rsp
  mov    %rdi,%rbx
  mov    %rsi,%rbp
  mov    %fs:0x28,%rax
  mov    %rax,0x478(%rsp)
  xor    %eax,%eax
  movl   $0x1f,0x10(%rsp)
  movl   $0x1c,0x14(%rsp)
  movl   $0x1f,0x18(%rsp)
  movl   $0x1e,0x1c(%rsp)
  movl   $0x1f,0x20(%rsp)
  movl   $0x1e,0x24(%rsp)
  movl   $0x1f,0x28(%rsp)
  movl   $0x1f,0x2c(%rsp)
  movl   $0x1e,0x30(%rsp)
  movl   $0x1f,0x34(%rsp)
  movl   $0x1e,0x38(%rsp)
  movl   $0x1f,0x3c(%rsp)
  movl   $0x1f,0x40(%rsp)
  movl   $0x1d,0x44(%rsp)
  movl   $0x1f,0x48(%rsp)
  movl   $0x1e,0x4c(%rsp)
  movl   $0x1f,0x50(%rsp)
  movl   $0x1e,0x54(%rsp)
  movl   $0x1f,0x58(%rsp)
  movl   $0x1f,0x5c(%rsp)
  movl   $0x1e,0x60(%rsp)
  movl   $0x1f,0x64(%rsp)
  movl   $0x1e,0x68(%rsp)
  movl   $0x1f,0x6c(%rsp)
  cmpb   $0x0,(%rdi)
  jne    L137
  mov    %rdi,0x0(%rbp)
  pxor   %xmm0,%xmm0
L78:
  mov    0x478(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L34
  add    $0x488,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L137:
  lea    0x8(%rsp),%rcx
  lea    0x4(%rsp),%rdx
  lea    0xc(%rsp),%r8
  lea    D12(%rip),%rsi
  call   <sscanf@plt>
  mov    %eax,%edx
  mov    0x8(%rsp),%eax
  sub    $0x1,%eax
  mov    %eax,0x8(%rsp)
  cmp    $0x3,%edx
  jne    L42
  cmp    $0xb,%eax
  jbe    L108
L42:
  mov    %rbx,0x0(%rbp)
  pxor   %xmm0,%xmm0
  jmp    L78
L108:
  mov    0x4(%rsp),%edi
  call   <is_leap@plt>
  mov    %rax,%rcx
  lea    0x10(%rsp),%rdx
  lea    0x40(%rsp),%rax
  test   %rcx,%rcx
  cmove  %rdx,%rax
  mov    0xc(%rsp),%edx
  movslq 0x8(%rsp),%rcx
  cmp    (%rax,%rcx,4),%edx
  jg     L43
  test   %edx,%edx
  jle    L43
  mov    $0x62e,%r13d
  mov    $0x0,%r12d
  cmpl   $0x62e,0x4(%rsp)
  jle    L90
L66:
  mov    %r13d,%edi
  call   <is_leap@plt>
  cmp    $0x1,%rax
  sbb    $0xfffffe92,%r12d
  add    $0x1,%r13d
  cmp    %r13d,0x4(%rsp)
  jg     L66
L90:
  mov    0x8(%rsp),%eax
  test   %eax,%eax
  jle    L134
  mov    $0x0,%r13d
  jmp    L113
L43:
  mov    %rbx,0x0(%rbp)
  pxor   %xmm0,%xmm0
  jmp    L78
L22:
  mov    0x10(%rsp,%r13,4),%eax
L143:
  add    %eax,%r12d
  mov    0x8(%rsp),%eax
  add    $0x1,%r13
  cmp    %r13d,%eax
  jle    L134
L113:
  mov    0x4(%rsp),%edi
  call   <is_leap@plt>
  test   %rax,%rax
  je     L22
  mov    0x40(%rsp,%r13,4),%eax
  jmp    L143
L134:
  mov    0xc(%rsp),%r9d
  lea    -0x1(%r9,%r12,1),%r12d
  lea    0x70(%rsp),%rdi
  lea    0x1(%rax),%r8d
  mov    0x4(%rsp),%ecx
  lea    D12(%rip),%rdx
  mov    $0x400,%esi
  call   <snprintf@plt>
  cltq
  add    %rax,%rbx
  mov    %rbx,0x0(%rbp)
  pxor   %xmm0,%xmm0
  cvtsi2sd %r12d,%xmm0
  mulsd  D10(%rip),%xmm0
  subsd  D3(%rip),%xmm0
  jmp    L78
L34:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: tag: D12
type_guessed: string
name: extract_symbolic_data
arguments: tag: D10
type_guessed: f64
name: extract_symbolic_data
arguments: tag: D3
type_guessed: byte[8]

tool: D12: %d-%d-%d

tool: D10: 86400

tool: {"D3": [0x00,0x00,0x00,0x00,0xd0,0x90,0x77,0x41]}

assistant: ```c
double readstat_sav_date_parse(const char *s, char **dest) {
  int daysPerMonth[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
  int daysPerMonthLeap[] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
  int year, month, day;
  if (strlen(s) == 0) {
    *dest = (char *)s;
    return 0;
  }
  int ret = sscanf(s, "%d-%d-%d", &year, &month, &day);
  month--;
  if (month < 0 || month > 11 || ret != 3) {
    *dest = (char *)s;
    return 0;
  }
  int maxdays = (is_leap(year) ? daysPerMonthLeap : daysPerMonth)[month];
  if (day < 1 || day > maxdays) {
    *dest = (char *)s;
    return 0;
  } else {
    int days = 0;
    for (int i = 1582; i < year; i++) {
      days += is_leap(i) ? 366 : 365;
    }
    for (int m = 0; m < month; m++) {
      days += is_leap(year) ? daysPerMonthLeap[m] : daysPerMonth[m];
    }
    days += day - 1;
    char buf[1024];
    *dest = (char *)s + snprintf(buf, sizeof(buf), "%d-%d-%d", year, month + 1, day);
    return (days * 86400.0) - 24710400;
  }
}
```