#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 */
float fabs(float);
double powf(float, float);
float float_EffAdjFactor(float hNet, float hRated, float fExp) {
  float fEffAdj = 0.5 * powf(fabs(hNet - hRated) / hRated, fExp);
  fEffAdj = (((0.20) < (fEffAdj)) ? (0.20) : (fEffAdj));
  return (hNet < hRated) ? 1.0 - fEffAdj : 1.0 + fEffAdj;
}


x86 assembly (clang, -O0):
<float_EffAdjFactor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
call   1040 <fabs@plt>
divss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
call   1030 <powf@plt>
movaps %xmm0,%xmm1
movsd  0xea8(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe82(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    119a <float_EffAdjFactor+0x7a>
movsd  0xe70(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    11a8 <float_EffAdjFactor+0x88>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    11e8 <float_EffAdjFactor+0xc8>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe36(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    1202 <float_EffAdjFactor+0xe2>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe17(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<float_EffAdjFactor>:
push   %rax
movss  %xmm1,(%rsp)
movss  %xmm0,0x4(%rsp)
subss  %xmm1,%xmm0
andps  0xed9(%rip),%xmm0
divss  %xmm1,%xmm0
movaps %xmm2,%xmm1
call   1030 <powf@plt>
mulsd  0xee5(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
movss  (%rsp),%xmm0
ucomiss 0x4(%rsp),%xmm0
movsd  0xed0(%rip),%xmm2
cmpltsd %xmm1,%xmm2
movsd  0xecb(%rip),%xmm0
andpd  %xmm2,%xmm0
andnpd %xmm1,%xmm2
orpd   %xmm2,%xmm0
jbe    117b <float_EffAdjFactor+0x6b>
xorpd  0xe95(%rip),%xmm0
addsd  0xeb5(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @float_EffAdjFactor(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%8 = load float, float* %4
%9 = load float, float* %5
%10 = fsub float %8, %9
%11 = call float @fabs(float %10)
%12 = load float, float* %5
%13 = fdiv float %11, %12
%14 = load float, float* %6
%15 = call double @powf(float %13, float %14)
%16 = fmul double 5.000000e-01, %15
%17 = fptrunc double %16 to float
store float %17, float* %7
%18 = load float, float* %7
%19 = fpext float %18 to double
%20 = fcmp olt double 2.000000e-01, %19
br i1 %20, label %21, label %22
21: ; preds = %3
br label %25
22: ; preds = %3
%23 = load float, float* %7
%24 = fpext float %23 to double
br label %25
25: ; preds = %22, %21
%26 = phi double [ 2.000000e-01, %21 ], [ %24, %22 ]
%27 = fptrunc double %26 to float
store float %27, float* %7
%28 = load float, float* %4
%29 = load float, float* %5
%30 = fcmp olt float %28, %29
br i1 %30, label %31, label %35
31: ; preds = %25
%32 = load float, float* %7
%33 = fpext float %32 to double
%34 = fsub double 1.000000e+00, %33
br label %39
35: ; preds = %25
%36 = load float, float* %7
%37 = fpext float %36 to double
%38 = fadd double 1.000000e+00, %37
br label %39
39: ; preds = %35, %31
%40 = phi double [ %34, %31 ], [ %38, %35 ]
%41 = fptrunc double %40 to float
ret float %41
}

LLVM IR (-O2):
define float @float_EffAdjFactor(float %0, float %1, float %2) {
%4 = fsub float %0, %1
%5 = tail call float @llvm.fabs.f32(float %4)
%6 = fdiv float %5, %1
%7 = tail call double @powf(float %6, float %2)
%8 = fmul double %7, 5.000000e-01
%9 = fptrunc double %8 to float
%10 = fpext float %9 to double
%11 = fcmp ogt double %10, 2.000000e-01
%12 = fcmp olt float %0, %1
%13 = select i1 %11, double 0x3FC99999A0000000, double %10
%14 = fneg double %13
%15 = select i1 %12, double %14, double %13
%16 = fadd double %15, 1.000000e+00
%17 = fptrunc double %16 to float
ret float %17
}