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

```asm
<oneBspEval2>:
  endbr64
  push   %r15
  movslq %edi,%r11
  lea    0x0(,%rcx,4),%r15d
  push   %r14
  mov    %esi,%r14d
  push   %r13
  mov    %r8d,%r13d
  push   %r12
  push   %rbp
  mov    %rdx,%rbp
  push   %rbx
  sub    $0x18,%rsp
  movsd  (%r9,%r11,8),%xmm1
  mov    0x58(%rsp),%rax
  mov    0x60(%rsp),%rbx
  movsd  (%rax),%xmm0
  movslq %esi,%rax
  lea    0x0(,%rax,8),%r10
  mov    0x50(%rsp),%rax
  add    %r10,%rax
  comisd %xmm0,%xmm1
  jb     L158
  mov    0x58(%rsp),%rdi
  movsd  (%rax),%xmm1
  movsd  0x8(%rdi),%xmm0
  comisd %xmm0,%xmm1
  jb     L209
  movsd  (%rdx),%xmm0
  movsd  %xmm0,(%rbx)
  movsd  0x8(%rdx),%xmm0
  movsd  %xmm0,0x8(%rbx)
  movsd  0x10(%rdx),%xmm0
  movsd  %xmm0,0x10(%rbx)
  movsd  0x18(%rdx),%xmm0
  movsd  %xmm0,0x18(%rbx)
L172:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L158:
  mov    %ecx,%edi
  movslq %ecx,%rcx
  mov    %r9,%rdx
  comisd (%r9,%rcx,8),%xmm0
  jb     L41
  mov    0x58(%rsp),%rdi
  movsd  (%rax),%xmm1
  movsd  0x8(%rdi),%xmm0
  comisd %xmm0,%xmm1
  jae    L155
  mov    0x50(%rsp),%rdi
  movslq %r8d,%rax
  comisd (%rdi,%rax,8),%xmm0
  jb     L142
  imul   %r8d,%r15d
  movslq %r15d,%rax
  shl    $0x3,%rax
  movsd  -0x20(%rbp,%rax,1),%xmm0
  movsd  %xmm0,(%rbx)
  movsd  -0x18(%rbp,%rax,1),%xmm0
  movsd  %xmm0,0x8(%rbx)
  movsd  -0x10(%rbp,%rax,1),%xmm0
  movsd  %xmm0,0x10(%rbx)
  movsd  -0x8(%rbp,%rax,1),%xmm0
  movsd  %xmm0,0x18(%rbx)
  jmp    L172
  cs nopw 0x0(%rax,%rax,1)
L41:
  mov    0x58(%rsp),%rsi
  movq   $0x0,(%rbx)
  mov    %r11,%r12
  movq   $0x0,0x8(%rbx)
  movq   $0x0,0x10(%rbx)
  movq   $0x0,0x18(%rbx)
  movsd  0x8(%rsi),%xmm0
  movsd  (%rax),%xmm1
  comisd %xmm0,%xmm1
  jae    L61
  mov    0x58(%rsp),%rax
  mov    0x50(%rsp),%rsi
  mov    %r11,(%rsp)
  movsd  (%rax),%xmm1
  movslq %r8d,%rax
  comisd (%rsi,%rax,8),%xmm0
  jb     L207
  movapd %xmm1,%xmm0
  mov    %r11d,%esi
  mov    %r9,0x8(%rsp)
  sub    $0x1,%r13d
  call   <FindSpan@plt>
  imul   %r15d,%r13d
  mov    0x78(%rsp),%rcx
  mov    0x70(%rsp),%r9
  mov    %eax,%r14d
  mov    0x58(%rsp),%rax
  mov    0x68(%rsp),%r8
  mov    %r12d,%esi
  mov    0x8(%rsp),%rdx
  mov    %r14d,%edi
  sub    %r12d,%r14d
  movsd  (%rax),%xmm0
  call   <BasisFuns@plt>
  lea    0x0(%r13,%r14,4),%ecx
  test   %r12d,%r12d
  js     L172
  mov    (%rsp),%r11
  movslq %ecx,%rcx
  movsd  (%rbx),%xmm4
  lea    0x0(%rbp,%rcx,8),%rax
  movsd  0x8(%rbx),%xmm3
  movsd  0x10(%rbx),%xmm2
  lea    (%rcx,%r11,4),%rcx
  movsd  0x18(%rbx),%xmm1
  mov    0x78(%rsp),%rdx
  lea    0x20(%rbp,%rcx,8),%rcx
  nopl   0x0(%rax)
L238:
  movsd  (%rdx),%xmm0
  mulsd  (%rax),%xmm0
  add    $0x20,%rax
  add    $0x8,%rdx
  addsd  %xmm0,%xmm4
  movsd  %xmm4,(%rbx)
  movsd  -0x8(%rdx),%xmm0
  mulsd  -0x18(%rax),%xmm0
  addsd  %xmm0,%xmm3
  movsd  %xmm3,0x8(%rbx)
  movsd  -0x8(%rdx),%xmm0
  mulsd  -0x10(%rax),%xmm0
  addsd  %xmm0,%xmm2
  movsd  %xmm2,0x10(%rbx)
  movsd  -0x8(%rdx),%xmm0
  mulsd  -0x8(%rax),%xmm0
  addsd  %xmm0,%xmm1
  movsd  %xmm1,0x18(%rbx)
  cmp    %rax,%rcx
  jne    L238
  jmp    L172
  nopl   0x0(%rax,%rax,1)
L209:
  mov    0x50(%rsp),%rdi
  movslq %r8d,%rax
  comisd (%rdi,%rax,8),%xmm0
  jb     L193
  sub    $0x1,%r13d
  imul   %r15d,%r13d
  movslq %r13d,%rax
  movsd  0x0(%rbp,%rax,8),%xmm0
  lea    0x0(,%rax,8),%rdx
  movsd  %xmm0,(%rbx)
  movsd  0x8(%rbp,%rdx,1),%xmm0
  movsd  %xmm0,0x8(%rbx)
  movsd  0x10(%rbp,%rdx,1),%xmm0
  movsd  %xmm0,0x10(%rbx)
  movsd  0x18(%rbp,%rdx,1),%xmm0
  movsd  %xmm0,0x18(%rbx)
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L155:
  movslq %r15d,%r15
  shl    $0x3,%r15
  movsd  -0x20(%rbp,%r15,1),%xmm0
  movsd  %xmm0,(%rbx)
  movsd  -0x18(%rbp,%r15,1),%xmm0
  movsd  %xmm0,0x8(%rbx)
  movsd  -0x10(%rbp,%r15,1),%xmm0
  movsd  %xmm0,0x10(%rbx)
  movsd  -0x8(%rbp,%r15,1),%xmm0
  movsd  %xmm0,0x18(%rbx)
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L61:
  movsd  (%rsi),%xmm0
  mov    %r11d,%esi
  mov    %r11,0x8(%rsp)
  mov    %r9,(%rsp)
  call   <FindSpan@plt>
  mov    0x70(%rsp),%r9
  mov    (%rsp),%rdx
  mov    %r12d,%esi
  mov    %eax,%r13d
  mov    0x58(%rsp),%rax
  mov    0x68(%rsp),%r8
  mov    0x78(%rsp),%rcx
  mov    %r13d,%edi
  sub    %r12d,%r13d
  movsd  (%rax),%xmm0
  call   <BasisFuns@plt>
  test   %r12d,%r12d
  js     L172
  lea    0x0(,%r13,4),%eax
  mov    0x8(%rsp),%r11
  movsd  (%rbx),%xmm4
  cltq
  movsd  0x8(%rbx),%xmm3
  movsd  0x10(%rbx),%xmm2
  lea    0x0(%rbp,%rax,8),%rdx
  movslq %r13d,%rax
  movsd  0x18(%rbx),%xmm1
  mov    0x78(%rsp),%rcx
  add    %r11,%rax
  shl    $0x5,%rax
  lea    0x20(%rbp,%rax,1),%rax
  xchg   %ax,%ax
L210:
  movsd  (%rcx),%xmm0
  mulsd  (%rdx),%xmm0
  add    $0x20,%rdx
  add    $0x8,%rcx
  addsd  %xmm0,%xmm4
  movsd  %xmm4,(%rbx)
  movsd  -0x8(%rcx),%xmm0
  mulsd  -0x18(%rdx),%xmm0
  addsd  %xmm0,%xmm3
  movsd  %xmm3,0x8(%rbx)
  movsd  -0x8(%rcx),%xmm0
  mulsd  -0x10(%rdx),%xmm0
  addsd  %xmm0,%xmm2
  movsd  %xmm2,0x10(%rbx)
  movsd  -0x8(%rcx),%xmm0
  mulsd  -0x8(%rdx),%xmm0
  addsd  %xmm0,%xmm1
  movsd  %xmm1,0x18(%rbx)
  cmp    %rdx,%rax
  jne    L210
  jmp    L172
  nopl   0x0(%rax,%rax,1)
L193:
  mov    0x58(%rsp),%rax
  movq   $0x0,(%rbx)
  mov    %r8d,%edi
  movq   $0x0,0x8(%rbx)
  mov    0x50(%rsp),%rdx
  movq   $0x0,0x10(%rbx)
  movq   $0x0,0x18(%rbx)
  movsd  0x8(%rax),%xmm0
  mov    %r10,(%rsp)
  call   <FindSpan@plt>
  mov    0x88(%rsp),%r9
  mov    0x50(%rsp),%rdx
  mov    %r14d,%esi
  mov    %eax,%r12d
  mov    0x58(%rsp),%rax
  mov    0x80(%rsp),%r8
  mov    0x90(%rsp),%rcx
  mov    %r12d,%edi
  sub    %r14d,%r12d
  movsd  0x8(%rax),%xmm0
  call   <BasisFuns@plt>
  test   %r14d,%r14d
  js     L172
  imul   %r15d,%r12d
  mov    (%rsp),%r10
  movslq %r15d,%rcx
  movsd  (%rbx),%xmm4
  movsd  0x8(%rbx),%xmm3
  movsd  0x10(%rbx),%xmm2
  shl    $0x3,%rcx
  mov    0x90(%rsp),%rdx
  movsd  0x18(%rbx),%xmm1
  movslq %r12d,%rax
  lea    0x0(%rbp,%rax,8),%rax
  lea    0x8(%rdx,%r10,1),%rsi
  nopw   0x0(%rax,%rax,1)
L65:
  movsd  (%rdx),%xmm0
  mulsd  (%rax),%xmm0
  add    $0x8,%rdx
  addsd  %xmm0,%xmm4
  movsd  %xmm4,(%rbx)
  movsd  -0x8(%rdx),%xmm0
  mulsd  0x8(%rax),%xmm0
  addsd  %xmm0,%xmm3
  movsd  %xmm3,0x8(%rbx)
  movsd  -0x8(%rdx),%xmm0
  mulsd  0x10(%rax),%xmm0
  addsd  %xmm0,%xmm2
  movsd  %xmm2,0x10(%rbx)
  movsd  -0x8(%rdx),%xmm0
  mulsd  0x18(%rax),%xmm0
  add    %rcx,%rax
  addsd  %xmm0,%xmm1
  movsd  %xmm1,0x18(%rbx)
  cmp    %rdx,%rsi
  jne    L65
  jmp    L172
  nopw   0x0(%rax,%rax,1)
L207:
  movapd %xmm1,%xmm0
  mov    %r11d,%esi
  mov    %r10,0x8(%rsp)
  mov    %r9,(%rsp)
  call   <FindSpan@plt>
  mov    0x70(%rsp),%r9
  mov    (%rsp),%rdx
  mov    %r12d,%esi
  mov    %eax,%r11d
  mov    0x58(%rsp),%rax
  mov    0x68(%rsp),%r8
  mov    0x78(%rsp),%rcx
  mov    %r11d,%edi
  mov    %r11d,(%rsp)
  movsd  (%rax),%xmm0
  call   <BasisFuns@plt>
  mov    0x58(%rsp),%rax
  mov    %r13d,%edi
  mov    %r14d,%esi
  mov    0x50(%rsp),%rdx
  movsd  0x8(%rax),%xmm0
  call   <FindSpan@plt>
  mov    0x80(%rsp),%r8
  mov    0x50(%rsp),%rdx
  mov    %r14d,%esi
  mov    %eax,%r13d
  mov    0x58(%rsp),%rax
  mov    0x88(%rsp),%r9
  mov    0x90(%rsp),%rcx
  mov    %r13d,%edi
  sub    %r14d,%r13d
  movsd  0x8(%rax),%xmm0
  imul   %r15d,%r13d
  call   <BasisFuns@plt>
  mov    (%rsp),%r11d
  sub    %r12d,%r11d
  lea    0x0(%r13,%r11,4),%r8d
  test   %r14d,%r14d
  js     L172
  mov    0x78(%rsp),%rdi
  mov    0x8(%rsp),%r10
  mov    %r12d,%eax
  movslq %r8d,%r8
  mov    0x90(%rsp),%rcx
  lea    0x8(%rdi,%rax,8),%rsi
  xor    %edi,%edi
  lea    0x8(%rcx,%r10,1),%r9
  nopw   0x0(%rax,%rax,1)
L249:
  test   %r12d,%r12d
  js     L105
  movslq %edi,%rax
  movsd  (%rbx),%xmm4
  movsd  0x8(%rbx),%xmm3
  add    %r8,%rax
  movsd  0x10(%rbx),%xmm2
  movsd  0x18(%rbx),%xmm1
  mov    0x78(%rsp),%rdx
  lea    0x0(%rbp,%rax,8),%rax
  nopl   0x0(%rax)
L174:
  movsd  (%rcx),%xmm0
  mulsd  (%rdx),%xmm0
  add    $0x8,%rdx
  add    $0x20,%rax
  movsd  -0x20(%rax),%xmm5
  mulsd  %xmm0,%xmm5
  addsd  %xmm5,%xmm4
  movsd  %xmm4,(%rbx)
  movsd  -0x18(%rax),%xmm5
  mulsd  %xmm0,%xmm5
  addsd  %xmm5,%xmm3
  movsd  %xmm3,0x8(%rbx)
  movsd  -0x10(%rax),%xmm5
  mulsd  %xmm0,%xmm5
  addsd  %xmm5,%xmm2
  movsd  %xmm2,0x10(%rbx)
  mulsd  -0x8(%rax),%xmm0
  addsd  %xmm0,%xmm1
  movsd  %xmm1,0x18(%rbx)
  cmp    %rdx,%rsi
  jne    L174
L105:
  add    $0x8,%rcx
  add    %r15d,%edi
  cmp    %rcx,%r9
  jne    L249
  jmp    L172
L142:
  mov    0x58(%rsp),%rax
  movq   $0x0,(%rbx)
  mov    %r8d,%edi
  movq   $0x0,0x8(%rbx)
  mov    0x50(%rsp),%rdx
  movq   $0x0,0x10(%rbx)
  movq   $0x0,0x18(%rbx)
  movsd  0x8(%rax),%xmm0
  mov    %r10,(%rsp)
  call   <FindSpan@plt>
  mov    0x50(%rsp),%rdx
  mov    %r14d,%esi
  mov    0x88(%rsp),%r9
  mov    %eax,%r12d
  mov    0x58(%rsp),%rax
  mov    0x80(%rsp),%r8
  mov    0x90(%rsp),%rcx
  mov    %r12d,%edi
  sub    %r14d,%r12d
  movsd  0x8(%rax),%xmm0
  call   <BasisFuns@plt>
  lea    0x1(%r12),%edx
  imul   %r15d,%edx
  test   %r14d,%r14d
  js     L172
  mov    (%rsp),%r10
  movslq %r15d,%rcx
  movslq %edx,%rdx
  movsd  (%rbx),%xmm4
  movsd  0x8(%rbx),%xmm3
  movsd  0x10(%rbx),%xmm2
  shl    $0x3,%rcx
  lea    0x0(%rbp,%rdx,8),%rdx
  mov    0x90(%rsp),%rax
  movsd  0x18(%rbx),%xmm1
  lea    0x8(%rax,%r10,1),%rsi
  nopl   0x0(%rax)
L245:
  movsd  (%rax),%xmm0
  mulsd  -0x20(%rdx),%xmm0
  add    $0x8,%rax
  addsd  %xmm0,%xmm4
  movsd  %xmm4,(%rbx)
  movsd  -0x8(%rax),%xmm0
  mulsd  -0x18(%rdx),%xmm0
  addsd  %xmm0,%xmm3
  movsd  %xmm3,0x8(%rbx)
  movsd  -0x8(%rax),%xmm0
  mulsd  -0x10(%rdx),%xmm0
  addsd  %xmm0,%xmm2
  movsd  %xmm2,0x10(%rbx)
  movsd  -0x8(%rax),%xmm0
  mulsd  -0x8(%rdx),%xmm0
  add    %rcx,%rdx
  addsd  %xmm0,%xmm1
  movsd  %xmm1,0x18(%rbx)
  cmp    %rax,%rsi
  jne    L245
  jmp    L172
```

assistant: ```c
void oneBspEval2(int degU, int degV, double *cp, int ncp, int kcp, double *knotU, double *knotV, double *us, double *ep, double *leftU, double *rightU, double *NU, double *leftV, double *rightV, double *NV) {
  int i, j, spanU, spanV, ind, ind2, fourncp, myint;
  double NN;
  fourncp = 4 * ncp;
  if (us[0] <= knotU[degU]) {
    if (us[1] <= knotV[degV]) {
      ep[0] = cp[0];
      ep[1] = cp[1];
      ep[2] = cp[2];
      ep[3] = cp[3];
    } else if (us[1] >= knotV[kcp]) {
      myint = fourncp * (kcp - 1);
      ep[0] = cp[myint];
      ep[1] = cp[myint + 1];
      ep[2] = cp[myint + 2];
      ep[3] = cp[myint + 3];
    } else {
      ep[0] = 0.0;
      ep[1] = 0.0;
      ep[2] = 0.0;
      ep[3] = 0.0;
      spanV = FindSpan(kcp, degV, us[1], knotV);
      BasisFuns(spanV, us[1], degV, knotV, NV, leftV, rightV);
      ind = spanV - degV;
      for (i = 0; i <= degV; i++) {
        ep[0] += NV[i] * cp[(ind + i) * fourncp];
        ep[1] += NV[i] * cp[(ind + i) * fourncp + 1];
        ep[2] += NV[i] * cp[(ind + i) * fourncp + 2];
        ep[3] += NV[i] * cp[(ind + i) * fourncp + 3];
      }
    }
  } else if (us[0] >= knotU[ncp]) {
    if (us[1] <= knotV[degV]) {
      ep[0] = cp[fourncp - 4];
      ep[1] = cp[fourncp - 3];
      ep[2] = cp[fourncp - 2];
      ep[3] = cp[fourncp - 1];
    } else if (us[1] >= knotV[kcp]) {
      myint = fourncp * kcp;
      ep[0] = cp[myint - 4];
      ep[1] = cp[myint - 3];
      ep[2] = cp[myint - 2];
      ep[3] = cp[myint - 1];
    } else {
      ep[0] = 0.0;
      ep[1] = 0.0;
      ep[2] = 0.0;
      ep[3] = 0.0;
      spanV = FindSpan(kcp, degV, us[1], knotV);
      BasisFuns(spanV, us[1], degV, knotV, NV, leftV, rightV);
      ind = spanV - degV;
      myint = (ind + 1) * fourncp;
      for (i = 0; i <= degV; i++) {
        ep[0] += NV[i] * cp[i * fourncp + myint - 4];
        ep[1] += NV[i] * cp[i * fourncp + myint - 3];
        ep[2] += NV[i] * cp[i * fourncp + myint - 2];
        ep[3] += NV[i] * cp[i * fourncp + myint - 1];
      }
    }
  } else {
    ep[0] = 0.0;
    ep[1] = 0.0;
    ep[2] = 0.0;
    ep[3] = 0.0;
    if (us[1] <= knotV[degV]) {
      spanU = FindSpan(ncp, degU, us[0], knotU);
      BasisFuns(spanU, us[0], degU, knotU, NU, leftU, rightU);
      ind = spanU - degU;
      for (i = 0; i <= degU; i++) {
        ep[0] += NU[i] * cp[(ind + i) * 4];
        ep[1] += NU[i] * cp[(ind + i) * 4 + 1];
        ep[2] += NU[i] * cp[(ind + i) * 4 + 2];
        ep[3] += NU[i] * cp[(ind + i) * 4 + 3];
      }
    } else if (us[1] >= knotV[kcp]) {
      spanU = FindSpan(ncp, degU, us[0], knotU);
      BasisFuns(spanU, us[0], degU, knotU, NU, leftU, rightU);
      ind = spanU - degU;
      myint = ind * 4 + (kcp - 1) * fourncp;
      for (i = 0; i <= degU; i++) {
        ep[0] += NU[i] * cp[i * 4 + myint];
        ep[1] += NU[i] * cp[i * 4 + myint + 1];
        ep[2] += NU[i] * cp[i * 4 + myint + 2];
        ep[3] += NU[i] * cp[i * 4 + myint + 3];
      }
    } else {
      spanU = FindSpan(ncp, degU, us[0], knotU);
      BasisFuns(spanU, us[0], degU, knotU, NU, leftU, rightU);
      spanV = FindSpan(kcp, degV, us[1], knotV);
      BasisFuns(spanV, us[1], degV, knotV, NV, leftV, rightV);
      ind = spanU - degU;
      ind2 = spanV - degV;
      myint = ind2 * fourncp + ind * 4;
      for (i = 0; i <= degV; i++) {
        for (j = 0; j <= degU; j++) {
          NN = NV[i] * NU[j];
          ep[0] += NN * cp[i * fourncp + j * 4 + myint];
          ep[1] += NN * cp[i * fourncp + j * 4 + myint + 1];
          ep[2] += NN * cp[i * fourncp + j * 4 + myint + 2];
          ep[3] += NN * cp[i * fourncp + j * 4 + myint + 3];
        }
      }
    }
  }
}
```