user: Translate the below assembly code into C programming language:

```asm
<distestim>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  mov    %rdi,%r13
  push   %r12
  push   %rbx
  sub    $0x78,%rsp
  mov    %rsi,-0x70(%rbp)
  mov    %rdx,-0x80(%rbp)
  mov    %rcx,-0x98(%rbp)
  mov    %rsp,%rcx
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  movslq (%rsi),%rax
  mov    %rax,%rsi
  lea    0xf(,%rax,8),%rax
  mov    %rax,%rdi
  mov    %rax,%rdx
  and    $0xfffffffffffff000,%rdi
  and    $0xfffffffffffffff0,%rdx
  sub    %rdi,%rcx
  cmp    %rcx,%rsp
  je     L127
L78:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rcx,%rsp
  jne    L78
L127:
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  jne    L4
L259:
  mov    %rax,%rdx
  mov    %rsp,%rdi
  and    $0xfffffffffffff000,%rax
  mov    %rsp,%r15
  sub    %rax,%rdi
  and    $0xfffffffffffffff0,%rdx
  cmp    %rdi,%rsp
  je     L83
L13:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rdi,%rsp
  jne    L13
L83:
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  jne    L66
L44:
  mov    -0x80(%rbp),%rax
  pxor   %xmm7,%xmm7
  mov    %rsp,-0x68(%rbp)
  movsd  (%rax),%xmm1
  ucomisd %xmm7,%xmm1
  jp     L207
  jne    L207
  movsd  D26(%rip),%xmm0
  mov    %r13,%rdi
  call   <quantile@plt>
  mov    -0x80(%rbp),%rbx
  mov    -0x70(%rbp),%r14
  mov    %r13,%rdi
  mov    (%r14),%esi
  movsd  %xmm0,(%rbx)
  movsd  D22(%rip),%xmm0
  call   <quantile@plt>
  xor    %edi,%edi
  movapd %xmm0,%xmm1
  movsd  (%rbx),%xmm0
  subsd  %xmm1,%xmm0
  movsd  %xmm0,(%rbx)
  pxor   %xmm0,%xmm0
  cvtsi2sdl (%r14),%xmm0
  call   <pow@plt>
  movsd  (%rbx),%xmm1
  mov    (%r14),%esi
  divsd  %xmm0,%xmm1
L207:
  mulsd  D8(%rip),%xmm1
  mov    -0x80(%rbp),%rax
  movsd  %xmm1,(%rax)
  test   %esi,%esi
  jle    L271
  lea    0x8(%r15),%rax
  movl   $0x0,-0x74(%rbp)
  xor    %r14d,%r14d
  movq   $0x0,-0x88(%rbp)
  mov    %rax,-0x90(%rbp)
  mov    %r15,-0x60(%rbp)
  mov    %r14,%r15
  mov    %r13,%r14
  nopl   (%rax)
L121:
  movsd  (%r14,%r15,8),%xmm0
  movapd %xmm0,%xmm2
  subsd  %xmm1,%xmm2
  addsd  %xmm0,%xmm1
  test   %esi,%esi
  jle    L202
  xor    %ebx,%ebx
  pxor   %xmm3,%xmm3
  xor    %r12d,%r12d
  nopl   0x0(%rax,%rax,1)
L169:
  movsd  (%r14,%rbx,8),%xmm0
  comisd %xmm2,%xmm0
  jb     L275
  comisd %xmm0,%xmm1
  jb     L275
  mov    -0x68(%rbp),%rax
  movslq %r12d,%r13
  mov    $0x2,%edi
  movsd  %xmm1,-0x58(%rbp)
  movsd  %xmm3,-0x50(%rbp)
  movsd  %xmm0,(%rax,%r13,8)
  subsd  (%r14,%r15,8),%xmm0
  movsd  %xmm2,-0x48(%rbp)
  call   <pow@plt>
  pxor   %xmm5,%xmm5
  movsd  -0x48(%rbp),%xmm2
  movsd  -0x50(%rbp),%xmm3
  comisd %xmm0,%xmm5
  movsd  -0x58(%rbp),%xmm1
  jbe    L103
  xorpd  D0(%rip),%xmm0
L103:
  mov    -0x60(%rbp),%rax
  addsd  %xmm0,%xmm3
  add    $0x1,%r12d
  movsd  %xmm0,(%rax,%r13,8)
  mov    -0x70(%rbp),%rax
  mov    (%rax),%esi
L275:
  add    $0x1,%rbx
  cmp    %ebx,%esi
  jg     L169
  cmp    -0x74(%rbp),%r12d
  jge    L181
L277:
  add    $0x1,%r15
  cmp    %r15d,%esi
  jle    L271
L188:
  mov    -0x80(%rbp),%rax
  movsd  (%rax),%xmm1
  jmp    L121
L4:
  orq    $0x0,-0x8(%rsp,%rdx,1)
  jmp    L259
  nopw   0x0(%rax,%rax,1)
L181:
  test   %r12d,%r12d
  je     L230
  mov    -0x90(%rbp),%rcx
  lea    -0x1(%r12),%edi
  mov    -0x60(%rbp),%rax
  lea    (%rcx,%rdi,8),%rdi
  nopl   (%rax)
L123:
  movsd  (%rax),%xmm0
  movsd  D24(%rip),%xmm1
  add    $0x8,%rax
  divsd  %xmm3,%xmm0
  subsd  %xmm0,%xmm1
  movsd  %xmm1,-0x8(%rax)
  cmp    %rax,%rdi
  jne    L123
  pxor   %xmm2,%xmm2
  mov    -0x60(%rbp),%r13
  mov    -0x68(%rbp),%rdx
  mov    %r12d,%edi
  xor    %eax,%eax
  movapd %xmm2,%xmm1
  nop
L268:
  movsd  0x0(%r13,%rax,8),%xmm0
  movsd  (%rdx,%rax,8),%xmm4
  add    $0x1,%rax
  mulsd  %xmm0,%xmm4
  addsd  %xmm0,%xmm2
  addsd  %xmm4,%xmm1
  cmp    %rax,%rdi
  jne    L268
  divsd  %xmm2,%xmm1
  cmp    -0x74(%rbp),%r12d
  jle    L209
L117:
  mov    -0x98(%rbp),%rax
  add    $0x1,%r15
  mov    %r12d,-0x74(%rbp)
  movsd  %xmm3,-0x88(%rbp)
  movsd  %xmm1,(%rax)
  cmp    %r15d,%esi
  jg     L188
  nop
L271:
  mov    -0x38(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L64
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
  xchg   %ax,%ax
L202:
  mov    -0x74(%rbp),%eax
  test   %eax,%eax
  jne    L271
  pxor   %xmm1,%xmm1
  xor    %r12d,%r12d
  pxor   %xmm3,%xmm3
  divsd  %xmm1,%xmm1
L209:
  movsd  -0x88(%rbp),%xmm6
  comisd %xmm3,%xmm6
  jbe    L277
  jmp    L117
L66:
  orq    $0x0,-0x8(%rsp,%rdx,1)
  jmp    L44
L64:
  call   <__stack_chk_fail@plt>
L230:
  pxor   %xmm1,%xmm1
  divsd  %xmm1,%xmm1
  jmp    L209
```

tool_calls: name: disassemble_data
arguments: data_label: D26
datatype: f64
name: disassemble_data
arguments: data_label: D22
datatype: f64
name: disassemble_data
arguments: data_label: D8
datatype: f64
name: disassemble_data
arguments: data_label: D0
datatype: f32[4]
name: disassemble_data
arguments: data_label: D24
datatype: f32[2]

tool: D26: 0.975

tool: D22: 0.025

tool: D8: 0.5

tool: {"D0": [0.0,-0.0,0.0,0.0]}

tool: {"D24": [0.0,1.875]}

assistant: ```c
void distestim(double *x, int *n, double *smoothing, double *value) {
  int i, j;
  int count;
  int peakCount = 0;
  double lim[2];
  double range;
  double peakRange = 0;
  double M;
  double D[*n];
  double sumD = 0;
  double xBin[*n];
  if (*smoothing == 0) {
    *smoothing = quantile(x, *n, 0.975);
    *smoothing -= quantile(x, *n, 0.025);
    *smoothing /= pow(*n, 0.5);
  }
  *smoothing *= 0.5;
  for (i = 0; i < *n; i++) {
    lim[0] = x[i] - (*smoothing);
    lim[1] = x[i] + (*smoothing);
    sumD = 0;
    count = 0;
    for (j = 0; j < *n; j++) {
      if ((x[j] >= lim[0]) & (x[j] <= lim[1])) {
        xBin[count] = x[j];
        D[count] = pow(x[j] - x[i], 2);
        if (D[count] < 0)
          D[count] *= -1;
        sumD += D[count];
        count++;
      }
    }
    if (count >= peakCount) {
      range = sumD;
      for (j = 0; j < count; j++)
        D[j] = 1 - D[j] / sumD;
      sumD = 0;
      M = 0;
      for (j = 0; j < count; j++) {
        M += xBin[j] * D[j];
        sumD += D[j];
      }
      M /= sumD;
      if ((count > peakCount) || (range < peakRange)) {
        *value = M;
        peakCount = count;
        peakRange = range;
      }
    }
  }
}
```