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

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    D47(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    -0x14(%rbp),%rcx
  lea    -0x18(%rbp),%rdx
  lea    -0x1c(%rbp),%rax
  mov    %rax,%rsi
  lea    D46(%rip),%rax
  mov    %rax,%rdi
  call   <scanf@plt>
  mov    -0x18(%rbp),%eax
  cmp    $0xc,%eax
  ja     L202
  mov    %eax,%eax
  lea    0x0(,%rax,4),%rdx
  lea    D67(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  cltq
  lea    D67(%rip),%rdx
  add    %rdx,%rax
  notrack jmp *%rax
  movl   $0x0,-0x10(%rbp)
  jmp    L170
  movl   $0x1f,-0x10(%rbp)
  jmp    L170
  movl   $0x3b,-0x10(%rbp)
  jmp    L170
  movl   $0x5a,-0x10(%rbp)
  jmp    L170
  movl   $0x78,-0x10(%rbp)
  jmp    L170
  movl   $0x97,-0x10(%rbp)
  jmp    L170
  movl   $0xb5,-0x10(%rbp)
  jmp    L170
  movl   $0xd4,-0x10(%rbp)
  jmp    L170
  movl   $0xf3,-0x10(%rbp)
  jmp    L170
  movl   $0x111,-0x10(%rbp)
  jmp    L170
  movl   $0x12f,-0x10(%rbp)
  jmp    L170
  movl   $0x14d,-0x10(%rbp)
  jmp    L170
L202:
  lea    D36(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L170:
  mov    -0x1c(%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     L117
  mov    -0x1c(%rbp),%eax
  and    $0x3,%eax
  test   %eax,%eax
  je     L117
  mov    -0x1c(%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
  je     L28
L117:
  movl   $0x1,-0xc(%rbp)
  jmp    L144
L28:
  movl   $0x0,-0xc(%rbp)
L144:
  mov    -0x18(%rbp),%eax
  cmp    $0x1,%eax
  je     L212
  mov    -0x18(%rbp),%eax
  cmp    $0x2,%eax
  jne    L113
L212:
  mov    -0x14(%rbp),%eax
  add    %eax,-0x10(%rbp)
  mov    -0x10(%rbp),%eax
  mov    %eax,%esi
  lea    D60(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L48
L113:
  cmpl   $0x1,-0xc(%rbp)
  jne    L168
  mov    -0x14(%rbp),%edx
  mov    -0x10(%rbp),%eax
  add    %edx,%eax
  add    $0x1,%eax
  mov    %eax,-0x10(%rbp)
  mov    -0x10(%rbp),%eax
  mov    %eax,%esi
  lea    D60(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L48
L168:
  mov    -0x14(%rbp),%eax
  add    %eax,-0x10(%rbp)
  mov    -0x10(%rbp),%eax
  mov    %eax,%esi
  lea    D60(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L48:
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L135
  call   <__stack_chk_fail@plt>
L135:
  leave
  ret
```

tool_calls: name: unpack_data
arguments: tag: D47
data_type: string
name: unpack_data
arguments: tag: D46
data_type: string
name: unpack_data
arguments: tag: D36
data_type: string
name: unpack_data
arguments: tag: D60
data_type: string

tool: D47: 
Please input the year,month,day:

tool: D46: %d,%d,%d

tool: D36: month error!

tool: D60: the number of the day in this year is: %d


assistant: ```c
void main() {
  int year, month, day, sum, leap;
  printf("\nPlease input the year,month,day:\n");
  scanf("%d,%d,%d", &year, &month, &day);
  switch (month) {
  case 1:
    sum = 0;
    break;
  case 2:
    sum = 31;
    break;
  case 3:
    sum = 59;
    break;
  case 4:
    sum = 90;
    break;
  case 5:
    sum = 120;
    break;
  case 6:
    sum = 151;
    break;
  case 7:
    sum = 181;
    break;
  case 8:
    sum = 212;
    break;
  case 9:
    sum = 243;
    break;
  case 10:
    sum = 273;
    break;
  case 11:
    sum = 303;
    break;
  case 12:
    sum = 333;
    break;
  default:
    printf("month error!");
  }
  if ((0 == year % 400) || (0 == year % 4 || 0 != year % 100))
    leap = 1;
  else
    leap = 0;
  if (1 == month || 2 == month) {
    sum = sum + day;
    printf("the number of the day in this year is: %d\n", sum);
  } else {
    if (1 == leap) {
      sum = sum + day + 1;
      printf("the number of the day in this year is: %d\n", sum);
    } else {
      sum = sum + day;
      printf("the number of the day in this year is: %d\n", sum);
    }
  }
}
```