; 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: mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK4juce11MidiMessage12getTimeStampEv(ptr noundef nonnull align 8 dereferenceable(20)) #1 align 2

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4juce19MidiMessageSequence30createControllerUpdatesForTimeEidRNS_5ArrayINS_11MidiMessageENS_20DummyCriticalSectionELi0EEE(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %1, double noundef %2, ptr noundef nonnull align 8 dereferenceable(20) %3) #3 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca double, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i8, align 1
  %10 = alloca i8, align 1
  %11 = alloca [128 x i8], align 16
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca %"class.juce::MidiMessage", align 8
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca %"class.juce::MidiMessage", align 8
  %18 = alloca i32, align 4
  %19 = alloca %"class.juce::MidiMessage", align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i32 %1, ptr %6, align 4, !tbaa !9
  store double %2, ptr %7, align 8, !tbaa !11
  store ptr %3, ptr %8, align 8, !tbaa !5
  %20 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #5
  store i8 0, ptr %9, align 1, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 1, ptr %10) #5
  store i8 0, ptr %10, align 1, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 128, ptr %11) #5
  call void @llvm.memset.p0.i64(ptr align 16 %11, i8 0, i64 128, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  %21 = getelementptr inbounds %"class.juce::MidiMessageSequence", ptr %20, i32 0, i32 0
  %22 = call noundef i32 @_ZNK4juce10OwnedArrayINS_19MidiMessageSequence15MidiEventHolderENS_20DummyCriticalSectionEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20) %21) #5
  store i32 %22, ptr %12, align 4, !tbaa !9
  br label %23

23:                                               ; preds = %98, %4
  %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) #5
  br label %100

28:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %29 = getelementptr inbounds %"class.juce::MidiMessageSequence", ptr %20, i32 0, i32 0
  %30 = load i32, ptr %12, align 4, !tbaa !9
  %31 = call noundef ptr @_ZNK4juce10OwnedArrayINS_19MidiMessageSequence15MidiEventHolderENS_20DummyCriticalSectionEE12getUncheckedEi(ptr noundef nonnull align 8 dereferenceable(20) %29, i32 noundef %30) #5
  %32 = getelementptr inbounds %"class.juce::MidiMessageSequence::MidiEventHolder", ptr %31, i32 0, i32 0
  store ptr %32, ptr %13, align 8, !tbaa !5
  %33 = load ptr, ptr %13, align 8, !tbaa !5
  %34 = load i32, ptr %6, align 4, !tbaa !9
  %35 = call noundef zeroext i1 @_ZNK4juce11MidiMessage12isForChannelEi(ptr noundef nonnull align 8 dereferenceable(20) %33, i32 noundef %34) #5
  br i1 %35, label %36, label %98

36:                                               ; preds = %28
  %37 = load ptr, ptr %13, align 8, !tbaa !5
  %38 = call noundef double @_ZNK4juce11MidiMessage12getTimeStampEv(ptr noundef nonnull align 8 dereferenceable(20) %37) #5
  %39 = load double, ptr %7, align 8, !tbaa !11
  %40 = fcmp ole double %38, %39
  br i1 %40, label %41, label %98

41:                                               ; preds = %36
  %42 = load ptr, ptr %13, align 8, !tbaa !5
  %43 = call noundef zeroext i1 @_ZNK4juce11MidiMessage15isProgramChangeEv(ptr noundef nonnull align 8 dereferenceable(20) %42) #5
  br i1 %43, label %44, label %55

44:                                               ; preds = %41
  %45 = load i8, ptr %9, align 1, !tbaa !13, !range !15, !noundef !16
  %46 = trunc i8 %45 to i1
  br i1 %46, label %55, label %47

47:                                               ; preds = %44
  store i8 1, ptr %9, align 1, !tbaa !13
  %48 = load ptr, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %14) #5
  %49 = load ptr, ptr %13, align 8, !tbaa !5
  call void @_ZN4juce11MidiMessageC1ERKS0_d(ptr noundef nonnull align 8 dereferenceable(20) %14, ptr noundef nonnull align 8 dereferenceable(20) %49, double noundef 0.000000e+00)
  invoke void @_ZN4juce5ArrayINS_11MidiMessageENS_20DummyCriticalSectionELi0EE3addEOS1_(ptr noundef nonnull align 8 dereferenceable(20) %48, ptr noundef nonnull align 8 dereferenceable(20) %14)
          to label %50 unwind label %51

50:                                               ; preds = %47
  call void @_ZN4juce11MidiMessageD1Ev(ptr noundef nonnull align 8 dereferenceable(20) %14) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %14) #5
  br label %97

51:                                               ; preds = %47
  %52 = landingpad { ptr, i32 }
          cleanup
  %53 = extractvalue { ptr, i32 } %52, 0
  store ptr %53, ptr %15, align 8
  %54 = extractvalue { ptr, i32 } %52, 1
  store i32 %54, ptr %16, align 4
  call void @_ZN4juce11MidiMessageD1Ev(ptr noundef nonnull align 8 dereferenceable(20) %14) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %14) #5
  br label %99

55:                                               ; preds = %44, %41
  %56 = load ptr, ptr %13, align 8, !tbaa !5
  %57 = call noundef zeroext i1 @_ZNK4juce11MidiMessage12isPitchWheelEv(ptr noundef nonnull align 8 dereferenceable(20) %56) #5
  br i1 %57, label %58, label %69

58:                                               ; preds = %55
  %59 = load i8, ptr %10, align 1, !tbaa !13, !range !15, !noundef !16
  %60 = trunc i8 %59 to i1
  br i1 %60, label %69, label %61

61:                                               ; preds = %58
  store i8 1, ptr %10, align 1, !tbaa !13
  %62 = load ptr, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %17) #5
  %63 = load ptr, ptr %13, align 8, !tbaa !5
  call void @_ZN4juce11MidiMessageC1ERKS0_d(ptr noundef nonnull align 8 dereferenceable(20) %17, ptr noundef nonnull align 8 dereferenceable(20) %63, double noundef 0.000000e+00)
  invoke void @_ZN4juce5ArrayINS_11MidiMessageENS_20DummyCriticalSectionELi0EE3addEOS1_(ptr noundef nonnull align 8 dereferenceable(20) %62, ptr noundef nonnull align 8 dereferenceable(20) %17)
          to label %64 unwind label %65

64:                                               ; preds = %61
  call void @_ZN4juce11MidiMessageD1Ev(ptr noundef nonnull align 8 dereferenceable(20) %17) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %17) #5
  br label %96

65:                                               ; preds = %61
  %66 = landingpad { ptr, i32 }
          cleanup
  %67 = extractvalue { ptr, i32 } %66, 0
  store ptr %67, ptr %15, align 8
  %68 = extractvalue { ptr, i32 } %66, 1
  store i32 %68, ptr %16, align 4
  call void @_ZN4juce11MidiMessageD1Ev(ptr noundef nonnull align 8 dereferenceable(20) %17) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %17) #5
  br label %99

69:                                               ; preds = %58, %55
  %70 = load ptr, ptr %13, align 8, !tbaa !5
  %71 = call noundef zeroext i1 @_ZNK4juce11MidiMessage12isControllerEv(ptr noundef nonnull align 8 dereferenceable(20) %70) #5
  br i1 %71, label %72, label %95

72:                                               ; preds = %69
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #5
  %73 = load ptr, ptr %13, align 8, !tbaa !5
  %74 = call noundef i32 @_ZNK4juce11MidiMessage19getControllerNumberEv(ptr noundef nonnull align 8 dereferenceable(20) %73) #5
  store i32 %74, ptr %18, align 4, !tbaa !9
  br label %75

75:                                               ; preds = %72
  br label %76

76:                                               ; preds = %75
  br label %77

77:                                               ; preds = %76
  %78 = load i32, ptr %18, align 4, !tbaa !9
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [128 x i8], ptr %11, i64 0, i64 %79
  %81 = load i8, ptr %80, align 1, !tbaa !13, !range !15, !noundef !16
  %82 = trunc i8 %81 to i1
  br i1 %82, label %94, label %83

83:                                               ; preds = %77
  %84 = load i32, ptr %18, align 4, !tbaa !9
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [128 x i8], ptr %11, i64 0, i64 %85
  store i8 1, ptr %86, align 1, !tbaa !13
  %87 = load ptr, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %19) #5
  %88 = load ptr, ptr %13, align 8, !tbaa !5
  call void @_ZN4juce11MidiMessageC1ERKS0_d(ptr noundef nonnull align 8 dereferenceable(20) %19, ptr noundef nonnull align 8 dereferenceable(20) %88, double noundef 0.000000e+00)
  invoke void @_ZN4juce5ArrayINS_11MidiMessageENS_20DummyCriticalSectionELi0EE3addEOS1_(ptr noundef nonnull align 8 dereferenceable(20) %87, ptr noundef nonnull align 8 dereferenceable(20) %19)
          to label %89 unwind label %90

89:                                               ; preds = %83
  call void @_ZN4juce11MidiMessageD1Ev(ptr noundef nonnull align 8 dereferenceable(20) %19) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %19) #5
  br label %94

90:                                               ; preds = %83
  %91 = landingpad { ptr, i32 }
          cleanup
  %92 = extractvalue { ptr, i32 } %91, 0
  store ptr %92, ptr %15, align 8
  %93 = extractvalue { ptr, i32 } %91, 1
  store i32 %93, ptr %16, align 4
  call void @_ZN4juce11MidiMessageD1Ev(ptr noundef nonnull align 8 dereferenceable(20) %19) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  br label %99

94:                                               ; preds = %89, %77
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  br label %95

95:                                               ; preds = %94, %69
  br label %96

96:                                               ; preds = %95, %64
  br label %97

97:                                               ; preds = %96, %50
  br label %98

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

99:                                               ; preds = %90, %65, %51
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 128, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #5
  br label %101

100:                                              ; preds = %27
  call void @llvm.lifetime.end.p0(i64 128, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #5
  ret void

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

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

declare void @_ZN4juce11MidiMessageC1ERKS0_d(ptr, ptr, double)

declare void @_ZN4juce11MidiMessageD1Ev(ptr)

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = !{i8 0, i8 2}
!16 = !{}
!17 = distinct !{!17, !18}
!18 = !{!"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::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: mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK4juce11MidiMessage12getTimeStampEv(ptr noundef nonnull align 8 dereferenceable(20)) local_unnamed_addr #1 align 2

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4juce19MidiMessageSequence30createControllerUpdatesForTimeEidRNS_5ArrayINS_11MidiMessageENS_20DummyCriticalSectionELi0EEE(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %1, double noundef %2, ptr noundef nonnull align 8 dereferenceable(20) %3) local_unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca [128 x i8], align 16
  %6 = alloca %"class.juce::MidiMessage", align 8
  %7 = alloca %"class.juce::MidiMessage", align 8
  %8 = alloca %"class.juce::MidiMessage", align 8
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %5) #5
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(128) %5, i8 0, i64 128, i1 false)
  %9 = tail call noundef i32 @_ZNK4juce10OwnedArrayINS_19MidiMessageSequence15MidiEventHolderENS_20DummyCriticalSectionEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20) %0) #5
  %10 = icmp sgt i32 %9, 0
  br i1 %10, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %41, %4
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %5) #5
  ret void

.lr.ph:                                           ; preds = %4, %41
  %.in = phi i32 [ %11, %41 ], [ %9, %4 ]
  %.032 = phi i1 [ %.1, %41 ], [ false, %4 ]
  %.02431 = phi i1 [ %.125, %41 ], [ false, %4 ]
  %11 = add nsw i32 %.in, -1
  %12 = call noundef ptr @_ZNK4juce10OwnedArrayINS_19MidiMessageSequence15MidiEventHolderENS_20DummyCriticalSectionEE12getUncheckedEi(ptr noundef nonnull align 8 dereferenceable(20) %0, i32 noundef %11) #5
  %13 = call noundef zeroext i1 @_ZNK4juce11MidiMessage12isForChannelEi(ptr noundef nonnull align 8 dereferenceable(20) %12, i32 noundef %1) #5
  br i1 %13, label %14, label %41

14:                                               ; preds = %.lr.ph
  %15 = call noundef double @_ZNK4juce11MidiMessage12getTimeStampEv(ptr noundef nonnull align 8 dereferenceable(20) %12) #5
  %16 = fcmp ugt double %15, %2
  br i1 %16, label %41, label %17

17:                                               ; preds = %14
  %18 = call noundef zeroext i1 @_ZNK4juce11MidiMessage15isProgramChangeEv(ptr noundef nonnull align 8 dereferenceable(20) %12) #5
  %.not = xor i1 %18, true
  %brmerge = select i1 %.not, i1 true, i1 %.032
  br i1 %brmerge, label %23, label %19

19:                                               ; preds = %17
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #5
  call void @_ZN4juce11MidiMessageC1ERKS0_d(ptr noundef nonnull align 8 dereferenceable(20) %6, ptr noundef nonnull align 8 dereferenceable(20) %12, double noundef 0.000000e+00)
  invoke void @_ZN4juce5ArrayINS_11MidiMessageENS_20DummyCriticalSectionELi0EE3addEOS1_(ptr noundef nonnull align 8 dereferenceable(20) %3, ptr noundef nonnull align 8 dereferenceable(20) %6)
          to label %20 unwind label %21

20:                                               ; preds = %19
  call void @_ZN4juce11MidiMessageD1Ev(ptr noundef nonnull align 8 dereferenceable(20) %6) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #5
  br label %41

21:                                               ; preds = %19
  %22 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN4juce11MidiMessageD1Ev(ptr noundef nonnull align 8 dereferenceable(20) %6) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #5
  br label %43

23:                                               ; preds = %17
  %24 = call noundef zeroext i1 @_ZNK4juce11MidiMessage12isPitchWheelEv(ptr noundef nonnull align 8 dereferenceable(20) %12) #5
  %.not29 = xor i1 %24, true
  %brmerge30 = select i1 %.not29, i1 true, i1 %.02431
  br i1 %brmerge30, label %29, label %25

25:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #5
  call void @_ZN4juce11MidiMessageC1ERKS0_d(ptr noundef nonnull align 8 dereferenceable(20) %7, ptr noundef nonnull align 8 dereferenceable(20) %12, double noundef 0.000000e+00)
  invoke void @_ZN4juce5ArrayINS_11MidiMessageENS_20DummyCriticalSectionELi0EE3addEOS1_(ptr noundef nonnull align 8 dereferenceable(20) %3, ptr noundef nonnull align 8 dereferenceable(20) %7)
          to label %26 unwind label %27

26:                                               ; preds = %25
  call void @_ZN4juce11MidiMessageD1Ev(ptr noundef nonnull align 8 dereferenceable(20) %7) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #5
  br label %41

27:                                               ; preds = %25
  %28 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN4juce11MidiMessageD1Ev(ptr noundef nonnull align 8 dereferenceable(20) %7) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #5
  br label %43

29:                                               ; preds = %23
  %30 = call noundef zeroext i1 @_ZNK4juce11MidiMessage12isControllerEv(ptr noundef nonnull align 8 dereferenceable(20) %12) #5
  br i1 %30, label %31, label %41

31:                                               ; preds = %29
  %32 = call noundef i32 @_ZNK4juce11MidiMessage19getControllerNumberEv(ptr noundef nonnull align 8 dereferenceable(20) %12) #5
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [128 x i8], ptr %5, i64 0, i64 %33
  %35 = load i8, ptr %34, align 1, !tbaa !5, !range !9, !noundef !10
  %36 = trunc nuw i8 %35 to i1
  br i1 %36, label %41, label %37

37:                                               ; preds = %31
  store i8 1, ptr %34, align 1, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #5
  call void @_ZN4juce11MidiMessageC1ERKS0_d(ptr noundef nonnull align 8 dereferenceable(20) %8, ptr noundef nonnull align 8 dereferenceable(20) %12, double noundef 0.000000e+00)
  invoke void @_ZN4juce5ArrayINS_11MidiMessageENS_20DummyCriticalSectionELi0EE3addEOS1_(ptr noundef nonnull align 8 dereferenceable(20) %3, ptr noundef nonnull align 8 dereferenceable(20) %8)
          to label %38 unwind label %39

38:                                               ; preds = %37
  call void @_ZN4juce11MidiMessageD1Ev(ptr noundef nonnull align 8 dereferenceable(20) %8) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #5
  br label %41

39:                                               ; preds = %37
  %40 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN4juce11MidiMessageD1Ev(ptr noundef nonnull align 8 dereferenceable(20) %8) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #5
  br label %43

41:                                               ; preds = %31, %38, %20, %29, %26, %14, %.lr.ph
  %.125 = phi i1 [ %.02431, %29 ], [ true, %26 ], [ %.02431, %20 ], [ %.02431, %14 ], [ %.02431, %.lr.ph ], [ %.02431, %38 ], [ %.02431, %31 ]
  %.1 = phi i1 [ %.032, %29 ], [ %.032, %26 ], [ true, %20 ], [ %.032, %14 ], [ %.032, %.lr.ph ], [ %.032, %38 ], [ %.032, %31 ]
  %42 = icmp ugt i32 %.in, 1
  br i1 %42, label %.lr.ph, label %._crit_edge, !llvm.loop !11

43:                                               ; preds = %39, %27, %21
  %.pn = phi { ptr, i32 } [ %40, %39 ], [ %28, %27 ], [ %22, %21 ]
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %5) #5
  resume { ptr, i32 } %.pn
}

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

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

declare void @_ZN4juce11MidiMessageC1ERKS0_d(ptr, ptr, double) local_unnamed_addr

declare void @_ZN4juce11MidiMessageD1Ev(ptr) local_unnamed_addr

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"bool", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{i8 0, i8 2}
!10 = !{}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}


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