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

```asm
<ti_trima>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x78,%rsp
  mov    %edi,-0x64(%rbp)
  mov    %rsi,-0x70(%rbp)
  mov    %rdx,-0x78(%rbp)
  mov    %rcx,-0x80(%rbp)
  mov    -0x70(%rbp),%rax
  mov    (%rax),%rax
  mov    %rax,-0x20(%rbp)
  mov    -0x78(%rbp),%rax
  movsd  (%rax),%xmm0
  cvttsd2si %xmm0,%eax
  mov    %eax,-0x4c(%rbp)
  mov    -0x80(%rbp),%rax
  mov    (%rax),%rax
  mov    %rax,-0x40(%rbp)
  cmpl   $0x0,-0x4c(%rbp)
  jg     L148
  mov    $0x1,%eax
  jmp    L11
L148:
  mov    -0x78(%rbp),%rax
  mov    %rax,%rdi
  call   <ti_trima_start@plt>
  cmp    %eax,-0x64(%rbp)
  jg     L62
  mov    $0x0,%eax
  jmp    L11
L62:
  cmpl   $0x2,-0x4c(%rbp)
  jg     L88
  mov    -0x80(%rbp),%rcx
  mov    -0x78(%rbp),%rdx
  mov    -0x70(%rbp),%rsi
  mov    -0x64(%rbp),%eax
  mov    %eax,%edi
  call   <ti_sma@plt>
  jmp    L11
L88:
  mov    -0x4c(%rbp),%eax
  and    $0x1,%eax
  test   %eax,%eax
  je     L66
  mov    -0x4c(%rbp),%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  lea    0x1(%rax),%edx
  mov    -0x4c(%rbp),%eax
  mov    %eax,%ecx
  shr    $0x1f,%ecx
  add    %ecx,%eax
  sar    %eax
  add    $0x1,%eax
  imul   %edx,%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  jmp    L78
L66:
  mov    -0x4c(%rbp),%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  lea    0x1(%rax),%edx
  mov    -0x4c(%rbp),%eax
  mov    %eax,%ecx
  shr    $0x1f,%ecx
  add    %ecx,%eax
  sar    %eax
  imul   %edx,%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
L78:
  movsd  D8(%rip),%xmm1
  divsd  %xmm0,%xmm1
  movsd  %xmm1,-0x18(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x38(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x30(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x28(%rbp)
  mov    -0x4c(%rbp),%eax
  and    $0x1,%eax
  test   %eax,%eax
  je     L24
  mov    -0x4c(%rbp),%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  jmp    L52
L24:
  mov    -0x4c(%rbp),%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  sub    $0x1,%eax
L52:
  mov    %eax,-0x48(%rbp)
  mov    -0x48(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x44(%rbp)
  movl   $0x1,-0x5c(%rbp)
  movl   $0x0,-0x60(%rbp)
  jmp    L55
L87:
  mov    -0x60(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  pxor   %xmm0,%xmm0
  cvtsi2sdl -0x5c(%rbp),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  -0x38(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x38(%rbp)
  mov    -0x4c(%rbp),%eax
  sub    -0x48(%rbp),%eax
  cmp    %eax,-0x60(%rbp)
  jl     L23
  mov    -0x60(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movsd  -0x30(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x30(%rbp)
L23:
  mov    -0x60(%rbp),%eax
  cmp    -0x44(%rbp),%eax
  jge    L75
  mov    -0x60(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movsd  -0x28(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x28(%rbp)
L75:
  mov    -0x60(%rbp),%eax
  add    $0x1,%eax
  cmp    %eax,-0x44(%rbp)
  jle    L26
  addl   $0x1,-0x5c(%rbp)
L26:
  mov    -0x60(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    -0x4c(%rbp),%eax
  sub    -0x48(%rbp),%eax
  cmp    %eax,%edx
  jl     L109
  subl   $0x1,-0x5c(%rbp)
L109:
  addl   $0x1,-0x60(%rbp)
L55:
  mov    -0x4c(%rbp),%eax
  sub    $0x1,%eax
  cmp    %eax,-0x60(%rbp)
  jl     L87
  mov    -0x4c(%rbp),%eax
  sub    $0x1,%eax
  sub    -0x48(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x58(%rbp)
  mov    -0x44(%rbp),%eax
  mov    %eax,-0x54(%rbp)
  movl   $0x0,-0x50(%rbp)
  mov    -0x4c(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x60(%rbp)
  jmp    L10
L177:
  mov    -0x60(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movsd  -0x38(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x38(%rbp)
  mov    -0x40(%rbp),%rax
  lea    0x8(%rax),%rdx
  mov    %rdx,-0x40(%rbp)
  movsd  -0x38(%rbp),%xmm0
  mulsd  -0x18(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x60(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movsd  -0x30(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x30(%rbp)
  movsd  -0x38(%rbp),%xmm0
  addsd  -0x30(%rbp),%xmm0
  movsd  %xmm0,-0x38(%rbp)
  movsd  -0x38(%rbp),%xmm0
  subsd  -0x28(%rbp),%xmm0
  movsd  %xmm0,-0x38(%rbp)
  mov    -0x58(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x58(%rbp)
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  movsd  -0x30(%rbp),%xmm0
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x30(%rbp)
  mov    -0x54(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x54(%rbp)
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movsd  -0x28(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x28(%rbp)
  mov    -0x50(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x50(%rbp)
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  movsd  -0x28(%rbp),%xmm0
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x28(%rbp)
  addl   $0x1,-0x60(%rbp)
L10:
  mov    -0x60(%rbp),%eax
  cmp    -0x64(%rbp),%eax
  jl     L177
  mov    -0x80(%rbp),%rax
  mov    (%rax),%rdx
  mov    -0x40(%rbp),%rax
  sub    %rdx,%rax
  sar    $0x3,%rax
  mov    %rax,%rbx
  mov    -0x78(%rbp),%rax
  mov    %rax,%rdi
  call   <ti_trima_start@plt>
  mov    %eax,%edx
  mov    -0x64(%rbp),%eax
  sub    %edx,%eax
  cltq
  cmp    %rax,%rbx
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    $0x0,%eax
L11:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

tool_calls: name: read_data
arguments: data_tag: D8
type_guessed: f64

tool: D8: 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;
}
```