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

```asm
<CalcInterpolatedElements>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  movsd  %xmm0,(%rsp)
  mov    %rdi,%r12
  mov    %esi,0x14(%rsp)
  mov    %rdx,0x18(%rsp)
  movsd  %xmm1,0x8(%rsp)
  mov    %rcx,%rbp
  mov    %r9,%r14
  mov    0x60(%rsp),%rbx
  mov    0x70(%rsp),%r15
  movsd  (%r9),%xmm0
  movsd  D70(%rip),%xmm1
  comisd %xmm0,%xmm1
  ja     L211
  mov    %r8,%r13
  movsd  (%rsp),%xmm5
  comisd %xmm5,%xmm0
  jb     L70
  movapd %xmm0,%xmm1
  subsd  0x8(%rsp),%xmm1
  comisd %xmm1,%xmm5
  jb     L255
  movsd  D70(%rip),%xmm0
  comisd (%rcx),%xmm0
  jbe    L34
  movsd  %xmm1,(%rcx)
  mov    %r8,%rdi
  movapd %xmm1,%xmm0
  mov    0x18(%rsp),%rax
  call   *%rax
  jmp    L34
L211:
  movsd  D89(%rip),%xmm0
  movsd  %xmm0,(%rcx)
  mov    0x68(%rsp),%rax
  movsd  %xmm0,(%rax)
  movsd  (%rsp),%xmm6
  movsd  %xmm6,(%r9)
  mov    %rbx,%rdi
  movapd %xmm6,%xmm0
  call   *%rdx
  mov    0x14(%rsp),%eax
  test   %eax,%eax
  jle    L218
  mov    %eax,%edx
  mov    $0x0,%eax
L24:
  movsd  (%rbx,%rax,8),%xmm0
  movsd  %xmm0,(%r12,%rax,8)
  add    $0x1,%rax
  cmp    %rdx,%rax
  jne    L24
L218:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L255:
  movsd  0x8(%rsp),%xmm7
  movapd %xmm7,%xmm2
  addsd  %xmm7,%xmm2
  subsd  %xmm2,%xmm0
  movsd  (%rsp),%xmm6
  comisd %xmm0,%xmm6
  jb     L106
  movsd  D70(%rip),%xmm0
  comisd (%rcx),%xmm0
  jbe    L156
  movsd  %xmm1,(%rcx)
  mov    %r8,%rdi
  movapd %xmm1,%xmm0
  mov    0x18(%rsp),%rax
  call   *%rax
L156:
  movsd  (%r14),%xmm0
  mov    0x68(%rsp),%rax
  movsd  %xmm0,(%rax)
  movsd  0x0(%rbp),%xmm0
  movsd  %xmm0,(%r14)
  mov    0x14(%rsp),%eax
  test   %eax,%eax
  jle    L111
  mov    %eax,%edx
  mov    $0x0,%eax
L241:
  movsd  (%rbx,%rax,8),%xmm0
  movsd  %xmm0,(%r15,%rax,8)
  movsd  0x0(%r13,%rax,8),%xmm0
  movsd  %xmm0,(%rbx,%rax,8)
  add    $0x1,%rax
  cmp    %rdx,%rax
  jne    L241
L111:
  movsd  (%r14),%xmm0
  subsd  0x8(%rsp),%xmm0
  movsd  %xmm0,0x0(%rbp)
  mov    %r13,%rdi
  mov    0x18(%rsp),%rax
  call   *%rax
L34:
  movsd  (%r14),%xmm2
  movsd  (%rsp),%xmm6
  subsd  %xmm6,%xmm2
  subsd  0x0(%rbp),%xmm6
  movapd %xmm6,%xmm4
  movsd  D87(%rip),%xmm3
  divsd  0x8(%rsp),%xmm3
  mov    0x14(%rsp),%eax
  test   %eax,%eax
  jle    L218
  mov    %eax,%edx
  mov    $0x0,%eax
L99:
  movapd %xmm2,%xmm0
  mulsd  0x0(%r13,%rax,8),%xmm0
  movapd %xmm4,%xmm1
  mulsd  (%rbx,%rax,8),%xmm1
  addsd  %xmm1,%xmm0
  mulsd  %xmm3,%xmm0
  movsd  %xmm0,(%r12,%rax,8)
  add    $0x1,%rax
  cmp    %rdx,%rax
  jne    L99
  jmp    L218
L106:
  movsd  D89(%rip),%xmm0
  movsd  %xmm0,(%rcx)
  mov    0x68(%rsp),%rax
  movsd  %xmm0,(%rax)
  movsd  (%rsp),%xmm7
  movsd  %xmm7,(%r9)
  mov    %rbx,%rdi
  movapd %xmm7,%xmm0
  mov    0x18(%rsp),%rax
  call   *%rax
  mov    0x14(%rsp),%eax
  test   %eax,%eax
  jle    L218
  mov    %eax,%edx
  mov    $0x0,%eax
L79:
  movsd  (%rbx,%rax,8),%xmm0
  movsd  %xmm0,(%r12,%rax,8)
  add    $0x1,%rax
  cmp    %rdx,%rax
  jne    L79
  jmp    L218
L70:
  movsd  0x8(%rsp),%xmm1
  addsd  %xmm0,%xmm1
  comisd (%rsp),%xmm1
  jb     L168
  movsd  D70(%rip),%xmm0
  mov    0x68(%rsp),%rax
  comisd (%rax),%xmm0
  jbe    L154
  movsd  %xmm1,(%rax)
  mov    %r15,%rdi
  movapd %xmm1,%xmm0
  mov    0x18(%rsp),%rax
  call   *%rax
  jmp    L154
L168:
  movsd  0x8(%rsp),%xmm7
  movapd %xmm7,%xmm2
  addsd  %xmm7,%xmm2
  addsd  %xmm0,%xmm2
  comisd (%rsp),%xmm2
  jb     L291
  movsd  D70(%rip),%xmm0
  mov    0x68(%rsp),%rax
  comisd (%rax),%xmm0
  jbe    L293
  movsd  %xmm1,(%rax)
  mov    %r15,%rdi
  movapd %xmm1,%xmm0
  mov    0x18(%rsp),%rax
  call   *%rax
L293:
  movsd  (%r14),%xmm0
  movsd  %xmm0,0x0(%rbp)
  mov    0x68(%rsp),%rax
  movsd  (%rax),%xmm0
  movsd  %xmm0,(%r14)
  mov    0x14(%rsp),%eax
  test   %eax,%eax
  jle    L91
  mov    %eax,%edx
  mov    $0x0,%eax
L264:
  movsd  (%rbx,%rax,8),%xmm0
  movsd  %xmm0,0x0(%r13,%rax,8)
  movsd  (%r15,%rax,8),%xmm0
  movsd  %xmm0,(%rbx,%rax,8)
  add    $0x1,%rax
  cmp    %rdx,%rax
  jne    L264
L91:
  movsd  0x8(%rsp),%xmm0
  addsd  (%r14),%xmm0
  mov    0x68(%rsp),%rax
  movsd  %xmm0,(%rax)
  mov    %r15,%rdi
  mov    0x18(%rsp),%rax
  call   *%rax
L154:
  mov    0x68(%rsp),%rax
  movsd  (%rax),%xmm3
  movsd  (%rsp),%xmm7
  subsd  %xmm7,%xmm3
  subsd  (%r14),%xmm7
  movapd %xmm7,%xmm1
  movsd  D87(%rip),%xmm4
  divsd  0x8(%rsp),%xmm4
  mov    0x14(%rsp),%eax
  test   %eax,%eax
  jle    L218
  mov    %eax,%edx
  mov    $0x0,%eax
L193:
  movapd %xmm3,%xmm0
  mulsd  (%rbx,%rax,8),%xmm0
  movapd %xmm1,%xmm2
  mulsd  (%r15,%rax,8),%xmm2
  addsd  %xmm2,%xmm0
  mulsd  %xmm4,%xmm0
  movsd  %xmm0,(%r12,%rax,8)
  add    $0x1,%rax
  cmp    %rdx,%rax
  jne    L193
  jmp    L218
L291:
  movsd  D89(%rip),%xmm0
  movsd  %xmm0,(%rcx)
  mov    0x68(%rsp),%rax
  movsd  %xmm0,(%rax)
  movsd  (%rsp),%xmm5
  movsd  %xmm5,(%r9)
  mov    %rbx,%rdi
  movapd %xmm5,%xmm0
  mov    0x18(%rsp),%rax
  call   *%rax
  mov    0x14(%rsp),%eax
  test   %eax,%eax
  jle    L218
  mov    %eax,%edx
  mov    $0x0,%eax
L53:
  movsd  (%rbx,%rax,8),%xmm0
  movsd  %xmm0,(%r12,%rax,8)
  add    $0x1,%rax
  cmp    %rdx,%rax
  jne    L53
  jmp    L218
```

