#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 log(double);
double pow(double, int);
double r_net_d(double bbalb, double solar, double e0, double tempka,
               double dem) {
  double result, tsw, eatm;
  tsw = 0.7;
  eatm = 1.08 * pow(-log(tsw), 0.265);
  result = ((1.0 - bbalb) * solar) +
           e0 * 5.67 * pow(10, -8) * pow(tempka, 4) * (eatm - 1);
  return result;
}


x86 assembly (clang, -O0):
<r_net_d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  0xed7(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
call   1030 <log@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
xor    %edi,%edi
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xe97(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xe6e(%rip),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  0xe62(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  0xe48(%rip),%xmm0
mov    $0xfffffff8,%edi
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x60(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x20(%rbp),%xmm0
mov    $0x4,%edi
call   1040 <pow@plt>
movsd  -0x58(%rbp),%xmm1
movsd  -0x50(%rbp),%xmm2
movaps %xmm0,%xmm3
movsd  -0x48(%rbp),%xmm0
mulsd  %xmm3,%xmm1
movsd  -0x40(%rbp),%xmm3
movsd  0xdf3(%rip),%xmm4
subsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<r_net_d>:
sub    $0x28,%rsp
movsd  %xmm3,0x18(%rsp)
movsd  %xmm2,(%rsp)
movsd  %xmm1,0x20(%rsp)
movsd  %xmm0,0x8(%rsp)
movsd  0xecd(%rip),%xmm0
xor    %edi,%edi
call   1030 <pow@plt>
mulsd  0xec6(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0xec0(%rip),%xmm0
subsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  (%rsp),%xmm0
mulsd  0xeaf(%rip),%xmm0
movsd  %xmm0,(%rsp)
movsd  0xeaa(%rip),%xmm0
mov    $0xfffffff8,%edi
call   1030 <pow@plt>
mulsd  (%rsp),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x18(%rsp),%xmm0
mov    $0x4,%edi
call   1030 <pow@plt>
movsd  0x10(%rsp),%xmm1
addsd  0xe80(%rip),%xmm1
mulsd  (%rsp),%xmm0
mulsd  %xmm1,%xmm0
movsd  0x8(%rsp),%xmm1
mulsd  0x20(%rsp),%xmm1
addsd  %xmm1,%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @r_net_d(double %0, double %1, double %2, double %3, double %4) {
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
store double %0, double* %6
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
store double %4, double* %10
store double 0x3FE6666666666666, double* %12
%14 = load double, double* %12
%15 = call double @log(double %14)
%16 = fneg double %15
%17 = call double @pow(double %16, i32 0)
%18 = fmul double 1.080000e+00, %17
store double %18, double* %13
%19 = load double, double* %6
%20 = fsub double 1.000000e+00, %19
%21 = load double, double* %7
%22 = load double, double* %8
%23 = fmul double %22, 5.670000e+00
%24 = call double @pow(double 1.000000e+01, i32 -8)
%25 = fmul double %23, %24
%26 = load double, double* %9
%27 = call double @pow(double %26, i32 4)
%28 = fmul double %25, %27
%29 = load double, double* %13
%30 = fsub double %29, 1.000000e+00
%31 = fmul double %28, %30
%32 = call double @llvm.fmuladd.f64(double %20, double %21, double %31)
store double %32, double* %11
%33 = load double, double* %11
ret double %33
}

LLVM IR (-O2):
define double @r_net_d(double %0, double %1, double %2, double %3, double %4) {
%6 = tail call double @pow(double 0x3FD6D3C324E13F50, i32 0)
%7 = fmul double %6, 1.080000e+00
%8 = fsub double 1.000000e+00, %0
%9 = fmul double %2, 5.670000e+00
%10 = tail call double @pow(double 1.000000e+01, i32 -8)
%11 = fmul double %9, %10
%12 = tail call double @pow(double %3, i32 4)
%13 = fmul double %11, %12
%14 = fadd double %7, -1.000000e+00
%15 = fmul double %14, %13
%16 = tail call double @llvm.fmuladd.f64(double %8, double %1, double %15)
ret double %16
}