; 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::MidiMessage" = type <{ %"union.juce::MidiMessage::PackedData", double, i32, [4 x i8] }>
%"union.juce::MidiMessage::PackedData" = type { ptr }
%"class.juce::MidiMessageSequence" = type { %"class.juce::OwnedArray.35" }
%"class.juce::OwnedArray.35" = type { %"class.juce::ArrayAllocationBase.36", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.36" = type <{ %"class.juce::HeapBlock.37", i32, [4 x i8] }>
%"class.juce::HeapBlock.37" = type { ptr }
%"class.juce::MidiMessageSequence::MidiEventHolder" = type { %"class.juce::MidiMessage", ptr }

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

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: noinline noreturn nounwind uwtable
declare hidden void @__clang_call_terminate(ptr noundef) #1

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) #2

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN4juce19MidiMessageSequence18updateMatchedPairsEv(ptr noundef nonnull align 8 dereferenceable(24) %0) #3 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca %"class.juce::MidiMessage", align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %14 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  store i32 0, ptr %3, align 4, !tbaa !9
  br label %15

15:                                               ; preds = %100, %1
  %16 = load i32, ptr %3, align 4, !tbaa !9
  %17 = getelementptr inbounds %"class.juce::MidiMessageSequence", ptr %14, i32 0, i32 0
  %18 = call noundef i32 @_ZNK4juce10OwnedArrayINS_19MidiMessageSequence15MidiEventHolderENS_20DummyCriticalSectionEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20) %17) #5
  %19 = icmp slt i32 %16, %18
  br i1 %19, label %21, label %20

20:                                               ; preds = %15
  store i32 2, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  br label %103

21:                                               ; preds = %15
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  %22 = getelementptr inbounds %"class.juce::MidiMessageSequence", ptr %14, i32 0, i32 0
  %23 = load i32, ptr %3, align 4, !tbaa !9
  %24 = call noundef ptr @_ZNK4juce10OwnedArrayINS_19MidiMessageSequence15MidiEventHolderENS_20DummyCriticalSectionEE12getUncheckedEi(ptr noundef nonnull align 8 dereferenceable(20) %22, i32 noundef %23) #5
  store ptr %24, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %25 = load ptr, ptr %5, align 8, !tbaa !5
  %26 = getelementptr inbounds %"class.juce::MidiMessageSequence::MidiEventHolder", ptr %25, i32 0, i32 0
  store ptr %26, ptr %6, align 8, !tbaa !5
  %27 = load ptr, ptr %6, align 8, !tbaa !5
  %28 = call noundef zeroext i1 @_ZNK4juce11MidiMessage8isNoteOnEb(ptr noundef nonnull align 8 dereferenceable(20) %27, i1 noundef zeroext false) #5
  br i1 %28, label %29, label %99

29:                                               ; preds = %21
  %30 = load ptr, ptr %5, align 8, !tbaa !5
  %31 = getelementptr inbounds %"class.juce::MidiMessageSequence::MidiEventHolder", ptr %30, i32 0, i32 1
  store ptr null, ptr %31, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  %32 = load ptr, ptr %6, align 8, !tbaa !5
  %33 = call noundef i32 @_ZNK4juce11MidiMessage13getNoteNumberEv(ptr noundef nonnull align 8 dereferenceable(20) %32) #5
  store i32 %33, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  %34 = load ptr, ptr %6, align 8, !tbaa !5
  %35 = call noundef i32 @_ZNK4juce11MidiMessage10getChannelEv(ptr noundef nonnull align 8 dereferenceable(20) %34) #5
  store i32 %35, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  %36 = getelementptr inbounds %"class.juce::MidiMessageSequence", ptr %14, i32 0, i32 0
  %37 = call noundef i32 @_ZNK4juce10OwnedArrayINS_19MidiMessageSequence15MidiEventHolderENS_20DummyCriticalSectionEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20) %36) #5
  store i32 %37, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %38 = load i32, ptr %3, align 4, !tbaa !9
  %39 = add nsw i32 %38, 1
  store i32 %39, ptr %10, align 4, !tbaa !9
  br label %40

40:                                               ; preds = %94, %29
  %41 = load i32, ptr %10, align 4, !tbaa !9
  %42 = load i32, ptr %9, align 4, !tbaa !9
  %43 = icmp slt i32 %41, %42
  br i1 %43, label %45, label %44

44:                                               ; preds = %40
  store i32 5, ptr %4, align 4
  br label %97

45:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %46 = getelementptr inbounds %"class.juce::MidiMessageSequence", ptr %14, i32 0, i32 0
  %47 = load i32, ptr %10, align 4, !tbaa !9
  %48 = call noundef ptr @_ZNK4juce10OwnedArrayINS_19MidiMessageSequence15MidiEventHolderENS_20DummyCriticalSectionEE12getUncheckedEi(ptr noundef nonnull align 8 dereferenceable(20) %46, i32 noundef %47) #5
  %49 = getelementptr inbounds %"class.juce::MidiMessageSequence::MidiEventHolder", ptr %48, i32 0, i32 0
  store ptr %49, ptr %11, align 8, !tbaa !5
  %50 = load ptr, ptr %11, align 8, !tbaa !5
  %51 = call noundef i32 @_ZNK4juce11MidiMessage13getNoteNumberEv(ptr noundef nonnull align 8 dereferenceable(20) %50) #5
  %52 = load i32, ptr %7, align 4, !tbaa !9
  %53 = icmp eq i32 %51, %52
  br i1 %53, label %54, label %90

54:                                               ; preds = %45
  %55 = load ptr, ptr %11, align 8, !tbaa !5
  %56 = call noundef i32 @_ZNK4juce11MidiMessage10getChannelEv(ptr noundef nonnull align 8 dereferenceable(20) %55) #5
  %57 = load i32, ptr %8, align 4, !tbaa !9
  %58 = icmp eq i32 %56, %57
  br i1 %58, label %59, label %90

59:                                               ; preds = %54
  %60 = load ptr, ptr %11, align 8, !tbaa !5
  %61 = call noundef zeroext i1 @_ZNK4juce11MidiMessage9isNoteOffEb(ptr noundef nonnull align 8 dereferenceable(20) %60, i1 noundef zeroext true) #5
  br i1 %61, label %62, label %68

62:                                               ; preds = %59
  %63 = getelementptr inbounds %"class.juce::MidiMessageSequence", ptr %14, i32 0, i32 0
  %64 = load i32, ptr %10, align 4, !tbaa !9
  %65 = call noundef ptr @_ZNK4juce10OwnedArrayINS_19MidiMessageSequence15MidiEventHolderENS_20DummyCriticalSectionEEixEi(ptr noundef nonnull align 8 dereferenceable(20) %63, i32 noundef %64) #5
  %66 = load ptr, ptr %5, align 8, !tbaa !5
  %67 = getelementptr inbounds %"class.juce::MidiMessageSequence::MidiEventHolder", ptr %66, i32 0, i32 1
  store ptr %65, ptr %67, align 8, !tbaa !11
  store i32 5, ptr %4, align 4
  br label %91

68:                                               ; preds = %59
  %69 = load ptr, ptr %11, align 8, !tbaa !5
  %70 = call noundef zeroext i1 @_ZNK4juce11MidiMessage8isNoteOnEb(ptr noundef nonnull align 8 dereferenceable(20) %69, i1 noundef zeroext false) #5
  br i1 %70, label %71, label %88

71:                                               ; preds = %68
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %72 = invoke noalias noundef nonnull ptr @_Znwm(i64 noundef 32) #6
          to label %73 unwind label %104

73:                                               ; preds = %71
  call void @llvm.lifetime.start.p0(i64 24, ptr %13) #5
  %74 = load i32, ptr %8, align 4, !tbaa !9
  %75 = load i32, ptr %7, align 4, !tbaa !9
  call void @_ZN4juce11MidiMessage7noteOffEii(ptr dead_on_unwind writable sret(%"class.juce::MidiMessage") align 8 %13, i32 noundef %74, i32 noundef %75) #5
  invoke void @_ZN4juce19MidiMessageSequence15MidiEventHolderC1ERKNS_11MidiMessageE(ptr noundef nonnull align 8 dereferenceable(32) %72, ptr noundef nonnull align 8 dereferenceable(20) %13)
          to label %76 unwind label %104

76:                                               ; preds = %73
  call void @_ZN4juce11MidiMessageD1Ev(ptr noundef nonnull align 8 dereferenceable(20) %13) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %13) #5
  store ptr %72, ptr %12, align 8, !tbaa !5
  %77 = getelementptr inbounds %"class.juce::MidiMessageSequence", ptr %14, i32 0, i32 0
  %78 = load i32, ptr %10, align 4, !tbaa !9
  %79 = load ptr, ptr %12, align 8, !tbaa !5
  %80 = call noundef ptr @_ZN4juce10OwnedArrayINS_19MidiMessageSequence15MidiEventHolderENS_20DummyCriticalSectionEE6insertEiPS2_(ptr noundef nonnull align 8 dereferenceable(20) %77, i32 noundef %78, ptr noundef %79) #5
  %81 = load ptr, ptr %12, align 8, !tbaa !5
  %82 = getelementptr inbounds %"class.juce::MidiMessageSequence::MidiEventHolder", ptr %81, i32 0, i32 0
  %83 = load ptr, ptr %11, align 8, !tbaa !5
  %84 = call noundef double @_ZNK4juce11MidiMessage12getTimeStampEv(ptr noundef nonnull align 8 dereferenceable(20) %83) #5
  call void @_ZN4juce11MidiMessage12setTimeStampEd(ptr noundef nonnull align 8 dereferenceable(20) %82, double noundef %84) #5
  %85 = load ptr, ptr %12, align 8, !tbaa !5
  %86 = load ptr, ptr %5, align 8, !tbaa !5
  %87 = getelementptr inbounds %"class.juce::MidiMessageSequence::MidiEventHolder", ptr %86, i32 0, i32 1
  store ptr %85, ptr %87, align 8, !tbaa !11
  store i32 5, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  br label %91

88:                                               ; preds = %68
  br label %89

89:                                               ; preds = %88
  br label %90

90:                                               ; preds = %89, %54, %45
  store i32 0, ptr %4, align 4
  br label %91

91:                                               ; preds = %90, %76, %62
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  %92 = load i32, ptr %4, align 4
  switch i32 %92, label %97 [
    i32 0, label %93
  ]

93:                                               ; preds = %91
  br label %94

94:                                               ; preds = %93
  %95 = load i32, ptr %10, align 4, !tbaa !9
  %96 = add nsw i32 %95, 1
  store i32 %96, ptr %10, align 4, !tbaa !9
  br label %40, !llvm.loop !15

97:                                               ; preds = %91, %44
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %98

98:                                               ; preds = %97
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %99

99:                                               ; preds = %98, %21
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  br label %100

100:                                              ; preds = %99
  %101 = load i32, ptr %3, align 4, !tbaa !9
  %102 = add nsw i32 %101, 1
  store i32 %102, ptr %3, align 4, !tbaa !9
  br label %15, !llvm.loop !17

103:                                              ; preds = %20
  ret void

104:                                              ; preds = %73, %71
  %105 = landingpad { ptr, i32 }
          catch ptr null
  %106 = extractvalue { ptr, i32 } %105, 0
  call void @__clang_call_terminate(ptr %106) #7
  unreachable
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4juce11MidiMessage7noteOffEii(ptr dead_on_unwind noalias writable sret(%"class.juce::MidiMessage") align 8, i32 noundef, i32 noundef) #3 align 2

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

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

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

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

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

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

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

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

declare void @_ZN4juce11MidiMessageD1Ev(ptr)

declare void @_ZN4juce19MidiMessageSequence15MidiEventHolderC1ERKNS_11MidiMessageE(ptr, ptr)

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { noinline noreturn nounwind uwtable "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 = { nobuiltin allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
attributes #6 = { builtin allocsize(0) }
attributes #7 = { noreturn 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, !6, i64 24}
!12 = !{!"_ZTSN4juce19MidiMessageSequence15MidiEventHolderE", !13, i64 0, !6, i64 24}
!13 = !{!"_ZTSN4juce11MidiMessageE", !7, i64 0, !14, i64 8, !10, i64 16}
!14 = !{!"double", !7, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !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::MidiMessage" = type <{ %"union.juce::MidiMessage::PackedData", double, i32, [4 x i8] }>
%"union.juce::MidiMessage::PackedData" = type { ptr }

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

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: noinline noreturn nounwind uwtable
declare hidden void @__clang_call_terminate(ptr noundef) local_unnamed_addr #1

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN4juce19MidiMessageSequence18updateMatchedPairsEv(ptr noundef nonnull align 8 dereferenceable(24) %0) local_unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"class.juce::MidiMessage", align 8
  %3 = tail call noundef i32 @_ZNK4juce10OwnedArrayINS_19MidiMessageSequence15MidiEventHolderENS_20DummyCriticalSectionEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20) %0) #5
  %4 = icmp sgt i32 %3, 0
  br i1 %4, label %.lr.ph40, label %._crit_edge

