user: What would the C source look like for the assembly code provided here:

```asm
<readstat_sav_date_parse>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x4a0,%rsp
  mov    %rdi,-0x498(%rbp)
  mov    %rsi,-0x4a0(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x1f,-0x470(%rbp)
  movl   $0x1c,-0x46c(%rbp)
  movl   $0x1f,-0x468(%rbp)
  movl   $0x1e,-0x464(%rbp)
  movl   $0x1f,-0x460(%rbp)
  movl   $0x1e,-0x45c(%rbp)
  movl   $0x1f,-0x458(%rbp)
  movl   $0x1f,-0x454(%rbp)
  movl   $0x1e,-0x450(%rbp)
  movl   $0x1f,-0x44c(%rbp)
  movl   $0x1e,-0x448(%rbp)
  movl   $0x1f,-0x444(%rbp)
  movl   $0x1f,-0x440(%rbp)
  movl   $0x1d,-0x43c(%rbp)
  movl   $0x1f,-0x438(%rbp)
  movl   $0x1e,-0x434(%rbp)
  movl   $0x1f,-0x430(%rbp)
  movl   $0x1e,-0x42c(%rbp)
  movl   $0x1f,-0x428(%rbp)
  movl   $0x1f,-0x424(%rbp)
  movl   $0x1e,-0x420(%rbp)
  movl   $0x1f,-0x41c(%rbp)
  movl   $0x1e,-0x418(%rbp)
  movl   $0x1f,-0x414(%rbp)
  mov    -0x498(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L160
  mov    -0x4a0(%rbp),%rax
  mov    -0x498(%rbp),%rdx
  mov    %rdx,(%rax)
  pxor   %xmm0,%xmm0
  jmp    L110
L160:
  lea    -0x488(%rbp),%rsi
  lea    -0x48c(%rbp),%rcx
  lea    -0x490(%rbp),%rdx
  mov    -0x498(%rbp),%rax
  mov    %rsi,%r8
  lea    D19(%rip),%rsi
  mov    %rax,%rdi
  call   <sscanf@plt>
  mov    %eax,-0x478(%rbp)
  mov    -0x48c(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x48c(%rbp)
  mov    -0x48c(%rbp),%eax
  test   %eax,%eax
  js     L88
  mov    -0x48c(%rbp),%eax
  cmp    $0xb,%eax
  jg     L88
  cmpl   $0x3,-0x478(%rbp)
  je     L34
L88:
  mov    -0x4a0(%rbp),%rax
  mov    -0x498(%rbp),%rdx
  mov    %rdx,(%rax)
  pxor   %xmm0,%xmm0
  jmp    L110
L34:
  mov    -0x490(%rbp),%eax
  mov    %eax,%edi
  call   <is_leap@plt>
  test   %rax,%rax
  je     L127
  lea    -0x440(%rbp),%rax
  jmp    L97
L127:
  lea    -0x470(%rbp),%rax
L97:
  mov    -0x48c(%rbp),%edx
  movslq %edx,%rdx
  shl    $0x2,%rdx
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x474(%rbp)
  mov    -0x488(%rbp),%eax
  test   %eax,%eax
  jle    L41
  mov    -0x488(%rbp),%eax
  cmp    %eax,-0x474(%rbp)
  jge    L43
L41:
  mov    -0x4a0(%rbp),%rax
  mov    -0x498(%rbp),%rdx
  mov    %rdx,(%rax)
  pxor   %xmm0,%xmm0
  jmp    L110
L43:
  movl   $0x0,-0x484(%rbp)
  movl   $0x62e,-0x480(%rbp)
  jmp    L109
L0:
  mov    -0x480(%rbp),%eax
  mov    %eax,%edi
  call   <is_leap@plt>
  test   %rax,%rax
  je     L36
  mov    $0x16e,%eax
  jmp    L48
L36:
  mov    $0x16d,%eax
L48:
  add    %eax,-0x484(%rbp)
  addl   $0x1,-0x480(%rbp)
L109:
  mov    -0x490(%rbp),%eax
  cmp    %eax,-0x480(%rbp)
  jl     L0
  movl   $0x0,-0x47c(%rbp)
  jmp    L98
L174:
  mov    -0x490(%rbp),%eax
  mov    %eax,%edi
  call   <is_leap@plt>
  test   %rax,%rax
  je     L68
  mov    -0x47c(%rbp),%eax
  cltq
  mov    -0x440(%rbp,%rax,4),%eax
  jmp    L105
L68:
  mov    -0x47c(%rbp),%eax
  cltq
  mov    -0x470(%rbp,%rax,4),%eax
L105:
  add    %eax,-0x484(%rbp)
  addl   $0x1,-0x47c(%rbp)
L98:
  mov    -0x48c(%rbp),%eax
  cmp    %eax,-0x47c(%rbp)
  jl     L174
  mov    -0x488(%rbp),%eax
  sub    $0x1,%eax
  add    %eax,-0x484(%rbp)
  mov    -0x488(%rbp),%ecx
  mov    -0x48c(%rbp),%eax
  lea    0x1(%rax),%esi
  mov    -0x490(%rbp),%edx
  lea    -0x410(%rbp),%rax
  mov    %ecx,%r9d
  mov    %esi,%r8d
  mov    %edx,%ecx
  lea    D19(%rip),%rdx
  mov    $0x400,%esi
  mov    %rax,%rdi
  call   <snprintf@plt>
  movslq %eax,%rdx
  mov    -0x498(%rbp),%rax
  add    %rax,%rdx
  mov    -0x4a0(%rbp),%rax
  mov    %rdx,(%rax)
  pxor   %xmm1,%xmm1
  cvtsi2sdl -0x484(%rbp),%xmm1
  movsd  D33(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  D39(%rip),%xmm1
  subsd  %xmm1,%xmm0
L110:
  movq   %xmm0,%rax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L196
  call   <__stack_chk_fail@plt>
L196:
  movq   %rax,%xmm0
  leave
  ret
```

tool_calls: name: read_data
arguments: data_label: D19
data_type: string
name: read_data
arguments: data_label: D33
data_type: f64
name: read_data
arguments: data_label: D39
data_type: byte[8]

tool: D19: %d-%d-%d

tool: D33: 86400

tool: {"D39": [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;
  }
}
```