; 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::CharPointer_UTF8" = type { ptr }
%"class.juce::CodeDocument::Iterator" = type { ptr, %"class.juce::CharPointer_UTF8", i32, i32 }
%"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::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

; 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 void @_ZN4juce16CharPointer_UTF8aSES0_(ptr dead_on_unwind noalias writable sret(%"class.juce::CharPointer_UTF8") align 8, ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #1 align 2

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNK4juce6String14getCharPointerEv(ptr dead_on_unwind noalias writable sret(%"class.juce::CharPointer_UTF8") align 8, ptr noundef nonnull align 8 dereferenceable(8)) #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN4juce16CharPointer_UTF8aSEPKc(ptr dead_on_unwind noalias writable sret(%"class.juce::CharPointer_UTF8") align 8, ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN4juce12CodeDocument8Iterator15skipToEndOfLineEv(ptr noundef nonnull align 8 dereferenceable(24) %0) #2 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca %"class.juce::CharPointer_UTF8", align 8
  %6 = alloca %"class.juce::CharPointer_UTF8", align 8
  %7 = alloca %"class.juce::CharPointer_UTF8", align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %8 = load ptr, ptr %2, align 8
  %9 = getelementptr inbounds %"class.juce::CodeDocument::Iterator", ptr %8, i32 0, i32 1
  %10 = call noundef ptr @_ZNK4juce16CharPointer_UTF810getAddressEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #3
  %11 = icmp eq ptr %10, null
  br i1 %11, label %12, label %29

12:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #3
  %13 = getelementptr inbounds %"class.juce::CodeDocument::Iterator", ptr %8, i32 0, i32 0
  %14 = load ptr, ptr %13, align 8, !tbaa !9
  %15 = getelementptr inbounds %"class.juce::CodeDocument", ptr %14, i32 0, i32 0
  %16 = getelementptr inbounds %"class.juce::CodeDocument::Iterator", ptr %8, i32 0, i32 2
  %17 = load i32, ptr %16, align 8, !tbaa !13
  %18 = call noundef ptr @_ZNK4juce10OwnedArrayINS_16CodeDocumentLineENS_20DummyCriticalSectionEEixEi(ptr noundef nonnull align 8 dereferenceable(20) %15, i32 noundef %17) #3
  store ptr %18, ptr %3, align 8, !tbaa !5
  %19 = load ptr, ptr %3, align 8, !tbaa !5
  %20 = icmp eq ptr %19, null
  br i1 %20, label %21, label %22

21:                                               ; preds = %12
  store i32 1, ptr %4, align 4
  br label %26

22:                                               ; preds = %12
  %23 = load ptr, ptr %3, align 8, !tbaa !5
  %24 = getelementptr inbounds %"class.juce::CodeDocumentLine", ptr %23, i32 0, i32 0
  call void @_ZNK4juce6String14getCharPointerEv(ptr dead_on_unwind writable sret(%"class.juce::CharPointer_UTF8") align 8 %5, ptr noundef nonnull align 8 dereferenceable(8) %24) #3
  %25 = getelementptr inbounds %"class.juce::CodeDocument::Iterator", ptr %8, i32 0, i32 1
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #3
  call void @_ZN4juce16CharPointer_UTF8aSES0_(ptr dead_on_unwind writable sret(%"class.juce::CharPointer_UTF8") align 8 %6, ptr noundef nonnull align 8 dereferenceable(8) %25, ptr noundef %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  store i32 0, ptr %4, align 4
  br label %26

26:                                               ; preds = %22, %21
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #3
  %27 = load i32, ptr %4, align 4
  switch i32 %27, label %41 [
    i32 0, label %28
    i32 1, label %40
  ]

28:                                               ; preds = %26
  br label %29

29:                                               ; preds = %28, %1
  %30 = getelementptr inbounds %"class.juce::CodeDocument::Iterator", ptr %8, i32 0, i32 1
  %31 = call noundef i64 @_ZNK4juce16CharPointer_UTF86lengthEv(ptr noundef nonnull align 8 dereferenceable(8) %30) #3
  %32 = trunc i64 %31 to i32
  %33 = getelementptr inbounds %"class.juce::CodeDocument::Iterator", ptr %8, i32 0, i32 3
  %34 = load i32, ptr %33, align 4, !tbaa !14
  %35 = add nsw i32 %34, %32
  store i32 %35, ptr %33, align 4, !tbaa !14
  %36 = getelementptr inbounds %"class.juce::CodeDocument::Iterator", ptr %8, i32 0, i32 2
  %37 = load i32, ptr %36, align 8, !tbaa !13
  %38 = add nsw i32 %37, 1
  store i32 %38, ptr %36, align 8, !tbaa !13
  %39 = getelementptr inbounds %"class.juce::CodeDocument::Iterator", ptr %8, i32 0, i32 1
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  call void @_ZN4juce16CharPointer_UTF8aSEPKc(ptr dead_on_unwind writable sret(%"class.juce::CharPointer_UTF8") align 8 %7, ptr noundef nonnull align 8 dereferenceable(8) %39, ptr noundef null) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  br label %40

40:                                               ; preds = %29, %26
  ret void

41:                                               ; preds = %26
  unreachable
}

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

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 = { 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 = { 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, !6, i64 0}
!10 = !{!"_ZTSN4juce12CodeDocument8IteratorE", !6, i64 0, !11, i64 8, !12, i64 16, !12, i64 20}
!11 = !{!"_ZTSN4juce16CharPointer_UTF8E", !6, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!10, !12, i64 16}
!14 = !{!10, !12, i64 20}


; 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::CharPointer_UTF8" = type { ptr }

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

; Function Attrs: mustprogress 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 void @_ZN4juce16CharPointer_UTF8aSES0_(ptr dead_on_unwind noalias writable sret(%"class.juce::CharPointer_UTF8") align 8, ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #1 align 2

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN4juce12CodeDocument8Iterator15skipToEndOfLineEv(ptr noundef nonnull align 8 dereferenceable(24) %0) local_unnamed_addr #2 align 2 {
  %2 = alloca %"class.juce::CharPointer_UTF8", align 8
  %3 = alloca %"class.juce::CharPointer_UTF8", align 8
  %4 = alloca %"class.juce::CharPointer_UTF8", align 8
  %5 = getelementptr inbounds i8, ptr %0, i64 8
  %6 = tail call noundef ptr @_ZNK4juce16CharPointer_UTF810getAddressEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #3
  %7 = icmp eq ptr %6, null
  br i1 %7, label %8, label %14

8:                                                ; preds = %1
  %9 = load ptr, ptr %0, align 8, !tbaa !5
  %10 = getelementptr inbounds i8, ptr %0, i64 16
  %11 = load i32, ptr %10, align 8, !tbaa !12
  %12 = tail call noundef ptr @_ZNK4juce10OwnedArrayINS_16CodeDocumentLineENS_20DummyCriticalSectionEEixEi(ptr noundef nonnull align 8 dereferenceable(20) %9, i32 noundef %11) #3
  %13 = icmp eq ptr %12, null
  br i1 %13, label %21, label %.thread

.thread:                                          ; preds = %8
  call void @_ZNK4juce6String14getCharPointerEv(ptr dead_on_unwind nonnull writable sret(%"class.juce::CharPointer_UTF8") align 8 %2, ptr noundef nonnull align 8 dereferenceable(8) %12) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #3
  call void @_ZN4juce16CharPointer_UTF8aSES0_(ptr dead_on_unwind nonnull writable sret(%"class.juce::CharPointer_UTF8") align 8 %3, ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull %2) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #3
  br label %14

14:                                               ; preds = %.thread, %1
  %15 = call noundef i64 @_ZNK4juce16CharPointer_UTF86lengthEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #3
  %16 = trunc i64 %15 to i32
  %17 = getelementptr inbounds i8, ptr %0, i64 16
  %18 = load <2 x i32>, ptr %17, align 8, !tbaa !13
  %19 = insertelement <2 x i32> <i32 1, i32 poison>, i32 %16, i64 1
  %20 = add nsw <2 x i32> %18, %19
  store <2 x i32> %20, ptr %17, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #3
  call void @_ZN4juce16CharPointer_UTF8aSEPKc(ptr dead_on_unwind nonnull writable sret(%"class.juce::CharPointer_UTF8") align 8 %4, ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef null) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #3
  br label %21

21:                                               ; preds = %8, %14
  ret void
}

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

attributes #0 = { mustprogress 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 = { 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 = { 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, !7, i64 0}
!6 = !{!"_ZTSN4juce12CodeDocument8IteratorE", !7, i64 0, !10, i64 8, !11, i64 16, !11, i64 20}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSN4juce16CharPointer_UTF8E", !7, i64 0}
!11 = !{!"int", !8, i64 0}
!12 = !{!6, !11, i64 16}
!13 = !{!11, !11, i64 0}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass