; 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::KeyPress" = type { i32, %"class.juce::ModifierKeys", i32 }
%"class.juce::ModifierKeys" = type { i32 }
%"class.juce::StringRef" = type { %"class.juce::CharPointer_UTF8" }
%"class.juce::CharPointer_UTF8" = type { ptr }
%"class.juce::KeyPressMappingSet" = type { %"class.juce::KeyListener", %"class.juce::ChangeBroadcaster", %"class.juce::FocusChangeListener", ptr, %"class.juce::OwnedArray.138", %"class.juce::OwnedArray.143" }
%"class.juce::KeyListener" = type { ptr }
%"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::FocusChangeListener" = type { ptr }
%"class.juce::OwnedArray.138" = type { %"class.juce::ArrayAllocationBase.139", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.139" = type <{ %"class.juce::HeapBlock.140", i32, [4 x i8] }>
%"class.juce::HeapBlock.140" = type { ptr }
%"class.juce::OwnedArray.143" = type { %"class.juce::ArrayAllocationBase.144", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.144" = type <{ %"class.juce::HeapBlock.145", i32, [4 x i8] }>
%"class.juce::HeapBlock.145" = type { ptr }
%"struct.juce::KeyPressMappingSet::CommandMapping" = type <{ i32, [4 x i8], %"class.juce::Array.104", i8, [7 x i8] }>
%"class.juce::Array.104" = type { %"class.juce::ArrayAllocationBase.105", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.105" = type <{ %"class.juce::HeapBlock.106", i32, [4 x i8] }>
%"class.juce::HeapBlock.106" = type { ptr }

@.str.242 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.243 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.244 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.245 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.246 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.247 = external hidden unnamed_addr constant [10 x i8], align 1

; 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: nounwind
declare void @_ZN4juce9StringRefC1EPKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) unnamed_addr #1

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

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

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

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

declare noundef zeroext i1 @_ZNK4juce10XmlElement16getBoolAttributeENS_9StringRefEb(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, i1 noundef zeroext) #3

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN4juce18KeyPressMappingSet14restoreFromXmlERKNS_10XmlElementE(ptr noundef nonnull align 8 dereferenceable(128) %0, ptr noundef nonnull align 8 dereferenceable(32) %1) #2 align 2 {
  %3 = alloca i1, align 1
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca %"class.juce::StringRef", align 8
  %7 = alloca %"class.juce::StringRef", align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca %"class.juce::StringRef", align 8
  %12 = alloca %"class.juce::KeyPress", align 4
  %13 = alloca %"class.juce::StringRef", align 8
  %14 = alloca %"class.juce::StringRef", align 8
  %15 = alloca %"class.juce::StringRef", align 8
  %16 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %17 = load ptr, ptr %4, align 8
  %18 = load ptr, ptr %5, align 8, !tbaa !5
  call void @_ZN4juce9StringRefC1EPKc(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef @.str.242) #6
  %19 = call noundef zeroext i1 @_ZNK4juce10XmlElement10hasTagNameENS_9StringRefE(ptr noundef nonnull align 8 dereferenceable(32) %18, ptr noundef %6) #6
  br i1 %19, label %20, label %79

20:                                               ; preds = %2
  %21 = load ptr, ptr %5, align 8, !tbaa !5
  call void @_ZN4juce9StringRefC1EPKc(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef @.str.243) #6
  %22 = call noundef zeroext i1 @_ZNK4juce10XmlElement16getBoolAttributeENS_9StringRefEb(ptr noundef nonnull align 8 dereferenceable(32) %21, ptr noundef %7, i1 noundef zeroext true)
  br i1 %22, label %23, label %24

23:                                               ; preds = %20
  call void @_ZN4juce18KeyPressMappingSet22resetToDefaultMappingsEv(ptr noundef nonnull align 8 dereferenceable(128) %17)
  br label %25

24:                                               ; preds = %20
  call void @_ZN4juce18KeyPressMappingSet18clearAllKeyPressesEv(ptr noundef nonnull align 8 dereferenceable(128) %17)
  br label %25

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

28:                                               ; preds = %75, %25
  %29 = load ptr, ptr %8, align 8, !tbaa !5
  %30 = icmp ne ptr %29, null
  br i1 %30, label %32, label %31

31:                                               ; preds = %28
  store i32 2, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  br label %78

32:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  %33 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN4juce9StringRefC1EPKc(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef @.str.244) #6
  %34 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK4juce10XmlElement18getStringAttributeENS_9StringRefE(ptr noundef nonnull align 8 dereferenceable(32) %33, ptr noundef %11) #6
  %35 = call noundef i32 @_ZNK4juce6String13getHexValue32Ev(ptr noundef nonnull align 8 dereferenceable(8) %34) #6
  store i32 %35, ptr %10, align 4, !tbaa !9
  %36 = load i32, ptr %10, align 4, !tbaa !9
  %37 = icmp ne i32 %36, 0
  br i1 %37, label %38, label %74

38:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 12, ptr %12) #6
  %39 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN4juce9StringRefC1EPKc(ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef @.str.245) #6
  %40 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK4juce10XmlElement18getStringAttributeENS_9StringRefE(ptr noundef nonnull align 8 dereferenceable(32) %39, ptr noundef %13) #6
  call void @_ZN4juce8KeyPress21createFromDescriptionERKNS_6StringE(ptr dead_on_unwind writable sret(%"class.juce::KeyPress") align 4 %12, ptr noundef nonnull align 8 dereferenceable(8) %40)
  %41 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN4juce9StringRefC1EPKc(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef @.str.246) #6
  %42 = call noundef zeroext i1 @_ZNK4juce10XmlElement10hasTagNameENS_9StringRefE(ptr noundef nonnull align 8 dereferenceable(32) %41, ptr noundef %14) #6
  br i1 %42, label %43, label %45

43:                                               ; preds = %38
  %44 = load i32, ptr %10, align 4, !tbaa !9
  call void @_ZN4juce18KeyPressMappingSet11addKeyPressEiRKNS_8KeyPressEi(ptr noundef nonnull align 8 dereferenceable(128) %17, i32 noundef %44, ptr noundef nonnull align 4 dereferenceable(12) %12, i32 noundef -1)
  br label %73

45:                                               ; preds = %38
  %46 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN4juce9StringRefC1EPKc(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef @.str.247) #6
  %47 = call noundef zeroext i1 @_ZNK4juce10XmlElement10hasTagNameENS_9StringRefE(ptr noundef nonnull align 8 dereferenceable(32) %46, ptr noundef %15) #6
  br i1 %47, label %48, label %72

48:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  %49 = getelementptr inbounds %"class.juce::KeyPressMappingSet", ptr %17, i32 0, i32 4
  %50 = call noundef i32 @_ZNK4juce10OwnedArrayINS_18KeyPressMappingSet14CommandMappingENS_20DummyCriticalSectionEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20) %49) #6
  store i32 %50, ptr %16, align 4, !tbaa !9
  br label %51

51:                                               ; preds = %70, %48
  %52 = load i32, ptr %16, align 4, !tbaa !9
  %53 = add nsw i32 %52, -1
  store i32 %53, ptr %16, align 4, !tbaa !9
  %54 = icmp sge i32 %53, 0
  br i1 %54, label %56, label %55

55:                                               ; preds = %51
  store i32 5, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  br label %71

56:                                               ; preds = %51
  %57 = getelementptr inbounds %"class.juce::KeyPressMappingSet", ptr %17, i32 0, i32 4
  %58 = load i32, ptr %16, align 4, !tbaa !9
  %59 = call noundef ptr @_ZNK4juce10OwnedArrayINS_18KeyPressMappingSet14CommandMappingENS_20DummyCriticalSectionEE12getUncheckedEi(ptr noundef nonnull align 8 dereferenceable(20) %57, i32 noundef %58) #6
  %60 = getelementptr inbounds %"struct.juce::KeyPressMappingSet::CommandMapping", ptr %59, i32 0, i32 0
  %61 = load i32, ptr %60, align 8, !tbaa !11
  %62 = load i32, ptr %10, align 4, !tbaa !9
  %63 = icmp eq i32 %61, %62
  br i1 %63, label %64, label %70

64:                                               ; preds = %56
  %65 = getelementptr inbounds %"class.juce::KeyPressMappingSet", ptr %17, i32 0, i32 4
  %66 = load i32, ptr %16, align 4, !tbaa !9
  %67 = call noundef ptr @_ZNK4juce10OwnedArrayINS_18KeyPressMappingSet14CommandMappingENS_20DummyCriticalSectionEE12getUncheckedEi(ptr noundef nonnull align 8 dereferenceable(20) %65, i32 noundef %66) #6
  %68 = getelementptr inbounds %"struct.juce::KeyPressMappingSet::CommandMapping", ptr %67, i32 0, i32 2
  %69 = call noundef i32 @_ZN4juce5ArrayINS_8KeyPressENS_20DummyCriticalSectionELi0EE20removeAllInstancesOfERKS1_(ptr noundef nonnull align 8 dereferenceable(20) %68, ptr noundef nonnull align 4 dereferenceable(12) %12)
  br label %70

70:                                               ; preds = %64, %56
  br label %51, !llvm.loop !17

71:                                               ; preds = %55
  br label %72

72:                                               ; preds = %71, %45
  br label %73

73:                                               ; preds = %72, %43
  call void @llvm.lifetime.end.p0(i64 12, ptr %12) #6
  br label %74

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

