#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 limit_degrees(int /*<<< orphan*/);
int /*<<< orphan*/ rad2deg(int /*<<< orphan*/);
int sin(double);
int tan(double);
double topocentric_azimuth_angle_astro(double h_prime, double latitude,
                                       double delta_prime) {
  double h_prime_rad = deg2rad(h_prime);
  double lat_rad = deg2rad(latitude);
  return limit_degrees(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_astro>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <deg2rad@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%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   1090 <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   1080 <tan@plt>
mov    %eax,-0x2c(%rbp)
movsd  -0x28(%rbp),%xmm0
call   1090 <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   1070 <rad2deg@plt>
mov    %eax,%edi
call   1060 <limit_degrees@plt>
add    $0x40,%rsp
pop    %rbp
ret

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

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

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