; 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::StringRef" = type { %"class.juce::CharPointer_UTF8" }
%"class.juce::CharPointer_UTF8" = type { ptr }
%"class.juce::Array.521" = type { %"class.juce::ArrayAllocationBase.339", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.339" = type <{ %"class.juce::HeapBlock.340", i32, [4 x i8] }>
%"class.juce::HeapBlock.340" = type { ptr }
%"class.juce::String" = type { %"class.juce::CharPointer_UTF8" }
%"class.juce::TreeViewItem" = type <{ ptr, ptr, ptr, %"class.juce::OwnedArray.338", i32, i32, i32, i32, i32, i32, i8, [7 x i8] }>
%"class.juce::OwnedArray.338" = type { %"class.juce::ArrayAllocationBase.339", i32, [4 x i8] }

@.str.172 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.232 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.233 = external hidden unnamed_addr constant [5 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: nounwind
declare void @_ZN4juce9StringRefC1EPKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) unnamed_addr #0

; Function Attrs: nounwind
declare noundef zeroext i1 @_ZNK4juce10XmlElement10hasTagNameENS_9StringRefE(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef) #0

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4juce12TreeViewItem7setOpenEb(ptr noundef nonnull align 8 dereferenceable(73), i1 noundef zeroext) #4 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4juce12TreeViewItem20restoreOpennessStateERKNS_10XmlElementE(ptr noundef nonnull align 8 dereferenceable(73) %0, ptr noundef nonnull align 8 dereferenceable(32) %1) #4 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca %"class.juce::StringRef", align 8
  %6 = alloca %"class.juce::StringRef", align 8
  %7 = alloca %"class.juce::Array.521", align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca %"class.juce::String", align 8
  %13 = alloca %"class.juce::StringRef", align 8
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca %"class.juce::String", align 8
  %17 = alloca i32, align 4
  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
  %19 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZN4juce9StringRefC1EPKc(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef @.str.232) #5
  %20 = call noundef zeroext i1 @_ZNK4juce10XmlElement10hasTagNameENS_9StringRefE(ptr noundef nonnull align 8 dereferenceable(32) %19, ptr noundef %5) #5
  br i1 %20, label %21, label %22

21:                                               ; preds = %2
  call void @_ZN4juce12TreeViewItem7setOpenEb(ptr noundef nonnull align 8 dereferenceable(73) %18, i1 noundef zeroext false)
  br label %104

22:                                               ; preds = %2
  %23 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZN4juce9StringRefC1EPKc(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef @.str.233) #5
  %24 = call noundef zeroext i1 @_ZNK4juce10XmlElement10hasTagNameENS_9StringRefE(ptr noundef nonnull align 8 dereferenceable(32) %23, ptr noundef %6) #5
  br i1 %24, label %25, label %103

25:                                               ; preds = %22
  call void @_ZN4juce12TreeViewItem7setOpenEb(ptr noundef nonnull align 8 dereferenceable(73) %18, i1 noundef zeroext true)
  call void @llvm.lifetime.start.p0(i64 24, ptr %7) #5
  call void @_ZN4juce5ArrayIPNS_12TreeViewItemENS_20DummyCriticalSectionELi0EEC2Ev(ptr noundef nonnull align 8 dereferenceable(20) %7) #5
  %26 = getelementptr inbounds %"class.juce::TreeViewItem", ptr %18, i32 0, i32 3
  invoke void @_ZN4juce5ArrayIPNS_12TreeViewItemENS_20DummyCriticalSectionELi0EE8addArrayINS_10OwnedArrayIS1_S3_EEEEvRKT_ii(ptr noundef nonnull align 8 dereferenceable(20) %7, ptr noundef nonnull align 8 dereferenceable(20) %26, i32 noundef 0, i32 noundef -1)
          to label %27 unwind label %34

27:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %28 = load ptr, ptr %4, align 8, !tbaa !5
  %29 = call noundef ptr @_ZNK4juce10XmlElement20getFirstChildElementEv(ptr noundef nonnull align 8 dereferenceable(32) %28) #5
  store ptr %29, ptr %10, align 8, !tbaa !5
  br label %30

30:                                               ; preds = %80, %27
  %31 = load ptr, ptr %10, align 8, !tbaa !5
  %32 = icmp ne ptr %31, null
  br i1 %32, label %38, label %33

33:                                               ; preds = %30
  store i32 2, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  br label %83

34:                                               ; preds = %25
  %35 = landingpad { ptr, i32 }
          cleanup
  %36 = extractvalue { ptr, i32 } %35, 0
  store ptr %36, ptr %8, align 8
  %37 = extractvalue { ptr, i32 } %35, 1
  store i32 %37, ptr %9, align 4
  br label %102

38:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %39 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN4juce9StringRefC1EPKc(ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef @.str.172) #5
  %40 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK4juce10XmlElement18getStringAttributeENS_9StringRefE(ptr noundef nonnull align 8 dereferenceable(32) %39, ptr noundef %13) #5
  call void @_ZN4juce6StringC1ERKS0_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %40) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  store i32 0, ptr %14, align 4, !tbaa !9
  br label %41

41:                                               ; preds = %74, %38
  %42 = load i32, ptr %14, align 4, !tbaa !9
  %43 = call noundef i32 @_ZNK4juce5ArrayIPNS_12TreeViewItemENS_20DummyCriticalSectionELi0EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20) %7) #5
  %44 = icmp slt i32 %42, %43
  br i1 %44, label %46, label %45

45:                                               ; preds = %41
  store i32 5, ptr %11, align 4
  br label %78

46:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %47 = load i32, ptr %14, align 4, !tbaa !9
  %48 = invoke noundef ptr @_ZNK4juce5ArrayIPNS_12TreeViewItemENS_20DummyCriticalSectionELi0EE12getUncheckedEi(ptr noundef nonnull align 8 dereferenceable(20) %7, i32 noundef %47)
          to label %49 unwind label %62

49:                                               ; preds = %46
  store ptr %48, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %50 = load ptr, ptr %15, align 8, !tbaa !5
  %51 = load ptr, ptr %50, align 8, !tbaa !11
  %52 = getelementptr inbounds ptr, ptr %51, i64 3
  %53 = load ptr, ptr %52, align 8
  invoke void %53(ptr dead_on_unwind writable sret(%"class.juce::String") align 8 %16, ptr noundef nonnull align 8 dereferenceable(73) %50)
          to label %54 unwind label %66

54:                                               ; preds = %49
  %55 = call noundef zeroext i1 @_ZN4juceeqERKNS_6StringES2_(ptr noundef nonnull align 8 dereferenceable(8) %16, ptr noundef nonnull align 8 dereferenceable(8) %12) #5
  call void @_ZN4juce6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  br i1 %55, label %56, label %70

56:                                               ; preds = %54
  %57 = load ptr, ptr %15, align 8, !tbaa !5
  %58 = load ptr, ptr %10, align 8, !tbaa !5
  invoke void @_ZN4juce12TreeViewItem20restoreOpennessStateERKNS_10XmlElementE(ptr noundef nonnull align 8 dereferenceable(73) %57, ptr noundef nonnull align 8 dereferenceable(32) %58)
          to label %59 unwind label %62

59:                                               ; preds = %56
  %60 = load i32, ptr %14, align 4, !tbaa !9
  invoke void @_ZN4juce5ArrayIPNS_12TreeViewItemENS_20DummyCriticalSectionELi0EE6removeEi(ptr noundef nonnull align 8 dereferenceable(20) %7, i32 noundef %60)
          to label %61 unwind label %62

61:                                               ; preds = %59
  store i32 5, ptr %11, align 4
  br label %71

62:                                               ; preds = %59, %56, %46
  %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
  br label %77

66:                                               ; preds = %49
  %67 = landingpad { ptr, i32 }
          cleanup
  %68 = extractvalue { ptr, i32 } %67, 0
  store ptr %68, ptr %8, align 8
  %69 = extractvalue { ptr, i32 } %67, 1
  store i32 %69, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  br label %77

70:                                               ; preds = %54
  store i32 0, ptr %11, align 4
  br label %71

71:                                               ; preds = %70, %61
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  %72 = load i32, ptr %11, align 4
  switch i32 %72, label %78 [
    i32 0, label %73
  ]

73:                                               ; preds = %71
  br label %74

74:                                               ; preds = %73
  %75 = load i32, ptr %14, align 4, !tbaa !9
  %76 = add nsw i32 %75, 1
  store i32 %76, ptr %14, align 4, !tbaa !9
  br label %41, !llvm.loop !13

77:                                               ; preds = %66, %62
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @_ZN4juce6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  br label %102

78:                                               ; preds = %71, %45
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %79

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

80:                                               ; preds = %79
  %81 = load ptr, ptr %10, align 8, !tbaa !5
  %82 = call noundef ptr @_ZNK4juce10XmlElement14getNextElementEv(ptr noundef nonnull align 8 dereferenceable(32) %81) #5
  store ptr %82, ptr %10, align 8, !tbaa !5
  br label %30, !llvm.loop !15

83:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  store i32 0, ptr %17, align 4, !tbaa !9
  br label %84

84:                                               ; preds = %94, %83
  %85 = load i32, ptr %17, align 4, !tbaa !9
  %86 = call noundef i32 @_ZNK4juce5ArrayIPNS_12TreeViewItemENS_20DummyCriticalSectionELi0EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20) %7) #5
  %87 = icmp slt i32 %85, %86
  br i1 %87, label %89, label %88

88:                                               ; preds = %84
  store i32 8, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  br label %101

89:                                               ; preds = %84
  %90 = load i32, ptr %17, align 4, !tbaa !9
  %91 = invoke noundef ptr @_ZNK4juce5ArrayIPNS_12TreeViewItemENS_20DummyCriticalSectionELi0EE12getUncheckedEi(ptr noundef nonnull align 8 dereferenceable(20) %7, i32 noundef %90)
          to label %92 unwind label %97

92:                                               ; preds = %89
  invoke void @_ZN4juce12TreeViewItem24restoreToDefaultOpennessEv(ptr noundef nonnull align 8 dereferenceable(73) %91)
          to label %93 unwind label %97

93:                                               ; preds = %92
  br label %94

94:                                               ; preds = %93
  %95 = load i32, ptr %17, align 4, !tbaa !9
  %96 = add nsw i32 %95, 1
  store i32 %96, ptr %17, align 4, !tbaa !9
  br label %84, !llvm.loop !16

97:                                               ; preds = %92, %89
  %98 = landingpad { ptr, i32 }
          cleanup
  %99 = extractvalue { ptr, i32 } %98, 0
  store ptr %99, ptr %8, align 8
  %100 = extractvalue { ptr, i32 } %98, 1
  store i32 %100, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  br label %102

101:                                              ; preds = %88
  call void @_ZN4juce5ArrayIPNS_12TreeViewItemENS_20DummyCriticalSectionELi0EED2Ev(ptr noundef nonnull align 8 dereferenceable(20) %7) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #5
  br label %103

102:                                              ; preds = %97, %77, %34
  call void @_ZN4juce5ArrayIPNS_12TreeViewItemENS_20DummyCriticalSectionELi0EED2Ev(ptr noundef nonnull align 8 dereferenceable(20) %7) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #5
  br label %105

103:                                              ; preds = %101, %22
  br label %104

104:                                              ; preds = %103, %21
  ret void

105:                                              ; preds = %102
  %106 = load ptr, ptr %8, align 8
  %107 = load i32, ptr %9, align 4
  %108 = insertvalue { ptr, i32 } poison, ptr %106, 0
  %109 = insertvalue { ptr, i32 } %108, i32 %107, 1
  resume { ptr, i32 } %109
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4juce5ArrayIPNS_12TreeViewItemENS_20DummyCriticalSectionELi0EEC2Ev(ptr noundef nonnull align 8 dereferenceable(20)) unnamed_addr #2 align 2

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4juce5ArrayIPNS_12TreeViewItemENS_20DummyCriticalSectionELi0EED2Ev(ptr noundef nonnull align 8 dereferenceable(20)) 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 = { 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 = { 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 = { 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 #5 = { 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 = !{!12, !12, i64 0}
!12 = !{!"vtable pointer", !8, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}


; 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::StringRef" = type { %"class.juce::CharPointer_UTF8" }
%"class.juce::CharPointer_UTF8" = type { ptr }
%"class.juce::Array.521" = type { %"class.juce::ArrayAllocationBase.339", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.339" = type <{ %"class.juce::HeapBlock.340", i32, [4 x i8] }>
%"class.juce::HeapBlock.340" = type { ptr }
%"class.juce::String" = type { %"class.juce::CharPointer_UTF8" }

@.str.172 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.232 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.233 = external hidden unnamed_addr constant [5 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: nounwind
declare void @_ZN4juce9StringRefC1EPKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) unnamed_addr #0

; Function Attrs: nounwind
declare noundef zeroext i1 @_ZNK4juce10XmlElement10hasTagNameENS_9StringRefE(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef) local_unnamed_addr #0

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4juce12TreeViewItem7setOpenEb(ptr noundef nonnull align 8 dereferenceable(73), i1 noundef zeroext) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4juce12TreeViewItem20restoreOpennessStateERKNS_10XmlElementE(ptr noundef nonnull align 8 dereferenceable(73) %0, ptr noundef nonnull align 8 dereferenceable(32) %1) local_unnamed_addr #4 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.juce::StringRef", align 8
  %4 = alloca %"class.juce::StringRef", align 8
  %5 = alloca %"class.juce::Array.521", align 8
  %6 = alloca %"class.juce::String", align 8
  %7 = alloca %"class.juce::StringRef", align 8
  %8 = alloca %"class.juce::String", align 8
  call void @_ZN4juce9StringRefC1EPKc(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull @.str.232) #5
  %9 = call noundef zeroext i1 @_ZNK4juce10XmlElement10hasTagNameENS_9StringRefE(ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull %3) #5
  br i1 %9, label %10, label %11

10:                                               ; preds = %2
  call void @_ZN4juce12TreeViewItem7setOpenEb(ptr noundef nonnull align 8 dereferenceable(73) %0, i1 noundef zeroext false)
  br label %49

11:                                               ; preds = %2
  call void @_ZN4juce9StringRefC1EPKc(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull @.str.233) #5
  %12 = call noundef zeroext i1 @_ZNK4juce10XmlElement10hasTagNameENS_9StringRefE(ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull %4) #5
  br i1 %12, label %13, label %49

13:                                               ; preds = %11
  call void @_ZN4juce12TreeViewItem7setOpenEb(ptr noundef nonnull align 8 dereferenceable(73) %0, i1 noundef zeroext true)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #5
  call void @_ZN4juce5ArrayIPNS_12TreeViewItemENS_20DummyCriticalSectionELi0EEC2Ev(ptr noundef nonnull align 8 dereferenceable(20) %5) #5
  %14 = getelementptr inbounds i8, ptr %0, i64 24
  invoke void @_ZN4juce5ArrayIPNS_12TreeViewItemENS_20DummyCriticalSectionELi0EE8addArrayINS_10OwnedArrayIS1_S3_EEEEvRKT_ii(ptr noundef nonnull align 8 dereferenceable(20) %5, ptr noundef nonnull align 8 dereferenceable(20) %14, i32 noundef 0, i32 noundef -1)
          to label %15 unwind label %19

15:                                               ; preds = %13
  %16 = call noundef ptr @_ZNK4juce10XmlElement20getFirstChildElementEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #5
  %.not31 = icmp eq ptr %16, null
  br i1 %.not31, label %.preheader, label %.lr.ph34

.preheader:                                       ; preds = %.loopexit, %15
  %17 = call noundef i32 @_ZNK4juce5ArrayIPNS_12TreeViewItemENS_20DummyCriticalSectionELi0EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20) %5) #5
  %18 = icmp sgt i32 %17, 0
  br i1 %18, label %.lr.ph36, label %._crit_edge

19:                                               ; preds = %13
  %20 = landingpad { ptr, i32 }
          cleanup
  br label %48

.lr.ph34:                                         ; preds = %15, %.loopexit
  %.02232 = phi ptr [ %40, %.loopexit ], [ %16, %15 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #5
  call void @_ZN4juce9StringRefC1EPKc(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull @.str.172) #5
  %21 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK4juce10XmlElement18getStringAttributeENS_9StringRefE(ptr noundef nonnull align 8 dereferenceable(32) %.02232, ptr noundef nonnull %7) #5
  call void @_ZN4juce6StringC1ERKS0_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %21) #5
  %22 = call noundef i32 @_ZNK4juce5ArrayIPNS_12TreeViewItemENS_20DummyCriticalSectionELi0EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20) %5) #5
  %23 = icmp sgt i32 %22, 0
  br i1 %23, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %.lr.ph34, %.critedge
  %.02030 = phi i32 [ %36, %.critedge ], [ 0, %.lr.ph34 ]
  %24 = call noundef ptr @_ZNK4juce5ArrayIPNS_12TreeViewItemENS_20DummyCriticalSectionELi0EE12getUncheckedEi(ptr noundef nonnull align 8 dereferenceable(20) %5, i32 noundef %.02030)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #5
  %25 = load ptr, ptr %24, align 8, !tbaa !5
  %26 = getelementptr inbounds i8, ptr %25, i64 24
  %27 = load ptr, ptr %26, align 8
  invoke void %27(ptr dead_on_unwind nonnull writable sret(%"class.juce::String") align 8 %8, ptr noundef nonnull align 8 dereferenceable(73) %24)
          to label %28 unwind label %34

