#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*/ fwrite(unsigned char *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ *stdout;
scalar_t__ strcmp(char const *, char *);
void write_ppm_normalize_float(const char *fname, const float *rdata,
                               const float *gdata, const float *bdata, 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 = rdata[j + i * ncol];
      if (v > max)
        max = v;
      if (v < min)
        min = v;
    }
  for (i = 0; i < nrow; i++)
    for (j = 0; j < ncol; j++) {
      v = gdata[j + i * ncol];
      if (v > max)
        max = v;
      if (v < min)
        min = v;
    }
  for (i = 0; i < nrow; i++)
    for (j = 0; j < ncol; j++) {
      v = bdata[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, "P6\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++) {
      static unsigned char color[3];
      color[0] =
          (rdata[j + i * ncol] > 0) ? 255.0 / max * rdata[j + i * ncol] : 0;
      color[1] =
          (gdata[j + i * ncol] > 0) ? 255.0 / max * gdata[j + i * ncol] : 0;
      color[2] =
          (bdata[j + i * ncol] > 0) ? 255.0 / max * bdata[j + i * ncol] : 0;
      (void)fwrite(color, 1, 3, f);
    }
  if (f != stdout && fclose(f) == EOF)
    errorf("Error: unable to close file while writing PPM file ", fname);
}


