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

```asm
<interpolateDD>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x20,%rsp
  movapd %xmm0,%xmm4
  movsd  %xmm0,0x8(%rsp)
  mov    %rdi,%rbx
  movsd  %xmm1,0x10(%rsp)
  mov    %esi,%edx
  movsd  (%rdi),%xmm0
  comisd %xmm0,%xmm4
  jb     L33
  movsd  0x20(%rdi),%xmm1
  comisd %xmm4,%xmm1
  jbe    L109
  subsd  %xmm0,%xmm4
  movapd %xmm4,%xmm1
  movapd %xmm4,%xmm0
  mulsd  0x10(%rdi),%xmm0
  addsd  0x8(%rdi),%xmm0
  mulsd  %xmm4,%xmm1
  mulsd  D29(%rip),%xmm1
  mulsd  0x18(%rdi),%xmm1
  addsd  %xmm1,%xmm0
  jmp    L102
L33:
  pxor   %xmm0,%xmm0
L102:
  movslq %edx,%rax
  shl    $0x5,%rax
  lea    -0x40(%rbx,%rax,1),%rcx
  movsd  (%rcx),%xmm1
  movsd  0x8(%rsp),%xmm5
  comisd %xmm1,%xmm5
  jb     L138
  movsd  -0x20(%rbx,%rax,1),%xmm2
  comisd %xmm5,%xmm2
  jb     L138
  movapd %xmm5,%xmm2
  subsd  %xmm1,%xmm2
  movapd %xmm2,%xmm0
  mulsd  0x10(%rcx),%xmm0
  addsd  0x8(%rcx),%xmm0
  mulsd  %xmm2,%xmm2
  mulsd  D29(%rip),%xmm2
  mulsd  0x18(%rcx),%xmm2
  addsd  %xmm2,%xmm0
L138:
  movsd  0x8(%rsp),%xmm6
  comisd 0x20(%rbx),%xmm6
  jb     L120
  comisd %xmm6,%xmm1
  jbe    L120
  cmp    $0x2,%edx
  jle    L120
  lea    -0x1(%rdx),%r13d
  mov    $0x1,%ebp
  jmp    L85
L109:
  pxor   %xmm0,%xmm0
  jmp    L102
L65:
  mov    -0x18(%rbx),%r12
  movapd %xmm3,%xmm0
  subsd  -0x20(%rbx),%xmm0
  mulsd  D29(%rip),%xmm0
  divsd  0x10(%rsp),%xmm0
  call   <f_up@plt>
  movq   %r12,%xmm2
  mulsd  %xmm0,%xmm2
  movsd  %xmm2,0x18(%rsp)
  mov    0x8(%rbx),%r12
  movsd  0x8(%rsp),%xmm0
  subsd  (%rbx),%xmm0
  mulsd  D29(%rip),%xmm0
  divsd  0x10(%rsp),%xmm0
  call   <f_up@plt>
  movq   %r12,%xmm6
  mulsd  %xmm0,%xmm6
  addsd  0x18(%rsp),%xmm6
  movsd  %xmm6,0x18(%rsp)
  mov    0x28(%rbx),%r12
  movsd  0x8(%rsp),%xmm0
  subsd  0x20(%rbx),%xmm0
  mulsd  D29(%rip),%xmm0
  divsd  0x10(%rsp),%xmm0
  call   <f_up@plt>
  movq   %r12,%xmm2
  mulsd  %xmm0,%xmm2
  addsd  0x18(%rsp),%xmm2
  movsd  %xmm2,0x18(%rsp)
  mov    0x48(%rbx),%r12
  movsd  0x8(%rsp),%xmm0
  subsd  0x40(%rbx),%xmm0
  mulsd  D29(%rip),%xmm0
  divsd  0x10(%rsp),%xmm0
  call   <f_up@plt>
  movq   %r12,%xmm5
  mulsd  %xmm0,%xmm5
  movapd %xmm5,%xmm6
  addsd  0x18(%rsp),%xmm6
  movsd  %xmm6,0x18(%rsp)
  mov    0x68(%rbx),%r12
  movsd  0x8(%rsp),%xmm0
  subsd  0x60(%rbx),%xmm0
  mulsd  D29(%rip),%xmm0
  divsd  0x10(%rsp),%xmm0
  call   <f_up@plt>
  movq   %r12,%xmm7
  mulsd  %xmm0,%xmm7
  movapd %xmm7,%xmm0
  addsd  0x18(%rsp),%xmm0
  mulsd  D29(%rip),%xmm0
L52:
  add    $0x1,%ebp
  add    $0x20,%rbx
  cmp    %r13d,%ebp
  je     L120
L85:
  movsd  0x8(%rsp),%xmm3
  comisd 0x20(%rbx),%xmm3
  jb     L52
  movsd  0x40(%rbx),%xmm1
  comisd %xmm3,%xmm1
  jbe    L52
  test   %ebp,%ebp
  je     L52
  jmp    L65
L120:
  add    $0x20,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
```

tool_calls: name: disassemble_data
arguments: tag: D29
type: f64

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