; LLVM IR from modlfo/AudioEngine :: AudioEngine/JuceLibraryCode/juce_audio_basics.ll (ZN4juce11Synthesiser6noteOnEiif)

; 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::GenericScopedLock" = type { ptr }
%"class.juce::ReferenceCountedObjectPtr" = type { ptr }
%"class.juce::Synthesiser" = type { ptr, %"class.juce::CriticalSection", %"class.juce::OwnedArray", %"class.juce::ReferenceCountedArray", [16 x i32], double, i32, i32, i8, i8, [6 x i8], %"class.juce::BigInteger" }
%"class.juce::CriticalSection" = type { %union.pthread_mutex_t }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%"class.juce::OwnedArray" = type { %"class.juce::ArrayAllocationBase.3", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.3" = type <{ %"class.juce::HeapBlock.4", i32, [4 x i8] }>
%"class.juce::HeapBlock.4" = type { ptr }
%"class.juce::ReferenceCountedArray" = type { %"class.juce::ArrayAllocationBase.6", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.6" = type <{ %"class.juce::HeapBlock.7", i32, [4 x i8] }>
%"class.juce::HeapBlock.7" = type { ptr }
%"class.juce::BigInteger" = type <{ %"class.juce::HeapBlock.9", [4 x i32], i64, i32, i8, [3 x i8] }>
%"class.juce::HeapBlock.9" = 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: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN4juce17GenericScopedLockINS_15CriticalSectionEEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #1 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4juce11Synthesiser6noteOnEiif(ptr noundef nonnull align 8 dereferenceable(224) %0, i32 noundef %1, i32 noundef %2, float noundef %3) unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca float, align 4
  %9 = alloca %"class.juce::GenericScopedLock", align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca %"class.juce::ReferenceCountedObjectPtr", align 8
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca ptr, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i32 %1, ptr %6, align 4, !tbaa !9
  store i32 %2, ptr %7, align 4, !tbaa !9
  store float %3, ptr %8, align 4, !tbaa !11
  %18 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %19 = getelementptr inbounds %"class.juce::Synthesiser", ptr %18, i32 0, i32 1
  call void @_ZN4juce17GenericScopedLockINS_15CriticalSectionEEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(40) %19) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  %20 = getelementptr inbounds %"class.juce::Synthesiser", ptr %18, i32 0, i32 3
  %21 = call noundef i32 @_ZNK4juce21ReferenceCountedArrayINS_16SynthesiserSoundENS_20DummyCriticalSectionEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20) %20) #4
  store i32 %21, ptr %10, align 4, !tbaa !9
  br label %22

22:                                               ; preds = %99, %4
  %23 = load i32, ptr %10, align 4, !tbaa !9
  %24 = add nsw i32 %23, -1
  store i32 %24, ptr %10, align 4, !tbaa !9
  %25 = icmp sge i32 %24, 0
  br i1 %25, label %27, label %26

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

27:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  %28 = getelementptr inbounds %"class.juce::Synthesiser", ptr %18, i32 0, i32 3
  %29 = load i32, ptr %10, align 4, !tbaa !9
  call void @_ZNK4juce21ReferenceCountedArrayINS_16SynthesiserSoundENS_20DummyCriticalSectionEE12getUncheckedEi(ptr dead_on_unwind writable sret(%"class.juce::ReferenceCountedObjectPtr") align 8 %13, ptr noundef nonnull align 8 dereferenceable(20) %28, i32 noundef %29) #4
  %30 = call noundef ptr @_ZNK4juce25ReferenceCountedObjectPtrINS_16SynthesiserSoundEEcvPS1_Ev(ptr noundef nonnull align 8 dereferenceable(8) %13) #4
  call void @_ZN4juce25ReferenceCountedObjectPtrINS_16SynthesiserSoundEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  store ptr %30, ptr %12, align 8, !tbaa !5
  %31 = load ptr, ptr %12, align 8, !tbaa !5
  %32 = load i32, ptr %7, align 4, !tbaa !9
  %33 = load ptr, ptr %31, align 8, !tbaa !13
  %34 = getelementptr inbounds ptr, ptr %33, i64 2
  %35 = load ptr, ptr %34, align 8
  %36 = invoke noundef zeroext i1 %35(ptr noundef nonnull align 8 dereferenceable(16) %31, i32 noundef %32)
          to label %37 unwind label %54

