#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 degrees(int /*<<< orphan*/);
scalar_t__ julian_centuries(double *);
int /*<<< orphan*/ solar_elevation_from_time(double, double, double);
double libred_solar_elevation(double latitude, double longitude,
                              double *elevation) {
  double tm;
  if (julian_centuries(&tm))
    return -1;
  *elevation = degrees(solar_elevation_from_time(tm, latitude, longitude));
  return 0;
}


x86 assembly (clang, -O0):
<libred_solar_elevation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %rdi,-0x20(%rbp)
lea    -0x28(%rbp),%rdi
call   1030 <julian_centuries@plt>
cmp    $0x0,%rax
je     116b <libred_solar_elevation+0x3b>
movsd  0xe9f(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1196 <libred_solar_elevation+0x66>
movsd  -0x28(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
call   1040 <solar_elevation_from_time@plt>
mov    %eax,%edi
call   1050 <degrees@plt>
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<libred_solar_elevation>:
push   %rbx
sub    $0x20,%rsp
mov    %rdi,%rbx
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
lea    0x18(%rsp),%rdi
call   1030 <julian_centuries@plt>
test   %rax,%rax
je     115d <libred_solar_elevation+0x2d>
movsd  0xea5(%rip),%xmm0
jmp    1182 <libred_solar_elevation+0x52>
movsd  0x18(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
movsd  0x10(%rsp),%xmm2
call   1040 <solar_elevation_from_time@plt>
mov    %eax,%edi
call   1050 <degrees@plt>
movsd  %xmm0,(%rbx)
xorps  %xmm0,%xmm0
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @libred_solar_elevation(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* %5
store double %1, double* %6
store double* %2, double** %7
%9 = call i64 @julian_centuries(double* %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %3
store double -1.000000e+00, double* %4
br label %19
12: ; preds = %3
%13 = load double, double* %8
%14 = load double, double* %5
%15 = load double, double* %6
%16 = call i32 @solar_elevation_from_time(double %13, double %14, double %15)
%17 = call double @degrees(i32 %16)
%18 = load double*, double** %7
store double %17, double* %18
store double 0.000000e+00, double* %4
br label %19
19: ; preds = %12, %11
%20 = load double, double* %4
ret double %20
}

LLVM IR (-O2):
define double @libred_solar_elevation(double %0, double %1, double* nocapture writeonly %2) {
%4 = alloca double
%5 = bitcast double* %4 to i8*
%6 = call i64 @julian_centuries(double* %4)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %3
%9 = load double, double* %4
%10 = call i32 @solar_elevation_from_time(double %9, double %0, double %1)
%11 = call double @degrees(i32 %10)
store double %11, double* %2
br label %12
12: ; preds = %3, %8
%13 = phi double [ 0.000000e+00, %8 ], [ -1.000000e+00, %3 ]
ret double %13
}