#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, double);
void radiatewater(double tk[], double Rn[], double *G, double tc_air,
                  double evap_mbar, double R_solar) {
  double tk_air;
  double epsilons = 0.99;
  double epsilona;
  double albedo = 0.1;
  double stef_boltz = 5.67e-8;
  tk_air = tc_air + 273.15;
  epsilona = 1.24 * pow((evap_mbar / tk_air), (1.0 / 7.0));
  Rn[2] = (1.0 - albedo) * R_solar * epsilona * stef_boltz * pow(tk_air, 4.0) -
          epsilons * stef_boltz * pow(tk[2], 4.0) -
          (1.0 - epsilons) * epsilona * stef_boltz * pow(tk_air, 4.0);
  *G = 0.55 * Rn[2];
  Rn[0] = Rn[2];
  Rn[1] = 0.0;
}


x86 assembly (clang, -O0):
<radiatewater>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movsd  %xmm0,-0x20(%rbp)
movsd  %xmm1,-0x28(%rbp)
movsd  %xmm2,-0x30(%rbp)
movsd  0xf02(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xeed(%rip),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  0xed8(%rip),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  0xec3(%rip),%xmm0
addsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x28(%rbp),%xmm0
divsd  -0x38(%rbp),%xmm0
movsd  0xe9f(%rip),%xmm1
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xe87(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  0xe6e(%rip),%xmm0
subsd  -0x50(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
mulsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  0xe40(%rip),%xmm1
call   1030 <pow@plt>
movsd  %xmm0,-0x78(%rbp)
movsd  -0x40(%rbp),%xmm0
mulsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  0xe16(%rip),%xmm1
call   1030 <pow@plt>
movsd  -0x80(%rbp),%xmm1
movsd  -0x78(%rbp),%xmm2
movaps %xmm0,%xmm3
movsd  -0x70(%rbp),%xmm0
mulsd  %xmm3,%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  0xdd7(%rip),%xmm0
subsd  -0x40(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
mulsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  0xdae(%rip),%xmm1
call   1030 <pow@plt>
movsd  -0x68(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x60(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x10(%rax)
mov    -0x10(%rbp),%rax
movsd  0xd60(%rip),%xmm0
mulsd  0x10(%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x8(%rax)
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<radiatewater>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
movsd  %xmm2,0x8(%rsp)
movapd %xmm1,%xmm2
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%r15
addsd  0xecc(%rip),%xmm0
movsd  %xmm0,0x18(%rsp)
divsd  %xmm0,%xmm2
movsd  0xec2(%rip),%xmm1
movapd %xmm2,%xmm0
call   1030 <pow@plt>
mulsd  0xeb9(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm1
mulsd  0xead(%rip),%xmm1
mulsd  %xmm0,%xmm1
mulsd  0xea9(%rip),%xmm1
movsd  %xmm1,0x8(%rsp)
movsd  0xea3(%rip),%xmm1
movsd  0x18(%rsp),%xmm0
call   1030 <pow@plt>
movsd  %xmm0,(%rsp)
movsd  0x10(%r15),%xmm0
movsd  0xe85(%rip),%xmm1
call   1030 <pow@plt>
mulsd  0xe80(%rip),%xmm0
movsd  (%rsp),%xmm1
mulsd  0x8(%rsp),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp)
movsd  0x10(%rsp),%xmm0
mulsd  0xe66(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x18(%rsp),%xmm0
movsd  0xe42(%rip),%xmm1
call   1030 <pow@plt>
movsd  0x10(%rsp),%xmm1
mulsd  0xe47(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  (%rsp),%xmm1
movsd  %xmm1,0x10(%rbx)
mulsd  0xe39(%rip),%xmm1
movsd  %xmm1,(%r14)
movsd  0x10(%rbx),%xmm0
movsd  %xmm0,(%rbx)
movq   $0x0,0x8(%rbx)
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @radiatewater(double* %0, double* %1, double* %2, double %3, double %4, double %5) {
%7 = alloca double*
%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
store double* %0, double** %7
store double* %1, double** %8
store double* %2, double** %9
store double %3, double* %10
store double %4, double* %11
store double %5, double* %12
store double 0x3FEFAE147AE147AE, double* %14
store double 1.000000e-01, double* %16
store double 0x3E6E70C9E5BE6A9C, double* %17
%18 = load double, double* %10
%19 = fadd double %18, 2.731500e+02
store double %19, double* %13
%20 = load double, double* %11
%21 = load double, double* %13
%22 = fdiv double %20, %21
%23 = call double @pow(double %22, double 0x3FC2492492492492)
%24 = fmul double 1.240000e+00, %23
store double %24, double* %15
%25 = load double, double* %16
%26 = fsub double 1.000000e+00, %25
%27 = load double, double* %12
%28 = fmul double %26, %27
%29 = load double, double* %15
%30 = fmul double %28, %29
%31 = load double, double* %17
%32 = fmul double %30, %31
%33 = load double, double* %13
%34 = call double @pow(double %33, double 4.000000e+00)
%35 = load double, double* %14
%36 = load double, double* %17
%37 = fmul double %35, %36
%38 = load double*, double** %7
%39 = getelementptr inbounds double, double* %38, i64 2
%40 = load double, double* %39
%41 = call double @pow(double %40, double 4.000000e+00)
%42 = fmul double %37, %41
%43 = fneg double %42
%44 = call double @llvm.fmuladd.f64(double %32, double %34, double %43)
%45 = load double, double* %14
%46 = fsub double 1.000000e+00, %45
%47 = load double, double* %15
%48 = fmul double %46, %47
%49 = load double, double* %17
%50 = fmul double %48, %49
%51 = load double, double* %13
%52 = call double @pow(double %51, double 4.000000e+00)
%53 = fneg double %50
%54 = call double @llvm.fmuladd.f64(double %53, double %52, double %44)
%55 = load double*, double** %8
%56 = getelementptr inbounds double, double* %55, i64 2
store double %54, double* %56
%57 = load double*, double** %8
%58 = getelementptr inbounds double, double* %57, i64 2
%59 = load double, double* %58
%60 = fmul double 5.500000e-01, %59
%61 = load double*, double** %9
store double %60, double* %61
%62 = load double*, double** %8
%63 = getelementptr inbounds double, double* %62, i64 2
%64 = load double, double* %63
%65 = load double*, double** %8
%66 = getelementptr inbounds double, double* %65, i64 0
store double %64, double* %66
%67 = load double*, double** %8
%68 = getelementptr inbounds double, double* %67, i64 1
store double 0.000000e+00, double* %68
ret void
}

LLVM IR (-O2):
define void @radiatewater(double* nocapture %0, double* nocapture %1, double* nocapture writeonly %2, double %3, double %4, double %5) {
%7 = fadd double %3, 2.731500e+02
%8 = fdiv double %4, %7
%9 = tail call double @pow(double %8, double 0x3FC2492492492492)
%10 = fmul double %9, 1.240000e+00
%11 = fmul double %5, 9.000000e-01
%12 = fmul double %11, %10
%13 = fmul double %12, 0x3E6E70C9E5BE6A9C
%14 = tail call double @pow(double %7, double 4.000000e+00)
%15 = getelementptr inbounds double, double* %0, i64 2
%16 = load double, double* %15
%17 = tail call double @pow(double %16, double 4.000000e+00)
%18 = fmul double %17, -5.613300e-08
%19 = tail call double @llvm.fmuladd.f64(double %13, double %14, double %18)
%20 = fmul double %10, 0x3F847AE147AE1480
%21 = tail call double @pow(double %7, double 4.000000e+00)
%22 = fmul double %20, 0xBE6E70C9E5BE6A9C
%23 = tail call double @llvm.fmuladd.f64(double %22, double %21, double %19)
%24 = getelementptr inbounds double, double* %1, i64 2
store double %23, double* %24
%25 = fmul double %23, 5.500000e-01
store double %25, double* %2
%26 = load double, double* %24
store double %26, double* %1
%27 = getelementptr inbounds double, double* %1, i64 1
store double 0.000000e+00, double* %27
ret void
}