#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ EOF;
int /*<<< orphan*/ errorf(char *, char const *);
scalar_t__ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ fputc(double, int /*<<< orphan*/ *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ *stdout;
scalar_t__ strcmp(char const *, char *);
void write_pgm_normalize_float(const char *fname, const float *data, int ncol,
                               int nrow) {
  FILE *f;
  int i, j;
  float v, max, min;
  max = min = 0;
  for (i = 0; i < nrow; i++)
    for (j = 0; j < ncol; j++) {
      v = data[j + i * ncol];
      if (v > max)
        max = v;
      if (v < min)
        min = v;
    }
  if (min < 0)
    fprintf(stderr, "Warning: negative values in '%s' are truncated to zero.\n",
            fname);
  if (strcmp(fname, "-") == 0)
    f = stdout;
  else
    f = fopen(fname, "w");
  if (f == NULL)
    errorf("Error: unable to open output image file ", fname);
  fprintf(f, "P5\n");
  fprintf(f, "%u %u\n", ncol, nrow);
  fprintf(f, "%d\n", 255);
  for (i = 0; i < nrow; i++)
    for (j = 0; j < ncol; j++)
      fputc((unsigned char)(data[j + i * ncol] > 0)
                ? 255.0 / max * data[j + i * ncol]
                : 0,
            f);
  if (f != stdout && fclose(f) == EOF)
    errorf("Error: unable to close file while writing PGM file ", fname);
}


x86 assembly (clang, -O0):
<write_pgm_normalize_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x34(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x30(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1225 <write_pgm_normalize_float+0xc5>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1212 <write_pgm_normalize_float+0xb2>
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%ecx
mov    -0x24(%rbp),%edx
imul   -0x14(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm0
movss  %xmm0,-0x2c(%rbp)
movss  -0x2c(%rbp),%xmm0
ucomiss -0x30(%rbp),%xmm0
jbe    11e2 <write_pgm_normalize_float+0x82>
movss  -0x2c(%rbp),%xmm0
movss  %xmm0,-0x30(%rbp)
movss  -0x2c(%rbp),%xmm1
movss  -0x34(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    11ff <write_pgm_normalize_float+0x9f>
movss  -0x2c(%rbp),%xmm0
movss  %xmm0,-0x34(%rbp)
jmp    1204 <write_pgm_normalize_float+0xa4>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    11a0 <write_pgm_normalize_float+0x40>
jmp    1217 <write_pgm_normalize_float+0xb7>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    118d <write_pgm_normalize_float+0x2d>
xorps  %xmm0,%xmm0
ucomiss -0x34(%rbp),%xmm0
jbe    124e <write_pgm_normalize_float+0xee>
mov    0x2d9f(%rip),%rax
movslq (%rax),%rdi
mov    -0x8(%rbp),%rdx
lea    0xdc1(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xde8(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    127b <write_pgm_normalize_float+0x11b>
mov    0x2d61(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
jmp    128f <write_pgm_normalize_float+0x12f>
mov    -0x8(%rbp),%rdi
lea    0xdbd(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    12aa <write_pgm_normalize_float+0x14a>
mov    -0x8(%rbp),%rsi
lea    0xda0(%rip),%rdi
call   1070 <errorf@plt>
mov    -0x20(%rbp),%rdi
lea    0xdb9(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
lea    0xda5(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x20(%rbp),%rdi
lea    0xd9a(%rip),%rsi
mov    $0xff,%edx
mov    $0x0,%al
call   1060 <fprintf@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    13be <write_pgm_normalize_float+0x25e>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    13ab <write_pgm_normalize_float+0x24b>
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%ecx
mov    -0x24(%rbp),%edx
imul   -0x14(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
movzbl %al,%eax
cmp    $0x0,%eax
je     1382 <write_pgm_normalize_float+0x222>
movss  -0x30(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xcac(%rip),%xmm0
divsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%ecx
mov    -0x24(%rbp),%edx
imul   -0x14(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
jmp    138f <write_pgm_normalize_float+0x22f>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x40(%rbp)
jmp    138f <write_pgm_normalize_float+0x22f>
movsd  -0x40(%rbp),%xmm0
mov    -0x20(%rbp),%rdi
call   1040 <fputc@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1305 <write_pgm_normalize_float+0x1a5>
jmp    13b0 <write_pgm_normalize_float+0x250>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    12f2 <write_pgm_normalize_float+0x192>
mov    -0x20(%rbp),%rax
mov    0x2c07(%rip),%rcx
cmp    (%rcx),%rax
je     13fb <write_pgm_normalize_float+0x29b>
mov    -0x20(%rbp),%rdi
call   1030 <fclose@plt>
mov    0x2c06(%rip),%rcx
cmp    (%rcx),%rax
jne    13fb <write_pgm_normalize_float+0x29b>
mov    -0x8(%rbp),%rsi
lea    0xc87(%rip),%rdi
call   1070 <errorf@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_pgm_normalize_float>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %edx,%r12d
mov    %rsi,%rbx
mov    %rdi,%r14
movslq %edx,%r13
mov    %ecx,%eax
mov    %rax,0x18(%rsp)
mov    %edx,%r15d
mov    %ecx,0x8(%rsp)
test   %ecx,%ecx
jle    1260 <write_pgm_normalize_float+0xf0>
mov    %r15d,%eax
and    $0xfffffffe,%eax
lea    0x4(%rbx),%rcx
lea    0x0(,%r13,4),%rdx
xorps  %xmm0,%xmm0
xor    %ebp,%ebp
xorps  %xmm4,%xmm4
jmp    11ce <write_pgm_normalize_float+0x5e>
nopl   0x0(%rax)
add    $0x1,%rbp
add    %rdx,%rcx
cmp    0x18(%rsp),%rbp
je     1235 <write_pgm_normalize_float+0xc5>
test   %r12d,%r12d
jle    11c0 <write_pgm_normalize_float+0x50>
xor    %edi,%edi
cmp    $0x1,%r12d
je     120d <write_pgm_normalize_float+0x9d>
movaps %xmm0,%xmm1
xchg   %ax,%ax
movss  -0x4(%rcx,%rdi,4),%xmm2
movss  (%rcx,%rdi,4),%xmm0
movaps %xmm2,%xmm3
maxss  %xmm4,%xmm3
minss  %xmm1,%xmm2
movaps %xmm0,%xmm4
maxss  %xmm3,%xmm4
minss  %xmm2,%xmm0
add    $0x2,%rdi
movaps %xmm0,%xmm1
cmp    %rdi,%rax
jne    11e0 <write_pgm_normalize_float+0x70>
test   $0x1,%r15b
je     11c0 <write_pgm_normalize_float+0x50>
mov    %rbp,%rsi
imul   %r13,%rsi
add    %rsi,%rdi
movss  (%rbx,%rdi,4),%xmm1
movaps %xmm1,%xmm2
maxss  %xmm4,%xmm2
minss  %xmm0,%xmm1
movaps %xmm2,%xmm4
movaps %xmm1,%xmm0
jmp    11c0 <write_pgm_normalize_float+0x50>
movss  %xmm4,0x4(%rsp)
xorps  %xmm1,%xmm1
ucomiss %xmm0,%xmm1
jbe    1269 <write_pgm_normalize_float+0xf9>
mov    0x2d8e(%rip),%rax
movslq (%rax),%rdi
lea    0xdb8(%rip),%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1060 <fprintf@plt>
jmp    1269 <write_pgm_normalize_float+0xf9>
xorps  %xmm0,%xmm0
movss  %xmm0,0x4(%rsp)
lea    0xdd5(%rip),%rsi
mov    %r14,%rdi
call   1050 <strcmp@plt>
test   %rax,%rax
je     1291 <write_pgm_normalize_float+0x121>
lea    0xdc3(%rip),%rsi
mov    %r14,%rdi
call   1080 <fopen@plt>
mov    %rax,%rbp
jmp    129b <write_pgm_normalize_float+0x12b>
mov    0x2d38(%rip),%rax
mov    (%rax),%rbp
mov    %r13,0x10(%rsp)
test   %rbp,%rbp
jne    12b4 <write_pgm_normalize_float+0x144>
lea    0xd9d(%rip),%rdi
mov    %r14,%rsi
call   1070 <errorf@plt>
mov    %r14,0x20(%rsp)
lea    0xdb2(%rip),%rdi
mov    $0x3,%esi
mov    $0x1,%edx
mov    %rbp,%rcx
call   1090 <fwrite@plt>
lea    0xd9d(%rip),%rsi
mov    %rbp,%rdi
mov    %r12d,%edx
mov    0x8(%rsp),%r14d
mov    %r14d,%ecx
xor    %eax,%eax
call   1060 <fprintf@plt>
lea    0xd88(%rip),%rsi
mov    %rbp,%rdi
mov    $0xff,%edx
xor    %eax,%eax
call   1060 <fprintf@plt>
test   %r14d,%r14d
jle    137f <write_pgm_normalize_float+0x20f>
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xce5(%rip),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
shlq   $0x2,0x10(%rsp)
xor    %r13d,%r13d
jmp    1340 <write_pgm_normalize_float+0x1d0>
add    $0x1,%r13
add    0x10(%rsp),%rbx
cmp    0x18(%rsp),%r13
je     137f <write_pgm_normalize_float+0x20f>
test   %r12d,%r12d
jle    1330 <write_pgm_normalize_float+0x1c0>
xor    %r14d,%r14d
jmp    1364 <write_pgm_normalize_float+0x1f4>
nopw   0x0(%rax,%rax,1)
xorps  %xmm0,%xmm0
mov    %rbp,%rdi
call   1040 <fputc@plt>
add    $0x1,%r14
cmp    %r14,%r15
je     1330 <write_pgm_normalize_float+0x1c0>
movss  (%rbx,%r14,4),%xmm0
ucomiss 0xc97(%rip),%xmm0
jbe    1350 <write_pgm_normalize_float+0x1e0>
cvtss2sd %xmm0,%xmm0
mulsd  0x8(%rsp),%xmm0
jmp    1353 <write_pgm_normalize_float+0x1e3>
mov    0x2c4a(%rip),%rax
cmp    (%rax),%rbp
je     13be <write_pgm_normalize_float+0x24e>
mov    %rbp,%rdi
call   1030 <fclose@plt>
mov    0x2c4e(%rip),%rcx
cmp    (%rcx),%rax
jne    13be <write_pgm_normalize_float+0x24e>
lea    0xcdb(%rip),%rdi
mov    0x20(%rsp),%rsi
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1070 <errorf@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [57 x i8] c"Warning: negative values in '%s' are truncated to zero.\0A\00"
@.str.1 = [2 x i8] c"-\00"
@stdout = global i32* null
@.str.2 = [2 x i8] c"w\00"
@.str.3 = [41 x i8] c"Error: unable to open output image file \00"
@.str.4 = [4 x i8] c"P5\0A\00"
@.str.5 = [7 x i8] c"%u %u\0A\00"
@.str.6 = [4 x i8] c"%d\0A\00"
@EOF = global i64 0
@.str.7 = [52 x i8] c"Error: unable to close file while writing PGM file \00"
define void @write_pgm_normalize_float(i8* %0, float* %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca float*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32*
%10 = alloca i32
%11 = alloca i32
%12 = alloca float
%13 = alloca float
%14 = alloca float
store i8* %0, i8** %5
store float* %1, float** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
store float 0.000000e+00, float* %14
store float 0.000000e+00, float* %13
store i32 0, i32* %10
br label %15
15: ; preds = %50, %4
%16 = load i32, i32* %10
%17 = load i32, i32* %8
%18 = icmp slt i32 %16, %17
br i1 %18, label %19, label %53
19: ; preds = %15
store i32 0, i32* %11
br label %20
20: ; preds = %46, %19
%21 = load i32, i32* %11
%22 = load i32, i32* %7
%23 = icmp slt i32 %21, %22
br i1 %23, label %24, label %49
24: ; preds = %20
%25 = load float*, float** %6
%26 = load i32, i32* %11
%27 = load i32, i32* %10
%28 = load i32, i32* %7
%29 = mul nsw i32 %27, %28
%30 = add nsw i32 %26, %29
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds float, float* %25, i64 %31
%33 = load float, float* %32
store float %33, float* %12
%34 = load float, float* %12
%35 = load float, float* %13
%36 = fcmp ogt float %34, %35
br i1 %36, label %37, label %39
37: ; preds = %24
%38 = load float, float* %12
store float %38, float* %13
br label %39
39: ; preds = %37, %24
%40 = load float, float* %12
%41 = load float, float* %14
%42 = fcmp olt float %40, %41
br i1 %42, label %43, label %45
43: ; preds = %39
%44 = load float, float* %12
store float %44, float* %14
br label %45
45: ; preds = %43, %39
br label %46
46: ; preds = %45
%47 = load i32, i32* %11
%48 = add nsw i32 %47, 1
store i32 %48, i32* %11
br label %20
49: ; preds = %20
br label %50
50: ; preds = %49
%51 = load i32, i32* %10
%52 = add nsw i32 %51, 1
store i32 %52, i32* %10
br label %15
53: ; preds = %15
%54 = load float, float* %14
%55 = fcmp olt float %54, 0.000000e+00
br i1 %55, label %56, label %62
56: ; preds = %53
%57 = load i32, i32* @stderr
%58 = sext i32 %57 to i64
%59 = inttoptr i64 %58 to i32*
%60 = load i8*, i8** %5
%61 = call i32 (i32*, i8*, ...) @fprintf(i32* %59, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i8* %60)
br label %62
62: ; preds = %56, %53
%63 = load i8*, i8** %5
%64 = call i64 @strcmp(i8* %63, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%65 = icmp eq i64 %64, 0
br i1 %65, label %66, label %68
66: ; preds = %62
%67 = load i32*, i32** @stdout
store i32* %67, i32** %9
br label %71
68: ; preds = %62
%69 = load i8*, i8** %5
%70 = call i32* @fopen(i8* %69, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %70, i32** %9
br label %71
71: ; preds = %68, %66
%72 = load i32*, i32** %9
%73 = icmp eq i32* %72, null
br i1 %73, label %74, label %77
74: ; preds = %71
%75 = load i8*, i8** %5
%76 = call i32 @errorf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.3, i64 0, i64 0), i8* %75)
br label %77
77: ; preds = %74, %71
%78 = load i32*, i32** %9
%79 = call i32 (i32*, i8*, ...) @fprintf(i32* %78, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%80 = load i32*, i32** %9
%81 = load i32, i32* %7
%82 = load i32, i32* %8
%83 = call i32 (i32*, i8*, ...) @fprintf(i32* %80, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i32 %81, i32 %82)
%84 = load i32*, i32** %9
%85 = call i32 (i32*, i8*, ...) @fprintf(i32* %84, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i32 255)
store i32 0, i32* %10
br label %86
86: ; preds = %134, %77
%87 = load i32, i32* %10
%88 = load i32, i32* %8
%89 = icmp slt i32 %87, %88
br i1 %89, label %90, label %137
90: ; preds = %86
store i32 0, i32* %11
br label %91
91: ; preds = %130, %90
%92 = load i32, i32* %11
%93 = load i32, i32* %7
%94 = icmp slt i32 %92, %93
br i1 %94, label %95, label %133
95: ; preds = %91
%96 = load float*, float** %6
%97 = load i32, i32* %11
%98 = load i32, i32* %10
%99 = load i32, i32* %7
%100 = mul nsw i32 %98, %99
%101 = add nsw i32 %97, %100
%102 = sext i32 %101 to i64
%103 = getelementptr inbounds float, float* %96, i64 %102
%104 = load float, float* %103
%105 = fcmp ogt float %104, 0.000000e+00
%106 = zext i1 %105 to i32
%107 = trunc i32 %106 to i8
%108 = zext i8 %107 to i32
%109 = icmp ne i32 %108, 0
br i1 %109, label %110, label %125
110: ; preds = %95
%111 = load float, float* %13
%112 = fpext float %111 to double
%113 = fdiv double 2.550000e+02, %112
%114 = load float*, float** %6
%115 = load i32, i32* %11
%116 = load i32, i32* %10
%117 = load i32, i32* %7
%118 = mul nsw i32 %116, %117
%119 = add nsw i32 %115, %118
%120 = sext i32 %119 to i64
%121 = getelementptr inbounds float, float* %114, i64 %120
%122 = load float, float* %121
%123 = fpext float %122 to double
%124 = fmul double %113, %123
br label %126
125: ; preds = %95
br label %126
126: ; preds = %125, %110
%127 = phi double [ %124, %110 ], [ 0.000000e+00, %125 ]
%128 = load i32*, i32** %9
%129 = call i32 @fputc(double %127, i32* %128)
br label %130
130: ; preds = %126
%131 = load i32, i32* %11
%132 = add nsw i32 %131, 1
store i32 %132, i32* %11
br label %91
133: ; preds = %91
br label %134
134: ; preds = %133
%135 = load i32, i32* %10
%136 = add nsw i32 %135, 1
store i32 %136, i32* %10
br label %86
137: ; preds = %86
%138 = load i32*, i32** %9
%139 = load i32*, i32** @stdout
%140 = icmp ne i32* %138, %139
br i1 %140, label %141, label %149
141: ; preds = %137
%142 = load i32*, i32** %9
%143 = call i64 @fclose(i32* %142)
%144 = load i64, i64* @EOF
%145 = icmp eq i64 %143, %144
br i1 %145, label %146, label %149
146: ; preds = %141
%147 = load i8*, i8** %5
%148 = call i32 @errorf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.7, i64 0, i64 0), i8* %147)
br label %149
149: ; preds = %146, %141, %137
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [57 x i8] c"Warning: negative values in '%s' are truncated to zero.\0A\00"
@.str.1 = [2 x i8] c"-\00"
@stdout = global i32* null
@.str.2 = [2 x i8] c"w\00"
@.str.3 = [41 x i8] c"Error: unable to open output image file \00"
@.str.4 = [4 x i8] c"P5\0A\00"
@.str.5 = [7 x i8] c"%u %u\0A\00"
@.str.6 = [4 x i8] c"%d\0A\00"
@EOF = global i64 0
@.str.7 = [52 x i8] c"Error: unable to close file while writing PGM file \00"
define void @write_pgm_normalize_float(i8* %0, float* nocapture %1, i32 %2, i32 %3) {
%5 = icmp sgt i32 %3, 0
br i1 %5, label %6, label %70
6: ; preds = %4
%7 = icmp sgt i32 %2, 0
%8 = sext i32 %2 to i64
%9 = zext i32 %3 to i64
%10 = zext i32 %2 to i64
%11 = and i64 %10, 1
%12 = icmp eq i32 %2, 1
%13 = and i64 %10, 4294967294
%14 = icmp eq i64 %11, 0
br label %15
15: ; preds = %6, %58
%16 = phi i64 [ 0, %6 ], [ %61, %58 ]
%17 = phi float [ 0.000000e+00, %6 ], [ %60, %58 ]
%18 = phi float [ 0.000000e+00, %6 ], [ %59, %58 ]
br i1 %7, label %19, label %58
19: ; preds = %15
%20 = mul nsw i64 %16, %8
br i1 %12, label %44, label %21
21: ; preds = %19, %21
%22 = phi i64 [ %41, %21 ], [ 0, %19 ]
%23 = phi float [ %40, %21 ], [ %17, %19 ]
%24 = phi float [ %38, %21 ], [ %18, %19 ]
%25 = phi i64 [ %42, %21 ], [ 0, %19 ]
%26 = add nsw i64 %22, %20
%27 = getelementptr inbounds float, float* %1, i64 %26
%28 = load float, float* %27
%29 = fcmp ogt float %28, %24
%30 = select i1 %29, float %28, float %24
%31 = fcmp olt float %28, %23
%32 = select i1 %31, float %28, float %23
%33 = or i64 %22, 1
%34 = add nsw i64 %33, %20
%35 = getelementptr inbounds float, float* %1, i64 %34
%36 = load float, float* %35
%37 = fcmp ogt float %36, %30
%38 = select i1 %37, float %36, float %30
%39 = fcmp olt float %36, %32
%40 = select i1 %39, float %36, float %32
%41 = add nuw nsw i64 %22, 2
%42 = add i64 %25, 2
%43 = icmp eq i64 %42, %13
br i1 %43, label %44, label %21
44: ; preds = %21, %19
%45 = phi float [ undef, %19 ], [ %38, %21 ]
%46 = phi float [ undef, %19 ], [ %40, %21 ]
%47 = phi i64 [ 0, %19 ], [ %41, %21 ]
%48 = phi float [ %17, %19 ], [ %40, %21 ]
%49 = phi float [ %18, %19 ], [ %38, %21 ]
br i1 %14, label %58, label %50
50: ; preds = %44
%51 = add nsw i64 %47, %20
%52 = getelementptr inbounds float, float* %1, i64 %51
%53 = load float, float* %52
%54 = fcmp ogt float %53, %49
%55 = select i1 %54, float %53, float %49
%56 = fcmp olt float %53, %48
%57 = select i1 %56, float %53, float %48
br label %58
58: ; preds = %50, %44, %15
%59 = phi float [ %18, %15 ], [ %45, %44 ], [ %55, %50 ]
%60 = phi float [ %17, %15 ], [ %46, %44 ], [ %57, %50 ]
%61 = add nuw nsw i64 %16, 1
%62 = icmp eq i64 %61, %9
br i1 %62, label %63, label %15
63: ; preds = %58
%64 = fcmp olt float %60, 0.000000e+00
br i1 %64, label %65, label %70
65: ; preds = %63
%66 = load i32, i32* @stderr
%67 = sext i32 %66 to i64
%68 = inttoptr i64 %67 to i32*
%69 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %68, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %70
70: ; preds = %4, %65, %63
%71 = phi float [ %59, %65 ], [ %59, %63 ], [ 0.000000e+00, %4 ]
%72 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%73 = icmp eq i64 %72, 0
br i1 %73, label %74, label %76
74: ; preds = %70
%75 = load i32*, i32** @stdout
br label %78
76: ; preds = %70
%77 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %78
78: ; preds = %76, %74
%79 = phi i32* [ %75, %74 ], [ %77, %76 ]
%80 = icmp eq i32* %79, null
br i1 %80, label %81, label %83
81: ; preds = %78
%82 = tail call i32 @errorf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.3, i64 0, i64 0), i8* %0)
br label %83
83: ; preds = %81, %78
%84 = tail call i64 @fwrite(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i64 3, i64 1, i32* %79)
%85 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %79, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i32 %2, i32 %3)
%86 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %79, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i32 255)
br i1 %5, label %87, label %113
87: ; preds = %83
%88 = icmp sgt i32 %2, 0
%89 = fpext float %71 to double
%90 = fdiv double 2.550000e+02, %89
%91 = sext i32 %2 to i64
%92 = zext i32 %3 to i64
%93 = zext i32 %2 to i64
br label %94
94: ; preds = %87, %110
%95 = phi i64 [ 0, %87 ], [ %111, %110 ]
br i1 %88, label %96, label %110
96: ; preds = %94
%97 = mul nsw i64 %95, %91
br label %98
98: ; preds = %96, %98
%99 = phi i64 [ 0, %96 ], [ %108, %98 ]
%100 = add nsw i64 %99, %97
%101 = getelementptr inbounds float, float* %1, i64 %100
%102 = load float, float* %101
%103 = fcmp ogt float %102, 0.000000e+00
%104 = fpext float %102 to double
%105 = fmul double %90, %104
%106 = select i1 %103, double %105, double 0.000000e+00
%107 = tail call i32 @fputc(double %106, i32* %79)
%108 = add nuw nsw i64 %99, 1
%109 = icmp eq i64 %108, %93
br i1 %109, label %110, label %98
110: ; preds = %98, %94
%111 = add nuw nsw i64 %95, 1
%112 = icmp eq i64 %111, %92
br i1 %112, label %113, label %94
113: ; preds = %110, %83
%114 = load i32*, i32** @stdout
%115 = icmp eq i32* %79, %114
br i1 %115, label %122, label %116
116: ; preds = %113
%117 = tail call i64 @fclose(i32* %79)
%118 = load i64, i64* @EOF
%119 = icmp eq i64 %117, %118
br i1 %119, label %120, label %122
120: ; preds = %116
%121 = tail call i32 @errorf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.7, i64 0, i64 0), i8* %0)
br label %122
122: ; preds = %120, %116, %113
ret void
}