user: Demonstrate the C code that generates the assembly output below:

```asm
<ti_tema>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x68,%rsp
  mov    %edi,-0x54(%rbp)
  mov    %rsi,-0x60(%rbp)
  mov    %rdx,-0x68(%rbp)
  mov    %rcx,-0x70(%rbp)
  mov    -0x60(%rbp),%rax
  mov    (%rax),%rax
  mov    %rax,-0x28(%rbp)
  mov    -0x68(%rbp),%rax
  movsd  (%rax),%xmm0
  cvttsd2si %xmm0,%eax
  mov    %eax,-0x4c(%rbp)
  mov    -0x70(%rbp),%rax
  mov    (%rax),%rax
  mov    %rax,-0x48(%rbp)
  cmpl   $0x0,-0x4c(%rbp)
  jg     L95
  mov    $0x1,%eax
  jmp    L14
L95:
  mov    -0x68(%rbp),%rax
  mov    %rax,%rdi
  call   <ti_tema_start@plt>
  cmp    %eax,-0x54(%rbp)
  jg     L88
  mov    $0x0,%eax
  jmp    L14
L88:
  pxor   %xmm1,%xmm1
  cvtsi2sdl -0x4c(%rbp),%xmm1
  movsd  D34(%rip),%xmm0
  addsd  %xmm0,%xmm1
  movsd  D13(%rip),%xmm0
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x20(%rbp)
  movsd  D34(%rip),%xmm0
  subsd  -0x20(%rbp),%xmm0
  movsd  %xmm0,-0x18(%rbp)
  mov    -0x28(%rbp),%rax
  movsd  (%rax),%xmm0
  movsd  %xmm0,-0x40(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x38(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x30(%rbp)
  movl   $0x0,-0x50(%rbp)
  jmp    L108
L98:
  movsd  -0x40(%rbp),%xmm0
  movapd %xmm0,%xmm1
  mulsd  -0x18(%rbp),%xmm1
  mov    -0x50(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  -0x20(%rbp),%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x40(%rbp)
  mov    -0x4c(%rbp),%eax
  sub    $0x1,%eax
  cmp    %eax,-0x50(%rbp)
  jne    L24
  movsd  -0x40(%rbp),%xmm0
  movsd  %xmm0,-0x38(%rbp)
L24:
  mov    -0x4c(%rbp),%eax
  sub    $0x1,%eax
  cmp    %eax,-0x50(%rbp)
  jl     L76
  movsd  -0x38(%rbp),%xmm0
  movapd %xmm0,%xmm1
  mulsd  -0x18(%rbp),%xmm1
  movsd  -0x40(%rbp),%xmm0
  mulsd  -0x20(%rbp),%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x38(%rbp)
  mov    -0x4c(%rbp),%eax
  sub    $0x1,%eax
  add    %eax,%eax
  cmp    %eax,-0x50(%rbp)
  jne    L26
  movsd  -0x38(%rbp),%xmm0
  movsd  %xmm0,-0x30(%rbp)
L26:
  mov    -0x4c(%rbp),%eax
  sub    $0x1,%eax
  add    %eax,%eax
  cmp    %eax,-0x50(%rbp)
  jl     L76
  movsd  -0x30(%rbp),%xmm0
  movapd %xmm0,%xmm1
  mulsd  -0x18(%rbp),%xmm1
  movsd  -0x38(%rbp),%xmm0
  mulsd  -0x20(%rbp),%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x30(%rbp)
  mov    -0x4c(%rbp),%eax
  lea    -0x1(%rax),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  cmp    %eax,-0x50(%rbp)
  jl     L76
  movsd  -0x40(%rbp),%xmm1
  movsd  D31(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  -0x38(%rbp),%xmm2
  movsd  D31(%rip),%xmm1
  mulsd  %xmm2,%xmm1
  subsd  %xmm1,%xmm0
  addsd  -0x30(%rbp),%xmm0
  mov    -0x48(%rbp),%rax
  movsd  %xmm0,(%rax)
  addq   $0x8,-0x48(%rbp)
L76:
  addl   $0x1,-0x50(%rbp)
L108:
  mov    -0x50(%rbp),%eax
  cmp    -0x54(%rbp),%eax
  jl     L98
  mov    -0x70(%rbp),%rax
  mov    (%rax),%rdx
  mov    -0x48(%rbp),%rax
  sub    %rdx,%rax
  sar    $0x3,%rax
  mov    %rax,%rbx
  mov    -0x68(%rbp),%rax
  mov    %rax,%rdi
  call   <ti_tema_start@plt>
  mov    %eax,%edx
  mov    -0x54(%rbp),%eax
  sub    %edx,%eax
  cltq
  cmp    %rax,%rbx
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    $0x0,%eax
L14:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: tag: D34
type_guessed: f64
name: extract_symbolic_data
arguments: tag: D13
type_guessed: f32[2]
name: extract_symbolic_data
arguments: tag: D31
type_guessed: f32[2]

tool: D34: 1

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

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