user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<CalcParms>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdx,0x18(%rsp)
  mov    %rcx,0x8(%rsp)
  mov    %r8,0x10(%rsp)
  mov    0x60(%rsp),%rbp
  test   %edi,%edi
  js     L107
  mov    %edi,%ebx
  mov    %rsi,%r14
  mov    %r9,%r15
  lea    0x1(%rdi),%r13d
  mov    $0x0,%r12d
L65:
  movslq (%r14,%r12,4),%rax
  mov    0x18(%rsp),%rdi
  movsd  D90(%rip),%xmm0
  mulsd  (%rdi,%rax,8),%xmm0
  call   <cos@plt>
  movsd  %xmm0,0x0(%rbp,%r12,8)
  add    $0x1,%r12
  cmp    %r13,%r12
  jne    L65
  lea    -0x1(%rbx),%edx
  movslq %edx,%rax
  imul   $0xffffffff88888889,%rax,%rax
  shr    $0x20,%rax
  add    %edx,%eax
  sar    $0x3,%eax
  sar    $0x1f,%edx
  sub    %edx,%eax
  lea    0x1(%rax),%ecx
  mov    $0x0,%edx
  lea    0x1(%rax),%edi
  movslq %ecx,%rcx
  movq   D82(%rip),%xmm5
  movsd  D80(%rip),%xmm4
  movsd  D44(%rip),%xmm3
  jmp    L67
L11:
  add    %rcx,%rax
  cmp    %eax,%ebx
  jl     L6
L80:
  cmp    %eax,%edx
  je     L11
  movapd %xmm2,%xmm0
  subsd  0x0(%rbp,%rax,8),%xmm0
  addsd  %xmm0,%xmm0
  mulsd  %xmm0,%xmm1
  jmp    L11
L6:
  add    $0x1,%rsi
  cmp    %rdi,%rsi
  je     L79
L36:
  mov    %rsi,%rax
  cmp    %esi,%ebx
  jge    L80
  jmp    L6
L79:
  movapd %xmm1,%xmm0
  andpd  %xmm5,%xmm0
  comisd %xmm0,%xmm4
  jbe    L128
  movsd  D80(%rip),%xmm1
L128:
  movapd %xmm3,%xmm0
  divsd  %xmm1,%xmm0
  movsd  %xmm0,(%r15,%rdx,8)
  add    $0x1,%rdx
  cmp    %r13,%rdx
  je     L63
L67:
  movsd  0x0(%rbp,%rdx,8),%xmm2
  mov    $0x0,%esi
  movsd  D44(%rip),%xmm1
  jmp    L36
L63:
  mov    $0x0,%eax
  pxor   %xmm1,%xmm1
  movapd %xmm1,%xmm3
  movsd  D44(%rip),%xmm2
  movq   D59(%rip),%xmm5
L3:
  movsd  (%r15,%rax,8),%xmm0
  movslq (%r14,%rax,4),%rdx
  mov    0x8(%rsp),%rdi
  movapd %xmm0,%xmm4
  mulsd  (%rdi,%rdx,8),%xmm4
  addsd  %xmm4,%xmm1
  mulsd  %xmm2,%xmm0
  mov    0x10(%rsp),%rdi
  divsd  (%rdi,%rdx,8),%xmm0
  addsd  %xmm0,%xmm3
  xorpd  %xmm5,%xmm2
  add    $0x1,%rax
  cmp    %r13,%rax
  jne    L3
  movapd %xmm1,%xmm2
  divsd  %xmm3,%xmm2
  mov    $0x0,%eax
  movsd  D44(%rip),%xmm3
  movq   D59(%rip),%xmm4
L126:
  movslq (%r14,%rax,4),%rdx
  movapd %xmm2,%xmm1
  mulsd  %xmm3,%xmm1
  mov    0x10(%rsp),%rdi
  divsd  (%rdi,%rdx,8),%xmm1
  mov    0x8(%rsp),%rdi
  movsd  (%rdi,%rdx,8),%xmm0
  subsd  %xmm1,%xmm0
  mov    0x68(%rsp),%rdi
  movsd  %xmm0,(%rdi,%rax,8)
  xorpd  %xmm4,%xmm3
  add    $0x1,%rax
  cmp    %r13,%rax
  jne    L126
L107:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: read_data
arguments: tag: D90
type_infered: f64
name: read_data
arguments: tag: D82
type_infered: qword
name: read_data
arguments: tag: D80
type_infered: f64
name: read_data
arguments: tag: D44
type_infered: f64
name: read_data
arguments: tag: D59
type_infered: byte[8]

tool: D90: 6.283185307179586

tool: D82: 9223372036854775807

tool: D80: 1e-05

tool: D44: 1

tool: {"D59": [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;
  }
}
```