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

```asm
<ti_di>:
  endbr64
  push   %r15
  mov    $0x1,%eax
  push   %r14
  mov    %rdx,%r14
  mov    %rcx,%rdx
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  cvttsd2si (%r14),%ecx
  test   %ecx,%ecx
  mov    %ecx,0x8(%rsp)
  jle    L101
  mov    0x8(%rdx),%r8
  mov    %edi,%r12d
  mov    %r14,%rdi
  mov    %rdx,0x18(%rsp)
  mov    (%rsi),%rbx
  mov    0x8(%rsi),%rbp
  mov    0x10(%rsi),%r13
  mov    (%rdx),%r15
  mov    %r8,0x10(%rsp)
  call   <ti_di_start@plt>
  mov    %eax,%r9d
  xor    %eax,%eax
  cmp    %r12d,%r9d
  jge    L101
  mov    0x8(%rsp),%ecx
  pxor   %xmm0,%xmm0
  mov    0x10(%rsp),%r8
  mov    0x18(%rsp),%rdx
  cvtsi2sd %ecx,%xmm0
  cmp    $0x1,%ecx
  movapd %xmm0,%xmm7
  subsd  D35(%rip),%xmm7
  divsd  %xmm0,%xmm7
  je     L156
  pxor   %xmm5,%xmm5
  movq   D5(%rip),%xmm6
  lea    -0x1(%rcx),%esi
  xor    %eax,%eax
  movapd %xmm5,%xmm3
  movapd %xmm5,%xmm2
  movapd %xmm5,%xmm1
  jmp    L19
  nopl   0x0(%rax)
L126:
  comisd %xmm4,%xmm0
  jbe    L162
  movapd %xmm5,%xmm4
L70:
  movapd %xmm0,%xmm8
  cmpnltsd %xmm4,%xmm8
  andpd  %xmm8,%xmm0
L2:
  add    $0x1,%rax
  addsd  %xmm0,%xmm2
  addsd  %xmm4,%xmm3
  cmp    %rax,%rsi
  je     L91
L19:
  movsd  0x8(%rbp,%rax,8),%xmm8
  movsd  0x8(%rbx,%rax,8),%xmm0
  movsd  0x0(%r13,%rax,8),%xmm4
  movapd %xmm0,%xmm10
  movapd %xmm8,%xmm9
  subsd  %xmm4,%xmm10
  subsd  %xmm4,%xmm9
  movapd %xmm0,%xmm4
  subsd  %xmm8,%xmm4
  subsd  (%rbx,%rax,8),%xmm0
  andpd  %xmm6,%xmm10
  andpd  %xmm6,%xmm9
  maxsd  %xmm4,%xmm10
  comisd %xmm0,%xmm5
  movsd  0x0(%rbp,%rax,8),%xmm4
  subsd  %xmm8,%xmm4
  maxsd  %xmm10,%xmm9
  addsd  %xmm9,%xmm1
  jbe    L126
  movapd %xmm5,%xmm0
L162:
  comisd %xmm4,%xmm5
  jbe    L70
  movapd %xmm5,%xmm4
  jmp    L2
  cs nopw 0x0(%rax,%rax,1)
L142:
  lea    -0x1(%r12),%eax
  sub    %ecx,%eax
  lea    0x8(,%rax,8),%rax
  add    %rax,%rdi
  add    %rax,%rsi
L109:
  sub    (%rdx),%rdi
  mov    %rsi,0x10(%rsp)
  sar    $0x3,%rdi
  mov    %rdx,0x8(%rsp)
  mov    %rdi,%rbx
  mov    %r14,%rdi
  call   <ti_di_start@plt>
  xor    %edi,%edi
  mov    %eax,%r8d
  mov    %r12d,%eax
  sub    %r8d,%eax
  cltq
  cmp    %rbx,%rax
  sete   %dil
  call   <assert@plt>
  mov    0x8(%rsp),%rdx
  mov    0x10(%rsp),%rsi
  mov    %r14,%rdi
  sub    0x8(%rdx),%rsi
  sar    $0x3,%rsi
  mov    %rsi,%rbx
  call   <ti_di_start@plt>
  xor    %edi,%edi
  sub    %eax,%r12d
  movslq %r12d,%r12
  cmp    %rbx,%r12
  sete   %dil
  call   <assert@plt>
  xor    %eax,%eax
L101:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L91:
  movsd  D45(%rip),%xmm8
  movapd %xmm2,%xmm0
  mulsd  %xmm8,%xmm0
  mulsd  %xmm3,%xmm8
L29:
  divsd  %xmm1,%xmm0
  lea    0x8(%r15),%rdi
  lea    0x8(%r8),%rsi
  divsd  %xmm1,%xmm8
  movsd  %xmm0,(%r15)
  movsd  %xmm8,(%r8)
  cmp    %r12d,%ecx
  jge    L109
  movslq %ecx,%rax
  movq   D5(%rip),%xmm6
  movsd  D45(%rip),%xmm8
  mov    %rax,%r9
  neg    %r9
  shl    $0x3,%r9
  add    %r9,%r15
  add    %r9,%r8
  jmp    L129
  nopl   0x0(%rax)
L157:
  comisd %xmm4,%xmm0
  jbe    L139
  movapd %xmm5,%xmm4
L38:
  movapd %xmm0,%xmm9
  cmpnltsd %xmm4,%xmm9
  andpd  %xmm9,%xmm0
L98:
  mulsd  %xmm7,%xmm2
  mulsd  %xmm7,%xmm3
  addsd  %xmm0,%xmm2
  addsd  %xmm4,%xmm3
  movapd %xmm2,%xmm0
  mulsd  %xmm8,%xmm0
  divsd  %xmm1,%xmm0
  movsd  %xmm0,0x8(%r15,%rax,8)
  movapd %xmm3,%xmm0
  mulsd  %xmm8,%xmm0
  divsd  %xmm1,%xmm0
  movsd  %xmm0,0x8(%r8,%rax,8)
  add    $0x1,%rax
  cmp    %eax,%r12d
  jle    L142
L129:
  movsd  0x0(%rbp,%rax,8),%xmm9
  movsd  (%rbx,%rax,8),%xmm0
  mulsd  %xmm7,%xmm1
  movsd  -0x8(%r13,%rax,8),%xmm4
  movapd %xmm0,%xmm11
  movapd %xmm9,%xmm10
  subsd  %xmm4,%xmm11
  subsd  %xmm4,%xmm10
  movapd %xmm0,%xmm4
  subsd  %xmm9,%xmm4
  subsd  -0x8(%rbx,%rax,8),%xmm0
  andpd  %xmm6,%xmm11
  andpd  %xmm6,%xmm10
  maxsd  %xmm4,%xmm11
  comisd %xmm0,%xmm5
  movsd  -0x8(%rbp,%rax,8),%xmm4
  subsd  %xmm9,%xmm4
  maxsd  %xmm11,%xmm10
  addsd  %xmm10,%xmm1
  jbe    L157
  movapd %xmm5,%xmm0
L139:
  comisd %xmm4,%xmm5
  jbe    L38
  movapd %xmm5,%xmm4
  jmp    L98
  nopw   0x0(%rax,%rax,1)
L156:
  pxor   %xmm5,%xmm5
  movapd %xmm5,%xmm8
  movapd %xmm5,%xmm0
  movapd %xmm5,%xmm3
  movapd %xmm5,%xmm2
  movapd %xmm5,%xmm1
  jmp    L29
```

