; 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::Colour" = type { %"class.juce::PixelARGB" }
%"class.juce::PixelARGB" = type { %union.anon.77 }
%union.anon.77 = type { i32 }
%"class.juce::String" = type { %"class.juce::CharPointer_UTF8" }
%"class.juce::CharPointer_UTF8" = type { ptr }
%"class.juce::StringRef" = type { %"class.juce::CharPointer_UTF8" }
%"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::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 }

@.str.168 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.220 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.221 = external hidden unnamed_addr constant [3 x i8], align 1

declare i32 @__gxx_personality_v0(...)

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

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

; 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 uwtable
declare dso_local void @_ZNK4juce9Component10findColourEib(ptr dead_on_unwind noalias writable sret(%"class.juce::Colour") align 1, ptr noundef nonnull align 8 dereferenceable(197), i32 noundef, i1 noundef zeroext) #2 align 2

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

; Function Attrs: nounwind
declare void @_ZN4juce6ColourD1Ev(ptr noundef nonnull align 1 dereferenceable(4)) unnamed_addr #0

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

; Function Attrs: nounwind
declare noundef i32 @_ZNK4juce6String6lengthEv(ptr noundef nonnull align 8 dereferenceable(8)) #0

; Function Attrs: nounwind
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZN4juce6StringaSEOS0_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #0

declare void @_ZNK4juce6String7replaceENS_9StringRefES1_b(ptr dead_on_unwind writable sret(%"class.juce::String") align 8, ptr noundef nonnull align 8 dereferenceable(8), ptr noundef, ptr noundef, i1 noundef zeroext) #4

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK4juce10TextEditor11isMultiLineEv(ptr noundef nonnull align 8 dereferenceable(600)) #5 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4juce5RangeIiEC2ERKS1_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4juce10TextEditor17insertTextAtCaretERKNS_6StringE(ptr noundef nonnull align 8 dereferenceable(600) %0, ptr noundef nonnull align 8 dereferenceable(8) %1) unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca %"class.juce::String", align 8
  %6 = alloca %"class.juce::String", align 8
  %7 = alloca %"class.juce::StringRef", align 8
  %8 = alloca %"class.juce::StringRef", align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca %"class.juce::String", align 8
  %12 = alloca %"class.juce::StringRef", align 8
  %13 = alloca %"class.juce::StringRef", align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca %"class.juce::Range", align 4
  %17 = alloca %"class.juce::Colour", align 1
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %18 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  %19 = getelementptr inbounds %"class.juce::TextEditor", ptr %18, i32 0, i32 35
  %20 = call noundef ptr @_ZNK4juce21OptionalScopedPointerINS_10TextEditor11InputFilterEEcvPS2_Ev(ptr noundef nonnull align 8 dereferenceable(9) %19) #6
  %21 = icmp ne ptr %20, null
  br i1 %21, label %22, label %29

22:                                               ; preds = %2
  %23 = getelementptr inbounds %"class.juce::TextEditor", ptr %18, i32 0, i32 35
  %24 = call noundef ptr @_ZNK4juce21OptionalScopedPointerINS_10TextEditor11InputFilterEEptEv(ptr noundef nonnull align 8 dereferenceable(9) %23) #6
  %25 = load ptr, ptr %4, align 8, !tbaa !5
  %26 = load ptr, ptr %24, align 8, !tbaa !9
  %27 = getelementptr inbounds ptr, ptr %26, i64 2
  %28 = load ptr, ptr %27, align 8
  call void %28(ptr dead_on_unwind writable sret(%"class.juce::String") align 8 %5, ptr noundef nonnull align 8 dereferenceable(8) %24, ptr noundef nonnull align 8 dereferenceable(600) %18, ptr noundef nonnull align 8 dereferenceable(8) %25)
  br label %31

29:                                               ; preds = %2
  %30 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZN4juce6StringC1ERKS0_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %30) #6
  br label %31

31:                                               ; preds = %29, %22
  %32 = call noundef zeroext i1 @_ZNK4juce10TextEditor11isMultiLineEv(ptr noundef nonnull align 8 dereferenceable(600) %18)
  br i1 %32, label %33, label %40

33:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  call void @_ZN4juce9StringRefC1EPKc(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef @.str.220) #6
  call void @_ZN4juce9StringRefC1EPKc(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef @.str.168) #6
  invoke void @_ZNK4juce6String7replaceENS_9StringRefES1_b(ptr dead_on_unwind writable sret(%"class.juce::String") align 8 %6, ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef %7, ptr noundef %8, i1 noundef zeroext false)
          to label %34 unwind label %36

34:                                               ; preds = %33
  %35 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN4juce6StringaSEOS0_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6) #6
  call void @_ZN4juce6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  br label %47

36:                                               ; preds = %33
  %37 = landingpad { ptr, i32 }
          cleanup
  %38 = extractvalue { ptr, i32 } %37, 0
  store ptr %38, ptr %9, align 8
  %39 = extractvalue { ptr, i32 } %37, 1
  store i32 %39, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  br label %80

40:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  call void @_ZN4juce9StringRefC1EPKc(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef @.str.220) #6
  call void @_ZN4juce9StringRefC1EPKc(ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef @.str.221) #6
  invoke void @_ZNK4juce6String17replaceCharactersENS_9StringRefES1_(ptr dead_on_unwind writable sret(%"class.juce::String") align 8 %11, ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef %12, ptr noundef %13)
          to label %41 unwind label %43

41:                                               ; preds = %40
  %42 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN4juce6StringaSEOS0_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %11) #6
  call void @_ZN4juce6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  br label %47

43:                                               ; preds = %40
  %44 = landingpad { ptr, i32 }
          cleanup
  %45 = extractvalue { ptr, i32 } %44, 0
  store ptr %45, ptr %9, align 8
  %46 = extractvalue { ptr, i32 } %44, 1
  store i32 %46, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  br label %80

47:                                               ; preds = %41, %34
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  %48 = getelementptr inbounds %"class.juce::TextEditor", ptr %18, i32 0, i32 24
  %49 = call noundef i32 @_ZNK4juce5RangeIiE8getStartEv(ptr noundef nonnull align 4 dereferenceable(8) %48) #6
  store i32 %49, ptr %14, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  %50 = load i32, ptr %14, align 4, !tbaa !11
  %51 = call noundef i32 @_ZNK4juce6String6lengthEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #6
  %52 = add nsw i32 %50, %51
  store i32 %52, ptr %15, align 4, !tbaa !11
  %53 = getelementptr inbounds %"class.juce::TextEditor", ptr %18, i32 0, i32 24
  call void @_ZN4juce5RangeIiEC2ERKS1_(ptr noundef nonnull align 4 dereferenceable(8) %16, ptr noundef nonnull align 4 dereferenceable(8) %53) #6
  %54 = call noundef ptr @_ZN4juce10TextEditor14getUndoManagerEv(ptr noundef nonnull align 8 dereferenceable(600) %18) #6
  %55 = call noundef zeroext i1 @_ZNK4juce6String10isNotEmptyEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #6
  br i1 %55, label %56, label %59

56:                                               ; preds = %47
  %57 = load i32, ptr %15, align 4, !tbaa !11
  %58 = sub nsw i32 %57, 1
  br label %61

59:                                               ; preds = %47
  %60 = load i32, ptr %15, align 4, !tbaa !11
  br label %61

61:                                               ; preds = %59, %56
  %62 = phi i32 [ %58, %56 ], [ %60, %59 ]
  invoke void @_ZN4juce10TextEditor6removeENS_5RangeIiEEPNS_11UndoManagerEi(ptr noundef nonnull align 8 dereferenceable(600) %18, ptr noundef %16, ptr noundef %54, i32 noundef %62)
          to label %63 unwind label %71

