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

; 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 }
%"class.juce::SynthesiserVoice" = type { ptr, double, i32, i32, i32, %"class.juce::ReferenceCountedObjectPtr", i8, i8, i8, [5 x i8], %"class.juce::AudioBuffer" }
%"class.juce::AudioBuffer" = type <{ i32, i32, i64, ptr, %"class.juce::HeapBlock.0", [32 x ptr], i8, [7 x i8] }>
%"class.juce::HeapBlock.0" = 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
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
define dso_local void @_ZN4juce11Synthesiser7noteOffEiifb(ptr noundef nonnull align 8 dereferenceable(224) %0, i32 noundef %1, i32 noundef %2, float noundef %3, i1 noundef zeroext %4) unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca float, align 4
  %10 = alloca i8, align 1
  %11 = alloca %"class.juce::GenericScopedLock", align 8
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca ptr, align 8
  %17 = alloca %"class.juce::ReferenceCountedObjectPtr", align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  store i32 %1, ptr %7, align 4, !tbaa !9
  store i32 %2, ptr %8, align 4, !tbaa !9
  store float %3, ptr %9, align 4, !tbaa !11
  %18 = zext i1 %4 to i8
  store i8 %18, ptr %10, align 1, !tbaa !13
  %19 = load ptr, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  %20 = getelementptr inbounds %"class.juce::Synthesiser", ptr %19, i32 0, i32 1
  call void @_ZN4juce17GenericScopedLockINS_15CriticalSectionEEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(40) %20) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  %21 = getelementptr inbounds %"class.juce::Synthesiser", ptr %19, i32 0, i32 2
  %22 = call noundef i32 @_ZNK4juce10OwnedArrayINS_16SynthesiserVoiceENS_20DummyCriticalSectionEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20) %21) #4
  store i32 %22, ptr %12, align 4, !tbaa !9
  br label %23

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

27:                                               ; preds = %23
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  br label %99

28:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  %29 = getelementptr inbounds %"class.juce::Synthesiser", ptr %19, i32 0, i32 2
  %30 = load i32, ptr %12, align 4, !tbaa !9
  %31 = call noundef ptr @_ZNK4juce10OwnedArrayINS_16SynthesiserVoiceENS_20DummyCriticalSectionEE12getUncheckedEi(ptr noundef nonnull align 8 dereferenceable(20) %29, i32 noundef %30) #4
  store ptr %31, ptr %13, align 8, !tbaa !5
  %32 = load ptr, ptr %13, align 8, !tbaa !5
  %33 = call noundef i32 @_ZNK4juce16SynthesiserVoice23getCurrentlyPlayingNoteEv(ptr noundef nonnull align 8 dereferenceable(344) %32) #4
  %34 = load i32, ptr %8, align 4, !tbaa !9
  %35 = icmp eq i32 %33, %34
  br i1 %35, label %36, label %97

36:                                               ; preds = %28
  %37 = load ptr, ptr %13, align 8, !tbaa !5
  %38 = load i32, ptr %7, align 4, !tbaa !9
  %39 = load ptr, ptr %37, align 8, !tbaa !15
  %40 = getelementptr inbounds ptr, ptr %39, i64 13
  %41 = load ptr, ptr %40, align 8
  %42 = invoke noundef zeroext i1 %41(ptr noundef nonnull align 8 dereferenceable(344) %37, i32 noundef %38)
          to label %43 unwind label %86

43:                                               ; preds = %36
  br i1 %42, label %44, label %97

44:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  %45 = load ptr, ptr %13, align 8, !tbaa !5
  call void @_ZNK4juce16SynthesiserVoice24getCurrentlyPlayingSoundEv(ptr dead_on_unwind writable sret(%"class.juce::ReferenceCountedObjectPtr") align 8 %17, ptr noundef nonnull align 8 dereferenceable(344) %45) #4
  %46 = call noundef ptr @_ZNK4juce25ReferenceCountedObjectPtrINS_16SynthesiserSoundEEcvPS1_Ev(ptr noundef nonnull align 8 dereferenceable(8) %17) #4
  call void @_ZN4juce25ReferenceCountedObjectPtrINS_16SynthesiserSoundEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %17) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  store ptr %46, ptr %16, align 8, !tbaa !5
  %47 = load ptr, ptr %16, align 8, !tbaa !5
  %48 = icmp ne ptr %47, null
  br i1 %48, label %49, label %96

49:                                               ; preds = %44
  %50 = load ptr, ptr %16, align 8, !tbaa !5
  %51 = load i32, ptr %8, align 4, !tbaa !9
  %52 = load ptr, ptr %50, align 8, !tbaa !15
  %53 = getelementptr inbounds ptr, ptr %52, i64 2
  %54 = load ptr, ptr %53, align 8
  %55 = invoke noundef zeroext i1 %54(ptr noundef nonnull align 8 dereferenceable(16) %50, i32 noundef %51)
          to label %56 unwind label %90

56:                                               ; preds = %49
  br i1 %55, label %57, label %95

57:                                               ; preds = %56
  %58 = load ptr, ptr %16, align 8, !tbaa !5
  %59 = load i32, ptr %7, align 4, !tbaa !9
  %60 = load ptr, ptr %58, align 8, !tbaa !15
  %61 = getelementptr inbounds ptr, ptr %60, i64 3
  %62 = load ptr, ptr %61, align 8
  %63 = invoke noundef zeroext i1 %62(ptr noundef nonnull align 8 dereferenceable(16) %58, i32 noundef %59)
          to label %64 unwind label %90

64:                                               ; preds = %57
  br i1 %63, label %65, label %95

65:                                               ; preds = %64
  br label %66

66:                                               ; preds = %65
  br label %67

67:                                               ; preds = %66
  br label %68

68:                                               ; preds = %67
  %69 = load ptr, ptr %13, align 8, !tbaa !5
  %70 = getelementptr inbounds %"class.juce::SynthesiserVoice", ptr %69, i32 0, i32 6
  store i8 0, ptr %70, align 8, !tbaa !17
  %71 = load ptr, ptr %13, align 8, !tbaa !5
  %72 = getelementptr inbounds %"class.juce::SynthesiserVoice", ptr %71, i32 0, i32 7
  %73 = load i8, ptr %72, align 1, !tbaa !24, !range !25, !noundef !26
  %74 = trunc i8 %73 to i1
  br i1 %74, label %94, label %75

75:                                               ; preds = %68
  %76 = load ptr, ptr %13, align 8, !tbaa !5
  %77 = getelementptr inbounds %"class.juce::SynthesiserVoice", ptr %76, i32 0, i32 8
  %78 = load i8, ptr %77, align 2, !tbaa !27, !range !25, !noundef !26
  %79 = trunc i8 %78 to i1
  br i1 %79, label %94, label %80

80:                                               ; preds = %75
  %81 = load ptr, ptr %13, align 8, !tbaa !5
  %82 = load float, ptr %9, align 4, !tbaa !11
  %83 = load i8, ptr %10, align 1, !tbaa !13, !range !25, !noundef !26
  %84 = trunc i8 %83 to i1
  invoke void @_ZN4juce11Synthesiser9stopVoiceEPNS_16SynthesiserVoiceEfb(ptr noundef nonnull align 8 dereferenceable(224) %19, ptr noundef %81, float noundef %82, i1 noundef zeroext %84)
          to label %85 unwind label %90

85:                                               ; preds = %80
  br label %94

86:                                               ; preds = %36
  %87 = landingpad { ptr, i32 }
          cleanup
  %88 = extractvalue { ptr, i32 } %87, 0
  store ptr %88, ptr %14, align 8
  %89 = extractvalue { ptr, i32 } %87, 1
  store i32 %89, ptr %15, align 4
  br label %98

90:                                               ; preds = %80, %57, %49
  %91 = landingpad { ptr, i32 }
          cleanup
  %92 = extractvalue { ptr, i32 } %91, 0
  store ptr %92, ptr %14, align 8
  %93 = extractvalue { ptr, i32 } %91, 1
  store i32 %93, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  br label %98

94:                                               ; preds = %85, %75, %68
  br label %95

95:                                               ; preds = %94, %64, %56
  br label %96

96:                                               ; preds = %95, %44
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  br label %97

97:                                               ; preds = %96, %43, %28
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  br label %23, !llvm.loop !28

98:                                               ; preds = %90, %86
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  call void @_ZN4juce17GenericScopedLockINS_15CriticalSectionEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  br label %100

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNK4juce16SynthesiserVoice24getCurrentlyPlayingSoundEv(ptr dead_on_unwind noalias writable sret(%"class.juce::ReferenceCountedObjectPtr") align 8, ptr noundef nonnull align 8 dereferenceable(344)) #2 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 = !{!"bool", !7, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"vtable pointer", !8, i64 0}
!17 = !{!18, !14, i64 40}
!18 = !{!"_ZTSN4juce16SynthesiserVoiceE", !19, i64 8, !10, i64 16, !10, i64 20, !10, i64 24, !20, i64 32, !14, i64 40, !14, i64 41, !14, i64 42, !21, i64 48}
!19 = !{!"double", !7, i64 0}
!20 = !{!"_ZTSN4juce25ReferenceCountedObjectPtrINS_16SynthesiserSoundEEE", !6, i64 0}
!21 = !{!"_ZTSN4juce11AudioBufferIfEE", !10, i64 0, !10, i64 4, !22, i64 8, !6, i64 16, !23, i64 24, !7, i64 32, !14, i64 288}
!22 = !{!"long", !7, i64 0}
!23 = !{!"_ZTSN4juce9HeapBlockIcLb1EEE", !6, i64 0}
!24 = !{!18, !14, i64 41}
!25 = !{i8 0, i8 2}
!26 = !{}
!27 = !{!18, !14, i64 42}
!28 = distinct !{!28, !29}
!29 = !{!"llvm.loop.mustprogress"}


; 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
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
define dso_local void @_ZN4juce11Synthesiser7noteOffEiifb(ptr noundef nonnull align 8 dereferenceable(224) %0, i32 noundef %1, i32 noundef %2, float noundef %3, i1 noundef zeroext %4) unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %6 = alloca %"class.juce::GenericScopedLock", align 8
  %7 = alloca %"class.juce::ReferenceCountedObjectPtr", align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #4
  %8 = getelementptr inbounds i8, ptr %0, i64 8
  call void @_ZN4juce17GenericScopedLockINS_15CriticalSectionEEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(40) %8) #4
  %9 = getelementptr inbounds i8, ptr %0, i64 48
  %10 = call noundef i32 @_ZNK4juce10OwnedArrayINS_16SynthesiserVoiceENS_20DummyCriticalSectionEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20) %9) #4
  %11 = icmp sgt i32 %10, 0
  br i1 %11, label %.lr.ph, label %._crit_edge

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

.lr.ph:                                           ; preds = %5, %50
  %.in = phi i32 [ %12, %50 ], [ %10, %5 ]
  %12 = add nsw i32 %.in, -1
  %13 = call noundef ptr @_ZNK4juce10OwnedArrayINS_16SynthesiserVoiceENS_20DummyCriticalSectionEE12getUncheckedEi(ptr noundef nonnull align 8 dereferenceable(20) %9, i32 noundef %12) #4
  %14 = call noundef i32 @_ZNK4juce16SynthesiserVoice23getCurrentlyPlayingNoteEv(ptr noundef nonnull align 8 dereferenceable(344) %13) #4
  %15 = icmp eq i32 %14, %2
  br i1 %15, label %16, label %50

16:                                               ; preds = %.lr.ph
  %17 = load ptr, ptr %13, align 8, !tbaa !5
  %18 = getelementptr inbounds i8, ptr %17, i64 104
  %19 = load ptr, ptr %18, align 8
  %20 = invoke noundef zeroext i1 %19(ptr noundef nonnull align 8 dereferenceable(344) %13, i32 noundef %1)
          to label %21 unwind label %46

21:                                               ; preds = %16
  br i1 %20, label %22, label %50

22:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #4
  call void @_ZNK4juce16SynthesiserVoice24getCurrentlyPlayingSoundEv(ptr dead_on_unwind nonnull writable sret(%"class.juce::ReferenceCountedObjectPtr") align 8 %7, ptr noundef nonnull align 8 dereferenceable(344) %13) #4
  %23 = call noundef ptr @_ZNK4juce25ReferenceCountedObjectPtrINS_16SynthesiserSoundEEcvPS1_Ev(ptr noundef nonnull align 8 dereferenceable(8) %7) #4
  call void @_ZN4juce25ReferenceCountedObjectPtrINS_16SynthesiserSoundEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #4
  %.not = icmp eq ptr %23, null
  br i1 %.not, label %50, label %24

24:                                               ; preds = %22
  %25 = load ptr, ptr %23, align 8, !tbaa !5
  %26 = getelementptr inbounds i8, ptr %25, i64 16
  %27 = load ptr, ptr %26, align 8
  %28 = invoke noundef zeroext i1 %27(ptr noundef nonnull align 8 dereferenceable(16) %23, i32 noundef %2)
          to label %29 unwind label %48

29:                                               ; preds = %24
  br i1 %28, label %30, label %50

30:                                               ; preds = %29
  %31 = load ptr, ptr %23, align 8, !tbaa !5
  %32 = getelementptr inbounds i8, ptr %31, i64 24
  %33 = load ptr, ptr %32, align 8
  %34 = invoke noundef zeroext i1 %33(ptr noundef nonnull align 8 dereferenceable(16) %23, i32 noundef %1)
          to label %35 unwind label %48

35:                                               ; preds = %30
  br i1 %34, label %36, label %50

36:                                               ; preds = %35
  %37 = getelementptr inbounds i8, ptr %13, i64 40
  store i8 0, ptr %37, align 8, !tbaa !8
  %38 = getelementptr inbounds i8, ptr %13, i64 41
  %39 = load i8, ptr %38, align 1, !tbaa !19, !range !20, !noundef !21
  %40 = trunc nuw i8 %39 to i1
  br i1 %40, label %50, label %41

41:                                               ; preds = %36
  %42 = getelementptr inbounds i8, ptr %13, i64 42
  %43 = load i8, ptr %42, align 2, !tbaa !22, !range !20, !noundef !21
  %44 = trunc nuw i8 %43 to i1
  br i1 %44, label %50, label %45

45:                                               ; preds = %41
  invoke void @_ZN4juce11Synthesiser9stopVoiceEPNS_16SynthesiserVoiceEfb(ptr noundef nonnull align 8 dereferenceable(224) %0, ptr noundef nonnull %13, float noundef %3, i1 noundef zeroext %4)
          to label %50 unwind label %48

46:                                               ; preds = %16
  %47 = landingpad { ptr, i32 }
          cleanup
  br label %52

48:                                               ; preds = %45, %30, %24
  %49 = landingpad { ptr, i32 }
          cleanup
  br label %52

50:                                               ; preds = %22, %36, %41, %45, %35, %29, %21, %.lr.ph
  %51 = icmp ugt i32 %.in, 1
  br i1 %51, label %.lr.ph, label %._crit_edge, !llvm.loop !23

52:                                               ; preds = %48, %46
  %.pn = phi { ptr, i32 } [ %49, %48 ], [ %47, %46 ]
  call void @_ZN4juce17GenericScopedLockINS_15CriticalSectionEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  resume { ptr, i32 } %.pn
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNK4juce16SynthesiserVoice24getCurrentlyPlayingSoundEv(ptr dead_on_unwind noalias writable sret(%"class.juce::ReferenceCountedObjectPtr") align 8, ptr noundef nonnull align 8 dereferenceable(344)) local_unnamed_addr #2 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, !15, i64 40}
!9 = !{!"_ZTSN4juce16SynthesiserVoiceE", !10, i64 8, !12, i64 16, !12, i64 20, !12, i64 24, !13, i64 32, !15, i64 40, !15, i64 41, !15, i64 42, !16, i64 48}
!10 = !{!"double", !11, i64 0}
!11 = !{!"omnipotent char", !7, i64 0}
!12 = !{!"int", !11, i64 0}
!13 = !{!"_ZTSN4juce25ReferenceCountedObjectPtrINS_16SynthesiserSoundEEE", !14, i64 0}
!14 = !{!"any pointer", !11, i64 0}
!15 = !{!"bool", !11, i64 0}
!16 = !{!"_ZTSN4juce11AudioBufferIfEE", !12, i64 0, !12, i64 4, !17, i64 8, !14, i64 16, !18, i64 24, !11, i64 32, !15, i64 288}
!17 = !{!"long", !11, i64 0}
!18 = !{!"_ZTSN4juce9HeapBlockIcLb1EEE", !14, i64 0}
!19 = !{!9, !15, i64 41}
!20 = !{i8 0, i8 2}
!21 = !{}
!22 = !{!9, !15, i64 42}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}


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