37:                                               ; preds = %27
  br i1 %36, label %38, label %99

38:                                               ; preds = %37
  %39 = load ptr, ptr %12, align 8, !tbaa !5
  %40 = load i32, ptr %6, align 4, !tbaa !9
  %41 = load ptr, ptr %39, align 8, !tbaa !13
  %42 = getelementptr inbounds ptr, ptr %41, i64 3
  %43 = load ptr, ptr %42, align 8
  %44 = invoke noundef zeroext i1 %43(ptr noundef nonnull align 8 dereferenceable(16) %39, i32 noundef %40)
          to label %45 unwind label %54

45:                                               ; preds = %38
  br i1 %44, label %46, label %99

46:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  %47 = getelementptr inbounds %"class.juce::Synthesiser", ptr %18, i32 0, i32 2
  %48 = call noundef i32 @_ZNK4juce10OwnedArrayINS_16SynthesiserVoiceENS_20DummyCriticalSectionEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20) %47) #4
  store i32 %48, ptr %16, align 4, !tbaa !9
  br label %49

49:                                               ; preds = %81, %46
  %50 = load i32, ptr %16, align 4, !tbaa !9
  %51 = add nsw i32 %50, -1
  store i32 %51, ptr %16, align 4, !tbaa !9
  %52 = icmp sge i32 %51, 0
  br i1 %52, label %58, label %53

53:                                               ; preds = %49
  store i32 4, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  br label %82

54:                                               ; preds = %93, %82, %38, %27
  %55 = landingpad { ptr, i32 }
          cleanup
  %56 = extractvalue { ptr, i32 } %55, 0
  store ptr %56, ptr %14, align 8
  %57 = extractvalue { ptr, i32 } %55, 1
  store i32 %57, ptr %15, align 4
  br label %100

58:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  %59 = getelementptr inbounds %"class.juce::Synthesiser", ptr %18, i32 0, i32 2
  %60 = load i32, ptr %16, align 4, !tbaa !9
  %61 = call noundef ptr @_ZNK4juce10OwnedArrayINS_16SynthesiserVoiceENS_20DummyCriticalSectionEE12getUncheckedEi(ptr noundef nonnull align 8 dereferenceable(20) %59, i32 noundef %60) #4
  store ptr %61, ptr %17, align 8, !tbaa !5
  %62 = load ptr, ptr %17, align 8, !tbaa !5
  %63 = call noundef i32 @_ZNK4juce16SynthesiserVoice23getCurrentlyPlayingNoteEv(ptr noundef nonnull align 8 dereferenceable(344) %62) #4
  %64 = load i32, ptr %7, align 4, !tbaa !9
  %65 = icmp eq i32 %63, %64
  br i1 %65, label %66, label %81

66:                                               ; preds = %58
  %67 = load ptr, ptr %17, align 8, !tbaa !5
  %68 = load i32, ptr %6, align 4, !tbaa !9
  %69 = load ptr, ptr %67, align 8, !tbaa !13
  %70 = getelementptr inbounds ptr, ptr %69, i64 13
  %71 = load ptr, ptr %70, align 8
  %72 = invoke noundef zeroext i1 %71(ptr noundef nonnull align 8 dereferenceable(344) %67, i32 noundef %68)
          to label %73 unwind label %77

73:                                               ; preds = %66
  br i1 %72, label %74, label %81

74:                                               ; preds = %73
  %75 = load ptr, ptr %17, align 8, !tbaa !5
  invoke void @_ZN4juce11Synthesiser9stopVoiceEPNS_16SynthesiserVoiceEfb(ptr noundef nonnull align 8 dereferenceable(224) %18, ptr noundef %75, float noundef 1.000000e+00, i1 noundef zeroext true)
          to label %76 unwind label %77

76:                                               ; preds = %74
  br label %81

77:                                               ; preds = %74, %66
  %78 = landingpad { ptr, i32 }
          cleanup
  %79 = extractvalue { ptr, i32 } %78, 0
  store ptr %79, ptr %14, align 8
  %80 = extractvalue { ptr, i32 } %78, 1
  store i32 %80, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  br label %100

81:                                               ; preds = %76, %73, %58
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  br label %49, !llvm.loop !15

82:                                               ; preds = %53
  %83 = load ptr, ptr %12, align 8, !tbaa !5
  %84 = load i32, ptr %6, align 4, !tbaa !9
  %85 = load i32, ptr %7, align 4, !tbaa !9
  %86 = getelementptr inbounds %"class.juce::Synthesiser", ptr %18, i32 0, i32 9
  %87 = load i8, ptr %86, align 1, !tbaa !17, !range !31, !noundef !32
  %88 = trunc i8 %87 to i1
  %89 = load ptr, ptr %18, align 8, !tbaa !13
  %90 = getelementptr inbounds ptr, ptr %89, i64 16
  %91 = load ptr, ptr %90, align 8
  %92 = invoke noundef ptr %91(ptr noundef nonnull align 8 dereferenceable(224) %18, ptr noundef %83, i32 noundef %84, i32 noundef %85, i1 noundef zeroext %88)
          to label %93 unwind label %54

93:                                               ; preds = %82
  %94 = load ptr, ptr %12, align 8, !tbaa !5
  %95 = load i32, ptr %6, align 4, !tbaa !9
  %96 = load i32, ptr %7, align 4, !tbaa !9
  %97 = load float, ptr %8, align 4, !tbaa !11
  invoke void @_ZN4juce11Synthesiser10startVoiceEPNS_16SynthesiserVoiceEPNS_16SynthesiserSoundEiif(ptr noundef nonnull align 8 dereferenceable(224) %18, ptr noundef %92, ptr noundef %94, i32 noundef %95, i32 noundef %96, float noundef %97)
          to label %98 unwind label %54

98:                                               ; preds = %93
  br label %99

99:                                               ; preds = %98, %45, %37
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  br label %22, !llvm.loop !33

100:                                              ; preds = %77, %54
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  call void @_ZN4juce17GenericScopedLockINS_15CriticalSectionEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  br label %102

101:                                              ; preds = %26
  call void @_ZN4juce17GenericScopedLockINS_15CriticalSectionEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  ret void

