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

```asm
<main>:
  endbr64
  push   %rbx
  lea    -0x10000(%rsp),%r11
L2:
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  cmp    %r11,%rsp
  jne    L2
  sub    $0x20,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x10018(%rsp)
  xor    %eax,%eax
  lea    D64(%rip),%rdi
  call   <puts@plt>
  lea    0xc(%rsp),%rsi
  lea    D69(%rip),%rdi
  call   <scanf@plt>
  lea    0x10(%rsp),%rbx
  mov    0xc(%rsp),%eax
  lea    -0x1(%rax),%esi
  mov    %rbx,%rdx
  mov    $0x0,%edi
  call   <putdata@plt>
  mov    %rbx,%rdx
  mov    $0x1,%esi
  mov    0xc(%rsp),%edi
  call   <cdft@plt>
  mov    %rbx,%rdx
  mov    $0xffffffff,%esi
  mov    0xc(%rsp),%edi
  call   <cdft@plt>
  mov    0xc(%rsp),%esi
  pxor   %xmm1,%xmm1
  cvtsi2sd %esi,%xmm1
  movsd  D199(%rip),%xmm0
  divsd  %xmm1,%xmm0
  sub    $0x1,%esi
  mov    %rbx,%rdx
  mov    $0x0,%edi
  call   <errorcheck@plt>
  lea    D117(%rip),%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  mov    0xc(%rsp),%eax
  lea    -0x1(%rax),%esi
  mov    %rbx,%rdx
  mov    $0x0,%edi
  call   <putdata@plt>
  mov    %rbx,%rdx
  mov    $0x1,%esi
  mov    0xc(%rsp),%edi
  call   <rdft@plt>
  mov    %rbx,%rdx
  mov    $0xffffffff,%esi
  mov    0xc(%rsp),%edi
  call   <rdft@plt>
  mov    0xc(%rsp),%esi
  pxor   %xmm1,%xmm1
  cvtsi2sd %esi,%xmm1
  movsd  D199(%rip),%xmm0
  divsd  %xmm1,%xmm0
  sub    $0x1,%esi
  mov    %rbx,%rdx
  mov    $0x0,%edi
  call   <errorcheck@plt>
  lea    D141(%rip),%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  mov    0xc(%rsp),%eax
  lea    -0x1(%rax),%esi
  mov    %rbx,%rdx
  mov    $0x0,%edi
  call   <putdata@plt>
  mov    %rbx,%rdx
  mov    $0x1,%esi
  mov    0xc(%rsp),%edi
  call   <ddct@plt>
  mov    %rbx,%rdx
  mov    $0xffffffff,%esi
  mov    0xc(%rsp),%edi
  call   <ddct@plt>
  movsd  D178(%rip),%xmm0
  mulsd  0x10(%rsp),%xmm0
  movsd  %xmm0,0x10(%rsp)
  mov    0xc(%rsp),%esi
  pxor   %xmm1,%xmm1
  cvtsi2sd %esi,%xmm1
  movsd  D199(%rip),%xmm0
  divsd  %xmm1,%xmm0
  sub    $0x1,%esi
  mov    %rbx,%rdx
  mov    $0x0,%edi
  call   <errorcheck@plt>
  lea    D144(%rip),%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  mov    0xc(%rsp),%eax
  lea    -0x1(%rax),%esi
  mov    %rbx,%rdx
  mov    $0x0,%edi
  call   <putdata@plt>
  mov    %rbx,%rdx
  mov    $0x1,%esi
  mov    0xc(%rsp),%edi
  call   <ddst@plt>
  mov    %rbx,%rdx
  mov    $0xffffffff,%esi
  mov    0xc(%rsp),%edi
  call   <ddst@plt>
  movsd  D178(%rip),%xmm0
  mulsd  0x10(%rsp),%xmm0
  movsd  %xmm0,0x10(%rsp)
  mov    0xc(%rsp),%esi
  pxor   %xmm1,%xmm1
  cvtsi2sd %esi,%xmm1
  movsd  D199(%rip),%xmm0
  divsd  %xmm1,%xmm0
  sub    $0x1,%esi
  mov    %rbx,%rdx
  mov    $0x0,%edi
  call   <errorcheck@plt>
  lea    D198(%rip),%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  mov    %rbx,%rdx
  mov    0xc(%rsp),%esi
  mov    $0x0,%edi
  call   <putdata@plt>
  movsd  D178(%rip),%xmm0
  mulsd  0x10(%rsp),%xmm0
  movsd  %xmm0,0x10(%rsp)
  mov    0xc(%rsp),%edi
  movslq %edi,%rax
  movsd  D178(%rip),%xmm0
  mulsd  0x10(%rsp,%rax,8),%xmm0
  movsd  %xmm0,0x10(%rsp,%rax,8)
  mov    %rbx,%rsi
  call   <dfct@plt>
  movsd  D178(%rip),%xmm0
  mulsd  0x10(%rsp),%xmm0
  movsd  %xmm0,0x10(%rsp)
  mov    0xc(%rsp),%edi
  movslq %edi,%rax
  movsd  D178(%rip),%xmm0
  mulsd  0x10(%rsp,%rax,8),%xmm0
  movsd  %xmm0,0x10(%rsp,%rax,8)
  mov    %rbx,%rsi
  call   <dfct@plt>
  mov    0xc(%rsp),%esi
  pxor   %xmm1,%xmm1
  cvtsi2sd %esi,%xmm1
  movsd  D199(%rip),%xmm0
  divsd  %xmm1,%xmm0
  mov    %rbx,%rdx
  mov    $0x0,%edi
  call   <errorcheck@plt>
  lea    D118(%rip),%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  mov    0xc(%rsp),%eax
  lea    -0x1(%rax),%esi
  mov    %rbx,%rdx
  mov    $0x1,%edi
  call   <putdata@plt>
  mov    %rbx,%rsi
  mov    0xc(%rsp),%edi
  call   <dfst@plt>
  mov    %rbx,%rsi
  mov    0xc(%rsp),%edi
  call   <dfst@plt>
  mov    0xc(%rsp),%esi
  pxor   %xmm1,%xmm1
  cvtsi2sd %esi,%xmm1
  movsd  D199(%rip),%xmm0
  divsd  %xmm1,%xmm0
  sub    $0x1,%esi
  mov    %rbx,%rdx
  mov    $0x1,%edi
  call   <errorcheck@plt>
  lea    D30(%rip),%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  mov    0x10018(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L15
  mov    $0x0,%eax
  add    $0x10020,%rsp
  pop    %rbx
  ret
L15:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: data_label: D64
type_infered: string
name: parse_data
arguments: data_label: D69
type_infered: string
name: parse_data
arguments: data_label: D199
type_infered: f64
name: parse_data
arguments: data_label: D117
type_infered: string
name: parse_data
arguments: data_label: D141
type_infered: string
name: parse_data
arguments: data_label: D178
type_infered: f64
name: parse_data
arguments: data_label: D144
type_infered: string
name: parse_data
arguments: data_label: D198
type_infered: string
name: parse_data
arguments: data_label: D118
type_infered: string
name: parse_data
arguments: data_label: D30
type_infered: string

tool: D64: data length n=? (must be 2^m)

tool: D69: %d

tool: D199: 2

tool: D117: cdft err= %g 


tool: D141: rdft err= %g 


tool: D178: 0.5

tool: D144: ddct err= %g 


tool: D198: ddst err= %g 


tool: D118: dfct err= %g 


tool: D30: dfst err= %g 


assistant: ```c
int main() {
  int n;
  double a[8192 + 1], err;
  printf("data length n=? (must be 2^m)\n");
  scanf("%d", &n);
  putdata(0, n - 1, a);
  cdft(n, 1, a);
  cdft(n, -1, a);
  err = errorcheck(0, n - 1, 2.0 / n, a);
  printf("cdft err= %g \n", err);
  putdata(0, n - 1, a);
  rdft(n, 1, a);
  rdft(n, -1, a);
  err = errorcheck(0, n - 1, 2.0 / n, a);
  printf("rdft err= %g \n", err);
  putdata(0, n - 1, a);
  ddct(n, 1, a);
  ddct(n, -1, a);
  a[0] *= 0.5;
  err = errorcheck(0, n - 1, 2.0 / n, a);
  printf("ddct err= %g \n", err);
  putdata(0, n - 1, a);
  ddst(n, 1, a);
  ddst(n, -1, a);
  a[0] *= 0.5;
  err = errorcheck(0, n - 1, 2.0 / n, a);
  printf("ddst err= %g \n", err);
  putdata(0, n, a);
  a[0] *= 0.5;
  a[n] *= 0.5;
  dfct(n, a);
  a[0] *= 0.5;
  a[n] *= 0.5;
  dfct(n, a);
  err = errorcheck(0, n, 2.0 / n, a);
  printf("dfct err= %g \n", err);
  putdata(1, n - 1, a);
  dfst(n, a);
  dfst(n, a);
  err = errorcheck(1, n - 1, 2.0 / n, a);
  printf("dfst err= %g \n", err);
  return 0;
}
```