user: What is the c source code of the assembly code below:

```asm
<main>:
  endbr64
  push   %r14
  lea    D74(%rip),%rdi
  push   %r13
  push   %r12
  push   %rbp
  lea    D30(%rip),%rbp
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  call   <puts@plt>
  mov    %rsp,%rsi
  mov    %rbp,%rdi
  call   <scanf@plt>
  lea    D75(%rip),%rdi
  call   <puts@plt>
  lea    0x4(%rsp),%rsi
  mov    %rbp,%rdi
  call   <scanf@plt>
  mov    0x4(%rsp),%esi
  mov    (%rsp),%edi
  call   <alloc_2d_double@plt>
  mov    0x4(%rsp),%esi
  mov    (%rsp),%edi
  mov    %rax,%r14
  call   <alloc_2d_double@plt>
  mov    0x4(%rsp),%edx
  pxor   %xmm0,%xmm0
  movsd  D25(%rip),%xmm1
  mov    %rax,%r13
  mov    %edx,%eax
  shr    $0x1f,%eax
  add    %edx,%eax
  mov    (%rsp),%edx
  sar    %eax
  cmp    %edx,%eax
  cmovl  %edx,%eax
  cvtsi2sd %eax,%xmm0
  addsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%edi
  call   <sqrt@plt>
  lea    0x2(%rax),%edi
  call   <alloc_1d_int@plt>
  mov    (%rsp),%ecx
  mov    %rax,%rbp
  mov    0x4(%rsp),%eax
  mov    %ecx,%edx
  test   %eax,%eax
  lea    0x3(%rax),%edi
  cmovns %eax,%edi
  shr    $0x1f,%edx
  add    %ecx,%edx
  sar    %edx
  sar    $0x2,%edi
  cmp    %edx,%edi
  cmovl  %edx,%edi
  cmp    %ecx,%eax
  cmovl  %ecx,%eax
  add    %eax,%edi
  call   <alloc_1d_double@plt>
  movl   $0x0,0x0(%rbp)
  mov    0x4(%rsp),%esi
  mov    %r14,%rdx
  mov    (%rsp),%edi
  mov    %rax,%r12
  call   <putdata2d@plt>
  mov    0x4(%rsp),%esi
  mov    (%rsp),%edi
  mov    %r12,%r9
  mov    %rbp,%r8
  mov    %r14,%rcx
  mov    $0x1,%edx
  call   <cdft2d@plt>
  mov    0x4(%rsp),%esi
  mov    (%rsp),%edi
  mov    %r12,%r9
  mov    %rbp,%r8
  mov    %r14,%rcx
  mov    $0xffffffff,%edx
  call   <cdft2d@plt>
  mov    (%rsp),%edi
  pxor   %xmm2,%xmm2
  mov    0x4(%rsp),%esi
  movsd  D20(%rip),%xmm0
  mov    %r14,%rdx
  cvtsi2sd %edi,%xmm2
  divsd  %xmm2,%xmm0
  pxor   %xmm2,%xmm2
  cvtsi2sd %esi,%xmm2
  divsd  %xmm2,%xmm0
  call   <errorcheck2d@plt>
  lea    D111(%rip),%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  mov    0x4(%rsp),%esi
  mov    (%rsp),%edi
  mov    %r14,%rdx
  call   <putdata2d@plt>
  mov    0x4(%rsp),%esi
  mov    (%rsp),%edi
  mov    %r12,%r9
  mov    %rbp,%r8
  mov    %r14,%rcx
  mov    $0x1,%edx
  call   <rdft2d@plt>
  mov    0x4(%rsp),%esi
  mov    (%rsp),%edi
  mov    %r12,%r9
  mov    %rbp,%r8
  mov    %r14,%rcx
  mov    $0xffffffff,%edx
  call   <rdft2d@plt>
  mov    (%rsp),%edi
  pxor   %xmm2,%xmm2
  mov    0x4(%rsp),%esi
  movsd  D20(%rip),%xmm0
  mov    %r14,%rdx
  cvtsi2sd %edi,%xmm2
  divsd  %xmm2,%xmm0
  pxor   %xmm2,%xmm2
  cvtsi2sd %esi,%xmm2
  divsd  %xmm2,%xmm0
  call   <errorcheck2d@plt>
  lea    D8(%rip),%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  mov    0x4(%rsp),%esi
  mov    (%rsp),%edi
  mov    %r14,%rdx
  call   <putdata2d@plt>
  sub    $0x8,%rsp
  mov    %rbp,%r9
  mov    %r13,%r8
  push   %r12
  mov    0x14(%rsp),%esi
  mov    %r14,%rcx
  mov    $0x1,%edx
  mov    0x10(%rsp),%edi
  call   <ddct2d@plt>
  mov    0x10(%rsp),%edi
  mov    0x14(%rsp),%esi
  mov    %r14,%rcx
  mov    %rbp,%r9
  mov    %r13,%r8
  mov    $0xffffffff,%edx
  mov    %r12,(%rsp)
  call   <ddct2d@plt>
  mov    0x10(%rsp),%edi
  mov    D25(%rip),%rax
  pop    %rcx
  pop    %rsi
  test   %edi,%edi
  movq   %rax,%xmm1
  jle    L117
  mov    %edi,%edx
  mov    %r14,%rax
  lea    (%r14,%rdx,8),%rcx
  nopl   0x0(%rax,%rax,1)
L2:
  mov    (%rax),%rdx
  add    $0x8,%rax
  movsd  (%rdx),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,(%rdx)
  cmp    %rcx,%rax
  jne    L2
L117:
  mov    0x4(%rsp),%esi
  test   %esi,%esi
  jle    L84
  mov    (%r14),%rcx
  cmp    $0x1,%esi
  je     L29
  mov    %esi,%edx
  movapd D25(%rip),%xmm2
  mov    %rcx,%rax
  shr    %edx
  shl    $0x4,%rdx
  add    %rcx,%rdx
  nopw   0x0(%rax,%rax,1)
L27:
  movupd (%rax),%xmm0
  add    $0x10,%rax
  mulpd  %xmm2,%xmm0
  movups %xmm0,-0x10(%rax)
  cmp    %rdx,%rax
  jne    L27
  mov    %esi,%eax
  and    $0xfffffffe,%eax
  test   $0x1,%sil
  je     L84
L137:
  cltq
  lea    (%rcx,%rax,8),%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
L84:
  pxor   %xmm2,%xmm2
  movsd  D131(%rip),%xmm0
  mov    %r14,%rdx
  cvtsi2sd %edi,%xmm2
  divsd  %xmm2,%xmm0
  pxor   %xmm2,%xmm2
  cvtsi2sd %esi,%xmm2
  divsd  %xmm2,%xmm0
  call   <errorcheck2d@plt>
  lea    D120(%rip),%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  mov    0x4(%rsp),%esi
  mov    (%rsp),%edi
  mov    %r14,%rdx
  call   <putdata2d@plt>
  sub    $0x8,%rsp
  mov    %rbp,%r9
  mov    %r13,%r8
  push   %r12
  mov    0x14(%rsp),%esi
  mov    %r14,%rcx
  mov    $0x1,%edx
  mov    0x10(%rsp),%edi
  call   <ddst2d@plt>
  mov    0x10(%rsp),%edi
  mov    0x14(%rsp),%esi
  mov    %rbp,%r9
  mov    $0xffffffff,%edx
  mov    %r13,%r8
  mov    %r14,%rcx
  mov    %r12,(%rsp)
  call   <ddst2d@plt>
  mov    0x10(%rsp),%edi
  pop    %rax
  mov    D25(%rip),%rax
  pop    %rdx
  test   %edi,%edi
  movq   %rax,%xmm1
  jle    L87
  mov    %edi,%edx
  mov    %r14,%rax
  lea    (%r14,%rdx,8),%rcx
  nopl   0x0(%rax)
L28:
  mov    (%rax),%rdx
  add    $0x8,%rax
  movsd  (%rdx),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,(%rdx)
  cmp    %rcx,%rax
  jne    L28
L87:
  mov    0x4(%rsp),%esi
  test   %esi,%esi
  jle    L99
  mov    (%r14),%rcx
  cmp    $0x1,%esi
  je     L81
  mov    %esi,%edx
  movapd D25(%rip),%xmm2
  mov    %rcx,%rax
  shr    %edx
  shl    $0x4,%rdx
  add    %rcx,%rdx
  nopw   0x0(%rax,%rax,1)
L69:
  movupd (%rax),%xmm0
  add    $0x10,%rax
  mulpd  %xmm2,%xmm0
  movups %xmm0,-0x10(%rax)
  cmp    %rax,%rdx
  jne    L69
  mov    %esi,%eax
  and    $0xfffffffe,%eax
  test   $0x1,%sil
  je     L99
L24:
  cltq
  lea    (%rcx,%rax,8),%rax
  mulsd  (%rax),%xmm1
  movsd  %xmm1,(%rax)
L99:
  pxor   %xmm1,%xmm1
  movsd  D131(%rip),%xmm0
  mov    %r14,%rdx
  cvtsi2sd %edi,%xmm1
  divsd  %xmm1,%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2sd %esi,%xmm1
  divsd  %xmm1,%xmm0
  call   <errorcheck2d@plt>
  lea    D40(%rip),%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  mov    %r12,%rdi
  call   <free_1d_double@plt>
  mov    %rbp,%rdi
  call   <free_1d_int@plt>
  mov    %r13,%rdi
  call   <free_2d_double@plt>
  mov    %r14,%rdi
  call   <free_2d_double@plt>
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L22
  add    $0x18,%rsp
  xor    %eax,%eax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L29:
  xor    %eax,%eax
  jmp    L137
L81:
  xor    %eax,%eax
  jmp    L24
L22:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: tag: D74
type_infered: string
name: retrieve_data
arguments: tag: D30
type_infered: string
name: retrieve_data
arguments: tag: D75
type_infered: string
name: retrieve_data
arguments: tag: D25
type_infered: f64[2]
name: retrieve_data
arguments: tag: D20
type_infered: f64
name: retrieve_data
arguments: tag: D111
type_infered: string
name: retrieve_data
arguments: tag: D8
type_infered: string
name: retrieve_data
arguments: tag: D131
type_infered: f64
name: retrieve_data
arguments: tag: D120
type_infered: string
name: retrieve_data
arguments: tag: D40
type_infered: string

tool: D74: data length n1=? (n1 = power of 2) 

tool: D30: %d

tool: D75: data length n2=? (n2 = power of 2) 

tool: {"D25": [0.5,0.5]}

tool: D20: 2

tool: D111: cdft2d err= %g 


tool: D8: rdft2d err= %g 


tool: D131: 4

tool: D120: ddct2d err= %g 


tool: D40: ddst2d err= %g 


assistant: ```c
int main() {
  void cdft2d(int, int, int, double **, int *, double *);
  void rdft2d(int, int, int, double **, int *, double *);
  void ddct2d(int, int, int, double **, double **, int *, double *);
  void ddst2d(int, int, int, double **, double **, int *, double *);
  void putdata2d(int n1, int n2, double **a);
  double errorcheck2d(int n1, int n2, double scale, double **a);
  int *ip, n1, n2, n, i;
  double **a, **t, *w, err;
  printf("data length n1=? (n1 = power of 2) \n");
  scanf("%d", &n1);
  printf("data length n2=? (n2 = power of 2) \n");
  scanf("%d", &n2);
  a = alloc_2d_double(n1, n2);
  t = alloc_2d_double(n1, n2);
  n = ((n1) > (n2 / 2) ? (n1) : (n2 / 2));
  ip = alloc_1d_int(2 + (int)sqrt(n + 0.5));
  n = ((n1 / 2) > (n2 / 4) ? (n1 / 2) : (n2 / 4)) + ((n1) > (n2) ? (n1) : (n2));
  w = alloc_1d_double(n);
  ip[0] = 0;
  putdata2d(n1, n2, a);
  cdft2d(n1, n2, 1, a, ip, w);
  cdft2d(n1, n2, -1, a, ip, w);
  err = errorcheck2d(n1, n2, 2.0 / n1 / n2, a);
  printf("cdft2d err= %g \n", err);
  putdata2d(n1, n2, a);
  rdft2d(n1, n2, 1, a, ip, w);
  rdft2d(n1, n2, -1, a, ip, w);
  err = errorcheck2d(n1, n2, 2.0 / n1 / n2, a);
  printf("rdft2d err= %g \n", err);
  putdata2d(n1, n2, a);
  ddct2d(n1, n2, 1, a, t, ip, w);
  ddct2d(n1, n2, -1, a, t, ip, w);
  for (i = 0; i <= n1 - 1; i++) {
    a[i][0] *= 0.5;
  }
  for (i = 0; i <= n2 - 1; i++) {
    a[0][i] *= 0.5;
  }
  err = errorcheck2d(n1, n2, 4.0 / n1 / n2, a);
  printf("ddct2d err= %g \n", err);
  putdata2d(n1, n2, a);
  ddst2d(n1, n2, 1, a, t, ip, w);
  ddst2d(n1, n2, -1, a, t, ip, w);
  for (i = 0; i <= n1 - 1; i++) {
    a[i][0] *= 0.5;
  }
  for (i = 0; i <= n2 - 1; i++) {
    a[0][i] *= 0.5;
  }
  err = errorcheck2d(n1, n2, 4.0 / n1 / n2, a);
  printf("ddst2d err= %g \n", err);
  free_1d_double(w);
  free_1d_int(ip);
  free_2d_double(t);
  free_2d_double(a);
  return 0;
}
```