; 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::Point" = type { i32, i32 }
%"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::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: 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 void @_ZN4juce5PointIiEC2ERKS1_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) 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) #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN4juce9Component16ComponentHelpers7hitTestERS0_NS_5PointIiEE(ptr noundef nonnull align 8 dereferenceable(197), ptr noundef) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4juce9Component16ComponentHelpers22convertFromParentSpaceINS_5PointIiEEEET_RKS0_S5_(ptr dead_on_unwind noalias writable sret(%"class.juce::Point") align 4, ptr noundef nonnull align 8 dereferenceable(197), ptr noundef) #4 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZN4juce9Component14getComponentAtENS_5PointIiEE(ptr noundef nonnull align 8 dereferenceable(197) %0, ptr noundef %1) #4 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca %"class.juce::Point", align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca %"class.juce::Point", align 4
  %11 = alloca %"class.juce::Point", align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %12 = load ptr, ptr %4, align 8
  %13 = getelementptr inbounds %"class.juce::Component", ptr %12, i32 0, i32 17
  %14 = load i16, ptr %13, align 8
  %15 = lshr i16 %14, 1
  %16 = and i16 %15, 1
  %17 = trunc i16 %16 to i1
  br i1 %17, label %18, label %46

18:                                               ; preds = %2
  call void @_ZN4juce5PointIiEC2ERKS1_(ptr noundef nonnull align 4 dereferenceable(8) %6, ptr noundef nonnull align 4 dereferenceable(8) %1) #5
  %19 = call noundef zeroext i1 @_ZN4juce9Component16ComponentHelpers7hitTestERS0_NS_5PointIiEE(ptr noundef nonnull align 8 dereferenceable(197) %12, ptr noundef %6)
  br i1 %19, label %20, label %46

20:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  %21 = getelementptr inbounds %"class.juce::Component", ptr %12, i32 0, i32 7
  %22 = call noundef i32 @_ZNK4juce5ArrayIPNS_9ComponentENS_20DummyCriticalSectionELi0EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20) %21) #5
  store i32 %22, ptr %7, align 4, !tbaa !9
  br label %23

23:                                               ; preds = %42, %20
  %24 = load i32, ptr %7, align 4, !tbaa !9
  %25 = add nsw i32 %24, -1
  store i32 %25, ptr %7, align 4, !tbaa !9
  %26 = icmp sge i32 %25, 0
  br i1 %26, label %28, label %27

27:                                               ; preds = %23
  store i32 2, ptr %8, align 4
  br label %43

28:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %29 = getelementptr inbounds %"class.juce::Component", ptr %12, i32 0, i32 7
  %30 = load i32, ptr %7, align 4, !tbaa !9
  %31 = call noundef ptr @_ZNK4juce5ArrayIPNS_9ComponentENS_20DummyCriticalSectionELi0EE12getUncheckedEi(ptr noundef nonnull align 8 dereferenceable(20) %29, i32 noundef %30)
  store ptr %31, ptr %9, align 8, !tbaa !5
  %32 = load ptr, ptr %9, align 8, !tbaa !5
  %33 = load ptr, ptr %9, align 8, !tbaa !5
  call void @_ZN4juce5PointIiEC2ERKS1_(ptr noundef nonnull align 4 dereferenceable(8) %11, ptr noundef nonnull align 4 dereferenceable(8) %1) #5
  call void @_ZN4juce9Component16ComponentHelpers22convertFromParentSpaceINS_5PointIiEEEET_RKS0_S5_(ptr dead_on_unwind writable sret(%"class.juce::Point") align 4 %10, ptr noundef nonnull align 8 dereferenceable(197) %33, ptr noundef %11)
  %34 = call noundef ptr @_ZN4juce9Component14getComponentAtENS_5PointIiEE(ptr noundef nonnull align 8 dereferenceable(197) %32, ptr noundef %10)
  store ptr %34, ptr %9, align 8, !tbaa !5
  %35 = load ptr, ptr %9, align 8, !tbaa !5
  %36 = icmp ne ptr %35, null
  br i1 %36, label %37, label %39

37:                                               ; preds = %28
  %38 = load ptr, ptr %9, align 8, !tbaa !5
  store ptr %38, ptr %3, align 8
  store i32 1, ptr %8, align 4
  br label %40

39:                                               ; preds = %28
  store i32 0, ptr %8, align 4
  br label %40

