; LLVM IR from modlfo/AudioEngine :: AudioEngine/JuceLibraryCode (juce_audio_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::GenericScopedLock" = 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::ReferenceCountedObjectPtr" = type { ptr }
%"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

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) #3

; 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) #4 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4juce11Synthesiser18handleSustainPedalEib(ptr noundef nonnull align 8 dereferenceable(224) %0, i32 noundef %1, i1 noundef zeroext %2) unnamed_addr #4 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i8, align 1
  %7 = alloca %"class.juce::GenericScopedLock", align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !9
  %14 = zext i1 %2 to i8
  store i8 %14, ptr %6, align 1, !tbaa !11
  %15 = load ptr, ptr %4, align 8
  br label %16

16:                                               ; preds = %3
  br label %17

17:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %18 = getelementptr inbounds %"class.juce::Synthesiser", ptr %15, i32 0, i32 1
  call void @_ZN4juce17GenericScopedLockINS_15CriticalSectionEEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(40) %18) #6
  %19 = load i8, ptr %6, align 1, !tbaa !11, !range !13, !noundef !14
  %20 = trunc i8 %19 to i1
  br i1 %20, label %21, label %59

21:                                               ; preds = %17
  %22 = getelementptr inbounds %"class.juce::Synthesiser", ptr %15, i32 0, i32 11
  %23 = load i32, ptr %5, align 4, !tbaa !9
  invoke void @_ZN4juce10BigInteger6setBitEi(ptr noundef nonnull align 8 dereferenceable(37) %22, i32 noundef %23)
          to label %24 unwind label %32

24:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  %25 = getelementptr inbounds %"class.juce::Synthesiser", ptr %15, i32 0, i32 2
  %26 = call noundef i32 @_ZNK4juce10OwnedArrayINS_16SynthesiserVoiceENS_20DummyCriticalSectionEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20) %25) #6
  store i32 %26, ptr %10, align 4, !tbaa !9
  br label %27

27:                                               ; preds = %57, %24
  %28 = load i32, ptr %10, align 4, !tbaa !9
  %29 = add nsw i32 %28, -1
  store i32 %29, ptr %10, align 4, !tbaa !9
  %30 = icmp sge i32 %29, 0
  br i1 %30, label %36, label %31

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

32:                                               ; preds = %21
  %33 = landingpad { ptr, i32 }
          cleanup
  %34 = extractvalue { ptr, i32 } %33, 0
  store ptr %34, ptr %8, align 8
  %35 = extractvalue { ptr, i32 } %33, 1
  store i32 %35, ptr %9, align 4
  br label %96

36:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %37 = getelementptr inbounds %"class.juce::Synthesiser", ptr %15, i32 0, i32 2
  %38 = load i32, ptr %10, align 4, !tbaa !9
  %39 = call noundef ptr @_ZNK4juce10OwnedArrayINS_16SynthesiserVoiceENS_20DummyCriticalSectionEE12getUncheckedEi(ptr noundef nonnull align 8 dereferenceable(20) %37, i32 noundef %38) #6
  store ptr %39, ptr %11, align 8, !tbaa !5
  %40 = load ptr, ptr %11, align 8, !tbaa !5
  %41 = load i32, ptr %5, align 4, !tbaa !9
  %42 = load ptr, ptr %40, align 8, !tbaa !15
  %43 = getelementptr inbounds ptr, ptr %42, i64 13
  %44 = load ptr, ptr %43, align 8
  %45 = invoke noundef zeroext i1 %44(ptr noundef nonnull align 8 dereferenceable(344) %40, i32 noundef %41)
          to label %46 unwind label %53

46:                                               ; preds = %36
  br i1 %45, label %47, label %57

47:                                               ; preds = %46
  %48 = load ptr, ptr %11, align 8, !tbaa !5
  %49 = call noundef zeroext i1 @_ZNK4juce16SynthesiserVoice9isKeyDownEv(ptr noundef nonnull align 8 dereferenceable(344) %48) #6
  br i1 %49, label %50, label %57

50:                                               ; preds = %47
  %51 = load ptr, ptr %11, align 8, !tbaa !5
  %52 = getelementptr inbounds %"class.juce::SynthesiserVoice", ptr %51, i32 0, i32 7
  store i8 1, ptr %52, align 1, !tbaa !17
  br label %57

53:                                               ; preds = %36
  %54 = landingpad { ptr, i32 }
          cleanup
  %55 = extractvalue { ptr, i32 } %54, 0
  store ptr %55, ptr %8, align 8
  %56 = extractvalue { ptr, i32 } %54, 1
  store i32 %56, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %96

57:                                               ; preds = %50, %47, %46
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  br label %27, !llvm.loop !24

58:                                               ; preds = %31
  br label %95

59:                                               ; preds = %17
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  %60 = getelementptr inbounds %"class.juce::Synthesiser", ptr %15, i32 0, i32 2
  %61 = call noundef i32 @_ZNK4juce10OwnedArrayINS_16SynthesiserVoiceENS_20DummyCriticalSectionEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20) %60) #6
  store i32 %61, ptr %12, align 4, !tbaa !9
  br label %62

