; 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::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 }
%"struct.juce::KeyPressMappingSet::KeyPressTime" = type { %"class.juce::KeyPress", i32 }

; 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: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(12) ptr @_ZN4juce8KeyPressaSERKS0_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK4juce8KeyPresseqERKS0_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK4juce8KeyPress15isCurrentlyDownEv(ptr noundef nonnull align 4 dereferenceable(12)) #3 align 2

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

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

; Function Attrs: nounwind
declare noundef i32 @_ZN4juce4Time21getMillisecondCounterEv() #5

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #6

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK4juce10OwnedArrayINS_18KeyPressMappingSet14CommandMappingENS_20DummyCriticalSectionEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20)) #4 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) #4 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN4juce18KeyPressMappingSet15keyStateChangedEbPNS_9ComponentE(ptr noundef nonnull align 8 dereferenceable(128) %0, i1 noundef zeroext %1, ptr noundef %2) unnamed_addr #3 align 2 {
  %4 = alloca ptr, align 8
  %5 = alloca i8, align 1
  %6 = alloca ptr, align 8
  %7 = alloca i8, align 1
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca %"class.juce::KeyPress", align 4
  %14 = alloca i8, align 1
  %15 = alloca i32, align 4
  %16 = alloca i8, align 1
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca ptr, align 8
  %20 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  %21 = zext i1 %1 to i8
  store i8 %21, ptr %5, align 1, !tbaa !9
  store ptr %2, ptr %6, align 8, !tbaa !5
  %22 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 1, ptr %7) #7
  store i8 0, ptr %7, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  %23 = call noundef i32 @_ZN4juce4Time21getMillisecondCounterEv() #7
  store i32 %23, ptr %8, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  %24 = getelementptr inbounds %"class.juce::KeyPressMappingSet", ptr %22, i32 0, i32 4
  %25 = call noundef i32 @_ZNK4juce10OwnedArrayINS_18KeyPressMappingSet14CommandMappingENS_20DummyCriticalSectionEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20) %24) #7
  store i32 %25, ptr %9, align 4, !tbaa !11
  br label %26

26:                                               ; preds = %120, %3
  %27 = load i32, ptr %9, align 4, !tbaa !11
  %28 = add nsw i32 %27, -1
  store i32 %28, ptr %9, align 4, !tbaa !11
  %29 = icmp sge i32 %28, 0
  br i1 %29, label %31, label %30

30:                                               ; preds = %26
  store i32 2, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %121

31:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  %32 = getelementptr inbounds %"class.juce::KeyPressMappingSet", ptr %22, i32 0, i32 4
  %33 = load i32, ptr %9, align 4, !tbaa !11
  %34 = call noundef ptr @_ZNK4juce10OwnedArrayINS_18KeyPressMappingSet14CommandMappingENS_20DummyCriticalSectionEE12getUncheckedEi(ptr noundef nonnull align 8 dereferenceable(20) %32, i32 noundef %33) #7
  store ptr %34, ptr %11, align 8, !tbaa !5
  %35 = load ptr, ptr %11, align 8, !tbaa !5
  %36 = getelementptr inbounds %"struct.juce::KeyPressMappingSet::CommandMapping", ptr %35, i32 0, i32 3
  %37 = load i8, ptr %36, align 8, !tbaa !13, !range !18, !noundef !19
  %38 = trunc i8 %37 to i1
  br i1 %38, label %39, label %120

39:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  %40 = load ptr, ptr %11, align 8, !tbaa !5
  %41 = getelementptr inbounds %"struct.juce::KeyPressMappingSet::CommandMapping", ptr %40, i32 0, i32 2
  %42 = call noundef i32 @_ZNK4juce5ArrayINS_8KeyPressENS_20DummyCriticalSectionELi0EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20) %41) #7
  store i32 %42, ptr %12, align 4, !tbaa !11
  br label %43

43:                                               ; preds = %118, %39
  %44 = load i32, ptr %12, align 4, !tbaa !11
  %45 = add nsw i32 %44, -1
  store i32 %45, ptr %12, align 4, !tbaa !11
  %46 = icmp sge i32 %45, 0
  br i1 %46, label %48, label %47

47:                                               ; preds = %43
  store i32 4, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  br label %119

48:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 12, ptr %13) #7
  %49 = load ptr, ptr %11, align 8, !tbaa !5
  %50 = getelementptr inbounds %"struct.juce::KeyPressMappingSet::CommandMapping", ptr %49, i32 0, i32 2
  %51 = load i32, ptr %12, align 4, !tbaa !11
  %52 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNK4juce5ArrayINS_8KeyPressENS_20DummyCriticalSectionELi0EE12getReferenceEi(ptr noundef nonnull align 8 dereferenceable(20) %50, i32 noundef %51) #7
  call void @_ZN4juce8KeyPressC1ERKS0_(ptr noundef nonnull align 4 dereferenceable(12) %13, ptr noundef nonnull align 4 dereferenceable(12) %52) #7
  call void @llvm.lifetime.start.p0(i64 1, ptr %14) #7
  %53 = call noundef zeroext i1 @_ZNK4juce8KeyPress15isCurrentlyDownEv(ptr noundef nonnull align 4 dereferenceable(12) %13)
  %54 = zext i1 %53 to i8
  store i8 %54, ptr %14, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  store i32 0, ptr %15, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 1, ptr %16) #7
  store i8 0, ptr %16, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  %55 = getelementptr inbounds %"class.juce::KeyPressMappingSet", ptr %22, i32 0, i32 5
  %56 = call noundef i32 @_ZNK4juce10OwnedArrayINS_18KeyPressMappingSet12KeyPressTimeENS_20DummyCriticalSectionEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20) %55) #7
  store i32 %56, ptr %17, align 4, !tbaa !11
  br label %57

57:                                               ; preds = %70, %48
  %58 = load i32, ptr %17, align 4, !tbaa !11
  %59 = add nsw i32 %58, -1
  store i32 %59, ptr %17, align 4, !tbaa !11
  %60 = icmp sge i32 %59, 0
  br i1 %60, label %62, label %61

61:                                               ; preds = %57
  store i32 6, ptr %10, align 4
  br label %71

62:                                               ; preds = %57
  %63 = getelementptr inbounds %"class.juce::KeyPressMappingSet", ptr %22, i32 0, i32 5
  %64 = load i32, ptr %17, align 4, !tbaa !11
  %65 = call noundef ptr @_ZNK4juce10OwnedArrayINS_18KeyPressMappingSet12KeyPressTimeENS_20DummyCriticalSectionEE12getUncheckedEi(ptr noundef nonnull align 8 dereferenceable(20) %63, i32 noundef %64) #7
  %66 = getelementptr inbounds %"struct.juce::KeyPressMappingSet::KeyPressTime", ptr %65, i32 0, i32 0
  %67 = call noundef zeroext i1 @_ZNK4juce8KeyPresseqERKS0_(ptr noundef nonnull align 4 dereferenceable(12) %13, ptr noundef nonnull align 4 dereferenceable(12) %66) #7
  br i1 %67, label %68, label %70

68:                                               ; preds = %62
  %69 = load i32, ptr %17, align 4, !tbaa !11
  store i32 %69, ptr %15, align 4, !tbaa !11
  store i8 1, ptr %16, align 1, !tbaa !9
  store i8 1, ptr %7, align 1, !tbaa !9
  store i32 6, ptr %10, align 4
  br label %71

70:                                               ; preds = %62
  br label %57, !llvm.loop !20

71:                                               ; preds = %68, %61
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  br label %72

72:                                               ; preds = %71
  %73 = load i8, ptr %14, align 1, !tbaa !9, !range !18, !noundef !19
  %74 = trunc i8 %73 to i1
  %75 = zext i1 %74 to i32
  %76 = load i8, ptr %16, align 1, !tbaa !9, !range !18, !noundef !19
  %77 = trunc i8 %76 to i1
  %78 = zext i1 %77 to i32
  %79 = icmp ne i32 %75, %78
  br i1 %79, label %80, label %118

80:                                               ; preds = %72
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  store i32 0, ptr %18, align 4, !tbaa !11
  %81 = load i8, ptr %14, align 1, !tbaa !9, !range !18, !noundef !19
  %82 = trunc i8 %81 to i1
  br i1 %82, label %83, label %94

