user: 请从给定的汇编指令推导出C源代码：

```asm
<CalcParms>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x78,%rsp
  mov    %edi,-0x54(%rbp)
  mov    %rsi,-0x60(%rbp)
  mov    %rdx,-0x68(%rbp)
  mov    %rcx,-0x70(%rbp)
  mov    %r8,-0x78(%rbp)
  mov    %r9,-0x80(%rbp)
  movl   $0x0,-0x48(%rbp)
  jmp    L89
L25:
  mov    -0x48(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x60(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x68(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  movsd  D83(%rip),%xmm0
  mulsd  %xmm0,%xmm1
  movq   %xmm1,%rax
  mov    -0x48(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,8),%rcx
  mov    0x10(%rbp),%rdx
  lea    (%rcx,%rdx,1),%rbx
  movq   %rax,%xmm0
  call   <cos@plt>
  movq   %xmm0,%rax
  mov    %rax,(%rbx)
  addl   $0x1,-0x48(%rbp)
L89:
  mov    -0x48(%rbp),%eax
  cmp    -0x54(%rbp),%eax
  jle    L25
  mov    -0x54(%rbp),%eax
  sub    $0x1,%eax
  movslq %eax,%rdx
  imul   $0xffffffff88888889,%rdx,%rdx
  shr    $0x20,%rdx
  add    %eax,%edx
  sar    $0x3,%edx
  sar    $0x1f,%eax
  mov    %eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  add    $0x1,%eax
  mov    %eax,-0x3c(%rbp)
  movl   $0x0,-0x48(%rbp)
  jmp    L78
L45:
  movsd  D38(%rip),%xmm0
  movsd  %xmm0,-0x30(%rbp)
  mov    -0x48(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    0x10(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movsd  %xmm0,-0x18(%rbp)
  movl   $0x0,-0x44(%rbp)
  jmp    L8
L17:
  mov    -0x44(%rbp),%eax
  mov    %eax,-0x40(%rbp)
  jmp    L98
L74:
  mov    -0x40(%rbp),%eax
  cmp    -0x48(%rbp),%eax
  je     L111
  mov    -0x40(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    0x10(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  movsd  -0x18(%rbp),%xmm0
  subsd  %xmm1,%xmm0
  addsd  %xmm0,%xmm0
  movsd  -0x30(%rbp),%xmm1
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x30(%rbp)
L111:
  mov    -0x3c(%rbp),%eax
  add    %eax,-0x40(%rbp)
L98:
  mov    -0x40(%rbp),%eax
  cmp    -0x54(%rbp),%eax
  jle    L74
  addl   $0x1,-0x44(%rbp)
L8:
  mov    -0x44(%rbp),%eax
  cmp    -0x3c(%rbp),%eax
  jl     L17
  movsd  -0x30(%rbp),%xmm0
  movq   D82(%rip),%xmm1
  andpd  %xmm0,%xmm1
  movsd  D19(%rip),%xmm0
  comisd %xmm1,%xmm0
  jbe    L119
  movsd  D19(%rip),%xmm0
  movsd  %xmm0,-0x30(%rbp)
L119:
  mov    -0x48(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x80(%rbp),%rax
  add    %rdx,%rax
  movsd  D38(%rip),%xmm0
  divsd  -0x30(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x48(%rbp)
L78:
  mov    -0x48(%rbp),%eax
  cmp    -0x54(%rbp),%eax
  jle    L45
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x30(%rbp)
  movsd  -0x30(%rbp),%xmm0
  movsd  %xmm0,-0x28(%rbp)
  movsd  D38(%rip),%xmm0
  movsd  %xmm0,-0x38(%rbp)
  movl   $0x0,-0x48(%rbp)
  jmp    L2
L40:
  mov    -0x48(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x80(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0x48(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x60(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x70(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  -0x28(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x28(%rbp)
  mov    -0x48(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x80(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  -0x38(%rbp),%xmm0
  mov    -0x48(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x60(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x78(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  divsd  %xmm1,%xmm0
  movsd  -0x30(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x30(%rbp)
  movsd  -0x38(%rbp),%xmm0
  movq   D94(%rip),%xmm1
  xorpd  %xmm1,%xmm0
  movsd  %xmm0,-0x38(%rbp)
  addl   $0x1,-0x48(%rbp)
L2:
  mov    -0x48(%rbp),%eax
  cmp    -0x54(%rbp),%eax
  jle    L40
  movsd  -0x28(%rbp),%xmm0
  divsd  -0x30(%rbp),%xmm0
  movsd  %xmm0,-0x20(%rbp)
  movsd  D38(%rip),%xmm0
  movsd  %xmm0,-0x38(%rbp)
  movl   $0x0,-0x48(%rbp)
  jmp    L29
L27:
  mov    -0x48(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x60(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x70(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movsd  -0x38(%rbp),%xmm1
  mulsd  -0x20(%rbp),%xmm1
  mov    -0x48(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x60(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x78(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm2
  divsd  %xmm2,%xmm1
  mov    -0x48(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    0x18(%rbp),%rax
  add    %rdx,%rax
  subsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  movsd  -0x38(%rbp),%xmm0
  movq   D94(%rip),%xmm1
  xorpd  %xmm1,%xmm0
  movsd  %xmm0,-0x38(%rbp)
  addl   $0x1,-0x48(%rbp)
L29:
  mov    -0x48(%rbp),%eax
  cmp    -0x54(%rbp),%eax
  jle    L27
  nop
  nop
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: tag: D83
type: f64
name: retrieve_data
arguments: tag: D38
type: f64
name: retrieve_data
arguments: tag: D82
type: qword
name: retrieve_data
arguments: tag: D19
type: f64
name: retrieve_data
arguments: tag: D94
type: byte[8]

tool: D83: 6.283185307179586

tool: D38: 1

tool: D82: 9223372036854775807

tool: D19: 1e-05

tool: {"D94": [0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80]}

assistant: ```c
void CalcParms(int r, int Ext[], double Grid[], double D[], double W[], double ad[], double x[], double y[]) {
  int i, j, k, ld;
  double sign, xi, delta, denom, numer;
  for (i = 0; i <= r; i++)
    x[i] = cos(6.2831853071795865 * Grid[Ext[i]]);
  ld = (r - 1) / 15 + 1;
  for (i = 0; i <= r; i++) {
    denom = 1.0;
    xi = x[i];
    for (j = 0; j < ld; j++) {
      for (k = j; k <= r; k += ld)
        if (k != i)
          denom *= 2.0 * (xi - x[k]);
    }
    if (fabs(denom) < 0.00001)
      denom = 0.00001;
    ad[i] = 1.0 / denom;
  }
  numer = denom = 0;
  sign = 1;
  for (i = 0; i <= r; i++) {
    numer += ad[i] * D[Ext[i]];
    denom += sign * ad[i] / W[Ext[i]];
    sign = -sign;
  }
  delta = numer / denom;
  sign = 1;
  for (i = 0; i <= r; i++) {
    y[i] = D[Ext[i]] - sign * delta / W[Ext[i]];
    sign = -sign;
  }
}
```