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

; 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::ScopedPointer.96" = type { ptr }
%"class.juce::Component::SafePointer" = type { %"class.juce::WeakReference" }
%"class.juce::WeakReference" = type { %"class.juce::ReferenceCountedObjectPtr" }
%"class.juce::ReferenceCountedObjectPtr" = type { ptr }
%"class.juce::ModalComponentManager" = type { %"class.juce::AsyncUpdater", %"class.juce::DeletedAtShutdown", %"class.juce::OwnedArray.61" }
%"class.juce::AsyncUpdater" = type { ptr, %"class.juce::ReferenceCountedObjectPtr.15" }
%"class.juce::ReferenceCountedObjectPtr.15" = type { ptr }
%"class.juce::DeletedAtShutdown" = type { ptr }
%"class.juce::OwnedArray.61" = type { %"class.juce::ArrayAllocationBase.62", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.62" = type <{ %"class.juce::HeapBlock.63", i32, [4 x i8] }>
%"class.juce::HeapBlock.63" = type { ptr }
%"class.juce::ModalComponentManager::ModalItem" = type <{ %"class.juce::ComponentMovementWatcher.base", [4 x i8], ptr, %"class.juce::OwnedArray.90", i32, i8, i8, [2 x i8] }>
%"class.juce::ComponentMovementWatcher.base" = type <{ %"class.juce::ComponentListener", %"class.juce::WeakReference", i32, [4 x i8], %"class.juce::Array", i8, i8, [2 x i8], %"class.juce::Rectangle" }>
%"class.juce::ComponentListener" = type { ptr }
%"class.juce::Array" = type { %"class.juce::ArrayAllocationBase", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase" = type <{ %"class.juce::HeapBlock", i32, [4 x i8] }>
%"class.juce::HeapBlock" = type { ptr }
%"class.juce::Rectangle" = type { %"class.juce::Point", i32, i32 }
%"class.juce::Point" = type { i32, i32 }
%"class.juce::OwnedArray.90" = type { %"class.juce::ArrayAllocationBase.91", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.91" = type <{ %"class.juce::HeapBlock.92", i32, [4 x i8] }>
%"class.juce::HeapBlock.92" = type { ptr }

declare i32 @__gxx_personality_v0(...)

; 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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK4juce10OwnedArrayINS_21ModalComponentManager9ModalItemENS_20DummyCriticalSectionEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20)) #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK4juce10OwnedArrayINS_21ModalComponentManager9ModalItemENS_20DummyCriticalSectionEE12getUncheckedEi(ptr noundef nonnull align 8 dereferenceable(20), i32 noundef) #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4juce21ModalComponentManager17handleAsyncUpdateEv(ptr noundef nonnull align 8 dereferenceable(48) %0) unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca %"class.juce::ScopedPointer.96", align 8
  %7 = alloca %"class.juce::Component::SafePointer", align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %11 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  %12 = getelementptr inbounds %"class.juce::ModalComponentManager", ptr %11, i32 0, i32 2
  %13 = call noundef i32 @_ZNK4juce10OwnedArrayINS_21ModalComponentManager9ModalItemENS_20DummyCriticalSectionEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20) %12) #4
  store i32 %13, ptr %3, align 4, !tbaa !9
  br label %14

14:                                               ; preds = %79, %1
  %15 = load i32, ptr %3, align 4, !tbaa !9
  %16 = add nsw i32 %15, -1
  store i32 %16, ptr %3, align 4, !tbaa !9
  %17 = icmp sge i32 %16, 0
  br i1 %17, label %19, label %18

18:                                               ; preds = %14
  store i32 2, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  br label %80

19:                                               ; preds = %14
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  %20 = getelementptr inbounds %"class.juce::ModalComponentManager", ptr %11, i32 0, i32 2
  %21 = load i32, ptr %3, align 4, !tbaa !9
  %22 = call noundef ptr @_ZNK4juce10OwnedArrayINS_21ModalComponentManager9ModalItemENS_20DummyCriticalSectionEE12getUncheckedEi(ptr noundef nonnull align 8 dereferenceable(20) %20, i32 noundef %21) #4
  store ptr %22, ptr %5, align 8, !tbaa !5
  %23 = load ptr, ptr %5, align 8, !tbaa !5
  %24 = getelementptr inbounds %"class.juce::ModalComponentManager::ModalItem", ptr %23, i32 0, i32 5
  %25 = load i8, ptr %24, align 4, !tbaa !11, !range !26, !noundef !27
  %26 = trunc i8 %25 to i1
  br i1 %26, label %79, label %27

27:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  %28 = getelementptr inbounds %"class.juce::ModalComponentManager", ptr %11, i32 0, i32 2
  %29 = load i32, ptr %3, align 4, !tbaa !9
  %30 = call noundef ptr @_ZN4juce10OwnedArrayINS_21ModalComponentManager9ModalItemENS_20DummyCriticalSectionEE15removeAndReturnEi(ptr noundef nonnull align 8 dereferenceable(20) %28, i32 noundef %29)
  call void @_ZN4juce13ScopedPointerINS_21ModalComponentManager9ModalItemEEC2EPS2_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef %30) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  %31 = load ptr, ptr %5, align 8, !tbaa !5
  %32 = getelementptr inbounds %"class.juce::ModalComponentManager::ModalItem", ptr %31, i32 0, i32 6
  %33 = load i8, ptr %32, align 1, !tbaa !28, !range !26, !noundef !27
  %34 = trunc i8 %33 to i1
  br i1 %34, label %35, label %39

35:                                               ; preds = %27
  %36 = load ptr, ptr %5, align 8, !tbaa !5
  %37 = getelementptr inbounds %"class.juce::ModalComponentManager::ModalItem", ptr %36, i32 0, i32 2
  %38 = load ptr, ptr %37, align 8, !tbaa !29
  br label %40

39:                                               ; preds = %27
  br label %40

40:                                               ; preds = %39, %35
  %41 = phi ptr [ %38, %35 ], [ null, %39 ]
  invoke void @_ZN4juce9Component11SafePointerIS0_EC2EPS0_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef %41)
          to label %42 unwind label %51

42:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  %43 = load ptr, ptr %5, align 8, !tbaa !5
  %44 = getelementptr inbounds %"class.juce::ModalComponentManager::ModalItem", ptr %43, i32 0, i32 3
  %45 = call noundef i32 @_ZNK4juce10OwnedArrayINS_21ModalComponentManager8CallbackENS_20DummyCriticalSectionEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20) %44) #4
  store i32 %45, ptr %10, align 4, !tbaa !9
  br label %46

46:                                               ; preds = %66, %42
  %47 = load i32, ptr %10, align 4, !tbaa !9
  %48 = add nsw i32 %47, -1
  store i32 %48, ptr %10, align 4, !tbaa !9
  %49 = icmp sge i32 %48, 0
  br i1 %49, label %55, label %50

50:                                               ; preds = %46
  store i32 4, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  br label %71

51:                                               ; preds = %40
  %52 = landingpad { ptr, i32 }
          cleanup
  %53 = extractvalue { ptr, i32 } %52, 0
  store ptr %53, ptr %8, align 8
  %54 = extractvalue { ptr, i32 } %52, 1
  store i32 %54, ptr %9, align 4
  br label %78

55:                                               ; preds = %46
  %56 = load ptr, ptr %5, align 8, !tbaa !5
  %57 = getelementptr inbounds %"class.juce::ModalComponentManager::ModalItem", ptr %56, i32 0, i32 3
  %58 = load i32, ptr %10, align 4, !tbaa !9
  %59 = call noundef ptr @_ZNK4juce10OwnedArrayINS_21ModalComponentManager8CallbackENS_20DummyCriticalSectionEE12getUncheckedEi(ptr noundef nonnull align 8 dereferenceable(20) %57, i32 noundef %58) #4
  %60 = load ptr, ptr %5, align 8, !tbaa !5
  %61 = getelementptr inbounds %"class.juce::ModalComponentManager::ModalItem", ptr %60, i32 0, i32 4
  %62 = load i32, ptr %61, align 8, !tbaa !30
  %63 = load ptr, ptr %59, align 8, !tbaa !31
  %64 = getelementptr inbounds ptr, ptr %63, i64 2
  %65 = load ptr, ptr %64, align 8
  invoke void %65(ptr noundef nonnull align 8 dereferenceable(8) %59, i32 noundef %62)
          to label %66 unwind label %67

66:                                               ; preds = %55
  br label %46, !llvm.loop !33

67:                                               ; preds = %55
  %68 = landingpad { ptr, i32 }
          cleanup
  %69 = extractvalue { ptr, i32 } %68, 0
  store ptr %69, ptr %8, align 8
  %70 = extractvalue { ptr, i32 } %68, 1
  store i32 %70, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  br label %77

71:                                               ; preds = %50
  invoke void @_ZN4juce9Component11SafePointerIS0_E13deleteAndZeroEv(ptr noundef nonnull align 8 dereferenceable(8) %7)
          to label %72 unwind label %73

72:                                               ; preds = %71
  call void @_ZN4juce9Component11SafePointerIS0_ED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  call void @_ZN4juce13ScopedPointerINS_21ModalComponentManager9ModalItemEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  br label %79

