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

```asm
<rm_outliers>:
  endbr64
  push   %r15
  movapd %xmm0,%xmm2
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  sub    $0x28,%rsp
  movslq (%rsi),%r13
  mulsd  D4(%rip),%xmm2
  mov    %rsi,0x10(%rsp)
  mov    $0x8,%esi
  mov    %r13d,%edi
  movsd  %xmm0,0x8(%rsp)
  minsd  %xmm1,%xmm2
  mulsd  D6(%rip),%xmm2
  movsd  %xmm2,(%rsp)
  call   <my_alloc@plt>
  mov    0x0(%rbp),%r14
  mov    %rax,0x18(%rsp)
  test   %r13d,%r13d
  jle    L57
  lea    (%r14,%r13,8),%rbx
  movsd  0x8(%rsp),%xmm3
  mov    %rax,%r15
  xor    %r12d,%r12d
  movq   D22(%rip),%xmm4
  movsd  (%rsp),%xmm2
  lea    D53(%rip),%r13
  jmp    L43
  nopl   (%rax)
L68:
  add    $0x8,%r14
  movsd  %xmm1,(%r15)
  add    $0x1,%r12d
  add    $0x8,%r15
  cmp    %r14,%rbx
  je     L9
L43:
  movsd  (%r14),%xmm1
  movapd %xmm1,%xmm0
  subsd  %xmm3,%xmm0
  andpd  %xmm4,%xmm0
  comisd %xmm2,%xmm0
  jbe    L90
  movapd %xmm1,%xmm5
  subsd  D21(%rip),%xmm5
  movapd %xmm5,%xmm6
  andpd  %xmm4,%xmm6
  comisd %xmm6,%xmm2
  jbe    L6
  comisd %xmm3,%xmm2
  jbe    L6
  movapd %xmm5,%xmm0
  movapd %xmm5,%xmm1
  subsd  %xmm3,%xmm0
  andpd  %xmm4,%xmm0
  nopl   0x0(%rax)
L90:
  comisd %xmm0,%xmm2
  ja     L68
  cvttsd2si %xmm3,%edx
  movapd %xmm2,%xmm0
  mov    %r13,%rdi
  mov    $0x1,%eax
  cvttsd2si %xmm1,%esi
  add    $0x8,%r14
  movsd  %xmm3,0x8(%rsp)
  movsd  %xmm2,(%rsp)
  call   <printf@plt>
  movsd  0x8(%rsp),%xmm3
  movsd  (%rsp),%xmm2
  movq   D22(%rip),%xmm4
  cmp    %r14,%rbx
  jne    L43
L9:
  mov    0x10(%rsp),%rax
  mov    (%rax),%edx
  cmp    %r12d,%edx
  je     L109
  mov    %edx,%esi
  lea    D75(%rip),%rdi
  xor    %eax,%eax
  sub    %r12d,%esi
  call   <printf@plt>
L109:
  mov    0x0(%rbp),%rdi
  call   <free@plt>
  mov    0x18(%rsp),%rax
  mov    %rax,0x0(%rbp)
  mov    0x10(%rsp),%rax
  mov    %r12d,(%rax)
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L6:
  comisd %xmm1,%xmm2
  jbe    L90
  movapd %xmm3,%xmm5
  subsd  D21(%rip),%xmm5
  andpd  %xmm4,%xmm5
  comisd %xmm5,%xmm2
  jbe    L90
  addsd  D21(%rip),%xmm1
  movapd %xmm1,%xmm0
  subsd  %xmm3,%xmm0
  andpd  %xmm4,%xmm0
  jmp    L90
  nopl   (%rax)
L57:
  xor    %r12d,%r12d
  jmp    L9
```

tool_calls: name: disassemble_data
arguments: data_tag: D4
data_type: byte[8]
name: disassemble_data
arguments: data_tag: D6
data_type: f64
name: disassemble_data
arguments: data_tag: D22
data_type: qword
name: disassemble_data
arguments: data_tag: D53
data_type: string
name: disassemble_data
arguments: data_tag: D21
data_type: f64
name: disassemble_data
arguments: data_tag: D75
data_type: string

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

tool: D6: 3

tool: D22: 9223372036854775807

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


tool: D21: 360

tool: D75: %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;
}
```