#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 */
int /*<<< orphan*/ atan2(int, int);
int cos(double);
double deg2rad(double);
double rad2deg(int /*<<< orphan*/);
int sin(double);
int tan(double);
double topocentric_azimuth_angle_neg180_180(double h_prime, float latitude,
                                            double delta_prime) {
  double h_prime_rad = deg2rad(h_prime);
  double lat_rad = deg2rad(latitude);
  return rad2deg(
      atan2(sin(h_prime_rad), cos(h_prime_rad) * sin(lat_rad) -
                                  tan(deg2rad(delta_prime)) * cos(lat_rad)));
}


x86 assembly (clang, -O0):
<topocentric_azimuth_angle_neg180_180>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <deg2rad@plt>
movsd  %xmm0,-0x20(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
call   1040 <deg2rad@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1050 <sin@plt>
mov    %eax,-0x30(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1080 <cos@plt>
mov    %eax,-0x38(%rbp)
movsd  -0x28(%rbp),%xmm0
call   1050 <sin@plt>
mov    %eax,%ecx
mov    -0x38(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x34(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1040 <deg2rad@plt>
call   1070 <tan@plt>
mov    %eax,-0x2c(%rbp)
movsd  -0x28(%rbp),%xmm0
call   1080 <cos@plt>
mov    -0x34(%rbp),%esi
mov    -0x30(%rbp),%edi
mov    %eax,%ecx
mov    -0x2c(%rbp),%eax
imul   %ecx,%eax
sub    %eax,%esi
call   1030 <atan2@plt>
mov    %eax,%edi
call   1060 <rad2deg@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<topocentric_azimuth_angle_neg180_180>:
push   %rbp
push   %r14
push   %rbx
sub    $0x20,%rsp
movsd  %xmm2,0x18(%rsp)
movss  %xmm1,0x8(%rsp)
call   1040 <deg2rad@plt>
movsd  %xmm0,0x10(%rsp)
movss  0x8(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
call   1040 <deg2rad@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
call   1050 <sin@plt>
mov    %eax,%r14d
movsd  0x10(%rsp),%xmm0
call   1080 <cos@plt>
mov    %eax,%ebp
movsd  0x8(%rsp),%xmm0
call   1050 <sin@plt>
imul   %eax,%ebp
movsd  0x18(%rsp),%xmm0
call   1040 <deg2rad@plt>
call   1070 <tan@plt>
mov    %eax,%ebx
movsd  0x8(%rsp),%xmm0
call   1080 <cos@plt>
imul   %ebx,%eax
sub    %eax,%ebp
mov    %r14d,%edi
mov    %ebp,%esi
call   1030 <atan2@plt>
mov    %eax,%edi
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %rbp
jmp    1060 <rad2deg@plt>

LLVM IR (-O0):
define double @topocentric_azimuth_angle_neg180_180(double %0, float %1, double %2) {
%4 = alloca double
%5 = alloca float
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %4
store float %1, float* %5
store double %2, double* %6
%9 = load double, double* %4
%10 = call double @deg2rad(double %9)
store double %10, double* %7
%11 = load float, float* %5
%12 = fpext float %11 to double
%13 = call double @deg2rad(double %12)
store double %13, double* %8
%14 = load double, double* %7
%15 = call i32 @sin(double %14)
%16 = load double, double* %7
%17 = call i32 @cos(double %16)
%18 = load double, double* %8
%19 = call i32 @sin(double %18)
%20 = mul nsw i32 %17, %19
%21 = load double, double* %6
%22 = call double @deg2rad(double %21)
%23 = call i32 @tan(double %22)
%24 = load double, double* %8
%25 = call i32 @cos(double %24)
%26 = mul nsw i32 %23, %25
%27 = sub nsw i32 %20, %26
%28 = call i32 @atan2(i32 %15, i32 %27)
%29 = call double @rad2deg(i32 %28)
ret double %29
}

LLVM IR (-O2):
define double @topocentric_azimuth_angle_neg180_180(double %0, float %1, double %2) {
%4 = tail call double @deg2rad(double %0)
%5 = fpext float %1 to double
%6 = tail call double @deg2rad(double %5)
%7 = tail call i32 @sin(double %4)
%8 = tail call i32 @cos(double %4)
%9 = tail call i32 @sin(double %6)
%10 = mul nsw i32 %9, %8
%11 = tail call double @deg2rad(double %2)
%12 = tail call i32 @tan(double %11)
%13 = tail call i32 @cos(double %6)
%14 = mul nsw i32 %13, %12
%15 = sub nsw i32 %10, %14
%16 = tail call i32 @atan2(i32 %7, i32 %15)
%17 = tail call double @rad2deg(i32 %16)
ret double %17
}