; 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::RelativeCoordinatePositionerBase" = type <{ %"class.juce::Component::Positioner", %"class.juce::ComponentListener", %"class.juce::MarkerList::Listener", %"class.juce::Array", %"class.juce::Array.190", i8, [7 x i8] }>
%"class.juce::Component::Positioner" = type { ptr, ptr }
%"class.juce::ComponentListener" = type { ptr }
%"class.juce::MarkerList::Listener" = 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::Array.190" = type { %"class.juce::ArrayAllocationBase.191", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.191" = type <{ %"class.juce::HeapBlock.192", i32, [4 x i8] }>
%"class.juce::HeapBlock.192" = type { ptr }

; 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: 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
declare dso_local void @_ZN4juce9Component23removeComponentListenerEPNS_17ComponentListenerE(ptr noundef nonnull align 8 dereferenceable(197), ptr noundef) #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 uwtable
declare dso_local void @_ZN4juce10MarkerList14removeListenerEPNS0_8ListenerE(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef) #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4juce32RelativeCoordinatePositionerBase19unregisterListenersEv(ptr noundef nonnull align 8 dereferenceable(81) %0) #2 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %5 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #3
  %6 = getelementptr inbounds %"class.juce::RelativeCoordinatePositionerBase", ptr %5, i32 0, i32 3
  %7 = call noundef i32 @_ZNK4juce5ArrayIPNS_9ComponentENS_20DummyCriticalSectionELi0EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20) %6) #3
  store i32 %7, ptr %3, align 4, !tbaa !9
  br label %8

8:                                                ; preds = %13, %1
  %9 = load i32, ptr %3, align 4, !tbaa !9
  %10 = add nsw i32 %9, -1
  store i32 %10, ptr %3, align 4, !tbaa !9
  %11 = icmp sge i32 %10, 0
  br i1 %11, label %13, label %12

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

13:                                               ; preds = %8
  %14 = getelementptr inbounds %"class.juce::RelativeCoordinatePositionerBase", ptr %5, i32 0, i32 3
  %15 = load i32, ptr %3, align 4, !tbaa !9
  %16 = call noundef ptr @_ZNK4juce5ArrayIPNS_9ComponentENS_20DummyCriticalSectionELi0EE12getUncheckedEi(ptr noundef nonnull align 8 dereferenceable(20) %14, i32 noundef %15)
  %17 = getelementptr inbounds i8, ptr %5, i64 16
  call void @_ZN4juce9Component23removeComponentListenerEPNS_17ComponentListenerE(ptr noundef nonnull align 8 dereferenceable(197) %16, ptr noundef %17)
  br label %8, !llvm.loop !11

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

21:                                               ; preds = %26, %18
  %22 = load i32, ptr %4, align 4, !tbaa !9
  %23 = add nsw i32 %22, -1
  store i32 %23, ptr %4, align 4, !tbaa !9
  %24 = icmp sge i32 %23, 0
  br i1 %24, label %26, label %25

25:                                               ; preds = %21
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #3
  br label %31

26:                                               ; preds = %21
  %27 = getelementptr inbounds %"class.juce::RelativeCoordinatePositionerBase", ptr %5, i32 0, i32 4
  %28 = load i32, ptr %4, align 4, !tbaa !9
  %29 = call noundef ptr @_ZNK4juce5ArrayIPNS_10MarkerListENS_20DummyCriticalSectionELi0EE12getUncheckedEi(ptr noundef nonnull align 8 dereferenceable(20) %27, i32 noundef %28)
  %30 = getelementptr inbounds i8, ptr %5, i64 24
  call void @_ZN4juce10MarkerList14removeListenerEPNS0_8ListenerE(ptr noundef nonnull align 8 dereferenceable(48) %29, ptr noundef %30)
  br label %21, !llvm.loop !13

