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    $0x28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  mov    0x8(%rsi),%rdi
  test   %rdi,%rdi
  je     L13
  mov    %rsi,%rbx
  call   <atoi@plt>
  mov    %eax,0x4(%rsp)
  mov    0x10(%rbx),%rdi
  test   %rdi,%rdi
  je     L24
  call   <atoi@plt>
  mov    %eax,%r14d
  mov    $0x4,%esi
  mov    %eax,%edi
  call   <calloc@plt>
  mov    %rax,%r13
  mov    %rax,0x8(%rsp)
  test   %rax,%rax
  je     L82
  mov    %rax,%rbx
  mov    $0x0,%ebp
  lea    D68(%rip),%r15
  test   %r14d,%r14d
  jle    L92
L56:
  mov    %r15,%rsi
  lea    D59(%rip),%rdi
  call   <fopen@plt>
  mov    %rax,%r12
  lea    0x14(%rsp),%rdi
  call   <timer_start@plt>
  mov    %r12,%rsi
  mov    0x4(%rsp),%edi
  call   <do_task@plt>
  mov    0x14(%rsp),%edi
  call   <timer_end@plt>
  pxor   %xmm0,%xmm0
  cvtsi2ss %rax,%xmm0
  divss  D24(%rip),%xmm0
  movss  %xmm0,0x0(%r13)
  add    $0x1,%ebp
  cvtss2sd %xmm0,%xmm0
  mov    %ebp,%esi
  lea    D3(%rip),%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  add    $0x4,%r13
  cmp    %r14d,%ebp
  jne    L56
  lea    -0x1(%r14),%eax
  mov    0x8(%rsp),%rcx
  lea    0x4(%rcx,%rax,4),%rax
L75:
  movss  (%rsp),%xmm2
  addss  (%rbx),%xmm2
  movss  %xmm2,(%rsp)
  add    $0x4,%rbx
  cmp    %rax,%rbx
  jne    L75
L92:
  pxor   %xmm1,%xmm1
  cvtsi2ss %r14d,%xmm1
  movss  (%rsp),%xmm0
  divss  %xmm1,%xmm0
  cvtss2sd %xmm0,%xmm0
  lea    D71(%rip),%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  mov    $0x0,%eax
L63:
  mov    0x18(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L48
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L13:
  lea    D57(%rip),%rdi
  call   <puts@plt>
  mov    $0xffffffff,%eax
  jmp    L63
L24:
  lea    D10(%rip),%rdi
  call   <puts@plt>
  mov    $0xffffffff,%eax
  jmp    L63
L82:
  lea    D61(%rip),%rdi
  call   <puts@plt>
  mov    $0xffffffff,%eax
  jmp    L63
L48:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_tag: D68
data_type: string
name: read_data
arguments: data_tag: D59
data_type: string
name: read_data
arguments: data_tag: D24
data_type: byte[4]
name: read_data
arguments: data_tag: D3
data_type: string
name: read_data
arguments: data_tag: D71
data_type: string
name: read_data
arguments: data_tag: D57
data_type: string
name: read_data
arguments: data_tag: D10
data_type: string
name: read_data
arguments: data_tag: D61
data_type: string

tool: D68: w

tool: D59: hr_test.txt

tool: {"D24": [0x00,0x24,0x74,0x49]}

tool: D3: (%d) Time taken in nano grade = %.3f ms


tool: D71: -> Average: %.3f ms


tool: D57: lack of do count!

tool: D10: lack of repeat count!

tool: D61: No memory!

assistant: ```c
int main(int argc, char *argv[]) {
  struct timespec vartime;
  long timeElapsed = 0;
  float *result = NULL, total;
  int maxCnt = 0, repeatCnt = 0, doCnt = 0;
  FILE *record_fp = NULL;
  if (argv[1])
    maxCnt = atoi(argv[1]);
  else {
    printf("lack of do count!\n");
    return -1;
  }
  if (argv[2])
    repeatCnt = atoi(argv[2]);
  else {
    printf("lack of repeat count!\n");
    return -1;
  }
  if (!(result = (float *)calloc(repeatCnt, sizeof(float)))) {
    printf("No memory!\n");
    return -1;
  }
  for (doCnt = 0; doCnt < repeatCnt; doCnt++) {
    record_fp = fopen("hr_test"
                      ".txt",
                      "w");
    timer_start(&vartime);
    do_task(maxCnt, record_fp);
    timeElapsed = timer_end(vartime);
    result[doCnt] = (float)((float)timeElapsed / 1000000L);
    printf("(%d) Time taken in nano grade = %.3f ms\n", doCnt + 1, result[doCnt]);
  }
  for (doCnt = 0; doCnt < repeatCnt; doCnt++)
    total += result[doCnt];
  total /= repeatCnt;
  printf("-> Average: %.3f ms\n", total);
  return 0;
}
```