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

```asm
<BatchInterpolatedGradY3DMirrWarp>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x78,%rsp
  movsd  %xmm6,0x68(%rsp)
  movsd  %xmm7,0x48(%rsp)
  movapd %xmm6,%xmm7
  pxor   %xmm6,%xmm6
  comisd %xmm6,%xmm7
  mov    %rdi,0x20(%rsp)
  mov    %r9,0x38(%rsp)
  movq   $0x0,0x58(%rsp)
  movsd  %xmm0,0x10(%rsp)
  movsd  %xmm1,0x28(%rsp)
  movsd  %xmm2,0x30(%rsp)
  movsd  %xmm3,0x60(%rsp)
  movsd  %xmm4,0x40(%rsp)
  movsd  %xmm5,0x8(%rsp)
  jbe    L51
  mov    %rsi,%r13
  mov    %rdx,%r12
  mov    %rcx,%rbp
  mov    %r8,%rbx
  xor    %r14d,%r14d
  cs nopw 0x0(%rax,%rax,1)
L43:
  movsd  0x60(%rsp),%xmm7
  pxor   %xmm5,%xmm5
  mov    %r14,%r15
  movq   $0x0,0x50(%rsp)
  comisd %xmm5,%xmm7
  jbe    L34
L2:
  movsd  0x10(%rsp),%xmm6
  pxor   %xmm7,%xmm7
  comisd %xmm7,%xmm6
  jbe    L32
  pxor   %xmm5,%xmm5
  pxor   %xmm6,%xmm6
  xor    %r14d,%r14d
  mov    %r13,%rdx
  cvtsi2ssq 0x50(%rsp),%xmm5
  mov    %r12,%rax
  mov    %r14,%r13
  mov    %r15,%r12
  cvtsi2ssq 0x58(%rsp),%xmm6
  mov    %rax,%r15
  mov    %rdx,%r14
  movss  %xmm5,0x18(%rsp)
  movss  %xmm6,0x1c(%rsp)
  nopl   0x0(%rax,%rax,1)
L3:
  movss  0x1c(%rsp),%xmm2
  pxor   %xmm0,%xmm0
  mov    %rbx,%rcx
  mov    %rbp,%rdx
  mov    0xc0(%rsp),%rax
  cvtsi2ss %r13,%xmm0
  mov    %r15,%rsi
  movss  0x18(%rsp),%xmm1
  mov    0xc8(%rsp),%r8
  mov    %r14,%rdi
  add    $0x1,%r13
  addss  (%rax,%r12,4),%xmm2
  mov    0xb0(%rsp),%rax
  addss  (%rax,%r12,4),%xmm1
  mov    0x38(%rsp),%rax
  cvtss2sd %xmm2,%xmm2
  subsd  0x48(%rsp),%xmm2
  divsd  0xb8(%rsp),%xmm2
  addss  (%rax,%r12,4),%xmm0
  add    $0x1,%r12
  cvtss2sd %xmm1,%xmm1
  subsd  0x40(%rsp),%xmm1
  divsd  0x8(%rsp),%xmm1
  cvtss2sd %xmm0,%xmm0
  subsd  0x28(%rsp),%xmm0
  divsd  0x30(%rsp),%xmm0
  call   <InterpolatedGradY3DMirr@plt>
  mov    0x20(%rsp),%rax
  divsd  0x8(%rsp),%xmm0
  cvtsd2ss %xmm0,%xmm0
  movsd  0x10(%rsp),%xmm4
  movss  %xmm0,-0x4(%rax,%r12,4)
  pxor   %xmm0,%xmm0
  cvtsi2sd %r13,%xmm0
  comisd %xmm0,%xmm4
  ja     L3
  mov    %r15,%rax
  mov    %r14,%r13
  mov    %r12,%r15
  mov    %rax,%r12
L32:
  addq   $0x1,0x50(%rsp)
  mov    0x50(%rsp),%rax
  pxor   %xmm0,%xmm0
  movsd  0x60(%rsp),%xmm5
  cvtsi2sd %rax,%xmm0
  comisd %xmm0,%xmm5
  ja     L2
  mov    %r15,%r14
L34:
  addq   $0x1,0x58(%rsp)
  mov    0x58(%rsp),%rax
  pxor   %xmm0,%xmm0
  movsd  0x68(%rsp),%xmm7
  cvtsi2sd %rax,%xmm0
  comisd %xmm0,%xmm7
  ja     L43
L51:
  add    $0x78,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
extern void BatchInterpolatedGradY3DMirrWarp(float *Bout, float *Bcoeff, long Width, long Height, long Slice, double nx, double offx, double mx, float *WarpX, double ny, double offy, double my, float *WarpY, double nz, double offz, double mz, float *WarpZ, long SplineDegree) {
  double x, y, z;
  long idx;
  long idcoordx, idcoordy, idcoordz;
  idx = 0;
  for (idcoordz = 0; idcoordz < nz; idcoordz++) {
    for (idcoordy = 0; idcoordy < ny; idcoordy++) {
      for (idcoordx = 0; idcoordx < nx; idcoordx++) {
        x = (idcoordx + WarpX[idx] - offx) / mx;
        y = (idcoordy + WarpY[idx] - offy) / my;
        z = (idcoordz + WarpZ[idx] - offz) / mz;
        Bout[idx++] = InterpolatedGradY3DMirr(Bcoeff, Width, Height, Slice, x, y, z, SplineDegree) / my;
      }
    }
  }
}
```