user: 下面的汇编指令对应的C源代码是什么:

```asm
<ti_trima>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  cvttsd2si (%rdx),%r15d
  test   %r15d,%r15d
  jle    L3
  mov    %edi,%ebp
  mov    %rdx,%rdi
  mov    %rsi,0x8(%rsp)
  mov    (%rsi),%rbx
  mov    (%rcx),%r12
  mov    %rdx,%r13
  mov    %rcx,%r14
  call   <ti_trima_start@plt>
  cmp    %ebp,%eax
  jge    L26
  cmp    $0x2,%r15d
  mov    0x8(%rsp),%rsi
  jle    L50
  mov    %r15d,%eax
  sar    %eax
  lea    0x1(%rax),%esi
  test   $0x1,%r15b
  jne    L47
  imul   %eax,%esi
  pxor   %xmm0,%xmm0
  movsd  D7(%rip),%xmm5
  lea    -0x1(%rax),%edi
  cvtsi2sd %esi,%xmm0
  mov    %eax,%esi
  divsd  %xmm0,%xmm5
L53:
  pxor   %xmm1,%xmm1
  lea    -0x1(%r15),%r8d
  mov    %r15d,%ecx
  xor    %eax,%eax
  mov    %r8,%r9
  sub    %edi,%ecx
  movapd %xmm1,%xmm2
  mov    $0x1,%edx
  movapd %xmm1,%xmm0
  nop
L60:
  pxor   %xmm3,%xmm3
  movsd  (%rbx,%rax,8),%xmm4
  mov    %eax,%r10d
  cvtsi2sd %edx,%xmm3
  mulsd  %xmm4,%xmm3
  addsd  %xmm3,%xmm0
  cmp    %ecx,%eax
  jl     L83
  addsd  %xmm4,%xmm2
L83:
  cmp    %esi,%r10d
  jge    L58
  addsd  %xmm4,%xmm1
L58:
  cmp    %edi,%r10d
  setl   %r10b
  movzbl %r10b,%r10d
  add    %r10d,%edx
  lea    0x1(%rax),%r10d
  cmp    %ecx,%r10d
  setge  %r10b
  add    $0x1,%rax
  movzbl %r10b,%r10d
  sub    %r10d,%edx
  cmp    %rax,%r8
  jne    L60
  mov    %r9d,%eax
  sub    %edi,%eax
  cmp    %r9d,%ebp
  jle    L33
  mov    %ebp,%edi
  cltq
  movslq %esi,%rsi
  sub    %r15d,%edi
  lea    (%rbx,%rax,8),%r9
  movslq %r15d,%r15
  xor    %eax,%eax
  lea    0x1(%rdi),%r8
  lea    (%rbx,%r15,8),%rdx
  lea    (%rbx,%rsi,8),%rsi
  nopl   0x0(%rax,%rax,1)
L63:
  addsd  -0x8(%rdx,%rax,8),%xmm0
  mov    %rax,%rcx
  movapd %xmm0,%xmm3
  mulsd  %xmm5,%xmm3
  movsd  %xmm3,(%r12,%rax,8)
  addsd  -0x8(%rdx,%rax,8),%xmm2
  addsd  %xmm2,%xmm0
  subsd  0x8(%r9,%rax,8),%xmm2
  subsd  %xmm1,%xmm0
  addsd  (%rsi,%rax,8),%xmm1
  subsd  (%rbx,%rax,8),%xmm1
  add    $0x1,%rax
  cmp    %rcx,%rdi
  jne    L63
  lea    (%r12,%r8,8),%r12
L33:
  mov    %r13,%rdi
  sub    (%r14),%r12
  call   <ti_trima_start@plt>
  sar    $0x3,%r12
  xor    %edi,%edi
  sub    %eax,%ebp
  movslq %ebp,%rbp
  cmp    %r12,%rbp
  sete   %dil
  call   <assert@plt>
  add    $0x18,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  cs nopw 0x0(%rax,%rax,1)
L3:
  add    $0x18,%rsp
  mov    $0x1,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L26:
  add    $0x18,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L47:
  mov    %esi,%edx
  pxor   %xmm0,%xmm0
  movsd  D7(%rip),%xmm5
  mov    %eax,%edi
  imul   %esi,%edx
  cvtsi2sd %edx,%xmm0
  divsd  %xmm0,%xmm5
  jmp    L53
L50:
  add    $0x18,%rsp
  mov    %r14,%rcx
  mov    %r13,%rdx
  mov    %ebp,%edi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1090 <ti_sma@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D7
datatype: f64

tool: D7: 1

assistant: ```c
int ti_trima(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_trima_start(options))
    return 0;
  if (period <= 2)
    return ti_sma(size, inputs, options, outputs);
  double weights = 1 / (double)((period % 2) ? ((period / 2 + 1) * (period / 2 + 1)) : ((period / 2 + 1) * (period / 2)));
  double weight_sum = 0;
  double lead_sum = 0;
  double trail_sum = 0;
  const int lead_period = period % 2 ? period / 2 : period / 2 - 1;
  const int trail_period = lead_period + 1;
  int i, w = 1;
  for (i = 0; i < period - 1; ++i) {
    weight_sum += input[i] * w;
    if (i + 1 > period - lead_period)
      lead_sum += input[i];
    if (i + 1 <= trail_period)
      trail_sum += input[i];
    if (i + 1 < trail_period)
      ++w;
    if (i + 1 >= period - lead_period)
      --w;
  }
  int lsi = (period - 1) - lead_period + 1;
  int tsi1 = (period - 1) - period + 1 + trail_period;
  int tsi2 = (period - 1) - period + 1;
  for (i = period - 1; i < size; ++i) {
    weight_sum += input[i];
    *output++ = weight_sum * weights;
    lead_sum += input[i];
    weight_sum += lead_sum;
    weight_sum -= trail_sum;
    lead_sum -= input[lsi++];
    trail_sum += input[tsi1++];
    trail_sum -= input[tsi2++];
  }
  assert(output - outputs[0] == size - ti_trima_start(options));
  return 0;
}
```