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

```asm
<SplineInterp>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,%r13
  mov    $0x40000,%edi
  mov    $0x0,%eax
  call   <MemAlloc@plt>
  movslq %eax,%r12
  lea    0x40000(%r12),%rcx
  mov    %r12,%rax
  mov    %r13,%rdx
  sub    %r12,%rdx
L4:
  movsd  (%rdx,%rax,1),%xmm0
  movsd  %xmm0,(%rax)
  add    $0x8,%rax
  cmp    %rcx,%rax
  jne    L4
  mov    $0x40010,%edi
  mov    $0x0,%eax
  call   <MemAlloc@plt>
  mov    %eax,%r14d
  movslq %eax,%rbp
  mov    $0x20008,%edi
  mov    $0x0,%eax
  call   <MemAlloc@plt>
  movslq %eax,%rbx
  movl   $0x0,(%rbx)
  movq   $0x0,0x0(%rbp)
  mov    $0x0,%edx
  mov    $0x1,%ecx
  pxor   %xmm1,%xmm1
  movapd %xmm1,%xmm2
  jmp    L3
L69:
  movslq %ecx,%rsi
  movsd  %xmm0,0x0(%rbp,%rsi,8)
  mov    %edi,(%rbx,%rsi,4)
  add    $0x1,%ecx
L14:
  add    $0x1,%rdx
  cmp    $0x8000,%rdx
  je     L95
L3:
  mov    %edx,%edi
  movsd  0x0(%r13,%rdx,8),%xmm0
  ucomisd %xmm1,%xmm0
  jp     L69
  ucomisd %xmm2,%xmm0
  je     L14
  jmp    L69
L95:
  movslq %ecx,%rdx
  movq   $0x0,0x0(%rbp,%rdx,8)
  movl   $0x0,(%rbx,%rdx,4)
  cmp    $0x2,%ecx
  jle    L99
  cltq
  lea    0x4(%rax),%r15
  movslq %r14d,%r14
  lea    -0x3(%rcx),%eax
  lea    0x8(%r14,%rax,8),%r13
  movsd  D1(%rip),%xmm8
  movsd  D55(%rip),%xmm3
  movsd  D38(%rip),%xmm7
  movsd  D39(%rip),%xmm6
  movsd  D45(%rip),%xmm5
  movq   D56(%rip),%xmm4
  mov    %rbp,0x8(%rsp)
L54:
  mov    %r15,%rdi
  mov    (%r15),%eax
  lea    0x1(%rax),%edx
  add    $0x4,%r15
  mov    %r15,%r8
  mov    (%r15),%eax
  cmp    %eax,%edx
  jge    L78
  mov    %r14,%rbp
  lea    0x8(%r14),%r11
  lea    0x10(%r14),%r10
  lea    0x18(%r14),%r9
  movslq %edx,%rcx
  lea    (%r12,%rcx,8),%rcx
L40:
  mov    %edx,%esi
  sub    (%rdi),%esi
  pxor   %xmm1,%xmm1
  cvtsi2sd %esi,%xmm1
  sub    (%rdi),%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  divsd  %xmm0,%xmm1
  movapd %xmm1,%xmm9
  mulsd  %xmm1,%xmm9
  movapd %xmm1,%xmm11
  mulsd  %xmm9,%xmm11
  movapd %xmm11,%xmm2
  mulsd  %xmm8,%xmm2
  mulsd  %xmm3,%xmm1
  mulsd  %xmm7,%xmm11
  movapd %xmm9,%xmm0
  mulsd  %xmm6,%xmm0
  addsd  %xmm11,%xmm0
  addsd  %xmm5,%xmm0
  mulsd  (%r11),%xmm0
  movapd %xmm2,%xmm10
  addsd  %xmm9,%xmm10
  subsd  %xmm1,%xmm10
  mulsd  0x0(%rbp),%xmm10
  addsd  %xmm10,%xmm0
  movapd %xmm9,%xmm10
  addsd  %xmm9,%xmm10
  subsd  %xmm11,%xmm10
  addsd  %xmm10,%xmm1
  mulsd  (%r10),%xmm1
  addsd  %xmm1,%xmm0
  xorpd  %xmm4,%xmm2
  mulsd  %xmm3,%xmm9
  subsd  %xmm9,%xmm2
  mulsd  (%r9),%xmm2
  addsd  %xmm2,%xmm0
  movsd  %xmm0,(%rcx)
  add    $0x1,%edx
  mov    (%r8),%eax
  add    $0x8,%rcx
  cmp    %edx,%eax
  jg     L40
L78:
  add    $0x8,%r14
  cmp    %r13,%r14
  jne    L54
  mov    0x8(%rsp),%rbp
L99:
  mov    %rbp,%rdi
  mov    $0x0,%eax
  call   <MemFree@plt>
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <MemFree@plt>
  mov    %r12,%rax
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: retrieve_data
arguments: tag: D1
data_type: f32[2]
name: retrieve_data
arguments: tag: D55
data_type: f64
name: retrieve_data
arguments: tag: D38
data_type: f32[2]
name: retrieve_data
arguments: tag: D39
data_type: f32[2]
name: retrieve_data
arguments: tag: D45
data_type: f32[2]
name: retrieve_data
arguments: tag: D56
data_type: f32[2]

tool: {"D1": [0.0,-1.75]}

tool: D55: 0.5

tool: {"D38": [0.0,1.9375]}

tool: {"D39": [0.0,-2.0625]}

tool: {"D45": [0.0,1.875]}

tool: {"D56": [0.0,-0.0]}

assistant: ```c
double *SplineInterp(double *h16) {
  double *d;
  double *t1;
  int i, j, n;
  double u, u3, u2, s;
  int *t2;
  d = (double *)MemAlloc(sizeof(double) * 32768);
  for (i = 0; i < 32768; i++)
    d[i] = h16[i];
  t1 = (double *)MemAlloc(sizeof(double) * 32770);
  t2 = (int *)MemAlloc(sizeof(int) * 32770);
  t2[0] = 0;
  t1[0] = 0.0;
  n = 1;
  for (i = 0; i < 32768; i++)
    if (h16[i] != 0.0) {
      t1[n] = h16[i];
      t2[n] = i;
      ++n;
    }
  t1[n] = 0.0;
  t2[n] = 0;
  n++;
  s = 0.5;
  for (i = 1; i <= n - 3; i++) {
    for (j = t2[i] + 1; j < t2[i + 1]; j++) {
      u = ((double)(j - t2[i])) / ((double)(t2[i + 1] - t2[i]));
      u2 = u * u;
      u3 = u2 * u;
      d[j] = t1[i - 1] * (-s * u3 + 2 * s * u2 - s * u) + t1[i] * ((2 - s) * u3 + (s - 3) * u2 + 1) + t1[i + 1] * ((s - 2) * u3 + (3 - 2 * s) * u2 + s * u) + t1[i + 2] * (s * u3 - s * u2);
    }
  }
  MemFree(t1);
  MemFree(t2);
  return d;
}
```