user: Please show me the C implementation that matches the assembly code listed below:

```asm
<bspline>:
  endbr64
  push   %r15
  lea    (%rsi,%rdx,1),%eax
  push   %r14
  push   %r13
  mov    %edi,%r13d
  push   %r12
  mov    %rcx,%r12
  push   %rbp
  mov    %esi,%ebp
  push   %rbx
  mov    %edx,%ebx
  sub    $0x28,%rsp
  cmp    %edi,%eax
  setb   %dil
  mov    %eax,0x8(%rsp)
  xor    %eax,%eax
  movzbl %dil,%edi
  movsd  %xmm0,(%rsp)
  call   <assert@plt>
  mov    %ebp,%eax
  xor    %edi,%edi
  lea    (%r12,%rax,8),%r14
  lea    0x1(%rbp),%eax
  lea    (%r12,%rax,8),%r15
  mov    %eax,0x14(%rsp)
  movsd  (%r15),%xmm0
  comisd (%r14),%xmm0
  setae  %dil
  xor    %eax,%eax
  call   <assert@plt>
  movsd  (%rsp),%xmm3
  xor    %edi,%edi
  comisd (%r12),%xmm3
  jb     L7
  mov    %r13d,%eax
  xor    %edi,%edi
  movsd  (%r12,%rax,8),%xmm0
  comisd %xmm3,%xmm0
  setae  %dil
L7:
  xor    %eax,%eax
  call   <assert@plt>
  test   %ebx,%ebx
  jne    L1
  movsd  (%rsp),%xmm4
  comisd (%r14),%xmm4
  jae    L37
L34:
  add    $0x28,%rsp
  pxor   %xmm0,%xmm0
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L37:
  movsd  (%r15),%xmm1
  movsd  D9(%rip),%xmm0
  comisd %xmm4,%xmm1
  jbe    L34
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L1:
  mov    0x8(%rsp),%eax
  xor    %edi,%edi
  add    $0x1,%eax
  lea    (%r12,%rax,8),%rdx
  movsd  (%rdx),%xmm0
  comisd (%r14),%xmm0
  mov    %rdx,0x18(%rsp)
  setae  %dil
  xor    %eax,%eax
  call   <assert@plt>
  mov    0x8(%rsp),%eax
  movsd  (%r14),%xmm0
  lea    -0x1(%rbx),%r14d
  movsd  (%rsp),%xmm2
  movsd  (%r12,%rax,8),%xmm1
  mov    $0x2,%eax
  subsd  %xmm0,%xmm2
  subsd  %xmm0,%xmm1
  movapd %xmm2,%xmm0
  call   <frac@plt>
  mov    0x18(%rsp),%rdx
  mov    %eax,0x8(%rsp)
  mov    $0x2,%eax
  movsd  (%rdx),%xmm1
  movapd %xmm1,%xmm0
  subsd  (%r15),%xmm1
  subsd  (%rsp),%xmm0
  call   <frac@plt>
  movsd  (%rsp),%xmm0
  mov    %r12,%rcx
  mov    %r14d,%edx
  mov    %ebp,%esi
  mov    %r13d,%edi
  mov    %eax,%r15d
  call   <bspline>
  mov    0x8(%rsp),%r8d
  mov    %r12,%rcx
  mov    %r14d,%edx
  pxor   %xmm1,%xmm1
  mov    0x14(%rsp),%esi
  mov    %r13d,%edi
  cvtsi2sd %r8d,%xmm1
  mulsd  %xmm0,%xmm1
  movsd  (%rsp),%xmm0
  movsd  %xmm1,0x8(%rsp)
  call   <bspline>
  movapd %xmm0,%xmm1
  pxor   %xmm0,%xmm0
  cvtsi2sd %r15d,%xmm0
  mulsd  %xmm1,%xmm0
  addsd  0x8(%rsp),%xmm0
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: retrieve_data
arguments: data_tag: D9
type: f64

tool: D9: 1

assistant: ```c
double bspline(unsigned int n, unsigned int i, unsigned int p, const double tau[n + 1], double u) {
  assert(i + p < n);
  assert(tau[i] <= tau[i + 1]);
  assert((tau[0] <= u) && (u <= tau[n]));
  if (0 == p)
    return ((tau[i] <= u) && (u < tau[i + 1])) ? 1. : 0.;
  assert(tau[i] <= tau[i + p + 1]);
  double a = frac(u - tau[i], tau[i + p] - tau[i]);
  double b = frac(tau[i + p + 1] - u, tau[i + p + 1] - tau[i + 1]);
  return a * bspline(n, i, p - 1, tau, u) + b * bspline(n, i + 1, p - 1, tau, u);
}
```