user: Demonstrate the C code that generates the assembly output below:

```asm
<is_valid_date_format>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x60,%rsp
  mov    %rdi,-0x58(%rbp)
  mov    %esi,-0x5c(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x1f,-0x40(%rbp)
  movl   $0x1c,-0x3c(%rbp)
  movl   $0x1f,-0x38(%rbp)
  movl   $0x1e,-0x34(%rbp)
  movl   $0x1f,-0x30(%rbp)
  movl   $0x1e,-0x2c(%rbp)
  movl   $0x1f,-0x28(%rbp)
  movl   $0x1f,-0x24(%rbp)
  movl   $0x1e,-0x20(%rbp)
  movl   $0x1f,-0x1c(%rbp)
  movl   $0x1e,-0x18(%rbp)
  movl   $0x1f,-0x14(%rbp)
  lea    -0x50(%rbp),%rsi
  lea    -0x4c(%rbp),%rcx
  lea    -0x48(%rbp),%rdx
  mov    -0x58(%rbp),%rax
  mov    %rsi,%r8
  lea    D10(%rip),%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <sscanf@plt>
  mov    %eax,-0x44(%rbp)
  cmpl   $0x3,-0x44(%rbp)
  je     L146
  cmpl   $0x0,-0x5c(%rbp)
  jne    L11
  mov    -0x58(%rbp),%rax
  mov    %rax,%rsi
  lea    D8(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fail@plt>
L11:
  mov    $0xffffffff,%eax
  jmp    L117
L146:
  mov    -0x48(%rbp),%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
  je     L8
  mov    -0x48(%rbp),%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    L8
  mov    -0x48(%rbp),%eax
  and    $0x3,%eax
  test   %eax,%eax
  jne    L79
L8:
  movl   $0x1d,-0x3c(%rbp)
L79:
  mov    -0x4c(%rbp),%eax
  test   %eax,%eax
  jle    L44
  mov    -0x4c(%rbp),%eax
  cmp    $0xc,%eax
  jle    L51
L44:
  cmpl   $0x0,-0x5c(%rbp)
  jne    L85
  mov    -0x4c(%rbp),%eax
  mov    %eax,%edx
  lea    D57(%rip),%rax
  mov    %rax,%rsi
  lea    D5(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fail@plt>
L85:
  mov    $0xffffffff,%eax
  jmp    L117
L51:
  mov    -0x50(%rbp),%eax
  test   %eax,%eax
  jle    L100
  mov    -0x4c(%rbp),%eax
  sub    $0x1,%eax
  cltq
  mov    -0x40(%rbp,%rax,4),%edx
  mov    -0x50(%rbp),%eax
  cmp    %eax,%edx
  jge    L91
L100:
  cmpl   $0x0,-0x5c(%rbp)
  jne    L56
  mov    -0x50(%rbp),%eax
  mov    %eax,%edx
  lea    D57(%rip),%rax
  mov    %rax,%rsi
  lea    D23(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fail@plt>
L56:
  mov    $0xffffffff,%eax
  jmp    L117
L91:
  mov    $0x0,%eax
L117:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L110
  call   <__stack_chk_fail@plt>
L110:
  leave
  ret
```

tool_calls: name: read_data
arguments: data_label: D10
type_infered: string
name: read_data
arguments: data_label: D8
type_infered: string
name: read_data
arguments: data_label: D57
type_infered: string
name: read_data
arguments: data_label: D5
type_infered: string
name: read_data
arguments: data_label: D23
type_infered: string

tool: D10: %04d-%02d-%02d

tool: D8: invalid date format: %s


tool: D57: is_valid_date_format

tool: D5: %s: invalid month %d


tool: D23: %s: invalid day %d


assistant: ```c
int is_valid_date_format(const char *date, int silent_errors) {
  int d;
  int m;
  int y;
  int ret;
  int day_count[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
  ret = sscanf(date, "%04d-%02d-%02d", &y, &m, &d);
  if (ret != 3) {
    if (!silent_errors)
      fail("invalid date format: %s\n", date);
    return -1;
  }
  if (y % 400 == 0 || y % 100 != 0 || y % 4 == 0)
    day_count[1] = 29;
  if (m <= 0 || m >= 13) {
    if (!silent_errors)
      fail("%s: invalid month %d\n", __func__, m);
    return -1;
  }
  if (d <= 0 || d > day_count[m - 1]) {
    if (!silent_errors)
      fail("%s: invalid day %d\n", __func__, d);
    return -1;
  }
  return 0;
}
```