user: What is the c source code of the assembly code below?

```asm
<CalcInterpolatedElements>:
  endbr64
  push   %r15
  movapd %xmm0,%xmm2
  push   %r14
  mov    %r9,%r14
  push   %r13
  push   %r12
  movslq %esi,%r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  sub    $0x28,%rsp
  movsd  (%r9),%xmm0
  movsd  D29(%rip),%xmm4
  mov    0x60(%rsp),%rbx
  mov    0x70(%rsp),%r15
  comisd %xmm0,%xmm4
  mov    0x78(%rsp),%rsi
  ja     L160
  comisd %xmm2,%xmm0
  mov    %r8,%r13
  jb     L251
  movapd %xmm0,%xmm3
  subsd  %xmm1,%xmm3
  comisd %xmm3,%xmm2
  jae    L145
  movapd %xmm1,%xmm6
  movapd %xmm0,%xmm5
  addsd  %xmm1,%xmm6
  subsd  %xmm6,%xmm5
  comisd %xmm5,%xmm2
  jb     L112
  comisd (%rcx),%xmm4
  jbe    L53
  mov    %rcx,0x8(%rsp)
  movapd %xmm3,%xmm0
  mov    %r8,%rdi
  mov    %rsi,0x78(%rsp)
  mov    %rdx,(%rsp)
  movsd  %xmm1,0x18(%rsp)
  movsd  %xmm2,0x10(%rsp)
  movsd  %xmm3,(%rcx)
  call   *%rdx
  movsd  (%r14),%xmm0
  movsd  0x18(%rsp),%xmm1
  movsd  0x10(%rsp),%xmm2
  mov    0x8(%rsp),%rcx
  mov    0x78(%rsp),%rsi
  mov    (%rsp),%rdx
L53:
  mov    0x68(%rsp),%rax
  movsd  %xmm0,(%rax)
  movsd  (%rcx),%xmm0
  movsd  %xmm0,(%r14)
  test   %r12d,%r12d
  jle    L46
  movslq %r12d,%rdi
  xor    %eax,%eax
  cs nopw 0x0(%rax,%rax,1)
L141:
  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    %rax,%rdi
  jne    L141
  movsd  (%r14),%xmm0
L46:
  subsd  %xmm1,%xmm0
  mov    %rcx,(%rsp)
  mov    %r13,%rdi
  movsd  %xmm2,0x10(%rsp)
  movsd  %xmm1,0x8(%rsp)
  movsd  %xmm0,(%rcx)
  call   *%rdx
  mov    (%rsp),%rcx
  movsd  (%r14),%xmm0
  movsd  0x8(%rsp),%xmm1
  movsd  0x10(%rsp),%xmm2
  movsd  (%rcx),%xmm5
  jmp    L217
L251:
  movapd %xmm0,%xmm5
  addsd  %xmm1,%xmm5
  comisd %xmm2,%xmm5
  jae    L80
  movapd %xmm1,%xmm3
  addsd  %xmm1,%xmm3
  addsd  %xmm0,%xmm3
  comisd %xmm2,%xmm3
  jb     L55
  mov    0x68(%rsp),%rax
  comisd (%rax),%xmm4
  jbe    L68
  mov    %rcx,0x18(%rsp)
  movapd %xmm5,%xmm0
  mov    %r15,%rdi
  mov    %rsi,0x78(%rsp)
  mov    %rdx,(%rsp)
  movsd  %xmm1,0x10(%rsp)
  movsd  %xmm2,0x8(%rsp)
  movsd  %xmm5,(%rax)
  call   *%rdx
  movsd  (%r14),%xmm0
  mov    0x18(%rsp),%rcx
  movsd  0x10(%rsp),%xmm1
  movsd  0x8(%rsp),%xmm2
  mov    0x78(%rsp),%rsi
  mov    (%rsp),%rdx
L68:
  mov    0x68(%rsp),%rax
  movsd  %xmm0,(%rcx)
  movsd  (%rax),%xmm0
  movsd  %xmm0,(%r14)
  test   %r12d,%r12d
  jle    L17
  movslq %r12d,%rcx
  xor    %eax,%eax
  nopl   (%rax)
L142:
  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    %rax,%rcx
  jne    L142
  movsd  (%r14),%xmm0
L17:
  addsd  %xmm1,%xmm0
  mov    0x68(%rsp),%rax
  movsd  %xmm1,(%rsp)
  mov    %r15,%rdi
  movsd  %xmm2,0x8(%rsp)
  movsd  %xmm0,(%rax)
  call   *%rdx
  mov    0x68(%rsp),%rax
  movsd  (%r14),%xmm0
  movsd  (%rsp),%xmm1
  movsd  0x8(%rsp),%xmm2
  movsd  (%rax),%xmm3
  jmp    L86
  nopl   0x0(%rax,%rax,1)
L160:
  movsd  D8(%rip),%xmm0
  mov    0x68(%rsp),%rax
  mov    %rbx,%rdi
  movsd  %xmm0,(%rcx)
  movsd  %xmm0,(%rax)
  movapd %xmm2,%xmm0
  movsd  %xmm2,(%r9)
  call   *%rdx
  movslq %r12d,%rdx
  xor    %eax,%eax
  test   %r12d,%r12d
  jle    L200
  nopl   (%rax)
L230:
  movsd  (%rbx,%rax,8),%xmm0
  movsd  %xmm0,0x0(%rbp,%rax,8)
  add    $0x1,%rax
  cmp    %rax,%rdx
  jne    L230
L200:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L145:
  movsd  (%rcx),%xmm5
  comisd %xmm5,%xmm4
  jbe    L217
  mov    %rcx,(%rsp)
  movapd %xmm3,%xmm0
  mov    %r8,%rdi
  movsd  %xmm1,0x10(%rsp)
  movsd  %xmm2,0x8(%rsp)
  movsd  %xmm3,(%rcx)
  call   *%rdx
  mov    (%rsp),%rcx
  movsd  (%r14),%xmm0
  movsd  0x8(%rsp),%xmm2
  movsd  0x10(%rsp),%xmm1
  movsd  (%rcx),%xmm5
L217:
  movsd  D56(%rip),%xmm4
  movapd %xmm0,%xmm3
  subsd  %xmm2,%xmm3
  subsd  %xmm5,%xmm2
  divsd  %xmm1,%xmm4
  test   %r12d,%r12d
  jle    L200
  xor    %eax,%eax
  nopw   0x0(%rax,%rax,1)
L215:
  movsd  0x0(%r13,%rax,8),%xmm0
  movsd  (%rbx,%rax,8),%xmm1
  mulsd  %xmm3,%xmm0
  mulsd  %xmm2,%xmm1
  addsd  %xmm1,%xmm0
  mulsd  %xmm4,%xmm0
  movsd  %xmm0,0x0(%rbp,%rax,8)
  add    $0x1,%rax
  cmp    %rax,%r12
  jne    L215
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L80:
  mov    0x68(%rsp),%rax
  movsd  (%rax),%xmm3
  comisd %xmm3,%xmm4
  jbe    L86
  movsd  %xmm1,0x8(%rsp)
  movapd %xmm5,%xmm0
  mov    %r15,%rdi
  movsd  %xmm2,(%rsp)
  movsd  %xmm5,(%rax)
  call   *%rdx
  mov    0x68(%rsp),%rax
  movsd  (%r14),%xmm0
  movsd  (%rsp),%xmm2
  movsd  0x8(%rsp),%xmm1
  movsd  (%rax),%xmm3
L86:
  movsd  D56(%rip),%xmm4
  subsd  %xmm2,%xmm3
  subsd  %xmm0,%xmm2
  divsd  %xmm1,%xmm4
  test   %r12d,%r12d
  jle    L200
  xor    %eax,%eax
  nop
L192:
  movsd  (%rbx,%rax,8),%xmm0
  movsd  (%r15,%rax,8),%xmm1
  mulsd  %xmm3,%xmm0
  mulsd  %xmm2,%xmm1
  addsd  %xmm1,%xmm0
  mulsd  %xmm4,%xmm0
  movsd  %xmm0,0x0(%rbp,%rax,8)
  add    $0x1,%rax
  cmp    %rax,%r12
  jne    L192
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L55:
  movsd  D8(%rip),%xmm0
  mov    0x68(%rsp),%rax
  mov    %rbx,%rdi
  movsd  %xmm0,(%rcx)
  movsd  %xmm0,(%rax)
  movapd %xmm2,%xmm0
  movsd  %xmm2,(%r9)
  call   *%rdx
  test   %r12d,%r12d
  jle    L200
  xor    %eax,%eax
  xchg   %ax,%ax
L3:
  movsd  (%rbx,%rax,8),%xmm0
  movsd  %xmm0,0x0(%rbp,%rax,8)
  add    $0x1,%rax
  cmp    %rax,%r12
  jne    L3
  jmp    L200
  nopl   0x0(%rax)
L112:
  movsd  D8(%rip),%xmm0
  mov    0x68(%rsp),%rax
  mov    %rbx,%rdi
  movsd  %xmm0,(%rcx)
  movsd  %xmm0,(%rax)
  movapd %xmm2,%xmm0
  movsd  %xmm2,(%r9)
  call   *%rdx
  test   %r12d,%r12d
  jle    L200
  xor    %eax,%eax
  xchg   %ax,%ax
L158:
  movsd  (%rbx,%rax,8),%xmm0
  movsd  %xmm0,0x0(%rbp,%rax,8)
  add    $0x1,%rax
  cmp    %rax,%r12
  jne    L158
  jmp    L200
```

tool_calls: name: parse_data
arguments: label: D29
datatype: byte[8]
name: parse_data
arguments: label: D8
datatype: byte[8]
name: parse_data
arguments: label: D56
datatype: f64

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

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

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