75:                                               ; preds = %74
  %76 = load ptr, ptr %8, align 8, !tbaa !5
  %77 = call noundef ptr @_ZNK4juce10XmlElement14getNextElementEv(ptr noundef nonnull align 8 dereferenceable(32) %76) #6
  store ptr %77, ptr %8, align 8, !tbaa !5
  br label %28, !llvm.loop !19

78:                                               ; preds = %31
  store i1 true, ptr %3, align 1
  br label %80

79:                                               ; preds = %2
  store i1 false, ptr %3, align 1
  br label %80

80:                                               ; preds = %79, %78
  %81 = load i1, ptr %3, align 1
  ret i1 %81
}

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { "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 nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 #6 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 0}
!12 = !{!"_ZTSN4juce18KeyPressMappingSet14CommandMappingE", !10, i64 0, !13, i64 8, !16, i64 32}
!13 = !{!"_ZTSN4juce5ArrayINS_8KeyPressENS_20DummyCriticalSectionELi0EEE", !14, i64 0, !10, i64 16}
!14 = !{!"_ZTSN4juce19ArrayAllocationBaseINS_8KeyPressENS_20DummyCriticalSectionEEE", !15, i64 0, !10, i64 8}
!15 = !{!"_ZTSN4juce9HeapBlockINS_8KeyPressELb0EEE", !6, i64 0}
!16 = !{!"bool", !7, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = distinct !{!19, !18}


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

@.str.242 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.243 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.244 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.245 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.246 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.247 = external hidden unnamed_addr constant [10 x i8], align 1

; 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: nounwind
declare void @_ZN4juce9StringRefC1EPKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) unnamed_addr #1

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

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

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

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

declare noundef zeroext i1 @_ZNK4juce10XmlElement16getBoolAttributeENS_9StringRefEb(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, i1 noundef zeroext) local_unnamed_addr #3

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN4juce18KeyPressMappingSet14restoreFromXmlERKNS_10XmlElementE(ptr noundef nonnull align 8 dereferenceable(128) %0, ptr noundef nonnull align 8 dereferenceable(32) %1) local_unnamed_addr #2 align 2 {
  %3 = alloca %"class.juce::StringRef", align 8
  %4 = alloca %"class.juce::StringRef", align 8
  %5 = alloca %"class.juce::StringRef", align 8
  %6 = alloca %"class.juce::KeyPress", align 4
  %7 = alloca %"class.juce::StringRef", align 8
  %8 = alloca %"class.juce::StringRef", align 8
  %9 = alloca %"class.juce::StringRef", align 8
  call void @_ZN4juce9StringRefC1EPKc(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull @.str.242) #6
  %10 = call noundef zeroext i1 @_ZNK4juce10XmlElement10hasTagNameENS_9StringRefE(ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull %3) #6
  br i1 %10, label %11, label %.loopexit21

11:                                               ; preds = %2
  call void @_ZN4juce9StringRefC1EPKc(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull @.str.243) #6
  %12 = call noundef zeroext i1 @_ZNK4juce10XmlElement16getBoolAttributeENS_9StringRefEb(ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull %4, i1 noundef zeroext true)
  br i1 %12, label %13, label %14

13:                                               ; preds = %11
  call void @_ZN4juce18KeyPressMappingSet22resetToDefaultMappingsEv(ptr noundef nonnull align 8 dereferenceable(128) %0)
  br label %15

14:                                               ; preds = %11
  call void @_ZN4juce18KeyPressMappingSet18clearAllKeyPressesEv(ptr noundef nonnull align 8 dereferenceable(128) %0)
  br label %15

15:                                               ; preds = %14, %13
  %16 = call noundef ptr @_ZNK4juce10XmlElement20getFirstChildElementEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #6
  %.not22 = icmp eq ptr %16, null
  br i1 %.not22, label %.loopexit21, label %.lr.ph25

.lr.ph25:                                         ; preds = %15
  %17 = getelementptr inbounds i8, ptr %0, i64 80
  br label %18

18:                                               ; preds = %.lr.ph25, %40
  %.01723 = phi ptr [ %16, %.lr.ph25 ], [ %41, %40 ]
  call void @_ZN4juce9StringRefC1EPKc(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull @.str.244) #6
  %19 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK4juce10XmlElement18getStringAttributeENS_9StringRefE(ptr noundef nonnull align 8 dereferenceable(32) %.01723, ptr noundef nonnull %5) #6
  %20 = call noundef i32 @_ZNK4juce6String13getHexValue32Ev(ptr noundef nonnull align 8 dereferenceable(8) %19) #6
  %.not20 = icmp eq i32 %20, 0
  br i1 %.not20, label %40, label %21

21:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %6) #6
  call void @_ZN4juce9StringRefC1EPKc(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull @.str.245) #6
  %22 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK4juce10XmlElement18getStringAttributeENS_9StringRefE(ptr noundef nonnull align 8 dereferenceable(32) %.01723, ptr noundef nonnull %7) #6
  call void @_ZN4juce8KeyPress21createFromDescriptionERKNS_6StringE(ptr dead_on_unwind nonnull writable sret(%"class.juce::KeyPress") align 4 %6, ptr noundef nonnull align 8 dereferenceable(8) %22)
  call void @_ZN4juce9StringRefC1EPKc(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull @.str.246) #6
  %23 = call noundef zeroext i1 @_ZNK4juce10XmlElement10hasTagNameENS_9StringRefE(ptr noundef nonnull align 8 dereferenceable(32) %.01723, ptr noundef nonnull %8) #6
  br i1 %23, label %24, label %25

