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

```asm
<powspec2d>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x58,%rsp
  mov    %rdi,0x28(%rsp)
  mov    %rsi,0x30(%rsp)
  mov    %rdx,%r14
  mov    %ecx,0x40(%rsp)
  mov    %r8d,0x18(%rsp)
  cmp    %ecx,%r8d
  cmovle %r8d,%ecx
  mov    %ecx,%ebp
  mov    %ecx,0x4c(%rsp)
  mov    %ecx,%eax
  shr    $0x1f,%eax
  add    %ecx,%eax
  sar    %eax
  mov    %eax,%r15d
  lea    0x1(%rax),%edi
  movslq %edi,%rdi
  shl    $0x2,%rdi
  call   <malloc@plt>
  mov    %rax,%rbx
  cmp    $0xffffffff,%ebp
  jl     L189
  mov    $0x0,%eax
L511:
  movl   $0x0,(%r14,%rax,4)
  movl   $0x0,(%rbx,%rax,4)
  add    $0x1,%rax
  cmp    %eax,%r15d
  jge    L511
L189:
  mov    0x40(%rsp),%edi
  mov    %edi,%eax
  shr    $0x1f,%eax
  add    %edi,%eax
  sar    %eax
  mov    %eax,0x38(%rsp)
  cmp    $0x1,%edi
  jle    L206
  mov    0x18(%rsp),%esi
  mov    %esi,%eax
  shr    $0x1f,%eax
  add    %esi,%eax
  sar    %eax
  mov    %eax,%esi
  mov    %eax,0x48(%rsp)
  movslq %edi,%rax
  shl    $0x2,%rax
  mov    %rax,(%rsp)
  movq   $0x0,0x20(%rsp)
  movss  D39(%rip),%xmm4
  movss  %xmm4,0x1c(%rsp)
  mov    %r14,0x10(%rsp)
  mov    %esi,%r14d
  jmp    L243
L242:
  call   <sqrtf@plt>
  jmp    L236
L447:
  movaps %xmm0,%xmm2
  movss  0x1c(%rsp),%xmm4
  movaps %xmm4,%xmm1
  andps  %xmm0,%xmm1
  movss  D115(%rip),%xmm3
  ucomiss %xmm1,%xmm3
  jbe    L150
  cvttss2si %xmm0,%eax
  pxor   %xmm1,%xmm1
  cvtsi2ss %eax,%xmm1
  cmpnless %xmm1,%xmm2
  movss  D212(%rip),%xmm3
  andps  %xmm3,%xmm2
  addss  %xmm2,%xmm1
  andnps %xmm0,%xmm4
  movaps %xmm4,%xmm2
  orps   %xmm1,%xmm2
L150:
  cvttss2si %xmm2,%eax
L173:
  cmp    %r15d,%eax
  cmovg  %r15d,%eax
  cltq
  shl    $0x2,%rax
  mov    0x10(%rsp),%rcx
  lea    (%rcx,%rax,1),%rdx
  movss  0x0(%r13),%xmm0
  movss  (%r12),%xmm1
  mulss  %xmm0,%xmm0
  mulss  %xmm1,%xmm1
  addss  %xmm1,%xmm0
  addss  (%rdx),%xmm0
  movss  %xmm0,(%rdx)
  addl   $0x1,(%rbx,%rax,1)
  add    $0x1,%ebp
  mov    (%rsp),%rax
  add    %rax,%r13
  add    %rax,%r12
  cmp    %r14d,%ebp
  jge    L411
L24:
  mov    %ebp,%eax
  imul   %ebp,%eax
  add    0xc(%rsp),%eax
  pxor   %xmm0,%xmm0
  cvtsi2ss %eax,%xmm0
  pxor   %xmm4,%xmm4
  ucomiss %xmm0,%xmm4
  ja     L242
  sqrtss %xmm0,%xmm0
L236:
  movaps %xmm0,%xmm2
  movss  D39(%rip),%xmm1
  andps  %xmm0,%xmm1
  movss  D115(%rip),%xmm3
  ucomiss %xmm1,%xmm3
  jbe    L377
  cvttss2si %xmm0,%eax
  pxor   %xmm1,%xmm1
  cvtsi2ss %eax,%xmm1
  movaps %xmm1,%xmm2
  cmpnless %xmm0,%xmm2
  movss  D212(%rip),%xmm3
  andps  %xmm3,%xmm2
  subss  %xmm2,%xmm1
  movss  D39(%rip),%xmm2
  andnps %xmm0,%xmm2
  orps   %xmm1,%xmm2
L377:
  pxor   %xmm1,%xmm1
  cvtss2sd %xmm0,%xmm1
  pxor   %xmm3,%xmm3
  cvtss2sd %xmm2,%xmm3
  subsd  %xmm3,%xmm1
  movsd  D292(%rip),%xmm3
  comisd %xmm1,%xmm3
  jbe    L447
  cvttss2si %xmm2,%eax
  jmp    L173
L411:
  addq   $0x1,0x20(%rsp)
  mov    0x20(%rsp),%rax
  cmp    %eax,0x38(%rsp)
  jle    L293
L243:
  cmpl   $0x1,0x18(%rsp)
  jle    L411
  mov    0x20(%rsp),%rax
  mov    %eax,%edi
  imul   %eax,%edi
  mov    %edi,0xc(%rsp)
  lea    0x0(,%rax,4),%r12
  mov    0x28(%rsp),%rax
  lea    (%rax,%r12,1),%r13
  add    0x30(%rsp),%r12
  mov    $0x0,%ebp
  jmp    L24
L293:
  mov    0x10(%rsp),%r14
  mov    0x40(%rsp),%eax
  imul   0x48(%rsp),%eax
  cltq
  shl    $0x2,%rax
  mov    %rax,0x20(%rsp)
  movl   $0x0,0x1c(%rsp)
  movss  D39(%rip),%xmm5
  movss  %xmm5,0x10(%rsp)
  jmp    L12
L217:
  call   <sqrtf@plt>
  jmp    L347
L88:
  movaps %xmm0,%xmm2
  movss  0x10(%rsp),%xmm5
  movaps %xmm5,%xmm1
  andps  %xmm0,%xmm1
  movss  D115(%rip),%xmm3
  ucomiss %xmm1,%xmm3
  jbe    L199
  cvttss2si %xmm0,%eax
  pxor   %xmm1,%xmm1
  cvtsi2ss %eax,%xmm1
  cmpnless %xmm1,%xmm2
  movss  D212(%rip),%xmm3
  andps  %xmm3,%xmm2
  addss  %xmm2,%xmm1
  andnps %xmm0,%xmm5
  movaps %xmm5,%xmm2
  orps   %xmm1,%xmm2
L199:
  cvttss2si %xmm2,%eax
L20:
  cmp    %r15d,%eax
  cmovg  %r15d,%eax
  cltq
  shl    $0x2,%rax
  lea    (%r14,%rax,1),%rdx
  movss  0x0(%r13),%xmm0
  movss  (%r12),%xmm1
  mulss  %xmm0,%xmm0
  mulss  %xmm1,%xmm1
  addss  %xmm1,%xmm0
  addss  (%rdx),%xmm0
  movss  %xmm0,(%rdx)
  addl   $0x1,(%rbx,%rax,1)
  mov    (%rsp),%rax
  add    %rax,%r13
  add    %rax,%r12
  add    $0x1,%ebp
  je     L119
L482:
  mov    %ebp,%eax
  imul   %ebp,%eax
  add    0xc(%rsp),%eax
  pxor   %xmm0,%xmm0
  cvtsi2ss %eax,%xmm0
  pxor   %xmm5,%xmm5
  ucomiss %xmm0,%xmm5
  ja     L217
  sqrtss %xmm0,%xmm0
L347:
  movaps %xmm0,%xmm2
  movss  D39(%rip),%xmm1
  andps  %xmm0,%xmm1
  movss  D115(%rip),%xmm3
  ucomiss %xmm1,%xmm3
  jbe    L29
  cvttss2si %xmm0,%eax
  pxor   %xmm1,%xmm1
  cvtsi2ss %eax,%xmm1
  movaps %xmm1,%xmm2
  cmpnless %xmm0,%xmm2
  movss  D212(%rip),%xmm3
  andps  %xmm3,%xmm2
  subss  %xmm2,%xmm1
  movss  D39(%rip),%xmm2
  andnps %xmm0,%xmm2
  orps   %xmm1,%xmm2
L29:
  pxor   %xmm1,%xmm1
  cvtss2sd %xmm0,%xmm1
  pxor   %xmm3,%xmm3
  cvtss2sd %xmm2,%xmm3
  subsd  %xmm3,%xmm1
  movsd  D292(%rip),%xmm3
  comisd %xmm1,%xmm3
  jbe    L88
  cvttss2si %xmm2,%eax
  jmp    L20
L119:
  addl   $0x1,0x1c(%rsp)
  mov    0x1c(%rsp),%eax
  addq   $0x4,0x20(%rsp)
  cmp    0x38(%rsp),%eax
  jge    L206
L12:
  mov    0x18(%rsp),%esi
  mov    0x48(%rsp),%eax
  cmp    %eax,%esi
  jle    L119
  mov    0x1c(%rsp),%ecx
  mov    %ecx,%edi
  imul   %ecx,%edi
  mov    %edi,0xc(%rsp)
  sub    %esi,%eax
  mov    %eax,%ebp
  mov    0x28(%rsp),%r13
  mov    0x20(%rsp),%rax
  add    %rax,%r13
  mov    0x30(%rsp),%r12
  add    %rax,%r12
  jmp    L482
L206:
  mov    0x40(%rsp),%esi
  mov    0x38(%rsp),%edi
  cmp    %edi,%esi
  jle    L23
  mov    0x18(%rsp),%ecx
  mov    %ecx,%eax
  shr    $0x1f,%eax
  add    %ecx,%eax
  sar    %eax
  mov    %eax,%ecx
  mov    %eax,0x48(%rsp)
  mov    %edi,%eax
  sub    %esi,%edi
  mov    %edi,0x20(%rsp)
  movslq %eax,%rdx
  mov    %rdx,0x40(%rsp)
  mov    %ecx,%eax
  imul   %esi,%eax
  cltq
  add    %rdx,%rax
  shl    $0x2,%rax
  mov    %rax,0x38(%rsp)
  movslq %esi,%rax
  shl    $0x2,%rax
  mov    %rax,(%rsp)
  mov    %edi,0x1c(%rsp)
  movss  D39(%rip),%xmm6
  movss  %xmm6,0x10(%rsp)
  jmp    L513
L384:
  call   <sqrtf@plt>
  jmp    L181
L503:
  movaps %xmm0,%xmm2
  movss  0x10(%rsp),%xmm6
  movaps %xmm6,%xmm1
  andps  %xmm0,%xmm1
  movss  D115(%rip),%xmm3
  ucomiss %xmm1,%xmm3
  jbe    L49
  cvttss2si %xmm0,%eax
  pxor   %xmm1,%xmm1
  cvtsi2ss %eax,%xmm1
  cmpnless %xmm1,%xmm2
  movss  D212(%rip),%xmm3
  andps  %xmm3,%xmm2
  addss  %xmm2,%xmm1
  andnps %xmm0,%xmm6
  movaps %xmm6,%xmm2
  orps   %xmm1,%xmm2
L49:
  cvttss2si %xmm2,%eax
L485:
  cmp    %r15d,%eax
  cmovg  %r15d,%eax
  cltq
  shl    $0x2,%rax
  lea    (%r14,%rax,1),%rdx
  movss  0x0(%r13),%xmm0
  movss  (%r12),%xmm1
  mulss  %xmm0,%xmm0
  mulss  %xmm1,%xmm1
  addss  %xmm1,%xmm0
  addss  (%rdx),%xmm0
  movss  %xmm0,(%rdx)
  addl   $0x1,(%rbx,%rax,1)
  mov    (%rsp),%rax
  add    %rax,%r13
  add    %rax,%r12
  add    $0x1,%ebp
  je     L261
L465:
  mov    %ebp,%eax
  imul   %ebp,%eax
  add    0xc(%rsp),%eax
  pxor   %xmm0,%xmm0
  cvtsi2ss %eax,%xmm0
  pxor   %xmm6,%xmm6
  ucomiss %xmm0,%xmm6
  ja     L384
  sqrtss %xmm0,%xmm0
L181:
  movaps %xmm0,%xmm2
  movss  D39(%rip),%xmm1
  andps  %xmm0,%xmm1
  movss  D115(%rip),%xmm3
  ucomiss %xmm1,%xmm3
  jbe    L524
  cvttss2si %xmm0,%eax
  pxor   %xmm1,%xmm1
  cvtsi2ss %eax,%xmm1
  movaps %xmm1,%xmm2
  cmpnless %xmm0,%xmm2
  movss  D212(%rip),%xmm3
  andps  %xmm3,%xmm2
  subss  %xmm2,%xmm1
  movss  D39(%rip),%xmm2
  andnps %xmm0,%xmm2
  orps   %xmm1,%xmm2
L524:
  pxor   %xmm1,%xmm1
  cvtss2sd %xmm0,%xmm1
  pxor   %xmm3,%xmm3
  cvtss2sd %xmm2,%xmm3
  subsd  %xmm3,%xmm1
  movsd  D292(%rip),%xmm3
  comisd %xmm1,%xmm3
  jbe    L503
  cvttss2si %xmm2,%eax
  jmp    L485
L261:
  addq   $0x4,0x38(%rsp)
  addl   $0x1,0x1c(%rsp)
  je     L419
L513:
  mov    0x18(%rsp),%ecx
  mov    0x48(%rsp),%eax
  cmp    %eax,%ecx
  jle    L261
  mov    0x1c(%rsp),%esi
  mov    %esi,%edi
  imul   %esi,%edi
  mov    %edi,0xc(%rsp)
  sub    %ecx,%eax
  mov    %eax,%ebp
  mov    0x28(%rsp),%r13
  mov    0x38(%rsp),%rax
  add    %rax,%r13
  mov    0x30(%rsp),%r12
  add    %rax,%r12
  jmp    L465
L419:
  mov    0x40(%rsp),%rax
  shl    $0x2,%rax
  mov    %rax,0x38(%rsp)
  movss  D39(%rip),%xmm7
  movss  %xmm7,0x1c(%rsp)
  mov    %r14,0x10(%rsp)
  mov    0x48(%rsp),%r14d
  jmp    L75
L39:
  call   <sqrtf@plt>
  jmp    L392
L478:
  movaps %xmm0,%xmm2
  movss  0x1c(%rsp),%xmm7
  movaps %xmm7,%xmm1
  andps  %xmm0,%xmm1
  movss  D115(%rip),%xmm3
  ucomiss %xmm1,%xmm3
  jbe    L2
  cvttss2si %xmm0,%eax
  pxor   %xmm1,%xmm1
  cvtsi2ss %eax,%xmm1
  cmpnless %xmm1,%xmm2
  movss  D212(%rip),%xmm3
  andps  %xmm3,%xmm2
  addss  %xmm2,%xmm1
  andnps %xmm0,%xmm7
  movaps %xmm7,%xmm2
  orps   %xmm1,%xmm2
L2:
  cvttss2si %xmm2,%eax
L74:
  cmp    %r15d,%eax
  cmovg  %r15d,%eax
  cltq
  shl    $0x2,%rax
  mov    0x10(%rsp),%rsi
  lea    (%rsi,%rax,1),%rdx
  movss  0x0(%r13),%xmm0
  movss  (%r12),%xmm1
  mulss  %xmm0,%xmm0
  mulss  %xmm1,%xmm1
  addss  %xmm1,%xmm0
  addss  (%rdx),%xmm0
  movss  %xmm0,(%rdx)
  addl   $0x1,(%rbx,%rax,1)
  add    $0x1,%ebp
  mov    (%rsp),%rax
  add    %rax,%r13
  add    %rax,%r12
  cmp    %r14d,%ebp
  jge    L167
L96:
  mov    %ebp,%eax
  imul   %ebp,%eax
  add    0xc(%rsp),%eax
  pxor   %xmm0,%xmm0
  cvtsi2ss %eax,%xmm0
  pxor   %xmm7,%xmm7
  ucomiss %xmm0,%xmm7
  ja     L39
  sqrtss %xmm0,%xmm0
L392:
  movaps %xmm0,%xmm2
  movss  D39(%rip),%xmm1
  andps  %xmm0,%xmm1
  movss  D115(%rip),%xmm3
  ucomiss %xmm1,%xmm3
  jbe    L307
  cvttss2si %xmm0,%eax
  pxor   %xmm1,%xmm1
  cvtsi2ss %eax,%xmm1
  movaps %xmm1,%xmm2
  cmpnless %xmm0,%xmm2
  movss  D212(%rip),%xmm3
  andps  %xmm3,%xmm2
  subss  %xmm2,%xmm1
  movss  D39(%rip),%xmm2
  andnps %xmm0,%xmm2
  orps   %xmm1,%xmm2
L307:
  pxor   %xmm1,%xmm1
  cvtss2sd %xmm0,%xmm1
  pxor   %xmm3,%xmm3
  cvtss2sd %xmm2,%xmm3
  subsd  %xmm3,%xmm1
  movsd  D292(%rip),%xmm3
  comisd %xmm1,%xmm3
  jbe    L478
  cvttss2si %xmm2,%eax
  jmp    L74
L167:
  addq   $0x4,0x38(%rsp)
  addl   $0x1,0x20(%rsp)
  je     L240
L75:
  cmpl   $0x1,0x18(%rsp)
  jle    L167
  mov    0x20(%rsp),%edi
  mov    %edi,%eax
  imul   %edi,%eax
  mov    %eax,0xc(%rsp)
  mov    0x28(%rsp),%r13
  mov    0x38(%rsp),%rax
  add    %rax,%r13
  mov    0x30(%rsp),%r12
  add    %rax,%r12
  mov    $0x0,%ebp
  jmp    L96
L240:
  mov    0x10(%rsp),%r14
L23:
  cmpl   $0xffffffff,0x4c(%rsp)
  jl     L209
  mov    $0x0,%eax
  jmp    L139
L280:
  add    $0x1,%rax
  cmp    %eax,%r15d
  jl     L209
L139:
  mov    (%rbx,%rax,4),%edx
  test   %edx,%edx
  je     L280
  pxor   %xmm0,%xmm0
  cvtsi2ss %eax,%xmm0
  mulss  (%r14,%rax,4),%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2ss %edx,%xmm1
  divss  %xmm1,%xmm0
  movss  %xmm0,(%r14,%rax,4)
  jmp    L280
L209:
  mov    %rbx,%rdi
  call   <free@plt>
  add    $0x58,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: read_data
arguments: data_label: D39
type_infered: byte[4]
name: read_data
arguments: data_label: D115
type_infered: byte[4]
name: read_data
arguments: data_label: D212
type_infered: byte[4]
name: read_data
arguments: data_label: D292
type_infered: f64

tool: {"D39": [0xff,0xff,0xff,0x7f]}

tool: {"D115": [0x00,0x00,0x00,0x4b]}

tool: {"D212": [0x00,0x00,0x80,0x3f]}

tool: D292: 0.5

assistant: ```c
void powspec2d(float *Fr, float *Fi, float *PS2d, int N1, int N2) {
  int i, j, n, a, b;
  int ind, ind2, *number;
  float val;
  n = (N1 < N2 ? N1 : N2) / 2;
  number = (int *)malloc((n + 1) * sizeof(int));
  for (i = 0; i <= n; i++) {
    PS2d[i] = 0;
    number[i] = 0;
  }
  for (i = 0; i < N1 / 2; i++)
    for (j = 0; j < N2 / 2; j++) {
      a = i;
      b = j;
      ind2 = i + j * N1;
      val = sqrt((float)(a * a + b * b));
      if ((val - floor(val)) < 0.5)
        ind = (int)floor(val);
      else
        ind = (int)ceil(val);
      if (ind > n)
        ind = n;
      PS2d[ind] += Fr[ind2] * Fr[ind2] + Fi[ind2] * Fi[ind2];
      number[ind]++;
    }
  for (i = 0; i < N1 / 2; i++)
    for (j = N2 / 2; j < N2; j++) {
      a = i;
      b = j - N2;
      ind2 = i + j * N1;
      val = sqrt((float)(a * a + b * b));
      if ((val - floor(val)) < 0.5)
        ind = (int)floor(val);
      else
        ind = (int)ceil(val);
      if (ind > n)
        ind = n;
      PS2d[ind] += Fr[ind2] * Fr[ind2] + Fi[ind2] * Fi[ind2];
      number[ind]++;
    }
  for (i = N1 / 2; i < N1; i++)
    for (j = N2 / 2; j < N2; j++) {
      a = i - N1;
      b = j - N2;
      ind2 = i + j * N1;
      val = sqrt((float)(a * a + b * b));
      if ((val - floor(val)) < 0.5)
        ind = (int)floor(val);
      else
        ind = (int)ceil(val);
      if (ind > n)
        ind = n;
      PS2d[ind] += Fr[ind2] * Fr[ind2] + Fi[ind2] * Fi[ind2];
      number[ind]++;
    }
  for (i = N1 / 2; i < N1; i++)
    for (j = 0; j < N2 / 2; j++) {
      a = i - N1;
      b = j;
      ind2 = i + j * N1;
      val = sqrt((float)(a * a + b * b));
      if ((val - floor(val)) < 0.5)
        ind = (int)floor(val);
      else
        ind = (int)ceil(val);
      if (ind > n)
        ind = n;
      PS2d[ind] += Fr[ind2] * Fr[ind2] + Fi[ind2] * Fi[ind2];
      number[ind]++;
    }
  for (i = 0; i <= n; i++) {
    if (number[i] != 0)
      PS2d[i] = (float)(i)*PS2d[i] / (float)number[i];
  }
  free(number);
}
```