user: Please show me the C implementation that matches the assembly code listed below:

```asm
<d_realft>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0xb0,%rsp
  mov    %rdi,-0x98(%rbp)
  mov    %rsi,-0xa0(%rbp)
  mov    %edx,-0xa4(%rbp)
  movsd  D16(%rip),%xmm0
  movsd  %xmm0,-0x68(%rbp)
  mov    -0xa0(%rbp),%rax
  shr    %rax
  test   %rax,%rax
  js     L77
  pxor   %xmm0,%xmm0
  cvtsi2sd %rax,%xmm0
  jmp    L54
L77:
  mov    %rax,%rdx
  shr    %rdx
  and    $0x1,%eax
  or     %rax,%rdx
  pxor   %xmm0,%xmm0
  cvtsi2sd %rdx,%xmm0
  addsd  %xmm0,%xmm0
L54:
  movsd  D34(%rip),%xmm1
  divsd  %xmm0,%xmm1
  movsd  %xmm1,-0x70(%rbp)
  cmpl   $0x1,-0xa4(%rbp)
  jne    L37
  movsd  D84(%rip),%xmm0
  movsd  %xmm0,-0x88(%rbp)
  mov    -0xa0(%rbp),%rax
  shr    %rax
  mov    %rax,%rcx
  mov    -0x98(%rbp),%rax
  mov    $0x1,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <d_four1@plt>
  jmp    L63
L37:
  movsd  D16(%rip),%xmm0
  movsd  %xmm0,-0x88(%rbp)
  movsd  -0x70(%rbp),%xmm0
  movq   D72(%rip),%xmm1
  xorpd  %xmm1,%xmm0
  movsd  %xmm0,-0x70(%rbp)
L63:
  movsd  -0x70(%rbp),%xmm1
  movsd  D16(%rip),%xmm0
  mulsd  %xmm0,%xmm1
  movq   %xmm1,%rax
  movq   %rax,%xmm0
  call   <sin@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x60(%rbp)
  movsd  -0x60(%rbp),%xmm1
  movsd  D17(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  -0x60(%rbp),%xmm1
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x58(%rbp)
  mov    -0x70(%rbp),%rax
  movq   %rax,%xmm0
  call   <sin@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x50(%rbp)
  movsd  -0x58(%rbp),%xmm1
  movsd  D4(%rip),%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x80(%rbp)
  movsd  -0x50(%rbp),%xmm0
  movsd  %xmm0,-0x78(%rbp)
  mov    -0xa0(%rbp),%rax
  add    $0x3,%rax
  mov    %rax,-0x48(%rbp)
  movq   $0x2,-0x90(%rbp)
  jmp    L23
L7:
  mov    -0x90(%rbp),%rax
  add    %rax,%rax
  sub    $0x1,%rax
  mov    %rax,-0x38(%rbp)
  mov    -0x38(%rbp),%rax
  add    $0x1,%rax
  mov    %rax,-0x30(%rbp)
  mov    -0x48(%rbp),%rax
  sub    -0x30(%rbp),%rax
  mov    %rax,-0x28(%rbp)
  mov    -0x28(%rbp),%rax
  add    $0x1,%rax
  mov    %rax,-0x20(%rbp)
  mov    -0x38(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x98(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0x28(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x98(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  addsd  %xmm1,%xmm0
  movsd  -0x68(%rbp),%xmm1
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x40(%rbp)
  mov    -0x30(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x98(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x20(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x98(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  subsd  %xmm1,%xmm0
  movsd  -0x68(%rbp),%xmm1
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x18(%rbp)
  movsd  -0x88(%rbp),%xmm0
  movq   D72(%rip),%xmm1
  xorpd  %xmm0,%xmm1
  mov    -0x30(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x98(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm2
  mov    -0x20(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x98(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  addsd  %xmm2,%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x10(%rbp)
  mov    -0x38(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x98(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x28(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x98(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  subsd  %xmm1,%xmm0
  movsd  -0x88(%rbp),%xmm1
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  movsd  -0x80(%rbp),%xmm0
  mulsd  -0x10(%rbp),%xmm0
  addsd  -0x40(%rbp),%xmm0
  movsd  -0x78(%rbp),%xmm1
  mulsd  -0x8(%rbp),%xmm1
  mov    -0x38(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x98(%rbp),%rax
  add    %rdx,%rax
  subsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  movsd  -0x80(%rbp),%xmm0
  mulsd  -0x8(%rbp),%xmm0
  movapd %xmm0,%xmm1
  addsd  -0x18(%rbp),%xmm1
  movsd  -0x78(%rbp),%xmm0
  mulsd  -0x10(%rbp),%xmm0
  mov    -0x30(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x98(%rbp),%rax
  add    %rdx,%rax
  addsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  movsd  -0x80(%rbp),%xmm0
  movapd %xmm0,%xmm2
  mulsd  -0x10(%rbp),%xmm2
  movsd  -0x40(%rbp),%xmm0
  movapd %xmm0,%xmm1
  subsd  %xmm2,%xmm1
  movsd  -0x78(%rbp),%xmm0
  mulsd  -0x8(%rbp),%xmm0
  mov    -0x28(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x98(%rbp),%rax
  add    %rdx,%rax
  addsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  movsd  -0x80(%rbp),%xmm0
  mulsd  -0x8(%rbp),%xmm0
  movapd %xmm0,%xmm1
  subsd  -0x18(%rbp),%xmm1
  movsd  -0x78(%rbp),%xmm0
  mulsd  -0x10(%rbp),%xmm0
  mov    -0x20(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x98(%rbp),%rax
  add    %rdx,%rax
  addsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  movsd  -0x80(%rbp),%xmm0
  movsd  %xmm0,-0x60(%rbp)
  movsd  -0x60(%rbp),%xmm0
  mulsd  -0x58(%rbp),%xmm0
  movsd  -0x78(%rbp),%xmm1
  mulsd  -0x50(%rbp),%xmm1
  subsd  %xmm1,%xmm0
  movsd  -0x80(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x80(%rbp)
  movsd  -0x78(%rbp),%xmm0
  movapd %xmm0,%xmm1
  mulsd  -0x58(%rbp),%xmm1
  movsd  -0x60(%rbp),%xmm0
  mulsd  -0x50(%rbp),%xmm0
  addsd  %xmm1,%xmm0
  movsd  -0x78(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x78(%rbp)
  addq   $0x1,-0x90(%rbp)
L23:
  mov    -0xa0(%rbp),%rax
  shr    $0x2,%rax
  cmp    %rax,-0x90(%rbp)
  jbe    L7
  cmpl   $0x1,-0xa4(%rbp)
  jne    L8
  mov    -0x98(%rbp),%rax
  movsd  0x8(%rax),%xmm0
  movsd  %xmm0,-0x40(%rbp)
  mov    -0x98(%rbp),%rax
  add    $0x10,%rax
  movsd  (%rax),%xmm0
  mov    -0x98(%rbp),%rax
  add    $0x8,%rax
  addsd  -0x40(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x98(%rbp),%rax
  add    $0x10,%rax
  movsd  (%rax),%xmm1
  mov    -0x98(%rbp),%rax
  add    $0x10,%rax
  movsd  -0x40(%rbp),%xmm0
  subsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  jmp    L28
L8:
  mov    -0x98(%rbp),%rax
  movsd  0x8(%rax),%xmm0
  movsd  %xmm0,-0x40(%rbp)
  mov    -0x98(%rbp),%rax
  add    $0x10,%rax
  movsd  (%rax),%xmm0
  addsd  -0x40(%rbp),%xmm0
  mov    -0x98(%rbp),%rax
  add    $0x8,%rax
  mulsd  -0x68(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x98(%rbp),%rax
  add    $0x10,%rax
  movsd  (%rax),%xmm1
  movsd  -0x40(%rbp),%xmm0
  subsd  %xmm1,%xmm0
  mov    -0x98(%rbp),%rax
  add    $0x10,%rax
  mulsd  -0x68(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0xa0(%rbp),%rax
  shr    %rax
  mov    %rax,%rcx
  mov    -0x98(%rbp),%rax
  mov    $0xffffffff,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <d_four1@plt>
L28:
  nop
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: label: D16
datatype: f64
name: retrieve_data
arguments: label: D34
datatype: f64
name: retrieve_data
arguments: label: D84
datatype: byte[8]
name: retrieve_data
arguments: label: D72
datatype: byte[8]
name: retrieve_data
arguments: label: D17
datatype: byte[8]
name: retrieve_data
arguments: label: D4
datatype: f64

tool: D16: 0.5

tool: D34: 3.141592653589793

tool: {"D84": [0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0xbf]}

tool: {"D72": [0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80]}

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

tool: D4: 1

assistant: ```c
void d_realft(double data[], unsigned long n, int isign) {
  void d_four1(double data[], unsigned long nn, int isign);
  unsigned long i, i1, i2, i3, i4, np3;
  double c1 = 0.5, c2, h1r, h1i, h2r, h2i;
  double wr, wi, wpr, wpi, wtemp, theta;
  theta = 3.141592653589793 / (double)(n >> 1);
  if (isign == 1) {
    c2 = -0.5;
    d_four1(data, n >> 1, 1);
  } else {
    c2 = 0.5;
    theta = -theta;
  }
  wtemp = sin(0.5 * theta);
  wpr = -2.0 * wtemp * wtemp;
  wpi = sin(theta);
  wr = 1.0 + wpr;
  wi = wpi;
  np3 = n + 3;
  for (i = 2; i <= (n >> 2); i++) {
    i4 = 1 + (i3 = np3 - (i2 = 1 + (i1 = i + i - 1)));
    h1r = c1 * (data[i1] + data[i3]);
    h1i = c1 * (data[i2] - data[i4]);
    h2r = -c2 * (data[i2] + data[i4]);
    h2i = c2 * (data[i1] - data[i3]);
    data[i1] = h1r + wr * h2r - wi * h2i;
    data[i2] = h1i + wr * h2i + wi * h2r;
    data[i3] = h1r - wr * h2r + wi * h2i;
    data[i4] = -h1i + wr * h2i + wi * h2r;
    wr = (wtemp = wr) * wpr - wi * wpi + wr;
    wi = wi * wpr + wtemp * wpi + wi;
  }
  if (isign == 1) {
    data[1] = (h1r = data[1]) + data[2];
    data[2] = h1r - data[2];
  } else {
    data[1] = c1 * ((h1r = data[1]) + data[2]);
    data[2] = c1 * (h1r - data[2]);
    d_four1(data, n >> 1, -1);
  }
}
```