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

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x138,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x128(%rsp)
  xor    %eax,%eax
  movl   $0x2,0x4(%rsp)
  lea    0x20(%rsp),%rbx
  lea    0x18(%rsp),%r15
L38:
  lea    D36(%rip),%rsi
  lea    D57(%rip),%rdi
  call   <fopen@plt>
  lea    0x1c(%rsp),%r14
  mov    %rax,%r13
  jmp    L7
  nopw   0x0(%rax,%rax,1)
L46:
  mov    %r15,%rdx
  lea    D31(%rip),%rsi
  mov    %rbx,%rdi
  call   <sscanf@plt>
  mov    %r14,%rdx
  mov    %rbx,%rdi
  add    0x18(%rsp),%r12d
  lea    D23(%rip),%rsi
  call   <sscanf@plt>
  add    0x1c(%rsp),%ebp
L7:
  mov    %r13,%rdx
  mov    $0x100,%esi
  mov    %rbx,%rdi
  call   <fgets@plt>
  test   %rax,%rax
  jne    L46
  mov    %r13,%rdi
  call   <fclose@plt>
  mov    $0x5,%edi
  call   <sleep@plt>
  cmpl   $0x1,0x4(%rsp)
  jne    L47
  mov    0x10(%rsp),%r13d
  lea    (%r12,%rbp,1),%eax
  mov    %r12d,%esi
  lea    D64(%rip),%rdi
  movq   $0x0,0x8(%rsp)
  sub    %eax,%r13d
  call   <printf@plt>
  mov    %ebp,%esi
  lea    D59(%rip),%rdi
  call   <printf@plt>
  mov    %r13d,%esi
  lea    D41(%rip),%rdi
  call   <printf@plt>
  mov    0x128(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L24
  add    $0x138,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L47:
  movl   $0x1,0x4(%rsp)
  jmp    L38
L24:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: data_label: D36
data_type: string
name: parse_data
arguments: data_label: D57
data_type: string
name: parse_data
arguments: data_label: D31
data_type: string
name: parse_data
arguments: data_label: D23
data_type: string
name: parse_data
arguments: data_label: D64
data_type: string
name: parse_data
arguments: data_label: D59
data_type: string
name: parse_data
arguments: data_label: D41
data_type: string

tool: D36: r

tool: D57: /proc/diskstats

tool: D31: %*[ ]%*d%*[ ]%*d%*[ ]%*s%*[ ]%d

tool: D23: %*[ ]%*d%*[ ]%*d%*[ ]%*s%*[ ]%*d%*[ ]%*d%*[ ]%*d%*[ ]%*d%*[ ]%d

tool: D64: 
The total number of disk reads was: %d 


tool: D59: The total number of disk writes was: %d 


tool: D41: The relative disk activity was: %d 


assistant: ```c
int main(void) {
  FILE *fp;
  char line[256];
  int disk_reads;
  int disk_reads_total;
  int disk_writes;
  int disk_writes_total;
  int count = 1;
  int disk_activity[2];
  int relative_activity = 0;
  while (count < 3) {
    fp = fopen("/proc/diskstats", "r");
    while (fgets(line, 256, fp)) {
      sscanf(line, "%*[ ]%*d%*[ ]%*d%*[ ]%*s%*[ ]%d", &disk_reads);
      disk_reads_total = disk_reads_total + disk_reads;
      sscanf(line, "%*[ ]%*d%*[ ]%*d%*[ ]%*s%*[ ]%*d%*[ ]%*d%*[ ]%*d%*[ ]%*d%*[ ]%d", &disk_writes);
      disk_writes_total = disk_writes_total + disk_writes;
    }
    disk_activity[count] = disk_reads_total + disk_writes_total;
    count++;
    fclose(fp);
    sleep(5);
  }
  relative_activity = disk_activity[2] - disk_activity[1];
  printf("\nThe total number of disk reads was: %d \n", disk_reads_total);
  printf("The total number of disk writes was: %d \n", disk_writes_total);
  printf("The relative disk activity was: %d \n", relative_activity);
}
```