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

```asm
<cfanalyses>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x70,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %esi,-0x3c(%rbp)
  mov    %edx,-0x40(%rbp)
  mov    %rcx,-0x48(%rbp)
  mov    %r8,-0x50(%rbp)
  mov    %r9,-0x58(%rbp)
  mov    0x10(%rbp),%rax
  mov    %rax,-0x60(%rbp)
  mov    0x18(%rbp),%rax
  mov    %rax,-0x68(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x1,-0x18(%rbp)
  mov    -0x48(%rbp),%rax
  movl   $0x0,(%rax)
  mov    -0x50(%rbp),%rax
  movl   $0x0,(%rax)
  mov    -0x58(%rbp),%rax
  pxor   %xmm0,%xmm0
  movss  %xmm0,(%rax)
  mov    -0x60(%rbp),%rax
  pxor   %xmm0,%xmm0
  movss  %xmm0,(%rax)
  mov    -0x68(%rbp),%rax
  movl   $0x0,(%rax)
  mov    -0x38(%rbp),%rax
  lea    D77(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <fopen@plt>
  mov    %rax,-0x10(%rbp)
  cmpq   $0x0,-0x10(%rbp)
  je     L154
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <getactime@plt>
  movd   %xmm0,%eax
  mov    %eax,-0x20(%rbp)
  jmp    L140
L1:
  mov    -0x48(%rbp),%rax
  mov    (%rax),%eax
  lea    0x1(%rax),%edx
  mov    -0x48(%rbp),%rax
  mov    %edx,(%rax)
  mov    -0x60(%rbp),%rax
  movss  (%rax),%xmm1
  movss  -0x20(%rbp),%xmm0
  addss  %xmm1,%xmm0
  mov    -0x60(%rbp),%rax
  movss  %xmm0,(%rax)
  movss  -0x20(%rbp),%xmm0
  cvtss2sd %xmm0,%xmm0
  comisd D79(%rip),%xmm0
  jb     L93
  mov    -0x50(%rbp),%rax
  mov    (%rax),%eax
  lea    0x1(%rax),%edx
  mov    -0x50(%rbp),%rax
  mov    %edx,(%rax)
L93:
  movss  -0x20(%rbp),%xmm0
  pxor   %xmm1,%xmm1
  cvtss2sd %xmm0,%xmm1
  movsd  D17(%rip),%xmm0
  comisd %xmm1,%xmm0
  jbe    L14
  movl   $0x0,-0x18(%rbp)
L14:
  mov    -0x20(%rbp),%eax
  movd   %eax,%xmm0
  call   <ave2day@plt>
  mov    %eax,%edx
  mov    -0x24(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <newdate@plt>
  mov    %eax,-0x14(%rbp)
  movl   $0x0,-0x1c(%rbp)
  mov    -0x3c(%rbp),%eax
  sub    -0x14(%rbp),%eax
  test   %eax,%eax
  js     L81
  mov    -0x14(%rbp),%edx
  mov    -0x3c(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <diffdays@plt>
  mov    %eax,-0x1c(%rbp)
  mov    -0x68(%rbp),%rax
  mov    (%rax),%eax
  lea    0x1(%rax),%edx
  mov    -0x68(%rbp),%rax
  mov    %edx,(%rax)
L81:
  mov    -0x20(%rbp),%eax
  mov    -0x1c(%rbp),%edx
  mov    %edx,%edi
  movd   %eax,%xmm0
  call   <score@plt>
  mov    %rax,%rdx
  mov    -0x58(%rbp),%rax
  movss  (%rax),%xmm1
  pxor   %xmm0,%xmm0
  cvtsi2ss %rdx,%xmm0
  addss  %xmm1,%xmm0
  mov    -0x58(%rbp),%rax
  movss  %xmm0,(%rax)
L140:
  lea    -0x20(%rbp),%rsi
  lea    -0x24(%rbp),%rcx
  lea    -0x28(%rbp),%rdx
  mov    -0x10(%rbp),%rax
  mov    %rsi,%r8
  lea    D16(%rip),%rsi
  mov    %rax,%rdi
  call   <fscanf@plt>
  cmp    $0x3,%eax
  je     L1
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <fclose@plt>
  mov    -0x58(%rbp),%rax
  movss  (%rax),%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2ssl -0x40(%rbp),%xmm1
  divss  %xmm1,%xmm0
  mov    -0x58(%rbp),%rax
  movss  %xmm0,(%rax)
  mov    -0x58(%rbp),%rax
  movss  (%rax),%xmm0
  cvtss2sd %xmm0,%xmm0
  comisd D17(%rip),%xmm0
  jbe    L5
  cmpl   $0x0,-0x18(%rbp)
  je     L5
  mov    -0x58(%rbp),%rax
  movss  D50(%rip),%xmm0
  movss  %xmm0,(%rax)
L5:
  mov    -0x58(%rbp),%rax
  movss  (%rax),%xmm1
  movss  D21(%rip),%xmm0
  mulss  %xmm1,%xmm0
  mov    -0x58(%rbp),%rax
  movss  %xmm0,(%rax)
  mov    -0x48(%rbp),%rax
  mov    (%rax),%eax
  test   %eax,%eax
  jne    L66
  mov    -0x60(%rbp),%rax
  pxor   %xmm0,%xmm0
  movss  %xmm0,(%rax)
  jmp    L22
L66:
  mov    -0x60(%rbp),%rax
  movss  (%rax),%xmm0
  mov    -0x48(%rbp),%rax
  mov    (%rax),%eax
  pxor   %xmm1,%xmm1
  cvtsi2ss %eax,%xmm1
  divss  %xmm1,%xmm0
  mov    -0x60(%rbp),%rax
  movss  %xmm0,(%rax)
L22:
  mov    -0x60(%rbp),%rax
  movss  (%rax),%xmm0
  cvtss2sd %xmm0,%xmm0
  comisd D17(%rip),%xmm0
  ja     L11
  jmp    L62
L11:
  cmpl   $0x0,-0x18(%rbp)
  je     L62
  mov    -0x60(%rbp),%rax
  movss  D50(%rip),%xmm0
  movss  %xmm0,(%rax)
  jmp    L62
L154:
  nop
  jmp    L124
L62:
  nop
L124:
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L27
  call   <__stack_chk_fail@plt>
L27:
  leave
  ret
```