63:                                               ; preds = %61
  %64 = load i32, ptr %14, align 4, !tbaa !11
  %65 = getelementptr inbounds %"class.juce::TextEditor", ptr %18, i32 0, i32 28
  invoke void @_ZNK4juce9Component10findColourEib(ptr dead_on_unwind writable sret(%"class.juce::Colour") align 1 %17, ptr noundef nonnull align 8 dereferenceable(197) %18, i32 noundef 16777729, i1 noundef zeroext false)
          to label %66 unwind label %71

66:                                               ; preds = %63
  %67 = call noundef ptr @_ZN4juce10TextEditor14getUndoManagerEv(ptr noundef nonnull align 8 dereferenceable(600) %18) #6
  %68 = load i32, ptr %15, align 4, !tbaa !11
  invoke void @_ZN4juce10TextEditor6insertERKNS_6StringEiRKNS_4FontENS_6ColourEPNS_11UndoManagerEi(ptr noundef nonnull align 8 dereferenceable(600) %18, ptr noundef nonnull align 8 dereferenceable(8) %5, i32 noundef %64, ptr noundef nonnull align 8 dereferenceable(8) %65, ptr noundef %17, ptr noundef %67, i32 noundef %68)
          to label %69 unwind label %75

69:                                               ; preds = %66
  call void @_ZN4juce6ColourD1Ev(ptr noundef nonnull align 1 dereferenceable(4) %17) #6
  invoke void @_ZN4juce10TextEditor11textChangedEv(ptr noundef nonnull align 8 dereferenceable(600) %18)
          to label %70 unwind label %71

70:                                               ; preds = %69
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  call void @_ZN4juce6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  ret void

71:                                               ; preds = %69, %63, %61
  %72 = landingpad { ptr, i32 }
          cleanup
  %73 = extractvalue { ptr, i32 } %72, 0
  store ptr %73, ptr %9, align 8
  %74 = extractvalue { ptr, i32 } %72, 1
  store i32 %74, ptr %10, align 4
  br label %79

75:                                               ; preds = %66
  %76 = landingpad { ptr, i32 }
          cleanup
  %77 = extractvalue { ptr, i32 } %76, 0
  store ptr %77, ptr %9, align 8
  %78 = extractvalue { ptr, i32 } %76, 1
  store i32 %78, ptr %10, align 4
  call void @_ZN4juce6ColourD1Ev(ptr noundef nonnull align 1 dereferenceable(4) %17) #6
  br label %79

79:                                               ; preds = %75, %71
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %80

80:                                               ; preds = %79, %43, %36
  call void @_ZN4juce6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  br label %81

81:                                               ; preds = %80
  %82 = load ptr, ptr %9, align 8
  %83 = load i32, ptr %10, align 4
  %84 = insertvalue { ptr, i32 } poison, ptr %82, 0
  %85 = insertvalue { ptr, i32 } %84, i32 %83, 1
  resume { ptr, i32 } %85
}

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN4juce10TextEditor14getUndoManagerEv(ptr noundef nonnull align 8 dereferenceable(600)) #5 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 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 = { "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 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 #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 = !{!"vtable pointer", !8, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}


; 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::Colour" = type { %"class.juce::PixelARGB" }
%"class.juce::PixelARGB" = type { %union.anon.77 }
%union.anon.77 = type { i32 }
%"class.juce::String" = type { %"class.juce::CharPointer_UTF8" }
%"class.juce::CharPointer_UTF8" = type { ptr }
%"class.juce::StringRef" = type { %"class.juce::CharPointer_UTF8" }
%"class.juce::Range" = type { i32, i32 }

@.str.168 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.220 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.221 = external hidden unnamed_addr constant [3 x i8], align 1

declare i32 @__gxx_personality_v0(...)

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

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

; 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 uwtable
declare dso_local void @_ZNK4juce9Component10findColourEib(ptr dead_on_unwind noalias writable sret(%"class.juce::Colour") align 1, ptr noundef nonnull align 8 dereferenceable(197), i32 noundef, i1 noundef zeroext) local_unnamed_addr #2 align 2

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

