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

```asm
<ddst>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %edi,-0x14(%rbp)
  mov    %esi,-0x18(%rbp)
  mov    %rdx,-0x20(%rbp)
  cmpl   $0x0,-0x18(%rbp)
  jns    L6
  mov    -0x14(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movsd  %xmm0,-0x8(%rbp)
  mov    -0x14(%rbp),%eax
  sub    $0x2,%eax
  mov    %eax,-0xc(%rbp)
  jmp    L127
L16:
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movq   D4(%rip),%xmm1
  xorpd  %xmm1,%xmm0
  mov    -0xc(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0xc(%rbp),%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  subsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0xc(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  subsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  subl   $0x2,-0xc(%rbp)
L127:
  cmpl   $0x1,-0xc(%rbp)
  jg     L16
  mov    -0x20(%rbp),%rax
  movsd  (%rax),%xmm0
  mov    -0x20(%rbp),%rax
  add    $0x8,%rax
  addsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x20(%rbp),%rax
  movsd  (%rax),%xmm0
  subsd  -0x8(%rbp),%xmm0
  mov    -0x20(%rbp),%rax
  movsd  %xmm0,(%rax)
  cmpl   $0x4,-0x14(%rbp)
  jle    L20
  mov    -0x20(%rbp),%rdx
  mov    -0x14(%rbp),%eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <rftbsub@plt>
  mov    -0x20(%rbp),%rdx
  mov    -0x14(%rbp),%eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <bitrv2@plt>
  mov    -0x20(%rbp),%rdx
  mov    -0x14(%rbp),%eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <cftbsub@plt>
  jmp    L6
L20:
  cmpl   $0x4,-0x14(%rbp)
  jne    L6
  mov    -0x20(%rbp),%rdx
  mov    -0x14(%rbp),%eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <cftfsub@plt>
L6:
  cmpl   $0x4,-0x14(%rbp)
  jle    L11
  mov    -0x20(%rbp),%rdx
  mov    -0x14(%rbp),%eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <dstsub@plt>
  jmp    L27
L11:
  mov    -0x20(%rbp),%rdx
  mov    -0x14(%rbp),%eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <dstsub4@plt>
L27:
  cmpl   $0x0,-0x18(%rbp)
  js     L69
  cmpl   $0x4,-0x14(%rbp)
  jle    L115
  mov    -0x20(%rbp),%rdx
  mov    -0x14(%rbp),%eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <bitrv2@plt>
  mov    -0x20(%rbp),%rdx
  mov    -0x14(%rbp),%eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <cftfsub@plt>
  mov    -0x20(%rbp),%rdx
  mov    -0x14(%rbp),%eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <rftfsub@plt>
  jmp    L123
L115:
  cmpl   $0x4,-0x14(%rbp)
  jne    L123
  mov    -0x20(%rbp),%rdx
  mov    -0x14(%rbp),%eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <cftfsub@plt>
L123:
  mov    -0x20(%rbp),%rax
  movsd  (%rax),%xmm0
  mov    -0x20(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm1
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  mov    -0x20(%rbp),%rax
  movsd  (%rax),%xmm1
  mov    -0x20(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm0
  addsd  %xmm1,%xmm0
  mov    -0x20(%rbp),%rax
  movsd  %xmm0,(%rax)
  movl   $0x2,-0xc(%rbp)
  jmp    L120
L89:
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movq   D4(%rip),%xmm1
  xorpd  %xmm1,%xmm0
  mov    -0xc(%rbp),%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0xc(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  subsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0xc(%rbp),%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  subsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x2,-0xc(%rbp)
L120:
  mov    -0xc(%rbp),%eax
  cmp    -0x14(%rbp),%eax
  jl     L89
  mov    -0x14(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movsd  -0x8(%rbp),%xmm0
  movq   D4(%rip),%xmm1
  xorpd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
L69:
  nop
  leave
  ret
```

tool_calls: name: read_data
arguments: tag: D4
type_infered: byte[8]

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

assistant: ```c
void ddst(int n, int isgn, double *a) {
  void bitrv2(int n, double *a);
  void cftfsub(int n, double *a);
  void cftbsub(int n, double *a);
  void rftfsub(int n, double *a);
  void rftbsub(int n, double *a);
  void dstsub(int n, double *a);
  void dstsub4(int n, double *a);
  int j;
  double xr;
  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);
      bitrv2(n, a);
      cftbsub(n, a);
    } else if (n == 4) {
      cftfsub(n, a);
    }
  }
  if (n > 4) {
    dstsub(n, a);
  } else {
    dstsub4(n, a);
  }
  if (isgn >= 0) {
    if (n > 4) {
      bitrv2(n, a);
      cftfsub(n, a);
      rftfsub(n, a);
    } else if (n == 4) {
      cftfsub(n, a);
    }
    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;
  }
}
```