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

```asm
<ti_dema>:
  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,-0x44(%rbp)
  mov    -0x70(%rbp),%rax
  mov    (%rax),%rax
  mov    %rax,-0x40(%rbp)
  cmpl   $0x0,-0x44(%rbp)
  jg     L41
  mov    $0x1,%eax
  jmp    L18
L41:
  mov    -0x68(%rbp),%rax
  mov    %rax,%rdi
  call   <ti_dema_start@plt>
  cmp    %eax,-0x54(%rbp)
  jg     L60
  mov    $0x0,%eax
  jmp    L18
L60:
  pxor   %xmm1,%xmm1
  cvtsi2sdl -0x44(%rbp),%xmm1
  movsd  D8(%rip),%xmm0
  addsd  %xmm0,%xmm1
  movsd  D12(%rip),%xmm0
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x20(%rbp)
  movsd  D8(%rip),%xmm0
  subsd  -0x20(%rbp),%xmm0
  movsd  %xmm0,-0x18(%rbp)
  mov    -0x28(%rbp),%rax
  movsd  (%rax),%xmm0
  movsd  %xmm0,-0x38(%rbp)
  movsd  -0x38(%rbp),%xmm0
  movsd  %xmm0,-0x30(%rbp)
  movl   $0x0,-0x48(%rbp)
  jmp    L62
L2:
  movsd  -0x38(%rbp),%xmm0
  movapd %xmm0,%xmm1
  mulsd  -0x18(%rbp),%xmm1
  mov    -0x48(%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,-0x38(%rbp)
  mov    -0x44(%rbp),%eax
  sub    $0x1,%eax
  cmp    %eax,-0x48(%rbp)
  jne    L21
  movsd  -0x38(%rbp),%xmm0
  movsd  %xmm0,-0x30(%rbp)
L21:
  mov    -0x44(%rbp),%eax
  sub    $0x1,%eax
  cmp    %eax,-0x48(%rbp)
  jl     L16
  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    -0x44(%rbp),%eax
  sub    $0x1,%eax
  add    %eax,%eax
  cmp    %eax,-0x48(%rbp)
  jl     L16
  movsd  -0x38(%rbp),%xmm0
  addsd  %xmm0,%xmm0
  subsd  -0x30(%rbp),%xmm0
  mov    -0x40(%rbp),%rax
  movsd  %xmm0,(%rax)
  addq   $0x8,-0x40(%rbp)
L16:
  addl   $0x1,-0x48(%rbp)
L62:
  mov    -0x48(%rbp),%eax
  cmp    -0x54(%rbp),%eax
  jl     L2
  mov    -0x70(%rbp),%rax
  mov    (%rax),%rdx
  mov    -0x40(%rbp),%rax
  sub    %rdx,%rax
  sar    $0x3,%rax
  mov    %rax,%rbx
  mov    -0x68(%rbp),%rax
  mov    %rax,%rdi
  call   <ti_dema_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
L18:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

tool_calls: name: unpack_data
arguments: data_tag: D8
datatype: f64
name: unpack_data
arguments: data_tag: D12
datatype: f32[2]

tool: D8: 1

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

assistant: ```c
int ti_dema(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_dema_start(options))
    return 0;
  const double per = 2 / ((double)period + 1);
  const double per1 = 1.0 - per;
  double ema = input[0];
  double ema2 = ema;
  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) {
        *output = ema * 2 - ema2;
        ++output;
      }
    }
  }
  assert(output - outputs[0] == size - ti_dema_start(options));
  return 0;
}
```