user: What is the c source code of the assembly code below?

```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    L237
  cmp    $0x1,%edi
  je     L133
  shr    %edi
  mov    %rdx,%rax
  pxor   %xmm5,%xmm5
  mov    %edi,%edx
  movsd  %xmm5,0x38(%rsp)
  movapd %xmm5,%xmm0
  sub    $0x1,%edx
  shl    $0x4,%rdx
  lea    0x10(%rbp,%rdx,1),%rdx
L190:
  movsd  (%rax),%xmm1
  add    $0x10,%rax
  addsd  %xmm1,%xmm0
  movsd  -0x8(%rax),%xmm1
  addsd  %xmm1,%xmm0
  cmp    %rax,%rdx
  jne    L190
  mov    0x5c(%rsp),%edx
  mov    %edx,%eax
  and    $0xfffffffe,%eax
  and    $0x1,%edx
  je     L194
L67:
  cltq
  addsd  0x0(%rbp,%rax,8),%xmm0
L194:
  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    L20
  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)
  nop
L56:
  mov    0x40(%rsp),%rax
  movsd  (%rax),%xmm4
  ucomisd 0x38(%rsp),%xmm4
  movsd  %xmm4,0x20(%rsp)
  jp     L65
  je     L40
L65:
  mov    0x5c(%rsp),%edx
  test   %edx,%edx
  jle    L228
  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)
L166:
  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    L166
  movapd %xmm2,%xmm0
  mov    0x18(%rsp),%rbx
  xor    %r13d,%r13d
  call   <atan2@plt>
  mulsd  D18(%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)
L164:
  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    L164
  movsd  0x68(%rsp),%xmm7
  comisd 0x38(%rsp),%xmm7
  mov    D19(%rip),%rax
  mov    0x70(%rsp),%rbx
  movq   %rax,%xmm1
  jbe    L114
  divsd  %xmm1,%xmm3
  divsd  %xmm1,%xmm4
L114:
  movsd  0x38(%rsp),%xmm7
  ucomisd %xmm6,%xmm7
  ja     L152
L240:
  movapd %xmm6,%xmm0
  sqrtsd %xmm0,%xmm0
L106:
  mulsd  %xmm1,%xmm0
  movsd  0x38(%rsp),%xmm7
  movsd  0x68(%rsp),%xmm2
  movapd %xmm3,%xmm8
  mulsd  %xmm4,%xmm2
  ucomisd %xmm5,%xmm7
  divsd  %xmm0,%xmm8
  ja     L31
  movapd %xmm5,%xmm0
  sqrtsd %xmm0,%xmm0
L162:
  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)
L126:
  addq   $0x8,0x40(%rsp)
  add    $0x8,%rbx
  mov    0x40(%rsp),%rax
  addq   $0x8,0x50(%rsp)
  addq   $0x8,0x48(%rsp)
  cmp    %rax,0x60(%rsp)
  jne    L56
L20:
  add    $0xc8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L40:
  mov    0x5c(%rsp),%eax
  movq   $0x0,(%rbx)
  test   %eax,%eax
  jle    L13
  movsd  0x30(%rsp),%xmm2
  mov    0xa0(%rsp),%rdx
  mov    %rbp,%rax
  pxor   %xmm1,%xmm1
L39:
  movsd  (%rax),%xmm0
  add    $0x8,%rax
  subsd  %xmm2,%xmm0
  addsd  %xmm0,%xmm1
  movsd  %xmm1,(%rbx)
  cmp    %rdx,%rax
  jne    L39
L3:
  movsd  0x80(%rsp),%xmm3
  movsd  0x38(%rsp),%xmm5
  ucomisd %xmm3,%xmm5
  ja     L181
  sqrtsd %xmm3,%xmm3
  movapd %xmm3,%xmm0
L229:
  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    L126
  nopl   0x0(%rax)
L228:
  movsd  0x38(%rsp),%xmm3
  mov    D19(%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    L240
  nopl   0x0(%rax)
L13:
  pxor   %xmm1,%xmm1
  jmp    L3
L237:
  pxor   %xmm6,%xmm6
  movsd  %xmm6,0x38(%rsp)
  movapd %xmm6,%xmm0
  jmp    L194
L133:
  pxor   %xmm6,%xmm6
  xor    %eax,%eax
  movsd  %xmm6,0x38(%rsp)
  movapd %xmm6,%xmm0
  jmp    L67
L181:
  movapd %xmm3,%xmm0
  movsd  %xmm1,(%rsp)
  call   <sqrt@plt>
  movsd  (%rsp),%xmm1
  jmp    L229
L31:
  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    L162
L152:
  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    L106
```

tool_calls: name: unpack_data
arguments: label: D18
type_infered: f64
name: unpack_data
arguments: label: D19
type_infered: byte[8]

tool: D18: 0.5

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