._crit_edge:                                      ; preds = %.critedge, %1
  ret void

.lr.ph40:                                         ; preds = %1, %.critedge
  %.039 = phi i32 [ %.pre-phi, %.critedge ], [ 0, %1 ]
  %5 = call noundef ptr @_ZNK4juce10OwnedArrayINS_19MidiMessageSequence15MidiEventHolderENS_20DummyCriticalSectionEE12getUncheckedEi(ptr noundef nonnull align 8 dereferenceable(20) %0, i32 noundef %.039) #5
  %6 = call noundef zeroext i1 @_ZNK4juce11MidiMessage8isNoteOnEb(ptr noundef nonnull align 8 dereferenceable(20) %5, i1 noundef zeroext false) #5
  br i1 %6, label %7, label %.lr.ph40..critedge_crit_edge

.lr.ph40..critedge_crit_edge:                     ; preds = %.lr.ph40
  %.pre = add nuw nsw i32 %.039, 1
  br label %.critedge

7:                                                ; preds = %.lr.ph40
  %8 = getelementptr inbounds i8, ptr %5, i64 24
  store ptr null, ptr %8, align 8, !tbaa !5
  %9 = call noundef i32 @_ZNK4juce11MidiMessage13getNoteNumberEv(ptr noundef nonnull align 8 dereferenceable(20) %5) #5
  %10 = call noundef i32 @_ZNK4juce11MidiMessage10getChannelEv(ptr noundef nonnull align 8 dereferenceable(20) %5) #5
  %11 = call noundef i32 @_ZNK4juce10OwnedArrayINS_19MidiMessageSequence15MidiEventHolderENS_20DummyCriticalSectionEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20) %0) #5
  %.03137 = add nuw nsw i32 %.039, 1
  %12 = icmp slt i32 %.03137, %11
  br i1 %12, label %.lr.ph, label %.critedge

.lr.ph:                                           ; preds = %7, %31
  %.03138 = phi i32 [ %.031, %31 ], [ %.03137, %7 ]
  %13 = call noundef ptr @_ZNK4juce10OwnedArrayINS_19MidiMessageSequence15MidiEventHolderENS_20DummyCriticalSectionEE12getUncheckedEi(ptr noundef nonnull align 8 dereferenceable(20) %0, i32 noundef %.03138) #5
  %14 = call noundef i32 @_ZNK4juce11MidiMessage13getNoteNumberEv(ptr noundef nonnull align 8 dereferenceable(20) %13) #5
  %15 = icmp eq i32 %14, %9
  br i1 %15, label %16, label %31

16:                                               ; preds = %.lr.ph
  %17 = call noundef i32 @_ZNK4juce11MidiMessage10getChannelEv(ptr noundef nonnull align 8 dereferenceable(20) %13) #5
  %18 = icmp eq i32 %17, %10
  br i1 %18, label %19, label %31

19:                                               ; preds = %16
  %20 = call noundef zeroext i1 @_ZNK4juce11MidiMessage9isNoteOffEb(ptr noundef nonnull align 8 dereferenceable(20) %13, i1 noundef zeroext true) #5
  br i1 %20, label %21, label %23

21:                                               ; preds = %19
  %22 = call noundef ptr @_ZNK4juce10OwnedArrayINS_19MidiMessageSequence15MidiEventHolderENS_20DummyCriticalSectionEEixEi(ptr noundef nonnull align 8 dereferenceable(20) %0, i32 noundef %.03138) #5
  store ptr %22, ptr %8, align 8, !tbaa !5
  br label %.critedge

23:                                               ; preds = %19
  %24 = call noundef zeroext i1 @_ZNK4juce11MidiMessage8isNoteOnEb(ptr noundef nonnull align 8 dereferenceable(20) %13, i1 noundef zeroext false) #5
  br i1 %24, label %25, label %31

25:                                               ; preds = %23
  %26 = invoke noalias noundef nonnull dereferenceable(32) ptr @_Znwm(i64 noundef 32) #6
          to label %27 unwind label %34

27:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %2) #5
  call void @_ZN4juce11MidiMessage7noteOffEii(ptr dead_on_unwind nonnull writable sret(%"class.juce::MidiMessage") align 8 %2, i32 noundef %10, i32 noundef %9) #5
  invoke void @_ZN4juce19MidiMessageSequence15MidiEventHolderC1ERKNS_11MidiMessageE(ptr noundef nonnull align 8 dereferenceable(32) %26, ptr noundef nonnull align 8 dereferenceable(20) %2)
          to label %28 unwind label %34

28:                                               ; preds = %27
  call void @_ZN4juce11MidiMessageD1Ev(ptr noundef nonnull align 8 dereferenceable(20) %2) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #5
  %29 = call noundef ptr @_ZN4juce10OwnedArrayINS_19MidiMessageSequence15MidiEventHolderENS_20DummyCriticalSectionEE6insertEiPS2_(ptr noundef nonnull align 8 dereferenceable(20) %0, i32 noundef %.03138, ptr noundef nonnull %26) #5
  %30 = call noundef double @_ZNK4juce11MidiMessage12getTimeStampEv(ptr noundef nonnull align 8 dereferenceable(20) %13) #5
  call void @_ZN4juce11MidiMessage12setTimeStampEd(ptr noundef nonnull align 8 dereferenceable(20) %26, double noundef %30) #5
  store ptr %26, ptr %8, align 8, !tbaa !5
  br label %.critedge

31:                                               ; preds = %23, %16, %.lr.ph
  %.031 = add nuw i32 %.03138, 1
  %exitcond.not = icmp eq i32 %.031, %11
  br i1 %exitcond.not, label %.critedge, label %.lr.ph, !llvm.loop !13

.critedge:                                        ; preds = %31, %.lr.ph40..critedge_crit_edge, %7, %28, %21
  %.pre-phi = phi i32 [ %.pre, %.lr.ph40..critedge_crit_edge ], [ %.03137, %7 ], [ %.03137, %28 ], [ %.03137, %21 ], [ %.03137, %31 ]
  %32 = call noundef i32 @_ZNK4juce10OwnedArrayINS_19MidiMessageSequence15MidiEventHolderENS_20DummyCriticalSectionEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20) %0) #5
  %33 = icmp slt i32 %.pre-phi, %32
  br i1 %33, label %.lr.ph40, label %._crit_edge, !llvm.loop !15

34:                                               ; preds = %27, %25
  %35 = landingpad { ptr, i32 }
          catch ptr null
  %36 = extractvalue { ptr, i32 } %35, 0
  call void @__clang_call_terminate(ptr %36) #7
  unreachable
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4juce11MidiMessage7noteOffEii(ptr dead_on_unwind noalias writable sret(%"class.juce::MidiMessage") align 8, i32 noundef, i32 noundef) local_unnamed_addr #3 align 2

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

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

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

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

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

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

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

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

declare void @_ZN4juce11MidiMessageD1Ev(ptr) local_unnamed_addr

declare void @_ZN4juce19MidiMessageSequence15MidiEventHolderC1ERKNS_11MidiMessageE(ptr, ptr) local_unnamed_addr

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { noinline noreturn nounwind uwtable "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 = { nobuiltin allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
attributes #6 = { builtin allocsize(0) }
attributes #7 = { noreturn 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, !12, i64 24}
!6 = !{!"_ZTSN4juce19MidiMessageSequence15MidiEventHolderE", !7, i64 0, !12, i64 24}
!7 = !{!"_ZTSN4juce11MidiMessageE", !8, i64 0, !10, i64 8, !11, i64 16}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"double", !8, i64 0}
!11 = !{!"int", !8, i64 0}
!12 = !{!"any pointer", !8, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}


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