28:                                               ; preds = %.lr.ph
  %29 = call noundef zeroext i1 @_ZN4juceeqERKNS_6StringES2_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %6) #5
  call void @_ZN4juce6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #5
  br i1 %29, label %30, label %.critedge

30:                                               ; preds = %28
  invoke void @_ZN4juce12TreeViewItem20restoreOpennessStateERKNS_10XmlElementE(ptr noundef nonnull align 8 dereferenceable(73) %24, ptr noundef nonnull align 8 dereferenceable(32) %.02232)
          to label %31 unwind label %32

31:                                               ; preds = %30
  invoke void @_ZN4juce5ArrayIPNS_12TreeViewItemENS_20DummyCriticalSectionELi0EE6removeEi(ptr noundef nonnull align 8 dereferenceable(20) %5, i32 noundef %.02030)
          to label %.loopexit unwind label %32

32:                                               ; preds = %31, %30
  %33 = landingpad { ptr, i32 }
          cleanup
  br label %39

34:                                               ; preds = %.lr.ph
  %35 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #5
  br label %39

.critedge:                                        ; preds = %28
  %36 = add nuw nsw i32 %.02030, 1
  %37 = call noundef i32 @_ZNK4juce5ArrayIPNS_12TreeViewItemENS_20DummyCriticalSectionELi0EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20) %5) #5
  %38 = icmp slt i32 %36, %37
  br i1 %38, label %.lr.ph, label %.loopexit, !llvm.loop !8

39:                                               ; preds = %34, %32
  %.pn = phi { ptr, i32 } [ %33, %32 ], [ %35, %34 ]
  call void @_ZN4juce6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  br label %48

.loopexit:                                        ; preds = %.critedge, %.lr.ph34, %31
  call void @_ZN4juce6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  %40 = call noundef ptr @_ZNK4juce10XmlElement14getNextElementEv(ptr noundef nonnull align 8 dereferenceable(32) %.02232) #5
  %.not = icmp eq ptr %40, null
  br i1 %.not, label %.preheader, label %.lr.ph34, !llvm.loop !10

._crit_edge:                                      ; preds = %42, %.preheader
  call void @_ZN4juce5ArrayIPNS_12TreeViewItemENS_20DummyCriticalSectionELi0EED2Ev(ptr noundef nonnull align 8 dereferenceable(20) %5) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #5
  br label %49

.lr.ph36:                                         ; preds = %.preheader, %42
  %.035 = phi i32 [ %43, %42 ], [ 0, %.preheader ]
  %41 = call noundef ptr @_ZNK4juce5ArrayIPNS_12TreeViewItemENS_20DummyCriticalSectionELi0EE12getUncheckedEi(ptr noundef nonnull align 8 dereferenceable(20) %5, i32 noundef %.035)
  invoke void @_ZN4juce12TreeViewItem24restoreToDefaultOpennessEv(ptr noundef nonnull align 8 dereferenceable(73) %41)
          to label %42 unwind label %46

42:                                               ; preds = %.lr.ph36
  %43 = add nuw nsw i32 %.035, 1
  %44 = call noundef i32 @_ZNK4juce5ArrayIPNS_12TreeViewItemENS_20DummyCriticalSectionELi0EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20) %5) #5
  %45 = icmp slt i32 %43, %44
  br i1 %45, label %.lr.ph36, label %._crit_edge, !llvm.loop !11

46:                                               ; preds = %.lr.ph36
  %47 = landingpad { ptr, i32 }
          cleanup
  br label %48

48:                                               ; preds = %46, %39, %19
  %.pn.pn = phi { ptr, i32 } [ %.pn, %39 ], [ %47, %46 ], [ %20, %19 ]
  call void @_ZN4juce5ArrayIPNS_12TreeViewItemENS_20DummyCriticalSectionELi0EED2Ev(ptr noundef nonnull align 8 dereferenceable(20) %5) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #5
  resume { ptr, i32 } %.pn.pn

49:                                               ; preds = %11, %._crit_edge, %10
  ret void
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4juce5ArrayIPNS_12TreeViewItemENS_20DummyCriticalSectionELi0EEC2Ev(ptr noundef nonnull align 8 dereferenceable(20)) unnamed_addr #2 align 2

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4juce5ArrayIPNS_12TreeViewItemENS_20DummyCriticalSectionELi0EED2Ev(ptr noundef nonnull align 8 dereferenceable(20)) 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 = { 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 = { 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 #5 = { 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"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
!10 = distinct !{!10, !9}
!11 = distinct !{!11, !9}


; Effective O3 passes: GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass