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

```asm
<wigNaiveSynthesis_symX>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %edi,%eax
  mov    %esi,%edi
  mov    %edx,%r10d
  mov    %rcx,%rsi
  mov    %edi,%edx
  neg    %edx
  cmovs  %edi,%edx
  mov    %eax,%ecx
  neg    %ecx
  cmovs  %eax,%ecx
  cmp    %ecx,%edx
  cmovl  %ecx,%edx
  lea    (%r10,%r10,1),%ebp
  mov    %eax,%ecx
  sub    %edi,%ecx
  test   %ecx,%ecx
  jle    L91
  and    $0x1,%ecx
  cmp    $0x1,%ecx
  sbb    %r11d,%r11d
  and    $0x2,%r11d
  sub    $0x1,%r11d
L68:
  test   %ebp,%ebp
  jle    L66
  sub    %edx,%r10d
  mov    %r10d,%eax
  sar    $0x1f,%eax
  shr    $0x1e,%eax
  lea    (%r10,%rax,1),%ecx
  and    $0x3,%ecx
  sub    %eax,%ecx
  movslq %r10d,%rbx
  shl    $0x3,%rbx
  mov    %r9,%rdi
  lea    -0x1(%rbp),%eax
  lea    0x8(%r9,%rax,8),%rbp
  test   %ecx,%ecx
  mov    $0x0,%r9d
  cmovns %ecx,%r9d
  movslq %r9d,%rdx
  lea    0x0(,%rdx,8),%r12
  lea    (%rsi,%r12,1),%r14
  lea    -0x1(%r10),%eax
  sub    %r9d,%eax
  shr    $0x2,%eax
  mov    %eax,%eax
  lea    (%rdx,%rax,4),%rax
  lea    0x20(,%rax,8),%r13
  jmp    L36
L91:
  sub    %edi,%eax
  and    $0x1,%eax
  cmp    $0x1,%eax
  sbb    %r11d,%r11d
  and    $0x2,%r11d
  sub    $0x1,%r11d
  jmp    L68
L59:
  movsd  (%r8,%rax,8),%xmm1
  mulsd  (%rsi,%rax,8),%xmm1
  addsd  %xmm1,%xmm0
  add    $0x1,%rax
  cmp    %eax,%ecx
  jg     L59
L35:
  cmp    %r9d,%r10d
  jle    L84
  lea    (%r8,%r12,1),%rax
  lea    (%r8,%r13,1),%r15
  mov    %r14,%rdx
  pxor   %xmm2,%xmm2
  movapd %xmm2,%xmm3
  movapd %xmm2,%xmm4
L30:
  movsd  (%rax),%xmm1
  mulsd  (%rdx),%xmm1
  addsd  %xmm1,%xmm0
  movsd  0x8(%rax),%xmm1
  mulsd  0x8(%rdx),%xmm1
  addsd  %xmm1,%xmm4
  movsd  0x10(%rax),%xmm1
  mulsd  0x10(%rdx),%xmm1
  addsd  %xmm1,%xmm3
  movsd  0x18(%rax),%xmm1
  mulsd  0x18(%rdx),%xmm1
  addsd  %xmm1,%xmm2
  add    $0x20,%rax
  add    $0x20,%rdx
  cmp    %r15,%rax
  jne    L30
L13:
  addsd  %xmm4,%xmm0
  addsd  %xmm3,%xmm0
  addsd  %xmm2,%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2sd %r11d,%xmm1
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,(%rdi)
  add    %rbx,%r8
  add    $0x8,%rdi
  cmp    %rbp,%rdi
  je     L66
L36:
  mov    $0x0,%eax
  pxor   %xmm0,%xmm0
  test   %ecx,%ecx
  jg     L59
  jmp    L35
L84:
  pxor   %xmm2,%xmm2
  movapd %xmm2,%xmm3
  movapd %xmm2,%xmm4
  jmp    L13
L66:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
void wigNaiveSynthesis_symX(int m1, int m2, int bw, double *coeffs, double *wignersTrans, double *signal, double *workspace) {
  int i, j, m, n;
  int fudge;
  double tmp0, tmp1, tmp2, tmp3;
  m = ((((m1) > 0 ? (m1) : (-m1))) > (((m2) > 0 ? (m2) : (-m2))) ? (((m1) > 0 ? (m1) : (-m1))) : (((m2) > 0 ? (m2) : (-m2))));
  n = 2 * bw;
  if (((m1 - m2) > 0 ? (m1 - m2) : (-m1 - m2)) % 2)
    fudge = -1;
  else
    fudge = 1;
  for (i = 0; i < n; i++) {
    tmp0 = 0.;
    tmp1 = 0.;
    tmp2 = 0.;
    tmp3 = 0.;
    for (j = 0; j < (bw - m) % 4; ++j)
      tmp0 += wignersTrans[j] * coeffs[j];
    for (; j < (bw - m); j += 4) {
      tmp0 += wignersTrans[j] * coeffs[j];
      tmp1 += wignersTrans[j + 1] * coeffs[j + 1];
      tmp2 += wignersTrans[j + 2] * coeffs[j + 2];
      tmp3 += wignersTrans[j + 3] * coeffs[j + 3];
    }
    signal[i] = fudge * (tmp0 + tmp1 + tmp2 + tmp3);
    wignersTrans += (bw - m);
  }
}
```