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

/* Forward declarations */

/* Type definitions */
typedef float GLushort;
typedef int GLint;

/* Variables and functions */
int floor(float);
int /*<<< orphan*/ halveImage(int, int, int, float const *, float *);
void scale_internal(GLint components, GLint widthin, GLint heightin,
                    const GLushort *datain, GLint widthout, GLint heightout,
                    GLushort *dataout) {
  float x, lowx, highx, convx, halfconvx;
  float y, lowy, highy, convy, halfconvy;
  float xpercent, ypercent;
  float percent;
  float totals[4];
  float area;
  int i, j, k, yint, xint, xindex, yindex;
  int temp;
  if (widthin == widthout * 2 && heightin == heightout * 2) {
    halveImage(components, widthin, heightin, datain, dataout);
    return;
  }
  convy = (float)heightin / heightout;
  convx = (float)widthin / widthout;
  halfconvx = convx / 2;
  halfconvy = convy / 2;
  for (i = 0; i < heightout; i++) {
    y = convy * (i + 0.5);
    if (heightin > heightout) {
      highy = y + halfconvy;
      lowy = y - halfconvy;
    } else {
      highy = y + 0.5;
      lowy = y - 0.5;
    }
    for (j = 0; j < widthout; j++) {
      x = convx * (j + 0.5);
      if (widthin > widthout) {
        highx = x + halfconvx;
        lowx = x - halfconvx;
      } else {
        highx = x + 0.5;
        lowx = x - 0.5;
      }
      totals[0] = totals[1] = totals[2] = totals[3] = 0.0;
      area = 0.0;
      y = lowy;
      yint = floor(y);
      while (y < highy) {
        yindex = (yint + heightin) % heightin;
        if (highy < yint + 1) {
          ypercent = highy - y;
        } else {
          ypercent = yint + 1 - y;
        }
        x = lowx;
        xint = floor(x);
        while (x < highx) {
          xindex = (xint + widthin) % widthin;
          if (highx < xint + 1) {
            xpercent = highx - x;
          } else {
            xpercent = xint + 1 - x;
          }
          percent = xpercent * ypercent;
          area += percent;
          temp = (xindex + (yindex * widthin)) * components;
          for (k = 0; k < components; k++) {
            totals[k] += datain[temp + k] * percent;
          }
          xint++;
          x = xint;
        }
        yint++;
        y = yint;
      }
      temp = (j + (i * widthout)) * components;
      for (k = 0; k < components; k++) {
        dataout[temp + k] = (totals[k] + 0.5) / area;
      }
    }
  }
}