73:                                               ; preds = %71
  %74 = landingpad { ptr, i32 }
          cleanup
  %75 = extractvalue { ptr, i32 } %74, 0
  store ptr %75, ptr %8, align 8
  %76 = extractvalue { ptr, i32 } %74, 1
  store i32 %76, ptr %9, align 4
  br label %77

77:                                               ; preds = %73, %67
  call void @_ZN4juce9Component11SafePointerIS0_ED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %7) #4
  br label %78

78:                                               ; preds = %77, %51
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  call void @_ZN4juce13ScopedPointerINS_21ModalComponentManager9ModalItemEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  br label %81

79:                                               ; preds = %72, %19
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  br label %14, !llvm.loop !35

80:                                               ; preds = %18
  ret void

81:                                               ; preds = %78
  %82 = load ptr, ptr %8, align 8
  %83 = load i32, ptr %9, align 4
  %84 = insertvalue { ptr, i32 } poison, ptr %82, 0
  %85 = insertvalue { ptr, i32 } %84, i32 %83, 1
  resume { ptr, i32 } %85
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN4juce10OwnedArrayINS_21ModalComponentManager9ModalItemENS_20DummyCriticalSectionEE15removeAndReturnEi(ptr noundef nonnull align 8 dereferenceable(20), i32 noundef) #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN4juce13ScopedPointerINS_21ModalComponentManager9ModalItemEEC2EPS2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4juce9Component11SafePointerIS0_EC2EPS0_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK4juce10OwnedArrayINS_21ModalComponentManager8CallbackENS_20DummyCriticalSectionEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20)) #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK4juce10OwnedArrayINS_21ModalComponentManager8CallbackENS_20DummyCriticalSectionEE12getUncheckedEi(ptr noundef nonnull align 8 dereferenceable(20), i32 noundef) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4juce9Component11SafePointerIS0_E13deleteAndZeroEv(ptr noundef nonnull align 8 dereferenceable(8)) #3 align 2

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #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 = { 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 = !{!12, !20, i64 108}
!12 = !{!"_ZTSN4juce21ModalComponentManager9ModalItemE", !13, i64 0, !6, i64 72, !23, i64 80, !10, i64 104, !20, i64 108, !20, i64 109}
!13 = !{!"_ZTSN4juce24ComponentMovementWatcherE", !14, i64 0, !15, i64 8, !10, i64 16, !17, i64 24, !20, i64 48, !20, i64 49, !21, i64 52}
!14 = !{!"_ZTSN4juce17ComponentListenerE"}
!15 = !{!"_ZTSN4juce13WeakReferenceINS_9ComponentENS_22ReferenceCountedObjectEEE", !16, i64 0}
!16 = !{!"_ZTSN4juce25ReferenceCountedObjectPtrINS_13WeakReferenceINS_9ComponentENS_22ReferenceCountedObjectEE13SharedPointerEEE", !6, i64 0}
!17 = !{!"_ZTSN4juce5ArrayIPNS_9ComponentENS_20DummyCriticalSectionELi0EEE", !18, i64 0, !10, i64 16}
!18 = !{!"_ZTSN4juce19ArrayAllocationBaseIPNS_9ComponentENS_20DummyCriticalSectionEEE", !19, i64 0, !10, i64 8}
!19 = !{!"_ZTSN4juce9HeapBlockIPNS_9ComponentELb0EEE", !6, i64 0}
!20 = !{!"bool", !7, i64 0}
!21 = !{!"_ZTSN4juce9RectangleIiEE", !22, i64 0, !10, i64 8, !10, i64 12}
!22 = !{!"_ZTSN4juce5PointIiEE", !10, i64 0, !10, i64 4}
!23 = !{!"_ZTSN4juce10OwnedArrayINS_21ModalComponentManager8CallbackENS_20DummyCriticalSectionEEE", !24, i64 0, !10, i64 16}
!24 = !{!"_ZTSN4juce19ArrayAllocationBaseIPNS_21ModalComponentManager8CallbackENS_20DummyCriticalSectionEEE", !25, i64 0, !10, i64 8}
!25 = !{!"_ZTSN4juce9HeapBlockIPNS_21ModalComponentManager8CallbackELb0EEE", !6, i64 0}
!26 = !{i8 0, i8 2}
!27 = !{}
!28 = !{!12, !20, i64 109}
!29 = !{!12, !6, i64 72}
!30 = !{!12, !10, i64 104}
!31 = !{!32, !32, i64 0}
!32 = !{!"vtable pointer", !8, i64 0}
!33 = distinct !{!33, !34}
!34 = !{!"llvm.loop.mustprogress"}
!35 = distinct !{!35, !34}