62:                                               ; preds = %91, %59
  %63 = load i32, ptr %12, align 4, !tbaa !9
  %64 = add nsw i32 %63, -1
  store i32 %64, ptr %12, align 4, !tbaa !9
  %65 = icmp sge i32 %64, 0
  br i1 %65, label %67, label %66

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

67:                                               ; preds = %62
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %68 = getelementptr inbounds %"class.juce::Synthesiser", ptr %15, i32 0, i32 2
  %69 = load i32, ptr %12, align 4, !tbaa !9
  %70 = call noundef ptr @_ZNK4juce10OwnedArrayINS_16SynthesiserVoiceENS_20DummyCriticalSectionEE12getUncheckedEi(ptr noundef nonnull align 8 dereferenceable(20) %68, i32 noundef %69) #6
  store ptr %70, ptr %13, align 8, !tbaa !5
  %71 = load ptr, ptr %13, align 8, !tbaa !5
  %72 = load i32, ptr %5, align 4, !tbaa !9
  %73 = load ptr, ptr %71, align 8, !tbaa !15
  %74 = getelementptr inbounds ptr, ptr %73, i64 13
  %75 = load ptr, ptr %74, align 8
  %76 = invoke noundef zeroext i1 %75(ptr noundef nonnull align 8 dereferenceable(344) %71, i32 noundef %72)
          to label %77 unwind label %86

77:                                               ; preds = %67
  br i1 %76, label %78, label %91

78:                                               ; preds = %77
  %79 = load ptr, ptr %13, align 8, !tbaa !5
  %80 = getelementptr inbounds %"class.juce::SynthesiserVoice", ptr %79, i32 0, i32 7
  store i8 0, ptr %80, align 1, !tbaa !17
  %81 = load ptr, ptr %13, align 8, !tbaa !5
  %82 = call noundef zeroext i1 @_ZNK4juce16SynthesiserVoice9isKeyDownEv(ptr noundef nonnull align 8 dereferenceable(344) %81) #6
  br i1 %82, label %90, label %83

83:                                               ; preds = %78
  %84 = load ptr, ptr %13, align 8, !tbaa !5
  invoke void @_ZN4juce11Synthesiser9stopVoiceEPNS_16SynthesiserVoiceEfb(ptr noundef nonnull align 8 dereferenceable(224) %15, ptr noundef %84, float noundef 1.000000e+00, i1 noundef zeroext true)
          to label %85 unwind label %86

85:                                               ; preds = %83
  br label %90

86:                                               ; preds = %83, %67
  %87 = landingpad { ptr, i32 }
          cleanup
  %88 = extractvalue { ptr, i32 } %87, 0
  store ptr %88, ptr %8, align 8
  %89 = extractvalue { ptr, i32 } %87, 1
  store i32 %89, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %96

90:                                               ; preds = %85, %78
  br label %91

91:                                               ; preds = %90, %77
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  br label %62, !llvm.loop !26

92:                                               ; preds = %66
  %93 = getelementptr inbounds %"class.juce::Synthesiser", ptr %15, i32 0, i32 11
  %94 = load i32, ptr %5, align 4, !tbaa !9
  call void @_ZN4juce10BigInteger8clearBitEi(ptr noundef nonnull align 8 dereferenceable(37) %93, i32 noundef %94) #6
  br label %95

95:                                               ; preds = %92, %58
  call void @_ZN4juce17GenericScopedLockINS_15CriticalSectionEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  ret void

96:                                               ; preds = %86, %53, %32
  call void @_ZN4juce17GenericScopedLockINS_15CriticalSectionEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  br label %97

97:                                               ; preds = %96
  %98 = load ptr, ptr %8, align 8
  %99 = load i32, ptr %9, align 4
  %100 = insertvalue { ptr, i32 } poison, ptr %98, 0
  %101 = insertvalue { ptr, i32 } %100, i32 %99, 1
  resume { ptr, i32 } %101
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK4juce16SynthesiserVoice9isKeyDownEv(ptr noundef nonnull align 8 dereferenceable(344)) #5 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 = { "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 = { 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 #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 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{i8 0, i8 2}
!14 = !{}
!15 = !{!16, !16, i64 0}
!16 = !{!"vtable pointer", !8, i64 0}
!17 = !{!18, !12, i64 41}
!18 = !{!"_ZTSN4juce16SynthesiserVoiceE", !19, i64 8, !10, i64 16, !10, i64 20, !10, i64 24, !20, i64 32, !12, i64 40, !12, i64 41, !12, 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, !12, i64 288}
!22 = !{!"long", !7, i64 0}
!23 = !{!"_ZTSN4juce9HeapBlockIcLb1EEE", !6, i64 0}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}
!26 = distinct !{!26, !25}


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

; 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

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

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

; 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 #4 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4juce11Synthesiser18handleSustainPedalEib(ptr noundef nonnull align 8 dereferenceable(224) %0, i32 noundef %1, i1 noundef zeroext %2) unnamed_addr #4 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"class.juce::GenericScopedLock", align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  %5 = getelementptr inbounds i8, ptr %0, i64 8
  call void @_ZN4juce17GenericScopedLockINS_15CriticalSectionEEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(40) %5) #6
  br i1 %2, label %6, label %29

