user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<interpolateDD>:
  endbr64
  push   %rbp
  movapd %xmm0,%xmm2
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x28,%rsp
  movsd  (%rdi),%xmm0
  movsd  0x20(%rdi),%xmm3
  movsd  %xmm1,(%rsp)
  comisd %xmm0,%xmm2
  jb     L8
  comisd %xmm2,%xmm3
  ja     L106
L8:
  pxor   %xmm0,%xmm0
L34:
  movslq %esi,%rax
  shl    $0x5,%rax
  lea    -0x40(%rbx,%rax,1),%rdx
  movsd  (%rdx),%xmm1
  comisd %xmm1,%xmm2
  jb     L4
  movsd  -0x20(%rbx,%rax,1),%xmm4
  comisd %xmm2,%xmm4
  jae    L138
L4:
  comisd %xmm3,%xmm2
  jb     L56
  comisd %xmm2,%xmm1
  jbe    L56
  cmp    $0x2,%esi
  jle    L56
  lea    -0x3(%rsi),%eax
  shl    $0x5,%rax
  lea    0x20(%rbx,%rax,1),%rbp
  jmp    L5
  nopl   0x0(%rax)
L20:
  add    $0x20,%rbx
  cmp    %rbp,%rbx
  je     L56
L5:
  comisd 0x20(%rbx),%xmm2
  jb     L20
  movsd  0x40(%rbx),%xmm1
  comisd %xmm2,%xmm1
  jbe    L20
  movsd  -0x18(%rbx),%xmm6
  movapd %xmm2,%xmm0
  subsd  -0x20(%rbx),%xmm0
  add    $0x20,%rbx
  mulsd  D11(%rip),%xmm0
  movsd  %xmm2,0x18(%rsp)
  movsd  %xmm6,0x8(%rsp)
  divsd  (%rsp),%xmm0
  call   <f_up@plt>
  mulsd  0x8(%rsp),%xmm0
  movsd  0x18(%rsp),%xmm2
  movsd  -0x18(%rbx),%xmm3
  movapd %xmm2,%xmm7
  subsd  -0x20(%rbx),%xmm7
  movsd  %xmm3,0x10(%rsp)
  movsd  %xmm0,0x8(%rsp)
  movsd  D11(%rip),%xmm0
  mulsd  %xmm7,%xmm0
  divsd  (%rsp),%xmm0
  call   <f_up@plt>
  mulsd  0x10(%rsp),%xmm0
  movsd  0x8(%rsp),%xmm7
  movsd  0x18(%rsp),%xmm2
  movsd  0x8(%rbx),%xmm6
  movsd  %xmm6,0x10(%rsp)
  addsd  %xmm0,%xmm7
  movapd %xmm2,%xmm0
  subsd  (%rbx),%xmm0
  mulsd  D11(%rip),%xmm0
  divsd  (%rsp),%xmm0
  movsd  %xmm7,0x8(%rsp)
  call   <f_up@plt>
  mulsd  0x10(%rsp),%xmm0
  movsd  0x18(%rsp),%xmm2
  addsd  0x8(%rsp),%xmm0
  movsd  0x28(%rbx),%xmm4
  movapd %xmm2,%xmm3
  subsd  0x20(%rbx),%xmm3
  movsd  %xmm4,0x10(%rsp)
  movsd  %xmm0,0x8(%rsp)
  movsd  D11(%rip),%xmm0
  mulsd  %xmm3,%xmm0
  divsd  (%rsp),%xmm0
  call   <f_up@plt>
  mulsd  0x10(%rsp),%xmm0
  movsd  0x8(%rsp),%xmm7
  movsd  0x18(%rsp),%xmm2
  movsd  0x48(%rbx),%xmm6
  movsd  %xmm6,0x10(%rsp)
  addsd  %xmm0,%xmm7
  movapd %xmm2,%xmm0
  subsd  0x40(%rbx),%xmm0
  mulsd  D11(%rip),%xmm0
  divsd  (%rsp),%xmm0
  movsd  %xmm7,0x8(%rsp)
  call   <f_up@plt>
  mulsd  0x10(%rsp),%xmm0
  movsd  0x18(%rsp),%xmm2
  addsd  0x8(%rsp),%xmm0
  mulsd  D11(%rip),%xmm0
  cmp    %rbp,%rbx
  jne    L5
L56:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  ret
  nopw   0x0(%rax,%rax,1)
L138:
  movapd %xmm2,%xmm4
  movsd  0x10(%rdx),%xmm0
  subsd  %xmm1,%xmm4
  mulsd  %xmm4,%xmm0
  mulsd  %xmm4,%xmm4
  addsd  0x8(%rdx),%xmm0
  mulsd  D11(%rip),%xmm4
  mulsd  0x18(%rdx),%xmm4
  addsd  %xmm4,%xmm0
  jmp    L4
  nopl   0x0(%rax,%rax,1)
L106:
  movapd %xmm2,%xmm1
  subsd  %xmm0,%xmm1
  movsd  0x10(%rdi),%xmm0
  mulsd  %xmm1,%xmm0
  mulsd  %xmm1,%xmm1
  addsd  0x8(%rdi),%xmm0
  mulsd  D11(%rip),%xmm1
  mulsd  0x18(%rdi),%xmm1
  addsd  %xmm1,%xmm0
  jmp    L34
```

tool_calls: name: unpack_data
arguments: data_tag: D11
type: f64

tool: D11: 0.5

assistant: ```c
double interpolateDD(double X, double Values[][4], double step, int N) {
  int i;
  double toRet = 0.0;
  if (X >= Values[0][0] && X < Values[1][0])
    toRet = Values[0][1] + (X - Values[0][0]) * Values[0][2] + (X - Values[0][0]) * (X - Values[0][0]) * 0.5 * Values[0][3];
  if (X >= Values[N - 2][0] && X <= Values[N - 1][0])
    toRet = Values[N - 2][1] + (X - Values[N - 2][0]) * Values[N - 2][2] + (X - Values[N - 2][0]) * (X - Values[N - 2][0]) * 0.5 * Values[N - 2][3];
  if (X >= Values[1][0] && X < Values[N - 2][0])
    for (i = 1; i < N - 1; i++) {
      if (Values[i][0] <= X && Values[i + 1][0] > X && i != 0)
        toRet = 0.5 * (Values[i - 2][1] * f_up(0.5 * (X - Values[i - 2][0]) / step) + Values[i - 1][1] * f_up(0.5 * (X - Values[i - 1][0]) / step) + Values[i][1] * f_up(0.5 * (X - Values[i][0]) / step) + Values[i + 1][1] * f_up(0.5 * (X - Values[i + 1][0]) / step) + Values[i + 2][1] * f_up(0.5 * (X - Values[i + 2][0]) / step));
    }
  return toRet;
}
```