; 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::String" = type { %"class.juce::CharPointer_UTF8" }
%"class.juce::CharPointer_UTF8" = type { ptr }
%"class.juce::MemoryOutputStream" = type { %"class.juce::OutputStream", ptr, %"class.juce::MemoryBlock", ptr, i64, i64, i64 }
%"class.juce::OutputStream" = type { ptr, %"class.juce::String" }
%"class.juce::MemoryBlock" = type { %"class.juce::HeapBlock.149", i64 }
%"class.juce::HeapBlock.149" = type { ptr }
%"class.juce::Range" = type { i32, i32 }
%"class.juce::TextEditor" = type { %"class.juce::Component.base", %"class.juce::TextInputTarget", %"class.juce::SettableTooltipClient", %"class.juce::ScopedPointer.251", ptr, %"class.juce::BorderSize", i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, %"class.juce::UndoManager", %"class.juce::ScopedPointer.257", %"class.juce::Range", i32, i32, i32, %"class.juce::Font", i32, i32, %"class.juce::OwnedArray.258", %"class.juce::String", %"class.juce::Colour", i32, %"class.juce::OptionalScopedPointer", %"class.juce::Value", i32, i32, %"class.juce::ListenerList.264", %"class.juce::Array.270" }
%"class.juce::Component.base" = type <{ %"class.juce::MouseListener", %"class.juce::String", %"class.juce::String", ptr, %"class.juce::Rectangle", %"class.juce::ScopedPointer", %"class.juce::ScopedPointer.0", %"class.juce::Array", ptr, %"class.juce::MouseCursor", ptr, %"class.juce::ScopedPointer.1", %"class.juce::ScopedPointer.2", %"class.juce::ScopedPointer.3", %"class.juce::ListenerList", %"class.juce::NamedValueSet", %"class.juce::WeakReference<juce::Component>::Master", %union.anon, i8 }>
%"class.juce::MouseListener" = 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.0" = 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::MouseCursor" = type { ptr }
%"class.juce::ScopedPointer.1" = type { ptr }
%"class.juce::ScopedPointer.2" = type { ptr }
%"class.juce::ScopedPointer.3" = type { ptr }
%"class.juce::ListenerList" = type { %"class.juce::Array.4" }
%"class.juce::Array.4" = 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::NamedValueSet" = type { %"class.juce::Array.9" }
%"class.juce::Array.9" = type { %"class.juce::ArrayAllocationBase.10", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.10" = type <{ %"class.juce::HeapBlock.11", i32, [4 x i8] }>
%"class.juce::HeapBlock.11" = type { ptr }
%"class.juce::WeakReference<juce::Component>::Master" = type { %"class.juce::ReferenceCountedObjectPtr" }
%"class.juce::ReferenceCountedObjectPtr" = type { ptr }
%union.anon = type { i32 }
%"class.juce::TextInputTarget" = type { ptr }
%"class.juce::SettableTooltipClient" = type { %"class.juce::TooltipClient", %"class.juce::String" }
%"class.juce::TooltipClient" = type { ptr }
%"class.juce::ScopedPointer.251" = type { ptr }
%"class.juce::BorderSize" = type { i32, i32, i32, i32 }
%"class.juce::UndoManager" = type <{ %"class.juce::ChangeBroadcaster", %"class.juce::OwnedArray.252", %"class.juce::OwnedArray.252", %"class.juce::String", i32, i32, i32, i32, i8, i8, [6 x i8] }>
%"class.juce::ChangeBroadcaster" = type { ptr, %"class.juce::ChangeBroadcaster::ChangeBroadcasterCallback", %"class.juce::ListenerList.39" }
%"class.juce::ChangeBroadcaster::ChangeBroadcasterCallback" = type { %"class.juce::AsyncUpdater", ptr }
%"class.juce::AsyncUpdater" = type { ptr, %"class.juce::ReferenceCountedObjectPtr.15" }
%"class.juce::ReferenceCountedObjectPtr.15" = type { ptr }
%"class.juce::ListenerList.39" = type { %"class.juce::Array.40" }
%"class.juce::Array.40" = type { %"class.juce::ArrayAllocationBase.41", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.41" = type <{ %"class.juce::HeapBlock.42", i32, [4 x i8] }>
%"class.juce::HeapBlock.42" = type { ptr }
%"class.juce::OwnedArray.252" = type { %"class.juce::ArrayAllocationBase.253", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.253" = type <{ %"class.juce::HeapBlock.254", i32, [4 x i8] }>
%"class.juce::HeapBlock.254" = type { ptr }
%"class.juce::ScopedPointer.257" = type { ptr }
%"class.juce::Font" = type { %"class.juce::ReferenceCountedObjectPtr.158" }
%"class.juce::ReferenceCountedObjectPtr.158" = type { ptr }
%"class.juce::OwnedArray.258" = type { %"class.juce::ArrayAllocationBase.259", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.259" = type <{ %"class.juce::HeapBlock.260", i32, [4 x i8] }>
%"class.juce::HeapBlock.260" = type { ptr }
%"class.juce::Colour" = type { %"class.juce::PixelARGB" }
%"class.juce::PixelARGB" = type { %union.anon.77 }
%union.anon.77 = type { i32 }
%"class.juce::OptionalScopedPointer" = type <{ %"class.juce::ScopedPointer.263", i8, [7 x i8] }>
%"class.juce::ScopedPointer.263" = type { ptr }
%"class.juce::Value" = type { %"class.juce::ReferenceCountedObjectPtr.116", %"class.juce::ListenerList.117" }
%"class.juce::ReferenceCountedObjectPtr.116" = type { ptr }
%"class.juce::ListenerList.117" = type { %"class.juce::Array.118" }
%"class.juce::Array.118" = type { %"class.juce::ArrayAllocationBase.119", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.119" = type <{ %"class.juce::HeapBlock.120", i32, [4 x i8] }>
%"class.juce::HeapBlock.120" = type { ptr }
%"class.juce::ListenerList.264" = type { %"class.juce::Array.265" }
%"class.juce::Array.265" = type { %"class.juce::ArrayAllocationBase.266", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.266" = type <{ %"class.juce::HeapBlock.267", i32, [4 x i8] }>
%"class.juce::HeapBlock.267" = type { ptr }
%"class.juce::Array.270" = type { %"class.juce::ArrayAllocationBase.271", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.271" = type <{ %"class.juce::HeapBlock.272", i32, [4 x i8] }>
%"class.juce::HeapBlock.272" = type { ptr }

; Function Attrs: nounwind
declare void @_ZN4juce6StringC1Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #0

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) #1

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

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

declare void @_ZN4juce18MemoryOutputStreamC1Em(ptr noundef nonnull align 8 dereferenceable(72), i64 noundef) unnamed_addr #3

; Function Attrs: nounwind
declare void @_ZN4juce18MemoryOutputStreamD1Ev(ptr noundef nonnull align 8 dereferenceable(72)) unnamed_addr #0

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK4juce5RangeIiE7isEmptyEv(ptr noundef nonnull align 4 dereferenceable(8)) #4 align 2

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

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

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

declare void @_ZN4juce18MemoryOutputStream11preallocateEm(ptr noundef nonnull align 8 dereferenceable(72), i64 noundef) #3

declare void @_ZNK4juce18MemoryOutputStream6toUTF8Ev(ptr dead_on_unwind writable sret(%"class.juce::String") align 8, ptr noundef nonnull align 8 dereferenceable(72)) #3

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK4juce10TextEditor14getTextInRangeERKNS_5RangeIiEE(ptr dead_on_unwind noalias writable sret(%"class.juce::String") align 8 %0, ptr noundef nonnull align 8 dereferenceable(600) %1, ptr noundef nonnull align 4 dereferenceable(8) %2) unnamed_addr #5 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca %"class.juce::MemoryOutputStream", align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca %"class.juce::Range", 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
  %16 = load ptr, ptr %5, align 8
  %17 = load ptr, ptr %6, align 8, !tbaa !5
  %18 = call noundef zeroext i1 @_ZNK4juce5RangeIiE7isEmptyEv(ptr noundef nonnull align 4 dereferenceable(8) %17) #6
  br i1 %18, label %19, label %20

19:                                               ; preds = %3
  call void @_ZN4juce6StringC1Ev(ptr noundef nonnull align 8 dereferenceable(8) %0) #6
  br label %83

20:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 72, ptr %7) #6
  call void @_ZN4juce18MemoryOutputStreamC1Em(ptr noundef nonnull align 8 dereferenceable(72) %7, i64 noundef 256)
  %21 = invoke noundef i32 @_ZNK4juce10TextEditor16getTotalNumCharsEv(ptr noundef nonnull align 8 dereferenceable(600) %16)
          to label %22 unwind label %35

22:                                               ; preds = %20
  %23 = load ptr, ptr %6, align 8, !tbaa !5
  %24 = call noundef i32 @_ZNK4juce5RangeIiE9getLengthEv(ptr noundef nonnull align 4 dereferenceable(8) %23) #6
  %25 = invoke noundef i32 @_ZN4juce4jminIiEET_S1_S1_(i32 noundef %21, i32 noundef %24)
          to label %26 unwind label %35

26:                                               ; preds = %22
  %27 = sext i32 %25 to i64
  invoke void @_ZN4juce18MemoryOutputStream11preallocateEm(ptr noundef nonnull align 8 dereferenceable(72) %7, i64 noundef %27)
          to label %28 unwind label %35

28:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 0, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %29

29:                                               ; preds = %71, %28
  %30 = load i32, ptr %11, align 4, !tbaa !9
  %31 = getelementptr inbounds %"class.juce::TextEditor", ptr %16, i32 0, i32 31
  %32 = call noundef i32 @_ZNK4juce10OwnedArrayINS_10TextEditor18UniformTextSectionENS_20DummyCriticalSectionEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20) %31) #6
  %33 = icmp slt i32 %30, %32
  br i1 %33, label %39, label %34

34:                                               ; preds = %29
  store i32 2, ptr %12, align 4
  br label %74

35:                                               ; preds = %26, %22, %20
  %36 = landingpad { ptr, i32 }
          cleanup
  %37 = extractvalue { ptr, i32 } %36, 0
  store ptr %37, ptr %8, align 8
  %38 = extractvalue { ptr, i32 } %36, 1
  store i32 %38, ptr %9, align 4
  br label %82

39:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %40 = getelementptr inbounds %"class.juce::TextEditor", ptr %16, i32 0, i32 31
  %41 = load i32, ptr %11, align 4, !tbaa !9
  %42 = call noundef ptr @_ZNK4juce10OwnedArrayINS_10TextEditor18UniformTextSectionENS_20DummyCriticalSectionEE12getUncheckedEi(ptr noundef nonnull align 8 dereferenceable(20) %40, i32 noundef %41) #6
  store ptr %42, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  %43 = load i32, ptr %10, align 4, !tbaa !9
  %44 = load ptr, ptr %13, align 8, !tbaa !5
  %45 = call noundef i32 @_ZNK4juce10TextEditor18UniformTextSection14getTotalLengthEv(ptr noundef nonnull align 8 dereferenceable(40) %44) #6
  %46 = add nsw i32 %43, %45
  store i32 %46, ptr %14, align 4, !tbaa !9
  %47 = load ptr, ptr %6, align 8, !tbaa !5
  %48 = call noundef i32 @_ZNK4juce5RangeIiE8getStartEv(ptr noundef nonnull align 4 dereferenceable(8) %47) #6
  %49 = load i32, ptr %14, align 4, !tbaa !9
  %50 = icmp slt i32 %48, %49
  br i1 %50, label %51, label %66

51:                                               ; preds = %39
  %52 = load ptr, ptr %6, align 8, !tbaa !5
  %53 = call noundef i32 @_ZNK4juce5RangeIiE6getEndEv(ptr noundef nonnull align 4 dereferenceable(8) %52) #6
  %54 = load i32, ptr %10, align 4, !tbaa !9
  %55 = icmp sle i32 %53, %54
  br i1 %55, label %56, label %57

56:                                               ; preds = %51
  store i32 2, ptr %12, align 4
  br label %68

57:                                               ; preds = %51
  %58 = load ptr, ptr %13, align 8, !tbaa !5
  %59 = load ptr, ptr %6, align 8, !tbaa !5
  %60 = load i32, ptr %10, align 4, !tbaa !9
  call void @_ZNK4juce5RangeIiEmiEi(ptr dead_on_unwind writable sret(%"class.juce::Range") align 4 %15, ptr noundef nonnull align 4 dereferenceable(8) %59, i32 noundef %60) #6
  invoke void @_ZNK4juce10TextEditor18UniformTextSection15appendSubstringERNS_18MemoryOutputStreamENS_5RangeIiEE(ptr noundef nonnull align 8 dereferenceable(40) %58, ptr noundef nonnull align 8 dereferenceable(72) %7, ptr noundef %15)
          to label %61 unwind label %62

61:                                               ; preds = %57
  br label %66

62:                                               ; preds = %57
  %63 = landingpad { ptr, i32 }
          cleanup
  %64 = extractvalue { ptr, i32 } %63, 0
  store ptr %64, ptr %8, align 8
  %65 = extractvalue { ptr, i32 } %63, 1
  store i32 %65, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %81

66:                                               ; preds = %61, %39
  %67 = load i32, ptr %14, align 4, !tbaa !9
  store i32 %67, ptr %10, align 4, !tbaa !9
  store i32 0, ptr %12, align 4
  br label %68

68:                                               ; preds = %66, %56
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  %69 = load i32, ptr %12, align 4
  switch i32 %69, label %74 [
    i32 0, label %70
  ]

70:                                               ; preds = %68
  br label %71

71:                                               ; preds = %70
  %72 = load i32, ptr %11, align 4, !tbaa !9
  %73 = add nsw i32 %72, 1
  store i32 %73, ptr %11, align 4, !tbaa !9
  br label %29, !llvm.loop !11

74:                                               ; preds = %68, %34
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %75

75:                                               ; preds = %74
  invoke void @_ZNK4juce18MemoryOutputStream6toUTF8Ev(ptr dead_on_unwind writable sret(%"class.juce::String") align 8 %0, ptr noundef nonnull align 8 dereferenceable(72) %7)
          to label %76 unwind label %77

76:                                               ; preds = %75
  store i32 1, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @_ZN4juce18MemoryOutputStreamD1Ev(ptr noundef nonnull align 8 dereferenceable(72) %7) #6
  call void @llvm.lifetime.end.p0(i64 72, ptr %7) #6
  br label %83

77:                                               ; preds = %75
  %78 = landingpad { ptr, i32 }
          cleanup
  %79 = extractvalue { ptr, i32 } %78, 0
  store ptr %79, ptr %8, align 8
  %80 = extractvalue { ptr, i32 } %78, 1
  store i32 %80, ptr %9, align 4
  br label %81

81:                                               ; preds = %77, %62
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %82

82:                                               ; preds = %81, %35
  call void @_ZN4juce18MemoryOutputStreamD1Ev(ptr noundef nonnull align 8 dereferenceable(72) %7) #6
  call void @llvm.lifetime.end.p0(i64 72, ptr %7) #6
  br label %84

83:                                               ; preds = %76, %19
  ret void

84:                                               ; preds = %82
  %85 = load ptr, ptr %8, align 8
  %86 = load i32, ptr %9, align 4
  %87 = insertvalue { ptr, i32 } poison, ptr %85, 0
  %88 = insertvalue { ptr, i32 } %87, i32 %86, 1
  resume { ptr, i32 } %88
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK4juce10TextEditor18UniformTextSection15appendSubstringERNS_18MemoryOutputStreamENS_5RangeIiEE(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef nonnull align 8 dereferenceable(72), ptr noundef) #5 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNK4juce5RangeIiEmiEi(ptr dead_on_unwind noalias writable sret(%"class.juce::Range") align 4, ptr noundef nonnull align 4 dereferenceable(8), i32 noundef) #2 align 2

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { "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 = { 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 #6 = { 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::String" = type { %"class.juce::CharPointer_UTF8" }
%"class.juce::CharPointer_UTF8" = type { ptr }
%"class.juce::MemoryOutputStream" = type { %"class.juce::OutputStream", ptr, %"class.juce::MemoryBlock", ptr, i64, i64, i64 }
%"class.juce::OutputStream" = type { ptr, %"class.juce::String" }
%"class.juce::MemoryBlock" = type { %"class.juce::HeapBlock.149", i64 }
%"class.juce::HeapBlock.149" = type { ptr }
%"class.juce::Range" = type { i32, i32 }

; Function Attrs: nounwind
declare void @_ZN4juce6StringC1Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #0

declare i32 @__gxx_personality_v0(...)

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

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

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

declare void @_ZN4juce18MemoryOutputStreamC1Em(ptr noundef nonnull align 8 dereferenceable(72), i64 noundef) unnamed_addr #3

; Function Attrs: nounwind
declare void @_ZN4juce18MemoryOutputStreamD1Ev(ptr noundef nonnull align 8 dereferenceable(72)) unnamed_addr #0

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK4juce5RangeIiE7isEmptyEv(ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #4 align 2

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

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

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

declare void @_ZN4juce18MemoryOutputStream11preallocateEm(ptr noundef nonnull align 8 dereferenceable(72), i64 noundef) local_unnamed_addr #3

declare void @_ZNK4juce18MemoryOutputStream6toUTF8Ev(ptr dead_on_unwind writable sret(%"class.juce::String") align 8, ptr noundef nonnull align 8 dereferenceable(72)) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK4juce10TextEditor14getTextInRangeERKNS_5RangeIiEE(ptr dead_on_unwind noalias writable sret(%"class.juce::String") align 8 %0, ptr noundef nonnull align 8 dereferenceable(600) %1, ptr noundef nonnull align 4 dereferenceable(8) %2) unnamed_addr #5 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"class.juce::MemoryOutputStream", align 8
  %5 = alloca %"class.juce::Range", align 4
  %6 = tail call noundef zeroext i1 @_ZNK4juce5RangeIiE7isEmptyEv(ptr noundef nonnull align 4 dereferenceable(8) %2) #6
  br i1 %6, label %7, label %8

7:                                                ; preds = %3
  tail call void @_ZN4juce6StringC1Ev(ptr noundef nonnull align 8 dereferenceable(8) %0) #6
  br label %36

8:                                                ; preds = %3
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %4) #6
  call void @_ZN4juce18MemoryOutputStreamC1Em(ptr noundef nonnull align 8 dereferenceable(72) %4, i64 noundef 256)
  %9 = call noundef i32 @_ZNK4juce10TextEditor16getTotalNumCharsEv(ptr noundef nonnull align 8 dereferenceable(600) %1)
  %10 = call noundef i32 @_ZNK4juce5RangeIiE9getLengthEv(ptr noundef nonnull align 4 dereferenceable(8) %2) #6
  %11 = call noundef i32 @_ZN4juce4jminIiEET_S1_S1_(i32 noundef %9, i32 noundef %10)
  %12 = sext i32 %11 to i64
  invoke void @_ZN4juce18MemoryOutputStream11preallocateEm(ptr noundef nonnull align 8 dereferenceable(72) %4, i64 noundef %12)
          to label %.preheader unwind label %16

.preheader:                                       ; preds = %8
  %13 = getelementptr inbounds i8, ptr %1, i64 456
  %14 = call noundef i32 @_ZNK4juce10OwnedArrayINS_10TextEditor18UniformTextSectionENS_20DummyCriticalSectionEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20) %13) #6
  %15 = icmp sgt i32 %14, 0
  br i1 %15, label %.lr.ph, label %._crit_edge

16:                                               ; preds = %8
  %17 = landingpad { ptr, i32 }
          cleanup
  br label %35

.lr.ph:                                           ; preds = %.preheader, %28
  %.02130 = phi i32 [ %29, %28 ], [ 0, %.preheader ]
  %.02229 = phi i32 [ %20, %28 ], [ 0, %.preheader ]
  %18 = call noundef ptr @_ZNK4juce10OwnedArrayINS_10TextEditor18UniformTextSectionENS_20DummyCriticalSectionEE12getUncheckedEi(ptr noundef nonnull align 8 dereferenceable(20) %13, i32 noundef %.02130) #6
  %19 = call noundef i32 @_ZNK4juce10TextEditor18UniformTextSection14getTotalLengthEv(ptr noundef nonnull align 8 dereferenceable(40) %18) #6
  %20 = add nsw i32 %19, %.02229
  %21 = call noundef i32 @_ZNK4juce5RangeIiE8getStartEv(ptr noundef nonnull align 4 dereferenceable(8) %2) #6
  %22 = icmp slt i32 %21, %20
  br i1 %22, label %23, label %28

23:                                               ; preds = %.lr.ph
  %24 = call noundef i32 @_ZNK4juce5RangeIiE6getEndEv(ptr noundef nonnull align 4 dereferenceable(8) %2) #6
  %.not = icmp sgt i32 %24, %.02229
  br i1 %.not, label %25, label %._crit_edge

25:                                               ; preds = %23
  call void @_ZNK4juce5RangeIiEmiEi(ptr dead_on_unwind nonnull writable sret(%"class.juce::Range") align 4 %5, ptr noundef nonnull align 4 dereferenceable(8) %2, i32 noundef %.02229) #6
  invoke void @_ZNK4juce10TextEditor18UniformTextSection15appendSubstringERNS_18MemoryOutputStreamENS_5RangeIiEE(ptr noundef nonnull align 8 dereferenceable(40) %18, ptr noundef nonnull align 8 dereferenceable(72) %4, ptr noundef nonnull %5)
          to label %28 unwind label %26

26:                                               ; preds = %25
  %27 = landingpad { ptr, i32 }
          cleanup
  br label %35

28:                                               ; preds = %25, %.lr.ph
  %29 = add nuw nsw i32 %.02130, 1
  %30 = call noundef i32 @_ZNK4juce10OwnedArrayINS_10TextEditor18UniformTextSectionENS_20DummyCriticalSectionEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20) %13) #6
  %31 = icmp slt i32 %29, %30
  br i1 %31, label %.lr.ph, label %._crit_edge, !llvm.loop !5

