user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<rm_outliers>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdi,%r15
  mov    %rsi,%r14
  movsd  %xmm0,0x10(%rsp)
  mulsd  D2(%rip),%xmm0
  minsd  %xmm1,%xmm0
  mulsd  D103(%rip),%xmm0
  movsd  %xmm0,0x8(%rsp)
  mov    (%rsi),%ebp
  mov    $0x8,%esi
  mov    %ebp,%edi
  call   <my_alloc@plt>
  mov    %rax,0x18(%rsp)
  mov    (%r15),%rbx
  test   %ebp,%ebp
  jle    L17
  mov    %ebp,%ebp
  lea    (%rbx,%rbp,8),%r13
  mov    %rax,%rbp
  mov    $0x0,%r12d
  jmp    L32
L9:
  movapd %xmm1,%xmm0
L110:
  movapd %xmm0,%xmm1
  subsd  0x10(%rsp),%xmm1
  andpd  D91(%rip),%xmm1
  movsd  0x8(%rsp),%xmm6
  comisd %xmm1,%xmm6
  jbe    L40
  movsd  %xmm0,0x0(%rbp)
  add    $0x1,%r12d
  lea    0x8(%rbp),%rbp
L94:
  add    $0x8,%rbx
  cmp    %r13,%rbx
  je     L42
L32:
  movsd  (%rbx),%xmm0
  movapd %xmm0,%xmm1
  movsd  0x10(%rsp),%xmm4
  subsd  %xmm4,%xmm1
  andpd  D91(%rip),%xmm1
  movsd  0x8(%rsp),%xmm3
  comisd %xmm3,%xmm1
  jbe    L110
  movapd %xmm0,%xmm1
  subsd  D68(%rip),%xmm1
  movapd %xmm1,%xmm2
  andpd  D91(%rip),%xmm2
  comisd %xmm2,%xmm3
  jbe    L125
  comisd %xmm4,%xmm3
  ja     L9
L125:
  movsd  0x8(%rsp),%xmm7
  comisd %xmm0,%xmm7
  jbe    L110
  movsd  0x10(%rsp),%xmm1
  subsd  D68(%rip),%xmm1
  andpd  D91(%rip),%xmm1
  comisd %xmm1,%xmm7
  jbe    L110
  addsd  D68(%rip),%xmm0
  jmp    L110
L40:
  cvttsd2si 0x10(%rsp),%edx
  cvttsd2si %xmm0,%esi
  movsd  0x8(%rsp),%xmm0
  lea    D27(%rip),%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  jmp    L94
L17:
  mov    $0x0,%r12d
L42:
  mov    (%r14),%edx
  cmp    %r12d,%edx
  jne    L66
L78:
  mov    (%r15),%rdi
  call   <free@plt>
  mov    0x18(%rsp),%rax
  mov    %rax,(%r15)
  mov    %r12d,(%r14)
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L66:
  mov    %edx,%esi
  sub    %r12d,%esi
  lea    D99(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L78
```

tool_calls: name: retrieve_data
arguments: label: D2
data_type: byte[8]
name: retrieve_data
arguments: label: D103
data_type: f64
name: retrieve_data
arguments: label: D91
data_type: qword[2]
name: retrieve_data
arguments: label: D68
data_type: f64
name: retrieve_data
arguments: label: D27
data_type: string
name: retrieve_data
arguments: label: D99
data_type: string

tool: {"D2": [0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x3f]}

tool: D103: 3

tool: {"D91": [0x7fffffffffffffff,0x0000000000000000]}

tool: D68: 360

tool: D27: Outlier: %g (median=%g, 3RMS=%g)


tool: D99: %d outliers removed (from %d)



assistant: ```c
void rm_outliers(double **buf, int *N, double med, double std) {
  if (std > med / 2.)
    std = med / 2.;
  std *= 3.;
  int L = 0, i, oN = *N;
  double *ret = ((double *)my_alloc(oN, sizeof(double))), *rptr = ret, *iptr = *buf;
  for (i = 0; i < oN; ++i, ++iptr) {
    double d = *iptr;
    if (fabs(d - med) > std) {
      if (fabs(d - 360.) < std && med < std)
        d -= 360.;
      else if (d < std && fabs(med - 360.) < std)
        d += 360.;
    }
    if (fabs(d - med) < std) {
      *rptr++ = d;
      ++L;
    } else
      printf("Outlier: %g (median=%g, 3RMS=%g)\n", d, med, std);
  }
  if (L != *N)
    printf("%d outliers removed (from %d)\n\n", *N - L, *N);
  free(*buf);
  *buf = ret;
  *N = L;
}
```