#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_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);
  return (kexo_mean * (pow(r_prime_es, 2)) / (pow(r_prime_es / ds, 2)));
}


x86 assembly (clang, -O0):
<k_exo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%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,-0x18(%rbp)
movsd  0xedd(%rip),%xmm0
mov    $0x1a,%edi
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xec0(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x18(%rbp),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
movaps %xmm0,%xmm2
movsd  -0x40(%rbp),%xmm0
movsd  0xe86(%rip),%xmm1
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%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,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x18(%rbp),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x18(%rbp),%xmm0
divsd  -0x28(%rbp),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
divsd  %xmm1,%xmm0
add    $0x40,%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
store double %0, double* %2
%7 = call double @pow(double 1.000000e+01, i32 11)
%8 = fmul double 0x3FF7EF875E5B7726, %7
store double %8, double* %4
%9 = call double @pow(double 1.000000e+01, i32 26)
%10 = fmul double 3.900000e+00, %9
store double %10, double* %5
%11 = load double, double* %5
%12 = load double, double* %4
%13 = call double @pow(double %12, i32 2)
%14 = fmul double 0x402921FB5A7ED197, %13
%15 = fdiv double %11, %14
store double %15, double* %3
%16 = load double, double* %2
%17 = fsub double %16, 9.350000e+01
%18 = fmul double 0x401921FB5A7ED197, %17
%19 = fdiv double %18, 3.650000e+02
%20 = fptosi double %19 to i32
%21 = call double @sin(i32 %20)
%22 = call double @llvm.fmuladd.f64(double 1.672000e-02, double %21, double 1.000000e+00)
store double %22, double* %6
%23 = load double, double* %3
%24 = load double, double* %4
%25 = call double @pow(double %24, i32 2)
%26 = fmul double %23, %25
%27 = load double, double* %4
%28 = load double, double* %6
%29 = fdiv double %27, %28
%30 = call double @pow(double %29, i32 2)
%31 = fdiv double %26, %30
ret double %31
}

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
}