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

```asm
<RBR_dist_stats>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x58,%rsp
  movl   $0x0,(%r8)
  mov    %rdi,0x30(%rsp)
  mov    0x90(%rsp),%r14d
  mov    %esi,0x38(%rsp)
  mov    0x98(%rsp),%ebp
  mov    %rdx,0x40(%rsp)
  mov    %rcx,0x48(%rsp)
  movl   $0x42c80000,(%r9)
  test   %esi,%esi
  jle    L29
  lea    -0x1(%rsi),%eax
  pxor   %xmm6,%xmm6
  mov    %r8,%r15
  mov    %r9,%r12
  mov    %eax,0x3c(%rsp)
  lea    0x8(%rdi),%r13
  mov    %rax,0x28(%rsp)
  movq   $0x0,0x18(%rsp)
  movl   $0x0,0x20(%rsp)
  movss  %xmm6,0x8(%rsp)
  movss  %xmm6,0x4(%rsp)
  nopl   0x0(%rax)
L78:
  mov    0x18(%rsp),%rax
  mov    0x28(%rsp),%rsi
  mov    %eax,0x24(%rsp)
  cmp    %rsi,%rax
  je     L79
  mov    0x38(%rsp),%eax
  mov    0x18(%rsp),%rdx
  mov    %r13,%rbx
  mov    0x30(%rsp),%rcx
  sub    $0x2,%eax
  sub    %edx,%eax
  add    %rdx,%rax
  lea    0x10(%rcx,%rax,8),%rax
  mov    %rax,0x10(%rsp)
  jmp    L46
  nopl   0x0(%rax)
L92:
  pxor   %xmm2,%xmm2
  movss  D4(%rip),%xmm0
  movss  %xmm1,0xc(%rsp)
  cvtsi2ss %ebp,%xmm2
  divss  %xmm2,%xmm0
  cvttss2si %xmm0,%edi
  pxor   %xmm0,%xmm0
  cvtss2sd %xmm1,%xmm0
  call   <pow@plt>
  movss  0xc(%rsp),%xmm1
L33:
  movss  0x4(%rsp),%xmm3
  addss  0x8(%rsp),%xmm1
  comiss (%r15),%xmm0
  addss  %xmm0,%xmm3
  movss  %xmm1,0x8(%rsp)
  movss  %xmm3,0x4(%rsp)
  jbe    L67
  movss  %xmm0,(%r15)
L67:
  movss  (%r12),%xmm1
  comiss %xmm0,%xmm1
  jbe    L85
  movss  %xmm0,(%r12)
L85:
  add    $0x8,%rbx
  cmp    %rbx,0x10(%rsp)
  je     L5
L46:
  mov    -0x8(%r13),%rdi
  mov    (%rbx),%rsi
  mov    %ebp,%ecx
  mov    %r14d,%edx
  call   <RBR_ipowdist@plt>
  movaps %xmm0,%xmm1
  cmp    $0x2,%ebp
  jne    L92
  movss  %xmm1,0xc(%rsp)
  cvtss2sd %xmm0,%xmm0
  call   <sqrt@plt>
  movss  0xc(%rsp),%xmm1
  jmp    L33
L5:
  mov    0x20(%rsp),%eax
  add    0x3c(%rsp),%eax
  add    $0x8,%r13
  sub    0x24(%rsp),%eax
  addq   $0x1,0x18(%rsp)
  mov    %eax,0x20(%rsp)
  jmp    L78
  nop
L79:
  movss  0x4(%rsp),%xmm5
  pxor   %xmm2,%xmm2
  cvtsi2ssl 0x20(%rsp),%xmm2
  movaps %xmm5,%xmm1
  mulss  %xmm5,%xmm1
L7:
  movss  0x4(%rsp),%xmm0
  divss  %xmm2,%xmm1
  mov    0x40(%rsp),%rax
  divss  %xmm2,%xmm0
  movss  %xmm0,(%rax)
  movss  0x8(%rsp),%xmm0
  subss  %xmm1,%xmm0
  divss  %xmm2,%xmm0
  cvtss2sd %xmm0,%xmm0
  call   <sqrt@plt>
  mov    0x48(%rsp),%rax
  movss  %xmm0,(%rax)
  add    $0x58,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L29:
  pxor   %xmm1,%xmm1
  movaps %xmm1,%xmm2
  movss  %xmm1,0x8(%rsp)
  movss  %xmm1,0x4(%rsp)
  jmp    L7
```

tool_calls: name: read_data
arguments: data_tag: D4
type: byte[4]

tool: {"D4": [0x00,0x00,0x80,0x3f]}

assistant: ```c
int RBR_dist_stats(int **coords, int ncoords, float *mean, float *sd, float *longest, float *shortest, int PRECISION, int DIST_POWER) {
  int i, j, k;
  int total;
  float sum, sumpow;
  float powdist, dist;
  sum = 0.0;
  sumpow = 0.0;
  (*longest) = 0.0;
  (*shortest) = 100.0;
  total = 0.0;
  for (j = 0; j < ncoords; ++j) {
    for (k = j + 1; k < ncoords; ++k) {
      total++;
      powdist = RBR_ipowdist(coords[j], coords[k], PRECISION, DIST_POWER);
      if (DIST_POWER == 2)
        dist = sqrt((double)powdist);
      else
        dist = pow((double)powdist, (1 / (float)DIST_POWER));
      sum += dist;
      sumpow += powdist;
      if (dist > (*longest))
        (*longest) = dist;
      if (dist < (*shortest))
        (*shortest) = dist;
    }
  }
  (*mean) = (sum / (float)total);
  (*sd) = sqrt((double)((sumpow - (sum * sum) / (float)total) / (float)total));
  return 0;
}
```