#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 atan22(double, double);
double cos(double);
double epsilon(double);
double sin(double);
double tan(double);
void ecliptic(double d, double *lon, double *lat, double *r) {
  double eps, ceps, seps, alp, dec;
  alp = *lon;
  dec = *lat;
  eps = epsilon(d);
  ceps = cos(eps);
  seps = sin(eps);
  *lon = atan22(sin(alp) * ceps + tan(dec) * seps, cos(alp));
  *lat = asin(sin(dec) * ceps - cos(dec) * seps * sin(alp));
}


x86 assembly (clang, -O0):
<ecliptic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1080 <epsilon@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
call   1060 <cos@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  -0x40(%rbp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0x70(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x48(%rbp),%xmm0
call   1050 <tan@plt>
movsd  -0x78(%rbp),%xmm2
movaps %xmm0,%xmm1
movsd  -0x70(%rbp),%xmm0
mulsd  -0x38(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x40(%rbp),%xmm0
call   1060 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x68(%rbp),%xmm0
call   1070 <atan22@plt>
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x48(%rbp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x48(%rbp),%xmm0
call   1060 <cos@plt>
mulsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x40(%rbp),%xmm0
call   1030 <sin@plt>
movsd  -0x60(%rbp),%xmm1
movsd  -0x58(%rbp),%xmm2
movaps %xmm0,%xmm3
movsd  -0x50(%rbp),%xmm0
mulsd  %xmm3,%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1040 <asin@plt>
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ecliptic>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
movsd  (%rdi),%xmm1
movsd  %xmm1,0x18(%rsp)
movsd  (%rsi),%xmm1
movsd  %xmm1,0x8(%rsp)
call   1080 <epsilon@plt>
movsd  %xmm0,0x10(%rsp)
call   1060 <cos@plt>
movsd  %xmm0,0x20(%rsp)
movsd  0x10(%rsp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x18(%rsp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,(%rsp)
movsd  0x8(%rsp),%xmm0
call   1050 <tan@plt>
mulsd  0x10(%rsp),%xmm0
movsd  (%rsp),%xmm1
mulsd  0x20(%rsp),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rsp)
movsd  0x18(%rsp),%xmm0
call   1060 <cos@plt>
movaps %xmm0,%xmm1
movsd  (%rsp),%xmm0
call   1070 <atan22@plt>
movsd  %xmm0,(%rbx)
movsd  0x8(%rsp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,(%rsp)
movsd  0x8(%rsp),%xmm0
call   1060 <cos@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x18(%rsp),%xmm0
call   1030 <sin@plt>
movsd  0x8(%rsp),%xmm1
mulsd  0x10(%rsp),%xmm1
mulsd  %xmm0,%xmm1
movsd  (%rsp),%xmm0
mulsd  0x20(%rsp),%xmm0
subsd  %xmm1,%xmm0
call   1040 <asin@plt>
movsd  %xmm0,(%r14)
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @ecliptic(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
store double %0, double* %5
store double* %1, double** %6
store double* %2, double** %7
store double* %3, double** %8
%14 = load double*, double** %6
%15 = load double, double* %14
store double %15, double* %12
%16 = load double*, double** %7
%17 = load double, double* %16
store double %17, double* %13
%18 = load double, double* %5
%19 = call double @epsilon(double %18)
store double %19, double* %9
%20 = load double, double* %9
%21 = call double @cos(double %20)
store double %21, double* %10
%22 = load double, double* %9
%23 = call double @sin(double %22)
store double %23, double* %11
%24 = load double, double* %12
%25 = call double @sin(double %24)
%26 = load double, double* %10
%27 = load double, double* %13
%28 = call double @tan(double %27)
%29 = load double, double* %11
%30 = fmul double %28, %29
%31 = call double @llvm.fmuladd.f64(double %25, double %26, double %30)
%32 = load double, double* %12
%33 = call double @cos(double %32)
%34 = call double @atan22(double %31, double %33)
%35 = load double*, double** %6
store double %34, double* %35
%36 = load double, double* %13
%37 = call double @sin(double %36)
%38 = load double, double* %10
%39 = load double, double* %13
%40 = call double @cos(double %39)
%41 = load double, double* %11
%42 = fmul double %40, %41
%43 = load double, double* %12
%44 = call double @sin(double %43)
%45 = fmul double %42, %44
%46 = fneg double %45
%47 = call double @llvm.fmuladd.f64(double %37, double %38, double %46)
%48 = call double @asin(double %47)
%49 = load double*, double** %7
store double %48, double* %49
ret void
}

LLVM IR (-O2):
define void @ecliptic(double %0, double* nocapture %1, double* nocapture %2, double* nocapture readnone %3) {
%5 = load double, double* %1
%6 = load double, double* %2
%7 = tail call double @epsilon(double %0)
%8 = tail call double @cos(double %7)
%9 = tail call double @sin(double %7)
%10 = tail call double @sin(double %5)
%11 = tail call double @tan(double %6)
%12 = fmul double %9, %11
%13 = tail call double @llvm.fmuladd.f64(double %10, double %8, double %12)
%14 = tail call double @cos(double %5)
%15 = tail call double @atan22(double %13, double %14)
store double %15, double* %1
%16 = tail call double @sin(double %6)
%17 = tail call double @cos(double %6)
%18 = tail call double @sin(double %5)
%19 = fneg double %17
%20 = fmul double %9, %19
%21 = fmul double %20, %18
%22 = tail call double @llvm.fmuladd.f64(double %16, double %8, double %21)
%23 = tail call double @asin(double %22)
store double %23, double* %2
ret void
}