; 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: mustprogress nounwind uwtable
define dso_local noundef signext i32 @_ZNK4juce12CodeDocument8Iterator12peekNextCharEv(ptr noundef nonnull align 8 dereferenceable(24) %0) #2 align 2 {
  %2 = alloca i32, align 4
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca %"class.juce::CharPointer_UTF8", align 8
  %6 = alloca %"class.juce::CharPointer_UTF8", align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  %10 = load ptr, ptr %3, align 8
  %11 = getelementptr inbounds %"class.juce::CodeDocument::Iterator", ptr %10, i32 0, i32 1
  %12 = call noundef ptr @_ZNK4juce16CharPointer_UTF810getAddressEv(ptr noundef nonnull align 8 dereferenceable(8) %11) #4
  %13 = icmp eq ptr %12, null
  br i1 %13, label %14, label %32

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

23:                                               ; preds = %14
  %24 = load ptr, ptr %4, align 8, !tbaa !5
  %25 = getelementptr inbounds %"class.juce::CodeDocumentLine", ptr %24, 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) %25) #4
  %26 = getelementptr inbounds %"class.juce::CodeDocument::Iterator", ptr %10, i32 0, i32 1
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  call void @_ZN4juce16CharPointer_UTF8aSES0_(ptr dead_on_unwind writable sret(%"class.juce::CharPointer_UTF8") align 8 %6, ptr noundef nonnull align 8 dereferenceable(8) %26, ptr noundef %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  br label %28

27:                                               ; preds = %14
  store i32 0, ptr %2, align 4
  store i32 1, ptr %7, align 4
  br label %29

28:                                               ; preds = %23
  store i32 0, ptr %7, align 4
  br label %29

29:                                               ; preds = %28, %27
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #4
  %30 = load i32, ptr %7, align 4
  switch i32 %30, label %62 [
    i32 0, label %31
    i32 1, label %60
  ]

31:                                               ; preds = %29
  br label %32

32:                                               ; preds = %31, %1
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  %33 = getelementptr inbounds %"class.juce::CodeDocument::Iterator", ptr %10, i32 0, i32 1
  %34 = call noundef signext i32 @_ZNK4juce16CharPointer_UTF8deEv(ptr noundef nonnull align 8 dereferenceable(8) %33) #4
  store i32 %34, ptr %8, align 4, !tbaa !14
  %35 = load i32, ptr %8, align 4, !tbaa !14
  %36 = icmp ne i32 %35, 0
  br i1 %36, label %37, label %39

37:                                               ; preds = %32
  %38 = load i32, ptr %8, align 4, !tbaa !14
  store i32 %38, ptr %2, align 4
  store i32 1, ptr %7, align 4
  br label %40

39:                                               ; preds = %32
  store i32 0, ptr %7, align 4
  br label %40

40:                                               ; preds = %39, %37
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  %41 = load i32, ptr %7, align 4
  switch i32 %41, label %62 [
    i32 0, label %42
    i32 1, label %60
  ]

42:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %43 = getelementptr inbounds %"class.juce::CodeDocument::Iterator", ptr %10, i32 0, i32 0
  %44 = load ptr, ptr %43, align 8, !tbaa !9
  %45 = getelementptr inbounds %"class.juce::CodeDocument", ptr %44, i32 0, i32 0
  %46 = getelementptr inbounds %"class.juce::CodeDocument::Iterator", ptr %10, i32 0, i32 2
  %47 = load i32, ptr %46, align 8, !tbaa !13
  %48 = add nsw i32 %47, 1
  %49 = call noundef ptr @_ZNK4juce10OwnedArrayINS_16CodeDocumentLineENS_20DummyCriticalSectionEEixEi(ptr noundef nonnull align 8 dereferenceable(20) %45, i32 noundef %48) #4
  store ptr %49, ptr %9, align 8, !tbaa !5
  %50 = load ptr, ptr %9, align 8, !tbaa !5
  %51 = icmp ne ptr %50, null
  br i1 %51, label %52, label %56

52:                                               ; preds = %42
  %53 = load ptr, ptr %9, align 8, !tbaa !5
  %54 = getelementptr inbounds %"class.juce::CodeDocumentLine", ptr %53, i32 0, i32 0
  %55 = call noundef signext i32 @_ZNK4juce6StringixEi(ptr noundef nonnull align 8 dereferenceable(8) %54, i32 noundef 0) #4
  store i32 %55, ptr %2, align 4
  store i32 1, ptr %7, align 4
  br label %57

56:                                               ; preds = %42
  store i32 0, ptr %7, align 4
  br label %57

57:                                               ; preds = %56, %52
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  %58 = load i32, ptr %7, align 4
  switch i32 %58, label %62 [
    i32 0, label %59
    i32 1, label %60
  ]

59:                                               ; preds = %57
  store i32 0, ptr %2, align 4
  br label %60

60:                                               ; preds = %59, %57, %40, %29
  %61 = load i32, ptr %2, align 4
  ret i32 %61

62:                                               ; preds = %57, %40, %29
  unreachable
}

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

; Function Attrs: nounwind
declare noundef signext i32 @_ZNK4juce6StringixEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #3

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 "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, !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 = !{!15, !15, i64 0}
!15 = !{!"wchar_t", !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::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: mustprogress nounwind uwtable
define dso_local noundef signext i32 @_ZNK4juce12CodeDocument8Iterator12peekNextCharEv(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 = getelementptr inbounds i8, ptr %0, i64 8
  %5 = tail call noundef ptr @_ZNK4juce16CharPointer_UTF810getAddressEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #4
  %6 = icmp eq ptr %5, null
  br i1 %6, label %7, label %12

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

.thread:                                          ; preds = %7
  call void @_ZNK4juce6String14getCharPointerEv(ptr dead_on_unwind nonnull writable sret(%"class.juce::CharPointer_UTF8") align 8 %2, ptr noundef nonnull align 8 dereferenceable(8) %11) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #4
  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) %4, ptr noundef nonnull %2) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #4
  br label %12

12:                                               ; preds = %.thread, %1
  %13 = call noundef signext i32 @_ZNK4juce16CharPointer_UTF8deEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #4
  %.not15.not = icmp eq i32 %13, 0
  br i1 %.not15.not, label %14, label %22

14:                                               ; preds = %12
  %15 = load ptr, ptr %0, align 8, !tbaa !5
  %16 = getelementptr inbounds i8, ptr %0, i64 16
  %17 = load i32, ptr %16, align 8, !tbaa !12
  %18 = add nsw i32 %17, 1
  %19 = call noundef ptr @_ZNK4juce10OwnedArrayINS_16CodeDocumentLineENS_20DummyCriticalSectionEEixEi(ptr noundef nonnull align 8 dereferenceable(20) %15, i32 noundef %18) #4
  %.not16.not = icmp eq ptr %19, null
  br i1 %.not16.not, label %22, label %20

20:                                               ; preds = %14
  %21 = call noundef signext i32 @_ZNK4juce6StringixEi(ptr noundef nonnull align 8 dereferenceable(8) %19, i32 noundef 0) #4
  br label %22

22:                                               ; preds = %20, %14, %7, %12
  %.4 = phi i32 [ %13, %12 ], [ 0, %7 ], [ %21, %20 ], [ 0, %14 ]
  ret i32 %.4
}

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

; Function Attrs: nounwind
declare noundef signext i32 @_ZNK4juce6StringixEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #3

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 "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, !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}


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