; LLVM IR from Overload-Technologies/Overload :: Dependencies/soloud/src/filter/soloud_echofilter.ll (ZN6SoLoud10EchoFilter9setParamsEfff)

; 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"

%"class.SoLoud::EchoFilter" = type <{ %"class.SoLoud::Filter", float, float, float, [4 x i8] }>
%"class.SoLoud::Filter" = type { ptr }

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef i32 @_ZN6SoLoud10EchoFilter9setParamsEfff(ptr noundef nonnull align 8 dereferenceable(20) %0, float noundef %1, float noundef %2, float noundef %3) #0 align 2 {
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca float, align 4
  %8 = alloca float, align 4
  %9 = alloca float, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store float %1, ptr %7, align 4, !tbaa !9
  store float %2, ptr %8, align 4, !tbaa !9
  store float %3, ptr %9, align 4, !tbaa !9
  %10 = load ptr, ptr %6, align 8
  %11 = load float, ptr %7, align 4, !tbaa !9
  %12 = fcmp ole float %11, 0.000000e+00
  br i1 %12, label %22, label %13

13:                                               ; preds = %4
  %14 = load float, ptr %8, align 4, !tbaa !9
  %15 = fcmp ole float %14, 0.000000e+00
  br i1 %15, label %22, label %16

16:                                               ; preds = %13
  %17 = load float, ptr %9, align 4, !tbaa !9
  %18 = fcmp olt float %17, 0.000000e+00
  br i1 %18, label %22, label %19

19:                                               ; preds = %16
  %20 = load float, ptr %9, align 4, !tbaa !9
  %21 = fcmp oge float %20, 1.000000e+00
  br i1 %21, label %22, label %23

22:                                               ; preds = %19, %16, %13, %4
  store i32 1, ptr %5, align 4
  br label %30

23:                                               ; preds = %19
  %24 = load float, ptr %8, align 4, !tbaa !9
  %25 = getelementptr inbounds %"class.SoLoud::EchoFilter", ptr %10, i32 0, i32 2
  store float %24, ptr %25, align 4, !tbaa !11
  %26 = load float, ptr %7, align 4, !tbaa !9
  %27 = getelementptr inbounds %"class.SoLoud::EchoFilter", ptr %10, i32 0, i32 1
  store float %26, ptr %27, align 8, !tbaa !14
  %28 = load float, ptr %9, align 4, !tbaa !9
  %29 = getelementptr inbounds %"class.SoLoud::EchoFilter", ptr %10, i32 0, i32 3
  store float %28, ptr %29, align 8, !tbaa !15
  store i32 0, ptr %5, align 4
  br label %30

30:                                               ; preds = %23, %22
  %31 = load i32, ptr %5, align 4
  ret i32 %31
}

attributes #0 = { 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" }

!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}
!11 = !{!12, !10, i64 12}
!12 = !{!"_ZTSN6SoLoud10EchoFilterE", !13, i64 0, !10, i64 8, !10, i64 12, !10, i64 16}
!13 = !{!"_ZTSN6SoLoud6FilterE"}
!14 = !{!12, !10, i64 8}
!15 = !{!12, !10, i64 16}


; 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 norecurse nosync nounwind willreturn memory(argmem: write) uwtable
define dso_local noundef range(i32 0, 2) i32 @_ZN6SoLoud10EchoFilter9setParamsEfff(ptr nocapture noundef nonnull writeonly align 8 dereferenceable(20) %0, float noundef %1, float noundef %2, float noundef %3) local_unnamed_addr #0 align 2 {
  %5 = fcmp ole float %1, 0.000000e+00
  %6 = fcmp ole float %2, 0.000000e+00
  %or.cond = or i1 %5, %6
  %7 = fcmp olt float %3, 0.000000e+00
  %or.cond3 = or i1 %or.cond, %7
  %8 = fcmp oge float %3, 1.000000e+00
  %or.cond5 = or i1 %8, %or.cond3
  br i1 %or.cond5, label %13, label %9

9:                                                ; preds = %4
  %10 = getelementptr inbounds i8, ptr %0, i64 12
  store float %2, ptr %10, align 4, !tbaa !5
  %11 = getelementptr inbounds i8, ptr %0, i64 8
  store float %1, ptr %11, align 8, !tbaa !11
  %12 = getelementptr inbounds i8, ptr %0, i64 16
  store float %3, ptr %12, align 8, !tbaa !12
  br label %13

13:                                               ; preds = %4, %9
  %.0 = phi i32 [ 0, %9 ], [ 1, %4 ]
  ret i32 %.0
}

attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: 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" }

!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, !8, i64 12}
!6 = !{!"_ZTSN6SoLoud10EchoFilterE", !7, i64 0, !8, i64 8, !8, i64 12, !8, i64 16}
!7 = !{!"_ZTSN6SoLoud6FilterE"}
!8 = !{!"float", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!6, !8, i64 8}
!12 = !{!6, !8, i64 16}


; Effective O3 passes: GlobalOptPass,IPSCCPPass,InstCombinePass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass