; 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::CodeEditorComponent" = type { %"class.juce::Component.base", %"class.juce::ApplicationCommandTarget", %"class.juce::TextInputTarget", ptr, %"class.juce::Font", i32, i32, float, i32, i32, i32, i32, i32, i8, i8, i8, i8, double, %"class.juce::CodeDocument::Position", %"class.juce::CodeDocument::Position", %"class.juce::CodeDocument::Position", %"class.juce::ScopedPointer.60", %"class.juce::ScrollBar", %"class.juce::ScrollBar", ptr, %"class.juce::ScopedPointer.68", %"class.juce::ScopedPointer.69", i32, ptr, %"struct.juce::CodeEditorComponent::ColourScheme", %"class.juce::OwnedArray.75", %"class.juce::OwnedArray.80" }
%"class.juce::Component.base" = type <{ %"class.juce::MouseListener", %"class.juce::String", %"class.juce::String", ptr, %"class.juce::Rectangle", %"class.juce::ScopedPointer", %"class.juce::ScopedPointer.37", %"class.juce::Array.38", ptr, %"class.juce::MouseCursor", ptr, %"class.juce::ScopedPointer.43", %"class.juce::ScopedPointer.44", %"class.juce::ScopedPointer.45", %"class.juce::ListenerList.46", %"class.juce::NamedValueSet", %"class.juce::WeakReference<juce::Component>::Master", %union.anon, 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::Point" = type { i32, i32 }
%"class.juce::ScopedPointer" = type { ptr }
%"class.juce::ScopedPointer.37" = type { ptr }
%"class.juce::Array.38" = type { %"class.juce::ArrayAllocationBase.39", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.39" = type <{ %"class.juce::HeapBlock.40", i32, [4 x i8] }>
%"class.juce::HeapBlock.40" = type { ptr }
%"class.juce::MouseCursor" = type { ptr }
%"class.juce::ScopedPointer.43" = type { ptr }
%"class.juce::ScopedPointer.44" = type { ptr }
%"class.juce::ScopedPointer.45" = type { ptr }
%"class.juce::ListenerList.46" = type { %"class.juce::Array.47" }
%"class.juce::Array.47" = type { %"class.juce::ArrayAllocationBase.48", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.48" = type <{ %"class.juce::HeapBlock.49", i32, [4 x i8] }>
%"class.juce::HeapBlock.49" = type { ptr }
%"class.juce::NamedValueSet" = type { %"class.juce::Array.52" }
%"class.juce::Array.52" = type { %"class.juce::ArrayAllocationBase.53", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.53" = type <{ %"class.juce::HeapBlock.54", i32, [4 x i8] }>
%"class.juce::HeapBlock.54" = type { ptr }
%"class.juce::WeakReference<juce::Component>::Master" = type { %"class.juce::ReferenceCountedObjectPtr.57" }
%"class.juce::ReferenceCountedObjectPtr.57" = type { ptr }
%union.anon = type { i32 }
%"class.juce::ApplicationCommandTarget" = type { ptr, %"class.juce::WeakReference<juce::ApplicationCommandTarget>::Master" }
%"class.juce::WeakReference<juce::ApplicationCommandTarget>::Master" = type { %"class.juce::ReferenceCountedObjectPtr.58" }
%"class.juce::ReferenceCountedObjectPtr.58" = type { ptr }
%"class.juce::TextInputTarget" = type { ptr }
%"class.juce::Font" = type { %"class.juce::ReferenceCountedObjectPtr.59" }
%"class.juce::ReferenceCountedObjectPtr.59" = type { ptr }
%"class.juce::CodeDocument::Position" = type <{ ptr, i32, i32, i32, i8, [3 x i8] }>
%"class.juce::ScopedPointer.60" = type { ptr }
%"class.juce::ScrollBar" = type { %"class.juce::Component.base", %"class.juce::AsyncUpdater", %"class.juce::Timer", %"class.juce::Range", %"class.juce::Range", double, double, i32, i32, i32, i32, i32, i32, i32, i32, i32, i8, i8, i8, %"class.juce::ScopedPointer.61", %"class.juce::ScopedPointer.61", %"class.juce::ListenerList.62" }
%"class.juce::AsyncUpdater" = type { ptr, %"class.juce::ReferenceCountedObjectPtr" }
%"class.juce::ReferenceCountedObjectPtr" = type { ptr }
%"class.juce::Timer" = type { ptr, i32, i32, ptr, ptr }
%"class.juce::Range" = type { double, double }
%"class.juce::ScopedPointer.61" = type { ptr }
%"class.juce::ListenerList.62" = type { %"class.juce::Array.63" }
%"class.juce::Array.63" = type { %"class.juce::ArrayAllocationBase.64", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.64" = type <{ %"class.juce::HeapBlock.65", i32, [4 x i8] }>
%"class.juce::HeapBlock.65" = type { ptr }
%"class.juce::ScopedPointer.68" = type { ptr }
%"class.juce::ScopedPointer.69" = type { ptr }
%"struct.juce::CodeEditorComponent::ColourScheme" = type { %"class.juce::Array.70" }
%"class.juce::Array.70" = type { %"class.juce::ArrayAllocationBase.71", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.71" = type <{ %"class.juce::HeapBlock.72", i32, [4 x i8] }>
%"class.juce::HeapBlock.72" = type { ptr }
%"class.juce::OwnedArray.75" = type { %"class.juce::ArrayAllocationBase.76", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.76" = type <{ %"class.juce::HeapBlock.77", i32, [4 x i8] }>
%"class.juce::HeapBlock.77" = type { ptr }
%"class.juce::OwnedArray.80" = type { %"class.juce::ArrayAllocationBase.81", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.81" = type <{ %"class.juce::HeapBlock.82", i32, [4 x i8] }>
%"class.juce::HeapBlock.82" = 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: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN4juce4jmaxIiEET_S1_S1_(i32 noundef, i32 noundef) #1

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

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

13:                                               ; preds = %9
  %14 = getelementptr inbounds %"class.juce::CodeEditorComponent", ptr %6, i32 0, i32 31
  %15 = load i32, ptr %5, align 4, !tbaa !9
  %16 = call noundef ptr @_ZNK4juce10OwnedArrayINS_12CodeDocument8IteratorENS_20DummyCriticalSectionEE12getUncheckedEi(ptr noundef nonnull align 8 dereferenceable(20) %14, i32 noundef %15) #4
  %17 = call noundef i32 @_ZNK4juce12CodeDocument8Iterator7getLineEv(ptr noundef nonnull align 8 dereferenceable(24) %16) #4
  %18 = load i32, ptr %4, align 4, !tbaa !9
  %19 = icmp slt i32 %17, %18
  br i1 %19, label %20, label %21

20:                                               ; preds = %13
  br label %22

21:                                               ; preds = %13
  br label %9, !llvm.loop !11

22:                                               ; preds = %20, %9
  %23 = getelementptr inbounds %"class.juce::CodeEditorComponent", ptr %6, i32 0, i32 31
  %24 = load i32, ptr %5, align 4, !tbaa !9
  %25 = sub nsw i32 %24, 1
  %26 = call noundef i32 @_ZN4juce4jmaxIiEET_S1_S1_(i32 noundef 0, i32 noundef %25)
  %27 = getelementptr inbounds %"class.juce::CodeEditorComponent", ptr %6, i32 0, i32 31
  %28 = call noundef i32 @_ZNK4juce10OwnedArrayINS_12CodeDocument8IteratorENS_20DummyCriticalSectionEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20) %27) #4
  call void @_ZN4juce10OwnedArrayINS_12CodeDocument8IteratorENS_20DummyCriticalSectionEE11removeRangeEiib(ptr noundef nonnull align 8 dereferenceable(20) %23, i32 noundef %26, i32 noundef %28, i1 noundef zeroext true)
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  ret void
}

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

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

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = !{!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: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN4juce4jmaxIiEET_S1_S1_(i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN4juce19CodeEditorComponent20clearCachedIteratorsEi(ptr noundef nonnull align 8 dereferenceable(1232) %0, i32 noundef %1) local_unnamed_addr #0 align 2 {
  %3 = getelementptr inbounds i8, ptr %0, i64 1208
  %4 = tail call noundef i32 @_ZNK4juce10OwnedArrayINS_12CodeDocument8IteratorENS_20DummyCriticalSectionEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20) %3) #2
  br label %5

5:                                                ; preds = %7, %2
  %.0 = phi i32 [ %4, %2 ], [ %8, %7 ]
  %6 = icmp sgt i32 %.0, 0
  br i1 %6, label %7, label %12

7:                                                ; preds = %5
  %8 = add nsw i32 %.0, -1
  %9 = tail call noundef ptr @_ZNK4juce10OwnedArrayINS_12CodeDocument8IteratorENS_20DummyCriticalSectionEE12getUncheckedEi(ptr noundef nonnull align 8 dereferenceable(20) %3, i32 noundef %8) #2
  %10 = tail call noundef i32 @_ZNK4juce12CodeDocument8Iterator7getLineEv(ptr noundef nonnull align 8 dereferenceable(24) %9) #2
  %11 = icmp slt i32 %10, %1
  br i1 %11, label %12, label %5, !llvm.loop !5

12:                                               ; preds = %7, %5
  %13 = add nsw i32 %.0, -2
  %14 = tail call noundef i32 @_ZN4juce4jmaxIiEET_S1_S1_(i32 noundef 0, i32 noundef %13)
  %15 = tail call noundef i32 @_ZNK4juce10OwnedArrayINS_12CodeDocument8IteratorENS_20DummyCriticalSectionEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20) %3) #2
  tail call void @_ZN4juce10OwnedArrayINS_12CodeDocument8IteratorENS_20DummyCriticalSectionEE11removeRangeEiib(ptr noundef nonnull align 8 dereferenceable(20) %3, i32 noundef %14, i32 noundef %15, i1 noundef zeroext true)
  ret void
}

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

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

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

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

attributes #0 = { 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 = { 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 = { 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,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,LCSSAPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass