; LLVM IR from modlfo/AudioEngine :: AudioEngine/JuceLibraryCode (juce_audio_utils)

; 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::MidiKeyboardComponent" = type { %"class.juce::Component.base", %"class.juce::MidiKeyboardStateListener", %"class.juce::ChangeBroadcaster", %"class.juce::Timer", ptr, float, i32, float, i32, i32, i32, float, [4 x i8], %"class.juce::Array.97", %"class.juce::Array.97", %"class.juce::BigInteger", %"class.juce::BigInteger", i8, i32, i32, float, i8, i8, i8, %"class.juce::ScopedPointer.164", %"class.juce::ScopedPointer.164", %"class.juce::Array.102", %"class.juce::Array.97", i32, i32 }
%"class.juce::Component.base" = type <{ %"class.juce::MouseListener", %"class.juce::String", %"class.juce::String", ptr, %"class.juce::Rectangle", %"class.juce::ScopedPointer", %"class.juce::ScopedPointer.0", %"class.juce::Array", ptr, %"class.juce::MouseCursor", ptr, %"class.juce::ScopedPointer.1", %"class.juce::ScopedPointer.2", %"class.juce::ScopedPointer.3", %"class.juce::ListenerList", %"class.juce::NamedValueSet", %"class.juce::WeakReference<juce::Component>::Master", %union.anon, i8 }>
%"class.juce::MouseListener" = type { ptr }
%"class.juce::String" = type { %"class.juce::CharPointer_UTF8" }
%"class.juce::CharPointer_UTF8" = type { ptr }
%"class.juce::Rectangle" = type { %"class.juce::Point", i32, i32 }
%"class.juce::Point" = type { i32, i32 }
%"class.juce::ScopedPointer" = type { ptr }
%"class.juce::ScopedPointer.0" = type { ptr }
%"class.juce::Array" = type { %"class.juce::ArrayAllocationBase", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase" = type <{ %"class.juce::HeapBlock", i32, [4 x i8] }>
%"class.juce::HeapBlock" = type { ptr }
%"class.juce::MouseCursor" = type { ptr }
%"class.juce::ScopedPointer.1" = type { ptr }
%"class.juce::ScopedPointer.2" = type { ptr }
%"class.juce::ScopedPointer.3" = type { ptr }
%"class.juce::ListenerList" = type { %"class.juce::Array.4" }
%"class.juce::Array.4" = type { %"class.juce::ArrayAllocationBase.5", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.5" = type <{ %"class.juce::HeapBlock.6", i32, [4 x i8] }>
%"class.juce::HeapBlock.6" = type { ptr }
%"class.juce::NamedValueSet" = type { %"class.juce::Array.9" }
%"class.juce::Array.9" = type { %"class.juce::ArrayAllocationBase.10", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.10" = type <{ %"class.juce::HeapBlock.11", i32, [4 x i8] }>
%"class.juce::HeapBlock.11" = type { ptr }
%"class.juce::WeakReference<juce::Component>::Master" = type { %"class.juce::ReferenceCountedObjectPtr" }
%"class.juce::ReferenceCountedObjectPtr" = type { ptr }
%union.anon = type { i32 }
%"class.juce::MidiKeyboardStateListener" = type { ptr }
%"class.juce::ChangeBroadcaster" = type { ptr, %"class.juce::ChangeBroadcaster::ChangeBroadcasterCallback", %"class.juce::ListenerList.20" }
%"class.juce::ChangeBroadcaster::ChangeBroadcasterCallback" = type { %"class.juce::AsyncUpdater", ptr }
%"class.juce::AsyncUpdater" = type { ptr, %"class.juce::ReferenceCountedObjectPtr.19" }
%"class.juce::ReferenceCountedObjectPtr.19" = type { ptr }
%"class.juce::ListenerList.20" = type { %"class.juce::Array.21" }
%"class.juce::Array.21" = type { %"class.juce::ArrayAllocationBase.22", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.22" = type <{ %"class.juce::HeapBlock.23", i32, [4 x i8] }>
%"class.juce::HeapBlock.23" = type { ptr }
%"class.juce::Timer" = type { ptr, i32, i32, ptr, ptr }
%"class.juce::BigInteger" = type <{ %"class.juce::HeapBlock.34", [4 x i32], i64, i32, i8, [3 x i8] }>
%"class.juce::HeapBlock.34" = type { ptr }
%"class.juce::ScopedPointer.164" = type { ptr }
%"class.juce::Array.102" = type { %"class.juce::ArrayAllocationBase.103", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.103" = type <{ %"class.juce::HeapBlock.104", i32, [4 x i8] }>
%"class.juce::HeapBlock.104" = type { ptr }
%"class.juce::Array.97" = type { %"class.juce::ArrayAllocationBase.98", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.98" = type <{ %"class.juce::HeapBlock.99", i32, [4 x i8] }>
%"class.juce::HeapBlock.99" = type { ptr }

; 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 noundef zeroext i1 @_ZNK4juce10BigIntegerixEi(ptr noundef nonnull align 8 dereferenceable(37), i32 noundef) #1

declare void @_ZN4juce17MidiKeyboardState7noteOffEiif(ptr noundef nonnull align 8 dereferenceable(344), i32 noundef, i32 noundef, float noundef) #2

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

declare void @_ZN4juce17MidiKeyboardState6noteOnEiif(ptr noundef nonnull align 8 dereferenceable(344), i32 noundef, i32 noundef, float noundef) #2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN4juce21MidiKeyboardComponent15keyStateChangedEb(ptr noundef nonnull align 8 dereferenceable(560) %0, i1 noundef zeroext %1) unnamed_addr #4 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca i8, align 1
  %5 = alloca i8, align 1
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  %8 = zext i1 %1 to i8
  store i8 %8, ptr %4, align 1, !tbaa !9
  %9 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 1, ptr %5) #5
  store i8 0, ptr %5, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  %10 = getelementptr inbounds %"class.juce::MidiKeyboardComponent", ptr %9, i32 0, i32 26
  %11 = call noundef i32 @_ZNK4juce5ArrayINS_8KeyPressENS_20DummyCriticalSectionELi0EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20) %10) #5
  store i32 %11, ptr %6, align 4, !tbaa !11
  br label %12

12:                                               ; preds = %57, %2
  %13 = load i32, ptr %6, align 4, !tbaa !11
  %14 = add nsw i32 %13, -1
  store i32 %14, ptr %6, align 4, !tbaa !11
  %15 = icmp sge i32 %14, 0
  br i1 %15, label %17, label %16

16:                                               ; preds = %12
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %58

17:                                               ; preds = %12
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  %18 = getelementptr inbounds %"class.juce::MidiKeyboardComponent", ptr %9, i32 0, i32 28
  %19 = load i32, ptr %18, align 8, !tbaa !13
  %20 = mul nsw i32 12, %19
  %21 = getelementptr inbounds %"class.juce::MidiKeyboardComponent", ptr %9, i32 0, i32 27
  %22 = load i32, ptr %6, align 4, !tbaa !11
  %23 = call noundef i32 @_ZNK4juce5ArrayIiNS_20DummyCriticalSectionELi0EE12getUncheckedEi(ptr noundef nonnull align 8 dereferenceable(20) %21, i32 noundef %22)
  %24 = add nsw i32 %20, %23
  store i32 %24, ptr %7, align 4, !tbaa !11
  %25 = getelementptr inbounds %"class.juce::MidiKeyboardComponent", ptr %9, i32 0, i32 26
  %26 = load i32, ptr %6, align 4, !tbaa !11
  %27 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNK4juce5ArrayINS_8KeyPressENS_20DummyCriticalSectionELi0EE12getReferenceEi(ptr noundef nonnull align 8 dereferenceable(20) %25, i32 noundef %26) #5
  %28 = call noundef zeroext i1 @_ZNK4juce8KeyPress15isCurrentlyDownEv(ptr noundef nonnull align 4 dereferenceable(12) %27)
  br i1 %28, label %29, label %44

29:                                               ; preds = %17
  %30 = getelementptr inbounds %"class.juce::MidiKeyboardComponent", ptr %9, i32 0, i32 15
  %31 = load i32, ptr %7, align 4, !tbaa !11
  %32 = call noundef zeroext i1 @_ZNK4juce10BigIntegerixEi(ptr noundef nonnull align 8 dereferenceable(37) %30, i32 noundef %31) #5
  br i1 %32, label %43, label %33

33:                                               ; preds = %29
  %34 = getelementptr inbounds %"class.juce::MidiKeyboardComponent", ptr %9, i32 0, i32 15
  %35 = load i32, ptr %7, align 4, !tbaa !11
  call void @_ZN4juce10BigInteger6setBitEi(ptr noundef nonnull align 8 dereferenceable(37) %34, i32 noundef %35)
  %36 = getelementptr inbounds %"class.juce::MidiKeyboardComponent", ptr %9, i32 0, i32 4
  %37 = load ptr, ptr %36, align 8, !tbaa !62
  %38 = getelementptr inbounds %"class.juce::MidiKeyboardComponent", ptr %9, i32 0, i32 9
  %39 = load i32, ptr %38, align 8, !tbaa !63
  %40 = load i32, ptr %7, align 4, !tbaa !11
  %41 = getelementptr inbounds %"class.juce::MidiKeyboardComponent", ptr %9, i32 0, i32 11
  %42 = load float, ptr %41, align 8, !tbaa !64
  call void @_ZN4juce17MidiKeyboardState6noteOnEiif(ptr noundef nonnull align 8 dereferenceable(344) %37, i32 noundef %39, i32 noundef %40, float noundef %42)
  store i8 1, ptr %5, align 1, !tbaa !9
  br label %43

43:                                               ; preds = %33, %29
  br label %57

44:                                               ; preds = %17
  %45 = getelementptr inbounds %"class.juce::MidiKeyboardComponent", ptr %9, i32 0, i32 15
  %46 = load i32, ptr %7, align 4, !tbaa !11
  %47 = call noundef zeroext i1 @_ZNK4juce10BigIntegerixEi(ptr noundef nonnull align 8 dereferenceable(37) %45, i32 noundef %46) #5
  br i1 %47, label %48, label %56

48:                                               ; preds = %44
  %49 = getelementptr inbounds %"class.juce::MidiKeyboardComponent", ptr %9, i32 0, i32 15
  %50 = load i32, ptr %7, align 4, !tbaa !11
  call void @_ZN4juce10BigInteger8clearBitEi(ptr noundef nonnull align 8 dereferenceable(37) %49, i32 noundef %50) #5
  %51 = getelementptr inbounds %"class.juce::MidiKeyboardComponent", ptr %9, i32 0, i32 4
  %52 = load ptr, ptr %51, align 8, !tbaa !62
  %53 = getelementptr inbounds %"class.juce::MidiKeyboardComponent", ptr %9, i32 0, i32 9
  %54 = load i32, ptr %53, align 8, !tbaa !63
  %55 = load i32, ptr %7, align 4, !tbaa !11
  call void @_ZN4juce17MidiKeyboardState7noteOffEiif(ptr noundef nonnull align 8 dereferenceable(344) %52, i32 noundef %54, i32 noundef %55, float noundef 0.000000e+00)
  store i8 1, ptr %5, align 1, !tbaa !9
  br label %56

56:                                               ; preds = %48, %44
  br label %57

57:                                               ; preds = %56, %43
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %12, !llvm.loop !65

58:                                               ; preds = %16
  %59 = load i8, ptr %5, align 1, !tbaa !9, !range !67, !noundef !68
  %60 = trunc i8 %59 to i1
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #5
  ret i1 %60
}

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

declare noundef zeroext i1 @_ZNK4juce8KeyPress15isCurrentlyDownEv(ptr noundef nonnull align 4 dereferenceable(12)) #2

declare void @_ZN4juce10BigInteger6setBitEi(ptr noundef nonnull align 8 dereferenceable(37), i32 noundef) #2

; Function Attrs: nounwind
declare void @_ZN4juce10BigInteger8clearBitEi(ptr noundef nonnull align 8 dereferenceable(37), i32 noundef) #1

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 = { "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 = !{!"bool", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !12, i64 552}
!14 = !{!"_ZTSN4juce21MidiKeyboardComponentE", !15, i64 0, !40, i64 200, !41, i64 208, !49, i64 264, !6, i64 296, !50, i64 304, !12, i64 308, !50, i64 312, !51, i64 316, !12, i64 320, !12, i64 324, !50, i64 328, !52, i64 336, !52, i64 360, !55, i64 384, !55, i64 424, !10, i64 464, !12, i64 468, !12, i64 472, !50, i64 476, !10, i64 480, !10, i64 481, !10, i64 482, !58, i64 488, !58, i64 496, !59, i64 504, !52, i64 528, !12, i64 552, !12, i64 556}
!15 = !{!"_ZTSN4juce9ComponentE", !16, i64 0, !17, i64 8, !17, i64 16, !6, i64 24, !19, i64 32, !21, i64 48, !22, i64 56, !23, i64 64, !6, i64 88, !26, i64 96, !6, i64 104, !27, i64 112, !28, i64 120, !29, i64 128, !30, i64 136, !34, i64 160, !38, i64 184, !7, i64 192, !7, i64 196}
!16 = !{!"_ZTSN4juce13MouseListenerE"}
!17 = !{!"_ZTSN4juce6StringE", !18, i64 0}
!18 = !{!"_ZTSN4juce16CharPointer_UTF8E", !6, i64 0}
!19 = !{!"_ZTSN4juce9RectangleIiEE", !20, i64 0, !12, i64 8, !12, i64 12}
!20 = !{!"_ZTSN4juce5PointIiEE", !12, i64 0, !12, i64 4}
!21 = !{!"_ZTSN4juce13ScopedPointerINS_9Component10PositionerEEE", !6, i64 0}
!22 = !{!"_ZTSN4juce13ScopedPointerINS_15AffineTransformEEE", !6, i64 0}
!23 = !{!"_ZTSN4juce5ArrayIPNS_9ComponentENS_20DummyCriticalSectionELi0EEE", !24, i64 0, !12, i64 16}
!24 = !{!"_ZTSN4juce19ArrayAllocationBaseIPNS_9ComponentENS_20DummyCriticalSectionEEE", !25, i64 0, !12, i64 8}
!25 = !{!"_ZTSN4juce9HeapBlockIPNS_9ComponentELb0EEE", !6, i64 0}
!26 = !{!"_ZTSN4juce11MouseCursorE", !6, i64 0}
!27 = !{!"_ZTSN4juce13ScopedPointerINS_20CachedComponentImageEEE", !6, i64 0}
!28 = !{!"_ZTSN4juce13ScopedPointerINS_9Component17MouseListenerListEEE", !6, i64 0}
!29 = !{!"_ZTSN4juce13ScopedPointerINS_5ArrayIPNS_11KeyListenerENS_20DummyCriticalSectionELi0EEEEE", !6, i64 0}
!30 = !{!"_ZTSN4juce12ListenerListINS_17ComponentListenerENS_5ArrayIPS1_NS_20DummyCriticalSectionELi0EEEEE", !31, i64 0}
!31 = !{!"_ZTSN4juce5ArrayIPNS_17ComponentListenerENS_20DummyCriticalSectionELi0EEE", !32, i64 0, !12, i64 16}
!32 = !{!"_ZTSN4juce19ArrayAllocationBaseIPNS_17ComponentListenerENS_20DummyCriticalSectionEEE", !33, i64 0, !12, i64 8}
!33 = !{!"_ZTSN4juce9HeapBlockIPNS_17ComponentListenerELb0EEE", !6, i64 0}
!34 = !{!"_ZTSN4juce13NamedValueSetE", !35, i64 0}
!35 = !{!"_ZTSN4juce5ArrayINS_13NamedValueSet10NamedValueENS_20DummyCriticalSectionELi0EEE", !36, i64 0, !12, i64 16}
!36 = !{!"_ZTSN4juce19ArrayAllocationBaseINS_13NamedValueSet10NamedValueENS_20DummyCriticalSectionEEE", !37, i64 0, !12, i64 8}
!37 = !{!"_ZTSN4juce9HeapBlockINS_13NamedValueSet10NamedValueELb0EEE", !6, i64 0}
!38 = !{!"_ZTSN4juce13WeakReferenceINS_9ComponentENS_22ReferenceCountedObjectEE6MasterE", !39, i64 0}
!39 = !{!"_ZTSN4juce25ReferenceCountedObjectPtrINS_13WeakReferenceINS_9ComponentENS_22ReferenceCountedObjectEE13SharedPointerEEE", !6, i64 0}
!40 = !{!"_ZTSN4juce25MidiKeyboardStateListenerE"}
!41 = !{!"_ZTSN4juce17ChangeBroadcasterE", !42, i64 8, !45, i64 32}
!42 = !{!"_ZTSN4juce17ChangeBroadcaster25ChangeBroadcasterCallbackE", !43, i64 0, !6, i64 16}
!43 = !{!"_ZTSN4juce12AsyncUpdaterE", !44, i64 8}
!44 = !{!"_ZTSN4juce25ReferenceCountedObjectPtrINS_12AsyncUpdater19AsyncUpdaterMessageEEE", !6, i64 0}
!45 = !{!"_ZTSN4juce12ListenerListINS_14ChangeListenerENS_5ArrayIPS1_NS_20DummyCriticalSectionELi0EEEEE", !46, i64 0}
!46 = !{!"_ZTSN4juce5ArrayIPNS_14ChangeListenerENS_20DummyCriticalSectionELi0EEE", !47, i64 0, !12, i64 16}
!47 = !{!"_ZTSN4juce19ArrayAllocationBaseIPNS_14ChangeListenerENS_20DummyCriticalSectionEEE", !48, i64 0, !12, i64 8}
!48 = !{!"_ZTSN4juce9HeapBlockIPNS_14ChangeListenerELb0EEE", !6, i64 0}
!49 = !{!"_ZTSN4juce5TimerE", !12, i64 8, !12, i64 12, !6, i64 16, !6, i64 24}
!50 = !{!"float", !7, i64 0}
!51 = !{!"_ZTSN4juce21MidiKeyboardComponent11OrientationE", !7, i64 0}
!52 = !{!"_ZTSN4juce5ArrayIiNS_20DummyCriticalSectionELi0EEE", !53, i64 0, !12, i64 16}
!53 = !{!"_ZTSN4juce19ArrayAllocationBaseIiNS_20DummyCriticalSectionEEE", !54, i64 0, !12, i64 8}
!54 = !{!"_ZTSN4juce9HeapBlockIiLb0EEE", !6, i64 0}
!55 = !{!"_ZTSN4juce10BigIntegerE", !56, i64 0, !7, i64 8, !57, i64 24, !12, i64 32, !10, i64 36}
!56 = !{!"_ZTSN4juce9HeapBlockIjLb0EEE", !6, i64 0}
!57 = !{!"long", !7, i64 0}
!58 = !{!"_ZTSN4juce13ScopedPointerINS_6ButtonEEE", !6, i64 0}
!59 = !{!"_ZTSN4juce5ArrayINS_8KeyPressENS_20DummyCriticalSectionELi0EEE", !60, i64 0, !12, i64 16}
!60 = !{!"_ZTSN4juce19ArrayAllocationBaseINS_8KeyPressENS_20DummyCriticalSectionEEE", !61, i64 0, !12, i64 8}
!61 = !{!"_ZTSN4juce9HeapBlockINS_8KeyPressELb0EEE", !6, i64 0}
!62 = !{!14, !6, i64 296}
!63 = !{!14, !12, i64 320}
!64 = !{!14, !50, i64 328}
!65 = distinct !{!65, !66}
!66 = !{!"llvm.loop.mustprogress"}
!67 = !{i8 0, i8 2}
!68 = !{}


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

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

declare void @_ZN4juce17MidiKeyboardState7noteOffEiif(ptr noundef nonnull align 8 dereferenceable(344), i32 noundef, i32 noundef, float noundef) local_unnamed_addr #1

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

declare void @_ZN4juce17MidiKeyboardState6noteOnEiif(ptr noundef nonnull align 8 dereferenceable(344), i32 noundef, i32 noundef, float noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN4juce21MidiKeyboardComponent15keyStateChangedEb(ptr noundef nonnull align 8 dereferenceable(560) %0, i1 noundef zeroext %1) unnamed_addr #3 align 2 {
  %3 = getelementptr inbounds i8, ptr %0, i64 504
  %4 = tail call noundef i32 @_ZNK4juce5ArrayINS_8KeyPressENS_20DummyCriticalSectionELi0EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20) %3) #4
  %5 = icmp sgt i32 %4, 0
  br i1 %5, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %2
  %6 = getelementptr inbounds i8, ptr %0, i64 552
  %7 = getelementptr inbounds i8, ptr %0, i64 528
  %8 = getelementptr inbounds i8, ptr %0, i64 384
  %9 = getelementptr inbounds i8, ptr %0, i64 296
  %10 = getelementptr inbounds i8, ptr %0, i64 320
  %11 = getelementptr inbounds i8, ptr %0, i64 328
  br label %12

._crit_edge:                                      ; preds = %30, %2
  %.0.lcssa = phi i1 [ false, %2 ], [ %.1, %30 ]
  ret i1 %.0.lcssa

12:                                               ; preds = %.lr.ph, %30
  %.in = phi i32 [ %4, %.lr.ph ], [ %13, %30 ]
  %.012 = phi i1 [ false, %.lr.ph ], [ %.1, %30 ]
  %13 = add nsw i32 %.in, -1
  %14 = load i32, ptr %6, align 8, !tbaa !5
  %15 = mul nsw i32 %14, 12
  %16 = tail call noundef i32 @_ZNK4juce5ArrayIiNS_20DummyCriticalSectionELi0EE12getUncheckedEi(ptr noundef nonnull align 8 dereferenceable(20) %7, i32 noundef %13)
  %17 = add nsw i32 %15, %16
  %18 = tail call noundef nonnull align 4 dereferenceable(12) ptr @_ZNK4juce5ArrayINS_8KeyPressENS_20DummyCriticalSectionELi0EE12getReferenceEi(ptr noundef nonnull align 8 dereferenceable(20) %3, i32 noundef %13) #4
  %19 = tail call noundef zeroext i1 @_ZNK4juce8KeyPress15isCurrentlyDownEv(ptr noundef nonnull align 4 dereferenceable(12) %18)
  %20 = tail call noundef zeroext i1 @_ZNK4juce10BigIntegerixEi(ptr noundef nonnull align 8 dereferenceable(37) %8, i32 noundef %17) #4
  br i1 %19, label %21, label %26

21:                                               ; preds = %12
  br i1 %20, label %30, label %22

22:                                               ; preds = %21
  tail call void @_ZN4juce10BigInteger6setBitEi(ptr noundef nonnull align 8 dereferenceable(37) %8, i32 noundef %17)
  %23 = load ptr, ptr %9, align 8, !tbaa !59
  %24 = load i32, ptr %10, align 8, !tbaa !60
  %25 = load float, ptr %11, align 8, !tbaa !61
  tail call void @_ZN4juce17MidiKeyboardState6noteOnEiif(ptr noundef nonnull align 8 dereferenceable(344) %23, i32 noundef %24, i32 noundef %17, float noundef %25)
  br label %30

26:                                               ; preds = %12
  br i1 %20, label %27, label %30

27:                                               ; preds = %26
  tail call void @_ZN4juce10BigInteger8clearBitEi(ptr noundef nonnull align 8 dereferenceable(37) %8, i32 noundef %17) #4
  %28 = load ptr, ptr %9, align 8, !tbaa !59
  %29 = load i32, ptr %10, align 8, !tbaa !60
  tail call void @_ZN4juce17MidiKeyboardState7noteOffEiif(ptr noundef nonnull align 8 dereferenceable(344) %28, i32 noundef %29, i32 noundef %17, float noundef 0.000000e+00)
  br label %30

30:                                               ; preds = %26, %27, %21, %22
  %.1 = phi i1 [ %.012, %21 ], [ true, %22 ], [ true, %27 ], [ %.012, %26 ]
  %31 = icmp ugt i32 %.in, 1
  br i1 %31, label %12, label %._crit_edge, !llvm.loop !62
}

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

declare noundef zeroext i1 @_ZNK4juce8KeyPress15isCurrentlyDownEv(ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #1

declare void @_ZN4juce10BigInteger6setBitEi(ptr noundef nonnull align 8 dereferenceable(37), i32 noundef) local_unnamed_addr #1

; Function Attrs: nounwind
declare void @_ZN4juce10BigInteger8clearBitEi(ptr noundef nonnull align 8 dereferenceable(37), i32 noundef) local_unnamed_addr #0

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 = { "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 = { 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 #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 = { 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, !16, i64 552}
!6 = !{!"_ZTSN4juce21MidiKeyboardComponentE", !7, i64 0, !36, i64 200, !37, i64 208, !45, i64 264, !11, i64 296, !46, i64 304, !16, i64 308, !46, i64 312, !47, i64 316, !16, i64 320, !16, i64 324, !46, i64 328, !48, i64 336, !48, i64 360, !51, i64 384, !51, i64 424, !54, i64 464, !16, i64 468, !16, i64 472, !46, i64 476, !54, i64 480, !54, i64 481, !54, i64 482, !55, i64 488, !55, i64 496, !56, i64 504, !48, i64 528, !16, i64 552, !16, i64 556}
!7 = !{!"_ZTSN4juce9ComponentE", !8, i64 0, !9, i64 8, !9, i64 16, !11, i64 24, !14, i64 32, !17, i64 48, !18, i64 56, !19, i64 64, !11, i64 88, !22, i64 96, !11, i64 104, !23, i64 112, !24, i64 120, !25, i64 128, !26, i64 136, !30, i64 160, !34, i64 184, !12, i64 192, !12, i64 196}
!8 = !{!"_ZTSN4juce13MouseListenerE"}
!9 = !{!"_ZTSN4juce6StringE", !10, i64 0}
!10 = !{!"_ZTSN4juce16CharPointer_UTF8E", !11, i64 0}
!11 = !{!"any pointer", !12, i64 0}
!12 = !{!"omnipotent char", !13, i64 0}
!13 = !{!"Simple C++ TBAA"}
!14 = !{!"_ZTSN4juce9RectangleIiEE", !15, i64 0, !16, i64 8, !16, i64 12}
!15 = !{!"_ZTSN4juce5PointIiEE", !16, i64 0, !16, i64 4}
!16 = !{!"int", !12, i64 0}
!17 = !{!"_ZTSN4juce13ScopedPointerINS_9Component10PositionerEEE", !11, i64 0}
!18 = !{!"_ZTSN4juce13ScopedPointerINS_15AffineTransformEEE", !11, i64 0}
!19 = !{!"_ZTSN4juce5ArrayIPNS_9ComponentENS_20DummyCriticalSectionELi0EEE", !20, i64 0, !16, i64 16}
!20 = !{!"_ZTSN4juce19ArrayAllocationBaseIPNS_9ComponentENS_20DummyCriticalSectionEEE", !21, i64 0, !16, i64 8}
!21 = !{!"_ZTSN4juce9HeapBlockIPNS_9ComponentELb0EEE", !11, i64 0}
!22 = !{!"_ZTSN4juce11MouseCursorE", !11, i64 0}
!23 = !{!"_ZTSN4juce13ScopedPointerINS_20CachedComponentImageEEE", !11, i64 0}
!24 = !{!"_ZTSN4juce13ScopedPointerINS_9Component17MouseListenerListEEE", !11, i64 0}
!25 = !{!"_ZTSN4juce13ScopedPointerINS_5ArrayIPNS_11KeyListenerENS_20DummyCriticalSectionELi0EEEEE", !11, i64 0}
!26 = !{!"_ZTSN4juce12ListenerListINS_17ComponentListenerENS_5ArrayIPS1_NS_20DummyCriticalSectionELi0EEEEE", !27, i64 0}
!27 = !{!"_ZTSN4juce5ArrayIPNS_17ComponentListenerENS_20DummyCriticalSectionELi0EEE", !28, i64 0, !16, i64 16}
!28 = !{!"_ZTSN4juce19ArrayAllocationBaseIPNS_17ComponentListenerENS_20DummyCriticalSectionEEE", !29, i64 0, !16, i64 8}
!29 = !{!"_ZTSN4juce9HeapBlockIPNS_17ComponentListenerELb0EEE", !11, i64 0}
!30 = !{!"_ZTSN4juce13NamedValueSetE", !31, i64 0}
!31 = !{!"_ZTSN4juce5ArrayINS_13NamedValueSet10NamedValueENS_20DummyCriticalSectionELi0EEE", !32, i64 0, !16, i64 16}
!32 = !{!"_ZTSN4juce19ArrayAllocationBaseINS_13NamedValueSet10NamedValueENS_20DummyCriticalSectionEEE", !33, i64 0, !16, i64 8}
!33 = !{!"_ZTSN4juce9HeapBlockINS_13NamedValueSet10NamedValueELb0EEE", !11, i64 0}
!34 = !{!"_ZTSN4juce13WeakReferenceINS_9ComponentENS_22ReferenceCountedObjectEE6MasterE", !35, i64 0}
!35 = !{!"_ZTSN4juce25ReferenceCountedObjectPtrINS_13WeakReferenceINS_9ComponentENS_22ReferenceCountedObjectEE13SharedPointerEEE", !11, i64 0}
!36 = !{!"_ZTSN4juce25MidiKeyboardStateListenerE"}
!37 = !{!"_ZTSN4juce17ChangeBroadcasterE", !38, i64 8, !41, i64 32}
!38 = !{!"_ZTSN4juce17ChangeBroadcaster25ChangeBroadcasterCallbackE", !39, i64 0, !11, i64 16}
!39 = !{!"_ZTSN4juce12AsyncUpdaterE", !40, i64 8}
!40 = !{!"_ZTSN4juce25ReferenceCountedObjectPtrINS_12AsyncUpdater19AsyncUpdaterMessageEEE", !11, i64 0}
!41 = !{!"_ZTSN4juce12ListenerListINS_14ChangeListenerENS_5ArrayIPS1_NS_20DummyCriticalSectionELi0EEEEE", !42, i64 0}
!42 = !{!"_ZTSN4juce5ArrayIPNS_14ChangeListenerENS_20DummyCriticalSectionELi0EEE", !43, i64 0, !16, i64 16}
!43 = !{!"_ZTSN4juce19ArrayAllocationBaseIPNS_14ChangeListenerENS_20DummyCriticalSectionEEE", !44, i64 0, !16, i64 8}
!44 = !{!"_ZTSN4juce9HeapBlockIPNS_14ChangeListenerELb0EEE", !11, i64 0}
!45 = !{!"_ZTSN4juce5TimerE", !16, i64 8, !16, i64 12, !11, i64 16, !11, i64 24}
!46 = !{!"float", !12, i64 0}
!47 = !{!"_ZTSN4juce21MidiKeyboardComponent11OrientationE", !12, i64 0}
!48 = !{!"_ZTSN4juce5ArrayIiNS_20DummyCriticalSectionELi0EEE", !49, i64 0, !16, i64 16}
!49 = !{!"_ZTSN4juce19ArrayAllocationBaseIiNS_20DummyCriticalSectionEEE", !50, i64 0, !16, i64 8}
!50 = !{!"_ZTSN4juce9HeapBlockIiLb0EEE", !11, i64 0}
!51 = !{!"_ZTSN4juce10BigIntegerE", !52, i64 0, !12, i64 8, !53, i64 24, !16, i64 32, !54, i64 36}
!52 = !{!"_ZTSN4juce9HeapBlockIjLb0EEE", !11, i64 0}
!53 = !{!"long", !12, i64 0}
!54 = !{!"bool", !12, i64 0}
!55 = !{!"_ZTSN4juce13ScopedPointerINS_6ButtonEEE", !11, i64 0}
!56 = !{!"_ZTSN4juce5ArrayINS_8KeyPressENS_20DummyCriticalSectionELi0EEE", !57, i64 0, !16, i64 16}
!57 = !{!"_ZTSN4juce19ArrayAllocationBaseINS_8KeyPressENS_20DummyCriticalSectionEEE", !58, i64 0, !16, i64 8}
!58 = !{!"_ZTSN4juce9HeapBlockINS_8KeyPressELb0EEE", !11, i64 0}
!59 = !{!6, !11, i64 296}
!60 = !{!6, !16, i64 320}
!61 = !{!6, !46, i64 328}
!62 = distinct !{!62, !63}
!63 = !{!"llvm.loop.mustprogress"}


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