; LLVM IR from suxiaojack/sapDecoder :: src/equalizer.ll (ZN9Equalizer12EqzConvertdBEf)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

; Function Attrs: nounwind
declare float @powf(float noundef, float noundef) #0

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef float @_ZN9Equalizer12EqzConvertdBEf(ptr noundef nonnull align 8 dereferenceable(8) %0, float noundef %1) #1 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca float, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store float %1, ptr %4, align 4, !tbaa !9
  %5 = load ptr, ptr %3, align 8
  %6 = load float, ptr %4, align 4, !tbaa !9
  %7 = fcmp olt float %6, -2.000000e+01
  br i1 %7, label %8, label %9

8:                                                ; preds = %2
  store float -2.000000e+01, ptr %4, align 4, !tbaa !9
  br label %14

9:                                                ; preds = %2
  %10 = load float, ptr %4, align 4, !tbaa !9
  %11 = fcmp ogt float %10, 2.000000e+01
  br i1 %11, label %12, label %13

12:                                               ; preds = %9
  store float 2.000000e+01, ptr %4, align 4, !tbaa !9
  br label %13

13:                                               ; preds = %12, %9
  br label %14

14:                                               ; preds = %13, %8
  %15 = load float, ptr %4, align 4, !tbaa !9
  %16 = fdiv float %15, 2.000000e+01
  %17 = call float @powf(float noundef 1.000000e+01, float noundef %16) #2
  %18 = fsub float %17, 1.000000e+00
  %19 = fmul float 2.500000e-01, %18
  ret float %19
}

attributes #0 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"float", !7, i64 0}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare float @powf(float noundef, float noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nofree nounwind willreturn memory(write) uwtable
define dso_local noundef float @_ZN9Equalizer12EqzConvertdBEf(ptr nocapture noundef nonnull readnone align 8 dereferenceable(8) %0, float noundef %1) local_unnamed_addr #1 align 2 {
  %3 = fcmp olt float %1, -2.000000e+01
  br i1 %3, label %7, label %4

4:                                                ; preds = %2
  %5 = fcmp ogt float %1, 2.000000e+01
  br i1 %5, label %6, label %7

6:                                                ; preds = %4
  br label %7

7:                                                ; preds = %2, %4, %6
  %.0 = phi float [ 2.000000e+01, %6 ], [ %1, %4 ], [ -2.000000e+01, %2 ]
  %8 = fdiv float %.0, 2.000000e+01
  %9 = tail call float @powf(float noundef 1.000000e+01, float noundef %8) #2
  %10 = fadd float %9, -1.000000e+00
  %11 = fmul float %10, 2.500000e-01
  ret float %11
}

attributes #0 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nofree nounwind willreturn memory(write) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}


; Effective O3 passes: GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass