#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 */
double atan(int);
double fabs(float);
float pow(float, double);
int tan(float);
float xy2phi(float x, float y, float a[], int *quadrant) {
  float phi, thetap, theta, xd, yd, galPA, sintheta, costheta, cosqr, l, pixPA;
  xd = x - a[1];
  yd = y - a[2];
  galPA = a[9];
  if (xd == 0.) {
    if (yd < 0.)
      pixPA = 3.14159265352982;
    else if (yd >= 0.)
      pixPA = 0.;
  } else if (yd == 0.) {
    if (xd > 0.)
      pixPA = -3.14159265352982 / 2.;
    else if (xd < 0.)
      pixPA = 3.14159265352982 / 2.;
  } else {
    l = pow(xd * xd + yd * yd, 0.5);
    xd = xd / l;
    yd = yd / l;
    pixPA = atan(yd / xd) + 3.14159265352982 / 2.;
  };
  if ((xd > 0. && yd < 0.) || (xd > 0. && yd > 0.))
    pixPA = pixPA + 3.14159265352982;
  theta = pixPA - galPA;
  if (theta < 0.)
    theta = theta + 2 * 3.14159265352982;
  if (xd == 0. && yd == 0.)
    *quadrant = 0.;
  else
    *quadrant = (int)(theta / (3.14159265352982 / 2.) + 1);
  if (*quadrant == 5)
    *quadrant = 1;
  if (fabs(theta - 3.14159265352982 / 2.) < 1.e-7)
    phi = 3.14159265352982 / 2.;
  else if (fabs(theta + 3.14159265352982 / 2.) < 1.e-7)
    phi = -3.14159265352982 / 2.;
  else
    phi = atan(1 / a[8] * tan(theta));
  if ((*quadrant == 2 || *quadrant == 3) &&
      fabs(theta - 3.14159265352982 / 2.) > 1.e-7)
    phi += 3.14159265352982;
  if (*quadrant == 4)
    phi += (2 * 3.14159265352982);
  return (phi);
}


