user: 请将以下的汇编代码转换成C语言代码:

```asm
<do_ftuneven>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  mov    %rdx,%rbp
  push   %rbx
  sub    $0xc8,%rsp
  mov    %edi,0x5c(%rsp)
  movsd  %xmm0,0x68(%rsp)
  movsd  %xmm1,0x88(%rsp)
  test   %edi,%edi
  jle    L210
  pxor   %xmm4,%xmm4
  mov    %rdx,%rax
  lea    -0x1(%rdi),%edx
  lea    0x8(%rbp,%rdx,8),%rdx
  movsd  %xmm4,0x38(%rsp)
  movapd %xmm4,%xmm0
  nop
L204:
  addsd  (%rax),%xmm0
  add    $0x8,%rax
  cmp    %rax,%rdx
  jne    L204
L92:
  mov    0x5c(%rsp),%edx
  pxor   %xmm5,%xmm5
  cvtsi2sd %edx,%xmm5
  movsd  %xmm5,0x80(%rsp)
  divsd  %xmm5,%xmm0
  movsd  %xmm0,0x30(%rsp)
  test   %ecx,%ecx
  jle    L106
  mov    0x100(%rsp),%rax
  mov    %r8,0x40(%rsp)
  mov    %r9,%rbx
  mov    %rax,0x50(%rsp)
  mov    0x108(%rsp),%rax
  mov    %rax,0x48(%rsp)
  lea    -0x1(%rcx),%eax
  lea    0x8(%r8,%rax,8),%rax
  mov    %rax,0x60(%rsp)
  lea    -0x1(%rdx),%eax
  mov    %rax,0x98(%rsp)
  shl    $0x3,%rax
  lea    0x8(%r12,%rax,1),%rcx
  lea    0x8(%rbp,%rax,1),%rax
  mov    %rcx,0x90(%rsp)
  mov    %rax,0xa0(%rsp)
  nopl   0x0(%rax)
L117:
  mov    0x40(%rsp),%rax
  movsd  (%rax),%xmm4
  ucomisd 0x38(%rsp),%xmm4
  movsd  %xmm4,0x20(%rsp)
  jp     L56
  je     L127
L56:
  mov    0x5c(%rsp),%edx
  test   %edx,%edx
  jle    L85
  movsd  0x20(%rsp),%xmm6
  movsd  0x38(%rsp),%xmm1
  mov    %rbx,0x18(%rsp)
  mov    %r12,%rbx
  mov    0x90(%rsp),%r13
  lea    0xb8(%rsp),%r15
  lea    0xb0(%rsp),%r14
  movapd %xmm6,%xmm7
  movapd %xmm1,%xmm2
  addsd  %xmm6,%xmm7
  movsd  %xmm7,0x10(%rsp)
  nopw   0x0(%rax,%rax,1)
L197:
  movsd  0x10(%rsp),%xmm0
  mulsd  (%rbx),%xmm0
  mov    %r14,%rsi
  mov    %r15,%rdi
  add    $0x8,%rbx
  movsd  %xmm2,0x8(%rsp)
  movsd  %xmm1,(%rsp)
  call   <sincos@plt>
  movsd  (%rsp),%xmm1
  movsd  0x8(%rsp),%xmm2
  addsd  0xb0(%rsp),%xmm1
  addsd  0xb8(%rsp),%xmm2
  cmp    %rbx,%r13
  jne    L197
  movapd %xmm2,%xmm0
  mov    0x18(%rsp),%rbx
  xor    %r13d,%r13d
  call   <atan2@plt>
  mulsd  D0(%rip),%xmm0
  movsd  0x38(%rsp),%xmm3
  mov    %rbx,0x70(%rsp)
  mov    0x98(%rsp),%rbx
  movapd %xmm3,%xmm5
  movapd %xmm3,%xmm6
  movapd %xmm3,%xmm4
  movsd  %xmm0,0x28(%rsp)
  nopl   0x0(%rax)
L138:
  movsd  0x20(%rsp),%xmm0
  mulsd  (%r12,%r13,8),%xmm0
  mov    %r14,%rsi
  mov    %r15,%rdi
  subsd  0x28(%rsp),%xmm0
  movsd  %xmm5,0x18(%rsp)
  movsd  %xmm6,0x10(%rsp)
  movsd  %xmm4,0x8(%rsp)
  movsd  %xmm3,(%rsp)
  call   <sincos@plt>
  movsd  0x0(%rbp,%r13,8),%xmm0
  movsd  (%rsp),%xmm3
  mov    %r13,%rax
  subsd  0x30(%rsp),%xmm0
  movsd  0x8(%rsp),%xmm4
  add    $0x1,%r13
  movsd  0xb0(%rsp),%xmm2
  movsd  0x10(%rsp),%xmm6
  movsd  0xb8(%rsp),%xmm1
  movsd  0x18(%rsp),%xmm5
  movapd %xmm0,%xmm7
  mulsd  %xmm2,%xmm7
  mulsd  %xmm1,%xmm0
  mulsd  %xmm2,%xmm2
  mulsd  %xmm1,%xmm1
  addsd  %xmm7,%xmm3
  addsd  %xmm0,%xmm4
  addsd  %xmm2,%xmm6
  addsd  %xmm1,%xmm5
  cmp    %rax,%rbx
  jne    L138
  movsd  0x68(%rsp),%xmm7
  comisd 0x38(%rsp),%xmm7
  mov    D17(%rip),%rax
  mov    0x70(%rsp),%rbx
  movq   %rax,%xmm1
  jbe    L89
  divsd  %xmm1,%xmm3
  divsd  %xmm1,%xmm4
L89:
  movsd  0x38(%rsp),%xmm7
  ucomisd %xmm6,%xmm7
  ja     L95
L46:
  movapd %xmm6,%xmm0
  sqrtsd %xmm0,%xmm0
L213:
  mulsd  %xmm1,%xmm0
  movsd  0x38(%rsp),%xmm7
  movsd  0x68(%rsp),%xmm2
  movapd %xmm3,%xmm8
  mulsd  %xmm4,%xmm2
  ucomisd %xmm5,%xmm7
  divsd  %xmm0,%xmm8
  ja     L17
  movapd %xmm5,%xmm0
  sqrtsd %xmm0,%xmm0
L22:
  mulsd  %xmm1,%xmm0
  movsd  0x20(%rsp),%xmm1
  mov    %r14,%rsi
  mov    %r15,%rdi
  mulsd  0x88(%rsp),%xmm1
  movsd  %xmm5,0x78(%rsp)
  movsd  %xmm6,0x70(%rsp)
  movsd  %xmm8,0x18(%rsp)
  movsd  %xmm4,0x10(%rsp)
  movsd  %xmm3,0x8(%rsp)
  divsd  %xmm0,%xmm2
  movsd  0x28(%rsp),%xmm0
  subsd  %xmm1,%xmm0
  movsd  %xmm2,(%rsp)
  call   <sincos@plt>
  movsd  0x8(%rsp),%xmm3
  movsd  (%rsp),%xmm2
  movsd  0x10(%rsp),%xmm4
  movsd  0x70(%rsp),%xmm6
  mulsd  %xmm3,%xmm3
  movsd  0x78(%rsp),%xmm5
  movsd  0xb0(%rsp),%xmm0
  mulsd  %xmm4,%xmm4
  movsd  0x18(%rsp),%xmm8
  mov    0x50(%rsp),%rax
  movsd  0xb8(%rsp),%xmm1
  movapd %xmm0,%xmm7
  mulsd  %xmm8,%xmm7
  mulsd  %xmm2,%xmm0
  movapd %xmm1,%xmm9
  divsd  %xmm6,%xmm3
  mulsd  %xmm2,%xmm9
  mulsd  %xmm8,%xmm1
  subsd  %xmm9,%xmm7
  addsd  %xmm1,%xmm0
  movsd  %xmm7,(%rbx)
  movsd  %xmm0,(%rax)
  mov    0x48(%rsp),%rax
  divsd  %xmm5,%xmm4
  addsd  %xmm4,%xmm3
  movsd  %xmm3,(%rax)
L157:
  addq   $0x8,0x40(%rsp)
  add    $0x8,%rbx
  mov    0x40(%rsp),%rax
  addq   $0x8,0x50(%rsp)
  addq   $0x8,0x48(%rsp)
  cmp    %rax,0x60(%rsp)
  jne    L117
L106:
  add    $0xc8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L127:
  mov    0x5c(%rsp),%eax
  movq   $0x0,(%rbx)
  test   %eax,%eax
  jle    L59
  movsd  0x30(%rsp),%xmm2
  mov    0xa0(%rsp),%rdx
  mov    %rbp,%rax
  pxor   %xmm1,%xmm1
L14:
  movsd  (%rax),%xmm0
  add    $0x8,%rax
  subsd  %xmm2,%xmm0
  addsd  %xmm0,%xmm1
  movsd  %xmm1,(%rbx)
  cmp    %rax,%rdx
  jne    L14
L9:
  movsd  0x80(%rsp),%xmm3
  movsd  0x38(%rsp),%xmm5
  ucomisd %xmm3,%xmm5
  ja     L71
  sqrtsd %xmm3,%xmm3
  movapd %xmm3,%xmm0
L87:
  divsd  %xmm0,%xmm1
  mov    0x50(%rsp),%rax
  movsd  %xmm1,(%rbx)
  movq   $0x0,(%rax)
  movsd  (%rbx),%xmm0
  mov    0x48(%rsp),%rax
  mulsd  %xmm0,%xmm0
  movsd  %xmm0,(%rax)
  jmp    L157
  nopl   0x0(%rax)
L85:
  movsd  0x38(%rsp),%xmm3
  mov    D17(%rip),%rax
  lea    0xb8(%rsp),%r15
  lea    0xb0(%rsp),%r14
  movapd %xmm3,%xmm5
  movapd %xmm3,%xmm6
  movapd %xmm3,%xmm4
  movsd  %xmm3,0x28(%rsp)
  movq   %rax,%xmm1
  jmp    L46
  nopl   0x0(%rax)
L59:
  pxor   %xmm1,%xmm1
  jmp    L9
L210:
  pxor   %xmm5,%xmm5
  movsd  %xmm5,0x38(%rsp)
  movapd %xmm5,%xmm0
  jmp    L92
L95:
  movapd %xmm6,%xmm0
  movsd  %xmm1,0x70(%rsp)
  movsd  %xmm5,0x18(%rsp)
  movsd  %xmm4,0x10(%rsp)
  movsd  %xmm3,0x8(%rsp)
  movsd  %xmm6,(%rsp)
  call   <sqrt@plt>
  movsd  0x70(%rsp),%xmm1
  movsd  (%rsp),%xmm6
  movsd  0x18(%rsp),%xmm5
  movsd  0x10(%rsp),%xmm4
  movsd  0x8(%rsp),%xmm3
  jmp    L213
L71:
  movsd  0x80(%rsp),%xmm0
  movsd  %xmm1,(%rsp)
  call   <sqrt@plt>
  movsd  (%rsp),%xmm1
  jmp    L87
L17:
  movapd %xmm5,%xmm0
  movsd  %xmm6,0x78(%rsp)
  movsd  %xmm1,0xa8(%rsp)
  movsd  %xmm8,0x70(%rsp)
  movsd  %xmm4,0x18(%rsp)
  movsd  %xmm3,0x10(%rsp)
  movsd  %xmm2,0x8(%rsp)
  movsd  %xmm5,(%rsp)
  call   <sqrt@plt>
  movsd  0x78(%rsp),%xmm6
  movsd  (%rsp),%xmm5
  movsd  0xa8(%rsp),%xmm1
  movsd  0x70(%rsp),%xmm8
  movsd  0x18(%rsp),%xmm4
  movsd  0x10(%rsp),%xmm3
  movsd  0x8(%rsp),%xmm2
  jmp    L22
```

