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

; 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::Component" = 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, [3 x 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::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::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 }

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4juce9Component20reorderChildInternalEii(ptr noundef nonnull align 8 dereferenceable(197), i32 noundef, i32 noundef) #3 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4juce9Component7toFrontEb(ptr noundef nonnull align 8 dereferenceable(197) %0, i1 noundef zeroext %1) #3 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca i8, align 1
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  %9 = zext i1 %1 to i8
  store i8 %9, ptr %4, align 1, !tbaa !9
  %10 = load ptr, ptr %3, align 8
  br label %11

11:                                               ; preds = %2
  br label %12

12:                                               ; preds = %11
  %13 = getelementptr inbounds %"class.juce::Component", ptr %10, i32 0, i32 17
  %14 = load i16, ptr %13, align 8
  %15 = and i16 %14, 1
  %16 = trunc i16 %15 to i1
  br i1 %16, label %17, label %35

17:                                               ; preds = %12
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  %18 = call noundef ptr @_ZNK4juce9Component7getPeerEv(ptr noundef nonnull align 8 dereferenceable(197) %10)
  store ptr %18, ptr %5, align 8, !tbaa !5
  %19 = load ptr, ptr %5, align 8, !tbaa !5
  %20 = icmp ne ptr %19, null
  br i1 %20, label %21, label %34

21:                                               ; preds = %17
  %22 = load ptr, ptr %5, align 8, !tbaa !5
  %23 = load i8, ptr %4, align 1, !tbaa !9, !range !11, !noundef !12
  %24 = trunc i8 %23 to i1
  %25 = load ptr, ptr %22, align 8, !tbaa !13
  %26 = getelementptr inbounds ptr, ptr %25, i64 23
  %27 = load ptr, ptr %26, align 8
  call void %27(ptr noundef nonnull align 8 dereferenceable(77) %22, i1 noundef zeroext %24)
  %28 = load i8, ptr %4, align 1, !tbaa !9, !range !11, !noundef !12
  %29 = trunc i8 %28 to i1
  br i1 %29, label %30, label %33

30:                                               ; preds = %21
  %31 = call noundef zeroext i1 @_ZNK4juce9Component16hasKeyboardFocusEb(ptr noundef nonnull align 8 dereferenceable(197) %10, i1 noundef zeroext true)
  br i1 %31, label %33, label %32

32:                                               ; preds = %30
  call void @_ZN4juce9Component17grabKeyboardFocusEv(ptr noundef nonnull align 8 dereferenceable(197) %10)
  br label %33

33:                                               ; preds = %32, %30, %21
  br label %34

34:                                               ; preds = %33, %17
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  br label %87

35:                                               ; preds = %12
  %36 = getelementptr inbounds %"class.juce::Component", ptr %10, i32 0, i32 3
  %37 = load ptr, ptr %36, align 8, !tbaa !15
  %38 = icmp ne ptr %37, null
  br i1 %38, label %39, label %86

39:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  %40 = getelementptr inbounds %"class.juce::Component", ptr %10, i32 0, i32 3
  %41 = load ptr, ptr %40, align 8, !tbaa !15
  %42 = getelementptr inbounds %"class.juce::Component", ptr %41, i32 0, i32 7
  store ptr %42, ptr %6, align 8, !tbaa !5
  %43 = load ptr, ptr %6, align 8, !tbaa !5
  %44 = call noundef ptr @_ZNK4juce5ArrayIPNS_9ComponentENS_20DummyCriticalSectionELi0EE7getLastEv(ptr noundef nonnull align 8 dereferenceable(20) %43)
  %45 = icmp ne ptr %44, %10
  br i1 %45, label %46, label %81

46:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  %47 = load ptr, ptr %6, align 8, !tbaa !5
  %48 = call noundef i32 @_ZNK4juce5ArrayIPNS_9ComponentENS_20DummyCriticalSectionELi0EE7indexOfES2_(ptr noundef nonnull align 8 dereferenceable(20) %47, ptr noundef %10)
  store i32 %48, ptr %7, align 4, !tbaa !42
  %49 = load i32, ptr %7, align 4, !tbaa !42
  %50 = icmp sge i32 %49, 0
  br i1 %50, label %51, label %80

51:                                               ; preds = %46
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  store i32 -1, ptr %8, align 4, !tbaa !42
  %52 = getelementptr inbounds %"class.juce::Component", ptr %10, i32 0, i32 17
  %53 = load i16, ptr %52, align 8
  %54 = lshr i16 %53, 8
  %55 = and i16 %54, 1
  %56 = trunc i16 %55 to i1
  br i1 %56, label %75, label %57

57:                                               ; preds = %51
  %58 = load ptr, ptr %6, align 8, !tbaa !5
  %59 = call noundef i32 @_ZNK4juce5ArrayIPNS_9ComponentENS_20DummyCriticalSectionELi0EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20) %58) #4
  %60 = sub nsw i32 %59, 1
  store i32 %60, ptr %8, align 4, !tbaa !42
  br label %61

61:                                               ; preds = %71, %57
  %62 = load i32, ptr %8, align 4, !tbaa !42
  %63 = icmp sgt i32 %62, 0
  br i1 %63, label %64, label %69