; Function Attrs: nounwind
declare void @_ZN4juce6ColourD1Ev(ptr noundef nonnull align 1 dereferenceable(4)) unnamed_addr #0

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

; Function Attrs: nounwind
declare noundef i32 @_ZNK4juce6String6lengthEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #0

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

declare void @_ZNK4juce6String7replaceENS_9StringRefES1_b(ptr dead_on_unwind writable sret(%"class.juce::String") align 8, ptr noundef nonnull align 8 dereferenceable(8), ptr noundef, ptr noundef, i1 noundef zeroext) local_unnamed_addr #4

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK4juce10TextEditor11isMultiLineEv(ptr noundef nonnull align 8 dereferenceable(600)) local_unnamed_addr #5 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4juce5RangeIiEC2ERKS1_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4juce10TextEditor17insertTextAtCaretERKNS_6StringE(ptr noundef nonnull align 8 dereferenceable(600) %0, ptr noundef nonnull align 8 dereferenceable(8) %1) unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.juce::String", align 8
  %4 = alloca %"class.juce::String", align 8
  %5 = alloca %"class.juce::StringRef", align 8
  %6 = alloca %"class.juce::StringRef", align 8
  %7 = alloca %"class.juce::String", align 8
  %8 = alloca %"class.juce::StringRef", align 8
  %9 = alloca %"class.juce::StringRef", align 8
  %10 = alloca %"class.juce::Range", align 4
  %11 = alloca %"class.juce::Colour", align 1
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  %12 = getelementptr inbounds i8, ptr %0, i64 496
  %13 = tail call noundef ptr @_ZNK4juce21OptionalScopedPointerINS_10TextEditor11InputFilterEEcvPS2_Ev(ptr noundef nonnull align 8 dereferenceable(9) %12) #6
  %.not = icmp eq ptr %13, null
  br i1 %.not, label %19, label %14

14:                                               ; preds = %2
  %15 = tail call noundef ptr @_ZNK4juce21OptionalScopedPointerINS_10TextEditor11InputFilterEEptEv(ptr noundef nonnull align 8 dereferenceable(9) %12) #6
  %16 = load ptr, ptr %15, align 8, !tbaa !5
  %17 = getelementptr inbounds i8, ptr %16, i64 16
  %18 = load ptr, ptr %17, align 8
  call void %18(ptr dead_on_unwind nonnull writable sret(%"class.juce::String") align 8 %3, ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull align 8 dereferenceable(600) %0, ptr noundef nonnull align 8 dereferenceable(8) %1)
  br label %20

19:                                               ; preds = %2
  call void @_ZN4juce6StringC1ERKS0_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %1) #6
  br label %20

20:                                               ; preds = %19, %14
  %21 = call noundef zeroext i1 @_ZNK4juce10TextEditor11isMultiLineEv(ptr noundef nonnull align 8 dereferenceable(600) %0)
  br i1 %21, label %22, label %27

22:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  call void @_ZN4juce9StringRefC1EPKc(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull @.str.220) #6
  call void @_ZN4juce9StringRefC1EPKc(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull @.str.168) #6
  invoke void @_ZNK4juce6String7replaceENS_9StringRefES1_b(ptr dead_on_unwind nonnull writable sret(%"class.juce::String") align 8 %4, ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull %5, ptr noundef nonnull %6, i1 noundef zeroext false)
          to label %23 unwind label %25

23:                                               ; preds = %22
  %24 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN4juce6StringaSEOS0_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #6
  call void @_ZN4juce6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  br label %32

25:                                               ; preds = %22
  %26 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  br label %51

27:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #6
  call void @_ZN4juce9StringRefC1EPKc(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull @.str.220) #6
  call void @_ZN4juce9StringRefC1EPKc(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull @.str.221) #6
  invoke void @_ZNK4juce6String17replaceCharactersENS_9StringRefES1_(ptr dead_on_unwind nonnull writable sret(%"class.juce::String") align 8 %7, ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull %8, ptr noundef nonnull %9)
          to label %28 unwind label %30

