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

```asm
<is_valid_date_format>:
  endbr64
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  mov    %esi,%ebx
  lea    D14(%rip),%rsi
  sub    $0x58,%rsp
  movdqa D54(%rip),%xmm0
  mov    %fs:0x28,%rax
  mov    %rax,0x48(%rsp)
  xor    %eax,%eax
  lea    0x8(%rsp),%rcx
  lea    0xc(%rsp),%rdx
  movaps %xmm0,0x10(%rsp)
  movdqa D73(%rip),%xmm0
  lea    0x4(%rsp),%r8
  movaps %xmm0,0x20(%rsp)
  movdqa D20(%rip),%xmm0
  movaps %xmm0,0x30(%rsp)
  call   <sscanf@plt>
  cmp    $0x3,%eax
  jne    L73
  mov    0xc(%rsp),%edx
  imul   $0xc28f5c29,%edx,%eax
  add    $0x51eb850,%eax
  mov    %eax,%ecx
  ror    $0x4,%ecx
  cmp    $0xa3d70a,%ecx
  ja     L30
L29:
  movl   $0x1d,0x14(%rsp)
L107:
  mov    0x8(%rsp),%edx
  lea    -0x1(%rdx),%eax
  cmp    $0xb,%eax
  ja     L28
  mov    0x4(%rsp),%edx
  test   %edx,%edx
  jle    L102
  cltq
  cmp    0x10(%rsp,%rax,4),%edx
  jg     L102
  xor    %eax,%eax
L34:
  mov    0x48(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L27
  add    $0x58,%rsp
  pop    %rbx
  pop    %rbp
  ret
  nopl   0x0(%rax,%rax,1)
L30:
  ror    $0x2,%eax
  cmp    $0x28f5c28,%eax
  ja     L29
  and    $0x3,%edx
  jne    L107
  jmp    L29
  nopl   0x0(%rax)
L73:
  test   %ebx,%ebx
  je     L105
L99:
  mov    $0xffffffff,%eax
  jmp    L34
  nopl   0x0(%rax,%rax,1)
L102:
  test   %ebx,%ebx
  jne    L99
  lea    D12(%rip),%rsi
  lea    D43(%rip),%rdi
  xor    %eax,%eax
  call   <fail@plt>
  mov    $0xffffffff,%eax
  jmp    L34
L28:
  test   %ebx,%ebx
  jne    L99
  lea    D12(%rip),%rsi
  lea    D62(%rip),%rdi
  xor    %eax,%eax
  call   <fail@plt>
  jmp    L99
L105:
  mov    %rbp,%rsi
  lea    D60(%rip),%rdi
  xor    %eax,%eax
  call   <fail@plt>
  mov    $0xffffffff,%eax
  jmp    L34
L27:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_tag: D14
data_type: string
name: read_data
arguments: data_tag: D54
data_type: byte[16]
name: read_data
arguments: data_tag: D73
data_type: byte[16]
name: read_data
arguments: data_tag: D20
data_type: byte[16]
name: read_data
arguments: data_tag: D12
data_type: string
name: read_data
arguments: data_tag: D43
data_type: string
name: read_data
arguments: data_tag: D62
data_type: string
name: read_data
arguments: data_tag: D60
data_type: string

tool: D14: %04d-%02d-%02d

tool: {"D54": [0x1f,0x00,0x00,0x00,0x1c,0x00,0x00,0x00,0x1f,0x00,0x00,0x00,0x1e,0x00,0x00,0x00]}

tool: {"D73": [0x1f,0x00,0x00,0x00,0x1e,0x00,0x00,0x00,0x1f,0x00,0x00,0x00,0x1f,0x00,0x00,0x00]}

tool: {"D20": [0x1e,0x00,0x00,0x00,0x1f,0x00,0x00,0x00,0x1e,0x00,0x00,0x00,0x1f,0x00,0x00,0x00]}

tool: D12: is_valid_date_format

tool: D43: %s: invalid day %d


tool: D62: %s: invalid month %d


tool: D60: invalid date format: %s


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;
}
```