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

```asm
<prusage>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x48,%rsp
  mov    %rdi,%r12
  mov    %rsi,%rbx
  mov    %rdx,-0x58(%rbp)
  mov    %rcx,-0x60(%rbp)
  mov    %r8,-0x68(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  mov    0x48(%rbx),%eax
  mov    0x48(%r12),%edx
  sub    %edx,%eax
  imul   $0x64,%eax,%ecx
  mov    0x4c(%rbx),%eax
  mov    0x4c(%r12),%edx
  sub    %edx,%eax
  movslq %eax,%rdx
  imul   $0x68db8bad,%rdx,%rdx
  shr    $0x20,%rdx
  sar    $0xc,%edx
  sar    $0x1f,%eax
  mov    %eax,%esi
  mov    %edx,%eax
  sub    %esi,%eax
  add    %eax,%ecx
  mov    0x40(%rbx),%eax
  mov    0x40(%r12),%edx
  sub    %edx,%eax
  imul   $0x64,%eax,%eax
  add    %eax,%ecx
  mov    0x44(%rbx),%eax
  mov    0x44(%r12),%edx
  sub    %edx,%eax
  movslq %eax,%rdx
  imul   $0x68db8bad,%rdx,%rdx
  shr    $0x20,%rdx
  sar    $0xc,%edx
  sar    $0x1f,%eax
  mov    %eax,%esi
  mov    %edx,%eax
  sub    %esi,%eax
  lea    (%rcx,%rax,1),%r14d
  mov    -0x58(%rbp),%rax
  mov    (%rax),%edx
  mov    -0x60(%rbp),%rax
  mov    (%rax),%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  imul   $0x64,%eax,%ecx
  mov    -0x58(%rbp),%rax
  mov    0x4(%rax),%edx
  mov    -0x60(%rbp),%rax
  mov    0x4(%rax),%esi
  mov    %edx,%eax
  sub    %esi,%eax
  movslq %eax,%rdx
  imul   $0x68db8bad,%rdx,%rdx
  shr    $0x20,%rdx
  sar    $0xc,%edx
  sar    $0x1f,%eax
  mov    %eax,%esi
  mov    %edx,%eax
  sub    %esi,%eax
  add    %ecx,%eax
  mov    %eax,-0x44(%rbp)
  lea    D16(%rip),%r13
  jmp    L377
L233:
  movzbl 0x0(%r13),%eax
  cmp    $0x25,%al
  je     L140
  mov    -0x68(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x68(%rbp)
  movzbl 0x0(%r13),%edx
  mov    %dl,(%rax)
  jmp    L330
L140:
  lea    0x1(%r13),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L330
  add    $0x1,%r13
  movzbl 0x0(%r13),%eax
  movsbl %al,%eax
  sub    $0x43,%eax
  cmp    $0x15,%eax
  ja     L330
  mov    %eax,%eax
  lea    0x0(,%rax,4),%rdx
  lea    D76(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  cltq
  lea    D76(%rip),%rdx
  add    %rdx,%rax
  notrack jmp *%rax
  lea    0x48(%r12),%rdx
  lea    0x48(%rbx),%rcx
  lea    -0x40(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <tvsub@plt>
  mov    -0x3c(%rbp),%eax
  movslq %eax,%rdx
  imul   $0x14f8b589,%rdx,%rdx
  shr    $0x20,%rdx
  sar    $0xd,%edx
  sar    $0x1f,%eax
  mov    %edx,%ecx
  sub    %eax,%ecx
  mov    -0x40(%rbp),%edx
  mov    -0x68(%rbp),%rax
  lea    D65(%rip),%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  jmp    L61
L188:
  addq   $0x1,-0x68(%rbp)
L61:
  mov    -0x68(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L188
  jmp    L330
  lea    0x40(%r12),%rdx
  lea    0x40(%rbx),%rcx
  lea    -0x40(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <tvsub@plt>
  mov    -0x3c(%rbp),%eax
  movslq %eax,%rdx
  imul   $0x14f8b589,%rdx,%rdx
  shr    $0x20,%rdx
  sar    $0xd,%edx
  sar    $0x1f,%eax
  mov    %edx,%ecx
  sub    %eax,%ecx
  mov    -0x40(%rbp),%edx
  mov    -0x68(%rbp),%rax
  lea    D65(%rip),%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  jmp    L488
L68:
  addq   $0x1,-0x68(%rbp)
L488:
  mov    -0x68(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L68
  jmp    L330
  mov    -0x44(%rbp),%eax
  movslq %eax,%rdx
  imul   $0x51eb851f,%rdx,%rdx
  shr    $0x20,%rdx
  sar    $0x5,%edx
  sar    $0x1f,%eax
  sub    %eax,%edx
  mov    -0x68(%rbp),%rax
  mov    %rax,%rsi
  mov    %edx,%edi
  call   <psecs@plt>
  jmp    L362
L351:
  addq   $0x1,-0x68(%rbp)
L362:
  mov    -0x68(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L351
  jmp    L330
  imul   $0x64,%r14d,%eax
  cmpl   $0x0,-0x44(%rbp)
  je     L234
  mov    -0x44(%rbp),%edi
  jmp    L359
L234:
  mov    $0x1,%edi
L359:
  cltd
  idiv   %edi
  mov    %eax,%edx
  mov    -0x68(%rbp),%rax
  lea    D39(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  jmp    L292
L237:
  addq   $0x1,-0x68(%rbp)
L292:
  mov    -0x68(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L237
  jmp    L330
  mov    (%rbx),%eax
  mov    (%r12),%edx
  sub    %edx,%eax
  mov    %eax,%r15d
  mov    -0x68(%rbp),%rax
  mov    %r15d,%edx
  lea    D140(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  jmp    L109
L128:
  addq   $0x1,-0x68(%rbp)
L109:
  mov    -0x68(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L128
  jmp    L330
  test   %r14d,%r14d
  je     L86
  mov    0x4(%rbx),%eax
  mov    0x4(%r12),%edx
  sub    %edx,%eax
  cltd
  idiv   %r14d
  mov    %eax,%edx
  jmp    L164
L86:
  mov    $0x0,%edx
L164:
  mov    -0x68(%rbp),%rax
  lea    D27(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  jmp    L530
L369:
  addq   $0x1,-0x68(%rbp)
L530:
  mov    -0x68(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L369
  jmp    L330
  test   %r14d,%r14d
  je     L27
  mov    0x8(%rbx),%edx
  mov    0xc(%rbx),%eax
  add    %edx,%eax
  mov    0x8(%r12),%ecx
  mov    0xc(%r12),%edx
  add    %ecx,%edx
  sub    %edx,%eax
  cltd
  idiv   %r14d
  mov    %eax,%edx
  jmp    L74
L27:
  mov    $0x0,%edx
L74:
  mov    -0x68(%rbp),%rax
  lea    D27(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  jmp    L269
L76:
  addq   $0x1,-0x68(%rbp)
L269:
  mov    -0x68(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L76
  jmp    L330
  test   %r14d,%r14d
  je     L392
  mov    0x4(%rbx),%edx
  mov    0xc(%rbx),%eax
  add    %eax,%edx
  mov    0x8(%rbx),%eax
  add    %edx,%eax
  mov    0x4(%r12),%ecx
  mov    0x8(%r12),%edx
  add    %edx,%ecx
  mov    0xc(%r12),%edx
  add    %ecx,%edx
  sub    %edx,%eax
  cltd
  idiv   %r14d
  mov    %eax,%edx
  jmp    L389
L392:
  mov    $0x0,%edx
L389:
  mov    -0x68(%rbp),%rax
  lea    D27(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  jmp    L513
L264:
  addq   $0x1,-0x68(%rbp)
L513:
  mov    -0x68(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L264
  jmp    L330
  mov    0x10(%rbx),%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  mov    %eax,%edx
  mov    -0x68(%rbp),%rax
  lea    D27(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  jmp    L33
L148:
  addq   $0x1,-0x68(%rbp)
L33:
  mov    -0x68(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L148
  jmp    L330
  mov    0x38(%rbx),%rax
  mov    %eax,%edx
  mov    0x38(%r12),%rax
  mov    %eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  mov    %eax,%edx
  mov    -0x68(%rbp),%rax
  lea    D27(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  jmp    L419
L235:
  addq   $0x1,-0x68(%rbp)
L419:
  mov    -0x68(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L235
  jmp    L330
  mov    0x30(%rbx),%rax
  mov    %eax,%edx
  mov    0x30(%r12),%rax
  mov    %eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  mov    %eax,%edx
  mov    -0x68(%rbp),%rax
  lea    D27(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  jmp    L238
L474:
  addq   $0x1,-0x68(%rbp)
L238:
  mov    -0x68(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L474
  jmp    L330
  mov    0x28(%rbx),%rax
  mov    %eax,%edx
  mov    0x28(%r12),%rax
  mov    %eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  mov    %eax,%edx
  mov    -0x68(%rbp),%rax
  lea    D27(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  jmp    L81
L17:
  addq   $0x1,-0x68(%rbp)
L81:
  mov    -0x68(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L17
  jmp    L330
  mov    0x20(%rbx),%rax
  mov    %eax,%edx
  mov    0x20(%r12),%rax
  mov    %eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  mov    %eax,%edx
  mov    -0x68(%rbp),%rax
  lea    D27(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  jmp    L337
L59:
  addq   $0x1,-0x68(%rbp)
L337:
  mov    -0x68(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L59
  jmp    L330
  mov    0x18(%rbx),%eax
  mov    0x18(%r12),%edx
  sub    %edx,%eax
  mov    %eax,%ecx
  mov    0x14(%rbx),%eax
  mov    0x14(%r12),%esi
  sub    %esi,%eax
  mov    %eax,%edx
  mov    -0x68(%rbp),%rax
  lea    D55(%rip),%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  jmp    L146
L206:
  addq   $0x1,-0x68(%rbp)
L146:
  mov    -0x68(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L206
  nop
L330:
  add    $0x1,%r13
L377:
  movzbl 0x0(%r13),%eax
  test   %al,%al
  jne    L233
  mov    -0x68(%rbp),%rax
  movb   $0x0,(%rax)
  nop
  mov    -0x38(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L70
  call   <__stack_chk_fail@plt>
L70:
  add    $0x48,%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
```

tool_calls: name: parse_data
arguments: data_label: D16
datatype: string
name: parse_data
arguments: data_label: D65
datatype: string
name: parse_data
arguments: data_label: D39
datatype: string
name: parse_data
arguments: data_label: D140
datatype: string
name: parse_data
arguments: data_label: D27
datatype: string
name: parse_data
arguments: data_label: D55
datatype: string

tool: D16: %Uuser %Ssys %Ereal %P %Xi+%Dd %Mmaxrss %F+%Rpf %Ccsw

tool: D65: %ld.%01ld

tool: D39: %d%%

tool: D140: %d

tool: D27: %ld

tool: D55: %ld+%ld

assistant: ```c
void prusage(register struct rusage *r0, register struct rusage *r1, struct timeval *e, struct timeval *b, char *outp) {
  struct timeval tdiff;
  register time_t t;
  register char *cp;
  register int i;
  int ms;
  t = (r1->ru_utime.tv_sec - r0->ru_utime.tv_sec) * 100 + (r1->ru_utime.tv_usec - r0->ru_utime.tv_usec) / 10000 + (r1->ru_stime.tv_sec - r0->ru_stime.tv_sec) * 100 + (r1->ru_stime.tv_usec - r0->ru_stime.tv_usec) / 10000;
  ms = (e->tv_sec - b->tv_sec) * 100 + (e->tv_usec - b->tv_usec) / 10000;
  cp = "%Uuser %Ssys %Ereal %P %Xi+%Dd %Mmaxrss %F+%Rpf %Ccsw";
  for (; *cp; cp++) {
    if (*cp != '%')
      *outp++ = *cp;
    else if (cp[1])
      switch (*++cp) {
      case 'U':
        tvsub(&tdiff, &r1->ru_utime, &r0->ru_utime);
        sprintf(outp, "%ld.%01ld", tdiff.tv_sec, tdiff.tv_usec / 100000);
        {
          while (*outp)
            outp++;
        };
        break;
      case 'S':
        tvsub(&tdiff, &r1->ru_stime, &r0->ru_stime);
        sprintf(outp, "%ld.%01ld", tdiff.tv_sec, tdiff.tv_usec / 100000);
        {
          while (*outp)
            outp++;
        };
        break;
      case 'E':
        psecs(ms / 100, outp);
        {
          while (*outp)
            outp++;
        };
        break;
      case 'P':
        sprintf(outp, "%d%%", (int)(t * 100 / ((ms ? ms : 1))));
        {
          while (*outp)
            outp++;
        };
        break;
      case 'W':
        i = r1->ru_nswap - r0->ru_nswap;
        sprintf(outp, "%d", i);
        {
          while (*outp)
            outp++;
        };
        break;
      case 'X':
        sprintf(outp, "%ld", t == 0 ? 0 : (r1->ru_ixrss - r0->ru_ixrss) / t);
        {
          while (*outp)
            outp++;
        };
        break;
      case 'D':
        sprintf(outp, "%ld", t == 0 ? 0 : (r1->ru_idrss + r1->ru_isrss - (r0->ru_idrss + r0->ru_isrss)) / t);
        {
          while (*outp)
            outp++;
        };
        break;
      case 'K':
        sprintf(outp, "%ld", t == 0 ? 0 : ((r1->ru_ixrss + r1->ru_isrss + r1->ru_idrss) - (r0->ru_ixrss + r0->ru_idrss + r0->ru_isrss)) / t);
        {
          while (*outp)
            outp++;
        };
        break;
      case 'M':
        sprintf(outp, "%ld", r1->ru_maxrss / 2);
        {
          while (*outp)
            outp++;
        };
        break;
      case 'F':
        sprintf(outp, "%ld", r1->ru_majflt - r0->ru_majflt);
        {
          while (*outp)
            outp++;
        };
        break;
      case 'R':
        sprintf(outp, "%ld", r1->ru_minflt - r0->ru_minflt);
        {
          while (*outp)
            outp++;
        };
        break;
      case 'I':
        sprintf(outp, "%ld", r1->ru_inblock - r0->ru_inblock);
        {
          while (*outp)
            outp++;
        };
        break;
      case 'O':
        sprintf(outp, "%ld", r1->ru_oublock - r0->ru_oublock);
        {
          while (*outp)
            outp++;
        };
        break;
      case 'C':
        sprintf(outp, "%ld+%ld", r1->ru_nvcsw - r0->ru_nvcsw, r1->ru_nivcsw - r0->ru_nivcsw);
        {
          while (*outp)
            outp++;
        };
        break;
      }
  }
  *outp = '\0';
}
```