._crit_edge:                                      ; preds = %28, %23, %.preheader
  invoke void @_ZNK4juce18MemoryOutputStream6toUTF8Ev(ptr dead_on_unwind writable sret(%"class.juce::String") align 8 %0, ptr noundef nonnull align 8 dereferenceable(72) %4)
          to label %32 unwind label %33

32:                                               ; preds = %._crit_edge
  call void @_ZN4juce18MemoryOutputStreamD1Ev(ptr noundef nonnull align 8 dereferenceable(72) %4) #6
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %4) #6
  br label %36

33:                                               ; preds = %._crit_edge
  %34 = landingpad { ptr, i32 }
          cleanup
  br label %35

35:                                               ; preds = %26, %33, %16
  %.pn.pn = phi { ptr, i32 } [ %17, %16 ], [ %34, %33 ], [ %27, %26 ]
  call void @_ZN4juce18MemoryOutputStreamD1Ev(ptr noundef nonnull align 8 dereferenceable(72) %4) #6
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %4) #6
  resume { ptr, i32 } %.pn.pn

36:                                               ; preds = %32, %7
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK4juce10TextEditor18UniformTextSection15appendSubstringERNS_18MemoryOutputStreamENS_5RangeIiEE(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef nonnull align 8 dereferenceable(72), ptr noundef) local_unnamed_addr #5 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNK4juce5RangeIiEmiEi(ptr dead_on_unwind noalias writable sret(%"class.juce::Range") align 4, ptr noundef nonnull align 4 dereferenceable(8), i32 noundef) local_unnamed_addr #2 align 2

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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { "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 = { 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 #6 = { 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,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass