#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 */
struct printable_data {
  int dummy;
};

/* Variables and functions */
float INFINITY;
int /*<<< orphan*/ isfinite(float);
scalar_t__ isnan(float);
int /*<<< orphan*/ setnumber(struct printable_data *, char *, long double);
int /*<<< orphan*/ setnumbers(struct printable_data *, char *, long double *,
                              int);
float sum(float *, int);
float vnormf(float *, int);
void compute_stuff_basic(struct printable_data *p, float *x, int w, int h,
                         int pd) {
  int ns = w * h * pd, rns = 0, rnz = 0, nnan = 0, ninf = 0;
  float minsample = INFINITY, maxsample = -INFINITY;
  long double avgsample = 0;
  long double avgnzsample = 0;
  float sumsamples = 0;
  for (int i = 0; i < ns; i++) {
    float y = x[i];
    if (isnan(y)) {
      nnan += 1;
      continue;
    }
    if (!isfinite(y))
      ninf += 1;
    if (y < minsample)
      minsample = y;
    if (y > maxsample)
      maxsample = y;
    sumsamples += y;
    avgsample += y;
    rns += 1;
    if (y) {
      avgnzsample += y;
      rnz += 1;
    }
  }
  avgsample /= rns;
  avgnzsample /= rnz;
  setnumber(p, "minsample", minsample);
  setnumber(p, "maxsample", maxsample);
  setnumber(p, "avgsample", avgsample);
  setnumber(p, "avgnzsample", avgnzsample);
  setnumber(p, "sumsamples", sumsamples);
  float ks = sum(x, ns);
  setnumber(p, "kahsamples", ks);
  setnumber(p, "nnan", nnan);
  setnumber(p, "ninf", ninf);
  int np = w * h, minpixel_idx, maxpixel_idx, rnp = 0;
  float minpixel = INFINITY, maxpixel = -INFINITY;
  long double avgpixel[5] = {0}, avgnorm = 0;
  int minidx = -1, maxidx = -1;
  for (int j = 0; j < pd; j++)
    avgpixel[j] = 0;
  for (int i = 0; i < np; i++) {
    float xnorm = vnormf(x + pd * i, pd);
    if (isnan(xnorm))
      continue;
    if (xnorm < minpixel) {
      minidx = i;
      minpixel = xnorm;
    }
    if (xnorm > maxpixel) {
      maxidx = i;
      maxpixel = xnorm;
    }
    for (int j = 0; j < pd; j++)
      avgpixel[j] += x[pd * i + j];
    avgnorm += xnorm;
    rnp += 1;
  }
  setnumbers(p, "sumpixels", avgpixel, pd);
  avgnorm /= rnp;
  long double mipi[pd], mapi[pd];
  for (int j = 0; j < pd; j++) {
    mipi[j] = x[minidx * pd + j];
    mapi[j] = x[maxidx * pd + j];
    avgpixel[j] /= rnp;
  }
  setnumbers(p, "minpixel", mipi, pd);
  setnumbers(p, "maxpixel", mapi, pd);
  setnumbers(p, "avgpixel", avgpixel, pd);
  setnumber(p, "error", avgnorm);
}


x86 assembly (clang, -O0):
<compute_stuff_basic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x150,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x18(%rbp),%ecx
imul   %ecx,%eax
mov    -0x1c(%rbp),%ecx
imul   %ecx,%eax
mov    %eax,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
movl   $0x0,-0x30(%rbp)
mov    0x2e36(%rip),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x34(%rbp)
movss  (%rax),%xmm0
movaps 0xe3a(%rip),%xmm1
pxor   %xmm1,%xmm0
movss  %xmm0,-0x38(%rbp)
fldz
fld    %st(0)
fstpt  -0x50(%rbp)
fstpt  -0x60(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x64(%rbp)
movl   $0x0,-0x68(%rbp)
mov    -0x68(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    12e4 <compute_stuff_basic+0x184>
mov    -0x10(%rbp),%rax
movslq -0x68(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
movss  %xmm0,-0x6c(%rbp)
movss  -0x6c(%rbp),%xmm0
call   1080 <isnan@plt>
cmp    $0x0,%rax
je     1228 <compute_stuff_basic+0xc8>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    12d6 <compute_stuff_basic+0x176>
movss  -0x6c(%rbp),%xmm0
call   1070 <isfinite@plt>
cmp    $0x0,%eax
jne    1244 <compute_stuff_basic+0xe4>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
movss  -0x6c(%rbp),%xmm1
movss  -0x34(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1261 <compute_stuff_basic+0x101>
movss  -0x6c(%rbp),%xmm0
movss  %xmm0,-0x34(%rbp)
movss  -0x6c(%rbp),%xmm0
ucomiss -0x38(%rbp),%xmm0
jbe    127a <compute_stuff_basic+0x11a>
movss  -0x6c(%rbp),%xmm0
movss  %xmm0,-0x38(%rbp)
movss  -0x6c(%rbp),%xmm1
movss  -0x64(%rbp),%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x64(%rbp)
flds   -0x6c(%rbp)
fldt   -0x50(%rbp)
faddp  %st,%st(1)
fstpt  -0x50(%rbp)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
movss  -0x6c(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    12bd <compute_stuff_basic+0x15d>
jp     12bd <compute_stuff_basic+0x15d>
jmp    12d1 <compute_stuff_basic+0x171>
flds   -0x6c(%rbp)
fldt   -0x60(%rbp)
faddp  %st,%st(1)
fstpt  -0x60(%rbp)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    12d6 <compute_stuff_basic+0x176>
mov    -0x68(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x68(%rbp)
jmp    11e8 <compute_stuff_basic+0x88>
mov    -0x24(%rbp),%eax
mov    %eax,-0x134(%rbp)
fildl  -0x134(%rbp)
fldt   -0x50(%rbp)
fdivp  %st,%st(1)
fstpt  -0x50(%rbp)
mov    -0x28(%rbp),%eax
mov    %eax,-0x130(%rbp)
fildl  -0x130(%rbp)
fldt   -0x60(%rbp)
fdivp  %st,%st(1)
fstpt  -0x60(%rbp)
mov    -0x8(%rbp),%rdi
flds   -0x34(%rbp)
sub    $0x10,%rsp
mov    %rsp,%rax
fstpt  (%rax)
lea    0xce7(%rip),%rsi
call   1030 <setnumber@plt>
add    $0x10,%rsp
mov    -0x8(%rbp),%rdi
flds   -0x38(%rbp)
sub    $0x10,%rsp
mov    %rsp,%rax
fstpt  (%rax)
lea    0xcd1(%rip),%rsi
call   1030 <setnumber@plt>
add    $0x10,%rsp
mov    -0x8(%rbp),%rdi
fldt   -0x50(%rbp)
sub    $0x10,%rsp
mov    %rsp,%rax
fstpt  (%rax)
lea    0xcbb(%rip),%rsi
call   1030 <setnumber@plt>
add    $0x10,%rsp
mov    -0x8(%rbp),%rdi
fldt   -0x60(%rbp)
sub    $0x10,%rsp
mov    %rsp,%rax
fstpt  (%rax)
lea    0xca5(%rip),%rsi
call   1030 <setnumber@plt>
add    $0x10,%rsp
mov    -0x8(%rbp),%rdi
flds   -0x64(%rbp)
sub    $0x10,%rsp
mov    %rsp,%rax
fstpt  (%rax)
lea    0xc91(%rip),%rsi
call   1030 <setnumber@plt>
add    $0x10,%rsp
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%esi
call   1060 <sum@plt>
movss  %xmm0,-0x70(%rbp)
mov    -0x8(%rbp),%rdi
flds   -0x70(%rbp)
sub    $0x10,%rsp
mov    %rsp,%rax
fstpt  (%rax)
lea    0xc6b(%rip),%rsi
call   1030 <setnumber@plt>
add    $0x10,%rsp
mov    -0x8(%rbp),%rdi
mov    -0x2c(%rbp),%eax
mov    %eax,-0x12c(%rbp)
fildl  -0x12c(%rbp)
sub    $0x10,%rsp
mov    %rsp,%rax
fstpt  (%rax)
lea    0xc4a(%rip),%rsi
call   1030 <setnumber@plt>
add    $0x10,%rsp
mov    -0x8(%rbp),%rdi
mov    -0x30(%rbp),%eax
mov    %eax,-0x128(%rbp)
fildl  -0x128(%rbp)
sub    $0x10,%rsp
mov    %rsp,%rax
fstpt  (%rax)
lea    0xc23(%rip),%rsi
call   1030 <setnumber@plt>
add    $0x10,%rsp
mov    -0x14(%rbp),%eax
mov    -0x18(%rbp),%ecx
imul   %ecx,%eax
mov    %eax,-0x74(%rbp)
movl   $0x0,-0x80(%rbp)
mov    0x2b93(%rip),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x84(%rbp)
ff
movss  (%rax),%xmm0
movaps 0xb94(%rip),%xmm1
pxor   %xmm1,%xmm0
movss  %xmm0,-0x88(%rbp)
ff
xorps  %xmm0,%xmm0
movaps %xmm0,-0xa0(%rbp)
movaps %xmm0,-0xb0(%rbp)
movaps %xmm0,-0xc0(%rbp)
movaps %xmm0,-0xd0(%rbp)
movaps %xmm0,-0xe0(%rbp)
fldz
fstpt  -0xf0(%rbp)
movl   $0xffffffff,-0xf4(%rbp)
ff ff ff
movl   $0xffffffff,-0xf8(%rbp)
ff ff ff
movl   $0x0,-0xfc(%rbp)
mov    -0xfc(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    14fb <compute_stuff_basic+0x39b>
movslq -0xfc(%rbp),%rax
shl    $0x4,%rax
fldz
fstpt  -0xe0(%rbp,%rax,1)
mov    -0xfc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xfc(%rbp)
jmp    14c4 <compute_stuff_basic+0x364>
movl   $0x0,-0x100(%rbp)
mov    -0x100(%rbp),%eax
cmp    -0x74(%rbp),%eax
jge    1650 <compute_stuff_basic+0x4f0>
mov    -0x10(%rbp),%rdi
mov    -0x1c(%rbp),%eax
imul   -0x100(%rbp),%eax
cltq
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x1c(%rbp),%esi
call   1050 <vnormf@plt>
movss  %xmm0,-0x104(%rbp)
ff
movss  -0x104(%rbp),%xmm0
ff
call   1080 <isnan@plt>
cmp    $0x0,%rax
je     1557 <compute_stuff_basic+0x3f7>
jmp    163c <compute_stuff_basic+0x4dc>
movss  -0x104(%rbp),%xmm1
ff
movss  -0x84(%rbp),%xmm0
ff
ucomiss %xmm1,%xmm0
jbe    158c <compute_stuff_basic+0x42c>
mov    -0x100(%rbp),%eax
mov    %eax,-0xf4(%rbp)
movss  -0x104(%rbp),%xmm0
ff
movss  %xmm0,-0x84(%rbp)
ff
movss  -0x104(%rbp),%xmm0
ff
ucomiss -0x88(%rbp),%xmm0
jbe    15bd <compute_stuff_basic+0x45d>
mov    -0x100(%rbp),%eax
mov    %eax,-0xf8(%rbp)
movss  -0x104(%rbp),%xmm0
ff
movss  %xmm0,-0x88(%rbp)
ff
movl   $0x0,-0x108(%rbp)
mov    -0x108(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    161f <compute_stuff_basic+0x4bf>
mov    -0x10(%rbp),%rcx
mov    -0x1c(%rbp),%edx
mov    -0x100(%rbp),%eax
imul   %eax,%edx
movslq -0x108(%rbp),%rax
mov    %eax,%esi
add    %esi,%edx
movslq %edx,%rdx
flds   (%rcx,%rdx,4)
shl    $0x4,%rax
fldt   -0xe0(%rbp,%rax,1)
faddp  %st,%st(1)
fstpt  -0xe0(%rbp,%rax,1)
mov    -0x108(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x108(%rbp)
jmp    15c7 <compute_stuff_basic+0x467>
flds   -0x104(%rbp)
fldt   -0xf0(%rbp)
faddp  %st,%st(1)
fstpt  -0xf0(%rbp)
mov    -0x80(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x80(%rbp)
mov    -0x100(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x100(%rbp)
jmp    1505 <compute_stuff_basic+0x3a5>
mov    -0x8(%rbp),%rdi
mov    -0x1c(%rbp),%ecx
lea    0x9fc(%rip),%rsi
lea    -0xe0(%rbp),%rdx
call   1040 <setnumbers@plt>
mov    -0x80(%rbp),%eax
mov    %eax,-0x138(%rbp)
fildl  -0x138(%rbp)
fldt   -0xf0(%rbp)
fdivp  %st,%st(1)
fstpt  -0xf0(%rbp)
mov    -0x1c(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x110(%rbp)
mov    %rax,%rdx
shl    $0x4,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x150(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x118(%rbp)
mov    -0x1c(%rbp),%eax
mov    %rax,%rdx
shl    $0x4,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x148(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x120(%rbp)
movl   $0x0,-0x124(%rbp)
mov    -0x124(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    178a <compute_stuff_basic+0x62a>
mov    -0x148(%rbp),%rax
mov    -0x150(%rbp),%rcx
mov    -0x10(%rbp),%rsi
mov    -0xf4(%rbp),%edi
mov    -0x1c(%rbp),%edx
imul   %edx,%edi
movslq -0x124(%rbp),%rdx
mov    %edx,%r8d
add    %r8d,%edi
movslq %edi,%rdi
flds   (%rsi,%rdi,4)
shl    $0x4,%rdx
fstpt  (%rcx,%rdx,1)
mov    -0x10(%rbp),%rdx
mov    -0xf8(%rbp),%esi
mov    -0x1c(%rbp),%ecx
imul   %ecx,%esi
movslq -0x124(%rbp),%rcx
mov    %ecx,%edi
add    %edi,%esi
movslq %esi,%rsi
flds   (%rdx,%rsi,4)
shl    $0x4,%rcx
fstpt  (%rax,%rcx,1)
mov    -0x80(%rbp),%eax
mov    %eax,-0x13c(%rbp)
fildl  -0x13c(%rbp)
movslq -0x124(%rbp),%rax
shl    $0x4,%rax
fldt   -0xe0(%rbp,%rax,1)
fdivp  %st,%st(1)
fstpt  -0xe0(%rbp,%rax,1)
mov    -0x124(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x124(%rbp)
jmp    16dd <compute_stuff_basic+0x57d>
mov    -0x150(%rbp),%rdx
mov    -0x8(%rbp),%rdi
mov    -0x1c(%rbp),%ecx
lea    0x8c5(%rip),%rsi
call   1040 <setnumbers@plt>
mov    -0x148(%rbp),%rdx
mov    -0x8(%rbp),%rdi
mov    -0x1c(%rbp),%ecx
lea    0x8b4(%rip),%rsi
call   1040 <setnumbers@plt>
mov    -0x8(%rbp),%rdi
mov    -0x1c(%rbp),%ecx
lea    0x8aa(%rip),%rsi
lea    -0xe0(%rbp),%rdx
call   1040 <setnumbers@plt>
mov    -0x8(%rbp),%rdi
fldt   -0xf0(%rbp)
sub    $0x10,%rsp
mov    %rsp,%rax
fstpt  (%rax)
lea    0x88d(%rip),%rsi
call   1030 <setnumber@plt>
add    $0x10,%rsp
mov    -0x110(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compute_stuff_basic>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x128,%rsp
mov    %r8d,-0x60(%rbp)
mov    %rsi,-0x50(%rbp)
mov    %rdi,-0xb8(%rbp)
imul   %ecx,%edx
mov    %edx,%ecx
imul   %r8d,%ecx
mov    0x2e55(%rip),%rax
movss  (%rax),%xmm1
movaps 0xe62(%rip),%xmm0
movaps %xmm1,-0x100(%rbp)
xorps  %xmm1,%xmm0
movaps %xmm0,-0xb0(%rbp)
fldz
test   %ecx,%ecx
mov    %edx,-0x2c(%rbp)
mov    %ecx,-0x30(%rbp)
jle    12bf <compute_stuff_basic+0x15f>
fstp   %st(0)
mov    %ecx,%r13d
fldz
xor    %r15d,%r15d
fld    %st(0)
fchs
fstpt  -0x7c(%rbp)
xor    %ebx,%ebx
xor    %r12d,%r12d
xor    %r14d,%r14d
movl   $0x0,-0x5c(%rbp)
fld    %st(0)
fstpt  -0x40(%rbp)
fstpt  -0x70(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0xa0(%rbp)
ff
jmp    1299 <compute_stuff_basic+0x139>
nopw   0x0(%rax,%rax,1)
movss  -0x88(%rbp),%xmm0
ff
call   1070 <isfinite@plt>
cmp    $0x1,%eax
adcl   $0x0,-0x5c(%rbp)
movss  -0x88(%rbp),%xmm3
ff
movaps %xmm3,%xmm0
minss  -0x100(%rbp),%xmm0
ff
movaps %xmm3,%xmm1
maxss  -0xb0(%rbp),%xmm1
ff
movss  -0xa0(%rbp),%xmm2
ff
addss  %xmm3,%xmm2
movss  %xmm2,-0xa0(%rbp)
ff
movss  %xmm3,-0xec(%rbp)
ff
add    $0x1,%ebx
xorps  %xmm2,%xmm2
ucomiss %xmm2,%xmm3
flds   -0xec(%rbp)
fldt   -0x7c(%rbp)
fcmovne %st(1),%st
fldt   -0x40(%rbp)
fadd   %st(2),%st
fstpt  -0x40(%rbp)
fcmovu %st(1),%st
fstp   %st(1)
cmpneqss %xmm2,%xmm3
movd   %xmm3,%eax
fldt   -0x70(%rbp)
faddp  %st,%st(1)
fstpt  -0x70(%rbp)
sub    %eax,%r12d
movaps %xmm1,-0xb0(%rbp)
movaps %xmm0,-0x100(%rbp)
add    $0x1,%r15
cmp    %r15,%r13
je     12e1 <compute_stuff_basic+0x181>
mov    -0x50(%rbp),%rax
movss  (%rax,%r15,4),%xmm0
movss  %xmm0,-0x88(%rbp)
ff
call   1080 <isnan@plt>
test   %rax,%rax
je     1200 <compute_stuff_basic+0xa0>
add    $0x1,%r14d
jmp    1290 <compute_stuff_basic+0x130>
movl   $0x0,-0x5c(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0xa0(%rbp)
ff
fld    %st(0)
fstpt  -0x70(%rbp)
fstpt  -0x40(%rbp)
xor    %r14d,%r14d
xor    %r12d,%r12d
xor    %ebx,%ebx
mov    %ebx,-0xdc(%rbp)
fldt   -0x40(%rbp)
fidivl -0xdc(%rbp)
fstpt  -0x40(%rbp)
mov    %r12d,-0xe0(%rbp)
fldt   -0x70(%rbp)
fidivl -0xe0(%rbp)
fstpt  -0x88(%rbp)
movaps -0x100(%rbp),%xmm0
movss  %xmm0,-0xd8(%rbp)
ff
flds   -0xd8(%rbp)
sub    $0x10,%rsp
fstpt  (%rsp)
lea    0xce4(%rip),%rsi
mov    -0xb8(%rbp),%rbx
mov    %rbx,%rdi
call   1030 <setnumber@plt>
add    $0x10,%rsp
movaps -0xb0(%rbp),%xmm0
movss  %xmm0,-0xd4(%rbp)
ff
flds   -0xd4(%rbp)
sub    $0x10,%rsp
fstpt  (%rsp)
lea    0xcb8(%rip),%rsi
mov    %rbx,%rdi
call   1030 <setnumber@plt>
fldt   -0x40(%rbp)
fstpt  (%rsp)
lea    0xcad(%rip),%rsi
mov    %rbx,%rdi
call   1030 <setnumber@plt>
fldt   -0x88(%rbp)
fstpt  (%rsp)
lea    0xc9f(%rip),%rsi
mov    %rbx,%rdi
call   1030 <setnumber@plt>
add    $0x10,%rsp
movss  -0xa0(%rbp),%xmm0
ff
movss  %xmm0,-0xd0(%rbp)
ff
flds   -0xd0(%rbp)
sub    $0x10,%rsp
fstpt  (%rsp)
lea    0xc7b(%rip),%rsi
mov    %rbx,%rdi
call   1030 <setnumber@plt>
add    $0x10,%rsp
mov    -0x50(%rbp),%rdi
mov    -0x30(%rbp),%esi
call   1060 <sum@plt>
movss  %xmm0,-0xcc(%rbp)
ff
flds   -0xcc(%rbp)
sub    $0x10,%rsp
fstpt  (%rsp)
lea    0xc52(%rip),%rsi
mov    %rbx,%rdi
call   1030 <setnumber@plt>
add    $0x10,%rsp
mov    %r14d,-0xe4(%rbp)
fildl  -0xe4(%rbp)
sub    $0x10,%rsp
fstpt  (%rsp)
lea    0xc36(%rip),%rsi
mov    %rbx,%rdi
call   1030 <setnumber@plt>
add    $0x10,%rsp
mov    -0x5c(%rbp),%eax
mov    %eax,-0xe8(%rbp)
fildl  -0xe8(%rbp)
sub    $0x10,%rsp
fstpt  (%rsp)
lea    0xc12(%rip),%rsi
mov    %rbx,%rdi
call   1030 <setnumber@plt>
add    $0x10,%rsp
mov    0x2b92(%rip),%rax
movss  (%rax),%xmm0
movaps %xmm0,-0xa0(%rbp)
xorps  %xmm0,%xmm0
movaps %xmm0,-0x110(%rbp)
movaps %xmm0,-0x120(%rbp)
movaps %xmm0,-0x130(%rbp)
movaps %xmm0,-0x140(%rbp)
movaps %xmm0,-0x150(%rbp)
mov    -0x60(%rbp),%r15d
mov    %r15d,%r13d
test   %r15d,%r15d
fldz
jle    152e <compute_stuff_basic+0x3ce>
fstp   %st(0)
lea    -0x1(%r13),%rcx
mov    %r13d,%eax
and    $0x3,%eax
cmp    $0x3,%rcx
jae    14b1 <compute_stuff_basic+0x351>
xor    %ecx,%ecx
fldz
jmp    14f0 <compute_stuff_basic+0x390>
mov    %r13d,%edx
and    $0xfffffffc,%edx
lea    -0x120(%rbp),%rsi
xor    %ecx,%ecx
fldz
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
fld    %st(0)
fstpt  -0x30(%rsi)
fld    %st(0)
fstpt  -0x20(%rsi)
fld    %st(0)
fstpt  -0x10(%rsi)
fld    %st(0)
fstpt  (%rsi)
add    $0x4,%rcx
add    $0x40,%rsi
cmp    %rcx,%rdx
jne    14d0 <compute_stuff_basic+0x370>
fstp   %st(0)
test   %rax,%rax
fldz
je     152e <compute_stuff_basic+0x3ce>
fstp   %st(0)
shl    $0x4,%rcx
add    %rbp,%rcx
add    $0xfffffffffffffeb0,%rcx
shl    $0x4,%rax
xor    %edx,%edx
fldz
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
fld    %st(0)
fstpt  (%rcx,%rdx,1)
add    $0x10,%rdx
cmp    %rdx,%rax
jne    1520 <compute_stuff_basic+0x3c0>
fstp   %st(0)
fldz
mov    -0x2c(%rbp),%eax
test   %eax,%eax
mov    %r13,-0xc0(%rbp)
jle    16da <compute_stuff_basic+0x57a>
fstp   %st(0)
movaps 0xab3(%rip),%xmm0
xorps  -0xa0(%rbp),%xmm0
movaps %xmm0,-0xb0(%rbp)
movslq %r15d,%rcx
mov    %eax,%eax
mov    %rax,-0x70(%rbp)
and    $0xfffffffe,%r13d
mov    -0x50(%rbp),%rax
lea    0x4(%rax),%r12
mov    %rcx,-0x40(%rbp)
lea    0x0(,%rcx,4),%rax
mov    %rax,-0x100(%rbp)
xor    %r14d,%r14d
fldz
fstpt  -0x5c(%rbp)
movl   $0xffffffff,-0x7c(%rbp)
movl   $0xffffffff,-0x2c(%rbp)
movl   $0x0,-0x30(%rbp)
jmp    1601 <compute_stuff_basic+0x4a1>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movaps %xmm2,%xmm0
minss  -0xa0(%rbp),%xmm0
ff
movaps %xmm2,%xmm1
maxss  -0xb0(%rbp),%xmm1
ff
movss  %xmm2,-0xc8(%rbp)
ff
fldt   -0x5c(%rbp)
fadds  -0xc8(%rbp)
fstpt  -0x5c(%rbp)
addl   $0x1,-0x30(%rbp)
movaps %xmm0,-0xa0(%rbp)
movaps %xmm1,-0xb0(%rbp)
add    $0x1,%r14
add    -0x100(%rbp),%r12
cmp    -0x70(%rbp),%r14
je     16f2 <compute_stuff_basic+0x592>
mov    %r14,%rbx
imul   -0x40(%rbp),%rbx
mov    -0x50(%rbp),%rax
lea    (%rax,%rbx,4),%rdi
mov    %r15d,%esi
call   1050 <vnormf@plt>
movss  %xmm0,-0x88(%rbp)
ff
call   1080 <isnan@plt>
test   %rax,%rax
jne    15ec <compute_stuff_basic+0x48c>
movaps -0xa0(%rbp),%xmm0
movss  -0x88(%rbp),%xmm2
ff
ucomiss %xmm2,%xmm0
mov    -0x2c(%rbp),%eax
cmova  %r14d,%eax
mov    %eax,-0x2c(%rbp)
ucomiss -0xb0(%rbp),%xmm2
mov    -0x7c(%rbp),%eax
cmova  %r14d,%eax
mov    %eax,-0x7c(%rbp)
test   %r15d,%r15d
jle    15b0 <compute_stuff_basic+0x450>
cmp    $0x1,%r15d
jne    1672 <compute_stuff_basic+0x512>
xor    %eax,%eax
mov    -0xc0(%rbp),%rdx
jmp    16b0 <compute_stuff_basic+0x550>
lea    -0x140(%rbp),%rcx
xor    %eax,%eax
mov    -0xc0(%rbp),%rdx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
fldt   -0x10(%rcx)
fadds  -0x4(%r12,%rax,4)
fstpt  -0x10(%rcx)
fldt   (%rcx)
fadds  (%r12,%rax,4)
fstpt  (%rcx)
add    $0x2,%rax
add    $0x20,%rcx
cmp    %rax,%r13
jne    1690 <compute_stuff_basic+0x530>
test   $0x1,%dl
je     15b0 <compute_stuff_basic+0x450>
add    %rax,%rbx
shl    $0x4,%rax
fldt   -0x150(%rbp,%rax,1)
mov    -0x50(%rbp),%rcx
fadds  (%rcx,%rbx,4)
fstpt  -0x150(%rbp,%rax,1)
jmp    15b0 <compute_stuff_basic+0x450>
fstpt  -0x5c(%rbp)
movl   $0xffffffff,-0x2c(%rbp)
movl   $0x0,-0x30(%rbp)
movl   $0xffffffff,-0x7c(%rbp)
lea    0x961(%rip),%rsi
lea    -0x150(%rbp),%rdx
mov    -0xb8(%rbp),%rdi
mov    %r15d,%ecx
call   1040 <setnumbers@plt>
mov    -0x60(%rbp),%r12d
mov    %rsp,%r14
mov    %rsp,%rdx
mov    -0xc0(%rbp),%rbx
mov    %rbx,%rax
shl    $0x4,%rax
sub    %rax,%rdx
mov    %rdx,%rsp
mov    %rsp,%r13
sub    %rax,%r13
mov    %r13,%rsp
mov    -0x30(%rbp),%eax
mov    %eax,-0xc4(%rbp)
fildl  -0xc4(%rbp)
test   %r12d,%r12d
jle    1797 <compute_stuff_basic+0x637>
mov    -0x2c(%rbp),%esi
imul   %r12d,%esi
mov    -0x7c(%rbp),%eax
imul   %r12d,%eax
movslq %esi,%rsi
cltq
mov    -0x50(%rbp),%rdi
lea    (%rdi,%rax,4),%rax
lea    (%rdi,%rsi,4),%rdi
shl    $0x2,%rbx
xor    %esi,%esi
nop
flds   (%rdi,%rsi,1)
fstpt  (%rdx,%rsi,4)
flds   (%rax,%rsi,1)
fstpt  0x0(%r13,%rsi,4)
fldt   -0x150(%rbp,%rsi,4)
fdiv   %st(1),%st
fstpt  -0x150(%rbp,%rsi,4)
add    $0x4,%rsi
cmp    %rsi,%rbx
jne    1770 <compute_stuff_basic+0x610>
fldt   -0x5c(%rbp)
fdivp  %st,%st(1)
fstpt  -0x50(%rbp)
lea    0x8be(%rip),%rsi
mov    -0xb8(%rbp),%r15
mov    %r15,%rdi
mov    %r12d,%ecx
call   1040 <setnumbers@plt>
lea    0x8ae(%rip),%rsi
mov    %r15,%rdi
mov    %r13,%rdx
mov    %r12d,%ecx
call   1040 <setnumbers@plt>
lea    0x8a2(%rip),%rsi
lea    -0x150(%rbp),%rdx
mov    %r15,%rdi
mov    %r12d,%ecx
call   1040 <setnumbers@plt>
sub    $0x10,%rsp
fldt   -0x50(%rbp)
fstpt  (%rsp)
lea    0x888(%rip),%rsi
mov    %r15,%rdi
call   1030 <setnumber@plt>
add    $0x10,%rsp
mov    %r14,%rsp
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
%struct.printable_data = type { i32 }
@INFINITY = global float 0.000000e+00
@.str = [10 x i8] c"minsample\00"
@.str.1 = [10 x i8] c"maxsample\00"
@.str.2 = [10 x i8] c"avgsample\00"
@.str.3 = [12 x i8] c"avgnzsample\00"
@.str.4 = [11 x i8] c"sumsamples\00"
@.str.5 = [11 x i8] c"kahsamples\00"
@.str.6 = [5 x i8] c"nnan\00"
@.str.7 = [5 x i8] c"ninf\00"
@.str.8 = [10 x i8] c"sumpixels\00"
@.str.9 = [9 x i8] c"minpixel\00"
@.str.10 = [9 x i8] c"maxpixel\00"
@.str.11 = [9 x i8] c"avgpixel\00"
@.str.12 = [6 x i8] c"error\00"
define void @compute_stuff_basic(%struct.printable_data* %0, float* %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca [5 x x86_fp80]
%7 = mul i32 %3, %2
%8 = mul i32 %7, %4
%9 = load float, float* @INFINITY
%10 = fneg float %9
%11 = icmp sgt i32 %8, 0
br i1 %11, label %12, label %14
12: ; preds = %5
%13 = zext i32 %8 to i64
br label %54
14: ; preds = %89, %5
%15 = phi float [ 0.000000e+00, %5 ], [ %90, %89 ]
%16 = phi x86_fp80 [ 0xK00000000000000000000, %5 ], [ %91, %89 ]
%17 = phi x86_fp80 [ 0xK00000000000000000000, %5 ], [ %92, %89 ]
%18 = phi float [ %10, %5 ], [ %93, %89 ]
%19 = phi float [ %9, %5 ], [ %94, %89 ]
%20 = phi i32 [ 0, %5 ], [ %95, %89 ]
%21 = phi i32 [ 0, %5 ], [ %96, %89 ]
%22 = phi i32 [ 0, %5 ], [ %97, %89 ]
%23 = phi i32 [ 0, %5 ], [ %98, %89 ]
%24 = sitofp i32 %23 to x86_fp80
%25 = fdiv x86_fp80 %17, %24
%26 = sitofp i32 %22 to x86_fp80
%27 = fdiv x86_fp80 %16, %26
%28 = fpext float %19 to x86_fp80
%29 = tail call i32 @setnumber(%struct.printable_data* %0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), x86_fp80 %28)
%30 = fpext float %18 to x86_fp80
%31 = tail call i32 @setnumber(%struct.printable_data* %0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), x86_fp80 %30)
%32 = tail call i32 @setnumber(%struct.printable_data* %0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), x86_fp80 %25)
%33 = tail call i32 @setnumber(%struct.printable_data* %0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), x86_fp80 %27)
%34 = fpext float %15 to x86_fp80
%35 = tail call i32 @setnumber(%struct.printable_data* %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), x86_fp80 %34)
%36 = tail call float @sum(float* %1, i32 %8)
%37 = fpext float %36 to x86_fp80
%38 = tail call i32 @setnumber(%struct.printable_data* %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), x86_fp80 %37)
%39 = sitofp i32 %21 to x86_fp80
%40 = tail call i32 @setnumber(%struct.printable_data* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), x86_fp80 %39)
%41 = sitofp i32 %20 to x86_fp80
%42 = tail call i32 @setnumber(%struct.printable_data* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), x86_fp80 %41)
%43 = load float, float* @INFINITY
%44 = fneg float %43
%45 = bitcast [5 x x86_fp80]* %6 to i8*
%46 = icmp sgt i32 %4, 0
br i1 %46, label %47, label %111
47: ; preds = %14
%48 = zext i32 %4 to i64
%49 = add nsw i64 %48, -1
%50 = and i64 %48, 3
%51 = icmp ult i64 %49, 3
br i1 %51, label %101, label %52
52: ; preds = %47
%53 = and i64 %48, 4294967292
br label %121
54: ; preds = %12, %89
%55 = phi i64 [ 0, %12 ], [ %99, %89 ]
%56 = phi i32 [ 0, %12 ], [ %98, %89 ]
%57 = phi i32 [ 0, %12 ], [ %97, %89 ]
%58 = phi i32 [ 0, %12 ], [ %96, %89 ]
%59 = phi i32 [ 0, %12 ], [ %95, %89 ]
%60 = phi float [ %9, %12 ], [ %94, %89 ]
%61 = phi float [ %10, %12 ], [ %93, %89 ]
%62 = phi x86_fp80 [ 0xK00000000000000000000, %12 ], [ %92, %89 ]
%63 = phi x86_fp80 [ 0xK00000000000000000000, %12 ], [ %91, %89 ]
%64 = phi float [ 0.000000e+00, %12 ], [ %90, %89 ]
%65 = getelementptr inbounds float, float* %1, i64 %55
%66 = load float, float* %65
%67 = tail call i64 @isnan(float %66)
%68 = icmp eq i64 %67, 0
br i1 %68, label %71, label %69
69: ; preds = %54
%70 = add nsw i32 %58, 1
br label %89
71: ; preds = %54
%72 = tail call i32 @isfinite(float %66)
%73 = icmp eq i32 %72, 0
%74 = zext i1 %73 to i32
%75 = add nsw i32 %59, %74
%76 = fcmp olt float %66, %60
%77 = select i1 %76, float %66, float %60
%78 = fcmp ogt float %66, %61
%79 = select i1 %78, float %66, float %61
%80 = fadd float %64, %66
%81 = fpext float %66 to x86_fp80
%82 = fadd x86_fp80 %62, %81
%83 = add nsw i32 %56, 1
%84 = fcmp une float %66, 0.000000e+00
%85 = select i1 %84, x86_fp80 %81, x86_fp80 0xK80000000000000000000
%86 = fadd x86_fp80 %63, %85
%87 = zext i1 %84 to i32
%88 = add nsw i32 %57, %87
br label %89
89: ; preds = %71, %69
%90 = phi float [ %64, %69 ], [ %80, %71 ]
%91 = phi x86_fp80 [ %63, %69 ], [ %86, %71 ]
%92 = phi x86_fp80 [ %62, %69 ], [ %82, %71 ]
%93 = phi float [ %61, %69 ], [ %79, %71 ]
%94 = phi float [ %60, %69 ], [ %77, %71 ]
%95 = phi i32 [ %59, %69 ], [ %75, %71 ]
%96 = phi i32 [ %70, %69 ], [ %58, %71 ]
%97 = phi i32 [ %57, %69 ], [ %88, %71 ]
%98 = phi i32 [ %56, %69 ], [ %83, %71 ]
%99 = add nuw nsw i64 %55, 1
%100 = icmp eq i64 %99, %13
br i1 %100, label %14, label %54
101: ; preds = %121, %47
%102 = phi i64 [ 0, %47 ], [ %131, %121 ]
%103 = icmp eq i64 %50, 0
br i1 %103, label %111, label %104
104: ; preds = %101, %104
%105 = phi i64 [ %108, %104 ], [ %102, %101 ]
%106 = phi i64 [ %109, %104 ], [ 0, %101 ]
%107 = getelementptr inbounds [5 x x86_fp80], [5 x x86_fp80]* %6, i64 0, i64 %105
store x86_fp80 0xK00000000000000000000, x86_fp80* %107
%108 = add nuw nsw i64 %105, 1
%109 = add i64 %106, 1
%110 = icmp eq i64 %109, %50
br i1 %110, label %111, label %104
111: ; preds = %101, %104, %14
%112 = icmp sgt i32 %7, 0
br i1 %112, label %113, label %134
113: ; preds = %111
%114 = sext i32 %4 to i64
%115 = zext i32 %7 to i64
%116 = zext i32 %4 to i64
%117 = and i64 %116, 1
%118 = icmp eq i32 %4, 1
%119 = and i64 %116, 4294967294
%120 = icmp eq i64 %117, 0
br label %151
121: ; preds = %121, %52
%122 = phi i64 [ 0, %52 ], [ %131, %121 ]
%123 = phi i64 [ 0, %52 ], [ %132, %121 ]
%124 = getelementptr inbounds [5 x x86_fp80], [5 x x86_fp80]* %6, i64 0, i64 %122
store x86_fp80 0xK00000000000000000000, x86_fp80* %124
%125 = or i64 %122, 1
%126 = getelementptr inbounds [5 x x86_fp80], [5 x x86_fp80]* %6, i64 0, i64 %125
store x86_fp80 0xK00000000000000000000, x86_fp80* %126
%127 = or i64 %122, 2
%128 = getelementptr inbounds [5 x x86_fp80], [5 x x86_fp80]* %6, i64 0, i64 %127
store x86_fp80 0xK00000000000000000000, x86_fp80* %128
%129 = or i64 %122, 3
%130 = getelementptr inbounds [5 x x86_fp80], [5 x x86_fp80]* %6, i64 0, i64 %129
store x86_fp80 0xK00000000000000000000, x86_fp80* %130
%131 = add nuw nsw i64 %122, 4
%132 = add i64 %123, 4
%133 = icmp eq i64 %132, %53
br i1 %133, label %101, label %121
134: ; preds = %208, %111
%135 = phi i32 [ 0, %111 ], [ %209, %208 ]
%136 = phi x86_fp80 [ 0xK00000000000000000000, %111 ], [ %212, %208 ]
%137 = phi i32 [ -1, %111 ], [ %213, %208 ]
%138 = phi i32 [ -1, %111 ], [ %214, %208 ]
%139 = getelementptr inbounds [5 x x86_fp80], [5 x x86_fp80]* %6, i64 0, i64 0
%140 = call i32 @setnumbers(%struct.printable_data* %0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0), x86_fp80* %139, i32 %4)
%141 = sitofp i32 %135 to x86_fp80
%142 = zext i32 %4 to i64
%143 = call i8* @llvm.stacksave()
%144 = alloca x86_fp80, i64 %142
%145 = alloca x86_fp80, i64 %142
br i1 %46, label %146, label %217
146: ; preds = %134
%147 = mul nsw i32 %137, %4
%148 = mul nsw i32 %138, %4
%149 = sext i32 %147 to i64
%150 = sext i32 %148 to i64
br label %223
151: ; preds = %113, %208
%152 = phi i64 [ 0, %113 ], [ %215, %208 ]
%153 = phi i32 [ -1, %113 ], [ %214, %208 ]
%154 = phi i32 [ -1, %113 ], [ %213, %208 ]
%155 = phi x86_fp80 [ 0xK00000000000000000000, %113 ], [ %212, %208 ]
%156 = phi float [ %44, %113 ], [ %211, %208 ]
%157 = phi float [ %43, %113 ], [ %210, %208 ]
%158 = phi i32 [ 0, %113 ], [ %209, %208 ]
%159 = mul nsw i64 %152, %114
%160 = getelementptr inbounds float, float* %1, i64 %159
%161 = tail call float @vnormf(float* %160, i32 %4)
%162 = tail call i64 @isnan(float %161)
%163 = icmp eq i64 %162, 0
br i1 %163, label %164, label %208
164: ; preds = %151
%165 = fcmp olt float %161, %157
%166 = select i1 %165, float %161, float %157
%167 = trunc i64 %152 to i32
%168 = select i1 %165, i32 %167, i32 %154
%169 = fcmp ogt float %161, %156
%170 = select i1 %169, float %161, float %156
%171 = select i1 %169, i32 %167, i32 %153
br i1 %46, label %172, label %183
172: ; preds = %164
br i1 %118, label %173, label %187
173: ; preds = %187, %172
%174 = phi i64 [ 0, %172 ], [ %205, %187 ]
br i1 %120, label %183, label %175
175: ; preds = %173
%176 = add nsw i64 %174, %159
%177 = getelementptr inbounds float, float* %1, i64 %176
%178 = load float, float* %177
%179 = fpext float %178 to x86_fp80
%180 = getelementptr inbounds [5 x x86_fp80], [5 x x86_fp80]* %6, i64 0, i64 %174
%181 = load x86_fp80, x86_fp80* %180
%182 = fadd x86_fp80 %181, %179
store x86_fp80 %182, x86_fp80* %180
br label %183
183: ; preds = %175, %173, %164
%184 = fpext float %161 to x86_fp80
%185 = fadd x86_fp80 %155, %184
%186 = add nsw i32 %158, 1
br label %208
187: ; preds = %172, %187
%188 = phi i64 [ %205, %187 ], [ 0, %172 ]
%189 = phi i64 [ %206, %187 ], [ 0, %172 ]
%190 = add nsw i64 %188, %159
%191 = getelementptr inbounds float, float* %1, i64 %190
%192 = load float, float* %191
%193 = fpext float %192 to x86_fp80
%194 = getelementptr inbounds [5 x x86_fp80], [5 x x86_fp80]* %6, i64 0, i64 %188
%195 = load x86_fp80, x86_fp80* %194
%196 = fadd x86_fp80 %195, %193
store x86_fp80 %196, x86_fp80* %194
%197 = or i64 %188, 1
%198 = add nsw i64 %197, %159
%199 = getelementptr inbounds float, float* %1, i64 %198
%200 = load float, float* %199
%201 = fpext float %200 to x86_fp80
%202 = getelementptr inbounds [5 x x86_fp80], [5 x x86_fp80]* %6, i64 0, i64 %197
%203 = load x86_fp80, x86_fp80* %202
%204 = fadd x86_fp80 %203, %201
store x86_fp80 %204, x86_fp80* %202
%205 = add nuw nsw i64 %188, 2
%206 = add i64 %189, 2
%207 = icmp eq i64 %206, %119
br i1 %207, label %173, label %187
208: ; preds = %151, %183
%209 = phi i32 [ %186, %183 ], [ %158, %151 ]
%210 = phi float [ %166, %183 ], [ %157, %151 ]
%211 = phi float [ %170, %183 ], [ %156, %151 ]
%212 = phi x86_fp80 [ %185, %183 ], [ %155, %151 ]
%213 = phi i32 [ %168, %183 ], [ %154, %151 ]
%214 = phi i32 [ %171, %183 ], [ %153, %151 ]
%215 = add nuw nsw i64 %152, 1
%216 = icmp eq i64 %215, %115
br i1 %216, label %134, label %151
217: ; preds = %223, %134
%218 = fdiv x86_fp80 %136, %141
%219 = call i32 @setnumbers(%struct.printable_data* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0), x86_fp80* %144, i32 %4)
%220 = call i32 @setnumbers(%struct.printable_data* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0), x86_fp80* %145, i32 %4)
%221 = call i32 @setnumbers(%struct.printable_data* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.11, i64 0, i64 0), x86_fp80* %139, i32 %4)
%222 = call i32 @setnumber(%struct.printable_data* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0), x86_fp80 %218)
ret void
223: ; preds = %146, %223
%224 = phi i64 [ 0, %146 ], [ %238, %223 ]
%225 = add nsw i64 %224, %149
%226 = getelementptr inbounds float, float* %1, i64 %225
%227 = load float, float* %226
%228 = fpext float %227 to x86_fp80
%229 = getelementptr inbounds x86_fp80, x86_fp80* %144, i64 %224
store x86_fp80 %228, x86_fp80* %229
%230 = add nsw i64 %224, %150
%231 = getelementptr inbounds float, float* %1, i64 %230
%232 = load float, float* %231
%233 = fpext float %232 to x86_fp80
%234 = getelementptr inbounds x86_fp80, x86_fp80* %145, i64 %224
store x86_fp80 %233, x86_fp80* %234
%235 = getelementptr inbounds [5 x x86_fp80], [5 x x86_fp80]* %6, i64 0, i64 %224
%236 = load x86_fp80, x86_fp80* %235
%237 = fdiv x86_fp80 %236, %141
store x86_fp80 %237, x86_fp80* %235
%238 = add nuw nsw i64 %224, 1
%239 = icmp eq i64 %238, %142
br i1 %239, label %217, label %223
}