#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 cos(double);
double sin(double);
int /*<<< orphan*/ solve_sphere(double, double, double, double,
                                int /*<<< orphan*/ *, double *);
double parallacticLHD(double lt, double ha, double dec) {
  double A, b, cc, sc, B;
  A = ha;
  b = 3.141592653589793 / 2 - lt;
  cc = sin(dec);
  sc = cos(dec);
  solve_sphere(A, b, cc, sc, NULL, &B);
  if (B > 3.141592653589793)
    B -= 2 * 3.141592653589793;
  return (B);
}


x86 assembly (clang, -O0):
<parallacticLHD>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xeaf(%rip),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1050 <cos@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm2
movsd  -0x38(%rbp),%xmm3
xor    %eax,%eax
mov    %eax,%edi
lea    -0x40(%rbp),%rsi
call   1040 <solve_sphere@plt>
movsd  -0x40(%rbp),%xmm0
movsd  0xe51(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    11cf <parallacticLHD+0x9f>
movsd  -0x40(%rbp),%xmm0
movsd  0xe4a(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parallacticLHD>:
sub    $0x28,%rsp
movsd  %xmm2,(%rsp)
movsd  %xmm1,0x18(%rsp)
movsd  0xeb9(%rip),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,0x10(%rsp)
movaps %xmm2,%xmm0
call   1030 <sin@plt>
movsd  %xmm0,0x8(%rsp)
movsd  (%rsp),%xmm0
call   1050 <cos@plt>
movaps %xmm0,%xmm3
lea    0x20(%rsp),%rsi
movsd  0x18(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
movsd  0x8(%rsp),%xmm2
xor    %edi,%edi
call   1040 <solve_sphere@plt>
movsd  0x20(%rsp),%xmm1
movsd  0xe70(%rip),%xmm2
addsd  %xmm1,%xmm2
movsd  0xe6c(%rip),%xmm0
cmpltsd %xmm1,%xmm0
andpd  %xmm0,%xmm2
andnpd %xmm1,%xmm0
orpd   %xmm2,%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @parallacticLHD(double %0, double %1, double %2) {
%4 = alloca double
%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* %4
store double %1, double* %5
store double %2, double* %6
%12 = load double, double* %5
store double %12, double* %7
%13 = load double, double* %4
%14 = fsub double 0x3FF921FB54442D18, %13
store double %14, double* %8
%15 = load double, double* %6
%16 = call double @sin(double %15)
store double %16, double* %9
%17 = load double, double* %6
%18 = call double @cos(double %17)
store double %18, double* %10
%19 = load double, double* %7
%20 = load double, double* %8
%21 = load double, double* %9
%22 = load double, double* %10
%23 = call i32 @solve_sphere(double %19, double %20, double %21, double %22, i32* null, double* %11)
%24 = load double, double* %11
%25 = fcmp ogt double %24, 0x400921FB54442D18
br i1 %25, label %26, label %29
26: ; preds = %3
%27 = load double, double* %11
%28 = fsub double %27, 0x401921FB54442D18
store double %28, double* %11
br label %29
29: ; preds = %26, %3
%30 = load double, double* %11
ret double %30
}

LLVM IR (-O2):
define double @parallacticLHD(double %0, double %1, double %2) {
%4 = alloca double
%5 = bitcast double* %4 to i8*
%6 = fsub double 0x3FF921FB54442D18, %0
%7 = tail call double @sin(double %2)
%8 = tail call double @cos(double %2)
%9 = call i32 @solve_sphere(double %1, double %6, double %7, double %8, i32* null, double* %4)
%10 = load double, double* %4
%11 = fcmp ogt double %10, 0x400921FB54442D18
%12 = fadd double %10, 0xC01921FB54442D18
%13 = select i1 %11, double %12, double %10
ret double %13
}