#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 Map180(double);
double Map360(double);
double MeanObliquity();
double asin(int);
double atan2(int, int);
int cos(double);
int sin(double);
int tan(double);
void CelestialToEcliptical(double ra, double dec, double *lambda,
                           double *beta) {
  double elong, elat, eps;
  ra = ra * 3.14159265358 / 12.;
  dec = dec * 3.14159265358 / 180.;
  eps = MeanObliquity();
  eps = eps * 3.14159265358 / 180;
  elong = atan2(sin(ra) * cos(eps) + tan(dec) * sin(eps), cos(ra));
  elong = Map360(elong * 180. / 3.14159265358);
  elat = asin(sin(dec) * cos(eps) - cos(dec) * sin(eps) * sin(ra));
  elat = Map180(elat * 180. / 3.14159265358);
  if (elat > 90.) {
    *lambda = Map360(elong + 180.);
    *beta = 180. - elat;
  } else if (elat < -90.) {
    *lambda = Map360(elong + 180.);
    *beta = elat + 180;
  } else {
    *lambda = elong;
    *beta = elat;
  }
}


x86 assembly (clang, -O0):
<CelestialToEcliptical>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
movsd  0xe66(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xe69(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  0xe48(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  0xe43(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    $0x0,%al
call   1050 <MeanObliquity@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  0xe1e(%rip),%xmm0
mulsd  -0x38(%rbp),%xmm0
movsd  0xe19(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1060 <sin@plt>
mov    %eax,-0x58(%rbp)
movsd  -0x38(%rbp),%xmm0
call   10a0 <cos@plt>
mov    %eax,%ecx
mov    -0x58(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x50(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1080 <tan@plt>
mov    %eax,-0x54(%rbp)
movsd  -0x38(%rbp),%xmm0
call   1060 <sin@plt>
mov    -0x54(%rbp),%ecx
mov    %eax,%edx
mov    -0x50(%rbp),%eax
imul   %edx,%ecx
add    %ecx,%eax
mov    %eax,-0x4c(%rbp)
movsd  -0x8(%rbp),%xmm0
call   10a0 <cos@plt>
mov    -0x4c(%rbp),%edi
mov    %eax,%esi
call   1040 <atan2@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  0xda6(%rip),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  0xd91(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <Map360@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1060 <sin@plt>
mov    %eax,-0x48(%rbp)
movsd  -0x38(%rbp),%xmm0
call   10a0 <cos@plt>
mov    %eax,%ecx
mov    -0x48(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x40(%rbp)
movsd  -0x10(%rbp),%xmm0
call   10a0 <cos@plt>
mov    %eax,-0x44(%rbp)
movsd  -0x38(%rbp),%xmm0
call   1060 <sin@plt>
mov    %eax,%ecx
mov    -0x44(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x3c(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1060 <sin@plt>
mov    -0x40(%rbp),%edi
mov    %eax,%ecx
mov    -0x3c(%rbp),%eax
imul   %ecx,%eax
sub    %eax,%edi
call   1070 <asin@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  0xd1e(%rip),%xmm0
mulsd  -0x30(%rbp),%xmm0
movsd  0xd09(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1090 <Map180@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  0xce6(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1358 <CelestialToEcliptical+0x1d8>
movsd  0xce4(%rip),%xmm0
addsd  -0x28(%rbp),%xmm0
call   1030 <Map360@plt>
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  0xcca(%rip),%xmm0
subsd  -0x30(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    13be <CelestialToEcliptical+0x23e>
movsd  0xcc0(%rip),%xmm0
ucomisd -0x30(%rbp),%xmm0
jbe    139f <CelestialToEcliptical+0x21f>
movsd  0xc9d(%rip),%xmm0
addsd  -0x28(%rbp),%xmm0
call   1030 <Map360@plt>
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  0xc83(%rip),%xmm0
addsd  -0x30(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    13b9 <CelestialToEcliptical+0x239>
movsd  -0x28(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x30(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    13be <CelestialToEcliptical+0x23e>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CelestialToEcliptical>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x20,%rsp
movsd  0xe6c(%rip),%xmm2
mulsd  %xmm2,%xmm0
divsd  0xe68(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
mov    %rsi,%r14
mov    %rdi,%r15
mulsd  %xmm2,%xmm1
divsd  0xe58(%rip),%xmm1
movsd  %xmm1,0x8(%rsp)
xor    %eax,%eax
call   1050 <MeanObliquity@plt>
mulsd  0xe33(%rip),%xmm0
divsd  0xe3b(%rip),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x10(%rsp),%xmm0
call   1060 <sin@plt>
mov    %eax,%ebp
movsd  (%rsp),%xmm0
call   10a0 <cos@plt>
imul   %eax,%ebp
movsd  0x8(%rsp),%xmm0
call   1080 <tan@plt>
mov    %eax,%ebx
movsd  (%rsp),%xmm0
call   1060 <sin@plt>
imul   %eax,%ebx
add    %ebp,%ebx
movsd  0x10(%rsp),%xmm0
call   10a0 <cos@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1040 <atan2@plt>
mulsd  0xde4(%rip),%xmm0
divsd  0xdcc(%rip),%xmm0
call   1030 <Map360@plt>
movsd  %xmm0,0x18(%rsp)
movsd  0x8(%rsp),%xmm0
call   1060 <sin@plt>
mov    %eax,%ebx
movsd  (%rsp),%xmm0
call   10a0 <cos@plt>
imul   %eax,%ebx
movsd  0x8(%rsp),%xmm0
call   10a0 <cos@plt>
mov    %eax,%r12d
movsd  (%rsp),%xmm0
call   1060 <sin@plt>
mov    %eax,%ebp
imul   %r12d,%ebp
movsd  0x10(%rsp),%xmm0
call   1060 <sin@plt>
imul   %ebp,%eax
sub    %eax,%ebx
mov    %ebx,%edi
call   1070 <asin@plt>
mulsd  0xd7a(%rip),%xmm0
divsd  0xd62(%rip),%xmm0
call   1090 <Map180@plt>
movapd %xmm0,%xmm3
ucomisd 0xd69(%rip),%xmm0
jbe    12e1 <CelestialToEcliptical+0x161>
movsd  0xd57(%rip),%xmm1
movsd  0x18(%rsp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm3,(%rsp)
call   1030 <Map360@plt>
movsd  %xmm0,(%r15)
movsd  0xd36(%rip),%xmm0
subsd  (%rsp),%xmm0
jmp    132c <CelestialToEcliptical+0x1ac>
movsd  0x18(%rsp),%xmm2
movsd  0xd21(%rip),%xmm1
movsd  0xd29(%rip),%xmm0
ucomisd %xmm3,%xmm0
jbe    1323 <CelestialToEcliptical+0x1a3>
movapd %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm3,(%rsp)
call   1030 <Map360@plt>
movsd  %xmm0,(%r15)
movsd  0xcf4(%rip),%xmm0
addsd  (%rsp),%xmm0
jmp    132c <CelestialToEcliptical+0x1ac>
movsd  %xmm2,(%r15)
movapd %xmm3,%xmm0
movsd  %xmm0,(%r14)
add    $0x20,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @CelestialToEcliptical(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
store double %0, double* %5
store double %1, double* %6
store double* %2, double** %7
store double* %3, double** %8
%12 = load double, double* %5
%13 = fmul double %12, 0x400921FB5443D6F4
%14 = fdiv double %13, 1.200000e+01
store double %14, double* %5
%15 = load double, double* %6
%16 = fmul double %15, 0x400921FB5443D6F4
%17 = fdiv double %16, 1.800000e+02
store double %17, double* %6
%18 = call double (...) @MeanObliquity()
store double %18, double* %11
%19 = load double, double* %11
%20 = fmul double %19, 0x400921FB5443D6F4
%21 = fdiv double %20, 1.800000e+02
store double %21, double* %11
%22 = load double, double* %5
%23 = call i32 @sin(double %22)
%24 = load double, double* %11
%25 = call i32 @cos(double %24)
%26 = mul nsw i32 %23, %25
%27 = load double, double* %6
%28 = call i32 @tan(double %27)
%29 = load double, double* %11
%30 = call i32 @sin(double %29)
%31 = mul nsw i32 %28, %30
%32 = add nsw i32 %26, %31
%33 = load double, double* %5
%34 = call i32 @cos(double %33)
%35 = call double @atan2(i32 %32, i32 %34)
store double %35, double* %9
%36 = load double, double* %9
%37 = fmul double %36, 1.800000e+02
%38 = fdiv double %37, 0x400921FB5443D6F4
%39 = call double @Map360(double %38)
store double %39, double* %9
%40 = load double, double* %6
%41 = call i32 @sin(double %40)
%42 = load double, double* %11
%43 = call i32 @cos(double %42)
%44 = mul nsw i32 %41, %43
%45 = load double, double* %6
%46 = call i32 @cos(double %45)
%47 = load double, double* %11
%48 = call i32 @sin(double %47)
%49 = mul nsw i32 %46, %48
%50 = load double, double* %5
%51 = call i32 @sin(double %50)
%52 = mul nsw i32 %49, %51
%53 = sub nsw i32 %44, %52
%54 = call double @asin(i32 %53)
store double %54, double* %10
%55 = load double, double* %10
%56 = fmul double %55, 1.800000e+02
%57 = fdiv double %56, 0x400921FB5443D6F4
%58 = call double @Map180(double %57)
store double %58, double* %10
%59 = load double, double* %10
%60 = fcmp ogt double %59, 9.000000e+01
br i1 %60, label %61, label %69
61: ; preds = %4
%62 = load double, double* %9
%63 = fadd double %62, 1.800000e+02
%64 = call double @Map360(double %63)
%65 = load double*, double** %7
store double %64, double* %65
%66 = load double, double* %10
%67 = fsub double 1.800000e+02, %66
%68 = load double*, double** %8
store double %67, double* %68
br label %86
69: ; preds = %4
%70 = load double, double* %10
%71 = fcmp olt double %70, -9.000000e+01
br i1 %71, label %72, label %80
72: ; preds = %69
%73 = load double, double* %9
%74 = fadd double %73, 1.800000e+02
%75 = call double @Map360(double %74)
%76 = load double*, double** %7
store double %75, double* %76
%77 = load double, double* %10
%78 = fadd double %77, 1.800000e+02
%79 = load double*, double** %8
store double %78, double* %79
br label %85
80: ; preds = %69
%81 = load double, double* %9
%82 = load double*, double** %7
store double %81, double* %82
%83 = load double, double* %10
%84 = load double*, double** %8
store double %83, double* %84
br label %85
85: ; preds = %80, %72
br label %86
86: ; preds = %85, %61
ret void
}

LLVM IR (-O2):
define void @CelestialToEcliptical(double %0, double %1, double* nocapture writeonly %2, double* nocapture writeonly %3) {
%5 = fmul double %0, 0x400921FB5443D6F4
%6 = fdiv double %5, 1.200000e+01
%7 = fmul double %1, 0x400921FB5443D6F4
%8 = fdiv double %7, 1.800000e+02
%9 = tail call double (...) @MeanObliquity()
%10 = fmul double %9, 0x400921FB5443D6F4
%11 = fdiv double %10, 1.800000e+02
%12 = tail call i32 @sin(double %6)
%13 = tail call i32 @cos(double %11)
%14 = mul nsw i32 %13, %12
%15 = tail call i32 @tan(double %8)
%16 = tail call i32 @sin(double %11)
%17 = mul nsw i32 %16, %15
%18 = add nsw i32 %17, %14
%19 = tail call i32 @cos(double %6)
%20 = tail call double @atan2(i32 %18, i32 %19)
%21 = fmul double %20, 1.800000e+02
%22 = fdiv double %21, 0x400921FB5443D6F4
%23 = tail call double @Map360(double %22)
%24 = tail call i32 @sin(double %8)
%25 = tail call i32 @cos(double %11)
%26 = mul nsw i32 %25, %24
%27 = tail call i32 @cos(double %8)
%28 = tail call i32 @sin(double %11)
%29 = mul nsw i32 %28, %27
%30 = tail call i32 @sin(double %6)
%31 = mul nsw i32 %29, %30
%32 = sub nsw i32 %26, %31
%33 = tail call double @asin(i32 %32)
%34 = fmul double %33, 1.800000e+02
%35 = fdiv double %34, 0x400921FB5443D6F4
%36 = tail call double @Map180(double %35)
%37 = fcmp ogt double %36, 9.000000e+01
br i1 %37, label %38, label %42
38: ; preds = %4
%39 = fadd double %23, 1.800000e+02
%40 = tail call double @Map360(double %39)
store double %40, double* %2
%41 = fsub double 1.800000e+02, %36
br label %49
42: ; preds = %4
%43 = fcmp olt double %36, -9.000000e+01
br i1 %43, label %44, label %48
44: ; preds = %42
%45 = fadd double %23, 1.800000e+02
%46 = tail call double @Map360(double %45)
store double %46, double* %2
%47 = fadd double %36, 1.800000e+02
br label %49
48: ; preds = %42
store double %23, double* %2
br label %49
49: ; preds = %44, %48, %38
%50 = phi double [ %47, %44 ], [ %36, %48 ], [ %41, %38 ]
store double %50, double* %3
ret void
}