; LLVM IR from modlfo/AudioEngine :: AudioEngine/JuceLibraryCode (juce_data_structures)

; 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::ValueTree" = type { %"class.juce::ReferenceCountedObjectPtr.6", %"class.juce::ListenerList.7" }
%"class.juce::ReferenceCountedObjectPtr.6" = type { ptr }
%"class.juce::ListenerList.7" = type { %"class.juce::Array.8" }
%"class.juce::Array.8" = type { %"class.juce::ArrayAllocationBase.9", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.9" = type <{ %"class.juce::HeapBlock.10", i32, [4 x i8] }>
%"class.juce::HeapBlock.10" = type { ptr }
%"class.juce::ValueTree::SharedObject" = type { %"class.juce::ReferenceCountedObject", %"class.juce::Identifier", %"class.juce::NamedValueSet", %"class.juce::ReferenceCountedArray", %"class.juce::SortedSet.21", ptr }
%"class.juce::ReferenceCountedObject" = type { ptr, %"class.juce::Atomic" }
%"class.juce::Atomic" = type { i32, [4 x i8] }
%"class.juce::Identifier" = type { %"class.juce::String" }
%"class.juce::String" = type { %"class.juce::CharPointer_UTF8" }
%"class.juce::CharPointer_UTF8" = type { ptr }
%"class.juce::NamedValueSet" = type { %"class.juce::Array.13" }
%"class.juce::Array.13" = type { %"class.juce::ArrayAllocationBase.14", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.14" = type <{ %"class.juce::HeapBlock.15", i32, [4 x i8] }>
%"class.juce::HeapBlock.15" = type { ptr }
%"class.juce::ReferenceCountedArray" = type { %"class.juce::ArrayAllocationBase.18", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.18" = type <{ %"class.juce::HeapBlock.19", i32, [4 x i8] }>
%"class.juce::HeapBlock.19" = type { ptr }
%"class.juce::SortedSet.21" = type { %"class.juce::Array.22" }
%"class.juce::Array.22" = type { %"class.juce::ArrayAllocationBase.23", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.23" = type <{ %"class.juce::HeapBlock.24", i32, [4 x i8] }>
%"class.juce::HeapBlock.24" = type { ptr }

; 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: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) #1

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK4juce9ValueTree20createListOfChildrenERNS_10OwnedArrayIS0_NS_20DummyCriticalSectionEEE(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull align 8 dereferenceable(20) %1) #4 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %6 = load ptr, ptr %3, align 8
  br label %7

7:                                                ; preds = %2
  br label %8

8:                                                ; preds = %7
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  store i32 0, ptr %5, align 4, !tbaa !9
  br label %9

9:                                                ; preds = %26, %8
  %10 = load i32, ptr %5, align 4, !tbaa !9
  %11 = getelementptr inbounds %"class.juce::ValueTree", ptr %6, i32 0, i32 0
  %12 = call noundef ptr @_ZNK4juce25ReferenceCountedObjectPtrINS_9ValueTree12SharedObjectEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %11) #5
  %13 = getelementptr inbounds %"class.juce::ValueTree::SharedObject", ptr %12, i32 0, i32 3
  %14 = call noundef i32 @_ZNK4juce21ReferenceCountedArrayINS_9ValueTree12SharedObjectENS_20DummyCriticalSectionEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20) %13) #5
  %15 = icmp slt i32 %10, %14
  br i1 %15, label %17, label %16

16:                                               ; preds = %9
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %29

17:                                               ; preds = %9
  %18 = load ptr, ptr %4, align 8, !tbaa !5
  %19 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 32) #6
  %20 = getelementptr inbounds %"class.juce::ValueTree", ptr %6, i32 0, i32 0
  %21 = call noundef ptr @_ZNK4juce25ReferenceCountedObjectPtrINS_9ValueTree12SharedObjectEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %20) #5
  %22 = getelementptr inbounds %"class.juce::ValueTree::SharedObject", ptr %21, i32 0, i32 3
  %23 = load i32, ptr %5, align 4, !tbaa !9
  %24 = call noundef ptr @_ZNK4juce21ReferenceCountedArrayINS_9ValueTree12SharedObjectENS_20DummyCriticalSectionEE25getObjectPointerUncheckedEi(ptr noundef nonnull align 8 dereferenceable(20) %22, i32 noundef %23) #5
  call void @_ZN4juce9ValueTreeC1EPNS0_12SharedObjectE(ptr noundef nonnull align 8 dereferenceable(32) %19, ptr noundef %24) #5
  %25 = call noundef ptr @_ZN4juce10OwnedArrayINS_9ValueTreeENS_20DummyCriticalSectionEE3addEPS1_(ptr noundef nonnull align 8 dereferenceable(20) %18, ptr noundef %19) #5
  br label %26

26:                                               ; preds = %17
  %27 = load i32, ptr %5, align 4, !tbaa !9
  %28 = add nsw i32 %27, 1
  store i32 %28, ptr %5, align 4, !tbaa !9
  br label %9, !llvm.loop !11

29:                                               ; preds = %16
  ret void
}

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

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

declare void @_ZN4juce9ValueTreeC1EPNS0_12SharedObjectE(ptr, ptr)

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nobuiltin allocsize(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 = { 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 }
attributes #6 = { builtin allocsize(0) }

!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"

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) local_unnamed_addr #0

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

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

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

._crit_edge:                                      ; preds = %.lr.ph, %2
  ret void

.lr.ph:                                           ; preds = %2, %.lr.ph
  %.04 = phi i32 [ %12, %.lr.ph ], [ 0, %2 ]
  %7 = tail call noalias noundef nonnull dereferenceable(32) ptr @_Znwm(i64 noundef 32) #5
  %8 = tail call noundef ptr @_ZNK4juce25ReferenceCountedObjectPtrINS_9ValueTree12SharedObjectEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %0) #4
  %9 = getelementptr inbounds i8, ptr %8, i64 48
  %10 = tail call noundef ptr @_ZNK4juce21ReferenceCountedArrayINS_9ValueTree12SharedObjectENS_20DummyCriticalSectionEE25getObjectPointerUncheckedEi(ptr noundef nonnull align 8 dereferenceable(20) %9, i32 noundef %.04) #4
  tail call void @_ZN4juce9ValueTreeC1EPNS0_12SharedObjectE(ptr noundef nonnull align 8 dereferenceable(32) %7, ptr noundef %10) #4
  %11 = tail call noundef ptr @_ZN4juce10OwnedArrayINS_9ValueTreeENS_20DummyCriticalSectionEE3addEPS1_(ptr noundef nonnull align 8 dereferenceable(20) %1, ptr noundef nonnull %7) #4
  %12 = add nuw nsw i32 %.04, 1
  %13 = tail call noundef ptr @_ZNK4juce25ReferenceCountedObjectPtrINS_9ValueTree12SharedObjectEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %0) #4
  %14 = getelementptr inbounds i8, ptr %13, i64 48
  %15 = tail call noundef i32 @_ZNK4juce21ReferenceCountedArrayINS_9ValueTree12SharedObjectENS_20DummyCriticalSectionEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20) %14) #4
  %16 = icmp slt i32 %12, %15
  br i1 %16, label %.lr.ph, label %._crit_edge, !llvm.loop !5
}

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

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

declare void @_ZN4juce9ValueTreeC1EPNS0_12SharedObjectE(ptr, ptr) local_unnamed_addr

attributes #0 = { nobuiltin allocsize(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 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 = { 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 }
attributes #5 = { builtin allocsize(0) }

!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: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass