#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 alt(double, double, double);
int /*<<< orphan*/ ecliptic(double, double *, double *, double *);
int /*<<< orphan*/ equatorial(double, double *, double *, double *);
double gst(double);
int /*<<< orphan*/ libration(double, double, double, double, double *, double *,
                             double *);
int /*<<< orphan*/ moonpos(double, double *, double *, double *);
double rangerad(double);
int /*<<< orphan*/ topo(double, double, double *, double *, double *);
void tmoonsub_(double *day, double *glat, double *glong, double *moonalt,
               double *mrv, double *l, double *b, double *paxis) {
  double mlambda, mbeta;
  double malpha, mdelta;
  double lst, mhr;
  double tlambda, tbeta, trv;
  lst = gst(*day) + *glong;
  moonpos(*day, &mlambda, &mbeta, mrv);
  malpha = mlambda;
  mdelta = mbeta;
  equatorial(*day, &malpha, &mdelta, mrv);
  topo(lst, *glat, &malpha, &mdelta, mrv);
  mhr = rangerad(lst - malpha);
  *moonalt = alt(*glat, mhr, mdelta);
  tlambda = malpha;
  tbeta = mdelta;
  trv = *mrv;
  ecliptic(*day, &tlambda, &tbeta, &trv);
  libration(*day, tlambda, tbeta, malpha, l, b, paxis);
}


