user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<ti_volatility>:
  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,-0x40(%rbp)
  mov    -0x80(%rbp),%rax
  mov    (%rax),%rax
  mov    %rax,-0x58(%rbp)
  mov    -0x78(%rbp),%rax
  movsd  (%rax),%xmm0
  cvttsd2si %xmm0,%eax
  mov    %eax,-0x5c(%rbp)
  pxor   %xmm1,%xmm1
  cvtsi2sdl -0x5c(%rbp),%xmm1
  movsd  D36(%rip),%xmm0
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x38(%rbp)
  movsd  D40(%rip),%xmm0
  movsd  %xmm0,-0x30(%rbp)
  cmpl   $0x0,-0x5c(%rbp)
  jg     L4
  mov    $0x1,%eax
  jmp    L70
L4:
  mov    -0x78(%rbp),%rax
  mov    %rax,%rdi
  call   <ti_volatility_start@plt>
  cmp    %eax,-0x64(%rbp)
  jg     L28
  mov    $0x0,%eax
  jmp    L70
L28:
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x50(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x48(%rbp)
  movl   $0x1,-0x60(%rbp)
  jmp    L63
L59:
  mov    -0x60(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x60(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  divsd  %xmm1,%xmm0
  movsd  D36(%rip),%xmm1
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x18(%rbp)
  movsd  -0x50(%rbp),%xmm0
  addsd  -0x18(%rbp),%xmm0
  movsd  %xmm0,-0x50(%rbp)
  movsd  -0x18(%rbp),%xmm0
  mulsd  %xmm0,%xmm0
  movsd  -0x48(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x48(%rbp)
  addl   $0x1,-0x60(%rbp)
L63:
  mov    -0x60(%rbp),%eax
  cmp    -0x5c(%rbp),%eax
  jle    L59
  movsd  -0x48(%rbp),%xmm0
  mulsd  -0x38(%rbp),%xmm0
  movsd  -0x50(%rbp),%xmm1
  movapd %xmm1,%xmm2
  mulsd  -0x38(%rbp),%xmm2
  movsd  -0x50(%rbp),%xmm1
  mulsd  -0x38(%rbp),%xmm1
  mulsd  %xmm2,%xmm1
  subsd  %xmm1,%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  call   <sqrt@plt>
  movq   %xmm0,%rdx
  mov    -0x58(%rbp),%rax
  lea    0x8(%rax),%rcx
  mov    %rcx,-0x58(%rbp)
  movq   %rdx,%xmm0
  mulsd  -0x30(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x5c(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x60(%rbp)
  jmp    L52
L21:
  mov    -0x60(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x60(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  divsd  %xmm1,%xmm0
  movsd  D36(%rip),%xmm1
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x28(%rbp)
  movsd  -0x50(%rbp),%xmm0
  addsd  -0x28(%rbp),%xmm0
  movsd  %xmm0,-0x50(%rbp)
  movsd  -0x28(%rbp),%xmm0
  mulsd  %xmm0,%xmm0
  movsd  -0x48(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x48(%rbp)
  mov    -0x60(%rbp),%eax
  sub    -0x5c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x60(%rbp),%eax
  sub    -0x5c(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  divsd  %xmm1,%xmm0
  movsd  D36(%rip),%xmm1
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x20(%rbp)
  movsd  -0x50(%rbp),%xmm0
  subsd  -0x20(%rbp),%xmm0
  movsd  %xmm0,-0x50(%rbp)
  movsd  -0x20(%rbp),%xmm0
  movapd %xmm0,%xmm1
  mulsd  %xmm0,%xmm1
  movsd  -0x48(%rbp),%xmm0
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x48(%rbp)
  movsd  -0x48(%rbp),%xmm0
  mulsd  -0x38(%rbp),%xmm0
  movsd  -0x50(%rbp),%xmm1
  movapd %xmm1,%xmm2
  mulsd  -0x38(%rbp),%xmm2
  movsd  -0x50(%rbp),%xmm1
  mulsd  -0x38(%rbp),%xmm1
  mulsd  %xmm2,%xmm1
  subsd  %xmm1,%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  call   <sqrt@plt>
  movq   %xmm0,%rdx
  mov    -0x58(%rbp),%rax
  lea    0x8(%rax),%rcx
  mov    %rcx,-0x58(%rbp)
  movq   %rdx,%xmm0
  mulsd  -0x30(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x60(%rbp)
L52:
  mov    -0x60(%rbp),%eax
  cmp    -0x64(%rbp),%eax
  jl     L21
  mov    -0x80(%rbp),%rax
  mov    (%rax),%rdx
  mov    -0x58(%rbp),%rax
  sub    %rdx,%rax
  sar    $0x3,%rax
  mov    %rax,%rbx
  mov    -0x78(%rbp),%rax
  mov    %rax,%rdi
  call   <ti_volatility_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
L70:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: label: D36
datatype: f64
name: retrieve_data
arguments: label: D40
datatype: byte[8]

tool: D36: 1

tool: {"D40": [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;
}
```