tool_calls: name: read_data
arguments: tag: D70
data_type: byte[8]
name: read_data
arguments: tag: D89
data_type: byte[8]
name: read_data
arguments: tag: D87
data_type: f64

tool: {"D70": [0x2e,0x9f,0x87,0xa2,0xae,0x42,0x7d,0xd4]}

tool: {"D89": [0x7d,0xc3,0x94,0x25,0xad,0x49,0xb2,0xd4]}

tool: D87: 1

assistant: ```c
void CalcInterpolatedElements(const double t, double elem[], const int dim, void (*calc_func)(const double t, double elem[]), const double delta_t, double *t0, double e0[], double *t1, double e1[], double *t2, double e2[]) {
  int i;
  if (*t1 < -1e99) {
    *t0 = -1e100;
    *t2 = -1e100;
    *t1 = t;
    (*calc_func)(*t1, e1);
    for (i = 0; i < dim; i++)
      elem[i] = e1[i];
    return;
  }
  if (t <= *t1) {
    if (*t1 - delta_t <= t) {
      if (*t0 < -1e99) {
        *t0 = *t1 - delta_t;
        (*calc_func)(*t0, e0);
      }
    } else if (*t1 - 2.0 * delta_t <= t) {
      if (*t0 < -1e99) {
        *t0 = *t1 - delta_t;
        (*calc_func)(*t0, e0);
      }
      *t2 = *t1;
      *t1 = *t0;
      for (i = 0; i < dim; i++) {
        e2[i] = e1[i];
        e1[i] = e0[i];
      }
      *t0 = *t1 - delta_t;
      (*calc_func)(*t0, e0);
    } else {
      *t0 = -1e100;
      *t2 = -1e100;
      *t1 = t;
      (*calc_func)(*t1, e1);
      for (i = 0; i < dim; i++)
        elem[i] = e1[i];
      return;
    }
    {
      const double f0 = (*t1 - t);
      const double f1 = (t - *t0);
      const double fact = 1.0 / delta_t;
      for (i = 0; i < dim; i++)
        elem[i] = fact * (e0[i] * f0 + e1[i] * f1);
    }
  } else {
    if (*t1 + delta_t >= t) {
      if (*t2 < -1e99) {
        *t2 = *t1 + delta_t;
        (*calc_func)(*t2, e2);
      }
    } else if (*t1 + 2.0 * delta_t >= t) {
      if (*t2 < -1e99) {
        *t2 = *t1 + delta_t;
        (*calc_func)(*t2, e2);
      }
      *t0 = *t1;
      *t1 = *t2;
      for (i = 0; i < dim; i++) {
        e0[i] = e1[i];
        e1[i] = e2[i];
      }
      *t2 = *t1 + delta_t;
      (*calc_func)(*t2, e2);
    } else {
      *t0 = -1e100;
      *t2 = -1e100;
      *t1 = t;
      (*calc_func)(*t1, e1);
      for (i = 0; i < dim; i++)
        elem[i] = e1[i];
      return;
    }
    {
      const double f1 = (*t2 - t);
      const double f2 = (t - *t1);
      const double fact = 1.0 / delta_t;
      for (i = 0; i < dim; i++)
        elem[i] = fact * (e1[i] * f1 + e2[i] * f2);
    }
  }
}
```