user: Converte this assembly snippet into its equivalent C code:

```asm
<d_realft>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdi,%rbx
  mov    %rsi,%r13
  mov    %edx,%ebp
  mov    %rsi,%r12
  shr    %r12
  pxor   %xmm1,%xmm1
  cvtsi2sd %r12,%xmm1
  movsd  D45(%rip),%xmm0
  divsd  %xmm1,%xmm0
  movsd  %xmm0,0x18(%rsp)
  cmp    $0x1,%edx
  je     L8
  movsd  0x18(%rsp),%xmm7
  xorpd  D44(%rip),%xmm7
  movsd  %xmm7,0x18(%rsp)
  movsd  D99(%rip),%xmm7
  movsd  %xmm7,0x10(%rsp)
L40:
  movsd  0x18(%rsp),%xmm7
  mulsd  D99(%rip),%xmm7
  movapd %xmm7,%xmm0
  call   <sin@plt>
  movapd %xmm0,%xmm1
  mulsd  D60(%rip),%xmm1
  mulsd  %xmm0,%xmm1
  movsd  %xmm1,0x8(%rsp)
  movsd  0x18(%rsp),%xmm0
  call   <sin@plt>
  movapd %xmm0,%xmm5
  movsd  0x8(%rsp),%xmm3
  addsd  D43(%rip),%xmm3
  mov    %r13,%rcx
  shr    $0x2,%rcx
  cmp    $0x7,%r13
  jbe    L23
  lea    0x18(%rbx),%rax
  lea    (%rbx,%r13,8),%rdx
  shl    $0x4,%rcx
  lea    0x8(%rbx,%rcx,1),%rcx
  movapd %xmm0,%xmm4
  movsd  D99(%rip),%xmm6
  movsd  0x10(%rsp),%xmm7
  xorpd  D44(%rip),%xmm7
L54:
  movsd  (%rax),%xmm0
  movsd  -0x8(%rdx),%xmm9
  movapd %xmm0,%xmm1
  addsd  %xmm9,%xmm1
  mulsd  %xmm6,%xmm1
  movsd  0x8(%rax),%xmm2
  movsd  (%rdx),%xmm10
  movapd %xmm2,%xmm8
  subsd  %xmm10,%xmm8
  mulsd  %xmm6,%xmm8
  addsd  %xmm10,%xmm2
  mulsd  %xmm7,%xmm2
  subsd  %xmm9,%xmm0
  mulsd  0x10(%rsp),%xmm0
  movapd %xmm2,%xmm11
  mulsd  %xmm3,%xmm11
  movapd %xmm0,%xmm10
  mulsd  %xmm4,%xmm10
  movapd %xmm11,%xmm9
  addsd  %xmm1,%xmm9
  subsd  %xmm10,%xmm9
  movsd  %xmm9,(%rax)
  mulsd  %xmm3,%xmm0
  mulsd  %xmm4,%xmm2
  movapd %xmm0,%xmm9
  addsd  %xmm8,%xmm9
  addsd  %xmm2,%xmm9
  movsd  %xmm9,0x8(%rax)
  subsd  %xmm11,%xmm1
  addsd  %xmm10,%xmm1
  movsd  %xmm1,-0x8(%rdx)
  subsd  %xmm8,%xmm0
  addsd  %xmm2,%xmm0
  movsd  %xmm0,(%rdx)
  movsd  0x8(%rsp),%xmm2
  movapd %xmm2,%xmm0
  mulsd  %xmm3,%xmm0
  movapd %xmm5,%xmm1
  mulsd  %xmm4,%xmm1
  subsd  %xmm1,%xmm0
  movapd %xmm3,%xmm1
  addsd  %xmm0,%xmm3
  mulsd  %xmm4,%xmm2
  movapd %xmm2,%xmm0
  mulsd  %xmm5,%xmm1
  addsd  %xmm1,%xmm0
  addsd  %xmm0,%xmm4
  add    $0x10,%rax
  sub    $0x10,%rdx
  cmp    %rcx,%rax
  jne    L54
L23:
  cmp    $0x1,%ebp
  jne    L48
  movsd  0x8(%rbx),%xmm0
  movsd  0x10(%rbx),%xmm1
  movapd %xmm1,%xmm2
  addsd  %xmm0,%xmm2
  movsd  %xmm2,0x8(%rbx)
  subsd  %xmm1,%xmm0
  movsd  %xmm0,0x10(%rbx)
L44:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L8:
  mov    $0x1,%edx
  mov    %r12,%rsi
  call   <d_four1@plt>
  movsd  D78(%rip),%xmm6
  movsd  %xmm6,0x10(%rsp)
  jmp    L40
L48:
  movsd  0x8(%rbx),%xmm0
  movsd  0x10(%rbx),%xmm3
  movapd %xmm3,%xmm1
  addsd  %xmm0,%xmm1
  movsd  D99(%rip),%xmm2
  mulsd  %xmm2,%xmm1
  movsd  %xmm1,0x8(%rbx)
  subsd  %xmm3,%xmm0
  mulsd  %xmm2,%xmm0
  movsd  %xmm0,0x10(%rbx)
  mov    $0xffffffff,%edx
  mov    %r12,%rsi
  mov    %rbx,%rdi
  call   <d_four1@plt>
  jmp    L44
```

tool_calls: name: disassemble_data
arguments: label: D45
data_type: f64
name: disassemble_data
arguments: label: D44
data_type: byte[16]
name: disassemble_data
arguments: label: D99
data_type: f64
name: disassemble_data
arguments: label: D60
data_type: byte[8]
name: disassemble_data
arguments: label: D43
data_type: f64
name: disassemble_data
arguments: label: D78
data_type: byte[8]

tool: D45: 3.141592653589793

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

tool: D99: 0.5

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

tool: D43: 1

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

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);
  }
}
```