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

; 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::CodeDocument" = type { %"class.juce::OwnedArray", %"class.juce::Array.8", %"class.juce::UndoManager", i32, i32, i32, [4 x i8], %"class.juce::ListenerList.18", %"class.juce::String" }
%"class.juce::OwnedArray" = 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::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::UndoManager" = type <{ %"class.juce::ChangeBroadcaster", %"class.juce::OwnedArray.13", %"class.juce::OwnedArray.13", %"class.juce::String", i32, i32, i32, i32, i8, i8, [6 x i8] }>
%"class.juce::ChangeBroadcaster" = type { ptr, %"class.juce::ChangeBroadcaster::ChangeBroadcasterCallback", %"class.juce::ListenerList" }
%"class.juce::ChangeBroadcaster::ChangeBroadcasterCallback" = type { %"class.juce::AsyncUpdater", ptr }
%"class.juce::AsyncUpdater" = type { ptr, %"class.juce::ReferenceCountedObjectPtr" }
%"class.juce::ReferenceCountedObjectPtr" = type { ptr }
%"class.juce::ListenerList" = type { %"class.juce::Array" }
%"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::OwnedArray.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::ListenerList.18" = type { %"class.juce::Array.19" }
%"class.juce::Array.19" = type { %"class.juce::ArrayAllocationBase.20", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.20" = type <{ %"class.juce::HeapBlock.21", i32, [4 x i8] }>
%"class.juce::HeapBlock.21" = type { ptr }
%"class.juce::String" = type { %"class.juce::CharPointer_UTF8" }
%"class.juce::CharPointer_UTF8" = type { ptr }
%"class.juce::CodeDocumentLine" = type <{ %"class.juce::String", i32, i32, i32, [4 x i8] }>

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

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

; Function Attrs: noinline noreturn nounwind uwtable
declare hidden void @__clang_call_terminate(ptr noundef) #2

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

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef i32 @_ZN4juce12CodeDocument20getMaximumLineLengthEv(ptr noundef nonnull align 8 dereferenceable(232) %0) #3 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %4 = load ptr, ptr %2, align 8
  %5 = getelementptr inbounds %"class.juce::CodeDocument", ptr %4, i32 0, i32 5
  %6 = load i32, ptr %5, align 8, !tbaa !9
  %7 = icmp slt i32 %6, 0
  br i1 %7, label %8, label %29

8:                                                ; preds = %1
  %9 = getelementptr inbounds %"class.juce::CodeDocument", ptr %4, i32 0, i32 5
  store i32 0, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  %10 = getelementptr inbounds %"class.juce::CodeDocument", ptr %4, i32 0, i32 0
  %11 = call noundef i32 @_ZNK4juce10OwnedArrayINS_16CodeDocumentLineENS_20DummyCriticalSectionEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20) %10) #4
  store i32 %11, ptr %3, align 4, !tbaa !37
  br label %12

12:                                               ; preds = %26, %8
  %13 = load i32, ptr %3, align 4, !tbaa !37
  %14 = add nsw i32 %13, -1
  store i32 %14, ptr %3, align 4, !tbaa !37
  %15 = icmp sge i32 %14, 0
  br i1 %15, label %17, label %16

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

17:                                               ; preds = %12
  %18 = getelementptr inbounds %"class.juce::CodeDocument", ptr %4, i32 0, i32 5
  %19 = load i32, ptr %18, align 8, !tbaa !9
  %20 = getelementptr inbounds %"class.juce::CodeDocument", ptr %4, i32 0, i32 0
  %21 = load i32, ptr %3, align 4, !tbaa !37
  %22 = call noundef ptr @_ZNK4juce10OwnedArrayINS_16CodeDocumentLineENS_20DummyCriticalSectionEE12getUncheckedEi(ptr noundef nonnull align 8 dereferenceable(20) %20, i32 noundef %21) #4
  %23 = getelementptr inbounds %"class.juce::CodeDocumentLine", ptr %22, i32 0, i32 2
  %24 = load i32, ptr %23, align 4, !tbaa !38
  %25 = invoke noundef i32 @_ZN4juce4jmaxIiEET_S1_S1_(i32 noundef %19, i32 noundef %24)
          to label %26 unwind label %32

