#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 */
struct julian_date {
  int dummy;
};

/* Variables and functions */
scalar_t__ equation_of_the_equinoxes(struct julian_date *);
double mean_sidereal_time(struct julian_date *, struct julian_date *, double);
double reduce_angle(scalar_t__, double);
double apparent_sidereal_time(struct julian_date *ut1, struct julian_date *tdb,
                              double longitude) {
  double mst, ast;
  mst = mean_sidereal_time(ut1, tdb, longitude);
  ast = reduce_angle(mst + equation_of_the_equinoxes(tdb),
                     (2.0 * 3.141592653589793238462643));
  return ast;
}


x86 assembly (clang, -O0):
<apparent_sidereal_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movsd  -0x18(%rbp),%xmm0
call   1030 <mean_sidereal_time@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <equation_of_the_equinoxes@plt>
movsd  -0x30(%rbp),%xmm0
cvtsi2sd %rax,%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rdi
movsd  0xe76(%rip),%xmm0
call   1040 <reduce_angle@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<apparent_sidereal_time>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
call   1030 <mean_sidereal_time@plt>
movsd  %xmm0,0x8(%rsp)
mov    %rbx,%rdi
call   1050 <equation_of_the_equinoxes@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
addsd  0x8(%rsp),%xmm0
cvttsd2si %xmm0,%rdi
movsd  0xe9a(%rip),%xmm0
add    $0x10,%rsp
pop    %rbx
jmp    1040 <reduce_angle@plt>

LLVM IR (-O0):
%struct.julian_date = type { i32 }
define double @apparent_sidereal_time(%struct.julian_date* %0, %struct.julian_date* %1, double %2) {
%4 = alloca %struct.julian_date*
%5 = alloca %struct.julian_date*
%6 = alloca double
%7 = alloca double
%8 = alloca double
store %struct.julian_date* %0, %struct.julian_date** %4
store %struct.julian_date* %1, %struct.julian_date** %5
store double %2, double* %6
%9 = load %struct.julian_date*, %struct.julian_date** %4
%10 = load %struct.julian_date*, %struct.julian_date** %5
%11 = load double, double* %6
%12 = call double @mean_sidereal_time(%struct.julian_date* %9, %struct.julian_date* %10, double %11)
store double %12, double* %7
%13 = load double, double* %7
%14 = load %struct.julian_date*, %struct.julian_date** %5
%15 = call i64 @equation_of_the_equinoxes(%struct.julian_date* %14)
%16 = sitofp i64 %15 to double
%17 = fadd double %13, %16
%18 = fptosi double %17 to i64
%19 = call double @reduce_angle(i64 %18, double 0x401921FB54442D18)
store double %19, double* %8
%20 = load double, double* %8
ret double %20
}

LLVM IR (-O2):
%struct.julian_date = type { i32 }
define double @apparent_sidereal_time(%struct.julian_date* %0, %struct.julian_date* %1, double %2) {
%4 = tail call double @mean_sidereal_time(%struct.julian_date* %0, %struct.julian_date* %1, double %2)
%5 = tail call i64 @equation_of_the_equinoxes(%struct.julian_date* %1)
%6 = sitofp i64 %5 to double
%7 = fadd double %4, %6
%8 = fptosi double %7 to i64
%9 = tail call double @reduce_angle(i64 %8, double 0x401921FB54442D18)
ret double %9
}