#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 log10(double);
double sqrt(double);
double sigma_pp_diff(double Pp) {
  double d[7] = {0.3522, 0.1530, 1.498, 2.0, 30.0, 3.155, 1.042};
  double e[2] = {5.922, 1.632};
  double x, sigma;
  x = log10(Pp);
  sigma = 0;
  if ((Pp >= 2.25) && (Pp < 3.2)) {
    sigma = sqrt((x - d[0]) / d[1]) * (d[2] + d[3] * log10(d[4] * (x - 0.25)) +
                                       x * x * (d[5] - d[6] * x));
  } else if ((Pp >= 3.2) && (Pp <= 100.0)) {
    sigma = d[2] + d[3] * log10(d[4] * (x - 0.25)) + x * x * (d[5] - d[6] * x);
  } else if (Pp > 100.0) {
    sigma = e[0] + e[1] * x;
  }
  return sigma;
}


x86 assembly (clang, -O0):
<sigma_pp_diff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movsd  %xmm0,-0x8(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xed5(%rip),%rsi
mov    $0x38,%edx
call   1030 <memcpy@plt>
mov    0xf04(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0xf01(%rip),%rax
mov    %rax,-0x48(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <log10@plt>
movsd  %xmm0,-0x58(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xe71(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     1260 <sigma_pp_diff+0x130>
movsd  0xe67(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1260 <sigma_pp_diff+0x130>
movsd  -0x58(%rbp),%xmm0
subsd  -0x40(%rbp),%xmm0
divsd  -0x38(%rbp),%xmm0
call   1050 <sqrt@plt>
movsd  %xmm0,-0x68(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm1
movsd  0xe2d(%rip),%xmm2
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
call   1040 <log10@plt>
movsd  -0x78(%rbp),%xmm2
movsd  -0x70(%rbp),%xmm1
movaps %xmm0,%xmm3
movsd  -0x68(%rbp),%xmm0
mulsd  %xmm3,%xmm2
addsd  %xmm1,%xmm2
movsd  -0x58(%rbp),%xmm1
mulsd  -0x58(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm4
movsd  -0x10(%rbp),%xmm3
movsd  -0x58(%rbp),%xmm5
movq   %xmm3,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm3
mulsd  %xmm5,%xmm3
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
jmp    135f <sigma_pp_diff+0x22f>
movsd  -0x8(%rbp),%xmm0
movsd  0xd9b(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     1322 <sigma_pp_diff+0x1f2>
movsd  0xd91(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jb     1322 <sigma_pp_diff+0x1f2>
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x20(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm1
movsd  0xd65(%rip),%xmm2
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
call   1040 <log10@plt>
movsd  -0x88(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0x80(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x58(%rbp),%xmm0
mulsd  -0x58(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm3
movsd  -0x10(%rbp),%xmm2
movsd  -0x58(%rbp),%xmm4
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
mulsd  %xmm4,%xmm2
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
jmp    135a <sigma_pp_diff+0x22a>
movsd  -0x8(%rbp),%xmm0
movsd  0xce1(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1355 <sigma_pp_diff+0x225>
movsd  -0x50(%rbp),%xmm1
movsd  -0x48(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
jmp    135a <sigma_pp_diff+0x22a>
jmp    135f <sigma_pp_diff+0x22f>
movsd  -0x60(%rbp),%xmm0
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigma_pp_diff>:
sub    $0x18,%rsp
movsd  %xmm0,0x10(%rsp)
call   1030 <log10@plt>
movsd  0x10(%rsp),%xmm1
movapd %xmm0,%xmm2
ucomisd 0xebf(%rip),%xmm1
jb     1182 <sigma_pp_diff+0x62>
movsd  0xebd(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1182 <sigma_pp_diff+0x62>
movsd  0xef7(%rip),%xmm0
addsd  %xmm2,%xmm0
divsd  0xef3(%rip),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
movsd  %xmm2,0x8(%rsp)
jb     1210 <sigma_pp_diff+0xf0>
sqrtsd %xmm0,%xmm0
jmp    121b <sigma_pp_diff+0xfb>
ucomisd 0xe7e(%rip),%xmm1
jb     11f0 <sigma_pp_diff+0xd0>
movsd  0xe7c(%rip),%xmm0
ucomisd %xmm1,%xmm0
jb     11f0 <sigma_pp_diff+0xd0>
movsd  0xe86(%rip),%xmm0
addsd  %xmm2,%xmm0
mulsd  0xe82(%rip),%xmm0
movsd  %xmm2,0x8(%rsp)
call   1030 <log10@plt>
addsd  %xmm0,%xmm0
addsd  0xe73(%rip),%xmm0
movsd  0x8(%rsp),%xmm2
movapd %xmm2,%xmm1
mulsd  %xmm2,%xmm1
mulsd  0xe65(%rip),%xmm2
addsd  0xe65(%rip),%xmm2
mulsd  %xmm1,%xmm2
addsd  %xmm2,%xmm0
add    $0x18,%rsp
ret
xorpd  %xmm0,%xmm0
ucomisd 0xe14(%rip),%xmm1
jbe    1276 <sigma_pp_diff+0x156>
mulsd  0xe12(%rip),%xmm2
addsd  0xe12(%rip),%xmm2
jmp    1272 <sigma_pp_diff+0x152>
call   1040 <sqrt@plt>
movsd  0x8(%rsp),%xmm2
movsd  %xmm0,0x10(%rsp)
movsd  0xdff(%rip),%xmm0
addsd  %xmm2,%xmm0
mulsd  0xdfb(%rip),%xmm0
call   1030 <log10@plt>
addsd  %xmm0,%xmm0
addsd  0xdf2(%rip),%xmm0
movsd  0x8(%rsp),%xmm2
movapd %xmm2,%xmm1
mulsd  0xde8(%rip),%xmm2
addsd  0xde8(%rip),%xmm2
mulsd  %xmm1,%xmm1
mulsd  %xmm1,%xmm2
addsd  %xmm0,%xmm2
mulsd  0x10(%rsp),%xmm2
movapd %xmm2,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.sigma_pp_diff.d = [7 x double] [double 3.522000e-01, double 1.530000e-01, double 1.498000e+00, double 2.000000e+00, double 3.000000e+01, double 3.155000e+00, double 1.042000e+00]
@__const.sigma_pp_diff.e = [2 x double] [double 5.922000e+00, double 1.632000e+00]
define double @sigma_pp_diff(double %0) {
%2 = alloca double
%3 = alloca [7 x double]
%4 = alloca [2 x double]
%5 = alloca double
%6 = alloca double
store double %0, double* %2
%7 = bitcast [7 x double]* %3 to i8*
%8 = bitcast [2 x double]* %4 to i8*
%9 = load double, double* %2
%10 = call double @log10(double %9)
store double %10, double* %5
store double 0.000000e+00, double* %6
%11 = load double, double* %2
%12 = fcmp oge double %11, 2.250000e+00
br i1 %12, label %13, label %48
13: ; preds = %1
%14 = load double, double* %2
%15 = fcmp olt double %14, 3.200000e+00
br i1 %15, label %16, label %48
16: ; preds = %13
%17 = load double, double* %5
%18 = getelementptr inbounds [7 x double], [7 x double]* %3, i64 0, i64 0
%19 = load double, double* %18
%20 = fsub double %17, %19
%21 = getelementptr inbounds [7 x double], [7 x double]* %3, i64 0, i64 1
%22 = load double, double* %21
%23 = fdiv double %20, %22
%24 = call double @sqrt(double %23)
%25 = getelementptr inbounds [7 x double], [7 x double]* %3, i64 0, i64 2
%26 = load double, double* %25
%27 = getelementptr inbounds [7 x double], [7 x double]* %3, i64 0, i64 3
%28 = load double, double* %27
%29 = getelementptr inbounds [7 x double], [7 x double]* %3, i64 0, i64 4
%30 = load double, double* %29
%31 = load double, double* %5
%32 = fsub double %31, 2.500000e-01
%33 = fmul double %30, %32
%34 = call double @log10(double %33)
%35 = call double @llvm.fmuladd.f64(double %28, double %34, double %26)
%36 = load double, double* %5
%37 = load double, double* %5
%38 = fmul double %36, %37
%39 = getelementptr inbounds [7 x double], [7 x double]* %3, i64 0, i64 5
%40 = load double, double* %39
%41 = getelementptr inbounds [7 x double], [7 x double]* %3, i64 0, i64 6
%42 = load double, double* %41
%43 = load double, double* %5
%44 = fneg double %42
%45 = call double @llvm.fmuladd.f64(double %44, double %43, double %40)
%46 = call double @llvm.fmuladd.f64(double %38, double %45, double %35)
%47 = fmul double %24, %46
store double %47, double* %6
br label %89
48: ; preds = %13, %1
%49 = load double, double* %2
%50 = fcmp oge double %49, 3.200000e+00
br i1 %50, label %51, label %77
51: ; preds = %48
%52 = load double, double* %2
%53 = fcmp ole double %52, 1.000000e+02
br i1 %53, label %54, label %77
54: ; preds = %51
%55 = getelementptr inbounds [7 x double], [7 x double]* %3, i64 0, i64 2
%56 = load double, double* %55
%57 = getelementptr inbounds [7 x double], [7 x double]* %3, i64 0, i64 3
%58 = load double, double* %57
%59 = getelementptr inbounds [7 x double], [7 x double]* %3, i64 0, i64 4
%60 = load double, double* %59
%61 = load double, double* %5
%62 = fsub double %61, 2.500000e-01
%63 = fmul double %60, %62
%64 = call double @log10(double %63)
%65 = call double @llvm.fmuladd.f64(double %58, double %64, double %56)
%66 = load double, double* %5
%67 = load double, double* %5
%68 = fmul double %66, %67
%69 = getelementptr inbounds [7 x double], [7 x double]* %3, i64 0, i64 5
%70 = load double, double* %69
%71 = getelementptr inbounds [7 x double], [7 x double]* %3, i64 0, i64 6
%72 = load double, double* %71
%73 = load double, double* %5
%74 = fneg double %72
%75 = call double @llvm.fmuladd.f64(double %74, double %73, double %70)
%76 = call double @llvm.fmuladd.f64(double %68, double %75, double %65)
store double %76, double* %6
br label %88
77: ; preds = %51, %48
%78 = load double, double* %2
%79 = fcmp ogt double %78, 1.000000e+02
br i1 %79, label %80, label %87
80: ; preds = %77
%81 = getelementptr inbounds [2 x double], [2 x double]* %4, i64 0, i64 0
%82 = load double, double* %81
%83 = getelementptr inbounds [2 x double], [2 x double]* %4, i64 0, i64 1
%84 = load double, double* %83
%85 = load double, double* %5
%86 = call double @llvm.fmuladd.f64(double %84, double %85, double %82)
store double %86, double* %6
br label %87
87: ; preds = %80, %77
br label %88
88: ; preds = %87, %54
br label %89
89: ; preds = %88, %16
%90 = load double, double* %6
ret double %90
}

LLVM IR (-O2):
define double @sigma_pp_diff(double %0) {
%2 = tail call double @log10(double %0)
%3 = fcmp oge double %0, 2.250000e+00
%4 = fcmp olt double %0, 3.200000e+00
%5 = and i1 %3, %4
br i1 %5, label %6, label %18
6: ; preds = %1
%7 = fadd double %2, -3.522000e-01
%8 = fdiv double %7, 1.530000e-01
%9 = tail call double @sqrt(double %8)
%10 = fadd double %2, -2.500000e-01
%11 = fmul double %10, 3.000000e+01
%12 = tail call double @log10(double %11)
%13 = tail call double @llvm.fmuladd.f64(double %12, double 2.000000e+00, double 1.498000e+00)
%14 = fmul double %2, %2
%15 = tail call double @llvm.fmuladd.f64(double %2, double -1.042000e+00, double 3.155000e+00)
%16 = tail call double @llvm.fmuladd.f64(double %14, double %15, double %13)
%17 = fmul double %9, %16
br label %34
18: ; preds = %1
%19 = fcmp oge double %0, 3.200000e+00
%20 = fcmp ole double %0, 1.000000e+02
%21 = and i1 %19, %20
br i1 %21, label %22, label %30
22: ; preds = %18
%23 = fadd double %2, -2.500000e-01
%24 = fmul double %23, 3.000000e+01
%25 = tail call double @log10(double %24)
%26 = tail call double @llvm.fmuladd.f64(double %25, double 2.000000e+00, double 1.498000e+00)
%27 = fmul double %2, %2
%28 = tail call double @llvm.fmuladd.f64(double %2, double -1.042000e+00, double 3.155000e+00)
%29 = tail call double @llvm.fmuladd.f64(double %27, double %28, double %26)
br label %34
30: ; preds = %18
%31 = fcmp ogt double %0, 1.000000e+02
br i1 %31, label %32, label %34
32: ; preds = %30
%33 = tail call double @llvm.fmuladd.f64(double %2, double 1.632000e+00, double 5.922000e+00)
br label %34
34: ; preds = %22, %32, %30, %6
%35 = phi double [ %17, %6 ], [ %29, %22 ], [ %33, %32 ], [ 0.000000e+00, %30 ]
ret double %35
}