#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 cos(int /*<<< orphan*/);
int /*<<< orphan*/ deg2rad(double);
double sin(int /*<<< orphan*/);
double sun_rise_and_set(double *m_rts, double *h_rts, double *delta_prime,
                        double latitude, double *h_prime, double h0_prime,
                        int sun) {
  return m_rts[sun] + (h_rts[sun] - h0_prime) /
                          (360.0 * cos(deg2rad(delta_prime[sun])) *
                           cos(deg2rad(latitude)) * sin(deg2rad(h_prime[sun])));
}


x86 assembly (clang, -O0):
<sun_rise_and_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movsd  %xmm0,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
movsd  %xmm1,-0x30(%rbp)
mov    %r8d,-0x34(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
subsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
call   1030 <deg2rad@plt>
mov    %eax,%edi
call   1050 <cos@plt>
movaps %xmm0,%xmm1
movsd  0xe5d(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1030 <deg2rad@plt>
mov    %eax,%edi
call   1050 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x58(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
call   1030 <deg2rad@plt>
mov    %eax,%edi
call   1040 <sin@plt>
movsd  -0x50(%rbp),%xmm2
movsd  -0x48(%rbp),%xmm1
movaps %xmm0,%xmm3
movsd  -0x40(%rbp),%xmm0
mulsd  %xmm3,%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sun_rise_and_set>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %rcx,%r14
movsd  %xmm0,0x8(%rsp)
movslq %r8d,%rbx
movsd  (%rdi,%rbx,8),%xmm0
movsd  %xmm0,0x20(%rsp)
movsd  (%rsi,%rbx,8),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,0x18(%rsp)
movsd  (%rdx,%rbx,8),%xmm0
call   1030 <deg2rad@plt>
mov    %eax,%edi
call   1050 <cos@plt>
mulsd  0xe8a(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <deg2rad@plt>
mov    %eax,%edi
call   1050 <cos@plt>
mulsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  (%r14,%rbx,8),%xmm0
call   1030 <deg2rad@plt>
mov    %eax,%edi
call   1040 <sin@plt>
mulsd  0x8(%rsp),%xmm0
movsd  0x18(%rsp),%xmm1
divsd  %xmm0,%xmm1
addsd  0x20(%rsp),%xmm1
movapd %xmm1,%xmm0
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define double @sun_rise_and_set(double* %0, double* %1, double* %2, double %3, double* %4, double %5, i32 %6) {
%8 = alloca double*
%9 = alloca double*
%10 = alloca double*
%11 = alloca double
%12 = alloca double*
%13 = alloca double
%14 = alloca i32
store double* %0, double** %8
store double* %1, double** %9
store double* %2, double** %10
store double %3, double* %11
store double* %4, double** %12
store double %5, double* %13
store i32 %6, i32* %14
%15 = load double*, double** %8
%16 = load i32, i32* %14
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds double, double* %15, i64 %17
%19 = load double, double* %18
%20 = load double*, double** %9
%21 = load i32, i32* %14
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds double, double* %20, i64 %22
%24 = load double, double* %23
%25 = load double, double* %13
%26 = fsub double %24, %25
%27 = load double*, double** %10
%28 = load i32, i32* %14
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds double, double* %27, i64 %29
%31 = load double, double* %30
%32 = call i32 @deg2rad(double %31)
%33 = call double @cos(i32 %32)
%34 = fmul double 3.600000e+02, %33
%35 = load double, double* %11
%36 = call i32 @deg2rad(double %35)
%37 = call double @cos(i32 %36)
%38 = fmul double %34, %37
%39 = load double*, double** %12
%40 = load i32, i32* %14
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds double, double* %39, i64 %41
%43 = load double, double* %42
%44 = call i32 @deg2rad(double %43)
%45 = call double @sin(i32 %44)
%46 = fmul double %38, %45
%47 = fdiv double %26, %46
%48 = fadd double %19, %47
ret double %48
}

LLVM IR (-O2):
define double @sun_rise_and_set(double* nocapture %0, double* nocapture %1, double* nocapture %2, double %3, double* nocapture %4, double %5, i32 %6) {
%8 = sext i32 %6 to i64
%9 = getelementptr inbounds double, double* %0, i64 %8
%10 = load double, double* %9
%11 = getelementptr inbounds double, double* %1, i64 %8
%12 = load double, double* %11
%13 = fsub double %12, %5
%14 = getelementptr inbounds double, double* %2, i64 %8
%15 = load double, double* %14
%16 = tail call i32 @deg2rad(double %15)
%17 = tail call double @cos(i32 %16)
%18 = fmul double %17, 3.600000e+02
%19 = tail call i32 @deg2rad(double %3)
%20 = tail call double @cos(i32 %19)
%21 = fmul double %18, %20
%22 = getelementptr inbounds double, double* %4, i64 %8
%23 = load double, double* %22
%24 = tail call i32 @deg2rad(double %23)
%25 = tail call double @sin(i32 %24)
%26 = fmul double %21, %25
%27 = fdiv double %13, %26
%28 = fadd double %10, %27
ret double %28
}