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

```asm
<spline_construct>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdi,0x8(%rsp)
  mov    %rsi,%r14
  mov    %rdx,%r15
  mov    %ecx,%ebp
  lea    -0x1(%rcx),%eax
  mov    %eax,0x4(%rsp)
  lea    0x0(,%rax,8),%ebx
  mov    %ebx,%edi
  call   <malloc@plt>
  mov    %rax,%r12
  movslq %ebp,%rcx
  mov    %rcx,0x10(%rsp)
  mov    %ebp,0x18(%rsp)
  lea    0x0(,%rbp,8),%ecx
  mov    %ecx,0x1c(%rsp)
  mov    %ecx,%edi
  call   <malloc@plt>
  mov    %rax,%r13
  mov    %ebx,%edi
  call   <malloc@plt>
  mov    %rax,%rbp
  mov    0x1c(%rsp),%edi
  call   <malloc@plt>
  mov    %rax,%rbx
  mov    0x8(%rsp),%rdx
  movsd  0x8(%rdx),%xmm0
  subsd  (%rdx),%xmm0
  addsd  %xmm0,%xmm0
  movsd  %xmm0,0x0(%r13)
  movsd  0x8(%rdx),%xmm0
  subsd  (%rdx),%xmm0
  movsd  %xmm0,0x0(%rbp)
  movsd  0x8(%r14),%xmm0
  subsd  (%r14),%xmm0
  mulsd  D24(%rip),%xmm0
  movsd  %xmm0,(%rax)
  cmpl   $0x1,0x4(%rsp)
  jle    L25
  mov    0x18(%rsp),%eax
  lea    -0x3(%rax),%ecx
  add    $0x2,%rcx
  mov    $0x1,%eax
  movsd  D24(%rip),%xmm3
L1:
  movsd  0x8(%rdx),%xmm0
  subsd  (%rdx),%xmm0
  movsd  %xmm0,-0x8(%r12,%rax,8)
  movsd  0x8(%rdx),%xmm2
  movapd %xmm2,%xmm0
  subsd  (%rdx),%xmm0
  addsd  %xmm0,%xmm0
  movsd  0x10(%rdx),%xmm1
  subsd  %xmm2,%xmm1
  addsd  %xmm1,%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,0x0(%r13,%rax,8)
  movsd  0x10(%rdx),%xmm0
  subsd  0x8(%rdx),%xmm0
  movsd  %xmm0,0x0(%rbp,%rax,8)
  movsd  0x8(%r14,%rax,8),%xmm0
  subsd  -0x8(%r14,%rax,8),%xmm0
  mulsd  %xmm3,%xmm0
  movsd  %xmm0,(%rbx,%rax,8)
  add    $0x1,%rax
  add    $0x8,%rdx
  cmp    %rcx,%rax
  jne    L1
L25:
  mov    0x10(%rsp),%rcx
  shl    $0x3,%rcx
  lea    -0x8(%rcx),%rsi
  mov    0x8(%rsp),%rax
  lea    (%rax,%rsi,1),%rdx
  lea    -0x10(%rax,%rcx,1),%rax
  movsd  (%rdx),%xmm0
  subsd  (%rax),%xmm0
  movsd  %xmm0,-0x10(%r12,%rcx,1)
  movsd  (%rdx),%xmm0
  subsd  (%rax),%xmm0
  addsd  %xmm0,%xmm0
  movsd  %xmm0,-0x8(%r13,%rcx,1)
  add    %rbx,%rsi
  movsd  -0x8(%r14,%rcx,1),%xmm0
  subsd  -0x10(%r14,%rcx,1),%xmm0
  mulsd  D24(%rip),%xmm0
  movsd  %xmm0,(%rsi)
  movsd  0x0(%rbp),%xmm0
  divsd  0x0(%r13),%xmm0
  movsd  %xmm0,0x0(%rbp)
  movsd  (%rbx),%xmm0
  divsd  0x0(%r13),%xmm0
  movsd  %xmm0,(%rbx)
  mov    0x18(%rsp),%eax
  cmp    $0x1,%eax
  jle    L37
  mov    %eax,%edx
  mov    $0x1,%eax
  movsd  D34(%rip),%xmm3
  jmp    L35
L82:
  movsd  -0x8(%rbx,%rax,8),%xmm1
  mulsd  -0x8(%r12,%rax,8),%xmm1
  movsd  (%rbx,%rax,8),%xmm0
  subsd  %xmm1,%xmm0
  mulsd  %xmm2,%xmm0
  movsd  %xmm0,(%rbx,%rax,8)
  add    $0x1,%rax
  cmp    %rdx,%rax
  je     L32
L35:
  movsd  -0x8(%rbp,%rax,8),%xmm1
  mulsd  -0x8(%r12,%rax,8),%xmm1
  movsd  0x0(%r13,%rax,8),%xmm0
  subsd  %xmm1,%xmm0
  movapd %xmm3,%xmm2
  divsd  %xmm0,%xmm2
  cmp    %eax,0x4(%rsp)
  jle    L82
  movapd %xmm2,%xmm0
  mulsd  0x0(%rbp,%rax,8),%xmm0
  movsd  %xmm0,0x0(%rbp,%rax,8)
  jmp    L82
L37:
  movsd  (%rsi),%xmm0
  movsd  %xmm0,-0x8(%r15,%rcx,1)
  jmp    L27
L32:
  movsd  (%rsi),%xmm0
  movsd  %xmm0,-0x8(%r15,%rcx,1)
  mov    0x18(%rsp),%eax
  sub    $0x2,%eax
  cltq
L30:
  movsd  0x0(%rbp,%rax,8),%xmm1
  mulsd  0x8(%r15,%rax,8),%xmm1
  movsd  (%rbx,%rax,8),%xmm0
  subsd  %xmm1,%xmm0
  movsd  %xmm0,(%r15,%rax,8)
  sub    $0x1,%rax
  test   %eax,%eax
  jns    L30
L27:
  mov    %r12,%rdi
  call   <free@plt>
  mov    %r13,%rdi
  call   <free@plt>
  mov    %rbp,%rdi
  call   <free@plt>
  mov    %rbx,%rdi
  call   <free@plt>
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D24
type_infered: byte[8]
name: extract_symbolic_data
arguments: data_tag: D34
type_infered: f64

tool: {"D24": [0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x40]}

tool: D34: 1

assistant: ```c
void spline_construct(double *x, double *y, double *d, int n) {
  int i;
  double tmp;
  double *diag_low;
  double *diag_mid;
  double *diag_up;
  double *right;
  diag_low = malloc((n - 1) * sizeof(double));
  diag_mid = malloc(n * sizeof(double));
  diag_up = malloc((n - 1) * sizeof(double));
  right = malloc(n * sizeof(double));
  diag_mid[0] = 2 * (x[1] - x[0]);
  diag_up[0] = (x[1] - x[0]);
  right[0] = 3 * (y[1] - y[0]);
  for (i = 1; i < n - 1; i++) {
    diag_low[i - 1] = (x[i] - x[i - 1]);
    diag_mid[i] = 2 * (x[i] - x[i - 1]) + 2 * (x[i + 1] - x[i]);
    diag_up[i] = (x[i + 1] - x[i]);
    right[i] = 3 * (y[i + 1] - y[i - 1]);
  }
  diag_low[n - 2] = (x[n - 1] - x[n - 2]);
  diag_mid[n - 1] = 2 * (x[n - 1] - x[n - 2]);
  right[n - 1] = 3 * (y[n - 1] - y[n - 2]);
  diag_up[0] /= diag_mid[0];
  right[0] /= diag_mid[0];
  for (i = 1; i < n; i++) {
    tmp = 1.0 / (diag_mid[i] - diag_up[i - 1] * diag_low[i - 1]);
    if (i < n - 1)
      diag_up[i] *= tmp;
    right[i] = (right[i] - right[i - 1] * diag_low[i - 1]) * tmp;
  }
  d[n - 1] = right[n - 1];
  for (i = n - 2; i >= 0; i--) {
    d[i] = right[i] - diag_up[i] * d[i + 1];
  }
  free(diag_low);
  free(diag_mid);
  free(diag_up);
  free(right);
}
```