#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 */
typedef double clock_t;

/* Variables and functions */
double clock();
int /*<<< orphan*/ compimages(double *, double *, double *, int, double *,
                              double *, double *, double *, double *, double *,
                              double *, double *, int *, int *, double *);
int /*<<< orphan*/ free(double *);
int /*<<< orphan*/ invwavelet_transform3D(double *, int, int, int, int, int,
                                          double *);
scalar_t__ malloc(unsigned int);
int /*<<< orphan*/ memcpy(double *, double *, size_t);
int /*<<< orphan*/ printf(char *, ...);
unsigned int random();
int /*<<< orphan*/ show_compresults(double, double, double, double, double,
                                    double, double, double, int, int, double *,
                                    int, double);
int /*<<< orphan*/ wavelet_transform3D(double *, int, int, int, int, int,
                                       double *);
int main() {
  int Xlength = 512;
  int Ylength = 513;
  int Zlength = 511;
  clock_t time0, time1, time2, time3, time4, time5;
  double *body, *body_out;
  double *waveletcoeff;
  unsigned int a = 0;
  unsigned int mask12 = 0xfff;
  double *ptr;
  int size;
  double *diffvector;
  double *body_save;
  double maxvalue = 0;
  double poserror = 0;
  double negerror = 0;
  double error2 = 0;
  double norm2 = 0;
  double error1 = 0;
  double norm1 = 0;
  double dsum = 0;
  double errorlog10 = 0;
  int nonexactnumber = 0;
  int Size = 0;
  double SNR;
  int k;
  printf("Test of reconstruction with symmetric biorthogonal filters \n        "
         "  Filterlength=%d, Number of scales=%d\n\n",
         9, 10);
  size = Xlength * Ylength * Zlength;
  body = (double *)malloc((unsigned int)(size * sizeof(double)));
  waveletcoeff = (double *)malloc((unsigned int)(size * sizeof(double)));
  body_out = (double *)malloc((unsigned int)(size * sizeof(double)));
  body_save = (double *)malloc((unsigned int)(size * sizeof(double)));
  diffvector = (double *)malloc((unsigned int)(size * sizeof(double)));
  ptr = body;
  time0 = clock();
  for (k = 0; k < size; k++) {
    a = mask12 & random();
    *ptr++ = (double)a;
  }
  time1 = clock();
  memcpy(body_save, body, (size_t)size * sizeof(double));
  printf("\n");
  time2 = clock();
  wavelet_transform3D(body, Xlength, Ylength, Zlength, 9, 10, waveletcoeff);
  time3 = clock();
  printf("\n");
  invwavelet_transform3D(waveletcoeff, Xlength, Ylength, Zlength, 9, 10,
                         body_out);
  time4 = clock();
  printf("\n");
  compimages(body_save, body_out, diffvector, size, &maxvalue, &poserror,
             &negerror, &error2, &norm2, &error1, &norm1, &errorlog10,
             &nonexactnumber, &Size, &dsum);
  time5 = clock();
  printf("Size %d x %d x %d, random: %f sek,copy %f ,  WT  %f sek, invWT %f "
         "sek, compare %f sek\n",
         Xlength, Ylength, Zlength, 0.000001 * (time1 - time0),
         0.000001 * (time2 - time1), 0.000001 * (time3 - time2),
         0.000001 * (time4 - time3), 0.000001 * (time5 - time4));
  if (body != NULL)
    free(body);
  if (body_save != NULL)
    free(body_save);
  if (body_out != NULL)
    free(body_out);
  if (waveletcoeff != NULL)
    free(waveletcoeff);
  show_compresults(maxvalue, poserror, negerror, error2, norm2, error1, norm1,
                   errorlog10, nonexactnumber, size, &SNR, sizeof(double),
                   dsum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x138,%rsp
movl   $0x0,-0x2c(%rbp)
movl   $0x200,-0x30(%rbp)
movl   $0x201,-0x34(%rbp)
movl   $0x1ff,-0x38(%rbp)
movl   $0x0,-0x84(%rbp)
movl   $0xfff,-0x88(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xd8(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xe0(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xe8(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xf0(%rbp)
ff
movl   $0x0,-0xf4(%rbp)
movl   $0x0,-0xf8(%rbp)
lea    0xda6(%rip),%rdi
mov    $0x9,%esi
mov    $0xa,%edx
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x30(%rbp),%eax
imul   -0x34(%rbp),%eax
imul   -0x38(%rbp),%eax
mov    %eax,-0x94(%rbp)
movslq -0x94(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1090 <malloc@plt>
mov    %rax,-0x70(%rbp)
movslq -0x94(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1090 <malloc@plt>
mov    %rax,-0x80(%rbp)
movslq -0x94(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1090 <malloc@plt>
mov    %rax,-0x78(%rbp)
movslq -0x94(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1090 <malloc@plt>
mov    %rax,-0xa8(%rbp)
movslq -0x94(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1090 <malloc@plt>
mov    %rax,-0xa0(%rbp)
mov    -0x70(%rbp),%rax
mov    %rax,-0x90(%rbp)
mov    $0x0,%al
call   1040 <clock@plt>
movsd  %xmm0,-0x40(%rbp)
movl   $0x0,-0x104(%rbp)
mov    -0x104(%rbp),%eax
cmp    -0x94(%rbp),%eax
jge    1386 <main+0x1e6>
mov    -0x88(%rbp),%eax
mov    %eax,-0x108(%rbp)
xor    %eax,%eax
call   1080 <random@plt>
mov    %eax,%ecx
mov    -0x108(%rbp),%eax
and    %ecx,%eax
mov    %eax,-0x84(%rbp)
mov    -0x84(%rbp),%eax
cvtsi2sd %rax,%xmm0
mov    -0x90(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x90(%rbp)
movsd  %xmm0,(%rax)
mov    -0x104(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x104(%rbp)
jmp    1319 <main+0x179>
mov    $0x0,%al
call   1040 <clock@plt>
movsd  %xmm0,-0x48(%rbp)
mov    -0xa8(%rbp),%rdi
mov    -0x70(%rbp),%rsi
movslq -0x94(%rbp),%rdx
shl    $0x3,%rdx
call   1070 <memcpy@plt>
lea    0xcbf(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   1040 <clock@plt>
movsd  %xmm0,-0x50(%rbp)
mov    -0x70(%rbp),%rdi
mov    -0x30(%rbp),%esi
mov    -0x34(%rbp),%edx
mov    -0x38(%rbp),%ecx
mov    -0x80(%rbp),%rax
mov    $0x9,%r8d
mov    $0xa,%r9d
mov    %rax,(%rsp)
call   10c0 <wavelet_transform3D@plt>
mov    $0x0,%al
call   1040 <clock@plt>
movsd  %xmm0,-0x58(%rbp)
lea    0xc73(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x80(%rbp),%rdi
mov    -0x30(%rbp),%esi
mov    -0x34(%rbp),%edx
mov    -0x38(%rbp),%ecx
mov    -0x78(%rbp),%rax
mov    $0x9,%r8d
mov    $0xa,%r9d
mov    %rax,(%rsp)
call   1060 <invwavelet_transform3D@plt>
mov    $0x0,%al
call   1040 <clock@plt>
movsd  %xmm0,-0x60(%rbp)
lea    0xc33(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0xa8(%rbp),%rdi
mov    -0x78(%rbp),%rsi
mov    -0xa0(%rbp),%rdx
mov    -0x94(%rbp),%ecx
lea    -0xb0(%rbp),%r8
lea    -0xb8(%rbp),%r9
lea    -0xc0(%rbp),%rax
mov    %rax,-0x118(%rbp)
lea    -0xc8(%rbp),%r13
lea    -0xd0(%rbp),%r12
lea    -0xd8(%rbp),%r15
lea    -0xe0(%rbp),%r14
lea    -0xf0(%rbp),%rbx
lea    -0xf4(%rbp),%r11
lea    -0xf8(%rbp),%r10
lea    -0xe8(%rbp),%rax
mov    %rax,-0x110(%rbp)
mov    -0x118(%rbp),%rax
mov    %rax,(%rsp)
mov    -0x110(%rbp),%rax
mov    %r13,0x8(%rsp)
mov    %r12,0x10(%rsp)
mov    %r15,0x18(%rsp)
mov    %r14,0x20(%rsp)
mov    %rbx,0x28(%rsp)
mov    %r11,0x30(%rsp)
mov    %r10,0x38(%rsp)
mov    %rax,0x40(%rsp)
call   10a0 <compimages@plt>
mov    $0x0,%al
call   1040 <clock@plt>
movsd  %xmm0,-0x68(%rbp)
mov    -0x30(%rbp),%esi
mov    -0x34(%rbp),%edx
mov    -0x38(%rbp),%ecx
movsd  -0x48(%rbp),%xmm1
subsd  -0x40(%rbp),%xmm1
movsd  0xae0(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  -0x50(%rbp),%xmm2
subsd  -0x48(%rbp),%xmm2
movsd  0xaca(%rip),%xmm1
mulsd  %xmm2,%xmm1
movsd  -0x58(%rbp),%xmm3
subsd  -0x50(%rbp),%xmm3
movsd  0xab4(%rip),%xmm2
mulsd  %xmm3,%xmm2
movsd  -0x60(%rbp),%xmm4
subsd  -0x58(%rbp),%xmm4
movsd  0xa9e(%rip),%xmm3
mulsd  %xmm4,%xmm3
movsd  -0x68(%rbp),%xmm5
subsd  -0x60(%rbp),%xmm5
movsd  0xa88(%rip),%xmm4
mulsd  %xmm5,%xmm4
lea    0xaf2(%rip),%rdi
mov    $0x5,%al
call   1050 <printf@plt>
cmpq   $0x0,-0x70(%rbp)
je     159e <main+0x3fe>
mov    -0x70(%rbp),%rdi
call   1030 <free@plt>
cmpq   $0x0,-0xa8(%rbp)
je     15b8 <main+0x418>
mov    -0xa8(%rbp),%rdi
call   1030 <free@plt>
cmpq   $0x0,-0x78(%rbp)
je     15cc <main+0x42c>
mov    -0x78(%rbp),%rdi
call   1030 <free@plt>
cmpq   $0x0,-0x80(%rbp)
je     15e0 <main+0x440>
mov    -0x80(%rbp),%rdi
call   1030 <free@plt>
movsd  -0xb0(%rbp),%xmm0
ff
movsd  -0xb8(%rbp),%xmm1
ff
movsd  -0xc0(%rbp),%xmm2
ff
movsd  -0xc8(%rbp),%xmm3
ff
movsd  -0xd0(%rbp),%xmm4
ff
movsd  -0xd8(%rbp),%xmm5
ff
movsd  -0xe0(%rbp),%xmm6
ff
movsd  -0xf0(%rbp),%xmm7
ff
mov    -0xf4(%rbp),%edi
mov    -0x94(%rbp),%esi
movsd  -0xe8(%rbp),%xmm8
ff ff
lea    -0x100(%rbp),%rdx
mov    $0x8,%ecx
movsd  %xmm8,(%rsp)
call   10b0 <show_compresults@plt>
xor    %eax,%eax
add    $0x138,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x98,%rsp
movq   $0x0,0x48(%rsp)
movq   $0x0,0x40(%rsp)
movq   $0x0,0x38(%rsp)
movq   $0x0,0x30(%rsp)
movq   $0x0,0x28(%rsp)
movq   $0x0,0x20(%rsp)
movq   $0x0,0x18(%rsp)
movq   $0x0,0x10(%rsp)
movq   $0x0,0x8(%rsp)
movl   $0x0,(%rsp)
movl   $0x0,0x4(%rsp)
lea    0xde0(%rip),%rdi
mov    $0x9,%esi
mov    $0xa,%edx
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x3ffff000,%edi
call   10a0 <malloc@plt>
mov    %rax,%rbx
mov    $0x3ffff000,%edi
call   10a0 <malloc@plt>
mov    %rax,%r14
mov    $0x3ffff000,%edi
call   10a0 <malloc@plt>
mov    %rax,%r15
mov    $0x3ffff000,%edi
call   10a0 <malloc@plt>
mov    %rax,%r12
mov    $0x3ffff000,%edi
call   10a0 <malloc@plt>
mov    %rax,0x68(%rsp)
xor    %eax,%eax
call   1050 <clock@plt>
movsd  %xmm0,0x78(%rsp)
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1090 <random@plt>
and    $0xfff,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,(%rbx,%rbp,8)
add    $0x1,%rbp
cmp    $0x7fffe00,%ebp
jne    1290 <main+0xe0>
xor    %eax,%eax
call   1050 <clock@plt>
movsd  %xmm0,0x70(%rsp)
mov    $0x3ffff000,%edx
mov    %r12,%rdi
mov    %rbx,%rsi
call   1080 <memcpy@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
xor    %eax,%eax
call   1050 <clock@plt>
movsd  %xmm0,0x60(%rsp)
sub    $0x8,%rsp
mov    %rbx,%rdi
mov    $0x200,%esi
mov    $0x201,%edx
mov    $0x1ff,%ecx
mov    $0x9,%r8d
mov    $0xa,%r9d
push   %r14
call   10d0 <wavelet_transform3D@plt>
add    $0x10,%rsp
xor    %eax,%eax
call   1050 <clock@plt>
movsd  %xmm0,0x58(%rsp)
mov    $0xa,%edi
call   1040 <putchar@plt>
sub    $0x8,%rsp
mov    %r14,0x90(%rsp)
mov    %r14,%rdi
mov    $0x200,%esi
mov    $0x201,%edx
mov    $0x1ff,%ecx
mov    $0x9,%r8d
mov    $0xa,%r9d
push   %r15
call   1070 <invwavelet_transform3D@plt>
add    $0x10,%rsp
xor    %eax,%eax
call   1050 <clock@plt>
movsd  %xmm0,0x50(%rsp)
mov    $0xa,%edi
call   1040 <putchar@plt>
sub    $0x8,%rsp
lea    0x18(%rsp),%rax
lea    0xc(%rsp),%rbp
lea    0x8(%rsp),%r10
lea    0x10(%rsp),%r11
lea    0x20(%rsp),%r13
lea    0x28(%rsp),%r14
mov    %r15,%rsi
lea    0x30(%rsp),%r15
lea    0x50(%rsp),%r8
lea    0x48(%rsp),%r9
mov    %r12,%rdi
mov    %rsi,0x88(%rsp)
mov    0x70(%rsp),%rdx
mov    $0x7fffe00,%ecx
push   %rax
push   %rbp
push   %r10
push   %r11
push   %r13
push   %r14
push   %r15
lea    0x70(%rsp),%rax
push   %rax
lea    0x80(%rsp),%rax
push   %rax
call   10b0 <compimages@plt>
add    $0x50,%rsp
xor    %eax,%eax
call   1050 <clock@plt>
movsd  0x50(%rsp),%xmm3
subsd  %xmm3,%xmm0
movsd  0x58(%rsp),%xmm2
subsd  %xmm2,%xmm3
movsd  0x60(%rsp),%xmm6
subsd  %xmm6,%xmm2
movsd  0x70(%rsp),%xmm5
subsd  %xmm5,%xmm6
subsd  0x78(%rsp),%xmm5
movsd  0xbde(%rip),%xmm4
mulsd  %xmm4,%xmm5
mulsd  %xmm4,%xmm6
movapd %xmm6,%xmm1
mulsd  %xmm4,%xmm2
mulsd  %xmm4,%xmm3
mulsd  %xmm0,%xmm4
lea    0xc34(%rip),%rdi
mov    $0x200,%esi
mov    $0x201,%edx
mov    $0x1ff,%ecx
movapd %xmm5,%xmm0
mov    $0x5,%al
call   1060 <printf@plt>
test   %rbx,%rbx
je     1468 <main+0x2b8>
mov    %rbx,%rdi
call   1030 <free@plt>
test   %r12,%r12
je     1475 <main+0x2c5>
mov    %r12,%rdi
call   1030 <free@plt>
mov    0x80(%rsp),%rdi
test   %rdi,%rdi
mov    0x88(%rsp),%rbx
je     148f <main+0x2df>
call   1030 <free@plt>
test   %rbx,%rbx
je     149c <main+0x2ec>
mov    %rbx,%rdi
call   1030 <free@plt>
movsd  0x48(%rsp),%xmm0
movsd  0x40(%rsp),%xmm1
movsd  0x38(%rsp),%xmm2
movsd  0x30(%rsp),%xmm3
movsd  0x28(%rsp),%xmm4
movsd  0x20(%rsp),%xmm5
movsd  0x18(%rsp),%xmm6
movsd  0x8(%rsp),%xmm7
mov    (%rsp),%edi
movsd  0x10(%rsp),%xmm8
sub    $0x10,%rsp
movsd  %xmm8,(%rsp)
lea    0xa0(%rsp),%rdx
mov    $0x7fffe00,%esi
mov    $0x8,%ecx
call   10c0 <show_compresults@plt>
add    $0x10,%rsp
xor    %eax,%eax
add    $0x98,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [109 x i8] c"Test of reconstruction with symmetric biorthogonal filters \0A Filterlength=%d, Number of scales=%d\0A\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [87 x i8] c"Size %d x %d x %d, random: %f sek,copy %f , WT %f sek, invWT %f sek, compare %f sek\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double*
%12 = alloca double*
%13 = alloca double*
%14 = alloca i32
%15 = alloca i32
%16 = alloca double*
%17 = alloca i32
%18 = alloca double*
%19 = alloca double*
%20 = alloca double
%21 = alloca double
%22 = alloca double
%23 = alloca double
%24 = alloca double
%25 = alloca double
%26 = alloca double
%27 = alloca double
%28 = alloca double
%29 = alloca i32
%30 = alloca i32
%31 = alloca double
%32 = alloca i32
store i32 0, i32* %1
store i32 512, i32* %2
store i32 513, i32* %3
store i32 511, i32* %4
store i32 0, i32* %14
store i32 4095, i32* %15
store double 0.000000e+00, double* %20
store double 0.000000e+00, double* %21
store double 0.000000e+00, double* %22
store double 0.000000e+00, double* %23
store double 0.000000e+00, double* %24
store double 0.000000e+00, double* %25
store double 0.000000e+00, double* %26
store double 0.000000e+00, double* %27
store double 0.000000e+00, double* %28
store i32 0, i32* %29
store i32 0, i32* %30
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([109 x i8], [109 x i8]* @.str, i64 0, i64 0), i32 9, i32 10)
%34 = load i32, i32* %2
%35 = load i32, i32* %3
%36 = mul nsw i32 %34, %35
%37 = load i32, i32* %4
%38 = mul nsw i32 %36, %37
store i32 %38, i32* %17
%39 = load i32, i32* %17
%40 = sext i32 %39 to i64
%41 = mul i64 %40, 8
%42 = trunc i64 %41 to i32
%43 = call i64 @malloc(i32 %42)
%44 = inttoptr i64 %43 to double*
store double* %44, double** %11
%45 = load i32, i32* %17
%46 = sext i32 %45 to i64
%47 = mul i64 %46, 8
%48 = trunc i64 %47 to i32
%49 = call i64 @malloc(i32 %48)
%50 = inttoptr i64 %49 to double*
store double* %50, double** %13
%51 = load i32, i32* %17
%52 = sext i32 %51 to i64
%53 = mul i64 %52, 8
%54 = trunc i64 %53 to i32
%55 = call i64 @malloc(i32 %54)
%56 = inttoptr i64 %55 to double*
store double* %56, double** %12
%57 = load i32, i32* %17
%58 = sext i32 %57 to i64
%59 = mul i64 %58, 8
%60 = trunc i64 %59 to i32
%61 = call i64 @malloc(i32 %60)
%62 = inttoptr i64 %61 to double*
store double* %62, double** %19
%63 = load i32, i32* %17
%64 = sext i32 %63 to i64
%65 = mul i64 %64, 8
%66 = trunc i64 %65 to i32
%67 = call i64 @malloc(i32 %66)
%68 = inttoptr i64 %67 to double*
store double* %68, double** %18
%69 = load double*, double** %11
store double* %69, double** %16
%70 = call double (...) @clock()
store double %70, double* %5
store i32 0, i32* %32
br label %71
71: ; preds = %83, %0
%72 = load i32, i32* %32
%73 = load i32, i32* %17
%74 = icmp slt i32 %72, %73
br i1 %74, label %75, label %86
75: ; preds = %71
%76 = load i32, i32* %15
%77 = call i32 (...) @random()
%78 = and i32 %76, %77
store i32 %78, i32* %14
%79 = load i32, i32* %14
%80 = uitofp i32 %79 to double
%81 = load double*, double** %16
%82 = getelementptr inbounds double, double* %81, i32 1
store double* %82, double** %16
store double %80, double* %81
br label %83
83: ; preds = %75
%84 = load i32, i32* %32
%85 = add nsw i32 %84, 1
store i32 %85, i32* %32
br label %71
86: ; preds = %71
%87 = call double (...) @clock()
store double %87, double* %6
%88 = load double*, double** %19
%89 = load double*, double** %11
%90 = load i32, i32* %17
%91 = sext i32 %90 to i64
%92 = mul i64 %91, 8
%93 = call i32 @memcpy(double* %88, double* %89, i64 %92)
%94 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%95 = call double (...) @clock()
store double %95, double* %7
%96 = load double*, double** %11
%97 = load i32, i32* %2
%98 = load i32, i32* %3
%99 = load i32, i32* %4
%100 = load double*, double** %13
%101 = call i32 @wavelet_transform3D(double* %96, i32 %97, i32 %98, i32 %99, i32 9, i32 10, double* %100)
%102 = call double (...) @clock()
store double %102, double* %8
%103 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%104 = load double*, double** %13
%105 = load i32, i32* %2
%106 = load i32, i32* %3
%107 = load i32, i32* %4
%108 = load double*, double** %12
%109 = call i32 @invwavelet_transform3D(double* %104, i32 %105, i32 %106, i32 %107, i32 9, i32 10, double* %108)
%110 = call double (...) @clock()
store double %110, double* %9
%111 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%112 = load double*, double** %19
%113 = load double*, double** %12
%114 = load double*, double** %18
%115 = load i32, i32* %17
%116 = call i32 @compimages(double* %112, double* %113, double* %114, i32 %115, double* %20, double* %21, double* %22, double* %23, double* %24, double* %25, double* %26, double* %28, i32* %29, i32* %30, double* %27)
%117 = call double (...) @clock()
store double %117, double* %10
%118 = load i32, i32* %2
%119 = load i32, i32* %3
%120 = load i32, i32* %4
%121 = load double, double* %6
%122 = load double, double* %5
%123 = fsub double %121, %122
%124 = fmul double 0x3EB0C6F7A0B5ED8D, %123
%125 = load double, double* %7
%126 = load double, double* %6
%127 = fsub double %125, %126
%128 = fmul double 0x3EB0C6F7A0B5ED8D, %127
%129 = load double, double* %8
%130 = load double, double* %7
%131 = fsub double %129, %130
%132 = fmul double 0x3EB0C6F7A0B5ED8D, %131
%133 = load double, double* %9
%134 = load double, double* %8
%135 = fsub double %133, %134
%136 = fmul double 0x3EB0C6F7A0B5ED8D, %135
%137 = load double, double* %10
%138 = load double, double* %9
%139 = fsub double %137, %138
%140 = fmul double 0x3EB0C6F7A0B5ED8D, %139
%141 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([87 x i8], [87 x i8]* @.str.2, i64 0, i64 0), i32 %118, i32 %119, i32 %120, double %124, double %128, double %132, double %136, double %140)
%142 = load double*, double** %11
%143 = icmp ne double* %142, null
br i1 %143, label %144, label %147
144: ; preds = %86
%145 = load double*, double** %11
%146 = call i32 @free(double* %145)
br label %147
147: ; preds = %144, %86
%148 = load double*, double** %19
%149 = icmp ne double* %148, null
br i1 %149, label %150, label %153
150: ; preds = %147
%151 = load double*, double** %19
%152 = call i32 @free(double* %151)
br label %153
153: ; preds = %150, %147
%154 = load double*, double** %12
%155 = icmp ne double* %154, null
br i1 %155, label %156, label %159
156: ; preds = %153
%157 = load double*, double** %12
%158 = call i32 @free(double* %157)
br label %159
159: ; preds = %156, %153
%160 = load double*, double** %13
%161 = icmp ne double* %160, null
br i1 %161, label %162, label %165
162: ; preds = %159
%163 = load double*, double** %13
%164 = call i32 @free(double* %163)
br label %165
165: ; preds = %162, %159
%166 = load double, double* %20
%167 = load double, double* %21
%168 = load double, double* %22
%169 = load double, double* %23
%170 = load double, double* %24
%171 = load double, double* %25
%172 = load double, double* %26
%173 = load double, double* %28
%174 = load i32, i32* %29
%175 = load i32, i32* %17
%176 = load double, double* %27
%177 = call i32 @show_compresults(double %166, double %167, double %168, double %169, double %170, double %171, double %172, double %173, i32 %174, i32 %175, double* %31, i32 8, double %176)
ret i32 0
}

LLVM IR (-O2):
@.str = [109 x i8] c"Test of reconstruction with symmetric biorthogonal filters \0A Filterlength=%d, Number of scales=%d\0A\0A\00"
@.str.2 = [87 x i8] c"Size %d x %d x %d, random: %f sek,copy %f , WT %f sek, invWT %f sek, compare %f sek\0A\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca i32
%11 = alloca i32
%12 = alloca double
%13 = bitcast double* %1 to i8*
store double 0.000000e+00, double* %1
%14 = bitcast double* %2 to i8*
store double 0.000000e+00, double* %2
%15 = bitcast double* %3 to i8*
store double 0.000000e+00, double* %3
%16 = bitcast double* %4 to i8*
store double 0.000000e+00, double* %4
%17 = bitcast double* %5 to i8*
store double 0.000000e+00, double* %5
%18 = bitcast double* %6 to i8*
store double 0.000000e+00, double* %6
%19 = bitcast double* %7 to i8*
store double 0.000000e+00, double* %7
%20 = bitcast double* %8 to i8*
store double 0.000000e+00, double* %8
%21 = bitcast double* %9 to i8*
store double 0.000000e+00, double* %9
%22 = bitcast i32* %10 to i8*
store i32 0, i32* %10
%23 = bitcast i32* %11 to i8*
store i32 0, i32* %11
%24 = bitcast double* %12 to i8*
%25 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([109 x i8], [109 x i8]* @.str, i64 0, i64 0), i32 9, i32 10)
%26 = tail call i64 @malloc(i32 1073737728)
%27 = inttoptr i64 %26 to double*
%28 = tail call i64 @malloc(i32 1073737728)
%29 = tail call i64 @malloc(i32 1073737728)
%30 = tail call i64 @malloc(i32 1073737728)
%31 = tail call i64 @malloc(i32 1073737728)
%32 = tail call double (...) @clock()
br label %33
33: ; preds = %0, %33
%34 = phi i32 [ 0, %0 ], [ %40, %33 ]
%35 = phi double* [ %27, %0 ], [ %39, %33 ]
%36 = tail call i32 (...) @random()
%37 = and i32 %36, 4095
%38 = uitofp i32 %37 to double
%39 = getelementptr inbounds double, double* %35, i64 1
store double %38, double* %35
%40 = add nuw nsw i32 %34, 1
%41 = icmp eq i32 %40, 134217216
br i1 %41, label %42, label %33
42: ; preds = %33
%43 = inttoptr i64 %28 to double*
%44 = inttoptr i64 %29 to double*
%45 = inttoptr i64 %30 to double*
%46 = inttoptr i64 %31 to double*
%47 = tail call double (...) @clock()
%48 = tail call i32 @memcpy(double* %45, double* %27, i64 1073737728)
%49 = tail call i32 @putchar(i32 10)
%50 = tail call double (...) @clock()
%51 = tail call i32 @wavelet_transform3D(double* %27, i32 512, i32 513, i32 511, i32 9, i32 10, double* %43)
%52 = tail call double (...) @clock()
%53 = tail call i32 @putchar(i32 10)
%54 = tail call i32 @invwavelet_transform3D(double* %43, i32 512, i32 513, i32 511, i32 9, i32 10, double* %44)
%55 = tail call double (...) @clock()
%56 = tail call i32 @putchar(i32 10)
%57 = call i32 @compimages(double* %45, double* %44, double* %46, i32 134217216, double* %1, double* %2, double* %3, double* %4, double* %5, double* %6, double* %7, double* %9, i32* %10, i32* %11, double* %8)
%58 = call double (...) @clock()
%59 = fsub double %47, %32
%60 = fmul double %59, 0x3EB0C6F7A0B5ED8D
%61 = fsub double %50, %47
%62 = fmul double %61, 0x3EB0C6F7A0B5ED8D
%63 = fsub double %52, %50
%64 = fmul double %63, 0x3EB0C6F7A0B5ED8D
%65 = fsub double %55, %52
%66 = fmul double %65, 0x3EB0C6F7A0B5ED8D
%67 = fsub double %58, %55
%68 = fmul double %67, 0x3EB0C6F7A0B5ED8D
%69 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([87 x i8], [87 x i8]* @.str.2, i64 0, i64 0), i32 512, i32 513, i32 511, double %60, double %62, double %64, double %66, double %68)
%70 = icmp eq i64 %26, 0
br i1 %70, label %73, label %71
71: ; preds = %42
%72 = call i32 @free(double* %27)
br label %73
73: ; preds = %71, %42
%74 = icmp eq i64 %30, 0
br i1 %74, label %77, label %75
75: ; preds = %73
%76 = call i32 @free(double* %45)
br label %77
77: ; preds = %75, %73
%78 = icmp eq i64 %29, 0
br i1 %78, label %81, label %79
79: ; preds = %77
%80 = call i32 @free(double* %44)
br label %81
81: ; preds = %79, %77
%82 = icmp eq i64 %28, 0
br i1 %82, label %85, label %83
83: ; preds = %81
%84 = call i32 @free(double* %43)
br label %85
85: ; preds = %83, %81
%86 = load double, double* %1
%87 = load double, double* %2
%88 = load double, double* %3
%89 = load double, double* %4
%90 = load double, double* %5
%91 = load double, double* %6
%92 = load double, double* %7
%93 = load double, double* %9
%94 = load i32, i32* %10
%95 = load double, double* %8
%96 = call i32 @show_compresults(double %86, double %87, double %88, double %89, double %90, double %91, double %92, double %93, i32 %94, i32 134217216, double* %12, i32 8, double %95)
ret i32 0
}