user: 请从给定的汇编指令推导出C源代码:

```asm
<PowerSpectrum>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %edi,%r13d
  mov    %rsi,%rbp
  mov    %rdx,%r15
  mov    %edi,%ebx
  shr    $0x1f,%ebx
  add    %edi,%ebx
  sar    %ebx
  pxor   %xmm1,%xmm1
  cvtsi2sd %ebx,%xmm1
  movsd  D52(%rip),%xmm0
  divsd  %xmm1,%xmm0
  pxor   %xmm7,%xmm7
  cvtsd2ss %xmm0,%xmm7
  movss  %xmm7,0x1c(%rsp)
  mov    $0x4,%esi
  mov    %ebx,%edi
  call   <calloc@plt>
  mov    %rax,0x8(%rsp)
  mov    $0x4,%esi
  mov    %ebx,%edi
  call   <calloc@plt>
  mov    %rax,0x10(%rsp)
  mov    $0x4,%esi
  mov    %ebx,%edi
  call   <calloc@plt>
  mov    %rax,%r12
  mov    $0x4,%esi
  mov    %ebx,%edi
  call   <calloc@plt>
  mov    %rax,%r14
  cmp    $0x1,%r13d
  jle    L2
  mov    0x8(%rsp),%rsi
  mov    %rsi,%rdx
  mov    $0x0,%eax
  mov    0x10(%rsp),%rcx
  sub    %rsi,%rcx
L10:
  movss  0x0(%rbp,%rax,8),%xmm0
  movss  %xmm0,(%rdx)
  movss  0x4(%rbp,%rax,8),%xmm0
  movss  %xmm0,(%rcx,%rdx,1)
  add    $0x1,%rax
  add    $0x4,%rdx
  cmp    %eax,%ebx
  jg     L10
L2:
  mov    %r14,%r9
  mov    %r12,%r8
  mov    0x10(%rsp),%rcx
  mov    0x8(%rsp),%rdx
  mov    $0x0,%esi
  mov    %ebx,%edi
  call   <FFT@plt>
  movss  0x1c(%rsp),%xmm7
  mulss  D4(%rip),%xmm7
  movaps %xmm7,%xmm0
  call   <sin@plt>
  pxor   %xmm0,%xmm0
  cvtsi2ss %rax,%xmm0
  cvtss2sd %xmm0,%xmm0
  movapd %xmm0,%xmm1
  mulsd  D33(%rip),%xmm1
  mulsd  %xmm1,%xmm0
  pxor   %xmm6,%xmm6
  cvtsd2ss %xmm0,%xmm6
  movss  %xmm6,0x18(%rsp)
  movss  0x1c(%rsp),%xmm0
  call   <sin@plt>
  pxor   %xmm7,%xmm7
  cvtsi2ss %rax,%xmm7
  movss  0x18(%rsp),%xmm4
  addss  D58(%rip),%xmm4
  lea    0x3(%r13),%esi
  test   %r13d,%r13d
  cmovns %r13d,%esi
  sar    $0x2,%esi
  cmp    $0x7,%r13d
  jle    L31
  lea    0x4(%r12),%rdx
  movslq %ebx,%rbx
  lea    -0x4(%r12,%rbx,4),%rax
  movaps %xmm7,%xmm5
  mov    $0x1,%ecx
  movss  D4(%rip),%xmm6
  mov    %r14,%r8
  sub    %r12,%r8
  movss  D30(%rip),%xmm8
  mov    %r15,%rdi
  sub    %r12,%rdi
L7:
  movss  (%rdx),%xmm1
  movss  (%rax),%xmm3
  movaps %xmm1,%xmm0
  addss  %xmm3,%xmm0
  mulss  %xmm6,%xmm0
  movss  (%rdx,%r8,1),%xmm2
  movss  (%rax,%r8,1),%xmm10
  movaps %xmm2,%xmm9
  subss  %xmm10,%xmm9
  mulss  %xmm6,%xmm9
  addss  %xmm10,%xmm2
  mulss  %xmm6,%xmm2
  subss  %xmm3,%xmm1
  mulss  %xmm8,%xmm1
  movaps %xmm2,%xmm11
  mulss  %xmm4,%xmm11
  movaps %xmm1,%xmm10
  mulss  %xmm5,%xmm10
  movaps %xmm11,%xmm3
  addss  %xmm0,%xmm3
  subss  %xmm10,%xmm3
  mulss  %xmm4,%xmm1
  mulss  %xmm5,%xmm2
  movaps %xmm1,%xmm12
  addss  %xmm9,%xmm12
  addss  %xmm2,%xmm12
  mulss  %xmm3,%xmm3
  mulss  %xmm12,%xmm12
  addss  %xmm12,%xmm3
  movss  %xmm3,(%rdi,%rdx,1)
  subss  %xmm11,%xmm0
  addss  %xmm10,%xmm0
  subss  %xmm9,%xmm1
  addss  %xmm2,%xmm1
  mulss  %xmm0,%xmm0
  mulss  %xmm1,%xmm1
  addss  %xmm1,%xmm0
  movss  %xmm0,(%rdi,%rax,1)
  movss  0x18(%rsp),%xmm3
  movaps %xmm3,%xmm0
  mulss  %xmm4,%xmm0
  movaps %xmm7,%xmm1
  mulss  %xmm5,%xmm1
  subss  %xmm1,%xmm0
  movaps %xmm4,%xmm1
  addss  %xmm0,%xmm4
  mulss  %xmm5,%xmm3
  movaps %xmm3,%xmm0
  mulss  %xmm7,%xmm1
  addss  %xmm1,%xmm0
  addss  %xmm0,%xmm5
  add    $0x1,%ecx
  add    $0x4,%rdx
  sub    $0x4,%rax
  cmp    %esi,%ecx
  jl     L7
L31:
  movss  (%r12),%xmm0
  movss  (%r14),%xmm2
  movaps %xmm2,%xmm1
  addss  %xmm0,%xmm1
  subss  %xmm2,%xmm0
  mulss  %xmm1,%xmm1
  mulss  %xmm0,%xmm0
  addss  %xmm0,%xmm1
  movss  %xmm1,(%r15)
  movslq %esi,%rsi
  movss  (%r12,%rsi,4),%xmm0
  movss  (%r14,%rsi,4),%xmm1
  mulss  %xmm0,%xmm0
  mulss  %xmm1,%xmm1
  addss  %xmm1,%xmm0
  movss  %xmm0,(%r15,%rsi,4)
  mov    0x8(%rsp),%rdi
  call   <free@plt>
  mov    0x10(%rsp),%rdi
  call   <free@plt>
  mov    %r12,%rdi
  call   <free@plt>
  mov    %r14,%rdi
  call   <free@plt>
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: retrieve_data
arguments: data_tag: D52
type_infered: f64
name: retrieve_data
arguments: data_tag: D4
type_infered: f32
name: retrieve_data
arguments: data_tag: D33
type_infered: byte[8]
name: retrieve_data
arguments: data_tag: D58
type_infered: f32
name: retrieve_data
arguments: data_tag: D30
type_infered: byte[4]

tool: D52: 3.141592653589793

tool: D4: 0.5

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

tool: D58: 1

tool: {"D30": [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);
}
```