user: Converte this assembly snippet into its equivalent C code:

```asm
<spline>:
  endbr64
  push   %r14
  xor    %eax,%eax
  mov    %edx,%r14d
  push   %r13
  lea    -0x1(%rdx),%r13d
  push   %r12
  mov    %rcx,%r12
  push   %rbp
  mov    %rdi,%rbp
  mov    $0x1,%edi
  push   %rbx
  mov    %rsi,%rbx
  mov    %r13d,%esi
  sub    $0x10,%rsp
  movsd  %xmm0,0x8(%rsp)
  movsd  %xmm1,(%rsp)
  call   <vector@plt>
  movsd  0x8(%rsp),%xmm0
  movsd  (%rsp),%xmm1
  movsd  D15(%rip),%xmm8
  mov    %rax,%rdi
  comisd %xmm8,%xmm0
  jbe    L22
  movq   $0x0,0x8(%rax)
  movq   $0x0,0x8(%r12)
  cmp    $0x2,%r14d
  jle    L5
L36:
  movsd  D29(%rip),%xmm7
  lea    0x8(%rbp),%rdx
  movslq %r14d,%rcx
  mov    $0x2,%eax
  movsd  D58(%rip),%xmm5
  movsd  D64(%rip),%xmm6
  nopl   0x0(%rax,%rax,1)
L68:
  movsd  (%rdx),%xmm3
  movsd  0x8(%rdx),%xmm2
  add    $0x8,%rdx
  movsd  0x8(%rdx),%xmm0
  movsd  -0x8(%r12,%rax,8),%xmm4
  subsd  %xmm3,%xmm2
  subsd  %xmm3,%xmm0
  divsd  %xmm0,%xmm2
  mulsd  %xmm2,%xmm4
  movapd %xmm2,%xmm0
  subsd  %xmm5,%xmm0
  addsd  %xmm7,%xmm4
  divsd  %xmm4,%xmm0
  movsd  %xmm0,(%r12,%rax,8)
  movsd  (%rbx,%rax,8),%xmm3
  movsd  (%rdx),%xmm9
  movsd  0x8(%rbx,%rax,8),%xmm0
  movsd  0x8(%rdx),%xmm10
  mulsd  -0x8(%rdi,%rax,8),%xmm2
  subsd  %xmm3,%xmm0
  subsd  %xmm9,%xmm10
  subsd  -0x8(%rbx,%rax,8),%xmm3
  subsd  -0x8(%rdx),%xmm9
  divsd  %xmm10,%xmm0
  divsd  %xmm9,%xmm3
  subsd  %xmm3,%xmm0
  movsd  %xmm0,(%rdi,%rax,8)
  mulsd  %xmm6,%xmm0
  movsd  0x8(%rdx),%xmm3
  subsd  -0x8(%rdx),%xmm3
  divsd  %xmm3,%xmm0
  subsd  %xmm2,%xmm0
  divsd  %xmm4,%xmm0
  movsd  %xmm0,(%rdi,%rax,8)
  add    $0x1,%rax
  cmp    %rax,%rcx
  jne    L68
L79:
  comisd %xmm8,%xmm1
  lea    0x0(,%rcx,8),%rax
  jbe    L4
  pxor   %xmm1,%xmm1
  movapd %xmm1,%xmm0
L83:
  movsd  -0x8(%rdi,%rax,1),%xmm2
  mulsd  %xmm0,%xmm2
  mulsd  -0x8(%r12,%rax,1),%xmm0
  movslq %r13d,%rax
  subsd  %xmm2,%xmm1
  addsd  %xmm5,%xmm0
  divsd  %xmm0,%xmm1
  movsd  %xmm1,(%r12,%rcx,8)
  test   %r13d,%r13d
  jle    L62
  nopl   0x0(%rax)
L76:
  movsd  (%r12,%rax,8),%xmm0
  mulsd  0x8(%r12,%rax,8),%xmm0
  addsd  (%rdi,%rax,8),%xmm0
  movsd  %xmm0,(%r12,%rax,8)
  sub    $0x1,%rax
  test   %eax,%eax
  jg     L76
L62:
  add    $0x10,%rsp
  mov    %r13d,%edx
  mov    $0x1,%esi
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  jmp    1060 <free_vector@plt>
  nopl   0x0(%rax,%rax,1)
L4:
  movsd  0x0(%rbp,%rcx,8),%xmm2
  movsd  (%rbx,%rcx,8),%xmm0
  subsd  -0x8(%rbp,%rax,1),%xmm2
  subsd  -0x8(%rbx,%rax,1),%xmm0
  divsd  %xmm2,%xmm0
  subsd  %xmm0,%xmm1
  movsd  D13(%rip),%xmm0
  divsd  %xmm2,%xmm0
  mulsd  %xmm0,%xmm1
  movsd  D8(%rip),%xmm0
  jmp    L83
  nopl   0x0(%rax)
L22:
  mov    D41(%rip),%rax
  mov    %rax,0x8(%r12)
  movsd  0x10(%rbp),%xmm3
  movsd  0x10(%rbx),%xmm2
  subsd  0x8(%rbp),%xmm3
  subsd  0x8(%rbx),%xmm2
  divsd  %xmm3,%xmm2
  subsd  %xmm0,%xmm2
  movsd  D13(%rip),%xmm0
  divsd  %xmm3,%xmm0
  mulsd  %xmm0,%xmm2
  movsd  %xmm2,0x8(%rdi)
  cmp    $0x2,%r14d
  jg     L36
L5:
  movsd  D58(%rip),%xmm5
  movslq %r14d,%rcx
  jmp    L79
```