6:                                                ; preds = %3
  %7 = getelementptr inbounds i8, ptr %0, i64 184
  invoke void @_ZN4juce10BigInteger6setBitEi(ptr noundef nonnull align 8 dereferenceable(37) %7, i32 noundef %1)
          to label %8 unwind label %12

8:                                                ; preds = %6
  %9 = getelementptr inbounds i8, ptr %0, i64 48
  %10 = call noundef i32 @_ZNK4juce10OwnedArrayINS_16SynthesiserVoiceENS_20DummyCriticalSectionEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20) %9) #6
  %11 = icmp sgt i32 %10, 0
  br i1 %11, label %.lr.ph25, label %.loopexit

12:                                               ; preds = %6
  %13 = landingpad { ptr, i32 }
          cleanup
  br label %49

.lr.ph25:                                         ; preds = %8, %27
  %.in26 = phi i32 [ %14, %27 ], [ %10, %8 ]
  %14 = add nsw i32 %.in26, -1
  %15 = call noundef ptr @_ZNK4juce10OwnedArrayINS_16SynthesiserVoiceENS_20DummyCriticalSectionEE12getUncheckedEi(ptr noundef nonnull align 8 dereferenceable(20) %9, i32 noundef %14) #6
  %16 = load ptr, ptr %15, align 8, !tbaa !5
  %17 = getelementptr inbounds i8, ptr %16, i64 104
  %18 = load ptr, ptr %17, align 8
  %19 = invoke noundef zeroext i1 %18(ptr noundef nonnull align 8 dereferenceable(344) %15, i32 noundef %1)
          to label %20 unwind label %25

20:                                               ; preds = %.lr.ph25
  br i1 %19, label %21, label %27

21:                                               ; preds = %20
  %22 = call noundef zeroext i1 @_ZNK4juce16SynthesiserVoice9isKeyDownEv(ptr noundef nonnull align 8 dereferenceable(344) %15) #6
  br i1 %22, label %23, label %27

23:                                               ; preds = %21
  %24 = getelementptr inbounds i8, ptr %15, i64 41
  store i8 1, ptr %24, align 1, !tbaa !8
  br label %27

25:                                               ; preds = %.lr.ph25
  %26 = landingpad { ptr, i32 }
          cleanup
  br label %49

27:                                               ; preds = %23, %21, %20
  %28 = icmp ugt i32 %.in26, 1
  br i1 %28, label %.lr.ph25, label %.loopexit, !llvm.loop !19

29:                                               ; preds = %3
  %30 = getelementptr inbounds i8, ptr %0, i64 48
  %31 = call noundef i32 @_ZNK4juce10OwnedArrayINS_16SynthesiserVoiceENS_20DummyCriticalSectionEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20) %30) #6
  %32 = icmp sgt i32 %31, 0
  br i1 %32, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %47, %29
  %33 = getelementptr inbounds i8, ptr %0, i64 184
  call void @_ZN4juce10BigInteger8clearBitEi(ptr noundef nonnull align 8 dereferenceable(37) %33, i32 noundef %1) #6
  br label %.loopexit

.lr.ph:                                           ; preds = %29, %47
  %.in = phi i32 [ %34, %47 ], [ %31, %29 ]
  %34 = add nsw i32 %.in, -1
  %35 = call noundef ptr @_ZNK4juce10OwnedArrayINS_16SynthesiserVoiceENS_20DummyCriticalSectionEE12getUncheckedEi(ptr noundef nonnull align 8 dereferenceable(20) %30, i32 noundef %34) #6
  %36 = load ptr, ptr %35, align 8, !tbaa !5
  %37 = getelementptr inbounds i8, ptr %36, i64 104
  %38 = load ptr, ptr %37, align 8
  %39 = invoke noundef zeroext i1 %38(ptr noundef nonnull align 8 dereferenceable(344) %35, i32 noundef %1)
          to label %40 unwind label %45

40:                                               ; preds = %.lr.ph
  br i1 %39, label %41, label %47

41:                                               ; preds = %40
  %42 = getelementptr inbounds i8, ptr %35, i64 41
  store i8 0, ptr %42, align 1, !tbaa !8
  %43 = call noundef zeroext i1 @_ZNK4juce16SynthesiserVoice9isKeyDownEv(ptr noundef nonnull align 8 dereferenceable(344) %35) #6
  br i1 %43, label %47, label %44

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

45:                                               ; preds = %44, %.lr.ph
  %46 = landingpad { ptr, i32 }
          cleanup
  br label %49

47:                                               ; preds = %41, %44, %40
  %48 = icmp ugt i32 %.in, 1
  br i1 %48, label %.lr.ph, label %._crit_edge, !llvm.loop !21

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK4juce16SynthesiserVoice9isKeyDownEv(ptr noundef nonnull align 8 dereferenceable(344)) local_unnamed_addr #5 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 = { "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 = { 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 #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 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !15, i64 41}
!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 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = distinct !{!21, !20}


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