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

; 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::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::MultiDocumentPanel" = type <{ %"class.juce::Component.base", [3 x i8], %"class.juce::ComponentListener", i32, [4 x i8], %"class.juce::Array", %"class.juce::ScopedPointer.361", %"class.juce::Colour", i32, i32, [4 x i8] }>
%"class.juce::Component.base" = type <{ %"class.juce::MouseListener", %"class.juce::String", %"class.juce::String", ptr, %"class.juce::Rectangle", %"class.juce::ScopedPointer", %"class.juce::ScopedPointer.0", %"class.juce::Array", ptr, %"class.juce::MouseCursor", ptr, %"class.juce::ScopedPointer.1", %"class.juce::ScopedPointer.2", %"class.juce::ScopedPointer.3", %"class.juce::ListenerList", %"class.juce::NamedValueSet", %"class.juce::WeakReference<juce::Component>::Master", %union.anon, i8 }>
%"class.juce::MouseListener" = type { ptr }
%"class.juce::String" = type { %"class.juce::CharPointer_UTF8" }
%"class.juce::CharPointer_UTF8" = type { ptr }
%"class.juce::Rectangle" = type { %"class.juce::Point", i32, i32 }
%"class.juce::Point" = type { i32, i32 }
%"class.juce::ScopedPointer" = type { ptr }
%"class.juce::ScopedPointer.0" = type { ptr }
%"class.juce::MouseCursor" = type { ptr }
%"class.juce::ScopedPointer.1" = type { ptr }
%"class.juce::ScopedPointer.2" = type { ptr }
%"class.juce::ScopedPointer.3" = type { ptr }
%"class.juce::ListenerList" = type { %"class.juce::Array.4" }
%"class.juce::Array.4" = type { %"class.juce::ArrayAllocationBase.5", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.5" = type <{ %"class.juce::HeapBlock.6", i32, [4 x i8] }>
%"class.juce::HeapBlock.6" = type { ptr }
%"class.juce::NamedValueSet" = type { %"class.juce::Array.9" }
%"class.juce::Array.9" = type { %"class.juce::ArrayAllocationBase.10", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.10" = type <{ %"class.juce::HeapBlock.11", i32, [4 x i8] }>
%"class.juce::HeapBlock.11" = type { ptr }
%"class.juce::WeakReference<juce::Component>::Master" = type { %"class.juce::ReferenceCountedObjectPtr" }
%"class.juce::ReferenceCountedObjectPtr" = type { ptr }
%union.anon = type { i32 }
%"class.juce::ComponentListener" = type { ptr }
%"class.juce::ScopedPointer.361" = type { ptr }
%"class.juce::Colour" = type { %"class.juce::PixelARGB" }
%"class.juce::PixelARGB" = type { %union.anon.77 }
%union.anon.77 = type { i32 }

@_ZTIN4juce9ComponentE = external dso_local constant { ptr, ptr, ptr }, align 8
@_ZTIN4juce24MultiDocumentPanelWindowE = external dso_local constant { ptr, ptr, ptr }, align 8

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4juce5ArrayIPNS_9ComponentENS_20DummyCriticalSectionELi0EED2Ev(ptr noundef nonnull align 8 dereferenceable(20)) unnamed_addr #0 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK4juce9Component21getNumChildComponentsEv(ptr noundef nonnull align 8 dereferenceable(197)) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK4juce9Component17getChildComponentEi(ptr noundef nonnull align 8 dereferenceable(197), i32 noundef) #0 align 2

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

; Function Attrs: nounwind willreturn memory(read)
declare ptr @__dynamic_cast(ptr, ptr, ptr, i64) #3

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK4juce15ResizableWindow19getContentComponentEv(ptr noundef nonnull align 8 dereferenceable(328)) #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4juce18MultiDocumentPanel11updateOrderEv(ptr noundef nonnull align 8 dereferenceable(260) %0) #2 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca %"class.juce::Array", align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %10 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr %3) #5
  %11 = getelementptr inbounds %"class.juce::MultiDocumentPanel", ptr %10, i32 0, i32 5
  call void @_ZN4juce5ArrayIPNS_9ComponentENS_20DummyCriticalSectionELi0EEC2ERKS4_(ptr noundef nonnull align 8 dereferenceable(20) %3, ptr noundef nonnull align 8 dereferenceable(20) %11)
  %12 = getelementptr inbounds %"class.juce::MultiDocumentPanel", ptr %10, i32 0, i32 3
  %13 = load i32, ptr %12, align 8, !tbaa !9
  %14 = icmp eq i32 %13, 0
  br i1 %14, label %15, label %52

15:                                               ; preds = %1
  %16 = getelementptr inbounds %"class.juce::MultiDocumentPanel", ptr %10, i32 0, i32 5
  invoke void @_ZN4juce5ArrayIPNS_9ComponentENS_20DummyCriticalSectionELi0EE5clearEv(ptr noundef nonnull align 8 dereferenceable(20) %16)
          to label %17 unwind label %23

17:                                               ; preds = %15
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 0, ptr %6, align 4, !tbaa !42
  br label %18

18:                                               ; preds = %48, %17
  %19 = load i32, ptr %6, align 4, !tbaa !42
  %20 = call noundef i32 @_ZNK4juce9Component21getNumChildComponentsEv(ptr noundef nonnull align 8 dereferenceable(197) %10) #5
  %21 = icmp slt i32 %19, %20
  br i1 %21, label %27, label %22

22:                                               ; preds = %18
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %51

23:                                               ; preds = %78, %74, %15
  %24 = landingpad { ptr, i32 }
          cleanup
  %25 = extractvalue { ptr, i32 } %24, 0
  store ptr %25, ptr %4, align 8
  %26 = extractvalue { ptr, i32 } %24, 1
  store i32 %26, ptr %5, align 4
  br label %84

27:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %28 = load i32, ptr %6, align 4, !tbaa !42
  %29 = call noundef ptr @_ZNK4juce9Component17getChildComponentEi(ptr noundef nonnull align 8 dereferenceable(197) %10, i32 noundef %28) #5
  %30 = icmp eq ptr %29, null
  br i1 %30, label %33, label %31

31:                                               ; preds = %27
  %32 = call ptr @__dynamic_cast(ptr %29, ptr @_ZTIN4juce9ComponentE, ptr @_ZTIN4juce24MultiDocumentPanelWindowE, i64 0) #5
  br label %34

33:                                               ; preds = %27
  br label %34

34:                                               ; preds = %33, %31
  %35 = phi ptr [ %32, %31 ], [ null, %33 ]
  store ptr %35, ptr %7, align 8, !tbaa !5
  %36 = load ptr, ptr %7, align 8, !tbaa !5
  %37 = icmp ne ptr %36, null
  br i1 %37, label %38, label %47

38:                                               ; preds = %34
  %39 = getelementptr inbounds %"class.juce::MultiDocumentPanel", ptr %10, i32 0, i32 5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %40 = load ptr, ptr %7, align 8, !tbaa !5
  %41 = call noundef ptr @_ZNK4juce15ResizableWindow19getContentComponentEv(ptr noundef nonnull align 8 dereferenceable(328) %40) #5
  store ptr %41, ptr %8, align 8, !tbaa !5
  invoke void @_ZN4juce5ArrayIPNS_9ComponentENS_20DummyCriticalSectionELi0EE3addEOS2_(ptr noundef nonnull align 8 dereferenceable(20) %39, ptr noundef nonnull align 8 dereferenceable(8) %8)
          to label %42 unwind label %43

42:                                               ; preds = %38
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  br label %47

43:                                               ; preds = %38
  %44 = landingpad { ptr, i32 }
          cleanup
  %45 = extractvalue { ptr, i32 } %44, 0
  store ptr %45, ptr %4, align 8
  %46 = extractvalue { ptr, i32 } %44, 1
  store i32 %46, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %84

47:                                               ; preds = %42, %34
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  br label %48

48:                                               ; preds = %47
  %49 = load i32, ptr %6, align 4, !tbaa !42
  %50 = add nsw i32 %49, 1
  store i32 %50, ptr %6, align 4, !tbaa !42
  br label %18, !llvm.loop !43

51:                                               ; preds = %22
  br label %74

52:                                               ; preds = %1
  %53 = getelementptr inbounds %"class.juce::MultiDocumentPanel", ptr %10, i32 0, i32 6
  %54 = call noundef ptr @_ZNK4juce13ScopedPointerINS_15TabbedComponentEEcvPS1_Ev(ptr noundef nonnull align 8 dereferenceable(8) %53) #5
  %55 = icmp ne ptr %54, null
  br i1 %55, label %56, label %73

56:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %57 = getelementptr inbounds %"class.juce::MultiDocumentPanel", ptr %10, i32 0, i32 6
  %58 = call noundef ptr @_ZNK4juce13ScopedPointerINS_15TabbedComponentEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %57) #5
  %59 = call noundef ptr @_ZNK4juce15TabbedComponent26getCurrentContentComponentEv(ptr noundef nonnull align 8 dereferenceable(252) %58) #5
  store ptr %59, ptr %9, align 8, !tbaa !5
  %60 = load ptr, ptr %9, align 8, !tbaa !5
  %61 = icmp ne ptr %60, null
  br i1 %61, label %62, label %72

62:                                               ; preds = %56
  %63 = getelementptr inbounds %"class.juce::MultiDocumentPanel", ptr %10, i32 0, i32 5
  %64 = load ptr, ptr %9, align 8, !tbaa !5
  invoke void @_ZN4juce5ArrayIPNS_9ComponentENS_20DummyCriticalSectionELi0EE24removeFirstMatchingValueES2_(ptr noundef nonnull align 8 dereferenceable(20) %63, ptr noundef %64)
          to label %65 unwind label %68

65:                                               ; preds = %62
  %66 = getelementptr inbounds %"class.juce::MultiDocumentPanel", ptr %10, i32 0, i32 5
  invoke void @_ZN4juce5ArrayIPNS_9ComponentENS_20DummyCriticalSectionELi0EE3addERKS2_(ptr noundef nonnull align 8 dereferenceable(20) %66, ptr noundef nonnull align 8 dereferenceable(8) %9)
          to label %67 unwind label %68

67:                                               ; preds = %65
  br label %72

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

72:                                               ; preds = %67, %56
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  br label %73

73:                                               ; preds = %72, %52
  br label %74

74:                                               ; preds = %73, %51
  %75 = getelementptr inbounds %"class.juce::MultiDocumentPanel", ptr %10, i32 0, i32 5
  %76 = invoke noundef zeroext i1 @_ZNK4juce5ArrayIPNS_9ComponentENS_20DummyCriticalSectionELi0EEneIS4_EEbRKT_(ptr noundef nonnull align 8 dereferenceable(20) %75, ptr noundef nonnull align 8 dereferenceable(20) %3)
          to label %77 unwind label %23

77:                                               ; preds = %74
  br i1 %76, label %78, label %83

78:                                               ; preds = %77
  %79 = load ptr, ptr %10, align 8, !tbaa !45
  %80 = getelementptr inbounds ptr, ptr %79, i64 45
  %81 = load ptr, ptr %80, align 8
  invoke void %81(ptr noundef nonnull align 8 dereferenceable(260) %10)
          to label %82 unwind label %23

82:                                               ; preds = %78
  br label %83

83:                                               ; preds = %82, %77
  call void @_ZN4juce5ArrayIPNS_9ComponentENS_20DummyCriticalSectionELi0EED2Ev(ptr noundef nonnull align 8 dereferenceable(20) %3) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #5
  ret void

84:                                               ; preds = %68, %43, %23
  call void @_ZN4juce5ArrayIPNS_9ComponentENS_20DummyCriticalSectionELi0EED2Ev(ptr noundef nonnull align 8 dereferenceable(20) %3) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #5
  br label %85

85:                                               ; preds = %84
  %86 = load ptr, ptr %4, align 8
  %87 = load i32, ptr %5, align 4
  %88 = insertvalue { ptr, i32 } poison, ptr %86, 0
  %89 = insertvalue { ptr, i32 } %88, i32 %87, 1
  resume { ptr, i32 } %89
}

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK4juce15TabbedComponent26getCurrentContentComponentEv(ptr noundef nonnull align 8 dereferenceable(252)) #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK4juce5ArrayIPNS_9ComponentENS_20DummyCriticalSectionELi0EEneIS4_EEbRKT_(ptr noundef nonnull align 8 dereferenceable(20), ptr noundef nonnull align 8 dereferenceable(20)) #2 align 2

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" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { nounwind willreturn memory(read) }
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, !38, i64 208}
!10 = !{!"_ZTSN4juce18MultiDocumentPanelE", !11, i64 0, !37, i64 200, !38, i64 208, !20, i64 216, !39, i64 240, !40, i64 248, !17, i64 252, !17, i64 256}
!11 = !{!"_ZTSN4juce9ComponentE", !12, i64 0, !13, i64 8, !13, i64 16, !6, i64 24, !15, i64 32, !18, i64 48, !19, i64 56, !20, i64 64, !6, i64 88, !23, i64 96, !6, i64 104, !24, i64 112, !25, i64 120, !26, i64 128, !27, i64 136, !31, i64 160, !35, i64 184, !7, i64 192, !7, i64 196}
!12 = !{!"_ZTSN4juce13MouseListenerE"}
!13 = !{!"_ZTSN4juce6StringE", !14, i64 0}
!14 = !{!"_ZTSN4juce16CharPointer_UTF8E", !6, i64 0}
!15 = !{!"_ZTSN4juce9RectangleIiEE", !16, i64 0, !17, i64 8, !17, i64 12}
!16 = !{!"_ZTSN4juce5PointIiEE", !17, i64 0, !17, i64 4}
!17 = !{!"int", !7, i64 0}
!18 = !{!"_ZTSN4juce13ScopedPointerINS_9Component10PositionerEEE", !6, i64 0}
!19 = !{!"_ZTSN4juce13ScopedPointerINS_15AffineTransformEEE", !6, i64 0}
!20 = !{!"_ZTSN4juce5ArrayIPNS_9ComponentENS_20DummyCriticalSectionELi0EEE", !21, i64 0, !17, i64 16}
!21 = !{!"_ZTSN4juce19ArrayAllocationBaseIPNS_9ComponentENS_20DummyCriticalSectionEEE", !22, i64 0, !17, i64 8}
!22 = !{!"_ZTSN4juce9HeapBlockIPNS_9ComponentELb0EEE", !6, i64 0}
!23 = !{!"_ZTSN4juce11MouseCursorE", !6, i64 0}
!24 = !{!"_ZTSN4juce13ScopedPointerINS_20CachedComponentImageEEE", !6, i64 0}
!25 = !{!"_ZTSN4juce13ScopedPointerINS_9Component17MouseListenerListEEE", !6, i64 0}
!26 = !{!"_ZTSN4juce13ScopedPointerINS_5ArrayIPNS_11KeyListenerENS_20DummyCriticalSectionELi0EEEEE", !6, i64 0}
!27 = !{!"_ZTSN4juce12ListenerListINS_17ComponentListenerENS_5ArrayIPS1_NS_20DummyCriticalSectionELi0EEEEE", !28, i64 0}
!28 = !{!"_ZTSN4juce5ArrayIPNS_17ComponentListenerENS_20DummyCriticalSectionELi0EEE", !29, i64 0, !17, i64 16}
!29 = !{!"_ZTSN4juce19ArrayAllocationBaseIPNS_17ComponentListenerENS_20DummyCriticalSectionEEE", !30, i64 0, !17, i64 8}
!30 = !{!"_ZTSN4juce9HeapBlockIPNS_17ComponentListenerELb0EEE", !6, i64 0}
!31 = !{!"_ZTSN4juce13NamedValueSetE", !32, i64 0}
!32 = !{!"_ZTSN4juce5ArrayINS_13NamedValueSet10NamedValueENS_20DummyCriticalSectionELi0EEE", !33, i64 0, !17, i64 16}
!33 = !{!"_ZTSN4juce19ArrayAllocationBaseINS_13NamedValueSet10NamedValueENS_20DummyCriticalSectionEEE", !34, i64 0, !17, i64 8}
!34 = !{!"_ZTSN4juce9HeapBlockINS_13NamedValueSet10NamedValueELb0EEE", !6, i64 0}
!35 = !{!"_ZTSN4juce13WeakReferenceINS_9ComponentENS_22ReferenceCountedObjectEE6MasterE", !36, i64 0}
!36 = !{!"_ZTSN4juce25ReferenceCountedObjectPtrINS_13WeakReferenceINS_9ComponentENS_22ReferenceCountedObjectEE13SharedPointerEEE", !6, i64 0}
!37 = !{!"_ZTSN4juce17ComponentListenerE"}
!38 = !{!"_ZTSN4juce18MultiDocumentPanel10LayoutModeE", !7, i64 0}
!39 = !{!"_ZTSN4juce13ScopedPointerINS_15TabbedComponentEEE", !6, i64 0}
!40 = !{!"_ZTSN4juce6ColourE", !41, i64 0}
!41 = !{!"_ZTSN4juce9PixelARGBE", !7, i64 0}
!42 = !{!17, !17, i64 0}
!43 = distinct !{!43, !44}
!44 = !{!"llvm.loop.mustprogress"}
!45 = !{!46, !46, i64 0}
!46 = !{!"vtable pointer", !8, 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"

%"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 }

@_ZTIN4juce9ComponentE = external dso_local constant { ptr, ptr, ptr }, align 8
@_ZTIN4juce24MultiDocumentPanelWindowE = external dso_local constant { ptr, ptr, ptr }, align 8

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4juce5ArrayIPNS_9ComponentENS_20DummyCriticalSectionELi0EED2Ev(ptr noundef nonnull align 8 dereferenceable(20)) unnamed_addr #0 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK4juce9Component21getNumChildComponentsEv(ptr noundef nonnull align 8 dereferenceable(197)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK4juce9Component17getChildComponentEi(ptr noundef nonnull align 8 dereferenceable(197), i32 noundef) local_unnamed_addr #0 align 2

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(read)
declare ptr @__dynamic_cast(ptr, ptr, ptr, i64) local_unnamed_addr #3

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK4juce15ResizableWindow19getContentComponentEv(ptr noundef nonnull align 8 dereferenceable(328)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4juce18MultiDocumentPanel11updateOrderEv(ptr noundef nonnull align 8 dereferenceable(260) %0) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"class.juce::Array", align 8
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %2) #5
  %5 = getelementptr inbounds i8, ptr %0, i64 216
  call void @_ZN4juce5ArrayIPNS_9ComponentENS_20DummyCriticalSectionELi0EEC2ERKS4_(ptr noundef nonnull align 8 dereferenceable(20) %2, ptr noundef nonnull align 8 dereferenceable(20) %5)
  %6 = getelementptr inbounds i8, ptr %0, i64 208
  %7 = load i32, ptr %6, align 8, !tbaa !5
  %8 = icmp eq i32 %7, 0
  br i1 %8, label %9, label %26

9:                                                ; preds = %1
  invoke void @_ZN4juce5ArrayIPNS_9ComponentENS_20DummyCriticalSectionELi0EE5clearEv(ptr noundef nonnull align 8 dereferenceable(20) %5)
          to label %.preheader unwind label %12

.preheader:                                       ; preds = %9
  %10 = call noundef i32 @_ZNK4juce9Component21getNumChildComponentsEv(ptr noundef nonnull align 8 dereferenceable(197) %0) #5
  %11 = icmp sgt i32 %10, 0
  br i1 %11, label %.lr.ph, label %.loopexit

12:                                               ; preds = %39, %.loopexit, %9
  %13 = landingpad { ptr, i32 }
          cleanup
  br label %44

.lr.ph:                                           ; preds = %.preheader, %.thread
  %.0716 = phi i32 [ %23, %.thread ], [ 0, %.preheader ]
  %14 = call noundef ptr @_ZNK4juce9Component17getChildComponentEi(ptr noundef nonnull align 8 dereferenceable(197) %0, i32 noundef %.0716) #5
  %15 = icmp eq ptr %14, null
  br i1 %15, label %.thread, label %16

16:                                               ; preds = %.lr.ph
  %17 = call ptr @__dynamic_cast(ptr nonnull %14, ptr nonnull @_ZTIN4juce9ComponentE, ptr nonnull @_ZTIN4juce24MultiDocumentPanelWindowE, i64 0) #5
  %.not13 = icmp eq ptr %17, null
  br i1 %.not13, label %.thread, label %18

18:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #5
  %19 = call noundef ptr @_ZNK4juce15ResizableWindow19getContentComponentEv(ptr noundef nonnull align 8 dereferenceable(328) %17) #5
  store ptr %19, ptr %3, align 8, !tbaa !41
  invoke void @_ZN4juce5ArrayIPNS_9ComponentENS_20DummyCriticalSectionELi0EE3addEOS2_(ptr noundef nonnull align 8 dereferenceable(20) %5, ptr noundef nonnull align 8 dereferenceable(8) %3)
          to label %20 unwind label %21

20:                                               ; preds = %18
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  br label %.thread

21:                                               ; preds = %18
  %22 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  br label %44

.thread:                                          ; preds = %.lr.ph, %20, %16
  %23 = add nuw nsw i32 %.0716, 1
  %24 = call noundef i32 @_ZNK4juce9Component21getNumChildComponentsEv(ptr noundef nonnull align 8 dereferenceable(197) %0) #5
  %25 = icmp slt i32 %23, %24
  br i1 %25, label %.lr.ph, label %.loopexit, !llvm.loop !42

26:                                               ; preds = %1
  %27 = getelementptr inbounds i8, ptr %0, i64 240
  %28 = call noundef ptr @_ZNK4juce13ScopedPointerINS_15TabbedComponentEEcvPS1_Ev(ptr noundef nonnull align 8 dereferenceable(8) %27) #5
  %.not = icmp eq ptr %28, null
  br i1 %.not, label %.loopexit, label %29

29:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  %30 = call noundef ptr @_ZNK4juce13ScopedPointerINS_15TabbedComponentEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %27) #5
  %31 = call noundef ptr @_ZNK4juce15TabbedComponent26getCurrentContentComponentEv(ptr noundef nonnull align 8 dereferenceable(252) %30) #5
  store ptr %31, ptr %4, align 8, !tbaa !41
  %.not12 = icmp eq ptr %31, null
  br i1 %.not12, label %36, label %32

32:                                               ; preds = %29
  invoke void @_ZN4juce5ArrayIPNS_9ComponentENS_20DummyCriticalSectionELi0EE24removeFirstMatchingValueES2_(ptr noundef nonnull align 8 dereferenceable(20) %5, ptr noundef nonnull %31)
          to label %33 unwind label %34

33:                                               ; preds = %32
  invoke void @_ZN4juce5ArrayIPNS_9ComponentENS_20DummyCriticalSectionELi0EE3addERKS2_(ptr noundef nonnull align 8 dereferenceable(20) %5, ptr noundef nonnull align 8 dereferenceable(8) %4)
          to label %36 unwind label %34

34:                                               ; preds = %33, %32
  %35 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  br label %44

36:                                               ; preds = %33, %29
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  br label %.loopexit

.loopexit:                                        ; preds = %.thread, %.preheader, %26, %36
  %37 = invoke noundef zeroext i1 @_ZNK4juce5ArrayIPNS_9ComponentENS_20DummyCriticalSectionELi0EEneIS4_EEbRKT_(ptr noundef nonnull align 8 dereferenceable(20) %5, ptr noundef nonnull align 8 dereferenceable(20) %2)
          to label %38 unwind label %12

38:                                               ; preds = %.loopexit
  br i1 %37, label %39, label %43

39:                                               ; preds = %38
  %40 = load ptr, ptr %0, align 8, !tbaa !44
  %41 = getelementptr inbounds i8, ptr %40, i64 360
  %42 = load ptr, ptr %41, align 8
  invoke void %42(ptr noundef nonnull align 8 dereferenceable(260) %0)
          to label %43 unwind label %12

43:                                               ; preds = %39, %38
  call void @_ZN4juce5ArrayIPNS_9ComponentENS_20DummyCriticalSectionELi0EED2Ev(ptr noundef nonnull align 8 dereferenceable(20) %2) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #5
  ret void

44:                                               ; preds = %34, %21, %12
  %.pn = phi { ptr, i32 } [ %22, %21 ], [ %13, %12 ], [ %35, %34 ]
  call void @_ZN4juce5ArrayIPNS_9ComponentENS_20DummyCriticalSectionELi0EED2Ev(ptr noundef nonnull align 8 dereferenceable(20) %2) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #5
  resume { ptr, i32 } %.pn
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK4juce13ScopedPointerINS_15TabbedComponentEEcvPS1_Ev(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #4 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK4juce13ScopedPointerINS_15TabbedComponentEEptEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #4 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK4juce15TabbedComponent26getCurrentContentComponentEv(ptr noundef nonnull align 8 dereferenceable(252)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK4juce5ArrayIPNS_9ComponentENS_20DummyCriticalSectionELi0EEneIS4_EEbRKT_(ptr noundef nonnull align 8 dereferenceable(20), ptr noundef nonnull align 8 dereferenceable(20)) local_unnamed_addr #2 align 2

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" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 nofree nounwind willreturn memory(read) }
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, !37, i64 208}
!6 = !{!"_ZTSN4juce18MultiDocumentPanelE", !7, i64 0, !36, i64 200, !37, i64 208, !19, i64 216, !38, i64 240, !39, i64 248, !16, i64 252, !16, i64 256}
!7 = !{!"_ZTSN4juce9ComponentE", !8, i64 0, !9, i64 8, !9, i64 16, !11, i64 24, !14, i64 32, !17, i64 48, !18, i64 56, !19, i64 64, !11, i64 88, !22, i64 96, !11, i64 104, !23, i64 112, !24, i64 120, !25, i64 128, !26, i64 136, !30, i64 160, !34, i64 184, !12, i64 192, !12, i64 196}
!8 = !{!"_ZTSN4juce13MouseListenerE"}
!9 = !{!"_ZTSN4juce6StringE", !10, i64 0}
!10 = !{!"_ZTSN4juce16CharPointer_UTF8E", !11, i64 0}
!11 = !{!"any pointer", !12, i64 0}
!12 = !{!"omnipotent char", !13, i64 0}
!13 = !{!"Simple C++ TBAA"}
!14 = !{!"_ZTSN4juce9RectangleIiEE", !15, i64 0, !16, i64 8, !16, i64 12}
!15 = !{!"_ZTSN4juce5PointIiEE", !16, i64 0, !16, i64 4}
!16 = !{!"int", !12, i64 0}
!17 = !{!"_ZTSN4juce13ScopedPointerINS_9Component10PositionerEEE", !11, i64 0}
!18 = !{!"_ZTSN4juce13ScopedPointerINS_15AffineTransformEEE", !11, i64 0}
!19 = !{!"_ZTSN4juce5ArrayIPNS_9ComponentENS_20DummyCriticalSectionELi0EEE", !20, i64 0, !16, i64 16}
!20 = !{!"_ZTSN4juce19ArrayAllocationBaseIPNS_9ComponentENS_20DummyCriticalSectionEEE", !21, i64 0, !16, i64 8}
!21 = !{!"_ZTSN4juce9HeapBlockIPNS_9ComponentELb0EEE", !11, i64 0}
!22 = !{!"_ZTSN4juce11MouseCursorE", !11, i64 0}
!23 = !{!"_ZTSN4juce13ScopedPointerINS_20CachedComponentImageEEE", !11, i64 0}
!24 = !{!"_ZTSN4juce13ScopedPointerINS_9Component17MouseListenerListEEE", !11, i64 0}
!25 = !{!"_ZTSN4juce13ScopedPointerINS_5ArrayIPNS_11KeyListenerENS_20DummyCriticalSectionELi0EEEEE", !11, i64 0}
!26 = !{!"_ZTSN4juce12ListenerListINS_17ComponentListenerENS_5ArrayIPS1_NS_20DummyCriticalSectionELi0EEEEE", !27, i64 0}
!27 = !{!"_ZTSN4juce5ArrayIPNS_17ComponentListenerENS_20DummyCriticalSectionELi0EEE", !28, i64 0, !16, i64 16}
!28 = !{!"_ZTSN4juce19ArrayAllocationBaseIPNS_17ComponentListenerENS_20DummyCriticalSectionEEE", !29, i64 0, !16, i64 8}
!29 = !{!"_ZTSN4juce9HeapBlockIPNS_17ComponentListenerELb0EEE", !11, i64 0}
!30 = !{!"_ZTSN4juce13NamedValueSetE", !31, i64 0}
!31 = !{!"_ZTSN4juce5ArrayINS_13NamedValueSet10NamedValueENS_20DummyCriticalSectionELi0EEE", !32, i64 0, !16, i64 16}
!32 = !{!"_ZTSN4juce19ArrayAllocationBaseINS_13NamedValueSet10NamedValueENS_20DummyCriticalSectionEEE", !33, i64 0, !16, i64 8}
!33 = !{!"_ZTSN4juce9HeapBlockINS_13NamedValueSet10NamedValueELb0EEE", !11, i64 0}
!34 = !{!"_ZTSN4juce13WeakReferenceINS_9ComponentENS_22ReferenceCountedObjectEE6MasterE", !35, i64 0}
!35 = !{!"_ZTSN4juce25ReferenceCountedObjectPtrINS_13WeakReferenceINS_9ComponentENS_22ReferenceCountedObjectEE13SharedPointerEEE", !11, i64 0}
!36 = !{!"_ZTSN4juce17ComponentListenerE"}
!37 = !{!"_ZTSN4juce18MultiDocumentPanel10LayoutModeE", !12, i64 0}
!38 = !{!"_ZTSN4juce13ScopedPointerINS_15TabbedComponentEEE", !11, i64 0}
!39 = !{!"_ZTSN4juce6ColourE", !40, i64 0}
!40 = !{!"_ZTSN4juce9PixelARGBE", !12, i64 0}
!41 = !{!11, !11, i64 0}
!42 = distinct !{!42, !43}
!43 = !{!"llvm.loop.mustprogress"}
!44 = !{!45, !45, i64 0}
!45 = !{!"vtable pointer", !13, i64 0}


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