; LLVM IR from modlfo/AudioEngine :: AudioEngine/JuceLibraryCode (juce_audio_processors)

; 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.juce::SparseSet" = type { %"class.juce::Array.96" }
%"class.juce::Array.96" = type { %"class.juce::ArrayAllocationBase.97", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.97" = type <{ %"class.juce::HeapBlock.98", i32, [4 x i8] }>
%"class.juce::HeapBlock.98" = type { ptr }
%"class.juce::PluginListComponent" = type { %"class.juce::Component.base", %"class.juce::FileDragAndDropTarget", %"class.juce::ChangeListener", %"class.juce::Button::Listener", ptr, ptr, %"class.juce::File", %"class.juce::TableListBox", %"class.juce::TextButton", ptr, %"class.juce::String", %"class.juce::String", i8, i32, %"class.juce::ScopedPointer.184", %"class.juce::ScopedPointer.185" }
%"class.juce::Component.base" = type <{ %"class.juce::MouseListener", %"class.juce::String", %"class.juce::String", ptr, %"class.juce::Rectangle", %"class.juce::ScopedPointer.63", %"class.juce::ScopedPointer.64", %"class.juce::Array.65", ptr, %"class.juce::MouseCursor", ptr, %"class.juce::ScopedPointer.70", %"class.juce::ScopedPointer.71", %"class.juce::ScopedPointer.72", %"class.juce::ListenerList", %"class.juce::NamedValueSet", %"class.juce::WeakReference<juce::Component>::Master", %union.anon, i8 }>
%"class.juce::MouseListener" = type { ptr }
%"class.juce::Rectangle" = type { %"class.juce::Point", i32, i32 }
%"class.juce::Point" = type { i32, i32 }
%"class.juce::ScopedPointer.63" = type { ptr }
%"class.juce::ScopedPointer.64" = type { ptr }
%"class.juce::Array.65" = type { %"class.juce::ArrayAllocationBase.66", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.66" = type <{ %"class.juce::HeapBlock.67", i32, [4 x i8] }>
%"class.juce::HeapBlock.67" = type { ptr }
%"class.juce::MouseCursor" = type { ptr }
%"class.juce::ScopedPointer.70" = type { ptr }
%"class.juce::ScopedPointer.71" = type { ptr }
%"class.juce::ScopedPointer.72" = type { ptr }
%"class.juce::ListenerList" = type { %"class.juce::Array.73" }
%"class.juce::Array.73" = type { %"class.juce::ArrayAllocationBase.74", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.74" = type <{ %"class.juce::HeapBlock.75", i32, [4 x i8] }>
%"class.juce::HeapBlock.75" = type { ptr }
%"class.juce::NamedValueSet" = type { %"class.juce::Array.78" }
%"class.juce::Array.78" = type { %"class.juce::ArrayAllocationBase.79", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.79" = type <{ %"class.juce::HeapBlock.80", i32, [4 x i8] }>
%"class.juce::HeapBlock.80" = type { ptr }
%"class.juce::WeakReference<juce::Component>::Master" = type { %"class.juce::ReferenceCountedObjectPtr" }
%"class.juce::ReferenceCountedObjectPtr" = type { ptr }
%union.anon = type { i32 }
%"class.juce::FileDragAndDropTarget" = type { ptr }
%"class.juce::ChangeListener" = type { ptr }
%"class.juce::Button::Listener" = type { ptr }
%"class.juce::File" = type { %"class.juce::String" }
%"class.juce::TableListBox" = type <{ %"class.juce::ListBox", %"class.juce::ListBoxModel", %"class.juce::TableHeaderComponent::Listener", ptr, ptr, i32, i8, [3 x i8] }>
%"class.juce::ListBox" = type { %"class.juce::Component.base", %"class.juce::SettableTooltipClient", ptr, %"class.juce::ScopedPointer.162", %"class.juce::ScopedPointer.163", %"class.juce::ScopedPointer.164", i32, i32, i32, i32, i32, i8, i8, i8, i8, %"class.juce::SparseSet" }
%"class.juce::SettableTooltipClient" = type { %"class.juce::TooltipClient", %"class.juce::String" }
%"class.juce::TooltipClient" = type { ptr }
%"class.juce::ScopedPointer.162" = type { ptr }
%"class.juce::ScopedPointer.163" = type { ptr }
%"class.juce::ScopedPointer.164" = type { ptr }
%"class.juce::ListBoxModel" = type { ptr }
%"class.juce::TableHeaderComponent::Listener" = type { ptr }
%"class.juce::TextButton" = type { %"class.juce::Button.base", i8 }
%"class.juce::Button.base" = type <{ %"class.juce::Component.base", [3 x i8], %"class.juce::SettableTooltipClient", %"class.juce::Array.165", %"class.juce::WeakReference", %"class.juce::String", %"class.juce::ListenerList.170", %"class.juce::ScopedPointer.176", i32, i32, ptr, i32, i32, i32, i32, i32, i32, i32, i32, %"class.juce::Value", i8, i8, i8, i8, i8, i8, i8 }>
%"class.juce::Array.165" = type { %"class.juce::ArrayAllocationBase.166", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.166" = type <{ %"class.juce::HeapBlock.167", i32, [4 x i8] }>
%"class.juce::HeapBlock.167" = type { ptr }
%"class.juce::WeakReference" = type { %"class.juce::ReferenceCountedObjectPtr" }
%"class.juce::ListenerList.170" = type { %"class.juce::Array.171" }
%"class.juce::Array.171" = type { %"class.juce::ArrayAllocationBase.172", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.172" = type <{ %"class.juce::HeapBlock.173", i32, [4 x i8] }>
%"class.juce::HeapBlock.173" = type { ptr }
%"class.juce::ScopedPointer.176" = type { ptr }
%"class.juce::Value" = type { %"class.juce::ReferenceCountedObjectPtr.177", %"class.juce::ListenerList.178" }
%"class.juce::ReferenceCountedObjectPtr.177" = type { ptr }
%"class.juce::ListenerList.178" = type { %"class.juce::Array.179" }
%"class.juce::Array.179" = type { %"class.juce::ArrayAllocationBase.180", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.180" = type <{ %"class.juce::HeapBlock.181", i32, [4 x i8] }>
%"class.juce::HeapBlock.181" = type { ptr }
%"class.juce::String" = type { %"class.juce::CharPointer_UTF8" }
%"class.juce::CharPointer_UTF8" = type { ptr }
%"class.juce::ScopedPointer.184" = type { ptr }
%"class.juce::ScopedPointer.185" = type { ptr }

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4juce19PluginListComponent21removeSelectedPluginsEv(ptr noundef nonnull align 8 dereferenceable(1008) %0) #1 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca %"class.juce::SparseSet", align 8
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %7 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr %3) #5
  %8 = getelementptr inbounds %"class.juce::PluginListComponent", ptr %7, i32 0, i32 7
  call void @_ZNK4juce7ListBox15getSelectedRowsEv(ptr dead_on_unwind writable sret(%"class.juce::SparseSet") align 8 %3, ptr noundef nonnull align 8 dereferenceable(296) %8)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  %9 = getelementptr inbounds %"class.juce::PluginListComponent", ptr %7, i32 0, i32 7
  %10 = invoke noundef i32 @_ZN4juce12TableListBox10getNumRowsEv(ptr noundef nonnull align 8 dereferenceable(333) %9)
          to label %11 unwind label %17

11:                                               ; preds = %1
  store i32 %10, ptr %4, align 4, !tbaa !9
  br label %12

12:                                               ; preds = %28, %11
  %13 = load i32, ptr %4, align 4, !tbaa !9
  %14 = add nsw i32 %13, -1
  store i32 %14, ptr %4, align 4, !tbaa !9
  %15 = icmp sge i32 %14, 0
  br i1 %15, label %21, label %16

16:                                               ; preds = %12
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  br label %29

17:                                               ; preds = %25, %21, %1
  %18 = landingpad { ptr, i32 }
          cleanup
  %19 = extractvalue { ptr, i32 } %18, 0
  store ptr %19, ptr %5, align 8
  %20 = extractvalue { ptr, i32 } %18, 1
  store i32 %20, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  call void @_ZN4juce9SparseSetIiED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #5
  br label %30

21:                                               ; preds = %12
  %22 = load i32, ptr %4, align 4, !tbaa !9
  %23 = invoke noundef zeroext i1 @_ZNK4juce9SparseSetIiE8containsEi(ptr noundef nonnull align 8 dereferenceable(24) %3, i32 noundef %22)
          to label %24 unwind label %17

24:                                               ; preds = %21
  br i1 %23, label %25, label %28

25:                                               ; preds = %24
  %26 = load i32, ptr %4, align 4, !tbaa !9
  invoke void @_ZN4juce19PluginListComponent16removePluginItemEi(ptr noundef nonnull align 8 dereferenceable(1008) %7, i32 noundef %26)
          to label %27 unwind label %17

27:                                               ; preds = %25
  br label %28

28:                                               ; preds = %27, %24
  br label %12, !llvm.loop !11

29:                                               ; preds = %16
  call void @_ZN4juce9SparseSetIiED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #5
  ret void

30:                                               ; preds = %17
  %31 = load ptr, ptr %5, align 8
  %32 = load i32, ptr %6, align 4
  %33 = insertvalue { ptr, i32 } poison, ptr %31, 0
  %34 = insertvalue { ptr, i32 } %33, i32 %32, 1
  resume { ptr, i32 } %34
}

declare void @_ZNK4juce7ListBox15getSelectedRowsEv(ptr dead_on_unwind writable sret(%"class.juce::SparseSet") align 8, ptr noundef nonnull align 8 dereferenceable(296)) #2

declare noundef i32 @_ZN4juce12TableListBox10getNumRowsEv(ptr noundef nonnull align 8 dereferenceable(333)) unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK4juce9SparseSetIiE8containsEi(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4juce19PluginListComponent16removePluginItemEi(ptr noundef nonnull align 8 dereferenceable(1008), i32 noundef) #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN4juce9SparseSetIiED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #4 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { "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 #3 = { 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 #4 = { inlinehint 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 #5 = { 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 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}


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

%"class.juce::SparseSet" = type { %"class.juce::Array.96" }
%"class.juce::Array.96" = type { %"class.juce::ArrayAllocationBase.97", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.97" = type <{ %"class.juce::HeapBlock.98", i32, [4 x i8] }>
%"class.juce::HeapBlock.98" = type { ptr }

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4juce19PluginListComponent21removeSelectedPluginsEv(ptr noundef nonnull align 8 dereferenceable(1008) %0) local_unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"class.juce::SparseSet", align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %2) #5
  %3 = getelementptr inbounds i8, ptr %0, i64 248
  call void @_ZNK4juce7ListBox15getSelectedRowsEv(ptr dead_on_unwind nonnull writable sret(%"class.juce::SparseSet") align 8 %2, ptr noundef nonnull align 8 dereferenceable(296) %3)
  %4 = invoke noundef i32 @_ZN4juce12TableListBox10getNumRowsEv(ptr noundef nonnull align 8 dereferenceable(333) %3)
          to label %.preheader unwind label %.loopexit.split-lp

.preheader:                                       ; preds = %1
  %5 = icmp sgt i32 %4, 0
  br i1 %5, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %10, %.preheader
  call void @_ZN4juce9SparseSetIiED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #5
  ret void

.loopexit:                                        ; preds = %9
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %6

.loopexit.split-lp:                               ; preds = %1
  %lpad.loopexit.split-lp = landingpad { ptr, i32 }
          cleanup
  br label %6

6:                                                ; preds = %.loopexit.split-lp, %.loopexit
  %lpad.phi = phi { ptr, i32 } [ %lpad.loopexit, %.loopexit ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ]
  call void @_ZN4juce9SparseSetIiED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #5
  resume { ptr, i32 } %lpad.phi

.lr.ph:                                           ; preds = %.preheader, %10
  %.in = phi i32 [ %7, %10 ], [ %4, %.preheader ]
  %7 = add nsw i32 %.in, -1
  %8 = call noundef zeroext i1 @_ZNK4juce9SparseSetIiE8containsEi(ptr noundef nonnull align 8 dereferenceable(24) %2, i32 noundef %7)
  br i1 %8, label %9, label %10

9:                                                ; preds = %.lr.ph
  invoke void @_ZN4juce19PluginListComponent16removePluginItemEi(ptr noundef nonnull align 8 dereferenceable(1008) %0, i32 noundef %7)
          to label %10 unwind label %.loopexit

10:                                               ; preds = %9, %.lr.ph
  %11 = icmp ugt i32 %.in, 1
  br i1 %11, label %.lr.ph, label %._crit_edge, !llvm.loop !5
}

declare void @_ZNK4juce7ListBox15getSelectedRowsEv(ptr dead_on_unwind writable sret(%"class.juce::SparseSet") align 8, ptr noundef nonnull align 8 dereferenceable(296)) local_unnamed_addr #2

declare noundef i32 @_ZN4juce12TableListBox10getNumRowsEv(ptr noundef nonnull align 8 dereferenceable(333)) unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK4juce9SparseSetIiE8containsEi(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4juce19PluginListComponent16removePluginItemEi(ptr noundef nonnull align 8 dereferenceable(1008), i32 noundef) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN4juce9SparseSetIiED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #4 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { "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 #3 = { 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 #4 = { inlinehint 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 #5 = { 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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass