#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 acos(double);
double cos(double);
double sin(double);
double sqrt(int);
void solar_angles(double delta, double lat, double hour, double eot,
                  double *mu0, double *theta0, double *phi0) {
  double a;
  double h;
  double coslat;
  double sinlat;
  double sindelta;
  double cos_h;
  double costheta0;
  double cosphi0;
  h = (hour - eot * 24. - 12.) * 15. *
      (3.14159265358979323846264338327 / 180.0);
  coslat = cos(lat);
  sinlat = sin(lat);
  sindelta = sin(delta);
  cos_h = cos(h);
  a = cos(delta) * cos_h;
  costheta0 = (sinlat * sindelta + coslat * a);
  *mu0 = costheta0;
  *theta0 = acos(costheta0);
  cosphi0 = (coslat * sindelta - sinlat * a) / sqrt(1. - costheta0 * costheta0);
  *phi0 = acos(cosphi0);
  if (h > 0.)
    *phi0 = 2. * 3.14159265358979323846264338327 - *phi0;
}


x86 assembly (clang, -O0):
<solar_angles>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
mov    %rdi,-0x28(%rbp)
mov    %rsi,-0x30(%rbp)
mov    %rdx,-0x38(%rbp)
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xe8c(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xe74(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xe60(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe4c(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1050 <cos@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <sin@plt>
movsd  %xmm0,-0x58(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <sin@plt>
movsd  %xmm0,-0x60(%rbp)
movsd  -0x48(%rbp),%xmm0
call   1050 <cos@plt>
movsd  %xmm0,-0x68(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1050 <cos@plt>
mulsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x58(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm2
movsd  -0x50(%rbp),%xmm1
mulsd  -0x40(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x70(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x70(%rbp),%xmm0
call   1030 <acos@plt>
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x50(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm2
movsd  -0x58(%rbp),%xmm1
mulsd  -0x40(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x70(%rbp),%xmm0
movsd  -0x70(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xd46(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1060 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x80(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x78(%rbp),%xmm0
call   1030 <acos@plt>
mov    -0x38(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x48(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1314 <solar_angles+0x1d4>
mov    -0x38(%rbp),%rax
movsd  0xd20(%rip),%xmm0
subsd  (%rax),%xmm0
mov    -0x38(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solar_angles>:
push   %r15
push   %r14
push   %rbx
sub    $0x30,%rsp
mulsd  0xeaf(%rip),%xmm3
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,(%rsp)
addsd  %xmm2,%xmm3
addsd  0xe97(%rip),%xmm3
mulsd  0xe97(%rip),%xmm3
mulsd  0xe97(%rip),%xmm3
movsd  %xmm3,0x28(%rsp)
movaps %xmm1,%xmm0
call   1050 <cos@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1040 <sin@plt>
movsd  %xmm0,0x8(%rsp)
movsd  (%rsp),%xmm0
call   1040 <sin@plt>
movsd  %xmm0,0x20(%rsp)
movsd  0x28(%rsp),%xmm0
call   1050 <cos@plt>
movsd  %xmm0,0x18(%rsp)
movsd  (%rsp),%xmm0
call   1050 <cos@plt>
mulsd  0x18(%rsp),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x10(%rsp),%xmm1
mulsd  %xmm0,%xmm1
movsd  0x8(%rsp),%xmm0
mulsd  0x20(%rsp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x18(%rsp)
movsd  %xmm0,(%rbx)
call   1030 <acos@plt>
movsd  %xmm0,(%r15)
movsd  (%rsp),%xmm1
mulsd  0x8(%rsp),%xmm1
movsd  0x10(%rsp),%xmm0
mulsd  0x20(%rsp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x18(%rsp),%xmm1
mulsd  %xmm1,%xmm1
movsd  0xde3(%rip),%xmm0
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1060 <sqrt@plt>
movsd  0x10(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1030 <acos@plt>
movsd  0xdc3(%rip),%xmm1
subsd  %xmm0,%xmm1
xorpd  %xmm2,%xmm2
cmpltsd 0x28(%rsp),%xmm2
movapd %xmm2,%xmm3
andnpd %xmm0,%xmm3
andpd  %xmm1,%xmm2
orpd   %xmm3,%xmm2
movlpd %xmm2,(%r14)
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @solar_angles(double %0, double %1, double %2, double %3, double* %4, double* %5, double* %6) {
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double*
%13 = alloca double*
%14 = alloca double*
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca double
%19 = alloca double
%20 = alloca double
%21 = alloca double
%22 = alloca double
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 double* %6, double** %14
%23 = load double, double* %10
%24 = load double, double* %11
%25 = fneg double %24
%26 = call double @llvm.fmuladd.f64(double %25, double 2.400000e+01, double %23)
%27 = fsub double %26, 1.200000e+01
%28 = fmul double %27, 1.500000e+01
%29 = fmul double %28, 0x3F91DF46A2529D39
store double %29, double* %16
%30 = load double, double* %9
%31 = call double @cos(double %30)
store double %31, double* %17
%32 = load double, double* %9
%33 = call double @sin(double %32)
store double %33, double* %18
%34 = load double, double* %8
%35 = call double @sin(double %34)
store double %35, double* %19
%36 = load double, double* %16
%37 = call double @cos(double %36)
store double %37, double* %20
%38 = load double, double* %8
%39 = call double @cos(double %38)
%40 = load double, double* %20
%41 = fmul double %39, %40
store double %41, double* %15
%42 = load double, double* %18
%43 = load double, double* %19
%44 = load double, double* %17
%45 = load double, double* %15
%46 = fmul double %44, %45
%47 = call double @llvm.fmuladd.f64(double %42, double %43, double %46)
store double %47, double* %21
%48 = load double, double* %21
%49 = load double*, double** %12
store double %48, double* %49
%50 = load double, double* %21
%51 = call double @acos(double %50)
%52 = load double*, double** %13
store double %51, double* %52
%53 = load double, double* %17
%54 = load double, double* %19
%55 = load double, double* %18
%56 = load double, double* %15
%57 = fmul double %55, %56
%58 = fneg double %57
%59 = call double @llvm.fmuladd.f64(double %53, double %54, double %58)
%60 = load double, double* %21
%61 = load double, double* %21
%62 = fneg double %60
%63 = call double @llvm.fmuladd.f64(double %62, double %61, double 1.000000e+00)
%64 = fptosi double %63 to i32
%65 = call double @sqrt(i32 %64)
%66 = fdiv double %59, %65
store double %66, double* %22
%67 = load double, double* %22
%68 = call double @acos(double %67)
%69 = load double*, double** %14
store double %68, double* %69
%70 = load double, double* %16
%71 = fcmp ogt double %70, 0.000000e+00
br i1 %71, label %72, label %77
72: ; preds = %7
%73 = load double*, double** %14
%74 = load double, double* %73
%75 = fsub double 0x401921FB54442D18, %74
%76 = load double*, double** %14
store double %75, double* %76
br label %77
77: ; preds = %72, %7
ret void
}

LLVM IR (-O2):
define void @solar_angles(double %0, double %1, double %2, double %3, double* nocapture writeonly %4, double* nocapture writeonly %5, double* nocapture writeonly %6) {
%8 = fneg double %3
%9 = tail call double @llvm.fmuladd.f64(double %8, double 2.400000e+01, double %2)
%10 = fadd double %9, -1.200000e+01
%11 = fmul double %10, 1.500000e+01
%12 = fmul double %11, 0x3F91DF46A2529D39
%13 = tail call double @cos(double %1)
%14 = tail call double @sin(double %1)
%15 = tail call double @sin(double %0)
%16 = tail call double @cos(double %12)
%17 = tail call double @cos(double %0)
%18 = fmul double %16, %17
%19 = fmul double %13, %18
%20 = tail call double @llvm.fmuladd.f64(double %14, double %15, double %19)
store double %20, double* %4
%21 = tail call double @acos(double %20)
store double %21, double* %5
%22 = fneg double %14
%23 = fmul double %18, %22
%24 = tail call double @llvm.fmuladd.f64(double %13, double %15, double %23)
%25 = fneg double %20
%26 = tail call double @llvm.fmuladd.f64(double %25, double %20, double 1.000000e+00)
%27 = fptosi double %26 to i32
%28 = tail call double @sqrt(i32 %27)
%29 = fdiv double %24, %28
%30 = tail call double @acos(double %29)
%31 = fcmp ogt double %12, 0.000000e+00
%32 = fsub double 0x401921FB54442D18, %30
%33 = select i1 %31, double %32, double %30
store double %33, double* %6
ret void
}