#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 asin(double);
double atan(double);
double atan2(double, double);
double cos(double);
double fabs(double);
double sin(double);
void convertSgalToGal(double sglon, double sglat, double *glon, double *glat) {
  static int nthru = 0;
  static double dtor, rtod;
  static double trans[3][3];
  double sglonr, sglatr;
  double cosl, cosL, sinL;
  double x, y, z;
  double xgal, ygal, zgal;
  double cosph, sinph, cosps, sinps, costh, sinth;
  if (nthru == 0) {
    double psi = 0.00, theta = 83.68, phi = 137.37;
    dtor = atan(1.0) / 45.0;
    rtod = 1.0 / dtor;
    cosps = cos(psi * dtor);
    sinps = sin(psi * dtor);
    cosph = cos(phi * dtor);
    sinph = sin(phi * dtor);
    costh = cos(theta * dtor);
    sinth = sin(theta * dtor);
    trans[0][0] = cosps * cosph - costh * sinph * sinps;
    trans[0][1] = -sinps * cosph - costh * sinph * cosps;
    trans[0][2] = sinth * sinph;
    trans[1][0] = cosps * sinph + costh * cosph * sinps;
    trans[1][1] = -sinps * sinph + costh * cosph * cosps;
    trans[1][2] = -sinth * cosph;
    trans[2][0] = sinth * sinps;
    trans[2][1] = sinth * cosps;
    trans[2][2] = costh;
    nthru = 1;
  }
  sglonr = sglon * dtor;
  sglatr = sglat * dtor;
  cosl = cos(sglatr);
  cosL = cos(sglonr);
  sinL = sin(sglonr);
  x = cosl * cosL;
  y = sinL * cosl;
  z = sin(sglatr);
  zgal = trans[2][0] * x + trans[2][1] * y + trans[2][2] * z;
  if (fabs(zgal) >= 1.0) {
    zgal = zgal / fabs(zgal);
    *glat = asin(zgal);
    *glon = 0.0;
  } else {
    xgal = trans[0][0] * x + trans[0][1] * y + trans[0][2] * z;
    ygal = trans[1][0] * x + trans[1][1] * y + trans[1][2] * z;
    *glat = asin(zgal);
    *glon = atan2(ygal, xgal);
  }
  *glon = *glon * rtod;
  while (*glon < 0.0)
    *glon += 360.0;
  while (*glon > 360.0)
    *glon -= 360.0;
  *glat = *glat * rtod;
  if (fabs(*glat) >= 90.0) {
    *glon = 0.0;
    if (*glat > 90.0)
      *glat = 90.0;
    if (*glat < -90.0)
      *glat = -90.0;
  }
  return;
}