tool_calls: name: read_data
arguments: tag: D77
type: string
name: read_data
arguments: tag: D79
type: f64[2]
name: read_data
arguments: tag: D17
type: f64[2]
name: read_data
arguments: tag: D16
type: string
name: read_data
arguments: tag: D50
type: f32
name: read_data
arguments: tag: D21
type: f32

tool: D77: r

tool: {"D79": [3.9,4.92]}

tool: {"D17": [4.92,134217760.3125]}

tool: D16: %d %d %f


tool: D50: 5

tool: D21: 20

assistant: ```c
void cfanalyses(char *sumfile, int today, int qtd, int *view, int *learn, float *pct, float *addscore, int *ncardl) {
  int card, date, revd;
  int late;
  float ave;
  FILE *fp;
  int alla = 1;
  *view = 0;
  *learn = 0;
  *pct = 0.0;
  *addscore = 0.0;
  *ncardl = 0;
  if (!(fp = fopen(sumfile, "r")))
    return;
  ave = getactime(fp);
  while (3 == fscanf(fp, "%d %d %f\n", &card, &date, &ave)) {
    (*view)++;
    *addscore += ave;
    if (ave >= 3.90)
      (*learn)++;
    if (ave < 4.92)
      alla = 0;
    revd = newdate(date, ave2day(ave));
    late = 0;
    if (today - revd >= 0) {
      late = diffdays(today, revd);
      (*ncardl)++;
    }
    *pct += score(ave, late);
  }
  fclose(fp);
  *pct /= ((float)qtd);
  if (*pct > 4.92 && alla)
    *pct = 5.0;
  *pct *= 20.0;
  if (*view == 0)
    *addscore = 0.0;
  else
    *addscore /= ((float)*view);
  if (*addscore > 4.92 && alla)
    *addscore = 5.0;
  return;
}
```