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

; 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::GenericScopedLock" = type { ptr }
%"class.juce::TreeView" = type <{ %"class.juce::Component.base", [3 x i8], %"class.juce::SettableTooltipClient", %"class.juce::FileDragAndDropTarget", %"class.juce::DragAndDropTarget", %"class.juce::ScopedPointer.283", %"class.juce::CriticalSection", ptr, %"class.juce::ScopedPointer.284", %"class.juce::ScopedPointer.285", i32, i8, i8, i8, i8, i8, [7 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::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 }
%"class.juce::SettableTooltipClient" = type { %"class.juce::TooltipClient", %"class.juce::String" }
%"class.juce::TooltipClient" = type { ptr }
%"class.juce::FileDragAndDropTarget" = type { ptr }
%"class.juce::DragAndDropTarget" = type { ptr }
%"class.juce::ScopedPointer.283" = type { ptr }
%"class.juce::CriticalSection" = type { %union.pthread_mutex_t }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%"class.juce::ScopedPointer.284" = type { ptr }
%"class.juce::ScopedPointer.285" = type { ptr }
%"class.juce::TreeViewItem" = type <{ ptr, ptr, ptr, %"class.juce::OwnedArray.338", i32, i32, i32, i32, i32, i32, i8, [7 x i8] }>
%"class.juce::OwnedArray.338" = type { %"class.juce::ArrayAllocationBase.339", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.339" = type <{ %"class.juce::HeapBlock.340", i32, [4 x i8] }>
%"class.juce::HeapBlock.340" = 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: mustprogress uwtable
declare dso_local void @_ZN4juce9Component7setSizeEii(ptr noundef nonnull align 8 dereferenceable(197), i32 noundef, i32 noundef) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN4juce4jmaxIiEET_S1_S1_(i32 noundef, i32 noundef) #2

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4juce8TreeView19recalculateIfNeededEv(ptr noundef nonnull align 8 dereferenceable(313) %0) #1 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca %"class.juce::GenericScopedLock", align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %6 = load ptr, ptr %2, align 8
  %7 = getelementptr inbounds %"class.juce::TreeView", ptr %6, i32 0, i32 12
  %8 = load i8, ptr %7, align 1, !tbaa !9, !range !46, !noundef !47
  %9 = trunc i8 %8 to i1
  br i1 %9, label %10, label %80

10:                                               ; preds = %1
  %11 = getelementptr inbounds %"class.juce::TreeView", ptr %6, i32 0, i32 12
  store i8 0, ptr %11, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #4
  %12 = getelementptr inbounds %"class.juce::TreeView", ptr %6, i32 0, i32 6
  call void @_ZN4juce17GenericScopedLockINS_15CriticalSectionEEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(40) %12) #4
  %13 = getelementptr inbounds %"class.juce::TreeView", ptr %6, i32 0, i32 7
  %14 = load ptr, ptr %13, align 8, !tbaa !48
  %15 = icmp ne ptr %14, null
  br i1 %15, label %16, label %36

16:                                               ; preds = %10
  %17 = getelementptr inbounds %"class.juce::TreeView", ptr %6, i32 0, i32 7
  %18 = load ptr, ptr %17, align 8, !tbaa !48
  %19 = getelementptr inbounds %"class.juce::TreeView", ptr %6, i32 0, i32 13
  %20 = load i8, ptr %19, align 2, !tbaa !49, !range !46, !noundef !47
  %21 = trunc i8 %20 to i1
  br i1 %21, label %22, label %23

22:                                               ; preds = %16
  br label %29

23:                                               ; preds = %16
  %24 = getelementptr inbounds %"class.juce::TreeView", ptr %6, i32 0, i32 7
  %25 = load ptr, ptr %24, align 8, !tbaa !48
  %26 = getelementptr inbounds %"class.juce::TreeViewItem", ptr %25, i32 0, i32 5
  %27 = load i32, ptr %26, align 4, !tbaa !50
  %28 = sub nsw i32 0, %27
  br label %29

29:                                               ; preds = %23, %22
  %30 = phi i32 [ 0, %22 ], [ %28, %23 ]
  invoke void @_ZN4juce12TreeViewItem15updatePositionsEi(ptr noundef nonnull align 8 dereferenceable(73) %18, i32 noundef %30)
          to label %31 unwind label %32

31:                                               ; preds = %29
  br label %36

32:                                               ; preds = %74, %70, %43, %36, %29
  %33 = landingpad { ptr, i32 }
          cleanup
  %34 = extractvalue { ptr, i32 } %33, 0
  store ptr %34, ptr %4, align 8
  %35 = extractvalue { ptr, i32 } %33, 1
  store i32 %35, ptr %5, align 4
  call void @_ZN4juce17GenericScopedLockINS_15CriticalSectionEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %3) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #4
  br label %81

