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

```asm
<eval_spline>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %rdx,-0x38(%rbp)
  mov    %ecx,-0x3c(%rbp)
  movss  %xmm0,-0x40(%rbp)
  movl   $0x0,-0x18(%rbp)
  mov    -0x3c(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x14(%rbp)
  jmp    L22
L35:
  mov    -0x14(%rbp),%edx
  mov    -0x18(%rbp),%eax
  add    %edx,%eax
  sar    %eax
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  comiss -0x40(%rbp),%xmm0
  jbe    L31
  mov    -0x4(%rbp),%eax
  mov    %eax,-0x14(%rbp)
  jmp    L22
L31:
  mov    -0x4(%rbp),%eax
  mov    %eax,-0x18(%rbp)
L22:
  mov    -0x14(%rbp),%eax
  sub    -0x18(%rbp),%eax
  cmp    $0x1,%eax
  jg     L35
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  mov    -0x18(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm1
  subss  %xmm1,%xmm0
  movss  %xmm0,-0x10(%rbp)
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  subss  -0x40(%rbp),%xmm0
  divss  -0x10(%rbp),%xmm0
  movss  %xmm0,-0xc(%rbp)
  mov    -0x18(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm1
  movss  -0x40(%rbp),%xmm0
  subss  %xmm1,%xmm0
  divss  -0x10(%rbp),%xmm0
  movss  %xmm0,-0x8(%rbp)
  mov    -0x18(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  movaps %xmm0,%xmm1
  mulss  -0xc(%rbp),%xmm1
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  mulss  -0x8(%rbp),%xmm0
  addss  %xmm1,%xmm0
  pxor   %xmm1,%xmm1
  cvtss2sd %xmm0,%xmm1
  movss  -0xc(%rbp),%xmm0
  mulss  %xmm0,%xmm0
  mulss  -0xc(%rbp),%xmm0
  movaps %xmm0,%xmm2
  subss  -0xc(%rbp),%xmm2
  mov    -0x18(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  mulss  %xmm0,%xmm2
  movss  -0x8(%rbp),%xmm0
  mulss  %xmm0,%xmm0
  mulss  -0x8(%rbp),%xmm0
  movaps %xmm0,%xmm3
  subss  -0x8(%rbp),%xmm3
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movss  (%rax),%xmm0
  mulss  %xmm3,%xmm0
  addss  %xmm0,%xmm2
  movss  -0x10(%rbp),%xmm0
  mulss  %xmm0,%xmm0
  mulss  %xmm2,%xmm0
  cvtss2sd %xmm0,%xmm0
  movsd  D6(%rip),%xmm2
  divsd  %xmm2,%xmm0
  addsd  %xmm1,%xmm0
  cvtsd2ss %xmm0,%xmm0
  pop    %rbp
  ret
```

tool_calls: name: disassemble_data
arguments: tag: D6
data_type: f64

tool: D6: 6

assistant: ```c
float eval_spline(float xa[], float ya[], float y2a[], int n, float x) {
  int klo, khi, k;
  float h, b, a;
  klo = 0;
  khi = n - 1;
  while (khi - klo > 1) {
    k = (khi + klo) >> 1;
    if (xa[k] > x)
      khi = k;
    else
      klo = k;
  }
  h = xa[khi] - xa[klo];
  a = (xa[khi] - x) / h;
  b = (x - xa[klo]) / h;
  return (a * ya[klo] + b * ya[khi] + ((a * a * a - a) * y2a[klo] + (b * b * b - b) * y2a[khi]) * (h * h) / 6.0);
}
```