#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);
int icerp(int, int, int, int, int);
void scale_image_bicubic(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, wx, wy, v;
  int a, b, c, d;
  int dstride = dw * bpp;
  unsigned char *s;
  float invgamma;
  if (gc) {
    invgamma = 1.0 / gamma;
    for (y = 0; y < dh; ++y) {
      if (dh > 1) {
        iy = (((sh - 1) * y) << 7) / (dh - 1);
        if (y == dh - 1)
          --iy;
        wy = iy & 0x7f;
        iy >>= 7;
      } else
        iy = wy = 0;
      for (x = 0; x < dw; ++x) {
        if (dw > 1) {
          ix = (((sw - 1) * x) << 7) / (dw - 1);
          if (x == dw - 1)
            --ix;
          wx = ix & 0x7f;
          ix >>= 7;
        } else
          ix = wx = 0;
        s = src + ((iy - 1) * sw + (ix - 1)) * bpp;
        for (n = 0; n < bpp; ++n) {
          b = icerp(gamma_correct(s[(sw + 0) * bpp], gamma),
                    gamma_correct(s[(sw + 1) * bpp], gamma),
                    gamma_correct(s[(sw + 2) * bpp], gamma),
                    gamma_correct(s[(sw + 3) * bpp], gamma), wx);
          if (iy > 0) {
            a = icerp(gamma_correct(s[0], gamma), gamma_correct(s[bpp], gamma),
                      gamma_correct(s[2 * bpp], gamma),
                      gamma_correct(s[3 * bpp], gamma), wx);
          } else
            a = b;
          c = icerp(gamma_correct(s[(2 * sw + 0) * bpp], gamma),
                    gamma_correct(s[(2 * sw + 1) * bpp], gamma),
                    gamma_correct(s[(2 * sw + 2) * bpp], gamma),
                    gamma_correct(s[(2 * sw + 3) * bpp], gamma), wx);
          if (iy < dh - 1) {
            d = icerp(gamma_correct(s[(3 * sw + 0) * bpp], gamma),
                      gamma_correct(s[(3 * sw + 1) * bpp], gamma),
                      gamma_correct(s[(3 * sw + 2) * bpp], gamma),
                      gamma_correct(s[(3 * sw + 3) * bpp], gamma), wx);
          } else
            d = c;
          v = icerp(a, b, c, d, wy);
          if (v < 0)
            v = 0;
          if (v > 255)
            v = 255;
          dst[(y * dstride) + (x * bpp) + n] = gamma_correct(v, invgamma);
          ++s;
        }
      }
    }
  } else {
    for (y = 0; y < dh; ++y) {
      if (dh > 1) {
        iy = (((sh - 1) * y) << 7) / (dh - 1);
        if (y == dh - 1)
          --iy;
        wy = iy & 0x7f;
        iy >>= 7;
      } else
        iy = wy = 0;
      for (x = 0; x < dw; ++x) {
        if (dw > 1) {
          ix = (((sw - 1) * x) << 7) / (dw - 1);
          if (x == dw - 1)
            --ix;
          wx = ix & 0x7f;
          ix >>= 7;
        } else
          ix = wx = 0;
        s = src + ((iy - 1) * sw + (ix - 1)) * bpp;
        for (n = 0; n < bpp; ++n) {
          b = icerp(s[(sw + 0) * bpp], s[(sw + 1) * bpp], s[(sw + 2) * bpp],
                    s[(sw + 3) * bpp], wx);
          if (iy > 0) {
            a = icerp(s[0], s[bpp], s[2 * bpp], s[3 * bpp], wx);
          } else
            a = b;
          c = icerp(s[(2 * sw + 0) * bpp], s[(2 * sw + 1) * bpp],
                    s[(2 * sw + 2) * bpp], s[(2 * sw + 3) * bpp], wx);
          if (iy < dh - 1) {
            d = icerp(s[(3 * sw + 0) * bpp], s[(3 * sw + 1) * bpp],
                      s[(3 * sw + 2) * bpp], s[(3 * sw + 3) * bpp], wx);
          } else
            d = c;
          v = icerp(a, b, c, d, wy);
          if (v < 0)
            v = 0;
          if (v > 255)
            v = 255;
          dst[(y * dstride) + (x * bpp) + n] = v;
          ++s;
        }
      }
    }
  }
}