102:                                              ; preds = %100
  %103 = load ptr, ptr %14, align 8
  %104 = load i32, ptr %15, align 4
  %105 = insertvalue { ptr, i32 } poison, ptr %103, 0
  %106 = insertvalue { ptr, i32 } %105, i32 %104, 1
  resume { ptr, i32 } %106
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNK4juce21ReferenceCountedArrayINS_16SynthesiserSoundENS_20DummyCriticalSectionEE12getUncheckedEi(ptr dead_on_unwind noalias writable sret(%"class.juce::ReferenceCountedObjectPtr") align 8, ptr noundef nonnull align 8 dereferenceable(20), i32 noundef) #1 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4juce11Synthesiser10startVoiceEPNS_16SynthesiserVoiceEPNS_16SynthesiserSoundEiif(ptr noundef nonnull align 8 dereferenceable(224), ptr noundef, ptr noundef, i32 noundef, i32 noundef, float noundef) #3 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"vtable pointer", !8, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = !{!18, !27, i64 177}
!18 = !{!"_ZTSN4juce11SynthesiserE", !19, i64 8, !20, i64 48, !23, i64 72, !7, i64 96, !26, i64 160, !10, i64 168, !10, i64 172, !27, i64 176, !27, i64 177, !28, i64 184}
!19 = !{!"_ZTSN4juce15CriticalSectionE", !7, i64 0}
!20 = !{!"_ZTSN4juce10OwnedArrayINS_16SynthesiserVoiceENS_20DummyCriticalSectionEEE", !21, i64 0, !10, i64 16}
!21 = !{!"_ZTSN4juce19ArrayAllocationBaseIPNS_16SynthesiserVoiceENS_20DummyCriticalSectionEEE", !22, i64 0, !10, i64 8}
!22 = !{!"_ZTSN4juce9HeapBlockIPNS_16SynthesiserVoiceELb0EEE", !6, i64 0}
!23 = !{!"_ZTSN4juce21ReferenceCountedArrayINS_16SynthesiserSoundENS_20DummyCriticalSectionEEE", !24, i64 0, !10, i64 16}
!24 = !{!"_ZTSN4juce19ArrayAllocationBaseIPNS_16SynthesiserSoundENS_20DummyCriticalSectionEEE", !25, i64 0, !10, i64 8}
!25 = !{!"_ZTSN4juce9HeapBlockIPNS_16SynthesiserSoundELb0EEE", !6, i64 0}
!26 = !{!"double", !7, i64 0}
!27 = !{!"bool", !7, i64 0}
!28 = !{!"_ZTSN4juce10BigIntegerE", !29, i64 0, !7, i64 8, !30, i64 24, !10, i64 32, !27, i64 36}
!29 = !{!"_ZTSN4juce9HeapBlockIjLb0EEE", !6, i64 0}
!30 = !{!"long", !7, i64 0}
!31 = !{i8 0, i8 2}
!32 = !{}
!33 = distinct !{!33, !16}


; 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::GenericScopedLock" = type { ptr }
%"class.juce::ReferenceCountedObjectPtr" = type { ptr }

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN4juce17GenericScopedLockINS_15CriticalSectionEEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #1 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4juce11Synthesiser6noteOnEiif(ptr noundef nonnull align 8 dereferenceable(224) %0, i32 noundef %1, i32 noundef %2, float noundef %3) unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca %"class.juce::GenericScopedLock", align 8
  %6 = alloca %"class.juce::ReferenceCountedObjectPtr", align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #4
  %7 = getelementptr inbounds i8, ptr %0, i64 8
  call void @_ZN4juce17GenericScopedLockINS_15CriticalSectionEEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(40) %7) #4
  %8 = getelementptr inbounds i8, ptr %0, i64 72
  %9 = call noundef i32 @_ZNK4juce21ReferenceCountedArrayINS_16SynthesiserSoundENS_20DummyCriticalSectionEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20) %8) #4
  %10 = icmp sgt i32 %9, 0
  br i1 %10, label %.lr.ph29, label %._crit_edge30

.lr.ph29:                                         ; preds = %4
  %11 = getelementptr inbounds i8, ptr %0, i64 48
  %12 = getelementptr inbounds i8, ptr %0, i64 177
  br label %13

._crit_edge30:                                    ; preds = %54, %4
  call void @_ZN4juce17GenericScopedLockINS_15CriticalSectionEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #4
  ret void

13:                                               ; preds = %.lr.ph29, %54
  %.in = phi i32 [ %9, %.lr.ph29 ], [ %14, %54 ]
  %14 = add nsw i32 %.in, -1
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #4
  call void @_ZNK4juce21ReferenceCountedArrayINS_16SynthesiserSoundENS_20DummyCriticalSectionEE12getUncheckedEi(ptr dead_on_unwind nonnull writable sret(%"class.juce::ReferenceCountedObjectPtr") align 8 %6, ptr noundef nonnull align 8 dereferenceable(20) %8, i32 noundef %14) #4
  %15 = call noundef ptr @_ZNK4juce25ReferenceCountedObjectPtrINS_16SynthesiserSoundEEcvPS1_Ev(ptr noundef nonnull align 8 dereferenceable(8) %6) #4
  call void @_ZN4juce25ReferenceCountedObjectPtrINS_16SynthesiserSoundEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  %16 = load ptr, ptr %15, align 8, !tbaa !5
  %17 = getelementptr inbounds i8, ptr %16, i64 16
  %18 = load ptr, ptr %17, align 8
  %19 = invoke noundef zeroext i1 %18(ptr noundef nonnull align 8 dereferenceable(16) %15, i32 noundef %2)
          to label %20 unwind label %36