83:                                               ; preds = %80
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #7
  %84 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 16) #8
  call void @llvm.memset.p0.i64(ptr align 16 %84, i8 0, i64 16, i1 false)
  call void @_ZN4juce18KeyPressMappingSet12KeyPressTimeC2Ev(ptr noundef nonnull align 4 dereferenceable(16) %84) #7
  store ptr %84, ptr %19, align 8, !tbaa !5
  %85 = load ptr, ptr %19, align 8, !tbaa !5
  %86 = getelementptr inbounds %"struct.juce::KeyPressMappingSet::KeyPressTime", ptr %85, i32 0, i32 0
  %87 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN4juce8KeyPressaSERKS0_(ptr noundef nonnull align 4 dereferenceable(12) %86, ptr noundef nonnull align 4 dereferenceable(12) %13) #7
  %88 = load i32, ptr %8, align 4, !tbaa !11
  %89 = load ptr, ptr %19, align 8, !tbaa !5
  %90 = getelementptr inbounds %"struct.juce::KeyPressMappingSet::KeyPressTime", ptr %89, i32 0, i32 1
  store i32 %88, ptr %90, align 4, !tbaa !22
  %91 = getelementptr inbounds %"class.juce::KeyPressMappingSet", ptr %22, i32 0, i32 5
  %92 = load ptr, ptr %19, align 8, !tbaa !5
  %93 = call noundef ptr @_ZN4juce10OwnedArrayINS_18KeyPressMappingSet12KeyPressTimeENS_20DummyCriticalSectionEE3addEPS2_(ptr noundef nonnull align 8 dereferenceable(20) %91, ptr noundef %92) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  br label %110

94:                                               ; preds = %80
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #7
  %95 = getelementptr inbounds %"class.juce::KeyPressMappingSet", ptr %22, i32 0, i32 5
  %96 = load i32, ptr %15, align 4, !tbaa !11
  %97 = call noundef ptr @_ZNK4juce10OwnedArrayINS_18KeyPressMappingSet12KeyPressTimeENS_20DummyCriticalSectionEE12getUncheckedEi(ptr noundef nonnull align 8 dereferenceable(20) %95, i32 noundef %96) #7
  %98 = getelementptr inbounds %"struct.juce::KeyPressMappingSet::KeyPressTime", ptr %97, i32 0, i32 1
  %99 = load i32, ptr %98, align 4, !tbaa !22
  store i32 %99, ptr %20, align 4, !tbaa !11
  %100 = load i32, ptr %8, align 4, !tbaa !11
  %101 = load i32, ptr %20, align 4, !tbaa !11
  %102 = icmp ugt i32 %100, %101
  br i1 %102, label %103, label %107

103:                                              ; preds = %94
  %104 = load i32, ptr %8, align 4, !tbaa !11
  %105 = load i32, ptr %20, align 4, !tbaa !11
  %106 = sub i32 %104, %105
  store i32 %106, ptr %18, align 4, !tbaa !11
  br label %107

107:                                              ; preds = %103, %94
  %108 = getelementptr inbounds %"class.juce::KeyPressMappingSet", ptr %22, i32 0, i32 5
  %109 = load i32, ptr %15, align 4, !tbaa !11
  call void @_ZN4juce10OwnedArrayINS_18KeyPressMappingSet12KeyPressTimeENS_20DummyCriticalSectionEE6removeEib(ptr noundef nonnull align 8 dereferenceable(20) %108, i32 noundef %109, i1 noundef zeroext true)
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  br label %110

110:                                              ; preds = %107, %83
  %111 = load ptr, ptr %11, align 8, !tbaa !5
  %112 = getelementptr inbounds %"struct.juce::KeyPressMappingSet::CommandMapping", ptr %111, i32 0, i32 0
  %113 = load i32, ptr %112, align 8, !tbaa !27
  %114 = load i8, ptr %14, align 1, !tbaa !9, !range !18, !noundef !19
  %115 = trunc i8 %114 to i1
  %116 = load i32, ptr %18, align 4, !tbaa !11
  %117 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZNK4juce18KeyPressMappingSet13invokeCommandEiRKNS_8KeyPressEbiPNS_9ComponentE(ptr noundef nonnull align 8 dereferenceable(128) %22, i32 noundef %113, ptr noundef nonnull align 4 dereferenceable(12) %13, i1 noundef zeroext %115, i32 noundef %116, ptr noundef %117)
  store i8 1, ptr %7, align 1, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  br label %118

