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


x86 assembly (clang, -O0):
<equatorial>:
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
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%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
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):
<equatorial>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
movsd  (%rdi),%xmm1
movsd  %xmm1,0x10(%rsp)
movsd  (%rsi),%xmm1
movsd  %xmm1,0x8(%rsp)
call   1080 <epsilon@plt>
movsd  %xmm0,(%rsp)
call   1060 <cos@plt>
movsd  %xmm0,0x20(%rsp)
movsd  (%rsp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,0x18(%rsp)
movsd  0x10(%rsp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,(%rsp)
movsd  0x8(%rsp),%xmm0
call   1050 <tan@plt>
mulsd  0x18(%rsp),%xmm0
movsd  (%rsp),%xmm1
mulsd  0x20(%rsp),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp)
movsd  0x10(%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>
mulsd  0x18(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
call   1030 <sin@plt>
mulsd  0x8(%rsp),%xmm0
movsd  (%rsp),%xmm1
mulsd  0x20(%rsp),%xmm1
addsd  %xmm1,%xmm0
call   1040 <asin@plt>
movsd  %xmm0,(%r14)
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

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