#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
double *alloc_1d_double(int);
int *alloc_1d_int(int);
double **alloc_2d_double(int, int);
int /*<<< orphan*/ free_1d_double(double *);
int /*<<< orphan*/ free_1d_int(int *);
int /*<<< orphan*/ free_2d_double(double **);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
scalar_t__ sqrt(int);
int main() {
  void cdft2d(int, int, int, double **, double *, int *, double *);
  void rdft2d(int, int, int, double **, 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, *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);
  n = ((n1) > (n2 / 2) ? (n1) : (n2 / 2));
  ip = alloc_1d_int(2 + (int)sqrt(n + 0.5));
  n = ((n1) > (n2) ? (n1) : (n2)) * 3 / 2;
  w = alloc_1d_double(n);
  ip[0] = 0;
  putdata2d(n1, n2, a);
  cdft2d(n1, n2, 1, a, NULL, ip, w);
  cdft2d(n1, n2, -1, a, NULL, 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, NULL, ip, w);
  rdft2d(n1, n2, -1, a, NULL, 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, NULL, ip, w);
  ddct2d(n1, n2, -1, a, NULL, 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, NULL, ip, w);
  ddst2d(n1, n2, -1, a, NULL, 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(a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe12(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
lea    0xe29(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   10f0 <scanf@plt>
lea    0xe1c(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
lea    0xe0b(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   10f0 <scanf@plt>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1070 <alloc_2d_double@plt>
mov    %rax,-0x28(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x18(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x3c(%rbp),%eax
cmp    %ecx,%eax
jle    1273 <main+0x83>
mov    -0x14(%rbp),%eax
mov    %eax,-0x40(%rbp)
jmp    1281 <main+0x91>
mov    -0x18(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x40(%rbp)
mov    -0x40(%rbp),%eax
mov    %eax,-0x1c(%rbp)
cvtsi2sdl -0x1c(%rbp),%xmm0
movsd  0xd6c(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1100 <sqrt@plt>
mov    %eax,%edi
add    $0x2,%edi
call   1110 <alloc_1d_int@plt>
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jle    12c6 <main+0xd6>
mov    -0x14(%rbp),%eax
mov    %eax,-0x44(%rbp)
jmp    12cc <main+0xdc>
mov    -0x18(%rbp),%eax
mov    %eax,-0x44(%rbp)
mov    -0x44(%rbp),%eax
imul   $0x3,%eax,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
call   10e0 <alloc_1d_double@plt>
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    -0x28(%rbp),%rdx
call   10d0 <putdata2d@plt>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    -0x28(%rbp),%rcx
mov    -0x10(%rbp),%r9
mov    -0x30(%rbp),%rax
mov    $0x1,%edx
xor    %r8d,%r8d
mov    %rax,(%rsp)
call   10a0 <cdft2d@plt>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    -0x28(%rbp),%rcx
mov    -0x10(%rbp),%r9
mov    -0x30(%rbp),%rax
mov    $0xffffffff,%edx
xor    %r8d,%r8d
mov    %rax,(%rsp)
call   10a0 <cdft2d@plt>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
cvtsi2sdl -0x14(%rbp),%xmm1
movsd  0xcad(%rip),%xmm0
divsd  %xmm1,%xmm0
cvtsi2sdl -0x18(%rbp),%xmm1
divsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rdx
call   10c0 <errorcheck2d@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
lea    0xce3(%rip),%rdi
mov    $0x1,%al
call   1090 <printf@plt>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    -0x28(%rbp),%rdx
call   10d0 <putdata2d@plt>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    -0x28(%rbp),%rcx
mov    -0x10(%rbp),%r9
mov    -0x30(%rbp),%rax
mov    $0x1,%edx
xor    %r8d,%r8d
mov    %rax,(%rsp)
call   10b0 <rdft2d@plt>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    -0x28(%rbp),%rcx
mov    -0x10(%rbp),%r9
mov    -0x30(%rbp),%rax
mov    $0xffffffff,%edx
xor    %r8d,%r8d
mov    %rax,(%rsp)
call   10b0 <rdft2d@plt>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
cvtsi2sdl -0x14(%rbp),%xmm1
movsd  0xc17(%rip),%xmm0
divsd  %xmm1,%xmm0
cvtsi2sdl -0x18(%rbp),%xmm1
divsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rdx
call   10c0 <errorcheck2d@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
lea    0xc5e(%rip),%rdi
mov    $0x1,%al
call   1090 <printf@plt>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    -0x28(%rbp),%rdx
call   10d0 <putdata2d@plt>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    -0x28(%rbp),%rcx
mov    -0x10(%rbp),%r9
mov    -0x30(%rbp),%rax
mov    $0x1,%edx
xor    %r8d,%r8d
mov    %rax,(%rsp)
call   1060 <ddct2d@plt>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    -0x28(%rbp),%rcx
mov    -0x10(%rbp),%r9
mov    -0x30(%rbp),%rax
mov    $0xffffffff,%edx
xor    %r8d,%r8d
mov    %rax,(%rsp)
call   1060 <ddct2d@plt>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     14b6 <main+0x2c6>
mov    -0x28(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsd  0xb60(%rip),%xmm0
mulsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    147b <main+0x28b>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    -0x18(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     14f9 <main+0x309>
mov    -0x28(%rbp),%rax
mov    (%rax),%rax
movslq -0x20(%rbp),%rcx
movsd  0xb1f(%rip),%xmm0
mulsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    14bd <main+0x2cd>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
cvtsi2sdl -0x14(%rbp),%xmm1
movsd  0xb04(%rip),%xmm0
divsd  %xmm1,%xmm0
cvtsi2sdl -0x18(%rbp),%xmm1
divsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rdx
call   10c0 <errorcheck2d@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
lea    0xb54(%rip),%rdi
mov    $0x1,%al
call   1090 <printf@plt>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    -0x28(%rbp),%rdx
call   10d0 <putdata2d@plt>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    -0x28(%rbp),%rcx
mov    -0x10(%rbp),%r9
mov    -0x30(%rbp),%rax
mov    $0x1,%edx
xor    %r8d,%r8d
mov    %rax,(%rsp)
call   1040 <ddst2d@plt>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    -0x28(%rbp),%rcx
mov    -0x10(%rbp),%r9
mov    -0x30(%rbp),%rax
mov    $0xffffffff,%edx
xor    %r8d,%r8d
mov    %rax,(%rsp)
call   1040 <ddst2d@plt>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     15d1 <main+0x3e1>
mov    -0x28(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsd  0xa45(%rip),%xmm0
mulsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1596 <main+0x3a6>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    -0x18(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     1614 <main+0x424>
mov    -0x28(%rbp),%rax
mov    (%rax),%rax
movslq -0x20(%rbp),%rcx
movsd  0xa04(%rip),%xmm0
mulsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    15d8 <main+0x3e8>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
cvtsi2sdl -0x14(%rbp),%xmm1
movsd  0x9e9(%rip),%xmm0
divsd  %xmm1,%xmm0
cvtsi2sdl -0x18(%rbp),%xmm1
divsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rdx
call   10c0 <errorcheck2d@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
lea    0xa4a(%rip),%rdi
mov    $0x1,%al
call   1090 <printf@plt>
mov    -0x30(%rbp),%rdi
call   1030 <free_1d_double@plt>
mov    -0x10(%rbp),%rdi
call   1050 <free_1d_int@plt>
mov    -0x28(%rbp),%rdi
call   1080 <free_2d_double@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xe65(%rip),%rdi
call   1050 <puts@plt>
lea    0xe12(%rip),%rbx
lea    0x14(%rsp),%rsi
mov    %rbx,%rdi
call   1100 <scanf@plt>
lea    0xe69(%rip),%rdi
call   1050 <puts@plt>
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1100 <scanf@plt>
mov    0x14(%rsp),%edi
mov    0x10(%rsp),%esi
call   1080 <alloc_2d_double@plt>
mov    %rax,%r12
mov    0x14(%rsp),%eax
mov    0x10(%rsp),%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
add    %ecx,%edx
sar    %edx
cmp    %edx,%eax
cmovg  %eax,%edx
cvtsi2sd %edx,%xmm0
addsd  0xd8a(%rip),%xmm0
cvttsd2si %xmm0,%edi
call   1110 <sqrt@plt>
lea    0x2(%rax),%edi
call   1120 <alloc_1d_int@plt>
mov    %rax,%r14
mov    0x14(%rsp),%eax
mov    0x10(%rsp),%ecx
cmp    %ecx,%eax
cmovg  %eax,%ecx
lea    (%rcx,%rcx,2),%eax
mov    %eax,%edi
shr    $0x1f,%edi
add    %eax,%edi
sar    %edi
call   10f0 <alloc_1d_double@plt>
mov    %rax,%r15
movl   $0x0,(%r14)
mov    0x14(%rsp),%edi
mov    0x10(%rsp),%esi
mov    %r12,%rdx
call   10e0 <putdata2d@plt>
mov    0x14(%rsp),%edi
mov    0x10(%rsp),%esi
mov    %r15,(%rsp)
mov    $0x1,%edx
mov    %r12,%rcx
xor    %r8d,%r8d
mov    %r14,%r9
call   10b0 <cdft2d@plt>
mov    0x14(%rsp),%edi
mov    0x10(%rsp),%esi
mov    %r15,(%rsp)
mov    $0xffffffff,%edx
mov    %r12,%rcx
xor    %r8d,%r8d
mov    %r14,%r9
call   10b0 <cdft2d@plt>
mov    0x14(%rsp),%edi
mov    0x10(%rsp),%esi
cvtsi2sd %edi,%xmm1
movsd  0xcf4(%rip),%xmm0
divsd  %xmm1,%xmm0
xorps  %xmm1,%xmm1
cvtsi2sd %esi,%xmm1
divsd  %xmm1,%xmm0
mov    %r12,%rdx
call   10d0 <errorcheck2d@plt>
lea    0xd01(%rip),%rdi
mov    $0x1,%al
call   10a0 <printf@plt>
mov    0x14(%rsp),%edi
mov    0x10(%rsp),%esi
mov    %r12,%rdx
call   10e0 <putdata2d@plt>
mov    0x14(%rsp),%edi
mov    0x10(%rsp),%esi
mov    %r15,(%rsp)
mov    $0x1,%edx
mov    %r12,%rcx
xor    %r8d,%r8d
mov    %r14,%r9
call   10c0 <rdft2d@plt>
mov    0x14(%rsp),%edi
mov    0x10(%rsp),%esi
mov    %r15,(%rsp)
mov    $0xffffffff,%edx
mov    %r12,%rcx
xor    %r8d,%r8d
mov    %r14,%r9
call   10c0 <rdft2d@plt>
mov    0x14(%rsp),%edi
mov    0x10(%rsp),%esi
xorps  %xmm0,%xmm0
cvtsi2sd %edi,%xmm0
movsd  0xc6a(%rip),%xmm1
divsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsi2sd %esi,%xmm0
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
mov    %r12,%rdx
call   10d0 <errorcheck2d@plt>
lea    0xc84(%rip),%rdi
mov    $0x1,%al
call   10a0 <printf@plt>
mov    0x14(%rsp),%edi
mov    0x10(%rsp),%esi
mov    %r12,%rdx
call   10e0 <putdata2d@plt>
mov    0x14(%rsp),%edi
mov    0x10(%rsp),%esi
mov    %r15,(%rsp)
mov    $0x1,%edx
mov    %r12,%rcx
xor    %r8d,%r8d
mov    %r14,%r9
call   1070 <ddct2d@plt>
mov    0x14(%rsp),%edi
mov    0x10(%rsp),%esi
mov    %r15,(%rsp)
mov    $0xffffffff,%edx
mov    %r12,%rcx
xor    %r8d,%r8d
mov    %r14,%r9
call   1070 <ddct2d@plt>
mov    0x14(%rsp),%edi
test   %edi,%edi
jle    14c9 <main+0x2c9>
lea    -0x1(%rdi),%rcx
mov    %edi,%eax
and    $0x3,%eax
cmp    $0x3,%rcx
jae    1434 <main+0x234>
xor    %ecx,%ecx
jmp    149c <main+0x29c>
mov    %edi,%edx
and    $0xfffffffc,%edx
xor    %ecx,%ecx
movsd  0xbbd(%rip),%xmm0
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    (%r12,%rcx,8),%rsi
movsd  (%rsi),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,(%rsi)
mov    0x8(%r12,%rcx,8),%rsi
movsd  (%rsi),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,(%rsi)
mov    0x10(%r12,%rcx,8),%rsi
movsd  (%rsi),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,(%rsi)
mov    0x18(%r12,%rcx,8),%rsi
movsd  (%rsi),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,(%rsi)
add    $0x4,%rcx
cmp    %rcx,%rdx
jne    1450 <main+0x250>
test   %rax,%rax
je     14c9 <main+0x2c9>
lea    (%r12,%rcx,8),%rcx
xor    %edx,%edx
movsd  0xb51(%rip),%xmm0
nop
mov    (%rcx,%rdx,8),%rsi
movsd  (%rsi),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,(%rsi)
add    $0x1,%rdx
cmp    %rdx,%rax
jne    14b0 <main+0x2b0>
mov    0x10(%rsp),%esi
test   %esi,%esi
jle    15c7 <main+0x3c7>
mov    (%r12),%rax
cmp    $0x4,%esi
jae    14e5 <main+0x2e5>
xor    %ecx,%ecx
jmp    1599 <main+0x399>
mov    %esi,%ecx
and    $0xfffffffc,%ecx
lea    -0x4(%rcx),%rdx
mov    %rdx,%r8
shr    $0x2,%r8
add    $0x1,%r8
test   %rdx,%rdx
je     1851 <main+0x651>
mov    %r8,%rbx
and    $0xfffffffffffffffe,%rbx
xor    %edx,%edx
movapd 0xb0d(%rip),%xmm0
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movupd (%rax,%rdx,8),%xmm1
movupd 0x10(%rax,%rdx,8),%xmm2
movupd 0x20(%rax,%rdx,8),%xmm3
movupd 0x30(%rax,%rdx,8),%xmm4
mulpd  %xmm0,%xmm1
mulpd  %xmm0,%xmm2
movupd %xmm1,(%rax,%rdx,8)
movupd %xmm2,0x10(%rax,%rdx,8)
mulpd  %xmm0,%xmm3
mulpd  %xmm0,%xmm4
movupd %xmm3,0x20(%rax,%rdx,8)
movupd %xmm4,0x30(%rax,%rdx,8)
add    $0x8,%rdx
add    $0xfffffffffffffffe,%rbx
jne    1520 <main+0x320>
test   $0x1,%r8b
je     1594 <main+0x394>
movupd (%rax,%rdx,8),%xmm0
movupd 0x10(%rax,%rdx,8),%xmm1
movapd 0xa9f(%rip),%xmm2
mulpd  %xmm2,%xmm0
mulpd  %xmm2,%xmm1
movupd %xmm0,(%rax,%rdx,8)
movupd %xmm1,0x10(%rax,%rdx,8)
cmp    %rsi,%rcx
je     15c7 <main+0x3c7>
movsd  0xa5f(%rip),%xmm0
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,(%rax,%rcx,8)
add    $0x1,%rcx
cmp    %rcx,%rsi
jne    15b0 <main+0x3b0>
xorps  %xmm1,%xmm1
cvtsi2sd %edi,%xmm1
movsd  0xa3a(%rip),%xmm0
divsd  %xmm1,%xmm0
xorps  %xmm1,%xmm1
cvtsi2sd %esi,%xmm1
divsd  %xmm1,%xmm0
mov    %r12,%rdx
call   10d0 <errorcheck2d@plt>
lea    0xa61(%rip),%rdi
mov    $0x1,%al
call   10a0 <printf@plt>
mov    0x14(%rsp),%edi
mov    0x10(%rsp),%esi
mov    %r12,%rdx
call   10e0 <putdata2d@plt>
mov    0x14(%rsp),%edi
mov    0x10(%rsp),%esi
mov    %r15,(%rsp)
mov    $0x1,%edx
mov    %r12,%rcx
xor    %r8d,%r8d
mov    %r14,%r9
call   1040 <ddst2d@plt>
mov    0x14(%rsp),%edi
mov    0x10(%rsp),%esi
mov    %r15,(%rsp)
mov    $0xffffffff,%edx
mov    %r12,%rcx
xor    %r8d,%r8d
mov    %r14,%r9
call   1040 <ddst2d@plt>
mov    0x14(%rsp),%edi
test   %edi,%edi
jle    16f9 <main+0x4f9>
lea    -0x1(%rdi),%rcx
mov    %edi,%eax
and    $0x3,%eax
cmp    $0x3,%rcx
jae    1668 <main+0x468>
xor    %ecx,%ecx
jmp    16cc <main+0x4cc>
mov    %edi,%edx
and    $0xfffffffc,%edx
xor    %ecx,%ecx
movsd  0x989(%rip),%xmm0
nopw   0x0(%rax,%rax,1)
mov    (%r12,%rcx,8),%rsi
movsd  (%rsi),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,(%rsi)
mov    0x8(%r12,%rcx,8),%rsi
movsd  (%rsi),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,(%rsi)
mov    0x10(%r12,%rcx,8),%rsi
movsd  (%rsi),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,(%rsi)
mov    0x18(%r12,%rcx,8),%rsi
movsd  (%rsi),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,(%rsi)
add    $0x4,%rcx
cmp    %rcx,%rdx
jne    1680 <main+0x480>
test   %rax,%rax
je     16f9 <main+0x4f9>
lea    (%r12,%rcx,8),%rcx
xor    %edx,%edx
movsd  0x921(%rip),%xmm0
nop
mov    (%rcx,%rdx,8),%rsi
movsd  (%rsi),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,(%rsi)
add    $0x1,%rdx
cmp    %rdx,%rax
jne    16e0 <main+0x4e0>
mov    0x10(%rsp),%esi
test   %esi,%esi
jle    17f7 <main+0x5f7>
mov    (%r12),%rax
cmp    $0x4,%esi
jae    1715 <main+0x515>
xor    %ecx,%ecx
jmp    17c9 <main+0x5c9>
mov    %esi,%ecx
and    $0xfffffffc,%ecx
lea    -0x4(%rcx),%rdx
mov    %rdx,%r8
shr    $0x2,%r8
add    $0x1,%r8
test   %rdx,%rdx
je     1862 <main+0x662>
mov    %r8,%rbx
and    $0xfffffffffffffffe,%rbx
xor    %edx,%edx
movapd 0x8dd(%rip),%xmm0
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movupd (%rax,%rdx,8),%xmm1
movupd 0x10(%rax,%rdx,8),%xmm2
movupd 0x20(%rax,%rdx,8),%xmm3
movupd 0x30(%rax,%rdx,8),%xmm4
mulpd  %xmm0,%xmm1
mulpd  %xmm0,%xmm2
movupd %xmm1,(%rax,%rdx,8)
movupd %xmm2,0x10(%rax,%rdx,8)
mulpd  %xmm0,%xmm3
mulpd  %xmm0,%xmm4
movupd %xmm3,0x20(%rax,%rdx,8)
movupd %xmm4,0x30(%rax,%rdx,8)
add    $0x8,%rdx
add    $0xfffffffffffffffe,%rbx
jne    1750 <main+0x550>
test   $0x1,%r8b
je     17c4 <main+0x5c4>
movupd (%rax,%rdx,8),%xmm0
movupd 0x10(%rax,%rdx,8),%xmm1
movapd 0x86f(%rip),%xmm2
mulpd  %xmm2,%xmm0
mulpd  %xmm2,%xmm1
movupd %xmm0,(%rax,%rdx,8)
movupd %xmm1,0x10(%rax,%rdx,8)
cmp    %rsi,%rcx
je     17f7 <main+0x5f7>
movsd  0x82f(%rip),%xmm0
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,(%rax,%rcx,8)
add    $0x1,%rcx
cmp    %rcx,%rsi
jne    17e0 <main+0x5e0>
xorps  %xmm1,%xmm1
cvtsi2sd %edi,%xmm1
movsd  0x80a(%rip),%xmm0
divsd  %xmm1,%xmm0
xorps  %xmm1,%xmm1
cvtsi2sd %esi,%xmm1
divsd  %xmm1,%xmm0
mov    %r12,%rdx
call   10d0 <errorcheck2d@plt>
lea    0x842(%rip),%rdi
mov    $0x1,%al
call   10a0 <printf@plt>
mov    %r15,%rdi
call   1030 <free_1d_double@plt>
mov    %r14,%rdi
call   1060 <free_1d_int@plt>
mov    %r12,%rdi
call   1090 <free_2d_double@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret
xor    %edx,%edx
test   $0x1,%r8b
jne    156e <main+0x36e>
jmp    1594 <main+0x394>
xor    %edx,%edx
test   $0x1,%r8b
jne    179e <main+0x59e>
jmp    17c4 <main+0x5c4>

LLVM IR (-O0):
@.str = [37 x i8] c"data length n1=? (n1 = power of 2) \0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [37 x i8] c"data length n2=? (n2 = power of 2) \0A\00"
@.str.3 = [17 x i8] c"cdft2d err= %g \0A\00"
@.str.4 = [17 x i8] c"rdft2d err= %g \0A\00"
@.str.5 = [17 x i8] c"ddct2d err= %g \0A\00"
@.str.6 = [17 x i8] c"ddst2d err= %g \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca double**
%8 = alloca double*
%9 = alloca double
store i32 0, i32* %1
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0))
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%14 = load i32, i32* %3
%15 = load i32, i32* %4
%16 = call double** @alloc_2d_double(i32 %14, i32 %15)
store double** %16, double*** %7
%17 = load i32, i32* %3
%18 = load i32, i32* %4
%19 = sdiv i32 %18, 2
%20 = icmp sgt i32 %17, %19
br i1 %20, label %21, label %23
21: ; preds = %0
%22 = load i32, i32* %3
br label %26
23: ; preds = %0
%24 = load i32, i32* %4
%25 = sdiv i32 %24, 2
br label %26
26: ; preds = %23, %21
%27 = phi i32 [ %22, %21 ], [ %25, %23 ]
store i32 %27, i32* %5
%28 = load i32, i32* %5
%29 = sitofp i32 %28 to double
%30 = fadd double %29, 5.000000e-01
%31 = fptosi double %30 to i32
%32 = call i64 @sqrt(i32 %31)
%33 = trunc i64 %32 to i32
%34 = add nsw i32 2, %33
%35 = call i32* @alloc_1d_int(i32 %34)
store i32* %35, i32** %2
%36 = load i32, i32* %3
%37 = load i32, i32* %4
%38 = icmp sgt i32 %36, %37
br i1 %38, label %39, label %41
39: ; preds = %26
%40 = load i32, i32* %3
br label %43
41: ; preds = %26
%42 = load i32, i32* %4
br label %43
43: ; preds = %41, %39
%44 = phi i32 [ %40, %39 ], [ %42, %41 ]
%45 = mul nsw i32 %44, 3
%46 = sdiv i32 %45, 2
store i32 %46, i32* %5
%47 = load i32, i32* %5
%48 = call double* @alloc_1d_double(i32 %47)
store double* %48, double** %8
%49 = load i32*, i32** %2
%50 = getelementptr inbounds i32, i32* %49, i64 0
store i32 0, i32* %50
%51 = load i32, i32* %3
%52 = load i32, i32* %4
%53 = load double**, double*** %7
%54 = load i32, i32* %3
%55 = load i32, i32* %4
%56 = load double**, double*** %7
%57 = load i32*, i32** %2
%58 = load double*, double** %8
%59 = load i32, i32* %3
%60 = load i32, i32* %4
%61 = load double**, double*** %7
%62 = load i32*, i32** %2
%63 = load double*, double** %8
%64 = load i32, i32* %3
%65 = load i32, i32* %4
%66 = load i32, i32* %3
%67 = sitofp i32 %66 to double
%68 = fdiv double 2.000000e+00, %67
%69 = load i32, i32* %4
%70 = sitofp i32 %69 to double
%71 = fdiv double %68, %70
%72 = load double**, double*** %7
%73 = call double @errorcheck2d(i32 %64, i32 %65, double %71, double** %72)
store double %73, double* %9
%74 = load double, double* %9
%75 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), double %74)
%76 = load i32, i32* %3
%77 = load i32, i32* %4
%78 = load double**, double*** %7
%79 = load i32, i32* %3
%80 = load i32, i32* %4
%81 = load double**, double*** %7
%82 = load i32*, i32** %2
%83 = load double*, double** %8
%84 = load i32, i32* %3
%85 = load i32, i32* %4
%86 = load double**, double*** %7
%87 = load i32*, i32** %2
%88 = load double*, double** %8
%89 = load i32, i32* %3
%90 = load i32, i32* %4
%91 = load i32, i32* %3
%92 = sitofp i32 %91 to double
%93 = fdiv double 2.000000e+00, %92
%94 = load i32, i32* %4
%95 = sitofp i32 %94 to double
%96 = fdiv double %93, %95
%97 = load double**, double*** %7
%98 = call double @errorcheck2d(i32 %89, i32 %90, double %96, double** %97)
store double %98, double* %9
%99 = load double, double* %9
%100 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), double %99)
%101 = load i32, i32* %3
%102 = load i32, i32* %4
%103 = load double**, double*** %7
%104 = load i32, i32* %3
%105 = load i32, i32* %4
%106 = load double**, double*** %7
%107 = load i32*, i32** %2
%108 = load double*, double** %8
%109 = load i32, i32* %3
%110 = load i32, i32* %4
%111 = load double**, double*** %7
%112 = load i32*, i32** %2
%113 = load double*, double** %8
store i32 0, i32* %6
br label %114
114: ; preds = %128, %43
%115 = load i32, i32* %6
%116 = load i32, i32* %3
%117 = sub nsw i32 %116, 1
%118 = icmp sle i32 %115, %117
br i1 %118, label %119, label %131
119: ; preds = %114
%120 = load double**, double*** %7
%121 = load i32, i32* %6
%122 = sext i32 %121 to i64
%123 = getelementptr inbounds double*, double** %120, i64 %122
%124 = load double*, double** %123
%125 = getelementptr inbounds double, double* %124, i64 0
%126 = load double, double* %125
%127 = fmul double %126, 5.000000e-01
store double %127, double* %125
br label %128
128: ; preds = %119
%129 = load i32, i32* %6
%130 = add nsw i32 %129, 1
store i32 %130, i32* %6
br label %114
131: ; preds = %114
store i32 0, i32* %6
br label %132
132: ; preds = %146, %131
%133 = load i32, i32* %6
%134 = load i32, i32* %4
%135 = sub nsw i32 %134, 1
%136 = icmp sle i32 %133, %135
br i1 %136, label %137, label %149
137: ; preds = %132
%138 = load double**, double*** %7
%139 = getelementptr inbounds double*, double** %138, i64 0
%140 = load double*, double** %139
%141 = load i32, i32* %6
%142 = sext i32 %141 to i64
%143 = getelementptr inbounds double, double* %140, i64 %142
%144 = load double, double* %143
%145 = fmul double %144, 5.000000e-01
store double %145, double* %143
br label %146
146: ; preds = %137
%147 = load i32, i32* %6
%148 = add nsw i32 %147, 1
store i32 %148, i32* %6
br label %132
149: ; preds = %132
%150 = load i32, i32* %3
%151 = load i32, i32* %4
%152 = load i32, i32* %3
%153 = sitofp i32 %152 to double
%154 = fdiv double 4.000000e+00, %153
%155 = load i32, i32* %4
%156 = sitofp i32 %155 to double
%157 = fdiv double %154, %156
%158 = load double**, double*** %7
%159 = call double @errorcheck2d(i32 %150, i32 %151, double %157, double** %158)
store double %159, double* %9
%160 = load double, double* %9
%161 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0), double %160)
%162 = load i32, i32* %3
%163 = load i32, i32* %4
%164 = load double**, double*** %7
%165 = load i32, i32* %3
%166 = load i32, i32* %4
%167 = load double**, double*** %7
%168 = load i32*, i32** %2
%169 = load double*, double** %8
%170 = load i32, i32* %3
%171 = load i32, i32* %4
%172 = load double**, double*** %7
%173 = load i32*, i32** %2
%174 = load double*, double** %8
store i32 0, i32* %6
br label %175
175: ; preds = %189, %149
%176 = load i32, i32* %6
%177 = load i32, i32* %3
%178 = sub nsw i32 %177, 1
%179 = icmp sle i32 %176, %178
br i1 %179, label %180, label %192
180: ; preds = %175
%181 = load double**, double*** %7
%182 = load i32, i32* %6
%183 = sext i32 %182 to i64
%184 = getelementptr inbounds double*, double** %181, i64 %183
%185 = load double*, double** %184
%186 = getelementptr inbounds double, double* %185, i64 0
%187 = load double, double* %186
%188 = fmul double %187, 5.000000e-01
store double %188, double* %186
br label %189
189: ; preds = %180
%190 = load i32, i32* %6
%191 = add nsw i32 %190, 1
store i32 %191, i32* %6
br label %175
192: ; preds = %175
store i32 0, i32* %6
br label %193
193: ; preds = %207, %192
%194 = load i32, i32* %6
%195 = load i32, i32* %4
%196 = sub nsw i32 %195, 1
%197 = icmp sle i32 %194, %196
br i1 %197, label %198, label %210
198: ; preds = %193
%199 = load double**, double*** %7
%200 = getelementptr inbounds double*, double** %199, i64 0
%201 = load double*, double** %200
%202 = load i32, i32* %6
%203 = sext i32 %202 to i64
%204 = getelementptr inbounds double, double* %201, i64 %203
%205 = load double, double* %204
%206 = fmul double %205, 5.000000e-01
store double %206, double* %204
br label %207
207: ; preds = %198
%208 = load i32, i32* %6
%209 = add nsw i32 %208, 1
store i32 %209, i32* %6
br label %193
210: ; preds = %193
%211 = load i32, i32* %3
%212 = load i32, i32* %4
%213 = load i32, i32* %3
%214 = sitofp i32 %213 to double
%215 = fdiv double 4.000000e+00, %214
%216 = load i32, i32* %4
%217 = sitofp i32 %216 to double
%218 = fdiv double %215, %217
%219 = load double**, double*** %7
%220 = call double @errorcheck2d(i32 %211, i32 %212, double %218, double** %219)
store double %220, double* %9
%221 = load double, double* %9
%222 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0), double %221)
%223 = load double*, double** %8
%224 = call i32 @free_1d_double(double* %223)
%225 = load i32*, i32** %2
%226 = call i32 @free_1d_int(i32* %225)
%227 = load double**, double*** %7
%228 = call i32 @free_2d_double(double** %227)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.3 = [17 x i8] c"cdft2d err= %g \0A\00"
@.str.4 = [17 x i8] c"rdft2d err= %g \0A\00"
@.str.5 = [17 x i8] c"ddct2d err= %g \0A\00"
@.str.6 = [17 x i8] c"ddst2d err= %g \0A\00"
@str = [36 x i8] c"data length n1=? (n1 = power of 2) \00"
@str.7 = [36 x i8] c"data length n2=? (n2 = power of 2) \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.7, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = call double** @alloc_2d_double(i32 %9, i32 %10)
%12 = load i32, i32* %1
%13 = load i32, i32* %2
%14 = sdiv i32 %13, 2
%15 = icmp sgt i32 %12, %14
%16 = select i1 %15, i32 %12, i32 %14
%17 = sitofp i32 %16 to double
%18 = fadd double %17, 5.000000e-01
%19 = fptosi double %18 to i32
%20 = call i64 @sqrt(i32 %19)
%21 = trunc i64 %20 to i32
%22 = add nsw i32 %21, 2
%23 = call i32* @alloc_1d_int(i32 %22)
%24 = load i32, i32* %1
%25 = load i32, i32* %2
%26 = icmp sgt i32 %24, %25
%27 = select i1 %26, i32 %24, i32 %25
%28 = mul nsw i32 %27, 3
%29 = sdiv i32 %28, 2
%30 = call double* @alloc_1d_double(i32 %29)
store i32 0, i32* %23
%31 = load i32, i32* %1
%32 = load i32, i32* %2
%33 = load i32, i32* %1
%34 = load i32, i32* %2
%35 = load i32, i32* %1
%36 = load i32, i32* %2
%37 = load i32, i32* %1
%38 = load i32, i32* %2
%39 = sitofp i32 %37 to double
%40 = fdiv double 2.000000e+00, %39
%41 = sitofp i32 %38 to double
%42 = fdiv double %40, %41
%43 = call double @errorcheck2d(i32 %37, i32 %38, double %42, double** %11)
%44 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), double %43)
%45 = load i32, i32* %1
%46 = load i32, i32* %2
%47 = load i32, i32* %1
%48 = load i32, i32* %2
%49 = load i32, i32* %1
%50 = load i32, i32* %2
%51 = load i32, i32* %1
%52 = load i32, i32* %2
%53 = sitofp i32 %51 to double
%54 = fdiv double 2.000000e+00, %53
%55 = sitofp i32 %52 to double
%56 = fdiv double %54, %55
%57 = call double @errorcheck2d(i32 %51, i32 %52, double %56, double** %11)
%58 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), double %57)
%59 = load i32, i32* %1
%60 = load i32, i32* %2
%61 = load i32, i32* %1
%62 = load i32, i32* %2
%63 = load i32, i32* %1
%64 = load i32, i32* %2
%65 = load i32, i32* %1
%66 = icmp sgt i32 %65, 0
br i1 %66, label %67, label %87
67: ; preds = %0
%68 = zext i32 %65 to i64
%69 = add nsw i64 %68, -1
%70 = and i64 %68, 3
%71 = icmp ult i64 %69, 3
br i1 %71, label %74, label %72
72: ; preds = %67
%73 = and i64 %68, 4294967292
br label %148
74: ; preds = %148, %67
%75 = phi i64 [ 0, %67 ], [ %170, %148 ]
%76 = icmp eq i64 %70, 0
br i1 %76, label %87, label %77
77: ; preds = %74, %77
%78 = phi i64 [ %84, %77 ], [ %75, %74 ]
%79 = phi i64 [ %85, %77 ], [ 0, %74 ]
%80 = getelementptr inbounds double*, double** %11, i64 %78
%81 = load double*, double** %80
%82 = load double, double* %81
%83 = fmul double %82, 5.000000e-01
store double %83, double* %81
%84 = add nuw nsw i64 %78, 1
%85 = add i64 %79, 1
%86 = icmp eq i64 %85, %70
br i1 %86, label %87, label %77
87: ; preds = %74, %77, %0
%88 = load i32, i32* %2
%89 = icmp sgt i32 %88, 0
br i1 %89, label %90, label %180
90: ; preds = %87
%91 = load double*, double** %11
%92 = zext i32 %88 to i64
%93 = icmp ult i32 %88, 4
br i1 %93, label %146, label %94
94: ; preds = %90
%95 = and i64 %92, 4294967292
%96 = add nsw i64 %95, -4
%97 = lshr exact i64 %96, 2
%98 = add nuw nsw i64 %97, 1
%99 = and i64 %98, 1
%100 = icmp eq i64 %96, 0
br i1 %100, label %130, label %101
101: ; preds = %94
%102 = and i64 %98, 9223372036854775806
br label %103
103: ; preds = %103, %101
%104 = phi i64 [ 0, %101 ], [ %127, %103 ]
%105 = phi i64 [ 0, %101 ], [ %128, %103 ]
%106 = getelementptr inbounds double, double* %91, i64 %104
%107 = bitcast double* %106 to <2 x double>*
%108 = load <2 x double>, <2 x double>* %107
%109 = getelementptr inbounds double, double* %106, i64 2
%110 = bitcast double* %109 to <2 x double>*
%111 = load <2 x double>, <2 x double>* %110
%112 = fmul <2 x double> %108, <double 5.000000e-01, double 5.000000e-01>
%113 = fmul <2 x double> %111, <double 5.000000e-01, double 5.000000e-01>
%114 = bitcast double* %106 to <2 x double>*
store <2 x double> %112, <2 x double>* %114
%115 = bitcast double* %109 to <2 x double>*
store <2 x double> %113, <2 x double>* %115
%116 = or i64 %104, 4
%117 = getelementptr inbounds double, double* %91, i64 %116
%118 = bitcast double* %117 to <2 x double>*
%119 = load <2 x double>, <2 x double>* %118
%120 = getelementptr inbounds double, double* %117, i64 2
%121 = bitcast double* %120 to <2 x double>*
%122 = load <2 x double>, <2 x double>* %121
%123 = fmul <2 x double> %119, <double 5.000000e-01, double 5.000000e-01>
%124 = fmul <2 x double> %122, <double 5.000000e-01, double 5.000000e-01>
%125 = bitcast double* %117 to <2 x double>*
store <2 x double> %123, <2 x double>* %125
%126 = bitcast double* %120 to <2 x double>*
store <2 x double> %124, <2 x double>* %126
%127 = add nuw i64 %104, 8
%128 = add i64 %105, 2
%129 = icmp eq i64 %128, %102
br i1 %129, label %130, label %103
130: ; preds = %103, %94
%131 = phi i64 [ 0, %94 ], [ %127, %103 ]
%132 = icmp eq i64 %99, 0
br i1 %132, label %144, label %133
133: ; preds = %130
%134 = getelementptr inbounds double, double* %91, i64 %131
%135 = bitcast double* %134 to <2 x double>*
%136 = load <2 x double>, <2 x double>* %135
%137 = getelementptr inbounds double, double* %134, i64 2
%138 = bitcast double* %137 to <2 x double>*
%139 = load <2 x double>, <2 x double>* %138
%140 = fmul <2 x double> %136, <double 5.000000e-01, double 5.000000e-01>
%141 = fmul <2 x double> %139, <double 5.000000e-01, double 5.000000e-01>
%142 = bitcast double* %134 to <2 x double>*
store <2 x double> %140, <2 x double>* %142
%143 = bitcast double* %137 to <2 x double>*
store <2 x double> %141, <2 x double>* %143
br label %144
144: ; preds = %130, %133
%145 = icmp eq i64 %95, %92
br i1 %145, label %180, label %146
146: ; preds = %90, %144
%147 = phi i64 [ 0, %90 ], [ %95, %144 ]
br label %173
148: ; preds = %148, %72
%149 = phi i64 [ 0, %72 ], [ %170, %148 ]
%150 = phi i64 [ 0, %72 ], [ %171, %148 ]
%151 = getelementptr inbounds double*, double** %11, i64 %149
%152 = load double*, double** %151
%153 = load double, double* %152
%154 = fmul double %153, 5.000000e-01
store double %154, double* %152
%155 = or i64 %149, 1
%156 = getelementptr inbounds double*, double** %11, i64 %155
%157 = load double*, double** %156
%158 = load double, double* %157
%159 = fmul double %158, 5.000000e-01
store double %159, double* %157
%160 = or i64 %149, 2
%161 = getelementptr inbounds double*, double** %11, i64 %160
%162 = load double*, double** %161
%163 = load double, double* %162
%164 = fmul double %163, 5.000000e-01
store double %164, double* %162
%165 = or i64 %149, 3
%166 = getelementptr inbounds double*, double** %11, i64 %165
%167 = load double*, double** %166
%168 = load double, double* %167
%169 = fmul double %168, 5.000000e-01
store double %169, double* %167
%170 = add nuw nsw i64 %149, 4
%171 = add i64 %150, 4
%172 = icmp eq i64 %171, %73
br i1 %172, label %74, label %148
173: ; preds = %146, %173
%174 = phi i64 [ %178, %173 ], [ %147, %146 ]
%175 = getelementptr inbounds double, double* %91, i64 %174
%176 = load double, double* %175
%177 = fmul double %176, 5.000000e-01
store double %177, double* %175
%178 = add nuw nsw i64 %174, 1
%179 = icmp eq i64 %178, %92
br i1 %179, label %180, label %173
180: ; preds = %173, %144, %87
%181 = sitofp i32 %65 to double
%182 = fdiv double 4.000000e+00, %181
%183 = sitofp i32 %88 to double
%184 = fdiv double %182, %183
%185 = call double @errorcheck2d(i32 %65, i32 %88, double %184, double** %11)
%186 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0), double %185)
%187 = load i32, i32* %1
%188 = load i32, i32* %2
%189 = load i32, i32* %1
%190 = load i32, i32* %2
%191 = load i32, i32* %1
%192 = load i32, i32* %2
%193 = load i32, i32* %1
%194 = icmp sgt i32 %193, 0
br i1 %194, label %195, label %215
195: ; preds = %180
%196 = zext i32 %193 to i64
%197 = add nsw i64 %196, -1
%198 = and i64 %196, 3
%199 = icmp ult i64 %197, 3
br i1 %199, label %202, label %200
200: ; preds = %195
%201 = and i64 %196, 4294967292
br label %276
202: ; preds = %276, %195
%203 = phi i64 [ 0, %195 ], [ %298, %276 ]
%204 = icmp eq i64 %198, 0
br i1 %204, label %215, label %205
205: ; preds = %202, %205
%206 = phi i64 [ %212, %205 ], [ %203, %202 ]
%207 = phi i64 [ %213, %205 ], [ 0, %202 ]
%208 = getelementptr inbounds double*, double** %11, i64 %206
%209 = load double*, double** %208
%210 = load double, double* %209
%211 = fmul double %210, 5.000000e-01
store double %211, double* %209
%212 = add nuw nsw i64 %206, 1
%213 = add i64 %207, 1
%214 = icmp eq i64 %213, %198
br i1 %214, label %215, label %205
215: ; preds = %202, %205, %180
%216 = load i32, i32* %2
%217 = icmp sgt i32 %216, 0
br i1 %217, label %218, label %308
218: ; preds = %215
%219 = load double*, double** %11
%220 = zext i32 %216 to i64
%221 = icmp ult i32 %216, 4
br i1 %221, label %274, label %222
222: ; preds = %218
%223 = and i64 %220, 4294967292
%224 = add nsw i64 %223, -4
%225 = lshr exact i64 %224, 2
%226 = add nuw nsw i64 %225, 1
%227 = and i64 %226, 1
%228 = icmp eq i64 %224, 0
br i1 %228, label %258, label %229
229: ; preds = %222
%230 = and i64 %226, 9223372036854775806
br label %231
231: ; preds = %231, %229
%232 = phi i64 [ 0, %229 ], [ %255, %231 ]
%233 = phi i64 [ 0, %229 ], [ %256, %231 ]
%234 = getelementptr inbounds double, double* %219, i64 %232
%235 = bitcast double* %234 to <2 x double>*
%236 = load <2 x double>, <2 x double>* %235
%237 = getelementptr inbounds double, double* %234, i64 2
%238 = bitcast double* %237 to <2 x double>*
%239 = load <2 x double>, <2 x double>* %238
%240 = fmul <2 x double> %236, <double 5.000000e-01, double 5.000000e-01>
%241 = fmul <2 x double> %239, <double 5.000000e-01, double 5.000000e-01>
%242 = bitcast double* %234 to <2 x double>*
store <2 x double> %240, <2 x double>* %242
%243 = bitcast double* %237 to <2 x double>*
store <2 x double> %241, <2 x double>* %243
%244 = or i64 %232, 4
%245 = getelementptr inbounds double, double* %219, i64 %244
%246 = bitcast double* %245 to <2 x double>*
%247 = load <2 x double>, <2 x double>* %246
%248 = getelementptr inbounds double, double* %245, i64 2
%249 = bitcast double* %248 to <2 x double>*
%250 = load <2 x double>, <2 x double>* %249
%251 = fmul <2 x double> %247, <double 5.000000e-01, double 5.000000e-01>
%252 = fmul <2 x double> %250, <double 5.000000e-01, double 5.000000e-01>
%253 = bitcast double* %245 to <2 x double>*
store <2 x double> %251, <2 x double>* %253
%254 = bitcast double* %248 to <2 x double>*
store <2 x double> %252, <2 x double>* %254
%255 = add nuw i64 %232, 8
%256 = add i64 %233, 2
%257 = icmp eq i64 %256, %230
br i1 %257, label %258, label %231
258: ; preds = %231, %222
%259 = phi i64 [ 0, %222 ], [ %255, %231 ]
%260 = icmp eq i64 %227, 0
br i1 %260, label %272, label %261
261: ; preds = %258
%262 = getelementptr inbounds double, double* %219, i64 %259
%263 = bitcast double* %262 to <2 x double>*
%264 = load <2 x double>, <2 x double>* %263
%265 = getelementptr inbounds double, double* %262, i64 2
%266 = bitcast double* %265 to <2 x double>*
%267 = load <2 x double>, <2 x double>* %266
%268 = fmul <2 x double> %264, <double 5.000000e-01, double 5.000000e-01>
%269 = fmul <2 x double> %267, <double 5.000000e-01, double 5.000000e-01>
%270 = bitcast double* %262 to <2 x double>*
store <2 x double> %268, <2 x double>* %270
%271 = bitcast double* %265 to <2 x double>*
store <2 x double> %269, <2 x double>* %271
br label %272
272: ; preds = %258, %261
%273 = icmp eq i64 %223, %220
br i1 %273, label %308, label %274
274: ; preds = %218, %272
%275 = phi i64 [ 0, %218 ], [ %223, %272 ]
br label %301
276: ; preds = %276, %200
%277 = phi i64 [ 0, %200 ], [ %298, %276 ]
%278 = phi i64 [ 0, %200 ], [ %299, %276 ]
%279 = getelementptr inbounds double*, double** %11, i64 %277
%280 = load double*, double** %279
%281 = load double, double* %280
%282 = fmul double %281, 5.000000e-01
store double %282, double* %280
%283 = or i64 %277, 1
%284 = getelementptr inbounds double*, double** %11, i64 %283
%285 = load double*, double** %284
%286 = load double, double* %285
%287 = fmul double %286, 5.000000e-01
store double %287, double* %285
%288 = or i64 %277, 2
%289 = getelementptr inbounds double*, double** %11, i64 %288
%290 = load double*, double** %289
%291 = load double, double* %290
%292 = fmul double %291, 5.000000e-01
store double %292, double* %290
%293 = or i64 %277, 3
%294 = getelementptr inbounds double*, double** %11, i64 %293
%295 = load double*, double** %294
%296 = load double, double* %295
%297 = fmul double %296, 5.000000e-01
store double %297, double* %295
%298 = add nuw nsw i64 %277, 4
%299 = add i64 %278, 4
%300 = icmp eq i64 %299, %201
br i1 %300, label %202, label %276
301: ; preds = %274, %301
%302 = phi i64 [ %306, %301 ], [ %275, %274 ]
%303 = getelementptr inbounds double, double* %219, i64 %302
%304 = load double, double* %303
%305 = fmul double %304, 5.000000e-01
store double %305, double* %303
%306 = add nuw nsw i64 %302, 1
%307 = icmp eq i64 %306, %220
br i1 %307, label %308, label %301
308: ; preds = %301, %272, %215
%309 = sitofp i32 %193 to double
%310 = fdiv double 4.000000e+00, %309
%311 = sitofp i32 %216 to double
%312 = fdiv double %310, %311
%313 = call double @errorcheck2d(i32 %193, i32 %216, double %312, double** %11)
%314 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0), double %313)
%315 = call i32 @free_1d_double(double* %30)
%316 = call i32 @free_1d_int(i32* %23)
%317 = call i32 @free_2d_double(double** %11)
ret i32 0
}