; 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::Array.288" = type { %"class.juce::ArrayAllocationBase.289", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.289" = type <{ %"class.juce::HeapBlock.290", i32, [4 x i8] }>
%"class.juce::HeapBlock.290" = type { ptr }
%"class.juce::ApplicationCommandManager" = type { %"class.juce::AsyncUpdater", %"class.juce::FocusChangeListener", %"class.juce::OwnedArray.126", %"class.juce::ListenerList.131", %"class.juce::ScopedPointer.137", ptr }
%"class.juce::AsyncUpdater" = type { ptr, %"class.juce::ReferenceCountedObjectPtr.15" }
%"class.juce::ReferenceCountedObjectPtr.15" = type { ptr }
%"class.juce::FocusChangeListener" = type { ptr }
%"class.juce::OwnedArray.126" = type { %"class.juce::ArrayAllocationBase.127", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.127" = type <{ %"class.juce::HeapBlock.128", i32, [4 x i8] }>
%"class.juce::HeapBlock.128" = type { ptr }
%"class.juce::ListenerList.131" = type { %"class.juce::Array.132" }
%"class.juce::Array.132" = type { %"class.juce::ArrayAllocationBase.133", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.133" = type <{ %"class.juce::HeapBlock.134", i32, [4 x i8] }>
%"class.juce::HeapBlock.134" = type { ptr }
%"class.juce::ScopedPointer.137" = type { ptr }
%"struct.juce::ApplicationCommandInfo" = type <{ i32, [4 x i8], %"class.juce::String", %"class.juce::String", %"class.juce::String", %"class.juce::Array.104", i32, [4 x i8] }>
%"class.juce::String" = type { %"class.juce::CharPointer_UTF8" }
%"class.juce::CharPointer_UTF8" = type { ptr }
%"class.juce::Array.104" = type { %"class.juce::ArrayAllocationBase.105", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.105" = type <{ %"class.juce::HeapBlock.106", i32, [4 x i8] }>
%"class.juce::HeapBlock.106" = 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: nounwind
declare noundef zeroext i1 @_ZN4juceeqERKNS_6StringES2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #1

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4juce5ArrayIiNS_20DummyCriticalSectionELi0EE3addERKi(ptr noundef nonnull align 8 dereferenceable(20), ptr noundef nonnull align 4 dereferenceable(4)) #3 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK4juce25ApplicationCommandManager21getCommandsInCategoryERKNS_6StringE(ptr dead_on_unwind noalias writable sret(%"class.juce::Array.288") align 8 %0, ptr noundef nonnull align 8 dereferenceable(88) %1, ptr noundef nonnull align 8 dereferenceable(8) %2) #3 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i1, align 1
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  store ptr %0, ptr %4, align 8
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  %11 = load ptr, ptr %5, align 8
  store i1 false, ptr %7, align 1
  call void @_ZN4juce5ArrayIiNS_20DummyCriticalSectionELi0EEC2Ev(ptr noundef nonnull align 8 dereferenceable(20) %0) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 0, ptr %8, align 4, !tbaa !9
  br label %12

12:                                               ; preds = %36, %3
  %13 = load i32, ptr %8, align 4, !tbaa !9
  %14 = getelementptr inbounds %"class.juce::ApplicationCommandManager", ptr %11, i32 0, i32 2
  %15 = call noundef i32 @_ZNK4juce10OwnedArrayINS_22ApplicationCommandInfoENS_20DummyCriticalSectionEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20) %14) #5
  %16 = icmp slt i32 %13, %15
  br i1 %16, label %18, label %17

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

18:                                               ; preds = %12
  %19 = getelementptr inbounds %"class.juce::ApplicationCommandManager", ptr %11, i32 0, i32 2
  %20 = load i32, ptr %8, align 4, !tbaa !9
  %21 = call noundef ptr @_ZNK4juce10OwnedArrayINS_22ApplicationCommandInfoENS_20DummyCriticalSectionEE12getUncheckedEi(ptr noundef nonnull align 8 dereferenceable(20) %19, i32 noundef %20) #5
  %22 = getelementptr inbounds %"struct.juce::ApplicationCommandInfo", ptr %21, i32 0, i32 4
  %23 = load ptr, ptr %6, align 8, !tbaa !5
  %24 = call noundef zeroext i1 @_ZN4juceeqERKNS_6StringES2_(ptr noundef nonnull align 8 dereferenceable(8) %22, ptr noundef nonnull align 8 dereferenceable(8) %23) #5
  br i1 %24, label %25, label %35

25:                                               ; preds = %18
  %26 = getelementptr inbounds %"class.juce::ApplicationCommandManager", ptr %11, i32 0, i32 2
  %27 = load i32, ptr %8, align 4, !tbaa !9
  %28 = call noundef ptr @_ZNK4juce10OwnedArrayINS_22ApplicationCommandInfoENS_20DummyCriticalSectionEE12getUncheckedEi(ptr noundef nonnull align 8 dereferenceable(20) %26, i32 noundef %27) #5
  %29 = getelementptr inbounds %"struct.juce::ApplicationCommandInfo", ptr %28, i32 0, i32 0
  invoke void @_ZN4juce5ArrayIiNS_20DummyCriticalSectionELi0EE3addERKi(ptr noundef nonnull align 8 dereferenceable(20) %0, ptr noundef nonnull align 4 dereferenceable(4) %29)
          to label %30 unwind label %31

30:                                               ; preds = %25
  br label %35

31:                                               ; preds = %25
  %32 = landingpad { ptr, i32 }
          cleanup
  %33 = extractvalue { ptr, i32 } %32, 0
  store ptr %33, ptr %9, align 8
  %34 = extractvalue { ptr, i32 } %32, 1
  store i32 %34, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @_ZN4juce5ArrayIiNS_20DummyCriticalSectionELi0EED2Ev(ptr noundef nonnull align 8 dereferenceable(20) %0) #5
  br label %43

35:                                               ; preds = %30, %18
  br label %36

36:                                               ; preds = %35
  %37 = load i32, ptr %8, align 4, !tbaa !9
  %38 = add nsw i32 %37, 1
  store i32 %38, ptr %8, align 4, !tbaa !9
  br label %12, !llvm.loop !11

39:                                               ; preds = %17
  store i1 true, ptr %7, align 1
  %40 = load i1, ptr %7, align 1
  br i1 %40, label %42, label %41

41:                                               ; preds = %39
  call void @_ZN4juce5ArrayIiNS_20DummyCriticalSectionELi0EED2Ev(ptr noundef nonnull align 8 dereferenceable(20) %0) #5
  br label %42

42:                                               ; preds = %41, %39
  ret void

43:                                               ; preds = %31
  %44 = load ptr, ptr %9, align 8
  %45 = load i32, ptr %10, align 4
  %46 = insertvalue { ptr, i32 } poison, ptr %44, 0
  %47 = insertvalue { ptr, i32 } %46, i32 %45, 1
  resume { ptr, i32 } %47
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind "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 = { 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 = { 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 #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::Array.288" = type { %"class.juce::ArrayAllocationBase.289", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.289" = type <{ %"class.juce::HeapBlock.290", i32, [4 x i8] }>
%"class.juce::HeapBlock.290" = type { ptr }

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nounwind
declare noundef zeroext i1 @_ZN4juceeqERKNS_6StringES2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #0

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK4juce25ApplicationCommandManager21getCommandsInCategoryERKNS_6StringE(ptr dead_on_unwind noalias nonnull writable sret(%"class.juce::Array.288") align 8 %0, ptr noundef nonnull align 8 dereferenceable(88) %1, ptr noundef nonnull align 8 dereferenceable(8) %2) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  tail call void @_ZN4juce5ArrayIiNS_20DummyCriticalSectionELi0EEC2Ev(ptr noundef nonnull align 8 dereferenceable(20) %0) #4
  %4 = getelementptr inbounds i8, ptr %1, i64 24
  %5 = tail call noundef i32 @_ZNK4juce10OwnedArrayINS_22ApplicationCommandInfoENS_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

.lr.ph:                                           ; preds = %3, %14
  %.08 = phi i32 [ %15, %14 ], [ 0, %3 ]
  %7 = tail call noundef ptr @_ZNK4juce10OwnedArrayINS_22ApplicationCommandInfoENS_20DummyCriticalSectionEE12getUncheckedEi(ptr noundef nonnull align 8 dereferenceable(20) %4, i32 noundef %.08) #4
  %8 = getelementptr inbounds i8, ptr %7, i64 24
  %9 = tail call noundef zeroext i1 @_ZN4juceeqERKNS_6StringES2_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %2) #4
  br i1 %9, label %10, label %14

10:                                               ; preds = %.lr.ph
  %11 = tail call noundef ptr @_ZNK4juce10OwnedArrayINS_22ApplicationCommandInfoENS_20DummyCriticalSectionEE12getUncheckedEi(ptr noundef nonnull align 8 dereferenceable(20) %4, i32 noundef %.08) #4
  invoke void @_ZN4juce5ArrayIiNS_20DummyCriticalSectionELi0EE3addERKi(ptr noundef nonnull align 8 dereferenceable(20) %0, ptr noundef nonnull align 4 dereferenceable(4) %11)
          to label %14 unwind label %12

12:                                               ; preds = %10
  %13 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZN4juce5ArrayIiNS_20DummyCriticalSectionELi0EED2Ev(ptr noundef nonnull align 8 dereferenceable(20) %0) #4
  resume { ptr, i32 } %13

14:                                               ; preds = %.lr.ph, %10
  %15 = add nuw nsw i32 %.08, 1
  %16 = tail call noundef i32 @_ZNK4juce10OwnedArrayINS_22ApplicationCommandInfoENS_20DummyCriticalSectionEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20) %4) #4
  %17 = icmp slt i32 %15, %16
  br i1 %17, label %.lr.ph, label %._crit_edge, !llvm.loop !5

._crit_edge:                                      ; preds = %14, %3
  ret void
}

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


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