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

```asm
<PowerSpectrum>:
  endbr64
  push   %r15
  mov    %edi,%r15d
  pxor   %xmm1,%xmm1
  pxor   %xmm6,%xmm6
  shr    $0x1f,%r15d
  push   %r14
  add    %edi,%r15d
  push   %r13
  sar    %r15d
  push   %r12
  push   %rbp
  cvtsi2sd %r15d,%xmm1
  push   %rbx
  mov    %edi,%ebx
  mov    %r15d,%edi
  sub    $0x28,%rsp
  movsd  D39(%rip),%xmm0
  mov    %rsi,0x18(%rsp)
  mov    $0x4,%esi
  divsd  %xmm1,%xmm0
  mov    %rdx,0x10(%rsp)
  cvtsd2ss %xmm0,%xmm6
  movss  %xmm6,0xc(%rsp)
  call   <calloc@plt>
  mov    $0x4,%esi
  mov    %r15d,%edi
  mov    %rax,%rbp
  call   <calloc@plt>
  mov    $0x4,%esi
  mov    %r15d,%edi
  mov    %rax,%r13
  call   <calloc@plt>
  mov    $0x4,%esi
  mov    %r15d,%edi
  mov    %rax,%r12
  call   <calloc@plt>
  mov    %rax,%r14
  cmp    $0x1,%ebx
  jle    L59
  mov    0x18(%rsp),%rcx
  mov    %r15d,%eax
  lea    (%rcx,%rax,8),%rsi
  shl    $0x2,%rax
  lea    0x0(%r13,%rax,1),%rdx
  cmp    %rdx,%rcx
  setae  %dl
  cmp    %rsi,%r13
  setae  %dil
  add    %rbp,%rax
  or     %edi,%edx
  cmp    %rax,%rcx
  setae  %al
  cmp    %rsi,%rbp
  setae  %sil
  or     %esi,%eax
  and    %edx,%eax
  cmp    $0x7,%ebx
  setg   %dl
  test   %dl,%al
  je     L66
  lea    0x4(%rbp),%rdx
  mov    %r13,%rax
  sub    %rdx,%rax
  cmp    $0x8,%rax
  jbe    L66
  mov    %r15d,%esi
  mov    %rbp,%rax
  mov    %r13,%rdi
  shr    $0x2,%esi
  neg    %rax
  sub    %rbp,%rdi
  shl    $0x4,%rsi
  lea    (%rcx,%rax,2),%rdx
  mov    %rbp,%rax
  add    %rbp,%rsi
  nopl   0x0(%rax)
L13:
  movups (%rdx,%rax,2),%xmm0
  movups 0x10(%rdx,%rax,2),%xmm1
  movaps %xmm0,%xmm2
  shufps $0xdd,%xmm1,%xmm0
  shufps $0x88,%xmm1,%xmm2
  movups %xmm2,(%rax)
  movups %xmm0,(%rdi,%rax,1)
  add    $0x10,%rax
  cmp    %rsi,%rax
  jne    L13
  mov    %r15d,%eax
  and    $0xfffffffc,%eax
  test   $0x3,%r15b
  je     L88
  lea    (%rax,%rax,1),%edx
  movslq %eax,%r9
  movslq %edx,%rsi
  lea    0x0(,%r9,4),%rdi
  movss  (%rcx,%rsi,4),%xmm0
  lea    0x0(,%rsi,4),%r8
  movss  %xmm0,0x0(%rbp,%r9,4)
  movss  0x4(%rcx,%rsi,4),%xmm0
  movss  %xmm0,0x0(%r13,%r9,4)
  lea    0x1(%rax),%r9d
  cmp    %r9d,%r15d
  jle    L88
  movss  0x8(%rcx,%r8,1),%xmm0
  add    $0x3,%edx
  add    $0x2,%eax
  movslq %edx,%rdx
  movss  %xmm0,0x4(%rbp,%rdi,1)
  movss  (%rcx,%rdx,4),%xmm0
  movss  %xmm0,0x4(%r13,%rdi,1)
  cmp    %r15d,%eax
  jge    L88
  movss  0x10(%rcx,%r8,1),%xmm0
  movss  %xmm0,0x8(%rbp,%rdi,1)
  movss  0x14(%rcx,%rsi,4),%xmm0
  movss  %xmm0,0x8(%r13,%rdi,1)
L88:
  xor    %esi,%esi
  mov    %r15d,%edi
  mov    %r14,%r9
  mov    %r12,%r8
  mov    %r13,%rcx
  mov    %rbp,%rdx
  call   <FFT@plt>
  movss  D56(%rip),%xmm6
  movss  0xc(%rsp),%xmm7
  mulss  %xmm6,%xmm7
  movaps %xmm7,%xmm0
  call   <sin@plt>
  pxor   %xmm0,%xmm0
  movsd  D55(%rip),%xmm7
  cvtsi2ss %rax,%xmm0
  cvtss2sd %xmm0,%xmm0
  mulsd  %xmm0,%xmm7
  mulsd  %xmm0,%xmm7
  movss  0xc(%rsp),%xmm0
  cvtsd2ss %xmm7,%xmm7
  movss  %xmm7,0x18(%rsp)
  call   <sin@plt>
  test   %ebx,%ebx
  lea    0x3(%rbx),%esi
  movss  0x18(%rsp),%xmm7
  cmovns %ebx,%esi
  movss  D48(%rip),%xmm5
  pxor   %xmm8,%xmm8
  cvtsi2ss %rax,%xmm8
  sar    $0x2,%esi
  addss  %xmm7,%xmm5
  mov    %esi,%edi
  cmp    $0x7,%ebx
  jle    L84
  mov    0x10(%rsp),%r8
  movslq %r15d,%r15
  mov    %r14,%r9
  lea    0x4(%r12),%rdx
  movss  D33(%rip),%xmm9
  lea    -0x4(%r12,%r15,4),%rax
  movaps %xmm8,%xmm4
  sub    %r12,%r9
  movss  D56(%rip),%xmm6
  mov    $0x1,%ecx
  sub    %r12,%r8
  nopl   (%rax)
L89:
  movss  (%r9,%rax,1),%xmm11
  movss  (%r9,%rdx,1),%xmm1
  add    $0x1,%ecx
  movss  (%rax),%xmm3
  movss  (%rdx),%xmm2
  movaps %xmm1,%xmm10
  addss  %xmm11,%xmm1
  movaps %xmm2,%xmm0
  subss  %xmm3,%xmm2
  subss  %xmm11,%xmm10
  addss  %xmm3,%xmm0
  mulss  %xmm6,%xmm1
  mulss  %xmm9,%xmm2
  mulss  %xmm6,%xmm0
  mulss  %xmm6,%xmm10
  movaps %xmm1,%xmm12
  mulss  %xmm5,%xmm12
  movaps %xmm2,%xmm11
  mulss  %xmm5,%xmm2
  mulss  %xmm4,%xmm11
  mulss  %xmm4,%xmm1
  movaps %xmm12,%xmm3
  movaps %xmm2,%xmm13
  addss  %xmm0,%xmm3
  subss  %xmm10,%xmm2
  addss  %xmm10,%xmm13
  subss  %xmm12,%xmm0
  subss  %xmm11,%xmm3
  addss  %xmm1,%xmm13
  addss  %xmm11,%xmm0
  addss  %xmm2,%xmm1
  mulss  %xmm3,%xmm3
  mulss  %xmm13,%xmm13
  mulss  %xmm1,%xmm1
  mulss  %xmm0,%xmm0
  addss  %xmm13,%xmm3
  addss  %xmm1,%xmm0
  movaps %xmm8,%xmm1
  movss  %xmm3,(%r8,%rdx,1)
  mulss  %xmm4,%xmm1
  add    $0x4,%rdx
  movss  %xmm0,(%r8,%rax,1)
  movaps %xmm7,%xmm0
  sub    $0x4,%rax
  mulss  %xmm5,%xmm0
  subss  %xmm1,%xmm0
  movaps %xmm5,%xmm1
  mulss  %xmm8,%xmm1
  addss  %xmm0,%xmm5
  movaps %xmm7,%xmm0
  mulss  %xmm4,%xmm0
  addss  %xmm1,%xmm0
  addss  %xmm0,%xmm4
  cmp    %esi,%ecx
  jl     L89
L84:
  movss  (%r14),%xmm2
  movss  (%r12),%xmm0
  movslq %edi,%rdi
  mov    0x10(%rsp),%rax
  movaps %xmm2,%xmm1
  addss  %xmm0,%xmm1
  subss  %xmm2,%xmm0
  mulss  %xmm1,%xmm1
  mulss  %xmm0,%xmm0
  addss  %xmm0,%xmm1
  movss  %xmm1,(%rax)
  movss  (%r12,%rdi,4),%xmm0
  movss  (%r14,%rdi,4),%xmm1
  mulss  %xmm0,%xmm0
  mulss  %xmm1,%xmm1
  addss  %xmm1,%xmm0
  movss  %xmm0,(%rax,%rdi,4)
  mov    %rbp,%rdi
  call   <free@plt>
  mov    %r13,%rdi
  call   <free@plt>
  mov    %r12,%rdi
  call   <free@plt>
  add    $0x28,%rsp
  mov    %r14,%rdi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1080 <free@plt>
  nopw   0x0(%rax,%rax,1)
L66:
  mov    %r13,%rsi
  mov    %rbp,%rdx
  xor    %eax,%eax
  sub    %rbp,%rsi
  nopl   0x0(%rax,%rax,1)
L64:
  movss  (%rcx,%rax,8),%xmm0
  movss  %xmm0,(%rdx)
  movss  0x4(%rcx,%rax,8),%xmm0
  add    $0x1,%rax
  movss  %xmm0,(%rsi,%rdx,1)
  add    $0x4,%rdx
  cmp    %eax,%r15d
  jg     L64
  jmp    L88
  cs nopw 0x0(%rax,%rax,1)
L59:
  xor    %esi,%esi
  mov    %r15d,%edi
  mov    %rax,%r9
  mov    %r12,%r8
  mov    %r13,%rcx
  mov    %rbp,%rdx
  call   <FFT@plt>
  movss  0xc(%rsp),%xmm7
  mulss  D56(%rip),%xmm7
  movaps %xmm7,%xmm0
  call   <sin@plt>
  movss  0xc(%rsp),%xmm0
  call   <sin@plt>
  test   %ebx,%ebx
  lea    0x3(%rbx),%edi
  cmovns %ebx,%edi
  sar    $0x2,%edi
  jmp    L84
```

