#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 atoi(char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ free(float *);
float *iio_read_image_float(char *, int *, int *);
float *iio_read_image_float_split(char *, int *, int *, int *);
int /*<<< orphan*/ iio_save_image_float_split(char *, float *, int, int, int);
float *malloc(int);
int /*<<< orphan*/ morphoop(float *, int, int, float *, int, int, int, int,
                            char *, float *);
int /*<<< orphan*/ stderr;
int main(int argc, char **argv) {
  if (argc < 5) {
    fprintf(stderr, "too few parameters\n");
    fprintf(stderr, "apply a 'morphologic' operation over the square "
                    "structuring element of size sz\n");
    fprintf(stderr,
            "   usage: %s input {min,max,median,average,random,rank} sz out [ "
            "struc_elem ]\n",
            argv[0]);
    return 1;
  }
  int nc, nr, nch;
  float *in = iio_read_image_float_split(argv[1], &nc, &nr, &nch);
  char *operation = argv[2];
  int se_nr, se_nc;
  se_nr = se_nc = atoi(argv[3]);
  float sse[se_nr * se_nc];
  float *se = sse;
  int i;
  for (i = 0; i < se_nr * se_nc; i++)
    se[i] = 1;
  int ctr_c = se_nc / 2;
  int ctr_r = se_nr / 2;
  if (argc > 5) {
    se = iio_read_image_float(argv[5], &se_nc, &se_nr);
    ctr_c = se_nc / 2;
    ctr_r = se_nr / 2;
  }
  float *out = malloc(nc * nr * nch * sizeof *out);
  for (int i = 0; i < nch; i++)
    morphoop(in + nc * nr * i, nc, nr, se, se_nc, se_nr, ctr_c, ctr_r,
             operation, out + nc * nr * i);
  iio_save_image_float_split(argv[4], out, nc, nr, nch);
  free(in);
  free(out);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r14
push   %rbx
sub    $0x70,%rsp
movl   $0x0,-0x14(%rbp)
mov    %edi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
cmpl   $0x5,-0x18(%rbp)
jge    11fb <main+0x7b>
mov    0x2e36(%rip),%rax
mov    (%rax),%edi
lea    0xe51(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2e1f(%rip),%rax
mov    (%rax),%edi
lea    0xe4e(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2e08(%rip),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%rax
mov    (%rax),%rdx
lea    0xe80(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
movl   $0x1,-0x14(%rbp)
jmp    13e5 <main+0x265>
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%rdi
lea    -0x24(%rbp),%rsi
lea    -0x28(%rbp),%rdx
lea    -0x2c(%rbp),%rcx
call   10a0 <iio_read_image_float_split@plt>
mov    %rax,-0x38(%rbp)
mov    -0x20(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x40(%rbp)
mov    -0x20(%rbp),%rax
mov    0x18(%rax),%rdi
call   1090 <atoi@plt>
mov    %eax,-0x48(%rbp)
mov    %eax,-0x44(%rbp)
mov    -0x44(%rbp),%eax
mov    -0x48(%rbp),%ecx
imul   %ecx,%eax
mov    %eax,%ecx
mov    %rsp,%rax
mov    %rax,-0x50(%rbp)
lea    0xf(,%rcx,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rax
sub    %rdx,%rax
mov    %rax,%rsp
mov    %rcx,-0x58(%rbp)
mov    %rax,-0x60(%rbp)
movl   $0x0,-0x64(%rbp)
mov    -0x64(%rbp),%eax
mov    -0x44(%rbp),%ecx
imul   -0x48(%rbp),%ecx
cmp    %ecx,%eax
jge    12a2 <main+0x122>
mov    -0x60(%rbp),%rax
movslq -0x64(%rbp),%rcx
movss  0xd71(%rip),%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    126d <main+0xed>
mov    -0x48(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x68(%rbp)
mov    -0x44(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x6c(%rbp)
cmpl   $0x5,-0x18(%rbp)
jle    12fd <main+0x17d>
mov    -0x20(%rbp),%rax
mov    0x28(%rax),%rdi
lea    -0x48(%rbp),%rsi
lea    -0x44(%rbp),%rdx
call   1060 <iio_read_image_float@plt>
mov    %rax,-0x60(%rbp)
mov    -0x48(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x68(%rbp)
mov    -0x44(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x6c(%rbp)
mov    -0x24(%rbp),%eax
imul   -0x28(%rbp),%eax
imul   -0x2c(%rbp),%eax
cltq
shl    $0x2,%rax
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,-0x78(%rbp)
movl   $0x0,-0x7c(%rbp)
mov    -0x7c(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    13aa <main+0x22a>
mov    -0x38(%rbp),%rdi
mov    -0x24(%rbp),%eax
imul   -0x28(%rbp),%eax
imul   -0x7c(%rbp),%eax
cltq
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x24(%rbp),%esi
mov    -0x28(%rbp),%edx
mov    -0x60(%rbp),%rcx
mov    -0x48(%rbp),%r8d
mov    -0x44(%rbp),%r9d
mov    -0x68(%rbp),%ebx
mov    -0x6c(%rbp),%r11d
mov    -0x40(%rbp),%r10
mov    -0x78(%rbp),%rax
mov    -0x24(%rbp),%r14d
imul   -0x28(%rbp),%r14d
imul   -0x7c(%rbp),%r14d
movslq %r14d,%r14
shl    $0x2,%r14
add    %r14,%rax
sub    $0x20,%rsp
mov    %ebx,(%rsp)
mov    %r11d,0x8(%rsp)
mov    %r10,0x10(%rsp)
mov    %rax,0x18(%rsp)
call   1040 <morphoop@plt>
add    $0x20,%rsp
mov    -0x7c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7c(%rbp)
jmp    1320 <main+0x1a0>
mov    -0x20(%rbp),%rax
mov    0x20(%rax),%rdi
mov    -0x78(%rbp),%rsi
mov    -0x24(%rbp),%edx
mov    -0x28(%rbp),%ecx
mov    -0x2c(%rbp),%r8d
call   1080 <iio_save_image_float_split@plt>
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
mov    -0x78(%rbp),%rdi
call   1030 <free@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x50(%rbp),%rax
mov    %rax,%rsp
mov    -0x14(%rbp),%eax
lea    -0x10(%rbp),%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
mov    %rsi,%r12
cmp    $0x4,%edi
jg     11de <main+0x5e>
mov    0x2e40(%rip),%rbx
mov    (%rbx),%edi
lea    0xe67(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    (%rbx),%edi
lea    0xe6b(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    (%rbx),%edi
mov    (%r12),%rdx
lea    0xea7(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    $0x1,%eax
jmp    1462 <main+0x2e2>
mov    %edi,%r14d
mov    0x8(%r12),%rdi
lea    -0x3c(%rbp),%rsi
lea    -0x38(%rbp),%rdx
lea    -0x34(%rbp),%rcx
call   10a0 <iio_read_image_float_split@plt>
mov    %rax,-0x58(%rbp)
mov    0x10(%r12),%rax
mov    %rax,-0x80(%rbp)
mov    0x18(%r12),%rdi
call   1090 <atoi@plt>
mov    %rsp,-0x68(%rbp)
mov    %eax,-0x2c(%rbp)
mov    %eax,-0x30(%rbp)
mov    %eax,%edx
imul   %edx,%edx
mov    %rsp,%rbx
lea    0xf(,%rdx,4),%rcx
and    $0xfffffffffffffff0,%rcx
sub    %rcx,%rbx
mov    %rbx,%rsp
test   %edx,%edx
jle    1340 <main+0x1c0>
cmp    $0x8,%edx
jae    1246 <main+0xc6>
xor    %ecx,%ecx
jmp    1330 <main+0x1b0>
mov    %edx,%ecx
and    $0xfffffff8,%ecx
lea    -0x8(%rcx),%rdi
mov    %rdi,%rsi
shr    $0x3,%rsi
add    $0x1,%rsi
mov    %esi,%r8d
and    $0x7,%r8d
cmp    $0x38,%rdi
jae    126e <main+0xee>
xor    %edi,%edi
jmp    12f1 <main+0x171>
and    $0xfffffffffffffff8,%rsi
xor    %edi,%edi
movaps 0xd85(%rip),%xmm0
nopl   0x0(%rax,%rax,1)
movaps %xmm0,(%rbx,%rdi,4)
movaps %xmm0,0x10(%rbx,%rdi,4)
movaps %xmm0,0x20(%rbx,%rdi,4)
movaps %xmm0,0x30(%rbx,%rdi,4)
movaps %xmm0,0x40(%rbx,%rdi,4)
movaps %xmm0,0x50(%rbx,%rdi,4)
movaps %xmm0,0x60(%rbx,%rdi,4)
movaps %xmm0,0x70(%rbx,%rdi,4)
movaps %xmm0,0x80(%rbx,%rdi,4)
movaps %xmm0,0x90(%rbx,%rdi,4)
movaps %xmm0,0xa0(%rbx,%rdi,4)
movaps %xmm0,0xb0(%rbx,%rdi,4)
movaps %xmm0,0xc0(%rbx,%rdi,4)
movaps %xmm0,0xd0(%rbx,%rdi,4)
movaps %xmm0,0xe0(%rbx,%rdi,4)
movaps %xmm0,0xf0(%rbx,%rdi,4)
add    $0x40,%rdi
add    $0xfffffffffffffff8,%rsi
jne    1280 <main+0x100>
test   %r8,%r8
je     1322 <main+0x1a2>
lea    (%rbx,%rdi,4),%rsi
add    $0x10,%rsi
shl    $0x5,%r8
xor    %edi,%edi
movaps 0xcf5(%rip),%xmm0
nopl   0x0(%rax,%rax,1)
movaps %xmm0,-0x10(%rsi,%rdi,1)
movaps %xmm0,(%rsi,%rdi,1)
add    $0x20,%rdi
cmp    %rdi,%r8
jne    1310 <main+0x190>
cmp    %rdx,%rcx
je     1340 <main+0x1c0>
nopw   0x0(%rax,%rax,1)
movl   $0x3f800000,(%rbx,%rcx,4)
add    $0x1,%rcx
cmp    %rcx,%rdx
jne    1330 <main+0x1b0>
mov    %eax,%ecx
cmp    $0x6,%r14d
jl     1363 <main+0x1e3>
mov    0x28(%r12),%rdi
lea    -0x2c(%rbp),%rsi
lea    -0x30(%rbp),%rdx
call   1060 <iio_read_image_float@plt>
mov    %rax,%rbx
mov    -0x2c(%rbp),%eax
mov    -0x30(%rbp),%ecx
mov    %ecx,-0x40(%rbp)
mov    %eax,-0x44(%rbp)
mov    -0x3c(%rbp),%r15d
mov    -0x38(%rbp),%r14d
mov    -0x34(%rbp),%r13d
mov    %r15d,%edi
imul   %r14d,%edi
imul   %r13d,%edi
shl    $0x2,%edi
call   1070 <malloc@plt>
mov    %rax,-0x50(%rbp)
test   %r13d,%r13d
jle    1431 <main+0x2b1>
mov    %r12,-0x60(%rbp)
mov    -0x40(%rbp),%r9d
mov    %r9d,%eax
shr    $0x1f,%eax
add    %r9d,%eax
sar    %eax
mov    %rax,-0x78(%rbp)
mov    -0x44(%rbp),%r8d
mov    %r8d,%eax
shr    $0x1f,%eax
add    %r8d,%eax
sar    %eax
mov    %rax,-0x70(%rbp)
mov    $0x1,%r12d
cs nopw 0x0(%rax,%rax,1)
nop
lea    -0x1(%r12),%eax
mov    %r15d,%ecx
imul   %r14d,%ecx
imul   %eax,%ecx
movslq %ecx,%rax
mov    -0x58(%rbp),%rcx
lea    (%rcx,%rax,4),%rdi
mov    -0x50(%rbp),%rcx
lea    (%rcx,%rax,4),%rax
mov    %r15d,%esi
mov    %r14d,%edx
mov    %rbx,%rcx
push   %rax
push   -0x80(%rbp)
push   -0x78(%rbp)
push   -0x70(%rbp)
call   1040 <morphoop@plt>
add    $0x20,%rsp
mov    -0x34(%rbp),%r13d
mov    -0x3c(%rbp),%r15d
mov    -0x38(%rbp),%r14d
cmp    %r13d,%r12d
jge    142d <main+0x2ad>
mov    -0x2c(%rbp),%r8d
mov    -0x30(%rbp),%r9d
add    $0x1,%r12d
jmp    13d0 <main+0x250>
mov    -0x60(%rbp),%r12
mov    0x20(%r12),%rdi
mov    -0x50(%rbp),%rbx
mov    %rbx,%rsi
mov    %r15d,%edx
mov    %r14d,%ecx
mov    %r13d,%r8d
call   1080 <iio_save_image_float_split@plt>
mov    -0x58(%rbp),%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    -0x68(%rbp),%rsp
xor    %eax,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [20 x i8] c"too few parameters\0A\00"
@.str.1 = [80 x i8] c"apply a 'morphologic' operation over the square structuring element of size sz\0A\00"
@.str.2 = [79 x i8] c" usage: %s input {min,max,median,average,random,rank} sz out [ struc_elem ]\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca float*
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i8*
%14 = alloca i64
%15 = alloca float*
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca float*
%20 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%21 = load i32, i32* %4
%22 = icmp slt i32 %21, 5
br i1 %22, label %23, label %33
23: ; preds = %2
%24 = load i32, i32* @stderr
%25 = call i32 (i32, i8*, ...) @fprintf(i32 %24, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%26 = load i32, i32* @stderr
%27 = call i32 (i32, i8*, ...) @fprintf(i32 %26, i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.1, i64 0, i64 0))
%28 = load i32, i32* @stderr
%29 = load i8**, i8*** %5
%30 = getelementptr inbounds i8*, i8** %29, i64 0
%31 = load i8*, i8** %30
%32 = call i32 (i32, i8*, ...) @fprintf(i32 %28, i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str.2, i64 0, i64 0), i8* %31)
store i32 1, i32* %3
br label %138
33: ; preds = %2
%34 = load i8**, i8*** %5
%35 = getelementptr inbounds i8*, i8** %34, i64 1
%36 = load i8*, i8** %35
%37 = call float* @iio_read_image_float_split(i8* %36, i32* %6, i32* %7, i32* %8)
store float* %37, float** %9
%38 = load i8**, i8*** %5
%39 = getelementptr inbounds i8*, i8** %38, i64 2
%40 = load i8*, i8** %39
store i8* %40, i8** %10
%41 = load i8**, i8*** %5
%42 = getelementptr inbounds i8*, i8** %41, i64 3
%43 = load i8*, i8** %42
%44 = call i32 @atoi(i8* %43)
store i32 %44, i32* %12
store i32 %44, i32* %11
%45 = load i32, i32* %11
%46 = load i32, i32* %12
%47 = mul nsw i32 %45, %46
%48 = zext i32 %47 to i64
%49 = call i8* @llvm.stacksave()
store i8* %49, i8** %13
%50 = alloca float, i64 %48
store i64 %48, i64* %14
store float* %50, float** %15
store i32 0, i32* %16
br label %51
51: ; preds = %62, %33
%52 = load i32, i32* %16
%53 = load i32, i32* %11
%54 = load i32, i32* %12
%55 = mul nsw i32 %53, %54
%56 = icmp slt i32 %52, %55
br i1 %56, label %57, label %65
57: ; preds = %51
%58 = load float*, float** %15
%59 = load i32, i32* %16
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds float, float* %58, i64 %60
store float 1.000000e+00, float* %61
br label %62
62: ; preds = %57
%63 = load i32, i32* %16
%64 = add nsw i32 %63, 1
store i32 %64, i32* %16
br label %51
65: ; preds = %51
%66 = load i32, i32* %12
%67 = sdiv i32 %66, 2
store i32 %67, i32* %17
%68 = load i32, i32* %11
%69 = sdiv i32 %68, 2
store i32 %69, i32* %18
%70 = load i32, i32* %4
%71 = icmp sgt i32 %70, 5
br i1 %71, label %72, label %81
72: ; preds = %65
%73 = load i8**, i8*** %5
%74 = getelementptr inbounds i8*, i8** %73, i64 5
%75 = load i8*, i8** %74
%76 = call float* @iio_read_image_float(i8* %75, i32* %12, i32* %11)
store float* %76, float** %15
%77 = load i32, i32* %12
%78 = sdiv i32 %77, 2
store i32 %78, i32* %17
%79 = load i32, i32* %11
%80 = sdiv i32 %79, 2
store i32 %80, i32* %18
br label %81
81: ; preds = %72, %65
%82 = load i32, i32* %6
%83 = load i32, i32* %7
%84 = mul nsw i32 %82, %83
%85 = load i32, i32* %8
%86 = mul nsw i32 %84, %85
%87 = sext i32 %86 to i64
%88 = mul i64 %87, 4
%89 = trunc i64 %88 to i32
%90 = call float* @malloc(i32 %89)
store float* %90, float** %19
store i32 0, i32* %20
br label %91
91: ; preds = %121, %81
%92 = load i32, i32* %20
%93 = load i32, i32* %8
%94 = icmp slt i32 %92, %93
br i1 %94, label %95, label %124
95: ; preds = %91
%96 = load float*, float** %9
%97 = load i32, i32* %6
%98 = load i32, i32* %7
%99 = mul nsw i32 %97, %98
%100 = load i32, i32* %20
%101 = mul nsw i32 %99, %100
%102 = sext i32 %101 to i64
%103 = getelementptr inbounds float, float* %96, i64 %102
%104 = load i32, i32* %6
%105 = load i32, i32* %7
%106 = load float*, float** %15
%107 = load i32, i32* %12
%108 = load i32, i32* %11
%109 = load i32, i32* %17
%110 = load i32, i32* %18
%111 = load i8*, i8** %10
%112 = load float*, float** %19
%113 = load i32, i32* %6
%114 = load i32, i32* %7
%115 = mul nsw i32 %113, %114
%116 = load i32, i32* %20
%117 = mul nsw i32 %115, %116
%118 = sext i32 %117 to i64
%119 = getelementptr inbounds float, float* %112, i64 %118
%120 = call i32 @morphoop(float* %103, i32 %104, i32 %105, float* %106, i32 %107, i32 %108, i32 %109, i32 %110, i8* %111, float* %119)
br label %121
121: ; preds = %95
%122 = load i32, i32* %20
%123 = add nsw i32 %122, 1
store i32 %123, i32* %20
br label %91
124: ; preds = %91
%125 = load i8**, i8*** %5
%126 = getelementptr inbounds i8*, i8** %125, i64 4
%127 = load i8*, i8** %126
%128 = load float*, float** %19
%129 = load i32, i32* %6
%130 = load i32, i32* %7
%131 = load i32, i32* %8
%132 = call i32 @iio_save_image_float_split(i8* %127, float* %128, i32 %129, i32 %130, i32 %131)
%133 = load float*, float** %9
%134 = call i32 @free(float* %133)
%135 = load float*, float** %19
%136 = call i32 @free(float* %135)
store i32 0, i32* %3
%137 = load i8*, i8** %13
br label %138
138: ; preds = %124, %23
%139 = load i32, i32* %3
ret i32 %139
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [20 x i8] c"too few parameters\0A\00"
@.str.1 = [80 x i8] c"apply a 'morphologic' operation over the square structuring element of size sz\0A\00"
@.str.2 = [79 x i8] c" usage: %s input {min,max,median,average,random,rank} sz out [ struc_elem ]\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = icmp slt i32 %0, 5
br i1 %8, label %9, label %17
9: ; preds = %2
%10 = load i32, i32* @stderr
%11 = tail call i32 (i32, i8*, ...) @fprintf(i32 %10, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%12 = load i32, i32* @stderr
%13 = tail call i32 (i32, i8*, ...) @fprintf(i32 %12, i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.1, i64 0, i64 0))
%14 = load i32, i32* @stderr
%15 = load i8*, i8** %1
%16 = tail call i32 (i32, i8*, ...) @fprintf(i32 %14, i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str.2, i64 0, i64 0), i8* %15)
br label %165
17: ; preds = %2
%18 = bitcast i32* %3 to i8*
%19 = bitcast i32* %4 to i8*
%20 = bitcast i32* %5 to i8*
%21 = getelementptr inbounds i8*, i8** %1, i64 1
%22 = load i8*, i8** %21
%23 = call float* @iio_read_image_float_split(i8* %22, i32* %3, i32* %4, i32* %5)
%24 = getelementptr inbounds i8*, i8** %1, i64 2
%25 = load i8*, i8** %24
%26 = bitcast i32* %6 to i8*
%27 = bitcast i32* %7 to i8*
%28 = getelementptr inbounds i8*, i8** %1, i64 3
%29 = load i8*, i8** %28
%30 = call i32 @atoi(i8* %29)
store i32 %30, i32* %7
store i32 %30, i32* %6
%31 = mul i32 %30, %30
%32 = zext i32 %31 to i64
%33 = call i8* @llvm.stacksave()
%34 = alloca float, i64 %32
%35 = icmp sgt i32 %31, 0
br i1 %35, label %36, label %114
36: ; preds = %17
%37 = icmp ult i32 %31, 8
br i1 %37, label %107, label %38
38: ; preds = %36
%39 = and i64 %32, 4294967288
%40 = add nsw i64 %39, -8
%41 = lshr exact i64 %40, 3
%42 = add nuw nsw i64 %41, 1
%43 = and i64 %42, 7
%44 = icmp ult i64 %40, 56
br i1 %44, label %92, label %45
45: ; preds = %38
%46 = and i64 %42, 4611686018427387896
br label %47
47: ; preds = %47, %45
%48 = phi i64 [ 0, %45 ], [ %89, %47 ]
%49 = phi i64 [ 0, %45 ], [ %90, %47 ]
%50 = getelementptr inbounds float, float* %34, i64 %48
%51 = bitcast float* %50 to <4 x float>*
store <4 x float> <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00>, <4 x float>* %51
%52 = getelementptr inbounds float, float* %50, i64 4
%53 = bitcast float* %52 to <4 x float>*
store <4 x float> <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00>, <4 x float>* %53
%54 = or i64 %48, 8
%55 = getelementptr inbounds float, float* %34, i64 %54
%56 = bitcast float* %55 to <4 x float>*
store <4 x float> <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00>, <4 x float>* %56
%57 = getelementptr inbounds float, float* %55, i64 4
%58 = bitcast float* %57 to <4 x float>*
store <4 x float> <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00>, <4 x float>* %58
%59 = or i64 %48, 16
%60 = getelementptr inbounds float, float* %34, i64 %59
%61 = bitcast float* %60 to <4 x float>*
store <4 x float> <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00>, <4 x float>* %61
%62 = getelementptr inbounds float, float* %60, i64 4
%63 = bitcast float* %62 to <4 x float>*
store <4 x float> <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00>, <4 x float>* %63
%64 = or i64 %48, 24
%65 = getelementptr inbounds float, float* %34, i64 %64
%66 = bitcast float* %65 to <4 x float>*
store <4 x float> <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00>, <4 x float>* %66
%67 = getelementptr inbounds float, float* %65, i64 4
%68 = bitcast float* %67 to <4 x float>*
store <4 x float> <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00>, <4 x float>* %68
%69 = or i64 %48, 32
%70 = getelementptr inbounds float, float* %34, i64 %69
%71 = bitcast float* %70 to <4 x float>*
store <4 x float> <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00>, <4 x float>* %71
%72 = getelementptr inbounds float, float* %70, i64 4
%73 = bitcast float* %72 to <4 x float>*
store <4 x float> <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00>, <4 x float>* %73
%74 = or i64 %48, 40
%75 = getelementptr inbounds float, float* %34, i64 %74
%76 = bitcast float* %75 to <4 x float>*
store <4 x float> <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00>, <4 x float>* %76
%77 = getelementptr inbounds float, float* %75, i64 4
%78 = bitcast float* %77 to <4 x float>*
store <4 x float> <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00>, <4 x float>* %78
%79 = or i64 %48, 48
%80 = getelementptr inbounds float, float* %34, i64 %79
%81 = bitcast float* %80 to <4 x float>*
store <4 x float> <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00>, <4 x float>* %81
%82 = getelementptr inbounds float, float* %80, i64 4
%83 = bitcast float* %82 to <4 x float>*
store <4 x float> <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00>, <4 x float>* %83
%84 = or i64 %48, 56
%85 = getelementptr inbounds float, float* %34, i64 %84
%86 = bitcast float* %85 to <4 x float>*
store <4 x float> <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00>, <4 x float>* %86
%87 = getelementptr inbounds float, float* %85, i64 4
%88 = bitcast float* %87 to <4 x float>*
store <4 x float> <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00>, <4 x float>* %88
%89 = add nuw i64 %48, 64
%90 = add nuw i64 %49, 8
%91 = icmp eq i64 %90, %46
br i1 %91, label %92, label %47
92: ; preds = %47, %38
%93 = phi i64 [ 0, %38 ], [ %89, %47 ]
%94 = icmp eq i64 %43, 0
br i1 %94, label %105, label %95
95: ; preds = %92, %95
%96 = phi i64 [ %102, %95 ], [ %93, %92 ]
%97 = phi i64 [ %103, %95 ], [ 0, %92 ]
%98 = getelementptr inbounds float, float* %34, i64 %96
%99 = bitcast float* %98 to <4 x float>*
store <4 x float> <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00>, <4 x float>* %99
%100 = getelementptr inbounds float, float* %98, i64 4
%101 = bitcast float* %100 to <4 x float>*
store <4 x float> <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00>, <4 x float>* %101
%102 = add nuw i64 %96, 8
%103 = add i64 %97, 1
%104 = icmp eq i64 %103, %43
br i1 %104, label %105, label %95
105: ; preds = %95, %92
%106 = icmp eq i64 %39, %32
br i1 %106, label %114, label %107
107: ; preds = %36, %105
%108 = phi i64 [ 0, %36 ], [ %39, %105 ]
br label %109
109: ; preds = %107, %109
%110 = phi i64 [ %112, %109 ], [ %108, %107 ]
%111 = getelementptr inbounds float, float* %34, i64 %110
store float 1.000000e+00, float* %111
%112 = add nuw nsw i64 %110, 1
%113 = icmp eq i64 %112, %32
br i1 %113, label %114, label %109
114: ; preds = %109, %105, %17
%115 = icmp sgt i32 %0, 5
br i1 %115, label %116, label %122
116: ; preds = %114
%117 = getelementptr inbounds i8*, i8** %1, i64 5
%118 = load i8*, i8** %117
%119 = call float* @iio_read_image_float(i8* %118, i32* %7, i32* %6)
%120 = load i32, i32* %7
%121 = load i32, i32* %6
br label %122
122: ; preds = %116, %114
%123 = phi float* [ %119, %116 ], [ %34, %114 ]
%124 = phi i32 [ %120, %116 ], [ %30, %114 ]
%125 = phi i32 [ %121, %116 ], [ %30, %114 ]
%126 = sdiv i32 %125, 2
%127 = sdiv i32 %124, 2
%128 = load i32, i32* %3
%129 = load i32, i32* %4
%130 = load i32, i32* %5
%131 = shl i32 %128, 2
%132 = mul i32 %131, %129
%133 = mul i32 %132, %130
%134 = call float* @malloc(i32 %133)
%135 = icmp sgt i32 %130, 0
br i1 %135, label %145, label %136
136: ; preds = %145, %122
%137 = phi i32 [ %129, %122 ], [ %161, %145 ]
%138 = phi i32 [ %128, %122 ], [ %160, %145 ]
%139 = phi i32 [ %130, %122 ], [ %158, %145 ]
%140 = getelementptr inbounds i8*, i8** %1, i64 4
%141 = load i8*, i8** %140
%142 = call i32 @iio_save_image_float_split(i8* %141, float* %134, i32 %138, i32 %137, i32 %139)
%143 = call i32 @free(float* %23)
%144 = call i32 @free(float* %134)
br label %165
145: ; preds = %122, %162
%146 = phi i32 [ %164, %162 ], [ %125, %122 ]
%147 = phi i32 [ %163, %162 ], [ %124, %122 ]
%148 = phi i32 [ %161, %162 ], [ %129, %122 ]
%149 = phi i32 [ %160, %162 ], [ %128, %122 ]
%150 = phi i32 [ %157, %162 ], [ 0, %122 ]
%151 = mul i32 %149, %150
%152 = mul i32 %151, %148
%153 = sext i32 %152 to i64
%154 = getelementptr inbounds float, float* %23, i64 %153
%155 = getelementptr inbounds float, float* %134, i64 %153
%156 = call i32 @morphoop(float* %154, i32 %149, i32 %148, float* %123, i32 %147, i32 %146, i32 %127, i32 %126, i8* %25, float* %155)
%157 = add nuw nsw i32 %150, 1
%158 = load i32, i32* %5
%159 = icmp slt i32 %157, %158
%160 = load i32, i32* %3
%161 = load i32, i32* %4
br i1 %159, label %162, label %136
162: ; preds = %145
%163 = load i32, i32* %7
%164 = load i32, i32* %6
br label %145
165: ; preds = %136, %9
%166 = phi i32 [ 1, %9 ], [ 0, %136 ]
ret i32 %166
}