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

```asm
<Forward_SO3_Naive>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  mov    %r9,%r12
  push   %rbp
  mov    %edi,%ebp
  push   %rbx
  lea    (%rdi,%rdi,1),%ebx
  mov    %ebp,%r11d
  mov    %ebx,%eax
  imul   %ebx,%r11d
  imul   %ebx,%eax
  sub    $0xa8,%rsp
  mov    0xe0(%rsp),%r15
  mov    %rsi,0x10(%rsp)
  mov    %eax,0x98(%rsp)
  imul   %ebx,%eax
  mov    %rdx,0x8(%rsp)
  mov    %r11d,0x9c(%rsp)
  cltq
  mov    %rcx,0x88(%rsp)
  shl    $0x3,%rax
  mov    %r8,0x90(%rsp)
  lea    (%r9,%rax,1),%r13
  mov    %rax,%rdi
  lea    0x0(%r13,%rax,1),%rsi
  movslq %ebx,%rax
  mov    %rsi,0x50(%rsp)
  add    %rsi,%rdi
  lea    0x0(,%rax,8),%rsi
  mov    %rdi,0x58(%rsp)
  lea    (%r15,%rsi,1),%rdi
  mov    %rdi,%rax
  mov    %rdi,0x40(%rsp)
  add    %rsi,%rax
  mov    %rsi,0x20(%rsp)
  mov    %rax,%rdx
  mov    %rax,0x28(%rsp)
  add    %rsi,%rdx
  mov    %rdx,%rax
  mov    %rdx,0x30(%rsp)
  add    %rsi,%rax
  mov    %rax,%r14
  mov    %rax,0x38(%rsp)
  movslq %r11d,%rax
  add    %rsi,%r14
  mov    %rdi,%rsi
  mov    %ebx,%edi
  lea    (%r14,%rax,8),%r11
  mov    %r11,0x18(%rsp)
  call   <SinEvalPts@plt>
  mov    0x28(%rsp),%rsi
  mov    %ebx,%edi
  call   <CosEvalPts@plt>
  mov    0x30(%rsp),%rsi
  mov    %ebx,%edi
  call   <SinEvalPts2@plt>
  mov    0x38(%rsp),%rsi
  mov    %ebx,%edi
  call   <CosEvalPts2@plt>
  mov    %r15,%rsi
  mov    %ebp,%edi
  call   <makeweights2@plt>
  sub    $0x8,%rsp
  mov    %ebx,%r9d
  mov    %r13,%rcx
  push   0x20(%rsp)
  mov    0xa8(%rsp),%r8d
  mov    %r12,%rdx
  mov    0x18(%rsp),%rsi
  mov    0x20(%rsp),%rdi
  call   <grid_invfourier_so3@plt>
  mov    0x60(%rsp),%rsi
  mov    %ebx,%ecx
  mov    %r12,%rdi
  mov    0xa8(%rsp),%edx
  call   <transpose_so3@plt>
  mov    0x68(%rsp),%rsi
  mov    %ebx,%ecx
  mov    %r13,%rdi
  mov    0xa8(%rsp),%edx
  call   <transpose_so3@plt>
  pop    %rax
  push   0x20(%rsp)
  mov    %ebx,%r9d
  mov    0xa8(%rsp),%r8d
  mov    %r13,%rcx
  mov    %r12,%rdx
  mov    0x68(%rsp),%rsi
  mov    0x60(%rsp),%rdi
  call   <grid_invfourier_so3@plt>
  mov    0x60(%rsp),%rsi
  mov    %ebx,%ecx
  mov    %r12,%rdi
  mov    0xa8(%rsp),%edx
  call   <transpose_so3@plt>
  mov    0x68(%rsp),%rsi
  mov    %ebx,%ecx
  mov    %r13,%rdi
  mov    0xa8(%rsp),%edx
  call   <transpose_so3@plt>
  mov    $0x1,%eax
  sub    %ebp,%eax
  mov    %eax,0x74(%rsp)
  pop    %rdx
  pop    %rcx
  test   %ebp,%ebp
  jle    L26
  mov    0x20(%rsp),%rbx
  lea    -0x1(%rbp),%eax
  lea    0x2(%rax),%rdx
  imul   %rbx,%rdx
  mov    %rdx,0x78(%rsp)
  lea    -0x2(%rbp),%edx
  lea    0x3(%rax,%rdx,1),%rax
  mov    %rax,%rsi
  mov    0x90(%rsp),%rax
  imul   %rbx,%rsi
  xor    %ebx,%ebx
  mov    %rax,0x10(%rsp)
  mov    0x88(%rsp),%rax
  mov    %rsi,0x80(%rsp)
  mov    %rax,0x8(%rsp)
  nopw   0x0(%rax,%rax,1)
L52:
  mov    0x50(%rsp),%rax
  mov    0x58(%rsp),%r13
  mov    %rax,0x48(%rsp)
  xor    %eax,%eax
  mov    %r13,%r12
  mov    %eax,%r13d
  nop
L98:
  sub    $0x8,%rsp
  mov    %r13d,%esi
  mov    %ebp,%edx
  mov    %ebx,%edi
  push   0x20(%rsp)
  push   %r14
  push   0x50(%rsp)
  mov    0x50(%rsp),%r9
  mov    0x48(%rsp),%r8
  mov    0x60(%rsp),%rcx
  call   <genWig_L2@plt>
  add    $0x20,%rsp
  mov    %r13d,%esi
  mov    %r15,%r9
  push   0x18(%rsp)
  mov    %r14,%r8
  mov    %ebp,%edx
  mov    %ebx,%edi
  push   0x10(%rsp)
  mov    0x58(%rsp),%rcx
  call   <wigNaiveAnalysis@plt>
  push   0x28(%rsp)
  mov    %r15,%r9
  mov    %r14,%r8
  push   0x28(%rsp)
  mov    %r12,%rcx
  mov    %r13d,%esi
  mov    %ebp,%edx
  mov    %ebx,%edi
  call   <wigNaiveAnalysis@plt>
  mov    0x40(%rsp),%rcx
  mov    %r13d,%esi
  mov    %ebp,%edx
  add    %rcx,0x68(%rsp)
  mov    %ebx,%edi
  add    $0x20,%rsp
  add    %rcx,%r12
  call   <howMany_so3@plt>
  mov    0x8(%rsp),%rcx
  mov    %r13d,%esi
  mov    %ebp,%edx
  cltq
  mov    %ebx,%edi
  lea    (%rcx,%rax,8),%rax
  mov    %rax,0x8(%rsp)
  call   <howMany_so3@plt>
  mov    0x10(%rsp),%rcx
  cltq
  lea    (%rcx,%rax,8),%rax
  mov    %rax,0x10(%rsp)
  mov    %r13d,%eax
  add    $0x1,%r13d
  cmp    %r13d,%ebp
  jne    L98
  mov    0x78(%rsp),%rcx
  mov    %eax,0x68(%rsp)
  mov    %r13d,%r12d
  mov    0x50(%rsp),%rax
  add    %rcx,%rax
  mov    %rax,0x48(%rsp)
  mov    0x58(%rsp),%rax
  add    %rcx,%rax
  mov    0x64(%rsp),%ecx
  test   %ecx,%ecx
  je     L51
  mov    %ebp,0x70(%rsp)
  mov    %rax,%r13
  mov    %ecx,%ebp
  nopl   0x0(%rax,%rax,1)
L88:
  sub    $0x8,%rsp
  mov    %r12d,%edx
  mov    %ebp,%esi
  mov    %ebx,%edi
  push   0x20(%rsp)
  push   %r14
  push   0x50(%rsp)
  mov    0x50(%rsp),%r9
  mov    0x48(%rsp),%r8
  mov    0x60(%rsp),%rcx
  call   <genWig_L2@plt>
  add    $0x20,%rsp
  mov    %r15,%r9
  mov    %r14,%r8
  push   0x18(%rsp)
  mov    %r12d,%edx
  mov    %ebp,%esi
  mov    %ebx,%edi
  push   0x10(%rsp)
  mov    0x58(%rsp),%rcx
  call   <wigNaiveAnalysis@plt>
  push   0x28(%rsp)
  mov    %r13,%rcx
  mov    %r15,%r9
  push   0x28(%rsp)
  mov    %r14,%r8
  mov    %r12d,%edx
  mov    %ebp,%esi
  mov    %ebx,%edi
  call   <wigNaiveAnalysis@plt>
  mov    0x40(%rsp),%rdi
  mov    %r12d,%edx
  mov    %ebp,%esi
  add    %rdi,0x68(%rsp)
  add    $0x20,%rsp
  add    %rdi,%r13
  mov    %ebx,%edi
  call   <howMany_so3@plt>
  mov    0x8(%rsp),%rsi
  mov    %r12d,%edx
  mov    %ebx,%edi
  cltq
  lea    (%rsi,%rax,8),%rax
  mov    %ebp,%esi
  mov    %rax,0x8(%rsp)
  call   <howMany_so3@plt>
  mov    0x10(%rsp),%rdx
  cltq
  lea    (%rdx,%rax,8),%rax
  mov    %rax,0x10(%rsp)
  add    $0x1,%ebp
  jne    L88
  mov    0x80(%rsp),%rsi
  mov    0x70(%rsp),%ebp
  lea    0x1(%rbx),%eax
  add    %rsi,0x50(%rsp)
  add    %rsi,0x58(%rsp)
  cmp    0x68(%rsp),%ebx
  je     L74
  mov    %eax,%ebx
  jmp    L52
L26:
  mov    0x90(%rsp),%rax
  mov    %rax,0x10(%rsp)
  mov    0x88(%rsp),%rax
  mov    %rax,0x8(%rsp)
L74:
  movslq 0x98(%rsp),%rax
  mov    0x50(%rsp),%rbx
  shl    $0x3,%rax
  add    %rax,%rbx
  add    0x58(%rsp),%rax
  mov    %rbx,0x50(%rsp)
  mov    0x64(%rsp),%ebx
  mov    %rax,0x58(%rsp)
  test   %ebx,%ebx
  jns    L51
  mov    0x20(%rsp),%rcx
  lea    -0x1(%rbp),%eax
  mov    0x18(%rsp),%r12
  lea    0x1(%rax),%rdx
  imul   %rcx,%rdx
  imul   %rcx,%rax
  mov    %rdx,0x70(%rsp)
  mov    %rax,0x68(%rsp)
  nopl   (%rax)
L126:
  mov    0x58(%rsp),%rax
  xor    %r13d,%r13d
  mov    %rax,0x48(%rsp)
  mov    0x50(%rsp),%rax
  test   %ebp,%ebp
  jle    L6
  mov    %r12,0x18(%rsp)
  mov    %r13d,%r12d
  mov    %rax,%r13
  nopl   (%rax)
L107:
  sub    $0x8,%rsp
  mov    %r12d,%esi
  mov    %ebp,%edx
  mov    %ebx,%edi
  push   0x20(%rsp)
  push   %r14
  push   0x50(%rsp)
  mov    0x50(%rsp),%r9
  mov    0x48(%rsp),%r8
  mov    0x60(%rsp),%rcx
  call   <genWig_L2@plt>
  add    $0x20,%rsp
  mov    %r13,%rcx
  mov    %r12d,%esi
  push   0x18(%rsp)
  mov    %r15,%r9
  mov    %r14,%r8
  mov    %ebp,%edx
  push   0x10(%rsp)
  mov    %ebx,%edi
  call   <wigNaiveAnalysis@plt>
  push   0x28(%rsp)
  mov    %r15,%r9
  mov    %r14,%r8
  push   0x28(%rsp)
  mov    %r12d,%esi
  mov    %ebp,%edx
  mov    %ebx,%edi
  mov    0x68(%rsp),%rcx
  call   <wigNaiveAnalysis@plt>
  mov    0x40(%rsp),%rsi
  mov    %ebp,%edx
  mov    %ebx,%edi
  add    %rsi,0x68(%rsp)
  add    $0x20,%rsp
  add    %rsi,%r13
  mov    %r12d,%esi
  call   <howMany_so3@plt>
  mov    0x8(%rsp),%rcx
  mov    %ebp,%edx
  mov    %r12d,%esi
  cltq
  mov    %ebx,%edi
  add    $0x1,%r12d
  lea    (%rcx,%rax,8),%rax
  mov    %rax,0x8(%rsp)
  call   <howMany_so3@plt>
  mov    0x10(%rsp),%rdx
  cltq
  lea    (%rdx,%rax,8),%rax
  mov    %rax,0x10(%rsp)
  cmp    %r12d,%ebp
  jne    L107
  mov    0x70(%rsp),%rdi
  add    %rdi,0x50(%rsp)
  add    %rdi,0x58(%rsp)
  mov    0x18(%rsp),%r12
L6:
  mov    0x50(%rsp),%rax
  mov    0x20(%rsp),%rdi
  mov    0x58(%rsp),%rcx
  mov    0x64(%rsp),%r13d
  add    %rdi,%rax
  add    %rdi,%rcx
  mov    %rax,0x50(%rsp)
  mov    %rcx,0x58(%rsp)
  mov    %rcx,0x48(%rsp)
  mov    %rax,0x18(%rsp)
  nopl   0x0(%rax)
L86:
  sub    $0x8,%rsp
  mov    %ebp,%edx
  mov    %r13d,%esi
  mov    %ebx,%edi
  push   %r12
  push   %r14
  push   0x50(%rsp)
  mov    0x50(%rsp),%r9
  mov    0x48(%rsp),%r8
  mov    0x60(%rsp),%rcx
  call   <genWig_L2@plt>
  add    $0x20,%rsp
  mov    %r15,%r9
  mov    %r14,%r8
  push   %r12
  mov    %ebp,%edx
  mov    %r13d,%esi
  mov    %ebx,%edi
  push   0x10(%rsp)
  mov    0x28(%rsp),%rcx
  call   <wigNaiveAnalysis@plt>
  push   %r12
  mov    %r15,%r9
  mov    %r14,%r8
  push   0x28(%rsp)
  mov    0x68(%rsp),%rcx
  mov    %ebp,%edx
  mov    %r13d,%esi
  mov    %ebx,%edi
  call   <wigNaiveAnalysis@plt>
  mov    0x40(%rsp),%rdx
  mov    %r13d,%esi
  mov    %ebx,%edi
  add    %rdx,0x38(%rsp)
  add    %rdx,0x68(%rsp)
  add    $0x20,%rsp
  mov    %ebp,%edx
  call   <howMany_so3@plt>
  mov    0x8(%rsp),%rcx
  mov    %ebx,%edi
  mov    %ebp,%edx
  cltq
  mov    %r13d,%esi
  lea    (%rcx,%rax,8),%rax
  mov    %rax,0x8(%rsp)
  call   <howMany_so3@plt>
  mov    0x10(%rsp),%rdi
  cltq
  lea    (%rdi,%rax,8),%rax
  mov    %rax,0x10(%rsp)
  add    $0x1,%r13d
  jne    L86
  mov    0x50(%rsp),%rax
  mov    0x68(%rsp),%rcx
  add    %rcx,%rax
  mov    %rax,0x50(%rsp)
  mov    0x58(%rsp),%rax
  add    %rcx,%rax
  mov    %rax,0x58(%rsp)
  add    $0x1,%ebx
  jne    L126
L51:
  mov    %ebp,%edi
  call   <totalCoeffs_so3@plt>
  pxor   %xmm1,%xmm1
  movsd  D1(%rip),%xmm0
  xor    %edx,%edx
  cvtsi2sdl 0x9c(%rsp),%xmm1
  movslq %eax,%rcx
  divsd  %xmm1,%xmm0
  test   %eax,%eax
  jle    L70
  mov    0x88(%rsp),%rax
  mov    0x90(%rsp),%rsi
  nopl   0x0(%rax,%rax,1)
L65:
  movsd  (%rax,%rdx,8),%xmm1
  mulsd  %xmm0,%xmm1
  movsd  %xmm1,(%rax,%rdx,8)
  movsd  (%rsi,%rdx,8),%xmm1
  mulsd  %xmm0,%xmm1
  movsd  %xmm1,(%rsi,%rdx,8)
  add    $0x1,%rdx
  cmp    %rcx,%rdx
  jne    L65
L70:
  add    $0xa8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: disassemble_data
arguments: tag: D1
type_infered: f64

tool: D1: 3.141592653589793

assistant: ```c
void Forward_SO3_Naive(int bw, double *rdata, double *idata, double *rcoeffs, double *icoeffs, double *workspace1, double *workspace2) {
  int j, n;
  int m1, m2;
  double *t1r, *t1i, *t2r, *t2i;
  double *sinPts, *cosPts, *sinPts2, *cosPts2;
  double *wigners, *scratch;
  double *weights;
  double *rcoeffsPtr, *icoeffsPtr;
  double scalar;
  int tmpInt;
  n = 2 * bw;
  t1r = workspace1;
  t1i = workspace1 + (n * n * n);
  t2r = t1i + (n * n * n);
  t2i = t2r + (n * n * n);
  rcoeffsPtr = rcoeffs;
  icoeffsPtr = icoeffs;
  weights = workspace2;
  sinPts = weights + n;
  cosPts = sinPts + n;
  sinPts2 = cosPts + n;
  cosPts2 = sinPts2 + n;
  wigners = cosPts2 + n;
  scratch = wigners + (bw * n);
  SinEvalPts(n, sinPts);
  CosEvalPts(n, cosPts);
  SinEvalPts2(n, sinPts2);
  CosEvalPts2(n, cosPts2);
  makeweights2(bw, weights);
  grid_invfourier_so3(rdata, idata, t1r, t1i, n * n, n, scratch);
  transpose_so3(t1r, t2r, n * n, n);
  transpose_so3(t1i, t2i, n * n, n);
  grid_invfourier_so3(t2r, t2i, t1r, t1i, n * n, n, scratch);
  transpose_so3(t1r, t2r, n * n, n);
  transpose_so3(t1i, t2i, n * n, n);
  for (m1 = 0; m1 < bw; m1++) {
    for (m2 = 0; m2 < bw; m2++) {
      genWig_L2(m1, m2, bw, sinPts, cosPts, sinPts2, cosPts2, wigners, scratch);
      wigNaiveAnalysis(m1, m2, bw, t2r, wigners, weights, rcoeffs, scratch);
      wigNaiveAnalysis(m1, m2, bw, t2i, wigners, weights, icoeffs, scratch);
      t2r += n;
      t2i += n;
      rcoeffs += howMany_so3(m1, m2, bw);
      icoeffs += howMany_so3(m1, m2, bw);
    }
    t2r += n;
    t2i += n;
    for (m2 = -(bw - 1); m2 < 0; m2++) {
      genWig_L2(m1, m2, bw, sinPts, cosPts, sinPts2, cosPts2, wigners, scratch);
      wigNaiveAnalysis(m1, m2, bw, t2r, wigners, weights, rcoeffs, scratch);
      wigNaiveAnalysis(m1, m2, bw, t2i, wigners, weights, icoeffs, scratch);
      t2r += n;
      t2i += n;
      rcoeffs += howMany_so3(m1, m2, bw);
      icoeffs += howMany_so3(m1, m2, bw);
    }
  }
  t2r += n * n;
  t2i += n * n;
  for (m1 = -(bw - 1); m1 < 0; m1++) {
    for (m2 = 0; m2 < bw; m2++) {
      genWig_L2(m1, m2, bw, sinPts, cosPts, sinPts2, cosPts2, wigners, scratch);
      wigNaiveAnalysis(m1, m2, bw, t2r, wigners, weights, rcoeffs, scratch);
      wigNaiveAnalysis(m1, m2, bw, t2i, wigners, weights, icoeffs, scratch);
      t2r += n;
      t2i += n;
      rcoeffs += howMany_so3(m1, m2, bw);
      icoeffs += howMany_so3(m1, m2, bw);
    }
    t2r += n;
    t2i += n;
    for (m2 = -(bw - 1); m2 < 0; m2++) {
      genWig_L2(m1, m2, bw, sinPts, cosPts, sinPts2, cosPts2, wigners, scratch);
      wigNaiveAnalysis(m1, m2, bw, t2r, wigners, weights, rcoeffs, scratch);
      wigNaiveAnalysis(m1, m2, bw, t2i, wigners, weights, icoeffs, scratch);
      t2r += n;
      t2i += n;
      rcoeffs += howMany_so3(m1, m2, bw);
      icoeffs += howMany_so3(m1, m2, bw);
    }
  }
  tmpInt = totalCoeffs_so3(bw);
  scalar = 3.14159265358979323846 / ((double)(bw * n));
  for (j = 0; j < tmpInt; j++) {
    rcoeffsPtr[j] *= scalar;
    icoeffsPtr[j] *= scalar;
  }
}
```