tool_calls: name: unpack_data
arguments: data_label: D39
type_guessed: f64
name: unpack_data
arguments: data_label: D56
type_guessed: f32
name: unpack_data
arguments: data_label: D55
type_guessed: byte[8]
name: unpack_data
arguments: data_label: D48
type_guessed: f32
name: unpack_data
arguments: data_label: D33
type_guessed: byte[4]

tool: D39: 3.141592653589793

tool: D56: 0.5

tool: {"D55": [0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0]}

tool: D48: 1

tool: {"D33": [0x00,0x00,0x00,0xbf]}

assistant: ```c
void PowerSpectrum(int NumSamples, float *In, float *Out) {
  int Half, i, i3;
  float theta, wtemp, wpr, wpi, wr, wi;
  float h1r, h1i, h2r, h2i, rt, it;
  float *tmpReal;
  float *tmpImag;
  float *RealOut;
  float *ImagOut;
  Half = NumSamples / 2;
  theta = 3.14159265358979323846 / Half;
  tmpReal = (float *)calloc(Half, sizeof(float));
  tmpImag = (float *)calloc(Half, sizeof(float));
  RealOut = (float *)calloc(Half, sizeof(float));
  ImagOut = (float *)calloc(Half, sizeof(float));
  for (i = 0; i < Half; i++) {
    tmpReal[i] = In[2 * i];
    tmpImag[i] = In[2 * i + 1];
  }
  FFT(Half, 0, tmpReal, tmpImag, RealOut, ImagOut);
  wtemp = (float)sin(0.5 * theta);
  wpr = -2.0 * wtemp * wtemp;
  wpi = (float)sin(theta);
  wr = 1.0 + wpr;
  wi = wpi;
  for (i = 1; i < Half / 2; i++) {
    i3 = Half - i;
    h1r = 0.5 * (RealOut[i] + RealOut[i3]);
    h1i = 0.5 * (ImagOut[i] - ImagOut[i3]);
    h2r = 0.5 * (ImagOut[i] + ImagOut[i3]);
    h2i = -0.5 * (RealOut[i] - RealOut[i3]);
    rt = h1r + wr * h2r - wi * h2i;
    it = h1i + wr * h2i + wi * h2r;
    Out[i] = rt * rt + it * it;
    rt = h1r - wr * h2r + wi * h2i;
    it = -h1i + wr * h2i + wi * h2r;
    Out[i3] = rt * rt + it * it;
    wr = (wtemp = wr) * wpr - wi * wpi + wr;
    wi = wi * wpr + wtemp * wpi + wi;
  }
  rt = (h1r = RealOut[0]) + ImagOut[0];
  it = h1r - ImagOut[0];
  Out[0] = rt * rt + it * it;
  rt = RealOut[Half / 2];
  it = ImagOut[Half / 2];
  Out[Half / 2] = rt * rt + it * it;
  free(tmpReal);
  free(tmpImag);
  free(RealOut);
  free(ImagOut);
}
```