20:                                               ; preds = %13
  br i1 %19, label %21, label %54

21:                                               ; preds = %20
  %22 = load ptr, ptr %15, align 8, !tbaa !5
  %23 = getelementptr inbounds i8, ptr %22, i64 24
  %24 = load ptr, ptr %23, align 8
  %25 = invoke noundef zeroext i1 %24(ptr noundef nonnull align 8 dereferenceable(16) %15, i32 noundef %1)
          to label %26 unwind label %36

26:                                               ; preds = %21
  br i1 %25, label %27, label %54

27:                                               ; preds = %26
  %28 = call noundef i32 @_ZNK4juce10OwnedArrayINS_16SynthesiserVoiceENS_20DummyCriticalSectionEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20) %11) #4
  %29 = icmp sgt i32 %28, 0
  br i1 %29, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %51, %27
  %30 = load i8, ptr %12, align 1, !tbaa !8, !range !25, !noundef !26
  %31 = trunc nuw i8 %30 to i1
  %32 = load ptr, ptr %0, align 8, !tbaa !5
  %33 = getelementptr inbounds i8, ptr %32, i64 128
  %34 = load ptr, ptr %33, align 8
  %35 = invoke noundef ptr %34(ptr noundef nonnull align 8 dereferenceable(224) %0, ptr noundef nonnull %15, i32 noundef %1, i32 noundef %2, i1 noundef zeroext %31)
          to label %53 unwind label %36

36:                                               ; preds = %53, %._crit_edge, %21, %13
  %37 = landingpad { ptr, i32 }
          cleanup
  br label %56

.lr.ph:                                           ; preds = %27, %51
  %.in31 = phi i32 [ %38, %51 ], [ %28, %27 ]
  %38 = add nsw i32 %.in31, -1
  %39 = call noundef ptr @_ZNK4juce10OwnedArrayINS_16SynthesiserVoiceENS_20DummyCriticalSectionEE12getUncheckedEi(ptr noundef nonnull align 8 dereferenceable(20) %11, i32 noundef %38) #4
  %40 = call noundef i32 @_ZNK4juce16SynthesiserVoice23getCurrentlyPlayingNoteEv(ptr noundef nonnull align 8 dereferenceable(344) %39) #4
  %41 = icmp eq i32 %40, %2
  br i1 %41, label %42, label %51

42:                                               ; preds = %.lr.ph
  %43 = load ptr, ptr %39, align 8, !tbaa !5
  %44 = getelementptr inbounds i8, ptr %43, i64 104
  %45 = load ptr, ptr %44, align 8
  %46 = invoke noundef zeroext i1 %45(ptr noundef nonnull align 8 dereferenceable(344) %39, i32 noundef %1)
          to label %47 unwind label %49

47:                                               ; preds = %42
  br i1 %46, label %48, label %51

48:                                               ; preds = %47
  invoke void @_ZN4juce11Synthesiser9stopVoiceEPNS_16SynthesiserVoiceEfb(ptr noundef nonnull align 8 dereferenceable(224) %0, ptr noundef nonnull %39, float noundef 1.000000e+00, i1 noundef zeroext true)
          to label %51 unwind label %49

49:                                               ; preds = %48, %42
  %50 = landingpad { ptr, i32 }
          cleanup
  br label %56