tool_calls: name: unpack_data
arguments: label: D0
data_type: f64
name: unpack_data
arguments: label: D17
data_type: byte[8]

tool: D0: 0.5

tool: {"D17": [0xcd,0x3b,0x7f,0x66,0x9e,0xa0,0xf6,0x3f]}

assistant: ```c
void do_ftuneven(int NJD, double *t, double *mag, double ft_sign, double tt_zero, int Nfreq, double *freqvals, double *FT_real, double *FT_imag, double *FT_periodogram) {
  int ii_ww, ii_t;
  double magmean;
  double wrun, csum, ssum, wtau, sumr, sumi, scos2, ssin2, cval, sval;
  double ft_real, ft_imag, phi_this;
  magmean = 0.0;
  for (ii_t = 0; ii_t < NJD; ii_t++) {
    magmean += mag[ii_t];
  }
  magmean = magmean / (double)NJD;
  for (ii_ww = 0; ii_ww < Nfreq; ii_ww++) {
    wrun = freqvals[ii_ww];
    if (wrun == 0.0) {
      FT_real[ii_ww] = 0.0;
      for (ii_t = 0; ii_t < NJD; ii_t++) {
        FT_real[ii_ww] += (mag[ii_t] - magmean);
      }
      FT_real[ii_ww] = FT_real[ii_ww] / sqrt(NJD);
      FT_imag[ii_ww] = 0.0;
      FT_periodogram[ii_ww] = FT_real[ii_ww] * FT_real[ii_ww];
    } else {
      csum = 0.0;
      ssum = 0.0;
      for (ii_t = 0; ii_t < NJD; ii_t++) {
        csum += cos(2.0 * wrun * t[ii_t]);
        ssum += sin(2.0 * wrun * t[ii_t]);
      }
      wtau = 0.5 * atan2(ssum, csum);
      sumr = 0.0;
      sumi = 0.0;
      scos2 = 0.0;
      ssin2 = 0.0;
      for (ii_t = 0; ii_t < NJD; ii_t++) {
        cval = cos(wrun * t[ii_t] - wtau);
        sval = sin(wrun * t[ii_t] - wtau);
        sumr += (mag[ii_t] - magmean) * cval;
        sumi += (mag[ii_t] - magmean) * sval;
        scos2 += cval * cval;
        ssin2 += sval * sval;
      }
      if (ft_sign > 0) {
        sumr = sumr / sqrt(2.0);
        sumi = sumi / sqrt(2.0);
      }
      ft_real = sumr / (sqrt(2.0) * sqrt(scos2));
      ft_imag = ft_sign * sumi / (sqrt(2.0) * sqrt(ssin2));
      phi_this = wtau - wrun * tt_zero;
      FT_real[ii_ww] = ft_real * cos(phi_this) - ft_imag * sin(phi_this);
      FT_imag[ii_ww] = ft_imag * cos(phi_this) + ft_real * sin(phi_this);
      FT_periodogram[ii_ww] = (sumr * sumr / scos2) + (sumi * sumi / ssin2);
    }
  }
}
```