user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<NURBScurveEval>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x68,%rsp
  mov    %edi,0x50(%rsp)
  mov    %edx,0x54(%rsp)
  mov    %rcx,0x38(%rsp)
  mov    0xa0(%rsp),%r13
  test   %r9d,%r9d
  jle    L94
  mov    %rsi,%rbx
  mov    %edx,%esi
  lea    0x0(,%rdx,4),%eax
  movslq %edi,%rdx
  lea    (%rcx,%rdx,8),%r12
  movslq %esi,%rdx
  lea    (%rcx,%rdx,8),%rsi
  mov    %rsi,0x10(%rsp)
  cltq
  shl    $0x3,%rax
  lea    -0x20(%rbx,%rax,1),%rsi
  mov    %rsi,0x18(%rsp)
  lea    -0x8(%rbx,%rax,1),%rsi
  mov    %rsi,0x20(%rsp)
  lea    -0x18(%rbx,%rax,1),%rcx
  mov    %rcx,0x28(%rsp)
  lea    -0x10(%rbx,%rax,1),%rax
  mov    %rax,0x30(%rsp)
  mov    %r8,%rbp
  lea    (%r9,%r9,2),%eax
  mov    %eax,0xc(%rsp)
  mov    $0x0,%r15d
  lea    0x20(%rbx),%rax
  mov    %rax,0x58(%rsp)
  jmp    L26
L33:
  mov    0x10(%rsp),%rax
  comisd (%rax),%xmm0
  jb     L45
  movslq %r15d,%rdx
  lea    0x0(,%rdx,8),%rax
  mov    0x18(%rsp),%rcx
  movsd  (%rcx),%xmm0
  mov    0x20(%rsp),%rdi
  divsd  (%rdi),%xmm0
  movsd  %xmm0,0x0(%r13,%rdx,8)
  mov    0x28(%rsp),%rsi
  movsd  (%rsi),%xmm0
  divsd  (%rdi),%xmm0
  movsd  %xmm0,0x8(%r13,%rax,1)
  mov    0x30(%rsp),%rcx
  movsd  (%rcx),%xmm0
  divsd  (%rdi),%xmm0
  movsd  %xmm0,0x10(%r13,%rax,1)
L51:
  add    $0x8,%rbp
  add    $0x3,%r15d
  cmp    0xc(%rsp),%r15d
  je     L94
L26:
  mov    %rbp,(%rsp)
  movsd  0x0(%rbp),%xmm0
  movsd  (%r12),%xmm1
  comisd %xmm0,%xmm1
  jb     L33
  movslq %r15d,%rdx
  lea    0x0(,%rdx,8),%rax
  movsd  (%rbx),%xmm0
  divsd  0x18(%rbx),%xmm0
  movsd  %xmm0,0x0(%r13,%rdx,8)
  movsd  0x8(%rbx),%xmm0
  divsd  0x18(%rbx),%xmm0
  movsd  %xmm0,0x8(%r13,%rax,1)
  movsd  0x10(%rbx),%xmm0
  divsd  0x18(%rbx),%xmm0
  movsd  %xmm0,0x10(%r13,%rax,1)
  jmp    L51
