user: 请从给定的汇编指令推导出C源代码:

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x78,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x68(%rsp)
  xor    %eax,%eax
  movl   $0x1f,0x30(%rsp)
  movl   $0x1f,0x38(%rsp)
  movl   $0x1e,0x3c(%rsp)
  movl   $0x1f,0x40(%rsp)
  movl   $0x1e,0x44(%rsp)
  movl   $0x1f,0x48(%rsp)
  movl   $0x1f,0x4c(%rsp)
  movl   $0x1e,0x50(%rsp)
  movl   $0x1f,0x54(%rsp)
  movl   $0x1e,0x58(%rsp)
  movl   $0x1f,0x5c(%rsp)
  lea    D29(%rip),%rsi
  lea    D79(%rip),%rdi
  call   <fopen@plt>
  mov    %rax,%rbp
  lea    D66(%rip),%rsi
  lea    D19(%rip),%rdi
  call   <fopen@plt>
  mov    %rax,%rbx
  lea    0xc(%rsp),%rdx
  lea    D74(%rip),%rsi
  mov    %rbp,%rdi
  call   <fscanf@plt>
  movl   $0x0,0x10(%rsp)
  movl   $0x0,0x14(%rsp)
  movl   $0x0,0x18(%rsp)
  movl   $0x0,0x1c(%rsp)
  movl   $0x0,0x20(%rsp)
  movl   $0x0,0x24(%rsp)
  movl   $0x0,0x28(%rsp)
  mov    0xc(%rsp),%eax
  lea    0x76b(%rax),%r8d
  cmp    $0x76b,%r8d
  jle    L94
  mov    $0x76c,%edx
  mov    $0x0,%edi
  mov    $0x1,%esi
  mov    $0x0,%ecx
  mov    $0x0,%r9d
  jmp    L2
L47:
  mov    %r10d,0x34(%rsp)
  movslq %edi,%rax
  cmp    %esi,0x30(%rsp,%rax,4)
  je     L138
  add    $0x1,%esi
  cmp    $0xd,%esi
  jne    L52
  movslq %ecx,%rax
  addl   $0x1,0x10(%rsp,%rax,4)
L52:
  add    $0x1,%ecx
  cmp    %r8d,%edx
  jg     L94
  cmp    $0x7,%ecx
  cmove  %r9d,%ecx
L2:
  movslq %edx,%rax
  imul   $0x51eb851f,%rax,%rax
  sar    $0x27,%rax
  mov    %edx,%r10d
  sar    $0x1f,%r10d
  sub    %r10d,%eax
  imul   $0x190,%eax,%eax
  mov    $0x1d,%r10d
  cmp    %eax,%edx
  je     L47
  movslq %edx,%rax
  imul   $0x51eb851f,%rax,%rax
  sar    $0x25,%rax
  mov    %edx,%r10d
  sar    $0x1f,%r10d
  sub    %r10d,%eax
  imul   $0x64,%eax,%eax
  mov    $0x1c,%r10d
  cmp    %eax,%edx
  je     L47
  mov    %edx,%r10d
  and    $0x3,%r10d
  cmp    $0x1,%r10d
  mov    $0x1c,%r10d
  adc    $0x0,%r10d
  jmp    L47
L138:
  add    $0x1,%edi
  cmp    $0xc,%edi
  je     L63
L3:
  mov    $0x1,%esi
  jmp    L52
L63:
  add    $0x1,%edx
  mov    $0x0,%edi
  jmp    L3
L94:
  lea    0x10(%rsp),%r12
  lea    0x1c(%rsp),%r14
  mov    %r12,%r13
  lea    D16(%rip),%r15
L62:
  mov    0x10(%r13),%edx
  mov    %r15,%rsi
  mov    %rbx,%rdi
  call   <fprintf@plt>
  add    $0x4,%r13
  cmp    %r13,%r14
  jne    L62
  lea    D16(%rip),%r13
L20:
  mov    (%r12),%edx
  mov    %r13,%rsi
  mov    %rbx,%rdi
  call   <fprintf@plt>
  add    $0x4,%r12
  cmp    %r12,%r14
  jne    L20
  mov    0x1c(%rsp),%edx
  lea    D7(%rip),%rsi
  mov    %rbx,%rdi
  call   <fprintf@plt>
  mov    %rbp,%rdi
  call   <fclose@plt>
  mov    %rbx,%rdi
  call   <fclose@plt>
  mov    0x68(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L51
  mov    $0x0,%eax
  add    $0x78,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L51:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: tag: D29
data_type: string
name: retrieve_data
arguments: tag: D79
data_type: string
name: retrieve_data
arguments: tag: D66
data_type: string
name: retrieve_data
arguments: tag: D19
data_type: string
name: retrieve_data
arguments: tag: D74
data_type: string
name: retrieve_data
arguments: tag: D16
data_type: string
name: retrieve_data
arguments: tag: D7
data_type: string

tool: D29: r

tool: D79: friday.in

tool: D66: w

tool: D19: friday.out

tool: D74: %d

tool: D16: %d 

tool: D7: %d


assistant: ```c
int main(void) {
  int d = 0, date = 1, month = 0, year = 1900, np, i;
  int array[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
  int final[7];
  FILE *fin, *fout;
  fin = fopen("friday.in", "r");
  fout = fopen("friday.out", "w");
  fscanf(fin, "%d", &np);
  for (i = 0; i < 7; i++)
    final[i] = 0;
  while (year < 1900 + np) {
    if (d == 7)
      d = 0;
    if (year % 400 == 0 || (year % 100 != 0 && year % 4 == 0)) {
      array[1] = 29;
    } else {
      array[1] = 28;
    }
    if (date == array[month]) {
      date = 1;
      month++;
      if (month == 12) {
        month = 0;
        year++;
      }
    } else {
      date++;
    }
    if (date == 13) {
      final[d] += 1;
    }
    d++;
  }
  for (i = 4; i < 7; i++) {
    fprintf(fout, "%d ", final[i]);
  }
  for (i = 0; i < 3; i++) {
    fprintf(fout, "%d ", final[i]);
  }
  fprintf(fout, "%d\n", final[3]);
  fclose(fin);
  fclose(fout);
}
```