; 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::MPEInstrument" = type { ptr, %"class.juce::CriticalSection", %"class.juce::Array.61", %"class.juce::MPEZoneLayout", %"class.juce::ListenerList.66", [16 x i8], [16 x i8], [16 x i8], %"struct.juce::MPEInstrument::LegacyMode", %"struct.juce::MPEInstrument::MPEDimension", %"struct.juce::MPEInstrument::MPEDimension", %"struct.juce::MPEInstrument::MPEDimension" }
%"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::Array.61" = type { %"class.juce::ArrayAllocationBase.62", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.62" = type <{ %"class.juce::HeapBlock.63", i32, [4 x i8] }>
%"class.juce::HeapBlock.63" = type { ptr }
%"class.juce::MPEZoneLayout" = type { %"class.juce::Array.51", %"class.juce::MidiRPNDetector", %"class.juce::ListenerList" }
%"class.juce::Array.51" = type { %"class.juce::ArrayAllocationBase.52", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.52" = type <{ %"class.juce::HeapBlock.53", i32, [4 x i8] }>
%"class.juce::HeapBlock.53" = type { ptr }
%"class.juce::MidiRPNDetector" = type { [16 x %"struct.juce::MidiRPNDetector::ChannelState"] }
%"struct.juce::MidiRPNDetector::ChannelState" = type { i8, i8, i8, i8, i8 }
%"class.juce::ListenerList" = type { %"class.juce::Array.56" }
%"class.juce::Array.56" = type { %"class.juce::ArrayAllocationBase.57", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.57" = type <{ %"class.juce::HeapBlock.58", i32, [4 x i8] }>
%"class.juce::HeapBlock.58" = type { ptr }
%"class.juce::ListenerList.66" = type { %"class.juce::Array.67" }
%"class.juce::Array.67" = type { %"class.juce::ArrayAllocationBase.68", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.68" = type <{ %"class.juce::HeapBlock.69", i32, [4 x i8] }>
%"class.juce::HeapBlock.69" = type { ptr }
%"struct.juce::MPEInstrument::LegacyMode" = type { i8, %"class.juce::Range.50", i32 }
%"class.juce::Range.50" = type { i32, i32 }
%"struct.juce::MPEInstrument::MPEDimension" = type { i32, [16 x %"class.juce::MPEValue"], i64 }
%"class.juce::MPEValue" = type { i32 }
%"struct.juce::MPENote" = type <{ i16, i8, i8, %"class.juce::MPEValue", %"class.juce::MPEValue", %"class.juce::MPEValue", %"class.juce::MPEValue", %"class.juce::MPEValue", double, i32, [4 x i8] }>

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

; 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 i32 @_ZNK4juce7MPEZone19getFirstNoteChannelEv(ptr noundef nonnull align 4 dereferenceable(16)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK4juce7MPEZone18getLastNoteChannelEv(ptr noundef nonnull align 4 dereferenceable(16)) #1 align 2

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4juce12ListenerListINS_13MPEInstrument8ListenerENS_5ArrayIPS2_NS_20DummyCriticalSectionELi0EEEE4callINS_7MPENoteEEEvMS2_FvT_ENS_11TypeHelpers13ParameterTypeISA_E4typeE(ptr noundef nonnull align 8 dereferenceable(24), i64, i64, ptr noundef nonnull align 8 dereferenceable(36)) #3 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4juce13MPEInstrument24handleSustainOrSostenutoEibb(ptr noundef nonnull align 8 dereferenceable(528) %0, i32 noundef %1, i1 noundef zeroext %2, i1 noundef zeroext %3) #3 align 2 {
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i8, align 1
  %8 = alloca i8, align 1
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca { i64, i64 }, align 8
  %14 = alloca { i64, i64 }, align 8
  %15 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i32 %1, ptr %6, align 4, !tbaa !9
  %16 = zext i1 %2 to i8
  store i8 %16, ptr %7, align 1, !tbaa !11
  %17 = zext i1 %3 to i8
  store i8 %17, ptr %8, align 1, !tbaa !11
  %18 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %19 = getelementptr inbounds %"class.juce::MPEInstrument", ptr %18, i32 0, i32 3
  %20 = load i32, ptr %6, align 4, !tbaa !9
  %21 = call noundef ptr @_ZNK4juce13MPEZoneLayout22getZoneByMasterChannelEi(ptr noundef nonnull align 8 dereferenceable(128) %19, i32 noundef %20) #4
  store ptr %21, ptr %9, align 8, !tbaa !5
  %22 = getelementptr inbounds %"class.juce::MPEInstrument", ptr %18, i32 0, i32 8
  %23 = getelementptr inbounds %"struct.juce::MPEInstrument::LegacyMode", ptr %22, i32 0, i32 0
  %24 = load i8, ptr %23, align 8, !tbaa !13, !range !36, !noundef !37
  %25 = trunc i8 %24 to i1
  br i1 %25, label %26, label %31

26:                                               ; preds = %4
  %27 = getelementptr inbounds %"class.juce::MPEInstrument", ptr %18, i32 0, i32 8
  %28 = getelementptr inbounds %"struct.juce::MPEInstrument::LegacyMode", ptr %27, i32 0, i32 1
  %29 = load i32, ptr %6, align 4, !tbaa !9
  %30 = call noundef zeroext i1 @_ZNK4juce5RangeIiE8containsEi(ptr noundef nonnull align 4 dereferenceable(8) %28, i32 noundef %29) #4
  br i1 %30, label %35, label %34

31:                                               ; preds = %4
  %32 = load ptr, ptr %9, align 8, !tbaa !5
  %33 = icmp eq ptr %32, null
  br i1 %33, label %34, label %35

34:                                               ; preds = %31, %26
  store i32 1, ptr %10, align 4
  br label %164

35:                                               ; preds = %31, %26
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  %36 = getelementptr inbounds %"class.juce::MPEInstrument", ptr %18, i32 0, i32 2
  %37 = call noundef i32 @_ZNK4juce5ArrayINS_7MPENoteENS_20DummyCriticalSectionELi0EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20) %36) #4
  store i32 %37, ptr %11, align 4, !tbaa !9
  br label %38

38:                                               ; preds = %122, %35
  %39 = load i32, ptr %11, align 4, !tbaa !9
  %40 = add nsw i32 %39, -1
  store i32 %40, ptr %11, align 4, !tbaa !9
  %41 = icmp sge i32 %40, 0
  br i1 %41, label %43, label %42

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

43:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  %44 = getelementptr inbounds %"class.juce::MPEInstrument", ptr %18, i32 0, i32 2
  %45 = load i32, ptr %11, align 4, !tbaa !9
  %46 = call noundef nonnull align 8 dereferenceable(36) ptr @_ZNK4juce5ArrayINS_7MPENoteENS_20DummyCriticalSectionELi0EE12getReferenceEi(ptr noundef nonnull align 8 dereferenceable(20) %44, i32 noundef %45) #4
  store ptr %46, ptr %12, align 8, !tbaa !5
  %47 = getelementptr inbounds %"class.juce::MPEInstrument", ptr %18, i32 0, i32 8
  %48 = getelementptr inbounds %"struct.juce::MPEInstrument::LegacyMode", ptr %47, i32 0, i32 0
  %49 = load i8, ptr %48, align 8, !tbaa !13, !range !36, !noundef !37
  %50 = trunc i8 %49 to i1
  br i1 %50, label %51, label %58

51:                                               ; preds = %43
  %52 = load ptr, ptr %12, align 8, !tbaa !5
  %53 = getelementptr inbounds %"struct.juce::MPENote", ptr %52, i32 0, i32 1
  %54 = load i8, ptr %53, align 2, !tbaa !38
  %55 = zext i8 %54 to i32
  %56 = load i32, ptr %6, align 4, !tbaa !9
  %57 = icmp eq i32 %55, %56
  br i1 %57, label %65, label %122

58:                                               ; preds = %43
  %59 = load ptr, ptr %9, align 8, !tbaa !5
  %60 = load ptr, ptr %12, align 8, !tbaa !5
  %61 = getelementptr inbounds %"struct.juce::MPENote", ptr %60, i32 0, i32 1
  %62 = load i8, ptr %61, align 2, !tbaa !38
  %63 = zext i8 %62 to i32
  %64 = call noundef zeroext i1 @_ZNK4juce7MPEZone14isUsingChannelEi(ptr noundef nonnull align 4 dereferenceable(16) %59, i32 noundef %63) #4
  br i1 %64, label %65, label %122

65:                                               ; preds = %58, %51
  %66 = load ptr, ptr %12, align 8, !tbaa !5
  %67 = getelementptr inbounds %"struct.juce::MPENote", ptr %66, i32 0, i32 9
  %68 = load i32, ptr %67, align 8, !tbaa !44
  %69 = icmp eq i32 %68, 1
  br i1 %69, label %70, label %76

70:                                               ; preds = %65
  %71 = load i8, ptr %7, align 1, !tbaa !11, !range !36, !noundef !37
  %72 = trunc i8 %71 to i1
  br i1 %72, label %73, label %76

73:                                               ; preds = %70
  %74 = load ptr, ptr %12, align 8, !tbaa !5
  %75 = getelementptr inbounds %"struct.juce::MPENote", ptr %74, i32 0, i32 9
  store i32 3, ptr %75, align 8, !tbaa !44
  br label %100

76:                                               ; preds = %70, %65
  %77 = load ptr, ptr %12, align 8, !tbaa !5
  %78 = getelementptr inbounds %"struct.juce::MPENote", ptr %77, i32 0, i32 9
  %79 = load i32, ptr %78, align 8, !tbaa !44
  %80 = icmp eq i32 %79, 2
  br i1 %80, label %81, label %87

81:                                               ; preds = %76
  %82 = load i8, ptr %7, align 1, !tbaa !11, !range !36, !noundef !37
  %83 = trunc i8 %82 to i1
  br i1 %83, label %87, label %84

84:                                               ; preds = %81
  %85 = load ptr, ptr %12, align 8, !tbaa !5
  %86 = getelementptr inbounds %"struct.juce::MPENote", ptr %85, i32 0, i32 9
  store i32 0, ptr %86, align 8, !tbaa !44
  br label %99

87:                                               ; preds = %81, %76
  %88 = load ptr, ptr %12, align 8, !tbaa !5
  %89 = getelementptr inbounds %"struct.juce::MPENote", ptr %88, i32 0, i32 9
  %90 = load i32, ptr %89, align 8, !tbaa !44
  %91 = icmp eq i32 %90, 3
  br i1 %91, label %92, label %98

92:                                               ; preds = %87
  %93 = load i8, ptr %7, align 1, !tbaa !11, !range !36, !noundef !37
  %94 = trunc i8 %93 to i1
  br i1 %94, label %98, label %95

95:                                               ; preds = %92
  %96 = load ptr, ptr %12, align 8, !tbaa !5
  %97 = getelementptr inbounds %"struct.juce::MPENote", ptr %96, i32 0, i32 9
  store i32 1, ptr %97, align 8, !tbaa !44
  br label %98

98:                                               ; preds = %95, %92, %87
  br label %99

99:                                               ; preds = %98, %84
  br label %100

100:                                              ; preds = %99, %73
  %101 = load ptr, ptr %12, align 8, !tbaa !5
  %102 = getelementptr inbounds %"struct.juce::MPENote", ptr %101, i32 0, i32 9
  %103 = load i32, ptr %102, align 8, !tbaa !44
  %104 = icmp eq i32 %103, 0
  br i1 %104, label %105, label %114

105:                                              ; preds = %100
  %106 = getelementptr inbounds %"class.juce::MPEInstrument", ptr %18, i32 0, i32 4
  %107 = load ptr, ptr %12, align 8, !tbaa !5
  store { i64, i64 } { i64 57, i64 0 }, ptr %13, align 8, !tbaa !45
  %108 = getelementptr inbounds { i64, i64 }, ptr %13, i32 0, i32 0
  %109 = load i64, ptr %108, align 8
  %110 = getelementptr inbounds { i64, i64 }, ptr %13, i32 0, i32 1
  %111 = load i64, ptr %110, align 8
  call void @_ZN4juce12ListenerListINS_13MPEInstrument8ListenerENS_5ArrayIPS2_NS_20DummyCriticalSectionELi0EEEE4callINS_7MPENoteEEEvMS2_FvT_ENS_11TypeHelpers13ParameterTypeISA_E4typeE(ptr noundef nonnull align 8 dereferenceable(24) %106, i64 %109, i64 %111, ptr noundef nonnull align 8 dereferenceable(36) %107)
  %112 = getelementptr inbounds %"class.juce::MPEInstrument", ptr %18, i32 0, i32 2
  %113 = load i32, ptr %11, align 4, !tbaa !9
  call void @_ZN4juce5ArrayINS_7MPENoteENS_20DummyCriticalSectionELi0EE6removeEi(ptr noundef nonnull align 8 dereferenceable(20) %112, i32 noundef %113)
  br label %121

114:                                              ; preds = %100
  %115 = getelementptr inbounds %"class.juce::MPEInstrument", ptr %18, i32 0, i32 4
  %116 = load ptr, ptr %12, align 8, !tbaa !5
  store { i64, i64 } { i64 49, i64 0 }, ptr %14, align 8, !tbaa !45
  %117 = getelementptr inbounds { i64, i64 }, ptr %14, i32 0, i32 0
  %118 = load i64, ptr %117, align 8
  %119 = getelementptr inbounds { i64, i64 }, ptr %14, i32 0, i32 1
  %120 = load i64, ptr %119, align 8
  call void @_ZN4juce12ListenerListINS_13MPEInstrument8ListenerENS_5ArrayIPS2_NS_20DummyCriticalSectionELi0EEEE4callINS_7MPENoteEEEvMS2_FvT_ENS_11TypeHelpers13ParameterTypeISA_E4typeE(ptr noundef nonnull align 8 dereferenceable(24) %115, i64 %118, i64 %120, ptr noundef nonnull align 8 dereferenceable(36) %116)
  br label %121

121:                                              ; preds = %114, %105
  br label %122

122:                                              ; preds = %121, %58, %51
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  br label %38, !llvm.loop !46

123:                                              ; preds = %42
  %124 = load i8, ptr %8, align 1, !tbaa !11, !range !36, !noundef !37
  %125 = trunc i8 %124 to i1
  br i1 %125, label %163, label %126

126:                                              ; preds = %123
  %127 = getelementptr inbounds %"class.juce::MPEInstrument", ptr %18, i32 0, i32 8
  %128 = getelementptr inbounds %"struct.juce::MPEInstrument::LegacyMode", ptr %127, i32 0, i32 0
  %129 = load i8, ptr %128, align 8, !tbaa !13, !range !36, !noundef !37
  %130 = trunc i8 %129 to i1
  br i1 %130, label %131, label %140

131:                                              ; preds = %126
  %132 = load i8, ptr %7, align 1, !tbaa !11, !range !36, !noundef !37
  %133 = trunc i8 %132 to i1
  %134 = getelementptr inbounds %"class.juce::MPEInstrument", ptr %18, i32 0, i32 7
  %135 = load i32, ptr %6, align 4, !tbaa !9
  %136 = sub nsw i32 %135, 1
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds [16 x i8], ptr %134, i64 0, i64 %137
  %139 = zext i1 %133 to i8
  store i8 %139, ptr %138, align 1, !tbaa !11
  br label %162

140:                                              ; preds = %126
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  %141 = load ptr, ptr %9, align 8, !tbaa !5
  %142 = call noundef i32 @_ZNK4juce7MPEZone19getFirstNoteChannelEv(ptr noundef nonnull align 4 dereferenceable(16) %141) #4
  store i32 %142, ptr %15, align 4, !tbaa !9
  br label %143

143:                                              ; preds = %158, %140
  %144 = load i32, ptr %15, align 4, !tbaa !9
  %145 = load ptr, ptr %9, align 8, !tbaa !5
  %146 = call noundef i32 @_ZNK4juce7MPEZone18getLastNoteChannelEv(ptr noundef nonnull align 4 dereferenceable(16) %145) #4
  %147 = icmp sle i32 %144, %146
  br i1 %147, label %149, label %148

148:                                              ; preds = %143
  store i32 4, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  br label %161

149:                                              ; preds = %143
  %150 = load i8, ptr %7, align 1, !tbaa !11, !range !36, !noundef !37
  %151 = trunc i8 %150 to i1
  %152 = getelementptr inbounds %"class.juce::MPEInstrument", ptr %18, i32 0, i32 7
  %153 = load i32, ptr %15, align 4, !tbaa !9
  %154 = sub nsw i32 %153, 1
  %155 = sext i32 %154 to i64
  %156 = getelementptr inbounds [16 x i8], ptr %152, i64 0, i64 %155
  %157 = zext i1 %151 to i8
  store i8 %157, ptr %156, align 1, !tbaa !11
  br label %158

158:                                              ; preds = %149
  %159 = load i32, ptr %15, align 4, !tbaa !9
  %160 = add nsw i32 %159, 1
  store i32 %160, ptr %15, align 4, !tbaa !9
  br label %143, !llvm.loop !48

161:                                              ; preds = %148
  br label %162

162:                                              ; preds = %161, %131
  br label %163

163:                                              ; preds = %162, %123
  store i32 0, ptr %10, align 4
  br label %164

164:                                              ; preds = %163, %34
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  %165 = load i32, ptr %10, align 4
  switch i32 %165, label %167 [
    i32 0, label %166
    i32 1, label %166
  ]

166:                                              ; preds = %164, %164
  ret void

167:                                              ; preds = %164
  unreachable
}

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 = { 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 = !{!14, !12, i64 272}
!14 = !{!"_ZTSN4juce13MPEInstrumentE", !15, i64 8, !16, i64 48, !19, i64 72, !28, i64 200, !7, i64 224, !7, i64 240, !7, i64 256, !32, i64 272, !34, i64 288, !34, i64 368, !34, i64 448}
!15 = !{!"_ZTSN4juce15CriticalSectionE", !7, i64 0}
!16 = !{!"_ZTSN4juce5ArrayINS_7MPENoteENS_20DummyCriticalSectionELi0EEE", !17, i64 0, !10, i64 16}
!17 = !{!"_ZTSN4juce19ArrayAllocationBaseINS_7MPENoteENS_20DummyCriticalSectionEEE", !18, i64 0, !10, i64 8}
!18 = !{!"_ZTSN4juce9HeapBlockINS_7MPENoteELb0EEE", !6, i64 0}
!19 = !{!"_ZTSN4juce13MPEZoneLayoutE", !20, i64 0, !23, i64 24, !24, i64 104}
!20 = !{!"_ZTSN4juce5ArrayINS_7MPEZoneENS_20DummyCriticalSectionELi0EEE", !21, i64 0, !10, i64 16}
!21 = !{!"_ZTSN4juce19ArrayAllocationBaseINS_7MPEZoneENS_20DummyCriticalSectionEEE", !22, i64 0, !10, i64 8}
!22 = !{!"_ZTSN4juce9HeapBlockINS_7MPEZoneELb0EEE", !6, i64 0}
!23 = !{!"_ZTSN4juce15MidiRPNDetectorE", !7, i64 0}
!24 = !{!"_ZTSN4juce12ListenerListINS_13MPEZoneLayout8ListenerENS_5ArrayIPS2_NS_20DummyCriticalSectionELi0EEEEE", !25, i64 0}
!25 = !{!"_ZTSN4juce5ArrayIPNS_13MPEZoneLayout8ListenerENS_20DummyCriticalSectionELi0EEE", !26, i64 0, !10, i64 16}
!26 = !{!"_ZTSN4juce19ArrayAllocationBaseIPNS_13MPEZoneLayout8ListenerENS_20DummyCriticalSectionEEE", !27, i64 0, !10, i64 8}
!27 = !{!"_ZTSN4juce9HeapBlockIPNS_13MPEZoneLayout8ListenerELb0EEE", !6, i64 0}
!28 = !{!"_ZTSN4juce12ListenerListINS_13MPEInstrument8ListenerENS_5ArrayIPS2_NS_20DummyCriticalSectionELi0EEEEE", !29, i64 0}
!29 = !{!"_ZTSN4juce5ArrayIPNS_13MPEInstrument8ListenerENS_20DummyCriticalSectionELi0EEE", !30, i64 0, !10, i64 16}
!30 = !{!"_ZTSN4juce19ArrayAllocationBaseIPNS_13MPEInstrument8ListenerENS_20DummyCriticalSectionEEE", !31, i64 0, !10, i64 8}
!31 = !{!"_ZTSN4juce9HeapBlockIPNS_13MPEInstrument8ListenerELb0EEE", !6, i64 0}
!32 = !{!"_ZTSN4juce13MPEInstrument10LegacyModeE", !12, i64 0, !33, i64 4, !10, i64 12}
!33 = !{!"_ZTSN4juce5RangeIiEE", !10, i64 0, !10, i64 4}
!34 = !{!"_ZTSN4juce13MPEInstrument12MPEDimensionE", !35, i64 0, !7, i64 4, !7, i64 72}
!35 = !{!"_ZTSN4juce13MPEInstrument12TrackingModeE", !7, i64 0}
!36 = !{i8 0, i8 2}
!37 = !{}
!38 = !{!39, !7, i64 2}
!39 = !{!"_ZTSN4juce7MPENoteE", !40, i64 0, !7, i64 2, !7, i64 3, !41, i64 4, !41, i64 8, !41, i64 12, !41, i64 16, !41, i64 20, !42, i64 24, !43, i64 32}
!40 = !{!"short", !7, i64 0}
!41 = !{!"_ZTSN4juce8MPEValueE", !10, i64 0}
!42 = !{!"double", !7, i64 0}
!43 = !{!"_ZTSN4juce7MPENote8KeyStateE", !7, i64 0}
!44 = !{!39, !43, i64 32}
!45 = !{!7, !7, i64 0}
!46 = distinct !{!46, !47}
!47 = !{!"llvm.loop.mustprogress"}
!48 = distinct !{!48, !47}


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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK4juce7MPEZone19getFirstNoteChannelEv(ptr noundef nonnull align 4 dereferenceable(16)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK4juce7MPEZone18getLastNoteChannelEv(ptr noundef nonnull align 4 dereferenceable(16)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK4juce7MPEZone14isUsingChannelEi(ptr noundef nonnull align 4 dereferenceable(16), i32 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK4juce13MPEZoneLayout22getZoneByMasterChannelEi(ptr noundef nonnull align 8 dereferenceable(128), i32 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK4juce5RangeIiE8containsEi(ptr noundef nonnull align 4 dereferenceable(8), i32 noundef) local_unnamed_addr #0 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4juce12ListenerListINS_13MPEInstrument8ListenerENS_5ArrayIPS2_NS_20DummyCriticalSectionELi0EEEE4callINS_7MPENoteEEEvMS2_FvT_ENS_11TypeHelpers13ParameterTypeISA_E4typeE(ptr noundef nonnull align 8 dereferenceable(24), i64, i64, ptr noundef nonnull align 8 dereferenceable(36)) local_unnamed_addr #2 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4juce13MPEInstrument24handleSustainOrSostenutoEibb(ptr noundef nonnull align 8 dereferenceable(528) %0, i32 noundef %1, i1 noundef zeroext %2, i1 noundef zeroext %3) local_unnamed_addr #2 align 2 {
  %5 = zext i1 %2 to i8
  %6 = getelementptr inbounds i8, ptr %0, i64 72
  %7 = tail call noundef ptr @_ZNK4juce13MPEZoneLayout22getZoneByMasterChannelEi(ptr noundef nonnull align 8 dereferenceable(128) %6, i32 noundef %1) #3
  %8 = getelementptr inbounds i8, ptr %0, i64 272
  %9 = load i8, ptr %8, align 8, !tbaa !5, !range !33, !noundef !34
  %10 = trunc nuw i8 %9 to i1
  br i1 %10, label %11, label %14

11:                                               ; preds = %4
  %12 = getelementptr inbounds i8, ptr %0, i64 276
  %13 = tail call noundef zeroext i1 @_ZNK4juce5RangeIiE8containsEi(ptr noundef nonnull align 4 dereferenceable(8) %12, i32 noundef %1) #3
  br i1 %13, label %16, label %.loopexit

14:                                               ; preds = %4
  %15 = icmp eq ptr %7, null
  br i1 %15, label %.loopexit, label %16

16:                                               ; preds = %14, %11
  %17 = getelementptr inbounds i8, ptr %0, i64 48
  %18 = tail call noundef i32 @_ZNK4juce5ArrayINS_7MPENoteENS_20DummyCriticalSectionELi0EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20) %17) #3
  %19 = icmp sgt i32 %18, 0
  br i1 %19, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %16
  %20 = add nsw i32 %18, -1
  %21 = getelementptr inbounds i8, ptr %0, i64 200
  br i1 %2, label %.lr.ph.split, label %.lr.ph.split.us

.lr.ph.split.us:                                  ; preds = %.lr.ph, %38
  %22 = phi i32 [ %39, %38 ], [ %20, %.lr.ph ]
  %23 = tail call noundef nonnull align 8 dereferenceable(36) ptr @_ZNK4juce5ArrayINS_7MPENoteENS_20DummyCriticalSectionELi0EE12getReferenceEi(ptr noundef nonnull align 8 dereferenceable(20) %17, i32 noundef %22) #3
  %24 = load i8, ptr %8, align 8, !tbaa !5, !range !33, !noundef !34
  %25 = trunc nuw i8 %24 to i1
  %26 = getelementptr inbounds i8, ptr %23, i64 2
  %27 = load i8, ptr %26, align 2, !tbaa !35
  %28 = zext i8 %27 to i32
  br i1 %25, label %31, label %29

29:                                               ; preds = %.lr.ph.split.us
  %30 = tail call noundef zeroext i1 @_ZNK4juce7MPEZone14isUsingChannelEi(ptr noundef nonnull align 4 dereferenceable(16) %7, i32 noundef %28) #3
  br i1 %30, label %33, label %38

31:                                               ; preds = %.lr.ph.split.us
  %32 = icmp eq i32 %28, %1
  br i1 %32, label %33, label %38

33:                                               ; preds = %31, %29
  %34 = getelementptr inbounds i8, ptr %23, i64 32
  %35 = load i32, ptr %34, align 8, !tbaa !41
  switch i32 %35, label %.thread.us [
    i32 2, label %.thread41.us
    i32 3, label %36
    i32 0, label %37
  ]

.thread41.us:                                     ; preds = %33
  store i32 0, ptr %34, align 8, !tbaa !41
  br label %37

36:                                               ; preds = %33
  store i32 1, ptr %34, align 8, !tbaa !41
  br label %.thread.us

37:                                               ; preds = %33, %.thread41.us
  tail call void @_ZN4juce12ListenerListINS_13MPEInstrument8ListenerENS_5ArrayIPS2_NS_20DummyCriticalSectionELi0EEEE4callINS_7MPENoteEEEvMS2_FvT_ENS_11TypeHelpers13ParameterTypeISA_E4typeE(ptr noundef nonnull align 8 dereferenceable(24) %21, i64 57, i64 0, ptr noundef nonnull align 8 dereferenceable(36) %23)
  tail call void @_ZN4juce5ArrayINS_7MPENoteENS_20DummyCriticalSectionELi0EE6removeEi(ptr noundef nonnull align 8 dereferenceable(20) %17, i32 noundef %22)
  br label %38

.thread.us:                                       ; preds = %33, %36
  tail call void @_ZN4juce12ListenerListINS_13MPEInstrument8ListenerENS_5ArrayIPS2_NS_20DummyCriticalSectionELi0EEEE4callINS_7MPENoteEEEvMS2_FvT_ENS_11TypeHelpers13ParameterTypeISA_E4typeE(ptr noundef nonnull align 8 dereferenceable(24) %21, i64 49, i64 0, ptr noundef nonnull align 8 dereferenceable(36) %23)
  br label %38

38:                                               ; preds = %.thread.us, %37, %31, %29
  %39 = add nsw i32 %22, -1
  %40 = icmp sgt i32 %22, 0
  br i1 %40, label %.lr.ph.split.us, label %._crit_edge, !llvm.loop !42

._crit_edge:                                      ; preds = %38, %57, %16
  br i1 %3, label %.loopexit, label %60

.lr.ph.split:                                     ; preds = %.lr.ph, %57
  %41 = phi i32 [ %58, %57 ], [ %20, %.lr.ph ]
  %42 = tail call noundef nonnull align 8 dereferenceable(36) ptr @_ZNK4juce5ArrayINS_7MPENoteENS_20DummyCriticalSectionELi0EE12getReferenceEi(ptr noundef nonnull align 8 dereferenceable(20) %17, i32 noundef %41) #3
  %43 = load i8, ptr %8, align 8, !tbaa !5, !range !33, !noundef !34
  %44 = trunc nuw i8 %43 to i1
  %45 = getelementptr inbounds i8, ptr %42, i64 2
  %46 = load i8, ptr %45, align 2, !tbaa !35
  %47 = zext i8 %46 to i32
  br i1 %44, label %48, label %50

48:                                               ; preds = %.lr.ph.split
  %49 = icmp eq i32 %47, %1
  br i1 %49, label %52, label %57

50:                                               ; preds = %.lr.ph.split
  %51 = tail call noundef zeroext i1 @_ZNK4juce7MPEZone14isUsingChannelEi(ptr noundef nonnull align 4 dereferenceable(16) %7, i32 noundef %47) #3
  br i1 %51, label %52, label %57

52:                                               ; preds = %50, %48
  %53 = getelementptr inbounds i8, ptr %42, i64 32
  %54 = load i32, ptr %53, align 8, !tbaa !41
  switch i32 %54, label %.thread [
    i32 1, label %55
    i32 0, label %56
  ]

55:                                               ; preds = %52
  store i32 3, ptr %53, align 8, !tbaa !41
  br label %.thread

56:                                               ; preds = %52
  tail call void @_ZN4juce12ListenerListINS_13MPEInstrument8ListenerENS_5ArrayIPS2_NS_20DummyCriticalSectionELi0EEEE4callINS_7MPENoteEEEvMS2_FvT_ENS_11TypeHelpers13ParameterTypeISA_E4typeE(ptr noundef nonnull align 8 dereferenceable(24) %21, i64 57, i64 0, ptr noundef nonnull align 8 dereferenceable(36) %42)
  tail call void @_ZN4juce5ArrayINS_7MPENoteENS_20DummyCriticalSectionELi0EE6removeEi(ptr noundef nonnull align 8 dereferenceable(20) %17, i32 noundef %41)
  br label %57

.thread:                                          ; preds = %52, %55
  tail call void @_ZN4juce12ListenerListINS_13MPEInstrument8ListenerENS_5ArrayIPS2_NS_20DummyCriticalSectionELi0EEEE4callINS_7MPENoteEEEvMS2_FvT_ENS_11TypeHelpers13ParameterTypeISA_E4typeE(ptr noundef nonnull align 8 dereferenceable(24) %21, i64 49, i64 0, ptr noundef nonnull align 8 dereferenceable(36) %42)
  br label %57

57:                                               ; preds = %56, %.thread, %50, %48
  %58 = add nsw i32 %41, -1
  %59 = icmp sgt i32 %41, 0
  br i1 %59, label %.lr.ph.split, label %._crit_edge, !llvm.loop !42

60:                                               ; preds = %._crit_edge
  %61 = load i8, ptr %8, align 8, !tbaa !5, !range !33, !noundef !34
  %62 = trunc nuw i8 %61 to i1
  br i1 %62, label %63, label %68

63:                                               ; preds = %60
  %64 = getelementptr inbounds i8, ptr %0, i64 256
  %65 = add nsw i32 %1, -1
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [16 x i8], ptr %64, i64 0, i64 %66
  store i8 %5, ptr %67, align 1, !tbaa !44
  br label %.loopexit

68:                                               ; preds = %60
  %69 = tail call noundef i32 @_ZNK4juce7MPEZone19getFirstNoteChannelEv(ptr noundef nonnull align 4 dereferenceable(16) %7) #3
  %70 = tail call noundef i32 @_ZNK4juce7MPEZone18getLastNoteChannelEv(ptr noundef nonnull align 4 dereferenceable(16) %7) #3
  %.not43 = icmp sgt i32 %69, %70
  br i1 %.not43, label %.loopexit, label %.lr.ph46

.lr.ph46:                                         ; preds = %68
  %71 = getelementptr inbounds i8, ptr %0, i64 256
  %72 = sext i32 %69 to i64
  br label %73

73:                                               ; preds = %.lr.ph46, %73
  %indvars.iv = phi i64 [ %72, %.lr.ph46 ], [ %indvars.iv.next, %73 ]
  %74 = add nsw i64 %indvars.iv, -1
  %75 = getelementptr inbounds [16 x i8], ptr %71, i64 0, i64 %74
  store i8 %5, ptr %75, align 1, !tbaa !44
  %indvars.iv.next = add nsw i64 %indvars.iv, 1
  %76 = tail call noundef i32 @_ZNK4juce7MPEZone18getLastNoteChannelEv(ptr noundef nonnull align 4 dereferenceable(16) %7) #3
  %77 = sext i32 %76 to i64
  %.not.not = icmp slt i64 %indvars.iv, %77
  br i1 %.not.not, label %73, label %.loopexit, !llvm.loop !45

.loopexit:                                        ; preds = %73, %68, %._crit_edge, %63, %11, %14
  ret void
}

attributes #0 = { 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 #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 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 = { 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, !29, i64 272}
!6 = !{!"_ZTSN4juce13MPEInstrumentE", !7, i64 8, !10, i64 48, !15, i64 72, !24, i64 200, !8, i64 224, !8, i64 240, !8, i64 256, !28, i64 272, !31, i64 288, !31, i64 368, !31, i64 448}
!7 = !{!"_ZTSN4juce15CriticalSectionE", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSN4juce5ArrayINS_7MPENoteENS_20DummyCriticalSectionELi0EEE", !11, i64 0, !14, i64 16}
!11 = !{!"_ZTSN4juce19ArrayAllocationBaseINS_7MPENoteENS_20DummyCriticalSectionEEE", !12, i64 0, !14, i64 8}
!12 = !{!"_ZTSN4juce9HeapBlockINS_7MPENoteELb0EEE", !13, i64 0}
!13 = !{!"any pointer", !8, i64 0}
!14 = !{!"int", !8, i64 0}
!15 = !{!"_ZTSN4juce13MPEZoneLayoutE", !16, i64 0, !19, i64 24, !20, i64 104}
!16 = !{!"_ZTSN4juce5ArrayINS_7MPEZoneENS_20DummyCriticalSectionELi0EEE", !17, i64 0, !14, i64 16}
!17 = !{!"_ZTSN4juce19ArrayAllocationBaseINS_7MPEZoneENS_20DummyCriticalSectionEEE", !18, i64 0, !14, i64 8}
!18 = !{!"_ZTSN4juce9HeapBlockINS_7MPEZoneELb0EEE", !13, i64 0}
!19 = !{!"_ZTSN4juce15MidiRPNDetectorE", !8, i64 0}
!20 = !{!"_ZTSN4juce12ListenerListINS_13MPEZoneLayout8ListenerENS_5ArrayIPS2_NS_20DummyCriticalSectionELi0EEEEE", !21, i64 0}
!21 = !{!"_ZTSN4juce5ArrayIPNS_13MPEZoneLayout8ListenerENS_20DummyCriticalSectionELi0EEE", !22, i64 0, !14, i64 16}
!22 = !{!"_ZTSN4juce19ArrayAllocationBaseIPNS_13MPEZoneLayout8ListenerENS_20DummyCriticalSectionEEE", !23, i64 0, !14, i64 8}
!23 = !{!"_ZTSN4juce9HeapBlockIPNS_13MPEZoneLayout8ListenerELb0EEE", !13, i64 0}
!24 = !{!"_ZTSN4juce12ListenerListINS_13MPEInstrument8ListenerENS_5ArrayIPS2_NS_20DummyCriticalSectionELi0EEEEE", !25, i64 0}
!25 = !{!"_ZTSN4juce5ArrayIPNS_13MPEInstrument8ListenerENS_20DummyCriticalSectionELi0EEE", !26, i64 0, !14, i64 16}
!26 = !{!"_ZTSN4juce19ArrayAllocationBaseIPNS_13MPEInstrument8ListenerENS_20DummyCriticalSectionEEE", !27, i64 0, !14, i64 8}
!27 = !{!"_ZTSN4juce9HeapBlockIPNS_13MPEInstrument8ListenerELb0EEE", !13, i64 0}
!28 = !{!"_ZTSN4juce13MPEInstrument10LegacyModeE", !29, i64 0, !30, i64 4, !14, i64 12}
!29 = !{!"bool", !8, i64 0}
!30 = !{!"_ZTSN4juce5RangeIiEE", !14, i64 0, !14, i64 4}
!31 = !{!"_ZTSN4juce13MPEInstrument12MPEDimensionE", !32, i64 0, !8, i64 4, !8, i64 72}
!32 = !{!"_ZTSN4juce13MPEInstrument12TrackingModeE", !8, i64 0}
!33 = !{i8 0, i8 2}
!34 = !{}
!35 = !{!36, !8, i64 2}
!36 = !{!"_ZTSN4juce7MPENoteE", !37, i64 0, !8, i64 2, !8, i64 3, !38, i64 4, !38, i64 8, !38, i64 12, !38, i64 16, !38, i64 20, !39, i64 24, !40, i64 32}
!37 = !{!"short", !8, i64 0}
!38 = !{!"_ZTSN4juce8MPEValueE", !14, i64 0}
!39 = !{!"double", !8, i64 0}
!40 = !{!"_ZTSN4juce7MPENote8KeyStateE", !8, i64 0}
!41 = !{!36, !40, i64 32}
!42 = distinct !{!42, !43}
!43 = !{!"llvm.loop.mustprogress"}
!44 = !{!29, !29, i64 0}
!45 = distinct !{!45, !43}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass