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),%r15d
  test   %r15d,%r15d
  jle    L198
  mov    %edi,%ebx
  mov    %rdx,%rdi
  mov    (%rsi),%r13
  mov    (%rcx),%r12
  mov    %rdx,%rbp
  mov    %rcx,%r14
  call   <ti_tema_start@plt>
  mov    %eax,%r8d
  xor    %eax,%eax
  cmp    %ebx,%r8d
  jge    L198
  pxor   %xmm0,%xmm0
  movsd  D19(%rip),%xmm4
  movsd  D22(%rip),%xmm3
  cvtsi2sd %r15d,%xmm0
  addsd  %xmm4,%xmm0
  divsd  %xmm0,%xmm3
  movsd  0x0(%r13),%xmm0
  subsd  %xmm3,%xmm4
  test   %ebx,%ebx
  jle    L87
  lea    -0x1(%r15),%ecx
  lea    (%rcx,%rcx,1),%edi
  lea    (%rdi,%rcx,1),%esi
  test   %esi,%esi
  jle    L117
  cmp    %ebx,%esi
  pxor   %xmm5,%xmm5
  mov    %r13,%rdx
  cmovg  %ebx,%esi
  movapd %xmm5,%xmm1
  jmp    L101
L46:
  jle    L14
L68:
  add    $0x1,%eax
  add    $0x8,%rdx
  cmp    %esi,%eax
  jge    L153
L101:
  movsd  (%rdx),%xmm2
  mulsd  %xmm4,%xmm0
  mulsd  %xmm3,%xmm2
  addsd  %xmm2,%xmm0
  cmp    %eax,%ecx
  jne    L46
  movapd %xmm0,%xmm1
L14:
  mulsd  %xmm4,%xmm1
  movapd %xmm3,%xmm2
  mulsd  %xmm0,%xmm2
  addsd  %xmm2,%xmm1
  cmp    %eax,%edi
  je     L13
  jg     L68
L86:
  mulsd  %xmm4,%xmm5
  movapd %xmm3,%xmm2
  add    $0x1,%eax
  add    $0x8,%rdx
  mulsd  %xmm1,%xmm2
  addsd  %xmm2,%xmm5
  cmp    %esi,%eax
  jl     L101
L153:
  cmp    %eax,%ebx
  jle    L87
L35:
  movsd  D9(%rip),%xmm6
  cltq
  jmp    L77
  xchg   %ax,%ax
L203:
  jle    L180
L55:
  add    $0x1,%rax
  cmp    %eax,%ebx
  jle    L87
L77:
  movsd  0x0(%r13,%rax,8),%xmm2
  mulsd  %xmm4,%xmm0
  mov    %eax,%edx
  mulsd  %xmm3,%xmm2
  addsd  %xmm2,%xmm0
  cmp    %eax,%ecx
  jne    L203
  movapd %xmm0,%xmm1
L180:
  mulsd  %xmm4,%xmm1
  movapd %xmm3,%xmm2
  mulsd  %xmm0,%xmm2
  addsd  %xmm2,%xmm1
  cmp    %edx,%edi
  je     L64
  jg     L55
L156:
  movapd %xmm3,%xmm2
  movapd %xmm1,%xmm7
  add    $0x1,%rax
  add    $0x8,%r12
  mulsd  %xmm1,%xmm2
  mulsd  %xmm4,%xmm5
  mulsd  %xmm6,%xmm7
  addsd  %xmm2,%xmm5
  movapd %xmm0,%xmm2
  mulsd  %xmm6,%xmm2
  subsd  %xmm7,%xmm2
  addsd  %xmm5,%xmm2
  movsd  %xmm2,-0x8(%r12)
  cmp    %eax,%ebx
  jg     L77
  nopl   0x0(%rax)
L87:
  mov    %rbp,%rdi
  sub    (%r14),%r12
  call   <ti_tema_start@plt>
  sar    $0x3,%r12
  xor    %edi,%edi
  mov    %eax,%r8d
  mov    %ebx,%eax
  sub    %r8d,%eax
  cltq
  cmp    %r12,%rax
  sete   %dil
  call   <assert@plt>
  xor    %eax,%eax
L198:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L13:
  movapd %xmm1,%xmm5
  jmp    L86
  nopl   0x0(%rax)
L64:
  movapd %xmm1,%xmm5
  jmp    L156
  nopl   0x0(%rax)
L117:
  pxor   %xmm5,%xmm5
  xor    %eax,%eax
  movapd %xmm5,%xmm1
  jmp    L35
```

tool_calls: name: parse_data
arguments: label: D19
data_type: f64
name: parse_data
arguments: label: D22
data_type: f32[2]
name: parse_data
arguments: label: D9
data_type: f32[2]

tool: D19: 1

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

tool: {"D9": [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;
}
```