#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 pow(double, int);
double sin(int);
double k_exo(double doy) {
  double Kexo, kexo_mean, r_prime_es, phi, ds;
  r_prime_es = 1.495978706916 * pow(10, 11);
  phi = 3.9 * pow(10, 26);
  kexo_mean = phi / (4 * 3.1415927 * pow(r_prime_es, 2));
  ds = 1.0 + 0.01672 * sin(2 * 3.1415927 * (doy - 93.5) / 365.0);
  Kexo = kexo_mean * (pow(r_prime_es, 2)) / (pow(r_prime_es / ds, 2));
  return Kexo;
}


x86 assembly (clang, -O0):
<k_exo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xf03(%rip),%xmm0
mov    $0xb,%edi
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xef6(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xedd(%rip),%xmm0
mov    $0x1a,%edi
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xec0(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x20(%rbp),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
movaps %xmm0,%xmm2
movsd  -0x48(%rbp),%xmm0
movsd  0xe86(%rip),%xmm1
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  0xe64(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xe50(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xe3c(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <sin@plt>
movsd  0xe17(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe13(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x20(%rbp),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x40(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x20(%rbp),%xmm0
divsd  -0x30(%rbp),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<k_exo>:
sub    $0x18,%rsp
movsd  %xmm0,0x8(%rsp)
movsd  0xece(%rip),%xmm0
mov    $0xb,%edi
call   1040 <pow@plt>
mulsd  0xec4(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0xeae(%rip),%xmm0
mov    $0x1a,%edi
call   1040 <pow@plt>
mulsd  0xeac(%rip),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x10(%rsp),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
mulsd  0xe97(%rip),%xmm0
movsd  (%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp)
movsd  0x8(%rsp),%xmm0
addsd  0xe83(%rip),%xmm0
mulsd  0xe83(%rip),%xmm0
divsd  0xe83(%rip),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <sin@plt>
mulsd  0xe7a(%rip),%xmm0
addsd  0xe7a(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
mulsd  (%rsp),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x10(%rsp),%xmm0
divsd  0x8(%rsp),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
movsd  (%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @k_exo(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %2
%8 = call double @pow(double 1.000000e+01, i32 11)
%9 = fmul double 0x3FF7EF875E5B7726, %8
store double %9, double* %5
%10 = call double @pow(double 1.000000e+01, i32 26)
%11 = fmul double 3.900000e+00, %10
store double %11, double* %6
%12 = load double, double* %6
%13 = load double, double* %5
%14 = call double @pow(double %13, i32 2)
%15 = fmul double 0x402921FB5A7ED197, %14
%16 = fdiv double %12, %15
store double %16, double* %4
%17 = load double, double* %2
%18 = fsub double %17, 9.350000e+01
%19 = fmul double 0x401921FB5A7ED197, %18
%20 = fdiv double %19, 3.650000e+02
%21 = fptosi double %20 to i32
%22 = call double @sin(i32 %21)
%23 = call double @llvm.fmuladd.f64(double 1.672000e-02, double %22, double 1.000000e+00)
store double %23, double* %7
%24 = load double, double* %4
%25 = load double, double* %5
%26 = call double @pow(double %25, i32 2)
%27 = fmul double %24, %26
%28 = load double, double* %5
%29 = load double, double* %7
%30 = fdiv double %28, %29
%31 = call double @pow(double %30, i32 2)
%32 = fdiv double %27, %31
store double %32, double* %3
%33 = load double, double* %3
ret double %33
}

LLVM IR (-O2):
define double @k_exo(double %0) {
%2 = tail call double @pow(double 1.000000e+01, i32 11)
%3 = fmul double %2, 0x3FF7EF875E5B7726
%4 = tail call double @pow(double 1.000000e+01, i32 26)
%5 = fmul double %4, 3.900000e+00
%6 = tail call double @pow(double %3, i32 2)
%7 = fmul double %6, 0x402921FB5A7ED197
%8 = fdiv double %5, %7
%9 = fadd double %0, -9.350000e+01
%10 = fmul double %9, 0x401921FB5A7ED197
%11 = fdiv double %10, 3.650000e+02
%12 = fptosi double %11 to i32
%13 = tail call double @sin(i32 %12)
%14 = tail call double @llvm.fmuladd.f64(double %13, double 1.672000e-02, double 1.000000e+00)
%15 = tail call double @pow(double %3, i32 2)
%16 = fmul double %8, %15
%17 = fdiv double %3, %14
%18 = tail call double @pow(double %17, i32 2)
%19 = fdiv double %16, %18
ret double %19
}