#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 exp(double);
double pow(double, int);
double sqrt(double);
double sigma_pp_res(double Pp) {
  double g[5] = {0.0004257, 4.5, -7.0, 2.1, 503.5};
  double Ep, sigma;
  Ep = sqrt(Pp * Pp + 0.879844);
  sigma = 0;
  if ((Ep >= 1.6) && (Ep < 1.9)) {
    sigma = g[0] * pow(Ep, 14);
  } else if ((Ep >= 1.9) && (Ep < 2.3)) {
    sigma = g[1] * exp(-g[2] * (Ep - g[3]) * (Ep - g[3]));
  } else if ((Ep >= 2.3) && (Ep <= 20.0)) {
    sigma = g[4] * pow(Ep, -6);
  }
  return sigma;
}


x86 assembly (clang, -O0):
<sigma_pp_res>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movsd  %xmm0,-0x8(%rbp)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1030 <memset@plt>
movsd  0xecb(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xeb6(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xea1(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xe8c(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xe77(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe54(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1060 <sqrt@plt>
movsd  %xmm0,-0x38(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  0xe29(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     1223 <sigma_pp_res+0xe3>
movsd  0xe4f(%rip),%xmm0
ucomisd -0x38(%rbp),%xmm0
jbe    1223 <sigma_pp_res+0xe3>
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x38(%rbp),%xmm0
mov    $0xe,%edi
call   1050 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x48(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
jmp    1308 <sigma_pp_res+0x1c8>
movsd  -0x38(%rbp),%xmm0
movsd  0xe08(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     12aa <sigma_pp_res+0x16a>
movsd  0xdfe(%rip),%xmm0
ucomisd -0x38(%rbp),%xmm0
jbe    12aa <sigma_pp_res+0x16a>
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x20(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  -0x38(%rbp),%xmm1
subsd  -0x18(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  -0x38(%rbp),%xmm1
subsd  -0x18(%rbp),%xmm1
mulsd  %xmm1,%xmm0
call   1040 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x50(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
jmp    1303 <sigma_pp_res+0x1c3>
movsd  -0x38(%rbp),%xmm0
movsd  0xd89(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     12fe <sigma_pp_res+0x1be>
movsd  0xd7f(%rip),%xmm0
ucomisd -0x38(%rbp),%xmm0
jb     12fe <sigma_pp_res+0x1be>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x38(%rbp),%xmm0
mov    $0xfffffffa,%edi
call   1050 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x58(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
jmp    1303 <sigma_pp_res+0x1c3>
jmp    1308 <sigma_pp_res+0x1c8>
movsd  -0x40(%rbp),%xmm0
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigma_pp_res>:
push   %rax
mulsd  %xmm0,%xmm0
addsd  0xec3(%rip),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1157 <sigma_pp_res+0x27>
sqrtsd %xmm0,%xmm0
ucomisd 0xeb5(%rip),%xmm0
jae    1166 <sigma_pp_res+0x36>
jmp    118c <sigma_pp_res+0x5c>
call   1050 <sqrt@plt>
ucomisd 0xea4(%rip),%xmm0
jb     118c <sigma_pp_res+0x5c>
movsd  0xea2(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    118c <sigma_pp_res+0x5c>
mov    $0xe,%edi
call   1040 <pow@plt>
movapd %xmm0,%xmm1
mulsd  0xebe(%rip),%xmm1
jmp    1205 <sigma_pp_res+0xd5>
ucomisd 0xe7c(%rip),%xmm0
jb     11d3 <sigma_pp_res+0xa3>
movsd  0xe7a(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    11d3 <sigma_pp_res+0xa3>
addsd  0xe84(%rip),%xmm0
movsd  0xe84(%rip),%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1030 <exp@plt>
movapd %xmm0,%xmm1
mulsd  0xe6f(%rip),%xmm1
jmp    1205 <sigma_pp_res+0xd5>
ucomisd 0xe3d(%rip),%xmm0
xorpd  %xmm1,%xmm1
jb     1205 <sigma_pp_res+0xd5>
movsd  0xe37(%rip),%xmm2
ucomisd %xmm0,%xmm2
jb     1205 <sigma_pp_res+0xd5>
mov    $0xfffffffa,%edi
call   1040 <pow@plt>
movapd %xmm0,%xmm1
mulsd  0xe23(%rip),%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @sigma_pp_res(double %0) {
%2 = alloca double
%3 = alloca [5 x double]
%4 = alloca double
%5 = alloca double
store double %0, double* %2
%6 = bitcast [5 x double]* %3 to i8*
%7 = bitcast i8* %6 to [5 x double]*
%8 = getelementptr inbounds [5 x double], [5 x double]* %7, i32 0, i32 0
store double 4.257000e-04, double* %8
%9 = getelementptr inbounds [5 x double], [5 x double]* %7, i32 0, i32 1
store double 4.500000e+00, double* %9
%10 = getelementptr inbounds [5 x double], [5 x double]* %7, i32 0, i32 2
store double -7.000000e+00, double* %10
%11 = getelementptr inbounds [5 x double], [5 x double]* %7, i32 0, i32 3
store double 2.100000e+00, double* %11
%12 = getelementptr inbounds [5 x double], [5 x double]* %7, i32 0, i32 4
store double 5.035000e+02, double* %12
%13 = load double, double* %2
%14 = load double, double* %2
%15 = call double @llvm.fmuladd.f64(double %13, double %14, double 8.798440e-01)
%16 = call double @sqrt(double %15)
store double %16, double* %4
store double 0.000000e+00, double* %5
%17 = load double, double* %4
%18 = fcmp oge double %17, 1.600000e+00
br i1 %18, label %19, label %28
19: ; preds = %1
%20 = load double, double* %4
%21 = fcmp olt double %20, 1.900000e+00
br i1 %21, label %22, label %28
22: ; preds = %19
%23 = getelementptr inbounds [5 x double], [5 x double]* %3, i64 0, i64 0
%24 = load double, double* %23
%25 = load double, double* %4
%26 = call double @pow(double %25, i32 14)
%27 = fmul double %24, %26
store double %27, double* %5
br label %66
28: ; preds = %19, %1
%29 = load double, double* %4
%30 = fcmp oge double %29, 1.900000e+00
br i1 %30, label %31, label %52
31: ; preds = %28
%32 = load double, double* %4
%33 = fcmp olt double %32, 2.300000e+00
br i1 %33, label %34, label %52
34: ; preds = %31
%35 = getelementptr inbounds [5 x double], [5 x double]* %3, i64 0, i64 1
%36 = load double, double* %35
%37 = getelementptr inbounds [5 x double], [5 x double]* %3, i64 0, i64 2
%38 = load double, double* %37
%39 = fneg double %38
%40 = load double, double* %4
%41 = getelementptr inbounds [5 x double], [5 x double]* %3, i64 0, i64 3
%42 = load double, double* %41
%43 = fsub double %40, %42
%44 = fmul double %39, %43
%45 = load double, double* %4
%46 = getelementptr inbounds [5 x double], [5 x double]* %3, i64 0, i64 3
%47 = load double, double* %46
%48 = fsub double %45, %47
%49 = fmul double %44, %48
%50 = call double @exp(double %49)
%51 = fmul double %36, %50
store double %51, double* %5
br label %65
52: ; preds = %31, %28
%53 = load double, double* %4
%54 = fcmp oge double %53, 2.300000e+00
br i1 %54, label %55, label %64
55: ; preds = %52
%56 = load double, double* %4
%57 = fcmp ole double %56, 2.000000e+01
br i1 %57, label %58, label %64
58: ; preds = %55
%59 = getelementptr inbounds [5 x double], [5 x double]* %3, i64 0, i64 4
%60 = load double, double* %59
%61 = load double, double* %4
%62 = call double @pow(double %61, i32 -6)
%63 = fmul double %60, %62
store double %63, double* %5
br label %64
64: ; preds = %58, %55, %52
br label %65
65: ; preds = %64, %34
br label %66
66: ; preds = %65, %22
%67 = load double, double* %5
ret double %67
}

LLVM IR (-O2):
define double @sigma_pp_res(double %0) {
%2 = tail call double @llvm.fmuladd.f64(double %0, double %0, double 8.798440e-01)
%3 = tail call double @sqrt(double %2)
%4 = fcmp oge double %3, 1.600000e+00
%5 = fcmp olt double %3, 1.900000e+00
%6 = and i1 %4, %5
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = tail call double @pow(double %3, i32 14)
%9 = fmul double %8, 4.257000e-04
br label %27
10: ; preds = %1
%11 = fcmp oge double %3, 1.900000e+00
%12 = fcmp olt double %3, 2.300000e+00
%13 = and i1 %11, %12
br i1 %13, label %14, label %20
14: ; preds = %10
%15 = fadd double %3, -2.100000e+00
%16 = fmul double %15, 7.000000e+00
%17 = fmul double %15, %16
%18 = tail call double @exp(double %17)
%19 = fmul double %18, 4.500000e+00
br label %27
20: ; preds = %10
%21 = fcmp oge double %3, 2.300000e+00
%22 = fcmp ole double %3, 2.000000e+01
%23 = and i1 %21, %22
br i1 %23, label %24, label %27
24: ; preds = %20
%25 = tail call double @pow(double %3, i32 -6)
%26 = fmul double %25, 5.035000e+02
br label %27
27: ; preds = %14, %24, %20, %7
%28 = phi double [ %9, %7 ], [ %19, %14 ], [ %26, %24 ], [ 0.000000e+00, %20 ]
ret double %28
}