#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 sqrt(double);
double get_prob(double Tair, double Age, double SurfaceLiquidWater,
                double U10) {
  double mean_u_occurence;
  double sigma_occurence;
  double prob_occurence;
  if (1) {
    if (SurfaceLiquidWater < 0.001) {
      mean_u_occurence =
          11.2 + 0.365 * Tair + 0.00706 * Tair * Tair + 0.9 * log(Age);
      sigma_occurence = 4.3 + 0.145 * Tair + 0.00196 * Tair * Tair;
      prob_occurence =
          1. / (1. + exp(sqrt(3.1415927) * (mean_u_occurence - U10) /
                         sigma_occurence));
    } else {
      mean_u_occurence = 21.;
      sigma_occurence = 7.;
      prob_occurence =
          1. / (1. + exp(sqrt(3.1415927) * (mean_u_occurence - U10) /
                         sigma_occurence));
    }
    if (prob_occurence < 0.0)
      prob_occurence = 0.0;
    if (prob_occurence > 1.0)
      prob_occurence = 1.0;
  } else
    prob_occurence = 1.;
  return prob_occurence;
}


x86 assembly (clang, -O0):
<get_prob>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  0xeac(%rip),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    1246 <get_prob+0x116>
movsd  -0x8(%rbp),%xmm1
movsd  0xee4(%rip),%xmm0
mulsd  %xmm0,%xmm1
movsd  0xee0(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  0xec4(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <log@plt>
movsd  -0x40(%rbp),%xmm1
movsd  0xe8e(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  0xe64(%rip),%xmm0
mulsd  %xmm0,%xmm1
movsd  0xe60(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  0xe44(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xe0d(%rip),%xmm0
call   1050 <sqrt@plt>
movsd  -0x28(%rbp),%xmm1
subsd  -0x20(%rbp),%xmm1
mulsd  %xmm1,%xmm0
divsd  -0x30(%rbp),%xmm0
call   1030 <exp@plt>
cvtsi2sd %eax,%xmm0
movsd  0xddc(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  0xdd0(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
jmp    12a6 <get_prob+0x176>
movsd  0xdd2(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xdbd(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xda8(%rip),%xmm0
call   1050 <sqrt@plt>
movsd  -0x28(%rbp),%xmm1
subsd  -0x20(%rbp),%xmm1
mulsd  %xmm1,%xmm0
divsd  -0x30(%rbp),%xmm0
call   1030 <exp@plt>
cvtsi2sd %eax,%xmm0
movsd  0xd77(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  0xd6b(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x38(%rbp),%xmm0
jbe    12bc <get_prob+0x18c>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  0xd3f(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    12e0 <get_prob+0x1b0>
movsd  0xd2d(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_prob>:
sub    $0x48,%rsp
movapd %xmm0,%xmm4
movsd  0xf10(%rip),%xmm0
ucomisd %xmm2,%xmm0
jbe    11de <get_prob+0xbe>
movsd  0xf06(%rip),%xmm0
mulsd  %xmm4,%xmm0
addsd  0xf02(%rip),%xmm0
movapd %xmm0,0x30(%rsp)
movsd  0xefc(%rip),%xmm0
mulsd  %xmm4,%xmm0
movapd %xmm0,0x20(%rsp)
movapd %xmm1,%xmm0
movsd  %xmm3,0x8(%rsp)
movapd %xmm4,0x10(%rsp)
call   1040 <log@plt>
movsd  0x8(%rsp),%xmm3
movapd 0x10(%rsp),%xmm2
movapd 0x20(%rsp),%xmm5
unpcklpd %xmm2,%xmm5
movapd 0xe77(%rip),%xmm1
movsd  %xmm2,%xmm1
movapd %xmm2,%xmm4
mulpd  %xmm5,%xmm1
movapd 0x30(%rsp),%xmm2
shufpd $0x2,0xe6c(%rip),%xmm2
addpd  %xmm1,%xmm2
movsd  0xea0(%rip),%xmm1
mulsd  %xmm4,%xmm1
unpcklpd %xmm1,%xmm0
movapd 0xe60(%rip),%xmm1
unpcklpd %xmm4,%xmm1
mulpd  %xmm0,%xmm1
addpd  %xmm2,%xmm1
jmp    11e6 <get_prob+0xc6>
movapd 0xe1a(%rip),%xmm1
movapd %xmm1,%xmm0
subsd  %xmm3,%xmm0
mulsd  0xe72(%rip),%xmm0
unpckhpd %xmm1,%xmm1
divsd  %xmm1,%xmm0
call   1030 <exp@plt>
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
movsd  0xe5e(%rip),%xmm0
addsd  %xmm0,%xmm1
movapd %xmm0,%xmm2
divsd  %xmm1,%xmm2
xorpd  %xmm1,%xmm1
maxsd  %xmm2,%xmm1
minsd  %xmm1,%xmm0
add    $0x48,%rsp
ret

LLVM IR (-O0):
define double @get_prob(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%12 = load double, double* %7
%13 = fcmp olt double %12, 1.000000e-03
br i1 %13, label %14, label %41
14: ; preds = %4
%15 = load double, double* %5
%16 = call double @llvm.fmuladd.f64(double 3.650000e-01, double %15, double 1.120000e+01)
%17 = load double, double* %5
%18 = fmul double 7.060000e-03, %17
%19 = load double, double* %5
%20 = call double @llvm.fmuladd.f64(double %18, double %19, double %16)
%21 = load double, double* %6
%22 = call double @log(double %21)
%23 = call double @llvm.fmuladd.f64(double 9.000000e-01, double %22, double %20)
store double %23, double* %9
%24 = load double, double* %5
%25 = call double @llvm.fmuladd.f64(double 1.450000e-01, double %24, double 4.300000e+00)
%26 = load double, double* %5
%27 = fmul double 1.960000e-03, %26
%28 = load double, double* %5
%29 = call double @llvm.fmuladd.f64(double %27, double %28, double %25)
store double %29, double* %10
%30 = call double @sqrt(double 0x400921FB5A7ED197)
%31 = load double, double* %9
%32 = load double, double* %8
%33 = fsub double %31, %32
%34 = fmul double %30, %33
%35 = load double, double* %10
%36 = fdiv double %34, %35
%37 = call i32 @exp(double %36)
%38 = sitofp i32 %37 to double
%39 = fadd double 1.000000e+00, %38
%40 = fdiv double 1.000000e+00, %39
store double %40, double* %11
br label %53
41: ; preds = %4
store double 2.100000e+01, double* %9
store double 7.000000e+00, double* %10
%42 = call double @sqrt(double 0x400921FB5A7ED197)
%43 = load double, double* %9
%44 = load double, double* %8
%45 = fsub double %43, %44
%46 = fmul double %42, %45
%47 = load double, double* %10
%48 = fdiv double %46, %47
%49 = call i32 @exp(double %48)
%50 = sitofp i32 %49 to double
%51 = fadd double 1.000000e+00, %50
%52 = fdiv double 1.000000e+00, %51
store double %52, double* %11
br label %53
53: ; preds = %41, %14
%54 = load double, double* %11
%55 = fcmp olt double %54, 0.000000e+00
br i1 %55, label %56, label %57
56: ; preds = %53
store double 0.000000e+00, double* %11
br label %57
57: ; preds = %56, %53
%58 = load double, double* %11
%59 = fcmp ogt double %58, 1.000000e+00
br i1 %59, label %60, label %61
60: ; preds = %57
store double 1.000000e+00, double* %11
br label %61
61: ; preds = %60, %57
%62 = load double, double* %11
ret double %62
}

LLVM IR (-O2):
define double @get_prob(double %0, double %1, double %2, double %3) {
%5 = fcmp olt double %2, 1.000000e-03
br i1 %5, label %6, label %20
6: ; preds = %4
%7 = tail call double @llvm.fmuladd.f64(double %0, double 3.650000e-01, double 1.120000e+01)
%8 = fmul double %0, 7.060000e-03
%9 = tail call double @log(double %1)
%10 = insertelement <2 x double> poison, double %0, i64 1
%11 = insertelement <2 x double> %10, double %8, i64 0
%12 = insertelement <2 x double> <double poison, double 1.450000e-01>, double %0, i64 0
%13 = insertelement <2 x double> <double poison, double 4.300000e+00>, double %7, i64 0
%14 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %11, <2 x double> %12, <2 x double> %13)
%15 = fmul double %0, 1.960000e-03
%16 = insertelement <2 x double> poison, double %9, i64 0
%17 = insertelement <2 x double> %16, double %15, i64 1
%18 = insertelement <2 x double> <double 9.000000e-01, double poison>, double %0, i64 1
%19 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %17, <2 x double> %18, <2 x double> %14)
br label %20
20: ; preds = %4, %6
%21 = phi <2 x double> [ %19, %6 ], [ <double 2.100000e+01, double 7.000000e+00>, %4 ]
%22 = extractelement <2 x double> %21, i64 0
%23 = fsub double %22, %3
%24 = fmul double %23, 0x3FFC5BF895389DAE
%25 = extractelement <2 x double> %21, i64 1
%26 = fdiv double %24, %25
%27 = tail call i32 @exp(double %26)
%28 = sitofp i32 %27 to double
%29 = fadd double %28, 1.000000e+00
%30 = fdiv double 1.000000e+00, %29
%31 = fcmp olt double %30, 0.000000e+00
%32 = select i1 %31, double 0.000000e+00, double %30
%33 = fcmp ogt double %32, 1.000000e+00
%34 = select i1 %33, double 1.000000e+00, double %32
ret double %34
}