#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 */
float asin(float);
int /*<<< orphan*/ exit(int);
scalar_t__ floor(float);
int /*<<< orphan*/ printf(char *);
double sqrt(float);
float aperturePhotometry(float *pix, int npx, int npy, float xcen, float ycen,
                         float r) {
  int xmin, xmax, ymin, ymax;
  float xc[4], yc[4];
  int x, y;
  float temp, x0, y0;
  float x1, x2;
  float th1, th2;
  int i, flag;
  float factor;
  double sum;
  if (r <= 0.)
    return 0.;
  xmin = (int)floor(xcen - r - .5);
  ymin = (int)floor(ycen - r - .5);
  xmax = (int)floor(xcen + r + .5);
  ymax = (int)floor(ycen + r + .5);
  if ((xmin < 0) || (ymin < 0) || (xmax > npx) || (ymax > npy)) {
    printf("ERROR\n");
    return -1.;
  }
  sum = 0.;
  for (y = ymin; y <= ymax; y++) {
    for (x = xmin; x <= xmax; x++) {
      x0 = x - xcen;
      y0 = y - ycen;
      if (x0 < 0)
        x0 = -x0;
      if (y0 < 0)
        y0 = -y0;
      if (x0 > y0) {
        temp = x0;
        x0 = y0;
        y0 = temp;
      }
      xc[0] = xc[1] = x0 - .5;
      xc[2] = xc[3] = x0 + .5;
      yc[0] = yc[3] = y0 - .5;
      yc[1] = yc[2] = y0 + .5;
      flag = 0;
      for (i = 0; i < 4; i++)
        if (xc[i] * xc[i] + yc[i] * yc[i] < r * r)
          flag++;
      switch (flag) {
      case 0:
        if ((r > y0 - 0.5) && (x0 > -.5) && (x0 < .5)) {
          x1 = -sqrt(r * r - (y0 - .5) * (y0 - .5));
          th1 = asin(x1 / r);
          x2 = -x1;
          th2 = -th1;
          factor = r * r / 2. * (th2 - th1) + .5 * x2 * sqrt(r * r - x2 * x2) -
                   .5 * x1 * sqrt(r * r - x1 * x1) - (y0 - .5) * (x2 - x1);
        } else
          factor = 0.;
        break;
      case 4:
        factor = 1.;
        break;
      case 1:
        x1 = x0 - .5;
        th1 = asin(x1 / r);
        x2 = sqrt(r * r - (y0 - .5) * (y0 - .5));
        th2 = asin(x2 / r);
        factor = r * r / 2. * (th2 - th1) + .5 * x2 * sqrt(r * r - x2 * x2) -
                 .5 * x1 * sqrt(r * r - x1 * x1) - (y0 - .5) * (x2 - x1);
        break;
      case 3:
        x1 = sqrt(r * r - (y0 + .5) * (y0 + .5));
        th1 = asin(x1 / r);
        x2 = x0 + .5;
        th2 = asin(x2 / r);
        factor = r * r / 2. * (th2 - th1) + .5 * x2 * sqrt(r * r - x2 * x2) -
                 .5 * x1 * sqrt(r * r - x1 * x1) - (y0 - .5) * (x2 - x1) +
                 1. * (x1 - x0 + .5);
        break;
      case 2:
        x1 = x0 - .5;
        th1 = asin(x1 / r);
        x2 = x0 + .5;
        th2 = asin(x2 / r);
        factor = r * r / 2. * (th2 - th1) + .5 * x2 * sqrt(r * r - x2 * x2) -
                 .5 * x1 * sqrt(r * r - x1 * x1) - (y0 - .5) * 1.;
        break;
      default:
        exit(-1);
      }
      sum += (double)(factor * pix[y * npx + x]);
    }
  }
  return (float)sum;
}


x86 assembly (clang, -O0):
<aperturePhotometry>:
push   %rbp
mov    %rsp,%rbp
sub    $0x140,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
movss  %xmm0,-0x1c(%rbp)
movss  %xmm1,-0x20(%rbp)
movss  %xmm2,-0x24(%rbp)
movss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jb     1197 <aperturePhotometry+0x47>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1e2e <aperturePhotometry+0xcde>
movss  -0x1c(%rbp),%xmm0
subss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe53(%rip),%xmm1
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1070 <floor@plt>
mov    %eax,-0x28(%rbp)
movss  -0x20(%rbp),%xmm0
subss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe2d(%rip),%xmm1
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1070 <floor@plt>
mov    %eax,-0x30(%rbp)
movss  -0x1c(%rbp),%xmm0
addss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe07(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1070 <floor@plt>
mov    %eax,-0x2c(%rbp)
movss  -0x20(%rbp),%xmm0
addss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xde1(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1070 <floor@plt>
mov    %eax,-0x34(%rbp)
cmpl   $0x0,-0x28(%rbp)
jl     125b <aperturePhotometry+0x10b>
cmpl   $0x0,-0x30(%rbp)
jl     125b <aperturePhotometry+0x10b>
mov    -0x2c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     125b <aperturePhotometry+0x10b>
mov    -0x34(%rbp),%eax
cmp    -0x18(%rbp),%eax
jle    1279 <aperturePhotometry+0x129>
lea    0xdd2(%rip),%rdi
call   1030 <printf@plt>
movss  0xdad(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1e2e <aperturePhotometry+0xcde>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
mov    -0x30(%rbp),%eax
mov    %eax,-0x68(%rbp)
mov    -0x68(%rbp),%eax
cmp    -0x34(%rbp),%eax
jg     1e1d <aperturePhotometry+0xccd>
mov    -0x28(%rbp),%eax
mov    %eax,-0x64(%rbp)
mov    -0x64(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jg     1e0a <aperturePhotometry+0xcba>
cvtsi2ssl -0x64(%rbp),%xmm0
subss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0x70(%rbp)
cvtsi2ssl -0x68(%rbp),%xmm0
subss  -0x20(%rbp),%xmm0
movss  %xmm0,-0x74(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x70(%rbp),%xmm0
jbe    12ea <aperturePhotometry+0x19a>
movss  -0x70(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x70(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x74(%rbp),%xmm0
jbe    130e <aperturePhotometry+0x1be>
movss  -0x74(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x74(%rbp)
movss  -0x70(%rbp),%xmm0
ucomiss -0x74(%rbp),%xmm0
jbe    133b <aperturePhotometry+0x1eb>
movss  -0x70(%rbp),%xmm0
movss  %xmm0,-0x6c(%rbp)
movss  -0x74(%rbp),%xmm0
movss  %xmm0,-0x70(%rbp)
movss  -0x6c(%rbp),%xmm0
movss  %xmm0,-0x74(%rbp)
movss  -0x70(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xcb4(%rip),%xmm1
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4c(%rbp)
movss  %xmm0,-0x50(%rbp)
movss  -0x70(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xc91(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x44(%rbp)
movss  %xmm0,-0x48(%rbp)
movss  -0x74(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xc6e(%rip),%xmm1
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x54(%rbp)
movss  %xmm0,-0x60(%rbp)
movss  -0x74(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xc4b(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x58(%rbp)
movss  %xmm0,-0x5c(%rbp)
movl   $0x0,-0x8c(%rbp)
movl   $0x0,-0x88(%rbp)
cmpl   $0x4,-0x88(%rbp)
jge    145f <aperturePhotometry+0x30f>
movslq -0x88(%rbp),%rax
movss  -0x50(%rbp,%rax,4),%xmm1
movslq -0x88(%rbp),%rax
movss  -0x50(%rbp,%rax,4),%xmm2
movslq -0x88(%rbp),%rax
movss  -0x60(%rbp,%rax,4),%xmm0
movslq -0x88(%rbp),%rax
mulss  -0x60(%rbp,%rax,4),%xmm0
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
movss  -0x24(%rbp),%xmm0
mulss  -0x24(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1446 <aperturePhotometry+0x2f6>
mov    -0x8c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8c(%rbp)
jmp    144b <aperturePhotometry+0x2fb>
mov    -0x88(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x88(%rbp)
jmp    13db <aperturePhotometry+0x28b>
mov    -0x8c(%rbp),%eax
mov    %rax,-0xa0(%rbp)
sub    $0x4,%rax
ja     1dc0 <aperturePhotometry+0xc70>
mov    -0xa0(%rbp),%rax
lea    0xb9c(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x74(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0xb59(%rip),%xmm2
subsd  %xmm2,%xmm1
ucomisd %xmm1,%xmm0
jbe    1735 <aperturePhotometry+0x5e5>
movss  -0x70(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xb4a(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1735 <aperturePhotometry+0x5e5>
movss  -0x70(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xb1f(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1735 <aperturePhotometry+0x5e5>
movss  -0x24(%rbp),%xmm0
mulss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movss  -0x74(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xaf6(%rip),%xmm2
subsd  %xmm2,%xmm0
movss  -0x74(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
movsd  0xae1(%rip),%xmm3
subsd  %xmm3,%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1050 <sqrt@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x78(%rbp)
movss  -0x78(%rbp),%xmm0
divss  -0x24(%rbp),%xmm0
call   1040 <asin@plt>
movss  %xmm0,-0x80(%rbp)
movss  -0x78(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x7c(%rbp)
movss  -0x80(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x84(%rbp)
ff
movss  -0x24(%rbp),%xmm0
mulss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xa42(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
movss  -0x84(%rbp),%xmm0
ff
subss  -0x80(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
movss  -0x7c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xa04(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
movss  -0x24(%rbp),%xmm0
movss  -0x24(%rbp),%xmm2
movss  -0x7c(%rbp),%xmm1
mulss  -0x7c(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
call   1050 <sqrt@plt>
movsd  -0xc8(%rbp),%xmm1
ff
movsd  -0xc0(%rbp),%xmm2
ff
movaps %xmm0,%xmm3
movsd  -0xb8(%rbp),%xmm0
ff
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movss  -0x78(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0x98a(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movss  -0x24(%rbp),%xmm0
movss  -0x24(%rbp),%xmm2
movss  -0x78(%rbp),%xmm1
mulss  -0x78(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
call   1050 <sqrt@plt>
movsd  -0xb0(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0xa8(%rbp),%xmm0
ff
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movss  -0x74(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0x90d(%rip),%xmm2
subsd  %xmm2,%xmm0
movss  -0x7c(%rbp),%xmm2
subss  -0x78(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x90(%rbp)
ff
jmp    1740 <aperturePhotometry+0x5f0>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x90(%rbp)
ff
jmp    1dca <aperturePhotometry+0xc7a>
movss  0x8cb(%rip),%xmm0
movss  %xmm0,-0x90(%rbp)
ff
jmp    1dca <aperturePhotometry+0xc7a>
movss  -0x70(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0x895(%rip),%xmm1
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x78(%rbp)
movss  -0x78(%rbp),%xmm0
divss  -0x24(%rbp),%xmm0
call   1040 <asin@plt>
movss  %xmm0,-0x80(%rbp)
movss  -0x24(%rbp),%xmm0
mulss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movss  -0x74(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0x855(%rip),%xmm2
subsd  %xmm2,%xmm0
movss  -0x74(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
movsd  0x840(%rip),%xmm3
subsd  %xmm3,%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1050 <sqrt@plt>
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x7c(%rbp)
movss  -0x7c(%rbp),%xmm0
divss  -0x24(%rbp),%xmm0
call   1040 <asin@plt>
movss  %xmm0,-0x84(%rbp)
ff
movss  -0x24(%rbp),%xmm0
mulss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0x7e6(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xe0(%rbp)
ff
movss  -0x84(%rbp),%xmm0
ff
subss  -0x80(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0xe8(%rbp)
ff
movss  -0x7c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0x7a8(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xf0(%rbp)
ff
movss  -0x24(%rbp),%xmm0
movss  -0x24(%rbp),%xmm2
movss  -0x7c(%rbp),%xmm1
mulss  -0x7c(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
call   1050 <sqrt@plt>
movsd  -0xf0(%rbp),%xmm1
ff
movsd  -0xe8(%rbp),%xmm2
ff
movaps %xmm0,%xmm3
movsd  -0xe0(%rbp),%xmm0
ff
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
movss  -0x78(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0x72e(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xd8(%rbp)
ff
movss  -0x24(%rbp),%xmm0
movss  -0x24(%rbp),%xmm2
movss  -0x78(%rbp),%xmm1
mulss  -0x78(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
call   1050 <sqrt@plt>
movsd  -0xd8(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0xd0(%rbp),%xmm0
ff
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movss  -0x74(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0x6b1(%rip),%xmm2
subsd  %xmm2,%xmm0
movss  -0x7c(%rbp),%xmm2
subss  -0x78(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x90(%rbp)
ff
jmp    1dca <aperturePhotometry+0xc7a>
movss  -0x24(%rbp),%xmm0
mulss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movss  -0x74(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0x650(%rip),%xmm2
addsd  %xmm2,%xmm0
movss  -0x74(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
movsd  0x63b(%rip),%xmm3
addsd  %xmm3,%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1050 <sqrt@plt>
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x78(%rbp)
movss  -0x78(%rbp),%xmm0
divss  -0x24(%rbp),%xmm0
call   1040 <asin@plt>
movss  %xmm0,-0x80(%rbp)
movss  -0x70(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0x5e1(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x7c(%rbp)
movss  -0x7c(%rbp),%xmm0
divss  -0x24(%rbp),%xmm0
call   1040 <asin@plt>
movss  %xmm0,-0x84(%rbp)
ff
movss  -0x24(%rbp),%xmm0
mulss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0x5af(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x108(%rbp)
ff
movss  -0x84(%rbp),%xmm0
ff
subss  -0x80(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x110(%rbp)
ff
movss  -0x7c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0x571(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x118(%rbp)
ff
movss  -0x24(%rbp),%xmm0
movss  -0x24(%rbp),%xmm2
movss  -0x7c(%rbp),%xmm1
mulss  -0x7c(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
call   1050 <sqrt@plt>
movsd  -0x118(%rbp),%xmm1
ff
movsd  -0x110(%rbp),%xmm2
ff
movaps %xmm0,%xmm3
movsd  -0x108(%rbp),%xmm0
ff
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x100(%rbp)
ff
movss  -0x78(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0x4f7(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xf8(%rbp)
ff
movss  -0x24(%rbp),%xmm0
movss  -0x24(%rbp),%xmm2
movss  -0x78(%rbp),%xmm1
mulss  -0x78(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
call   1050 <sqrt@plt>
movsd  -0x100(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0xf8(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movss  -0x74(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0x47a(%rip),%xmm2
subsd  %xmm2,%xmm1
movss  -0x7c(%rbp),%xmm2
subss  -0x78(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movss  -0x78(%rbp),%xmm0
subss  -0x70(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0x433(%rip),%xmm2
addsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x90(%rbp)
ff
jmp    1dca <aperturePhotometry+0xc7a>
movss  -0x70(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0x409(%rip),%xmm1
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x78(%rbp)
movss  -0x78(%rbp),%xmm0
divss  -0x24(%rbp),%xmm0
call   1040 <asin@plt>
movss  %xmm0,-0x80(%rbp)
movss  -0x70(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0x3d7(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x7c(%rbp)
movss  -0x7c(%rbp),%xmm0
divss  -0x24(%rbp),%xmm0
call   1040 <asin@plt>
movss  %xmm0,-0x84(%rbp)
ff
movss  -0x24(%rbp),%xmm0
mulss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0x3a5(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x130(%rbp)
ff
movss  -0x84(%rbp),%xmm0
ff
subss  -0x80(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x138(%rbp)
ff
movss  -0x7c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0x367(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x140(%rbp)
ff
movss  -0x24(%rbp),%xmm0
movss  -0x24(%rbp),%xmm2
movss  -0x7c(%rbp),%xmm1
mulss  -0x7c(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
call   1050 <sqrt@plt>
movsd  -0x140(%rbp),%xmm1
ff
movsd  -0x138(%rbp),%xmm2
ff
movaps %xmm0,%xmm3
movsd  -0x130(%rbp),%xmm0
ff
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x120(%rbp)
ff
movss  -0x78(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0x2ed(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x128(%rbp)
ff
movss  -0x24(%rbp),%xmm0
movss  -0x24(%rbp),%xmm2
movss  -0x78(%rbp),%xmm1
mulss  -0x78(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
call   1050 <sqrt@plt>
movsd  -0x128(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0x120(%rbp),%xmm0
ff
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movss  -0x74(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0x270(%rip),%xmm2
subsd  %xmm2,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x90(%rbp)
ff
jmp    1dca <aperturePhotometry+0xc7a>
mov    $0xffffffff,%edi
call   1060 <exit@plt>
movss  -0x90(%rbp),%xmm0
ff
mov    -0x10(%rbp),%rax
mov    -0x68(%rbp),%ecx
imul   -0x14(%rbp),%ecx
add    -0x64(%rbp),%ecx
movslq %ecx,%rcx
mulss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  -0x98(%rbp),%xmm0
ff
movsd  %xmm0,-0x98(%rbp)
ff
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    129c <aperturePhotometry+0x14c>
jmp    1e0f <aperturePhotometry+0xcbf>
mov    -0x68(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x68(%rbp)
jmp    128a <aperturePhotometry+0x13a>
movsd  -0x98(%rbp),%xmm0
ff
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x140,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aperturePhotometry>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xe8,%rsp
movaps %xmm0,%xmm3
xorps  %xmm0,%xmm0
ucomiss %xmm2,%xmm0
jae    123f <aperturePhotometry+0xef>
mov    %edx,%ebx
mov    %esi,%r14d
mov    %rdi,%r15
movaps %xmm3,%xmm0
subss  %xmm2,%xmm0
addss  0xe79(%rip),%xmm0
movss  %xmm2,(%rsp)
movss  %xmm1,0x2c(%rsp)
movss  %xmm3,0x4(%rsp)
call   1070 <floor@plt>
mov    %rax,%rbp
movss  0x2c(%rsp),%xmm0
subss  (%rsp),%xmm0
addss  0xe4d(%rip),%xmm0
call   1070 <floor@plt>
mov    %rax,%r12
movss  0x4(%rsp),%xmm0
addss  (%rsp),%xmm0
addss  0xe36(%rip),%xmm0
call   1070 <floor@plt>
mov    %rax,0x90(%rsp)
movss  0x2c(%rsp),%xmm0
addss  (%rsp),%xmm0
addss  0xe16(%rip),%xmm0
call   1070 <floor@plt>
mov    %rax,0x48(%rsp)
test   %ebp,%ebp
js     122b <aperturePhotometry+0xdb>
test   %r12d,%r12d
js     122b <aperturePhotometry+0xdb>
cmp    %r14d,0x90(%rsp)
jg     122b <aperturePhotometry+0xdb>
cmp    %ebx,0x48(%rsp)
jg     122b <aperturePhotometry+0xdb>
xorpd  %xmm4,%xmm4
cmp    0x48(%rsp),%r12d
movss  0x4(%rsp),%xmm3
jle    1251 <aperturePhotometry+0x101>
xorps  %xmm0,%xmm0
cvtsd2ss %xmm4,%xmm0
jmp    123f <aperturePhotometry+0xef>
lea    0xe42(%rip),%rdi
call   1030 <puts@plt>
movss  0xdcd(%rip),%xmm0
add    $0xe8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
movss  (%rsp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  %xmm1,0xb8(%rsp)
mulss  %xmm0,%xmm0
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
movsd  0xda2(%rip),%xmm2
movsd  %xmm1,0xa0(%rsp)
mulsd  %xmm1,%xmm2
movsd  %xmm2,0x68(%rsp)
movslq %ebp,%rax
mov    0x90(%rsp),%rcx
lea    0x1(%rcx),%ebx
movslq %r12d,%r13
movslq %r14d,%rdx
mov    0x48(%rsp),%rcx
add    $0x1,%ecx
mov    %rcx,0x48(%rsp)
movaps %xmm0,0x80(%rsp)
shufps $0x0,%xmm0,%xmm0
movaps %xmm0,0xc0(%rsp)
mov    %rdx,%rcx
imul   %r13,%rcx
add    %rax,%rcx
lea    (%r15,%rcx,4),%r12
shl    $0x2,%rdx
mov    %rdx,0xa8(%rsp)
xorpd  %xmm4,%xmm4
lea    0xd7d(%rip),%r14
mov    %rbp,0xb0(%rsp)
jmp    1315 <aperturePhotometry+0x1c5>
nopl   (%rax)
mov    %r12,%rbp
add    $0x1,%r13
mov    %rbp,%r12
add    0xa8(%rsp),%r12
cmp    %r13d,0x48(%rsp)
mov    0xb0(%rsp),%rbp
je     1222 <aperturePhotometry+0xd2>
cmp    0x90(%rsp),%ebp
jg     12f0 <aperturePhotometry+0x1a0>
xorps  %xmm0,%xmm0
cvtsi2ss %r13d,%xmm0
subss  0x2c(%rsp),%xmm0
movaps %xmm0,%xmm1
xorps  0xcfa(%rip),%xmm1
movaps %xmm0,%xmm2
cmpltss 0xcce(%rip),%xmm2
andps  %xmm2,%xmm1
andnps %xmm0,%xmm2
orps   %xmm1,%xmm2
movaps %xmm2,0xd0(%rsp)
mov    %ebp,%r15d
mov    %r12,%rbp
jmp    14a0 <aperturePhotometry+0x350>
movaps %xmm5,%xmm0
divss  (%rsp),%xmm0
movsd  %xmm4,0x20(%rsp)
movapd %xmm2,0x70(%rsp)
movaps %xmm5,0x30(%rsp)
call   1040 <asin@plt>
movss  %xmm0,0x10(%rsp)
movapd 0x70(%rsp),%xmm0
mulsd  %xmm0,%xmm0
movsd  0xa0(%rsp),%xmm1
subsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
call   1050 <sqrt@plt>
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x8(%rsp)
divss  (%rsp),%xmm0
call   1040 <asin@plt>
subss  0x10(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,0x10(%rsp)
movss  0x8(%rsp),%xmm1
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
mulsd  0xc3a(%rip),%xmm0
movsd  %xmm0,0x50(%rsp)
mulss  %xmm1,%xmm1
movaps 0x80(%rsp),%xmm0
subss  %xmm1,%xmm0
call   1050 <sqrt@plt>
mulsd  0x50(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
mulsd  0x68(%rsp),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,0x10(%rsp)
movaps 0x30(%rsp),%xmm1
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
movsd  %xmm0,0x50(%rsp)
mulss  %xmm1,%xmm1
movaps 0x80(%rsp),%xmm0
subss  %xmm1,%xmm0
call   1050 <sqrt@plt>
movsd  0x20(%rsp),%xmm4
movss  0x4(%rsp),%xmm3
movsd  0x50(%rsp),%xmm1
mulsd  0xbca(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0x10(%rsp),%xmm1
movss  0x8(%rsp),%xmm0
subss  0x30(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0x70(%rsp),%xmm0
subsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
mulss  (%r12),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  %xmm0,%xmm4
add    $0x4,%r12
add    $0x1,%r15d
cmp    %r15d,%ebx
je     12f3 <aperturePhotometry+0x1a3>
xorps  %xmm0,%xmm0
cvtsi2ss %r15d,%xmm0
subss  %xmm3,%xmm0
movaps %xmm0,%xmm1
xorps  0xb7a(%rip),%xmm1
movaps %xmm0,%xmm2
cmpltss 0xb4e(%rip),%xmm2
andps  %xmm2,%xmm1
andnps %xmm0,%xmm2
orps   %xmm1,%xmm2
movaps 0xd0(%rsp),%xmm0
movaps %xmm0,%xmm6
minss  %xmm2,%xmm6
maxss  %xmm0,%xmm2
movaps %xmm6,%xmm5
shufps $0x0,%xmm6,%xmm5
addps  0xb54(%rip),%xmm5
cvtss2sd %xmm2,%xmm2
movlhps %xmm2,%xmm2
addpd  0xb55(%rip),%xmm2
cvtpd2ps %xmm2,%xmm0
mulps  %xmm0,%xmm0
shufps $0x14,%xmm0,%xmm0
movaps %xmm5,%xmm1
mulps  %xmm5,%xmm1
unpcklps %xmm1,%xmm1
addps  %xmm0,%xmm1
cmpltps 0xc0(%rsp),%xmm1
movmskps %xmm1,%ecx
mov    %ecx,%eax
shr    %al
and    $0x5,%al
sub    %al,%cl
mov    %ecx,%eax
and    $0x33,%al
shr    $0x2,%cl
and    $0x33,%cl
add    %al,%cl
mov    %ecx,%eax
shr    $0x4,%al
add    %cl,%al
and    $0xf,%al
cmp    $0x4,%al
ja     18da <aperturePhotometry+0x78a>
movzbl %al,%eax
movslq (%r14,%rax,4),%rax
add    %r14,%rax
movss  0xab3(%rip),%xmm0
jmp    *%rax
movsd  0xb8(%rsp),%xmm0
ucomisd %xmm2,%xmm0
xorpd  %xmm0,%xmm0
jbe    1481 <aperturePhotometry+0x331>
ucomiss 0xa8b(%rip),%xmm6
jbe    1481 <aperturePhotometry+0x331>
movss  0xa81(%rip),%xmm1
ucomiss %xmm6,%xmm1
jbe    1481 <aperturePhotometry+0x331>
movapd %xmm2,%xmm0
mulsd  %xmm2,%xmm0
movsd  0xa0(%rsp),%xmm1
subsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
movsd  %xmm4,0x20(%rsp)
movapd %xmm2,0x70(%rsp)
call   1050 <sqrt@plt>
cvtsd2ss %xmm0,%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xa67(%rip),%xmm1
xorps  %xmm1,%xmm0
divss  (%rsp),%xmm0
call   1040 <asin@plt>
movaps %xmm0,%xmm1
xorps  0xa50(%rip),%xmm1
subss  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
movsd  %xmm0,0x30(%rsp)
movaps 0x10(%rsp),%xmm1
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
mulsd  0xa13(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
mulss  %xmm1,%xmm1
movaps 0x80(%rsp),%xmm0
subss  %xmm1,%xmm0
movaps %xmm0,0x50(%rsp)
call   1050 <sqrt@plt>
mulsd  0x8(%rsp),%xmm0
movsd  0x30(%rsp),%xmm1
mulsd  0x68(%rsp),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,0x30(%rsp)
movapd 0x50(%rsp),%xmm0
call   1050 <sqrt@plt>
movsd  0x20(%rsp),%xmm4
movss  0x4(%rsp),%xmm3
mulsd  0x8(%rsp),%xmm0
addsd  0x30(%rsp),%xmm0
movaps 0x10(%rsp),%xmm1
addss  %xmm1,%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  0x70(%rsp),%xmm1
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
jmp    1481 <aperturePhotometry+0x331>
movaps %xmm5,%xmm0
divss  (%rsp),%xmm0
movsd  %xmm4,0x20(%rsp)
movapd %xmm2,0x70(%rsp)
movaps %xmm5,0x30(%rsp)
call   1040 <asin@plt>
movss  %xmm0,0x10(%rsp)
movaps 0x30(%rsp),%xmm0
shufps $0x55,%xmm0,%xmm0
movaps %xmm0,0x50(%rsp)
divss  (%rsp),%xmm0
call   1040 <asin@plt>
subss  0x10(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,0x10(%rsp)
movaps 0x50(%rsp),%xmm0
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
mulsd  0x934(%rip),%xmm1
movsd  %xmm1,0x8(%rsp)
mulss  %xmm0,%xmm0
movaps %xmm0,%xmm2
movaps 0x80(%rsp),%xmm0
subss  %xmm2,%xmm0
call   1050 <sqrt@plt>
mulsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
mulsd  0x68(%rsp),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,0x10(%rsp)
movaps 0x30(%rsp),%xmm0
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
mulss  %xmm0,%xmm0
movaps %xmm0,%xmm1
movaps 0x80(%rsp),%xmm0
subss  %xmm1,%xmm0
call   1050 <sqrt@plt>
movsd  0x20(%rsp),%xmm4
movss  0x4(%rsp),%xmm3
movsd  0x8(%rsp),%xmm1
mulsd  0x8be(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0x10(%rsp),%xmm1
subsd  0x70(%rsp),%xmm1
jmp    147a <aperturePhotometry+0x32a>
movapd %xmm2,%xmm0
unpckhpd %xmm2,%xmm0
mulsd  %xmm0,%xmm0
movsd  0xa0(%rsp),%xmm1
subsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
movsd  %xmm4,0x20(%rsp)
movapd %xmm2,0x70(%rsp)
movaps %xmm5,0x30(%rsp)
movaps %xmm6,0x50(%rsp)
call   1050 <sqrt@plt>
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x8(%rsp)
divss  (%rsp),%xmm0
call   1040 <asin@plt>
movss  %xmm0,0x10(%rsp)
movaps 0x30(%rsp),%xmm0
shufps $0x55,%xmm0,%xmm0
movaps %xmm0,0x30(%rsp)
divss  (%rsp),%xmm0
call   1040 <asin@plt>
subss  0x10(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,0x10(%rsp)
movaps 0x30(%rsp),%xmm1
xorps  %xmm2,%xmm2
cvtss2sd %xmm1,%xmm2
movsd  0x810(%rip),%xmm0
mulsd  %xmm0,%xmm2
movsd  %xmm2,0x98(%rsp)
mulss  %xmm1,%xmm1
movaps 0x80(%rsp),%xmm0
subss  %xmm1,%xmm0
call   1050 <sqrt@plt>
mulsd  0x98(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
mulsd  0x68(%rsp),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,0x10(%rsp)
movss  0x8(%rsp),%xmm1
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
movsd  %xmm0,0x98(%rsp)
mulss  %xmm1,%xmm1
movaps 0x80(%rsp),%xmm0
subss  %xmm1,%xmm0
call   1050 <sqrt@plt>
movsd  0x20(%rsp),%xmm4
movss  0x4(%rsp),%xmm3
movsd  0x98(%rsp),%xmm1
mulsd  0x78f(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0x10(%rsp),%xmm1
movaps 0x30(%rsp),%xmm0
movss  0x8(%rsp),%xmm2
subss  %xmm2,%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0x70(%rsp),%xmm0
subsd  %xmm0,%xmm1
subss  0x50(%rsp),%xmm2
xorps  %xmm0,%xmm0
cvtss2sd %xmm2,%xmm0
addsd  0x74b(%rip),%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
jmp    1481 <aperturePhotometry+0x331>
mov    $0xffffffff,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"ERROR\0A\00"
define float @aperturePhotometry(float* %0, i32 %1, i32 %2, float %3, float %4, float %5) {
%7 = alloca float
%8 = alloca float*
%9 = alloca i32
%10 = alloca i32
%11 = alloca float
%12 = alloca float
%13 = alloca float
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca [4 x float]
%19 = alloca [4 x float]
%20 = alloca i32
%21 = alloca i32
%22 = alloca float
%23 = alloca float
%24 = alloca float
%25 = alloca float
%26 = alloca float
%27 = alloca float
%28 = alloca float
%29 = alloca i32
%30 = alloca i32
%31 = alloca float
%32 = alloca double
store float* %0, float** %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store float %3, float* %11
store float %4, float* %12
store float %5, float* %13
%33 = load float, float* %13
%34 = fpext float %33 to double
%35 = fcmp ole double %34, 0.000000e+00
br i1 %35, label %36, label %37
36: ; preds = %6
store float 0.000000e+00, float* %7
br label %510
37: ; preds = %6
%38 = load float, float* %11
%39 = load float, float* %13
%40 = fsub float %38, %39
%41 = fpext float %40 to double
%42 = fsub double %41, 5.000000e-01
%43 = fptrunc double %42 to float
%44 = call i64 @floor(float %43)
%45 = trunc i64 %44 to i32
store i32 %45, i32* %14
%46 = load float, float* %12
%47 = load float, float* %13
%48 = fsub float %46, %47
%49 = fpext float %48 to double
%50 = fsub double %49, 5.000000e-01
%51 = fptrunc double %50 to float
%52 = call i64 @floor(float %51)
%53 = trunc i64 %52 to i32
store i32 %53, i32* %16
%54 = load float, float* %11
%55 = load float, float* %13
%56 = fadd float %54, %55
%57 = fpext float %56 to double
%58 = fadd double %57, 5.000000e-01
%59 = fptrunc double %58 to float
%60 = call i64 @floor(float %59)
%61 = trunc i64 %60 to i32
store i32 %61, i32* %15
%62 = load float, float* %12
%63 = load float, float* %13
%64 = fadd float %62, %63
%65 = fpext float %64 to double
%66 = fadd double %65, 5.000000e-01
%67 = fptrunc double %66 to float
%68 = call i64 @floor(float %67)
%69 = trunc i64 %68 to i32
store i32 %69, i32* %17
%70 = load i32, i32* %14
%71 = icmp slt i32 %70, 0
br i1 %71, label %83, label %72
72: ; preds = %37
%73 = load i32, i32* %16
%74 = icmp slt i32 %73, 0
br i1 %74, label %83, label %75
75: ; preds = %72
%76 = load i32, i32* %15
%77 = load i32, i32* %9
%78 = icmp sgt i32 %76, %77
br i1 %78, label %83, label %79
79: ; preds = %75
%80 = load i32, i32* %17
%81 = load i32, i32* %10
%82 = icmp sgt i32 %80, %81
br i1 %82, label %83, label %85
83: ; preds = %79, %75, %72, %37
%84 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
store float -1.000000e+00, float* %7
br label %510
85: ; preds = %79
store double 0.000000e+00, double* %32
%86 = load i32, i32* %16
store i32 %86, i32* %21
br label %87
87: ; preds = %504, %85
%88 = load i32, i32* %21
%89 = load i32, i32* %17
%90 = icmp sle i32 %88, %89
br i1 %90, label %91, label %507
91: ; preds = %87
%92 = load i32, i32* %14
store i32 %92, i32* %20
br label %93
93: ; preds = %500, %91
%94 = load i32, i32* %20
%95 = load i32, i32* %15
%96 = icmp sle i32 %94, %95
br i1 %96, label %97, label %503
97: ; preds = %93
%98 = load i32, i32* %20
%99 = sitofp i32 %98 to float
%100 = load float, float* %11
%101 = fsub float %99, %100
store float %101, float* %23
%102 = load i32, i32* %21
%103 = sitofp i32 %102 to float
%104 = load float, float* %12
%105 = fsub float %103, %104
store float %105, float* %24
%106 = load float, float* %23
%107 = fcmp olt float %106, 0.000000e+00
br i1 %107, label %108, label %111
108: ; preds = %97
%109 = load float, float* %23
%110 = fneg float %109
store float %110, float* %23
br label %111
111: ; preds = %108, %97
%112 = load float, float* %24
%113 = fcmp olt float %112, 0.000000e+00
br i1 %113, label %114, label %117
114: ; preds = %111
%115 = load float, float* %24
%116 = fneg float %115
store float %116, float* %24
br label %117
117: ; preds = %114, %111
%118 = load float, float* %23
%119 = load float, float* %24
%120 = fcmp ogt float %118, %119
br i1 %120, label %121, label %125
121: ; preds = %117
%122 = load float, float* %23
store float %122, float* %22
%123 = load float, float* %24
store float %123, float* %23
%124 = load float, float* %22
store float %124, float* %24
br label %125
125: ; preds = %121, %117
%126 = load float, float* %23
%127 = fpext float %126 to double
%128 = fsub double %127, 5.000000e-01
%129 = fptrunc double %128 to float
%130 = getelementptr inbounds [4 x float], [4 x float]* %18, i64 0, i64 1
store float %129, float* %130
%131 = getelementptr inbounds [4 x float], [4 x float]* %18, i64 0, i64 0
store float %129, float* %131
%132 = load float, float* %23
%133 = fpext float %132 to double
%134 = fadd double %133, 5.000000e-01
%135 = fptrunc double %134 to float
%136 = getelementptr inbounds [4 x float], [4 x float]* %18, i64 0, i64 3
store float %135, float* %136
%137 = getelementptr inbounds [4 x float], [4 x float]* %18, i64 0, i64 2
store float %135, float* %137
%138 = load float, float* %24
%139 = fpext float %138 to double
%140 = fsub double %139, 5.000000e-01
%141 = fptrunc double %140 to float
%142 = getelementptr inbounds [4 x float], [4 x float]* %19, i64 0, i64 3
store float %141, float* %142
%143 = getelementptr inbounds [4 x float], [4 x float]* %19, i64 0, i64 0
store float %141, float* %143
%144 = load float, float* %24
%145 = fpext float %144 to double
%146 = fadd double %145, 5.000000e-01
%147 = fptrunc double %146 to float
%148 = getelementptr inbounds [4 x float], [4 x float]* %19, i64 0, i64 2
store float %147, float* %148
%149 = getelementptr inbounds [4 x float], [4 x float]* %19, i64 0, i64 1
store float %147, float* %149
store i32 0, i32* %30
store i32 0, i32* %29
br label %150
150: ; preds = %180, %125
%151 = load i32, i32* %29
%152 = icmp slt i32 %151, 4
br i1 %152, label %153, label %183
153: ; preds = %150
%154 = load i32, i32* %29
%155 = sext i32 %154 to i64
%156 = getelementptr inbounds [4 x float], [4 x float]* %18, i64 0, i64 %155
%157 = load float, float* %156
%158 = load i32, i32* %29
%159 = sext i32 %158 to i64
%160 = getelementptr inbounds [4 x float], [4 x float]* %18, i64 0, i64 %159
%161 = load float, float* %160
%162 = load i32, i32* %29
%163 = sext i32 %162 to i64
%164 = getelementptr inbounds [4 x float], [4 x float]* %19, i64 0, i64 %163
%165 = load float, float* %164
%166 = load i32, i32* %29
%167 = sext i32 %166 to i64
%168 = getelementptr inbounds [4 x float], [4 x float]* %19, i64 0, i64 %167
%169 = load float, float* %168
%170 = fmul float %165, %169
%171 = call float @llvm.fmuladd.f32(float %157, float %161, float %170)
%172 = load float, float* %13
%173 = load float, float* %13
%174 = fmul float %172, %173
%175 = fcmp olt float %171, %174
br i1 %175, label %176, label %179
176: ; preds = %153
%177 = load i32, i32* %30
%178 = add nsw i32 %177, 1
store i32 %178, i32* %30
br label %179
179: ; preds = %176, %153
br label %180
180: ; preds = %179
%181 = load i32, i32* %29
%182 = add nsw i32 %181, 1
store i32 %182, i32* %29
br label %150
183: ; preds = %150
%184 = load i32, i32* %30
switch i32 %184, label %483 [
i32 0, label %185
i32 4, label %272
i32 1, label %273
i32 3, label %346
i32 2, label %425
]
185: ; preds = %183
%186 = load float, float* %13
%187 = fpext float %186 to double
%188 = load float, float* %24
%189 = fpext float %188 to double
%190 = fsub double %189, 5.000000e-01
%191 = fcmp ogt double %187, %190
br i1 %191, label %192, label %270
192: ; preds = %185
%193 = load float, float* %23
%194 = fpext float %193 to double
%195 = fcmp ogt double %194, -5.000000e-01
br i1 %195, label %196, label %270
196: ; preds = %192
%197 = load float, float* %23
%198 = fpext float %197 to double
%199 = fcmp olt double %198, 5.000000e-01
br i1 %199, label %200, label %270
200: ; preds = %196
%201 = load float, float* %13
%202 = load float, float* %13
%203 = fmul float %201, %202
%204 = fpext float %203 to double
%205 = load float, float* %24
%206 = fpext float %205 to double
%207 = fsub double %206, 5.000000e-01
%208 = load float, float* %24
%209 = fpext float %208 to double
%210 = fsub double %209, 5.000000e-01
%211 = fneg double %207
%212 = call double @llvm.fmuladd.f64(double %211, double %210, double %204)
%213 = fptrunc double %212 to float
%214 = call double @sqrt(float %213)
%215 = fneg double %214
%216 = fptrunc double %215 to float
store float %216, float* %25
%217 = load float, float* %25
%218 = load float, float* %13
%219 = fdiv float %217, %218
%220 = call float @asin(float %219)
store float %220, float* %27
%221 = load float, float* %25
%222 = fneg float %221
store float %222, float* %26
%223 = load float, float* %27
%224 = fneg float %223
store float %224, float* %28
%225 = load float, float* %13
%226 = load float, float* %13
%227 = fmul float %225, %226
%228 = fpext float %227 to double
%229 = fdiv double %228, 2.000000e+00
%230 = load float, float* %28
%231 = load float, float* %27
%232 = fsub float %230, %231
%233 = fpext float %232 to double
%234 = load float, float* %26
%235 = fpext float %234 to double
%236 = fmul double 5.000000e-01, %235
%237 = load float, float* %13
%238 = load float, float* %13
%239 = load float, float* %26
%240 = load float, float* %26
%241 = fmul float %239, %240
%242 = fneg float %241
%243 = call float @llvm.fmuladd.f32(float %237, float %238, float %242)
%244 = call double @sqrt(float %243)
%245 = fmul double %236, %244
%246 = call double @llvm.fmuladd.f64(double %229, double %233, double %245)
%247 = load float, float* %25
%248 = fpext float %247 to double
%249 = fmul double 5.000000e-01, %248
%250 = load float, float* %13
%251 = load float, float* %13
%252 = load float, float* %25
%253 = load float, float* %25
%254 = fmul float %252, %253
%255 = fneg float %254
%256 = call float @llvm.fmuladd.f32(float %250, float %251, float %255)
%257 = call double @sqrt(float %256)
%258 = fneg double %249
%259 = call double @llvm.fmuladd.f64(double %258, double %257, double %246)
%260 = load float, float* %24
%261 = fpext float %260 to double
%262 = fsub double %261, 5.000000e-01
%263 = load float, float* %26
%264 = load float, float* %25
%265 = fsub float %263, %264
%266 = fpext float %265 to double
%267 = fneg double %262
%268 = call double @llvm.fmuladd.f64(double %267, double %266, double %259)
%269 = fptrunc double %268 to float
store float %269, float* %31
br label %271
270: ; preds = %196, %192, %185
store float 0.000000e+00, float* %31
br label %271
271: ; preds = %270, %200
br label %485
272: ; preds = %183
store float 1.000000e+00, float* %31
br label %485
273: ; preds = %183
%274 = load float, float* %23
%275 = fpext float %274 to double
%276 = fsub double %275, 5.000000e-01
%277 = fptrunc double %276 to float
store float %277, float* %25
%278 = load float, float* %25
%279 = load float, float* %13
%280 = fdiv float %278, %279
%281 = call float @asin(float %280)
store float %281, float* %27
%282 = load float, float* %13
%283 = load float, float* %13
%284 = fmul float %282, %283
%285 = fpext float %284 to double
%286 = load float, float* %24
%287 = fpext float %286 to double
%288 = fsub double %287, 5.000000e-01
%289 = load float, float* %24
%290 = fpext float %289 to double
%291 = fsub double %290, 5.000000e-01
%292 = fneg double %288
%293 = call double @llvm.fmuladd.f64(double %292, double %291, double %285)
%294 = fptrunc double %293 to float
%295 = call double @sqrt(float %294)
%296 = fptrunc double %295 to float
store float %296, float* %26
%297 = load float, float* %26
%298 = load float, float* %13
%299 = fdiv float %297, %298
%300 = call float @asin(float %299)
store float %300, float* %28
%301 = load float, float* %13
%302 = load float, float* %13
%303 = fmul float %301, %302
%304 = fpext float %303 to double
%305 = fdiv double %304, 2.000000e+00
%306 = load float, float* %28
%307 = load float, float* %27
%308 = fsub float %306, %307
%309 = fpext float %308 to double
%310 = load float, float* %26
%311 = fpext float %310 to double
%312 = fmul double 5.000000e-01, %311
%313 = load float, float* %13
%314 = load float, float* %13
%315 = load float, float* %26
%316 = load float, float* %26
%317 = fmul float %315, %316
%318 = fneg float %317
%319 = call float @llvm.fmuladd.f32(float %313, float %314, float %318)
%320 = call double @sqrt(float %319)
%321 = fmul double %312, %320
%322 = call double @llvm.fmuladd.f64(double %305, double %309, double %321)
%323 = load float, float* %25
%324 = fpext float %323 to double
%325 = fmul double 5.000000e-01, %324
%326 = load float, float* %13
%327 = load float, float* %13
%328 = load float, float* %25
%329 = load float, float* %25
%330 = fmul float %328, %329
%331 = fneg float %330
%332 = call float @llvm.fmuladd.f32(float %326, float %327, float %331)
%333 = call double @sqrt(float %332)
%334 = fneg double %325
%335 = call double @llvm.fmuladd.f64(double %334, double %333, double %322)
%336 = load float, float* %24
%337 = fpext float %336 to double
%338 = fsub double %337, 5.000000e-01
%339 = load float, float* %26
%340 = load float, float* %25
%341 = fsub float %339, %340
%342 = fpext float %341 to double
%343 = fneg double %338
%344 = call double @llvm.fmuladd.f64(double %343, double %342, double %335)
%345 = fptrunc double %344 to float
store float %345, float* %31
br label %485
346: ; preds = %183
%347 = load float, float* %13
%348 = load float, float* %13
%349 = fmul float %347, %348
%350 = fpext float %349 to double
%351 = load float, float* %24
%352 = fpext float %351 to double
%353 = fadd double %352, 5.000000e-01
%354 = load float, float* %24
%355 = fpext float %354 to double
%356 = fadd double %355, 5.000000e-01
%357 = fneg double %353
%358 = call double @llvm.fmuladd.f64(double %357, double %356, double %350)
%359 = fptrunc double %358 to float
%360 = call double @sqrt(float %359)
%361 = fptrunc double %360 to float
store float %361, float* %25
%362 = load float, float* %25
%363 = load float, float* %13
%364 = fdiv float %362, %363
%365 = call float @asin(float %364)
store float %365, float* %27
%366 = load float, float* %23
%367 = fpext float %366 to double
%368 = fadd double %367, 5.000000e-01
%369 = fptrunc double %368 to float
store float %369, float* %26
%370 = load float, float* %26
%371 = load float, float* %13
%372 = fdiv float %370, %371
%373 = call float @asin(float %372)
store float %373, float* %28
%374 = load float, float* %13
%375 = load float, float* %13
%376 = fmul float %374, %375
%377 = fpext float %376 to double
%378 = fdiv double %377, 2.000000e+00
%379 = load float, float* %28
%380 = load float, float* %27
%381 = fsub float %379, %380
%382 = fpext float %381 to double
%383 = load float, float* %26
%384 = fpext float %383 to double
%385 = fmul double 5.000000e-01, %384
%386 = load float, float* %13
%387 = load float, float* %13
%388 = load float, float* %26
%389 = load float, float* %26
%390 = fmul float %388, %389
%391 = fneg float %390
%392 = call float @llvm.fmuladd.f32(float %386, float %387, float %391)
%393 = call double @sqrt(float %392)
%394 = fmul double %385, %393
%395 = call double @llvm.fmuladd.f64(double %378, double %382, double %394)
%396 = load float, float* %25
%397 = fpext float %396 to double
%398 = fmul double 5.000000e-01, %397
%399 = load float, float* %13
%400 = load float, float* %13
%401 = load float, float* %25
%402 = load float, float* %25
%403 = fmul float %401, %402
%404 = fneg float %403
%405 = call float @llvm.fmuladd.f32(float %399, float %400, float %404)
%406 = call double @sqrt(float %405)
%407 = fneg double %398
%408 = call double @llvm.fmuladd.f64(double %407, double %406, double %395)
%409 = load float, float* %24
%410 = fpext float %409 to double
%411 = fsub double %410, 5.000000e-01
%412 = load float, float* %26
%413 = load float, float* %25
%414 = fsub float %412, %413
%415 = fpext float %414 to double
%416 = fneg double %411
%417 = call double @llvm.fmuladd.f64(double %416, double %415, double %408)
%418 = load float, float* %25
%419 = load float, float* %23
%420 = fsub float %418, %419
%421 = fpext float %420 to double
%422 = fadd double %421, 5.000000e-01
%423 = call double @llvm.fmuladd.f64(double 1.000000e+00, double %422, double %417)
%424 = fptrunc double %423 to float
store float %424, float* %31
br label %485
425: ; preds = %183
%426 = load float, float* %23
%427 = fpext float %426 to double
%428 = fsub double %427, 5.000000e-01
%429 = fptrunc double %428 to float
store float %429, float* %25
%430 = load float, float* %25
%431 = load float, float* %13
%432 = fdiv float %430, %431
%433 = call float @asin(float %432)
store float %433, float* %27
%434 = load float, float* %23
%435 = fpext float %434 to double
%436 = fadd double %435, 5.000000e-01
%437 = fptrunc double %436 to float
store float %437, float* %26
%438 = load float, float* %26
%439 = load float, float* %13
%440 = fdiv float %438, %439
%441 = call float @asin(float %440)
store float %441, float* %28
%442 = load float, float* %13
%443 = load float, float* %13
%444 = fmul float %442, %443
%445 = fpext float %444 to double
%446 = fdiv double %445, 2.000000e+00
%447 = load float, float* %28
%448 = load float, float* %27
%449 = fsub float %447, %448
%450 = fpext float %449 to double
%451 = load float, float* %26
%452 = fpext float %451 to double
%453 = fmul double 5.000000e-01, %452
%454 = load float, float* %13
%455 = load float, float* %13
%456 = load float, float* %26
%457 = load float, float* %26
%458 = fmul float %456, %457
%459 = fneg float %458
%460 = call float @llvm.fmuladd.f32(float %454, float %455, float %459)
%461 = call double @sqrt(float %460)
%462 = fmul double %453, %461
%463 = call double @llvm.fmuladd.f64(double %446, double %450, double %462)
%464 = load float, float* %25
%465 = fpext float %464 to double
%466 = fmul double 5.000000e-01, %465
%467 = load float, float* %13
%468 = load float, float* %13
%469 = load float, float* %25
%470 = load float, float* %25
%471 = fmul float %469, %470
%472 = fneg float %471
%473 = call float @llvm.fmuladd.f32(float %467, float %468, float %472)
%474 = call double @sqrt(float %473)
%475 = fneg double %466
%476 = call double @llvm.fmuladd.f64(double %475, double %474, double %463)
%477 = load float, float* %24
%478 = fpext float %477 to double
%479 = fsub double %478, 5.000000e-01
%480 = fneg double %479
%481 = call double @llvm.fmuladd.f64(double %480, double 1.000000e+00, double %476)
%482 = fptrunc double %481 to float
store float %482, float* %31
br label %485
483: ; preds = %183
%484 = call i32 @exit(i32 -1)
unreachable
485: ; preds = %425, %346, %273, %272, %271
%486 = load float, float* %31
%487 = load float*, float** %8
%488 = load i32, i32* %21
%489 = load i32, i32* %9
%490 = mul nsw i32 %488, %489
%491 = load i32, i32* %20
%492 = add nsw i32 %490, %491
%493 = sext i32 %492 to i64
%494 = getelementptr inbounds float, float* %487, i64 %493
%495 = load float, float* %494
%496 = fmul float %486, %495
%497 = fpext float %496 to double
%498 = load double, double* %32
%499 = fadd double %498, %497
store double %499, double* %32
br label %500
500: ; preds = %485
%501 = load i32, i32* %20
%502 = add nsw i32 %501, 1
store i32 %502, i32* %20
br label %93
503: ; preds = %93
br label %504
504: ; preds = %503
%505 = load i32, i32* %21
%506 = add nsw i32 %505, 1
store i32 %506, i32* %21
br label %87
507: ; preds = %87
%508 = load double, double* %32
%509 = fptrunc double %508 to float
store float %509, float* %7
br label %510
510: ; preds = %507, %83, %36
%511 = load float, float* %7
ret float %511
}

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