#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_3d_double(int, int, int);
int /*<<< orphan*/ free_1d_double(double *);
int /*<<< orphan*/ free_1d_int(int *);
int /*<<< orphan*/ free_3d_double(double ***);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
scalar_t__ sqrt(int);
int main() {
  void cdft3d(int, int, int, int, double ***, double *, int *, double *);
  void rdft3d(int, int, int, int, double ***, double *, int *, double *);
  void ddct3d(int, int, int, int, double ***, double *, int *, double *);
  void ddst3d(int, int, int, int, double ***, double *, int *, double *);
  void putdata3d(int n1, int n2, int n3, double ***a);
  double errorcheck3d(int n1, int n2, int n3, double scale, double ***a);
  int *ip, n1, n2, n3, n, nt, i, j;
  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);
  printf("data length n3=? (n3 = power of 2) \n");
  scanf("%d", &n3);
  a = alloc_3d_double(n1, n2, n3);
  nt = ((n1) > (n2) ? (n1) : (n2));
  n = ((nt) > (n3 / 2) ? (nt) : (n3 / 2));
  ip = alloc_1d_int(2 + (int)sqrt(n + 0.5));
  n = ((nt) > (n3) ? (nt) : (n3)) * 3 / 2;
  w = alloc_1d_double(n);
  ip[0] = 0;
  putdata3d(n1, n2, n3, a);
  cdft3d(n1, n2, n3, 1, a, NULL, ip, w);
  cdft3d(n1, n2, n3, -1, a, NULL, ip, w);
  err = errorcheck3d(n1, n2, n3, 2.0 / n1 / n2 / n3, a);
  printf("cdft3d err= %g \n", err);
  putdata3d(n1, n2, n3, a);
  rdft3d(n1, n2, n3, 1, a, NULL, ip, w);
  rdft3d(n1, n2, n3, -1, a, NULL, ip, w);
  err = errorcheck3d(n1, n2, n3, 2.0 / n1 / n2 / n3, a);
  printf("rdft3d err= %g \n", err);
  putdata3d(n1, n2, n3, a);
  ddct3d(n1, n2, n3, 1, a, NULL, ip, w);
  ddct3d(n1, n2, n3, -1, a, NULL, ip, w);
  for (i = 0; i <= n1 - 1; i++) {
    for (j = 0; j <= n2 - 1; j++) {
      a[i][j][0] *= 0.5;
    }
    for (j = 0; j <= n3 - 1; j++) {
      a[i][0][j] *= 0.5;
    }
  }
  for (i = 0; i <= n2 - 1; i++) {
    for (j = 0; j <= n3 - 1; j++) {
      a[0][i][j] *= 0.5;
    }
  }
  err = errorcheck3d(n1, n2, n3, 8.0 / n1 / n2 / n3, a);
  printf("ddct3d err= %g \n", err);
  putdata3d(n1, n2, n3, a);
  ddst3d(n1, n2, n3, 1, a, NULL, ip, w);
  ddst3d(n1, n2, n3, -1, a, NULL, ip, w);
  for (i = 0; i <= n1 - 1; i++) {
    for (j = 0; j <= n2 - 1; j++) {
      a[i][j][0] *= 0.5;
    }
    for (j = 0; j <= n3 - 1; j++) {
      a[i][0][j] *= 0.5;
    }
  }
  for (i = 0; i <= n2 - 1; i++) {
    for (j = 0; j <= n3 - 1; j++) {
      a[0][i][j] *= 0.5;
    }
  }
  err = errorcheck3d(n1, n2, n3, 8.0 / n1 / n2 / n3, a);
  printf("ddst3d err= %g \n", err);
  free_1d_double(w);
  free_1d_int(ip);
  free_3d_double(a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe12(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    0xe29(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   10d0 <scanf@plt>
lea    0xe1c(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    0xe0b(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   10d0 <scanf@plt>
lea    0xe23(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    0xded(%rip),%rdi
lea    -0x1c(%rbp),%rsi
call   10d0 <scanf@plt>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
call   10f0 <alloc_3d_double@plt>
mov    %rax,-0x38(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jle    1282 <main+0x92>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4c(%rbp)
jmp    1288 <main+0x98>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x50(%rbp)
mov    -0x1c(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x50(%rbp),%eax
cmp    %ecx,%eax
jle    12b7 <main+0xc7>
mov    -0x24(%rbp),%eax
mov    %eax,-0x54(%rbp)
jmp    12c5 <main+0xd5>
mov    -0x1c(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x54(%rbp)
mov    -0x54(%rbp),%eax
mov    %eax,-0x20(%rbp)
cvtsi2sdl -0x20(%rbp),%xmm0
movsd  0xd28(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   10e0 <sqrt@plt>
mov    %eax,%edi
add    $0x2,%edi
call   1100 <alloc_1d_int@plt>
mov    %rax,-0x10(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jle    130a <main+0x11a>
mov    -0x24(%rbp),%eax
mov    %eax,-0x58(%rbp)
jmp    1310 <main+0x120>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x58(%rbp)
mov    -0x58(%rbp),%eax
imul   $0x3,%eax,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%edi
call   10b0 <alloc_1d_double@plt>
mov    %rax,-0x40(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x38(%rbp),%rcx
call   1080 <putdata3d@plt>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x38(%rbp),%r8
mov    -0x10(%rbp),%r10
mov    -0x40(%rbp),%rax
mov    $0x1,%ecx
xor    %r9d,%r9d
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   10c0 <cdft3d@plt>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x38(%rbp),%r8
mov    -0x10(%rbp),%r10
mov    -0x40(%rbp),%rax
mov    $0xffffffff,%ecx
xor    %r9d,%r9d
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   10c0 <cdft3d@plt>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
cvtsi2sdl -0x14(%rbp),%xmm1
movsd  0xc53(%rip),%xmm0
divsd  %xmm1,%xmm0
cvtsi2sdl -0x18(%rbp),%xmm1
divsd  %xmm1,%xmm0
cvtsi2sdl -0x1c(%rbp),%xmm1
divsd  %xmm1,%xmm0
mov    -0x38(%rbp),%rcx
call   1040 <errorcheck3d@plt>
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm0
lea    0xca5(%rip),%rdi
mov    $0x1,%al
call   1070 <printf@plt>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x38(%rbp),%rcx
call   1080 <putdata3d@plt>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x38(%rbp),%r8
mov    -0x10(%rbp),%r10
mov    -0x40(%rbp),%rax
mov    $0x1,%ecx
xor    %r9d,%r9d
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <rdft3d@plt>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x38(%rbp),%r8
mov    -0x10(%rbp),%r10
mov    -0x40(%rbp),%rax
mov    $0xffffffff,%ecx
xor    %r9d,%r9d
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <rdft3d@plt>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
cvtsi2sdl -0x14(%rbp),%xmm1
movsd  0xb9e(%rip),%xmm0
divsd  %xmm1,%xmm0
cvtsi2sdl -0x18(%rbp),%xmm1
divsd  %xmm1,%xmm0
cvtsi2sdl -0x1c(%rbp),%xmm1
divsd  %xmm1,%xmm0
mov    -0x38(%rbp),%rcx
call   1040 <errorcheck3d@plt>
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm0
lea    0xc01(%rip),%rdi
mov    $0x1,%al
call   1070 <printf@plt>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x38(%rbp),%rcx
call   1080 <putdata3d@plt>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x38(%rbp),%r8
mov    -0x10(%rbp),%r10
mov    -0x40(%rbp),%rax
mov    $0x1,%ecx
xor    %r9d,%r9d
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   10a0 <ddct3d@plt>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x38(%rbp),%r8
mov    -0x10(%rbp),%r10
mov    -0x40(%rbp),%rax
mov    $0xffffffff,%ecx
xor    %r9d,%r9d
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   10a0 <ddct3d@plt>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     15c9 <main+0x3d9>
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
mov    -0x18(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     156b <main+0x37b>
mov    -0x38(%rbp),%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsd  0xaab(%rip),%xmm0
mulsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1528 <main+0x338>
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     15b6 <main+0x3c6>
mov    -0x38(%rbp),%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    (%rax),%rax
movslq -0x2c(%rbp),%rcx
movsd  0xa62(%rip),%xmm0
mulsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1572 <main+0x382>
jmp    15bb <main+0x3cb>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1510 <main+0x320>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
mov    -0x18(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     163f <main+0x44f>
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     162c <main+0x43c>
mov    -0x38(%rbp),%rax
mov    (%rax),%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x2c(%rbp),%rcx
movsd  0x9ec(%rip),%xmm0
mulsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    15e8 <main+0x3f8>
jmp    1631 <main+0x441>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    15d0 <main+0x3e0>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
cvtsi2sdl -0x14(%rbp),%xmm1
movsd  0x9bb(%rip),%xmm0
divsd  %xmm1,%xmm0
cvtsi2sdl -0x18(%rbp),%xmm1
divsd  %xmm1,%xmm0
cvtsi2sdl -0x1c(%rbp),%xmm1
divsd  %xmm1,%xmm0
mov    -0x38(%rbp),%rcx
call   1040 <errorcheck3d@plt>
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm0
lea    0xa27(%rip),%rdi
mov    $0x1,%al
call   1070 <printf@plt>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x38(%rbp),%rcx
call   1080 <putdata3d@plt>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x38(%rbp),%r8
mov    -0x10(%rbp),%r10
mov    -0x40(%rbp),%rax
mov    $0x1,%ecx
xor    %r9d,%r9d
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1090 <ddst3d@plt>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x38(%rbp),%r8
mov    -0x10(%rbp),%r10
mov    -0x40(%rbp),%rax
mov    $0xffffffff,%ecx
xor    %r9d,%r9d
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1090 <ddst3d@plt>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     17b4 <main+0x5c4>
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
mov    -0x18(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     1756 <main+0x566>
mov    -0x38(%rbp),%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsd  0x8c0(%rip),%xmm0
mulsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1713 <main+0x523>
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     17a1 <main+0x5b1>
mov    -0x38(%rbp),%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    (%rax),%rax
movslq -0x2c(%rbp),%rcx
movsd  0x877(%rip),%xmm0
mulsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    175d <main+0x56d>
jmp    17a6 <main+0x5b6>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    16fb <main+0x50b>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
mov    -0x18(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     182a <main+0x63a>
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     1817 <main+0x627>
mov    -0x38(%rbp),%rax
mov    (%rax),%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x2c(%rbp),%rcx
movsd  0x801(%rip),%xmm0
mulsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    17d3 <main+0x5e3>
jmp    181c <main+0x62c>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    17bb <main+0x5cb>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
cvtsi2sdl -0x14(%rbp),%xmm1
movsd  0x7d0(%rip),%xmm0
divsd  %xmm1,%xmm0
cvtsi2sdl -0x18(%rbp),%xmm1
divsd  %xmm1,%xmm0
cvtsi2sdl -0x1c(%rbp),%xmm1
divsd  %xmm1,%xmm0
mov    -0x38(%rbp),%rcx
call   1040 <errorcheck3d@plt>
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm0
lea    0x84d(%rip),%rdi
mov    $0x1,%al
call   1070 <printf@plt>
mov    -0x40(%rbp),%rdi
call   1050 <free_1d_double@plt>
mov    -0x10(%rbp),%rdi
call   1060 <free_1d_int@plt>
mov    -0x38(%rbp),%rdi
call   1110 <free_3d_double@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
lea    0xe62(%rip),%rdi
call   1060 <puts@plt>
lea    0xe0f(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   10e0 <scanf@plt>
lea    0xe66(%rip),%rdi
call   1060 <puts@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   10e0 <scanf@plt>
lea    0xe71(%rip),%rdi
call   1060 <puts@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   10e0 <scanf@plt>
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
mov    0x4(%rsp),%edx
call   1100 <alloc_3d_double@plt>
mov    %rax,%r15
mov    0xc(%rsp),%eax
mov    0x8(%rsp),%ebx
cmp    %ebx,%eax
cmovg  %eax,%ebx
mov    0x4(%rsp),%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
sar    %ecx
cmp    %ecx,%ebx
cmovg  %ebx,%ecx
cvtsi2sd %ecx,%xmm0
addsd  0xd61(%rip),%xmm0
cvttsd2si %xmm0,%edi
call   10f0 <sqrt@plt>
lea    0x2(%rax),%edi
call   1110 <alloc_1d_int@plt>
mov    %rax,%rbp
mov    0x4(%rsp),%eax
cmp    %eax,%ebx
cmovle %eax,%ebx
lea    (%rbx,%rbx,2),%eax
mov    %eax,%edi
shr    $0x1f,%edi
add    %eax,%edi
sar    %edi
call   10c0 <alloc_1d_double@plt>
mov    %rax,%rbx
movl   $0x0,0x0(%rbp)
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
mov    0x4(%rsp),%edx
mov    %r15,%rcx
call   1090 <putdata3d@plt>
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
mov    0x4(%rsp),%edx
mov    $0x1,%ecx
mov    %r15,%r8
xor    %r9d,%r9d
push   %rbx
push   %rbp
call   10d0 <cdft3d@plt>
add    $0x10,%rsp
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
mov    0x4(%rsp),%edx
mov    $0xffffffff,%ecx
mov    %r15,%r8
xor    %r9d,%r9d
push   %rbx
push   %rbp
call   10d0 <cdft3d@plt>
add    $0x10,%rsp
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
mov    0x4(%rsp),%edx
cvtsi2sd %edi,%xmm1
movsd  0xcc1(%rip),%xmm0
divsd  %xmm1,%xmm0
xorps  %xmm1,%xmm1
cvtsi2sd %esi,%xmm1
divsd  %xmm1,%xmm0
xorps  %xmm1,%xmm1
cvtsi2sd %edx,%xmm1
divsd  %xmm1,%xmm0
mov    %r15,%rcx
call   1040 <errorcheck3d@plt>
lea    0xcc3(%rip),%rdi
mov    $0x1,%al
call   1080 <printf@plt>
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
mov    0x4(%rsp),%edx
mov    %r15,%rcx
call   1090 <putdata3d@plt>
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
mov    0x4(%rsp),%edx
mov    $0x1,%ecx
mov    %r15,%r8
xor    %r9d,%r9d
push   %rbx
push   %rbp
call   1030 <rdft3d@plt>
add    $0x10,%rsp
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
mov    0x4(%rsp),%edx
mov    $0xffffffff,%ecx
mov    %r15,%r8
xor    %r9d,%r9d
push   %rbx
push   %rbp
call   1030 <rdft3d@plt>
add    $0x10,%rsp
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
xorps  %xmm0,%xmm0
cvtsi2sd %edi,%xmm0
mov    0x4(%rsp),%edx
movsd  0xc1e(%rip),%xmm1
divsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsi2sd %esi,%xmm0
divsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsi2sd %edx,%xmm0
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
mov    %r15,%rcx
call   1040 <errorcheck3d@plt>
lea    0xc2d(%rip),%rdi
mov    $0x1,%al
call   1080 <printf@plt>
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
mov    0x4(%rsp),%edx
mov    %r15,%rcx
call   1090 <putdata3d@plt>
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
mov    0x4(%rsp),%edx
mov    $0x1,%ecx
mov    %r15,%r8
xor    %r9d,%r9d
push   %rbx
push   %rbp
call   10b0 <ddct3d@plt>
add    $0x10,%rsp
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
mov    0x4(%rsp),%edx
mov    $0xffffffff,%ecx
mov    %r15,%r8
xor    %r9d,%r9d
mov    %rbx,0x10(%rsp)
push   %rbx
mov    %rbp,0x20(%rsp)
push   %rbp
call   10b0 <ddct3d@plt>
add    $0x10,%rsp
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%r13d
test   %edi,%edi
jle    1688 <main+0x488>
mov    0x4(%rsp),%eax
lea    -0x1(%r13),%r10
mov    %eax,%r11d
and    $0xfffffffc,%r11d
lea    -0x4(%r11),%r8
mov    %r8,%r9
shr    $0x2,%r9
add    $0x1,%r9
mov    %r13d,%ecx
and    $0x3,%ecx
mov    %r13d,%esi
and    $0xfffffffc,%esi
mov    %r9,%rbx
movabs $0x7ffffffffffffffe,%rdx
ff ff 7f
and    %rdx,%rbx
mov    %rbx,0x20(%rsp)
xor    %r14d,%r14d
movsd  0xb25(%rip),%xmm0
movapd 0xb3d(%rip),%xmm1
jmp    14fd <main+0x2fd>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%r14
cmp    %rdi,%r14
je     1688 <main+0x488>
test   %r13d,%r13d
jle    1599 <main+0x399>
mov    (%r15,%r14,8),%rbx
xor    %ebp,%ebp
cmp    $0x3,%r10
jb     156c <main+0x36c>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%rbx,%rbp,8),%rdx
movsd  (%rdx),%xmm2
mulsd  %xmm0,%xmm2
movsd  %xmm2,(%rdx)
mov    0x8(%rbx,%rbp,8),%rdx
movsd  (%rdx),%xmm2
mulsd  %xmm0,%xmm2
movsd  %xmm2,(%rdx)
mov    0x10(%rbx,%rbp,8),%rdx
movsd  (%rdx),%xmm2
mulsd  %xmm0,%xmm2
movsd  %xmm2,(%rdx)
mov    0x18(%rbx,%rbp,8),%rdx
movsd  (%rdx),%xmm2
mulsd  %xmm0,%xmm2
movsd  %xmm2,(%rdx)
add    $0x4,%rbp
cmp    %rbp,%rsi
jne    1520 <main+0x320>
test   %rcx,%rcx
je     1599 <main+0x399>
lea    (%rbx,%rbp,8),%rbx
xor    %ebp,%ebp
nopw   0x0(%rax,%rax,1)
mov    (%rbx,%rbp,8),%rdx
movsd  (%rdx),%xmm2
mulsd  %xmm0,%xmm2
movsd  %xmm2,(%rdx)
add    $0x1,%rbp
cmp    %rbp,%rcx
jne    1580 <main+0x380>
test   %eax,%eax
jle    14f0 <main+0x2f0>
mov    (%r15,%r14,8),%rdx
mov    (%rdx),%r12
cmp    $0x4,%eax
jae    15c0 <main+0x3c0>
xor    %ebx,%ebx
jmp    1660 <main+0x460>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
test   %r8,%r8
je     167e <main+0x47e>
mov    0x20(%rsp),%rbp
xor    %ebx,%ebx
movupd (%r12,%rbx,8),%xmm2
movupd 0x10(%r12,%rbx,8),%xmm3
movupd 0x20(%r12,%rbx,8),%xmm4
movupd 0x30(%r12,%rbx,8),%xmm5
mulpd  %xmm1,%xmm2
mulpd  %xmm1,%xmm3
movupd %xmm2,(%r12,%rbx,8)
movupd %xmm3,0x10(%r12,%rbx,8)
mulpd  %xmm1,%xmm4
mulpd  %xmm1,%xmm5
movupd %xmm4,0x20(%r12,%rbx,8)
movupd %xmm5,0x30(%r12,%rbx,8)
add    $0x8,%rbx
add    $0xfffffffffffffffe,%rbp
jne    15d0 <main+0x3d0>
test   $0x1,%r9b
je     1648 <main+0x448>
movupd (%r12,%rbx,8),%xmm2
movupd 0x10(%r12,%rbx,8),%xmm3
mulpd  %xmm1,%xmm2
mulpd  %xmm1,%xmm3
movupd %xmm2,(%r12,%rbx,8)
movupd %xmm3,0x10(%r12,%rbx,8)
mov    %r11,%rbx
cmp    %rax,%r11
je     14f0 <main+0x2f0>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsd  (%r12,%rbx,8),%xmm2
mulsd  %xmm0,%xmm2
movsd  %xmm2,(%r12,%rbx,8)
add    $0x1,%rbx
cmp    %rbx,%rax
jne    1660 <main+0x460>
jmp    14f0 <main+0x2f0>
xor    %ebx,%ebx
test   $0x1,%r9b
jne    1626 <main+0x426>
jmp    1648 <main+0x448>
mov    0x4(%rsp),%edx
test   %r13d,%r13d
jle    17b6 <main+0x5b6>
mov    %edx,%r11d
and    $0xfffffffc,%r11d
lea    -0x4(%r11),%r9
mov    %r9,%r10
shr    $0x2,%r10
add    $0x1,%r10
mov    %r10,%r8
movabs $0x7ffffffffffffffe,%rax
ff ff 7f
and    %rax,%r8
xor    %ebp,%ebp
movsd  0x93b(%rip),%xmm0
movapd 0x953(%rip),%xmm1
jmp    16dd <main+0x4dd>
nop
add    $0x1,%rbp
cmp    %r13,%rbp
je     17b6 <main+0x5b6>
test   %edx,%edx
jle    16d0 <main+0x4d0>
mov    (%r15),%rax
mov    (%rax,%rbp,8),%rbx
cmp    $0x4,%edx
jae    1700 <main+0x500>
xor    %eax,%eax
jmp    1790 <main+0x590>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
test   %r9,%r9
je     17ac <main+0x5ac>
mov    %r8,%rax
xor    %ecx,%ecx
xchg   %ax,%ax
movupd (%rbx,%rcx,8),%xmm2
movupd 0x10(%rbx,%rcx,8),%xmm3
movupd 0x20(%rbx,%rcx,8),%xmm4
movupd 0x30(%rbx,%rcx,8),%xmm5
mulpd  %xmm1,%xmm2
mulpd  %xmm1,%xmm3
movupd %xmm2,(%rbx,%rcx,8)
movupd %xmm3,0x10(%rbx,%rcx,8)
mulpd  %xmm1,%xmm4
mulpd  %xmm1,%xmm5
movupd %xmm4,0x20(%rbx,%rcx,8)
movupd %xmm5,0x30(%rbx,%rcx,8)
add    $0x8,%rcx
add    $0xfffffffffffffffe,%rax
jne    1710 <main+0x510>
test   $0x1,%r10b
je     177c <main+0x57c>
movupd (%rbx,%rcx,8),%xmm2
movupd 0x10(%rbx,%rcx,8),%xmm3
mulpd  %xmm1,%xmm2
mulpd  %xmm1,%xmm3
movupd %xmm2,(%rbx,%rcx,8)
movupd %xmm3,0x10(%rbx,%rcx,8)
mov    %r11,%rax
cmp    %rdx,%r11
je     16d0 <main+0x4d0>
nopl   0x0(%rax,%rax,1)
movsd  (%rbx,%rax,8),%xmm2
mulsd  %xmm0,%xmm2
movsd  %xmm2,(%rbx,%rax,8)
add    $0x1,%rax
cmp    %rax,%rdx
jne    1790 <main+0x590>
jmp    16d0 <main+0x4d0>
xor    %ecx,%ecx
test   $0x1,%r10b
jne    175e <main+0x55e>
jmp    177c <main+0x57c>
xorps  %xmm1,%xmm1
cvtsi2sd %edi,%xmm1
movsd  0x84b(%rip),%xmm0
divsd  %xmm1,%xmm0
xorps  %xmm1,%xmm1
cvtsi2sd %r13d,%xmm1
divsd  %xmm1,%xmm0
xorps  %xmm1,%xmm1
cvtsi2sd %edx,%xmm1
divsd  %xmm1,%xmm0
mov    %r13d,%esi
mov    %r15,%rcx
call   1040 <errorcheck3d@plt>
lea    0x863(%rip),%rdi
mov    $0x1,%al
call   1080 <printf@plt>
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
mov    0x4(%rsp),%edx
mov    %r15,%rcx
call   1090 <putdata3d@plt>
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
mov    0x4(%rsp),%edx
mov    $0x1,%ecx
mov    %r15,%r8
xor    %r9d,%r9d
mov    0x10(%rsp),%rbp
push   %rbp
mov    0x20(%rsp),%rbx
push   %rbx
call   10a0 <ddst3d@plt>
add    $0x10,%rsp
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
mov    0x4(%rsp),%edx
mov    $0xffffffff,%ecx
mov    %r15,%r8
xor    %r9d,%r9d
push   %rbp
push   %rbx
call   10a0 <ddst3d@plt>
add    $0x10,%rsp
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
test   %edi,%edi
jle    1a46 <main+0x846>
mov    0x4(%rsp),%eax
lea    -0x1(%rsi),%r10
mov    %eax,%r11d
and    $0xfffffffc,%r11d
lea    -0x4(%r11),%r8
mov    %r8,%r9
shr    $0x2,%r9
add    $0x1,%r9
mov    %esi,%ecx
and    $0x3,%ecx
mov    %esi,%r14d
and    $0xfffffffc,%r14d
mov    %r9,%r13
movabs $0x7ffffffffffffffe,%rdx
ff ff 7f
and    %rdx,%r13
xor    %r12d,%r12d
movsd  0x750(%rip),%xmm0
movapd 0x768(%rip),%xmm1
jmp    18cd <main+0x6cd>
nopw   0x0(%rax,%rax,1)
add    $0x1,%r12
cmp    %rdi,%r12
je     1a46 <main+0x846>
test   %esi,%esi
jle    196b <main+0x76b>
mov    (%r15,%r12,8),%rbx
xor    %ebp,%ebp
cmp    $0x3,%r10
jb     193c <main+0x73c>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%rbx,%rbp,8),%rdx
movsd  (%rdx),%xmm2
mulsd  %xmm0,%xmm2
movsd  %xmm2,(%rdx)
mov    0x8(%rbx,%rbp,8),%rdx
movsd  (%rdx),%xmm2
mulsd  %xmm0,%xmm2
movsd  %xmm2,(%rdx)
mov    0x10(%rbx,%rbp,8),%rdx
movsd  (%rdx),%xmm2
mulsd  %xmm0,%xmm2
movsd  %xmm2,(%rdx)
mov    0x18(%rbx,%rbp,8),%rdx
movsd  (%rdx),%xmm2
mulsd  %xmm0,%xmm2
movsd  %xmm2,(%rdx)
add    $0x4,%rbp
cmp    %rbp,%r14
jne    18f0 <main+0x6f0>
test   %rcx,%rcx
je     196b <main+0x76b>
lea    (%rbx,%rbp,8),%rdx
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
mov    (%rdx,%rbx,8),%rbp
movsd  0x0(%rbp),%xmm2
mulsd  %xmm0,%xmm2
movsd  %xmm2,0x0(%rbp)
add    $0x1,%rbx
cmp    %rbx,%rcx
jne    1950 <main+0x750>
test   %eax,%eax
jle    18c0 <main+0x6c0>
mov    (%r15,%r12,8),%rdx
mov    (%rdx),%rbx
cmp    $0x4,%eax
jae    1990 <main+0x790>
xor    %edx,%edx
jmp    1a20 <main+0x820>
cs nopw 0x0(%rax,%rax,1)
test   %r8,%r8
je     1a3c <main+0x83c>
mov    %r13,%rdx
xor    %ebp,%ebp
xchg   %ax,%ax
movupd (%rbx,%rbp,8),%xmm2
movupd 0x10(%rbx,%rbp,8),%xmm3
movupd 0x20(%rbx,%rbp,8),%xmm4
movupd 0x30(%rbx,%rbp,8),%xmm5
mulpd  %xmm1,%xmm2
mulpd  %xmm1,%xmm3
movupd %xmm2,(%rbx,%rbp,8)
movupd %xmm3,0x10(%rbx,%rbp,8)
mulpd  %xmm1,%xmm4
mulpd  %xmm1,%xmm5
movupd %xmm4,0x20(%rbx,%rbp,8)
movupd %xmm5,0x30(%rbx,%rbp,8)
add    $0x8,%rbp
add    $0xfffffffffffffffe,%rdx
jne    19a0 <main+0x7a0>
test   $0x1,%r9b
je     1a0c <main+0x80c>
movupd (%rbx,%rbp,8),%xmm2
movupd 0x10(%rbx,%rbp,8),%xmm3
mulpd  %xmm1,%xmm2
mulpd  %xmm1,%xmm3
movupd %xmm2,(%rbx,%rbp,8)
movupd %xmm3,0x10(%rbx,%rbp,8)
mov    %r11,%rdx
cmp    %rax,%r11
je     18c0 <main+0x6c0>
nopl   0x0(%rax,%rax,1)
movsd  (%rbx,%rdx,8),%xmm2
mulsd  %xmm0,%xmm2
movsd  %xmm2,(%rbx,%rdx,8)
add    $0x1,%rdx
cmp    %rdx,%rax
jne    1a20 <main+0x820>
jmp    18c0 <main+0x6c0>
xor    %ebp,%ebp
test   $0x1,%r9b
jne    19ee <main+0x7ee>
jmp    1a0c <main+0x80c>
mov    0x4(%rsp),%edx
test   %esi,%esi
movabs $0x7ffffffffffffffe,%r11
ff ff 7f
jle    1b76 <main+0x976>
mov    %edx,%r10d
and    $0xfffffffc,%r10d
lea    -0x4(%r10),%r8
mov    %r8,%r9
shr    $0x2,%r9
add    $0x1,%r9
and    %r9,%r11
xor    %ebp,%ebp
movsd  0x581(%rip),%xmm0
movapd 0x599(%rip),%xmm1
jmp    1a9d <main+0x89d>
nopl   0x0(%rax)
add    $0x1,%rbp
cmp    %rsi,%rbp
je     1b76 <main+0x976>
test   %edx,%edx
jle    1a90 <main+0x890>
mov    (%r15),%rax
mov    (%rax,%rbp,8),%rbx
cmp    $0x4,%edx
jae    1ac0 <main+0x8c0>
xor    %eax,%eax
jmp    1b50 <main+0x950>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
test   %r8,%r8
je     1b6c <main+0x96c>
mov    %r11,%rax
xor    %ecx,%ecx
xchg   %ax,%ax
movupd (%rbx,%rcx,8),%xmm2
movupd 0x10(%rbx,%rcx,8),%xmm3
movupd 0x20(%rbx,%rcx,8),%xmm4
movupd 0x30(%rbx,%rcx,8),%xmm5
mulpd  %xmm1,%xmm2
mulpd  %xmm1,%xmm3
movupd %xmm2,(%rbx,%rcx,8)
movupd %xmm3,0x10(%rbx,%rcx,8)
mulpd  %xmm1,%xmm4
mulpd  %xmm1,%xmm5
movupd %xmm4,0x20(%rbx,%rcx,8)
movupd %xmm5,0x30(%rbx,%rcx,8)
add    $0x8,%rcx
add    $0xfffffffffffffffe,%rax
jne    1ad0 <main+0x8d0>
test   $0x1,%r9b
je     1b3c <main+0x93c>
movupd (%rbx,%rcx,8),%xmm2
movupd 0x10(%rbx,%rcx,8),%xmm3
mulpd  %xmm1,%xmm2
mulpd  %xmm1,%xmm3
movupd %xmm2,(%rbx,%rcx,8)
movupd %xmm3,0x10(%rbx,%rcx,8)
mov    %r10,%rax
cmp    %rdx,%r10
je     1a90 <main+0x890>
nopl   0x0(%rax,%rax,1)
movsd  (%rbx,%rax,8),%xmm2
mulsd  %xmm0,%xmm2
movsd  %xmm2,(%rbx,%rax,8)
add    $0x1,%rax
cmp    %rax,%rdx
jne    1b50 <main+0x950>
jmp    1a90 <main+0x890>
xor    %ecx,%ecx
test   $0x1,%r9b
jne    1b1e <main+0x91e>
jmp    1b3c <main+0x93c>
xorps  %xmm1,%xmm1
cvtsi2sd %edi,%xmm1
movsd  0x48b(%rip),%xmm0
divsd  %xmm1,%xmm0
xorps  %xmm1,%xmm1
cvtsi2sd %esi,%xmm1
divsd  %xmm1,%xmm0
xorps  %xmm1,%xmm1
cvtsi2sd %edx,%xmm1
divsd  %xmm1,%xmm0
mov    %r15,%rcx
call   1040 <errorcheck3d@plt>
lea    0x4b8(%rip),%rdi
mov    $0x1,%al
call   1080 <printf@plt>
mov    0x10(%rsp),%rdi
call   1050 <free_1d_double@plt>
mov    0x18(%rsp),%rdi
call   1070 <free_1d_int@plt>
mov    %r15,%rdi
call   1120 <free_3d_double@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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 = [37 x i8] c"data length n3=? (n3 = power of 2) \0A\00"
@.str.4 = [17 x i8] c"cdft3d err= %g \0A\00"
@.str.5 = [17 x i8] c"rdft3d err= %g \0A\00"
@.str.6 = [17 x i8] c"ddct3d err= %g \0A\00"
@.str.7 = [17 x i8] c"ddst3d 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 i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca double***
%11 = alloca double*
%12 = alloca double
store i32 0, i32* %1
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0))
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.3, i64 0, i64 0))
%18 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %5)
%19 = load i32, i32* %3
%20 = load i32, i32* %4
%21 = load i32, i32* %5
%22 = call double*** @alloc_3d_double(i32 %19, i32 %20, i32 %21)
store double*** %22, double**** %10
%23 = load i32, i32* %3
%24 = load i32, i32* %4
%25 = icmp sgt i32 %23, %24
br i1 %25, label %26, label %28
26: ; preds = %0
%27 = load i32, i32* %3
br label %30
28: ; preds = %0
%29 = load i32, i32* %4
br label %30
30: ; preds = %28, %26
%31 = phi i32 [ %27, %26 ], [ %29, %28 ]
store i32 %31, i32* %7
%32 = load i32, i32* %7
%33 = load i32, i32* %5
%34 = sdiv i32 %33, 2
%35 = icmp sgt i32 %32, %34
br i1 %35, label %36, label %38
36: ; preds = %30
%37 = load i32, i32* %7
br label %41
38: ; preds = %30
%39 = load i32, i32* %5
%40 = sdiv i32 %39, 2
br label %41
41: ; preds = %38, %36
%42 = phi i32 [ %37, %36 ], [ %40, %38 ]
store i32 %42, i32* %6
%43 = load i32, i32* %6
%44 = sitofp i32 %43 to double
%45 = fadd double %44, 5.000000e-01
%46 = fptosi double %45 to i32
%47 = call i64 @sqrt(i32 %46)
%48 = trunc i64 %47 to i32
%49 = add nsw i32 2, %48
%50 = call i32* @alloc_1d_int(i32 %49)
store i32* %50, i32** %2
%51 = load i32, i32* %7
%52 = load i32, i32* %5
%53 = icmp sgt i32 %51, %52
br i1 %53, label %54, label %56
54: ; preds = %41
%55 = load i32, i32* %7
br label %58
56: ; preds = %41
%57 = load i32, i32* %5
br label %58
58: ; preds = %56, %54
%59 = phi i32 [ %55, %54 ], [ %57, %56 ]
%60 = mul nsw i32 %59, 3
%61 = sdiv i32 %60, 2
store i32 %61, i32* %6
%62 = load i32, i32* %6
%63 = call double* @alloc_1d_double(i32 %62)
store double* %63, double** %11
%64 = load i32*, i32** %2
%65 = getelementptr inbounds i32, i32* %64, i64 0
store i32 0, i32* %65
%66 = load i32, i32* %3
%67 = load i32, i32* %4
%68 = load i32, i32* %5
%69 = load double***, double**** %10
%70 = load i32, i32* %3
%71 = load i32, i32* %4
%72 = load i32, i32* %5
%73 = load double***, double**** %10
%74 = load i32*, i32** %2
%75 = load double*, double** %11
%76 = load i32, i32* %3
%77 = load i32, i32* %4
%78 = load i32, i32* %5
%79 = load double***, double**** %10
%80 = load i32*, i32** %2
%81 = load double*, double** %11
%82 = load i32, i32* %3
%83 = load i32, i32* %4
%84 = load i32, i32* %5
%85 = load i32, i32* %3
%86 = sitofp i32 %85 to double
%87 = fdiv double 2.000000e+00, %86
%88 = load i32, i32* %4
%89 = sitofp i32 %88 to double
%90 = fdiv double %87, %89
%91 = load i32, i32* %5
%92 = sitofp i32 %91 to double
%93 = fdiv double %90, %92
%94 = load double***, double**** %10
%95 = call double @errorcheck3d(i32 %82, i32 %83, i32 %84, double %93, double*** %94)
store double %95, double* %12
%96 = load double, double* %12
%97 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), double %96)
%98 = load i32, i32* %3
%99 = load i32, i32* %4
%100 = load i32, i32* %5
%101 = load double***, double**** %10
%102 = load i32, i32* %3
%103 = load i32, i32* %4
%104 = load i32, i32* %5
%105 = load double***, double**** %10
%106 = load i32*, i32** %2
%107 = load double*, double** %11
%108 = load i32, i32* %3
%109 = load i32, i32* %4
%110 = load i32, i32* %5
%111 = load double***, double**** %10
%112 = load i32*, i32** %2
%113 = load double*, double** %11
%114 = load i32, i32* %3
%115 = load i32, i32* %4
%116 = load i32, i32* %5
%117 = load i32, i32* %3
%118 = sitofp i32 %117 to double
%119 = fdiv double 2.000000e+00, %118
%120 = load i32, i32* %4
%121 = sitofp i32 %120 to double
%122 = fdiv double %119, %121
%123 = load i32, i32* %5
%124 = sitofp i32 %123 to double
%125 = fdiv double %122, %124
%126 = load double***, double**** %10
%127 = call double @errorcheck3d(i32 %114, i32 %115, i32 %116, double %125, double*** %126)
store double %127, double* %12
%128 = load double, double* %12
%129 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0), double %128)
%130 = load i32, i32* %3
%131 = load i32, i32* %4
%132 = load i32, i32* %5
%133 = load double***, double**** %10
%134 = load i32, i32* %3
%135 = load i32, i32* %4
%136 = load i32, i32* %5
%137 = load double***, double**** %10
%138 = load i32*, i32** %2
%139 = load double*, double** %11
%140 = load i32, i32* %3
%141 = load i32, i32* %4
%142 = load i32, i32* %5
%143 = load double***, double**** %10
%144 = load i32*, i32** %2
%145 = load double*, double** %11
store i32 0, i32* %8
br label %146
146: ; preds = %196, %58
%147 = load i32, i32* %8
%148 = load i32, i32* %3
%149 = sub nsw i32 %148, 1
%150 = icmp sle i32 %147, %149
br i1 %150, label %151, label %199
151: ; preds = %146
store i32 0, i32* %9
br label %152
152: ; preds = %170, %151
%153 = load i32, i32* %9
%154 = load i32, i32* %4
%155 = sub nsw i32 %154, 1
%156 = icmp sle i32 %153, %155
br i1 %156, label %157, label %173
157: ; preds = %152
%158 = load double***, double**** %10
%159 = load i32, i32* %8
%160 = sext i32 %159 to i64
%161 = getelementptr inbounds double**, double*** %158, i64 %160
%162 = load double**, double*** %161
%163 = load i32, i32* %9
%164 = sext i32 %163 to i64
%165 = getelementptr inbounds double*, double** %162, i64 %164
%166 = load double*, double** %165
%167 = getelementptr inbounds double, double* %166, i64 0
%168 = load double, double* %167
%169 = fmul double %168, 5.000000e-01
store double %169, double* %167
br label %170
170: ; preds = %157
%171 = load i32, i32* %9
%172 = add nsw i32 %171, 1
store i32 %172, i32* %9
br label %152
173: ; preds = %152
store i32 0, i32* %9
br label %174
174: ; preds = %192, %173
%175 = load i32, i32* %9
%176 = load i32, i32* %5
%177 = sub nsw i32 %176, 1
%178 = icmp sle i32 %175, %177
br i1 %178, label %179, label %195
179: ; preds = %174
%180 = load double***, double**** %10
%181 = load i32, i32* %8
%182 = sext i32 %181 to i64
%183 = getelementptr inbounds double**, double*** %180, i64 %182
%184 = load double**, double*** %183
%185 = getelementptr inbounds double*, double** %184, i64 0
%186 = load double*, double** %185
%187 = load i32, i32* %9
%188 = sext i32 %187 to i64
%189 = getelementptr inbounds double, double* %186, i64 %188
%190 = load double, double* %189
%191 = fmul double %190, 5.000000e-01
store double %191, double* %189
br label %192
192: ; preds = %179
%193 = load i32, i32* %9
%194 = add nsw i32 %193, 1
store i32 %194, i32* %9
br label %174
195: ; preds = %174
br label %196
196: ; preds = %195
%197 = load i32, i32* %8
%198 = add nsw i32 %197, 1
store i32 %198, i32* %8
br label %146
199: ; preds = %146
store i32 0, i32* %8
br label %200
200: ; preds = %228, %199
%201 = load i32, i32* %8
%202 = load i32, i32* %4
%203 = sub nsw i32 %202, 1
%204 = icmp sle i32 %201, %203
br i1 %204, label %205, label %231
205: ; preds = %200
store i32 0, i32* %9
br label %206
206: ; preds = %224, %205
%207 = load i32, i32* %9
%208 = load i32, i32* %5
%209 = sub nsw i32 %208, 1
%210 = icmp sle i32 %207, %209
br i1 %210, label %211, label %227
211: ; preds = %206
%212 = load double***, double**** %10
%213 = getelementptr inbounds double**, double*** %212, i64 0
%214 = load double**, double*** %213
%215 = load i32, i32* %8
%216 = sext i32 %215 to i64
%217 = getelementptr inbounds double*, double** %214, i64 %216
%218 = load double*, double** %217
%219 = load i32, i32* %9
%220 = sext i32 %219 to i64
%221 = getelementptr inbounds double, double* %218, i64 %220
%222 = load double, double* %221
%223 = fmul double %222, 5.000000e-01
store double %223, double* %221
br label %224
224: ; preds = %211
%225 = load i32, i32* %9
%226 = add nsw i32 %225, 1
store i32 %226, i32* %9
br label %206
227: ; preds = %206
br label %228
228: ; preds = %227
%229 = load i32, i32* %8
%230 = add nsw i32 %229, 1
store i32 %230, i32* %8
br label %200
231: ; preds = %200
%232 = load i32, i32* %3
%233 = load i32, i32* %4
%234 = load i32, i32* %5
%235 = load i32, i32* %3
%236 = sitofp i32 %235 to double
%237 = fdiv double 8.000000e+00, %236
%238 = load i32, i32* %4
%239 = sitofp i32 %238 to double
%240 = fdiv double %237, %239
%241 = load i32, i32* %5
%242 = sitofp i32 %241 to double
%243 = fdiv double %240, %242
%244 = load double***, double**** %10
%245 = call double @errorcheck3d(i32 %232, i32 %233, i32 %234, double %243, double*** %244)
store double %245, double* %12
%246 = load double, double* %12
%247 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0), double %246)
%248 = load i32, i32* %3
%249 = load i32, i32* %4
%250 = load i32, i32* %5
%251 = load double***, double**** %10
%252 = load i32, i32* %3
%253 = load i32, i32* %4
%254 = load i32, i32* %5
%255 = load double***, double**** %10
%256 = load i32*, i32** %2
%257 = load double*, double** %11
%258 = load i32, i32* %3
%259 = load i32, i32* %4
%260 = load i32, i32* %5
%261 = load double***, double**** %10
%262 = load i32*, i32** %2
%263 = load double*, double** %11
store i32 0, i32* %8
br label %264
264: ; preds = %314, %231
%265 = load i32, i32* %8
%266 = load i32, i32* %3
%267 = sub nsw i32 %266, 1
%268 = icmp sle i32 %265, %267
br i1 %268, label %269, label %317
269: ; preds = %264
store i32 0, i32* %9
br label %270
270: ; preds = %288, %269
%271 = load i32, i32* %9
%272 = load i32, i32* %4
%273 = sub nsw i32 %272, 1
%274 = icmp sle i32 %271, %273
br i1 %274, label %275, label %291
275: ; preds = %270
%276 = load double***, double**** %10
%277 = load i32, i32* %8
%278 = sext i32 %277 to i64
%279 = getelementptr inbounds double**, double*** %276, i64 %278
%280 = load double**, double*** %279
%281 = load i32, i32* %9
%282 = sext i32 %281 to i64
%283 = getelementptr inbounds double*, double** %280, i64 %282
%284 = load double*, double** %283
%285 = getelementptr inbounds double, double* %284, i64 0
%286 = load double, double* %285
%287 = fmul double %286, 5.000000e-01
store double %287, double* %285
br label %288
288: ; preds = %275
%289 = load i32, i32* %9
%290 = add nsw i32 %289, 1
store i32 %290, i32* %9
br label %270
291: ; preds = %270
store i32 0, i32* %9
br label %292
292: ; preds = %310, %291
%293 = load i32, i32* %9
%294 = load i32, i32* %5
%295 = sub nsw i32 %294, 1
%296 = icmp sle i32 %293, %295
br i1 %296, label %297, label %313
297: ; preds = %292
%298 = load double***, double**** %10
%299 = load i32, i32* %8
%300 = sext i32 %299 to i64
%301 = getelementptr inbounds double**, double*** %298, i64 %300
%302 = load double**, double*** %301
%303 = getelementptr inbounds double*, double** %302, i64 0
%304 = load double*, double** %303
%305 = load i32, i32* %9
%306 = sext i32 %305 to i64
%307 = getelementptr inbounds double, double* %304, i64 %306
%308 = load double, double* %307
%309 = fmul double %308, 5.000000e-01
store double %309, double* %307
br label %310
310: ; preds = %297
%311 = load i32, i32* %9
%312 = add nsw i32 %311, 1
store i32 %312, i32* %9
br label %292
313: ; preds = %292
br label %314
314: ; preds = %313
%315 = load i32, i32* %8
%316 = add nsw i32 %315, 1
store i32 %316, i32* %8
br label %264
317: ; preds = %264
store i32 0, i32* %8
br label %318
318: ; preds = %346, %317
%319 = load i32, i32* %8
%320 = load i32, i32* %4
%321 = sub nsw i32 %320, 1
%322 = icmp sle i32 %319, %321
br i1 %322, label %323, label %349
323: ; preds = %318
store i32 0, i32* %9
br label %324
324: ; preds = %342, %323
%325 = load i32, i32* %9
%326 = load i32, i32* %5
%327 = sub nsw i32 %326, 1
%328 = icmp sle i32 %325, %327
br i1 %328, label %329, label %345
329: ; preds = %324
%330 = load double***, double**** %10
%331 = getelementptr inbounds double**, double*** %330, i64 0
%332 = load double**, double*** %331
%333 = load i32, i32* %8
%334 = sext i32 %333 to i64
%335 = getelementptr inbounds double*, double** %332, i64 %334
%336 = load double*, double** %335
%337 = load i32, i32* %9
%338 = sext i32 %337 to i64
%339 = getelementptr inbounds double, double* %336, i64 %338
%340 = load double, double* %339
%341 = fmul double %340, 5.000000e-01
store double %341, double* %339
br label %342
342: ; preds = %329
%343 = load i32, i32* %9
%344 = add nsw i32 %343, 1
store i32 %344, i32* %9
br label %324
345: ; preds = %324
br label %346
346: ; preds = %345
%347 = load i32, i32* %8
%348 = add nsw i32 %347, 1
store i32 %348, i32* %8
br label %318
349: ; preds = %318
%350 = load i32, i32* %3
%351 = load i32, i32* %4
%352 = load i32, i32* %5
%353 = load i32, i32* %3
%354 = sitofp i32 %353 to double
%355 = fdiv double 8.000000e+00, %354
%356 = load i32, i32* %4
%357 = sitofp i32 %356 to double
%358 = fdiv double %355, %357
%359 = load i32, i32* %5
%360 = sitofp i32 %359 to double
%361 = fdiv double %358, %360
%362 = load double***, double**** %10
%363 = call double @errorcheck3d(i32 %350, i32 %351, i32 %352, double %361, double*** %362)
store double %363, double* %12
%364 = load double, double* %12
%365 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.7, i64 0, i64 0), double %364)
%366 = load double*, double** %11
%367 = call i32 @free_1d_double(double* %366)
%368 = load i32*, i32** %2
%369 = call i32 @free_1d_int(i32* %368)
%370 = load double***, double**** %10
%371 = call i32 @free_3d_double(double*** %370)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.4 = [17 x i8] c"cdft3d err= %g \0A\00"
@.str.5 = [17 x i8] c"rdft3d err= %g \0A\00"
@.str.6 = [17 x i8] c"ddct3d err= %g \0A\00"
@.str.7 = [17 x i8] c"ddst3d err= %g \0A\00"
@str = [36 x i8] c"data length n1=? (n1 = power of 2) \00"
@str.8 = [36 x i8] c"data length n2=? (n2 = power of 2) \00"
@str.9 = [36 x i8] c"data length n3=? (n3 = power of 2) \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.8, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.9, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%13 = load i32, i32* %1
%14 = load i32, i32* %2
%15 = load i32, i32* %3
%16 = call double*** @alloc_3d_double(i32 %13, i32 %14, i32 %15)
%17 = load i32, i32* %1
%18 = load i32, i32* %2
%19 = icmp sgt i32 %17, %18
%20 = select i1 %19, i32 %17, i32 %18
%21 = load i32, i32* %3
%22 = sdiv i32 %21, 2
%23 = icmp sgt i32 %20, %22
%24 = select i1 %23, i32 %20, i32 %22
%25 = sitofp i32 %24 to double
%26 = fadd double %25, 5.000000e-01
%27 = fptosi double %26 to i32
%28 = call i64 @sqrt(i32 %27)
%29 = trunc i64 %28 to i32
%30 = add nsw i32 %29, 2
%31 = call i32* @alloc_1d_int(i32 %30)
%32 = load i32, i32* %3
%33 = icmp sgt i32 %20, %32
%34 = select i1 %33, i32 %20, i32 %32
%35 = mul nsw i32 %34, 3
%36 = sdiv i32 %35, 2
%37 = call double* @alloc_1d_double(i32 %36)
store i32 0, i32* %31
%38 = load i32, i32* %1
%39 = load i32, i32* %2
%40 = load i32, i32* %3
%41 = load i32, i32* %1
%42 = load i32, i32* %2
%43 = load i32, i32* %3
%44 = load i32, i32* %1
%45 = load i32, i32* %2
%46 = load i32, i32* %3
%47 = load i32, i32* %1
%48 = load i32, i32* %2
%49 = load i32, i32* %3
%50 = sitofp i32 %47 to double
%51 = fdiv double 2.000000e+00, %50
%52 = sitofp i32 %48 to double
%53 = fdiv double %51, %52
%54 = sitofp i32 %49 to double
%55 = fdiv double %53, %54
%56 = call double @errorcheck3d(i32 %47, i32 %48, i32 %49, double %55, double*** %16)
%57 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), double %56)
%58 = load i32, i32* %1
%59 = load i32, i32* %2
%60 = load i32, i32* %3
%61 = load i32, i32* %1
%62 = load i32, i32* %2
%63 = load i32, i32* %3
%64 = load i32, i32* %1
%65 = load i32, i32* %2
%66 = load i32, i32* %3
%67 = load i32, i32* %1
%68 = load i32, i32* %2
%69 = load i32, i32* %3
%70 = sitofp i32 %67 to double
%71 = fdiv double 2.000000e+00, %70
%72 = sitofp i32 %68 to double
%73 = fdiv double %71, %72
%74 = sitofp i32 %69 to double
%75 = fdiv double %73, %74
%76 = call double @errorcheck3d(i32 %67, i32 %68, i32 %69, double %75, double*** %16)
%77 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0), double %76)
%78 = load i32, i32* %1
%79 = load i32, i32* %2
%80 = load i32, i32* %3
%81 = load i32, i32* %1
%82 = load i32, i32* %2
%83 = load i32, i32* %3
%84 = load i32, i32* %1
%85 = load i32, i32* %2
%86 = load i32, i32* %3
%87 = load i32, i32* %1
%88 = icmp sgt i32 %87, 0
%89 = load i32, i32* %2
br i1 %88, label %90, label %118
90: ; preds = %0
%91 = icmp sgt i32 %89, 0
%92 = load i32, i32* %3
%93 = icmp sgt i32 %92, 0
%94 = zext i32 %87 to i64
%95 = zext i32 %89 to i64
%96 = zext i32 %92 to i64
%97 = add nsw i64 %95, -1
%98 = and i64 %96, 4294967292
%99 = add nsw i64 %98, -4
%100 = lshr exact i64 %99, 2
%101 = add nuw nsw i64 %100, 1
%102 = and i64 %95, 3
%103 = icmp ult i64 %97, 3
%104 = and i64 %95, 4294967292
%105 = icmp eq i64 %102, 0
%106 = icmp ult i32 %92, 4
%107 = and i64 %96, 4294967292
%108 = and i64 %101, 1
%109 = icmp eq i64 %99, 0
%110 = and i64 %101, 9223372036854775806
%111 = icmp eq i64 %108, 0
%112 = icmp eq i64 %107, %96
br label %113
113: ; preds = %90, %229
%114 = phi i64 [ 0, %90 ], [ %230, %229 ]
br i1 %91, label %115, label %148
115: ; preds = %113
%116 = getelementptr inbounds double**, double*** %16, i64 %114
%117 = load double**, double*** %116
br i1 %103, label %136, label %197
118: ; preds = %229, %0
%119 = icmp sgt i32 %89, 0
%120 = load i32, i32* %3
br i1 %119, label %121, label %292
121: ; preds = %118
%122 = icmp sgt i32 %120, 0
%123 = zext i32 %89 to i64
%124 = zext i32 %120 to i64
%125 = and i64 %124, 4294967292
%126 = add nsw i64 %125, -4
%127 = lshr exact i64 %126, 2
%128 = add nuw nsw i64 %127, 1
%129 = icmp ult i32 %120, 4
%130 = and i64 %124, 4294967292
%131 = and i64 %128, 1
%132 = icmp eq i64 %126, 0
%133 = and i64 %128, 9223372036854775806
%134 = icmp eq i64 %131, 0
%135 = icmp eq i64 %130, %124
br label %232
136: ; preds = %197, %115
%137 = phi i64 [ 0, %115 ], [ %219, %197 ]
br i1 %105, label %148, label %138
138: ; preds = %136, %138
%139 = phi i64 [ %145, %138 ], [ %137, %136 ]
%140 = phi i64 [ %146, %138 ], [ 0, %136 ]
%141 = getelementptr inbounds double*, double** %117, i64 %139
%142 = load double*, double** %141
%143 = load double, double* %142
%144 = fmul double %143, 5.000000e-01
store double %144, double* %142
%145 = add nuw nsw i64 %139, 1
%146 = add i64 %140, 1
%147 = icmp eq i64 %146, %102
br i1 %147, label %148, label %138
148: ; preds = %136, %138, %113
br i1 %93, label %149, label %229
149: ; preds = %148
%150 = getelementptr inbounds double**, double*** %16, i64 %114
%151 = load double**, double*** %150
%152 = load double*, double** %151
br i1 %106, label %195, label %153
153: ; preds = %149
br i1 %109, label %181, label %154
154: ; preds = %153, %154
%155 = phi i64 [ %178, %154 ], [ 0, %153 ]
%156 = phi i64 [ %179, %154 ], [ 0, %153 ]
%157 = getelementptr inbounds double, double* %152, i64 %155
%158 = bitcast double* %157 to <2 x double>*
%159 = load <2 x double>, <2 x double>* %158
%160 = getelementptr inbounds double, double* %157, i64 2
%161 = bitcast double* %160 to <2 x double>*
%162 = load <2 x double>, <2 x double>* %161
%163 = fmul <2 x double> %159, <double 5.000000e-01, double 5.000000e-01>
%164 = fmul <2 x double> %162, <double 5.000000e-01, double 5.000000e-01>
%165 = bitcast double* %157 to <2 x double>*
store <2 x double> %163, <2 x double>* %165
%166 = bitcast double* %160 to <2 x double>*
store <2 x double> %164, <2 x double>* %166
%167 = or i64 %155, 4
%168 = getelementptr inbounds double, double* %152, i64 %167
%169 = bitcast double* %168 to <2 x double>*
%170 = load <2 x double>, <2 x double>* %169
%171 = getelementptr inbounds double, double* %168, i64 2
%172 = bitcast double* %171 to <2 x double>*
%173 = load <2 x double>, <2 x double>* %172
%174 = fmul <2 x double> %170, <double 5.000000e-01, double 5.000000e-01>
%175 = fmul <2 x double> %173, <double 5.000000e-01, double 5.000000e-01>
%176 = bitcast double* %168 to <2 x double>*
store <2 x double> %174, <2 x double>* %176
%177 = bitcast double* %171 to <2 x double>*
store <2 x double> %175, <2 x double>* %177
%178 = add nuw i64 %155, 8
%179 = add i64 %156, 2
%180 = icmp eq i64 %179, %110
br i1 %180, label %181, label %154
181: ; preds = %154, %153
%182 = phi i64 [ 0, %153 ], [ %178, %154 ]
br i1 %111, label %194, label %183
183: ; preds = %181
%184 = getelementptr inbounds double, double* %152, i64 %182
%185 = bitcast double* %184 to <2 x double>*
%186 = load <2 x double>, <2 x double>* %185
%187 = getelementptr inbounds double, double* %184, i64 2
%188 = bitcast double* %187 to <2 x double>*
%189 = load <2 x double>, <2 x double>* %188
%190 = fmul <2 x double> %186, <double 5.000000e-01, double 5.000000e-01>
%191 = fmul <2 x double> %189, <double 5.000000e-01, double 5.000000e-01>
%192 = bitcast double* %184 to <2 x double>*
store <2 x double> %190, <2 x double>* %192
%193 = bitcast double* %187 to <2 x double>*
store <2 x double> %191, <2 x double>* %193
br label %194
194: ; preds = %181, %183
br i1 %112, label %229, label %195
195: ; preds = %149, %194
%196 = phi i64 [ 0, %149 ], [ %107, %194 ]
br label %222
197: ; preds = %115, %197
%198 = phi i64 [ %219, %197 ], [ 0, %115 ]
%199 = phi i64 [ %220, %197 ], [ 0, %115 ]
%200 = getelementptr inbounds double*, double** %117, i64 %198
%201 = load double*, double** %200
%202 = load double, double* %201
%203 = fmul double %202, 5.000000e-01
store double %203, double* %201
%204 = or i64 %198, 1
%205 = getelementptr inbounds double*, double** %117, i64 %204
%206 = load double*, double** %205
%207 = load double, double* %206
%208 = fmul double %207, 5.000000e-01
store double %208, double* %206
%209 = or i64 %198, 2
%210 = getelementptr inbounds double*, double** %117, i64 %209
%211 = load double*, double** %210
%212 = load double, double* %211
%213 = fmul double %212, 5.000000e-01
store double %213, double* %211
%214 = or i64 %198, 3
%215 = getelementptr inbounds double*, double** %117, i64 %214
%216 = load double*, double** %215
%217 = load double, double* %216
%218 = fmul double %217, 5.000000e-01
store double %218, double* %216
%219 = add nuw nsw i64 %198, 4
%220 = add i64 %199, 4
%221 = icmp eq i64 %220, %104
br i1 %221, label %136, label %197
222: ; preds = %195, %222
%223 = phi i64 [ %227, %222 ], [ %196, %195 ]
%224 = getelementptr inbounds double, double* %152, i64 %223
%225 = load double, double* %224
%226 = fmul double %225, 5.000000e-01
store double %226, double* %224
%227 = add nuw nsw i64 %223, 1
%228 = icmp eq i64 %227, %96
br i1 %228, label %229, label %222
229: ; preds = %222, %194, %148
%230 = add nuw nsw i64 %114, 1
%231 = icmp eq i64 %230, %94
br i1 %231, label %118, label %113
232: ; preds = %121, %289
%233 = phi i64 [ 0, %121 ], [ %290, %289 ]
br i1 %122, label %234, label %289
234: ; preds = %232
%235 = load double**, double*** %16
%236 = getelementptr inbounds double*, double** %235, i64 %233
%237 = load double*, double** %236
br i1 %129, label %280, label %238
238: ; preds = %234
br i1 %132, label %266, label %239
239: ; preds = %238, %239
%240 = phi i64 [ %263, %239 ], [ 0, %238 ]
%241 = phi i64 [ %264, %239 ], [ 0, %238 ]
%242 = getelementptr inbounds double, double* %237, i64 %240
%243 = bitcast double* %242 to <2 x double>*
%244 = load <2 x double>, <2 x double>* %243
%245 = getelementptr inbounds double, double* %242, i64 2
%246 = bitcast double* %245 to <2 x double>*
%247 = load <2 x double>, <2 x double>* %246
%248 = fmul <2 x double> %244, <double 5.000000e-01, double 5.000000e-01>
%249 = fmul <2 x double> %247, <double 5.000000e-01, double 5.000000e-01>
%250 = bitcast double* %242 to <2 x double>*
store <2 x double> %248, <2 x double>* %250
%251 = bitcast double* %245 to <2 x double>*
store <2 x double> %249, <2 x double>* %251
%252 = or i64 %240, 4
%253 = getelementptr inbounds double, double* %237, i64 %252
%254 = bitcast double* %253 to <2 x double>*
%255 = load <2 x double>, <2 x double>* %254
%256 = getelementptr inbounds double, double* %253, i64 2
%257 = bitcast double* %256 to <2 x double>*
%258 = load <2 x double>, <2 x double>* %257
%259 = fmul <2 x double> %255, <double 5.000000e-01, double 5.000000e-01>
%260 = fmul <2 x double> %258, <double 5.000000e-01, double 5.000000e-01>
%261 = bitcast double* %253 to <2 x double>*
store <2 x double> %259, <2 x double>* %261
%262 = bitcast double* %256 to <2 x double>*
store <2 x double> %260, <2 x double>* %262
%263 = add nuw i64 %240, 8
%264 = add i64 %241, 2
%265 = icmp eq i64 %264, %133
br i1 %265, label %266, label %239
266: ; preds = %239, %238
%267 = phi i64 [ 0, %238 ], [ %263, %239 ]
br i1 %134, label %279, label %268
268: ; preds = %266
%269 = getelementptr inbounds double, double* %237, i64 %267
%270 = bitcast double* %269 to <2 x double>*
%271 = load <2 x double>, <2 x double>* %270
%272 = getelementptr inbounds double, double* %269, i64 2
%273 = bitcast double* %272 to <2 x double>*
%274 = load <2 x double>, <2 x double>* %273
%275 = fmul <2 x double> %271, <double 5.000000e-01, double 5.000000e-01>
%276 = fmul <2 x double> %274, <double 5.000000e-01, double 5.000000e-01>
%277 = bitcast double* %269 to <2 x double>*
store <2 x double> %275, <2 x double>* %277
%278 = bitcast double* %272 to <2 x double>*
store <2 x double> %276, <2 x double>* %278
br label %279
279: ; preds = %266, %268
br i1 %135, label %289, label %280
280: ; preds = %234, %279
%281 = phi i64 [ 0, %234 ], [ %130, %279 ]
br label %282
282: ; preds = %280, %282
%283 = phi i64 [ %287, %282 ], [ %281, %280 ]
%284 = getelementptr inbounds double, double* %237, i64 %283
%285 = load double, double* %284
%286 = fmul double %285, 5.000000e-01
store double %286, double* %284
%287 = add nuw nsw i64 %283, 1
%288 = icmp eq i64 %287, %124
br i1 %288, label %289, label %282
289: ; preds = %282, %279, %232
%290 = add nuw nsw i64 %233, 1
%291 = icmp eq i64 %290, %123
br i1 %291, label %292, label %232
292: ; preds = %289, %118
%293 = sitofp i32 %87 to double
%294 = fdiv double 8.000000e+00, %293
%295 = sitofp i32 %89 to double
%296 = fdiv double %294, %295
%297 = sitofp i32 %120 to double
%298 = fdiv double %296, %297
%299 = call double @errorcheck3d(i32 %87, i32 %89, i32 %120, double %298, double*** %16)
%300 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0), double %299)
%301 = load i32, i32* %1
%302 = load i32, i32* %2
%303 = load i32, i32* %3
%304 = load i32, i32* %1
%305 = load i32, i32* %2
%306 = load i32, i32* %3
%307 = load i32, i32* %1
%308 = load i32, i32* %2
%309 = load i32, i32* %3
%310 = load i32, i32* %1
%311 = icmp sgt i32 %310, 0
%312 = load i32, i32* %2
br i1 %311, label %313, label %341
313: ; preds = %292
%314 = icmp sgt i32 %312, 0
%315 = load i32, i32* %3
%316 = icmp sgt i32 %315, 0
%317 = zext i32 %310 to i64
%318 = zext i32 %312 to i64
%319 = zext i32 %315 to i64
%320 = add nsw i64 %318, -1
%321 = and i64 %319, 4294967292
%322 = add nsw i64 %321, -4
%323 = lshr exact i64 %322, 2
%324 = add nuw nsw i64 %323, 1
%325 = and i64 %318, 3
%326 = icmp ult i64 %320, 3
%327 = and i64 %318, 4294967292
%328 = icmp eq i64 %325, 0
%329 = icmp ult i32 %315, 4
%330 = and i64 %319, 4294967292
%331 = and i64 %324, 1
%332 = icmp eq i64 %322, 0
%333 = and i64 %324, 9223372036854775806
%334 = icmp eq i64 %331, 0
%335 = icmp eq i64 %330, %319
br label %336
336: ; preds = %313, %452
%337 = phi i64 [ 0, %313 ], [ %453, %452 ]
br i1 %314, label %338, label %371
338: ; preds = %336
%339 = getelementptr inbounds double**, double*** %16, i64 %337
%340 = load double**, double*** %339
br i1 %326, label %359, label %420
341: ; preds = %452, %292
%342 = icmp sgt i32 %312, 0
%343 = load i32, i32* %3
br i1 %342, label %344, label %515
344: ; preds = %341
%345 = icmp sgt i32 %343, 0
%346 = zext i32 %312 to i64
%347 = zext i32 %343 to i64
%348 = and i64 %347, 4294967292
%349 = add nsw i64 %348, -4
%350 = lshr exact i64 %349, 2
%351 = add nuw nsw i64 %350, 1
%352 = icmp ult i32 %343, 4
%353 = and i64 %347, 4294967292
%354 = and i64 %351, 1
%355 = icmp eq i64 %349, 0
%356 = and i64 %351, 9223372036854775806
%357 = icmp eq i64 %354, 0
%358 = icmp eq i64 %353, %347
br label %455
359: ; preds = %420, %338
%360 = phi i64 [ 0, %338 ], [ %442, %420 ]
br i1 %328, label %371, label %361
361: ; preds = %359, %361
%362 = phi i64 [ %368, %361 ], [ %360, %359 ]
%363 = phi i64 [ %369, %361 ], [ 0, %359 ]
%364 = getelementptr inbounds double*, double** %340, i64 %362
%365 = load double*, double** %364
%366 = load double, double* %365
%367 = fmul double %366, 5.000000e-01
store double %367, double* %365
%368 = add nuw nsw i64 %362, 1
%369 = add i64 %363, 1
%370 = icmp eq i64 %369, %325
br i1 %370, label %371, label %361
371: ; preds = %359, %361, %336
br i1 %316, label %372, label %452
372: ; preds = %371
%373 = getelementptr inbounds double**, double*** %16, i64 %337
%374 = load double**, double*** %373
%375 = load double*, double** %374
br i1 %329, label %418, label %376
376: ; preds = %372
br i1 %332, label %404, label %377
377: ; preds = %376, %377
%378 = phi i64 [ %401, %377 ], [ 0, %376 ]
%379 = phi i64 [ %402, %377 ], [ 0, %376 ]
%380 = getelementptr inbounds double, double* %375, i64 %378
%381 = bitcast double* %380 to <2 x double>*
%382 = load <2 x double>, <2 x double>* %381
%383 = getelementptr inbounds double, double* %380, i64 2
%384 = bitcast double* %383 to <2 x double>*
%385 = load <2 x double>, <2 x double>* %384
%386 = fmul <2 x double> %382, <double 5.000000e-01, double 5.000000e-01>
%387 = fmul <2 x double> %385, <double 5.000000e-01, double 5.000000e-01>
%388 = bitcast double* %380 to <2 x double>*
store <2 x double> %386, <2 x double>* %388
%389 = bitcast double* %383 to <2 x double>*
store <2 x double> %387, <2 x double>* %389
%390 = or i64 %378, 4
%391 = getelementptr inbounds double, double* %375, i64 %390
%392 = bitcast double* %391 to <2 x double>*
%393 = load <2 x double>, <2 x double>* %392
%394 = getelementptr inbounds double, double* %391, i64 2
%395 = bitcast double* %394 to <2 x double>*
%396 = load <2 x double>, <2 x double>* %395
%397 = fmul <2 x double> %393, <double 5.000000e-01, double 5.000000e-01>
%398 = fmul <2 x double> %396, <double 5.000000e-01, double 5.000000e-01>
%399 = bitcast double* %391 to <2 x double>*
store <2 x double> %397, <2 x double>* %399
%400 = bitcast double* %394 to <2 x double>*
store <2 x double> %398, <2 x double>* %400
%401 = add nuw i64 %378, 8
%402 = add i64 %379, 2
%403 = icmp eq i64 %402, %333
br i1 %403, label %404, label %377
404: ; preds = %377, %376
%405 = phi i64 [ 0, %376 ], [ %401, %377 ]
br i1 %334, label %417, label %406
406: ; preds = %404
%407 = getelementptr inbounds double, double* %375, i64 %405
%408 = bitcast double* %407 to <2 x double>*
%409 = load <2 x double>, <2 x double>* %408
%410 = getelementptr inbounds double, double* %407, i64 2
%411 = bitcast double* %410 to <2 x double>*
%412 = load <2 x double>, <2 x double>* %411
%413 = fmul <2 x double> %409, <double 5.000000e-01, double 5.000000e-01>
%414 = fmul <2 x double> %412, <double 5.000000e-01, double 5.000000e-01>
%415 = bitcast double* %407 to <2 x double>*
store <2 x double> %413, <2 x double>* %415
%416 = bitcast double* %410 to <2 x double>*
store <2 x double> %414, <2 x double>* %416
br label %417
417: ; preds = %404, %406
br i1 %335, label %452, label %418
418: ; preds = %372, %417
%419 = phi i64 [ 0, %372 ], [ %330, %417 ]
br label %445
420: ; preds = %338, %420
%421 = phi i64 [ %442, %420 ], [ 0, %338 ]
%422 = phi i64 [ %443, %420 ], [ 0, %338 ]
%423 = getelementptr inbounds double*, double** %340, i64 %421
%424 = load double*, double** %423
%425 = load double, double* %424
%426 = fmul double %425, 5.000000e-01
store double %426, double* %424
%427 = or i64 %421, 1
%428 = getelementptr inbounds double*, double** %340, i64 %427
%429 = load double*, double** %428
%430 = load double, double* %429
%431 = fmul double %430, 5.000000e-01
store double %431, double* %429
%432 = or i64 %421, 2
%433 = getelementptr inbounds double*, double** %340, i64 %432
%434 = load double*, double** %433
%435 = load double, double* %434
%436 = fmul double %435, 5.000000e-01
store double %436, double* %434
%437 = or i64 %421, 3
%438 = getelementptr inbounds double*, double** %340, i64 %437
%439 = load double*, double** %438
%440 = load double, double* %439
%441 = fmul double %440, 5.000000e-01
store double %441, double* %439
%442 = add nuw nsw i64 %421, 4
%443 = add i64 %422, 4
%444 = icmp eq i64 %443, %327
br i1 %444, label %359, label %420
445: ; preds = %418, %445
%446 = phi i64 [ %450, %445 ], [ %419, %418 ]
%447 = getelementptr inbounds double, double* %375, i64 %446
%448 = load double, double* %447
%449 = fmul double %448, 5.000000e-01
store double %449, double* %447
%450 = add nuw nsw i64 %446, 1
%451 = icmp eq i64 %450, %319
br i1 %451, label %452, label %445
452: ; preds = %445, %417, %371
%453 = add nuw nsw i64 %337, 1
%454 = icmp eq i64 %453, %317
br i1 %454, label %341, label %336
455: ; preds = %344, %512
%456 = phi i64 [ 0, %344 ], [ %513, %512 ]
br i1 %345, label %457, label %512
457: ; preds = %455
%458 = load double**, double*** %16
%459 = getelementptr inbounds double*, double** %458, i64 %456
%460 = load double*, double** %459
br i1 %352, label %503, label %461
461: ; preds = %457
br i1 %355, label %489, label %462
462: ; preds = %461, %462
%463 = phi i64 [ %486, %462 ], [ 0, %461 ]
%464 = phi i64 [ %487, %462 ], [ 0, %461 ]
%465 = getelementptr inbounds double, double* %460, i64 %463
%466 = bitcast double* %465 to <2 x double>*
%467 = load <2 x double>, <2 x double>* %466
%468 = getelementptr inbounds double, double* %465, i64 2
%469 = bitcast double* %468 to <2 x double>*
%470 = load <2 x double>, <2 x double>* %469
%471 = fmul <2 x double> %467, <double 5.000000e-01, double 5.000000e-01>
%472 = fmul <2 x double> %470, <double 5.000000e-01, double 5.000000e-01>
%473 = bitcast double* %465 to <2 x double>*
store <2 x double> %471, <2 x double>* %473
%474 = bitcast double* %468 to <2 x double>*
store <2 x double> %472, <2 x double>* %474
%475 = or i64 %463, 4
%476 = getelementptr inbounds double, double* %460, i64 %475
%477 = bitcast double* %476 to <2 x double>*
%478 = load <2 x double>, <2 x double>* %477
%479 = getelementptr inbounds double, double* %476, i64 2
%480 = bitcast double* %479 to <2 x double>*
%481 = load <2 x double>, <2 x double>* %480
%482 = fmul <2 x double> %478, <double 5.000000e-01, double 5.000000e-01>
%483 = fmul <2 x double> %481, <double 5.000000e-01, double 5.000000e-01>
%484 = bitcast double* %476 to <2 x double>*
store <2 x double> %482, <2 x double>* %484
%485 = bitcast double* %479 to <2 x double>*
store <2 x double> %483, <2 x double>* %485
%486 = add nuw i64 %463, 8
%487 = add i64 %464, 2
%488 = icmp eq i64 %487, %356
br i1 %488, label %489, label %462
489: ; preds = %462, %461
%490 = phi i64 [ 0, %461 ], [ %486, %462 ]
br i1 %357, label %502, label %491
491: ; preds = %489
%492 = getelementptr inbounds double, double* %460, i64 %490
%493 = bitcast double* %492 to <2 x double>*
%494 = load <2 x double>, <2 x double>* %493
%495 = getelementptr inbounds double, double* %492, i64 2
%496 = bitcast double* %495 to <2 x double>*
%497 = load <2 x double>, <2 x double>* %496
%498 = fmul <2 x double> %494, <double 5.000000e-01, double 5.000000e-01>
%499 = fmul <2 x double> %497, <double 5.000000e-01, double 5.000000e-01>
%500 = bitcast double* %492 to <2 x double>*
store <2 x double> %498, <2 x double>* %500
%501 = bitcast double* %495 to <2 x double>*
store <2 x double> %499, <2 x double>* %501
br label %502
502: ; preds = %489, %491
br i1 %358, label %512, label %503
503: ; preds = %457, %502
%504 = phi i64 [ 0, %457 ], [ %353, %502 ]
br label %505
505: ; preds = %503, %505
%506 = phi i64 [ %510, %505 ], [ %504, %503 ]
%507 = getelementptr inbounds double, double* %460, i64 %506
%508 = load double, double* %507
%509 = fmul double %508, 5.000000e-01
store double %509, double* %507
%510 = add nuw nsw i64 %506, 1
%511 = icmp eq i64 %510, %347
br i1 %511, label %512, label %505
512: ; preds = %505, %502, %455
%513 = add nuw nsw i64 %456, 1
%514 = icmp eq i64 %513, %346
br i1 %514, label %515, label %455
515: ; preds = %512, %341
%516 = sitofp i32 %310 to double
%517 = fdiv double 8.000000e+00, %516
%518 = sitofp i32 %312 to double
%519 = fdiv double %517, %518
%520 = sitofp i32 %343 to double
%521 = fdiv double %519, %520
%522 = call double @errorcheck3d(i32 %310, i32 %312, i32 %343, double %521, double*** %16)
%523 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.7, i64 0, i64 0), double %522)
%524 = call i32 @free_1d_double(double* %37)
%525 = call i32 @free_1d_int(i32* %31)
%526 = call i32 @free_3d_double(double*** %16)
ret i32 0
}