; 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::ScopedPointer.96" = type { ptr }
%"class.juce::Component::SafePointer" = type { %"class.juce::WeakReference" }
%"class.juce::WeakReference" = type { %"class.juce::ReferenceCountedObjectPtr" }
%"class.juce::ReferenceCountedObjectPtr" = type { ptr }

declare i32 @__gxx_personality_v0(...)

; 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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK4juce10OwnedArrayINS_21ModalComponentManager9ModalItemENS_20DummyCriticalSectionEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK4juce10OwnedArrayINS_21ModalComponentManager9ModalItemENS_20DummyCriticalSectionEE12getUncheckedEi(ptr noundef nonnull align 8 dereferenceable(20), i32 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4juce21ModalComponentManager17handleAsyncUpdateEv(ptr noundef nonnull align 8 dereferenceable(48) %0) unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"class.juce::ScopedPointer.96", align 8
  %3 = alloca %"class.juce::Component::SafePointer", align 8
  %4 = getelementptr inbounds i8, ptr %0, i64 24
  %5 = tail call noundef i32 @_ZNK4juce10OwnedArrayINS_21ModalComponentManager9ModalItemENS_20DummyCriticalSectionEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20) %4) #4
  %6 = icmp sgt i32 %5, 0
  br i1 %6, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %41, %1
  ret void

.lr.ph:                                           ; preds = %1, %41
  %.in = phi i32 [ %7, %41 ], [ %5, %1 ]
  %7 = add nsw i32 %.in, -1
  %8 = call noundef ptr @_ZNK4juce10OwnedArrayINS_21ModalComponentManager9ModalItemENS_20DummyCriticalSectionEE12getUncheckedEi(ptr noundef nonnull align 8 dereferenceable(20) %4, i32 noundef %7) #4
  %9 = getelementptr inbounds i8, ptr %8, i64 108
  %10 = load i8, ptr %9, align 4, !tbaa !5, !range !24, !noundef !25
  %11 = trunc nuw i8 %10 to i1
  br i1 %11, label %41, label %12

12:                                               ; preds = %.lr.ph
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #4
  %13 = call noundef ptr @_ZN4juce10OwnedArrayINS_21ModalComponentManager9ModalItemENS_20DummyCriticalSectionEE15removeAndReturnEi(ptr noundef nonnull align 8 dereferenceable(20) %4, i32 noundef %7)
  call void @_ZN4juce13ScopedPointerINS_21ModalComponentManager9ModalItemEEC2EPS2_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef %13) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #4
  %14 = getelementptr inbounds i8, ptr %8, i64 109
  %15 = load i8, ptr %14, align 1, !tbaa !26, !range !24, !noundef !25
  %16 = trunc nuw i8 %15 to i1
  br i1 %16, label %17, label %20

17:                                               ; preds = %12
  %18 = getelementptr inbounds i8, ptr %8, i64 72
  %19 = load ptr, ptr %18, align 8, !tbaa !27
  br label %20

20:                                               ; preds = %12, %17
  %21 = phi ptr [ %19, %17 ], [ null, %12 ]
  invoke void @_ZN4juce9Component11SafePointerIS0_EC2EPS0_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef %21)
          to label %22 unwind label %29

22:                                               ; preds = %20
  %23 = getelementptr inbounds i8, ptr %8, i64 80
  %24 = call noundef i32 @_ZNK4juce10OwnedArrayINS_21ModalComponentManager8CallbackENS_20DummyCriticalSectionEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20) %23) #4
  %25 = getelementptr inbounds i8, ptr %8, i64 104
  br label %26

26:                                               ; preds = %31, %22
  %.0 = phi i32 [ %24, %22 ], [ %32, %31 ]
  %27 = icmp sgt i32 %.0, 0
  br i1 %27, label %31, label %28

28:                                               ; preds = %26
  call void @_ZN4juce9Component11SafePointerIS0_E13deleteAndZeroEv(ptr noundef nonnull align 8 dereferenceable(8) %3)
  call void @_ZN4juce9Component11SafePointerIS0_ED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %3) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #4
  call void @_ZN4juce13ScopedPointerINS_21ModalComponentManager9ModalItemEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %2) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #4
  br label %41

29:                                               ; preds = %20
  %30 = landingpad { ptr, i32 }
          cleanup
  br label %40

31:                                               ; preds = %26
  %32 = add nsw i32 %.0, -1
  %33 = call noundef ptr @_ZNK4juce10OwnedArrayINS_21ModalComponentManager8CallbackENS_20DummyCriticalSectionEE12getUncheckedEi(ptr noundef nonnull align 8 dereferenceable(20) %23, i32 noundef %32) #4
  %34 = load i32, ptr %25, align 8, !tbaa !28
  %35 = load ptr, ptr %33, align 8, !tbaa !29
  %36 = getelementptr inbounds i8, ptr %35, i64 16
  %37 = load ptr, ptr %36, align 8
  invoke void %37(ptr noundef nonnull align 8 dereferenceable(8) %33, i32 noundef %34)
          to label %26 unwind label %38, !llvm.loop !31

38:                                               ; preds = %31
  %39 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN4juce9Component11SafePointerIS0_ED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %3) #4
  br label %40

40:                                               ; preds = %38, %29
  %.pn = phi { ptr, i32 } [ %39, %38 ], [ %30, %29 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #4
  call void @_ZN4juce13ScopedPointerINS_21ModalComponentManager9ModalItemEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %2) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #4
  resume { ptr, i32 } %.pn

41:                                               ; preds = %28, %.lr.ph
  %42 = icmp sgt i32 %.in, 1
  br i1 %42, label %.lr.ph, label %._crit_edge, !llvm.loop !33
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN4juce13ScopedPointerINS_21ModalComponentManager9ModalItemEEC2EPS2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4juce9Component11SafePointerIS0_EC2EPS0_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK4juce10OwnedArrayINS_21ModalComponentManager8CallbackENS_20DummyCriticalSectionEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK4juce10OwnedArrayINS_21ModalComponentManager8CallbackENS_20DummyCriticalSectionEE12getUncheckedEi(ptr noundef nonnull align 8 dereferenceable(20), i32 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4juce9Component11SafePointerIS0_E13deleteAndZeroEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3 align 2

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #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 = { 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, !18, i64 108}
!6 = !{!"_ZTSN4juce21ModalComponentManager9ModalItemE", !7, i64 0, !11, i64 72, !21, i64 80, !14, i64 104, !18, i64 108, !18, i64 109}
!7 = !{!"_ZTSN4juce24ComponentMovementWatcherE", !8, i64 0, !9, i64 8, !14, i64 16, !15, i64 24, !18, i64 48, !18, i64 49, !19, i64 52}
!8 = !{!"_ZTSN4juce17ComponentListenerE"}
!9 = !{!"_ZTSN4juce13WeakReferenceINS_9ComponentENS_22ReferenceCountedObjectEEE", !10, i64 0}
!10 = !{!"_ZTSN4juce25ReferenceCountedObjectPtrINS_13WeakReferenceINS_9ComponentENS_22ReferenceCountedObjectEE13SharedPointerEEE", !11, i64 0}
!11 = !{!"any pointer", !12, i64 0}
!12 = !{!"omnipotent char", !13, i64 0}
!13 = !{!"Simple C++ TBAA"}
!14 = !{!"int", !12, i64 0}
!15 = !{!"_ZTSN4juce5ArrayIPNS_9ComponentENS_20DummyCriticalSectionELi0EEE", !16, i64 0, !14, i64 16}
!16 = !{!"_ZTSN4juce19ArrayAllocationBaseIPNS_9ComponentENS_20DummyCriticalSectionEEE", !17, i64 0, !14, i64 8}
!17 = !{!"_ZTSN4juce9HeapBlockIPNS_9ComponentELb0EEE", !11, i64 0}
!18 = !{!"bool", !12, i64 0}
!19 = !{!"_ZTSN4juce9RectangleIiEE", !20, i64 0, !14, i64 8, !14, i64 12}
!20 = !{!"_ZTSN4juce5PointIiEE", !14, i64 0, !14, i64 4}
!21 = !{!"_ZTSN4juce10OwnedArrayINS_21ModalComponentManager8CallbackENS_20DummyCriticalSectionEEE", !22, i64 0, !14, i64 16}
!22 = !{!"_ZTSN4juce19ArrayAllocationBaseIPNS_21ModalComponentManager8CallbackENS_20DummyCriticalSectionEEE", !23, i64 0, !14, i64 8}
!23 = !{!"_ZTSN4juce9HeapBlockIPNS_21ModalComponentManager8CallbackELb0EEE", !11, i64 0}
!24 = !{i8 0, i8 2}
!25 = !{}
!26 = !{!6, !18, i64 109}
!27 = !{!6, !11, i64 72}
!28 = !{!6, !14, i64 104}
!29 = !{!30, !30, i64 0}
!30 = !{!"vtable pointer", !13, i64 0}
!31 = distinct !{!31, !32}
!32 = !{!"llvm.loop.mustprogress"}
!33 = distinct !{!33, !32}


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