#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 /*<<< orphan*/ NAN;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ isnan(float);
float op_average(float *, int);
float op_max(float *, int);
float op_median(float *, int);
float op_min(float *, int);
float op_random(float *, int);
float op_rank(float *, int, float);
size_t p_sym(int, int, int, int);
int /*<<< orphan*/ stderr;
scalar_t__ strcmp(char *, char *);
void morphoop(float *ptrI, int nc, int nr, float *ptrS, int se_nc, int se_nr,
              int ctr_c, int ctr_r, char *operation, float *ptrO) {
  int n, m, k, l, kmax, kmin, lmax, lmin;
  float pdata[se_nr * se_nc], S;
  kmin = -ctr_r;
  kmax = se_nr - 1 - ctr_r;
  lmin = -ctr_c;
  lmax = se_nc - 1 - ctr_c;
  for (n = 0; n < nr; n++)
    for (m = 0; m < nc; m++) {
      int i = 0;
      for (k = kmin; k <= kmax; k++)
        for (l = lmin; l <= lmax; l++)
          if (ptrS[se_nc * (k - kmin) + (l - lmin)]) {
            float v = ptrI[p_sym(nc, nr, (m + l), (n + k))];
            if (!isnan(v))
              pdata[i++] = v;
          }
      if (strcmp(operation, "min") == 0) {
        S = op_min(pdata, i);
      } else if (strcmp(operation, "max") == 0) {
        S = op_max(pdata, i);
      } else if (strcmp(operation, "median") == 0) {
        S = op_median(pdata, i);
      } else if (strcmp(operation, "average") == 0) {
        S = op_average(pdata, i);
      } else if (strcmp(operation, "random") == 0) {
        S = op_random(pdata, i);
      } else if (strcmp(operation, "rank") == 0) {
        S = op_rank(pdata, i, ptrI[p_sym(nc, nr, m, n)]);
      } else {
        fprintf(stderr, "unknown operation: %s", operation);
        exit(1);
      }
      if (i != 0)
        *ptrO++ = (float)S;
      else
        *ptrO++ = NAN;
    }
}


x86 assembly (clang, -O0):
<morphoop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    -0x1c(%rbp),%ecx
imul   %ecx,%eax
mov    %rsp,%rcx
mov    %rcx,-0x48(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x68(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x50(%rbp)
xor    %eax,%eax
sub    0x18(%rbp),%eax
mov    %eax,-0x38(%rbp)
mov    -0x20(%rbp),%eax
sub    $0x1,%eax
sub    0x18(%rbp),%eax
mov    %eax,-0x34(%rbp)
xor    %eax,%eax
sub    0x10(%rbp),%eax
mov    %eax,-0x40(%rbp)
mov    -0x1c(%rbp),%eax
sub    $0x1,%eax
sub    0x10(%rbp),%eax
mov    %eax,-0x3c(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1538 <morphoop+0x388>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1525 <morphoop+0x375>
movl   $0x0,-0x58(%rbp)
mov    -0x38(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x34(%rbp),%eax
jg     1346 <morphoop+0x196>
mov    -0x40(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x3c(%rbp),%eax
jg     1333 <morphoop+0x183>
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
mov    -0x2c(%rbp),%edx
sub    -0x38(%rbp),%edx
imul   %edx,%ecx
mov    -0x30(%rbp),%edx
sub    -0x40(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    12bc <morphoop+0x10c>
jp     12bc <morphoop+0x10c>
jmp    1320 <morphoop+0x170>
mov    -0x8(%rbp),%rax
mov    %rax,-0x70(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x28(%rbp),%edx
add    -0x30(%rbp),%edx
mov    -0x24(%rbp),%ecx
add    -0x2c(%rbp),%ecx
call   1060 <p_sym@plt>
mov    %rax,%rcx
mov    -0x70(%rbp),%rax
movss  (%rax,%rcx,4),%xmm0
movss  %xmm0,-0x5c(%rbp)
movss  -0x5c(%rbp),%xmm0
call   10a0 <isnan@plt>
cmp    $0x0,%eax
jne    131b <morphoop+0x16b>
mov    -0x68(%rbp),%rax
movss  -0x5c(%rbp),%xmm0
mov    -0x58(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x58(%rbp)
movslq %ecx,%rcx
movss  %xmm0,(%rax,%rcx,4)
jmp    1320 <morphoop+0x170>
jmp    1325 <morphoop+0x175>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    1279 <morphoop+0xc9>
jmp    1338 <morphoop+0x188>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1267 <morphoop+0xb7>
mov    0x20(%rbp),%rdi
lea    0xcaf(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    1376 <morphoop+0x1c6>
mov    -0x68(%rbp),%rdi
mov    -0x58(%rbp),%esi
call   1040 <op_min@plt>
movss  %xmm0,-0x54(%rbp)
jmp    14cd <morphoop+0x31d>
mov    0x20(%rbp),%rdi
lea    0xc83(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    13a6 <morphoop+0x1f6>
mov    -0x68(%rbp),%rdi
mov    -0x58(%rbp),%esi
call   1080 <op_max@plt>
movss  %xmm0,-0x54(%rbp)
jmp    14c8 <morphoop+0x318>
mov    0x20(%rbp),%rdi
lea    0xc57(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    13d6 <morphoop+0x226>
mov    -0x68(%rbp),%rdi
mov    -0x58(%rbp),%esi
call   10c0 <op_median@plt>
movss  %xmm0,-0x54(%rbp)
jmp    14c3 <morphoop+0x313>
mov    0x20(%rbp),%rdi
lea    0xc2e(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    1406 <morphoop+0x256>
mov    -0x68(%rbp),%rdi
mov    -0x58(%rbp),%esi
call   1030 <op_average@plt>
movss  %xmm0,-0x54(%rbp)
jmp    14be <morphoop+0x30e>
mov    0x20(%rbp),%rdi
lea    0xc06(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    1436 <morphoop+0x286>
mov    -0x68(%rbp),%rdi
mov    -0x58(%rbp),%esi
call   10d0 <op_random@plt>
movss  %xmm0,-0x54(%rbp)
jmp    14b9 <morphoop+0x309>
mov    0x20(%rbp),%rdi
lea    0xbdd(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    1491 <morphoop+0x2e1>
mov    -0x58(%rbp),%eax
mov    %eax,-0x7c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x78(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x28(%rbp),%edx
mov    -0x24(%rbp),%ecx
call   1060 <p_sym@plt>
mov    -0x68(%rbp),%rdi
mov    -0x7c(%rbp),%esi
mov    %rax,%rcx
mov    -0x78(%rbp),%rax
movss  (%rax,%rcx,4),%xmm0
call   1090 <op_rank@plt>
movss  %xmm0,-0x54(%rbp)
jmp    14b4 <morphoop+0x304>
mov    0x2b40(%rip),%rax
mov    (%rax),%edi
mov    0x20(%rbp),%rdx
lea    0xb7e(%rip),%rsi
call   1070 <fprintf@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>
jmp    14b9 <morphoop+0x309>
jmp    14be <morphoop+0x30e>
jmp    14c3 <morphoop+0x313>
jmp    14c8 <morphoop+0x318>
jmp    14cd <morphoop+0x31d>
cmpl   $0x0,-0x58(%rbp)
je     14f4 <morphoop+0x344>
movss  -0x54(%rbp),%xmm0
mov    0x28(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,0x28(%rbp)
movss  %xmm0,(%rax)
jmp    1512 <morphoop+0x362>
mov    0x2afd(%rip),%rax
cvtsi2ssl (%rax),%xmm0
mov    0x28(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,0x28(%rbp)
movss  %xmm0,(%rax)
jmp    1517 <morphoop+0x367>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    124e <morphoop+0x9e>
jmp    152a <morphoop+0x37a>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    123b <morphoop+0x8b>
mov    -0x48(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<morphoop>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
mov    %rcx,-0x98(%rbp)
mov    %esi,-0x30(%rbp)
mov    %rdi,-0x80(%rbp)
mov    %r9d,%eax
mov    %r8d,-0x3c(%rbp)
imul   %r8d,%eax
lea    0xf(,%rax,4),%rax
and    $0xfffffffffffffff0,%rax
mov    %rsp,%rsi
sub    %rax,%rsi
mov    %rsi,-0x38(%rbp)
mov    %rsi,%rsp
mov    %edx,-0x40(%rbp)
test   %edx,%edx
jle    14c7 <morphoop+0x317>
mov    %r9d,%ecx
mov    0x28(%rbp),%rdx
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%esi
mov    %eax,%edi
not    %edi
add    %r9d,%edi
mov    %edi,-0x64(%rbp)
sub    %eax,%ecx
mov    %ecx,-0x6c(%rbp)
neg    %eax
mov    %eax,-0x4c(%rbp)
mov    %esi,%eax
neg    %eax
mov    %eax,-0x54(%rbp)
not    %esi
add    -0x3c(%rbp),%esi
mov    %esi,-0x68(%rbp)
mov    -0x30(%rbp),%eax
mov    %rax,-0x88(%rbp)
xor    %eax,%eax
mov    %rax,-0x60(%rbp)
jmp    1257 <morphoop+0xa7>
mov    -0x60(%rbp),%rcx
add    $0x1,%ecx
mov    %rcx,%rax
mov    %rcx,-0x60(%rbp)
cmp    -0x40(%rbp),%ecx
je     14c7 <morphoop+0x317>
cmpl   $0x0,-0x30(%rbp)
jle    1240 <morphoop+0x90>
mov    -0x54(%rbp),%eax
mov    %eax,-0x50(%rbp)
xor    %ebx,%ebx
jmp    1289 <morphoop+0xd9>
nopw   0x0(%rax,%rax,1)
movss  %xmm0,(%rdx)
add    $0x4,%rdx
add    $0x1,%rbx
addl   $0x1,-0x50(%rbp)
cmp    -0x88(%rbp),%rbx
je     1240 <morphoop+0x90>
mov    %rbx,-0x48(%rbp)
mov    %rdx,-0x90(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x4c(%rbp),%eax
cmp    %eax,-0x64(%rbp)
jge    1370 <morphoop+0x1c0>
mov    0x20(%rbp),%rbx
mov    %rbx,%rdi
lea    0xd4f(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     1440 <morphoop+0x290>
mov    %rbx,%rdi
lea    0xd3b(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
mov    -0x2c(%rbp),%r14d
je     1460 <morphoop+0x2b0>
mov    %rbx,%rdi
lea    0xd23(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     146e <morphoop+0x2be>
mov    %rbx,%rdi
lea    0xd12(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     147c <morphoop+0x2cc>
mov    %rbx,%rdi
lea    0xd02(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     148a <morphoop+0x2da>
mov    %rbx,%rdi
lea    0xcf1(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
jne    14d6 <morphoop+0x326>
mov    -0x30(%rbp),%edi
mov    -0x40(%rbp),%esi
mov    -0x48(%rbp),%rbx
mov    %ebx,%edx
mov    -0x60(%rbp),%rcx
call   1060 <p_sym@plt>
mov    -0x80(%rbp),%rcx
movss  (%rcx,%rax,4),%xmm0
mov    -0x38(%rbp),%rdi
mov    %r14d,%esi
call   1090 <op_rank@plt>
jmp    14a4 <morphoop+0x2f4>
xchg   %ax,%ax
xor    %r14d,%r14d
movl   $0x0,-0x2c(%rbp)
mov    -0x4c(%rbp),%eax
mov    %eax,%ebx
jmp    13a4 <morphoop+0x1f4>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x1,%ebx
mov    -0x70(%rbp),%r14d
add    -0x3c(%rbp),%r14d
cmp    -0x6c(%rbp),%ebx
je     12a7 <morphoop+0xf7>
mov    -0x54(%rbp),%eax
cmp    %eax,-0x68(%rbp)
mov    %r14d,-0x70(%rbp)
jl     1390 <morphoop+0x1e0>
mov    -0x60(%rbp),%rax
lea    (%rbx,%rax,1),%r12d
mov    -0x3c(%rbp),%r15d
mov    -0x50(%rbp),%r13d
jmp    13de <morphoop+0x22e>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%r13d
add    $0x1,%r14d
add    $0xffffffff,%r15d
je     1390 <morphoop+0x1e0>
movslq %r14d,%rax
mov    -0x98(%rbp),%rcx
movss  (%rcx,%rax,4),%xmm0
ucomiss 0xc0c(%rip),%xmm0
jne    13f8 <morphoop+0x248>
jnp    13d0 <morphoop+0x220>
mov    -0x30(%rbp),%edi
mov    -0x40(%rbp),%esi
mov    %r13d,%edx
mov    %r12d,%ecx
call   1060 <p_sym@plt>
mov    -0x80(%rbp),%rcx
movss  (%rcx,%rax,4),%xmm0
movss  %xmm0,-0x74(%rbp)
call   10a0 <isnan@plt>
test   %eax,%eax
jne    13d0 <morphoop+0x220>
mov    -0x2c(%rbp),%ecx
movslq %ecx,%rax
add    $0x1,%ecx
mov    %ecx,-0x2c(%rbp)
mov    -0x38(%rbp),%rcx
movss  -0x74(%rbp),%xmm0
movss  %xmm0,(%rcx,%rax,4)
jmp    13d0 <morphoop+0x220>
nopl   0x0(%rax)
mov    -0x38(%rbp),%rdi
mov    -0x2c(%rbp),%r14d
mov    %r14d,%esi
call   1040 <op_min@plt>
jmp    14a0 <morphoop+0x2f0>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    -0x38(%rbp),%rdi
mov    %r14d,%esi
call   1080 <op_max@plt>
jmp    14a0 <morphoop+0x2f0>
mov    -0x38(%rbp),%rdi
mov    %r14d,%esi
call   10c0 <op_median@plt>
jmp    14a0 <morphoop+0x2f0>
mov    -0x38(%rbp),%rdi
mov    %r14d,%esi
call   1030 <op_average@plt>
jmp    14a0 <morphoop+0x2f0>
mov    -0x38(%rbp),%rdi
mov    %r14d,%esi
call   10d0 <op_random@plt>
cs nopw 0x0(%rax,%rax,1)
mov    -0x48(%rbp),%rbx
test   %r14d,%r14d
mov    -0x90(%rbp),%rdx
jne    1270 <morphoop+0xc0>
mov    0x2b3d(%rip),%rax
xorps  %xmm0,%xmm0
cvtsi2ssl (%rax),%xmm0
jmp    1270 <morphoop+0xc0>
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2afb(%rip),%rax
mov    (%rax),%edi
lea    0xb41(%rip),%rsi
mov    %rbx,%rdx
call   1070 <fprintf@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"min\00"
@.str.1 = [4 x i8] c"max\00"
@.str.2 = [7 x i8] c"median\00"
@.str.3 = [8 x i8] c"average\00"
@.str.4 = [7 x i8] c"random\00"
@.str.5 = [5 x i8] c"rank\00"
@stderr = global i32 0
@.str.6 = [22 x i8] c"unknown operation: %s\00"
@NAN = global i32 0
define void @morphoop(float* %0, i32 %1, i32 %2, float* %3, i32 %4, i32 %5, i32 %6, i32 %7, i8* %8, float* %9) {
%11 = alloca float*
%12 = alloca i32
%13 = alloca i32
%14 = alloca float*
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i8*
%20 = alloca float*
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
%24 = alloca i32
%25 = alloca i32
%26 = alloca i32
%27 = alloca i32
%28 = alloca i32
%29 = alloca i8*
%30 = alloca i64
%31 = alloca float
%32 = alloca i32
%33 = alloca float
store float* %0, float** %11
store i32 %1, i32* %12
store i32 %2, i32* %13
store float* %3, float** %14
store i32 %4, i32* %15
store i32 %5, i32* %16
store i32 %6, i32* %17
store i32 %7, i32* %18
store i8* %8, i8** %19
store float* %9, float** %20
%34 = load i32, i32* %16
%35 = load i32, i32* %15
%36 = mul nsw i32 %34, %35
%37 = zext i32 %36 to i64
%38 = call i8* @llvm.stacksave()
store i8* %38, i8** %29
%39 = alloca float, i64 %37
store i64 %37, i64* %30
%40 = load i32, i32* %18
%41 = sub nsw i32 0, %40
store i32 %41, i32* %26
%42 = load i32, i32* %16
%43 = sub nsw i32 %42, 1
%44 = load i32, i32* %18
%45 = sub nsw i32 %43, %44
store i32 %45, i32* %25
%46 = load i32, i32* %17
%47 = sub nsw i32 0, %46
store i32 %47, i32* %28
%48 = load i32, i32* %15
%49 = sub nsw i32 %48, 1
%50 = load i32, i32* %17
%51 = sub nsw i32 %49, %50
store i32 %51, i32* %27
store i32 0, i32* %21
br label %52
52: ; preds = %196, %10
%53 = load i32, i32* %21
%54 = load i32, i32* %13
%55 = icmp slt i32 %53, %54
br i1 %55, label %56, label %199
56: ; preds = %52
store i32 0, i32* %22
br label %57
57: ; preds = %192, %56
%58 = load i32, i32* %22
%59 = load i32, i32* %12
%60 = icmp slt i32 %58, %59
br i1 %60, label %61, label %195
61: ; preds = %57
store i32 0, i32* %32
%62 = load i32, i32* %26
store i32 %62, i32* %23
br label %63
63: ; preds = %116, %61
%64 = load i32, i32* %23
%65 = load i32, i32* %25
%66 = icmp sle i32 %64, %65
br i1 %66, label %67, label %119
67: ; preds = %63
%68 = load i32, i32* %28
store i32 %68, i32* %24
br label %69
69: ; preds = %112, %67
%70 = load i32, i32* %24
%71 = load i32, i32* %27
%72 = icmp sle i32 %70, %71
br i1 %72, label %73, label %115
73: ; preds = %69
%74 = load float*, float** %14
%75 = load i32, i32* %15
%76 = load i32, i32* %23
%77 = load i32, i32* %26
%78 = sub nsw i32 %76, %77
%79 = mul nsw i32 %75, %78
%80 = load i32, i32* %24
%81 = load i32, i32* %28
%82 = sub nsw i32 %80, %81
%83 = add nsw i32 %79, %82
%84 = sext i32 %83 to i64
%85 = getelementptr inbounds float, float* %74, i64 %84
%86 = load float, float* %85
%87 = fcmp une float %86, 0.000000e+00
br i1 %87, label %88, label %111
88: ; preds = %73
%89 = load float*, float** %11
%90 = load i32, i32* %12
%91 = load i32, i32* %13
%92 = load i32, i32* %22
%93 = load i32, i32* %24
%94 = add nsw i32 %92, %93
%95 = load i32, i32* %21
%96 = load i32, i32* %23
%97 = add nsw i32 %95, %96
%98 = call i64 @p_sym(i32 %90, i32 %91, i32 %94, i32 %97)
%99 = getelementptr inbounds float, float* %89, i64 %98
%100 = load float, float* %99
store float %100, float* %33
%101 = load float, float* %33
%102 = call i32 @isnan(float %101)
%103 = icmp ne i32 %102, 0
br i1 %103, label %110, label %104
104: ; preds = %88
%105 = load float, float* %33
%106 = load i32, i32* %32
%107 = add nsw i32 %106, 1
store i32 %107, i32* %32
%108 = sext i32 %106 to i64
%109 = getelementptr inbounds float, float* %39, i64 %108
store float %105, float* %109
br label %110
110: ; preds = %104, %88
br label %111
111: ; preds = %110, %73
br label %112
112: ; preds = %111
%113 = load i32, i32* %24
%114 = add nsw i32 %113, 1
store i32 %114, i32* %24
br label %69
115: ; preds = %69
br label %116
116: ; preds = %115
%117 = load i32, i32* %23
%118 = add nsw i32 %117, 1
store i32 %118, i32* %23
br label %63
119: ; preds = %63
%120 = load i8*, i8** %19
%121 = call i64 @strcmp(i8* %120, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%122 = icmp eq i64 %121, 0
br i1 %122, label %123, label %126
123: ; preds = %119
%124 = load i32, i32* %32
%125 = call float @op_min(float* %39, i32 %124)
store float %125, float* %31
br label %179
126: ; preds = %119
%127 = load i8*, i8** %19
%128 = call i64 @strcmp(i8* %127, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%129 = icmp eq i64 %128, 0
br i1 %129, label %130, label %133
130: ; preds = %126
%131 = load i32, i32* %32
%132 = call float @op_max(float* %39, i32 %131)
store float %132, float* %31
br label %178
133: ; preds = %126
%134 = load i8*, i8** %19
%135 = call i64 @strcmp(i8* %134, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%136 = icmp eq i64 %135, 0
br i1 %136, label %137, label %140
137: ; preds = %133
%138 = load i32, i32* %32
%139 = call float @op_median(float* %39, i32 %138)
store float %139, float* %31
br label %177
140: ; preds = %133
%141 = load i8*, i8** %19
%142 = call i64 @strcmp(i8* %141, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%143 = icmp eq i64 %142, 0
br i1 %143, label %144, label %147
144: ; preds = %140
%145 = load i32, i32* %32
%146 = call float @op_average(float* %39, i32 %145)
store float %146, float* %31
br label %176
147: ; preds = %140
%148 = load i8*, i8** %19
%149 = call i64 @strcmp(i8* %148, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%150 = icmp eq i64 %149, 0
br i1 %150, label %151, label %154
151: ; preds = %147
%152 = load i32, i32* %32
%153 = call float @op_random(float* %39, i32 %152)
store float %153, float* %31
br label %175
154: ; preds = %147
%155 = load i8*, i8** %19
%156 = call i64 @strcmp(i8* %155, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%157 = icmp eq i64 %156, 0
br i1 %157, label %158, label %169
158: ; preds = %154
%159 = load i32, i32* %32
%160 = load float*, float** %11
%161 = load i32, i32* %12
%162 = load i32, i32* %13
%163 = load i32, i32* %22
%164 = load i32, i32* %21
%165 = call i64 @p_sym(i32 %161, i32 %162, i32 %163, i32 %164)
%166 = getelementptr inbounds float, float* %160, i64 %165
%167 = load float, float* %166
%168 = call float @op_rank(float* %39, i32 %159, float %167)
store float %168, float* %31
br label %174
169: ; preds = %154
%170 = load i32, i32* @stderr
%171 = load i8*, i8** %19
%172 = call i32 @fprintf(i32 %170, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0), i8* %171)
%173 = call i32 @exit(i32 1)
unreachable
174: ; preds = %158
br label %175
175: ; preds = %174, %151
br label %176
176: ; preds = %175, %144
br label %177
177: ; preds = %176, %137
br label %178
178: ; preds = %177, %130
br label %179
179: ; preds = %178, %123
%180 = load i32, i32* %32
%181 = icmp ne i32 %180, 0
br i1 %181, label %182, label %186
182: ; preds = %179
%183 = load float, float* %31
%184 = load float*, float** %20
%185 = getelementptr inbounds float, float* %184, i32 1
store float* %185, float** %20
store float %183, float* %184
br label %191
186: ; preds = %179
%187 = load i32, i32* @NAN
%188 = sitofp i32 %187 to float
%189 = load float*, float** %20
%190 = getelementptr inbounds float, float* %189, i32 1
store float* %190, float** %20
store float %188, float* %189
br label %191
191: ; preds = %186, %182
br label %192
192: ; preds = %191
%193 = load i32, i32* %22
%194 = add nsw i32 %193, 1
store i32 %194, i32* %22
br label %57
195: ; preds = %57
br label %196
196: ; preds = %195
%197 = load i32, i32* %21
%198 = add nsw i32 %197, 1
store i32 %198, i32* %21
br label %52
199: ; preds = %52
%200 = load i8*, i8** %29
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"min\00"
@.str.1 = [4 x i8] c"max\00"
@.str.2 = [7 x i8] c"median\00"
@.str.3 = [8 x i8] c"average\00"
@.str.4 = [7 x i8] c"random\00"
@.str.5 = [5 x i8] c"rank\00"
@stderr = global i32 0
@.str.6 = [22 x i8] c"unknown operation: %s\00"
@NAN = global i32 0
define void @morphoop(float* nocapture %0, i32 %1, i32 %2, float* nocapture %3, i32 %4, i32 %5, i32 %6, i32 %7, i8* %8, float* nocapture writeonly %9) {
%11 = mul nsw i32 %5, %4
%12 = zext i32 %11 to i64
%13 = alloca float, i64 %12
%14 = sub nsw i32 0, %7
%15 = sub i32 0, %6
%16 = icmp sgt i32 %2, 0
br i1 %16, label %17, label %125
17: ; preds = %10
%18 = xor i32 %6, -1
%19 = add i32 %18, %4
%20 = xor i32 %7, -1
%21 = add i32 %20, %5
%22 = icmp sgt i32 %1, 0
%23 = icmp slt i32 %21, %14
%24 = icmp slt i32 %19, %15
%25 = zext i32 %15 to i64
%26 = sub i32 %4, %6
%27 = sub i32 %5, %7
%28 = zext i32 %1 to i64
br label %29
29: ; preds = %17, %121
%30 = phi float* [ %9, %17 ], [ %122, %121 ]
%31 = phi i32 [ 0, %17 ], [ %123, %121 ]
br i1 %22, label %32, label %121
32: ; preds = %29, %112
%33 = phi i64 [ %119, %112 ], [ 0, %29 ]
%34 = phi float* [ %118, %112 ], [ %30, %29 ]
br i1 %23, label %73, label %35
35: ; preds = %32, %69
%36 = phi i32 [ %70, %69 ], [ 0, %32 ]
%37 = phi i32 [ %71, %69 ], [ %14, %32 ]
br i1 %24, label %69, label %38
38: ; preds = %35
%39 = add nsw i32 %37, %7
%40 = mul nsw i32 %39, %4
%41 = add i32 %40, %6
%42 = add nsw i32 %37, %31
br label %43
43: ; preds = %38, %64
%44 = phi i64 [ %25, %38 ], [ %66, %64 ]
%45 = phi i32 [ %36, %38 ], [ %65, %64 ]
%46 = trunc i64 %44 to i32
%47 = add i32 %41, %46
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds float, float* %3, i64 %48
%50 = load float, float* %49
%51 = fcmp une float %50, 0.000000e+00
br i1 %51, label %52, label %64
52: ; preds = %43
%53 = add i64 %44, %33
%54 = trunc i64 %53 to i32
%55 = call i64 @p_sym(i32 %1, i32 %2, i32 %54, i32 %42)
%56 = getelementptr inbounds float, float* %0, i64 %55
%57 = load float, float* %56
%58 = call i32 @isnan(float %57)
%59 = icmp eq i32 %58, 0
br i1 %59, label %60, label %64
60: ; preds = %52
%61 = add nsw i32 %45, 1
%62 = sext i32 %45 to i64
%63 = getelementptr inbounds float, float* %13, i64 %62
store float %57, float* %63
br label %64
64: ; preds = %52, %60, %43
%65 = phi i32 [ %45, %43 ], [ %45, %52 ], [ %61, %60 ]
%66 = add i64 %44, 1
%67 = trunc i64 %66 to i32
%68 = icmp eq i32 %26, %67
br i1 %68, label %69, label %43
69: ; preds = %64, %35
%70 = phi i32 [ %36, %35 ], [ %65, %64 ]
%71 = add i32 %37, 1
%72 = icmp eq i32 %71, %27
br i1 %72, label %73, label %35
73: ; preds = %69, %32
%74 = phi i32 [ 0, %32 ], [ %70, %69 ]
%75 = call i64 @strcmp(i8* %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%76 = icmp eq i64 %75, 0
br i1 %76, label %77, label %79
77: ; preds = %73
%78 = call float @op_min(float* %13, i32 %74)
br label %112
79: ; preds = %73
%80 = call i64 @strcmp(i8* %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%81 = icmp eq i64 %80, 0
br i1 %81, label %82, label %84
82: ; preds = %79
%83 = call float @op_max(float* %13, i32 %74)
br label %112
84: ; preds = %79
%85 = call i64 @strcmp(i8* %8, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%86 = icmp eq i64 %85, 0
br i1 %86, label %87, label %89
87: ; preds = %84
%88 = call float @op_median(float* %13, i32 %74)
br label %112
89: ; preds = %84
%90 = call i64 @strcmp(i8* %8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%91 = icmp eq i64 %90, 0
br i1 %91, label %92, label %94
92: ; preds = %89
%93 = call float @op_average(float* %13, i32 %74)
br label %112
94: ; preds = %89
%95 = call i64 @strcmp(i8* %8, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%96 = icmp eq i64 %95, 0
br i1 %96, label %97, label %99
97: ; preds = %94
%98 = call float @op_random(float* %13, i32 %74)
br label %112
99: ; preds = %94
%100 = call i64 @strcmp(i8* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%101 = icmp eq i64 %100, 0
br i1 %101, label %102, label %108
102: ; preds = %99
%103 = trunc i64 %33 to i32
%104 = call i64 @p_sym(i32 %1, i32 %2, i32 %103, i32 %31)
%105 = getelementptr inbounds float, float* %0, i64 %104
%106 = load float, float* %105
%107 = call float @op_rank(float* %13, i32 %74, float %106)
br label %112
108: ; preds = %99
%109 = load i32, i32* @stderr
%110 = call i32 @fprintf(i32 %109, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0), i8* %8)
%111 = call i32 @exit(i32 1)
unreachable
112: ; preds = %82, %92, %102, %97, %87, %77
%113 = phi float [ %78, %77 ], [ %83, %82 ], [ %88, %87 ], [ %93, %92 ], [ %98, %97 ], [ %107, %102 ]
%114 = icmp eq i32 %74, 0
%115 = load i32, i32* @NAN
%116 = sitofp i32 %115 to float
%117 = select i1 %114, float %116, float %113
%118 = getelementptr inbounds float, float* %34, i64 1
store float %117, float* %34
%119 = add nuw nsw i64 %33, 1
%120 = icmp eq i64 %119, %28
br i1 %120, label %121, label %32
121: ; preds = %112, %29
%122 = phi float* [ %30, %29 ], [ %118, %112 ]
%123 = add nuw nsw i32 %31, 1
%124 = icmp eq i32 %123, %2
br i1 %124, label %125, label %29
125: ; preds = %121, %10
ret void
}