#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*/ asin(int);
int cos(double);
double deg2rad(double);
double rad2deg(int /*<<< orphan*/);
int sin(double);
double topocentric_elevation_angle(float latitude, double delta_prime,
                                   double h_prime) {
  double lat_rad = deg2rad(latitude);
  double delta_prime_rad = deg2rad(delta_prime);
  return rad2deg(
      asin(sin(lat_rad) * sin(delta_prime_rad) +
           cos(lat_rad) * cos(delta_prime_rad) * cos(deg2rad(h_prime))));
}


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

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

LLVM IR (-O0):
define double @topocentric_elevation_angle(float %0, double %1, double %2) {
%4 = alloca float
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store float %0, float* %4
store double %1, double* %5
store double %2, double* %6
%9 = load float, float* %4
%10 = fpext float %9 to double
%11 = call double @deg2rad(double %10)
store double %11, double* %7
%12 = load double, double* %5
%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* %8
%17 = call i32 @sin(double %16)
%18 = mul nsw i32 %15, %17
%19 = load double, double* %7
%20 = call i32 @cos(double %19)
%21 = load double, double* %8
%22 = call i32 @cos(double %21)
%23 = mul nsw i32 %20, %22
%24 = load double, double* %6
%25 = call double @deg2rad(double %24)
%26 = call i32 @cos(double %25)
%27 = mul nsw i32 %23, %26
%28 = add nsw i32 %18, %27
%29 = call i32 @asin(i32 %28)
%30 = call double @rad2deg(i32 %29)
ret double %30
}

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