51:                                               ; preds = %48, %47, %.lr.ph
  %52 = icmp ugt i32 %.in31, 1
  br i1 %52, label %.lr.ph, label %._crit_edge, !llvm.loop !27

53:                                               ; preds = %._crit_edge
  invoke void @_ZN4juce11Synthesiser10startVoiceEPNS_16SynthesiserVoiceEPNS_16SynthesiserSoundEiif(ptr noundef nonnull align 8 dereferenceable(224) %0, ptr noundef %35, ptr noundef nonnull %15, i32 noundef %1, i32 noundef %2, float noundef %3)
          to label %54 unwind label %36

54:                                               ; preds = %53, %26, %20
  %55 = icmp sgt i32 %.in, 1
  br i1 %55, label %13, label %._crit_edge30, !llvm.loop !29

56:                                               ; preds = %49, %36
  %.pn = phi { ptr, i32 } [ %50, %49 ], [ %37, %36 ]
  call void @_ZN4juce17GenericScopedLockINS_15CriticalSectionEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #4
  resume { ptr, i32 } %.pn
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNK4juce21ReferenceCountedArrayINS_16SynthesiserSoundENS_20DummyCriticalSectionEE12getUncheckedEi(ptr dead_on_unwind noalias writable sret(%"class.juce::ReferenceCountedObjectPtr") align 8, ptr noundef nonnull align 8 dereferenceable(20), i32 noundef) local_unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4juce11Synthesiser10startVoiceEPNS_16SynthesiserVoiceEPNS_16SynthesiserSoundEiif(ptr noundef nonnull align 8 dereferenceable(224), ptr noundef, ptr noundef, i32 noundef, i32 noundef, float noundef) local_unnamed_addr #3 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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, !6, i64 0}
!6 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !21, i64 177}
!9 = !{!"_ZTSN4juce11SynthesiserE", !10, i64 8, !12, i64 48, !17, i64 72, !11, i64 96, !20, i64 160, !16, i64 168, !16, i64 172, !21, i64 176, !21, i64 177, !22, i64 184}
!10 = !{!"_ZTSN4juce15CriticalSectionE", !11, i64 0}
!11 = !{!"omnipotent char", !7, i64 0}
!12 = !{!"_ZTSN4juce10OwnedArrayINS_16SynthesiserVoiceENS_20DummyCriticalSectionEEE", !13, i64 0, !16, i64 16}
!13 = !{!"_ZTSN4juce19ArrayAllocationBaseIPNS_16SynthesiserVoiceENS_20DummyCriticalSectionEEE", !14, i64 0, !16, i64 8}
!14 = !{!"_ZTSN4juce9HeapBlockIPNS_16SynthesiserVoiceELb0EEE", !15, i64 0}
!15 = !{!"any pointer", !11, i64 0}
!16 = !{!"int", !11, i64 0}
!17 = !{!"_ZTSN4juce21ReferenceCountedArrayINS_16SynthesiserSoundENS_20DummyCriticalSectionEEE", !18, i64 0, !16, i64 16}
!18 = !{!"_ZTSN4juce19ArrayAllocationBaseIPNS_16SynthesiserSoundENS_20DummyCriticalSectionEEE", !19, i64 0, !16, i64 8}
!19 = !{!"_ZTSN4juce9HeapBlockIPNS_16SynthesiserSoundELb0EEE", !15, i64 0}
!20 = !{!"double", !11, i64 0}
!21 = !{!"bool", !11, i64 0}
!22 = !{!"_ZTSN4juce10BigIntegerE", !23, i64 0, !11, i64 8, !24, i64 24, !16, i64 32, !21, i64 36}
!23 = !{!"_ZTSN4juce9HeapBlockIjLb0EEE", !15, i64 0}
!24 = !{!"long", !11, i64 0}
!25 = !{i8 0, i8 2}
!26 = !{}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.mustprogress"}
!29 = distinct !{!29, !28}


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