user: 请将以下的汇编代码转换成C语言代码:

```asm
<lineSearchUpdateOffsetNURBS>:
  endbr64
  push   %r15
  mov    %r8d,%r15d
  push   %r14
  imul   %r9d,%r15d
  push   %r13
  mov    %edi,%r13d
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rcx,%rbx
  sub    $0x98,%rsp
  mov    0xe8(%rsp),%ecx
  mov    %esi,0x40(%rsp)
  mov    %rdx,0x18(%rsp)
  mov    0xf8(%rsp),%rbp
  lea    -0x8(%r15,%r15,1),%edx
  mov    %r8d,0x8c(%rsp)
  mov    0x100(%rsp),%rsi
  mov    %r9d,0x64(%rsp)
  mov    0x110(%rsp),%r11
  mov    0x118(%rsp),%rdi
  mov    0x130(%rsp),%r12
  test   %ecx,%ecx
  jle    L127
  mov    0xe8(%rsp),%eax
  pxor   %xmm8,%xmm8
  mov    %rsi,%rcx
  movsd  %xmm8,0x70(%rsp)
  lea    -0x1(%rax),%r8d
  mov    %r8,%rax
  lea    0x8(%rsi,%r8,8),%r8
L170:
  movsd  (%rcx),%xmm0
  add    $0x8,%rcx
  mulsd  %xmm0,%xmm0
  addsd  0x70(%rsp),%xmm0
  movsd  %xmm0,0x70(%rsp)
  cmp    %r8,%rcx
  jne    L170
  test   %edx,%edx
  jle    L119
L179:
  movslq %edx,%rcx
  movapd %xmm8,%xmm0
  xor    %edx,%edx
L167:
  movsd  (%r11,%rdx,8),%xmm1
  mulsd  (%rdi,%rdx,8),%xmm1
  add    $0x1,%rdx
  addsd  %xmm1,%xmm0
  cmp    %rcx,%rdx
  jne    L167
  mulsd  D8(%rip),%xmm0
  movsd  %xmm0,0x78(%rsp)
L227:
  shl    $0x4,%rax
  mov    %r13d,0xc(%rsp)
  movslq %r13d,%r10
  mov    %r11,%r14
  movslq 0xe8(%rsp),%rdx
  movsd  D11(%rip),%xmm7
  movl   $0x32,0x88(%rsp)
  lea    (%rsi,%rdx,8),%rsi
  mov    %rsi,0x80(%rsp)
  mov    0xe0(%rsp),%rsi
  lea    0x10(%rsi,%rax,1),%rax
  mov    0x148(%rsp),%rsi
  mov    %rax,0x58(%rsp)
  mov    0x40(%rsp),%eax
  lea    0x8(%rsi,%rax,8),%rax
  mov    %rax,0x10(%rsp)
L193:
  mov    0xe8(%rsp),%eax
  test   %eax,%eax
  jle    L208
  mov    0xf0(%rsp),%rax
  mov    %r10,%r13
  mov    0x8c(%rsp),%r10d
  movsd  %xmm8,0x30(%rsp)
  movsd  %xmm7,0x68(%rsp)
  mov    %rax,0x28(%rsp)
  mov    0x80(%rsp),%rax
  mov    %rax,0x38(%rsp)
  mov    0xe0(%rsp),%rax
  mov    %rax,0x20(%rsp)
  nopw   0x0(%rax,%rax,1)
L59:
  mov    0x20(%rsp),%rax
  mov    0xc(%rsp),%esi
  mov    %r10d,%edi
  mov    %r10d,0x48(%rsp)
  mov    0xd0(%rsp),%rdx
  movsd  %xmm8,0x50(%rsp)
  movsd  (%rax),%xmm0
  call   <FindSpan@plt>
  mov    0x128(%rsp),%r9
  mov    0xc(%rsp),%esi
  mov    %r12,%rcx
  mov    %eax,%edi
  mov    0x20(%rsp),%rax
  mov    0x120(%rsp),%r8
  mov    0xd0(%rsp),%rdx
  mov    %edi,0x44(%rsp)
  movsd  (%rax),%xmm0
  call   <BasisFuns@plt>
  mov    0x20(%rsp),%rax
  mov    0x44(%rsp),%edi
  sub    0xc(%rsp),%edi
  mov    0xd8(%rsp),%rdx
  movsd  0x8(%rax),%xmm0
  mov    0x40(%rsp),%esi
  mov    %edi,0x60(%rsp)
  mov    0x64(%rsp),%edi
  call   <FindSpan@plt>
  mov    0x140(%rsp),%r9
  mov    0x138(%rsp),%r8
  mov    %eax,%edi
  mov    0x20(%rsp),%rax
  mov    0x148(%rsp),%rcx
  mov    0xd8(%rsp),%rdx
  mov    0x40(%rsp),%esi
  mov    %edi,0x44(%rsp)
  movsd  0x8(%rax),%xmm0
  call   <BasisFuns@plt>
  mov    0x40(%rsp),%eax
  mov    0x44(%rsp),%edi
  mov    0x48(%rsp),%r10d
  movsd  0x50(%rsp),%xmm8
  sub    %eax,%edi
  test   %eax,%eax
  js     L31
  imul   %r10d,%edi
  mov    0x60(%rsp),%r9d
  movapd %xmm8,%xmm6
  mov    0x148(%rsp),%r11
  movsd  0x68(%rsp),%xmm7
  movapd %xmm8,%xmm4
  movapd %xmm8,%xmm5
  movapd %xmm8,%xmm3
  add    %edi,%r9d
  nopl   0x0(%rax)
L47:
  mov    0xc(%rsp),%edx
  test   %edx,%edx
  js     L162
  movslq %r9d,%rax
  movsd  (%r11),%xmm9
  lea    (%r9,%r9,2),%edi
  xor    %edx,%edx
  mov    0x108(%rsp),%rsi
  mov    %rax,%rcx
  shl    $0x5,%rcx
  add    0x18(%rsp),%rcx
  lea    (%rsi,%rax,4),%r8
  jmp    L26
  nopw   0x0(%rax,%rax,1)
L181:
  add    %eax,%eax
  add    $0x20,%rcx
  movslq %eax,%rsi
  movslq %edi,%rax
  add    $0x3,%edi
  movsd  0x8(%r14,%rsi,8),%xmm2
  mulsd  %xmm7,%xmm2
  addsd  %xmm2,%xmm1
  movsd  0x0(%rbp,%rax,8),%xmm2
  mulsd  %xmm1,%xmm0
  movsd  (%r14,%rsi,8),%xmm1
  mulsd  %xmm7,%xmm1
  addsd  %xmm0,%xmm6
  mulsd  %xmm1,%xmm2
  addsd  (%rbx,%rax,8),%xmm2
  mulsd  %xmm0,%xmm2
  addsd  %xmm2,%xmm3
  movsd  0x8(%rbp,%rax,8),%xmm2
  mulsd  %xmm1,%xmm2
  mulsd  0x10(%rbp,%rax,8),%xmm1
  addsd  0x8(%rbx,%rax,8),%xmm2
  addsd  0x10(%rbx,%rax,8),%xmm1
  lea    0x1(%rdx),%rax
  mulsd  %xmm0,%xmm2
  mulsd  %xmm0,%xmm1
  addsd  %xmm2,%xmm5
  addsd  %xmm1,%xmm4
  cmp    %rdx,%r13
  je     L162
L29:
  mov    %rax,%rdx
L26:
  movsd  (%r12,%rdx,8),%xmm0
  mov    (%r8,%rdx,4),%eax
  movsd  0x18(%rcx),%xmm1
  mulsd  %xmm9,%xmm0
  cmp    %r15d,%eax
  jl     L181
  movsd  (%rcx),%xmm2
  lea    0x1(%rdx),%rax
  add    $0x20,%rcx
  add    $0x3,%edi
  mulsd  %xmm0,%xmm2
  addsd  %xmm2,%xmm3
  movsd  -0x18(%rcx),%xmm2
  mulsd  %xmm0,%xmm2
  addsd  %xmm2,%xmm5
  movsd  -0x10(%rcx),%xmm2
  mulsd  %xmm0,%xmm2
  mulsd  %xmm1,%xmm0
  addsd  %xmm2,%xmm4
  addsd  %xmm0,%xmm6
  cmp    %rdx,%r13
  jne    L29
L162:
  add    %r10d,%r9d
  add    $0x8,%r11
  cmp    %r11,0x10(%rsp)
  jne    L47
L81:
  mov    0x28(%rsp),%rax
  mov    0x38(%rsp),%rsi
  mov    %r10d,0x44(%rsp)
  movsd  %xmm8,0x48(%rsp)
  mulsd  (%rax),%xmm3
  mulsd  0x8(%rax),%xmm5
  mulsd  0x10(%rax),%xmm4
  addsd  %xmm5,%xmm3
  addsd  %xmm4,%xmm3
  divsd  %xmm6,%xmm3
  addsd  (%rsi),%xmm3
  movapd %xmm3,%xmm0
  call   <pwr2@plt>
  pxor   %xmm0,%xmm0
  mov    0x44(%rsp),%r10d
  addq   $0x10,0x20(%rsp)
  cvtsi2sd %rax,%xmm0
  addsd  0x30(%rsp),%xmm0
  addq   $0x18,0x28(%rsp)
  addq   $0x8,0x38(%rsp)
  mov    0x20(%rsp),%rdi
  cmp    %rdi,0x58(%rsp)
  movsd  0x48(%rsp),%xmm8
  movsd  %xmm0,0x30(%rsp)
  jne    L59
  movsd  0x68(%rsp),%xmm7
  mov    %r13,%r10
L158:
  movsd  0x78(%rsp),%xmm0
  mulsd  %xmm7,%xmm0
  addsd  0x70(%rsp),%xmm0
  comisd 0x30(%rsp),%xmm0
  ja     L219
  mulsd  D8(%rip),%xmm7
  subl   $0x1,0x88(%rsp)
  jne    L193
L48:
  add    $0x98,%rsp
  movapd %xmm8,%xmm0
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L31:
  movapd %xmm8,%xmm6
  movapd %xmm8,%xmm4
  movapd %xmm8,%xmm5
  movapd %xmm8,%xmm3
  jmp    L81
L208:
  movsd  %xmm8,0x30(%rsp)
  jmp    L158
L219:
  movsd  0x70(%rsp),%xmm8
  mov    %r14,%r11
  subsd  0x30(%rsp),%xmm8
  test   %r15d,%r15d
  jle    L48
  mov    0x108(%rsp),%rsi
  mov    0x18(%rsp),%rax
  lea    (%r15,%r15,2),%r9d
  xor    %ecx,%ecx
L40:
  mov    (%rsi),%edx
  cmp    %r15d,%edx
  jge    L130
  add    %edx,%edx
  movslq %ecx,%rdi
  movslq %edx,%rdx
  lea    0x0(,%rdi,8),%r12
  lea    (%r11,%rdx,8),%r13
  lea    (%rbx,%r12,1),%r10
  movsd  0x0(%r13),%xmm0
  lea    0x8(%rbx,%r12,1),%r8
  mulsd  %xmm7,%xmm0
  mulsd  0x0(%rbp,%rdi,8),%xmm0
  lea    0x10(%rbx,%r12,1),%rdi
  addsd  (%r10),%xmm0
  movsd  %xmm0,(%r10)
  movsd  0x0(%r13),%xmm0
  mulsd  %xmm7,%xmm0
  mulsd  0x8(%rbp,%r12,1),%xmm0
  addsd  (%r8),%xmm0
  movsd  %xmm0,(%r8)
  movsd  0x0(%r13),%xmm0
  mulsd  %xmm7,%xmm0
  mulsd  0x10(%rbp,%r12,1),%xmm0
  addsd  (%rdi),%xmm0
  movsd  %xmm0,(%rdi)
  movsd  0x8(%r11,%rdx,8),%xmm0
  mulsd  %xmm7,%xmm0
  addsd  0x18(%rax),%xmm0
  movsd  %xmm0,0x18(%rax)
  movsd  (%r10),%xmm1
  mulsd  %xmm0,%xmm1
  movsd  %xmm1,(%rax)
  movsd  (%r8),%xmm1
  mulsd  %xmm0,%xmm1
  movsd  %xmm1,0x8(%rax)
  mulsd  (%rdi),%xmm0
  movsd  %xmm0,0x10(%rax)
L130:
  add    $0x3,%ecx
  add    $0x4,%rsi
  add    $0x20,%rax
  cmp    %ecx,%r9d
  jne    L40
  jmp    L48
L127:
  mov    0xe8(%rsp),%eax
  pxor   %xmm8,%xmm8
  movsd  %xmm8,0x70(%rsp)
  sub    $0x1,%eax
  test   %edx,%edx
  jg     L179
L119:
  movsd  %xmm8,0x78(%rsp)
  jmp    L227
```

