#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 M_PI;
double asin(double);
double atan2(double, double);
double cos(double const);
double rad(double);
double sin(double const);
void cvtJ2000toGalactic(double ra, double dec, double *pl, double *pb) {
  const double rgc = rad(192.859508335), dgc = rad(27.1283361111),
               lcp = rad(122.932);
  double sin_t, cos_t, t;
  *pb = asin(sin(dgc) * sin(dec) + cos(dgc) * cos(dec) * (cos(ra - rgc)));
  sin_t = (cos(dec) * sin(ra - rgc) / cos(*pb));
  cos_t =
      ((cos(dgc) * sin(dec) - sin(dgc) * cos(dec) * cos(ra - rgc)) / cos(*pb));
  t = atan2(sin_t, cos_t);
  *pl = lcp - t;
  if (*pl < 0.0)
    *pl += 2.0 * M_PI;
  if (*pl >= 2.0 * M_PI)
    *pl -= 2.0 * M_PI;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
movsd  0xe9b(%rip),%xmm0
call   1070 <rad@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  0xe81(%rip),%xmm0
call   1070 <rad@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  0xe67(%rip),%xmm0
call   1070 <rad@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  -0x30(%rbp),%xmm0
call   1040 <sin@plt>
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x10(%rbp),%xmm0
call   1040 <sin@plt>
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
call   1060 <cos@plt>
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0x10(%rbp),%xmm0
call   1060 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0xa8(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x8(%rbp),%xmm0
subsd  -0x28(%rbp),%xmm0
call   1060 <cos@plt>
movsd  -0xa0(%rbp),%xmm1
ff
movsd  -0x98(%rbp),%xmm2
ff
movaps %xmm0,%xmm3
movsd  -0x90(%rbp),%xmm0
ff
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1050 <asin@plt>
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x10(%rbp),%xmm0
call   1060 <cos@plt>
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x8(%rbp),%xmm0
subsd  -0x28(%rbp),%xmm0
call   1040 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x88(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
call   1060 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x80(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x30(%rbp),%xmm0
call   1060 <cos@plt>
movsd  %xmm0,-0x60(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <sin@plt>
movsd  %xmm0,-0x68(%rbp)
movsd  -0x30(%rbp),%xmm0
call   1040 <sin@plt>
movsd  %xmm0,-0x78(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1060 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x78(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x28(%rbp),%xmm0
call   1060 <cos@plt>
movsd  -0x70(%rbp),%xmm1
movsd  -0x68(%rbp),%xmm2
movaps %xmm0,%xmm3
movsd  -0x60(%rbp),%xmm0
mulsd  %xmm3,%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
call   1060 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x58(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm1
call   1030 <atan2@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  -0x38(%rbp),%xmm0
subsd  -0x50(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
xorps  %xmm0,%xmm0
ucomisd (%rax),%xmm0
jbe    1395 <cvtJ2000toGalactic+0x245>
mov    0x2c6b(%rip),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm1
addsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0xc73(%rip),%xmm1
mov    0x2c3c(%rip),%rax
mulsd  (%rax),%xmm1
ucomisd %xmm1,%xmm0
jb     13d9 <cvtJ2000toGalactic+0x289>
mov    0x2c27(%rip),%rax
movsd  (%rax),%xmm1
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
addsd  %xmm1,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rax)
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %r14
push   %rbx
sub    $0x48,%rsp
mov    %rsi,%rbx
mov    %rdi,%r14
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x28(%rsp)
movsd  0xe8f(%rip),%xmm0
call   1070 <rad@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0xe84(%rip),%xmm0
call   1070 <rad@plt>
movsd  %xmm0,0x18(%rsp)
movsd  0xe79(%rip),%xmm0
call   1070 <rad@plt>
movsd  %xmm0,0x40(%rsp)
movsd  0x18(%rsp),%xmm0
call   1040 <sin@plt>
movsd  %xmm0,0x20(%rsp)
movsd  0x10(%rsp),%xmm0
call   1040 <sin@plt>
movsd  %xmm0,0x38(%rsp)
movsd  0x18(%rsp),%xmm0
call   1060 <cos@plt>
movsd  %xmm0,0x30(%rsp)
movsd  0x10(%rsp),%xmm0
call   1060 <cos@plt>
mulsd  0x30(%rsp),%xmm0
movsd  %xmm0,0x30(%rsp)
movsd  0x28(%rsp),%xmm0
subsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x28(%rsp)
call   1060 <cos@plt>
mulsd  0x30(%rsp),%xmm0
movsd  0x38(%rsp),%xmm1
mulsd  0x20(%rsp),%xmm1
addsd  %xmm1,%xmm0
call   1050 <asin@plt>
movsd  %xmm0,(%rbx)
movsd  0x10(%rsp),%xmm0
call   1060 <cos@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x28(%rsp),%xmm0
call   1040 <sin@plt>
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  (%rbx),%xmm0
call   1060 <cos@plt>
movsd  0x8(%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
movsd  0x18(%rsp),%xmm0
call   1060 <cos@plt>
movsd  %xmm0,0x38(%rsp)
movsd  0x10(%rsp),%xmm0
call   1040 <sin@plt>
movsd  %xmm0,0x20(%rsp)
movsd  0x18(%rsp),%xmm0
call   1040 <sin@plt>
movsd  %xmm0,0x18(%rsp)
movsd  0x10(%rsp),%xmm0
call   1060 <cos@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x28(%rsp),%xmm0
call   1060 <cos@plt>
movsd  0x10(%rsp),%xmm1
mulsd  0x18(%rsp),%xmm1
mulsd  %xmm0,%xmm1
movsd  0x20(%rsp),%xmm0
mulsd  0x38(%rsp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,0x20(%rsp)
movsd  (%rbx),%xmm0
call   1060 <cos@plt>
movsd  0x20(%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  0x8(%rsp),%xmm0
call   1030 <atan2@plt>
movsd  0x40(%rsp),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,(%r14)
xorpd  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    1327 <cvtJ2000toGalactic+0x1d7>
mov    0x2cd2(%rip),%rax
movsd  (%rax),%xmm0
addsd  %xmm0,%xmm0
addsd  %xmm0,%xmm1
movsd  %xmm1,(%r14)
mov    0x2cba(%rip),%rax
movsd  (%rax),%xmm0
addsd  %xmm0,%xmm0
ucomisd %xmm0,%xmm1
jb     1345 <cvtJ2000toGalactic+0x1f5>
subsd  %xmm0,%xmm1
movsd  %xmm1,(%r14)
add    $0x48,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define void @cvtJ2000toGalactic(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
store double %0, double* %5
store double %1, double* %6
store double* %2, double** %7
store double* %3, double** %8
%15 = call double @rad(double 0x40681B81179FAEDC)
store double %15, double* %9
%16 = call double @rad(double 0x403B20DAA2A81201)
store double %16, double* %10
%17 = call double @rad(double 1.229320e+02)
store double %17, double* %11
%18 = load double, double* %10
%19 = call double @sin(double %18)
%20 = load double, double* %6
%21 = call double @sin(double %20)
%22 = load double, double* %10
%23 = call double @cos(double %22)
%24 = load double, double* %6
%25 = call double @cos(double %24)
%26 = fmul double %23, %25
%27 = load double, double* %5
%28 = load double, double* %9
%29 = fsub double %27, %28
%30 = call double @cos(double %29)
%31 = fmul double %26, %30
%32 = call double @llvm.fmuladd.f64(double %19, double %21, double %31)
%33 = call double @asin(double %32)
%34 = load double*, double** %8
store double %33, double* %34
%35 = load double, double* %6
%36 = call double @cos(double %35)
%37 = load double, double* %5
%38 = load double, double* %9
%39 = fsub double %37, %38
%40 = call double @sin(double %39)
%41 = fmul double %36, %40
%42 = load double*, double** %8
%43 = load double, double* %42
%44 = call double @cos(double %43)
%45 = fdiv double %41, %44
store double %45, double* %12
%46 = load double, double* %10
%47 = call double @cos(double %46)
%48 = load double, double* %6
%49 = call double @sin(double %48)
%50 = load double, double* %10
%51 = call double @sin(double %50)
%52 = load double, double* %6
%53 = call double @cos(double %52)
%54 = fmul double %51, %53
%55 = load double, double* %5
%56 = load double, double* %9
%57 = fsub double %55, %56
%58 = call double @cos(double %57)
%59 = fmul double %54, %58
%60 = fneg double %59
%61 = call double @llvm.fmuladd.f64(double %47, double %49, double %60)
%62 = load double*, double** %8
%63 = load double, double* %62
%64 = call double @cos(double %63)
%65 = fdiv double %61, %64
store double %65, double* %13
%66 = load double, double* %12
%67 = load double, double* %13
%68 = call double @atan2(double %66, double %67)
store double %68, double* %14
%69 = load double, double* %11
%70 = load double, double* %14
%71 = fsub double %69, %70
%72 = load double*, double** %7
store double %71, double* %72
%73 = load double*, double** %7
%74 = load double, double* %73
%75 = fcmp olt double %74, 0.000000e+00
br i1 %75, label %76, label %81
76: ; preds = %4
%77 = load double, double* @M_PI
%78 = load double*, double** %7
%79 = load double, double* %78
%80 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %77, double %79)
store double %80, double* %78
br label %81
81: ; preds = %76, %4
%82 = load double*, double** %7
%83 = load double, double* %82
%84 = load double, double* @M_PI
%85 = fmul double 2.000000e+00, %84
%86 = fcmp oge double %83, %85
br i1 %86, label %87, label %92
87: ; preds = %81
%88 = load double, double* @M_PI
%89 = load double*, double** %7
%90 = load double, double* %89
%91 = call double @llvm.fmuladd.f64(double -2.000000e+00, double %88, double %90)
store double %91, double* %89
br label %92
92: ; preds = %87, %81
ret void
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define void @cvtJ2000toGalactic(double %0, double %1, double* nocapture %2, double* nocapture %3) {
%5 = tail call double @rad(double 0x40681B81179FAEDC)
%6 = tail call double @rad(double 0x403B20DAA2A81201)
%7 = tail call double @rad(double 1.229320e+02)
%8 = tail call double @sin(double %6)
%9 = tail call double @sin(double %1)
%10 = tail call double @cos(double %6)
%11 = tail call double @cos(double %1)
%12 = fmul double %10, %11
%13 = fsub double %0, %5
%14 = tail call double @cos(double %13)
%15 = fmul double %12, %14
%16 = tail call double @llvm.fmuladd.f64(double %8, double %9, double %15)
%17 = tail call double @asin(double %16)
store double %17, double* %3
%18 = tail call double @cos(double %1)
%19 = tail call double @sin(double %13)
%20 = fmul double %18, %19
%21 = load double, double* %3
%22 = tail call double @cos(double %21)
%23 = fdiv double %20, %22
%24 = tail call double @cos(double %6)
%25 = tail call double @sin(double %1)
%26 = tail call double @sin(double %6)
%27 = tail call double @cos(double %1)
%28 = tail call double @cos(double %13)
%29 = fneg double %26
%30 = fmul double %27, %29
%31 = fmul double %30, %28
%32 = tail call double @llvm.fmuladd.f64(double %24, double %25, double %31)
%33 = load double, double* %3
%34 = tail call double @cos(double %33)
%35 = fdiv double %32, %34
%36 = tail call double @atan2(double %23, double %35)
%37 = fsub double %7, %36
store double %37, double* %2
%38 = fcmp olt double %37, 0.000000e+00
br i1 %38, label %39, label %42
39: ; preds = %4
%40 = load double, double* @M_PI
%41 = tail call double @llvm.fmuladd.f64(double %40, double 2.000000e+00, double %37)
store double %41, double* %2
br label %42
42: ; preds = %39, %4
%43 = phi double [ %41, %39 ], [ %37, %4 ]
%44 = load double, double* @M_PI
%45 = fmul double %44, 2.000000e+00
%46 = fcmp ult double %43, %45
br i1 %46, label %49, label %47
47: ; preds = %42
%48 = tail call double @llvm.fmuladd.f64(double %44, double -2.000000e+00, double %43)
store double %48, double* %2
br label %49
49: ; preds = %47, %42
ret void
}