#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 fabs(double);
int pow(double, double);
double ue_n2(double x) {
  double ax, x0, x1, x2, x3, x4, x5, x6, val;
  ax = 0.395 * fabs(x);
  x0 = 0.0;
  x1 = 0.003901;
  x2 = 0.01757;
  x3 = 0.03901;
  x4 = 0.09753;
  x5 = 0.7806;
  x6 = 22.08;
  if (ax <= x1)
    val = 46000 * (ax / 0.003901);
  else if (ax <= x2)
    val = 46000 * pow((ax / x1), 0.9);
  else if (ax <= x3)
    val = 171000 * pow((ax / x2), 0.6);
  else if (ax <= x4)
    val = 255000 * pow((ax / x3), 0.23);
  else if (ax <= x5)
    val = 309000 + 550000 * (ax - x4);
  else if (ax <= x6)
    val = 670000 * pow((ax / x5), 0.73);
  else
    val = 670000 * pow((x6 / x5), 0.73);
  return val;
}


x86 assembly (clang, -O0):
<ue_n2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm1
movaps 0xf47(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0xefb(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xeda(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xec5(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xeb0(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xe9b(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xe86(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xe71(%rip),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     11cf <ue_n2+0xbf>
movsd  -0x10(%rbp),%xmm1
movsd  0xe73(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xea7(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
jmp    134a <ue_n2+0x23a>
movsd  -0x10(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     120e <ue_n2+0xfe>
movsd  -0x10(%rbp),%xmm0
divsd  -0x20(%rbp),%xmm0
movsd  0xe6b(%rip),%xmm1
call   1030 <pow@plt>
imul   $0xb3b0,%eax,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x50(%rbp)
jmp    1345 <ue_n2+0x235>
movsd  -0x10(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     124d <ue_n2+0x13d>
movsd  -0x10(%rbp),%xmm0
divsd  -0x28(%rbp),%xmm0
movsd  0xe24(%rip),%xmm1
call   1030 <pow@plt>
imul   $0x29bf8,%eax,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x50(%rbp)
jmp    1340 <ue_n2+0x230>
movsd  -0x10(%rbp),%xmm1
movsd  -0x38(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     128c <ue_n2+0x17c>
movsd  -0x10(%rbp),%xmm0
divsd  -0x30(%rbp),%xmm0
movsd  0xddd(%rip),%xmm1
call   1030 <pow@plt>
imul   $0x3e418,%eax,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x50(%rbp)
jmp    133b <ue_n2+0x22b>
movsd  -0x10(%rbp),%xmm1
movsd  -0x40(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     12cc <ue_n2+0x1bc>
movsd  -0x10(%rbp),%xmm0
subsd  -0x38(%rbp),%xmm0
movsd  0xd8e(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd8a(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
jmp    1336 <ue_n2+0x226>
movsd  -0x10(%rbp),%xmm1
movsd  -0x48(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     130b <ue_n2+0x1fb>
movsd  -0x10(%rbp),%xmm0
divsd  -0x40(%rbp),%xmm0
movsd  0xd46(%rip),%xmm1
call   1030 <pow@plt>
imul   $0xa3930,%eax,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x50(%rbp)
jmp    1331 <ue_n2+0x221>
movsd  -0x48(%rbp),%xmm0
divsd  -0x40(%rbp),%xmm0
movsd  0xd1b(%rip),%xmm1
call   1030 <pow@plt>
imul   $0xa3930,%eax,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x50(%rbp)
jmp    1336 <ue_n2+0x226>
jmp    133b <ue_n2+0x22b>
jmp    1340 <ue_n2+0x230>
jmp    1345 <ue_n2+0x235>
jmp    134a <ue_n2+0x23a>
movsd  -0x50(%rbp),%xmm0
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ue_n2>:
push   %rax
andpd  0xee7(%rip),%xmm0
mulsd  0xeef(%rip),%xmm0
movsd  0xeef(%rip),%xmm1
ucomisd %xmm0,%xmm1
jae    118a <ue_n2+0x7a>
movsd  0xef1(%rip),%xmm1
ucomisd %xmm0,%xmm1
jae    119c <ue_n2+0x8c>
movsd  0xef3(%rip),%xmm1
ucomisd %xmm0,%xmm1
jae    11b9 <ue_n2+0xa9>
movsd  0xef5(%rip),%xmm1
ucomisd %xmm0,%xmm1
jae    11d6 <ue_n2+0xc6>
movsd  0xef7(%rip),%xmm1
ucomisd %xmm0,%xmm1
jae    11f3 <ue_n2+0xe3>
movsd  0xf05(%rip),%xmm1
ucomisd %xmm0,%xmm1
jae    120d <ue_n2+0xfd>
movsd  0xf03(%rip),%xmm0
jmp    1215 <ue_n2+0x105>
divsd  0xe86(%rip),%xmm0
mulsd  0xe86(%rip),%xmm0
pop    %rax
ret
divsd  0xe74(%rip),%xmm0
movsd  0xe84(%rip),%xmm1
call   1030 <pow@plt>
imul   $0xb3b0,%eax,%eax
jmp    1228 <ue_n2+0x118>
divsd  0xe67(%rip),%xmm0
movsd  0xe77(%rip),%xmm1
call   1030 <pow@plt>
imul   $0x29bf8,%eax,%eax
jmp    1228 <ue_n2+0x118>
divsd  0xe5a(%rip),%xmm0
movsd  0xe6a(%rip),%xmm1
call   1030 <pow@plt>
imul   $0x3e418,%eax,%eax
jmp    1228 <ue_n2+0x118>
addsd  0xe65(%rip),%xmm0
mulsd  0xe65(%rip),%xmm0
addsd  0xe65(%rip),%xmm0
pop    %rax
ret
divsd  0xe43(%rip),%xmm0
movsd  0xe63(%rip),%xmm1
call   1030 <pow@plt>
imul   $0xa3930,%eax,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @ue_n2(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%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* %2
%12 = load double, double* %2
%13 = call double @llvm.fabs.f64(double %12)
%14 = fmul double 3.950000e-01, %13
store double %14, double* %3
store double 0.000000e+00, double* %4
store double 3.901000e-03, double* %5
store double 1.757000e-02, double* %6
store double 3.901000e-02, double* %7
store double 9.753000e-02, double* %8
store double 0x3FE8FAACD9E83E42, double* %9
store double 2.208000e+01, double* %10
%15 = load double, double* %3
%16 = load double, double* %5
%17 = fcmp ole double %15, %16
br i1 %17, label %18, label %22
18: ; preds = %1
%19 = load double, double* %3
%20 = fdiv double %19, 3.901000e-03
%21 = fmul double 4.600000e+04, %20
store double %21, double* %11
br label %87
22: ; preds = %1
%23 = load double, double* %3
%24 = load double, double* %6
%25 = fcmp ole double %23, %24
br i1 %25, label %26, label %33
26: ; preds = %22
%27 = load double, double* %3
%28 = load double, double* %5
%29 = fdiv double %27, %28
%30 = call i32 @pow(double %29, double 9.000000e-01)
%31 = mul nsw i32 46000, %30
%32 = sitofp i32 %31 to double
store double %32, double* %11
br label %86
33: ; preds = %22
%34 = load double, double* %3
%35 = load double, double* %7
%36 = fcmp ole double %34, %35
br i1 %36, label %37, label %44
37: ; preds = %33
%38 = load double, double* %3
%39 = load double, double* %6
%40 = fdiv double %38, %39
%41 = call i32 @pow(double %40, double 6.000000e-01)
%42 = mul nsw i32 171000, %41
%43 = sitofp i32 %42 to double
store double %43, double* %11
br label %85
44: ; preds = %33
%45 = load double, double* %3
%46 = load double, double* %8
%47 = fcmp ole double %45, %46
br i1 %47, label %48, label %55
48: ; preds = %44
%49 = load double, double* %3
%50 = load double, double* %7
%51 = fdiv double %49, %50
%52 = call i32 @pow(double %51, double 2.300000e-01)
%53 = mul nsw i32 255000, %52
%54 = sitofp i32 %53 to double
store double %54, double* %11
br label %84
55: ; preds = %44
%56 = load double, double* %3
%57 = load double, double* %9
%58 = fcmp ole double %56, %57
br i1 %58, label %59, label %64
59: ; preds = %55
%60 = load double, double* %3
%61 = load double, double* %8
%62 = fsub double %60, %61
%63 = call double @llvm.fmuladd.f64(double 5.500000e+05, double %62, double 3.090000e+05)
store double %63, double* %11
br label %83
64: ; preds = %55
%65 = load double, double* %3
%66 = load double, double* %10
%67 = fcmp ole double %65, %66
br i1 %67, label %68, label %75
68: ; preds = %64
%69 = load double, double* %3
%70 = load double, double* %9
%71 = fdiv double %69, %70
%72 = call i32 @pow(double %71, double 7.300000e-01)
%73 = mul nsw i32 670000, %72
%74 = sitofp i32 %73 to double
store double %74, double* %11
br label %82
75: ; preds = %64
%76 = load double, double* %10
%77 = load double, double* %9
%78 = fdiv double %76, %77
%79 = call i32 @pow(double %78, double 7.300000e-01)
%80 = mul nsw i32 670000, %79
%81 = sitofp i32 %80 to double
store double %81, double* %11
br label %82
82: ; preds = %75, %68
br label %83
83: ; preds = %82, %59
br label %84
84: ; preds = %83, %48
br label %85
85: ; preds = %84, %37
br label %86
86: ; preds = %85, %26
br label %87
87: ; preds = %86, %18
%88 = load double, double* %11
ret double %88
}

LLVM IR (-O2):
define double @ue_n2(double %0) {
%2 = tail call double @llvm.fabs.f64(double %0)
%3 = fmul double %2, 3.950000e-01
%4 = fcmp ugt double %3, 3.901000e-03
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = fdiv double %3, 3.901000e-03
%7 = fmul double %6, 4.600000e+04
br label %45
8: ; preds = %1
%9 = fcmp ugt double %3, 1.757000e-02
br i1 %9, label %15, label %10
10: ; preds = %8
%11 = fdiv double %3, 3.901000e-03
%12 = tail call i32 @pow(double %11, double 9.000000e-01)
%13 = mul nsw i32 %12, 46000
%14 = sitofp i32 %13 to double
br label %45
15: ; preds = %8
%16 = fcmp ugt double %3, 3.901000e-02
br i1 %16, label %22, label %17
17: ; preds = %15
%18 = fdiv double %3, 1.757000e-02
%19 = tail call i32 @pow(double %18, double 6.000000e-01)
%20 = mul nsw i32 %19, 171000
%21 = sitofp i32 %20 to double
br label %45
22: ; preds = %15
%23 = fcmp ugt double %3, 9.753000e-02
br i1 %23, label %29, label %24
24: ; preds = %22
%25 = fdiv double %3, 3.901000e-02
%26 = tail call i32 @pow(double %25, double 2.300000e-01)
%27 = mul nsw i32 %26, 255000
%28 = sitofp i32 %27 to double
br label %45
29: ; preds = %22
%30 = fcmp ugt double %3, 0x3FE8FAACD9E83E42
br i1 %30, label %34, label %31
31: ; preds = %29
%32 = fadd double %3, -9.753000e-02
%33 = tail call double @llvm.fmuladd.f64(double %32, double 5.500000e+05, double 3.090000e+05)
br label %45
34: ; preds = %29
%35 = fcmp ugt double %3, 2.208000e+01
br i1 %35, label %41, label %36
36: ; preds = %34
%37 = fdiv double %3, 0x3FE8FAACD9E83E42
%38 = tail call i32 @pow(double %37, double 7.300000e-01)
%39 = mul nsw i32 %38, 670000
%40 = sitofp i32 %39 to double
br label %45
41: ; preds = %34
%42 = tail call i32 @pow(double 0x403C4932F6C07157, double 7.300000e-01)
%43 = mul nsw i32 %42, 670000
%44 = sitofp i32 %43 to double
br label %45
45: ; preds = %10, %24, %36, %41, %31, %17, %5
%46 = phi double [ %7, %5 ], [ %14, %10 ], [ %21, %17 ], [ %28, %24 ], [ %33, %31 ], [ %40, %36 ], [ %44, %41 ]
ret double %46
}