user: 请从给定的汇编指令推导出C源代码：

```asm
<ti_aroonosc>:
  endbr64
  push   %r15
  mov    $0x1,%eax
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  cvttsd2si (%rdx),%r14d
  mov    %edi,0x10(%rsp)
  mov    %rcx,0x8(%rsp)
  mov    %r14d,0x14(%rsp)
  test   %r14d,%r14d
  jle    L150
  mov    %edi,%r15d
  mov    %rdx,%rdi
  mov    (%rsi),%rbx
  mov    0x8(%rsi),%rbp
  mov    (%rcx),%r12
  mov    %rdx,%r13
  call   <ti_aroon_start@plt>
  mov    %eax,%r8d
  xor    %eax,%eax
  cmp    %r15d,%r8d
  jge    L150
  pxor   %xmm0,%xmm0
  movsd  (%rbx),%xmm1
  movsd  0x0(%rbp),%xmm2
  cvtsi2sd %r14d,%xmm0
  movsd  D5(%rip),%xmm4
  divsd  %xmm0,%xmm4
  cmp    %r15d,%r14d
  jge    L124
  mov    %r13,0x18(%rsp)
  movslq %r14d,%rcx
  sub    %r14d,%r15d
  xor    %esi,%esi
  mov    $0xffffffff,%r9d
  mov    $0xffffffff,%r8d
  xor    %edi,%edi
  jmp    L101
  nopl   (%rax)
L5:
  sub    %r9d,%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
L215:
  mulsd  %xmm4,%xmm0
  add    $0x1,%rcx
  movsd  %xmm0,(%r12,%rsi,8)
  add    $0x1,%rsi
  cmp    %edi,%r15d
  je     L74
L101:
  mov    %edi,%r14d
  movsd  (%rbx,%rcx,8),%xmm0
  mov    %ecx,%r13d
  add    $0x1,%edi
  mov    %esi,%r11d
  cmp    %r8d,%esi
  jg     L202
  comisd %xmm1,%xmm0
  jb     L3
  movapd %xmm0,%xmm1
  mov    %ecx,%r8d
L3:
  cmp    %r9d,%r11d
  jg     L120
L112:
  movsd  0x0(%rbp,%rcx,8),%xmm3
L55:
  comisd %xmm3,%xmm2
  mov    %r8d,%eax
  jb     L5
  sub    %r13d,%eax
  pxor   %xmm0,%xmm0
  movapd %xmm3,%xmm2
  mov    %r13d,%r9d
  cvtsi2sd %eax,%xmm0
  jmp    L215
  nopl   (%rax)
L74:
  mov    0x10(%rsp),%eax
  mov    0x18(%rsp),%r13
  sub    $0x1,%eax
  sub    0x14(%rsp),%eax
  lea    0x8(%r12,%rax,8),%r12
L124:
  mov    0x8(%rsp),%rax
  mov    %r13,%rdi
  sub    (%rax),%r12
  call   <ti_aroonosc_start@plt>
  sar    $0x3,%r12
  xor    %edi,%edi
  mov    %eax,%r8d
  mov    0x10(%rsp),%eax
  sub    %r8d,%eax
  cltq
  cmp    %r12,%rax
  sete   %dil
  call   <assert@plt>
  xor    %eax,%eax
L150:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L202:
  movsd  (%rbx,%rsi,8),%xmm1
  mov    %ecx,%r10d
  cmp    %edi,%ecx
  jl     L127
  movslq %edi,%rax
  mov    %r14d,%r8d
  mov    %rax,%rdx
  nopl   0x0(%rax)
L80:
  movsd  (%rbx,%rdx,8),%xmm0
  comisd %xmm1,%xmm0
  jb     L30
  movapd %xmm0,%xmm1
  mov    %edx,%r8d
L30:
  add    $0x1,%rdx
  cmp    %edx,%r10d
  jge    L80
  cmp    %r9d,%r11d
  jle    L112
  movsd  0x0(%rbp,%rsi,8),%xmm2
L206:
  mov    %r14d,%r9d
  nopl   (%rax)
L75:
  movsd  0x0(%rbp,%rax,8),%xmm0
  comisd %xmm0,%xmm2
  jb     L209
  movapd %xmm0,%xmm2
  mov    %eax,%r9d
L209:
  add    $0x1,%rax
  cmp    %eax,%ecx
  jge    L75
  mov    %r8d,%eax
  pxor   %xmm0,%xmm0
  sub    %r9d,%eax
  cvtsi2sd %eax,%xmm0
  jmp    L215
  xchg   %ax,%ax
L120:
  movsd  0x0(%rbp,%rsi,8),%xmm2
  movslq %edi,%rax
  cmp    %ecx,%edi
  jle    L206
  mov    %r8d,%eax
  pxor   %xmm0,%xmm0
  mov    %r14d,%r9d
  sub    %r14d,%eax
  cvtsi2sd %eax,%xmm0
  jmp    L215
  nopl   0x0(%rax,%rax,1)
L127:
  cmp    %r9d,%esi
  jg     L132
  movsd  0x0(%rbp,%rcx,8),%xmm3
  mov    %r14d,%r8d
  jmp    L55
L132:
  movsd  0x0(%rbp,%rsi,8),%xmm2
  mov    %r14d,%r8d
  mov    %r14d,%r9d
  pxor   %xmm0,%xmm0
  jmp    L215
```

tool_calls: name: unpack_data
arguments: label: D5
type: f64

tool: D5: 100

assistant: ```c
int ti_aroonosc(int size, double const *const *inputs, double const *options, double *const *outputs) {
  const double *high = inputs[0];
  const double *low = inputs[1];
  double *output = outputs[0];
  const int period = (int)options[0];
  if (period < 1)
    return 1;
  if (size <= ti_aroon_start(options))
    return 0;
  const double scale = 100.0 / period;
  int trail = 0, maxi = -1, mini = -1;
  double max = high[0];
  double min = low[0];
  int i, j;
  for (i = period; i < size; ++i, ++trail) {
    double bar = high[i];
    if (maxi < trail) {
      maxi = trail;
      max = high[maxi];
      j = trail;
      while (++j <= i) {
        bar = high[j];
        if (bar >= max) {
          max = bar;
          maxi = j;
        }
      }
    } else if (bar >= max) {
      maxi = i;
      max = bar;
    }
    bar = low[i];
    if (mini < trail) {
      mini = trail;
      min = low[mini];
      j = trail;
      while (++j <= i) {
        bar = low[j];
        if (bar <= min) {
          min = bar;
          mini = j;
        }
      }
    } else if (bar <= min) {
      mini = i;
      min = bar;
    }
    *output++ = (maxi - mini) * scale;
  }
  assert(output - outputs[0] == size - ti_aroonosc_start(options));
  return 0;
}
```