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  D50(%rip),%xmm1
  comisd %xmm0,%xmm1
  ja     L227
  mov    %r8,%r13
  movsd  (%rsp),%xmm5
  comisd %xmm5,%xmm0
  jb     L19
  movapd %xmm0,%xmm1
  subsd  0x8(%rsp),%xmm1
  comisd %xmm1,%xmm5
  jb     L243
  movsd  D50(%rip),%xmm0
  comisd (%rcx),%xmm0
  jbe    L66
  movsd  %xmm1,(%rcx)
  mov    0x78(%rsp),%rsi
  mov    %r8,%rdi
  movapd %xmm1,%xmm0
  mov    0x18(%rsp),%rax
  call   *%rax
  jmp    L66
L227:
  movsd  D36(%rip),%xmm0
  movsd  %xmm0,(%rcx)
  mov    0x68(%rsp),%rax
  movsd  %xmm0,(%rax)
  movsd  (%rsp),%xmm6
  movsd  %xmm6,(%r9)
  mov    0x78(%rsp),%rsi
  mov    %rbx,%rdi
  movapd %xmm6,%xmm0
  call   *%rdx
  mov    0x14(%rsp),%eax
  test   %eax,%eax
  jle    L92
  mov    %eax,%edx
  mov    $0x0,%eax
L239:
  movsd  (%rbx,%rax,8),%xmm0
  movsd  %xmm0,(%r12,%rax,8)
  add    $0x1,%rax
  cmp    %rdx,%rax
  jne    L239
L92:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L243:
  movsd  0x8(%rsp),%xmm7
  movapd %xmm7,%xmm2
  addsd  %xmm7,%xmm2
  subsd  %xmm2,%xmm0
  movsd  (%rsp),%xmm6
  comisd %xmm0,%xmm6
  jb     L258
  movsd  D50(%rip),%xmm0
  comisd (%rcx),%xmm0
  jbe    L293
  movsd  %xmm1,(%rcx)
  mov    0x78(%rsp),%rsi
  mov    %r8,%rdi
  movapd %xmm1,%xmm0
  mov    0x18(%rsp),%rax
  call   *%rax
L293:
  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    L200
  mov    %eax,%edx
  mov    $0x0,%eax
L101:
  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    L101
L200:
  movsd  (%r14),%xmm0
  subsd  0x8(%rsp),%xmm0
  movsd  %xmm0,0x0(%rbp)
  mov    0x78(%rsp),%rsi
  mov    %r13,%rdi
  mov    0x18(%rsp),%rax
  call   *%rax
L66:
  movsd  (%r14),%xmm2
  movsd  (%rsp),%xmm6
  subsd  %xmm6,%xmm2
  subsd  0x0(%rbp),%xmm6
  movapd %xmm6,%xmm4
  movsd  D84(%rip),%xmm3
  divsd  0x8(%rsp),%xmm3
  mov    0x14(%rsp),%eax
  test   %eax,%eax
  jle    L92
  mov    %eax,%edx
  mov    $0x0,%eax
L5:
  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    L5
  jmp    L92
L258:
  movsd  D36(%rip),%xmm0
  movsd  %xmm0,(%rcx)
  mov    0x68(%rsp),%rax
  movsd  %xmm0,(%rax)
  movsd  (%rsp),%xmm7
  movsd  %xmm7,(%r9)
  mov    0x78(%rsp),%rsi
  mov    %rbx,%rdi
  movapd %xmm7,%xmm0
  mov    0x18(%rsp),%rax
  call   *%rax
  mov    0x14(%rsp),%eax
  test   %eax,%eax
  jle    L92
  mov    %eax,%edx
  mov    $0x0,%eax
L291:
  movsd  (%rbx,%rax,8),%xmm0
  movsd  %xmm0,(%r12,%rax,8)
  add    $0x1,%rax
  cmp    %rdx,%rax
  jne    L291
  jmp    L92
L19:
  movsd  0x8(%rsp),%xmm1
  addsd  %xmm0,%xmm1
  comisd (%rsp),%xmm1
  jb     L45
  movsd  D50(%rip),%xmm0
  mov    0x68(%rsp),%rax
  comisd (%rax),%xmm0
  jbe    L86
  movsd  %xmm1,(%rax)
  mov    0x78(%rsp),%rsi
  mov    %r15,%rdi
  movapd %xmm1,%xmm0
  mov    0x18(%rsp),%rax
  call   *%rax
  jmp    L86
L45:
  movsd  0x8(%rsp),%xmm7
  movapd %xmm7,%xmm2
  addsd  %xmm7,%xmm2
  addsd  %xmm0,%xmm2
  comisd (%rsp),%xmm2
  jb     L259
  movsd  D50(%rip),%xmm0
  mov    0x68(%rsp),%rax
  comisd (%rax),%xmm0
  jbe    L288
  movsd  %xmm1,(%rax)
  mov    0x78(%rsp),%rsi
  mov    %r15,%rdi
  movapd %xmm1,%xmm0
  mov    0x18(%rsp),%rax
  call   *%rax
L288:
  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    L189
  mov    %eax,%edx
  mov    $0x0,%eax
L207:
  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    L207
L189:
  movsd  0x8(%rsp),%xmm0
  addsd  (%r14),%xmm0
  mov    0x68(%rsp),%rax
  movsd  %xmm0,(%rax)
  mov    0x78(%rsp),%rsi
  mov    %r15,%rdi
  mov    0x18(%rsp),%rax
  call   *%rax
L86:
  mov    0x68(%rsp),%rax
  movsd  (%rax),%xmm3
  movsd  (%rsp),%xmm7
  subsd  %xmm7,%xmm3
  subsd  (%r14),%xmm7
  movapd %xmm7,%xmm1
  movsd  D84(%rip),%xmm4
  divsd  0x8(%rsp),%xmm4
  mov    0x14(%rsp),%eax
  test   %eax,%eax
  jle    L92
  mov    %eax,%edx
  mov    $0x0,%eax
L119:
  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    L119
  jmp    L92
L259:
  movsd  D36(%rip),%xmm0
  movsd  %xmm0,(%rcx)
  mov    0x68(%rsp),%rax
  movsd  %xmm0,(%rax)
  movsd  (%rsp),%xmm5
  movsd  %xmm5,(%r9)
  mov    0x78(%rsp),%rsi
  mov    %rbx,%rdi
  movapd %xmm5,%xmm0
  mov    0x18(%rsp),%rax
  call   *%rax
  mov    0x14(%rsp),%eax
  test   %eax,%eax
  jle    L92
  mov    %eax,%edx
  mov    $0x0,%eax
L103:
  movsd  (%rbx,%rax,8),%xmm0
  movsd  %xmm0,(%r12,%rax,8)
  add    $0x1,%rax
  cmp    %rdx,%rax
  jne    L103
  jmp    L92
```

tool_calls: name: disassemble_data
arguments: tag: D50
type_infered: byte[8]
name: disassemble_data
arguments: tag: D36
type_infered: byte[8]
name: disassemble_data
arguments: tag: D84
type_infered: f64

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

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

tool: D84: 1

assistant: ```c
void CalcInterpolatedElements(const double t, double elem[], const int dim, void (*calc_func)(const double t, double elem[], void *user), const double delta_t, double *t0, double e0[], double *t1, double e1[], double *t2, double e2[], void *user) {
  int i;
  if (*t1 < -1e99) {
    *t0 = -1e100;
    *t2 = -1e100;
    *t1 = t;
    (*calc_func)(*t1, e1, user);
    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, user);
      }
    } else if (*t1 - 2.0 * delta_t <= t) {
      if (*t0 < -1e99) {
        *t0 = *t1 - delta_t;
        (*calc_func)(*t0, e0, user);
      }
      *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, user);
    } else {
      *t0 = -1e100;
      *t2 = -1e100;
      *t1 = t;
      (*calc_func)(*t1, e1, user);
      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, user);
      }
    } else if (*t1 + 2.0 * delta_t >= t) {
      if (*t2 < -1e99) {
        *t2 = *t1 + delta_t;
        (*calc_func)(*t2, e2, user);
      }
      *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, user);
    } else {
      *t0 = -1e100;
      *t2 = -1e100;
      *t1 = t;
      (*calc_func)(*t1, e1, user);
      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);
    }
  }
}
```