tool_calls: name: extract_symbolic_data
arguments: tag: D15
datatype: f64
name: extract_symbolic_data
arguments: tag: D29
datatype: f64
name: extract_symbolic_data
arguments: tag: D58
datatype: f64
name: extract_symbolic_data
arguments: tag: D64
datatype: f64
name: extract_symbolic_data
arguments: tag: D13
datatype: f64
name: extract_symbolic_data
arguments: tag: D8
datatype: f64
name: extract_symbolic_data
arguments: tag: D41
datatype: f32[2]

tool: D15: 9.9e+29

tool: D29: 2

tool: D58: 1

tool: D64: 6

tool: D13: 3

tool: D8: 0.5

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

assistant: ```c
void spline(x, y, n, yp1, ypn, y2) double x[], y[], yp1, ypn, y2[];
int n;
{
  int i, k;
  double p, qn, sig, un, *u, *vector();
  void free_vector();
  u = vector(1, n - 1);
  if (yp1 > 0.99e30)
    y2[1] = u[1] = 0.0;
  else {
    y2[1] = -0.5;
    u[1] = (3.0 / (x[2] - x[1])) * ((y[2] - y[1]) / (x[2] - x[1]) - yp1);
  }
  for (i = 2; i <= n - 1; i++) {
    sig = (x[i] - x[i - 1]) / (x[i + 1] - x[i - 1]);
    p = sig * y2[i - 1] + 2.0;
    y2[i] = (sig - 1.0) / p;
    u[i] = (y[i + 1] - y[i]) / (x[i + 1] - x[i]) - (y[i] - y[i - 1]) / (x[i] - x[i - 1]);
    u[i] = (6.0 * u[i] / (x[i + 1] - x[i - 1]) - sig * u[i - 1]) / p;
  }
  if (ypn > 0.99e30)
    qn = un = 0.0;
  else {
    qn = 0.5;
    un = (3.0 / (x[n] - x[n - 1])) * (ypn - (y[n] - y[n - 1]) / (x[n] - x[n - 1]));
  }
  y2[n] = (un - qn * u[n - 1]) / (qn * y2[n - 1] + 1.0);
  for (k = n - 1; k >= 1; k--)
    y2[k] = y2[k] * y2[k + 1] + u[k];
  free_vector(u, 1, n - 1);
}
```