#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 */
int exp(int);
void icerad(double sw, double hi, double hs, double *avgcond, double *SWnet,
            double *SW_under_ice) {
  double a, b, c, d;
  *avgcond = (hs * 2.3 + hi * 0.7) / (2.3 * 0.7);
  a = -1. * (1. - exp(-6.0 * hs)) / (0.7 * 6.0);
  b = -1. * exp(-6.0 * hs) * (1 - exp(-1.5 * hi)) / (2.3 * 1.5);
  c = -1. * (1. - exp(-20 * hs)) / (0.7 * 20);
  d = -1. * exp(-20 * hs) * (1 - exp(-20 * hi)) / (2.3 * 20);
  *SWnet = sw * 0.7 * (a + b) + sw * 0.3 * (c + d);
  *SW_under_ice = (0.7 * sw * (1 - exp(-(6.0 * hs + 1.5 * hi))) +
                   0.3 * sw * (1 - exp(-(20 * hs + 20 * hi))));
}


x86 assembly (clang, -O0):
<icerad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x28(%rbp)
mov    %rdx,-0x30(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xedd(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
movsd  0xf28(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xf10(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  0xeec(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <exp@plt>
cvtsi2sd %eax,%xmm0
movsd  0xeba(%rip),%xmm1
subsd  %xmm0,%xmm1
movsd  0xe9e(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xec2(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xea9(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <exp@plt>
cvtsi2sd %eax,%xmm1
movsd  0xe67(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  0xe76(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <exp@plt>
movsd  -0x78(%rbp),%xmm0
mov    %eax,%ecx
mov    $0x1,%eax
sub    %ecx,%eax
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe42(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xe11(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <exp@plt>
cvtsi2sd %eax,%xmm0
movsd  0xe0f(%rip),%xmm1
subsd  %xmm0,%xmm1
movsd  0xdf3(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xdef(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  0xdce(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <exp@plt>
cvtsi2sd %eax,%xmm1
movsd  0xdbc(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  0xda3(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <exp@plt>
movsd  -0x70(%rbp),%xmm0
mov    %eax,%ecx
mov    $0x1,%eax
sub    %ecx,%eax
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd6f(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  0xd56(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm2
addsd  -0x40(%rbp),%xmm2
movsd  0xd27(%rip),%xmm1
mulsd  -0x8(%rbp),%xmm1
movsd  -0x48(%rbp),%xmm3
addsd  -0x50(%rbp),%xmm3
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  0xd14(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xcf5(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
movsd  0xce0(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <exp@plt>
mov    %eax,%ecx
mov    $0x1,%eax
sub    %ecx,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  0xc96(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xc77(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
movsd  0xc6a(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <exp@plt>
movsd  -0x68(%rbp),%xmm1
movsd  -0x60(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm2
mov    %eax,%ecx
mov    $0x1,%eax
sub    %ecx,%eax
cvtsi2sd %eax,%xmm3
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<icerad>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x38,%rsp
mov    %rdx,%r14
mov    %rsi,%r15
movapd %xmm2,0x20(%rsp)
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x18(%rsp)
movapd %xmm1,%xmm0
mulsd  0xec2(%rip),%xmm0
movsd  0xec2(%rip),%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
divsd  0xeba(%rip),%xmm1
movsd  %xmm1,(%rdi)
movsd  0xeb6(%rip),%xmm0
mulsd  %xmm2,%xmm0
cvttsd2si %xmm0,%ebp
mov    %ebp,%edi
call   1030 <exp@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0xea0(%rip),%xmm1
subsd  %xmm0,%xmm1
divsd  0xe9c(%rip),%xmm1
movsd  %xmm1,0x8(%rsp)
mov    %ebp,%edi
call   1030 <exp@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,(%rsp)
movsd  0xe83(%rip),%xmm0
mulsd  0x10(%rsp),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <exp@plt>
mov    $0x1,%ebx
mov    $0x1,%ecx
sub    %eax,%ecx
xorps  %xmm0,%xmm0
cvtsi2sd %ecx,%xmm0
mulsd  (%rsp),%xmm0
divsd  0xe5c(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,(%rsp)
movapd 0x20(%rsp),%xmm0
mulsd  0xe4b(%rip),%xmm0
cvttsd2si %xmm0,%ebp
mov    %ebp,%edi
call   1030 <exp@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0xe11(%rip),%xmm1
subsd  %xmm0,%xmm1
divsd  0xe2d(%rip),%xmm1
movsd  %xmm1,0x8(%rsp)
mov    %ebp,%edi
call   1030 <exp@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x30(%rsp)
movsd  0xe03(%rip),%xmm0
mulsd  0x10(%rsp),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <exp@plt>
mov    $0x1,%ecx
sub    %eax,%ecx
xorps  %xmm0,%xmm0
cvtsi2sd %ecx,%xmm0
mulsd  0x30(%rsp),%xmm0
divsd  0xde8(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
movsd  0xd8a(%rip),%xmm1
movsd  0x18(%rsp),%xmm2
mulsd  %xmm2,%xmm1
movsd  %xmm1,0x8(%rsp)
mulsd  0xdca(%rip),%xmm2
movsd  %xmm2,0x18(%rsp)
mulsd  %xmm2,%xmm0
movsd  (%rsp),%xmm2
mulsd  %xmm1,%xmm2
addsd  %xmm0,%xmm2
movsd  %xmm2,(%r15)
movsd  0xdae(%rip),%xmm0
mulsd  0x10(%rsp),%xmm0
movsd  0xda8(%rip),%xmm1
mulsd  0x20(%rsp),%xmm1
addsd  %xmm0,%xmm1
xorpd  0xdae(%rip),%xmm1
cvttsd2si %xmm1,%edi
call   1030 <exp@plt>
mov    $0x1,%ecx
sub    %eax,%ecx
xorps  %xmm0,%xmm0
cvtsi2sd %ecx,%xmm0
movsd  %xmm0,(%rsp)
movsd  0xd7a(%rip),%xmm0
movsd  0x10(%rsp),%xmm2
mulsd  %xmm0,%xmm2
movapd 0x20(%rsp),%xmm1
mulsd  %xmm0,%xmm1
addsd  %xmm2,%xmm1
xorpd  0xd6a(%rip),%xmm1
cvttsd2si %xmm1,%edi
call   1030 <exp@plt>
sub    %eax,%ebx
xorps  %xmm0,%xmm0
cvtsi2sd %ebx,%xmm0
mulsd  0x18(%rsp),%xmm0
movsd  (%rsp),%xmm1
mulsd  0x8(%rsp),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,(%r14)
add    $0x38,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @icerad(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
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
%17 = load double, double* %9
%18 = load double, double* %8
%19 = fmul double %18, 0x3FE6666666666666
%20 = call double @llvm.fmuladd.f64(double %17, double 2.300000e+00, double %19)
%21 = fdiv double %20, 0x3FF9C28F5C28F5C2
%22 = load double*, double** %10
store double %21, double* %22
%23 = load double, double* %9
%24 = fmul double -6.000000e+00, %23
%25 = fptosi double %24 to i32
%26 = call i32 @exp(i32 %25)
%27 = sitofp i32 %26 to double
%28 = fsub double 1.000000e+00, %27
%29 = fmul double -1.000000e+00, %28
%30 = fdiv double %29, 0x4010CCCCCCCCCCCC
store double %30, double* %13
%31 = load double, double* %9
%32 = fmul double -6.000000e+00, %31
%33 = fptosi double %32 to i32
%34 = call i32 @exp(i32 %33)
%35 = sitofp i32 %34 to double
%36 = fmul double -1.000000e+00, %35
%37 = load double, double* %8
%38 = fmul double -1.500000e+00, %37
%39 = fptosi double %38 to i32
%40 = call i32 @exp(i32 %39)
%41 = sub nsw i32 1, %40
%42 = sitofp i32 %41 to double
%43 = fmul double %36, %42
%44 = fdiv double %43, 0x400B999999999999
store double %44, double* %14
%45 = load double, double* %9
%46 = fmul double -2.000000e+01, %45
%47 = fptosi double %46 to i32
%48 = call i32 @exp(i32 %47)
%49 = sitofp i32 %48 to double
%50 = fsub double 1.000000e+00, %49
%51 = fmul double -1.000000e+00, %50
%52 = fdiv double %51, 1.400000e+01
store double %52, double* %15
%53 = load double, double* %9
%54 = fmul double -2.000000e+01, %53
%55 = fptosi double %54 to i32
%56 = call i32 @exp(i32 %55)
%57 = sitofp i32 %56 to double
%58 = fmul double -1.000000e+00, %57
%59 = load double, double* %8
%60 = fmul double -2.000000e+01, %59
%61 = fptosi double %60 to i32
%62 = call i32 @exp(i32 %61)
%63 = sub nsw i32 1, %62
%64 = sitofp i32 %63 to double
%65 = fmul double %58, %64
%66 = fdiv double %65, 4.600000e+01
store double %66, double* %16
%67 = load double, double* %7
%68 = fmul double %67, 0x3FE6666666666666
%69 = load double, double* %13
%70 = load double, double* %14
%71 = fadd double %69, %70
%72 = load double, double* %7
%73 = fmul double %72, 3.000000e-01
%74 = load double, double* %15
%75 = load double, double* %16
%76 = fadd double %74, %75
%77 = fmul double %73, %76
%78 = call double @llvm.fmuladd.f64(double %68, double %71, double %77)
%79 = load double*, double** %11
store double %78, double* %79
%80 = load double, double* %7
%81 = fmul double 0x3FE6666666666666, %80
%82 = load double, double* %9
%83 = load double, double* %8
%84 = fmul double 1.500000e+00, %83
%85 = call double @llvm.fmuladd.f64(double 6.000000e+00, double %82, double %84)
%86 = fneg double %85
%87 = fptosi double %86 to i32
%88 = call i32 @exp(i32 %87)
%89 = sub nsw i32 1, %88
%90 = sitofp i32 %89 to double
%91 = load double, double* %7
%92 = fmul double 3.000000e-01, %91
%93 = load double, double* %9
%94 = load double, double* %8
%95 = fmul double 2.000000e+01, %94
%96 = call double @llvm.fmuladd.f64(double 2.000000e+01, double %93, double %95)
%97 = fneg double %96
%98 = fptosi double %97 to i32
%99 = call i32 @exp(i32 %98)
%100 = sub nsw i32 1, %99
%101 = sitofp i32 %100 to double
%102 = fmul double %92, %101
%103 = call double @llvm.fmuladd.f64(double %81, double %90, double %102)
%104 = load double*, double** %12
store double %103, double* %104
ret void
}

LLVM IR (-O2):
define void @icerad(double %0, double %1, double %2, double* nocapture writeonly %3, double* nocapture writeonly %4, double* nocapture writeonly %5) {
%7 = fmul double %1, 0x3FE6666666666666
%8 = tail call double @llvm.fmuladd.f64(double %2, double 2.300000e+00, double %7)
%9 = fdiv double %8, 0x3FF9C28F5C28F5C2
store double %9, double* %3
%10 = fmul double %2, -6.000000e+00
%11 = fptosi double %10 to i32
%12 = tail call i32 @exp(i32 %11)
%13 = sitofp i32 %12 to double
%14 = fsub double 1.000000e+00, %13
%15 = fdiv double %14, 0x4010CCCCCCCCCCCC
%16 = tail call i32 @exp(i32 %11)
%17 = sitofp i32 %16 to double
%18 = fneg double %17
%19 = fmul double %1, -1.500000e+00
%20 = fptosi double %19 to i32
%21 = tail call i32 @exp(i32 %20)
%22 = sub nsw i32 1, %21
%23 = sitofp i32 %22 to double
%24 = fmul double %18, %23
%25 = fdiv double %24, 0x400B999999999999
%26 = fmul double %2, -2.000000e+01
%27 = fptosi double %26 to i32
%28 = tail call i32 @exp(i32 %27)
%29 = sitofp i32 %28 to double
%30 = fsub double 1.000000e+00, %29
%31 = fdiv double %30, 1.400000e+01
%32 = tail call i32 @exp(i32 %27)
%33 = sitofp i32 %32 to double
%34 = fneg double %33
%35 = fmul double %1, -2.000000e+01
%36 = fptosi double %35 to i32
%37 = tail call i32 @exp(i32 %36)
%38 = sub nsw i32 1, %37
%39 = sitofp i32 %38 to double
%40 = fmul double %34, %39
%41 = fdiv double %40, 4.600000e+01
%42 = fmul double %0, 0x3FE6666666666666
%43 = fsub double %25, %15
%44 = fmul double %0, 3.000000e-01
%45 = fsub double %41, %31
%46 = fmul double %44, %45
%47 = tail call double @llvm.fmuladd.f64(double %42, double %43, double %46)
store double %47, double* %4
%48 = fmul double %1, 1.500000e+00
%49 = tail call double @llvm.fmuladd.f64(double %2, double 6.000000e+00, double %48)
%50 = fneg double %49
%51 = fptosi double %50 to i32
%52 = tail call i32 @exp(i32 %51)
%53 = sub nsw i32 1, %52
%54 = sitofp i32 %53 to double
%55 = fmul double %1, 2.000000e+01
%56 = tail call double @llvm.fmuladd.f64(double %2, double 2.000000e+01, double %55)
%57 = fneg double %56
%58 = fptosi double %57 to i32
%59 = tail call i32 @exp(i32 %58)
%60 = sub nsw i32 1, %59
%61 = sitofp i32 %60 to double
%62 = fmul double %44, %61
%63 = tail call double @llvm.fmuladd.f64(double %42, double %54, double %62)
store double %63, double* %5
ret void
}