user: Converte this assembly snippet into its equivalent C code:

```asm
<ddst>:
  endbr64
  push   %r15
  mov    %esi,%r9d
  push   %r14
  push   %r13
  mov    %r8,%r13
  push   %r12
  mov    %edi,%r12d
  push   %rbp
  mov    %rdx,%rbp
  push   %rbx
  mov    %rcx,%rbx
  sub    $0x18,%rsp
  mov    (%rcx),%r14d
  lea    0x0(,%r14,4),%eax
  cmp    %edi,%eax
  jl     L80
L159:
  mov    0x4(%rbx),%r15d
  movslq %r14d,%r14
  lea    0x0(%r13,%r14,8),%r14
  cmp    %r15d,%r12d
  jg     L66
L58:
  movslq %r12d,%rax
  lea    -0x8(%rbp,%rax,8),%r8
  test   %r9d,%r9d
  js     L84
  mov    %r14,%rcx
  mov    %r15d,%edx
  mov    %rbp,%rsi
  mov    %r12d,%edi
  mov    %r8,0x8(%rsp)
  call   <dstsub@plt>
  cmp    $0x4,%r12d
  mov    0x8(%rsp),%r8
  jg     L144
  je     L158
  movsd  0x0(%rbp),%xmm0
  movsd  0x8(%rbp),%xmm1
  movq   D4(%rip),%xmm3
  movapd %xmm0,%xmm4
  addsd  %xmm1,%xmm0
  subsd  %xmm1,%xmm4
  movsd  %xmm0,0x0(%rbp)
  cmp    $0x3,%r12d
  jne    L153
L75:
  movq   D4(%rip),%xmm3
  lea    0x8(%rbp),%rax
  mov    $0x2,%edx
  nop
L140:
  movsd  0x8(%rax),%xmm0
  movsd  0x10(%rax),%xmm2
  add    $0x2,%edx
  add    $0x10,%rax
  movapd %xmm0,%xmm1
  subsd  %xmm2,%xmm0
  xorpd  %xmm3,%xmm1
  subsd  %xmm2,%xmm1
  movsd  %xmm0,-0x8(%rax)
  movsd  %xmm1,-0x10(%rax)
  cmp    %edx,%r12d
  jg     L140
L153:
  xorpd  %xmm4,%xmm3
  movsd  %xmm3,(%r8)
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L84:
  lea    -0x2(%r12),%eax
  movsd  (%r8),%xmm4
  cmp    $0x1,%eax
  jle    L160
  cltq
  lea    -0x4(%r12),%esi
  movq   D4(%rip),%xmm3
  lea    0x0(,%rax,8),%rdx
  shr    %esi
  lea    0x0(%rbp,%rdx,1),%rax
  shl    $0x4,%rsi
  lea    -0x10(%rbp,%rdx,1),%rdx
  sub    %rsi,%rdx
  nopl   0x0(%rax)
L27:
  movsd  (%rax),%xmm0
  movsd  -0x8(%rax),%xmm2
  sub    $0x10,%rax
  movapd %xmm0,%xmm1
  subsd  %xmm2,%xmm0
  xorpd  %xmm3,%xmm1
  subsd  %xmm2,%xmm1
  movsd  %xmm0,0x10(%rax)
  movsd  %xmm1,0x18(%rax)
  cmp    %rax,%rdx
  jne    L27
L160:
  movsd  0x0(%rbp),%xmm0
  movapd %xmm0,%xmm1
  subsd  %xmm4,%xmm0
  addsd  %xmm4,%xmm1
  movsd  %xmm0,0x0(%rbp)
  movsd  %xmm1,0x8(%rbp)
  cmp    $0x4,%r12d
  jg     L9
  je     L115
L61:
  add    $0x18,%rsp
  mov    %r14,%rcx
  mov    %r15d,%edx
  mov    %rbp,%rsi
  pop    %rbx
  mov    %r12d,%edi
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1100 <dstsub@plt>
  cs nopw 0x0(%rax,%rax,1)
L66:
  mov    %r14,%rdx
  mov    %rbx,%rsi
  mov    %r12d,%edi
  mov    %r9d,0x8(%rsp)
  call   <makect@plt>
  mov    %r12d,%r15d
  mov    0x8(%rsp),%r9d
  jmp    L58
L80:
  mov    %edi,%r14d
  mov    %esi,0x8(%rsp)
  mov    %r8,%rdx
  mov    %rcx,%rsi
  sar    $0x2,%r14d
  mov    %r14d,%edi
  call   <makewt@plt>
  mov    0x8(%rsp),%r9d
  jmp    L159
  nopl   0x0(%rax,%rax,1)
L144:
  lea    0x8(%rbx),%rsi
  mov    %rbp,%rdx
  mov    %r12d,%edi
  mov    %r8,0x8(%rsp)
  call   <bitrv2@plt>
  mov    %r13,%rdx
  mov    %rbp,%rsi
  mov    %r12d,%edi
  call   <cftfsub@plt>
  mov    %r14,%rcx
  mov    %r15d,%edx
  mov    %rbp,%rsi
  mov    %r12d,%edi
  call   <rftfsub@plt>
  mov    0x8(%rsp),%r8
L105:
  movsd  0x0(%rbp),%xmm1
  movsd  0x8(%rbp),%xmm0
  movapd %xmm1,%xmm4
  subsd  %xmm0,%xmm4
  addsd  %xmm1,%xmm0
  movsd  %xmm0,0x0(%rbp)
  jmp    L75
L9:
  mov    %r14,%rcx
  mov    %r15d,%edx
  mov    %rbp,%rsi
  mov    %r12d,%edi
  call   <rftbsub@plt>
  lea    0x8(%rbx),%rsi
  mov    %rbp,%rdx
  mov    %r12d,%edi
  call   <bitrv2@plt>
  mov    %r13,%rdx
  mov    %rbp,%rsi
  mov    %r12d,%edi
  call   <cftbsub@plt>
  jmp    L61
  nopl   0x0(%rax,%rax,1)
L158:
  mov    %r13,%rdx
  mov    %rbp,%rsi
  mov    $0x4,%edi
  mov    %r8,0x8(%rsp)
  call   <cftfsub@plt>
  mov    0x8(%rsp),%r8
  jmp    L105
  nopl   0x0(%rax)
L115:
  mov    %r13,%rdx
  mov    %rbp,%rsi
  mov    $0x4,%edi
  call   <cftfsub@plt>
  jmp    L61
```

tool_calls: name: read_data
arguments: data_tag: D4
type_guessed: byte[8]

tool: {"D4": [0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80]}

assistant: ```c
void ddst(int n, int isgn, double *a, int *ip, double *w) {
  int j, nw, nc;
  double xr;
  nw = ip[0];
  if (n > (nw << 2)) {
    nw = n >> 2;
    makewt(nw, ip, w);
  }
  nc = ip[1];
  if (n > nc) {
    nc = n;
    makect(nc, ip, w + nw);
  }
  if (isgn < 0) {
    xr = a[n - 1];
    for (j = n - 2; j >= 2; j -= 2) {
      a[j + 1] = -a[j] - a[j - 1];
      a[j] -= a[j - 1];
    }
    a[1] = a[0] + xr;
    a[0] -= xr;
    if (n > 4) {
      rftbsub(n, a, nc, w + nw);
      bitrv2(n, ip + 2, a);
      cftbsub(n, a, w);
    } else if (n == 4) {
      cftfsub(n, a, w);
    }
  }
  dstsub(n, a, nc, w + nw);
  if (isgn >= 0) {
    if (n > 4) {
      bitrv2(n, ip + 2, a);
      cftfsub(n, a, w);
      rftfsub(n, a, nc, w + nw);
    } else if (n == 4) {
      cftfsub(n, a, w);
    }
    xr = a[0] - a[1];
    a[0] += a[1];
    for (j = 2; j < n; j += 2) {
      a[j - 1] = -a[j] - a[j + 1];
      a[j] -= a[j + 1];
    }
    a[n - 1] = -xr;
  }
}
```