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

```asm
<stepfm>:
  endbr64
  push   %r15
  subsd  %xmm0,%xmm1
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  sub    $0x78,%rsp
  mov    %edx,0x3c(%rsp)
  movsd  %xmm0,0x28(%rsp)
  pxor   %xmm0,%xmm0
  mov    %fs:0x28,%rax
  mov    %rax,0x68(%rsp)
  xor    %eax,%eax
  lea    -0x1(%rcx),%eax
  movq   $0x0,0x50(%rsp)
  movq   $0x0,0x58(%rsp)
  cvtsi2sd %eax,%xmm0
  movq   $0x0,0x60(%rsp)
  divsd  %xmm0,%xmm1
  pxor   %xmm0,%xmm0
  cvtsi2sd %ecx,%xmm0
  movsd  %xmm1,0x18(%rsp)
  pxor   %xmm1,%xmm1
  cvtsi2sd %edx,%xmm1
  movapd %xmm1,%xmm5
  divsd  %xmm0,%xmm5
  mulsd  %xmm5,%xmm0
  movsd  %xmm5,0x20(%rsp)
  movsd  %xmm0,(%rsp)
  test   %rsi,%rsi
  je     L140
  pxor   %xmm4,%xmm4
  xor    %edx,%edx
  mov    %rsi,%r12
  comisd %xmm4,%xmm0
  jbe    L129
  pxor   %xmm1,%xmm1
  lea    0x48(%rsp),%r15
  lea    0x40(%rsp),%r14
  xor    %ebx,%ebx
  movsd  D59(%rip),%xmm6
  movapd %xmm1,%xmm3
  movsd  %xmm6,0x30(%rsp)
L144:
  movapd %xmm3,%xmm0
  divsd  0x20(%rsp),%xmm0
  cvttsd2si %xmm0,%edx
  pxor   %xmm2,%xmm2
  mov    %ebx,%r13d
  cvtsi2sd %edx,%xmm2
  mulsd  0x18(%rsp),%xmm2
  addsd  0x28(%rsp),%xmm2
  cmp    $0x2,%rbx
  ja     L138
  addsd  %xmm2,%xmm1
  movsd  %xmm2,0x50(%rsp,%rbx,8)
L26:
  movsd  0x30(%rsp),%xmm0
  mov    %r14,%rsi
  mov    %r15,%rdi
  movsd  %xmm1,0x10(%rsp)
  movsd  %xmm2,0x8(%rsp)
  mulsd  %xmm2,%xmm0
  mulsd  %xmm3,%xmm0
  call   <sincos@plt>
  lea    0x1(%r13),%edx
  pxor   %xmm3,%xmm3
  movsd  0x40(%rsp),%xmm0
  cvtsi2sd %edx,%xmm3
  movsd  (%rsp),%xmm7
  movsd  0x8(%rsp),%xmm2
  movsd  %xmm0,0x0(%rbp,%rbx,8)
  movsd  0x48(%rsp),%xmm0
  movsd  0x10(%rsp),%xmm1
  movsd  %xmm0,(%r12,%rbx,8)
  add    $0x1,%rbx
  comisd %xmm3,%xmm7
  ja     L144
L129:
  mov    0x3c(%rsp),%eax
  cmp    %edx,%eax
  jle    L134
  movslq %edx,%r13
  lea    0x48(%rsp),%r15
  lea    0x40(%rsp),%r14
  sub    $0x1,%eax
  mulsd  D59(%rip),%xmm2
  sub    %edx,%eax
  lea    0x1(%r13),%rbx
  add    %rbx,%rax
  mov    %rax,0x8(%rsp)
  movsd  %xmm2,(%rsp)
  jmp    L8
  xchg   %ax,%ax
L68:
  add    $0x1,%rbx
L8:
  pxor   %xmm0,%xmm0
  mov    %r14,%rsi
  mov    %r15,%rdi
  cvtsi2sd %r13d,%xmm0
  mulsd  (%rsp),%xmm0
  call   <sincos@plt>
  movsd  0x40(%rsp),%xmm0
  movsd  %xmm0,0x0(%rbp,%r13,8)
  movsd  0x48(%rsp),%xmm0
  movsd  %xmm0,(%r12,%r13,8)
  mov    %rbx,%r13
  cmp    %rbx,0x8(%rsp)
  jne    L68
L134:
  mov    0x68(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L167
  add    $0x78,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L138:
  mov    %ebx,%edx
  mov    $0xaaaaaaab,%eax
  movapd %xmm2,%xmm0
  imul   %rax,%rdx
  shr    $0x21,%rdx
  lea    (%rdx,%rdx,2),%ecx
  mov    %ebx,%edx
  sub    %ecx,%edx
  movslq %edx,%rdx
  subsd  0x50(%rsp,%rdx,8),%xmm0
  movsd  %xmm2,0x50(%rsp,%rdx,8)
  addsd  %xmm0,%xmm1
  movapd %xmm1,%xmm2
  divsd  D0(%rip),%xmm2
  jmp    L26
  cs nopw 0x0(%rax,%rax,1)
L140:
  movsd  (%rsp),%xmm7
  pxor   %xmm3,%xmm3
  xor    %eax,%eax
  comisd %xmm3,%xmm7
  jbe    L31
  movsd  D59(%rip),%xmm7
  pxor   %xmm3,%xmm3
  xor    %r12d,%r12d
  mov    $0xaaaaaaab,%r14d
  movapd %xmm3,%xmm1
  movsd  %xmm7,0x30(%rsp)
L21:
  movapd %xmm1,%xmm0
  divsd  0x20(%rsp),%xmm0
  cvttsd2si %xmm0,%eax
  pxor   %xmm2,%xmm2
  mov    %r12d,%r13d
  cvtsi2sd %eax,%xmm2
  mulsd  0x18(%rsp),%xmm2
  addsd  0x28(%rsp),%xmm2
  cmp    $0x2,%r12
  ja     L27
  addsd  %xmm2,%xmm3
  movsd  %xmm2,0x50(%rsp,%r12,8)
L65:
  movsd  0x30(%rsp),%xmm0
  movsd  %xmm3,0x10(%rsp)
  movsd  %xmm2,0x8(%rsp)
  mulsd  %xmm2,%xmm0
  mulsd  %xmm1,%xmm0
  call   <cos@plt>
  lea    0x1(%r13),%eax
  pxor   %xmm1,%xmm1
  movsd  (%rsp),%xmm7
  cvtsi2sd %eax,%xmm1
  movsd  %xmm0,0x0(%rbp,%r12,8)
  add    $0x1,%r12
  movsd  0x8(%rsp),%xmm2
  movsd  0x10(%rsp),%xmm3
  comisd %xmm1,%xmm7
  ja     L21
L31:
  mov    0x3c(%rsp),%ecx
  cmp    %eax,%ecx
  jle    L134
  mulsd  D59(%rip),%xmm2
  sub    $0x1,%ecx
  movslq %eax,%r13
  mov    %ecx,%ebx
  lea    0x1(%r13),%r12
  sub    %eax,%ebx
  add    %r12,%rbx
  movsd  %xmm2,(%rsp)
  jmp    L47
  nopl   0x0(%rax,%rax,1)
L89:
  add    $0x1,%r12
L47:
  pxor   %xmm0,%xmm0
  cvtsi2sd %r13d,%xmm0
  mulsd  (%rsp),%xmm0
  call   <cos@plt>
  movsd  %xmm0,0x0(%rbp,%r13,8)
  mov    %r12,%r13
  cmp    %r12,%rbx
  jne    L89
  jmp    L134
  nopl   0x0(%rax,%rax,1)
L27:
  mov    %r12d,%eax
  movapd %xmm2,%xmm0
  imul   %r14,%rax
  shr    $0x21,%rax
  lea    (%rax,%rax,2),%edx
  mov    %r12d,%eax
  sub    %edx,%eax
  cltq
  subsd  0x50(%rsp,%rax,8),%xmm0
  movsd  %xmm2,0x50(%rsp,%rax,8)
  addsd  %xmm0,%xmm3
  movapd %xmm3,%xmm2
  divsd  D0(%rip),%xmm2
  jmp    L65
L167:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: tag: D59
type_guessed: byte[8]
name: parse_data
arguments: tag: D0
type_guessed: f32[2]

tool: {"D59": [0x18,0x2d,0x44,0x54,0xfb,0x21,0x19,0x40]}

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

assistant: ```c
void stepfm(double *result_real, double *result_imag, double f1, double f2, int n, int num_bins) {
  int i;
  double f;
  double increment = (double)(f2 - f1) / (num_bins - 1);
  double bin_size = (double)n / (double)num_bins;
  double sum = 0.0;
  double wind[3] = {0, 0, 0};
  double smoothed_freq;
  if (result_imag == NULL) {
    for (i = 0; i < num_bins * bin_size; i++) {
      f = f1 + (int)(i / bin_size) * increment;
      if (i < 3) {
        smoothed_freq = f;
        sum += f;
        wind[i] = f;
      } else {
        sum += f - wind[i % 3];
        smoothed_freq = sum / 3;
        wind[i % 3] = f;
      }
      result_real[i] = cos(2.0 * 3.14159265358979323846 * smoothed_freq * (double)i);
    }
    for (; i < n; i++) {
      result_real[i] = cos(2.0 * 3.14159265358979323846 * smoothed_freq * (double)i);
    }
  } else {
    for (i = 0; i < num_bins * bin_size; i++) {
      f = f1 + (int)(i / bin_size) * increment;
      if (i < 3) {
        smoothed_freq = f;
        sum += f;
        wind[i] = f;
      } else {
        sum += f - wind[i % 3];
        smoothed_freq = sum / 3;
        wind[i % 3] = f;
      }
      result_real[i] = cos(2.0 * 3.14159265358979323846 * smoothed_freq * (double)i);
      result_imag[i] = sin(2.0 * 3.14159265358979323846 * smoothed_freq * (double)i);
    }
    for (; i < n; i++) {
      result_real[i] = cos(2.0 * 3.14159265358979323846 * smoothed_freq * (double)i);
      result_imag[i] = sin(2.0 * 3.14159265358979323846 * smoothed_freq * (double)i);
    }
  }
}
```