tool_calls: name: unpack_data
arguments: label: D35
type: f32[2]
name: unpack_data
arguments: label: D5
type: qword
name: unpack_data
arguments: label: D45
type: f64

tool: {"D35": [0.0,1.875]}

tool: D5: 9223372036854775807

tool: D45: 100

assistant: ```c
int ti_di(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];
  const int period = (int)options[0];
  double *plus_di = outputs[0];
  double *minus_di = outputs[1];
  if (period < 1)
    return 1;
  if (size <= ti_di_start(options))
    return 0;
  const double per = ((double)period - 1) / ((double)period);
  double atr = 0;
  double dmup = 0;
  double dmdown = 0;
  int i;
  for (i = 1; i < period; ++i) {
    double truerange;
    do {
      const double l = low[i];
      const double h = high[i];
      const double c = close[i - 1];
      const double ych = fabs(h - c);
      const double ycl = fabs(l - c);
      double v = h - l;
      if (ych > v)
        v = ych;
      if (ycl > v)
        v = ycl;
      truerange = v;
    } while (0);
    atr += truerange;
    double dp, dm;
    do {
      dp = high[i] - high[i - 1];
      dm = low[i - 1] - low[i];
      if (dp < 0)
        dp = 0;
      else if (dp > dm)
        dm = 0;
      if (dm < 0)
        dm = 0;
      else if (dm > dp)
        dp = 0;
    } while (0);
    dmup += dp;
    dmdown += dm;
  }
  *plus_di++ = 100.0 * dmup / atr;
  *minus_di++ = 100.0 * dmdown / atr;
  for (i = period; i < size; ++i) {
    double truerange;
    do {
      const double l = low[i];
      const double h = high[i];
      const double c = close[i - 1];
      const double ych = fabs(h - c);
      const double ycl = fabs(l - c);
      double v = h - l;
      if (ych > v)
        v = ych;
      if (ycl > v)
        v = ycl;
      truerange = v;
    } while (0);
    atr = atr * per + truerange;
    double dp, dm;
    do {
      dp = high[i] - high[i - 1];
      dm = low[i - 1] - low[i];
      if (dp < 0)
        dp = 0;
      else if (dp > dm)
        dm = 0;
      if (dm < 0)
        dm = 0;
      else if (dm > dp)
        dp = 0;
    } while (0);
    dmup = dmup * per + dp;
    dmdown = dmdown * per + dm;
    *plus_di++ = 100.0 * dmup / atr;
    *minus_di++ = 100.0 * dmdown / atr;
  }
  assert(plus_di - outputs[0] == size - ti_di_start(options));
  assert(minus_di - outputs[1] == size - ti_di_start(options));
  return 0;
}
```