; LLVM IR from Overload-Technologies/Overload :: Dependencies/soloud/src/filter (soloud_duckfilter)

; 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::DuckFilter" = type { %"class.SoLoud::Filter", ptr, float, float, float, i32 }
%"class.SoLoud::Filter" = type { ptr }

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN6SoLoud10DuckFilter9setParamsEPNS_6SoloudEjfff(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef %1, i32 noundef %2, float noundef %3, float noundef %4, float noundef %5) #0 align 2 {
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca float, align 4
  %12 = alloca float, align 4
  %13 = alloca float, align 4
  store ptr %0, ptr %8, align 8, !tbaa !5
  store ptr %1, ptr %9, align 8, !tbaa !5
  store i32 %2, ptr %10, align 4, !tbaa !9
  store float %3, ptr %11, align 4, !tbaa !11
  store float %4, ptr %12, align 4, !tbaa !11
  store float %5, ptr %13, align 4, !tbaa !11
  %14 = load ptr, ptr %8, align 8
  %15 = load float, ptr %11, align 4, !tbaa !11
  %16 = fcmp olt float %15, 0.000000e+00
  br i1 %16, label %30, label %17

17:                                               ; preds = %6
  %18 = load float, ptr %12, align 4, !tbaa !11
  %19 = fcmp olt float %18, 0.000000e+00
  br i1 %19, label %30, label %20

20:                                               ; preds = %17
  %21 = load float, ptr %13, align 4, !tbaa !11
  %22 = fcmp olt float %21, 0.000000e+00
  br i1 %22, label %30, label %23

23:                                               ; preds = %20
  %24 = load ptr, ptr %9, align 8, !tbaa !5
  %25 = icmp eq ptr %24, null
  br i1 %25, label %30, label %26

26:                                               ; preds = %23
  %27 = load ptr, ptr %9, align 8, !tbaa !5
  %28 = load i32, ptr %10, align 4, !tbaa !9
  %29 = call noundef zeroext i1 @_ZN6SoLoud6Soloud18isValidVoiceHandleEj(ptr noundef nonnull align 8 dereferenceable(138833) %27, i32 noundef %28)
  br i1 %29, label %31, label %30

30:                                               ; preds = %26, %23, %20, %17, %6
  store i32 1, ptr %7, align 4
  br label %42

31:                                               ; preds = %26
  %32 = load i32, ptr %10, align 4, !tbaa !9
  %33 = getelementptr inbounds %"class.SoLoud::DuckFilter", ptr %14, i32 0, i32 5
  store i32 %32, ptr %33, align 4, !tbaa !13
  %34 = load float, ptr %11, align 4, !tbaa !11
  %35 = getelementptr inbounds %"class.SoLoud::DuckFilter", ptr %14, i32 0, i32 2
  store float %34, ptr %35, align 8, !tbaa !16
  %36 = load float, ptr %12, align 4, !tbaa !11
  %37 = getelementptr inbounds %"class.SoLoud::DuckFilter", ptr %14, i32 0, i32 3
  store float %36, ptr %37, align 4, !tbaa !17
  %38 = load float, ptr %13, align 4, !tbaa !11
  %39 = getelementptr inbounds %"class.SoLoud::DuckFilter", ptr %14, i32 0, i32 4
  store float %38, ptr %39, align 8, !tbaa !18
  %40 = load ptr, ptr %9, align 8, !tbaa !5
  %41 = getelementptr inbounds %"class.SoLoud::DuckFilter", ptr %14, i32 0, i32 1
  store ptr %40, ptr %41, align 8, !tbaa !19
  store i32 0, ptr %7, align 4
  br label %42

42:                                               ; preds = %31, %30
  %43 = load i32, ptr %7, align 4
  ret i32 %43
}

declare noundef zeroext i1 @_ZN6SoLoud6Soloud18isValidVoiceHandleEj(ptr noundef nonnull align 8 dereferenceable(138833), i32 noundef) #1

attributes #0 = { mustprogress 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 #1 = { "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 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = !{!14, !10, i64 28}
!14 = !{!"_ZTSN6SoLoud10DuckFilterE", !15, i64 0, !6, i64 8, !12, i64 16, !12, i64 20, !12, i64 24, !10, i64 28}
!15 = !{!"_ZTSN6SoLoud6FilterE"}
!16 = !{!14, !12, i64 16}
!17 = !{!14, !12, i64 20}
!18 = !{!14, !12, i64 24}
!19 = !{!14, !6, i64 8}


; 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 uwtable
define dso_local noundef range(i32 0, 2) i32 @_ZN6SoLoud10DuckFilter9setParamsEPNS_6SoloudEjfff(ptr nocapture noundef nonnull writeonly align 8 dereferenceable(32) %0, ptr noundef %1, i32 noundef %2, float noundef %3, float noundef %4, float noundef %5) local_unnamed_addr #0 align 2 {
  %7 = fcmp olt float %3, 0.000000e+00
  %8 = fcmp olt float %4, 0.000000e+00
  %or.cond = or i1 %7, %8
  %9 = fcmp olt float %5, 0.000000e+00
  %or.cond3 = or i1 %or.cond, %9
  %10 = icmp eq ptr %1, null
  %or.cond5 = or i1 %10, %or.cond3
  br i1 %or.cond5, label %19, label %11

11:                                               ; preds = %6
  %12 = tail call noundef zeroext i1 @_ZN6SoLoud6Soloud18isValidVoiceHandleEj(ptr noundef nonnull align 8 dereferenceable(138833) %1, i32 noundef %2)
  br i1 %12, label %13, label %19

13:                                               ; preds = %11
  %14 = getelementptr inbounds i8, ptr %0, i64 28
  store i32 %2, ptr %14, align 4, !tbaa !5
  %15 = getelementptr inbounds i8, ptr %0, i64 16
  store float %3, ptr %15, align 8, !tbaa !13
  %16 = getelementptr inbounds i8, ptr %0, i64 20
  store float %4, ptr %16, align 4, !tbaa !14
  %17 = getelementptr inbounds i8, ptr %0, i64 24
  store float %5, ptr %17, align 8, !tbaa !15
  %18 = getelementptr inbounds i8, ptr %0, i64 8
  store ptr %1, ptr %18, align 8, !tbaa !16
  br label %19

19:                                               ; preds = %6, %11, %13
  %.0 = phi i32 [ 0, %13 ], [ 1, %11 ], [ 1, %6 ]
  ret i32 %.0
}

declare noundef zeroext i1 @_ZN6SoLoud6Soloud18isValidVoiceHandleEj(ptr noundef nonnull align 8 dereferenceable(138833), i32 noundef) local_unnamed_addr #1

attributes #0 = { mustprogress 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 #1 = { "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, !12, i64 28}
!6 = !{!"_ZTSN6SoLoud10DuckFilterE", !7, i64 0, !8, i64 8, !11, i64 16, !11, i64 20, !11, i64 24, !12, i64 28}
!7 = !{!"_ZTSN6SoLoud6FilterE"}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"float", !9, i64 0}
!12 = !{!"int", !9, i64 0}
!13 = !{!6, !11, i64 16}
!14 = !{!6, !11, i64 20}
!15 = !{!6, !11, i64 24}
!16 = !{!6, !8, i64 8}


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