28:                                               ; preds = %27
  %29 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN4juce6StringaSEOS0_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %7) #6
  call void @_ZN4juce6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  br label %32

30:                                               ; preds = %27
  %31 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  br label %51

32:                                               ; preds = %28, %23
  %33 = getelementptr inbounds i8, ptr %0, i64 416
  %34 = call noundef i32 @_ZNK4juce5RangeIiE8getStartEv(ptr noundef nonnull align 4 dereferenceable(8) %33) #6
  %35 = call noundef i32 @_ZNK4juce6String6lengthEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  %36 = add nsw i32 %35, %34
  call void @_ZN4juce5RangeIiEC2ERKS1_(ptr noundef nonnull align 4 dereferenceable(8) %10, ptr noundef nonnull align 4 dereferenceable(8) %33) #6
  %37 = call noundef ptr @_ZN4juce10TextEditor14getUndoManagerEv(ptr noundef nonnull align 8 dereferenceable(600) %0) #6
  %38 = call noundef zeroext i1 @_ZNK4juce6String10isNotEmptyEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  %39 = sext i1 %38 to i32
  %40 = add nsw i32 %36, %39
  invoke void @_ZN4juce10TextEditor6removeENS_5RangeIiEEPNS_11UndoManagerEi(ptr noundef nonnull align 8 dereferenceable(600) %0, ptr noundef nonnull %10, ptr noundef %37, i32 noundef %40)
          to label %41 unwind label %47

41:                                               ; preds = %32
  invoke void @_ZNK4juce9Component10findColourEib(ptr dead_on_unwind nonnull writable sret(%"class.juce::Colour") align 1 %11, ptr noundef nonnull align 8 dereferenceable(197) %0, i32 noundef 16777729, i1 noundef zeroext false)
          to label %42 unwind label %47

42:                                               ; preds = %41
  %43 = getelementptr inbounds i8, ptr %0, i64 440
  %44 = call noundef ptr @_ZN4juce10TextEditor14getUndoManagerEv(ptr noundef nonnull align 8 dereferenceable(600) %0) #6
  invoke void @_ZN4juce10TextEditor6insertERKNS_6StringEiRKNS_4FontENS_6ColourEPNS_11UndoManagerEi(ptr noundef nonnull align 8 dereferenceable(600) %0, ptr noundef nonnull align 8 dereferenceable(8) %3, i32 noundef %34, ptr noundef nonnull align 8 dereferenceable(8) %43, ptr noundef nonnull %11, ptr noundef %44, i32 noundef %36)
          to label %45 unwind label %49

45:                                               ; preds = %42
  call void @_ZN4juce6ColourD1Ev(ptr noundef nonnull align 1 dereferenceable(4) %11) #6
  invoke void @_ZN4juce10TextEditor11textChangedEv(ptr noundef nonnull align 8 dereferenceable(600) %0)
          to label %46 unwind label %47

46:                                               ; preds = %45
  call void @_ZN4juce6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  ret void

47:                                               ; preds = %45, %41, %32
  %48 = landingpad { ptr, i32 }
          cleanup
  br label %51

49:                                               ; preds = %42
  %50 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN4juce6ColourD1Ev(ptr noundef nonnull align 1 dereferenceable(4) %11) #6
  br label %51

51:                                               ; preds = %47, %49, %30, %25
  %.pn.pn = phi { ptr, i32 } [ %26, %25 ], [ %31, %30 ], [ %48, %47 ], [ %50, %49 ]
  call void @_ZN4juce6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  resume { ptr, i32 } %.pn.pn
}

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN4juce10TextEditor14getUndoManagerEv(ptr noundef nonnull align 8 dereferenceable(600)) local_unnamed_addr #5 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 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 = { "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 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 #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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass