user: What would the C source look like for the assembly code provided here?

```asm
<CalcInterpolatedElements>:
  endbr64
  push   %r15
  movapd %xmm0,%xmm2
  mov    %r9,%r15
  push   %r14
  push   %r13
  push   %r12
  movslq %esi,%r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  sub    $0x28,%rsp
  movsd  (%r9),%xmm0
  movsd  D50(%rip),%xmm4
  mov    0x60(%rsp),%rbx
  mov    0x70(%rsp),%r14
  comisd %xmm0,%xmm4
  ja     L262
  comisd %xmm2,%xmm0
  mov    %r8,%r13
  jb     L244
  movapd %xmm0,%xmm3
  subsd  %xmm1,%xmm3
  comisd %xmm3,%xmm2
  jae    L58
  movapd %xmm1,%xmm6
  movapd %xmm0,%xmm5
  addsd  %xmm1,%xmm6
  subsd  %xmm6,%xmm5
  comisd %xmm5,%xmm2
  jb     L264
  comisd (%rcx),%xmm4
  jbe    L0
  mov    %rcx,0x8(%rsp)
  movapd %xmm3,%xmm0
  mov    %r8,%rdi
  mov    %rdx,(%rsp)
  movsd  %xmm1,0x18(%rsp)
  movsd  %xmm2,0x10(%rsp)
  movsd  %xmm3,(%rcx)
  call   *%rdx
  movsd  (%r15),%xmm0
  movsd  0x18(%rsp),%xmm1
  movsd  0x10(%rsp),%xmm2
  mov    0x8(%rsp),%rcx
  mov    (%rsp),%rdx
L0:
  mov    0x68(%rsp),%rax
  movsd  %xmm0,(%rax)
  movsd  (%rcx),%xmm0
  movsd  %xmm0,(%r15)
  test   %r12d,%r12d
  jle    L179
  movslq %r12d,%rdi
  xor    %eax,%eax
  nopw   0x0(%rax,%rax,1)
L271:
  movsd  (%rbx,%rax,8),%xmm0
  movsd  %xmm0,(%r14,%rax,8)
  movsd  0x0(%r13,%rax,8),%xmm0
  movsd  %xmm0,(%rbx,%rax,8)
  add    $0x1,%rax
  cmp    %rax,%rdi
  jne    L271
  movsd  (%r15),%xmm0
L179:
  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  (%r15),%xmm0
  movsd  0x8(%rsp),%xmm1
  movsd  0x10(%rsp),%xmm2
  movsd  (%rcx),%xmm5
  jmp    L61
L244:
  movapd %xmm0,%xmm5
  addsd  %xmm1,%xmm5
  comisd %xmm2,%xmm5
  jae    L117
  movapd %xmm1,%xmm3
  addsd  %xmm1,%xmm3
  addsd  %xmm0,%xmm3
  comisd %xmm2,%xmm3
  jb     L234
  mov    0x68(%rsp),%rax
  comisd (%rax),%xmm4
  jbe    L220
  mov    %rcx,0x18(%rsp)
  movapd %xmm5,%xmm0
  mov    %r14,%rdi
  mov    %rdx,(%rsp)
  movsd  %xmm1,0x10(%rsp)
  movsd  %xmm2,0x8(%rsp)
  movsd  %xmm5,(%rax)
  call   *%rdx
  movsd  (%r15),%xmm0
  mov    0x18(%rsp),%rcx
  movsd  0x10(%rsp),%xmm1
  movsd  0x8(%rsp),%xmm2
  mov    (%rsp),%rdx
L220:
  mov    0x68(%rsp),%rax
  movsd  %xmm0,(%rcx)
  movsd  (%rax),%xmm0
  movsd  %xmm0,(%r15)
  test   %r12d,%r12d
  jle    L132
  movslq %r12d,%rcx
  xor    %eax,%eax
  nopl   0x0(%rax,%rax,1)
L69:
  movsd  (%rbx,%rax,8),%xmm0
  movsd  %xmm0,0x0(%r13,%rax,8)
  movsd  (%r14,%rax,8),%xmm0
  movsd  %xmm0,(%rbx,%rax,8)
  add    $0x1,%rax
  cmp    %rax,%rcx
  jne    L69
  movsd  (%r15),%xmm0
L132:
  addsd  %xmm1,%xmm0
  mov    0x68(%rsp),%rax
  movsd  %xmm1,(%rsp)
  mov    %r14,%rdi
  movsd  %xmm2,0x8(%rsp)
  movsd  %xmm0,(%rax)
  call   *%rdx
  mov    0x68(%rsp),%rax
  movsd  (%r15),%xmm0
  movsd  (%rsp),%xmm1
  movsd  0x8(%rsp),%xmm2
  movsd  (%rax),%xmm3
  jmp    L104
L262:
  movsd  D36(%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    L38
  nopl   (%rax)
L32:
  movsd  (%rbx,%rax,8),%xmm0
  movsd  %xmm0,0x0(%rbp,%rax,8)
  add    $0x1,%rax
  cmp    %rax,%rdx
  jne    L32
L38:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L58:
  movsd  (%rcx),%xmm5
  comisd %xmm5,%xmm4
  jbe    L61
  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  (%r15),%xmm0
  movsd  0x8(%rsp),%xmm2
  movsd  0x10(%rsp),%xmm1
  movsd  (%rcx),%xmm5
L61:
  movsd  D57(%rip),%xmm4
  movapd %xmm0,%xmm3
  subsd  %xmm2,%xmm3
  subsd  %xmm5,%xmm2
  divsd  %xmm1,%xmm4
  test   %r12d,%r12d
  jle    L38
  xor    %eax,%eax
  nopw   0x0(%rax,%rax,1)
L237:
  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    L237
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L117:
  mov    0x68(%rsp),%rax
  movsd  (%rax),%xmm3
  comisd %xmm3,%xmm4
  jbe    L104
  movsd  %xmm1,0x8(%rsp)
  movapd %xmm5,%xmm0
  mov    %r14,%rdi
  movsd  %xmm2,(%rsp)
  movsd  %xmm5,(%rax)
  call   *%rdx
  mov    0x68(%rsp),%rax
  movsd  (%r15),%xmm0
  movsd  (%rsp),%xmm2
  movsd  0x8(%rsp),%xmm1
  movsd  (%rax),%xmm3
L104:
  movsd  D57(%rip),%xmm4
  subsd  %xmm2,%xmm3
  subsd  %xmm0,%xmm2
  divsd  %xmm1,%xmm4
  test   %r12d,%r12d
  jle    L38
  xor    %eax,%eax
  nop
L36:
  movsd  (%rbx,%rax,8),%xmm0
  movsd  (%r14,%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    L36
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L234:
  movsd  D36(%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    L38
  xor    %eax,%eax
  xchg   %ax,%ax
L7:
  movsd  (%rbx,%rax,8),%xmm0
  movsd  %xmm0,0x0(%rbp,%rax,8)
  add    $0x1,%rax
  cmp    %rax,%r12
  jne    L7
  jmp    L38
  nopl   0x0(%rax)
L264:
  movsd  D36(%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    L38
  xor    %eax,%eax
  xchg   %ax,%ax
L204:
  movsd  (%rbx,%rax,8),%xmm0
  movsd  %xmm0,0x0(%rbp,%rax,8)
  add    $0x1,%rax
  cmp    %rax,%r12
  jne    L204
  jmp    L38
```

tool_calls: name: retrieve_data
arguments: data_tag: D50
datatype: byte[8]
name: retrieve_data
arguments: data_tag: D36
datatype: byte[8]
name: retrieve_data
arguments: data_tag: D57
datatype: f64

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

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

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