118:                                              ; preds = %110, %72
  call void @llvm.lifetime.end.p0(i64 1, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %13) #7
  br label %43, !llvm.loop !28

119:                                              ; preds = %47
  br label %120

120:                                              ; preds = %119, %31
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  br label %26, !llvm.loop !29

121:                                              ; preds = %30
  %122 = load i8, ptr %7, align 1, !tbaa !9, !range !18, !noundef !19
  %123 = trunc i8 %122 to i1
  store i32 1, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #7
  ret i1 %123
}

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN4juce18KeyPressMappingSet12KeyPressTimeC2Ev(ptr noundef nonnull align 4 dereferenceable(16)) unnamed_addr #4 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4juce10OwnedArrayINS_18KeyPressMappingSet12KeyPressTimeENS_20DummyCriticalSectionEE6removeEib(ptr noundef nonnull align 8 dereferenceable(20), i32 noundef, i1 noundef zeroext) #3 align 2

declare void @_ZN4juce8KeyPressC1ERKS0_(ptr, ptr)

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nobuiltin allocsize(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 = { 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 #4 = { 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 #5 = { 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 #6 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #7 = { nounwind }
attributes #8 = { builtin allocsize(0) }

!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 = !{!"bool", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !10, i64 32}
!14 = !{!"_ZTSN4juce18KeyPressMappingSet14CommandMappingE", !12, i64 0, !15, i64 8, !10, i64 32}
!15 = !{!"_ZTSN4juce5ArrayINS_8KeyPressENS_20DummyCriticalSectionELi0EEE", !16, i64 0, !12, i64 16}
!16 = !{!"_ZTSN4juce19ArrayAllocationBaseINS_8KeyPressENS_20DummyCriticalSectionEEE", !17, i64 0, !12, i64 8}
!17 = !{!"_ZTSN4juce9HeapBlockINS_8KeyPressELb0EEE", !6, i64 0}
!18 = !{i8 0, i8 2}
!19 = !{}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = !{!23, !12, i64 12}
!23 = !{!"_ZTSN4juce18KeyPressMappingSet12KeyPressTimeE", !24, i64 0, !12, i64 12}
!24 = !{!"_ZTSN4juce8KeyPressE", !12, i64 0, !25, i64 4, !26, i64 8}
!25 = !{!"_ZTSN4juce12ModifierKeysE", !12, i64 0}
!26 = !{!"wchar_t", !7, i64 0}
!27 = !{!14, !12, i64 0}
!28 = distinct !{!28, !21}
!29 = distinct !{!29, !21}


; 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 }

; 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: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(12) ptr @_ZN4juce8KeyPressaSERKS0_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK4juce8KeyPresseqERKS0_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK4juce8KeyPress15isCurrentlyDownEv(ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #3 align 2

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

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

; Function Attrs: nounwind
declare noundef i32 @_ZN4juce4Time21getMillisecondCounterEv() local_unnamed_addr #5

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #6

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK4juce10OwnedArrayINS_18KeyPressMappingSet14CommandMappingENS_20DummyCriticalSectionEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20)) local_unnamed_addr #4 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 #4 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN4juce18KeyPressMappingSet15keyStateChangedEbPNS_9ComponentE(ptr noundef nonnull align 8 dereferenceable(128) %0, i1 noundef zeroext %1, ptr noundef %2) unnamed_addr #3 align 2 {
  %4 = alloca %"class.juce::KeyPress", align 4
  %5 = tail call noundef i32 @_ZN4juce4Time21getMillisecondCounterEv() #8
  %6 = getelementptr inbounds i8, ptr %0, i64 80
  %7 = tail call noundef i32 @_ZNK4juce10OwnedArrayINS_18KeyPressMappingSet14CommandMappingENS_20DummyCriticalSectionEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20) %6) #8
  %8 = icmp sgt i32 %7, 0
  br i1 %8, label %.lr.ph46, label %._crit_edge47