64:                                               ; preds = %61
  %65 = load ptr, ptr %6, align 8, !tbaa !5
  %66 = load i32, ptr %8, align 4, !tbaa !42
  %67 = call noundef ptr @_ZNK4juce5ArrayIPNS_9ComponentENS_20DummyCriticalSectionELi0EE12getUncheckedEi(ptr noundef nonnull align 8 dereferenceable(20) %65, i32 noundef %66)
  %68 = call noundef zeroext i1 @_ZNK4juce9Component13isAlwaysOnTopEv(ptr noundef nonnull align 8 dereferenceable(197) %67) #4
  br label %69

69:                                               ; preds = %64, %61
  %70 = phi i1 [ false, %61 ], [ %68, %64 ]
  br i1 %70, label %71, label %74

71:                                               ; preds = %69
  %72 = load i32, ptr %8, align 4, !tbaa !42
  %73 = add nsw i32 %72, -1
  store i32 %73, ptr %8, align 4, !tbaa !42
  br label %61, !llvm.loop !43

74:                                               ; preds = %69
  br label %75

75:                                               ; preds = %74, %51
  %76 = getelementptr inbounds %"class.juce::Component", ptr %10, i32 0, i32 3
  %77 = load ptr, ptr %76, align 8, !tbaa !15
  %78 = load i32, ptr %7, align 4, !tbaa !42
  %79 = load i32, ptr %8, align 4, !tbaa !42
  call void @_ZN4juce9Component20reorderChildInternalEii(ptr noundef nonnull align 8 dereferenceable(197) %77, i32 noundef %78, i32 noundef %79)
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  br label %80

80:                                               ; preds = %75, %46
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %81

81:                                               ; preds = %80, %39
  %82 = load i8, ptr %4, align 1, !tbaa !9, !range !11, !noundef !12
  %83 = trunc i8 %82 to i1
  br i1 %83, label %84, label %85

84:                                               ; preds = %81
  call void @_ZN4juce9Component22internalBroughtToFrontEv(ptr noundef nonnull align 8 dereferenceable(197) %10)
  call void @_ZN4juce9Component17grabKeyboardFocusEv(ptr noundef nonnull align 8 dereferenceable(197) %10)
  br label %85

85:                                               ; preds = %84, %81
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  br label %86

86:                                               ; preds = %85, %35
  br label %87

87:                                               ; preds = %86, %34
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK4juce9Component16hasKeyboardFocusEb(ptr noundef nonnull align 8 dereferenceable(197), i1 noundef zeroext) #1 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK4juce9Component13isAlwaysOnTopEv(ptr noundef nonnull align 8 dereferenceable(197)) #1 align 2

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4juce9Component7toFrontEb(ptr noundef nonnull align 8 dereferenceable(197) %0, i1 noundef zeroext %1) local_unnamed_addr #2 align 2 {
  %3 = getelementptr inbounds i8, ptr %0, i64 192
  %4 = load i16, ptr %3, align 8
  %5 = trunc i16 %4 to i1
  br i1 %5, label %6, label %14

6:                                                ; preds = %2
  %7 = tail call noundef ptr @_ZNK4juce9Component7getPeerEv(ptr noundef nonnull align 8 dereferenceable(197) %0)
  %.not21 = icmp eq ptr %7, null
  br i1 %.not21, label %36, label %8

8:                                                ; preds = %6
  %9 = load ptr, ptr %7, align 8, !tbaa !5
  %10 = getelementptr inbounds i8, ptr %9, i64 184
  %11 = load ptr, ptr %10, align 8
  tail call void %11(ptr noundef nonnull align 8 dereferenceable(77) %7, i1 noundef zeroext %1)
  br i1 %1, label %12, label %36

12:                                               ; preds = %8
  %13 = tail call noundef zeroext i1 @_ZNK4juce9Component16hasKeyboardFocusEb(ptr noundef nonnull align 8 dereferenceable(197) %0, i1 noundef zeroext true)
  br i1 %13, label %36, label %.sink.split

14:                                               ; preds = %2
  %15 = getelementptr inbounds i8, ptr %0, i64 24
  %16 = load ptr, ptr %15, align 8, !tbaa !8
  %.not = icmp eq ptr %16, null
  br i1 %.not, label %36, label %17

17:                                               ; preds = %14
  %18 = getelementptr inbounds i8, ptr %16, i64 64
  %19 = tail call noundef ptr @_ZNK4juce5ArrayIPNS_9ComponentENS_20DummyCriticalSectionELi0EE7getLastEv(ptr noundef nonnull align 8 dereferenceable(20) %18)
  %.not19 = icmp eq ptr %19, %0
  br i1 %.not19, label %34, label %20

20:                                               ; preds = %17
  %21 = tail call noundef i32 @_ZNK4juce5ArrayIPNS_9ComponentENS_20DummyCriticalSectionELi0EE7indexOfES2_(ptr noundef nonnull align 8 dereferenceable(20) %18, ptr noundef nonnull %0)
  %22 = icmp sgt i32 %21, -1
  br i1 %22, label %23, label %34

23:                                               ; preds = %20
  %24 = load i16, ptr %3, align 8
  %25 = and i16 %24, 256
  %.not20 = icmp eq i16 %25, 0
  br i1 %.not20, label %26, label %.critedge

26:                                               ; preds = %23
  %27 = tail call noundef i32 @_ZNK4juce5ArrayIPNS_9ComponentENS_20DummyCriticalSectionELi0EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20) %18) #3
  br label %28

28:                                               ; preds = %30, %26
  %.0.in = phi i32 [ %27, %26 ], [ %.0, %30 ]
  %.0 = add nsw i32 %.0.in, -1
  %29 = icmp sgt i32 %.0.in, 1
  br i1 %29, label %30, label %.critedge

30:                                               ; preds = %28
  %31 = tail call noundef ptr @_ZNK4juce5ArrayIPNS_9ComponentENS_20DummyCriticalSectionELi0EE12getUncheckedEi(ptr noundef nonnull align 8 dereferenceable(20) %18, i32 noundef %.0)
  %32 = tail call noundef zeroext i1 @_ZNK4juce9Component13isAlwaysOnTopEv(ptr noundef nonnull align 8 dereferenceable(197) %31) #3
  br i1 %32, label %28, label %.critedge, !llvm.loop !37

.critedge:                                        ; preds = %30, %28, %23
  %.1 = phi i32 [ -1, %23 ], [ %.0, %28 ], [ %.0, %30 ]
  %33 = load ptr, ptr %15, align 8, !tbaa !8
  tail call void @_ZN4juce9Component20reorderChildInternalEii(ptr noundef nonnull align 8 dereferenceable(197) %33, i32 noundef %21, i32 noundef %.1)
  br label %34

34:                                               ; preds = %20, %.critedge, %17
  br i1 %1, label %35, label %36

35:                                               ; preds = %34
  tail call void @_ZN4juce9Component22internalBroughtToFrontEv(ptr noundef nonnull align 8 dereferenceable(197) %0)
  br label %.sink.split

.sink.split:                                      ; preds = %12, %35
  tail call void @_ZN4juce9Component17grabKeyboardFocusEv(ptr noundef nonnull align 8 dereferenceable(197) %0)
  br label %36

36:                                               ; preds = %.sink.split, %34, %6, %12, %8, %14
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK4juce9Component16hasKeyboardFocusEb(ptr noundef nonnull align 8 dereferenceable(197), i1 noundef zeroext) local_unnamed_addr #1 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK4juce9Component13isAlwaysOnTopEv(ptr noundef nonnull align 8 dereferenceable(197)) local_unnamed_addr #1 align 2

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

attributes #0 = { 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 #1 = { 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 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !13, i64 24}
!9 = !{!"_ZTSN4juce9ComponentE", !10, i64 0, !11, i64 8, !11, i64 16, !13, i64 24, !15, i64 32, !18, i64 48, !19, i64 56, !20, i64 64, !13, i64 88, !23, i64 96, !13, i64 104, !24, i64 112, !25, i64 120, !26, i64 128, !27, i64 136, !31, i64 160, !35, i64 184, !14, i64 192, !14, i64 196}
!10 = !{!"_ZTSN4juce13MouseListenerE"}
!11 = !{!"_ZTSN4juce6StringE", !12, i64 0}
!12 = !{!"_ZTSN4juce16CharPointer_UTF8E", !13, i64 0}
!13 = !{!"any pointer", !14, i64 0}
!14 = !{!"omnipotent char", !7, i64 0}
!15 = !{!"_ZTSN4juce9RectangleIiEE", !16, i64 0, !17, i64 8, !17, i64 12}
!16 = !{!"_ZTSN4juce5PointIiEE", !17, i64 0, !17, i64 4}
!17 = !{!"int", !14, i64 0}
!18 = !{!"_ZTSN4juce13ScopedPointerINS_9Component10PositionerEEE", !13, i64 0}
!19 = !{!"_ZTSN4juce13ScopedPointerINS_15AffineTransformEEE", !13, 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", !13, i64 0}
!23 = !{!"_ZTSN4juce11MouseCursorE", !13, i64 0}
!24 = !{!"_ZTSN4juce13ScopedPointerINS_20CachedComponentImageEEE", !13, i64 0}
!25 = !{!"_ZTSN4juce13ScopedPointerINS_9Component17MouseListenerListEEE", !13, i64 0}
!26 = !{!"_ZTSN4juce13ScopedPointerINS_5ArrayIPNS_11KeyListenerENS_20DummyCriticalSectionELi0EEEEE", !13, 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", !13, 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", !13, i64 0}
!35 = !{!"_ZTSN4juce13WeakReferenceINS_9ComponentENS_22ReferenceCountedObjectEE6MasterE", !36, i64 0}
!36 = !{!"_ZTSN4juce25ReferenceCountedObjectPtrINS_13WeakReferenceINS_9ComponentENS_22ReferenceCountedObjectEE13SharedPointerEEE", !13, i64 0}
!37 = distinct !{!37, !38}
!38 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass