#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 */
int /*<<< orphan*/ fwrite(unsigned char *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ stbiw__linear_to_rgbe(unsigned char *, float *);
int /*<<< orphan*/ stbiw__write_dump_data(int /*<<< orphan*/ *, int,
                                          unsigned char *);
int /*<<< orphan*/ stbiw__write_run_data(int /*<<< orphan*/ *, int,
                                         unsigned char);
void stbiw__write_hdr_scanline(FILE *f, int width, int comp,
                               unsigned char *scratch, const float *scanline) {
  unsigned char scanlineheader[4] = {2, 2, 0, 0};
  unsigned char rgbe[4];
  float linear[3];
  int x;
  scanlineheader[2] = (width & 0xff00) >> 8;
  scanlineheader[3] = (width & 0x00ff);
  if (width < 8 || width >= 32768) {
    for (x = 0; x < width; x++) {
      switch (comp) {
      case 4:
      case 3:
        linear[2] = scanline[x * comp + 2];
        linear[1] = scanline[x * comp + 1];
        linear[0] = scanline[x * comp + 0];
        break;
      case 2:
      case 1:
        linear[0] = linear[1] = linear[2] = scanline[x * comp + 0];
        break;
      }
      stbiw__linear_to_rgbe(rgbe, linear);
      fwrite(rgbe, 4, 1, f);
    }
  } else {
    int c, r;
    for (x = 0; x < width; x++) {
      switch (comp) {
      case 4:
      case 3:
        linear[2] = scanline[x * comp + 2];
        linear[1] = scanline[x * comp + 1];
        linear[0] = scanline[x * comp + 0];
        break;
      case 2:
      case 1:
        linear[0] = linear[1] = linear[2] = scanline[x * comp + 0];
        break;
      }
      stbiw__linear_to_rgbe(rgbe, linear);
      scratch[x + width * 0] = rgbe[0];
      scratch[x + width * 1] = rgbe[1];
      scratch[x + width * 2] = rgbe[2];
      scratch[x + width * 3] = rgbe[3];
    }
    fwrite(scanlineheader, 4, 1, f);
    for (c = 0; c < 4; c++) {
      unsigned char *comp = &scratch[width * c];
      x = 0;
      while (x < width) {
        r = x;
        while (r + 2 < width) {
          if (comp[r] == comp[r + 1] && comp[r] == comp[r + 2])
            break;
          ++r;
        }
        if (r + 2 >= width)
          r = width;
        while (x < r) {
          int len = r - x;
          if (len > 128)
            len = 128;
          stbiw__write_dump_data(f, len, &comp[x]);
          x += len;
        }
        if (r + 2 < width) {
          while (r < width && comp[r] == comp[x])
            ++r;
          while (x < r) {
            int len = r - x;
            if (len > 127)
              len = 127;
            stbiw__write_run_data(f, len, comp[x]);
            x += len;
          }
        }
      }
    }
  }
}


x86 assembly (clang, -O0):
<stbiw__write_hdr_scanline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    0xea0(%rip),%eax
mov    %eax,-0x24(%rbp)
mov    -0xc(%rbp),%eax
and    $0xff00,%eax
sar    $0x8,%eax
mov    %al,-0x22(%rbp)
mov    -0xc(%rbp),%eax
and    $0xff,%eax
mov    %al,-0x21(%rbp)
cmpl   $0x8,-0xc(%rbp)
jl     1193 <stbiw__write_hdr_scanline+0x53>
cmpl   $0x8000,-0xc(%rbp)
jl     1283 <stbiw__write_hdr_scanline+0x143>
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    127e <stbiw__write_hdr_scanline+0x13e>
mov    -0x10(%rbp),%eax
mov    %eax,-0x54(%rbp)
add    $0xffffffff,%eax
sub    $0x2,%eax
jb     1227 <stbiw__write_hdr_scanline+0xe7>
jmp    11bd <stbiw__write_hdr_scanline+0x7d>
mov    -0x54(%rbp),%eax
add    $0xfffffffd,%eax
sub    $0x1,%eax
ja     124c <stbiw__write_hdr_scanline+0x10c>
jmp    11d1 <stbiw__write_hdr_scanline+0x91>
mov    -0x20(%rbp),%rax
mov    -0x38(%rbp),%ecx
imul   -0x10(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm0
movss  %xmm0,-0x2c(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x38(%rbp),%ecx
imul   -0x10(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm0
movss  %xmm0,-0x30(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x38(%rbp),%ecx
imul   -0x10(%rbp),%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm0
movss  %xmm0,-0x34(%rbp)
jmp    124c <stbiw__write_hdr_scanline+0x10c>
mov    -0x20(%rbp),%rax
mov    -0x38(%rbp),%ecx
imul   -0x10(%rbp),%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm0
movss  %xmm0,-0x2c(%rbp)
movss  %xmm0,-0x30(%rbp)
movss  %xmm0,-0x34(%rbp)
lea    -0x28(%rbp),%rdi
lea    -0x34(%rbp),%rsi
call   1030 <stbiw__linear_to_rgbe@plt>
lea    -0x28(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x4,%esi
mov    $0x1,%edx
call   1060 <fwrite@plt>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    119a <stbiw__write_hdr_scanline+0x5a>
jmp    15b3 <stbiw__write_hdr_scanline+0x473>
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    13b3 <stbiw__write_hdr_scanline+0x273>
mov    -0x10(%rbp),%eax
mov    %eax,-0x58(%rbp)
add    $0xffffffff,%eax
sub    $0x2,%eax
jb     1317 <stbiw__write_hdr_scanline+0x1d7>
jmp    12ad <stbiw__write_hdr_scanline+0x16d>
mov    -0x58(%rbp),%eax
add    $0xfffffffd,%eax
sub    $0x1,%eax
ja     133c <stbiw__write_hdr_scanline+0x1fc>
jmp    12c1 <stbiw__write_hdr_scanline+0x181>
mov    -0x20(%rbp),%rax
mov    -0x38(%rbp),%ecx
imul   -0x10(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm0
movss  %xmm0,-0x2c(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x38(%rbp),%ecx
imul   -0x10(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm0
movss  %xmm0,-0x30(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x38(%rbp),%ecx
imul   -0x10(%rbp),%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm0
movss  %xmm0,-0x34(%rbp)
jmp    133c <stbiw__write_hdr_scanline+0x1fc>
mov    -0x20(%rbp),%rax
mov    -0x38(%rbp),%ecx
imul   -0x10(%rbp),%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm0
movss  %xmm0,-0x2c(%rbp)
movss  %xmm0,-0x30(%rbp)
movss  %xmm0,-0x34(%rbp)
lea    -0x28(%rbp),%rdi
lea    -0x34(%rbp),%rsi
call   1030 <stbiw__linear_to_rgbe@plt>
mov    -0x28(%rbp),%dl
mov    -0x18(%rbp),%rax
mov    -0x38(%rbp),%ecx
imul   $0x0,-0xc(%rbp),%esi
add    %esi,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x27(%rbp),%dl
mov    -0x18(%rbp),%rax
mov    -0x38(%rbp),%ecx
mov    -0xc(%rbp),%esi
shl    $0x0,%esi
add    %esi,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x26(%rbp),%dl
mov    -0x18(%rbp),%rax
mov    -0x38(%rbp),%ecx
mov    -0xc(%rbp),%esi
shl    $0x1,%esi
add    %esi,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x25(%rbp),%dl
mov    -0x18(%rbp),%rax
mov    -0x38(%rbp),%ecx
imul   $0x3,-0xc(%rbp),%esi
add    %esi,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    128a <stbiw__write_hdr_scanline+0x14a>
lea    -0x24(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x4,%esi
mov    $0x1,%edx
call   1060 <fwrite@plt>
movl   $0x0,-0x3c(%rbp)
cmpl   $0x4,-0x3c(%rbp)
jge    15ae <stbiw__write_hdr_scanline+0x46e>
mov    -0x18(%rbp),%rax
mov    -0xc(%rbp),%ecx
imul   -0x3c(%rbp),%ecx
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x48(%rbp)
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    159b <stbiw__write_hdr_scanline+0x45b>
mov    -0x38(%rbp),%eax
mov    %eax,-0x40(%rbp)
mov    -0x40(%rbp),%eax
add    $0x2,%eax
cmp    -0xc(%rbp),%eax
jge    1475 <stbiw__write_hdr_scanline+0x335>
mov    -0x48(%rbp),%rax
movslq -0x40(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
mov    -0x48(%rbp),%rcx
mov    -0x40(%rbp),%edx
add    $0x1,%edx
movslq %edx,%rdx
movzbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
jne    1467 <stbiw__write_hdr_scanline+0x327>
mov    -0x48(%rbp),%rax
movslq -0x40(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
mov    -0x48(%rbp),%rcx
mov    -0x40(%rbp),%edx
add    $0x2,%edx
movslq %edx,%rdx
movzbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
jne    1467 <stbiw__write_hdr_scanline+0x327>
jmp    1475 <stbiw__write_hdr_scanline+0x335>
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    1409 <stbiw__write_hdr_scanline+0x2c9>
mov    -0x40(%rbp),%eax
add    $0x2,%eax
cmp    -0xc(%rbp),%eax
jl     148a <stbiw__write_hdr_scanline+0x34a>
mov    -0xc(%rbp),%eax
mov    %eax,-0x40(%rbp)
jmp    148f <stbiw__write_hdr_scanline+0x34f>
mov    -0x38(%rbp),%eax
cmp    -0x40(%rbp),%eax
jge    14dd <stbiw__write_hdr_scanline+0x39d>
mov    -0x40(%rbp),%eax
sub    -0x38(%rbp),%eax
mov    %eax,-0x4c(%rbp)
cmpl   $0x80,-0x4c(%rbp)
jle    14b8 <stbiw__write_hdr_scanline+0x378>
movl   $0x80,-0x4c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x4c(%rbp),%esi
mov    -0x48(%rbp),%rdx
movslq -0x38(%rbp),%rax
add    %rax,%rdx
call   1040 <stbiw__write_dump_data@plt>
mov    -0x4c(%rbp),%eax
add    -0x38(%rbp),%eax
mov    %eax,-0x38(%rbp)
jmp    148f <stbiw__write_hdr_scanline+0x34f>
mov    -0x40(%rbp),%eax
add    $0x2,%eax
cmp    -0xc(%rbp),%eax
jge    1596 <stbiw__write_hdr_scanline+0x456>
jmp    14f1 <stbiw__write_hdr_scanline+0x3b1>
mov    -0x40(%rbp),%ecx
xor    %eax,%eax
cmp    -0xc(%rbp),%ecx
mov    %al,-0x59(%rbp)
jge    1522 <stbiw__write_hdr_scanline+0x3e2>
mov    -0x48(%rbp),%rax
movslq -0x40(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
mov    -0x48(%rbp),%rcx
movslq -0x38(%rbp),%rdx
movzbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
sete   %al
mov    %al,-0x59(%rbp)
mov    -0x59(%rbp),%al
test   $0x1,%al
jne    1532 <stbiw__write_hdr_scanline+0x3f2>
jmp    1540 <stbiw__write_hdr_scanline+0x400>
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    14f1 <stbiw__write_hdr_scanline+0x3b1>
jmp    1545 <stbiw__write_hdr_scanline+0x405>
mov    -0x38(%rbp),%eax
cmp    -0x40(%rbp),%eax
jge    1591 <stbiw__write_hdr_scanline+0x451>
mov    -0x40(%rbp),%eax
sub    -0x38(%rbp),%eax
mov    %eax,-0x50(%rbp)
cmpl   $0x7f,-0x50(%rbp)
jle    156b <stbiw__write_hdr_scanline+0x42b>
movl   $0x7f,-0x50(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x50(%rbp),%esi
mov    -0x48(%rbp),%rax
movslq -0x38(%rbp),%rcx
movzbl (%rax,%rcx,1),%edx
call   1050 <stbiw__write_run_data@plt>
mov    -0x50(%rbp),%eax
add    -0x38(%rbp),%eax
mov    %eax,-0x38(%rbp)
jmp    1545 <stbiw__write_hdr_scanline+0x405>
jmp    1596 <stbiw__write_hdr_scanline+0x456>
jmp    13f7 <stbiw__write_hdr_scanline+0x2b7>
jmp    15a0 <stbiw__write_hdr_scanline+0x460>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    13d1 <stbiw__write_hdr_scanline+0x291>
jmp    15b3 <stbiw__write_hdr_scanline+0x473>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stbiw__write_hdr_scanline>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
mov    %r8,%r12
mov    %esi,%eax
rol    $0x8,%ax
movl   $0x202,0x34(%rsp)
mov    %ax,0x36(%rsp)
lea    -0x8000(%rsi),%eax
cmp    $0xffff8008,%eax
mov    %rdi,0x28(%rsp)
jae    1226 <stbiw__write_hdr_scanline+0xe6>
test   %esi,%esi
jle    14e8 <stbiw__write_hdr_scanline+0x3a8>
movslq %edx,%r15
mov    %esi,%ebp
shl    $0x2,%r15
lea    -0x1(%rdx),%r14d
lea    0x8(%rsp),%r13
add    $0xfffffffd,%edx
mov    %rdx,0x18(%rsp)
jmp    11ec <stbiw__write_hdr_scanline+0xac>
xchg   %ax,%ax
movss  (%r12),%xmm0
movss  %xmm0,0x14(%rsp)
movss  %xmm0,0x10(%rsp)
movss  %xmm0,0xc(%rsp)
mov    0x28(%rsp),%rbx
mov    %r13,%rdi
lea    0xc(%rsp),%rsi
call   1030 <stbiw__linear_to_rgbe@plt>
mov    %r13,%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1060 <fwrite@plt>
add    %r15,%r12
add    $0xffffffffffffffff,%rbp
je     14e8 <stbiw__write_hdr_scanline+0x3a8>
cmp    $0x2,%r14d
jb     11a0 <stbiw__write_hdr_scanline+0x60>
cmpl   $0x1,0x18(%rsp)
mov    0x28(%rsp),%rbx
ja     11bd <stbiw__write_hdr_scanline+0x7d>
movss  0x8(%r12),%xmm0
movss  %xmm0,0x14(%rsp)
movss  0x4(%r12),%xmm0
movss  %xmm0,0x10(%rsp)
movss  (%r12),%xmm0
movss  %xmm0,0xc(%rsp)
jmp    11bd <stbiw__write_hdr_scanline+0x7d>
mov    %rsi,0x48(%rsp)
mov    %esi,%r13d
lea    0x0(,%r13,2),%rbx
add    %r13,%rbx
mov    %rdx,0x18(%rsp)
movslq %edx,%rbp
lea    0x0(,%rbp,4),%rax
mov    %rax,0x20(%rsp)
add    %rcx,%rbx
lea    (%rcx,%r13,2),%rax
mov    %rax,0x40(%rsp)
mov    %rcx,0x38(%rsp)
lea    (%rcx,%r13,1),%r15
xor    %r14d,%r14d
add    $0xffffffff,%ebp
jmp    12d3 <stbiw__write_hdr_scanline+0x193>
nopl   0x0(%rax,%rax,1)
movss  (%r12),%xmm0
movss  %xmm0,0x14(%rsp)
movss  %xmm0,0x10(%rsp)
movss  %xmm0,0xc(%rsp)
lea    0x8(%rsp),%rdi
lea    0xc(%rsp),%rsi
call   1030 <stbiw__linear_to_rgbe@plt>
movzbl 0x8(%rsp),%eax
mov    0x38(%rsp),%rcx
mov    %al,(%rcx,%r14,1)
movzbl 0x9(%rsp),%eax
mov    %al,(%r15,%r14,1)
movzbl 0xa(%rsp),%eax
mov    0x40(%rsp),%rcx
mov    %al,(%rcx,%r14,1)
movzbl 0xb(%rsp),%eax
mov    %al,(%rbx,%r14,1)
add    $0x1,%r14
add    0x20(%rsp),%r12
cmp    %r14,%r13
je     130a <stbiw__write_hdr_scanline+0x1ca>
cmp    $0x2,%ebp
jb     1270 <stbiw__write_hdr_scanline+0x130>
mov    0x18(%rsp),%rax
add    $0xfffffffd,%eax
cmp    $0x1,%eax
ja     1288 <stbiw__write_hdr_scanline+0x148>
movss  0x8(%r12),%xmm0
movss  %xmm0,0x14(%rsp)
movss  0x4(%r12),%xmm0
movss  %xmm0,0x10(%rsp)
movss  (%r12),%xmm0
jmp    1282 <stbiw__write_hdr_scanline+0x142>
lea    0x34(%rsp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    0x28(%rsp),%rcx
call   1060 <fwrite@plt>
mov    0x38(%rsp),%rax
lea    0x1(%rax),%rdi
xor    %r15d,%r15d
mov    %rax,0x20(%rsp)
mov    0x48(%rsp),%rsi
mov    %r13,0x18(%rsp)
jmp    1360 <stbiw__write_hdr_scanline+0x220>
mov    0x50(%rsp),%r15
add    $0x1,%r15
add    %r13,%rdi
add    %r13,0x20(%rsp)
cmp    $0x4,%r15
mov    0x38(%rsp),%rax
je     14e8 <stbiw__write_hdr_scanline+0x3a8>
mov    %r15,0x50(%rsp)
imul   %r13,%r15
add    %rax,%r15
xor    %r14d,%r14d
mov    %rdi,0x40(%rsp)
jmp    1399 <stbiw__write_hdr_scanline+0x259>
cs nopw 0x0(%rax,%rax,1)
mov    %r14d,%ebp
mov    0x18(%rsp),%r13
mov    %ebp,%r14d
mov    0x48(%rsp),%rsi
cmp    %esi,%ebp
mov    0x40(%rsp),%rdi
jge    1340 <stbiw__write_hdr_scanline+0x200>
lea    0x2(%r14),%eax
mov    %esi,%r12d
cmp    %esi,%eax
jge    13f3 <stbiw__write_hdr_scanline+0x2b3>
cltq
movslq %r14d,%rcx
mov    (%r15,%rcx,1),%dl
add    $0x2,%rcx
add    0x20(%rsp),%rax
mov    %r14d,%r12d
jmp    13d3 <stbiw__write_hdr_scanline+0x293>
nopl   0x0(%rax,%rax,1)
add    $0x1,%r12d
add    $0x1,%rcx
add    $0x1,%rax
mov    %ebx,%edx
cmp    %r13,%rcx
jge    13f0 <stbiw__write_hdr_scanline+0x2b0>
movzbl -0x2(%rdi,%rcx,1),%ebx
cmp    %bl,%dl
jne    13c0 <stbiw__write_hdr_scanline+0x280>
cmp    (%rax),%dl
jne    13c0 <stbiw__write_hdr_scanline+0x280>
jmp    13f3 <stbiw__write_hdr_scanline+0x2b3>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %esi,%r12d
cmp    %r14d,%r12d
mov    0x28(%rsp),%rbx
jle    1439 <stbiw__write_hdr_scanline+0x2f9>
mov    $0x80,%r13d
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r12d,%ebp
sub    %r14d,%ebp
cmp    $0x80,%ebp
cmovge %r13d,%ebp
movslq %r14d,%r14
lea    (%r15,%r14,1),%rdx
mov    %rbx,%rdi
mov    %ebp,%esi
call   1040 <stbiw__write_dump_data@plt>
add    %ebp,%r14d
cmp    %r14d,%r12d
jg     1410 <stbiw__write_hdr_scanline+0x2d0>
lea    0x2(%r12),%eax
mov    0x48(%rsp),%rdx
cmp    %edx,%eax
jge    1380 <stbiw__write_hdr_scanline+0x240>
movslq %r14d,%rax
mov    (%r15,%rax,1),%al
movslq %r12d,%rcx
add    $0x1,%r12d
cmp    %r12d,%edx
cmovg  %edx,%r12d
mov    0x18(%rsp),%r13
mov    $0x7f,%edx
mov    0x20(%rsp),%rsi
nop
cmp    %al,(%rsi,%rcx,1)
jne    1480 <stbiw__write_hdr_scanline+0x340>
add    $0x1,%rcx
cmp    %r13,%rcx
jl     1470 <stbiw__write_hdr_scanline+0x330>
jmp    1483 <stbiw__write_hdr_scanline+0x343>
mov    %ecx,%r12d
mov    %r12d,%ebp
sub    %r14d,%ebp
jle    14e0 <stbiw__write_hdr_scanline+0x3a0>
cmp    $0x7f,%ebp
cmovge %edx,%ebp
movzbl %al,%edx
mov    %rbx,%rdi
mov    %ebp,%esi
call   1050 <stbiw__write_run_data@plt>
add    %r14d,%ebp
cmp    %ebp,%r12d
jle    1388 <stbiw__write_hdr_scanline+0x248>
mov    0x28(%rsp),%r14
nop
movslq %ebp,%rbx
movzbl (%r15,%rbx,1),%edx
mov    %r12d,%ebp
sub    %ebx,%ebp
cmp    $0x7f,%ebp
mov    $0x7f,%eax
cmovge %eax,%ebp
mov    %r14,%rdi
mov    %ebp,%esi
call   1050 <stbiw__write_run_data@plt>
add    %ebx,%ebp
cmp    %ebp,%r12d
jg     14b0 <stbiw__write_hdr_scanline+0x370>
jmp    1388 <stbiw__write_hdr_scanline+0x248>
xchg   %ax,%ax
mov    %r14d,%ebp
jmp    1388 <stbiw__write_hdr_scanline+0x248>
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.stbiw__write_hdr_scanline.scanlineheader = [4 x i8] c"\02\02\00\00"
define void @stbiw__write_hdr_scanline(i32* %0, i32 %1, i32 %2, i8* %3, float* %4) {
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
%10 = alloca float*
%11 = alloca [4 x i8]
%12 = alloca [4 x i8]
%13 = alloca [3 x float]
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i8*
%18 = alloca i32
%19 = alloca i32
store i32* %0, i32** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i8* %3, i8** %9
store float* %4, float** %10
%20 = bitcast [4 x i8]* %11 to i8*
%21 = load i32, i32* %7
%22 = and i32 %21, 65280
%23 = ashr i32 %22, 8
%24 = trunc i32 %23 to i8
%25 = getelementptr inbounds [4 x i8], [4 x i8]* %11, i64 0, i64 2
store i8 %24, i8* %25
%26 = load i32, i32* %7
%27 = and i32 %26, 255
%28 = trunc i32 %27 to i8
%29 = getelementptr inbounds [4 x i8], [4 x i8]* %11, i64 0, i64 3
store i8 %28, i8* %29
%30 = load i32, i32* %7
%31 = icmp slt i32 %30, 8
br i1 %31, label %35, label %32
32: ; preds = %5
%33 = load i32, i32* %7
%34 = icmp sge i32 %33, 32768
br i1 %34, label %35, label %93
35: ; preds = %32, %5
store i32 0, i32* %14
br label %36
36: ; preds = %89, %35
%37 = load i32, i32* %14
%38 = load i32, i32* %7
%39 = icmp slt i32 %37, %38
br i1 %39, label %40, label %92
40: ; preds = %36
%41 = load i32, i32* %8
switch i32 %41, label %82 [
i32 4, label %42
i32 3, label %42
i32 2, label %70
i32 1, label %70
]
42: ; preds = %40, %40
%43 = load float*, float** %10
%44 = load i32, i32* %14
%45 = load i32, i32* %8
%46 = mul nsw i32 %44, %45
%47 = add nsw i32 %46, 2
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds float, float* %43, i64 %48
%50 = load float, float* %49
%51 = getelementptr inbounds [3 x float], [3 x float]* %13, i64 0, i64 2
store float %50, float* %51
%52 = load float*, float** %10
%53 = load i32, i32* %14
%54 = load i32, i32* %8
%55 = mul nsw i32 %53, %54
%56 = add nsw i32 %55, 1
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds float, float* %52, i64 %57
%59 = load float, float* %58
%60 = getelementptr inbounds [3 x float], [3 x float]* %13, i64 0, i64 1
store float %59, float* %60
%61 = load float*, float** %10
%62 = load i32, i32* %14
%63 = load i32, i32* %8
%64 = mul nsw i32 %62, %63
%65 = add nsw i32 %64, 0
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds float, float* %61, i64 %66
%68 = load float, float* %67
%69 = getelementptr inbounds [3 x float], [3 x float]* %13, i64 0, i64 0
store float %68, float* %69
br label %82
70: ; preds = %40, %40
%71 = load float*, float** %10
%72 = load i32, i32* %14
%73 = load i32, i32* %8
%74 = mul nsw i32 %72, %73
%75 = add nsw i32 %74, 0
%76 = sext i32 %75 to i64
%77 = getelementptr inbounds float, float* %71, i64 %76
%78 = load float, float* %77
%79 = getelementptr inbounds [3 x float], [3 x float]* %13, i64 0, i64 2
store float %78, float* %79
%80 = getelementptr inbounds [3 x float], [3 x float]* %13, i64 0, i64 1
store float %78, float* %80
%81 = getelementptr inbounds [3 x float], [3 x float]* %13, i64 0, i64 0
store float %78, float* %81
br label %82
82: ; preds = %40, %70, %42
%83 = getelementptr inbounds [4 x i8], [4 x i8]* %12, i64 0, i64 0
%84 = getelementptr inbounds [3 x float], [3 x float]* %13, i64 0, i64 0
%85 = call i32 @stbiw__linear_to_rgbe(i8* %83, float* %84)
%86 = getelementptr inbounds [4 x i8], [4 x i8]* %12, i64 0, i64 0
%87 = load i32*, i32** %6
%88 = call i32 @fwrite(i8* %86, i32 4, i32 1, i32* %87)
br label %89
89: ; preds = %82
%90 = load i32, i32* %14
%91 = add nsw i32 %90, 1
store i32 %91, i32* %14
br label %36
92: ; preds = %36
br label %332
93: ; preds = %32
store i32 0, i32* %14
br label %94
94: ; preds = %180, %93
%95 = load i32, i32* %14
%96 = load i32, i32* %7
%97 = icmp slt i32 %95, %96
br i1 %97, label %98, label %183
98: ; preds = %94
%99 = load i32, i32* %8
switch i32 %99, label %140 [
i32 4, label %100
i32 3, label %100
i32 2, label %128
i32 1, label %128
]
100: ; preds = %98, %98
%101 = load float*, float** %10
%102 = load i32, i32* %14
%103 = load i32, i32* %8
%104 = mul nsw i32 %102, %103
%105 = add nsw i32 %104, 2
%106 = sext i32 %105 to i64
%107 = getelementptr inbounds float, float* %101, i64 %106
%108 = load float, float* %107
%109 = getelementptr inbounds [3 x float], [3 x float]* %13, i64 0, i64 2
store float %108, float* %109
%110 = load float*, float** %10
%111 = load i32, i32* %14
%112 = load i32, i32* %8
%113 = mul nsw i32 %111, %112
%114 = add nsw i32 %113, 1
%115 = sext i32 %114 to i64
%116 = getelementptr inbounds float, float* %110, i64 %115
%117 = load float, float* %116
%118 = getelementptr inbounds [3 x float], [3 x float]* %13, i64 0, i64 1
store float %117, float* %118
%119 = load float*, float** %10
%120 = load i32, i32* %14
%121 = load i32, i32* %8
%122 = mul nsw i32 %120, %121
%123 = add nsw i32 %122, 0
%124 = sext i32 %123 to i64
%125 = getelementptr inbounds float, float* %119, i64 %124
%126 = load float, float* %125
%127 = getelementptr inbounds [3 x float], [3 x float]* %13, i64 0, i64 0
store float %126, float* %127
br label %140
128: ; preds = %98, %98
%129 = load float*, float** %10
%130 = load i32, i32* %14
%131 = load i32, i32* %8
%132 = mul nsw i32 %130, %131
%133 = add nsw i32 %132, 0
%134 = sext i32 %133 to i64
%135 = getelementptr inbounds float, float* %129, i64 %134
%136 = load float, float* %135
%137 = getelementptr inbounds [3 x float], [3 x float]* %13, i64 0, i64 2
store float %136, float* %137
%138 = getelementptr inbounds [3 x float], [3 x float]* %13, i64 0, i64 1
store float %136, float* %138
%139 = getelementptr inbounds [3 x float], [3 x float]* %13, i64 0, i64 0
store float %136, float* %139
br label %140
140: ; preds = %98, %128, %100
%141 = getelementptr inbounds [4 x i8], [4 x i8]* %12, i64 0, i64 0
%142 = getelementptr inbounds [3 x float], [3 x float]* %13, i64 0, i64 0
%143 = call i32 @stbiw__linear_to_rgbe(i8* %141, float* %142)
%144 = getelementptr inbounds [4 x i8], [4 x i8]* %12, i64 0, i64 0
%145 = load i8, i8* %144
%146 = load i8*, i8** %9
%147 = load i32, i32* %14
%148 = load i32, i32* %7
%149 = mul nsw i32 %148, 0
%150 = add nsw i32 %147, %149
%151 = sext i32 %150 to i64
%152 = getelementptr inbounds i8, i8* %146, i64 %151
store i8 %145, i8* %152
%153 = getelementptr inbounds [4 x i8], [4 x i8]* %12, i64 0, i64 1
%154 = load i8, i8* %153
%155 = load i8*, i8** %9
%156 = load i32, i32* %14
%157 = load i32, i32* %7
%158 = mul nsw i32 %157, 1
%159 = add nsw i32 %156, %158
%160 = sext i32 %159 to i64
%161 = getelementptr inbounds i8, i8* %155, i64 %160
store i8 %154, i8* %161
%162 = getelementptr inbounds [4 x i8], [4 x i8]* %12, i64 0, i64 2
%163 = load i8, i8* %162
%164 = load i8*, i8** %9
%165 = load i32, i32* %14
%166 = load i32, i32* %7
%167 = mul nsw i32 %166, 2
%168 = add nsw i32 %165, %167
%169 = sext i32 %168 to i64
%170 = getelementptr inbounds i8, i8* %164, i64 %169
store i8 %163, i8* %170
%171 = getelementptr inbounds [4 x i8], [4 x i8]* %12, i64 0, i64 3
%172 = load i8, i8* %171
%173 = load i8*, i8** %9
%174 = load i32, i32* %14
%175 = load i32, i32* %7
%176 = mul nsw i32 %175, 3
%177 = add nsw i32 %174, %176
%178 = sext i32 %177 to i64
%179 = getelementptr inbounds i8, i8* %173, i64 %178
store i8 %172, i8* %179
br label %180
180: ; preds = %140
%181 = load i32, i32* %14
%182 = add nsw i32 %181, 1
store i32 %182, i32* %14
br label %94
183: ; preds = %94
%184 = getelementptr inbounds [4 x i8], [4 x i8]* %11, i64 0, i64 0
%185 = load i32*, i32** %6
%186 = call i32 @fwrite(i8* %184, i32 4, i32 1, i32* %185)
store i32 0, i32* %15
br label %187
187: ; preds = %328, %183
%188 = load i32, i32* %15
%189 = icmp slt i32 %188, 4
br i1 %189, label %190, label %331
190: ; preds = %187
%191 = load i8*, i8** %9
%192 = load i32, i32* %7
%193 = load i32, i32* %15
%194 = mul nsw i32 %192, %193
%195 = sext i32 %194 to i64
%196 = getelementptr inbounds i8, i8* %191, i64 %195
store i8* %196, i8** %17
store i32 0, i32* %14
br label %197
197: ; preds = %326, %190
%198 = load i32, i32* %14
%199 = load i32, i32* %7
%200 = icmp slt i32 %198, %199
br i1 %200, label %201, label %327
201: ; preds = %197
%202 = load i32, i32* %14
store i32 %202, i32* %16
br label %203
203: ; preds = %239, %201
%204 = load i32, i32* %16
%205 = add nsw i32 %204, 2
%206 = load i32, i32* %7
%207 = icmp slt i32 %205, %206
br i1 %207, label %208, label %242
208: ; preds = %203
%209 = load i8*, i8** %17
%210 = load i32, i32* %16
%211 = sext i32 %210 to i64
%212 = getelementptr inbounds i8, i8* %209, i64 %211
%213 = load i8, i8* %212
%214 = zext i8 %213 to i32
%215 = load i8*, i8** %17
%216 = load i32, i32* %16
%217 = add nsw i32 %216, 1
%218 = sext i32 %217 to i64
%219 = getelementptr inbounds i8, i8* %215, i64 %218
%220 = load i8, i8* %219
%221 = zext i8 %220 to i32
%222 = icmp eq i32 %214, %221
br i1 %222, label %223, label %239
223: ; preds = %208
%224 = load i8*, i8** %17
%225 = load i32, i32* %16
%226 = sext i32 %225 to i64
%227 = getelementptr inbounds i8, i8* %224, i64 %226
%228 = load i8, i8* %227
%229 = zext i8 %228 to i32
%230 = load i8*, i8** %17
%231 = load i32, i32* %16
%232 = add nsw i32 %231, 2
%233 = sext i32 %232 to i64
%234 = getelementptr inbounds i8, i8* %230, i64 %233
%235 = load i8, i8* %234
%236 = zext i8 %235 to i32
%237 = icmp eq i32 %229, %236
br i1 %237, label %238, label %239
238: ; preds = %223
br label %242
239: ; preds = %223, %208
%240 = load i32, i32* %16
%241 = add nsw i32 %240, 1
store i32 %241, i32* %16
br label %203
242: ; preds = %238, %203
%243 = load i32, i32* %16
%244 = add nsw i32 %243, 2
%245 = load i32, i32* %7
%246 = icmp sge i32 %244, %245
br i1 %246, label %247, label %249
247: ; preds = %242
%248 = load i32, i32* %7
store i32 %248, i32* %16
br label %249
249: ; preds = %247, %242
br label %250
250: ; preds = %261, %249
%251 = load i32, i32* %14
%252 = load i32, i32* %16
%253 = icmp slt i32 %251, %252
br i1 %253, label %254, label %272
254: ; preds = %250
%255 = load i32, i32* %16
%256 = load i32, i32* %14
%257 = sub nsw i32 %255, %256
store i32 %257, i32* %18
%258 = load i32, i32* %18
%259 = icmp sgt i32 %258, 128
br i1 %259, label %260, label %261
260: ; preds = %254
store i32 128, i32* %18
br label %261
261: ; preds = %260, %254
%262 = load i32*, i32** %6
%263 = load i32, i32* %18
%264 = load i8*, i8** %17
%265 = load i32, i32* %14
%266 = sext i32 %265 to i64
%267 = getelementptr inbounds i8, i8* %264, i64 %266
%268 = call i32 @stbiw__write_dump_data(i32* %262, i32 %263, i8* %267)
%269 = load i32, i32* %18
%270 = load i32, i32* %14
%271 = add nsw i32 %270, %269
store i32 %271, i32* %14
br label %250
272: ; preds = %250
%273 = load i32, i32* %16
%274 = add nsw i32 %273, 2
%275 = load i32, i32* %7
%276 = icmp slt i32 %274, %275
br i1 %276, label %277, label %326
277: ; preds = %272
br label %278
278: ; preds = %298, %277
%279 = load i32, i32* %16
%280 = load i32, i32* %7
%281 = icmp slt i32 %279, %280
br i1 %281, label %282, label %296
282: ; preds = %278
%283 = load i8*, i8** %17
%284 = load i32, i32* %16
%285 = sext i32 %284 to i64
%286 = getelementptr inbounds i8, i8* %283, i64 %285
%287 = load i8, i8* %286
%288 = zext i8 %287 to i32
%289 = load i8*, i8** %17
%290 = load i32, i32* %14
%291 = sext i32 %290 to i64
%292 = getelementptr inbounds i8, i8* %289, i64 %291
%293 = load i8, i8* %292
%294 = zext i8 %293 to i32
%295 = icmp eq i32 %288, %294
br label %296
296: ; preds = %282, %278
%297 = phi i1 [ false, %278 ], [ %295, %282 ]
br i1 %297, label %298, label %301
298: ; preds = %296
%299 = load i32, i32* %16
%300 = add nsw i32 %299, 1
store i32 %300, i32* %16
br label %278
301: ; preds = %296
br label %302
302: ; preds = %313, %301
%303 = load i32, i32* %14
%304 = load i32, i32* %16
%305 = icmp slt i32 %303, %304
br i1 %305, label %306, label %325
306: ; preds = %302
%307 = load i32, i32* %16
%308 = load i32, i32* %14
%309 = sub nsw i32 %307, %308
store i32 %309, i32* %19
%310 = load i32, i32* %19
%311 = icmp sgt i32 %310, 127
br i1 %311, label %312, label %313
312: ; preds = %306
store i32 127, i32* %19
br label %313
313: ; preds = %312, %306
%314 = load i32*, i32** %6
%315 = load i32, i32* %19
%316 = load i8*, i8** %17
%317 = load i32, i32* %14
%318 = sext i32 %317 to i64
%319 = getelementptr inbounds i8, i8* %316, i64 %318
%320 = load i8, i8* %319
%321 = call i32 @stbiw__write_run_data(i32* %314, i32 %315, i8 zeroext %320)
%322 = load i32, i32* %19
%323 = load i32, i32* %14
%324 = add nsw i32 %323, %322
store i32 %324, i32* %14
br label %302
325: ; preds = %302
br label %326
326: ; preds = %325, %272
br label %197
327: ; preds = %197
br label %328
328: ; preds = %327
%329 = load i32, i32* %15
%330 = add nsw i32 %329, 1
store i32 %330, i32* %15
br label %187
331: ; preds = %187
br label %332
332: ; preds = %331, %92
ret void
}

LLVM IR (-O2):
define void @stbiw__write_hdr_scanline(i32* %0, i32 %1, i32 %2, i8* %3, float* nocapture %4) {
%6 = alloca i32
%7 = bitcast i32* %6 to [4 x i8]*
%8 = alloca [4 x i8]
%9 = alloca [3 x float]
%10 = bitcast i32* %6 to i8*
store i32 514, i32* %6
%11 = getelementptr inbounds [4 x i8], [4 x i8]* %8, i64 0, i64 0
%12 = bitcast [3 x float]* %9 to i8*
%13 = lshr i32 %1, 8
%14 = trunc i32 %13 to i8
%15 = getelementptr inbounds [4 x i8], [4 x i8]* %7, i64 0, i64 2
store i8 %14, i8* %15
%16 = trunc i32 %1 to i8
%17 = getelementptr inbounds [4 x i8], [4 x i8]* %7, i64 0, i64 3
store i8 %16, i8* %17
%18 = add i32 %1, -32768
%19 = icmp ult i32 %18, -32760
br i1 %19, label %34, label %20
20: ; preds = %5
%21 = getelementptr inbounds [3 x float], [3 x float]* %9, i64 0, i64 2
%22 = getelementptr inbounds [3 x float], [3 x float]* %9, i64 0, i64 1
%23 = getelementptr inbounds [3 x float], [3 x float]* %9, i64 0, i64 0
%24 = getelementptr inbounds [4 x i8], [4 x i8]* %8, i64 0, i64 1
%25 = getelementptr inbounds [4 x i8], [4 x i8]* %8, i64 0, i64 2
%26 = shl nuw nsw i32 %1, 1
%27 = getelementptr inbounds [4 x i8], [4 x i8]* %8, i64 0, i64 3
%28 = mul nuw nsw i32 %1, 3
%29 = zext i32 %1 to i64
%30 = zext i32 %26 to i64
%31 = zext i32 %28 to i64
%32 = sext i32 %2 to i64
%33 = zext i32 %1 to i64
br label %63
34: ; preds = %5
%35 = icmp sgt i32 %1, 0
br i1 %35, label %36, label %188
36: ; preds = %34
%37 = getelementptr inbounds [3 x float], [3 x float]* %9, i64 0, i64 2
%38 = getelementptr inbounds [3 x float], [3 x float]* %9, i64 0, i64 1
%39 = getelementptr inbounds [3 x float], [3 x float]* %9, i64 0, i64 0
%40 = sext i32 %2 to i64
%41 = zext i32 %1 to i64
br label %42
42: ; preds = %36, %58
%43 = phi i64 [ 0, %36 ], [ %61, %58 ]
switch i32 %2, label %58 [
i32 4, label %44
i32 3, label %44
i32 2, label %54
i32 1, label %54
]
44: ; preds = %42, %42
%45 = mul nsw i64 %43, %40
%46 = add nsw i64 %45, 2
%47 = getelementptr inbounds float, float* %4, i64 %46
%48 = load float, float* %47
store float %48, float* %37
%49 = add nsw i64 %45, 1
%50 = getelementptr inbounds float, float* %4, i64 %49
%51 = load float, float* %50
store float %51, float* %38
%52 = getelementptr inbounds float, float* %4, i64 %45
%53 = load float, float* %52
store float %53, float* %39
br label %58
54: ; preds = %42, %42
%55 = mul nsw i64 %43, %40
%56 = getelementptr inbounds float, float* %4, i64 %55
%57 = load float, float* %56
store float %57, float* %37
store float %57, float* %38
store float %57, float* %39
br label %58
58: ; preds = %42, %54, %44
%59 = call i32 @stbiw__linear_to_rgbe(i8* %11, float* %39)
%60 = call i32 @fwrite(i8* %11, i32 4, i32 1, i32* %0)
%61 = add nuw nsw i64 %43, 1
%62 = icmp eq i64 %61, %41
br i1 %62, label %188, label %42
63: ; preds = %20, %79
%64 = phi i64 [ 0, %20 ], [ %92, %79 ]
switch i32 %2, label %79 [
i32 4, label %65
i32 3, label %65
i32 2, label %75
i32 1, label %75
]
65: ; preds = %63, %63
%66 = mul nsw i64 %64, %32
%67 = add nsw i64 %66, 2
%68 = getelementptr inbounds float, float* %4, i64 %67
%69 = load float, float* %68
store float %69, float* %21
%70 = add nsw i64 %66, 1
%71 = getelementptr inbounds float, float* %4, i64 %70
%72 = load float, float* %71
store float %72, float* %22
%73 = getelementptr inbounds float, float* %4, i64 %66
%74 = load float, float* %73
store float %74, float* %23
br label %79
75: ; preds = %63, %63
%76 = mul nsw i64 %64, %32
%77 = getelementptr inbounds float, float* %4, i64 %76
%78 = load float, float* %77
store float %78, float* %21
store float %78, float* %22
store float %78, float* %23
br label %79
79: ; preds = %63, %75, %65
%80 = call i32 @stbiw__linear_to_rgbe(i8* %11, float* %23)
%81 = load i8, i8* %11
%82 = getelementptr inbounds i8, i8* %3, i64 %64
store i8 %81, i8* %82
%83 = load i8, i8* %24
%84 = add nuw nsw i64 %64, %29
%85 = getelementptr inbounds i8, i8* %3, i64 %84
store i8 %83, i8* %85
%86 = load i8, i8* %25
%87 = add nuw nsw i64 %64, %30
%88 = getelementptr inbounds i8, i8* %3, i64 %87
store i8 %86, i8* %88
%89 = load i8, i8* %27
%90 = add nuw nsw i64 %64, %31
%91 = getelementptr inbounds i8, i8* %3, i64 %90
store i8 %89, i8* %91
%92 = add nuw nsw i64 %64, 1
%93 = icmp eq i64 %92, %33
br i1 %93, label %94, label %63
94: ; preds = %79
%95 = call i32 @fwrite(i8* %10, i32 4, i32 1, i32* %0)
br label %96
96: ; preds = %185, %94
%97 = phi i64 [ 0, %94 ], [ %186, %185 ]
%98 = mul nsw i64 %97, %29
%99 = getelementptr inbounds i8, i8* %3, i64 %98
br label %100
100: ; preds = %96, %182
%101 = phi i32 [ %183, %182 ], [ 0, %96 ]
%102 = add i32 %101, 2
%103 = icmp slt i32 %102, %1
br i1 %103, label %104, label %127
104: ; preds = %100
%105 = sext i32 %102 to i64
%106 = sext i32 %101 to i64
%107 = getelementptr inbounds i8, i8* %99, i64 %106
%108 = load i8, i8* %107
br label %109
109: ; preds = %104, %121
%110 = phi i8 [ %108, %104 ], [ %115, %121 ]
%111 = phi i64 [ %106, %104 ], [ %113, %121 ]
%112 = phi i64 [ %105, %104 ], [ %123, %121 ]
%113 = add nsw i64 %111, 1
%114 = getelementptr inbounds i8, i8* %99, i64 %113
%115 = load i8, i8* %114
%116 = icmp eq i8 %110, %115
br i1 %116, label %117, label %121
117: ; preds = %109
%118 = getelementptr inbounds i8, i8* %99, i64 %112
%119 = load i8, i8* %118
%120 = icmp eq i8 %110, %119
br i1 %120, label %125, label %121
121: ; preds = %117, %109
%122 = add nsw i64 %111, 3
%123 = add nsw i64 %112, 1
%124 = icmp slt i64 %122, %29
br i1 %124, label %109, label %127
125: ; preds = %117
%126 = trunc i64 %111 to i32
br label %127
127: ; preds = %121, %125, %100
%128 = phi i32 [ %1, %100 ], [ %126, %125 ], [ %1, %121 ]
%129 = icmp sgt i32 %128, %101
br i1 %129, label %130, label %140
130: ; preds = %127, %130
%131 = phi i32 [ %138, %130 ], [ %101, %127 ]
%132 = sub nsw i32 %128, %131
%133 = icmp slt i32 %132, 128
%134 = select i1 %133, i32 %132, i32 128
%135 = sext i32 %131 to i64
%136 = getelementptr inbounds i8, i8* %99, i64 %135
%137 = call i32 @stbiw__write_dump_data(i32* %0, i32 %134, i8* %136)
%138 = add nsw i32 %134, %131
%139 = icmp sgt i32 %128, %138
br i1 %139, label %130, label %140
140: ; preds = %130, %127
%141 = phi i32 [ %101, %127 ], [ %138, %130 ]
%142 = add nsw i32 %128, 2
%143 = icmp slt i32 %142, %1
br i1 %143, label %144, label %182
144: ; preds = %140
%145 = sext i32 %141 to i64
%146 = getelementptr inbounds i8, i8* %99, i64 %145
%147 = load i8, i8* %146
%148 = sext i32 %128 to i64
%149 = add i32 %128, 1
%150 = call i32 @llvm.smax.i32(i32 %1, i32 %149)
br label %151
151: ; preds = %144, %156
%152 = phi i64 [ %148, %144 ], [ %157, %156 ]
%153 = getelementptr inbounds i8, i8* %99, i64 %152
%154 = load i8, i8* %153
%155 = icmp eq i8 %154, %147
br i1 %155, label %156, label %159
156: ; preds = %151
%157 = add nsw i64 %152, 1
%158 = icmp slt i64 %157, %29
br i1 %158, label %151, label %161
159: ; preds = %151
%160 = trunc i64 %152 to i32
br label %161
161: ; preds = %156, %159
%162 = phi i32 [ %160, %159 ], [ %150, %156 ]
%163 = icmp sgt i32 %162, %141
br i1 %163, label %164, label %182
164: ; preds = %161
%165 = sub nsw i32 %162, %141
%166 = icmp slt i32 %165, 127
%167 = select i1 %166, i32 %165, i32 127
%168 = call i32 @stbiw__write_run_data(i32* %0, i32 %167, i8 zeroext %147)
%169 = add nsw i32 %167, %141
%170 = icmp sgt i32 %162, %169
br i1 %170, label %171, label %182
171: ; preds = %164, %171
%172 = phi i32 [ %180, %171 ], [ %169, %164 ]
%173 = sext i32 %172 to i64
%174 = getelementptr inbounds i8, i8* %99, i64 %173
%175 = load i8, i8* %174
%176 = sub nsw i32 %162, %172
%177 = icmp slt i32 %176, 127
%178 = select i1 %177, i32 %176, i32 127
%179 = call i32 @stbiw__write_run_data(i32* %0, i32 %178, i8 zeroext %175)
%180 = add nsw i32 %178, %172
%181 = icmp sgt i32 %162, %180
br i1 %181, label %171, label %182
182: ; preds = %171, %164, %161, %140
%183 = phi i32 [ %141, %140 ], [ %141, %161 ], [ %169, %164 ], [ %180, %171 ]
%184 = icmp slt i32 %183, %1
br i1 %184, label %100, label %185
185: ; preds = %182
%186 = add nuw nsw i64 %97, 1
%187 = icmp eq i64 %186, 4
br i1 %187, label %188, label %96
188: ; preds = %185, %58, %34
ret void
}