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

```asm
<ti_volatility>:
  endbr64
  push   %r15
  mov    $0x1,%eax
  push   %r14
  mov    %rdx,%r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x58,%rsp
  cvttsd2si (%rdx),%ebx
  test   %ebx,%ebx
  jle    L72
  mov    %edi,%r13d
  mov    %rdx,%rdi
  mov    %rcx,0x8(%rsp)
  mov    (%rsi),%rbp
  mov    (%rcx),%r15
  call   <ti_volatility_start@plt>
  mov    %eax,%r8d
  xor    %eax,%eax
  cmp    %r13d,%r8d
  jge    L72
  cmp    $0x1,%ebx
  mov    0x8(%rsp),%rdx
  je     L29
  mov    %ebx,%ecx
  pxor   %xmm7,%xmm7
  movapd D2(%rip),%xmm3
  mov    %rbp,%rax
  shr    %ecx
  movapd %xmm7,%xmm6
  movapd %xmm7,%xmm2
  sub    $0x1,%ecx
  shl    $0x4,%rcx
  lea    0x10(%rbp,%rcx,1),%rcx
  nop
L99:
  movupd 0x8(%rax),%xmm0
  movupd (%rax),%xmm4
  add    $0x10,%rax
  divpd  %xmm4,%xmm0
  addpd  %xmm3,%xmm0
  movapd %xmm0,%xmm1
  movapd %xmm0,%xmm5
  mulpd  %xmm0,%xmm0
  addsd  %xmm2,%xmm1
  unpckhpd %xmm5,%xmm5
  movapd %xmm5,%xmm2
  addsd  %xmm1,%xmm2
  movapd %xmm0,%xmm1
  unpckhpd %xmm0,%xmm0
  addsd  %xmm6,%xmm1
  movapd %xmm0,%xmm6
  addsd  %xmm1,%xmm6
  cmp    %rcx,%rax
  jne    L99
  mov    %ebx,%eax
  movsd  D6(%rip),%xmm3
  or     $0x1,%eax
  test   $0x1,%bl
  je     L122
L82:
  movsd  D6(%rip),%xmm3
  cltq
  movsd  0x0(%rbp,%rax,8),%xmm0
  divsd  -0x8(%rbp,%rax,8),%xmm0
  subsd  %xmm3,%xmm0
  addsd  %xmm0,%xmm2
  mulsd  %xmm0,%xmm0
  addsd  %xmm0,%xmm6
L122:
  pxor   %xmm0,%xmm0
  movapd %xmm3,%xmm4
  cvtsi2sd %ebx,%xmm0
  divsd  %xmm0,%xmm4
  movapd %xmm4,%xmm1
  movapd %xmm4,%xmm0
  mulsd  %xmm2,%xmm1
  mulsd  %xmm6,%xmm0
  mulsd  %xmm1,%xmm1
  subsd  %xmm1,%xmm0
  ucomisd %xmm0,%xmm7
  ja     L112
  sqrtsd %xmm0,%xmm0
L8:
  movsd  D10(%rip),%xmm5
  lea    0x1(%rbx),%eax
  lea    0x8(%r15),%rcx
  mulsd  %xmm5,%xmm0
  movsd  %xmm0,(%r15)
  cmp    %eax,%r13d
  jle    L44
  lea    -0x2(%r13),%esi
  sub    %ebx,%esi
  movslq %ebx,%rbx
  lea    0x0(%rbp,%rbx,8),%r12
  lea    0x10(,%rsi,8),%rax
  mov    $0x8,%ebx
  nopl   0x0(%rax)
L2:
  movsd  (%r12,%rbx,1),%xmm1
  divsd  -0x8(%r12,%rbx,1),%xmm1
  movapd %xmm1,%xmm0
  movsd  0x0(%rbp,%rbx,1),%xmm1
  subsd  %xmm3,%xmm0
  divsd  -0x8(%rbp,%rbx,1),%xmm1
  subsd  %xmm3,%xmm1
  addsd  %xmm0,%xmm2
  mulsd  %xmm0,%xmm0
  subsd  %xmm1,%xmm2
  mulsd  %xmm1,%xmm1
  addsd  %xmm0,%xmm6
  movapd %xmm4,%xmm0
  subsd  %xmm1,%xmm6
  movapd %xmm4,%xmm1
  mulsd  %xmm2,%xmm1
  mulsd  %xmm6,%xmm0
  mulsd  %xmm1,%xmm1
  subsd  %xmm1,%xmm0
  ucomisd %xmm0,%xmm7
  ja     L1
  sqrtsd %xmm0,%xmm0
  mulsd  %xmm5,%xmm0
  movsd  %xmm0,(%r15,%rbx,1)
  add    $0x8,%rbx
  cmp    %rbx,%rax
  jne    L2
L61:
  lea    0x8(%rcx,%rsi,8),%rcx
L44:
  sub    (%rdx),%rcx
  mov    %r14,%rdi
  sar    $0x3,%rcx
  mov    %rcx,%rbx
  call   <ti_volatility_start@plt>
  xor    %edi,%edi
  sub    %eax,%r13d
  movslq %r13d,%r13
  cmp    %rbx,%r13
  sete   %dil
  call   <assert@plt>
  xor    %eax,%eax
L72:
  add    $0x58,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  cs nopw 0x0(%rax,%rax,1)
L29:
  pxor   %xmm7,%xmm7
  mov    $0x1,%eax
  movapd %xmm7,%xmm6
  movapd %xmm7,%xmm2
  jmp    L82
L1:
  mov    %rdx,0x38(%rsp)
  mov    %rcx,0x18(%rsp)
  mov    %rax,0x10(%rsp)
  mov    %rsi,0x8(%rsp)
  movsd  %xmm3,0x48(%rsp)
  movsd  %xmm7,0x40(%rsp)
  movsd  %xmm6,0x30(%rsp)
  movsd  %xmm2,0x28(%rsp)
  movsd  %xmm4,0x20(%rsp)
  call   <sqrt@plt>
  mov    0x8(%rsp),%rsi
  mov    0x18(%rsp),%rcx
  mov    D10(%rip),%rax
  movsd  0x20(%rsp),%xmm4
  movsd  0x28(%rsp),%xmm2
  movsd  0x30(%rsp),%xmm6
  movq   %rax,%xmm5
  mov    0x10(%rsp),%rax
  mov    0x38(%rsp),%rdx
  mulsd  %xmm5,%xmm0
  movsd  0x40(%rsp),%xmm7
  movsd  0x48(%rsp),%xmm3
  movsd  %xmm0,(%r15,%rbx,1)
  add    $0x8,%rbx
  cmp    %rbx,%rax
  jne    L2
  jmp    L61
L112:
  mov    %rdx,0x20(%rsp)
  movsd  %xmm3,0x30(%rsp)
  movsd  %xmm7,0x28(%rsp)
  movsd  %xmm6,0x18(%rsp)
  movsd  %xmm2,0x10(%rsp)
  movsd  %xmm4,0x8(%rsp)
  call   <sqrt@plt>
  movsd  0x30(%rsp),%xmm3
  mov    0x20(%rsp),%rdx
  movsd  0x28(%rsp),%xmm7
  movsd  0x18(%rsp),%xmm6
  movsd  0x10(%rsp),%xmm2
  movsd  0x8(%rsp),%xmm4
  jmp    L8
```

tool_calls: name: retrieve_data
arguments: data_label: D2
type_guessed: f32[4]
name: retrieve_data
arguments: data_label: D6
type_guessed: f64
name: retrieve_data
arguments: data_label: D10
type_guessed: byte[8]

tool: {"D2": [0.0,-1.875,0.0,-1.875]}

tool: D6: 1

tool: {"D10": [0x5f,0x75,0xbc,0x7e,0xbf,0xbf,0x2f,0x40]}

assistant: ```c
int ti_volatility(int size, double const *const *inputs, double const *options, double *const *outputs) {
  const double *input = inputs[0];
  double *output = outputs[0];
  const int period = (int)options[0];
  const double scale = 1.0 / period;
  const double annual = sqrt(252);
  if (period < 1)
    return 1;
  if (size <= ti_volatility_start(options))
    return 0;
  double sum = 0;
  double sum2 = 0;
  int i;
  for (i = 1; i <= period; ++i) {
    const double c = (input[i] / input[i - 1] - 1.0);
    sum += c;
    sum2 += c * c;
  }
  *output++ = sqrt(sum2 * scale - (sum * scale) * (sum * scale)) * annual;
  for (i = period + 1; i < size; ++i) {
    const double c = (input[i] / input[i - 1] - 1.0);
    sum += c;
    sum2 += c * c;
    const double cp = (input[i - period] / input[i - period - 1] - 1.0);
    sum -= cp;
    sum2 -= cp * cp;
    *output++ = sqrt(sum2 * scale - (sum * scale) * (sum * scale)) * annual;
  }
  assert(output - outputs[0] == size - ti_volatility_start(options));
  return 0;
}
```