40:                                               ; preds = %39, %37
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  %41 = load i32, ptr %8, align 4
  switch i32 %41, label %43 [
    i32 0, label %42
  ]

42:                                               ; preds = %40
  br label %23, !llvm.loop !11

43:                                               ; preds = %40, %27
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  %44 = load i32, ptr %8, align 4
  switch i32 %44, label %49 [
    i32 2, label %45
    i32 1, label %47
  ]

45:                                               ; preds = %43
  store ptr %12, ptr %3, align 8
  br label %47

46:                                               ; preds = %18, %2
  store ptr null, ptr %3, align 8
  br label %47

47:                                               ; preds = %46, %45, %43
  %48 = load ptr, ptr %3, align 8
  ret ptr %48

49:                                               ; preds = %43
  unreachable
}

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 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 = { 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 #5 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.juce::Point" = type { i32, i32 }

; 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 void @_ZN4juce5PointIiEC2ERKS1_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) unnamed_addr #1 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: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN4juce9Component16ComponentHelpers7hitTestERS0_NS_5PointIiEE(ptr noundef nonnull align 8 dereferenceable(197), ptr noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4juce9Component16ComponentHelpers22convertFromParentSpaceINS_5PointIiEEEET_RKS0_S5_(ptr dead_on_unwind noalias writable sret(%"class.juce::Point") align 4, ptr noundef nonnull align 8 dereferenceable(197), ptr noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZN4juce9Component14getComponentAtENS_5PointIiEE(ptr noundef nonnull align 8 dereferenceable(197) %0, ptr noundef %1) local_unnamed_addr #3 align 2 {
  %3 = alloca %"class.juce::Point", align 4
  %4 = alloca %"class.juce::Point", align 4
  %5 = alloca %"class.juce::Point", align 4
  %6 = getelementptr inbounds i8, ptr %0, i64 192
  %7 = load i16, ptr %6, align 8
  %8 = and i16 %7, 2
  %.not = icmp eq i16 %8, 0
  br i1 %.not, label %.loopexit, label %9

9:                                                ; preds = %2
  call void @_ZN4juce5PointIiEC2ERKS1_(ptr noundef nonnull align 4 dereferenceable(8) %3, ptr noundef nonnull align 4 dereferenceable(8) %1) #4
  %10 = call noundef zeroext i1 @_ZN4juce9Component16ComponentHelpers7hitTestERS0_NS_5PointIiEE(ptr noundef nonnull align 8 dereferenceable(197) %0, ptr noundef nonnull %3)
  br i1 %10, label %11, label %.loopexit

11:                                               ; preds = %9
  %12 = getelementptr inbounds i8, ptr %0, i64 64
  %13 = call noundef i32 @_ZNK4juce5ArrayIPNS_9ComponentENS_20DummyCriticalSectionELi0EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20) %12) #4
  br label %14

14:                                               ; preds = %16, %11
  %.09 = phi i32 [ %13, %11 ], [ %17, %16 ]
  %15 = icmp slt i32 %.09, 1
  br i1 %15, label %.loopexit, label %16

16:                                               ; preds = %14
  %17 = add nsw i32 %.09, -1
  %18 = call noundef ptr @_ZNK4juce5ArrayIPNS_9ComponentENS_20DummyCriticalSectionELi0EE12getUncheckedEi(ptr noundef nonnull align 8 dereferenceable(20) %12, i32 noundef %17)
  call void @_ZN4juce5PointIiEC2ERKS1_(ptr noundef nonnull align 4 dereferenceable(8) %5, ptr noundef nonnull align 4 dereferenceable(8) %1) #4
  call void @_ZN4juce9Component16ComponentHelpers22convertFromParentSpaceINS_5PointIiEEEET_RKS0_S5_(ptr dead_on_unwind nonnull writable sret(%"class.juce::Point") align 4 %4, ptr noundef nonnull align 8 dereferenceable(197) %18, ptr noundef nonnull %5)
  %19 = call noundef ptr @_ZN4juce9Component14getComponentAtENS_5PointIiEE(ptr noundef nonnull align 8 dereferenceable(197) %18, ptr noundef nonnull %4)
  %.not14 = icmp eq ptr %19, null
  br i1 %.not14, label %14, label %.loopexit, !llvm.loop !5

.loopexit:                                        ; preds = %16, %14, %2, %9
  %.3 = phi ptr [ null, %9 ], [ null, %2 ], [ %0, %14 ], [ %19, %16 ]
  ret ptr %.3
}

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 = { inlinehint 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 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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}


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