user: 请将以下的汇编代码转换成C语言代码：

```asm
<ti_macd>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x98,%rsp
  mov    %edi,-0x84(%rbp)
  mov    %rsi,-0x90(%rbp)
  mov    %rdx,-0x98(%rbp)
  mov    %rcx,-0xa0(%rbp)
  mov    -0x90(%rbp),%rax
  mov    (%rax),%rax
  mov    %rax,-0x28(%rbp)
  mov    -0xa0(%rbp),%rax
  mov    (%rax),%rax
  mov    %rax,-0x68(%rbp)
  mov    -0xa0(%rbp),%rax
  mov    0x8(%rax),%rax
  mov    %rax,-0x60(%rbp)
  mov    -0xa0(%rbp),%rax
  mov    0x10(%rax),%rax
  mov    %rax,-0x58(%rbp)
  mov    -0x98(%rbp),%rax
  movsd  (%rax),%xmm0
  cvttsd2si %xmm0,%eax
  mov    %eax,-0x74(%rbp)
  mov    -0x98(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm0
  cvttsd2si %xmm0,%eax
  mov    %eax,-0x70(%rbp)
  mov    -0x98(%rbp),%rax
  add    $0x10,%rax
  movsd  (%rax),%xmm0
  cvttsd2si %xmm0,%eax
  mov    %eax,-0x6c(%rbp)
  cmpl   $0x0,-0x74(%rbp)
  jg     L23
  mov    $0x1,%eax
  jmp    L118
L23:
  cmpl   $0x1,-0x70(%rbp)
  jg     L47
  mov    $0x1,%eax
  jmp    L118
L47:
  mov    -0x70(%rbp),%eax
  cmp    -0x74(%rbp),%eax
  jge    L154
  mov    $0x1,%eax
  jmp    L118
L154:
  cmpl   $0x0,-0x6c(%rbp)
  jg     L131
  mov    $0x1,%eax
  jmp    L118
L131:
  mov    -0x98(%rbp),%rax
  mov    %rax,%rdi
  call   <ti_macd_start@plt>
  cmp    %eax,-0x84(%rbp)
  jg     L76
  mov    $0x0,%eax
  jmp    L118
L76:
  pxor   %xmm1,%xmm1
  cvtsi2sdl -0x74(%rbp),%xmm1
  movsd  D35(%rip),%xmm0
  addsd  %xmm0,%xmm1
  movsd  D27(%rip),%xmm0
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x50(%rbp)
  pxor   %xmm1,%xmm1
  cvtsi2sdl -0x70(%rbp),%xmm1
  movsd  D35(%rip),%xmm0
  addsd  %xmm0,%xmm1
  movsd  D27(%rip),%xmm0
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x48(%rbp)
  pxor   %xmm1,%xmm1
  cvtsi2sdl -0x6c(%rbp),%xmm1
  movsd  D35(%rip),%xmm0
  addsd  %xmm0,%xmm1
  movsd  D27(%rip),%xmm0
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x20(%rbp)
  cmpl   $0xc,-0x74(%rbp)
  jne    L51
  cmpl   $0x1a,-0x70(%rbp)
  jne    L51
  movsd  D48(%rip),%xmm0
  movsd  %xmm0,-0x50(%rbp)
  movsd  D8(%rip),%xmm0
  movsd  %xmm0,-0x48(%rbp)
L51:
  mov    -0x28(%rbp),%rax
  movsd  (%rax),%xmm0
  movsd  %xmm0,-0x40(%rbp)
  mov    -0x28(%rbp),%rax
  movsd  (%rax),%xmm0
  movsd  %xmm0,-0x38(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x30(%rbp)
  movl   $0x1,-0x78(%rbp)
  jmp    L8
L89:
  mov    -0x78(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  subsd  -0x40(%rbp),%xmm0
  mulsd  -0x50(%rbp),%xmm0
  movsd  -0x40(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x40(%rbp)
  mov    -0x78(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  subsd  -0x38(%rbp),%xmm0
  mulsd  -0x48(%rbp),%xmm0
  movsd  -0x38(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x38(%rbp)
  movsd  -0x40(%rbp),%xmm0
  subsd  -0x38(%rbp),%xmm0
  movsd  %xmm0,-0x18(%rbp)
  mov    -0x70(%rbp),%eax
  sub    $0x1,%eax
  cmp    %eax,-0x78(%rbp)
  jne    L60
  movsd  -0x18(%rbp),%xmm0
  movsd  %xmm0,-0x30(%rbp)
L60:
  mov    -0x70(%rbp),%eax
  sub    $0x1,%eax
  cmp    %eax,-0x78(%rbp)
  jl     L148
  movsd  -0x18(%rbp),%xmm0
  subsd  -0x30(%rbp),%xmm0
  mulsd  -0x20(%rbp),%xmm0
  movsd  -0x30(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x30(%rbp)
  mov    -0x68(%rbp),%rax
  lea    0x8(%rax),%rdx
  mov    %rdx,-0x68(%rbp)
  movsd  -0x18(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x60(%rbp),%rax
  lea    0x8(%rax),%rdx
  mov    %rdx,-0x60(%rbp)
  movsd  -0x30(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x58(%rbp),%rax
  lea    0x8(%rax),%rdx
  mov    %rdx,-0x58(%rbp)
  movsd  -0x18(%rbp),%xmm0
  subsd  -0x30(%rbp),%xmm0
  movsd  %xmm0,(%rax)
L148:
  addl   $0x1,-0x78(%rbp)
L8:
  mov    -0x78(%rbp),%eax
  cmp    -0x84(%rbp),%eax
  jl     L89
  mov    -0xa0(%rbp),%rax
  mov    (%rax),%rdx
  mov    -0x68(%rbp),%rax
  sub    %rdx,%rax
  sar    $0x3,%rax
  mov    %rax,%rbx
  mov    -0x98(%rbp),%rax
  mov    %rax,%rdi
  call   <ti_macd_start@plt>
  mov    %eax,%edx
  mov    -0x84(%rbp),%eax
  sub    %edx,%eax
  cltq
  cmp    %rax,%rbx
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0xa0(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rdx
  mov    -0x60(%rbp),%rax
  sub    %rdx,%rax
  sar    $0x3,%rax
  mov    %rax,%rbx
  mov    -0x98(%rbp),%rax
  mov    %rax,%rdi
  call   <ti_macd_start@plt>
  mov    %eax,%edx
  mov    -0x84(%rbp),%eax
  sub    %edx,%eax
  cltq
  cmp    %rax,%rbx
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0xa0(%rbp),%rax
  add    $0x10,%rax
  mov    (%rax),%rdx
  mov    -0x58(%rbp),%rax
  sub    %rdx,%rax
  sar    $0x3,%rax
  mov    %rax,%rbx
  mov    -0x98(%rbp),%rax
  mov    %rax,%rdi
  call   <ti_macd_start@plt>
  mov    %eax,%edx
  mov    -0x84(%rbp),%eax
  sub    %edx,%eax
  cltq
  cmp    %rax,%rbx
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    $0x0,%eax
L118:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: label: D35
data_type: f64
name: extract_symbolic_data
arguments: label: D27
data_type: f64
name: extract_symbolic_data
arguments: label: D48
data_type: f64
name: extract_symbolic_data
arguments: label: D8
data_type: f64

tool: D35: 1

tool: D27: 2

tool: D48: 0.15

tool: D8: 0.075

assistant: ```c
int ti_macd(int size, double const *const *inputs, double const *options, double *const *outputs) {
  const double *input = inputs[0];
  double *macd = outputs[0];
  double *signal = outputs[1];
  double *hist = outputs[2];
  const int short_period = (int)options[0];
  const int long_period = (int)options[1];
  const int signal_period = (int)options[2];
  if (short_period < 1)
    return 1;
  if (long_period < 2)
    return 1;
  if (long_period < short_period)
    return 1;
  if (signal_period < 1)
    return 1;
  if (size <= ti_macd_start(options))
    return 0;
  double short_per = 2 / ((double)short_period + 1);
  double long_per = 2 / ((double)long_period + 1);
  double signal_per = 2 / ((double)signal_period + 1);
  if (short_period == 12 && long_period == 26) {
    short_per = 0.15;
    long_per = 0.075;
  }
  double short_ema = input[0];
  double long_ema = input[0];
  double signal_ema = 0;
  int i;
  for (i = 1; i < size; ++i) {
    short_ema = (input[i] - short_ema) * short_per + short_ema;
    long_ema = (input[i] - long_ema) * long_per + long_ema;
    const double out = short_ema - long_ema;
    if (i == long_period - 1) {
      signal_ema = out;
    }
    if (i >= long_period - 1) {
      signal_ema = (out - signal_ema) * signal_per + signal_ema;
      *macd++ = out;
      *signal++ = signal_ema;
      *hist++ = out - signal_ema;
    }
  }
  assert(macd - outputs[0] == size - ti_macd_start(options));
  assert(signal - outputs[1] == size - ti_macd_start(options));
  assert(hist - outputs[2] == size - ti_macd_start(options));
  return 0;
}
```