31:                                               ; preds = %25
  %32 = getelementptr inbounds %"class.juce::RelativeCoordinatePositionerBase", ptr %5, i32 0, i32 3
  call void @_ZN4juce5ArrayIPNS_9ComponentENS_20DummyCriticalSectionELi0EE5clearEv(ptr noundef nonnull align 8 dereferenceable(20) %32)
  %33 = getelementptr inbounds %"class.juce::RelativeCoordinatePositionerBase", ptr %5, i32 0, i32 4
  call void @_ZN4juce5ArrayIPNS_10MarkerListENS_20DummyCriticalSectionELi0EE5clearEv(ptr noundef nonnull align 8 dereferenceable(20) %33)
  ret void
}

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4juce5ArrayIPNS_10MarkerListENS_20DummyCriticalSectionELi0EE5clearEv(ptr noundef nonnull align 8 dereferenceable(20)) #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 = { 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 }

!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"}
!13 = distinct !{!13, !12}


; 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: 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
declare dso_local void @_ZN4juce9Component23removeComponentListenerEPNS_17ComponentListenerE(ptr noundef nonnull align 8 dereferenceable(197), ptr noundef) local_unnamed_addr #1 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4juce32RelativeCoordinatePositionerBase19unregisterListenersEv(ptr noundef nonnull align 8 dereferenceable(81) %0) local_unnamed_addr #1 align 2 {
  %2 = getelementptr inbounds i8, ptr %0, i64 32
  %3 = tail call noundef i32 @_ZNK4juce5ArrayIPNS_9ComponentENS_20DummyCriticalSectionELi0EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20) %2) #2
  %4 = icmp sgt i32 %3, 0
  br i1 %4, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %1
  %5 = getelementptr inbounds i8, ptr %0, i64 16
  br label %10

._crit_edge:                                      ; preds = %10, %1
  %6 = getelementptr inbounds i8, ptr %0, i64 56
  %7 = tail call noundef i32 @_ZNK4juce5ArrayIPNS_10MarkerListENS_20DummyCriticalSectionELi0EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20) %6) #2
  %8 = icmp sgt i32 %7, 0
  br i1 %8, label %.lr.ph10, label %._crit_edge11

.lr.ph10:                                         ; preds = %._crit_edge
  %9 = getelementptr inbounds i8, ptr %0, i64 24
  br label %14

10:                                               ; preds = %.lr.ph, %10
  %.047 = phi i32 [ %3, %.lr.ph ], [ %11, %10 ]
  %11 = add nsw i32 %.047, -1
  %12 = tail call noundef ptr @_ZNK4juce5ArrayIPNS_9ComponentENS_20DummyCriticalSectionELi0EE12getUncheckedEi(ptr noundef nonnull align 8 dereferenceable(20) %2, i32 noundef %11)
  tail call void @_ZN4juce9Component23removeComponentListenerEPNS_17ComponentListenerE(ptr noundef nonnull align 8 dereferenceable(197) %12, ptr noundef nonnull %5)
  %13 = icmp ugt i32 %.047, 1
  br i1 %13, label %10, label %._crit_edge, !llvm.loop !5

._crit_edge11:                                    ; preds = %14, %._crit_edge
  tail call void @_ZN4juce5ArrayIPNS_9ComponentENS_20DummyCriticalSectionELi0EE5clearEv(ptr noundef nonnull align 8 dereferenceable(20) %2)
  tail call void @_ZN4juce5ArrayIPNS_10MarkerListENS_20DummyCriticalSectionELi0EE5clearEv(ptr noundef nonnull align 8 dereferenceable(20) %6)
  ret void

14:                                               ; preds = %.lr.ph10, %14
  %.08 = phi i32 [ %7, %.lr.ph10 ], [ %15, %14 ]
  %15 = add nsw i32 %.08, -1
  %16 = tail call noundef ptr @_ZNK4juce5ArrayIPNS_10MarkerListENS_20DummyCriticalSectionELi0EE12getUncheckedEi(ptr noundef nonnull align 8 dereferenceable(20) %6, i32 noundef %15)
  tail call void @_ZN4juce10MarkerList14removeListenerEPNS0_8ListenerE(ptr noundef nonnull align 8 dereferenceable(48) %16, ptr noundef nonnull %9)
  %17 = icmp ugt i32 %.08, 1
  br i1 %17, label %14, label %._crit_edge11, !llvm.loop !7
}

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4juce5ArrayIPNS_10MarkerListENS_20DummyCriticalSectionELi0EE5clearEv(ptr noundef nonnull align 8 dereferenceable(20)) local_unnamed_addr #1 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 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 = { 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"}
!7 = distinct !{!7, !6}


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