L45:
  movslq %r15d,%rax
  shl    $0x3,%rax
  lea    0x0(%r13,%rax,1),%r14
  movq   $0x0,(%r14)
  lea    0x8(%r13,%rax,1),%rsi
  mov    %rsi,0x40(%rsp)
  movq   $0x0,(%rsi)
  lea    0x10(%r13,%rax,1),%rax
  mov    %rax,0x48(%rsp)
  movq   $0x0,(%rax)
  mov    0x38(%rsp),%rdx
  mov    (%rsp),%rcx
  movsd  (%rcx),%xmm0
  mov    0x50(%rsp),%esi
  mov    0x54(%rsp),%edi
  call   <FindSpan@plt>
  mov    0xb0(%rsp),%r9
  mov    0xa8(%rsp),%r8
  mov    0xb8(%rsp),%rcx
  mov    0x38(%rsp),%rdx
  mov    0x50(%rsp),%esi
  mov    (%rsp),%r11
  movsd  (%r11),%xmm0
  mov    %eax,(%rsp)
  mov    %eax,%edi
  call   <BasisFuns@plt>
  mov    (%rsp),%ecx
  mov    0x50(%rsp),%r10d
  sub    %r10d,%ecx
  test   %r10d,%r10d
  js     L42
  mov    0xb8(%rsp),%rdx
  lea    0x0(,%rcx,4),%eax
  cltq
  lea    (%rbx,%rax,8),%rax
  movslq %ecx,%rcx
  mov    %r10d,%esi
  add    %rsi,%rcx
  shl    $0x5,%rcx
  add    0x58(%rsp),%rcx
  pxor   %xmm1,%xmm1
  mov    0x40(%rsp),%rsi
  mov    0x48(%rsp),%rdi
L32:
  movsd  (%rdx),%xmm0
  mulsd  (%rax),%xmm0
  addsd  (%r14),%xmm0
  movsd  %xmm0,(%r14)
  movsd  (%rdx),%xmm0
  mulsd  0x8(%rax),%xmm0
  addsd  (%rsi),%xmm0
  movsd  %xmm0,(%rsi)
  movsd  (%rdx),%xmm0
  mulsd  0x10(%rax),%xmm0
  addsd  (%rdi),%xmm0
  movsd  %xmm0,(%rdi)
  movsd  (%rdx),%xmm0
  mulsd  0x18(%rax),%xmm0
  addsd  %xmm0,%xmm1
  add    $0x8,%rdx
  add    $0x20,%rax
  cmp    %rcx,%rax
  jne    L32
L0:
  movsd  (%r14),%xmm0
  divsd  %xmm1,%xmm0
  movsd  %xmm0,(%r14)
  mov    0x40(%rsp),%rax
  movsd  (%rax),%xmm0
  divsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  mov    0x48(%rsp),%rax
  movsd  (%rax),%xmm0
  divsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  jmp    L51
L42:
  pxor   %xmm1,%xmm1
  jmp    L0
L94:
  add    $0x68,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
void NURBScurveEval(int deg, double *cp, int ncp, double *knot, double *us, int nus, double *ep, double *left, double *right, double *N) {
  int i, jj, span, ind, fourncp;
  double wgh;
  fourncp = 4 * ncp;
  for (jj = 0; jj < nus; jj++) {
    if (us[jj] <= knot[deg]) {
      ep[jj * 3] = cp[0] / cp[3];
      ep[jj * 3 + 1] = cp[1] / cp[3];
      ep[jj * 3 + 2] = cp[2] / cp[3];
    } else if (us[jj] >= knot[ncp]) {
      ep[jj * 3] = cp[fourncp - 4] / cp[fourncp - 1];
      ep[jj * 3 + 1] = cp[fourncp - 3] / cp[fourncp - 1];
      ep[jj * 3 + 2] = cp[fourncp - 2] / cp[fourncp - 1];
    } else {
      ep[jj * 3] = 0.0;
      ep[jj * 3 + 1] = 0.0;
      ep[jj * 3 + 2] = 0.0;
      wgh = 0.0;
      span = FindSpan(ncp, deg, us[jj], knot);
      BasisFuns(span, us[jj], deg, knot, N, left, right);
      ind = span - deg;
      for (i = 0; i <= deg; i++) {
        ep[jj * 3] += N[i] * cp[(i + ind) * 4];
        ep[jj * 3 + 1] += N[i] * cp[(i + ind) * 4 + 1];
        ep[jj * 3 + 2] += N[i] * cp[(i + ind) * 4 + 2];
        wgh += N[i] * cp[(i + ind) * 4 + 3];
      }
      ep[jj * 3] = ep[jj * 3] / wgh;
      ep[jj * 3 + 1] = ep[jj * 3 + 1] / wgh;
      ep[jj * 3 + 2] = ep[jj * 3 + 2] / wgh;
    }
  }
}
```