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

```asm
<sp2fctest>:
  endbr64
  push   %r15
  mov    %rdi,%rax
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %ecx,%ebx
  sub    $0x48,%rsp
  mov    %ecx,0x38(%rsp)
  mov    0x80(%rsp),%edi
  mov    0x80(%rsp),%ecx
  mov    %rdx,0x30(%rsp)
  add    $0x1,%edi
  add    $0x2,%ecx
  mov    %edi,0x3c(%rsp)
  imul   %edi,%ecx
  test   %ebx,%ebx
  jle    L7
  mov    %r9d,%edx
  mov    %r8d,%ebp
  mov    %r8d,%r13d
  movslq %ecx,%rcx
  imul   %r8d,%edx
  shr    $0x1f,%ebp
  mov    %rsi,0x8(%rsp)
  add    %r8d,%ebp
  mov    %rax,0x10(%rsp)
  movl   $0x0,0x18(%rsp)
  sar    %ebp
  lea    0x0(,%rdx,8),%ebx
  movslq %edx,%rdi
  movslq %r8d,%rdx
  lea    (%r8,%r8,1),%r8d
  shl    $0x3,%rdi
  mov    %ebx,0x1c(%rsp)
  lea    0x0(,%rdx,8),%r12
  movslq %r8d,%r8
  mov    %rdi,0x20(%rsp)
  lea    0x0(,%rcx,8),%rdi
  lea    -0x8(,%rdx,8),%r14
  lea    0x0(,%r8,8),%rbx
  mov    %rdi,0x28(%rsp)
  mov    %rbx,(%rsp)
L11:
  mov    0x8(%rsp),%rdi
  mov    0x1c(%rsp),%edx
  xor    %esi,%esi
  mov    0x10(%rsp),%r15
  mov    %rdi,%rbx
  call   <memset@plt>
  mov    0x80(%rsp),%eax
  test   %eax,%eax
  js     L31
  mov    0x80(%rsp),%r10d
  mov    0x3c(%rsp),%r9d
  mov    0x30(%rsp),%r11
L17:
  lea    (%rbx,%r12,1),%rcx
  mov    %r15,%r8
  mov    %r11,%rsi
  xor    %edi,%edi
  nopl   0x0(%rax)
L60:
  add    $0x1,%edi
  movsd  (%r8),%xmm4
  add    $0x10,%r8
  movsd  -0x8(%r8),%xmm5
  mov    %edi,%eax
  and    $0x1,%eax
  lea    -0x1(%rax,%rax,1),%eax
  cmp    $0x1,%r13d
  jle    L58
  pxor   %xmm2,%xmm2
  mov    %r14,%rdx
  cvtsi2sd %eax,%xmm2
  xor    %eax,%eax
  xchg   %ax,%ax
L35:
  movsd  (%rsi,%rax,8),%xmm0
  movapd %xmm4,%xmm1
  movsd  (%rbx,%rax,8),%xmm3
  mulsd  %xmm0,%xmm1
  mulsd  %xmm5,%xmm0
  addsd  %xmm1,%xmm3
  mulsd  %xmm2,%xmm1
  movsd  %xmm3,(%rbx,%rax,8)
  movsd  (%rcx,%rax,8),%xmm3
  addsd  %xmm0,%xmm3
  mulsd  %xmm2,%xmm0
  movsd  %xmm3,(%rcx,%rax,8)
  addsd  (%rbx,%rdx,1),%xmm1
  add    $0x1,%rax
  movsd  %xmm1,(%rbx,%rdx,1)
  addsd  (%rcx,%rdx,1),%xmm0
  movsd  %xmm0,(%rcx,%rdx,1)
  sub    $0x8,%rdx
  cmp    %eax,%ebp
  jg     L35
L58:
  add    %r12,%rsi
  cmp    %r9d,%edi
  jne    L60
  lea    0x1(%r10),%eax
  sub    $0x1,%r10d
  add    (%rsp),%rbx
  sub    $0x1,%r9d
  mov    %rax,%rdx
  imul   %r12,%rax
  shl    $0x4,%rdx
  add    %rdx,%r15
  add    %rax,%r11
  cmp    $0xffffffff,%r10d
  jne    L17
L31:
  mov    0x20(%rsp),%rsi
  addl   $0x1,0x18(%rsp)
  add    %rsi,0x8(%rsp)
  mov    0x18(%rsp),%eax
  mov    0x28(%rsp),%rsi
  add    %rsi,0x10(%rsp)
  cmp    %eax,0x38(%rsp)
  jne    L11
L7:
  add    $0x48,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
void sp2fctest(double *sa, double *fa, double *poli, int nlev, int nlat, int nfc, int nt) {
  int lev, jm, jn, latn, lats, nsp2, is;
  double sar, sai;
  double *far, *fai, *pol;
  double *sal, *fal;
  double pval;
  nsp2 = (nt + 1) * (nt + 2);
  for (lev = 0; lev < nlev; lev++) {
    pol = poli;
    fal = fa + lev * nfc * nlat;
    sal = sa + lev * nsp2;
    memset(fal, 0, nfc * nlat * sizeof(double));
    for (jm = 0; jm <= nt; jm++) {
      for (jn = 0; jn <= nt - jm; jn++) {
        is = (jn + 1) % 2 * 2 - 1;
        sar = *sal++;
        sai = *sal++;
        far = fal;
        fai = fal + nlat;
        for (latn = 0; latn < nlat / 2; latn++) {
          lats = nlat - latn - 1;
          pval = pol[latn];
          far[latn] += pval * sar;
          fai[latn] += pval * sai;
          far[lats] += pval * sar * is;
          fai[lats] += pval * sai * is;
        }
        pol += nlat;
      }
      fal += 2 * nlat;
    }
  }
}
```