x86 assembly (clang, -O0):
<tmoonsub_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
call   10a0 <gst@plt>
mov    -0x18(%rbp),%rax
addsd  (%rax),%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x28(%rbp),%rdx
lea    -0x38(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1040 <moonpos@plt>
movsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x28(%rbp),%rdx
lea    -0x48(%rbp),%rdi
lea    -0x50(%rbp),%rsi
call   1050 <equatorial@plt>
movsd  -0x58(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x28(%rbp),%rdx
lea    -0x48(%rbp),%rdi
lea    -0x50(%rbp),%rsi
call   1090 <topo@plt>
movsd  -0x58(%rbp),%xmm0
subsd  -0x48(%rbp),%xmm0
call   1080 <rangerad@plt>
movsd  %xmm0,-0x60(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  -0x60(%rbp),%xmm1
movsd  -0x50(%rbp),%xmm2
call   1030 <alt@plt>
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x78(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
lea    -0x68(%rbp),%rdi
lea    -0x70(%rbp),%rsi
lea    -0x78(%rbp),%rdx
call   1070 <ecliptic@plt>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  -0x68(%rbp),%xmm1
movsd  -0x70(%rbp),%xmm2
movsd  -0x48(%rbp),%xmm3
mov    -0x30(%rbp),%rdi
mov    0x10(%rbp),%rsi
mov    0x18(%rbp),%rdx
call   1060 <libration@plt>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tmoonsub_>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
mov    %r9,0x28(%rsp)
mov    %r8,%r13
mov    %rcx,%r12
mov    %rdx,%r15
mov    %rsi,%r14
mov    %rdi,%rbx
movsd  (%rdi),%xmm0
call   10a0 <gst@plt>
addsd  (%r15),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  (%rbx),%xmm0
lea    0x40(%rsp),%rdi
lea    0x38(%rsp),%rsi
mov    %r13,%rdx
call   1040 <moonpos@plt>
movsd  0x40(%rsp),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x38(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  (%rbx),%xmm0
mov    %rsp,%rbp
lea    0x8(%rsp),%r15
mov    %rbp,%rdi
mov    %r15,%rsi
mov    %r13,%rdx
call   1050 <equatorial@plt>
movsd  (%r14),%xmm1
movsd  0x10(%rsp),%xmm0
mov    %rbp,%rdi
mov    %r15,%rsi
mov    %r13,%rdx
call   1090 <topo@plt>
movsd  0x10(%rsp),%xmm0
subsd  (%rsp),%xmm0
call   1080 <rangerad@plt>
movapd %xmm0,%xmm1
movsd  (%r14),%xmm0
movsd  0x8(%rsp),%xmm2
call   1030 <alt@plt>
movsd  %xmm0,(%r12)
movsd  (%rsp),%xmm0
movsd  %xmm0,0x20(%rsp)
movsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x18(%rsp)
movsd  0x0(%r13),%xmm0
movsd  %xmm0,0x30(%rsp)
movsd  (%rbx),%xmm0
lea    0x20(%rsp),%rdi
lea    0x18(%rsp),%rsi
lea    0x30(%rsp),%rdx
call   1070 <ecliptic@plt>
movsd  (%rbx),%xmm0
movsd  0x20(%rsp),%xmm1
movsd  0x18(%rsp),%xmm2
movsd  (%rsp),%xmm3
mov    0x28(%rsp),%rdi
mov    0x80(%rsp),%rsi
mov    0x88(%rsp),%rdx
call   1060 <libration@plt>
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @tmoonsub_(double* %0, double* %1, double* %2, double* %3, double* %4, double* %5, double* %6, double* %7) {
%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
store double* %0, double** %9
store double* %1, double** %10
store double* %2, double** %11
store double* %3, double** %12
store double* %4, double** %13
store double* %5, double** %14
store double* %6, double** %15
store double* %7, double** %16
%26 = load double*, double** %9
%27 = load double, double* %26
%28 = call double @gst(double %27)
%29 = load double*, double** %11
%30 = load double, double* %29
%31 = fadd double %28, %30
store double %31, double* %21
%32 = load double*, double** %9
%33 = load double, double* %32
%34 = load double*, double** %13
%35 = call i32 @moonpos(double %33, double* %17, double* %18, double* %34)
%36 = load double, double* %17
store double %36, double* %19
%37 = load double, double* %18
store double %37, double* %20
%38 = load double*, double** %9
%39 = load double, double* %38
%40 = load double*, double** %13
%41 = call i32 @equatorial(double %39, double* %19, double* %20, double* %40)
%42 = load double, double* %21
%43 = load double*, double** %10
%44 = load double, double* %43
%45 = load double*, double** %13
%46 = call i32 @topo(double %42, double %44, double* %19, double* %20, double* %45)
%47 = load double, double* %21
%48 = load double, double* %19
%49 = fsub double %47, %48
%50 = call double @rangerad(double %49)
store double %50, double* %22
%51 = load double*, double** %10
%52 = load double, double* %51
%53 = load double, double* %22
%54 = load double, double* %20
%55 = call double @alt(double %52, double %53, double %54)
%56 = load double*, double** %12
store double %55, double* %56
%57 = load double, double* %19
store double %57, double* %23
%58 = load double, double* %20
store double %58, double* %24
%59 = load double*, double** %13
%60 = load double, double* %59
store double %60, double* %25
%61 = load double*, double** %9
%62 = load double, double* %61
%63 = call i32 @ecliptic(double %62, double* %23, double* %24, double* %25)
%64 = load double*, double** %9
%65 = load double, double* %64
%66 = load double, double* %23
%67 = load double, double* %24
%68 = load double, double* %19
%69 = load double*, double** %14
%70 = load double*, double** %15
%71 = load double*, double** %16
%72 = call i32 @libration(double %65, double %66, double %67, double %68, double* %69, double* %70, double* %71)
ret void
}

LLVM IR (-O2):
define void @tmoonsub_(double* nocapture %0, double* nocapture %1, double* nocapture %2, double* nocapture writeonly %3, double* %4, double* %5, double* %6, double* %7) {
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = bitcast double* %9 to i8*
%17 = bitcast double* %10 to i8*
%18 = bitcast double* %11 to i8*
%19 = bitcast double* %12 to i8*
%20 = bitcast double* %13 to i8*
%21 = bitcast double* %14 to i8*
%22 = bitcast double* %15 to i8*
%23 = load double, double* %0
%24 = tail call double @gst(double %23)
%25 = load double, double* %2
%26 = fadd double %24, %25
%27 = load double, double* %0
%28 = call i32 @moonpos(double %27, double* %9, double* %10, double* %4)
%29 = load double, double* %9
store double %29, double* %11
%30 = load double, double* %10
store double %30, double* %12
%31 = load double, double* %0
%32 = call i32 @equatorial(double %31, double* %11, double* %12, double* %4)
%33 = load double, double* %1
%34 = call i32 @topo(double %26, double %33, double* %11, double* %12, double* %4)
%35 = load double, double* %11
%36 = fsub double %26, %35
%37 = call double @rangerad(double %36)
%38 = load double, double* %1
%39 = load double, double* %12
%40 = call double @alt(double %38, double %37, double %39)
store double %40, double* %3
%41 = load double, double* %11
store double %41, double* %13
%42 = load double, double* %12
store double %42, double* %14
%43 = load double, double* %4
store double %43, double* %15
%44 = load double, double* %0
%45 = call i32 @ecliptic(double %44, double* %13, double* %14, double* %15)
%46 = load double, double* %0
%47 = load double, double* %13
%48 = load double, double* %14
%49 = load double, double* %11
%50 = call i32 @libration(double %46, double %47, double %48, double %49, double* %5, double* %6, double* %7)
ret void
}