tool_calls: name: read_data
arguments: label: D8
datatype: f64
name: read_data
arguments: label: D11
datatype: f64

tool: D8: 0.5

tool: D11: 1

assistant: ```c
double lineSearchUpdateOffsetNURBS(int degU, int degV, double *cpw, double *cp, int ncp, int kcp, double *knotU, double *knotV, double *us, int nus, double *dirOffset, double *cpDir, double *sgnDistDiff, int *matInds, double *gnDir, double *gradIent, double *leftU, double *rightU, double *NU, double *leftV, double *rightV, double *NV) {
  int i, j, ii, itr, twoii, threeii, spanU, spanV, ind, ind2, fourncp, myint, numCP, numRows, orderU, orderV, cpInd;
  double bspnt[4], f0, scfp0, falpha, fdiff = 0.0, alpha = 1.0;
  fourncp = 4 * ncp;
  orderU = degU + 1;
  orderV = degV + 1;
  numCP = ncp * kcp;
  numRows = 2 * (numCP - 4);
  f0 = 0.0;
  for (ii = 0; ii < nus; ii++) {
    f0 += sgnDistDiff[ii] * sgnDistDiff[ii];
  }
  scfp0 = 0.0;
  for (ii = 0; ii < numRows; ii++) {
    scfp0 += gnDir[ii] * gradIent[ii];
  }
  scfp0 = 0.5 * scfp0;
  for (itr = 0; itr < 50; itr++) {
    falpha = 0.0;
    for (ii = 0; ii < nus; ii++) {
      twoii = 2 * ii;
      threeii = 3 * ii;
      spanU = FindSpan(ncp, degU, us[twoii], knotU);
      BasisFuns(spanU, us[twoii], degU, knotU, NU, leftU, rightU);
      ind = spanU - degU;
      spanV = FindSpan(kcp, degV, us[twoii + 1], knotV);
      BasisFuns(spanV, us[twoii + 1], degV, knotV, NV, leftV, rightV);
      ind2 = spanV - degV;
      myint = ind2 * fourncp + ind * 4;
      bspnt[0] = 0.0;
      bspnt[1] = 0.0;
      bspnt[2] = 0.0;
      bspnt[3] = 0.0;
      for (i = 0; i <= degV; i++) {
        for (j = 0; j <= degU; j++) {
          cpInd = (ind2 + i) * ncp + ind + j;
          if (matInds[cpInd] < numCP) {
            bspnt[0] += NV[i] * NU[j] * (cpw[4 * cpInd + 3] + alpha * gnDir[2 * matInds[cpInd] + 1]) * (cp[3 * cpInd] + alpha * gnDir[2 * matInds[cpInd]] * cpDir[3 * cpInd]);
            bspnt[1] += NV[i] * NU[j] * (cpw[4 * cpInd + 3] + alpha * gnDir[2 * matInds[cpInd] + 1]) * (cp[3 * cpInd + 1] + alpha * gnDir[2 * matInds[cpInd]] * cpDir[3 * cpInd + 1]);
            bspnt[2] += NV[i] * NU[j] * (cpw[4 * cpInd + 3] + alpha * gnDir[2 * matInds[cpInd] + 1]) * (cp[3 * cpInd + 2] + alpha * gnDir[2 * matInds[cpInd]] * cpDir[3 * cpInd + 2]);
            bspnt[3] += NV[i] * NU[j] * (cpw[4 * cpInd + 3] + alpha * gnDir[2 * matInds[cpInd] + 1]);
          } else {
            bspnt[0] += NV[i] * NU[j] * cpw[4 * cpInd];
            bspnt[1] += NV[i] * NU[j] * cpw[4 * cpInd + 1];
            bspnt[2] += NV[i] * NU[j] * cpw[4 * cpInd + 2];
            bspnt[3] += NV[i] * NU[j] * cpw[4 * cpInd + 3];
          }
        }
      }
      falpha += pwr2((dirOffset[threeii] * bspnt[0] + dirOffset[threeii + 1] * bspnt[1] + dirOffset[threeii + 2] * bspnt[2]) / bspnt[3] + sgnDistDiff[ii + nus]);
    }
    if (falpha < (f0 + alpha * scfp0)) {
      fdiff = f0 - falpha;
      for (cpInd = 0; cpInd < numCP; cpInd++) {
        if (matInds[cpInd] < numCP) {
          cp[3 * cpInd] += alpha * gnDir[2 * matInds[cpInd]] * cpDir[3 * cpInd];
          cp[3 * cpInd + 1] += alpha * gnDir[2 * matInds[cpInd]] * cpDir[3 * cpInd + 1];
          cp[3 * cpInd + 2] += alpha * gnDir[2 * matInds[cpInd]] * cpDir[3 * cpInd + 2];
          cpw[4 * cpInd + 3] += alpha * gnDir[2 * matInds[cpInd] + 1];
          cpw[4 * cpInd] = cpw[4 * cpInd + 3] * cp[3 * cpInd];
          cpw[4 * cpInd + 1] = cpw[4 * cpInd + 3] * cp[3 * cpInd + 1];
          cpw[4 * cpInd + 2] = cpw[4 * cpInd + 3] * cp[3 * cpInd + 2];
        }
      }
      break;
    } else {
      alpha = 0.5 * alpha;
    }
  }
  return (fdiff);
}
```