.lr.ph46:                                         ; preds = %3
  %9 = getelementptr inbounds i8, ptr %0, i64 104
  br label %10

._crit_edge47:                                    ; preds = %.loopexit, %3
  %.0.lcssa = phi i1 [ false, %3 ], [ %.4, %.loopexit ]
  ret i1 %.0.lcssa

10:                                               ; preds = %.lr.ph46, %.loopexit
  %.in = phi i32 [ %7, %.lr.ph46 ], [ %11, %.loopexit ]
  %.044 = phi i1 [ false, %.lr.ph46 ], [ %.4, %.loopexit ]
  %11 = add nsw i32 %.in, -1
  %12 = call noundef ptr @_ZNK4juce10OwnedArrayINS_18KeyPressMappingSet14CommandMappingENS_20DummyCriticalSectionEE12getUncheckedEi(ptr noundef nonnull align 8 dereferenceable(20) %6, i32 noundef %11) #8
  %13 = getelementptr inbounds i8, ptr %12, i64 32
  %14 = load i8, ptr %13, align 8, !tbaa !5, !range !15, !noundef !16
  %15 = trunc nuw i8 %14 to i1
  br i1 %15, label %16, label %.loopexit

16:                                               ; preds = %10
  %17 = getelementptr inbounds i8, ptr %12, i64 8
  %18 = call noundef i32 @_ZNK4juce5ArrayINS_8KeyPressENS_20DummyCriticalSectionELi0EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20) %17) #8
  %19 = icmp sgt i32 %18, 0
  br i1 %19, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %16, %42
  %.in49 = phi i32 [ %20, %42 ], [ %18, %16 ]
  %.142 = phi i1 [ %.3, %42 ], [ %.044, %16 ]
  %20 = add nsw i32 %.in49, -1
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %4) #8
  %21 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNK4juce5ArrayINS_8KeyPressENS_20DummyCriticalSectionELi0EE12getReferenceEi(ptr noundef nonnull align 8 dereferenceable(20) %17, i32 noundef %20) #8
  call void @_ZN4juce8KeyPressC1ERKS0_(ptr noundef nonnull align 4 dereferenceable(12) %4, ptr noundef nonnull align 4 dereferenceable(12) %21) #8
  %22 = call noundef zeroext i1 @_ZNK4juce8KeyPress15isCurrentlyDownEv(ptr noundef nonnull align 4 dereferenceable(12) %4)
  %23 = call noundef i32 @_ZNK4juce10OwnedArrayINS_18KeyPressMappingSet12KeyPressTimeENS_20DummyCriticalSectionEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20) %9) #8
  br label %24

24:                                               ; preds = %26, %.lr.ph
  %.031 = phi i32 [ %23, %.lr.ph ], [ %27, %26 ]
  %25 = icmp sgt i32 %.031, 0
  br i1 %25, label %26, label %._crit_edge

._crit_edge:                                      ; preds = %24
  br i1 %22, label %31, label %42

26:                                               ; preds = %24
  %27 = add nsw i32 %.031, -1
  %28 = call noundef ptr @_ZNK4juce10OwnedArrayINS_18KeyPressMappingSet12KeyPressTimeENS_20DummyCriticalSectionEE12getUncheckedEi(ptr noundef nonnull align 8 dereferenceable(20) %9, i32 noundef %27) #8
  %29 = call noundef zeroext i1 @_ZNK4juce8KeyPresseqERKS0_(ptr noundef nonnull align 4 dereferenceable(12) %4, ptr noundef nonnull align 4 dereferenceable(12) %28) #8
  br i1 %29, label %30, label %24, !llvm.loop !17

30:                                               ; preds = %26
  br i1 %22, label %42, label %36

31:                                               ; preds = %._crit_edge
  %32 = call noalias noundef nonnull dereferenceable(16) ptr @_Znwm(i64 noundef 16) #9
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %32, i8 0, i64 16, i1 false)
  call void @_ZN4juce18KeyPressMappingSet12KeyPressTimeC2Ev(ptr noundef nonnull align 4 dereferenceable(16) %32) #8
  %33 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN4juce8KeyPressaSERKS0_(ptr noundef nonnull align 4 dereferenceable(12) %32, ptr noundef nonnull align 4 dereferenceable(12) %4) #8
  %34 = getelementptr inbounds i8, ptr %32, i64 12
  store i32 %5, ptr %34, align 4, !tbaa !19
  %35 = call noundef ptr @_ZN4juce10OwnedArrayINS_18KeyPressMappingSet12KeyPressTimeENS_20DummyCriticalSectionEE3addEPS2_(ptr noundef nonnull align 8 dereferenceable(20) %9, ptr noundef nonnull %32) #8
  br label %40

36:                                               ; preds = %30
  %37 = call noundef ptr @_ZNK4juce10OwnedArrayINS_18KeyPressMappingSet12KeyPressTimeENS_20DummyCriticalSectionEE12getUncheckedEi(ptr noundef nonnull align 8 dereferenceable(20) %9, i32 noundef %27) #8
  %38 = getelementptr inbounds i8, ptr %37, i64 12
  %39 = load i32, ptr %38, align 4, !tbaa !19
  %spec.select = call i32 @llvm.usub.sat.i32(i32 %5, i32 %39)
  call void @_ZN4juce10OwnedArrayINS_18KeyPressMappingSet12KeyPressTimeENS_20DummyCriticalSectionEE6removeEib(ptr noundef nonnull align 8 dereferenceable(20) %9, i32 noundef %27, i1 noundef zeroext true)
  br label %40

40:                                               ; preds = %36, %31
  %.130 = phi i32 [ 0, %31 ], [ %spec.select, %36 ]
  %41 = load i32, ptr %12, align 8, !tbaa !24
  call void @_ZNK4juce18KeyPressMappingSet13invokeCommandEiRKNS_8KeyPressEbiPNS_9ComponentE(ptr noundef nonnull align 8 dereferenceable(128) %0, i32 noundef %41, ptr noundef nonnull align 4 dereferenceable(12) %4, i1 noundef zeroext %22, i32 noundef %.130, ptr noundef %2)
  br label %42

42:                                               ; preds = %._crit_edge, %40, %30
  %.3 = phi i1 [ true, %40 ], [ true, %30 ], [ %.142, %._crit_edge ]
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %4) #8
  %43 = icmp sgt i32 %.in49, 1
  br i1 %43, label %.lr.ph, label %.loopexit, !llvm.loop !25

.loopexit:                                        ; preds = %42, %16, %10
  %.4 = phi i1 [ %.044, %10 ], [ %.044, %16 ], [ %.3, %42 ]
  %44 = icmp sgt i32 %.in, 1
  br i1 %44, label %10, label %._crit_edge47, !llvm.loop !26
}

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN4juce18KeyPressMappingSet12KeyPressTimeC2Ev(ptr noundef nonnull align 4 dereferenceable(16)) unnamed_addr #4 align 2

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

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

declare void @_ZN4juce8KeyPressC1ERKS0_(ptr, ptr) local_unnamed_addr

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.usub.sat.i32(i32, i32) #7

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nobuiltin allocsize(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 = { 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 #4 = { 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 #5 = { 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 #6 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #7 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #8 = { nounwind }
attributes #9 = { builtin allocsize(0) }

!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, !14, i64 32}
!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 = !{i8 0, i8 2}
!16 = !{}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = !{!20, !7, i64 12}
!20 = !{!"_ZTSN4juce18KeyPressMappingSet12KeyPressTimeE", !21, i64 0, !7, i64 12}
!21 = !{!"_ZTSN4juce8KeyPressE", !7, i64 0, !22, i64 4, !23, i64 8}
!22 = !{!"_ZTSN4juce12ModifierKeysE", !7, i64 0}
!23 = !{!"wchar_t", !8, i64 0}
!24 = !{!6, !7, i64 0}
!25 = distinct !{!25, !18}
!26 = distinct !{!26, !18}


; Effective O3 passes: AggressiveInstCombinePass,ConstraintEliminationPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass