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

```asm
<uv2dv>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rsi,%rax
  mov    %rdx,%rsi
  mov    %rcx,%rdx
  mov    %r8,-0x10(%rsp)
  mov    %r9,-0x8(%rsp)
  mov    0x40(%rsp),%r15d
  mov    0x48(%rsp),%ebx
  lea    0x1(%rbx),%ecx
  lea    0x2(%rbx),%r8d
  imul   %ecx,%r8d
  cmpl   $0x0,0x38(%rsp)
  jle    L82
  movslq %r15d,%r9
  lea    0x0(,%r9,8),%r13
  lea    (%r15,%r15,1),%r9d
  movslq %r9d,%r9
  lea    0x0(,%r9,8),%rbx
  mov    %rbx,-0x50(%rsp)
  movslq %r8d,%r8
  lea    0x0(,%r8,8),%rbx
  mov    %rbx,-0x20(%rsp)
  mov    %rsi,-0x40(%rsp)
  mov    %rdx,-0x38(%rsp)
  imul   %r15d,%ecx
  mov    %ecx,%edx
  add    %edx,%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,8),%rbx
  mov    %rbx,-0x18(%rsp)
  lea    (%rdi,%r13,1),%rbx
  mov    %rbx,-0x30(%rsp)
  add    %r13,%rax
  mov    %rax,-0x28(%rsp)
  movl   $0x0,-0x44(%rsp)
  mov    %r15d,%r14d
  jmp    L52
L21:
  mov    %r12d,%ebp
  add    $0x1,%rbp
  mov    %rbp,%rax
  shl    $0x4,%rax
  mov    %rax,-0x58(%rsp)
  lea    (%r10,%rax,1),%rbx
  mov    -0x60(%rsp),%rcx
  mov    -0x68(%rsp),%rdx
  mov    -0x70(%rsp),%r11
L111:
  test   %r15d,%r15d
  jle    L24
  mov    $0x0,%eax
  pxor   %xmm6,%xmm6
  movapd %xmm6,%xmm7
  movapd %xmm6,%xmm8
  movapd %xmm6,%xmm9
L118:
  movsd  (%r8,%rax,8),%xmm2
  movsd  (%rdx,%rax,8),%xmm0
  movsd  (%rsi,%rax,8),%xmm10
  movsd  (%rcx,%rax,8),%xmm3
  movapd %xmm2,%xmm1
  mulsd  %xmm0,%xmm1
  movapd %xmm10,%xmm4
  mulsd  %xmm3,%xmm4
  subsd  %xmm4,%xmm1
  addsd  %xmm1,%xmm9
  movsd  (%rdi,%rax,8),%xmm4
  movsd  (%r9,%rax,8),%xmm1
  movapd %xmm0,%xmm5
  mulsd  %xmm4,%xmm5
  movapd %xmm3,%xmm11
  mulsd  %xmm1,%xmm11
  addsd  %xmm11,%xmm5
  addsd  %xmm5,%xmm8
  mulsd  %xmm0,%xmm1
  mulsd  %xmm3,%xmm4
  addsd  %xmm4,%xmm1
  subsd  %xmm1,%xmm7
  mulsd  %xmm10,%xmm0
  mulsd  %xmm3,%xmm2
  subsd  %xmm2,%xmm0
  subsd  %xmm0,%xmm6
  add    $0x1,%rax
  cmp    %rax,%r14
  jne    L118
L1:
  movsd  %xmm9,(%r10)
  add    $0x10,%r10
  movsd  %xmm8,-0x8(%r10)
  movsd  %xmm7,(%r11)
  add    $0x10,%r11
  movsd  %xmm6,-0x8(%r11)
  add    %r13,%rdx
  add    %r13,%rcx
  cmp    %r10,%rbx
  jne    L111
  mov    -0x58(%rsp),%rbx
  add    %rbx,-0x70(%rsp)
  imul   %r13,%rbp
  add    %rbp,-0x68(%rsp)
  add    %rbp,-0x60(%rsp)
L9:
  sub    $0x1,%r12d
  mov    -0x50(%rsp),%rax
  add    %rax,%rsi
  add    %rax,%rdi
  cmp    $0xffffffff,%r12d
  je     L94
L89:
  mov    %rsi,%r9
  sub    %r13,%r9
  mov    %rdi,%r8
  sub    %r13,%r8
  mov    0x48(%rsp),%eax
  sub    %r12d,%eax
  cmp    %eax,0x48(%rsp)
  jge    L21
  jmp    L9
L24:
  pxor   %xmm6,%xmm6
  movapd %xmm6,%xmm7
  movapd %xmm6,%xmm8
  movapd %xmm6,%xmm9
  jmp    L1
L94:
  addl   $0x1,-0x44(%rsp)
  mov    -0x44(%rsp),%eax
  mov    -0x20(%rsp),%rsi
  add    %rsi,-0x40(%rsp)
  add    %rsi,-0x38(%rsp)
  mov    -0x18(%rsp),%rdi
  add    %rdi,-0x30(%rsp)
  add    %rdi,-0x28(%rsp)
  cmp    %eax,0x38(%rsp)
  je     L82
L52:
  mov    -0x40(%rsp),%r10
  mov    -0x38(%rsp),%rax
  mov    %rax,-0x70(%rsp)
  cmpl   $0x0,0x48(%rsp)
  js     L94
  mov    -0x28(%rsp),%rdi
  mov    -0x30(%rsp),%rsi
  mov    0x48(%rsp),%r12d
  mov    -0x8(%rsp),%rax
  mov    %rax,-0x60(%rsp)
  mov    -0x10(%rsp),%rax
  mov    %rax,-0x68(%rsp)
  jmp    L89
L82:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
void uv2dv(double *fu, double *fv, double *sd, double *sv, double *pol2, double *pol3, int klev, int nlat, int nt) {
  int lev, jmm, jfc, lat, nfc, nsp2;
  double dir, dii, vor, voi;
  double *ufr, *ufi, *vfr, *vfi;
  double *ful, *fvl, *sdl, *svl;
  double *po2, *po3;
  nsp2 = (nt + 1) * (nt + 2);
  nfc = (nt + 1) * 2;
  for (lev = 0; lev < klev; lev++) {
    po2 = pol2;
    po3 = pol3;
    ful = fu + lev * nfc * nlat;
    fvl = fv + lev * nfc * nlat;
    sdl = sd + lev * nsp2;
    svl = sv + lev * nsp2;
    for (jmm = 0; jmm <= nt; jmm++) {
      for (jfc = jmm; jfc <= nt; jfc++) {
        ufr = ful;
        ufi = ful + nlat;
        vfr = fvl;
        vfi = fvl + nlat;
        dir = 0.0;
        dii = 0.0;
        vor = 0.0;
        voi = 0.0;
        for (lat = 0; lat < nlat; lat++) {
          dir += vfr[lat] * po2[lat] - ufi[lat] * po3[lat];
          dii += vfi[lat] * po2[lat] + ufr[lat] * po3[lat];
          vor -= ufr[lat] * po2[lat] + vfi[lat] * po3[lat];
          voi -= ufi[lat] * po2[lat] - vfr[lat] * po3[lat];
        }
        *sdl++ = dir;
        *sdl++ = dii;
        *svl++ = vor;
        *svl++ = voi;
        po2 += nlat;
        po3 += nlat;
      }
      ful += 2 * nlat;
      fvl += 2 * nlat;
    }
  }
}
```