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

```asm
<splint>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  add    $0xffffffffffffff80,%rsp
  mov    %rdi,-0x58(%rbp)
  mov    %rsi,-0x60(%rbp)
  mov    %rdx,-0x68(%rbp)
  mov    %rcx,-0x70(%rbp)
  mov    %r8,-0x78(%rbp)
  mov    %r9,-0x80(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movq   $0x0,-0x38(%rbp)
  movq   $0x0,-0x30(%rbp)
  jmp    L32
L52:
  mov    -0x30(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x78(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movsd  %xmm0,-0x28(%rbp)
  cmpl   $0x0,0x18(%rbp)
  jne    L6
  mov    -0x70(%rbp),%rax
  lea    -0x1(%rax),%r8
  lea    -0x48(%rbp),%rdx
  mov    -0x38(%rbp),%rsi
  mov    -0x28(%rbp),%rdi
  mov    -0x58(%rbp),%rax
  mov    %rdx,%rcx
  mov    %r8,%rdx
  movq   %rdi,%xmm0
  mov    %rax,%rdi
  call   <lin_search@plt>
  test   %rax,%rax
  je     L85
  mov    -0x48(%rbp),%rax
  add    $0x1,%rax
  mov    %rax,-0x40(%rbp)
  mov    -0x48(%rbp),%rax
  mov    %rax,-0x38(%rbp)
  jmp    L38
L85:
  mov    -0x70(%rbp),%rax
  lea    -0x1(%rax),%rdx
  mov    -0x28(%rbp),%rcx
  mov    -0x58(%rbp),%rax
  mov    $0x0,%esi
  movq   %rcx,%xmm0
  mov    %rax,%rdi
  call   <b_search@plt>
  mov    %rax,-0x48(%rbp)
  mov    -0x48(%rbp),%rax
  add    $0x1,%rax
  mov    %rax,-0x40(%rbp)
  mov    -0x48(%rbp),%rax
  mov    %rax,-0x38(%rbp)
  jmp    L38
L6:
  cmpl   $0x1,0x18(%rbp)
  jne    L38
  mov    -0x38(%rbp),%rax
  add    $0x1,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  movsd  -0x28(%rbp),%xmm0
  comisd %xmm1,%xmm0
  jb     L60
  mov    -0x70(%rbp),%rax
  lea    -0x1(%rax),%rdx
  mov    -0x38(%rbp),%rsi
  mov    -0x28(%rbp),%rcx
  mov    -0x58(%rbp),%rax
  movq   %rcx,%xmm0
  mov    %rax,%rdi
  call   <b_search@plt>
  mov    %rax,-0x38(%rbp)
  jmp    L21
L60:
  mov    -0x38(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  comisd -0x28(%rbp),%xmm0
  jbe    L21
  mov    -0x38(%rbp),%rdx
  mov    -0x28(%rbp),%rcx
  mov    -0x58(%rbp),%rax
  mov    $0x0,%esi
  movq   %rcx,%xmm0
  mov    %rax,%rdi
  call   <b_search@plt>
  mov    %rax,-0x38(%rbp)
L21:
  mov    -0x38(%rbp),%rax
  mov    %rax,-0x48(%rbp)
  mov    -0x48(%rbp),%rax
  add    $0x1,%rax
  mov    %rax,-0x40(%rbp)
L38:
  mov    -0x40(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x48(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x20(%rbp)
  mov    -0x40(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x30(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x78(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  subsd  %xmm1,%xmm0
  divsd  -0x20(%rbp),%xmm0
  movsd  %xmm0,-0x18(%rbp)
  mov    -0x30(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x78(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x48(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  subsd  %xmm1,%xmm0
  divsd  -0x20(%rbp),%xmm0
  movsd  %xmm0,-0x10(%rbp)
  mov    -0x48(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x60(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movapd %xmm0,%xmm1
  mulsd  -0x18(%rbp),%xmm1
  mov    -0x40(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x60(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  -0x10(%rbp),%xmm0
  addsd  %xmm0,%xmm1
  movsd  -0x18(%rbp),%xmm0
  mulsd  %xmm0,%xmm0
  mulsd  -0x18(%rbp),%xmm0
  movapd %xmm0,%xmm2
  subsd  -0x18(%rbp),%xmm2
  mov    -0x48(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x68(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm0,%xmm2
  movsd  -0x10(%rbp),%xmm0
  mulsd  %xmm0,%xmm0
  mulsd  -0x10(%rbp),%xmm0
  movapd %xmm0,%xmm3
  subsd  -0x10(%rbp),%xmm3
  mov    -0x40(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x68(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm3,%xmm0
  addsd  %xmm2,%xmm0
  mulsd  -0x20(%rbp),%xmm0
  mulsd  -0x20(%rbp),%xmm0
  movsd  D1(%rip),%xmm2
  divsd  %xmm2,%xmm0
  mov    -0x30(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x80(%rbp),%rax
  add    %rdx,%rax
  addsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  addq   $0x1,-0x30(%rbp)
L32:
  mov    -0x30(%rbp),%rax
  cmp    0x10(%rbp),%rax
  jb     L52
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L24
  call   <__stack_chk_fail@plt>
L24:
  leave
  ret
```

tool_calls: name: unpack_data
arguments: data_tag: D1
type_guessed: f64

tool: D1: 6

assistant: ```c
int splint(const double *pxa, const double *pya, const double *py2a, size_t n, const double *px, double *py, size_t nx, int blookup) {
  size_t klo;
  size_t khi;
  size_t prev_idx = 0;
  double h;
  double b;
  double a;
  double x;
  for (size_t i = 0; i < nx; i++) {
    x = px[i];
    if (blookup == 0) {
      if (lin_search(pxa, x, prev_idx, n - 1, &klo)) {
        khi = klo + 1;
        prev_idx = klo;
      } else {
        klo = b_search(pxa, x, 0, n - 1);
        khi = klo + 1;
        prev_idx = klo;
      }
    } else if (blookup == 1) {
      if (x >= pxa[prev_idx + 1])
        prev_idx = b_search(pxa, x, prev_idx, n - 1);
      else if (x < pxa[prev_idx])
        prev_idx = b_search(pxa, x, 0, prev_idx);
      klo = prev_idx;
      khi = klo + 1;
    }
    h = pxa[khi] - pxa[klo];
    a = (pxa[khi] - px[i]) / h;
    b = (px[i] - pxa[klo]) / h;
    py[i] = a * pya[klo] + b * pya[khi] + ((a * a * a - a) * py2a[klo] + (b * b * b - b) * py2a[khi]) * h * h / 6.0;
  }
  return 0;
}
```