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

```asm
<main>:
  endbr64
  push   %r12
  lea    D32(%rip),%rsi
  lea    D14(%rip),%rdi
  push   %rbp
  sub    $0x78,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x68(%rsp)
  xor    %eax,%eax
  call   <fopen@plt>
  lea    D38(%rip),%rsi
  lea    D17(%rip),%rdi
  mov    %rax,%rbp
  call   <fopen@plt>
  pxor   %xmm0,%xmm0
  lea    0xc(%rsp),%rdx
  mov    %rbp,%rdi
  mov    %rax,%r12
  lea    D30(%rip),%rsi
  movabs $0x1c0000001f,%rax
  movq   $0x0,0x20(%rsp)
  mov    %rax,0x34(%rsp)
  movabs $0x1e0000001f,%rax
  mov    %rax,0x3c(%rsp)
  mov    %rax,0x44(%rsp)
  movabs $0x1f0000001f,%rax
  mov    %rax,0x4c(%rsp)
  sub    $0x1,%rax
  mov    %rax,0x54(%rsp)
  mov    %rax,0x5c(%rsp)
  movl   $0x0,0x28(%rsp)
  movaps %xmm0,0x10(%rsp)
  call   <fscanf@plt>
  mov    0xc(%rsp),%eax
  lea    0x76b(%rax),%r9d
  cmp    $0x76b,%r9d
  jle    L1
  mov    $0x1,%eax
  mov    $0x1,%ecx
  mov    $0x76c,%esi
  mov    $0x1,%r8d
  mov    $0x1,%edi
  nopw   0x0(%rax,%rax,1)
L64:
  imul   $0xc28f5c29,%esi,%r10d
  mov    $0x1d,%edx
  mov    %r10d,%r11d
  ror    $0x4,%r11d
  cmp    $0xa3d70a,%r11d
  jbe    L113
  ror    $0x2,%r10d
  mov    $0x1c,%edx
  cmp    $0x28f5c28,%r10d
  jbe    L113
  mov    %esi,%edx
  and    $0x3,%edx
  cmp    $0x1,%edx
  mov    $0x1c,%edx
  adc    $0x0,%edx
L113:
  mov    %edx,0x38(%rsp)
  cmp    %ecx,0x30(%rsp,%rdi,4)
  jle    L81
  lea    0x1(%rax),%edx
  add    $0x1,%ecx
  movslq %edx,%rax
  mov    %edx,%r10d
  imul   $0xffffffff92492493,%rax,%rax
  sar    $0x1f,%r10d
  shr    $0x20,%rax
  add    %edx,%eax
  sar    $0x2,%eax
  sub    %r10d,%eax
  lea    0x0(,%rax,8),%r10d
  sub    %eax,%r10d
  mov    %edx,%eax
  sub    %r10d,%eax
  cmp    %esi,%r9d
  jl     L1
  cmp    $0xd,%ecx
  jne    L64
  movslq %eax,%rdx
  addl   $0x1,0x10(%rsp,%rdx,4)
  jmp    L64
  nopw   0x0(%rax,%rax,1)
L81:
  cmp    $0xb,%r8d
  jg     L11
  lea    0x1(%rax),%edx
  add    $0x1,%r8d
  movslq %edx,%rax
  mov    %edx,%ecx
  imul   $0xffffffff92492493,%rax,%rax
  sar    $0x1f,%ecx
  shr    $0x20,%rax
  add    %edx,%eax
  sar    $0x2,%eax
  sub    %ecx,%eax
  lea    0x0(,%rax,8),%ecx
  sub    %eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  cmp    %esi,%r9d
  jl     L1
  mov    $0x1,%ecx
  movslq %r8d,%rdi
  jmp    L64
  cs nopw 0x0(%rax,%rax,1)
L11:
  lea    0x1(%rax),%edx
  add    $0x1,%esi
  movslq %edx,%rax
  mov    %edx,%ecx
  imul   $0xffffffff92492493,%rax,%rax
  sar    $0x1f,%ecx
  shr    $0x20,%rax
  add    %edx,%eax
  sar    $0x2,%eax
  sub    %ecx,%eax
  lea    0x0(,%rax,8),%ecx
  sub    %eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  cmp    %esi,%r9d
  jl     L1
  mov    $0x1,%ecx
  mov    $0x1,%r8d
  mov    $0x1,%edi
  jmp    L64
  nopw   0x0(%rax,%rax,1)
L1:
  sub    $0x8,%rsp
  lea    D10(%rip),%rsi
  mov    %r12,%rdi
  mov    0x2c(%rsp),%eax
  push   %rax
  mov    0x30(%rsp),%eax
  push   %rax
  mov    0x34(%rsp),%eax
  push   %rax
  mov    0x38(%rsp),%r9d
  mov    0x34(%rsp),%r8d
  mov    0x30(%rsp),%ecx
  mov    0x48(%rsp),%edx
  call   <fprintf@plt>
  add    $0x20,%rsp
  mov    %rbp,%rdi
  call   <fclose@plt>
  mov    %r12,%rdi
  call   <fclose@plt>
  mov    0x68(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L9
  add    $0x78,%rsp
  xor    %eax,%eax
  pop    %rbp
  pop    %r12
  ret
L9:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: label: D32
type_guessed: string
name: disassemble_data
arguments: label: D14
type_guessed: string
name: disassemble_data
arguments: label: D38
type_guessed: string
name: disassemble_data
arguments: label: D17
type_guessed: string
name: disassemble_data
arguments: label: D30
type_guessed: string
name: disassemble_data
arguments: label: D10
type_guessed: string

tool: D32: r

tool: D14: friday.in

tool: D38: w

tool: D17: friday.out

tool: D30: %d

tool: D10: %d %d %d %d %d %d %d


assistant: ```c
int main() {
  FILE *fin = fopen("friday.in", "r");
  FILE *fout = fopen("friday.out", "w");
  int days_in_month[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
  int res[7] = {0};
  int year = 1900, month = 1, day = 1;
  int n, end_year;
  int which_day = 1;
  fscanf(fin, "%d", &n);
  end_year = 1900 + n - 1;
  while (year <= end_year) {
    if (day == 13)
      res[which_day]++;
    if (year % 400 == 0 || (year % 100 != 0 && year % 4 == 0))
      days_in_month[2] = 29;
    else
      days_in_month[2] = 28;
    if (day < days_in_month[month])
      day++;
    else {
      day = 1;
      if (month < 12)
        month++;
      else {
        month = 1;
        year++;
      }
    }
    which_day++;
    which_day %= 7;
  }
  fprintf(fout, "%d %d %d %d %d %d %d\n", res[6], res[0], res[1], res[2], res[3], res[4], res[5]);
  fclose(fin);
  fclose(fout);
  return 0;
}
```