x86 assembly (clang, -O0):
<scale_image_bicubic>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%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,-0x58(%rbp)
cmpl   $0x0,0x18(%rbp)
je     15fb <scale_image_bicubic+0x4db>
movss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe8f(%rip),%xmm0
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x64(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    15f6 <scale_image_bicubic+0x4d6>
cmpl   $0x1,-0x10(%rbp)
jle    11e5 <scale_image_bicubic+0xc5>
mov    -0x20(%rbp),%eax
sub    $0x1,%eax
imul   -0x2c(%rbp),%eax
shl    $0x7,%eax
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0x38(%rbp)
mov    -0x2c(%rbp),%eax
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jne    11ce <scale_image_bicubic+0xae>
mov    -0x38(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x38(%rbp)
mov    -0x38(%rbp),%eax
and    $0x7f,%eax
mov    %eax,-0x40(%rbp)
mov    -0x38(%rbp),%eax
sar    $0x7,%eax
mov    %eax,-0x38(%rbp)
jmp    11f3 <scale_image_bicubic+0xd3>
movl   $0x0,-0x40(%rbp)
movl   $0x0,-0x38(%rbp)
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    15e3 <scale_image_bicubic+0x4c3>
cmpl   $0x1,-0xc(%rbp)
jle    125a <scale_image_bicubic+0x13a>
mov    -0x1c(%rbp),%eax
sub    $0x1,%eax
imul   -0x28(%rbp),%eax
shl    $0x7,%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0x34(%rbp)
mov    -0x28(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jne    1243 <scale_image_bicubic+0x123>
mov    -0x34(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%eax
and    $0x7f,%eax
mov    %eax,-0x3c(%rbp)
mov    -0x34(%rbp),%eax
sar    $0x7,%eax
mov    %eax,-0x34(%rbp)
jmp    1268 <scale_image_bicubic+0x148>
movl   $0x0,-0x3c(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x38(%rbp),%ecx
sub    $0x1,%ecx
imul   -0x1c(%rbp),%ecx
mov    -0x34(%rbp),%edx
sub    $0x1,%edx
add    %edx,%ecx
imul   0x10(%rbp),%ecx
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x60(%rbp)
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    0x10(%rbp),%eax
jge    15d0 <scale_image_bicubic+0x4b0>
mov    -0x60(%rbp),%rax
mov    -0x1c(%rbp),%ecx
add    $0x0,%ecx
imul   0x10(%rbp),%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%edi
movss  -0x24(%rbp),%xmm0
call   1030 <gamma_correct@plt>
mov    %eax,-0x70(%rbp)
mov    -0x60(%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,-0x6c(%rbp)
mov    -0x60(%rbp),%rax
mov    -0x1c(%rbp),%ecx
add    $0x2,%ecx
imul   0x10(%rbp),%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%edi
movss  -0x24(%rbp),%xmm0
call   1030 <gamma_correct@plt>
mov    %eax,-0x68(%rbp)
mov    -0x60(%rbp),%rax
mov    -0x1c(%rbp),%ecx
add    $0x3,%ecx
imul   0x10(%rbp),%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%edi
movss  -0x24(%rbp),%xmm0
call   1030 <gamma_correct@plt>
mov    -0x70(%rbp),%edi
mov    -0x6c(%rbp),%esi
mov    -0x68(%rbp),%edx
mov    %eax,%ecx
mov    -0x3c(%rbp),%r8d
call   1040 <icerp@plt>
mov    %eax,-0x4c(%rbp)
cmpl   $0x0,-0x38(%rbp)
jle    13c5 <scale_image_bicubic+0x2a5>
mov    -0x60(%rbp),%rax
movzbl (%rax),%edi
movss  -0x24(%rbp),%xmm0
call   1030 <gamma_correct@plt>
mov    %eax,-0x7c(%rbp)
mov    -0x60(%rbp),%rax
movslq 0x10(%rbp),%rcx
movzbl (%rax,%rcx,1),%edi
movss  -0x24(%rbp),%xmm0
call   1030 <gamma_correct@plt>
mov    %eax,-0x78(%rbp)
mov    -0x60(%rbp),%rax
mov    0x10(%rbp),%ecx
shl    $0x1,%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%edi
movss  -0x24(%rbp),%xmm0
call   1030 <gamma_correct@plt>
mov    %eax,-0x74(%rbp)
mov    -0x60(%rbp),%rax
imul   $0x3,0x10(%rbp),%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%edi
movss  -0x24(%rbp),%xmm0
call   1030 <gamma_correct@plt>
mov    -0x7c(%rbp),%edi
mov    -0x78(%rbp),%esi
mov    -0x74(%rbp),%edx
mov    %eax,%ecx
mov    -0x3c(%rbp),%r8d
call   1040 <icerp@plt>
mov    %eax,-0x48(%rbp)
jmp    13cb <scale_image_bicubic+0x2ab>
mov    -0x4c(%rbp),%eax
mov    %eax,-0x48(%rbp)
mov    -0x60(%rbp),%rax
mov    -0x1c(%rbp),%ecx
shl    $0x1,%ecx
add    $0x0,%ecx
imul   0x10(%rbp),%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%edi
movss  -0x24(%rbp),%xmm0
call   1030 <gamma_correct@plt>
mov    %eax,-0x88(%rbp)
mov    -0x60(%rbp),%rax
mov    -0x1c(%rbp),%ecx
shl    $0x1,%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,-0x84(%rbp)
mov    -0x60(%rbp),%rax
mov    -0x1c(%rbp),%ecx
shl    $0x1,%ecx
add    $0x2,%ecx
imul   0x10(%rbp),%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%edi
movss  -0x24(%rbp),%xmm0
call   1030 <gamma_correct@plt>
mov    %eax,-0x80(%rbp)
mov    -0x60(%rbp),%rax
mov    -0x1c(%rbp),%ecx
shl    $0x1,%ecx
add    $0x3,%ecx
imul   0x10(%rbp),%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%edi
movss  -0x24(%rbp),%xmm0
call   1030 <gamma_correct@plt>
mov    -0x88(%rbp),%edi
mov    -0x84(%rbp),%esi
mov    -0x80(%rbp),%edx
mov    %eax,%ecx
mov    -0x3c(%rbp),%r8d
call   1040 <icerp@plt>
mov    %eax,-0x50(%rbp)
mov    -0x38(%rbp),%eax
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1547 <scale_image_bicubic+0x427>
mov    -0x60(%rbp),%rax
imul   $0x3,-0x1c(%rbp),%ecx
add    $0x0,%ecx
imul   0x10(%rbp),%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%edi
movss  -0x24(%rbp),%xmm0
call   1030 <gamma_correct@plt>
mov    %eax,-0x94(%rbp)
mov    -0x60(%rbp),%rax
imul   $0x3,-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,-0x90(%rbp)
mov    -0x60(%rbp),%rax
imul   $0x3,-0x1c(%rbp),%ecx
add    $0x2,%ecx
imul   0x10(%rbp),%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%edi
movss  -0x24(%rbp),%xmm0
call   1030 <gamma_correct@plt>
mov    %eax,-0x8c(%rbp)
mov    -0x60(%rbp),%rax
imul   $0x3,-0x1c(%rbp),%ecx
add    $0x3,%ecx
imul   0x10(%rbp),%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%edi
movss  -0x24(%rbp),%xmm0
call   1030 <gamma_correct@plt>
mov    -0x94(%rbp),%edi
mov    -0x90(%rbp),%esi
mov    -0x8c(%rbp),%edx
mov    %eax,%ecx
mov    -0x3c(%rbp),%r8d
call   1040 <icerp@plt>
mov    %eax,-0x54(%rbp)
jmp    154d <scale_image_bicubic+0x42d>
mov    -0x50(%rbp),%eax
mov    %eax,-0x54(%rbp)
mov    -0x48(%rbp),%edi
mov    -0x4c(%rbp),%esi
mov    -0x50(%rbp),%edx
mov    -0x54(%rbp),%ecx
mov    -0x40(%rbp),%r8d
call   1040 <icerp@plt>
mov    %eax,-0x44(%rbp)
cmpl   $0x0,-0x44(%rbp)
jge    1576 <scale_image_bicubic+0x456>
movl   $0x0,-0x44(%rbp)
cmpl   $0xff,-0x44(%rbp)
jle    158a <scale_image_bicubic+0x46a>
movl   $0xff,-0x44(%rbp)
mov    -0x44(%rbp),%edi
movss  -0x64(%rbp),%xmm0
call   1030 <gamma_correct@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
mov    -0x2c(%rbp),%ecx
imul   -0x58(%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    -0x60(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x60(%rbp)
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    1293 <scale_image_bicubic+0x173>
jmp    15d5 <scale_image_bicubic+0x4b5>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    11fa <scale_image_bicubic+0xda>
jmp    15e8 <scale_image_bicubic+0x4c8>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1185 <scale_image_bicubic+0x65>
jmp    1960 <scale_image_bicubic+0x840>
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    195b <scale_image_bicubic+0x83b>
cmpl   $0x1,-0x10(%rbp)
jle    1662 <scale_image_bicubic+0x542>
mov    -0x20(%rbp),%eax
sub    $0x1,%eax
imul   -0x2c(%rbp),%eax
shl    $0x7,%eax
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0x38(%rbp)
mov    -0x2c(%rbp),%eax
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jne    164b <scale_image_bicubic+0x52b>
mov    -0x38(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x38(%rbp)
mov    -0x38(%rbp),%eax
and    $0x7f,%eax
mov    %eax,-0x40(%rbp)
mov    -0x38(%rbp),%eax
sar    $0x7,%eax
mov    %eax,-0x38(%rbp)
jmp    1670 <scale_image_bicubic+0x550>
movl   $0x0,-0x40(%rbp)
movl   $0x0,-0x38(%rbp)
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1948 <scale_image_bicubic+0x828>
cmpl   $0x1,-0xc(%rbp)
jle    16d7 <scale_image_bicubic+0x5b7>
mov    -0x1c(%rbp),%eax
sub    $0x1,%eax
imul   -0x28(%rbp),%eax
shl    $0x7,%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0x34(%rbp)
mov    -0x28(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jne    16c0 <scale_image_bicubic+0x5a0>
mov    -0x34(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%eax
and    $0x7f,%eax
mov    %eax,-0x3c(%rbp)
mov    -0x34(%rbp),%eax
sar    $0x7,%eax
mov    %eax,-0x34(%rbp)
jmp    16e5 <scale_image_bicubic+0x5c5>
movl   $0x0,-0x3c(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x38(%rbp),%ecx
sub    $0x1,%ecx
imul   -0x1c(%rbp),%ecx
mov    -0x34(%rbp),%edx
sub    $0x1,%edx
add    %edx,%ecx
imul   0x10(%rbp),%ecx
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x60(%rbp)
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    0x10(%rbp),%eax
jge    1935 <scale_image_bicubic+0x815>
mov    -0x60(%rbp),%rax
mov    -0x1c(%rbp),%ecx
add    $0x0,%ecx
imul   0x10(%rbp),%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%edi
mov    -0x60(%rbp),%rax
mov    -0x1c(%rbp),%ecx
add    $0x1,%ecx
imul   0x10(%rbp),%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%esi
mov    -0x60(%rbp),%rax
mov    -0x1c(%rbp),%ecx
add    $0x2,%ecx
imul   0x10(%rbp),%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%edx
mov    -0x60(%rbp),%rax
mov    -0x1c(%rbp),%ecx
add    $0x3,%ecx
imul   0x10(%rbp),%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%ecx
mov    -0x3c(%rbp),%r8d
call   1040 <icerp@plt>
mov    %eax,-0x4c(%rbp)
cmpl   $0x0,-0x38(%rbp)
jle    17ca <scale_image_bicubic+0x6aa>
mov    -0x60(%rbp),%rax
movzbl (%rax),%edi
mov    -0x60(%rbp),%rax
movslq 0x10(%rbp),%rcx
movzbl (%rax,%rcx,1),%esi
mov    -0x60(%rbp),%rax
mov    0x10(%rbp),%ecx
shl    $0x1,%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%edx
mov    -0x60(%rbp),%rax
imul   $0x3,0x10(%rbp),%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%ecx
mov    -0x3c(%rbp),%r8d
call   1040 <icerp@plt>
mov    %eax,-0x48(%rbp)
jmp    17d0 <scale_image_bicubic+0x6b0>
mov    -0x4c(%rbp),%eax
mov    %eax,-0x48(%rbp)
mov    -0x60(%rbp),%rax
mov    -0x1c(%rbp),%ecx
shl    $0x1,%ecx
add    $0x0,%ecx
imul   0x10(%rbp),%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%edi
mov    -0x60(%rbp),%rax
mov    -0x1c(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
imul   0x10(%rbp),%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%esi
mov    -0x60(%rbp),%rax
mov    -0x1c(%rbp),%ecx
shl    $0x1,%ecx
add    $0x2,%ecx
imul   0x10(%rbp),%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%edx
mov    -0x60(%rbp),%rax
mov    -0x1c(%rbp),%ecx
shl    $0x1,%ecx
add    $0x3,%ecx
imul   0x10(%rbp),%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%ecx
mov    -0x3c(%rbp),%r8d
call   1040 <icerp@plt>
mov    %eax,-0x50(%rbp)
mov    -0x38(%rbp),%eax
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    18b6 <scale_image_bicubic+0x796>
mov    -0x60(%rbp),%rax
imul   $0x3,-0x1c(%rbp),%ecx
add    $0x0,%ecx
imul   0x10(%rbp),%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%edi
mov    -0x60(%rbp),%rax
imul   $0x3,-0x1c(%rbp),%ecx
add    $0x1,%ecx
imul   0x10(%rbp),%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%esi
mov    -0x60(%rbp),%rax
imul   $0x3,-0x1c(%rbp),%ecx
add    $0x2,%ecx
imul   0x10(%rbp),%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%edx
mov    -0x60(%rbp),%rax
imul   $0x3,-0x1c(%rbp),%ecx
add    $0x3,%ecx
imul   0x10(%rbp),%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%ecx
mov    -0x3c(%rbp),%r8d
call   1040 <icerp@plt>
mov    %eax,-0x54(%rbp)
jmp    18bc <scale_image_bicubic+0x79c>
mov    -0x50(%rbp),%eax
mov    %eax,-0x54(%rbp)
mov    -0x48(%rbp),%edi
mov    -0x4c(%rbp),%esi
mov    -0x50(%rbp),%edx
mov    -0x54(%rbp),%ecx
mov    -0x40(%rbp),%r8d
call   1040 <icerp@plt>
mov    %eax,-0x44(%rbp)
cmpl   $0x0,-0x44(%rbp)
jge    18e5 <scale_image_bicubic+0x7c5>
movl   $0x0,-0x44(%rbp)
cmpl   $0xff,-0x44(%rbp)
jle    18f9 <scale_image_bicubic+0x7d9>
movl   $0xff,-0x44(%rbp)
mov    -0x44(%rbp),%eax
mov    %al,%dl
mov    -0x8(%rbp),%rax
mov    -0x2c(%rbp),%ecx
imul   -0x58(%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    -0x60(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x60(%rbp)
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    1710 <scale_image_bicubic+0x5f0>
jmp    193a <scale_image_bicubic+0x81a>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1677 <scale_image_bicubic+0x557>
jmp    194d <scale_image_bicubic+0x82d>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1602 <scale_image_bicubic+0x4e2>
jmp    1960 <scale_image_bicubic+0x840>
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scale_image_bicubic>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1b8,%rsp
mov    %r8,0x28(%rsp)
mov    %rcx,0x50(%rsp)
mov    %rdi,0x30(%rsp)
mov    0x1f0(%rsp),%r10d
mov    %rsi,0x18(%rsp)
imul   %esi,%r10d
cmpl   $0x0,0x1f8(%rsp)
mov    %rdx,0x190(%rsp)
je     17f4 <scale_image_bicubic+0x6d4>
test   %edx,%edx
jle    1d56 <scale_image_bicubic+0xc36>
movss  0xe89(%rip),%xmm1
divss  %xmm0,%xmm1
movss  %xmm1,0x148(%rsp)
shl    $0x7,%r9d
add    $0xffffff80,%r9d
mov    %r9d,0x14(%rsp)
mov    0x28(%rsp),%rsi
mov    %esi,%ecx
shl    $0x7,%ecx
add    $0xffffff80,%ecx
mov    %ecx,0x18c(%rsp)
mov    0x1f0(%rsp),%eax
mov    %eax,%ecx
imul   %esi,%ecx
movslq %ecx,%rcx
mov    %rcx,0x40(%rsp)
lea    0x1(%rsi),%ecx
imul   %eax,%ecx
movslq %ecx,%rcx
mov    %rcx,0x38(%rsp)
lea    0x2(%rsi),%ecx
imul   %eax,%ecx
movslq %ecx,%r9
lea    0x3(%rsi),%ecx
imul   %eax,%ecx
movslq %ecx,%r11
movslq %eax,%rbp
lea    (%rsi,%rsi,1),%ecx
imul   %eax,%ecx
movslq %ecx,%r14
lea    (%rsi,%rsi,1),%ecx
add    $0x1,%ecx
imul   %eax,%ecx
movslq %ecx,%r15
lea    (%rsi,%rsi,1),%ecx
add    $0x2,%ecx
imul   %eax,%ecx
movslq %ecx,%r12
lea    (%rsi,%rsi,1),%ecx
add    $0x3,%ecx
imul   %eax,%ecx
movslq %ecx,%r13
lea    (%rsi,%rsi,2),%ecx
imul   %eax,%ecx
movslq %ecx,%rbx
lea    (%rsi,%rsi,2),%ecx
add    $0x1,%ecx
imul   %eax,%ecx
movslq %ecx,%r8
lea    (%rsi,%rsi,2),%ecx
add    $0x2,%ecx
imul   %eax,%ecx
movslq %ecx,%rdi
lea    (%rsi,%rsi,2),%ecx
add    $0x3,%ecx
imul   %eax,%ecx
movslq %ecx,%rcx
movslq %r10d,%rax
mov    %rax,0x1a0(%rsp)
mov    0x50(%rsp),%rax
add    %rax,%rcx
mov    %rcx,0xa0(%rsp)
add    %rax,%rdi
mov    %rdi,0xa8(%rsp)
add    %rax,%r8
mov    %r8,0xb0(%rsp)
add    %rax,%rbx
mov    %rbx,0xb8(%rsp)
add    %rax,0x40(%rsp)
add    %rax,0x38(%rsp)
add    %rax,%r9
mov    %r9,0xe8(%rsp)
add    %rax,%r11
mov    %r11,0xe0(%rsp)
lea    0x0(,%rbp,2),%rcx
add    %rbp,%rcx
add    %rax,%rcx
mov    %rcx,0x98(%rsp)
add    %rax,%r14
mov    %r14,0xd8(%rsp)
add    %rax,%r15
mov    %r15,0xd0(%rsp)
add    %rax,%r12
mov    %r12,0xc8(%rsp)
add    %rax,%r13
mov    %r13,0xc0(%rsp)
lea    -0x1(%rdx),%ecx
mov    %rcx,0x68(%rsp)
mov    0x18(%rsp),%rcx
lea    -0x1(%rcx),%esi
mov    %rsi,0x1b0(%rsp)
mov    %edx,%esi
mov    %rsi,0x198(%rsp)
mov    %ecx,%ecx
mov    %rcx,0xf8(%rsp)
mov    %ebp,%ecx
mov    %rcx,0x140(%rsp)
lea    (%rax,%rbp,1),%rcx
mov    %rcx,0x90(%rsp)
mov    %rbp,0x48(%rsp)
lea    (%rax,%rbp,2),%rax
mov    %rax,0x88(%rsp)
xor    %ecx,%ecx
movss  %xmm0,(%rsp)
jmp    135f <scale_image_bicubic+0x23f>
mov    0x1a8(%rsp),%rcx
add    $0x1,%rcx
mov    0x1a0(%rsp),%rax
add    %rax,0x30(%rsp)
cmp    0x198(%rsp),%rcx
mov    0x190(%rsp),%rdx
je     1d56 <scale_image_bicubic+0xc36>
mov    $0x0,%eax
mov    %rax,0x8(%rsp)
movl   $0x0,0x70(%rsp)
cmp    $0x1,%edx
je     13a0 <scale_image_bicubic+0x280>
mov    0x14(%rsp),%eax
imul   %ecx,%eax
cltd
mov    0x68(%rsp),%rsi
idiv   %esi
xor    %edx,%edx
cmp    %rsi,%rcx
sete   %dl
sub    %edx,%eax
mov    %eax,%edx
and    $0x7f,%edx
mov    %edx,0x70(%rsp)
sar    $0x7,%eax
mov    %rax,0x8(%rsp)
mov    %rcx,0x1a8(%rsp)
cmpl   $0x0,0x18(%rsp)
jle    1330 <scale_image_bicubic+0x210>
mov    0x8(%rsp),%rax
add    $0xffffffff,%eax
imul   0x28(%rsp),%eax
add    $0xffffffff,%eax
mov    %eax,0xf0(%rsp)
mov    0x30(%rsp),%rax
mov    %rax,0x20(%rsp)
xor    %edi,%edi
jmp    1406 <scale_image_bicubic+0x2e6>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    0x58(%rsp),%rdi
add    $0x1,%rdi
mov    0x20(%rsp),%rax
add    0x48(%rsp),%rax
mov    %rax,0x20(%rsp)
cmp    0xf8(%rsp),%rdi
je     1330 <scale_image_bicubic+0x210>
xor    %eax,%eax
mov    $0x0,%r12d
cmpl   $0x2,0x18(%rsp)
jl     143e <scale_image_bicubic+0x31e>
mov    0x18c(%rsp),%eax
imul   %edi,%eax
cltd
mov    0x1b0(%rsp),%rsi
idiv   %esi
xor    %ecx,%ecx
cmp    %rsi,%rdi
sete   %cl
sub    %ecx,%eax
mov    %eax,%r12d
and    $0x7f,%r12d
sar    $0x7,%eax
mov    %rdi,0x58(%rsp)
cmpl   $0x0,0x1f0(%rsp)
jle    13e0 <scale_image_bicubic+0x2c0>
add    0xf0(%rsp),%eax
imul   0x1f0(%rsp),%eax
movslq %eax,%rcx
mov    0x50(%rsp),%rax
add    %rcx,%rax
mov    %rax,0x130(%rsp)
mov    0xa0(%rsp),%rax
lea    (%rax,%rcx,1),%rax
mov    %rax,0x110(%rsp)
mov    0xa8(%rsp),%rax
lea    (%rax,%rcx,1),%rax
mov    %rax,0x108(%rsp)
mov    0xb0(%rsp),%rax
lea    (%rax,%rcx,1),%rax
mov    %rax,0x100(%rsp)
mov    0xb8(%rsp),%rax
lea    (%rax,%rcx,1),%rax
mov    %rax,0x60(%rsp)
mov    0x40(%rsp),%rax
lea    (%rax,%rcx,1),%rax
mov    %rax,0x170(%rsp)
mov    0x38(%rsp),%rax
lea    (%rax,%rcx,1),%rax
mov    %rax,0x168(%rsp)
mov    0xe8(%rsp),%rax
lea    (%rax,%rcx,1),%rax
mov    %rax,0x160(%rsp)
mov    0xe0(%rsp),%rax
lea    (%rax,%rcx,1),%rax
mov    %rax,0x158(%rsp)
mov    0x90(%rsp),%rax
lea    (%rax,%rcx,1),%rax
mov    %rax,0x128(%rsp)
mov    0x88(%rsp),%rax
lea    (%rax,%rcx,1),%rax
mov    %rax,0x120(%rsp)
mov    0x98(%rsp),%rax
lea    (%rax,%rcx,1),%rax
mov    %rax,0x118(%rsp)
mov    0xd8(%rsp),%rax
add    %rcx,%rax
mov    %rax,0x80(%rsp)
mov    0xd0(%rsp),%rax
add    %rcx,%rax
mov    %rax,0x78(%rsp)
mov    0xc8(%rsp),%rax
add    %rcx,%rax
mov    %rax,0x150(%rsp)
add    0xc0(%rsp),%rcx
mov    %rcx,0x178(%rsp)
xor    %r14d,%r14d
jmp    15f1 <scale_image_bicubic+0x4d1>
nopl   (%rax)
mov    %r15d,%edi
mov    0x180(%rsp),%esi
mov    %r13d,%edx
mov    0x70(%rsp),%r8d
call   1040 <icerp@plt>
test   %eax,%eax
mov    $0x0,%ecx
cmovs  %ecx,%eax
cmp    $0xff,%eax
mov    $0xff,%ecx
cmovae %ecx,%eax
mov    %eax,%edi
movss  0x148(%rsp),%xmm0
call   1030 <gamma_correct@plt>
mov    0x20(%rsp),%rcx
mov    %al,(%rcx,%r14,1)
add    $0x1,%r14
cmp    %r14,0x140(%rsp)
movss  (%rsp),%xmm0
mov    %ebx,%r12d
je     13e0 <scale_image_bicubic+0x2c0>
mov    0x170(%rsp),%rax
movzbl (%rax,%r14,1),%edi
call   1030 <gamma_correct@plt>
mov    %eax,%r13d
mov    0x168(%rsp),%rax
movzbl (%rax,%r14,1),%edi
movss  (%rsp),%xmm0
call   1030 <gamma_correct@plt>
mov    %eax,%r15d
mov    0x160(%rsp),%rax
movzbl (%rax,%r14,1),%edi
movss  (%rsp),%xmm0
call   1030 <gamma_correct@plt>
mov    %eax,%ebx
mov    0x158(%rsp),%rax
movzbl (%rax,%r14,1),%edi
movss  (%rsp),%xmm0
call   1030 <gamma_correct@plt>
mov    %r13d,%edi
mov    %r15d,%esi
mov    %ebx,%edx
mov    %eax,%ecx
mov    %r12d,%r8d
call   1040 <icerp@plt>
mov    %eax,%r15d
mov    %eax,0x180(%rsp)
cmpl   $0x0,0x8(%rsp)
jle    16ea <scale_image_bicubic+0x5ca>
mov    0x130(%rsp),%rax
movzbl (%rax,%r14,1),%edi
movss  (%rsp),%xmm0
call   1030 <gamma_correct@plt>
mov    %eax,%r13d
mov    0x128(%rsp),%rax
movzbl (%rax,%r14,1),%edi
movss  (%rsp),%xmm0
call   1030 <gamma_correct@plt>
mov    %eax,%ebx
mov    0x120(%rsp),%rax
movzbl (%rax,%r14,1),%edi
movss  (%rsp),%xmm0
call   1030 <gamma_correct@plt>
mov    %eax,%ebp
mov    0x118(%rsp),%rax
movzbl (%rax,%r14,1),%edi
movss  (%rsp),%xmm0
call   1030 <gamma_correct@plt>
mov    %r13d,%edi
mov    %ebx,%esi
mov    %ebp,%edx
mov    %eax,%ecx
mov    %r12d,%r8d
call   1040 <icerp@plt>
mov    %eax,%r15d
mov    0x80(%rsp),%rax
movzbl (%rax,%r14,1),%edi
movss  (%rsp),%xmm0
call   1030 <gamma_correct@plt>
mov    %eax,%r13d
mov    0x78(%rsp),%rax
movzbl (%rax,%r14,1),%edi
movss  (%rsp),%xmm0
call   1030 <gamma_correct@plt>
mov    %eax,%ebp
mov    0x150(%rsp),%rax
movzbl (%rax,%r14,1),%edi
movss  (%rsp),%xmm0
call   1030 <gamma_correct@plt>
mov    %eax,%ebx
mov    0x178(%rsp),%rax
movzbl (%rax,%r14,1),%edi
movss  (%rsp),%xmm0
call   1030 <gamma_correct@plt>
mov    %r13d,%edi
mov    %ebp,%esi
mov    %ebx,%edx
mov    %eax,%ecx
mov    %r12d,%ebx
mov    %r12d,%r8d
call   1040 <icerp@plt>
mov    %eax,%r13d
mov    %eax,%ecx
mov    0x68(%rsp),%rax
cmp    %eax,0x8(%rsp)
jge    1590 <scale_image_bicubic+0x470>
mov    0x60(%rsp),%rax
movzbl (%rax,%r14,1),%edi
movss  (%rsp),%xmm0
call   1030 <gamma_correct@plt>
mov    %eax,0x138(%rsp)
mov    0x100(%rsp),%rax
movzbl (%rax,%r14,1),%edi
movss  (%rsp),%xmm0
call   1030 <gamma_correct@plt>
mov    %eax,%ebp
mov    0x108(%rsp),%rax
movzbl (%rax,%r14,1),%edi
movss  (%rsp),%xmm0
call   1030 <gamma_correct@plt>
mov    %eax,%r12d
mov    0x110(%rsp),%rax
movzbl (%rax,%r14,1),%edi
movss  (%rsp),%xmm0
call   1030 <gamma_correct@plt>
mov    0x138(%rsp),%edi
mov    %ebp,%esi
mov    %r12d,%edx
mov    %eax,%ecx
mov    %ebx,%r8d
call   1040 <icerp@plt>
mov    %eax,%ecx
jmp    1590 <scale_image_bicubic+0x470>
test   %edx,%edx
jle    1d56 <scale_image_bicubic+0xc36>
shl    $0x7,%r9d
add    $0xffffff80,%r9d
mov    %r9d,0x14(%rsp)
mov    0x28(%rsp),%rsi
mov    %esi,%eax
shl    $0x7,%eax
add    $0xffffff80,%eax
mov    %eax,0xa8(%rsp)
mov    0x1f0(%rsp),%r11d
mov    %r11d,%ecx
imul   %esi,%ecx
movslq %ecx,%rax
mov    %rax,0x60(%rsp)
lea    0x1(%rsi),%ecx
imul   %r11d,%ecx
movslq %ecx,%rax
mov    %rax,0x58(%rsp)
lea    0x2(%rsi),%ecx
imul   %r11d,%ecx
movslq %ecx,%rax
mov    %rax,0x48(%rsp)
lea    0x3(%rsi),%ecx
imul   %r11d,%ecx
movslq %ecx,%r14
movslq %r11d,%r13
lea    (%rsi,%rsi,1),%ecx
imul   %r11d,%ecx
movslq %ecx,%r15
lea    (%rsi,%rsi,1),%ecx
add    $0x1,%ecx
imul   %r11d,%ecx
movslq %ecx,%r12
lea    (%rsi,%rsi,1),%ecx
add    $0x2,%ecx
imul   %r11d,%ecx
movslq %ecx,%rbx
lea    (%rsi,%rsi,1),%ecx
add    $0x3,%ecx
imul   %r11d,%ecx
movslq %ecx,%rbp
lea    (%rsi,%rsi,2),%ecx
imul   %r11d,%ecx
movslq %ecx,%r9
lea    (%rsi,%rsi,2),%ecx
add    $0x1,%ecx
imul   %r11d,%ecx
movslq %ecx,%r8
lea    (%rsi,%rsi,2),%ecx
add    $0x2,%ecx
imul   %r11d,%ecx
movslq %ecx,%rdi
lea    (%rsi,%rsi,2),%ecx
add    $0x3,%ecx
imul   %r11d,%ecx
movslq %ecx,%rcx
movslq %r10d,%rax
mov    %rax,0x90(%rsp)
mov    0x50(%rsp),%rax
add    %rax,%rcx
mov    %rcx,0xc8(%rsp)
add    %rax,%rdi
mov    %rdi,0xd0(%rsp)
add    %rax,%r8
mov    %r8,0xd8(%rsp)
add    %rax,%r9
mov    %r9,0xe0(%rsp)
add    %rax,0x60(%rsp)
add    %rax,0x58(%rsp)
add    %rax,0x48(%rsp)
add    %rax,%r14
mov    %r14,0xf8(%rsp)
lea    0x0(,%r13,2),%rcx
add    %r13,%rcx
add    %rax,%rcx
mov    %rcx,0xc0(%rsp)
add    %rax,%r15
mov    %r15,0xf0(%rsp)
add    %rax,%r12
mov    %r12,0x40(%rsp)
add    %rax,%rbx
mov    %rbx,0x38(%rsp)
add    %rax,%rbp
mov    %rbp,0xe8(%rsp)
lea    -0x1(%rdx),%ecx
mov    %rcx,0x78(%rsp)
mov    0x18(%rsp),%rcx
lea    -0x1(%rcx),%esi
mov    %rsi,0xa0(%rsp)
mov    %edx,%esi
mov    %rsi,0x88(%rsp)
mov    %ecx,%ecx
mov    %rcx,0x108(%rsp)
mov    %r11d,%ecx
mov    %rcx,0x150(%rsp)
lea    (%rax,%r13,1),%rcx
mov    %rcx,0xb8(%rsp)
mov    %r13,0x110(%rsp)
lea    (%rax,%r13,2),%rax
mov    %rax,0xb0(%rsp)
xor    %esi,%esi
jmp    19df <scale_image_bicubic+0x8bf>
nopl   (%rax)
mov    0x98(%rsp),%rsi
add    $0x1,%rsi
mov    0x90(%rsp),%rax
add    %rax,0x30(%rsp)
cmp    0x88(%rsp),%rsi
mov    0x190(%rsp),%rdx
je     1d56 <scale_image_bicubic+0xc36>
mov    $0x0,%eax
mov    %rax,(%rsp)
movl   $0x0,0x80(%rsp)
cmp    $0x1,%edx
je     1a24 <scale_image_bicubic+0x904>
mov    0x14(%rsp),%eax
imul   %esi,%eax
cltd
mov    0x78(%rsp),%rcx
idiv   %ecx
xor    %edx,%edx
cmp    %rcx,%rsi
sete   %dl
sub    %edx,%eax
mov    %eax,%ecx
and    $0x7f,%ecx
mov    %ecx,0x80(%rsp)
sar    $0x7,%eax
mov    %rax,(%rsp)
mov    %rsi,0x98(%rsp)
cmpl   $0x0,0x18(%rsp)
jle    19b0 <scale_image_bicubic+0x890>
mov    (%rsp),%rax
add    $0xffffffff,%eax
imul   0x28(%rsp),%eax
add    $0xffffffff,%eax
mov    %eax,0x100(%rsp)
mov    0x30(%rsp),%rax
mov    %rax,0x8(%rsp)
xor    %edi,%edi
jmp    1a8c <scale_image_bicubic+0x96c>
nopl   0x0(%rax,%rax,1)
mov    0x118(%rsp),%rdi
add    $0x1,%rdi
mov    0x8(%rsp),%rax
add    0x110(%rsp),%rax
mov    %rax,0x8(%rsp)
cmp    0x108(%rsp),%rdi
je     19b0 <scale_image_bicubic+0x890>
xor    %eax,%eax
mov    $0x0,%r12d
cmpl   $0x2,0x18(%rsp)
jl     1ac4 <scale_image_bicubic+0x9a4>
mov    0xa8(%rsp),%eax
imul   %edi,%eax
cltd
mov    0xa0(%rsp),%rsi
idiv   %esi
xor    %ecx,%ecx
cmp    %rsi,%rdi
sete   %cl
sub    %ecx,%eax
mov    %eax,%r12d
and    $0x7f,%r12d
sar    $0x7,%eax
mov    %rdi,0x118(%rsp)
cmpl   $0x0,0x1f0(%rsp)
jle    1a60 <scale_image_bicubic+0x940>
add    0x100(%rsp),%eax
imul   0x1f0(%rsp),%eax
movslq %eax,%r14
mov    0x50(%rsp),%rax
add    %r14,%rax
mov    %rax,0x70(%rsp)
mov    0xc8(%rsp),%rax
lea    (%rax,%r14,1),%rax
mov    %rax,0x138(%rsp)
mov    0xd0(%rsp),%rax
lea    (%rax,%r14,1),%rax
mov    %rax,0x130(%rsp)
mov    0xd8(%rsp),%rax
lea    (%rax,%r14,1),%rax
mov    %rax,0x128(%rsp)
mov    0xe0(%rsp),%rax
lea    (%rax,%r14,1),%rax
mov    %rax,0x120(%rsp)
mov    0x60(%rsp),%rax
lea    (%rax,%r14,1),%rax
mov    %rax,0x180(%rsp)
mov    0x58(%rsp),%rax
lea    (%rax,%r14,1),%rax
mov    %rax,0x20(%rsp)
mov    0x48(%rsp),%rax
lea    (%rax,%r14,1),%rax
mov    %rax,0x178(%rsp)
mov    0xf8(%rsp),%rax
lea    (%rax,%r14,1),%rax
mov    %rax,0x170(%rsp)
mov    0xb8(%rsp),%rax
lea    (%rax,%r14,1),%rax
mov    %rax,0x68(%rsp)
mov    0xb0(%rsp),%rax
lea    (%rax,%r14,1),%rax
mov    %rax,0x148(%rsp)
mov    0xc0(%rsp),%rax
lea    (%rax,%r14,1),%rax
mov    %rax,0x140(%rsp)
mov    0xf0(%rsp),%rax
add    %r14,%rax
mov    %rax,0x168(%rsp)
mov    0x40(%rsp),%rax
add    %r14,%rax
mov    %rax,0x160(%rsp)
mov    0x38(%rsp),%rax
add    %r14,%rax
mov    %rax,0x158(%rsp)
add    0xe8(%rsp),%r14
xor    %r15d,%r15d
jmp    1c2b <scale_image_bicubic+0xb0b>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    0x8(%rsp),%rcx
mov    %al,(%rcx,%r15,1)
add    $0x1,%r15
cmp    %r15,0x150(%rsp)
je     1a60 <scale_image_bicubic+0x940>
mov    0x180(%rsp),%rax
movzbl (%rax,%r15,1),%edi
mov    0x20(%rsp),%rax
movzbl (%rax,%r15,1),%esi
mov    0x178(%rsp),%rax
movzbl (%rax,%r15,1),%edx
mov    0x170(%rsp),%rax
movzbl (%rax,%r15,1),%ecx
mov    %r12d,%r8d
call   1040 <icerp@plt>
mov    %eax,%r13d
mov    %eax,%ebp
cmpl   $0x0,(%rsp)
jle    1ca7 <scale_image_bicubic+0xb87>
mov    0x70(%rsp),%rax
movzbl (%rax,%r15,1),%edi
mov    0x68(%rsp),%rax
movzbl (%rax,%r15,1),%esi
mov    0x148(%rsp),%rax
movzbl (%rax,%r15,1),%edx
mov    0x140(%rsp),%rax
movzbl (%rax,%r15,1),%ecx
mov    %r12d,%r8d
call   1040 <icerp@plt>
mov    %eax,%ebp
mov    0x168(%rsp),%rax
movzbl (%rax,%r15,1),%edi
mov    0x160(%rsp),%rax
movzbl (%rax,%r15,1),%esi
mov    0x158(%rsp),%rax
movzbl (%rax,%r15,1),%edx
movzbl (%r14,%r15,1),%ecx
mov    %r12d,%r8d
call   1040 <icerp@plt>
mov    %eax,%ebx
mov    %eax,%ecx
mov    (%rsp),%rax
cmp    0x78(%rsp),%eax
jge    1d27 <scale_image_bicubic+0xc07>
mov    0x120(%rsp),%rax
movzbl (%rax,%r15,1),%edi
mov    0x128(%rsp),%rax
movzbl (%rax,%r15,1),%esi
mov    0x130(%rsp),%rax
movzbl (%rax,%r15,1),%edx
mov    0x138(%rsp),%rax
movzbl (%rax,%r15,1),%ecx
mov    %r12d,%r8d
call   1040 <icerp@plt>
mov    %eax,%ecx
mov    %ebp,%edi
mov    %r13d,%esi
mov    %ebx,%edx
mov    0x80(%rsp),%r8d
call   1040 <icerp@plt>
test   %eax,%eax
jns    1d41 <scale_image_bicubic+0xc21>
xor    %eax,%eax
cmp    $0xff,%eax
jb     1c10 <scale_image_bicubic+0xaf0>
mov    $0xff,%eax
jmp    1c10 <scale_image_bicubic+0xaf0>
add    $0x1b8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @scale_image_bicubic(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 i32
%27 = alloca i32
%28 = alloca i32
%29 = alloca i32
%30 = alloca i32
%31 = alloca i32
%32 = alloca i8*
%33 = 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
%34 = load i32, i32* %11
%35 = load i32, i32* %16
%36 = mul nsw i32 %34, %35
store i32 %36, i32* %31
%37 = load i32, i32* %17
%38 = icmp ne i32 %37, 0
br i1 %38, label %39, label %359
39: ; preds = %9
%40 = load float, float* %18
%41 = fpext float %40 to double
%42 = fdiv double 1.000000e+00, %41
%43 = fptrunc double %42 to float
store float %43, float* %33
store i32 0, i32* %20
br label %44
44: ; preds = %355, %39
%45 = load i32, i32* %20
%46 = load i32, i32* %12
%47 = icmp slt i32 %45, %46
br i1 %47, label %48, label %358
48: ; preds = %44
%49 = load i32, i32* %12
%50 = icmp sgt i32 %49, 1
br i1 %50, label %51, label %72
51: ; preds = %48
%52 = load i32, i32* %15
%53 = sub nsw i32 %52, 1
%54 = load i32, i32* %20
%55 = mul nsw i32 %53, %54
%56 = shl i32 %55, 7
%57 = load i32, i32* %12
%58 = sub nsw i32 %57, 1
%59 = sdiv i32 %56, %58
store i32 %59, i32* %23
%60 = load i32, i32* %20
%61 = load i32, i32* %12
%62 = sub nsw i32 %61, 1
%63 = icmp eq i32 %60, %62
br i1 %63, label %64, label %67
64: ; preds = %51
%65 = load i32, i32* %23
%66 = add nsw i32 %65, -1
store i32 %66, i32* %23
br label %67
67: ; preds = %64, %51
%68 = load i32, i32* %23
%69 = and i32 %68, 127
store i32 %69, i32* %25
%70 = load i32, i32* %23
%71 = ashr i32 %70, 7
store i32 %71, i32* %23
br label %73
72: ; preds = %48
store i32 0, i32* %25
store i32 0, i32* %23
br label %73
73: ; preds = %72, %67
store i32 0, i32* %19
br label %74
74: ; preds = %351, %73
%75 = load i32, i32* %19
%76 = load i32, i32* %11
%77 = icmp slt i32 %75, %76
br i1 %77, label %78, label %354
78: ; preds = %74
%79 = load i32, i32* %11
%80 = icmp sgt i32 %79, 1
br i1 %80, label %81, label %102
81: ; preds = %78
%82 = load i32, i32* %14
%83 = sub nsw i32 %82, 1
%84 = load i32, i32* %19
%85 = mul nsw i32 %83, %84
%86 = shl i32 %85, 7
%87 = load i32, i32* %11
%88 = sub nsw i32 %87, 1
%89 = sdiv i32 %86, %88
store i32 %89, i32* %22
%90 = load i32, i32* %19
%91 = load i32, i32* %11
%92 = sub nsw i32 %91, 1
%93 = icmp eq i32 %90, %92
br i1 %93, label %94, label %97
94: ; preds = %81
%95 = load i32, i32* %22
%96 = add nsw i32 %95, -1
store i32 %96, i32* %22
br label %97
97: ; preds = %94, %81
%98 = load i32, i32* %22
%99 = and i32 %98, 127
store i32 %99, i32* %24
%100 = load i32, i32* %22
%101 = ashr i32 %100, 7
store i32 %101, i32* %22
br label %103
102: ; preds = %78
store i32 0, i32* %24
store i32 0, i32* %22
br label %103
103: ; preds = %102, %97
%104 = load i8*, i8** %13
%105 = load i32, i32* %23
%106 = sub nsw i32 %105, 1
%107 = load i32, i32* %14
%108 = mul nsw i32 %106, %107
%109 = load i32, i32* %22
%110 = sub nsw i32 %109, 1
%111 = add nsw i32 %108, %110
%112 = load i32, i32* %16
%113 = mul nsw i32 %111, %112
%114 = sext i32 %113 to i64
%115 = getelementptr inbounds i8, i8* %104, i64 %114
store i8* %115, i8** %32
store i32 0, i32* %21
br label %116
116: ; preds = %347, %103
%117 = load i32, i32* %21
%118 = load i32, i32* %16
%119 = icmp slt i32 %117, %118
br i1 %119, label %120, label %350
120: ; preds = %116
%121 = load i8*, i8** %32
%122 = load i32, i32* %14
%123 = add nsw i32 %122, 0
%124 = load i32, i32* %16
%125 = mul nsw i32 %123, %124
%126 = sext i32 %125 to i64
%127 = getelementptr inbounds i8, i8* %121, i64 %126
%128 = load i8, i8* %127
%129 = zext i8 %128 to i32
%130 = load float, float* %18
%131 = call i32 @gamma_correct(i32 %129, float %130)
%132 = load i8*, i8** %32
%133 = load i32, i32* %14
%134 = add nsw i32 %133, 1
%135 = load i32, i32* %16
%136 = mul nsw i32 %134, %135
%137 = sext i32 %136 to i64
%138 = getelementptr inbounds i8, i8* %132, i64 %137
%139 = load i8, i8* %138
%140 = zext i8 %139 to i32
%141 = load float, float* %18
%142 = call i32 @gamma_correct(i32 %140, float %141)
%143 = load i8*, i8** %32
%144 = load i32, i32* %14
%145 = add nsw i32 %144, 2
%146 = load i32, i32* %16
%147 = mul nsw i32 %145, %146
%148 = sext i32 %147 to i64
%149 = getelementptr inbounds i8, i8* %143, i64 %148
%150 = load i8, i8* %149
%151 = zext i8 %150 to i32
%152 = load float, float* %18
%153 = call i32 @gamma_correct(i32 %151, float %152)
%154 = load i8*, i8** %32
%155 = load i32, i32* %14
%156 = add nsw i32 %155, 3
%157 = load i32, i32* %16
%158 = mul nsw i32 %156, %157
%159 = sext i32 %158 to i64
%160 = getelementptr inbounds i8, i8* %154, i64 %159
%161 = load i8, i8* %160
%162 = zext i8 %161 to i32
%163 = load float, float* %18
%164 = call i32 @gamma_correct(i32 %162, float %163)
%165 = load i32, i32* %24
%166 = call i32 @icerp(i32 %131, i32 %142, i32 %153, i32 %164, i32 %165)
store i32 %166, i32* %28
%167 = load i32, i32* %23
%168 = icmp sgt i32 %167, 0
br i1 %168, label %169, label %204
169: ; preds = %120
%170 = load i8*, i8** %32
%171 = getelementptr inbounds i8, i8* %170, i64 0
%172 = load i8, i8* %171
%173 = zext i8 %172 to i32
%174 = load float, float* %18
%175 = call i32 @gamma_correct(i32 %173, float %174)
%176 = load i8*, i8** %32
%177 = load i32, i32* %16
%178 = sext i32 %177 to i64
%179 = getelementptr inbounds i8, i8* %176, i64 %178
%180 = load i8, i8* %179
%181 = zext i8 %180 to i32
%182 = load float, float* %18
%183 = call i32 @gamma_correct(i32 %181, float %182)
%184 = load i8*, i8** %32
%185 = load i32, i32* %16
%186 = mul nsw i32 2, %185
%187 = sext i32 %186 to i64
%188 = getelementptr inbounds i8, i8* %184, i64 %187
%189 = load i8, i8* %188
%190 = zext i8 %189 to i32
%191 = load float, float* %18
%192 = call i32 @gamma_correct(i32 %190, float %191)
%193 = load i8*, i8** %32
%194 = load i32, i32* %16
%195 = mul nsw i32 3, %194
%196 = sext i32 %195 to i64
%197 = getelementptr inbounds i8, i8* %193, i64 %196
%198 = load i8, i8* %197
%199 = zext i8 %198 to i32
%200 = load float, float* %18
%201 = call i32 @gamma_correct(i32 %199, float %200)
%202 = load i32, i32* %24
%203 = call i32 @icerp(i32 %175, i32 %183, i32 %192, i32 %201, i32 %202)
store i32 %203, i32* %27
br label %206
204: ; preds = %120
%205 = load i32, i32* %28
store i32 %205, i32* %27
br label %206
206: ; preds = %204, %169
%207 = load i8*, i8** %32
%208 = load i32, i32* %14
%209 = mul nsw i32 2, %208
%210 = add nsw i32 %209, 0
%211 = load i32, i32* %16
%212 = mul nsw i32 %210, %211
%213 = sext i32 %212 to i64
%214 = getelementptr inbounds i8, i8* %207, i64 %213
%215 = load i8, i8* %214
%216 = zext i8 %215 to i32
%217 = load float, float* %18
%218 = call i32 @gamma_correct(i32 %216, float %217)
%219 = load i8*, i8** %32
%220 = load i32, i32* %14
%221 = mul nsw i32 2, %220
%222 = add nsw i32 %221, 1
%223 = load i32, i32* %16
%224 = mul nsw i32 %222, %223
%225 = sext i32 %224 to i64
%226 = getelementptr inbounds i8, i8* %219, i64 %225
%227 = load i8, i8* %226
%228 = zext i8 %227 to i32
%229 = load float, float* %18
%230 = call i32 @gamma_correct(i32 %228, float %229)
%231 = load i8*, i8** %32
%232 = load i32, i32* %14
%233 = mul nsw i32 2, %232
%234 = add nsw i32 %233, 2
%235 = load i32, i32* %16
%236 = mul nsw i32 %234, %235
%237 = sext i32 %236 to i64
%238 = getelementptr inbounds i8, i8* %231, i64 %237
%239 = load i8, i8* %238
%240 = zext i8 %239 to i32
%241 = load float, float* %18
%242 = call i32 @gamma_correct(i32 %240, float %241)
%243 = load i8*, i8** %32
%244 = load i32, i32* %14
%245 = mul nsw i32 2, %244
%246 = add nsw i32 %245, 3
%247 = load i32, i32* %16
%248 = mul nsw i32 %246, %247
%249 = sext i32 %248 to i64
%250 = getelementptr inbounds i8, i8* %243, i64 %249
%251 = load i8, i8* %250
%252 = zext i8 %251 to i32
%253 = load float, float* %18
%254 = call i32 @gamma_correct(i32 %252, float %253)
%255 = load i32, i32* %24
%256 = call i32 @icerp(i32 %218, i32 %230, i32 %242, i32 %254, i32 %255)
store i32 %256, i32* %29
%257 = load i32, i32* %23
%258 = load i32, i32* %12
%259 = sub nsw i32 %258, 1
%260 = icmp slt i32 %257, %259
br i1 %260, label %261, label %312
261: ; preds = %206
%262 = load i8*, i8** %32
%263 = load i32, i32* %14
%264 = mul nsw i32 3, %263
%265 = add nsw i32 %264, 0
%266 = load i32, i32* %16
%267 = mul nsw i32 %265, %266
%268 = sext i32 %267 to i64
%269 = getelementptr inbounds i8, i8* %262, i64 %268
%270 = load i8, i8* %269
%271 = zext i8 %270 to i32
%272 = load float, float* %18
%273 = call i32 @gamma_correct(i32 %271, float %272)
%274 = load i8*, i8** %32
%275 = load i32, i32* %14
%276 = mul nsw i32 3, %275
%277 = add nsw i32 %276, 1
%278 = load i32, i32* %16
%279 = mul nsw i32 %277, %278
%280 = sext i32 %279 to i64
%281 = getelementptr inbounds i8, i8* %274, i64 %280
%282 = load i8, i8* %281
%283 = zext i8 %282 to i32
%284 = load float, float* %18
%285 = call i32 @gamma_correct(i32 %283, float %284)
%286 = load i8*, i8** %32
%287 = load i32, i32* %14
%288 = mul nsw i32 3, %287
%289 = add nsw i32 %288, 2
%290 = load i32, i32* %16
%291 = mul nsw i32 %289, %290
%292 = sext i32 %291 to i64
%293 = getelementptr inbounds i8, i8* %286, i64 %292
%294 = load i8, i8* %293
%295 = zext i8 %294 to i32
%296 = load float, float* %18
%297 = call i32 @gamma_correct(i32 %295, float %296)
%298 = load i8*, i8** %32
%299 = load i32, i32* %14
%300 = mul nsw i32 3, %299
%301 = add nsw i32 %300, 3
%302 = load i32, i32* %16
%303 = mul nsw i32 %301, %302
%304 = sext i32 %303 to i64
%305 = getelementptr inbounds i8, i8* %298, i64 %304
%306 = load i8, i8* %305
%307 = zext i8 %306 to i32
%308 = load float, float* %18
%309 = call i32 @gamma_correct(i32 %307, float %308)
%310 = load i32, i32* %24
%311 = call i32 @icerp(i32 %273, i32 %285, i32 %297, i32 %309, i32 %310)
store i32 %311, i32* %30
br label %314
312: ; preds = %206
%313 = load i32, i32* %29
store i32 %313, i32* %30
br label %314
314: ; preds = %312, %261
%315 = load i32, i32* %27
%316 = load i32, i32* %28
%317 = load i32, i32* %29
%318 = load i32, i32* %30
%319 = load i32, i32* %25
%320 = call i32 @icerp(i32 %315, i32 %316, i32 %317, i32 %318, i32 %319)
store i32 %320, i32* %26
%321 = load i32, i32* %26
%322 = icmp slt i32 %321, 0
br i1 %322, label %323, label %324
323: ; preds = %314
store i32 0, i32* %26
br label %324
324: ; preds = %323, %314
%325 = load i32, i32* %26
%326 = icmp sgt i32 %325, 255
br i1 %326, label %327, label %328
327: ; preds = %324
store i32 255, i32* %26
br label %328
328: ; preds = %327, %324
%329 = load i32, i32* %26
%330 = load float, float* %33
%331 = call i32 @gamma_correct(i32 %329, float %330)
%332 = trunc i32 %331 to i8
%333 = load i8*, i8** %10
%334 = load i32, i32* %20
%335 = load i32, i32* %31
%336 = mul nsw i32 %334, %335
%337 = load i32, i32* %19
%338 = load i32, i32* %16
%339 = mul nsw i32 %337, %338
%340 = add nsw i32 %336, %339
%341 = load i32, i32* %21
%342 = add nsw i32 %340, %341
%343 = sext i32 %342 to i64
%344 = getelementptr inbounds i8, i8* %333, i64 %343
store i8 %332, i8* %344
%345 = load i8*, i8** %32
%346 = getelementptr inbounds i8, i8* %345, i32 1
store i8* %346, i8** %32
br label %347
347: ; preds = %328
%348 = load i32, i32* %21
%349 = add nsw i32 %348, 1
store i32 %349, i32* %21
br label %116
350: ; preds = %116
br label %351
351: ; preds = %350
%352 = load i32, i32* %19
%353 = add nsw i32 %352, 1
store i32 %353, i32* %19
br label %74
354: ; preds = %74
br label %355
355: ; preds = %354
%356 = load i32, i32* %20
%357 = add nsw i32 %356, 1
store i32 %357, i32* %20
br label %44
358: ; preds = %44
br label %641
359: ; preds = %9
store i32 0, i32* %20
br label %360
360: ; preds = %637, %359
%361 = load i32, i32* %20
%362 = load i32, i32* %12
%363 = icmp slt i32 %361, %362
br i1 %363, label %364, label %640
364: ; preds = %360
%365 = load i32, i32* %12
%366 = icmp sgt i32 %365, 1
br i1 %366, label %367, label %388
367: ; preds = %364
%368 = load i32, i32* %15
%369 = sub nsw i32 %368, 1
%370 = load i32, i32* %20
%371 = mul nsw i32 %369, %370
%372 = shl i32 %371, 7
%373 = load i32, i32* %12
%374 = sub nsw i32 %373, 1
%375 = sdiv i32 %372, %374
store i32 %375, i32* %23
%376 = load i32, i32* %20
%377 = load i32, i32* %12
%378 = sub nsw i32 %377, 1
%379 = icmp eq i32 %376, %378
br i1 %379, label %380, label %383
380: ; preds = %367
%381 = load i32, i32* %23
%382 = add nsw i32 %381, -1
store i32 %382, i32* %23
br label %383
383: ; preds = %380, %367
%384 = load i32, i32* %23
%385 = and i32 %384, 127
store i32 %385, i32* %25
%386 = load i32, i32* %23
%387 = ashr i32 %386, 7
store i32 %387, i32* %23
br label %389
388: ; preds = %364
store i32 0, i32* %25
store i32 0, i32* %23
br label %389
389: ; preds = %388, %383
store i32 0, i32* %19
br label %390
390: ; preds = %633, %389
%391 = load i32, i32* %19
%392 = load i32, i32* %11
%393 = icmp slt i32 %391, %392
br i1 %393, label %394, label %636
394: ; preds = %390
%395 = load i32, i32* %11
%396 = icmp sgt i32 %395, 1
br i1 %396, label %397, label %418
397: ; preds = %394
%398 = load i32, i32* %14
%399 = sub nsw i32 %398, 1
%400 = load i32, i32* %19
%401 = mul nsw i32 %399, %400
%402 = shl i32 %401, 7
%403 = load i32, i32* %11
%404 = sub nsw i32 %403, 1
%405 = sdiv i32 %402, %404
store i32 %405, i32* %22
%406 = load i32, i32* %19
%407 = load i32, i32* %11
%408 = sub nsw i32 %407, 1
%409 = icmp eq i32 %406, %408
br i1 %409, label %410, label %413
410: ; preds = %397
%411 = load i32, i32* %22
%412 = add nsw i32 %411, -1
store i32 %412, i32* %22
br label %413
413: ; preds = %410, %397
%414 = load i32, i32* %22
%415 = and i32 %414, 127
store i32 %415, i32* %24
%416 = load i32, i32* %22
%417 = ashr i32 %416, 7
store i32 %417, i32* %22
br label %419
418: ; preds = %394
store i32 0, i32* %24
store i32 0, i32* %22
br label %419
419: ; preds = %418, %413
%420 = load i8*, i8** %13
%421 = load i32, i32* %23
%422 = sub nsw i32 %421, 1
%423 = load i32, i32* %14
%424 = mul nsw i32 %422, %423
%425 = load i32, i32* %22
%426 = sub nsw i32 %425, 1
%427 = add nsw i32 %424, %426
%428 = load i32, i32* %16
%429 = mul nsw i32 %427, %428
%430 = sext i32 %429 to i64
%431 = getelementptr inbounds i8, i8* %420, i64 %430
store i8* %431, i8** %32
store i32 0, i32* %21
br label %432
432: ; preds = %629, %419
%433 = load i32, i32* %21
%434 = load i32, i32* %16
%435 = icmp slt i32 %433, %434
br i1 %435, label %436, label %632
436: ; preds = %432
%437 = load i8*, i8** %32
%438 = load i32, i32* %14
%439 = add nsw i32 %438, 0
%440 = load i32, i32* %16
%441 = mul nsw i32 %439, %440
%442 = sext i32 %441 to i64
%443 = getelementptr inbounds i8, i8* %437, i64 %442
%444 = load i8, i8* %443
%445 = zext i8 %444 to i32
%446 = load i8*, i8** %32
%447 = load i32, i32* %14
%448 = add nsw i32 %447, 1
%449 = load i32, i32* %16
%450 = mul nsw i32 %448, %449
%451 = sext i32 %450 to i64
%452 = getelementptr inbounds i8, i8* %446, i64 %451
%453 = load i8, i8* %452
%454 = zext i8 %453 to i32
%455 = load i8*, i8** %32
%456 = load i32, i32* %14
%457 = add nsw i32 %456, 2
%458 = load i32, i32* %16
%459 = mul nsw i32 %457, %458
%460 = sext i32 %459 to i64
%461 = getelementptr inbounds i8, i8* %455, i64 %460
%462 = load i8, i8* %461
%463 = zext i8 %462 to i32
%464 = load i8*, i8** %32
%465 = load i32, i32* %14
%466 = add nsw i32 %465, 3
%467 = load i32, i32* %16
%468 = mul nsw i32 %466, %467
%469 = sext i32 %468 to i64
%470 = getelementptr inbounds i8, i8* %464, i64 %469
%471 = load i8, i8* %470
%472 = zext i8 %471 to i32
%473 = load i32, i32* %24
%474 = call i32 @icerp(i32 %445, i32 %454, i32 %463, i32 %472, i32 %473)
store i32 %474, i32* %28
%475 = load i32, i32* %23
%476 = icmp sgt i32 %475, 0
br i1 %476, label %477, label %504
477: ; preds = %436
%478 = load i8*, i8** %32
%479 = getelementptr inbounds i8, i8* %478, i64 0
%480 = load i8, i8* %479
%481 = zext i8 %480 to i32
%482 = load i8*, i8** %32
%483 = load i32, i32* %16
%484 = sext i32 %483 to i64
%485 = getelementptr inbounds i8, i8* %482, i64 %484
%486 = load i8, i8* %485
%487 = zext i8 %486 to i32
%488 = load i8*, i8** %32
%489 = load i32, i32* %16
%490 = mul nsw i32 2, %489
%491 = sext i32 %490 to i64
%492 = getelementptr inbounds i8, i8* %488, i64 %491
%493 = load i8, i8* %492
%494 = zext i8 %493 to i32
%495 = load i8*, i8** %32
%496 = load i32, i32* %16
%497 = mul nsw i32 3, %496
%498 = sext i32 %497 to i64
%499 = getelementptr inbounds i8, i8* %495, i64 %498
%500 = load i8, i8* %499
%501 = zext i8 %500 to i32
%502 = load i32, i32* %24
%503 = call i32 @icerp(i32 %481, i32 %487, i32 %494, i32 %501, i32 %502)
store i32 %503, i32* %27
br label %506
504: ; preds = %436
%505 = load i32, i32* %28
store i32 %505, i32* %27
br label %506
506: ; preds = %504, %477
%507 = load i8*, i8** %32
%508 = load i32, i32* %14
%509 = mul nsw i32 2, %508
%510 = add nsw i32 %509, 0
%511 = load i32, i32* %16
%512 = mul nsw i32 %510, %511
%513 = sext i32 %512 to i64
%514 = getelementptr inbounds i8, i8* %507, i64 %513
%515 = load i8, i8* %514
%516 = zext i8 %515 to i32
%517 = load i8*, i8** %32
%518 = load i32, i32* %14
%519 = mul nsw i32 2, %518
%520 = add nsw i32 %519, 1
%521 = load i32, i32* %16
%522 = mul nsw i32 %520, %521
%523 = sext i32 %522 to i64
%524 = getelementptr inbounds i8, i8* %517, i64 %523
%525 = load i8, i8* %524
%526 = zext i8 %525 to i32
%527 = load i8*, i8** %32
%528 = load i32, i32* %14
%529 = mul nsw i32 2, %528
%530 = add nsw i32 %529, 2
%531 = load i32, i32* %16
%532 = mul nsw i32 %530, %531
%533 = sext i32 %532 to i64
%534 = getelementptr inbounds i8, i8* %527, i64 %533
%535 = load i8, i8* %534
%536 = zext i8 %535 to i32
%537 = load i8*, i8** %32
%538 = load i32, i32* %14
%539 = mul nsw i32 2, %538
%540 = add nsw i32 %539, 3
%541 = load i32, i32* %16
%542 = mul nsw i32 %540, %541
%543 = sext i32 %542 to i64
%544 = getelementptr inbounds i8, i8* %537, i64 %543
%545 = load i8, i8* %544
%546 = zext i8 %545 to i32
%547 = load i32, i32* %24
%548 = call i32 @icerp(i32 %516, i32 %526, i32 %536, i32 %546, i32 %547)
store i32 %548, i32* %29
%549 = load i32, i32* %23
%550 = load i32, i32* %12
%551 = sub nsw i32 %550, 1
%552 = icmp slt i32 %549, %551
br i1 %552, label %553, label %596
553: ; preds = %506
%554 = load i8*, i8** %32
%555 = load i32, i32* %14
%556 = mul nsw i32 3, %555
%557 = add nsw i32 %556, 0
%558 = load i32, i32* %16
%559 = mul nsw i32 %557, %558
%560 = sext i32 %559 to i64
%561 = getelementptr inbounds i8, i8* %554, i64 %560
%562 = load i8, i8* %561
%563 = zext i8 %562 to i32
%564 = load i8*, i8** %32
%565 = load i32, i32* %14
%566 = mul nsw i32 3, %565
%567 = add nsw i32 %566, 1
%568 = load i32, i32* %16
%569 = mul nsw i32 %567, %568
%570 = sext i32 %569 to i64
%571 = getelementptr inbounds i8, i8* %564, i64 %570
%572 = load i8, i8* %571
%573 = zext i8 %572 to i32
%574 = load i8*, i8** %32
%575 = load i32, i32* %14
%576 = mul nsw i32 3, %575
%577 = add nsw i32 %576, 2
%578 = load i32, i32* %16
%579 = mul nsw i32 %577, %578
%580 = sext i32 %579 to i64
%581 = getelementptr inbounds i8, i8* %574, i64 %580
%582 = load i8, i8* %581
%583 = zext i8 %582 to i32
%584 = load i8*, i8** %32
%585 = load i32, i32* %14
%586 = mul nsw i32 3, %585
%587 = add nsw i32 %586, 3
%588 = load i32, i32* %16
%589 = mul nsw i32 %587, %588
%590 = sext i32 %589 to i64
%591 = getelementptr inbounds i8, i8* %584, i64 %590
%592 = load i8, i8* %591
%593 = zext i8 %592 to i32
%594 = load i32, i32* %24
%595 = call i32 @icerp(i32 %563, i32 %573, i32 %583, i32 %593, i32 %594)
store i32 %595, i32* %30
br label %598
596: ; preds = %506
%597 = load i32, i32* %29
store i32 %597, i32* %30
br label %598
598: ; preds = %596, %553
%599 = load i32, i32* %27
%600 = load i32, i32* %28
%601 = load i32, i32* %29
%602 = load i32, i32* %30
%603 = load i32, i32* %25
%604 = call i32 @icerp(i32 %599, i32 %600, i32 %601, i32 %602, i32 %603)
store i32 %604, i32* %26
%605 = load i32, i32* %26
%606 = icmp slt i32 %605, 0
br i1 %606, label %607, label %608
607: ; preds = %598
store i32 0, i32* %26
br label %608
608: ; preds = %607, %598
%609 = load i32, i32* %26
%610 = icmp sgt i32 %609, 255
br i1 %610, label %611, label %612
611: ; preds = %608
store i32 255, i32* %26
br label %612
612: ; preds = %611, %608
%613 = load i32, i32* %26
%614 = trunc i32 %613 to i8
%615 = load i8*, i8** %10
%616 = load i32, i32* %20
%617 = load i32, i32* %31
%618 = mul nsw i32 %616, %617
%619 = load i32, i32* %19
%620 = load i32, i32* %16
%621 = mul nsw i32 %619, %620
%622 = add nsw i32 %618, %621
%623 = load i32, i32* %21
%624 = add nsw i32 %622, %623
%625 = sext i32 %624 to i64
%626 = getelementptr inbounds i8, i8* %615, i64 %625
store i8 %614, i8* %626
%627 = load i8*, i8** %32
%628 = getelementptr inbounds i8, i8* %627, i32 1
store i8* %628, i8** %32
br label %629
629: ; preds = %612
%630 = load i32, i32* %21
%631 = add nsw i32 %630, 1
store i32 %631, i32* %21
br label %432
632: ; preds = %432
br label %633
633: ; preds = %632
%634 = load i32, i32* %19
%635 = add nsw i32 %634, 1
store i32 %635, i32* %19
br label %390
636: ; preds = %390
br label %637
637: ; preds = %636
%638 = load i32, i32* %20
%639 = add nsw i32 %638, 1
store i32 %639, i32* %20
br label %360
640: ; preds = %360
br label %641
641: ; preds = %640, %358
ret void
}

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