24:                                               ; preds = %21
  call void @_ZN4juce18KeyPressMappingSet11addKeyPressEiRKNS_8KeyPressEi(ptr noundef nonnull align 8 dereferenceable(128) %0, i32 noundef %20, ptr noundef nonnull align 4 dereferenceable(12) %6, i32 noundef -1)
  br label %.loopexit

25:                                               ; preds = %21
  call void @_ZN4juce9StringRefC1EPKc(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull @.str.247) #6
  %26 = call noundef zeroext i1 @_ZNK4juce10XmlElement10hasTagNameENS_9StringRefE(ptr noundef nonnull align 8 dereferenceable(32) %.01723, ptr noundef nonnull %9) #6
  br i1 %26, label %27, label %.loopexit

27:                                               ; preds = %25
  %28 = call noundef i32 @_ZNK4juce10OwnedArrayINS_18KeyPressMappingSet14CommandMappingENS_20DummyCriticalSectionEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20) %17) #6
  %29 = icmp sgt i32 %28, 0
  br i1 %29, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %27, %38
  %.in = phi i32 [ %30, %38 ], [ %28, %27 ]
  %30 = add nsw i32 %.in, -1
  %31 = call noundef ptr @_ZNK4juce10OwnedArrayINS_18KeyPressMappingSet14CommandMappingENS_20DummyCriticalSectionEE12getUncheckedEi(ptr noundef nonnull align 8 dereferenceable(20) %17, i32 noundef %30) #6
  %32 = load i32, ptr %31, align 8, !tbaa !5
  %33 = icmp eq i32 %32, %20
  br i1 %33, label %34, label %38

34:                                               ; preds = %.lr.ph
  %35 = call noundef ptr @_ZNK4juce10OwnedArrayINS_18KeyPressMappingSet14CommandMappingENS_20DummyCriticalSectionEE12getUncheckedEi(ptr noundef nonnull align 8 dereferenceable(20) %17, i32 noundef %30) #6
  %36 = getelementptr inbounds i8, ptr %35, i64 8
  %37 = call noundef i32 @_ZN4juce5ArrayINS_8KeyPressENS_20DummyCriticalSectionELi0EE20removeAllInstancesOfERKS1_(ptr noundef nonnull align 8 dereferenceable(20) %36, ptr noundef nonnull align 4 dereferenceable(12) %6)
  br label %38

38:                                               ; preds = %34, %.lr.ph
  %39 = icmp ugt i32 %.in, 1
  br i1 %39, label %.lr.ph, label %.loopexit, !llvm.loop !15

.loopexit:                                        ; preds = %38, %27, %25, %24
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %6) #6
  br label %40

40:                                               ; preds = %.loopexit, %18
  %41 = call noundef ptr @_ZNK4juce10XmlElement14getNextElementEv(ptr noundef nonnull align 8 dereferenceable(32) %.01723) #6
  %.not = icmp eq ptr %41, null
  br i1 %.not, label %.loopexit21, label %18, !llvm.loop !17

.loopexit21:                                      ; preds = %40, %15, %2
  ret i1 %10
}

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { "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 nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 #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, !7, i64 0}
!6 = !{!"_ZTSN4juce18KeyPressMappingSet14CommandMappingE", !7, i64 0, !10, i64 8, !14, i64 32}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSN4juce5ArrayINS_8KeyPressENS_20DummyCriticalSectionELi0EEE", !11, i64 0, !7, i64 16}
!11 = !{!"_ZTSN4juce19ArrayAllocationBaseINS_8KeyPressENS_20DummyCriticalSectionEEE", !12, i64 0, !7, i64 8}
!12 = !{!"_ZTSN4juce9HeapBlockINS_8KeyPressELb0EEE", !13, i64 0}
!13 = !{!"any pointer", !8, i64 0}
!14 = !{!"bool", !8, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass