#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(double);
double k_exo(double);
double log(double);
double pow(double, int);
double r_net(double albedo, double sunza, double emissivity, double lst,
             double dem, double doy, double tmax) {
  double result;
  double sb;
  double ds;
  double tsw;
  double kexo;
  double eatm;
  ds = 1 - 0.01672 * cos(2 * 3.1415927 * (doy - 4) / 365.0);
  sb = 5.67 * pow(10, -8);
  tsw = 0.7;
  eatm = 1.08 * pow(-log(tsw), 0.265);
  kexo = k_exo(doy);
  result =
      (1 - albedo) * (tsw * kexo * cos(sunza * 3.1415927 / 180.0) / (ds * ds)) +
      (eatm * sb * pow(tmax, 4)) - (emissivity * sb * pow(lst, 4)) -
      (1 - emissivity) * (eatm * sb * pow(tmax, 4));
  return result;
}


x86 assembly (clang, -O0):
<r_net>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
movsd  %xmm6,-0x38(%rbp)
movsd  -0x30(%rbp),%xmm1
movsd  0xed5(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xec1(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xead(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1040 <cos@plt>
movsd  0xe94(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe50(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  0xe6f(%rip),%xmm0
mov    $0xfffffff8,%edi
call   1060 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xe52(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  0xe39(%rip),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x58(%rbp),%xmm0
call   1050 <log@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
xor    %edi,%edi
call   1060 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xdf9(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x30(%rbp),%xmm0
call   1030 <k_exo@plt>
movsd  %xmm0,-0x60(%rbp)
movsd  0xdc1(%rip),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x58(%rbp),%xmm0
mulsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  0xdaa(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  0xd95(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1040 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0xb0(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  -0x50(%rbp),%xmm1
mulsd  -0x50(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x68(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0x38(%rbp),%xmm0
mov    $0x4,%edi
call   1060 <pow@plt>
movsd  -0xa8(%rbp),%xmm1
ff
movsd  -0xa0(%rbp),%xmm2
ff
movaps %xmm0,%xmm3
movsd  -0x98(%rbp),%xmm0
ff
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x18(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x20(%rbp),%xmm0
mov    $0x4,%edi
call   1060 <pow@plt>
movsd  -0x90(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0x88(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  0xcaf(%rip),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x68(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x38(%rbp),%xmm0
mov    $0x4,%edi
call   1060 <pow@plt>
movsd  -0x80(%rbp),%xmm2
movsd  -0x78(%rbp),%xmm1
movaps %xmm0,%xmm3
movsd  -0x70(%rbp),%xmm0
mulsd  %xmm3,%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<r_net>:
sub    $0x58,%rsp
movsd  %xmm6,0x38(%rsp)
movsd  %xmm5,0x18(%rsp)
movsd  %xmm3,0x48(%rsp)
movsd  %xmm2,0x50(%rsp)
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,0x20(%rsp)
movsd  0xea0(%rip),%xmm0
addsd  %xmm5,%xmm0
mulsd  0xe9c(%rip),%xmm0
divsd  0xe9c(%rip),%xmm0
call   1040 <cos@plt>
mulsd  0xe97(%rip),%xmm0
movsd  0xe97(%rip),%xmm1
movsd  %xmm1,0x28(%rsp)
addsd  %xmm1,%xmm0
movsd  %xmm0,0x40(%rsp)
movsd  0xe87(%rip),%xmm0
mov    $0xfffffff8,%edi
call   1050 <pow@plt>
mulsd  0xe7d(%rip),%xmm0
movsd  %xmm0,0x30(%rsp)
movsd  0xe77(%rip),%xmm0
xor    %edi,%edi
call   1050 <pow@plt>
mulsd  0xe70(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x18(%rsp),%xmm0
call   1030 <k_exo@plt>
movapd %xmm0,%xmm1
movsd  0xe33(%rip),%xmm0
subsd  0x20(%rsp),%xmm0
movsd  %xmm0,0x20(%rsp)
mulsd  0xe47(%rip),%xmm1
movsd  %xmm1,0x18(%rsp)
movsd  0x8(%rsp),%xmm0
mulsd  0xe3b(%rip),%xmm0
divsd  0xe3b(%rip),%xmm0
call   1040 <cos@plt>
mulsd  0x18(%rsp),%xmm0
movsd  0x40(%rsp),%xmm1
mulsd  %xmm1,%xmm1
divsd  %xmm1,%xmm0
mulsd  0x20(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
mulsd  0x30(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x38(%rsp),%xmm0
mov    $0x4,%edi
call   1050 <pow@plt>
mulsd  0x10(%rsp),%xmm0
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x48(%rsp),%xmm0
mov    $0x4,%edi
call   1050 <pow@plt>
movsd  0x50(%rsp),%xmm1
movsd  0x30(%rsp),%xmm2
mulsd  %xmm1,%xmm2
mulsd  %xmm0,%xmm2
movsd  0x8(%rsp),%xmm0
subsd  %xmm2,%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x28(%rsp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,0x28(%rsp)
movsd  0x38(%rsp),%xmm0
mov    $0x4,%edi
call   1050 <pow@plt>
mulsd  0x10(%rsp),%xmm0
mulsd  0x28(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x58,%rsp
ret

LLVM IR (-O0):
define double @r_net(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
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
%21 = load double, double* %13
%22 = fsub double %21, 4.000000e+00
%23 = fmul double 0x401921FB5A7ED197, %22
%24 = fdiv double %23, 3.650000e+02
%25 = call double @cos(double %24)
%26 = call double @llvm.fmuladd.f64(double -1.672000e-02, double %25, double 1.000000e+00)
store double %26, double* %17
%27 = call double @pow(double 1.000000e+01, i32 -8)
%28 = fmul double 5.670000e+00, %27
store double %28, double* %16
store double 0x3FE6666666666666, double* %18
%29 = load double, double* %18
%30 = call double @log(double %29)
%31 = fneg double %30
%32 = call double @pow(double %31, i32 0)
%33 = fmul double 1.080000e+00, %32
store double %33, double* %20
%34 = load double, double* %13
%35 = call double @k_exo(double %34)
store double %35, double* %19
%36 = load double, double* %8
%37 = fsub double 1.000000e+00, %36
%38 = load double, double* %18
%39 = load double, double* %19
%40 = fmul double %38, %39
%41 = load double, double* %9
%42 = fmul double %41, 0x400921FB5A7ED197
%43 = fdiv double %42, 1.800000e+02
%44 = call double @cos(double %43)
%45 = fmul double %40, %44
%46 = load double, double* %17
%47 = load double, double* %17
%48 = fmul double %46, %47
%49 = fdiv double %45, %48
%50 = load double, double* %20
%51 = load double, double* %16
%52 = fmul double %50, %51
%53 = load double, double* %14
%54 = call double @pow(double %53, i32 4)
%55 = fmul double %52, %54
%56 = call double @llvm.fmuladd.f64(double %37, double %49, double %55)
%57 = load double, double* %10
%58 = load double, double* %16
%59 = fmul double %57, %58
%60 = load double, double* %11
%61 = call double @pow(double %60, i32 4)
%62 = fneg double %59
%63 = call double @llvm.fmuladd.f64(double %62, double %61, double %56)
%64 = load double, double* %10
%65 = fsub double 1.000000e+00, %64
%66 = load double, double* %20
%67 = load double, double* %16
%68 = fmul double %66, %67
%69 = load double, double* %14
%70 = call double @pow(double %69, i32 4)
%71 = fmul double %68, %70
%72 = fneg double %65
%73 = call double @llvm.fmuladd.f64(double %72, double %71, double %63)
store double %73, double* %15
%74 = load double, double* %15
ret double %74
}

LLVM IR (-O2):
define double @r_net(double %0, double %1, double %2, double %3, double %4, double %5, double %6) {
%8 = fadd double %5, -4.000000e+00
%9 = fmul double %8, 0x401921FB5A7ED197
%10 = fdiv double %9, 3.650000e+02
%11 = tail call double @cos(double %10)
%12 = tail call double @llvm.fmuladd.f64(double %11, double -1.672000e-02, double 1.000000e+00)
%13 = tail call double @pow(double 1.000000e+01, i32 -8)
%14 = fmul double %13, 5.670000e+00
%15 = tail call double @pow(double 0x3FD6D3C324E13F50, i32 0)
%16 = fmul double %15, 1.080000e+00
%17 = tail call double @k_exo(double %5)
%18 = fsub double 1.000000e+00, %0
%19 = fmul double %17, 0x3FE6666666666666
%20 = fmul double %1, 0x400921FB5A7ED197
%21 = fdiv double %20, 1.800000e+02
%22 = tail call double @cos(double %21)
%23 = fmul double %19, %22
%24 = fmul double %12, %12
%25 = fdiv double %23, %24
%26 = fmul double %14, %16
%27 = tail call double @pow(double %6, i32 4)
%28 = fmul double %26, %27
%29 = tail call double @llvm.fmuladd.f64(double %18, double %25, double %28)
%30 = tail call double @pow(double %3, i32 4)
%31 = fneg double %14
%32 = fmul double %31, %2
%33 = tail call double @llvm.fmuladd.f64(double %32, double %30, double %29)
%34 = fsub double 1.000000e+00, %2
%35 = tail call double @pow(double %6, i32 4)
%36 = fmul double %26, %35
%37 = fneg double %34
%38 = tail call double @llvm.fmuladd.f64(double %37, double %36, double %33)
ret double %38
}