26:                                               ; preds = %17
  %27 = getelementptr inbounds %"class.juce::CodeDocument", ptr %4, i32 0, i32 5
  store i32 %25, ptr %27, align 8, !tbaa !9
  br label %12, !llvm.loop !40

28:                                               ; preds = %16
  br label %29

29:                                               ; preds = %28, %1
  %30 = getelementptr inbounds %"class.juce::CodeDocument", ptr %4, i32 0, i32 5
  %31 = load i32, ptr %30, align 8, !tbaa !9
  ret i32 %31

32:                                               ; preds = %17
  %33 = landingpad { ptr, i32 }
          catch ptr null
  %34 = extractvalue { ptr, i32 } %33, 0
  call void @__clang_call_terminate(ptr %34) #5
  unreachable
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { noinline noreturn nounwind uwtable "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 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 }
attributes #5 = { noreturn 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, !14, i64 192}
!10 = !{!"_ZTSN4juce12CodeDocumentE", !11, i64 0, !15, i64 24, !18, i64 48, !14, i64 184, !14, i64 188, !14, i64 192, !33, i64 200, !30, i64 224}
!11 = !{!"_ZTSN4juce10OwnedArrayINS_16CodeDocumentLineENS_20DummyCriticalSectionEEE", !12, i64 0, !14, i64 16}
!12 = !{!"_ZTSN4juce19ArrayAllocationBaseIPNS_16CodeDocumentLineENS_20DummyCriticalSectionEEE", !13, i64 0, !14, i64 8}
!13 = !{!"_ZTSN4juce9HeapBlockIPNS_16CodeDocumentLineELb0EEE", !6, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = !{!"_ZTSN4juce5ArrayIPNS_12CodeDocument8PositionENS_20DummyCriticalSectionELi0EEE", !16, i64 0, !14, i64 16}
!16 = !{!"_ZTSN4juce19ArrayAllocationBaseIPNS_12CodeDocument8PositionENS_20DummyCriticalSectionEEE", !17, i64 0, !14, i64 8}
!17 = !{!"_ZTSN4juce9HeapBlockIPNS_12CodeDocument8PositionELb0EEE", !6, i64 0}
!18 = !{!"_ZTSN4juce11UndoManagerE", !19, i64 0, !27, i64 56, !27, i64 80, !30, i64 104, !14, i64 112, !14, i64 116, !14, i64 120, !14, i64 124, !32, i64 128, !32, i64 129}
!19 = !{!"_ZTSN4juce17ChangeBroadcasterE", !20, i64 8, !23, i64 32}
!20 = !{!"_ZTSN4juce17ChangeBroadcaster25ChangeBroadcasterCallbackE", !21, i64 0, !6, i64 16}
!21 = !{!"_ZTSN4juce12AsyncUpdaterE", !22, i64 8}
!22 = !{!"_ZTSN4juce25ReferenceCountedObjectPtrINS_12AsyncUpdater19AsyncUpdaterMessageEEE", !6, i64 0}
!23 = !{!"_ZTSN4juce12ListenerListINS_14ChangeListenerENS_5ArrayIPS1_NS_20DummyCriticalSectionELi0EEEEE", !24, i64 0}
!24 = !{!"_ZTSN4juce5ArrayIPNS_14ChangeListenerENS_20DummyCriticalSectionELi0EEE", !25, i64 0, !14, i64 16}
!25 = !{!"_ZTSN4juce19ArrayAllocationBaseIPNS_14ChangeListenerENS_20DummyCriticalSectionEEE", !26, i64 0, !14, i64 8}
!26 = !{!"_ZTSN4juce9HeapBlockIPNS_14ChangeListenerELb0EEE", !6, i64 0}
!27 = !{!"_ZTSN4juce10OwnedArrayINS_11UndoManager9ActionSetENS_20DummyCriticalSectionEEE", !28, i64 0, !14, i64 16}
!28 = !{!"_ZTSN4juce19ArrayAllocationBaseIPNS_11UndoManager9ActionSetENS_20DummyCriticalSectionEEE", !29, i64 0, !14, i64 8}
!29 = !{!"_ZTSN4juce9HeapBlockIPNS_11UndoManager9ActionSetELb0EEE", !6, i64 0}
!30 = !{!"_ZTSN4juce6StringE", !31, i64 0}
!31 = !{!"_ZTSN4juce16CharPointer_UTF8E", !6, i64 0}
!32 = !{!"bool", !7, i64 0}
!33 = !{!"_ZTSN4juce12ListenerListINS_12CodeDocument8ListenerENS_5ArrayIPS2_NS_20DummyCriticalSectionELi0EEEEE", !34, i64 0}
!34 = !{!"_ZTSN4juce5ArrayIPNS_12CodeDocument8ListenerENS_20DummyCriticalSectionELi0EEE", !35, i64 0, !14, i64 16}
!35 = !{!"_ZTSN4juce19ArrayAllocationBaseIPNS_12CodeDocument8ListenerENS_20DummyCriticalSectionEEE", !36, i64 0, !14, i64 8}
!36 = !{!"_ZTSN4juce9HeapBlockIPNS_12CodeDocument8ListenerELb0EEE", !6, i64 0}
!37 = !{!14, !14, i64 0}
!38 = !{!39, !14, i64 12}
!39 = !{!"_ZTSN4juce16CodeDocumentLineE", !30, i64 0, !14, i64 8, !14, i64 12, !14, i64 16}
!40 = distinct !{!40, !41}
!41 = !{!"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"

declare i32 @__gxx_personality_v0(...)

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

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

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef i32 @_ZN4juce12CodeDocument20getMaximumLineLengthEv(ptr noundef nonnull align 8 dereferenceable(232) %0) local_unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %2 = getelementptr inbounds i8, ptr %0, i64 192
  %3 = load i32, ptr %2, align 8, !tbaa !5
  %4 = icmp slt i32 %3, 0
  br i1 %4, label %5, label %.loopexit

5:                                                ; preds = %1
  store i32 0, ptr %2, align 8, !tbaa !5
  %6 = tail call noundef i32 @_ZNK4juce10OwnedArrayINS_16CodeDocumentLineENS_20DummyCriticalSectionEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20) %0) #2
  %7 = icmp sgt i32 %6, 0
  %.pre4 = load i32, ptr %2, align 8, !tbaa !5
  br i1 %7, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %5, %.lr.ph
  %8 = phi i32 [ %13, %.lr.ph ], [ %.pre4, %5 ]
  %.03 = phi i32 [ %9, %.lr.ph ], [ %6, %5 ]
  %9 = add nsw i32 %.03, -1
  %10 = tail call noundef ptr @_ZNK4juce10OwnedArrayINS_16CodeDocumentLineENS_20DummyCriticalSectionEE12getUncheckedEi(ptr noundef nonnull align 8 dereferenceable(20) %0, i32 noundef %9) #2
  %11 = getelementptr inbounds i8, ptr %10, i64 12
  %12 = load i32, ptr %11, align 4, !tbaa !36
  %13 = tail call noundef i32 @_ZN4juce4jmaxIiEET_S1_S1_(i32 noundef %8, i32 noundef %12)
  store i32 %13, ptr %2, align 8, !tbaa !5
  %14 = icmp ugt i32 %.03, 1
  br i1 %14, label %.lr.ph, label %.loopexit, !llvm.loop !38

.loopexit:                                        ; preds = %.lr.ph, %5, %1
  %15 = phi i32 [ %.pre4, %5 ], [ %3, %1 ], [ %13, %.lr.ph ]
  ret i32 %15
}

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 = { 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, !13, i64 192}
!6 = !{!"_ZTSN4juce12CodeDocumentE", !7, i64 0, !14, i64 24, !17, i64 48, !13, i64 184, !13, i64 188, !13, i64 192, !32, i64 200, !29, i64 224}
!7 = !{!"_ZTSN4juce10OwnedArrayINS_16CodeDocumentLineENS_20DummyCriticalSectionEEE", !8, i64 0, !13, i64 16}
!8 = !{!"_ZTSN4juce19ArrayAllocationBaseIPNS_16CodeDocumentLineENS_20DummyCriticalSectionEEE", !9, i64 0, !13, i64 8}
!9 = !{!"_ZTSN4juce9HeapBlockIPNS_16CodeDocumentLineELb0EEE", !10, i64 0}
!10 = !{!"any pointer", !11, i64 0}
!11 = !{!"omnipotent char", !12, i64 0}
!12 = !{!"Simple C++ TBAA"}
!13 = !{!"int", !11, i64 0}
!14 = !{!"_ZTSN4juce5ArrayIPNS_12CodeDocument8PositionENS_20DummyCriticalSectionELi0EEE", !15, i64 0, !13, i64 16}
!15 = !{!"_ZTSN4juce19ArrayAllocationBaseIPNS_12CodeDocument8PositionENS_20DummyCriticalSectionEEE", !16, i64 0, !13, i64 8}
!16 = !{!"_ZTSN4juce9HeapBlockIPNS_12CodeDocument8PositionELb0EEE", !10, i64 0}
!17 = !{!"_ZTSN4juce11UndoManagerE", !18, i64 0, !26, i64 56, !26, i64 80, !29, i64 104, !13, i64 112, !13, i64 116, !13, i64 120, !13, i64 124, !31, i64 128, !31, i64 129}
!18 = !{!"_ZTSN4juce17ChangeBroadcasterE", !19, i64 8, !22, i64 32}
!19 = !{!"_ZTSN4juce17ChangeBroadcaster25ChangeBroadcasterCallbackE", !20, i64 0, !10, i64 16}
!20 = !{!"_ZTSN4juce12AsyncUpdaterE", !21, i64 8}
!21 = !{!"_ZTSN4juce25ReferenceCountedObjectPtrINS_12AsyncUpdater19AsyncUpdaterMessageEEE", !10, i64 0}
!22 = !{!"_ZTSN4juce12ListenerListINS_14ChangeListenerENS_5ArrayIPS1_NS_20DummyCriticalSectionELi0EEEEE", !23, i64 0}
!23 = !{!"_ZTSN4juce5ArrayIPNS_14ChangeListenerENS_20DummyCriticalSectionELi0EEE", !24, i64 0, !13, i64 16}
!24 = !{!"_ZTSN4juce19ArrayAllocationBaseIPNS_14ChangeListenerENS_20DummyCriticalSectionEEE", !25, i64 0, !13, i64 8}
!25 = !{!"_ZTSN4juce9HeapBlockIPNS_14ChangeListenerELb0EEE", !10, i64 0}
!26 = !{!"_ZTSN4juce10OwnedArrayINS_11UndoManager9ActionSetENS_20DummyCriticalSectionEEE", !27, i64 0, !13, i64 16}
!27 = !{!"_ZTSN4juce19ArrayAllocationBaseIPNS_11UndoManager9ActionSetENS_20DummyCriticalSectionEEE", !28, i64 0, !13, i64 8}
!28 = !{!"_ZTSN4juce9HeapBlockIPNS_11UndoManager9ActionSetELb0EEE", !10, i64 0}
!29 = !{!"_ZTSN4juce6StringE", !30, i64 0}
!30 = !{!"_ZTSN4juce16CharPointer_UTF8E", !10, i64 0}
!31 = !{!"bool", !11, i64 0}
!32 = !{!"_ZTSN4juce12ListenerListINS_12CodeDocument8ListenerENS_5ArrayIPS2_NS_20DummyCriticalSectionELi0EEEEE", !33, i64 0}
!33 = !{!"_ZTSN4juce5ArrayIPNS_12CodeDocument8ListenerENS_20DummyCriticalSectionELi0EEE", !34, i64 0, !13, i64 16}
!34 = !{!"_ZTSN4juce19ArrayAllocationBaseIPNS_12CodeDocument8ListenerENS_20DummyCriticalSectionEEE", !35, i64 0, !13, i64 8}
!35 = !{!"_ZTSN4juce9HeapBlockIPNS_12CodeDocument8ListenerELb0EEE", !10, i64 0}
!36 = !{!37, !13, i64 12}
!37 = !{!"_ZTSN4juce16CodeDocumentLineE", !29, i64 0, !13, i64 8, !13, i64 12, !13, i64 16}
!38 = distinct !{!38, !39}
!39 = !{!"llvm.loop.mustprogress"}


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