#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 */
int FILENAME_MAX;
double atof(char *);
int atoi(char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, double);
int /*<<< orphan*/ free(double *);
int /*<<< orphan*/ gaussconv_lindeberg(double *, double *, int, int, double,
                                       double);
scalar_t__ malloc(int);
int /*<<< orphan*/ printImage(double *, int, int, char *);
int /*<<< orphan*/ printImage_LinearConversion(double *, int, int, char *);
int /*<<< orphan*/ print_usage();
double *read_image_to_gray(char *, int *, int *);
double rmse(double *, double *, int);
int /*<<< orphan*/ sprintf(char *, char *, char *);
double sqrt(double);
int /*<<< orphan*/ stdout;
int main(int argc, char **argv) {
  double sigma;
  double g;
  int N;
  switch (argc) {
  case 6:
    sigma = atof(argv[2]);
    g = atof(argv[3]);
    N = atoi(argv[4]);
    break;
  default:
    print_usage();
    return -1;
  }
  int w, h;
  double *x = read_image_to_gray(argv[1], &w, &h);
  double *t = (double *)malloc(w * h * sizeof(double));
  double *y1 = (double *)malloc(w * h * sizeof(double));
  double *y2 = (double *)malloc(w * h * sizeof(double));
  double *d = (double *)malloc(w * h * sizeof(double));
  gaussconv_lindeberg(x, y1, w, h, sqrt((double)N) * sigma, g);
  for (int j = 0; j < w * h; j++)
    t[j] = x[j];
  for (int i = 0; i < N; i++) {
    gaussconv_lindeberg(t, y2, w, h, sigma, g);
    for (int j = 0; j < w * h; j++)
      t[j] = y2[j];
  }
  for (int j = 0; j < w * h; j++) {
    d[j] = y1[j] - y2[j];
  }
  char name[FILENAME_MAX];
  sprintf(name, "%s_direct.png", argv[5]);
  printImage(y1, w, h, name);
  sprintf(name, "%s_iter.png", argv[5]);
  printImage(y2, w, h, name);
  sprintf(name, "%s_diff.png", argv[5]);
  printImage_LinearConversion(d, w, h, name);
  double err = rmse(y1, y2, w * h);
  fprintf(stdout, "RMSE = %g \n", err);
  free(x);
  free(t);
  free(y1);
  free(y2);
  free(d);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x6,%eax
jne    1233 <main+0x63>
jmp    11fa <main+0x2a>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1050 <atof@plt>
movsd  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1050 <atof@plt>
movsd  %xmm0,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rdi
call   10b0 <atoi@plt>
mov    %eax,-0x24(%rbp)
jmp    1246 <main+0x76>
mov    $0x0,%al
call   10f0 <print_usage@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1556 <main+0x386>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    -0x28(%rbp),%rsi
lea    -0x2c(%rbp),%rdx
call   1090 <read_image_to_gray@plt>
mov    %rax,-0x38(%rbp)
mov    -0x28(%rbp),%eax
imul   -0x2c(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0x40(%rbp)
mov    -0x28(%rbp),%eax
imul   -0x2c(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0x48(%rbp)
mov    -0x28(%rbp),%eax
imul   -0x2c(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0x50(%rbp)
mov    -0x28(%rbp),%eax
imul   -0x2c(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0x58(%rbp)
mov    -0x38(%rbp),%rax
mov    %rax,-0x98(%rbp)
mov    -0x48(%rbp),%rax
mov    %rax,-0x90(%rbp)
mov    -0x28(%rbp),%eax
mov    %eax,-0x88(%rbp)
mov    -0x2c(%rbp),%eax
mov    %eax,-0x84(%rbp)
cvtsi2sdl -0x24(%rbp),%xmm0
call   10c0 <sqrt@plt>
mov    -0x98(%rbp),%rdi
mov    -0x90(%rbp),%rsi
mov    -0x88(%rbp),%edx
mov    -0x84(%rbp),%ecx
mulsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
call   10a0 <gaussconv_lindeberg@plt>
movl   $0x0,-0x5c(%rbp)
mov    -0x5c(%rbp),%eax
mov    -0x28(%rbp),%ecx
imul   -0x2c(%rbp),%ecx
cmp    %ecx,%eax
jge    135b <main+0x18b>
mov    -0x38(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x40(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x5c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5c(%rbp)
jmp    1321 <main+0x151>
movl   $0x0,-0x60(%rbp)
mov    -0x60(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    13df <main+0x20f>
mov    -0x40(%rbp),%rdi
mov    -0x50(%rbp),%rsi
mov    -0x28(%rbp),%edx
mov    -0x2c(%rbp),%ecx
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
call   10a0 <gaussconv_lindeberg@plt>
movl   $0x0,-0x64(%rbp)
mov    -0x64(%rbp),%eax
mov    -0x28(%rbp),%ecx
imul   -0x2c(%rbp),%ecx
cmp    %ecx,%eax
jge    13cc <main+0x1fc>
mov    -0x50(%rbp),%rax
movslq -0x64(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x40(%rbp),%rax
movslq -0x64(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    1392 <main+0x1c2>
jmp    13d1 <main+0x201>
mov    -0x60(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x60(%rbp)
jmp    1362 <main+0x192>
movl   $0x0,-0x68(%rbp)
mov    -0x68(%rbp),%eax
mov    -0x28(%rbp),%ecx
imul   -0x2c(%rbp),%ecx
cmp    %ecx,%eax
jge    142d <main+0x25d>
mov    -0x48(%rbp),%rax
movslq -0x68(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x50(%rbp),%rax
movslq -0x68(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
mov    -0x58(%rbp),%rax
movslq -0x68(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x68(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x68(%rbp)
jmp    13e6 <main+0x216>
mov    0x2bb4(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rcx,-0x70(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0xa0(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x78(%rbp)
mov    -0x10(%rbp),%rax
mov    0x28(%rax),%rdx
lea    0xb95(%rip),%rsi
call   10e0 <sprintf@plt>
mov    -0xa0(%rbp),%rcx
mov    -0x48(%rbp),%rdi
mov    -0x28(%rbp),%esi
mov    -0x2c(%rbp),%edx
call   10d0 <printImage@plt>
mov    -0xa0(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x28(%rax),%rdx
lea    0xb72(%rip),%rsi
call   10e0 <sprintf@plt>
mov    -0xa0(%rbp),%rcx
mov    -0x50(%rbp),%rdi
mov    -0x28(%rbp),%esi
mov    -0x2c(%rbp),%edx
call   10d0 <printImage@plt>
mov    -0xa0(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x28(%rax),%rdx
lea    0xb4d(%rip),%rsi
call   10e0 <sprintf@plt>
mov    -0xa0(%rbp),%rcx
mov    -0x58(%rbp),%rdi
mov    -0x28(%rbp),%esi
mov    -0x2c(%rbp),%edx
call   1060 <printImage_LinearConversion@plt>
mov    -0x48(%rbp),%rdi
mov    -0x50(%rbp),%rsi
mov    -0x28(%rbp),%edx
imul   -0x2c(%rbp),%edx
call   1040 <rmse@plt>
movsd  %xmm0,-0x80(%rbp)
mov    0x2ad0(%rip),%rax
mov    (%rax),%edi
movsd  -0x80(%rbp),%xmm0
lea    0xb10(%rip),%rsi
call   1070 <fprintf@plt>
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
mov    -0x48(%rbp),%rdi
call   1030 <free@plt>
mov    -0x50(%rbp),%rdi
call   1030 <free@plt>
mov    -0x58(%rbp),%rdi
call   1030 <free@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x70(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
cmp    $0x6,%edi
jne    1294 <main+0xc4>
mov    %rsi,%rbx
mov    0x10(%rsi),%rdi
call   1050 <atof@plt>
movsd  %xmm0,-0x48(%rbp)
mov    0x18(%rbx),%rdi
call   1050 <atof@plt>
movsd  %xmm0,-0x60(%rbp)
mov    0x20(%rbx),%rdi
call   10b0 <atoi@plt>
mov    %rbx,-0x58(%rbp)
mov    0x8(%rbx),%rdi
mov    %eax,%ebx
lea    -0x30(%rbp),%rsi
lea    -0x2c(%rbp),%rdx
call   1090 <read_image_to_gray@plt>
mov    %rax,%r15
mov    -0x30(%rbp),%edi
imul   -0x2c(%rbp),%edi
shl    $0x3,%edi
call   1080 <malloc@plt>
mov    %rax,%r13
mov    -0x30(%rbp),%edi
imul   -0x2c(%rbp),%edi
shl    $0x3,%edi
call   1080 <malloc@plt>
mov    %rax,-0x40(%rbp)
mov    -0x30(%rbp),%edi
imul   -0x2c(%rbp),%edi
shl    $0x3,%edi
call   1080 <malloc@plt>
mov    %rax,%r12
mov    -0x30(%rbp),%edi
imul   -0x2c(%rbp),%edi
shl    $0x3,%edi
call   1080 <malloc@plt>
mov    -0x30(%rbp),%edx
xorps  %xmm0,%xmm0
cvtsi2sd %ebx,%xmm0
mov    -0x2c(%rbp),%r14d
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
mov    %rax,-0x50(%rbp)
jb     12a5 <main+0xd5>
sqrtsd %xmm0,%xmm0
jmp    12b0 <main+0xe0>
xor    %eax,%eax
call   10f0 <print_usage@plt>
mov    $0xffffffff,%eax
jmp    196a <main+0x79a>
mov    %edx,-0x34(%rbp)
call   10c0 <sqrt@plt>
mov    -0x34(%rbp),%edx
mulsd  -0x48(%rbp),%xmm0
mov    %r15,%rdi
mov    -0x40(%rbp),%rsi
mov    %r14d,%ecx
movsd  -0x60(%rbp),%xmm1
call   10a0 <gaussconv_lindeberg@plt>
mov    -0x30(%rbp),%edx
mov    -0x2c(%rbp),%ecx
mov    %ecx,%r9d
imul   %edx,%r9d
test   %r9d,%r9d
jle    148a <main+0x2ba>
mov    %r9d,%r10d
cmp    $0x4,%r9d
jb     1309 <main+0x139>
lea    (%r15,%r10,8),%rax
cmp    %rax,%r13
jae    1395 <main+0x1c5>
lea    0x0(,%r10,8),%rax
add    %r13,%rax
cmp    %rax,%r15
jae    1395 <main+0x1c5>
xor    %edi,%edi
mov    %rdi,%rax
not    %rax
add    %r10,%rax
mov    %r10,%rsi
and    $0x3,%rsi
je     1337 <main+0x167>
nopl   (%rax)
movsd  (%r15,%rdi,8),%xmm0
movsd  %xmm0,0x0(%r13,%rdi,8)
add    $0x1,%rdi
add    $0xffffffffffffffff,%rsi
jne    1320 <main+0x150>
cmp    $0x3,%rax
jb     148a <main+0x2ba>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsd  (%r15,%rdi,8),%xmm0
movsd  %xmm0,0x0(%r13,%rdi,8)
movsd  0x8(%r15,%rdi,8),%xmm0
movsd  %xmm0,0x8(%r13,%rdi,8)
movsd  0x10(%r15,%rdi,8),%xmm0
movsd  %xmm0,0x10(%r13,%rdi,8)
movsd  0x18(%r15,%rdi,8),%xmm0
movsd  %xmm0,0x18(%r13,%rdi,8)
add    $0x4,%rdi
cmp    %rdi,%r10
jne    1350 <main+0x180>
jmp    148a <main+0x2ba>
mov    %r10d,%edi
and    $0xfffffffc,%edi
lea    -0x4(%rdi),%rsi
mov    %rsi,%rax
shr    $0x2,%rax
add    $0x1,%rax
mov    %eax,%r8d
and    $0x3,%r8d
cmp    $0xc,%rsi
jae    13be <main+0x1ee>
xor    %esi,%esi
jmp    143d <main+0x26d>
and    $0xfffffffffffffffc,%rax
xor    %esi,%esi
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movups (%r15,%rsi,8),%xmm0
movups 0x10(%r15,%rsi,8),%xmm1
movups %xmm0,0x0(%r13,%rsi,8)
movups %xmm1,0x10(%r13,%rsi,8)
movups 0x20(%r15,%rsi,8),%xmm0
movups 0x30(%r15,%rsi,8),%xmm1
movups %xmm0,0x20(%r13,%rsi,8)
movups %xmm1,0x30(%r13,%rsi,8)
movups 0x40(%r15,%rsi,8),%xmm0
movups 0x50(%r15,%rsi,8),%xmm1
movups %xmm0,0x40(%r13,%rsi,8)
movups %xmm1,0x50(%r13,%rsi,8)
movupd 0x60(%r15,%rsi,8),%xmm0
movupd 0x70(%r15,%rsi,8),%xmm1
movupd %xmm0,0x60(%r13,%rsi,8)
movupd %xmm1,0x70(%r13,%rsi,8)
add    $0x10,%rsi
add    $0xfffffffffffffffc,%rax
jne    13d0 <main+0x200>
test   %r8,%r8
je     1481 <main+0x2b1>
lea    0x10(,%rsi,8),%r11
add    %r13,%r11
lea    (%r15,%rsi,8),%rsi
add    $0x10,%rsi
shl    $0x5,%r8
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
movupd -0x10(%rsi,%rax,1),%xmm0
movupd (%rsi,%rax,1),%xmm1
movupd %xmm0,-0x10(%r11,%rax,1)
movupd %xmm1,(%r11,%rax,1)
add    $0x20,%rax
cmp    %rax,%r8
jne    1460 <main+0x290>
cmp    %r10,%rdi
jne    130b <main+0x13b>
test   %ebx,%ebx
jle    16a0 <main+0x4d0>
lea    0x10(%r13),%rax
mov    %rax,-0x70(%rbp)
lea    0x10(%r12),%rax
mov    %rax,-0x68(%rbp)
xor    %r14d,%r14d
mov    %ebx,-0x34(%rbp)
jmp    14bd <main+0x2ed>
nopl   0x0(%rax,%rax,1)
add    $0x1,%r14d
cmp    %ebx,%r14d
je     16a0 <main+0x4d0>
mov    %r13,%rdi
mov    %r12,%rsi
movsd  -0x48(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm1
call   10a0 <gaussconv_lindeberg@plt>
mov    -0x30(%rbp),%edx
mov    -0x2c(%rbp),%ecx
mov    %ecx,%r9d
imul   %edx,%r9d
test   %r9d,%r9d
jle    14b0 <main+0x2e0>
mov    %r9d,%r10d
cmp    $0x4,%r9d
jb     150e <main+0x33e>
lea    (%r12,%r10,8),%rax
cmp    %rax,%r13
jae    15a5 <main+0x3d5>
lea    0x0(,%r10,8),%rax
add    %r13,%rax
cmp    %rax,%r12
jae    15a5 <main+0x3d5>
xor    %edi,%edi
mov    %rdi,%rax
not    %rax
add    %r10,%rax
mov    %r10,%rsi
and    $0x3,%rsi
je     1547 <main+0x377>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsd  (%r12,%rdi,8),%xmm0
movsd  %xmm0,0x0(%r13,%rdi,8)
add    $0x1,%rdi
add    $0xffffffffffffffff,%rsi
jne    1530 <main+0x360>
cmp    $0x3,%rax
jb     14b0 <main+0x2e0>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsd  (%r12,%rdi,8),%xmm0
movsd  %xmm0,0x0(%r13,%rdi,8)
movsd  0x8(%r12,%rdi,8),%xmm0
movsd  %xmm0,0x8(%r13,%rdi,8)
movsd  0x10(%r12,%rdi,8),%xmm0
movsd  %xmm0,0x10(%r13,%rdi,8)
movsd  0x18(%r12,%rdi,8),%xmm0
movsd  %xmm0,0x18(%r13,%rdi,8)
add    $0x4,%rdi
cmp    %rdi,%r10
jne    1560 <main+0x390>
jmp    14b0 <main+0x2e0>
mov    %r10d,%edi
and    $0xfffffffc,%edi
lea    -0x4(%rdi),%rsi
mov    %rsi,%rax
shr    $0x2,%rax
add    $0x1,%rax
mov    %eax,%r8d
and    $0x3,%r8d
cmp    $0xc,%rsi
jae    15ce <main+0x3fe>
xor    %esi,%esi
jmp    164d <main+0x47d>
movabs $0x7ffffffffffffffc,%rsi
ff ff 7f
and    %rsi,%rax
xor    %esi,%esi
nopl   (%rax)
movups (%r12,%rsi,8),%xmm0
movups 0x10(%r12,%rsi,8),%xmm1
movups %xmm0,0x0(%r13,%rsi,8)
movups %xmm1,0x10(%r13,%rsi,8)
movups 0x20(%r12,%rsi,8),%xmm0
movups 0x30(%r12,%rsi,8),%xmm1
movups %xmm0,0x20(%r13,%rsi,8)
movups %xmm1,0x30(%r13,%rsi,8)
movups 0x40(%r12,%rsi,8),%xmm0
movups 0x50(%r12,%rsi,8),%xmm1
movups %xmm0,0x40(%r13,%rsi,8)
movups %xmm1,0x50(%r13,%rsi,8)
movupd 0x60(%r12,%rsi,8),%xmm0
movupd 0x70(%r12,%rsi,8),%xmm1
movupd %xmm0,0x60(%r13,%rsi,8)
movupd %xmm1,0x70(%r13,%rsi,8)
add    $0x10,%rsi
add    $0xfffffffffffffffc,%rax
jne    15e0 <main+0x410>
test   %r8,%r8
je     168f <main+0x4bf>
mov    -0x70(%rbp),%rax
lea    (%rax,%rsi,8),%rax
mov    -0x68(%rbp),%rbx
lea    (%rbx,%rsi,8),%rsi
shl    $0x5,%r8
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
movupd -0x10(%rsi,%rbx,1),%xmm0
movupd (%rsi,%rbx,1),%xmm1
movupd %xmm0,-0x10(%rax,%rbx,1)
movupd %xmm1,(%rax,%rbx,1)
add    $0x20,%rbx
cmp    %rbx,%r8
jne    1670 <main+0x4a0>
cmp    %r10,%rdi
mov    -0x34(%rbp),%ebx
je     14b0 <main+0x2e0>
jmp    1510 <main+0x340>
test   %r9d,%r9d
mov    -0x40(%rbp),%rcx
mov    -0x50(%rbp),%rbx
jle    187c <main+0x6ac>
mov    %r9d,%r10d
cmp    $0x4,%r9d
jae    1767 <main+0x597>
xor    %eax,%eax
mov    %rax,%rdx
not    %rdx
add    %r10,%rdx
mov    %r10,%rsi
and    $0x3,%rsi
je     16fa <main+0x52a>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsd  (%rcx,%rax,8),%xmm0
subsd  (%r12,%rax,8),%xmm0
movsd  %xmm0,(%rbx,%rax,8)
add    $0x1,%rax
add    $0xffffffffffffffff,%rsi
jne    16e0 <main+0x510>
cmp    $0x3,%rdx
jb     187c <main+0x6ac>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsd  (%rcx,%rax,8),%xmm0
subsd  (%r12,%rax,8),%xmm0
movsd  %xmm0,(%rbx,%rax,8)
movsd  0x8(%rcx,%rax,8),%xmm0
subsd  0x8(%r12,%rax,8),%xmm0
movsd  %xmm0,0x8(%rbx,%rax,8)
movsd  0x10(%rcx,%rax,8),%xmm0
subsd  0x10(%r12,%rax,8),%xmm0
movsd  %xmm0,0x10(%rbx,%rax,8)
movsd  0x18(%rcx,%rax,8),%xmm0
subsd  0x18(%r12,%rax,8),%xmm0
movsd  %xmm0,0x18(%rbx,%rax,8)
add    $0x4,%rax
cmp    %rax,%r10
jne    1710 <main+0x540>
jmp    187c <main+0x6ac>
lea    (%rbx,%r10,8),%rax
lea    (%rcx,%r10,8),%rdx
lea    (%r12,%r10,8),%rsi
cmp    %rdx,%rbx
setb   %dil
cmp    %rax,%rcx
setb   %r8b
cmp    %rsi,%rbx
setb   %dl
cmp    %rax,%r12
setb   %sil
xor    %eax,%eax
test   %r8b,%dil
jne    16c0 <main+0x4f0>
and    %sil,%dl
jne    16c0 <main+0x4f0>
mov    %r10d,%eax
and    $0xfffffffc,%eax
lea    -0x4(%rax),%rsi
mov    %rsi,%rdx
shr    $0x2,%rdx
add    $0x1,%rdx
test   %rsi,%rsi
je     1979 <main+0x7a9>
movabs $0x7ffffffffffffffc,%rdi
ff ff 7f
or     $0x2,%rdi
and    %rdx,%rdi
xor    %esi,%esi
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movupd (%rcx,%rsi,8),%xmm0
movupd 0x10(%rcx,%rsi,8),%xmm1
movupd (%r12,%rsi,8),%xmm2
subpd  %xmm2,%xmm0
movupd 0x10(%r12,%rsi,8),%xmm2
subpd  %xmm2,%xmm1
movupd %xmm0,(%rbx,%rsi,8)
movupd %xmm1,0x10(%rbx,%rsi,8)
movupd 0x20(%rcx,%rsi,8),%xmm0
movupd 0x30(%rcx,%rsi,8),%xmm1
movupd 0x20(%r12,%rsi,8),%xmm2
subpd  %xmm2,%xmm0
movupd 0x30(%r12,%rsi,8),%xmm2
subpd  %xmm2,%xmm1
movupd %xmm0,0x20(%rbx,%rsi,8)
movupd %xmm1,0x30(%rbx,%rsi,8)
add    $0x8,%rsi
add    $0xfffffffffffffffe,%rdi
jne    17e0 <main+0x610>
test   $0x1,%dl
je     1873 <main+0x6a3>
movupd (%rcx,%rsi,8),%xmm0
movupd 0x10(%rcx,%rsi,8),%xmm1
movupd (%r12,%rsi,8),%xmm2
subpd  %xmm2,%xmm0
movupd 0x10(%r12,%rsi,8),%xmm2
subpd  %xmm2,%xmm1
movupd %xmm0,(%rbx,%rsi,8)
movupd %xmm1,0x10(%rbx,%rsi,8)
cmp    %r10,%rax
jne    16c0 <main+0x4f0>
mov    %rsp,-0x48(%rbp)
mov    0x2761(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%r14
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r14
mov    %r14,%rsp
mov    -0x58(%rbp),%rax
mov    0x28(%rax),%rdx
lea    0x757(%rip),%rsi
mov    %r14,%rdi
call   10e0 <sprintf@plt>
mov    -0x30(%rbp),%esi
mov    -0x2c(%rbp),%edx
mov    -0x40(%rbp),%rdi
mov    %r14,%rcx
call   10d0 <printImage@plt>
mov    -0x58(%rbp),%rbx
mov    0x28(%rbx),%rdx
lea    0x73c(%rip),%rsi
mov    %r14,%rdi
call   10e0 <sprintf@plt>
mov    -0x30(%rbp),%esi
mov    -0x2c(%rbp),%edx
mov    %r12,%rdi
mov    %r14,%rcx
call   10d0 <printImage@plt>
mov    0x28(%rbx),%rdx
lea    0x724(%rip),%rsi
mov    %r14,%rdi
call   10e0 <sprintf@plt>
mov    -0x30(%rbp),%esi
mov    -0x2c(%rbp),%edx
mov    -0x50(%rbp),%rdi
mov    %r14,%rcx
call   1060 <printImage_LinearConversion@plt>
mov    -0x2c(%rbp),%edx
imul   -0x30(%rbp),%edx
mov    -0x40(%rbp),%rbx
mov    %rbx,%rdi
mov    %r12,%rsi
call   1040 <rmse@plt>
mov    0x26ab(%rip),%rax
mov    (%rax),%edi
lea    0x6f0(%rip),%rsi
call   1070 <fprintf@plt>
mov    %r15,%rdi
call   1030 <free@plt>
mov    %r13,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r12,%rdi
call   1030 <free@plt>
mov    -0x50(%rbp),%rdi
call   1030 <free@plt>
mov    -0x48(%rbp),%rsp
xor    %eax,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %esi,%esi
test   $0x1,%dl
jne    1848 <main+0x678>
jmp    1873 <main+0x6a3>

LLVM IR (-O0):
@FILENAME_MAX = global i32 0
@.str = [14 x i8] c"%s_direct.png\00"
@.str.1 = [12 x i8] c"%s_iter.png\00"
@.str.2 = [12 x i8] c"%s_diff.png\00"
@stdout = global i32 0
@.str.3 = [12 x i8] c"RMSE = %g \0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double
%7 = alloca double
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca double*
%12 = alloca double*
%13 = alloca double*
%14 = alloca double*
%15 = alloca double*
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i8*
%21 = alloca i64
%22 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%23 = load i32, i32* %4
switch i32 %23, label %37 [
i32 6, label %24
]
24: ; preds = %2
%25 = load i8**, i8*** %5
%26 = getelementptr inbounds i8*, i8** %25, i64 2
%27 = load i8*, i8** %26
%28 = call double @atof(i8* %27)
store double %28, double* %6
%29 = load i8**, i8*** %5
%30 = getelementptr inbounds i8*, i8** %29, i64 3
%31 = load i8*, i8** %30
%32 = call double @atof(i8* %31)
store double %32, double* %7
%33 = load i8**, i8*** %5
%34 = getelementptr inbounds i8*, i8** %33, i64 4
%35 = load i8*, i8** %34
%36 = call i32 @atoi(i8* %35)
store i32 %36, i32* %8
br label %39
37: ; preds = %2
%38 = call i32 (...) @print_usage()
store i32 -1, i32* %3
br label %217
39: ; preds = %24
%40 = load i8**, i8*** %5
%41 = getelementptr inbounds i8*, i8** %40, i64 1
%42 = load i8*, i8** %41
%43 = call double* @read_image_to_gray(i8* %42, i32* %9, i32* %10)
store double* %43, double** %11
%44 = load i32, i32* %9
%45 = load i32, i32* %10
%46 = mul nsw i32 %44, %45
%47 = sext i32 %46 to i64
%48 = mul i64 %47, 8
%49 = trunc i64 %48 to i32
%50 = call i64 @malloc(i32 %49)
%51 = inttoptr i64 %50 to double*
store double* %51, double** %12
%52 = load i32, i32* %9
%53 = load i32, i32* %10
%54 = mul nsw i32 %52, %53
%55 = sext i32 %54 to i64
%56 = mul i64 %55, 8
%57 = trunc i64 %56 to i32
%58 = call i64 @malloc(i32 %57)
%59 = inttoptr i64 %58 to double*
store double* %59, double** %13
%60 = load i32, i32* %9
%61 = load i32, i32* %10
%62 = mul nsw i32 %60, %61
%63 = sext i32 %62 to i64
%64 = mul i64 %63, 8
%65 = trunc i64 %64 to i32
%66 = call i64 @malloc(i32 %65)
%67 = inttoptr i64 %66 to double*
store double* %67, double** %14
%68 = load i32, i32* %9
%69 = load i32, i32* %10
%70 = mul nsw i32 %68, %69
%71 = sext i32 %70 to i64
%72 = mul i64 %71, 8
%73 = trunc i64 %72 to i32
%74 = call i64 @malloc(i32 %73)
%75 = inttoptr i64 %74 to double*
store double* %75, double** %15
%76 = load double*, double** %11
%77 = load double*, double** %13
%78 = load i32, i32* %9
%79 = load i32, i32* %10
%80 = load i32, i32* %8
%81 = sitofp i32 %80 to double
%82 = call double @sqrt(double %81)
%83 = load double, double* %6
%84 = fmul double %82, %83
%85 = load double, double* %7
%86 = call i32 @gaussconv_lindeberg(double* %76, double* %77, i32 %78, i32 %79, double %84, double %85)
store i32 0, i32* %16
br label %87
87: ; preds = %103, %39
%88 = load i32, i32* %16
%89 = load i32, i32* %9
%90 = load i32, i32* %10
%91 = mul nsw i32 %89, %90
%92 = icmp slt i32 %88, %91
br i1 %92, label %93, label %106
93: ; preds = %87
%94 = load double*, double** %11
%95 = load i32, i32* %16
%96 = sext i32 %95 to i64
%97 = getelementptr inbounds double, double* %94, i64 %96
%98 = load double, double* %97
%99 = load double*, double** %12
%100 = load i32, i32* %16
%101 = sext i32 %100 to i64
%102 = getelementptr inbounds double, double* %99, i64 %101
store double %98, double* %102
br label %103
103: ; preds = %93
%104 = load i32, i32* %16
%105 = add nsw i32 %104, 1
store i32 %105, i32* %16
br label %87
106: ; preds = %87
store i32 0, i32* %17
br label %107
107: ; preds = %139, %106
%108 = load i32, i32* %17
%109 = load i32, i32* %8
%110 = icmp slt i32 %108, %109
br i1 %110, label %111, label %142
111: ; preds = %107
%112 = load double*, double** %12
%113 = load double*, double** %14
%114 = load i32, i32* %9
%115 = load i32, i32* %10
%116 = load double, double* %6
%117 = load double, double* %7
%118 = call i32 @gaussconv_lindeberg(double* %112, double* %113, i32 %114, i32 %115, double %116, double %117)
store i32 0, i32* %18
br label %119
119: ; preds = %135, %111
%120 = load i32, i32* %18
%121 = load i32, i32* %9
%122 = load i32, i32* %10
%123 = mul nsw i32 %121, %122
%124 = icmp slt i32 %120, %123
br i1 %124, label %125, label %138
125: ; preds = %119
%126 = load double*, double** %14
%127 = load i32, i32* %18
%128 = sext i32 %127 to i64
%129 = getelementptr inbounds double, double* %126, i64 %128
%130 = load double, double* %129
%131 = load double*, double** %12
%132 = load i32, i32* %18
%133 = sext i32 %132 to i64
%134 = getelementptr inbounds double, double* %131, i64 %133
store double %130, double* %134
br label %135
135: ; preds = %125
%136 = load i32, i32* %18
%137 = add nsw i32 %136, 1
store i32 %137, i32* %18
br label %119
138: ; preds = %119
br label %139
139: ; preds = %138
%140 = load i32, i32* %17
%141 = add nsw i32 %140, 1
store i32 %141, i32* %17
br label %107
142: ; preds = %107
store i32 0, i32* %19
br label %143
143: ; preds = %165, %142
%144 = load i32, i32* %19
%145 = load i32, i32* %9
%146 = load i32, i32* %10
%147 = mul nsw i32 %145, %146
%148 = icmp slt i32 %144, %147
br i1 %148, label %149, label %168
149: ; preds = %143
%150 = load double*, double** %13
%151 = load i32, i32* %19
%152 = sext i32 %151 to i64
%153 = getelementptr inbounds double, double* %150, i64 %152
%154 = load double, double* %153
%155 = load double*, double** %14
%156 = load i32, i32* %19
%157 = sext i32 %156 to i64
%158 = getelementptr inbounds double, double* %155, i64 %157
%159 = load double, double* %158
%160 = fsub double %154, %159
%161 = load double*, double** %15
%162 = load i32, i32* %19
%163 = sext i32 %162 to i64
%164 = getelementptr inbounds double, double* %161, i64 %163
store double %160, double* %164
br label %165
165: ; preds = %149
%166 = load i32, i32* %19
%167 = add nsw i32 %166, 1
store i32 %167, i32* %19
br label %143
168: ; preds = %143
%169 = load i32, i32* @FILENAME_MAX
%170 = zext i32 %169 to i64
%171 = call i8* @llvm.stacksave()
store i8* %171, i8** %20
%172 = alloca i8, i64 %170
store i64 %170, i64* %21
%173 = load i8**, i8*** %5
%174 = getelementptr inbounds i8*, i8** %173, i64 5
%175 = load i8*, i8** %174
%176 = call i32 @sprintf(i8* %172, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %175)
%177 = load double*, double** %13
%178 = load i32, i32* %9
%179 = load i32, i32* %10
%180 = call i32 @printImage(double* %177, i32 %178, i32 %179, i8* %172)
%181 = load i8**, i8*** %5
%182 = getelementptr inbounds i8*, i8** %181, i64 5
%183 = load i8*, i8** %182
%184 = call i32 @sprintf(i8* %172, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %183)
%185 = load double*, double** %14
%186 = load i32, i32* %9
%187 = load i32, i32* %10
%188 = call i32 @printImage(double* %185, i32 %186, i32 %187, i8* %172)
%189 = load i8**, i8*** %5
%190 = getelementptr inbounds i8*, i8** %189, i64 5
%191 = load i8*, i8** %190
%192 = call i32 @sprintf(i8* %172, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* %191)
%193 = load double*, double** %15
%194 = load i32, i32* %9
%195 = load i32, i32* %10
%196 = call i32 @printImage_LinearConversion(double* %193, i32 %194, i32 %195, i8* %172)
%197 = load double*, double** %13
%198 = load double*, double** %14
%199 = load i32, i32* %9
%200 = load i32, i32* %10
%201 = mul nsw i32 %199, %200
%202 = call double @rmse(double* %197, double* %198, i32 %201)
store double %202, double* %22
%203 = load i32, i32* @stdout
%204 = load double, double* %22
%205 = call i32 @fprintf(i32 %203, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), double %204)
%206 = load double*, double** %11
%207 = call i32 @free(double* %206)
%208 = load double*, double** %12
%209 = call i32 @free(double* %208)
%210 = load double*, double** %13
%211 = call i32 @free(double* %210)
%212 = load double*, double** %14
%213 = call i32 @free(double* %212)
%214 = load double*, double** %15
%215 = call i32 @free(double* %214)
store i32 0, i32* %3
%216 = load i8*, i8** %20
br label %217
217: ; preds = %168, %37
%218 = load i32, i32* %3
ret i32 %218
}

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