x86 assembly (clang, -O0):
<scale_internal>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x1c(%rbp),%ecx
shl    $0x1,%ecx
cmp    %ecx,%eax
jne    1181 <scale_internal+0x61>
mov    -0xc(%rbp),%eax
mov    -0x20(%rbp),%ecx
shl    $0x1,%ecx
cmp    %ecx,%eax
jne    1181 <scale_internal+0x61>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    0x10(%rbp),%r8
call   1030 <halveImage@plt>
jmp    15bd <scale_internal+0x49d>
cvtsi2ssl -0xc(%rbp),%xmm0
cvtsi2ssl -0x20(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x44(%rbp)
cvtsi2ssl -0x8(%rbp),%xmm0
cvtsi2ssl -0x1c(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x30(%rbp)
movss  -0x30(%rbp),%xmm0
movss  0xe4c(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x34(%rbp)
movss  -0x44(%rbp),%xmm0
movss  0xe36(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x48(%rbp)
movl   $0x0,-0x78(%rbp)
mov    -0x78(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    15bd <scale_internal+0x49d>
movss  -0x44(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
cvtsi2sdl -0x78(%rbp),%xmm1
movsd  0xe0c(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x38(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x20(%rbp),%eax
jle    123c <scale_internal+0x11c>
movss  -0x38(%rbp),%xmm0
addss  -0x48(%rbp),%xmm0
movss  %xmm0,-0x40(%rbp)
movss  -0x38(%rbp),%xmm0
subss  -0x48(%rbp),%xmm0
movss  %xmm0,-0x3c(%rbp)
jmp    1278 <scale_internal+0x158>
movss  -0x38(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xdbb(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x40(%rbp)
movss  -0x38(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xd9d(%rip),%xmm1
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x3c(%rbp)
movl   $0x0,-0x7c(%rbp)
mov    -0x7c(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    15aa <scale_internal+0x48a>
movss  -0x30(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
cvtsi2sdl -0x7c(%rbp),%xmm1
movsd  0xd67(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x24(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jle    12e1 <scale_internal+0x1c1>
movss  -0x24(%rbp),%xmm0
addss  -0x34(%rbp),%xmm0
movss  %xmm0,-0x2c(%rbp)
movss  -0x24(%rbp),%xmm0
subss  -0x34(%rbp),%xmm0
movss  %xmm0,-0x28(%rbp)
jmp    131d <scale_internal+0x1fd>
movss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xd16(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x2c(%rbp)
movss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xcf8(%rip),%xmm1
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x28(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x64(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x68(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x6c(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x70(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x74(%rbp)
movss  -0x3c(%rbp),%xmm0
movss  %xmm0,-0x38(%rbp)
movss  -0x38(%rbp),%xmm0
call   1040 <floor@plt>
mov    %eax,-0x84(%rbp)
movss  -0x38(%rbp),%xmm1
movss  -0x40(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1520 <scale_internal+0x400>
mov    -0x84(%rbp),%eax
add    -0xc(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x90(%rbp)
movss  -0x40(%rbp),%xmm1
mov    -0x84(%rbp),%eax
add    $0x1,%eax
cvtsi2ss %eax,%xmm0
ucomiss %xmm1,%xmm0
jbe    13b4 <scale_internal+0x294>
movss  -0x40(%rbp),%xmm0
subss  -0x38(%rbp),%xmm0
movss  %xmm0,-0x50(%rbp)
jmp    13cb <scale_internal+0x2ab>
mov    -0x84(%rbp),%eax
add    $0x1,%eax
cvtsi2ss %eax,%xmm0
subss  -0x38(%rbp),%xmm0
movss  %xmm0,-0x50(%rbp)
movss  -0x28(%rbp),%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x24(%rbp),%xmm0
call   1040 <floor@plt>
mov    %eax,-0x88(%rbp)
movss  -0x24(%rbp),%xmm1
movss  -0x2c(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    14ff <scale_internal+0x3df>
mov    -0x88(%rbp),%eax
add    -0x8(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0x8c(%rbp)
movss  -0x2c(%rbp),%xmm1
mov    -0x88(%rbp),%eax
add    $0x1,%eax
cvtsi2ss %eax,%xmm0
ucomiss %xmm1,%xmm0
jbe    143a <scale_internal+0x31a>
movss  -0x2c(%rbp),%xmm0
subss  -0x24(%rbp),%xmm0
movss  %xmm0,-0x4c(%rbp)
jmp    1451 <scale_internal+0x331>
mov    -0x88(%rbp),%eax
add    $0x1,%eax
cvtsi2ss %eax,%xmm0
subss  -0x24(%rbp),%xmm0
movss  %xmm0,-0x4c(%rbp)
movss  -0x4c(%rbp),%xmm0
mulss  -0x50(%rbp),%xmm0
movss  %xmm0,-0x54(%rbp)
movss  -0x54(%rbp),%xmm0
addss  -0x74(%rbp),%xmm0
movss  %xmm0,-0x74(%rbp)
mov    -0x8c(%rbp),%eax
mov    -0x90(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    %ecx,%eax
imul   -0x4(%rbp),%eax
mov    %eax,-0x94(%rbp)
movl   $0x0,-0x80(%rbp)
mov    -0x80(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    14de <scale_internal+0x3be>
mov    -0x18(%rbp),%rax
mov    -0x94(%rbp),%ecx
add    -0x80(%rbp),%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm0
movss  -0x54(%rbp),%xmm2
movslq -0x80(%rbp),%rax
movss  -0x70(%rbp,%rax,4),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x70(%rbp,%rax,4)
mov    -0x80(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x80(%rbp)
jmp    1492 <scale_internal+0x372>
mov    -0x88(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x88(%rbp)
cvtsi2ssl -0x88(%rbp),%xmm0
ff
movss  %xmm0,-0x24(%rbp)
jmp    13e5 <scale_internal+0x2c5>
mov    -0x84(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x84(%rbp)
cvtsi2ssl -0x84(%rbp),%xmm0
ff
movss  %xmm0,-0x38(%rbp)
jmp    135f <scale_internal+0x23f>
mov    -0x7c(%rbp),%eax
mov    -0x78(%rbp),%ecx
imul   -0x1c(%rbp),%ecx
add    %ecx,%eax
imul   -0x4(%rbp),%eax
mov    %eax,-0x94(%rbp)
movl   $0x0,-0x80(%rbp)
mov    -0x80(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1597 <scale_internal+0x477>
movslq -0x80(%rbp),%rax
movss  -0x70(%rbp,%rax,4),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xaa9(%rip),%xmm1
addsd  %xmm1,%xmm0
movss  -0x74(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    0x10(%rbp),%rax
mov    -0x94(%rbp),%ecx
add    -0x80(%rbp),%ecx
movslq %ecx,%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x80(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x80(%rbp)
jmp    153d <scale_internal+0x41d>
jmp    159c <scale_internal+0x47c>
mov    -0x7c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7c(%rbp)
jmp    127f <scale_internal+0x15f>
jmp    15af <scale_internal+0x48f>
mov    -0x78(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x78(%rbp)
jmp    11da <scale_internal+0xba>
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scale_internal>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x128,%rsp
mov    %rcx,%r13
mov    %esi,%r15d
mov    %edi,%ebx
mov    0x160(%rsp),%rax
mov    %rax,0x40(%rsp)
mov    %r8,0x38(%rsp)
lea    (%r8,%r8,1),%eax
cmp    %esi,%eax
jne    117e <scale_internal+0x5e>
lea    (%r9,%r9,1),%eax
cmp    %edx,%eax
jne    117e <scale_internal+0x5e>
mov    %ebx,%edi
mov    %r15d,%esi
mov    %r13,%rcx
mov    0x40(%rsp),%r8
add    $0x128,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <halveImage@plt>
mov    %edx,0x30(%rsp)
test   %r9d,%r9d
jle    17fa <scale_internal+0x6da>
mov    0x30(%rsp),%eax
cvtsi2ss %eax,%xmm0
cvtsi2ss %r9d,%xmm2
cvtsi2ss %r15d,%xmm1
cvtsi2ssl 0x38(%rsp),%xmm3
divss  %xmm2,%xmm0
movss  0xe51(%rip),%xmm2
movaps %xmm0,%xmm4
mulss  %xmm2,%xmm4
movaps %xmm4,0x70(%rsp)
movss  %xmm4,0x24(%rsp)
cmp    %r9d,%eax
jg     11cc <scale_internal+0xac>
movss  %xmm2,0x24(%rsp)
divss  %xmm3,%xmm1
movaps 0xe39(%rip),%xmm3
movss  0xe25(%rip),%xmm4
movss  %xmm4,0x2c(%rsp)
jle    11ef <scale_internal+0xcf>
movaps 0x70(%rsp),%xmm4
xorps  %xmm3,%xmm4
movaps %xmm4,0x70(%rsp)
movaps %xmm1,%xmm4
mulss  %xmm2,%xmm4
movss  %xmm4,0x28(%rsp)
cmp    0x38(%rsp),%r15d
jg     120e <scale_internal+0xee>
movss  %xmm2,0x28(%rsp)
jle    1219 <scale_internal+0xf9>
xorps  %xmm3,%xmm4
movss  %xmm4,0x2c(%rsp)
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,0x88(%rsp)
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
movsd  %xmm0,0xd0(%rsp)
movslq %ebx,%rdx
mov    0x38(%rsp),%rax
movslq %eax,%r8
mov    %r9d,%esi
mov    %rsi,0x98(%rsp)
mov    %eax,%eax
mov    %rax,0xe0(%rsp)
mov    %edx,%r12d
mov    %r12d,%r14d
and    $0xfffffff8,%r14d
lea    -0x8(%r14),%r10
mov    %r10,%r9
shr    $0x3,%r9
add    $0x1,%r9
mov    %r12d,%eax
and    $0xfffffffc,%eax
mov    %rax,0xc8(%rsp)
add    $0xfffffffffffffffc,%rax
mov    %rax,0xc0(%rsp)
mov    %rax,%rbp
shr    $0x2,%rbp
add    $0x1,%rbp
mov    %r9,%r11
and    $0xfffffffffffffffe,%r11
mov    %rbp,%rax
mov    %rbp,0xb8(%rsp)
and    $0xfffffffffffffffe,%rbp
mov    %rbp,0xb0(%rsp)
lea    0x30(%r13),%rbp
mov    %r8,0x80(%rsp)
imul   %rdx,%r8
shl    $0x2,%r8
mov    %r8,0x90(%rsp)
movsd  0xd6a(%rip),%xmm4
mov    0x40(%rsp),%rax
lea    0x10(%rax),%rcx
mov    %rcx,0x60(%rsp)
mov    %rdx,0xa0(%rsp)
lea    0x0(,%rdx,4),%rcx
mov    %rcx,0xd8(%rsp)
mov    %rax,0x58(%rsp)
xor    %eax,%eax
mov    %r10,0x120(%rsp)
mov    %r9,0x118(%rsp)
mov    %r11,0x110(%rsp)
mov    %rbp,0x108(%rsp)
mov    %r13,0x100(%rsp)
jmp    135c <scale_internal+0x23c>
nopl   (%rax)
mov    0x68(%rsp),%rcx
add    $0x1,%rcx
mov    0x90(%rsp),%rax
add    %rax,0x60(%rsp)
add    %rax,0x58(%rsp)
mov    %rcx,%rax
cmp    0x98(%rsp),%rcx
je     17fa <scale_internal+0x6da>
mov    %rax,0x68(%rsp)
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
addsd  %xmm4,%xmm0
cmpl   $0x0,0x38(%rsp)
jle    1330 <scale_internal+0x210>
mulsd  0x88(%rsp),%xmm0
xorps  %xmm1,%xmm1
cvtsd2ss %xmm0,%xmm1
movaps 0x70(%rsp),%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,0x1c(%rsp)
addss  0x24(%rsp),%xmm1
movss  %xmm1,0x20(%rsp)
mov    0x68(%rsp),%rax
imul   0x80(%rsp),%rax
mov    %rax,0xa8(%rsp)
mov    0x58(%rsp),%rdx
mov    0x60(%rsp),%rsi
xor    %edi,%edi
jmp    13f0 <scale_internal+0x2d0>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%rdi
mov    0xd8(%rsp),%rax
add    %rax,%rsi
add    %rax,%rdx
cmp    0xe0(%rsp),%rdi
je     1330 <scale_internal+0x210>
mov    %rsi,0xf0(%rsp)
mov    %rdx,0xf8(%rsp)
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
movss  0x1c(%rsp),%xmm0
mov    %rdi,%rbp
call   1040 <floor@plt>
movss  0x20(%rsp),%xmm0
ucomiss 0x1c(%rsp),%xmm0
mov    %rbp,0xe8(%rsp)
xorps  %xmm0,%xmm0
cvtsi2sd %ebp,%xmm0
addsd  0xc09(%rip),%xmm0
xorps  %xmm7,%xmm7
jbe    1680 <scale_internal+0x560>
mulsd  0xd0(%rsp),%xmm0
xorps  %xmm9,%xmm9
cvtsd2ss %xmm0,%xmm9
movss  0x2c(%rsp),%xmm0
addss  %xmm9,%xmm0
addss  0x28(%rsp),%xmm9
xorps  %xmm7,%xmm7
movss  0x1c(%rsp),%xmm8
movss  %xmm9,0x4c(%rsp)
movss  %xmm0,0x48(%rsp)
jmp    149d <scale_internal+0x37d>
nopl   (%rax)
mov    %rbp,%r14
movss  0x34(%rsp),%xmm7
movss  0x20(%rsp),%xmm1
ucomiss %xmm8,%xmm1
mov    0x54(%rsp),%eax
jbe    1680 <scale_internal+0x560>
movss  %xmm7,0x34(%rsp)
mov    %r14,%rbp
movss  %xmm8,0x50(%rsp)
mov    %eax,%r14d
lea    0x1(%r14),%r13d
call   1040 <floor@plt>
movss  0x48(%rsp),%xmm0
movss  0x4c(%rsp),%xmm9
ucomiss %xmm0,%xmm9
mov    %r13d,0x54(%rsp)
xorps  %xmm8,%xmm8
cvtsi2ss %r13d,%xmm8
jbe    1480 <scale_internal+0x360>
mov    %eax,%ecx
movss  0x20(%rsp),%xmm1
minss  %xmm8,%xmm1
subss  0x50(%rsp),%xmm1
mov    0x30(%rsp),%esi
add    %esi,%r14d
mov    %r14d,%eax
cltd
idiv   %esi
mov    %edx,%esi
imul   %r15d,%esi
movaps %xmm0,%xmm2
mov    %rbp,%r14
mov    0x120(%rsp),%r8
mov    0x118(%rsp),%r9
mov    0x110(%rsp),%r10
mov    0x108(%rsp),%r11
mov    0x100(%rsp),%r13
movss  0x34(%rsp),%xmm7
jmp    154e <scale_internal+0x42e>
cs nopw 0x0(%rax,%rax,1)
addss  %xmm3,%xmm7
ucomiss %xmm2,%xmm9
jbe    1489 <scale_internal+0x369>
mov    %ecx,%eax
movaps %xmm2,%xmm4
lea    0x1(%rax),%ecx
xorps  %xmm2,%xmm2
cvtsi2ss %ecx,%xmm2
movaps %xmm9,%xmm3
minss  %xmm2,%xmm3
subss  %xmm4,%xmm3
mulss  %xmm1,%xmm3
test   %ebx,%ebx
jle    1540 <scale_internal+0x420>
add    %r15d,%eax
cltd
idiv   %r15d
add    %esi,%edx
imul   %ebx,%edx
movslq %edx,%rax
cmp    $0x8,%ebx
jae    1590 <scale_internal+0x470>
xor    %edx,%edx
jmp    1639 <scale_internal+0x519>
nopl   0x0(%rax)
movaps %xmm3,%xmm4
shufps $0x0,%xmm3,%xmm4
test   %r8,%r8
je     1671 <scale_internal+0x551>
lea    (%r11,%rax,4),%rdi
mov    %r10,%rbp
xor    %edx,%edx
nopl   0x0(%rax)
movups -0x30(%rdi,%rdx,4),%xmm5
movups -0x20(%rdi,%rdx,4),%xmm6
mulps  %xmm4,%xmm5
addps  (%rsp,%rdx,4),%xmm5
mulps  %xmm4,%xmm6
addps  0x10(%rsp,%rdx,4),%xmm6
movaps %xmm5,(%rsp,%rdx,4)
movaps %xmm6,0x10(%rsp,%rdx,4)
movups -0x10(%rdi,%rdx,4),%xmm5
mulps  %xmm4,%xmm5
addps  0x20(%rsp,%rdx,4),%xmm5
movups (%rdi,%rdx,4),%xmm6
mulps  %xmm4,%xmm6
addps  0x30(%rsp,%rdx,4),%xmm6
movaps %xmm5,0x20(%rsp,%rdx,4)
movaps %xmm6,0x30(%rsp,%rdx,4)
add    $0x10,%rdx
add    $0xfffffffffffffffe,%rbp
jne    15b0 <scale_internal+0x490>
test   $0x1,%r9b
je     162d <scale_internal+0x50d>
lea    (%rdx,%rax,1),%rdi
movups 0x0(%r13,%rdi,4),%xmm5
movups 0x10(%r13,%rdi,4),%xmm6
mulps  %xmm4,%xmm5
addps  (%rsp,%rdx,4),%xmm5
mulps  %xmm4,%xmm6
addps  0x10(%rsp,%rdx,4),%xmm6
movaps %xmm5,(%rsp,%rdx,4)
movaps %xmm6,0x10(%rsp,%rdx,4)
mov    %r14,%rdx
cmp    %r12,%r14
je     1540 <scale_internal+0x420>
lea    0x0(,%rax,4),%rax
add    %r13,%rax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movss  (%rax,%rdx,4),%xmm4
mulss  %xmm3,%xmm4
addss  (%rsp,%rdx,4),%xmm4
movss  %xmm4,(%rsp,%rdx,4)
add    $0x1,%rdx
cmp    %rdx,%r12
jne    1650 <scale_internal+0x530>
jmp    1540 <scale_internal+0x420>
xor    %edx,%edx
test   $0x1,%r9b
jne    1605 <scale_internal+0x4e5>
jmp    162d <scale_internal+0x50d>
nopl   0x0(%rax,%rax,1)
test   %ebx,%ebx
movsd  0x9b6(%rip),%xmm4
movapd 0x98e(%rip),%xmm5
mov    0xf8(%rsp),%rdx
mov    0xf0(%rsp),%rsi
mov    0xe8(%rsp),%rdi
jle    13d0 <scale_internal+0x2b0>
xorps  %xmm0,%xmm0
cvtss2sd %xmm7,%xmm0
cmp    $0x4,%ebx
jae    16d0 <scale_internal+0x5b0>
xor    %eax,%eax
jmp    17c0 <scale_internal+0x6a0>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movaps %xmm0,%xmm1
movlhps %xmm0,%xmm1
cmpq   $0x0,0xc0(%rsp)
je     17e8 <scale_internal+0x6c8>
mov    0xb0(%rsp),%rcx
xor    %eax,%eax
nop
cvtps2pd (%rsp,%rax,4),%xmm2
cvtps2pd 0x8(%rsp,%rax,4),%xmm3
addpd  %xmm5,%xmm3
addpd  %xmm5,%xmm2
divpd  %xmm1,%xmm2
divpd  %xmm1,%xmm3
cvtpd2ps %xmm3,%xmm3
cvtpd2ps %xmm2,%xmm2
unpcklpd %xmm3,%xmm2
movupd %xmm2,-0x10(%rsi,%rax,4)
cvtps2pd 0x10(%rsp,%rax,4),%xmm2
cvtps2pd 0x18(%rsp,%rax,4),%xmm3
addpd  %xmm5,%xmm3
addpd  %xmm5,%xmm2
divpd  %xmm1,%xmm2
divpd  %xmm1,%xmm3
cvtpd2ps %xmm3,%xmm3
cvtpd2ps %xmm2,%xmm2
unpcklpd %xmm3,%xmm2
movupd %xmm2,(%rsi,%rax,4)
add    $0x8,%rax
add    $0xfffffffffffffffe,%rcx
jne    16f0 <scale_internal+0x5d0>
testb  $0x1,0xb8(%rsp)
01
je     17a0 <scale_internal+0x680>
mov    0xa8(%rsp),%rcx
add    %rdi,%rcx
cvtps2pd (%rsp,%rax,4),%xmm2
cvtps2pd 0x8(%rsp,%rax,4),%xmm3
addpd  %xmm5,%xmm3
addpd  %xmm5,%xmm2
divpd  %xmm1,%xmm2
divpd  %xmm1,%xmm3
cvtpd2ps %xmm3,%xmm1
cvtpd2ps %xmm2,%xmm2
imul   0xa0(%rsp),%rcx
unpcklpd %xmm1,%xmm2
add    %rax,%rcx
mov    0x40(%rsp),%rax
movupd %xmm2,(%rax,%rcx,4)
mov    0xc8(%rsp),%rcx
mov    %rcx,%rax
cmp    %r12,%rcx
je     13d0 <scale_internal+0x2b0>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movss  (%rsp,%rax,4),%xmm1
cvtss2sd %xmm1,%xmm1
addsd  %xmm4,%xmm1
divsd  %xmm0,%xmm1
cvtsd2ss %xmm1,%xmm1
movss  %xmm1,(%rdx,%rax,4)
add    $0x1,%rax
cmp    %rax,%r12
jne    17c0 <scale_internal+0x6a0>
jmp    13d0 <scale_internal+0x2b0>
xor    %eax,%eax
testb  $0x1,0xb8(%rsp)
01
jne    175a <scale_internal+0x63a>
jmp    17a0 <scale_internal+0x680>
add    $0x128,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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