user: 请将以下的汇编代码转换成C语言代码：

```asm
<splint>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x60,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    %rdx,-0x48(%rbp)
  mov    %ecx,-0x4c(%rbp)
  movsd  %xmm0,-0x58(%rbp)
  mov    %r8,-0x60(%rbp)
  movl   $0x1,-0x24(%rbp)
  mov    -0x4c(%rbp),%eax
  mov    %eax,-0x20(%rbp)
  jmp    L56
L42:
  mov    -0x20(%rbp),%edx
  mov    -0x24(%rbp),%eax
  add    %edx,%eax
  sar    %eax
  mov    %eax,-0x1c(%rbp)
  mov    -0x1c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  comisd -0x58(%rbp),%xmm0
  jbe    L53
  mov    -0x1c(%rbp),%eax
  mov    %eax,-0x20(%rbp)
  jmp    L56
L53:
  mov    -0x1c(%rbp),%eax
  mov    %eax,-0x24(%rbp)
L56:
  mov    -0x20(%rbp),%eax
  sub    -0x24(%rbp),%eax
  cmp    $0x1,%eax
  jg     L42
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x18(%rbp)
  pxor   %xmm0,%xmm0
  ucomisd -0x18(%rbp),%xmm0
  jp     L58
  pxor   %xmm0,%xmm0
  ucomisd -0x18(%rbp),%xmm0
  jne    L58
  lea    D13(%rip),%rax
  mov    %rax,%rdi
  call   <nrerror@plt>
L58:
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  subsd  -0x58(%rbp),%xmm0
  divsd  -0x18(%rbp),%xmm0
  movsd  %xmm0,-0x10(%rbp)
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  movsd  -0x58(%rbp),%xmm0
  subsd  %xmm1,%xmm0
  divsd  -0x18(%rbp),%xmm0
  movsd  %xmm0,-0x8(%rbp)
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movapd %xmm0,%xmm1
  mulsd  -0x10(%rbp),%xmm1
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  -0x8(%rbp),%xmm0
  addsd  %xmm0,%xmm1
  movsd  -0x10(%rbp),%xmm0
  mulsd  %xmm0,%xmm0
  mulsd  -0x10(%rbp),%xmm0
  movapd %xmm0,%xmm2
  subsd  -0x10(%rbp),%xmm2
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm0,%xmm2
  movsd  -0x8(%rbp),%xmm0
  mulsd  %xmm0,%xmm0
  mulsd  -0x8(%rbp),%xmm0
  movapd %xmm0,%xmm3
  subsd  -0x8(%rbp),%xmm3
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm3,%xmm0
  addsd  %xmm0,%xmm2
  movsd  -0x18(%rbp),%xmm0
  mulsd  %xmm0,%xmm0
  mulsd  %xmm2,%xmm0
  movsd  D12(%rip),%xmm2
  divsd  %xmm2,%xmm0
  addsd  %xmm1,%xmm0
  mov    -0x60(%rbp),%rax
  movsd  %xmm0,(%rax)
  nop
  leave
  ret
```

tool_calls: name: read_data
arguments: label: D13
type_guessed: string
name: read_data
arguments: label: D12
type_guessed: f64

tool: D13: Bad xa input to routine splint

tool: D12: 6

assistant: ```c
void splint(double xa[], double ya[], double y2a[], int n, double x, double *y) {
  void nrerror(char error_text[]);
  int klo, khi, k;
  double h, b, a;
  klo = 1;
  khi = n;
  while (khi - klo > 1) {
    k = (khi + klo) >> 1;
    if (xa[k] > x)
      khi = k;
    else
      klo = k;
  }
  h = xa[khi] - xa[klo];
  if (h == 0.0)
    nrerror("Bad xa input to routine splint");
  a = (xa[khi] - x) / h;
  b = (x - xa[klo]) / h;
  *y = a * ya[klo] + b * ya[khi] + ((a * a * a - a) * y2a[klo] + (b * b * b - b) * y2a[khi]) * (h * h) / 6.0;
}
```