#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(double);
double log(double);
double pow(double, double);
void correct_precip(double *gauge_correction, double wind, double wind_h,
                    double roughness, double snow_roughness) {
  double gauge_wind;
  gauge_wind =
      wind * (log((1.0 + roughness) / roughness) / log(wind_h / roughness));
  gauge_correction[0] = 100. / exp(4.606 - 0.041 * pow(gauge_wind, 0.69));
  gauge_wind = wind * (log((1.0 + snow_roughness) / snow_roughness) /
                       log(wind_h / snow_roughness));
  gauge_correction[1] = 100. / exp(4.606 - 0.036 * pow(gauge_wind, 1.75));
}


x86 assembly (clang, -O0):
<correct_precip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  %xmm3,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  0xebe(%rip),%xmm0
addsd  -0x20(%rbp),%xmm0
divsd  -0x20(%rbp),%xmm0
call   1040 <log@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  -0x18(%rbp),%xmm0
divsd  -0x20(%rbp),%xmm0
call   1040 <log@plt>
movsd  -0x50(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x48(%rbp),%xmm0
divsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  0xe84(%rip),%xmm1
call   1050 <pow@plt>
movsd  0xe6f(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe4b(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1030 <exp@plt>
cvtsi2sd %eax,%xmm1
movsd  0xe26(%rip),%xmm0
divsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xe28(%rip),%xmm0
addsd  -0x28(%rbp),%xmm0
divsd  -0x28(%rbp),%xmm0
call   1040 <log@plt>
movsd  %xmm0,-0x40(%rbp)
movsd  -0x18(%rbp),%xmm0
divsd  -0x28(%rbp),%xmm0
call   1040 <log@plt>
movsd  -0x40(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x38(%rbp),%xmm0
divsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  0xdd6(%rip),%xmm1
call   1050 <pow@plt>
movsd  0xdb9(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xdb5(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1030 <exp@plt>
cvtsi2sd %eax,%xmm1
movsd  0xd90(%rip),%xmm0
divsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x8(%rax)
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<correct_precip>:
push   %rbx
sub    $0x30,%rsp
movsd  %xmm3,0x10(%rsp)
movsd  %xmm1,0x18(%rsp)
movsd  %xmm0,0x20(%rsp)
mov    %rdi,%rbx
movsd  %xmm2,0x28(%rsp)
movapd %xmm2,%xmm0
addsd  0xea4(%rip),%xmm0
divsd  %xmm2,%xmm0
call   1040 <log@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x18(%rsp),%xmm0
divsd  0x28(%rsp),%xmm0
call   1040 <log@plt>
movsd  0x8(%rsp),%xmm1
divsd  %xmm0,%xmm1
mulsd  0x20(%rsp),%xmm1
movapd %xmm1,%xmm0
movsd  0xe70(%rip),%xmm1
call   1050 <pow@plt>
mulsd  0xe6b(%rip),%xmm0
addsd  0xe6b(%rip),%xmm0
call   1030 <exp@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0xe5f(%rip),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,(%rbx)
movsd  0x10(%rsp),%xmm1
movsd  0xe29(%rip),%xmm0
addsd  %xmm1,%xmm0
divsd  %xmm1,%xmm0
call   1040 <log@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x18(%rsp),%xmm0
divsd  0x10(%rsp),%xmm0
call   1040 <log@plt>
movsd  0x8(%rsp),%xmm1
divsd  %xmm0,%xmm1
mulsd  0x20(%rsp),%xmm1
movapd %xmm1,%xmm0
movsd  0xe11(%rip),%xmm1
call   1050 <pow@plt>
mulsd  0xe0c(%rip),%xmm0
addsd  0xdec(%rip),%xmm0
call   1030 <exp@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0xde0(%rip),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rbx)
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @correct_precip(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
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
%12 = load double, double* %7
%13 = load double, double* %9
%14 = fadd double 1.000000e+00, %13
%15 = load double, double* %9
%16 = fdiv double %14, %15
%17 = call double @log(double %16)
%18 = load double, double* %8
%19 = load double, double* %9
%20 = fdiv double %18, %19
%21 = call double @log(double %20)
%22 = fdiv double %17, %21
%23 = fmul double %12, %22
store double %23, double* %11
%24 = load double, double* %11
%25 = call double @pow(double %24, double 6.900000e-01)
%26 = call double @llvm.fmuladd.f64(double -4.100000e-02, double %25, double 4.606000e+00)
%27 = call i32 @exp(double %26)
%28 = sitofp i32 %27 to double
%29 = fdiv double 1.000000e+02, %28
%30 = load double*, double** %6
%31 = getelementptr inbounds double, double* %30, i64 0
store double %29, double* %31
%32 = load double, double* %7
%33 = load double, double* %10
%34 = fadd double 1.000000e+00, %33
%35 = load double, double* %10
%36 = fdiv double %34, %35
%37 = call double @log(double %36)
%38 = load double, double* %8
%39 = load double, double* %10
%40 = fdiv double %38, %39
%41 = call double @log(double %40)
%42 = fdiv double %37, %41
%43 = fmul double %32, %42
store double %43, double* %11
%44 = load double, double* %11
%45 = call double @pow(double %44, double 1.750000e+00)
%46 = call double @llvm.fmuladd.f64(double -3.600000e-02, double %45, double 4.606000e+00)
%47 = call i32 @exp(double %46)
%48 = sitofp i32 %47 to double
%49 = fdiv double 1.000000e+02, %48
%50 = load double*, double** %6
%51 = getelementptr inbounds double, double* %50, i64 1
store double %49, double* %51
ret void
}

LLVM IR (-O2):
define void @correct_precip(double* nocapture writeonly %0, double %1, double %2, double %3, double %4) {
%6 = fadd double %3, 1.000000e+00
%7 = fdiv double %6, %3
%8 = tail call double @log(double %7)
%9 = fdiv double %2, %3
%10 = tail call double @log(double %9)
%11 = fdiv double %8, %10
%12 = fmul double %11, %1
%13 = tail call double @pow(double %12, double 6.900000e-01)
%14 = tail call double @llvm.fmuladd.f64(double %13, double -4.100000e-02, double 4.606000e+00)
%15 = tail call i32 @exp(double %14)
%16 = sitofp i32 %15 to double
%17 = fdiv double 1.000000e+02, %16
store double %17, double* %0
%18 = fadd double %4, 1.000000e+00
%19 = fdiv double %18, %4
%20 = tail call double @log(double %19)
%21 = fdiv double %2, %4
%22 = tail call double @log(double %21)
%23 = fdiv double %20, %22
%24 = fmul double %23, %1
%25 = tail call double @pow(double %24, double 1.750000e+00)
%26 = tail call double @llvm.fmuladd.f64(double %25, double -3.600000e-02, double 4.606000e+00)
%27 = tail call i32 @exp(double %26)
%28 = sitofp i32 %27 to double
%29 = fdiv double 1.000000e+02, %28
%30 = getelementptr inbounds double, double* %0, i64 1
store double %29, double* %30
ret void
}