user: Demonstrate the C code that generates the assembly output below:

```asm
<ti_wad>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x68,%rsp
  mov    %edi,-0x54(%rbp)
  mov    %rsi,-0x60(%rbp)
  mov    %rdx,-0x68(%rbp)
  mov    %rcx,-0x70(%rbp)
  mov    -0x60(%rbp),%rax
  mov    (%rax),%rax
  mov    %rax,-0x30(%rbp)
  mov    -0x60(%rbp),%rax
  mov    0x8(%rax),%rax
  mov    %rax,-0x28(%rbp)
  mov    -0x60(%rbp),%rax
  mov    0x10(%rax),%rax
  mov    %rax,-0x20(%rbp)
  mov    -0x68(%rbp),%rax
  mov    %rax,%rdi
  call   <ti_wad_start@plt>
  cmp    %eax,-0x54(%rbp)
  jg     L32
  mov    $0x0,%eax
  jmp    L82
L32:
  mov    -0x70(%rbp),%rax
  mov    (%rax),%rax
  mov    %rax,-0x48(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x40(%rbp)
  mov    -0x20(%rbp),%rax
  movsd  (%rax),%xmm0
  movsd  %xmm0,-0x38(%rbp)
  movl   $0x1,-0x4c(%rbp)
  jmp    L41
L72:
  mov    -0x4c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movsd  %xmm0,-0x18(%rbp)
  movsd  -0x18(%rbp),%xmm0
  comisd -0x38(%rbp),%xmm0
  jbe    L100
  mov    -0x4c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  comisd -0x38(%rbp),%xmm0
  jbe    L106
  movsd  -0x38(%rbp),%xmm0
  jmp    L64
L106:
  mov    -0x4c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
L64:
  movsd  -0x18(%rbp),%xmm1
  subsd  %xmm0,%xmm1
  movsd  -0x40(%rbp),%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x40(%rbp)
  jmp    L93
L100:
  movsd  -0x38(%rbp),%xmm0
  comisd -0x18(%rbp),%xmm0
  jbe    L93
  mov    -0x4c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  movsd  -0x38(%rbp),%xmm0
  comisd %xmm1,%xmm0
  jbe    L29
  movsd  -0x38(%rbp),%xmm0
  jmp    L35
L29:
  mov    -0x4c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
L35:
  movsd  -0x18(%rbp),%xmm1
  subsd  %xmm0,%xmm1
  movsd  -0x40(%rbp),%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x40(%rbp)
L93:
  mov    -0x48(%rbp),%rax
  lea    0x8(%rax),%rdx
  mov    %rdx,-0x48(%rbp)
  movsd  -0x40(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x4c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movsd  %xmm0,-0x38(%rbp)
  addl   $0x1,-0x4c(%rbp)
L41:
  mov    -0x4c(%rbp),%eax
  cmp    -0x54(%rbp),%eax
  jl     L72
  mov    -0x70(%rbp),%rax
  mov    (%rax),%rdx
  mov    -0x48(%rbp),%rax
  sub    %rdx,%rax
  sar    $0x3,%rax
  mov    %rax,%rbx
  mov    -0x68(%rbp),%rax
  mov    %rax,%rdi
  call   <ti_wad_start@plt>
  mov    %eax,%edx
  mov    -0x54(%rbp),%eax
  sub    %edx,%eax
  cltq
  cmp    %rax,%rbx
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    $0x0,%eax
L82:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

assistant: ```c
int ti_wad(int size, double const *const *inputs, double const *options, double *const *outputs) {
  const double *high = inputs[0];
  const double *low = inputs[1];
  const double *close = inputs[2];
  (void)options;
  if (size <= ti_wad_start(options))
    return 0;
  double *output = outputs[0];
  double sum = 0;
  double yc = close[0];
  int i;
  for (i = 1; i < size; ++i) {
    const double c = close[i];
    if (c > yc) {
      sum += c - ((yc) < (low[i]) ? (yc) : (low[i]));
    } else if (c < yc) {
      sum += c - ((yc) > (high[i]) ? (yc) : (high[i]));
    } else {
    }
    *output++ = sum;
    yc = close[i];
  }
  assert(output - outputs[0] == size - ti_wad_start(options));
  return 0;
}
```