x86 assembly (clang, -O0):
<convertSgalToGal>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
cmpl   $0x0,0x2eec(%rip)
jne    1447 <convertSgalToGal+0x2f7>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  0xe8b(%rip),%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  0xe73(%rip),%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  0xe53(%rip),%xmm0
call   1050 <atan@plt>
movsd  0xe4e(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,0x2ea2(%rip)
movsd  0xe32(%rip),%xmm0
divsd  0x2e92(%rip),%xmm0
movsd  %xmm0,0x2e92(%rip)
movsd  -0xb0(%rbp),%xmm0
ff
mulsd  0x2e7a(%rip),%xmm0
call   1070 <cos@plt>
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0xb0(%rbp),%xmm0
ff
mulsd  0x2e5d(%rip),%xmm0
call   1040 <sin@plt>
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0xc0(%rbp),%xmm0
ff
mulsd  0x2e40(%rip),%xmm0
call   1070 <cos@plt>
movsd  %xmm0,-0x80(%rbp)
movsd  -0xc0(%rbp),%xmm0
ff
mulsd  0x2e26(%rip),%xmm0
call   1040 <sin@plt>
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0xb8(%rbp),%xmm0
ff
mulsd  0x2e09(%rip),%xmm0
call   1070 <cos@plt>
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0xb8(%rbp),%xmm0
ff
mulsd  0x2dec(%rip),%xmm0
call   1040 <sin@plt>
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
movsd  -0x80(%rbp),%xmm2
movsd  -0xa0(%rbp),%xmm1
ff
mulsd  -0x88(%rbp),%xmm1
ff
mulsd  -0x98(%rbp),%xmm1
ff
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x2dab(%rip)
movsd  -0x98(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  -0x80(%rbp),%xmm2
movsd  -0xa0(%rbp),%xmm1
mulsd  -0x88(%rbp),%xmm1
ff
mulsd  -0x90(%rbp),%xmm1
ff
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x2d50(%rip)
movsd  -0xa8(%rbp),%xmm0
ff
mulsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,0x2d40(%rip)
movsd  -0x90(%rbp),%xmm0
ff
movsd  -0x88(%rbp),%xmm2
ff
movsd  -0xa0(%rbp),%xmm1
ff
mulsd  -0x80(%rbp),%xmm1
mulsd  -0x98(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x2d13(%rip)
movsd  -0x98(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  -0x88(%rbp),%xmm2
ff
movsd  -0xa0(%rbp),%xmm1
ff
mulsd  -0x80(%rbp),%xmm1
mulsd  -0x90(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x2ccf(%rip)
movsd  -0xa8(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x80(%rbp),%xmm0
movsd  %xmm0,0x2cab(%rip)
movsd  -0xa8(%rbp),%xmm0
ff
mulsd  -0x98(%rbp),%xmm0
ff
movsd  %xmm0,0x2c9b(%rip)
movsd  -0xa8(%rbp),%xmm0
ff
mulsd  -0x90(%rbp),%xmm0
ff
movsd  %xmm0,0x2c8b(%rip)
movsd  -0xa0(%rbp),%xmm0
ff
movsd  %xmm0,0x2c83(%rip)
movl   $0x1,0x2c19(%rip)
movsd  -0x8(%rbp),%xmm0
mulsd  0x2c14(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
mulsd  0x2c02(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
call   1070 <cos@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  -0x28(%rbp),%xmm0
call   1070 <cos@plt>
movsd  %xmm0,-0x40(%rbp)
movsd  -0x28(%rbp),%xmm0
call   1040 <sin@plt>
movsd  %xmm0,-0x48(%rbp)
movsd  -0x38(%rbp),%xmm0
mulsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x48(%rbp),%xmm0
mulsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x30(%rbp),%xmm0
call   1040 <sin@plt>
movsd  %xmm0,-0x60(%rbp)
movsd  0x2be3(%rip),%xmm1
movsd  -0x50(%rbp),%xmm2
movsd  0x2bde(%rip),%xmm0
mulsd  -0x58(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0x2bd1(%rip),%xmm0
movsd  -0x60(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x78(%rbp),%xmm0
movaps 0xb33(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  0xae7(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     1563 <convertSgalToGal+0x413>
movsd  -0x78(%rbp),%xmm0
movsd  -0x78(%rbp),%xmm1
movaps 0xb0c(%rip),%xmm2
pand   %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x78(%rbp),%xmm0
call   1060 <asin@plt>
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
jmp    1604 <convertSgalToGal+0x4b4>
movsd  0x2b15(%rip),%xmm1
movsd  -0x50(%rbp),%xmm2
movsd  0x2b10(%rip),%xmm0
mulsd  -0x58(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0x2b03(%rip),%xmm0
movsd  -0x60(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  0x2af1(%rip),%xmm1
movsd  -0x50(%rbp),%xmm2
movsd  0x2aec(%rip),%xmm0
mulsd  -0x58(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0x2adf(%rip),%xmm0
movsd  -0x60(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x78(%rbp),%xmm0
call   1060 <asin@plt>
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x70(%rbp),%xmm0
movsd  -0x68(%rbp),%xmm1
call   1030 <atan2@plt>
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
mulsd  0x2a5c(%rip),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
xorps  %xmm0,%xmm0
ucomisd (%rax),%xmm0
jbe    1646 <convertSgalToGal+0x4f6>
mov    -0x18(%rbp),%rax
movsd  0x9e7(%rip),%xmm0
addsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
jmp    161c <convertSgalToGal+0x4cc>
jmp    164b <convertSgalToGal+0x4fb>
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0x9c5(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1682 <convertSgalToGal+0x532>
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0x9ab(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rax)
jmp    164b <convertSgalToGal+0x4fb>
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
mulsd  0x29de(%rip),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
movaps 0x997(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  0x973(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     171f <convertSgalToGal+0x5cf>
mov    -0x18(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0x94e(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    16f4 <convertSgalToGal+0x5a4>
mov    -0x20(%rbp),%rax
movsd  0x938(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    -0x20(%rbp),%rax
movsd  0x930(%rip),%xmm0
ucomisd (%rax),%xmm0
jbe    171a <convertSgalToGal+0x5ca>
mov    -0x20(%rbp),%rax
movsd  0x91a(%rip),%xmm0
movsd  %xmm0,(%rax)
jmp    171f <convertSgalToGal+0x5cf>
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convertSgalToGal>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%rbx
mov    %rdi,%r14
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
cmpb   $0x1,0x2ef0(%rip)
jne    117f <convertSgalToGal+0x2f>
movsd  0x2eee(%rip),%xmm1
jmp    1245 <convertSgalToGal+0xf5>
movsd  0xe79(%rip),%xmm0
call   1050 <atan@plt>
movabs $0x3f91df46a2529d39,%rax
df 91 3f
mov    %rax,0x2ecb(%rip)
movabs $0x404ca5dc1a63c1f8,%rax
a5 4c 40
mov    %rax,0x2ec2(%rip)
movabs $0xbfe78b340321e870,%rax
8b e7 bf
mov    %rax,0x2ec1(%rip)
movabs $0xbfb315f4d7df358e,%rax
15 b3 bf
mov    %rax,0x2ec0(%rip)
movabs $0x3fe58a6804407b97,%rax
8a e5 3f
mov    %rax,0x2ebf(%rip)
movabs $0x3fe5ac1fe1de3733,%rax
ac e5 3f
mov    %rax,0x2ebe(%rip)
movabs $0xbfb4bbdb6884b502,%rax
bb b4 bf
mov    %rax,0x2ebd(%rip)
movabs $0x3fe76692c9b6220b,%rax
66 e7 3f
mov    %rax,0x2ebc(%rip)
movabs $0x3fefce36bf90b971,%rax
ce ef 3f
mov    %rax,0x2ebb(%rip)
movabs $0x3fbc2e491d28681c,%rax
2e bc 3f
mov    %rax,0x2eba(%rip)
movb   $0x1,0x2e23(%rip)
movsd  0xdc3(%rip),%xmm1
movsd  0x8(%rsp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,0x10(%rsp)
call   1070 <cos@plt>
movsd  %xmm0,0x20(%rsp)
movsd  0x8(%rsp),%xmm0
call   1070 <cos@plt>
movsd  %xmm0,0x18(%rsp)
movsd  0x8(%rsp),%xmm0
call   1040 <sin@plt>
movsd  0x20(%rsp),%xmm2
movsd  0x18(%rsp),%xmm1
mulsd  %xmm2,%xmm1
movsd  %xmm1,0x18(%rsp)
mulsd  %xmm2,%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
call   1040 <sin@plt>
movsd  0x8(%rsp),%xmm5
movsd  0x18(%rsp),%xmm3
movapd %xmm0,%xmm4
movsd  0x2e11(%rip),%xmm0
mulsd  %xmm5,%xmm0
xorpd  %xmm2,%xmm2
movapd %xmm3,%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0x2e05(%rip),%xmm0
mulsd  %xmm4,%xmm0
addsd  %xmm1,%xmm0
movapd 0xd35(%rip),%xmm1
andpd  %xmm0,%xmm1
ucomisd 0xcf9(%rip),%xmm1
jae    1381 <convertSgalToGal+0x231>
movsd  0x2d7f(%rip),%xmm1
mulsd  %xmm5,%xmm1
movsd  0x2d63(%rip),%xmm2
mulsd  %xmm3,%xmm2
addsd  %xmm1,%xmm2
movsd  0x2d73(%rip),%xmm1
mulsd  %xmm4,%xmm1
addsd  %xmm2,%xmm1
movsd  %xmm1,0x10(%rsp)
mulsd  0x2d7d(%rip),%xmm5
mulsd  0x2d65(%rip),%xmm3
addsd  %xmm5,%xmm3
mulsd  0x2d79(%rip),%xmm4
addsd  %xmm3,%xmm4
movsd  %xmm4,0x8(%rsp)
call   1060 <asin@plt>
movsd  %xmm0,(%rbx)
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
call   1030 <atan2@plt>
movapd %xmm0,%xmm3
jmp    1392 <convertSgalToGal+0x242>
divsd  %xmm1,%xmm0
call   1060 <asin@plt>
xorpd  %xmm3,%xmm3
movsd  %xmm0,(%rbx)
movsd  0x2cd6(%rip),%xmm0
mulsd  %xmm0,%xmm3
xorpd  %xmm1,%xmm1
ucomisd %xmm3,%xmm1
jbe    13ba <convertSgalToGal+0x26a>
movsd  0xc60(%rip),%xmm2
addsd  %xmm2,%xmm3
ucomisd %xmm3,%xmm1
ja     13b0 <convertSgalToGal+0x260>
movsd  %xmm3,(%r14)
ucomisd 0xc49(%rip),%xmm3
jbe    13ef <convertSgalToGal+0x29f>
movsd  0xc47(%rip),%xmm1
movsd  0xc37(%rip),%xmm2
nopl   0x0(%rax)
addsd  %xmm1,%xmm3
ucomisd %xmm2,%xmm3
ja     13e0 <convertSgalToGal+0x290>
movsd  %xmm3,(%r14)
mulsd  (%rbx),%xmm0
movsd  %xmm0,(%rbx)
andpd  0xc31(%rip),%xmm0
ucomisd 0xc19(%rip),%xmm0
jb     1434 <convertSgalToGal+0x2e4>
movq   $0x0,(%r14)
movsd  (%rbx),%xmm1
movsd  0xc04(%rip),%xmm0
ucomisd %xmm0,%xmm1
ja     1430 <convertSgalToGal+0x2e0>
movsd  0xbfe(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1434 <convertSgalToGal+0x2e4>
movsd  %xmm0,(%rbx)
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@convertSgalToGal.nthru = internal global i32 0
@convertSgalToGal.dtor = internal global double 0.000000e+00
@convertSgalToGal.rtod = internal global double 0.000000e+00
@convertSgalToGal.trans = internal global [3 x [3 x double]] zeroinitializer
define void @convertSgalToGal(double %0, double %1, double* %2, double* %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double*
%8 = alloca double*
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca double
%19 = alloca double
%20 = alloca double
%21 = alloca double
%22 = alloca double
%23 = alloca double
%24 = alloca double
%25 = alloca double
%26 = alloca double
%27 = alloca double
%28 = alloca double
store double %0, double* %5
store double %1, double* %6
store double* %2, double** %7
store double* %3, double** %8
%29 = load i32, i32* @convertSgalToGal.nthru
%30 = icmp eq i32 %29, 0
br i1 %30, label %31, label %110
31: ; preds = %4
store double 0.000000e+00, double* %26
store double 8.368000e+01, double* %27
store double 1.373700e+02, double* %28
%32 = call double @atan(double 1.000000e+00)
%33 = fdiv double %32, 4.500000e+01
store double %33, double* @convertSgalToGal.dtor
%34 = load double, double* @convertSgalToGal.dtor
%35 = fdiv double 1.000000e+00, %34
store double %35, double* @convertSgalToGal.rtod
%36 = load double, double* %26
%37 = load double, double* @convertSgalToGal.dtor
%38 = fmul double %36, %37
%39 = call double @cos(double %38)
store double %39, double* %22
%40 = load double, double* %26
%41 = load double, double* @convertSgalToGal.dtor
%42 = fmul double %40, %41
%43 = call double @sin(double %42)
store double %43, double* %23
%44 = load double, double* %28
%45 = load double, double* @convertSgalToGal.dtor
%46 = fmul double %44, %45
%47 = call double @cos(double %46)
store double %47, double* %20
%48 = load double, double* %28
%49 = load double, double* @convertSgalToGal.dtor
%50 = fmul double %48, %49
%51 = call double @sin(double %50)
store double %51, double* %21
%52 = load double, double* %27
%53 = load double, double* @convertSgalToGal.dtor
%54 = fmul double %52, %53
%55 = call double @cos(double %54)
store double %55, double* %24
%56 = load double, double* %27
%57 = load double, double* @convertSgalToGal.dtor
%58 = fmul double %56, %57
%59 = call double @sin(double %58)
store double %59, double* %25
%60 = load double, double* %22
%61 = load double, double* %20
%62 = load double, double* %24
%63 = load double, double* %21
%64 = fmul double %62, %63
%65 = load double, double* %23
%66 = fmul double %64, %65
%67 = fneg double %66
%68 = call double @llvm.fmuladd.f64(double %60, double %61, double %67)
store double %68, double* getelementptr inbounds ([3 x [3 x double]], [3 x [3 x double]]* @convertSgalToGal.trans, i64 0, i64 0, i64 0)
%69 = load double, double* %23
%70 = fneg double %69
%71 = load double, double* %20
%72 = load double, double* %24
%73 = load double, double* %21
%74 = fmul double %72, %73
%75 = load double, double* %22
%76 = fmul double %74, %75
%77 = fneg double %76
%78 = call double @llvm.fmuladd.f64(double %70, double %71, double %77)
store double %78, double* getelementptr inbounds ([3 x [3 x double]], [3 x [3 x double]]* @convertSgalToGal.trans, i64 0, i64 0, i64 1)
%79 = load double, double* %25
%80 = load double, double* %21
%81 = fmul double %79, %80
store double %81, double* getelementptr inbounds ([3 x [3 x double]], [3 x [3 x double]]* @convertSgalToGal.trans, i64 0, i64 0, i64 2)
%82 = load double, double* %22
%83 = load double, double* %21
%84 = load double, double* %24
%85 = load double, double* %20
%86 = fmul double %84, %85
%87 = load double, double* %23
%88 = fmul double %86, %87
%89 = call double @llvm.fmuladd.f64(double %82, double %83, double %88)
store double %89, double* getelementptr inbounds ([3 x [3 x double]], [3 x [3 x double]]* @convertSgalToGal.trans, i64 0, i64 1, i64 0)
%90 = load double, double* %23
%91 = fneg double %90
%92 = load double, double* %21
%93 = load double, double* %24
%94 = load double, double* %20
%95 = fmul double %93, %94
%96 = load double, double* %22
%97 = fmul double %95, %96
%98 = call double @llvm.fmuladd.f64(double %91, double %92, double %97)
store double %98, double* getelementptr inbounds ([3 x [3 x double]], [3 x [3 x double]]* @convertSgalToGal.trans, i64 0, i64 1, i64 1)
%99 = load double, double* %25
%100 = fneg double %99
%101 = load double, double* %20
%102 = fmul double %100, %101
store double %102, double* getelementptr inbounds ([3 x [3 x double]], [3 x [3 x double]]* @convertSgalToGal.trans, i64 0, i64 1, i64 2)
%103 = load double, double* %25
%104 = load double, double* %23
%105 = fmul double %103, %104
store double %105, double* getelementptr inbounds ([3 x [3 x double]], [3 x [3 x double]]* @convertSgalToGal.trans, i64 0, i64 2, i64 0)
%106 = load double, double* %25
%107 = load double, double* %22
%108 = fmul double %106, %107
store double %108, double* getelementptr inbounds ([3 x [3 x double]], [3 x [3 x double]]* @convertSgalToGal.trans, i64 0, i64 2, i64 1)
%109 = load double, double* %24
store double %109, double* getelementptr inbounds ([3 x [3 x double]], [3 x [3 x double]]* @convertSgalToGal.trans, i64 0, i64 2, i64 2)
store i32 1, i32* @convertSgalToGal.nthru
br label %110
110: ; preds = %31, %4
%111 = load double, double* %5
%112 = load double, double* @convertSgalToGal.dtor
%113 = fmul double %111, %112
store double %113, double* %9
%114 = load double, double* %6
%115 = load double, double* @convertSgalToGal.dtor
%116 = fmul double %114, %115
store double %116, double* %10
%117 = load double, double* %10
%118 = call double @cos(double %117)
store double %118, double* %11
%119 = load double, double* %9
%120 = call double @cos(double %119)
store double %120, double* %12
%121 = load double, double* %9
%122 = call double @sin(double %121)
store double %122, double* %13
%123 = load double, double* %11
%124 = load double, double* %12
%125 = fmul double %123, %124
store double %125, double* %14
%126 = load double, double* %13
%127 = load double, double* %11
%128 = fmul double %126, %127
store double %128, double* %15
%129 = load double, double* %10
%130 = call double @sin(double %129)
store double %130, double* %16
%131 = load double, double* getelementptr inbounds ([3 x [3 x double]], [3 x [3 x double]]* @convertSgalToGal.trans, i64 0, i64 2, i64 0)
%132 = load double, double* %14
%133 = load double, double* getelementptr inbounds ([3 x [3 x double]], [3 x [3 x double]]* @convertSgalToGal.trans, i64 0, i64 2, i64 1)
%134 = load double, double* %15
%135 = fmul double %133, %134
%136 = call double @llvm.fmuladd.f64(double %131, double %132, double %135)
%137 = load double, double* getelementptr inbounds ([3 x [3 x double]], [3 x [3 x double]]* @convertSgalToGal.trans, i64 0, i64 2, i64 2)
%138 = load double, double* %16
%139 = call double @llvm.fmuladd.f64(double %137, double %138, double %136)
store double %139, double* %19
%140 = load double, double* %19
%141 = call double @llvm.fabs.f64(double %140)
%142 = fcmp oge double %141, 1.000000e+00
br i1 %142, label %143, label %152
143: ; preds = %110
%144 = load double, double* %19
%145 = load double, double* %19
%146 = call double @llvm.fabs.f64(double %145)
%147 = fdiv double %144, %146
store double %147, double* %19
%148 = load double, double* %19
%149 = call double @asin(double %148)
%150 = load double*, double** %8
store double %149, double* %150
%151 = load double*, double** %7
store double 0.000000e+00, double* %151
br label %178
152: ; preds = %110
%153 = load double, double* getelementptr inbounds ([3 x [3 x double]], [3 x [3 x double]]* @convertSgalToGal.trans, i64 0, i64 0, i64 0)
%154 = load double, double* %14
%155 = load double, double* getelementptr inbounds ([3 x [3 x double]], [3 x [3 x double]]* @convertSgalToGal.trans, i64 0, i64 0, i64 1)
%156 = load double, double* %15
%157 = fmul double %155, %156
%158 = call double @llvm.fmuladd.f64(double %153, double %154, double %157)
%159 = load double, double* getelementptr inbounds ([3 x [3 x double]], [3 x [3 x double]]* @convertSgalToGal.trans, i64 0, i64 0, i64 2)
%160 = load double, double* %16
%161 = call double @llvm.fmuladd.f64(double %159, double %160, double %158)
store double %161, double* %17
%162 = load double, double* getelementptr inbounds ([3 x [3 x double]], [3 x [3 x double]]* @convertSgalToGal.trans, i64 0, i64 1, i64 0)
%163 = load double, double* %14
%164 = load double, double* getelementptr inbounds ([3 x [3 x double]], [3 x [3 x double]]* @convertSgalToGal.trans, i64 0, i64 1, i64 1)
%165 = load double, double* %15
%166 = fmul double %164, %165
%167 = call double @llvm.fmuladd.f64(double %162, double %163, double %166)
%168 = load double, double* getelementptr inbounds ([3 x [3 x double]], [3 x [3 x double]]* @convertSgalToGal.trans, i64 0, i64 1, i64 2)
%169 = load double, double* %16
%170 = call double @llvm.fmuladd.f64(double %168, double %169, double %167)
store double %170, double* %18
%171 = load double, double* %19
%172 = call double @asin(double %171)
%173 = load double*, double** %8
store double %172, double* %173
%174 = load double, double* %18
%175 = load double, double* %17
%176 = call double @atan2(double %174, double %175)
%177 = load double*, double** %7
store double %176, double* %177
br label %178
178: ; preds = %152, %143
%179 = load double*, double** %7
%180 = load double, double* %179
%181 = load double, double* @convertSgalToGal.rtod
%182 = fmul double %180, %181
%183 = load double*, double** %7
store double %182, double* %183
br label %184
184: ; preds = %188, %178
%185 = load double*, double** %7
%186 = load double, double* %185
%187 = fcmp olt double %186, 0.000000e+00
br i1 %187, label %188, label %192
188: ; preds = %184
%189 = load double*, double** %7
%190 = load double, double* %189
%191 = fadd double %190, 3.600000e+02
store double %191, double* %189
br label %184
192: ; preds = %184
br label %193
193: ; preds = %197, %192
%194 = load double*, double** %7
%195 = load double, double* %194
%196 = fcmp ogt double %195, 3.600000e+02
br i1 %196, label %197, label %201
197: ; preds = %193
%198 = load double*, double** %7
%199 = load double, double* %198
%200 = fsub double %199, 3.600000e+02
store double %200, double* %198
br label %193
201: ; preds = %193
%202 = load double*, double** %8
%203 = load double, double* %202
%204 = load double, double* @convertSgalToGal.rtod
%205 = fmul double %203, %204
%206 = load double*, double** %8
store double %205, double* %206
%207 = load double*, double** %8
%208 = load double, double* %207
%209 = call double @llvm.fabs.f64(double %208)
%210 = fcmp oge double %209, 9.000000e+01
br i1 %210, label %211, label %225
211: ; preds = %201
%212 = load double*, double** %7
store double 0.000000e+00, double* %212
%213 = load double*, double** %8
%214 = load double, double* %213
%215 = fcmp ogt double %214, 9.000000e+01
br i1 %215, label %216, label %218
216: ; preds = %211
%217 = load double*, double** %8
store double 9.000000e+01, double* %217
br label %218
218: ; preds = %216, %211
%219 = load double*, double** %8
%220 = load double, double* %219
%221 = fcmp olt double %220, -9.000000e+01
br i1 %221, label %222, label %224
222: ; preds = %218
%223 = load double*, double** %8
store double -9.000000e+01, double* %223
br label %224
224: ; preds = %222, %218
br label %225
225: ; preds = %224, %201
ret void
}

LLVM IR (-O2):
@convertSgalToGal.nthru = internal unnamed_addr global i1 false
@convertSgalToGal.dtor = internal unnamed_addr global double 0.000000e+00
@convertSgalToGal.rtod = internal unnamed_addr global double 0.000000e+00
@convertSgalToGal.trans.0 = internal unnamed_addr global double 0.000000e+00
@convertSgalToGal.trans.1 = internal unnamed_addr global double 0.000000e+00
@convertSgalToGal.trans.2 = internal unnamed_addr global double 0.000000e+00
@convertSgalToGal.trans.3 = internal unnamed_addr global double 0.000000e+00
@convertSgalToGal.trans.4 = internal unnamed_addr global double 0.000000e+00
@convertSgalToGal.trans.5 = internal unnamed_addr global double 0.000000e+00
@convertSgalToGal.trans.7 = internal unnamed_addr global double 0.000000e+00
@convertSgalToGal.trans.8 = internal unnamed_addr global double 0.000000e+00
define void @convertSgalToGal(double %0, double %1, double* nocapture %2, double* nocapture %3) {
%5 = load i1, i1* @convertSgalToGal.nthru
br i1 %5, label %6, label %8
6: ; preds = %4
%7 = load double, double* @convertSgalToGal.dtor
br label %10
8: ; preds = %4
%9 = tail call double @atan(double 1.000000e+00)
store double 0x3F91DF46A2529D39, double* @convertSgalToGal.dtor
store double 0x404CA5DC1A63C1F8, double* @convertSgalToGal.rtod
store double 0xBFE78B340321E870, double* @convertSgalToGal.trans.0
store double 0xBFB315F4D7DF358E, double* @convertSgalToGal.trans.1
store double 0x3FE58A6804407B97, double* @convertSgalToGal.trans.2
store double 0x3FE5AC1FE1DE3733, double* @convertSgalToGal.trans.3
store double 0xBFB4BBDB6884B502, double* @convertSgalToGal.trans.4
store double 0x3FE76692C9B6220B, double* @convertSgalToGal.trans.5
store double 0x3FEFCE36BF90B971, double* @convertSgalToGal.trans.7
store double 0x3FBC2E491D28681C, double* @convertSgalToGal.trans.8
store i1 true, i1* @convertSgalToGal.nthru
br label %10
10: ; preds = %6, %8
%11 = phi double [ %7, %6 ], [ 0x3F91DF46A2529D39, %8 ]
%12 = fmul double %11, %0
%13 = fmul double %11, %1
%14 = tail call double @cos(double %13)
%15 = tail call double @cos(double %12)
%16 = tail call double @sin(double %12)
%17 = fmul double %14, %15
%18 = fmul double %14, %16
%19 = tail call double @sin(double %13)
%20 = load double, double* @convertSgalToGal.trans.7
%21 = fmul double %18, %20
%22 = tail call double @llvm.fmuladd.f64(double %17, double 0.000000e+00, double %21)
%23 = load double, double* @convertSgalToGal.trans.8
%24 = tail call double @llvm.fmuladd.f64(double %23, double %19, double %22)
%25 = tail call double @llvm.fabs.f64(double %24)
%26 = fcmp ult double %25, 1.000000e+00
br i1 %26, label %30, label %27
27: ; preds = %10
%28 = fdiv double %24, %25
%29 = tail call double @asin(double %28)
store double %29, double* %3
br label %45
30: ; preds = %10
%31 = load double, double* @convertSgalToGal.trans.0
%32 = load double, double* @convertSgalToGal.trans.1
%33 = fmul double %18, %32
%34 = tail call double @llvm.fmuladd.f64(double %31, double %17, double %33)
%35 = load double, double* @convertSgalToGal.trans.2
%36 = tail call double @llvm.fmuladd.f64(double %35, double %19, double %34)
%37 = load double, double* @convertSgalToGal.trans.3
%38 = load double, double* @convertSgalToGal.trans.4
%39 = fmul double %18, %38
%40 = tail call double @llvm.fmuladd.f64(double %37, double %17, double %39)
%41 = load double, double* @convertSgalToGal.trans.5
%42 = tail call double @llvm.fmuladd.f64(double %41, double %19, double %40)
%43 = tail call double @asin(double %24)
store double %43, double* %3
%44 = tail call double @atan2(double %42, double %36)
br label %45
45: ; preds = %30, %27
%46 = phi double [ %44, %30 ], [ 0.000000e+00, %27 ]
%47 = load double, double* @convertSgalToGal.rtod
%48 = fmul double %46, %47
%49 = fcmp olt double %48, 0.000000e+00
br i1 %49, label %53, label %50
50: ; preds = %53, %45
%51 = phi double [ %48, %45 ], [ %55, %53 ]
store double %51, double* %2
%52 = fcmp ogt double %51, 3.600000e+02
br i1 %52, label %57, label %62
53: ; preds = %45, %53
%54 = phi double [ %55, %53 ], [ %48, %45 ]
%55 = fadd double %54, 3.600000e+02
%56 = fcmp olt double %55, 0.000000e+00
br i1 %56, label %53, label %50
57: ; preds = %50, %57
%58 = phi double [ %59, %57 ], [ %51, %50 ]
%59 = fadd double %58, -3.600000e+02
%60 = fcmp ogt double %59, 3.600000e+02
br i1 %60, label %57, label %61
61: ; preds = %57
store double %59, double* %2
br label %62
62: ; preds = %61, %50
%63 = load double, double* %3
%64 = fmul double %47, %63
store double %64, double* %3
%65 = tail call double @llvm.fabs.f64(double %64)
%66 = fcmp ult double %65, 9.000000e+01
br i1 %66, label %74, label %67
67: ; preds = %62
store double 0.000000e+00, double* %2
%68 = load double, double* %3
%69 = fcmp ogt double %68, 9.000000e+01
br i1 %69, label %72, label %70
70: ; preds = %67
%71 = fcmp olt double %68, -9.000000e+01
br i1 %71, label %72, label %74
72: ; preds = %70, %67
%73 = phi double [ 9.000000e+01, %67 ], [ -9.000000e+01, %70 ]
store double %73, double* %3
br label %74
74: ; preds = %72, %70, %62
ret void
}