x86 assembly (clang, -O0):
<write_ppm_normalize_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9d,-0x28(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x44(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x40(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x28(%rbp),%eax
jge    122f <write_ppm_normalize_float+0xcf>
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    121c <write_ppm_normalize_float+0xbc>
mov    -0x10(%rbp),%rax
mov    -0x38(%rbp),%ecx
mov    -0x34(%rbp),%edx
imul   -0x24(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm0
movss  %xmm0,-0x3c(%rbp)
movss  -0x3c(%rbp),%xmm0
ucomiss -0x40(%rbp),%xmm0
jbe    11ec <write_ppm_normalize_float+0x8c>
movss  -0x3c(%rbp),%xmm0
movss  %xmm0,-0x40(%rbp)
movss  -0x3c(%rbp),%xmm1
movss  -0x44(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1209 <write_ppm_normalize_float+0xa9>
movss  -0x3c(%rbp),%xmm0
movss  %xmm0,-0x44(%rbp)
jmp    120e <write_ppm_normalize_float+0xae>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    11aa <write_ppm_normalize_float+0x4a>
jmp    1221 <write_ppm_normalize_float+0xc1>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1197 <write_ppm_normalize_float+0x37>
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x28(%rbp),%eax
jge    12ce <write_ppm_normalize_float+0x16e>
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    12bb <write_ppm_normalize_float+0x15b>
mov    -0x18(%rbp),%rax
mov    -0x38(%rbp),%ecx
mov    -0x34(%rbp),%edx
imul   -0x24(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm0
movss  %xmm0,-0x3c(%rbp)
movss  -0x3c(%rbp),%xmm0
ucomiss -0x40(%rbp),%xmm0
jbe    128b <write_ppm_normalize_float+0x12b>
movss  -0x3c(%rbp),%xmm0
movss  %xmm0,-0x40(%rbp)
movss  -0x3c(%rbp),%xmm1
movss  -0x44(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    12a8 <write_ppm_normalize_float+0x148>
movss  -0x3c(%rbp),%xmm0
movss  %xmm0,-0x44(%rbp)
jmp    12ad <write_ppm_normalize_float+0x14d>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    1249 <write_ppm_normalize_float+0xe9>
jmp    12c0 <write_ppm_normalize_float+0x160>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1236 <write_ppm_normalize_float+0xd6>
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x28(%rbp),%eax
jge    136d <write_ppm_normalize_float+0x20d>
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    135a <write_ppm_normalize_float+0x1fa>
mov    -0x20(%rbp),%rax
mov    -0x38(%rbp),%ecx
mov    -0x34(%rbp),%edx
imul   -0x24(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm0
movss  %xmm0,-0x3c(%rbp)
movss  -0x3c(%rbp),%xmm0
ucomiss -0x40(%rbp),%xmm0
jbe    132a <write_ppm_normalize_float+0x1ca>
movss  -0x3c(%rbp),%xmm0
movss  %xmm0,-0x40(%rbp)
movss  -0x3c(%rbp),%xmm1
movss  -0x44(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1347 <write_ppm_normalize_float+0x1e7>
movss  -0x3c(%rbp),%xmm0
movss  %xmm0,-0x44(%rbp)
jmp    134c <write_ppm_normalize_float+0x1ec>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    12e8 <write_ppm_normalize_float+0x188>
jmp    135f <write_ppm_normalize_float+0x1ff>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    12d5 <write_ppm_normalize_float+0x175>
xorps  %xmm0,%xmm0
ucomiss -0x44(%rbp),%xmm0
jbe    1396 <write_ppm_normalize_float+0x236>
mov    0x2c57(%rip),%rax
movslq (%rax),%rdi
mov    -0x8(%rbp),%rdx
lea    0xc79(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xca0(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    13c3 <write_ppm_normalize_float+0x263>
mov    0x2c19(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x30(%rbp)
jmp    13d7 <write_ppm_normalize_float+0x277>
mov    -0x8(%rbp),%rdi
lea    0xc75(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    13f2 <write_ppm_normalize_float+0x292>
mov    -0x8(%rbp),%rsi
lea    0xc58(%rip),%rdi
call   1060 <errorf@plt>
mov    -0x30(%rbp),%rdi
lea    0xc71(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x30(%rbp),%rdi
mov    -0x24(%rbp),%edx
mov    -0x28(%rbp),%ecx
lea    0xc5d(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x30(%rbp),%rdi
lea    0xc52(%rip),%rsi
mov    $0xff,%edx
mov    $0x0,%al
call   1050 <fprintf@plt>
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x28(%rbp),%eax
jge    1611 <write_ppm_normalize_float+0x4b1>
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    15fe <write_ppm_normalize_float+0x49e>
mov    -0x10(%rbp),%rax
mov    -0x38(%rbp),%ecx
mov    -0x34(%rbp),%edx
imul   -0x24(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    14bc <write_ppm_normalize_float+0x35c>
movss  -0x40(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xb72(%rip),%xmm0
divsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
mov    -0x38(%rbp),%ecx
mov    -0x34(%rbp),%edx
imul   -0x24(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
jmp    14c9 <write_ppm_normalize_float+0x369>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x50(%rbp)
jmp    14c9 <write_ppm_normalize_float+0x369>
movsd  -0x50(%rbp),%xmm0
cvttsd2si %xmm0,%eax
mov    %al,0x2b90(%rip)
mov    -0x18(%rbp),%rax
mov    -0x38(%rbp),%ecx
mov    -0x34(%rbp),%edx
imul   -0x24(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    153b <write_ppm_normalize_float+0x3db>
movss  -0x40(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xaf3(%rip),%xmm0
divsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
mov    -0x38(%rbp),%ecx
mov    -0x34(%rbp),%edx
imul   -0x24(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
jmp    1548 <write_ppm_normalize_float+0x3e8>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x58(%rbp)
jmp    1548 <write_ppm_normalize_float+0x3e8>
movsd  -0x58(%rbp),%xmm0
cvttsd2si %xmm0,%eax
mov    %al,0x2b12(%rip)
mov    -0x20(%rbp),%rax
mov    -0x38(%rbp),%ecx
mov    -0x34(%rbp),%edx
imul   -0x24(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    15ba <write_ppm_normalize_float+0x45a>
movss  -0x40(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xa74(%rip),%xmm0
divsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
mov    -0x38(%rbp),%ecx
mov    -0x34(%rbp),%edx
imul   -0x24(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
jmp    15c7 <write_ppm_normalize_float+0x467>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x60(%rbp)
jmp    15c7 <write_ppm_normalize_float+0x467>
movsd  -0x60(%rbp),%xmm0
cvttsd2si %xmm0,%eax
mov    %al,0x2a94(%rip)
mov    -0x30(%rbp),%rcx
lea    0x2a87(%rip),%rdi
mov    $0x1,%esi
mov    $0x3,%edx
call   1080 <fwrite@plt>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    144d <write_ppm_normalize_float+0x2ed>
jmp    1603 <write_ppm_normalize_float+0x4a3>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    143a <write_ppm_normalize_float+0x2da>
mov    -0x30(%rbp),%rax
mov    0x29b4(%rip),%rcx
cmp    (%rcx),%rax
je     164e <write_ppm_normalize_float+0x4ee>
mov    -0x30(%rbp),%rdi
call   1030 <fclose@plt>
mov    0x29b3(%rip),%rcx
cmp    (%rcx),%rax
jne    164e <write_ppm_normalize_float+0x4ee>
mov    -0x8(%rbp),%rsi
lea    0xa34(%rip),%rdi
call   1060 <errorf@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_ppm_normalize_float>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
mov    %r8d,%r13d
mov    %rcx,%r15
movslq %r8d,%r11
mov    %r9d,%r14d
mov    %r8d,%r12d
mov    %r9d,(%rsp)
test   %r9d,%r9d
mov    %r12,0x40(%rsp)
mov    %rdi,0x10(%rsp)
mov    %r11,0x18(%rsp)
mov    %rdx,0x20(%rsp)
jle    12c5 <write_ppm_normalize_float+0x165>
lea    -0x1(%r12),%r8
mov    %r12d,%ebx
and    $0xfffffffe,%ebx
lea    0x4(%rsi),%rax
lea    0x0(,%r11,4),%r9
xorps  %xmm0,%xmm0
xor    %r10d,%r10d
xorps  %xmm4,%xmm4
jmp    11cc <write_ppm_normalize_float+0x6c>
add    $0x1,%r10
add    %r9,%rax
cmp    %r14,%r10
je     1235 <write_ppm_normalize_float+0xd5>
test   %r13d,%r13d
jle    11c0 <write_ppm_normalize_float+0x60>
xor    %ebp,%ebp
test   %r8,%r8
je     120d <write_ppm_normalize_float+0xad>
movaps %xmm0,%xmm1
nopl   0x0(%rax,%rax,1)
movss  -0x4(%rax,%rbp,4),%xmm2
movss  (%rax,%rbp,4),%xmm0
movaps %xmm2,%xmm3
maxss  %xmm4,%xmm3
minss  %xmm1,%xmm2
movaps %xmm0,%xmm4
maxss  %xmm3,%xmm4
minss  %xmm2,%xmm0
add    $0x2,%rbp
movaps %xmm0,%xmm1
cmp    %rbp,%rbx
jne    11e0 <write_ppm_normalize_float+0x80>
test   $0x1,%r12b
je     11c0 <write_ppm_normalize_float+0x60>
mov    %r10,%rdi
imul   %r11,%rdi
add    %rdi,%rbp
movss  (%rsi,%rbp,4),%xmm1
movaps %xmm1,%xmm2
maxss  %xmm4,%xmm2
minss  %xmm0,%xmm1
movaps %xmm2,%xmm4
movaps %xmm1,%xmm0
jmp    11c0 <write_ppm_normalize_float+0x60>
cmpl   $0x0,(%rsp)
jle    1376 <write_ppm_normalize_float+0x216>
mov    %r12d,%ebx
and    $0xfffffffe,%ebx
lea    0x4(%rdx),%rdi
xor    %r10d,%r10d
jmp    125c <write_ppm_normalize_float+0xfc>
xchg   %ax,%ax
add    $0x1,%r10
add    %r9,%rdi
cmp    %r14,%r10
je     12d9 <write_ppm_normalize_float+0x179>
test   %r13d,%r13d
jle    1250 <write_ppm_normalize_float+0xf0>
xor    %ebp,%ebp
test   %r8,%r8
je     129d <write_ppm_normalize_float+0x13d>
movaps %xmm0,%xmm1
nopl   0x0(%rax,%rax,1)
movss  -0x4(%rdi,%rbp,4),%xmm2
movss  (%rdi,%rbp,4),%xmm0
movaps %xmm2,%xmm3
maxss  %xmm4,%xmm3
minss  %xmm1,%xmm2
movaps %xmm0,%xmm4
maxss  %xmm3,%xmm4
minss  %xmm2,%xmm0
add    $0x2,%rbp
movaps %xmm0,%xmm1
cmp    %rbp,%rbx
jne    1270 <write_ppm_normalize_float+0x110>
test   $0x1,%r12b
je     1250 <write_ppm_normalize_float+0xf0>
mov    %r10,%rax
imul   %r11,%rax
add    %rax,%rbp
movss  (%rdx,%rbp,4),%xmm1
movaps %xmm1,%xmm2
maxss  %xmm4,%xmm2
minss  %xmm0,%xmm1
movaps %xmm2,%xmm4
movaps %xmm1,%xmm0
jmp    1250 <write_ppm_normalize_float+0xf0>
mov    %rdi,%rbx
mov    %rsi,%r12
xorps  %xmm0,%xmm0
movss  %xmm0,0xc(%rsp)
jmp    13ae <write_ppm_normalize_float+0x24e>
cmpl   $0x0,(%rsp)
jle    1376 <write_ppm_normalize_float+0x216>
mov    %r12d,%ebx
and    $0xfffffffe,%ebx
lea    0x4(%r15),%rdi
xor    %r10d,%r10d
jmp    130c <write_ppm_normalize_float+0x1ac>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%r10
add    %r9,%rdi
cmp    %r14,%r10
je     1376 <write_ppm_normalize_float+0x216>
test   %r13d,%r13d
jle    1300 <write_ppm_normalize_float+0x1a0>
xor    %ebp,%ebp
test   %r8,%r8
je     134d <write_ppm_normalize_float+0x1ed>
movaps %xmm0,%xmm1
nopl   0x0(%rax,%rax,1)
movss  -0x4(%rdi,%rbp,4),%xmm2
movss  (%rdi,%rbp,4),%xmm0
movaps %xmm2,%xmm3
maxss  %xmm4,%xmm3
minss  %xmm1,%xmm2
movaps %xmm0,%xmm4
maxss  %xmm3,%xmm4
minss  %xmm2,%xmm0
add    $0x2,%rbp
movaps %xmm0,%xmm1
cmp    %rbp,%rbx
jne    1320 <write_ppm_normalize_float+0x1c0>
test   $0x1,%r12b
je     1300 <write_ppm_normalize_float+0x1a0>
mov    %r10,%rax
imul   %r11,%rax
add    %rax,%rbp
movss  (%r15,%rbp,4),%xmm1
movaps %xmm1,%xmm2
maxss  %xmm4,%xmm2
minss  %xmm0,%xmm1
movaps %xmm2,%xmm4
movaps %xmm1,%xmm0
jmp    1300 <write_ppm_normalize_float+0x1a0>
movss  %xmm4,0xc(%rsp)
mov    %rsi,%r12
xorps  %xmm1,%xmm1
ucomiss %xmm0,%xmm1
jbe    13a9 <write_ppm_normalize_float+0x249>
mov    0x2c4a(%rip),%rax
movslq (%rax),%rdi
lea    0xc70(%rip),%rsi
mov    0x10(%rsp),%rbx
mov    %rbx,%rdx
xor    %eax,%eax
call   1050 <fprintf@plt>
jmp    13ae <write_ppm_normalize_float+0x24e>
mov    0x10(%rsp),%rbx
mov    %r14,0x38(%rsp)
lea    0xc87(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     15b1 <write_ppm_normalize_float+0x451>
lea    0xc71(%rip),%rsi
mov    %rbx,%rdi
call   1070 <fopen@plt>
mov    %rax,%rbp
test   %rbp,%rbp
jne    13f1 <write_ppm_normalize_float+0x291>
lea    0xc5c(%rip),%rdi
mov    %rbx,%rsi
call   1060 <errorf@plt>
lea    0xc76(%rip),%rdi
mov    $0x3,%esi
mov    $0x1,%edx
mov    %rbp,%rcx
call   1080 <fwrite@plt>
lea    0xc61(%rip),%rsi
mov    %rbp,%rdi
mov    %r13d,%edx
mov    (%rsp),%ebx
mov    %ebx,%ecx
xor    %eax,%eax
call   1050 <fprintf@plt>
lea    0xc4f(%rip),%rsi
mov    %rbp,0x30(%rsp)
mov    %rbp,%rdi
mov    $0xff,%edx
xor    %eax,%eax
call   1050 <fprintf@plt>
test   %ebx,%ebx
mov    0x20(%rsp),%rbx
mov    0x18(%rsp),%rax
jle    1561 <write_ppm_normalize_float+0x401>
mov    %r15,%rbp
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xb9b(%rip),%xmm1
divsd  %xmm0,%xmm1
shl    $0x2,%rax
xorps  %xmm2,%xmm2
lea    0x2bf1(%rip),%r15
xor    %ecx,%ecx
mov    %r13d,0x2c(%rsp)
mov    %rax,0x18(%rsp)
movsd  %xmm1,(%rsp)
mov    0x30(%rsp),%r14
jmp    14b7 <write_ppm_normalize_float+0x357>
nop
mov    0x20(%rsp),%rcx
add    $0x1,%rcx
mov    0x18(%rsp),%rax
add    %rax,%r12
add    %rax,%rbx
add    %rax,%rbp
cmp    0x38(%rsp),%rcx
mov    0x2c(%rsp),%r13d
je     1561 <write_ppm_normalize_float+0x401>
mov    %rcx,0x20(%rsp)
test   %r13d,%r13d
mov    $0x0,%edx
jle    1490 <write_ppm_normalize_float+0x330>
xor    %r13d,%r13d
nopl   0x0(%rax)
movss  (%r12,%r13,4),%xmm0
ucomiss %xmm2,%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
cmovbe %edx,%eax
mov    %al,0x2b7a(%rip)
movss  (%rbx,%r13,4),%xmm0
ucomiss %xmm2,%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
cmovbe %edx,%eax
mov    %al,0x2b5d(%rip)
movss  0x0(%rbp,%r13,4),%xmm0
ucomiss %xmm2,%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
cmovbe %edx,%eax
mov    %al,0x2b3f(%rip)
mov    %r15,%rdi
mov    $0x1,%esi
mov    $0x3,%edx
mov    %r14,%rcx
call   1080 <fwrite@plt>
xor    %edx,%edx
mov    0x40(%rsp),%rax
xorps  %xmm2,%xmm2
movsd  (%rsp),%xmm1
add    $0x1,%r13
cmp    %r13,%rax
jne    14d0 <write_ppm_normalize_float+0x370>
jmp    1490 <write_ppm_normalize_float+0x330>
mov    0x2a68(%rip),%rax
mov    0x30(%rsp),%rdi
cmp    (%rax),%rdi
je     15a2 <write_ppm_normalize_float+0x442>
call   1030 <fclose@plt>
mov    0x2a6a(%rip),%rcx
cmp    (%rcx),%rax
jne    15a2 <write_ppm_normalize_float+0x442>
lea    0xaf3(%rip),%rdi
mov    0x10(%rsp),%rsi
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1060 <errorf@plt>
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2a18(%rip),%rax
mov    (%rax),%rbp
test   %rbp,%rbp
jne    13f1 <write_ppm_normalize_float+0x291>
jmp    13e2 <write_ppm_normalize_float+0x282>

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"P6\0A\00"
@.str.5 = [7 x i8] c"%u %u\0A\00"
@.str.6 = [4 x i8] c"%d\0A\00"
@write_ppm_normalize_float.color = internal global [3 x i8] zeroinitializer
@EOF = global i64 0
@.str.7 = [52 x i8] c"Error: unable to close file while writing PPM file \00"
define void @write_ppm_normalize_float(i8* %0, float* %1, float* %2, float* %3, i32 %4, i32 %5) {
%7 = alloca i8*
%8 = alloca float*
%9 = alloca float*
%10 = alloca float*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32*
%14 = alloca i32
%15 = alloca i32
%16 = alloca float
%17 = alloca float
%18 = alloca float
store i8* %0, i8** %7
store float* %1, float** %8
store float* %2, float** %9
store float* %3, float** %10
store i32 %4, i32* %11
store i32 %5, i32* %12
store float 0.000000e+00, float* %18
store float 0.000000e+00, float* %17
store i32 0, i32* %14
br label %19
19: ; preds = %54, %6
%20 = load i32, i32* %14
%21 = load i32, i32* %12
%22 = icmp slt i32 %20, %21
br i1 %22, label %23, label %57
23: ; preds = %19
store i32 0, i32* %15
br label %24
24: ; preds = %50, %23
%25 = load i32, i32* %15
%26 = load i32, i32* %11
%27 = icmp slt i32 %25, %26
br i1 %27, label %28, label %53
28: ; preds = %24
%29 = load float*, float** %8
%30 = load i32, i32* %15
%31 = load i32, i32* %14
%32 = load i32, i32* %11
%33 = mul nsw i32 %31, %32
%34 = add nsw i32 %30, %33
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds float, float* %29, i64 %35
%37 = load float, float* %36
store float %37, float* %16
%38 = load float, float* %16
%39 = load float, float* %17
%40 = fcmp ogt float %38, %39
br i1 %40, label %41, label %43
41: ; preds = %28
%42 = load float, float* %16
store float %42, float* %17
br label %43
43: ; preds = %41, %28
%44 = load float, float* %16
%45 = load float, float* %18
%46 = fcmp olt float %44, %45
br i1 %46, label %47, label %49
47: ; preds = %43
%48 = load float, float* %16
store float %48, float* %18
br label %49
49: ; preds = %47, %43
br label %50
50: ; preds = %49
%51 = load i32, i32* %15
%52 = add nsw i32 %51, 1
store i32 %52, i32* %15
br label %24
53: ; preds = %24
br label %54
54: ; preds = %53
%55 = load i32, i32* %14
%56 = add nsw i32 %55, 1
store i32 %56, i32* %14
br label %19
57: ; preds = %19
store i32 0, i32* %14
br label %58
58: ; preds = %93, %57
%59 = load i32, i32* %14
%60 = load i32, i32* %12
%61 = icmp slt i32 %59, %60
br i1 %61, label %62, label %96
62: ; preds = %58
store i32 0, i32* %15
br label %63
63: ; preds = %89, %62
%64 = load i32, i32* %15
%65 = load i32, i32* %11
%66 = icmp slt i32 %64, %65
br i1 %66, label %67, label %92
67: ; preds = %63
%68 = load float*, float** %9
%69 = load i32, i32* %15
%70 = load i32, i32* %14
%71 = load i32, i32* %11
%72 = mul nsw i32 %70, %71
%73 = add nsw i32 %69, %72
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds float, float* %68, i64 %74
%76 = load float, float* %75
store float %76, float* %16
%77 = load float, float* %16
%78 = load float, float* %17
%79 = fcmp ogt float %77, %78
br i1 %79, label %80, label %82
80: ; preds = %67
%81 = load float, float* %16
store float %81, float* %17
br label %82
82: ; preds = %80, %67
%83 = load float, float* %16
%84 = load float, float* %18
%85 = fcmp olt float %83, %84
br i1 %85, label %86, label %88
86: ; preds = %82
%87 = load float, float* %16
store float %87, float* %18
br label %88
88: ; preds = %86, %82
br label %89
89: ; preds = %88
%90 = load i32, i32* %15
%91 = add nsw i32 %90, 1
store i32 %91, i32* %15
br label %63
92: ; preds = %63
br label %93
93: ; preds = %92
%94 = load i32, i32* %14
%95 = add nsw i32 %94, 1
store i32 %95, i32* %14
br label %58
96: ; preds = %58
store i32 0, i32* %14
br label %97
97: ; preds = %132, %96
%98 = load i32, i32* %14
%99 = load i32, i32* %12
%100 = icmp slt i32 %98, %99
br i1 %100, label %101, label %135
101: ; preds = %97
store i32 0, i32* %15
br label %102
102: ; preds = %128, %101
%103 = load i32, i32* %15
%104 = load i32, i32* %11
%105 = icmp slt i32 %103, %104
br i1 %105, label %106, label %131
106: ; preds = %102
%107 = load float*, float** %10
%108 = load i32, i32* %15
%109 = load i32, i32* %14
%110 = load i32, i32* %11
%111 = mul nsw i32 %109, %110
%112 = add nsw i32 %108, %111
%113 = sext i32 %112 to i64
%114 = getelementptr inbounds float, float* %107, i64 %113
%115 = load float, float* %114
store float %115, float* %16
%116 = load float, float* %16
%117 = load float, float* %17
%118 = fcmp ogt float %116, %117
br i1 %118, label %119, label %121
119: ; preds = %106
%120 = load float, float* %16
store float %120, float* %17
br label %121
121: ; preds = %119, %106
%122 = load float, float* %16
%123 = load float, float* %18
%124 = fcmp olt float %122, %123
br i1 %124, label %125, label %127
125: ; preds = %121
%126 = load float, float* %16
store float %126, float* %18
br label %127
127: ; preds = %125, %121
br label %128
128: ; preds = %127
%129 = load i32, i32* %15
%130 = add nsw i32 %129, 1
store i32 %130, i32* %15
br label %102
131: ; preds = %102
br label %132
132: ; preds = %131
%133 = load i32, i32* %14
%134 = add nsw i32 %133, 1
store i32 %134, i32* %14
br label %97
135: ; preds = %97
%136 = load float, float* %18
%137 = fcmp olt float %136, 0.000000e+00
br i1 %137, label %138, label %144
138: ; preds = %135
%139 = load i32, i32* @stderr
%140 = sext i32 %139 to i64
%141 = inttoptr i64 %140 to i32*
%142 = load i8*, i8** %7
%143 = call i32 (i32*, i8*, ...) @fprintf(i32* %141, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i8* %142)
br label %144
144: ; preds = %138, %135
%145 = load i8*, i8** %7
%146 = call i64 @strcmp(i8* %145, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%147 = icmp eq i64 %146, 0
br i1 %147, label %148, label %150
148: ; preds = %144
%149 = load i32*, i32** @stdout
store i32* %149, i32** %13
br label %153
150: ; preds = %144
%151 = load i8*, i8** %7
%152 = call i32* @fopen(i8* %151, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %152, i32** %13
br label %153
153: ; preds = %150, %148
%154 = load i32*, i32** %13
%155 = icmp eq i32* %154, null
br i1 %155, label %156, label %159
156: ; preds = %153
%157 = load i8*, i8** %7
%158 = call i32 @errorf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.3, i64 0, i64 0), i8* %157)
br label %159
159: ; preds = %156, %153
%160 = load i32*, i32** %13
%161 = call i32 (i32*, i8*, ...) @fprintf(i32* %160, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%162 = load i32*, i32** %13
%163 = load i32, i32* %11
%164 = load i32, i32* %12
%165 = call i32 (i32*, i8*, ...) @fprintf(i32* %162, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i32 %163, i32 %164)
%166 = load i32*, i32** %13
%167 = call i32 (i32*, i8*, ...) @fprintf(i32* %166, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i32 255)
store i32 0, i32* %14
br label %168
168: ; preds = %271, %159
%169 = load i32, i32* %14
%170 = load i32, i32* %12
%171 = icmp slt i32 %169, %170
br i1 %171, label %172, label %274
172: ; preds = %168
store i32 0, i32* %15
br label %173
173: ; preds = %267, %172
%174 = load i32, i32* %15
%175 = load i32, i32* %11
%176 = icmp slt i32 %174, %175
br i1 %176, label %177, label %270
177: ; preds = %173
%178 = load float*, float** %8
%179 = load i32, i32* %15
%180 = load i32, i32* %14
%181 = load i32, i32* %11
%182 = mul nsw i32 %180, %181
%183 = add nsw i32 %179, %182
%184 = sext i32 %183 to i64
%185 = getelementptr inbounds float, float* %178, i64 %184
%186 = load float, float* %185
%187 = fcmp ogt float %186, 0.000000e+00
br i1 %187, label %188, label %203
188: ; preds = %177
%189 = load float, float* %17
%190 = fpext float %189 to double
%191 = fdiv double 2.550000e+02, %190
%192 = load float*, float** %8
%193 = load i32, i32* %15
%194 = load i32, i32* %14
%195 = load i32, i32* %11
%196 = mul nsw i32 %194, %195
%197 = add nsw i32 %193, %196
%198 = sext i32 %197 to i64
%199 = getelementptr inbounds float, float* %192, i64 %198
%200 = load float, float* %199
%201 = fpext float %200 to double
%202 = fmul double %191, %201
br label %204
203: ; preds = %177
br label %204
204: ; preds = %203, %188
%205 = phi double [ %202, %188 ], [ 0.000000e+00, %203 ]
%206 = fptoui double %205 to i8
store i8 %206, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @write_ppm_normalize_float.color, i64 0, i64 0)
%207 = load float*, float** %9
%208 = load i32, i32* %15
%209 = load i32, i32* %14
%210 = load i32, i32* %11
%211 = mul nsw i32 %209, %210
%212 = add nsw i32 %208, %211
%213 = sext i32 %212 to i64
%214 = getelementptr inbounds float, float* %207, i64 %213
%215 = load float, float* %214
%216 = fcmp ogt float %215, 0.000000e+00
br i1 %216, label %217, label %232
217: ; preds = %204
%218 = load float, float* %17
%219 = fpext float %218 to double
%220 = fdiv double 2.550000e+02, %219
%221 = load float*, float** %9
%222 = load i32, i32* %15
%223 = load i32, i32* %14
%224 = load i32, i32* %11
%225 = mul nsw i32 %223, %224
%226 = add nsw i32 %222, %225
%227 = sext i32 %226 to i64
%228 = getelementptr inbounds float, float* %221, i64 %227
%229 = load float, float* %228
%230 = fpext float %229 to double
%231 = fmul double %220, %230
br label %233
232: ; preds = %204
br label %233
233: ; preds = %232, %217
%234 = phi double [ %231, %217 ], [ 0.000000e+00, %232 ]
%235 = fptoui double %234 to i8
store i8 %235, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @write_ppm_normalize_float.color, i64 0, i64 1)
%236 = load float*, float** %10
%237 = load i32, i32* %15
%238 = load i32, i32* %14
%239 = load i32, i32* %11
%240 = mul nsw i32 %238, %239
%241 = add nsw i32 %237, %240
%242 = sext i32 %241 to i64
%243 = getelementptr inbounds float, float* %236, i64 %242
%244 = load float, float* %243
%245 = fcmp ogt float %244, 0.000000e+00
br i1 %245, label %246, label %261
246: ; preds = %233
%247 = load float, float* %17
%248 = fpext float %247 to double
%249 = fdiv double 2.550000e+02, %248
%250 = load float*, float** %10
%251 = load i32, i32* %15
%252 = load i32, i32* %14
%253 = load i32, i32* %11
%254 = mul nsw i32 %252, %253
%255 = add nsw i32 %251, %254
%256 = sext i32 %255 to i64
%257 = getelementptr inbounds float, float* %250, i64 %256
%258 = load float, float* %257
%259 = fpext float %258 to double
%260 = fmul double %249, %259
br label %262
261: ; preds = %233
br label %262
262: ; preds = %261, %246
%263 = phi double [ %260, %246 ], [ 0.000000e+00, %261 ]
%264 = fptoui double %263 to i8
store i8 %264, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @write_ppm_normalize_float.color, i64 0, i64 2)
%265 = load i32*, i32** %13
%266 = call i32 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @write_ppm_normalize_float.color, i64 0, i64 0), i32 1, i32 3, i32* %265)
br label %267
267: ; preds = %262
%268 = load i32, i32* %15
%269 = add nsw i32 %268, 1
store i32 %269, i32* %15
br label %173
270: ; preds = %173
br label %271
271: ; preds = %270
%272 = load i32, i32* %14
%273 = add nsw i32 %272, 1
store i32 %273, i32* %14
br label %168
274: ; preds = %168
%275 = load i32*, i32** %13
%276 = load i32*, i32** @stdout
%277 = icmp ne i32* %275, %276
br i1 %277, label %278, label %286
278: ; preds = %274
%279 = load i32*, i32** %13
%280 = call i64 @fclose(i32* %279)
%281 = load i64, i64* @EOF
%282 = icmp eq i64 %280, %281
br i1 %282, label %283, label %286
283: ; preds = %278
%284 = load i8*, i8** %7
%285 = call i32 @errorf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.7, i64 0, i64 0), i8* %284)
br label %286
286: ; preds = %283, %278, %274
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"P6\0A\00"
@.str.5 = [7 x i8] c"%u %u\0A\00"
@.str.6 = [4 x i8] c"%d\0A\00"
@write_ppm_normalize_float.color = internal global [3 x i8] zeroinitializer
@EOF = global i64 0
@.str.7 = [52 x i8] c"Error: unable to close file while writing PPM file \00"
define void @write_ppm_normalize_float(i8* %0, float* nocapture %1, float* nocapture %2, float* nocapture %3, i32 %4, i32 %5) {
%7 = icmp sgt i32 %5, 0
br i1 %7, label %8, label %189
8: ; preds = %6
%9 = icmp sgt i32 %4, 0
%10 = sext i32 %4 to i64
%11 = zext i32 %5 to i64
%12 = zext i32 %4 to i64
%13 = add nsw i64 %12, -1
%14 = and i64 %12, 1
%15 = icmp eq i64 %13, 0
%16 = and i64 %12, 4294967294
%17 = icmp eq i64 %14, 0
br label %18
18: ; preds = %8, %70
%19 = phi i64 [ 0, %8 ], [ %73, %70 ]
%20 = phi float [ 0.000000e+00, %8 ], [ %72, %70 ]
%21 = phi float [ 0.000000e+00, %8 ], [ %71, %70 ]
br i1 %9, label %22, label %70
22: ; preds = %18
%23 = mul nsw i64 %19, %10
br i1 %15, label %56, label %33
24: ; preds = %70
br i1 %7, label %25, label %180
25: ; preds = %24
%26 = icmp sgt i32 %4, 0
%27 = sext i32 %4 to i64
%28 = zext i32 %5 to i64
%29 = and i64 %12, 1
%30 = icmp eq i64 %13, 0
%31 = and i64 %12, 4294967294
%32 = icmp eq i64 %29, 0
br label %75
33: ; preds = %22, %33
%34 = phi i64 [ %53, %33 ], [ 0, %22 ]
%35 = phi float [ %52, %33 ], [ %20, %22 ]
%36 = phi float [ %50, %33 ], [ %21, %22 ]
%37 = phi i64 [ %54, %33 ], [ 0, %22 ]
%38 = add nsw i64 %34, %23
%39 = getelementptr inbounds float, float* %1, i64 %38
%40 = load float, float* %39
%41 = fcmp ogt float %40, %36
%42 = select i1 %41, float %40, float %36
%43 = fcmp olt float %40, %35
%44 = select i1 %43, float %40, float %35
%45 = or i64 %34, 1
%46 = add nsw i64 %45, %23
%47 = getelementptr inbounds float, float* %1, i64 %46
%48 = load float, float* %47
%49 = fcmp ogt float %48, %42
%50 = select i1 %49, float %48, float %42
%51 = fcmp olt float %48, %44
%52 = select i1 %51, float %48, float %44
%53 = add nuw nsw i64 %34, 2
%54 = add i64 %37, 2
%55 = icmp eq i64 %54, %16
br i1 %55, label %56, label %33
56: ; preds = %33, %22
%57 = phi float [ undef, %22 ], [ %50, %33 ]
%58 = phi float [ undef, %22 ], [ %52, %33 ]
%59 = phi i64 [ 0, %22 ], [ %53, %33 ]
%60 = phi float [ %20, %22 ], [ %52, %33 ]
%61 = phi float [ %21, %22 ], [ %50, %33 ]
br i1 %17, label %70, label %62
62: ; preds = %56
%63 = add nsw i64 %59, %23
%64 = getelementptr inbounds float, float* %1, i64 %63
%65 = load float, float* %64
%66 = fcmp ogt float %65, %61
%67 = select i1 %66, float %65, float %61
%68 = fcmp olt float %65, %60
%69 = select i1 %68, float %65, float %60
br label %70
70: ; preds = %62, %56, %18
%71 = phi float [ %21, %18 ], [ %57, %56 ], [ %67, %62 ]
%72 = phi float [ %20, %18 ], [ %58, %56 ], [ %69, %62 ]
%73 = add nuw nsw i64 %19, 1
%74 = icmp eq i64 %73, %11
br i1 %74, label %24, label %18
75: ; preds = %25, %127
%76 = phi i64 [ 0, %25 ], [ %130, %127 ]
%77 = phi float [ %72, %25 ], [ %129, %127 ]
%78 = phi float [ %71, %25 ], [ %128, %127 ]
br i1 %26, label %79, label %127
79: ; preds = %75
%80 = mul nsw i64 %76, %27
br i1 %30, label %113, label %90
81: ; preds = %127
br i1 %7, label %82, label %180
82: ; preds = %81
%83 = icmp sgt i32 %4, 0
%84 = sext i32 %4 to i64
%85 = zext i32 %5 to i64
%86 = and i64 %12, 1
%87 = icmp eq i64 %13, 0
%88 = and i64 %12, 4294967294
%89 = icmp eq i64 %86, 0
br label %132
90: ; preds = %79, %90
%91 = phi i64 [ %110, %90 ], [ 0, %79 ]
%92 = phi float [ %109, %90 ], [ %77, %79 ]
%93 = phi float [ %107, %90 ], [ %78, %79 ]
%94 = phi i64 [ %111, %90 ], [ 0, %79 ]
%95 = add nsw i64 %91, %80
%96 = getelementptr inbounds float, float* %2, i64 %95
%97 = load float, float* %96
%98 = fcmp ogt float %97, %93
%99 = select i1 %98, float %97, float %93
%100 = fcmp olt float %97, %92
%101 = select i1 %100, float %97, float %92
%102 = or i64 %91, 1
%103 = add nsw i64 %102, %80
%104 = getelementptr inbounds float, float* %2, i64 %103
%105 = load float, float* %104
%106 = fcmp ogt float %105, %99
%107 = select i1 %106, float %105, float %99
%108 = fcmp olt float %105, %101
%109 = select i1 %108, float %105, float %101
%110 = add nuw nsw i64 %91, 2
%111 = add i64 %94, 2
%112 = icmp eq i64 %111, %31
br i1 %112, label %113, label %90
113: ; preds = %90, %79
%114 = phi float [ undef, %79 ], [ %107, %90 ]
%115 = phi float [ undef, %79 ], [ %109, %90 ]
%116 = phi i64 [ 0, %79 ], [ %110, %90 ]
%117 = phi float [ %77, %79 ], [ %109, %90 ]
%118 = phi float [ %78, %79 ], [ %107, %90 ]
br i1 %32, label %127, label %119
119: ; preds = %113
%120 = add nsw i64 %116, %80
%121 = getelementptr inbounds float, float* %2, i64 %120
%122 = load float, float* %121
%123 = fcmp ogt float %122, %118
%124 = select i1 %123, float %122, float %118
%125 = fcmp olt float %122, %117
%126 = select i1 %125, float %122, float %117
br label %127
127: ; preds = %119, %113, %75
%128 = phi float [ %78, %75 ], [ %114, %113 ], [ %124, %119 ]
%129 = phi float [ %77, %75 ], [ %115, %113 ], [ %126, %119 ]
%130 = add nuw nsw i64 %76, 1
%131 = icmp eq i64 %130, %28
br i1 %131, label %81, label %75
132: ; preds = %82, %175
%133 = phi i64 [ 0, %82 ], [ %178, %175 ]
%134 = phi float [ %129, %82 ], [ %177, %175 ]
%135 = phi float [ %128, %82 ], [ %176, %175 ]
br i1 %83, label %136, label %175
136: ; preds = %132
%137 = mul nsw i64 %133, %84
br i1 %87, label %161, label %138
138: ; preds = %136, %138
%139 = phi i64 [ %158, %138 ], [ 0, %136 ]
%140 = phi float [ %157, %138 ], [ %134, %136 ]
%141 = phi float [ %155, %138 ], [ %135, %136 ]
%142 = phi i64 [ %159, %138 ], [ 0, %136 ]
%143 = add nsw i64 %139, %137
%144 = getelementptr inbounds float, float* %3, i64 %143
%145 = load float, float* %144
%146 = fcmp ogt float %145, %141
%147 = select i1 %146, float %145, float %141
%148 = fcmp olt float %145, %140
%149 = select i1 %148, float %145, float %140
%150 = or i64 %139, 1
%151 = add nsw i64 %150, %137
%152 = getelementptr inbounds float, float* %3, i64 %151
%153 = load float, float* %152
%154 = fcmp ogt float %153, %147
%155 = select i1 %154, float %153, float %147
%156 = fcmp olt float %153, %149
%157 = select i1 %156, float %153, float %149
%158 = add nuw nsw i64 %139, 2
%159 = add i64 %142, 2
%160 = icmp eq i64 %159, %88
br i1 %160, label %161, label %138
161: ; preds = %138, %136
%162 = phi float [ undef, %136 ], [ %155, %138 ]
%163 = phi float [ undef, %136 ], [ %157, %138 ]
%164 = phi i64 [ 0, %136 ], [ %158, %138 ]
%165 = phi float [ %134, %136 ], [ %157, %138 ]
%166 = phi float [ %135, %136 ], [ %155, %138 ]
br i1 %89, label %175, label %167
167: ; preds = %161
%168 = add nsw i64 %164, %137
%169 = getelementptr inbounds float, float* %3, i64 %168
%170 = load float, float* %169
%171 = fcmp ogt float %170, %166
%172 = select i1 %171, float %170, float %166
%173 = fcmp olt float %170, %165
%174 = select i1 %173, float %170, float %165
br label %175
175: ; preds = %167, %161, %132
%176 = phi float [ %135, %132 ], [ %162, %161 ], [ %172, %167 ]
%177 = phi float [ %134, %132 ], [ %163, %161 ], [ %174, %167 ]
%178 = add nuw nsw i64 %133, 1
%179 = icmp eq i64 %178, %85
br i1 %179, label %180, label %132
180: ; preds = %175, %24, %81
%181 = phi float [ %128, %81 ], [ %71, %24 ], [ %176, %175 ]
%182 = phi float [ %129, %81 ], [ %72, %24 ], [ %177, %175 ]
%183 = fcmp olt float %182, 0.000000e+00
br i1 %183, label %184, label %189
184: ; preds = %180
%185 = load i32, i32* @stderr
%186 = sext i32 %185 to i64
%187 = inttoptr i64 %186 to i32*
%188 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %187, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %189
189: ; preds = %6, %184, %180
%190 = phi float [ %181, %184 ], [ %181, %180 ], [ 0.000000e+00, %6 ]
%191 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%192 = icmp eq i64 %191, 0
br i1 %192, label %193, label %195
193: ; preds = %189
%194 = load i32*, i32** @stdout
br label %197
195: ; preds = %189
%196 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %197
197: ; preds = %195, %193
%198 = phi i32* [ %194, %193 ], [ %196, %195 ]
%199 = icmp eq i32* %198, null
br i1 %199, label %200, label %202
200: ; preds = %197
%201 = tail call i32 @errorf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.3, i64 0, i64 0), i8* %0)
br label %202
202: ; preds = %200, %197
%203 = tail call i64 bitcast (i32 (i8*, i32, i32, i32*)* @fwrite to i64 (i8*, i64, i64, i32*)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i64 3, i64 1, i32* %198)
%204 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %198, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i32 %4, i32 %5)
%205 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %198, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i32 255)
br i1 %7, label %206, label %247
206: ; preds = %202
%207 = icmp sgt i32 %4, 0
%208 = fpext float %190 to double
%209 = fdiv double 2.550000e+02, %208
%210 = sext i32 %4 to i64
%211 = zext i32 %5 to i64
%212 = zext i32 %4 to i64
br label %213
213: ; preds = %206, %244
%214 = phi i64 [ 0, %206 ], [ %245, %244 ]
br i1 %207, label %215, label %244
215: ; preds = %213
%216 = mul nsw i64 %214, %210
br label %217
217: ; preds = %215, %217
%218 = phi i64 [ 0, %215 ], [ %242, %217 ]
%219 = add nsw i64 %218, %216
%220 = getelementptr inbounds float, float* %1, i64 %219
%221 = load float, float* %220
%222 = fcmp ogt float %221, 0.000000e+00
%223 = fpext float %221 to double
%224 = fmul double %209, %223
%225 = fptoui double %224 to i8
%226 = select i1 %222, i8 %225, i8 0
store i8 %226, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @write_ppm_normalize_float.color, i64 0, i64 0)
%227 = getelementptr inbounds float, float* %2, i64 %219
%228 = load float, float* %227
%229 = fcmp ogt float %228, 0.000000e+00
%230 = fpext float %228 to double
%231 = fmul double %209, %230
%232 = fptoui double %231 to i8
%233 = select i1 %229, i8 %232, i8 0
store i8 %233, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @write_ppm_normalize_float.color, i64 0, i64 1)
%234 = getelementptr inbounds float, float* %3, i64 %219
%235 = load float, float* %234
%236 = fcmp ogt float %235, 0.000000e+00
%237 = fpext float %235 to double
%238 = fmul double %209, %237
%239 = fptoui double %238 to i8
%240 = select i1 %236, i8 %239, i8 0
store i8 %240, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @write_ppm_normalize_float.color, i64 0, i64 2)
%241 = tail call i32 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @write_ppm_normalize_float.color, i64 0, i64 0), i32 1, i32 3, i32* %198)
%242 = add nuw nsw i64 %218, 1
%243 = icmp eq i64 %242, %212
br i1 %243, label %244, label %217
244: ; preds = %217, %213
%245 = add nuw nsw i64 %214, 1
%246 = icmp eq i64 %245, %211
br i1 %246, label %247, label %213
247: ; preds = %244, %202
%248 = load i32*, i32** @stdout
%249 = icmp eq i32* %198, %248
br i1 %249, label %256, label %250
250: ; preds = %247
%251 = tail call i64 @fclose(i32* %198)
%252 = load i64, i64* @EOF
%253 = icmp eq i64 %251, %252
br i1 %253, label %254, label %256
254: ; preds = %250
%255 = tail call i32 @errorf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.7, i64 0, i64 0), i8* %0)
br label %256
256: ; preds = %254, %250, %247
ret void
}