36:                                               ; preds = %31, %10
  %37 = getelementptr inbounds %"class.juce::TreeView", ptr %6, i32 0, i32 5
  %38 = call noundef ptr @_ZNK4juce13ScopedPointerINS_8TreeView12TreeViewportEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %37) #4
  invoke void @_ZN4juce8TreeView12TreeViewport16updateComponentsEb(ptr noundef nonnull align 8 dereferenceable(1228) %38, i1 noundef zeroext false)
          to label %39 unwind label %32

39:                                               ; preds = %36
  %40 = getelementptr inbounds %"class.juce::TreeView", ptr %6, i32 0, i32 7
  %41 = load ptr, ptr %40, align 8, !tbaa !48
  %42 = icmp ne ptr %41, null
  br i1 %42, label %43, label %74

43:                                               ; preds = %39
  %44 = getelementptr inbounds %"class.juce::TreeView", ptr %6, i32 0, i32 5
  %45 = call noundef ptr @_ZNK4juce13ScopedPointerINS_8TreeView12TreeViewportEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %44) #4
  %46 = call noundef ptr @_ZNK4juce8Viewport18getViewedComponentEv(ptr noundef nonnull align 8 dereferenceable(1224) %45) #4
  %47 = getelementptr inbounds %"class.juce::TreeView", ptr %6, i32 0, i32 5
  %48 = call noundef ptr @_ZNK4juce13ScopedPointerINS_8TreeView12TreeViewportEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %47) #4
  %49 = call noundef i32 @_ZNK4juce8Viewport22getMaximumVisibleWidthEv(ptr noundef nonnull align 8 dereferenceable(1224) %48)
  %50 = getelementptr inbounds %"class.juce::TreeView", ptr %6, i32 0, i32 7
  %51 = load ptr, ptr %50, align 8, !tbaa !48
  %52 = getelementptr inbounds %"class.juce::TreeViewItem", ptr %51, i32 0, i32 8
  %53 = load i32, ptr %52, align 8, !tbaa !55
  %54 = add nsw i32 %53, 50
  %55 = invoke noundef i32 @_ZN4juce4jmaxIiEET_S1_S1_(i32 noundef %49, i32 noundef %54)
          to label %56 unwind label %32

56:                                               ; preds = %43
  %57 = getelementptr inbounds %"class.juce::TreeView", ptr %6, i32 0, i32 7
  %58 = load ptr, ptr %57, align 8, !tbaa !48
  %59 = getelementptr inbounds %"class.juce::TreeViewItem", ptr %58, i32 0, i32 6
  %60 = load i32, ptr %59, align 8, !tbaa !56
  %61 = getelementptr inbounds %"class.juce::TreeView", ptr %6, i32 0, i32 13
  %62 = load i8, ptr %61, align 2, !tbaa !49, !range !46, !noundef !47
  %63 = trunc i8 %62 to i1
  br i1 %63, label %64, label %65

64:                                               ; preds = %56
  br label %70

65:                                               ; preds = %56
  %66 = getelementptr inbounds %"class.juce::TreeView", ptr %6, i32 0, i32 7
  %67 = load ptr, ptr %66, align 8, !tbaa !48
  %68 = getelementptr inbounds %"class.juce::TreeViewItem", ptr %67, i32 0, i32 5
  %69 = load i32, ptr %68, align 4, !tbaa !50
  br label %70