x86 assembly (clang, -O0):
<xy2phi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movss  -0x4(%rbp),%xmm0
mov    -0x10(%rbp),%rax
subss  0x4(%rax),%xmm0
movss  %xmm0,-0x28(%rbp)
movss  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rax
subss  0x8(%rax),%xmm0
movss  %xmm0,-0x2c(%rbp)
mov    -0x10(%rbp),%rax
movss  0x24(%rax),%xmm0
movss  %xmm0,-0x30(%rbp)
movss  -0x28(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    11fa <xy2phi+0xba>
jp     11fa <xy2phi+0xba>
movss  -0x2c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    11d2 <xy2phi+0x92>
movss  0xe70(%rip),%xmm0
movss  %xmm0,-0x44(%rbp)
jmp    11f5 <xy2phi+0xb5>
movss  -0x2c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     11f0 <xy2phi+0xb0>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x44(%rbp)
jmp    11f5 <xy2phi+0xb5>
jmp    12e4 <xy2phi+0x1a4>
movss  -0x2c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    126b <xy2phi+0x12b>
jp     126b <xy2phi+0x12b>
movss  -0x28(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    123e <xy2phi+0xfe>
movss  0xe00(%rip),%xmm0
movss  %xmm0,-0x44(%rbp)
jmp    1266 <xy2phi+0x126>
movss  -0x28(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    1261 <xy2phi+0x121>
movss  0xdd4(%rip),%xmm0
movss  %xmm0,-0x44(%rbp)
jmp    1266 <xy2phi+0x126>
jmp    12df <xy2phi+0x19f>
movss  -0x28(%rbp),%xmm0
movss  -0x28(%rbp),%xmm2
movss  -0x2c(%rbp),%xmm1
mulss  -0x2c(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movsd  0xd79(%rip),%xmm1
call   1060 <pow@plt>
movss  %xmm0,-0x40(%rbp)
movss  -0x28(%rbp),%xmm0
divss  -0x40(%rbp),%xmm0
movss  %xmm0,-0x28(%rbp)
movss  -0x2c(%rbp),%xmm0
divss  -0x40(%rbp),%xmm0
movss  %xmm0,-0x2c(%rbp)
movss  -0x2c(%rbp),%xmm0
divss  -0x28(%rbp),%xmm0
cvttss2si %xmm0,%edi
call   1040 <atan@plt>
movsd  0xd2e(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x44(%rbp)
jmp    12e4 <xy2phi+0x1a4>
movss  -0x28(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1310 <xy2phi+0x1d0>
movss  -0x2c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
ja     133c <xy2phi+0x1fc>
movss  -0x28(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    135a <xy2phi+0x21a>
movss  -0x2c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    135a <xy2phi+0x21a>
movss  -0x44(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xcc3(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x44(%rbp)
movss  -0x44(%rbp),%xmm0
subss  -0x30(%rbp),%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    139d <xy2phi+0x25d>
movss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xc88(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x28(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    13e4 <xy2phi+0x2a4>
jp     13e4 <xy2phi+0x2a4>
movss  -0x2c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    13e4 <xy2phi+0x2a4>
jp     13e4 <xy2phi+0x2a4>
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
jmp    140f <xy2phi+0x2cf>
movss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xc0b(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xc1f(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
cmpl   $0x5,(%rax)
jne    1426 <xy2phi+0x2e6>
mov    -0x18(%rbp),%rax
movl   $0x1,(%rax)
movss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xbc9(%rip),%xmm1
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1030 <fabs@plt>
movaps %xmm0,%xmm1
movsd  0xbd9(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    146b <xy2phi+0x32b>
movss  0xbcf(%rip),%xmm0
movss  %xmm0,-0x1c(%rbp)
jmp    14f4 <xy2phi+0x3b4>
movss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xb84(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1030 <fabs@plt>
movaps %xmm0,%xmm1
movsd  0xb94(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    14b0 <xy2phi+0x370>
movss  0xb8e(%rip),%xmm0
movss  %xmm0,-0x1c(%rbp)
jmp    14ef <xy2phi+0x3af>
mov    -0x10(%rbp),%rax
movss  0xb80(%rip),%xmm0
divss  0x20(%rax),%xmm0
movss  %xmm0,-0x48(%rbp)
movss  -0x24(%rbp),%xmm0
call   1050 <tan@plt>
movss  -0x48(%rbp),%xmm0
cvtsi2ss %eax,%xmm1
mulss  %xmm1,%xmm0
cvttss2si %xmm0,%edi
call   1040 <atan@plt>
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x1c(%rbp)
jmp    14f4 <xy2phi+0x3b4>
mov    -0x18(%rbp),%rax
cmpl   $0x2,(%rax)
je     150e <xy2phi+0x3ce>
mov    -0x18(%rbp),%rax
cmpl   $0x3,(%rax)
jne    155c <xy2phi+0x41c>
movss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xae1(%rip),%xmm1
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1030 <fabs@plt>
movsd  0xaf4(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    155c <xy2phi+0x41c>
movss  -0x1c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xac1(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
cmpl   $0x4,(%rax)
jne    1587 <xy2phi+0x447>
movss  -0x1c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xa9e(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xy2phi>:
push   %r14
push   %rbx
sub    $0x38,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
movaps %xmm0,%xmm3
movsd  0x4(%rdi),%xmm0
unpcklps %xmm1,%xmm3
subps  %xmm0,%xmm3
movss  0x24(%rdi),%xmm4
xorps  %xmm0,%xmm0
movaps %xmm3,%xmm1
shufps $0x55,%xmm3,%xmm1
ucomiss %xmm0,%xmm3
jne    1183 <xy2phi+0x43>
jp     1183 <xy2phi+0x43>
ucomiss %xmm1,%xmm0
jbe    119c <xy2phi+0x5c>
movss  0xec2(%rip),%xmm0
jmp    1212 <xy2phi+0xd2>
ucomiss %xmm0,%xmm1
jne    11a1 <xy2phi+0x61>
jp     11a1 <xy2phi+0x61>
xorps  %xmm0,%xmm0
ucomiss %xmm0,%xmm3
jbe    120a <xy2phi+0xca>
movss  0xe9e(%rip),%xmm0
jmp    1212 <xy2phi+0xd2>
xorps  %xmm0,%xmm0
jmp    1212 <xy2phi+0xd2>
mulss  %xmm1,%xmm1
movaps %xmm3,%xmm0
mulss  %xmm3,%xmm0
addss  %xmm1,%xmm0
movsd  0xe48(%rip),%xmm1
movaps %xmm3,0x10(%rsp)
movss  %xmm4,0x8(%rsp)
call   1060 <pow@plt>
shufps $0x0,%xmm0,%xmm0
movaps 0x10(%rsp),%xmm1
divps  %xmm0,%xmm1
movaps %xmm1,0x10(%rsp)
movaps 0x10(%rsp),%xmm0
shufps $0x55,%xmm0,%xmm0
divss  0x10(%rsp),%xmm0
cvttss2si %xmm0,%edi
call   1040 <atan@plt>
movss  0x8(%rsp),%xmm4
movaps 0x10(%rsp),%xmm3
addsd  0xe04(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
jmp    1212 <xy2phi+0xd2>
movss  0xe2a(%rip),%xmm0
xorps  %xmm2,%xmm2
ucomiss %xmm2,%xmm3
movaps %xmm3,%xmm1
shufps $0x55,%xmm3,%xmm1
jbe    1226 <xy2phi+0xe6>
ucomiss %xmm1,%xmm2
ja     1233 <xy2phi+0xf3>
ucomiss %xmm2,%xmm3
jbe    1243 <xy2phi+0x103>
xorps  %xmm2,%xmm2
ucomiss %xmm2,%xmm1
jbe    1243 <xy2phi+0x103>
cvtss2sd %xmm0,%xmm0
addsd  0xdd1(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
subss  %xmm4,%xmm0
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
addsd  0xdc2(%rip),%xmm1
cvtsd2ss %xmm1,%xmm1
xorps  %xmm2,%xmm2
movaps %xmm0,%xmm4
cmpltss %xmm2,%xmm4
movaps %xmm4,%xmm2
andnps %xmm0,%xmm2
andps  %xmm1,%xmm4
orps   %xmm2,%xmm4
xorps  %xmm0,%xmm0
cmpeqps %xmm0,%xmm3
unpcklps %xmm3,%xmm3
movmskpd %xmm3,%ecx
xor    %eax,%eax
movaps %xmm4,0x20(%rsp)
xorps  %xmm1,%xmm1
cvtss2sd %xmm4,%xmm1
cmp    $0x3,%cl
je     12b4 <xy2phi+0x174>
movaps %xmm1,%xmm0
divsd  0xd6b(%rip),%xmm0
addsd  0xd7b(%rip),%xmm0
cvttsd2si %xmm0,%ecx
cmp    $0x5,%ecx
mov    $0x1,%eax
cmovne %ecx,%eax
mov    %eax,(%r14)
movsd  0xd69(%rip),%xmm0
movsd  %xmm1,0x8(%rsp)
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x10(%rsp)
call   1030 <fabs@plt>
movsd  0xd50(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    12f0 <xy2phi+0x1b0>
movss  0xd4e(%rip),%xmm0
jmp    1356 <xy2phi+0x216>
movsd  0x8(%rsp),%xmm0
addsd  0xd0a(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
call   1030 <fabs@plt>
movsd  0xd21(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    131f <xy2phi+0x1df>
movss  0xd1b(%rip),%xmm0
jmp    1356 <xy2phi+0x216>
movss  0xd1d(%rip),%xmm0
divss  0x20(%rbx),%xmm0
movss  %xmm0,0x8(%rsp)
movaps 0x20(%rsp),%xmm0
call   1050 <tan@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
mulss  0x8(%rsp),%xmm0
cvttss2si %xmm0,%edi
call   1040 <atan@plt>
cvtsd2ss %xmm0,%xmm0
mov    (%r14),%eax
and    $0xfffffffe,%eax
cmp    $0x2,%eax
jne    1392 <xy2phi+0x252>
movss  %xmm0,0x8(%rsp)
movss  0x10(%rsp),%xmm0
call   1030 <fabs@plt>
ucomisd 0xcb6(%rip),%xmm0
jbe    13b0 <xy2phi+0x270>
movss  0x8(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  0xc82(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
cmpl   $0x4,(%r14)
jne    13a8 <xy2phi+0x268>
cvtss2sd %xmm0,%xmm0
addsd  0xc74(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x38,%rsp
pop    %rbx
pop    %r14
ret
movss  0x8(%rsp),%xmm0
cmpl   $0x4,(%r14)
je     1398 <xy2phi+0x258>
jmp    13a8 <xy2phi+0x268>

LLVM IR (-O0):
define float @xy2phi(float %0, float %1, float* %2, i32* %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float*
%8 = alloca i32*
%9 = alloca float
%10 = alloca float
%11 = alloca float
%12 = alloca float
%13 = alloca float
%14 = alloca float
%15 = alloca float
%16 = alloca float
%17 = alloca float
%18 = alloca float
%19 = alloca float
store float %0, float* %5
store float %1, float* %6
store float* %2, float** %7
store i32* %3, i32** %8
%20 = load float, float* %5
%21 = load float*, float** %7
%22 = getelementptr inbounds float, float* %21, i64 1
%23 = load float, float* %22
%24 = fsub float %20, %23
store float %24, float* %12
%25 = load float, float* %6
%26 = load float*, float** %7
%27 = getelementptr inbounds float, float* %26, i64 2
%28 = load float, float* %27
%29 = fsub float %25, %28
store float %29, float* %13
%30 = load float*, float** %7
%31 = getelementptr inbounds float, float* %30, i64 9
%32 = load float, float* %31
store float %32, float* %14
%33 = load float, float* %12
%34 = fpext float %33 to double
%35 = fcmp oeq double %34, 0.000000e+00
br i1 %35, label %36, label %48
36: ; preds = %4
%37 = load float, float* %13
%38 = fpext float %37 to double
%39 = fcmp olt double %38, 0.000000e+00
br i1 %39, label %40, label %41
40: ; preds = %36
store float 0x400921FB60000000, float* %19
br label %47
41: ; preds = %36
%42 = load float, float* %13
%43 = fpext float %42 to double
%44 = fcmp oge double %43, 0.000000e+00
br i1 %44, label %45, label %46
45: ; preds = %41
store float 0.000000e+00, float* %19
br label %46
46: ; preds = %45, %41
br label %47
47: ; preds = %46, %40
br label %86
48: ; preds = %4
%49 = load float, float* %13
%50 = fpext float %49 to double
%51 = fcmp oeq double %50, 0.000000e+00
br i1 %51, label %52, label %64
52: ; preds = %48
%53 = load float, float* %12
%54 = fpext float %53 to double
%55 = fcmp ogt double %54, 0.000000e+00
br i1 %55, label %56, label %57
56: ; preds = %52
store float 0xBFF921FB60000000, float* %19
br label %63
57: ; preds = %52
%58 = load float, float* %12
%59 = fpext float %58 to double
%60 = fcmp olt double %59, 0.000000e+00
br i1 %60, label %61, label %62
61: ; preds = %57
store float 0x3FF921FB60000000, float* %19
br label %62
62: ; preds = %61, %57
br label %63
63: ; preds = %62, %56
br label %85
64: ; preds = %48
%65 = load float, float* %12
%66 = load float, float* %12
%67 = load float, float* %13
%68 = load float, float* %13
%69 = fmul float %67, %68
%70 = call float @llvm.fmuladd.f32(float %65, float %66, float %69)
%71 = call float @pow(float %70, double 5.000000e-01)
store float %71, float* %18
%72 = load float, float* %12
%73 = load float, float* %18
%74 = fdiv float %72, %73
store float %74, float* %12
%75 = load float, float* %13
%76 = load float, float* %18
%77 = fdiv float %75, %76
store float %77, float* %13
%78 = load float, float* %13
%79 = load float, float* %12
%80 = fdiv float %78, %79
%81 = fptosi float %80 to i32
%82 = call double @atan(i32 %81)
%83 = fadd double %82, 0x3FF921FB54421D91
%84 = fptrunc double %83 to float
store float %84, float* %19
br label %85
85: ; preds = %64, %63
br label %86
86: ; preds = %85, %47
%87 = load float, float* %12
%88 = fpext float %87 to double
%89 = fcmp ogt double %88, 0.000000e+00
br i1 %89, label %90, label %94
90: ; preds = %86
%91 = load float, float* %13
%92 = fpext float %91 to double
%93 = fcmp olt double %92, 0.000000e+00
br i1 %93, label %102, label %94
94: ; preds = %90, %86
%95 = load float, float* %12
%96 = fpext float %95 to double
%97 = fcmp ogt double %96, 0.000000e+00
br i1 %97, label %98, label %107
98: ; preds = %94
%99 = load float, float* %13
%100 = fpext float %99 to double
%101 = fcmp ogt double %100, 0.000000e+00
br i1 %101, label %102, label %107
102: ; preds = %98, %90
%103 = load float, float* %19
%104 = fpext float %103 to double
%105 = fadd double %104, 0x400921FB54421D91
%106 = fptrunc double %105 to float
store float %106, float* %19
br label %107
107: ; preds = %102, %98, %94
%108 = load float, float* %19
%109 = load float, float* %14
%110 = fsub float %108, %109
store float %110, float* %11
%111 = load float, float* %11
%112 = fpext float %111 to double
%113 = fcmp olt double %112, 0.000000e+00
br i1 %113, label %114, label %119
114: ; preds = %107
%115 = load float, float* %11
%116 = fpext float %115 to double
%117 = fadd double %116, 0x401921FB54421D91
%118 = fptrunc double %117 to float
store float %118, float* %11
br label %119
119: ; preds = %114, %107
%120 = load float, float* %12
%121 = fpext float %120 to double
%122 = fcmp oeq double %121, 0.000000e+00
br i1 %122, label %123, label %129
123: ; preds = %119
%124 = load float, float* %13
%125 = fpext float %124 to double
%126 = fcmp oeq double %125, 0.000000e+00
br i1 %126, label %127, label %129
127: ; preds = %123
%128 = load i32*, i32** %8
store i32 0, i32* %128
br label %136
129: ; preds = %123, %119
%130 = load float, float* %11
%131 = fpext float %130 to double
%132 = fdiv double %131, 0x3FF921FB54421D91
%133 = fadd double %132, 1.000000e+00
%134 = fptosi double %133 to i32
%135 = load i32*, i32** %8
store i32 %134, i32* %135
br label %136
136: ; preds = %129, %127
%137 = load i32*, i32** %8
%138 = load i32, i32* %137
%139 = icmp eq i32 %138, 5
br i1 %139, label %140, label %142
140: ; preds = %136
%141 = load i32*, i32** %8
store i32 1, i32* %141
br label %142
142: ; preds = %140, %136
%143 = load float, float* %11
%144 = fpext float %143 to double
%145 = fsub double %144, 0x3FF921FB54421D91
%146 = fptrunc double %145 to float
%147 = call double @fabs(float %146)
%148 = fcmp olt double %147, 0x3E7AD7F29ABCAF48
br i1 %148, label %149, label %150
149: ; preds = %142
store float 0x3FF921FB60000000, float* %9
br label %171
150: ; preds = %142
%151 = load float, float* %11
%152 = fpext float %151 to double
%153 = fadd double %152, 0x3FF921FB54421D91
%154 = fptrunc double %153 to float
%155 = call double @fabs(float %154)
%156 = fcmp olt double %155, 0x3E7AD7F29ABCAF48
br i1 %156, label %157, label %158
157: ; preds = %150
store float 0xBFF921FB60000000, float* %9
br label %170
158: ; preds = %150
%159 = load float*, float** %7
%160 = getelementptr inbounds float, float* %159, i64 8
%161 = load float, float* %160
%162 = fdiv float 1.000000e+00, %161
%163 = load float, float* %11
%164 = call i32 @tan(float %163)
%165 = sitofp i32 %164 to float
%166 = fmul float %162, %165
%167 = fptosi float %166 to i32
%168 = call double @atan(i32 %167)
%169 = fptrunc double %168 to float
store float %169, float* %9
br label %170
170: ; preds = %158, %157
br label %171
171: ; preds = %170, %149
%172 = load i32*, i32** %8
%173 = load i32, i32* %172
%174 = icmp eq i32 %173, 2
br i1 %174, label %179, label %175
175: ; preds = %171
%176 = load i32*, i32** %8
%177 = load i32, i32* %176
%178 = icmp eq i32 %177, 3
br i1 %178, label %179, label %191
179: ; preds = %175, %171
%180 = load float, float* %11
%181 = fpext float %180 to double
%182 = fsub double %181, 0x3FF921FB54421D91
%183 = fptrunc double %182 to float
%184 = call double @fabs(float %183)
%185 = fcmp ogt double %184, 0x3E7AD7F29ABCAF48
br i1 %185, label %186, label %191
186: ; preds = %179
%187 = load float, float* %9
%188 = fpext float %187 to double
%189 = fadd double %188, 0x400921FB54421D91
%190 = fptrunc double %189 to float
store float %190, float* %9
br label %191
191: ; preds = %186, %179, %175
%192 = load i32*, i32** %8
%193 = load i32, i32* %192
%194 = icmp eq i32 %193, 4
br i1 %194, label %195, label %200
195: ; preds = %191
%196 = load float, float* %9
%197 = fpext float %196 to double
%198 = fadd double %197, 0x401921FB54421D91
%199 = fptrunc double %198 to float
store float %199, float* %9
br label %200
200: ; preds = %195, %191
%201 = load float, float* %9
ret float %201
}

LLVM IR (-O2):
define float @xy2phi(float %0, float %1, float* nocapture %2, i32* nocapture %3) {
%5 = getelementptr inbounds float, float* %2, i64 1
%6 = bitcast float* %5 to <2 x float>*
%7 = load <2 x float>, <2 x float>* %6
%8 = insertelement <2 x float> poison, float %0, i64 0
%9 = insertelement <2 x float> %8, float %1, i64 1
%10 = fsub <2 x float> %9, %7
%11 = getelementptr inbounds float, float* %2, i64 9
%12 = load float, float* %11
%13 = extractelement <2 x float> %10, i64 0
%14 = fcmp oeq float %13, 0.000000e+00
br i1 %14, label %15, label %19
15: ; preds = %4
%16 = extractelement <2 x float> %10, i64 1
%17 = fcmp olt float %16, 0.000000e+00
br i1 %17, label %39, label %18
18: ; preds = %15
br label %39
19: ; preds = %4
%20 = extractelement <2 x float> %10, i64 1
%21 = fcmp oeq float %20, 0.000000e+00
br i1 %21, label %22, label %25
22: ; preds = %19
%23 = fcmp ogt float %13, 0.000000e+00
br i1 %23, label %39, label %24
24: ; preds = %22
br label %39
25: ; preds = %19
%26 = fmul float %20, %20
%27 = tail call float @llvm.fmuladd.f32(float %13, float %13, float %26)
%28 = tail call float @pow(float %27, double 5.000000e-01)
%29 = insertelement <2 x float> poison, float %28, i64 0
%30 = shufflevector <2 x float> %29, <2 x float> poison, <2 x i32> zeroinitializer
%31 = fdiv <2 x float> %10, %30
%32 = extractelement <2 x float> %31, i64 0
%33 = extractelement <2 x float> %31, i64 1
%34 = fdiv float %33, %32
%35 = fptosi float %34 to i32
%36 = tail call double @atan(i32 %35)
%37 = fadd double %36, 0x3FF921FB54421D91
%38 = fptrunc double %37 to float
br label %39
39: ; preds = %24, %18, %22, %15, %25
%40 = phi float [ %38, %25 ], [ 0x400921FB60000000, %15 ], [ 0.000000e+00, %18 ], [ 0xBFF921FB60000000, %22 ], [ 0x3FF921FB60000000, %24 ]
%41 = phi <2 x float> [ %31, %25 ], [ %10, %15 ], [ %10, %18 ], [ %10, %22 ], [ %10, %24 ]
%42 = extractelement <2 x float> %41, i64 0
%43 = fcmp ogt float %42, 0.000000e+00
%44 = extractelement <2 x float> %41, i64 1
%45 = fcmp olt float %44, 0.000000e+00
%46 = select i1 %43, i1 %45, i1 false
br i1 %46, label %50, label %47
47: ; preds = %39
%48 = fcmp ogt float %44, 0.000000e+00
%49 = select i1 %43, i1 %48, i1 false
br i1 %49, label %50, label %54
50: ; preds = %47, %39
%51 = fpext float %40 to double
%52 = fadd double %51, 0x400921FB54421D91
%53 = fptrunc double %52 to float
br label %54
54: ; preds = %50, %47
%55 = phi float [ %53, %50 ], [ %40, %47 ]
%56 = fsub float %55, %12
%57 = fcmp olt float %56, 0.000000e+00
%58 = fpext float %56 to double
%59 = fadd double %58, 0x401921FB54421D91
%60 = fptrunc double %59 to float
%61 = select i1 %57, float %60, float %56
%62 = fcmp oeq <2 x float> %41, zeroinitializer
%63 = extractelement <2 x i1> %62, i64 0
%64 = extractelement <2 x i1> %62, i64 1
%65 = select i1 %63, i1 %64, i1 false
%66 = fpext float %61 to double
br i1 %65, label %73, label %67
67: ; preds = %54
%68 = fdiv double %66, 0x3FF921FB54421D91
%69 = fadd double %68, 1.000000e+00
%70 = fptosi double %69 to i32
%71 = icmp eq i32 %70, 5
%72 = select i1 %71, i32 1, i32 %70
br label %73
73: ; preds = %54, %67
%74 = phi i32 [ %72, %67 ], [ 0, %54 ]
store i32 %74, i32* %3
%75 = fadd double %66, 0xBFF921FB54421D91
%76 = fptrunc double %75 to float
%77 = tail call double @fabs(float %76)
%78 = fcmp olt double %77, 0x3E7AD7F29ABCAF48
br i1 %78, label %94, label %79
79: ; preds = %73
%80 = fadd double %66, 0x3FF921FB54421D91
%81 = fptrunc double %80 to float
%82 = tail call double @fabs(float %81)
%83 = fcmp olt double %82, 0x3E7AD7F29ABCAF48
br i1 %83, label %94, label %84
84: ; preds = %79
%85 = getelementptr inbounds float, float* %2, i64 8
%86 = load float, float* %85
%87 = fdiv float 1.000000e+00, %86
%88 = tail call i32 @tan(float %61)
%89 = sitofp i32 %88 to float
%90 = fmul float %87, %89
%91 = fptosi float %90 to i32
%92 = tail call double @atan(i32 %91)
%93 = fptrunc double %92 to float
br label %94
94: ; preds = %79, %73, %84
%95 = phi float [ %93, %84 ], [ 0x3FF921FB60000000, %73 ], [ 0xBFF921FB60000000, %79 ]
%96 = load i32, i32* %3
%97 = and i32 %96, -2
%98 = icmp eq i32 %97, 2
br i1 %98, label %99, label %106
99: ; preds = %94
%100 = tail call double @fabs(float %76)
%101 = fcmp ogt double %100, 0x3E7AD7F29ABCAF48
br i1 %101, label %102, label %106
102: ; preds = %99
%103 = fpext float %95 to double
%104 = fadd double %103, 0x400921FB54421D91
%105 = fptrunc double %104 to float
br label %106
106: ; preds = %94, %102, %99
%107 = phi float [ %105, %102 ], [ %95, %99 ], [ %95, %94 ]
%108 = load i32, i32* %3
%109 = icmp eq i32 %108, 4
%110 = fpext float %107 to double
%111 = fadd double %110, 0x401921FB54421D91
%112 = fptrunc double %111 to float
%113 = select i1 %109, float %112, float %107
ret float %113
}