#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 suntime_get_sunrise_utc(double, double, double, int, int, int);
double suntime_get_sunset_utc(double, double, double, int, int, int);
double suntime_get_daytime(double latitude, double longitude, double zenith,
                           int year, int month, int day) {
  double sunrise, sunset;
  sunrise =
      suntime_get_sunrise_utc(latitude, longitude, zenith, year, month, day);
  sunset =
      suntime_get_sunset_utc(latitude, longitude, zenith, year, month, day);
  ;
  if (sunrise > sunset)
    return (sunset + (24 - sunrise));
  return (sunset - sunrise);
}


x86 assembly (clang, -O0):
<suntime_get_daytime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
mov    %edi,-0x24(%rbp)
mov    %esi,-0x28(%rbp)
mov    %edx,-0x2c(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
mov    -0x24(%rbp),%edi
mov    -0x28(%rbp),%esi
mov    -0x2c(%rbp),%edx
call   1030 <suntime_get_sunrise_utc@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
mov    -0x24(%rbp),%edi
mov    -0x28(%rbp),%esi
mov    -0x2c(%rbp),%edx
call   1040 <suntime_get_sunset_utc@plt>
movsd  %xmm0,-0x40(%rbp)
movsd  -0x38(%rbp),%xmm0
ucomisd -0x40(%rbp),%xmm0
jbe    11b4 <suntime_get_daytime+0x94>
movsd  -0x40(%rbp),%xmm0
movsd  0xe5f(%rip),%xmm1
subsd  -0x38(%rbp),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11c3 <suntime_get_daytime+0xa3>
movsd  -0x40(%rbp),%xmm0
subsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<suntime_get_daytime>:
push   %rbp
push   %r14
push   %rbx
sub    $0x30,%rsp
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
movsd  %xmm2,0x18(%rsp)
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
call   1030 <suntime_get_sunrise_utc@plt>
movaps %xmm0,0x20(%rsp)
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
movsd  0x18(%rsp),%xmm2
mov    %ebx,%edi
mov    %ebp,%esi
mov    %r14d,%edx
call   1040 <suntime_get_sunset_utc@plt>
movsd  0xe8f(%rip),%xmm1
movapd 0x20(%rsp),%xmm3
subsd  %xmm3,%xmm1
movapd %xmm0,%xmm2
cmpltsd %xmm3,%xmm2
xorpd  0xe84(%rip),%xmm3
andpd  %xmm2,%xmm1
andnpd %xmm3,%xmm2
orpd   %xmm1,%xmm2
addsd  %xmm2,%xmm0
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define double @suntime_get_daytime(double %0, double %1, double %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca double
%15 = alloca double
store double %0, double* %8
store double %1, double* %9
store double %2, double* %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store i32 %5, i32* %13
%16 = load double, double* %8
%17 = load double, double* %9
%18 = load double, double* %10
%19 = load i32, i32* %11
%20 = load i32, i32* %12
%21 = load i32, i32* %13
%22 = call double @suntime_get_sunrise_utc(double %16, double %17, double %18, i32 %19, i32 %20, i32 %21)
store double %22, double* %14
%23 = load double, double* %8
%24 = load double, double* %9
%25 = load double, double* %10
%26 = load i32, i32* %11
%27 = load i32, i32* %12
%28 = load i32, i32* %13
%29 = call double @suntime_get_sunset_utc(double %23, double %24, double %25, i32 %26, i32 %27, i32 %28)
store double %29, double* %15
%30 = load double, double* %14
%31 = load double, double* %15
%32 = fcmp ogt double %30, %31
br i1 %32, label %33, label %38
33: ; preds = %6
%34 = load double, double* %15
%35 = load double, double* %14
%36 = fsub double 2.400000e+01, %35
%37 = fadd double %34, %36
store double %37, double* %7
br label %42
38: ; preds = %6
%39 = load double, double* %15
%40 = load double, double* %14
%41 = fsub double %39, %40
store double %41, double* %7
br label %42
42: ; preds = %38, %33
%43 = load double, double* %7
ret double %43
}

LLVM IR (-O2):
define double @suntime_get_daytime(double %0, double %1, double %2, i32 %3, i32 %4, i32 %5) {
%7 = tail call double @suntime_get_sunrise_utc(double %0, double %1, double %2, i32 %3, i32 %4, i32 %5)
%8 = tail call double @suntime_get_sunset_utc(double %0, double %1, double %2, i32 %3, i32 %4, i32 %5)
%9 = fcmp ogt double %7, %8
%10 = fsub double 2.400000e+01, %7
%11 = fneg double %7
%12 = select i1 %9, double %10, double %11
%13 = fadd double %8, %12
ret double %13
}