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

```asm
<ti_tema>:
  endbr64
  push   %r15
  mov    $0x1,%eax
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  cvttsd2si (%rdx),%ebx
  test   %ebx,%ebx
  jle    L3
  mov    %edi,%ebp
  mov    %rdx,%rdi
  mov    (%rsi),%r14
  mov    (%rcx),%r15
  mov    %rdx,%r12
  mov    %rcx,%r13
  call   <ti_tema_start@plt>
  mov    %eax,%r8d
  xor    %eax,%eax
  cmp    %ebp,%r8d
  jge    L3
  pxor   %xmm0,%xmm0
  movsd  D7(%rip),%xmm4
  movsd  D3(%rip),%xmm3
  cvtsi2sd %ebx,%xmm0
  addsd  %xmm4,%xmm0
  divsd  %xmm0,%xmm3
  movsd  (%r14),%xmm0
  subsd  %xmm3,%xmm4
  test   %ebp,%ebp
  jle    L71
  lea    -0x1(%rbx),%edx
  pxor   %xmm5,%xmm5
  movslq %ebp,%rsi
  xor    %eax,%eax
  lea    (%rdx,%rdx,1),%edi
  movsd  D16(%rip),%xmm6
  movapd %xmm0,%xmm1
  movapd %xmm5,%xmm2
  lea    (%rdi,%rdx,1),%r8d
  jmp    L64
  nopl   (%rax)
L117:
  jle    L37
L55:
  add    $0x1,%rax
  cmp    %rsi,%rax
  je     L71
L68:
  movsd  (%r14,%rax,8),%xmm1
L64:
  mulsd  %xmm4,%xmm0
  mov    %eax,%ecx
  mulsd  %xmm3,%xmm1
  addsd  %xmm1,%xmm0
  cmp    %eax,%edx
  jne    L117
  movapd %xmm0,%xmm2
L37:
  mulsd  %xmm4,%xmm2
  movapd %xmm3,%xmm1
  mulsd  %xmm0,%xmm1
  addsd  %xmm1,%xmm2
  cmp    %ecx,%edi
  je     L12
  jg     L55
L116:
  mulsd  %xmm4,%xmm5
  movapd %xmm3,%xmm1
  mulsd  %xmm2,%xmm1
  addsd  %xmm1,%xmm5
  cmp    %ecx,%r8d
  jg     L55
  movapd %xmm2,%xmm7
  movapd %xmm0,%xmm1
  add    $0x1,%rax
  add    $0x8,%r15
  mulsd  %xmm6,%xmm7
  mulsd  %xmm6,%xmm1
  subsd  %xmm7,%xmm1
  addsd  %xmm5,%xmm1
  movsd  %xmm1,-0x8(%r15)
  cmp    %rsi,%rax
  jne    L68
  nopl   (%rax)
L71:
  mov    %r12,%rdi
  sub    0x0(%r13),%r15
  call   <ti_tema_start@plt>
  sar    $0x3,%r15
  xor    %edi,%edi
  sub    %eax,%ebp
  movslq %ebp,%rbp
  cmp    %r15,%rbp
  sete   %dil
  call   <assert@plt>
  xor    %eax,%eax
L3:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L12:
  movapd %xmm2,%xmm5
  jmp    L116
```

tool_calls: name: parse_data
arguments: data_tag: D7
data_type: f64
name: parse_data
arguments: data_tag: D3
data_type: f32[2]
name: parse_data
arguments: data_tag: D16
data_type: f32[2]

tool: D7: 1

tool: {"D3": [0.0,2.0]}

tool: {"D16": [0.0,2.125]}

assistant: ```c
int ti_tema(int size, double const *const *inputs, double const *options, double *const *outputs) {
  const double *input = inputs[0];
  const int period = (int)options[0];
  double *output = outputs[0];
  if (period < 1)
    return 1;
  if (size <= ti_tema_start(options))
    return 0;
  const double per = 2 / ((double)period + 1);
  const double per1 = 1.0 - per;
  double ema = input[0];
  double ema2 = 0;
  double ema3 = 0;
  int i;
  for (i = 0; i < size; ++i) {
    ema = ema * per1 + input[i] * per;
    if (i == period - 1) {
      ema2 = ema;
    }
    if (i >= period - 1) {
      ema2 = ema2 * per1 + ema * per;
      if (i == (period - 1) * 2) {
        ema3 = ema2;
      }
      if (i >= (period - 1) * 2) {
        ema3 = ema3 * per1 + ema2 * per;
        if (i >= (period - 1) * 3) {
          *output = 3 * ema - 3 * ema2 + ema3;
          ++output;
        }
      }
    }
  }
  assert(output - outputs[0] == size - ti_tema_start(options));
  return 0;
}
```