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

```asm
<display_stats>:
  endbr64
  push   %r14
  mov    %rcx,%r14
  push   %r13
  mov    %edi,%r13d
  xor    %edi,%edi
  push   %r12
  mov    %edx,%r12d
  push   %rbp
  push   %rbx
  mov    %esi,%ebx
  sub    $0x120,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x118(%rsp)
  xor    %eax,%eax
  call   <time@plt>
  mov    %r13d,%edi
  mov    %r14,%rsi
  mov    %eax,%ebp
  call   <calc_real_time@plt>
  test   %ebx,%ebx
  lea    0x3ff(%rbx),%eax
  mov    %ebx,%ecx
  cmovns %ebx,%eax
  sar    $0x1f,%ecx
  shr    $0x16,%ecx
  lea    (%rbx,%rcx,1),%edx
  mov    %eax,%r13d
  and    $0x3ff,%edx
  sar    $0xa,%r13d
  sub    %ecx,%edx
  cmp    %ebx,%edx
  je     L34
  sar    $0x1f,%eax
  shr    $0x16,%eax
  lea    0x0(%r13,%rax,1),%edx
  and    $0x3ff,%edx
  sub    %eax,%edx
  cmp    %r13d,%edx
  je     L29
  lea    0x10(%rsp),%r14
  cmp    $0xffffffff,%r13d
  je     L52
  test   %r13d,%r13d
  lea    0x3ff(%r13),%edx
  lea    D12(%rip),%rsi
  mov    %r14,%rdi
  cmovns %r13d,%edx
  movss  %xmm0,0xc(%rsp)
  sar    $0xa,%edx
  call   <sprintf@plt>
  movss  0xc(%rsp),%xmm0
L52:
  sub    %r12d,%ebp
  pxor   %xmm1,%xmm1
  pxor   %xmm2,%xmm2
  mov    %r14,%rsi
  cvtsi2ss %r13d,%xmm1
  lea    D35(%rip),%rdi
  cvtsi2ss %rbp,%xmm2
  divss  %xmm2,%xmm1
  call   <printf@plt>
  mov    0x118(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L6
  add    $0x120,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L34:
  lea    0x10(%rsp),%r14
  lea    D2(%rip),%rsi
  movss  %xmm0,0xc(%rsp)
  mov    %r14,%rdi
  call   <sprintf@plt>
  movss  0xc(%rsp),%xmm0
  jmp    L52
  nopw   0x0(%rax,%rax,1)
L29:
  lea    0x10(%rsp),%r14
  mov    %r13d,%edx
  lea    D37(%rip),%rsi
  movss  %xmm0,0xc(%rsp)
  mov    %r14,%rdi
  call   <sprintf@plt>
  movss  0xc(%rsp),%xmm0
  jmp    L52
L6:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: data_tag: D12
type_infered: string
name: retrieve_data
arguments: data_tag: D35
type_infered: string
name: retrieve_data
arguments: data_tag: D2
type_infered: string
name: retrieve_data
arguments: data_tag: D37
type_infered: string

tool: D12: %5i MB

tool: D35: Processed %.2f s - %s total - %.1f KB/s throughput

tool: D2: %5i b 

tool: D37: %5i KB

assistant: ```c
void display_stats(int sample_c, int bytecount, unsigned int start_time, struct wav_file_headers *wav_headers) {
  float wavtime;
  int total;
  char human[256];
  int orig_byte_count;
  unsigned int current_time;
  float kbps;
  current_time = time(NULL);
  wavtime = calc_real_time(sample_c, wav_headers);
  orig_byte_count = bytecount;
  if ((bytecount % 1024) == bytecount) {
    sprintf(human, "%5i b ", bytecount);
    bytecount = -1;
  } else {
    bytecount = total = bytecount / 1024;
  }
  if ((total % 1024) == bytecount) {
    sprintf(human, "%5i KB", total);
    bytecount = -1;
  } else {
    total = total / 1024;
  }
  if (bytecount != -1)
    sprintf(human, "%5i MB", total);
  kbps = (float)(orig_byte_count / 1024) / (float)(current_time - start_time);
  printf("\rProcessed %.2f s - %s total - %.1f KB/s throughput\r", wavtime, human, kbps);
}
```