user: Translate the below assembly code into C programming language:

```asm
<splint>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %rdx,%r13
  mov    %rcx,0x10(%rsp)
  mov    %r9,0x8(%rsp)
  mov    0x78(%rsp),%r15d
  mov    %fs:0x28,%rdx
  mov    %rdx,0x28(%rsp)
  xor    %edx,%edx
  cmpq   $0x0,0x70(%rsp)
  je     L53
  mov    %rdi,%rbp
  mov    %rsi,%r12
  mov    %r8,%r14
  mov    $0x0,%ebx
  mov    $0x0,%esi
  jmp    L40
L59:
  mov    0x10(%rsp),%rax
  sub    $0x1,%rax
  mov    %rax,0x18(%rsp)
  lea    0x20(%rsp),%rcx
  mov    %rax,%rdx
  movapd %xmm5,%xmm0
  mov    %rbp,%rdi
  call   <lin_search@plt>
  test   %rax,%rax
  je     L15
  mov    0x20(%rsp),%rsi
  lea    0x1(%rsi),%rax
  jmp    L60
L15:
  mov    0x18(%rsp),%rdx
  mov    $0x0,%esi
  movsd  (%rsp),%xmm0
  mov    %rbp,%rdi
  call   <b_search@plt>
  mov    %rax,%rsi
  mov    %rax,0x20(%rsp)
  lea    0x1(%rax),%rax
  jmp    L60
L113:
  mov    0x10(%rsp),%rax
  lea    -0x1(%rax),%rdx
  movapd %xmm6,%xmm0
  mov    %rbp,%rdi
  call   <b_search@plt>
  mov    %rax,%rsi
L50:
  mov    %rsi,0x20(%rsp)
  lea    0x1(%rsi),%rax
L60:
  movsd  0x0(%rbp,%rax,8),%xmm2
  mov    0x20(%rsp),%rdx
  movsd  0x0(%rbp,%rdx,8),%xmm0
  movapd %xmm2,%xmm4
  subsd  %xmm0,%xmm4
  movsd  (%r14,%rbx,8),%xmm3
  subsd  %xmm3,%xmm2
  divsd  %xmm4,%xmm2
  subsd  %xmm0,%xmm3
  divsd  %xmm4,%xmm3
  movapd %xmm2,%xmm1
  mulsd  %xmm2,%xmm1
  mulsd  %xmm2,%xmm1
  subsd  %xmm2,%xmm1
  mulsd  0x0(%r13,%rdx,8),%xmm1
  movapd %xmm3,%xmm0
  mulsd  %xmm3,%xmm0
  mulsd  %xmm3,%xmm0
  subsd  %xmm3,%xmm0
  mulsd  0x0(%r13,%rax,8),%xmm0
  addsd  %xmm1,%xmm0
  mulsd  %xmm4,%xmm0
  mulsd  %xmm4,%xmm0
  divsd  D4(%rip),%xmm0
  mulsd  (%r12,%rdx,8),%xmm2
  mulsd  (%r12,%rax,8),%xmm3
  addsd  %xmm3,%xmm2
  addsd  %xmm2,%xmm0
  mov    0x8(%rsp),%rdi
  movsd  %xmm0,(%rdi,%rbx,8)
  add    $0x1,%rbx
  cmp    %rbx,0x70(%rsp)
  je     L53
L40:
  movsd  (%r14,%rbx,8),%xmm5
  movsd  %xmm5,(%rsp)
  test   %r15d,%r15d
  je     L59
  cmp    $0x1,%r15d
  jne    L60
  lea    0x1(%rsi),%rax
  lea    0x0(,%rax,8),%rdx
  movsd  (%rsp),%xmm6
  comisd 0x0(%rbp,%rax,8),%xmm6
  jae    L113
  movsd  -0x8(%rbp,%rdx,1),%xmm0
  comisd (%rsp),%xmm0
  jbe    L50
  mov    %rsi,%rdx
  mov    $0x0,%esi
  movsd  (%rsp),%xmm0
  mov    %rbp,%rdi
  call   <b_search@plt>
  mov    %rax,%rsi
  jmp    L50
L53:
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L112
  mov    $0x0,%eax
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L112:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: tag: D4
data_type: f64

tool: D4: 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;
}
```