70:                                               ; preds = %65, %64
  %71 = phi i32 [ 0, %64 ], [ %69, %65 ]
  %72 = sub nsw i32 %60, %71
  invoke void @_ZN4juce9Component7setSizeEii(ptr noundef nonnull align 8 dereferenceable(197) %46, i32 noundef %55, i32 noundef %72)
          to label %73 unwind label %32

73:                                               ; preds = %70
  br label %79

74:                                               ; preds = %39
  %75 = getelementptr inbounds %"class.juce::TreeView", ptr %6, i32 0, i32 5
  %76 = call noundef ptr @_ZNK4juce13ScopedPointerINS_8TreeView12TreeViewportEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %75) #4
  %77 = call noundef ptr @_ZNK4juce8Viewport18getViewedComponentEv(ptr noundef nonnull align 8 dereferenceable(1224) %76) #4
  invoke void @_ZN4juce9Component7setSizeEii(ptr noundef nonnull align 8 dereferenceable(197) %77, i32 noundef 0, i32 noundef 0)
          to label %78 unwind label %32

78:                                               ; preds = %74
  br label %79

79:                                               ; preds = %78, %73
  call void @_ZN4juce17GenericScopedLockINS_15CriticalSectionEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %3) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #4
  br label %80

80:                                               ; preds = %79, %1
  ret void

81:                                               ; preds = %32
  %82 = load ptr, ptr %4, align 8
  %83 = load i32, ptr %5, 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 uwtable
declare dso_local void @_ZN4juce12TreeViewItem15updatePositionsEi(ptr noundef nonnull align 8 dereferenceable(73), i32 noundef) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4juce8TreeView12TreeViewport16updateComponentsEb(ptr noundef nonnull align 8 dereferenceable(1228), i1 noundef zeroext) #1 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 = { 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 #3 = { 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 #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, !45, i64 309}
!10 = !{!"_ZTSN4juce8TreeViewE", !11, i64 0, !37, i64 200, !39, i64 216, !40, i64 224, !41, i64 232, !42, i64 240, !6, i64 280, !43, i64 288, !44, i64 296, !17, i64 304, !45, i64 308, !45, i64 309, !45, i64 310, !45, i64 311, !45, i64 312}
!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 = !{!"_ZTSN4juce21SettableTooltipClientE", !38, i64 0, !13, i64 8}
!38 = !{!"_ZTSN4juce13TooltipClientE"}
!39 = !{!"_ZTSN4juce21FileDragAndDropTargetE"}
!40 = !{!"_ZTSN4juce17DragAndDropTargetE"}
!41 = !{!"_ZTSN4juce13ScopedPointerINS_8TreeView12TreeViewportEEE", !6, i64 0}
!42 = !{!"_ZTSN4juce15CriticalSectionE", !7, i64 0}
!43 = !{!"_ZTSN4juce13ScopedPointerINS_8TreeView20InsertPointHighlightEEE", !6, i64 0}
!44 = !{!"_ZTSN4juce13ScopedPointerINS_8TreeView20TargetGroupHighlightEEE", !6, i64 0}
!45 = !{!"bool", !7, i64 0}
!46 = !{i8 0, i8 2}
!47 = !{}
!48 = !{!10, !6, i64 280}
!49 = !{!10, !45, i64 310}
!50 = !{!51, !17, i64 52}
!51 = !{!"_ZTSN4juce12TreeViewItemE", !6, i64 8, !6, i64 16, !52, i64 24, !17, i64 48, !17, i64 52, !17, i64 56, !17, i64 60, !17, i64 64, !17, i64 68, !45, i64 72, !45, i64 72, !45, i64 72, !45, i64 72, !45, i64 72, !45, i64 72, !17, i64 72}
!52 = !{!"_ZTSN4juce10OwnedArrayINS_12TreeViewItemENS_20DummyCriticalSectionEEE", !53, i64 0, !17, i64 16}
!53 = !{!"_ZTSN4juce19ArrayAllocationBaseIPNS_12TreeViewItemENS_20DummyCriticalSectionEEE", !54, i64 0, !17, i64 8}
!54 = !{!"_ZTSN4juce9HeapBlockIPNS_12TreeViewItemELb0EEE", !6, i64 0}
!55 = !{!51, !17, i64 64}
!56 = !{!51, !17, i64 56}


; 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::GenericScopedLock" = 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: mustprogress uwtable
declare dso_local void @_ZN4juce9Component7setSizeEii(ptr noundef nonnull align 8 dereferenceable(197), i32 noundef, i32 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN4juce4jmaxIiEET_S1_S1_(i32 noundef, i32 noundef) local_unnamed_addr #2

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4juce8TreeView19recalculateIfNeededEv(ptr noundef nonnull align 8 dereferenceable(313) %0) local_unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"class.juce::GenericScopedLock", align 8
  %3 = getelementptr inbounds i8, ptr %0, i64 309
  %4 = load i8, ptr %3, align 1, !tbaa !5, !range !45, !noundef !46
  %5 = trunc nuw i8 %4 to i1
  br i1 %5, label %6, label %52

6:                                                ; preds = %1
  store i8 0, ptr %3, align 1, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #4
  %7 = getelementptr inbounds i8, ptr %0, i64 240
  call void @_ZN4juce17GenericScopedLockINS_15CriticalSectionEEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(40) %7) #4
  %8 = getelementptr inbounds i8, ptr %0, i64 280
  %9 = load ptr, ptr %8, align 8, !tbaa !47
  %.not = icmp eq ptr %9, null
  br i1 %.not, label %22, label %10

10:                                               ; preds = %6
  %11 = getelementptr inbounds i8, ptr %0, i64 310
  %12 = load i8, ptr %11, align 2, !tbaa !48, !range !45, !noundef !46
  %13 = trunc nuw i8 %12 to i1
  br i1 %13, label %18, label %14

14:                                               ; preds = %10
  %15 = getelementptr inbounds i8, ptr %9, i64 52
  %16 = load i32, ptr %15, align 4, !tbaa !49
  %17 = sub nsw i32 0, %16
  br label %18

18:                                               ; preds = %10, %14
  %19 = phi i32 [ %17, %14 ], [ 0, %10 ]
  invoke void @_ZN4juce12TreeViewItem15updatePositionsEi(ptr noundef nonnull align 8 dereferenceable(73) %9, i32 noundef %19)
          to label %22 unwind label %20

20:                                               ; preds = %.invoke, %22, %18
  %21 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN4juce17GenericScopedLockINS_15CriticalSectionEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %2) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #4
  resume { ptr, i32 } %21

22:                                               ; preds = %18, %6
  %23 = getelementptr inbounds i8, ptr %0, i64 232
  %24 = call noundef ptr @_ZNK4juce13ScopedPointerINS_8TreeView12TreeViewportEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %23) #4
  invoke void @_ZN4juce8TreeView12TreeViewport16updateComponentsEb(ptr noundef nonnull align 8 dereferenceable(1228) %24, i1 noundef zeroext false)
          to label %25 unwind label %20

25:                                               ; preds = %22
  %26 = load ptr, ptr %8, align 8, !tbaa !47
  %.not2 = icmp eq ptr %26, null
  %27 = call noundef ptr @_ZNK4juce13ScopedPointerINS_8TreeView12TreeViewportEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %23) #4
  %28 = call noundef ptr @_ZNK4juce8Viewport18getViewedComponentEv(ptr noundef nonnull align 8 dereferenceable(1224) %27) #4
  br i1 %.not2, label %.invoke, label %29

29:                                               ; preds = %25
  %30 = call noundef ptr @_ZNK4juce13ScopedPointerINS_8TreeView12TreeViewportEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %23) #4
  %31 = call noundef i32 @_ZNK4juce8Viewport22getMaximumVisibleWidthEv(ptr noundef nonnull align 8 dereferenceable(1224) %30)
  %32 = load ptr, ptr %8, align 8, !tbaa !47
  %33 = getelementptr inbounds i8, ptr %32, i64 64
  %34 = load i32, ptr %33, align 8, !tbaa !54
  %35 = add nsw i32 %34, 50
  %36 = call noundef i32 @_ZN4juce4jmaxIiEET_S1_S1_(i32 noundef %31, i32 noundef %35)
  %37 = load ptr, ptr %8, align 8, !tbaa !47
  %38 = getelementptr inbounds i8, ptr %37, i64 56
  %39 = load i32, ptr %38, align 8, !tbaa !55
  %40 = getelementptr inbounds i8, ptr %0, i64 310
  %41 = load i8, ptr %40, align 2, !tbaa !48, !range !45, !noundef !46
  %42 = trunc nuw i8 %41 to i1
  br i1 %42, label %46, label %43

43:                                               ; preds = %29
  %44 = getelementptr inbounds i8, ptr %37, i64 52
  %45 = load i32, ptr %44, align 4, !tbaa !49
  br label %46

46:                                               ; preds = %29, %43
  %47 = phi i32 [ %45, %43 ], [ 0, %29 ]
  %48 = sub nsw i32 %39, %47
  br label %.invoke

.invoke:                                          ; preds = %25, %46
  %49 = phi i32 [ %36, %46 ], [ 0, %25 ]
  %50 = phi i32 [ %48, %46 ], [ 0, %25 ]
  invoke void @_ZN4juce9Component7setSizeEii(ptr noundef nonnull align 8 dereferenceable(197) %28, i32 noundef %49, i32 noundef %50)
          to label %51 unwind label %20

51:                                               ; preds = %.invoke
  call void @_ZN4juce17GenericScopedLockINS_15CriticalSectionEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %2) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #4
  br label %52

52:                                               ; preds = %51, %1
  ret void
}

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4juce8TreeView12TreeViewport16updateComponentsEb(ptr noundef nonnull align 8 dereferenceable(1228), i1 noundef zeroext) local_unnamed_addr #1 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 = { 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 #3 = { 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 #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, !44, i64 309}
!6 = !{!"_ZTSN4juce8TreeViewE", !7, i64 0, !36, i64 200, !38, i64 216, !39, i64 224, !40, i64 232, !41, i64 240, !11, i64 280, !42, i64 288, !43, i64 296, !16, i64 304, !44, i64 308, !44, i64 309, !44, i64 310, !44, i64 311, !44, i64 312}
!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 = !{!"_ZTSN4juce21SettableTooltipClientE", !37, i64 0, !9, i64 8}
!37 = !{!"_ZTSN4juce13TooltipClientE"}
!38 = !{!"_ZTSN4juce21FileDragAndDropTargetE"}
!39 = !{!"_ZTSN4juce17DragAndDropTargetE"}
!40 = !{!"_ZTSN4juce13ScopedPointerINS_8TreeView12TreeViewportEEE", !11, i64 0}
!41 = !{!"_ZTSN4juce15CriticalSectionE", !12, i64 0}
!42 = !{!"_ZTSN4juce13ScopedPointerINS_8TreeView20InsertPointHighlightEEE", !11, i64 0}
!43 = !{!"_ZTSN4juce13ScopedPointerINS_8TreeView20TargetGroupHighlightEEE", !11, i64 0}
!44 = !{!"bool", !12, i64 0}
!45 = !{i8 0, i8 2}
!46 = !{}
!47 = !{!6, !11, i64 280}
!48 = !{!6, !44, i64 310}
!49 = !{!50, !16, i64 52}
!50 = !{!"_ZTSN4juce12TreeViewItemE", !11, i64 8, !11, i64 16, !51, i64 24, !16, i64 48, !16, i64 52, !16, i64 56, !16, i64 60, !16, i64 64, !16, i64 68, !44, i64 72, !44, i64 72, !44, i64 72, !44, i64 72, !44, i64 72, !44, i64 72, !16, i64 72}
!51 = !{!"_ZTSN4juce10OwnedArrayINS_12TreeViewItemENS_20DummyCriticalSectionEEE", !52, i64 0, !16, i64 16}
!52 = !{!"_ZTSN4juce19ArrayAllocationBaseIPNS_12TreeViewItemENS_20DummyCriticalSectionEEE", !53, i64 0, !16, i64 8}
!53 = !{!"_ZTSN4juce9HeapBlockIPNS_12TreeViewItemELb0EEE", !11, i64 0}
!54 = !{!50, !16, i64 64}
!55 = !{!50, !16, i64 56}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,SimplifyCFGPass