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

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int gamma_correct(int, float);
void scale_image_box(unsigned char *dst, int dw, int dh, unsigned char *src,
                     int sw, int sh, int bpp, int gc, float gamma) {
  int x, y, n, ix, iy, v;
  int dstride = dw * bpp;
  unsigned char *s;
  float invgamma;
  if (gc) {
    invgamma = 1.0f / gamma;
    for (y = 0; y < dh; ++y) {
      iy = ((y * sh + sh / 2) / dh) - 1;
      if (iy < 0)
        iy = 0;
      for (x = 0; x < dw; ++x) {
        ix = ((x * sw + sw / 2) / dw) - 1;
        if (ix < 0)
          ix = 0;
        s = src + (iy * sw + ix) * bpp;
        for (n = 0; n < bpp; ++n) {
          v = (gamma_correct(s[0], gamma) + gamma_correct(s[bpp], gamma) +
               gamma_correct(s[sw * bpp], gamma) +
               gamma_correct(s[(sw + 1) * bpp], gamma)) >>
              2;
          dst[(y * dstride) + (x * bpp) + n] = gamma_correct(v, invgamma);
          ++s;
        }
      }
    }
  } else {
    for (y = 0; y < dh; ++y) {
      iy = ((y * sh + sh / 2) / dh) - 1;
      if (iy < 0)
        iy = 0;
      for (x = 0; x < dw; ++x) {
        ix = ((x * sw + sw / 2) / dw) - 1;
        if (ix < 0)
          ix = 0;
        s = src + (iy * sw + ix) * bpp;
        for (n = 0; n < bpp; ++n) {
          v = (s[0] + s[bpp] + s[sw * bpp] + s[(sw + 1) * bpp]) >> 2;
          dst[(y * dstride) + (x * bpp) + n] = v;
          ++s;
        }
      }
    }
  }
}


x86 assembly (clang, -O0):
<scale_image_box>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
movss  %xmm0,-0x24(%rbp)
mov    -0xc(%rbp),%eax
imul   0x10(%rbp),%eax
mov    %eax,-0x40(%rbp)
cmpl   $0x0,0x18(%rbp)
je     1319 <scale_image_box+0x209>
movss  0xeab(%rip),%xmm0
divss  -0x24(%rbp),%xmm0
movss  %xmm0,-0x4c(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1314 <scale_image_box+0x204>
mov    -0x2c(%rbp),%eax
imul   -0x20(%rbp),%eax
mov    %eax,-0x50(%rbp)
mov    -0x20(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x50(%rbp),%eax
add    %ecx,%eax
cltd
idivl  -0x10(%rbp)
sub    $0x1,%eax
mov    %eax,-0x38(%rbp)
cmpl   $0x0,-0x38(%rbp)
jge    11a9 <scale_image_box+0x99>
movl   $0x0,-0x38(%rbp)
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1301 <scale_image_box+0x1f1>
mov    -0x28(%rbp),%eax
imul   -0x1c(%rbp),%eax
mov    %eax,-0x54(%rbp)
mov    -0x1c(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x54(%rbp),%eax
add    %ecx,%eax
cltd
idivl  -0xc(%rbp)
sub    $0x1,%eax
mov    %eax,-0x34(%rbp)
cmpl   $0x0,-0x34(%rbp)
jge    11f3 <scale_image_box+0xe3>
movl   $0x0,-0x34(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x38(%rbp),%ecx
imul   -0x1c(%rbp),%ecx
add    -0x34(%rbp),%ecx
imul   0x10(%rbp),%ecx
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x48(%rbp)
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    0x10(%rbp),%eax
jge    12ee <scale_image_box+0x1de>
mov    -0x48(%rbp),%rax
movzbl (%rax),%edi
movss  -0x24(%rbp),%xmm0
call   1030 <gamma_correct@plt>
mov    %eax,-0x60(%rbp)
mov    -0x48(%rbp),%rax
movslq 0x10(%rbp),%rcx
movzbl (%rax,%rcx,1),%edi
movss  -0x24(%rbp),%xmm0
call   1030 <gamma_correct@plt>
mov    %eax,%ecx
mov    -0x60(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x5c(%rbp)
mov    -0x48(%rbp),%rax
mov    -0x1c(%rbp),%ecx
imul   0x10(%rbp),%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%edi
movss  -0x24(%rbp),%xmm0
call   1030 <gamma_correct@plt>
mov    %eax,%ecx
mov    -0x5c(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x58(%rbp)
mov    -0x48(%rbp),%rax
mov    -0x1c(%rbp),%ecx
add    $0x1,%ecx
imul   0x10(%rbp),%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%edi
movss  -0x24(%rbp),%xmm0
call   1030 <gamma_correct@plt>
mov    %eax,%ecx
mov    -0x58(%rbp),%eax
add    %ecx,%eax
sar    $0x2,%eax
mov    %eax,-0x3c(%rbp)
mov    -0x3c(%rbp),%edi
movss  -0x4c(%rbp),%xmm0
call   1030 <gamma_correct@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
mov    -0x2c(%rbp),%ecx
imul   -0x40(%rbp),%ecx
mov    -0x28(%rbp),%esi
imul   0x10(%rbp),%esi
add    %esi,%ecx
add    -0x30(%rbp),%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x48(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x48(%rbp)
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    1216 <scale_image_box+0x106>
jmp    12f3 <scale_image_box+0x1e3>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    11b0 <scale_image_box+0xa0>
jmp    1306 <scale_image_box+0x1f6>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1166 <scale_image_box+0x56>
jmp    1489 <scale_image_box+0x379>
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1484 <scale_image_box+0x374>
mov    -0x2c(%rbp),%eax
imul   -0x20(%rbp),%eax
mov    %eax,-0x64(%rbp)
mov    -0x20(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x64(%rbp),%eax
add    %ecx,%eax
cltd
idivl  -0x10(%rbp)
sub    $0x1,%eax
mov    %eax,-0x38(%rbp)
cmpl   $0x0,-0x38(%rbp)
jge    1363 <scale_image_box+0x253>
movl   $0x0,-0x38(%rbp)
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1471 <scale_image_box+0x361>
mov    -0x28(%rbp),%eax
imul   -0x1c(%rbp),%eax
mov    %eax,-0x68(%rbp)
mov    -0x1c(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x68(%rbp),%eax
add    %ecx,%eax
cltd
idivl  -0xc(%rbp)
sub    $0x1,%eax
mov    %eax,-0x34(%rbp)
cmpl   $0x0,-0x34(%rbp)
jge    13ad <scale_image_box+0x29d>
movl   $0x0,-0x34(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x38(%rbp),%ecx
imul   -0x1c(%rbp),%ecx
add    -0x34(%rbp),%ecx
imul   0x10(%rbp),%ecx
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x48(%rbp)
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    0x10(%rbp),%eax
jge    145e <scale_image_box+0x34e>
mov    -0x48(%rbp),%rax
movzbl (%rax),%eax
mov    -0x48(%rbp),%rcx
movslq 0x10(%rbp),%rdx
movzbl (%rcx,%rdx,1),%ecx
add    %ecx,%eax
mov    -0x48(%rbp),%rcx
mov    -0x1c(%rbp),%edx
imul   0x10(%rbp),%edx
movslq %edx,%rdx
movzbl (%rcx,%rdx,1),%ecx
add    %ecx,%eax
mov    -0x48(%rbp),%rcx
mov    -0x1c(%rbp),%edx
add    $0x1,%edx
imul   0x10(%rbp),%edx
movslq %edx,%rdx
movzbl (%rcx,%rdx,1),%ecx
add    %ecx,%eax
sar    $0x2,%eax
mov    %eax,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
mov    %al,%dl
mov    -0x8(%rbp),%rax
mov    -0x2c(%rbp),%ecx
imul   -0x40(%rbp),%ecx
mov    -0x28(%rbp),%esi
imul   0x10(%rbp),%esi
add    %esi,%ecx
add    -0x30(%rbp),%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x48(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x48(%rbp)
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    13d0 <scale_image_box+0x2c0>
jmp    1463 <scale_image_box+0x353>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    136a <scale_image_box+0x25a>
jmp    1476 <scale_image_box+0x366>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1320 <scale_image_box+0x210>
jmp    1489 <scale_image_box+0x379>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scale_image_box>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x118,%rsp
mov    %r9d,0x14(%rsp)
mov    %r8,0x28(%rsp)
mov    %rcx,0x50(%rsp)
mov    %edx,%ebp
mov    %rdi,0x30(%rsp)
mov    0x150(%rsp),%eax
mov    %esi,0x4(%rsp)
imul   %esi,%eax
cmpl   $0x0,0x158(%rsp)
mov    %edx,0x3c(%rsp)
je     138c <scale_image_box+0x27c>
test   %ebp,%ebp
jle    197e <scale_image_box+0x86e>
movss  0xe99(%rip),%xmm1
divss  %xmm0,%xmm1
movss  %xmm1,0xa8(%rsp)
mov    0x14(%rsp),%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
add    %ecx,%edx
sar    %edx
mov    %edx,0x78(%rsp)
mov    0x28(%rsp),%rdx
mov    %edx,%ecx
shr    $0x1f,%ecx
add    %edx,%ecx
sar    %ecx
mov    %ecx,0x98(%rsp)
mov    0x150(%rsp),%esi
movslq %esi,%rdi
mov    %esi,%ecx
imul   %edx,%ecx
movslq %ecx,%rbx
lea    0x1(%rdx),%ecx
imul   %esi,%ecx
movslq %ecx,%rcx
cltq
mov    %rax,0x70(%rsp)
mov    %ebp,%eax
mov    %rax,0x68(%rsp)
mov    0x4(%rsp),%eax
mov    %rax,0x90(%rsp)
mov    %edi,%r14d
mov    0x50(%rsp),%rax
mov    %rdi,0x18(%rsp)
lea    (%rax,%rdi,1),%rdx
mov    %rdx,0x88(%rsp)
add    %rax,%rbx
mov    %rbx,0x48(%rsp)
add    %rax,%rcx
mov    %rcx,0x40(%rsp)
xor    %ecx,%ecx
movss  %xmm0,0x8(%rsp)
jmp    1235 <scale_image_box+0x125>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    0x80(%rsp),%rcx
add    $0x1,%rcx
mov    0x70(%rsp),%rax
add    %rax,0x30(%rsp)
cmp    0x68(%rsp),%rcx
mov    0x3c(%rsp),%ebp
je     197e <scale_image_box+0x86e>
mov    %rcx,0x80(%rsp)
mov    %ecx,%eax
imul   0x14(%rsp),%eax
add    0x78(%rsp),%eax
cltd
idiv   %ebp
cmpl   $0x0,0x4(%rsp)
jle    1210 <scale_image_box+0x100>
mov    %eax,%ecx
test   %eax,%eax
mov    $0x1,%eax
cmovle %eax,%ecx
add    $0xffffffff,%ecx
imul   0x28(%rsp),%ecx
add    $0xffffffff,%ecx
mov    %ecx,(%rsp)
mov    0x30(%rsp),%rbp
xor    %eax,%eax
jmp    129f <scale_image_box+0x18f>
cs nopw 0x0(%rax,%rax,1)
nop
mov    0xa0(%rsp),%rax
add    $0x1,%rax
add    0x18(%rsp),%rbp
cmp    0x90(%rsp),%rax
je     1210 <scale_image_box+0x100>
mov    %rax,0xa0(%rsp)
imul   0x28(%rsp),%eax
add    0x98(%rsp),%eax
cltd
idivl  0x4(%rsp)
cmpl   $0x0,0x150(%rsp)
jle    1280 <scale_image_box+0x170>
test   %eax,%eax
mov    $0x1,%ecx
cmovle %ecx,%eax
add    (%rsp),%eax
imul   0x150(%rsp),%eax
movslq %eax,%r13
mov    0x50(%rsp),%rax
add    %r13,%rax
mov    %rax,0x58(%rsp)
mov    0x88(%rsp),%rax
add    %r13,%rax
mov    %rax,0x20(%rsp)
mov    0x48(%rsp),%rax
lea    (%rax,%r13,1),%r12
add    0x40(%rsp),%r13
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
mov    0x58(%rsp),%rax
movzbl (%rax,%rbx,1),%edi
movss  0x8(%rsp),%xmm0
call   1030 <gamma_correct@plt>
mov    %eax,%r15d
mov    0x20(%rsp),%rax
movzbl (%rax,%rbx,1),%edi
movss  0x8(%rsp),%xmm0
call   1030 <gamma_correct@plt>
add    %eax,%r15d
movzbl (%r12,%rbx,1),%edi
movss  0x8(%rsp),%xmm0
call   1030 <gamma_correct@plt>
add    %eax,%r15d
movzbl 0x0(%r13,%rbx,1),%edi
movss  0x8(%rsp),%xmm0
call   1030 <gamma_correct@plt>
add    %eax,%r15d
sar    $0x2,%r15d
mov    %r15d,%edi
movss  0xa8(%rsp),%xmm0
call   1030 <gamma_correct@plt>
mov    %al,0x0(%rbp,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1310 <scale_image_box+0x200>
jmp    1280 <scale_image_box+0x170>
test   %ebp,%ebp
jle    197e <scale_image_box+0x86e>
mov    0x14(%rsp),%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
add    %ecx,%edx
sar    %edx
mov    %edx,0xb4(%rsp)
mov    0x28(%rsp),%rdx
mov    %edx,%r9d
shr    $0x1f,%r9d
add    %edx,%r9d
sar    %r9d
mov    0x150(%rsp),%esi
movslq %esi,%rdi
mov    %esi,%ecx
imul   %edx,%ecx
movslq %ecx,%rbx
lea    0x1(%rdx),%ecx
imul   %esi,%ecx
movslq %ecx,%rcx
cltq
mov    %rax,0xc8(%rsp)
mov    %ebp,%eax
mov    %rax,0xe0(%rsp)
mov    0x4(%rsp),%eax
mov    %rax,0xa8(%rsp)
mov    %esi,%edx
lea    (%rcx,%rdx,1),%rsi
mov    0x50(%rsp),%rax
add    %rax,%rsi
mov    %rsi,0x80(%rsp)
lea    (%rbx,%rdx,1),%rsi
add    %rax,%rsi
mov    %rsi,0x78(%rsp)
lea    (%rdi,%rdx,1),%rsi
add    %rax,%rsi
mov    %rsi,0x70(%rsp)
mov    %edx,%esi
and    $0xfffffff0,%esi
mov    %rsi,0x60(%rsp)
mov    %edx,%esi
and    $0xfffffff8,%esi
mov    %rsi,0xd8(%rsp)
mov    %rdx,%rsi
neg    %rsi
mov    %rsi,0x90(%rsp)
pxor   %xmm0,%xmm0
movdqa 0xbbc(%rip),%xmm1
lea    (%rax,%rcx,1),%rsi
mov    %rsi,0x68(%rsp)
lea    (%rax,%rbx,1),%rsi
mov    %rsi,0x110(%rsp)
lea    (%rax,%rdi,1),%rsi
mov    %rsi,0x108(%rsp)
mov    %rdx,0x20(%rsp)
lea    (%rax,%rdx,1),%rax
mov    %rax,0x100(%rsp)
mov    0x30(%rsp),%rax
lea    0x1(%rax),%rdx
mov    %rdx,0xc0(%rsp)
lea    0x1(%rdi),%rdx
mov    %rdx,0xf8(%rsp)
mov    %rbx,0x48(%rsp)
lea    0x1(%rbx),%rdx
mov    %rdx,0xf0(%rsp)
mov    %rcx,0x40(%rsp)
add    $0x1,%rcx
mov    %rcx,0xe8(%rsp)
xor    %ecx,%ecx
mov    %rax,0xb8(%rsp)
mov    %r9d,(%rsp)
mov    %rdi,0x8(%rsp)
jmp    1516 <scale_image_box+0x406>
nopw   0x0(%rax,%rax,1)
mov    0xd0(%rsp),%rcx
add    $0x1,%rcx
mov    0xc8(%rsp),%rax
add    %rax,0xb8(%rsp)
add    %rax,0xc0(%rsp)
cmp    0xe0(%rsp),%rcx
mov    0x3c(%rsp),%ebp
je     197e <scale_image_box+0x86e>
mov    %rcx,0xd0(%rsp)
mov    %ecx,%eax
imul   0x14(%rsp),%eax
add    0xb4(%rsp),%eax
cltd
idiv   %ebp
cmpl   $0x0,0x4(%rsp)
jle    14e0 <scale_image_box+0x3d0>
mov    %eax,%ecx
mov    0xd0(%rsp),%rdx
imul   0xc8(%rsp),%rdx
mov    0x20(%rsp),%rax
mov    %rdx,0x98(%rsp)
add    %rdx,%rax
mov    %rax,0x88(%rsp)
test   %ecx,%ecx
mov    $0x1,%eax
cmovle %eax,%ecx
add    $0xffffffff,%ecx
imul   0x28(%rsp),%ecx
add    $0xffffffff,%ecx
mov    %ecx,0xa0(%rsp)
mov    0xc0(%rsp),%rax
mov    %rax,0x58(%rsp)
mov    0xb8(%rsp),%r14
xor    %r15d,%r15d
jmp    15bf <scale_image_box+0x4af>
nopw   0x0(%rax,%rax,1)
add    $0x1,%r15
mov    0x8(%rsp),%rdi
add    %rdi,%r14
add    %rdi,0x58(%rsp)
cmp    0xa8(%rsp),%r15
je     14e0 <scale_image_box+0x3d0>
mov    %r15d,%eax
imul   0x28(%rsp),%eax
add    %r9d,%eax
cltd
idivl  0x4(%rsp)
cmpl   $0x0,0x150(%rsp)
jle    15a0 <scale_image_box+0x490>
mov    %r15,%rbp
imul   0x8(%rsp),%rbp
mov    0x98(%rsp),%rcx
lea    (%rcx,%rbp,1),%rsi
test   %eax,%eax
mov    $0x1,%ecx
cmovle %ecx,%eax
add    0xa0(%rsp),%eax
mov    0x150(%rsp),%edx
imul   %edx,%eax
cltq
mov    0x50(%rsp),%rcx
lea    (%rcx,%rax,1),%r8
cmp    $0x8,%edx
jae    1680 <scale_image_box+0x570>
xor    %ebp,%ebp
mov    %r8,%r13
testb  $0x1,0x20(%rsp)
je     18bb <scale_image_box+0x7ab>
movzbl 0x0(%r13),%ecx
mov    0x8(%rsp),%rax
movzbl 0x0(%r13,%rax,1),%edx
add    %ecx,%edx
mov    0x48(%rsp),%rax
movzbl 0x0(%r13,%rax,1),%ecx
add    %edx,%ecx
mov    0x40(%rsp),%rax
movzbl 0x0(%r13,%rax,1),%edx
add    %ecx,%edx
shr    $0x2,%edx
add    %rbp,%rsi
mov    0x30(%rsp),%rax
mov    %dl,(%rax,%rsi,1)
add    $0x1,%r13
mov    %rbp,%rdx
or     $0x1,%rdx
jmp    18be <scale_image_box+0x7ae>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    0x30(%rsp),%rcx
mov    %rsi,0x18(%rsp)
add    %rcx,%rsi
add    0x88(%rsp),%rbp
add    %rcx,%rbp
mov    0x68(%rsp),%rcx
lea    (%rcx,%rax,1),%r11
mov    0x80(%rsp),%rcx
add    %rax,%rcx
mov    0x110(%rsp),%rdx
lea    (%rdx,%rax,1),%r10
mov    0x78(%rsp),%rdx
add    %rax,%rdx
mov    0x108(%rsp),%rdi
lea    (%rdi,%rax,1),%r12
mov    0x70(%rsp),%rdi
add    %rax,%rdi
add    0x100(%rsp),%rax
cmp    %rcx,%rsi
setb   %r13b
cmp    %rbp,%r11
setb   %r9b
cmp    %rdx,%rsi
setb   %cl
cmp    %rbp,%r10
setb   %dl
cmp    %rdi,%rsi
setb   %bl
cmp    %rbp,%r12
setb   %dil
cmp    %rax,%rsi
setb   %al
cmp    %rbp,%r8
setb   %sil
test   %r9b,%r13b
jne    1960 <scale_image_box+0x850>
and    %dl,%cl
jne    1960 <scale_image_box+0x850>
and    %dil,%bl
mov    (%rsp),%r9d
jne    1745 <scale_image_box+0x635>
and    %sil,%al
jne    1745 <scale_image_box+0x635>
cmpl   $0x10,0x150(%rsp)
10
jae    174f <scale_image_box+0x63f>
xor    %ebx,%ebx
mov    0x18(%rsp),%rsi
jmp    1821 <scale_image_box+0x711>
xor    %ebp,%ebp
mov    %r8,%r13
jmp    1969 <scale_image_box+0x859>
mov    %r8,%rax
xor    %ebp,%ebp
mov    0x8(%rsp),%rcx
mov    0x48(%rsp),%rdx
mov    0x40(%rsp),%rsi
mov    0x60(%rsp),%rdi
nopl   0x0(%rax,%rax,1)
movdqu (%rax),%xmm2
movdqa %xmm2,%xmm3
punpcklbw %xmm0,%xmm3
punpckhbw %xmm0,%xmm2
movdqu (%rax,%rcx,1),%xmm4
movdqa %xmm4,%xmm5
punpcklbw %xmm0,%xmm5
paddw  %xmm3,%xmm5
punpckhbw %xmm0,%xmm4
paddw  %xmm2,%xmm4
movdqu (%rax,%rdx,1),%xmm2
movdqa %xmm2,%xmm3
punpckhbw %xmm0,%xmm3
punpcklbw %xmm0,%xmm2
movdqu (%rax,%rsi,1),%xmm6
movdqa %xmm6,%xmm7
punpcklbw %xmm0,%xmm7
paddw  %xmm2,%xmm7
paddw  %xmm5,%xmm7
punpckhbw %xmm0,%xmm6
paddw  %xmm3,%xmm6
paddw  %xmm4,%xmm6
psrlw  $0x2,%xmm7
psrlw  $0x2,%xmm6
pand   %xmm1,%xmm6
pand   %xmm1,%xmm7
packuswb %xmm6,%xmm7
movdqu %xmm7,(%r14,%rbp,1)
add    $0x10,%rbp
add    $0x10,%rax
cmp    %rbp,%rdi
jne    1770 <scale_image_box+0x660>
cmp    0x20(%rsp),%rdi
mov    0x18(%rsp),%rsi
je     15a0 <scale_image_box+0x490>
mov    0x60(%rsp),%rbx
testb  $0x8,0x20(%rsp)
jne    1821 <scale_image_box+0x711>
mov    0x60(%rsp),%rbp
add    %rbp,%r8
jmp    161b <scale_image_box+0x50b>
mov    0xd8(%rsp),%rbp
lea    (%r8,%rbp,1),%r13
mov    %r14,%r9
movq   (%r8,%rbx,1),%xmm2
punpcklbw %xmm0,%xmm2
movq   (%r12,%rbx,1),%xmm3
punpcklbw %xmm0,%xmm3
paddw  %xmm2,%xmm3
movq   (%r10,%rbx,1),%xmm2
punpcklbw %xmm0,%xmm2
movq   (%r11,%rbx,1),%xmm4
punpcklbw %xmm0,%xmm4
paddw  %xmm2,%xmm4
paddw  %xmm3,%xmm4
psrlw  $0x2,%xmm4
pand   %xmm1,%xmm4
packuswb %xmm4,%xmm4
movq   %xmm4,(%r9,%rbx,1)
add    $0x8,%r8
add    $0x8,%r11
add    $0x8,%r10
add    $0x8,%r12
add    $0x8,%r9
add    $0xfffffffffffffff8,%rbp
cmp    %rbp,%rbx
jne    1830 <scale_image_box+0x720>
mov    0xd8(%rsp),%rax
mov    %rax,%rbp
cmp    0x20(%rsp),%rax
mov    (%rsp),%r9d
je     15a0 <scale_image_box+0x490>
xchg   %ax,%ax
testb  $0x1,0x20(%rsp)
jne    1629 <scale_image_box+0x519>
mov    %rbp,%rdx
not    %rbp
cmp    0x90(%rsp),%rbp
je     15a0 <scale_image_box+0x490>
mov    0x20(%rsp),%r8
sub    %rdx,%r8
add    0x58(%rsp),%rdx
mov    0xf8(%rsp),%rax
lea    (%rax,%r13,1),%rbx
mov    0xf0(%rsp),%rax
lea    (%rax,%r13,1),%rcx
mov    0xe8(%rsp),%rax
lea    (%rax,%r13,1),%rsi
xor    %edi,%edi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl 0x0(%r13,%rdi,1),%eax
movzbl -0x1(%rbx,%rdi,1),%ebp
add    %eax,%ebp
movzbl -0x1(%rcx,%rdi,1),%eax
add    %ebp,%eax
movzbl -0x1(%rsi,%rdi,1),%ebp
add    %eax,%ebp
shr    $0x2,%ebp
mov    %bpl,-0x1(%rdx,%rdi,1)
movzbl 0x1(%r13,%rdi,1),%eax
movzbl (%rbx,%rdi,1),%ebp
add    %eax,%ebp
movzbl (%rcx,%rdi,1),%eax
add    %ebp,%eax
movzbl (%rsi,%rdi,1),%ebp
add    %eax,%ebp
shr    $0x2,%ebp
mov    %bpl,(%rdx,%rdi,1)
add    $0x2,%rdi
cmp    %rdi,%r8
jne    1910 <scale_image_box+0x800>
jmp    15a0 <scale_image_box+0x490>
xor    %ebp,%ebp
mov    %r8,%r13
mov    (%rsp),%r9d
mov    0x18(%rsp),%rsi
testb  $0x1,0x20(%rsp)
jne    1629 <scale_image_box+0x519>
jmp    18bb <scale_image_box+0x7ab>
add    $0x118,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @scale_image_box(i8* %0, i32 %1, i32 %2, i8* %3, i32 %4, i32 %5, i32 %6, i32 %7, float %8) {
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i8*
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca float
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
%24 = alloca i32
%25 = alloca i32
%26 = alloca i8*
%27 = alloca float
store i8* %0, i8** %10
store i32 %1, i32* %11
store i32 %2, i32* %12
store i8* %3, i8** %13
store i32 %4, i32* %14
store i32 %5, i32* %15
store i32 %6, i32* %16
store i32 %7, i32* %17
store float %8, float* %18
%28 = load i32, i32* %11
%29 = load i32, i32* %16
%30 = mul nsw i32 %28, %29
store i32 %30, i32* %25
%31 = load i32, i32* %17
%32 = icmp ne i32 %31, 0
br i1 %32, label %33, label %156
33: ; preds = %9
%34 = load float, float* %18
%35 = fdiv float 1.000000e+00, %34
store float %35, float* %27
store i32 0, i32* %20
br label %36
36: ; preds = %152, %33
%37 = load i32, i32* %20
%38 = load i32, i32* %12
%39 = icmp slt i32 %37, %38
br i1 %39, label %40, label %155
40: ; preds = %36
%41 = load i32, i32* %20
%42 = load i32, i32* %15
%43 = mul nsw i32 %41, %42
%44 = load i32, i32* %15
%45 = sdiv i32 %44, 2
%46 = add nsw i32 %43, %45
%47 = load i32, i32* %12
%48 = sdiv i32 %46, %47
%49 = sub nsw i32 %48, 1
store i32 %49, i32* %23
%50 = load i32, i32* %23
%51 = icmp slt i32 %50, 0
br i1 %51, label %52, label %53
52: ; preds = %40
store i32 0, i32* %23
br label %53
53: ; preds = %52, %40
store i32 0, i32* %19
br label %54
54: ; preds = %148, %53
%55 = load i32, i32* %19
%56 = load i32, i32* %11
%57 = icmp slt i32 %55, %56
br i1 %57, label %58, label %151
58: ; preds = %54
%59 = load i32, i32* %19
%60 = load i32, i32* %14
%61 = mul nsw i32 %59, %60
%62 = load i32, i32* %14
%63 = sdiv i32 %62, 2
%64 = add nsw i32 %61, %63
%65 = load i32, i32* %11
%66 = sdiv i32 %64, %65
%67 = sub nsw i32 %66, 1
store i32 %67, i32* %22
%68 = load i32, i32* %22
%69 = icmp slt i32 %68, 0
br i1 %69, label %70, label %71
70: ; preds = %58
store i32 0, i32* %22
br label %71
71: ; preds = %70, %58
%72 = load i8*, i8** %13
%73 = load i32, i32* %23
%74 = load i32, i32* %14
%75 = mul nsw i32 %73, %74
%76 = load i32, i32* %22
%77 = add nsw i32 %75, %76
%78 = load i32, i32* %16
%79 = mul nsw i32 %77, %78
%80 = sext i32 %79 to i64
%81 = getelementptr inbounds i8, i8* %72, i64 %80
store i8* %81, i8** %26
store i32 0, i32* %21
br label %82
82: ; preds = %144, %71
%83 = load i32, i32* %21
%84 = load i32, i32* %16
%85 = icmp slt i32 %83, %84
br i1 %85, label %86, label %147
86: ; preds = %82
%87 = load i8*, i8** %26
%88 = getelementptr inbounds i8, i8* %87, i64 0
%89 = load i8, i8* %88
%90 = zext i8 %89 to i32
%91 = load float, float* %18
%92 = call i32 @gamma_correct(i32 %90, float %91)
%93 = load i8*, i8** %26
%94 = load i32, i32* %16
%95 = sext i32 %94 to i64
%96 = getelementptr inbounds i8, i8* %93, i64 %95
%97 = load i8, i8* %96
%98 = zext i8 %97 to i32
%99 = load float, float* %18
%100 = call i32 @gamma_correct(i32 %98, float %99)
%101 = add nsw i32 %92, %100
%102 = load i8*, i8** %26
%103 = load i32, i32* %14
%104 = load i32, i32* %16
%105 = mul nsw i32 %103, %104
%106 = sext i32 %105 to i64
%107 = getelementptr inbounds i8, i8* %102, i64 %106
%108 = load i8, i8* %107
%109 = zext i8 %108 to i32
%110 = load float, float* %18
%111 = call i32 @gamma_correct(i32 %109, float %110)
%112 = add nsw i32 %101, %111
%113 = load i8*, i8** %26
%114 = load i32, i32* %14
%115 = add nsw i32 %114, 1
%116 = load i32, i32* %16
%117 = mul nsw i32 %115, %116
%118 = sext i32 %117 to i64
%119 = getelementptr inbounds i8, i8* %113, i64 %118
%120 = load i8, i8* %119
%121 = zext i8 %120 to i32
%122 = load float, float* %18
%123 = call i32 @gamma_correct(i32 %121, float %122)
%124 = add nsw i32 %112, %123
%125 = ashr i32 %124, 2
store i32 %125, i32* %24
%126 = load i32, i32* %24
%127 = load float, float* %27
%128 = call i32 @gamma_correct(i32 %126, float %127)
%129 = trunc i32 %128 to i8
%130 = load i8*, i8** %10
%131 = load i32, i32* %20
%132 = load i32, i32* %25
%133 = mul nsw i32 %131, %132
%134 = load i32, i32* %19
%135 = load i32, i32* %16
%136 = mul nsw i32 %134, %135
%137 = add nsw i32 %133, %136
%138 = load i32, i32* %21
%139 = add nsw i32 %137, %138
%140 = sext i32 %139 to i64
%141 = getelementptr inbounds i8, i8* %130, i64 %140
store i8 %129, i8* %141
%142 = load i8*, i8** %26
%143 = getelementptr inbounds i8, i8* %142, i32 1
store i8* %143, i8** %26
br label %144
144: ; preds = %86
%145 = load i32, i32* %21
%146 = add nsw i32 %145, 1
store i32 %146, i32* %21
br label %82
147: ; preds = %82
br label %148
148: ; preds = %147
%149 = load i32, i32* %19
%150 = add nsw i32 %149, 1
store i32 %150, i32* %19
br label %54
151: ; preds = %54
br label %152
152: ; preds = %151
%153 = load i32, i32* %20
%154 = add nsw i32 %153, 1
store i32 %154, i32* %20
br label %36
155: ; preds = %36
br label %267
156: ; preds = %9
store i32 0, i32* %20
br label %157
157: ; preds = %263, %156
%158 = load i32, i32* %20
%159 = load i32, i32* %12
%160 = icmp slt i32 %158, %159
br i1 %160, label %161, label %266
161: ; preds = %157
%162 = load i32, i32* %20
%163 = load i32, i32* %15
%164 = mul nsw i32 %162, %163
%165 = load i32, i32* %15
%166 = sdiv i32 %165, 2
%167 = add nsw i32 %164, %166
%168 = load i32, i32* %12
%169 = sdiv i32 %167, %168
%170 = sub nsw i32 %169, 1
store i32 %170, i32* %23
%171 = load i32, i32* %23
%172 = icmp slt i32 %171, 0
br i1 %172, label %173, label %174
173: ; preds = %161
store i32 0, i32* %23
br label %174
174: ; preds = %173, %161
store i32 0, i32* %19
br label %175
175: ; preds = %259, %174
%176 = load i32, i32* %19
%177 = load i32, i32* %11
%178 = icmp slt i32 %176, %177
br i1 %178, label %179, label %262
179: ; preds = %175
%180 = load i32, i32* %19
%181 = load i32, i32* %14
%182 = mul nsw i32 %180, %181
%183 = load i32, i32* %14
%184 = sdiv i32 %183, 2
%185 = add nsw i32 %182, %184
%186 = load i32, i32* %11
%187 = sdiv i32 %185, %186
%188 = sub nsw i32 %187, 1
store i32 %188, i32* %22
%189 = load i32, i32* %22
%190 = icmp slt i32 %189, 0
br i1 %190, label %191, label %192
191: ; preds = %179
store i32 0, i32* %22
br label %192
192: ; preds = %191, %179
%193 = load i8*, i8** %13
%194 = load i32, i32* %23
%195 = load i32, i32* %14
%196 = mul nsw i32 %194, %195
%197 = load i32, i32* %22
%198 = add nsw i32 %196, %197
%199 = load i32, i32* %16
%200 = mul nsw i32 %198, %199
%201 = sext i32 %200 to i64
%202 = getelementptr inbounds i8, i8* %193, i64 %201
store i8* %202, i8** %26
store i32 0, i32* %21
br label %203
203: ; preds = %255, %192
%204 = load i32, i32* %21
%205 = load i32, i32* %16
%206 = icmp slt i32 %204, %205
br i1 %206, label %207, label %258
207: ; preds = %203
%208 = load i8*, i8** %26
%209 = getelementptr inbounds i8, i8* %208, i64 0
%210 = load i8, i8* %209
%211 = zext i8 %210 to i32
%212 = load i8*, i8** %26
%213 = load i32, i32* %16
%214 = sext i32 %213 to i64
%215 = getelementptr inbounds i8, i8* %212, i64 %214
%216 = load i8, i8* %215
%217 = zext i8 %216 to i32
%218 = add nsw i32 %211, %217
%219 = load i8*, i8** %26
%220 = load i32, i32* %14
%221 = load i32, i32* %16
%222 = mul nsw i32 %220, %221
%223 = sext i32 %222 to i64
%224 = getelementptr inbounds i8, i8* %219, i64 %223
%225 = load i8, i8* %224
%226 = zext i8 %225 to i32
%227 = add nsw i32 %218, %226
%228 = load i8*, i8** %26
%229 = load i32, i32* %14
%230 = add nsw i32 %229, 1
%231 = load i32, i32* %16
%232 = mul nsw i32 %230, %231
%233 = sext i32 %232 to i64
%234 = getelementptr inbounds i8, i8* %228, i64 %233
%235 = load i8, i8* %234
%236 = zext i8 %235 to i32
%237 = add nsw i32 %227, %236
%238 = ashr i32 %237, 2
store i32 %238, i32* %24
%239 = load i32, i32* %24
%240 = trunc i32 %239 to i8
%241 = load i8*, i8** %10
%242 = load i32, i32* %20
%243 = load i32, i32* %25
%244 = mul nsw i32 %242, %243
%245 = load i32, i32* %19
%246 = load i32, i32* %16
%247 = mul nsw i32 %245, %246
%248 = add nsw i32 %244, %247
%249 = load i32, i32* %21
%250 = add nsw i32 %248, %249
%251 = sext i32 %250 to i64
%252 = getelementptr inbounds i8, i8* %241, i64 %251
store i8 %240, i8* %252
%253 = load i8*, i8** %26
%254 = getelementptr inbounds i8, i8* %253, i32 1
store i8* %254, i8** %26
br label %255
255: ; preds = %207
%256 = load i32, i32* %21
%257 = add nsw i32 %256, 1
store i32 %257, i32* %21
br label %203
258: ; preds = %203
br label %259
259: ; preds = %258
%260 = load i32, i32* %19
%261 = add nsw i32 %260, 1
store i32 %261, i32* %19
br label %175
262: ; preds = %175
br label %263
263: ; preds = %262
%264 = load i32, i32* %20
%265 = add nsw i32 %264, 1
store i32 %265, i32* %20
br label %157
266: ; preds = %157
br label %267
267: ; preds = %266, %155
ret void
}

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