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

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

; 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: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN4juce11MidiMessage29getMessageLengthFromFirstByteEh(i8 noundef zeroext) #2 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4juce11MidiMessageC2EPKviRihdb(ptr noundef nonnull align 8 dereferenceable(20) %0, ptr noundef %1, i32 noundef %2, ptr noundef nonnull align 4 dereferenceable(4) %3, i8 noundef zeroext %4, double noundef %5, i1 noundef zeroext %6) unnamed_addr #3 align 2 {
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca i8, align 1
  %13 = alloca double, align 8
  %14 = alloca i8, align 1
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca ptr, align 8
  %18 = alloca i8, align 1
  %19 = alloca i32, align 4
  %20 = alloca ptr, align 8
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca ptr, align 8
  store ptr %0, ptr %8, align 8, !tbaa !5
  store ptr %1, ptr %9, align 8, !tbaa !5
  store i32 %2, ptr %10, align 4, !tbaa !9
  store ptr %3, ptr %11, align 8, !tbaa !5
  store i8 %4, ptr %12, align 1, !tbaa !11
  store double %5, ptr %13, align 8, !tbaa !12
  %24 = zext i1 %6 to i8
  store i8 %24, ptr %14, align 1, !tbaa !14
  %25 = load ptr, ptr %8, align 8
  %26 = getelementptr inbounds %"class.juce::MidiMessage", ptr %25, i32 0, i32 0
  %27 = getelementptr inbounds %"class.juce::MidiMessage", ptr %25, i32 0, i32 1
  %28 = load double, ptr %13, align 8, !tbaa !12
  store double %28, ptr %27, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  %29 = load ptr, ptr %9, align 8, !tbaa !5
  store ptr %29, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  %30 = load ptr, ptr %15, align 8, !tbaa !5
  %31 = load i8, ptr %30, align 1, !tbaa !11
  %32 = zext i8 %31 to i32
  store i32 %32, ptr %16, align 4, !tbaa !9
  %33 = load i32, ptr %16, align 4, !tbaa !9
  %34 = icmp ult i32 %33, 128
  br i1 %34, label %35, label %39

35:                                               ; preds = %7
  %36 = load i8, ptr %12, align 1, !tbaa !11
  %37 = zext i8 %36 to i32
  store i32 %37, ptr %16, align 4, !tbaa !9
  %38 = load ptr, ptr %11, align 8, !tbaa !5
  store i32 -1, ptr %38, align 4, !tbaa !9
  br label %45

39:                                               ; preds = %7
  %40 = load ptr, ptr %11, align 8, !tbaa !5
  store i32 0, ptr %40, align 4, !tbaa !9
  %41 = load i32, ptr %10, align 4, !tbaa !9
  %42 = add nsw i32 %41, -1
  store i32 %42, ptr %10, align 4, !tbaa !9
  %43 = load ptr, ptr %15, align 8, !tbaa !5
  %44 = getelementptr inbounds i8, ptr %43, i32 1
  store ptr %44, ptr %15, align 8, !tbaa !5
  br label %45

45:                                               ; preds = %39, %35
  %46 = load i32, ptr %16, align 4, !tbaa !9
  %47 = icmp uge i32 %46, 128
  br i1 %47, label %48, label %188

48:                                               ; preds = %45
  %49 = load i32, ptr %16, align 4, !tbaa !9
  %50 = icmp eq i32 %49, 240
  br i1 %50, label %51, label %124

51:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  %52 = load ptr, ptr %15, align 8, !tbaa !5
  store ptr %52, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %18) #4
  %53 = load i8, ptr %14, align 1, !tbaa !14, !range !18, !noundef !19
  %54 = trunc i8 %53 to i1
  %55 = xor i1 %54, true
  %56 = zext i1 %55 to i8
  store i8 %56, ptr %18, align 1, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #4
  store i32 0, ptr %19, align 4, !tbaa !9
  br label %57

57:                                               ; preds = %91, %51
  %58 = load ptr, ptr %17, align 8, !tbaa !5
  %59 = load ptr, ptr %15, align 8, !tbaa !5
  %60 = load i32, ptr %10, align 4, !tbaa !9
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds i8, ptr %59, i64 %61
  %63 = icmp ult ptr %58, %62
  br i1 %63, label %64, label %94

64:                                               ; preds = %57
  %65 = load ptr, ptr %17, align 8, !tbaa !5
  %66 = load i8, ptr %65, align 1, !tbaa !11
  %67 = zext i8 %66 to i32
  %68 = icmp sge i32 %67, 128
  br i1 %68, label %69, label %84

69:                                               ; preds = %64
  %70 = load ptr, ptr %17, align 8, !tbaa !5
  %71 = load i8, ptr %70, align 1, !tbaa !11
  %72 = zext i8 %71 to i32
  %73 = icmp eq i32 %72, 247
  br i1 %73, label %74, label %77

74:                                               ; preds = %69
  %75 = load ptr, ptr %17, align 8, !tbaa !5
  %76 = getelementptr inbounds i8, ptr %75, i32 1
  store ptr %76, ptr %17, align 8, !tbaa !5
  br label %94

77:                                               ; preds = %69
  %78 = load i8, ptr %18, align 1, !tbaa !14, !range !18, !noundef !19
  %79 = trunc i8 %78 to i1
  br i1 %79, label %80, label %81

80:                                               ; preds = %77
  br label %94

81:                                               ; preds = %77
  %82 = load i32, ptr %19, align 4, !tbaa !9
  %83 = add nsw i32 %82, 1
  store i32 %83, ptr %19, align 4, !tbaa !9
  br label %91

84:                                               ; preds = %64
  %85 = load i8, ptr %18, align 1, !tbaa !14, !range !18, !noundef !19
  %86 = trunc i8 %85 to i1
  br i1 %86, label %90, label %87

87:                                               ; preds = %84
  store i8 1, ptr %18, align 1, !tbaa !14
  %88 = load i32, ptr %19, align 4, !tbaa !9
  %89 = add nsw i32 %88, 1
  store i32 %89, ptr %19, align 4, !tbaa !9
  br label %90

90:                                               ; preds = %87, %84
  br label %91

91:                                               ; preds = %90, %81
  %92 = load ptr, ptr %17, align 8, !tbaa !5
  %93 = getelementptr inbounds i8, ptr %92, i32 1
  store ptr %93, ptr %17, align 8, !tbaa !5
  br label %57, !llvm.loop !20

94:                                               ; preds = %80, %74, %57
  %95 = load i32, ptr %19, align 4, !tbaa !9
  %96 = load ptr, ptr %15, align 8, !tbaa !5
  %97 = sext i32 %95 to i64
  %98 = getelementptr inbounds i8, ptr %96, i64 %97
  store ptr %98, ptr %15, align 8, !tbaa !5
  %99 = load ptr, ptr %17, align 8, !tbaa !5
  %100 = load ptr, ptr %15, align 8, !tbaa !5
  %101 = ptrtoint ptr %99 to i64
  %102 = ptrtoint ptr %100 to i64
  %103 = sub i64 %101, %102
  %104 = trunc i64 %103 to i32
  %105 = add nsw i32 1, %104
  %106 = getelementptr inbounds %"class.juce::MidiMessage", ptr %25, i32 0, i32 2
  store i32 %105, ptr %106, align 8, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #4
  %107 = getelementptr inbounds %"class.juce::MidiMessage", ptr %25, i32 0, i32 2
  %108 = load i32, ptr %107, align 8, !tbaa !22
  %109 = call noundef ptr @_ZN4juce11MidiMessage13allocateSpaceEi(ptr noundef nonnull align 8 dereferenceable(20) %25, i32 noundef %108)
  store ptr %109, ptr %20, align 8, !tbaa !5
  %110 = load i32, ptr %16, align 4, !tbaa !9
  %111 = trunc i32 %110 to i8
  %112 = load ptr, ptr %20, align 8, !tbaa !5
  store i8 %111, ptr %112, align 1, !tbaa !11
  %113 = load ptr, ptr %20, align 8, !tbaa !5
  %114 = getelementptr inbounds i8, ptr %113, i64 1
  %115 = load ptr, ptr %15, align 8, !tbaa !5
  %116 = getelementptr inbounds %"class.juce::MidiMessage", ptr %25, i32 0, i32 2
  %117 = load i32, ptr %116, align 8, !tbaa !22
  %118 = sub nsw i32 %117, 1
  %119 = sext i32 %118 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %114, ptr align 1 %115, i64 %119, i1 false)
  %120 = load i32, ptr %19, align 4, !tbaa !9
  %121 = load ptr, ptr %11, align 8, !tbaa !5
  %122 = load i32, ptr %121, align 4, !tbaa !9
  %123 = add nsw i32 %122, %120
  store i32 %123, ptr %121, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  br label %182

124:                                              ; preds = %48
  %125 = load i32, ptr %16, align 4, !tbaa !9
  %126 = icmp eq i32 %125, 255
  br i1 %126, label %127, label %152

127:                                              ; preds = %124
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #4
  %128 = load ptr, ptr %15, align 8, !tbaa !5
  %129 = getelementptr inbounds i8, ptr %128, i64 1
  %130 = call noundef i32 @_ZN4juce11MidiMessage21readVariableLengthValEPKhRi(ptr noundef %129, ptr noundef nonnull align 4 dereferenceable(4) %21) #4
  store i32 %130, ptr %22, align 4, !tbaa !9
  %131 = load i32, ptr %10, align 4, !tbaa !9
  %132 = add nsw i32 %131, 1
  %133 = load i32, ptr %21, align 4, !tbaa !9
  %134 = add nsw i32 %133, 2
  %135 = load i32, ptr %22, align 4, !tbaa !9
  %136 = add nsw i32 %134, %135
  %137 = call noundef i32 @_ZN4juce4jminIiEET_S1_S1_(i32 noundef %132, i32 noundef %136)
  %138 = getelementptr inbounds %"class.juce::MidiMessage", ptr %25, i32 0, i32 2
  store i32 %137, ptr %138, align 8, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #4
  %139 = getelementptr inbounds %"class.juce::MidiMessage", ptr %25, i32 0, i32 2
  %140 = load i32, ptr %139, align 8, !tbaa !22
  %141 = call noundef ptr @_ZN4juce11MidiMessage13allocateSpaceEi(ptr noundef nonnull align 8 dereferenceable(20) %25, i32 noundef %140)
  store ptr %141, ptr %23, align 8, !tbaa !5
  %142 = load i32, ptr %16, align 4, !tbaa !9
  %143 = trunc i32 %142 to i8
  %144 = load ptr, ptr %23, align 8, !tbaa !5
  store i8 %143, ptr %144, align 1, !tbaa !11
  %145 = load ptr, ptr %23, align 8, !tbaa !5
  %146 = getelementptr inbounds i8, ptr %145, i64 1
  %147 = load ptr, ptr %15, align 8, !tbaa !5
  %148 = getelementptr inbounds %"class.juce::MidiMessage", ptr %25, i32 0, i32 2
  %149 = load i32, ptr %148, align 8, !tbaa !22
  %150 = sext i32 %149 to i64
  %151 = sub i64 %150, 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %146, ptr align 1 %147, i64 %151, i1 false)
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #4
  br label %181

152:                                              ; preds = %124
  %153 = load i32, ptr %16, align 4, !tbaa !9
  %154 = trunc i32 %153 to i8
  %155 = call noundef i32 @_ZN4juce11MidiMessage29getMessageLengthFromFirstByteEh(i8 noundef zeroext %154) #4
  %156 = getelementptr inbounds %"class.juce::MidiMessage", ptr %25, i32 0, i32 2
  store i32 %155, ptr %156, align 8, !tbaa !22
  %157 = load i32, ptr %16, align 4, !tbaa !9
  %158 = trunc i32 %157 to i8
  %159 = getelementptr inbounds %"class.juce::MidiMessage", ptr %25, i32 0, i32 0
  %160 = getelementptr inbounds [8 x i8], ptr %159, i64 0, i64 0
  store i8 %158, ptr %160, align 8, !tbaa !11
  %161 = getelementptr inbounds %"class.juce::MidiMessage", ptr %25, i32 0, i32 2
  %162 = load i32, ptr %161, align 8, !tbaa !22
  %163 = icmp sgt i32 %162, 1
  br i1 %163, label %164, label %180

164:                                              ; preds = %152
  %165 = load ptr, ptr %15, align 8, !tbaa !5
  %166 = getelementptr inbounds i8, ptr %165, i64 0
  %167 = load i8, ptr %166, align 1, !tbaa !11
  %168 = getelementptr inbounds %"class.juce::MidiMessage", ptr %25, i32 0, i32 0
  %169 = getelementptr inbounds [8 x i8], ptr %168, i64 0, i64 1
  store i8 %167, ptr %169, align 1, !tbaa !11
  %170 = getelementptr inbounds %"class.juce::MidiMessage", ptr %25, i32 0, i32 2
  %171 = load i32, ptr %170, align 8, !tbaa !22
  %172 = icmp sgt i32 %171, 2
  br i1 %172, label %173, label %179

173:                                              ; preds = %164
  %174 = load ptr, ptr %15, align 8, !tbaa !5
  %175 = getelementptr inbounds i8, ptr %174, i64 1
  %176 = load i8, ptr %175, align 1, !tbaa !11
  %177 = getelementptr inbounds %"class.juce::MidiMessage", ptr %25, i32 0, i32 0
  %178 = getelementptr inbounds [8 x i8], ptr %177, i64 0, i64 2
  store i8 %176, ptr %178, align 2, !tbaa !11
  br label %179

179:                                              ; preds = %173, %164
  br label %180

180:                                              ; preds = %179, %152
  br label %181

181:                                              ; preds = %180, %127
  br label %182

182:                                              ; preds = %181, %94
  %183 = getelementptr inbounds %"class.juce::MidiMessage", ptr %25, i32 0, i32 2
  %184 = load i32, ptr %183, align 8, !tbaa !22
  %185 = load ptr, ptr %11, align 8, !tbaa !5
  %186 = load i32, ptr %185, align 4, !tbaa !9
  %187 = add nsw i32 %186, %184
  store i32 %187, ptr %185, align 4, !tbaa !9
  br label %191

188:                                              ; preds = %45
  %189 = getelementptr inbounds %"class.juce::MidiMessage", ptr %25, i32 0, i32 0
  store ptr null, ptr %189, align 8, !tbaa !11
  %190 = getelementptr inbounds %"class.juce::MidiMessage", ptr %25, i32 0, i32 2
  store i32 0, ptr %190, align 8, !tbaa !22
  br label %191

191:                                              ; preds = %188, %182
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN4juce4jminIiEET_S1_S1_(i32 noundef, i32 noundef) #2

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

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

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

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

; 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 nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN4juce11MidiMessage29getMessageLengthFromFirstByteEh(i8 noundef zeroext) local_unnamed_addr #2 align 2

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN4juce11MidiMessageC2EPKviRihdb(ptr noundef nonnull align 8 dereferenceable(20) %0, ptr noundef %1, i32 noundef %2, ptr nocapture noundef nonnull align 4 dereferenceable(4) %3, i8 noundef zeroext %4, double noundef %5, i1 noundef zeroext %6) unnamed_addr #2 align 2 {
  %8 = alloca i32, align 4
  %9 = getelementptr inbounds i8, ptr %0, i64 8
  store double %5, ptr %9, align 8, !tbaa !5
  %10 = load i8, ptr %1, align 1, !tbaa !11
  %11 = icmp sgt i8 %10, -1
  br i1 %11, label %14, label %.thread

.thread:                                          ; preds = %7
  store i32 0, ptr %3, align 4, !tbaa !12
  %12 = add nsw i32 %2, -1
  %13 = getelementptr inbounds i8, ptr %1, i64 1
  br label %16

14:                                               ; preds = %7
  store i32 -1, ptr %3, align 4, !tbaa !12
  %15 = icmp slt i8 %4, 0
  br i1 %15, label %16, label %82

16:                                               ; preds = %.thread, %14
  %.062 = phi i32 [ %12, %.thread ], [ %2, %14 ]
  %.04761 = phi ptr [ %13, %.thread ], [ %1, %14 ]
  %.048.in60 = phi i8 [ %10, %.thread ], [ %4, %14 ]
  switch i8 %.048.in60, label %66 [
    i8 -16, label %17
    i8 -1, label %52
  ]

17:                                               ; preds = %16
  %18 = sext i32 %.062 to i64
  %19 = getelementptr inbounds i8, ptr %.04761, i64 %18
  %20 = icmp sgt i32 %.062, 0
  br i1 %20, label %.lr.ph.preheader, label %.loopexit

.lr.ph.preheader:                                 ; preds = %17
  %21 = xor i1 %6, true
  %22 = zext i1 %21 to i8
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %34
  %.04968 = phi i32 [ %spec.select56, %34 ], [ 0, %.lr.ph.preheader ]
  %.05067 = phi i8 [ %.151, %34 ], [ %22, %.lr.ph.preheader ]
  %.05266 = phi ptr [ %35, %34 ], [ %.04761, %.lr.ph.preheader ]
  %23 = load i8, ptr %.05266, align 1, !tbaa !11
  %24 = icmp slt i8 %23, 0
  br i1 %24, label %25, label %31

25:                                               ; preds = %.lr.ph
  %26 = icmp eq i8 %23, -9
  br i1 %26, label %27, label %29

27:                                               ; preds = %25
  %28 = getelementptr inbounds i8, ptr %.05266, i64 1
  br label %.loopexit

29:                                               ; preds = %25
  %30 = trunc nuw i8 %.05067 to i1
  br i1 %30, label %.loopexit, label %34

31:                                               ; preds = %.lr.ph
  %32 = trunc nuw i8 %.05067 to i1
  %spec.select = select i1 %32, i8 %.05067, i8 1
  %not. = xor i1 %32, true
  %33 = zext i1 %not. to i32
  br label %34

34:                                               ; preds = %29, %31
  %.sink = phi i32 [ %33, %31 ], [ 1, %29 ]
  %.151 = phi i8 [ %spec.select, %31 ], [ %.05067, %29 ]
  %spec.select56 = add nuw nsw i32 %.04968, %.sink
  %35 = getelementptr inbounds i8, ptr %.05266, i64 1
  %36 = icmp ult ptr %35, %19
  br i1 %36, label %.lr.ph, label %.loopexit, !llvm.loop !13

.loopexit:                                        ; preds = %34, %29, %17, %27
  %.04964 = phi i32 [ %.04968, %27 ], [ 0, %17 ], [ %spec.select56, %34 ], [ %.04968, %29 ]
  %.153 = phi ptr [ %28, %27 ], [ %.04761, %17 ], [ %35, %34 ], [ %.05266, %29 ]
  %37 = sext i32 %.04964 to i64
  %38 = getelementptr inbounds i8, ptr %.04761, i64 %37
  %39 = ptrtoint ptr %.153 to i64
  %40 = ptrtoint ptr %38 to i64
  %41 = sub i64 %39, %40
  %42 = trunc i64 %41 to i32
  %43 = add nsw i32 %42, 1
  %44 = getelementptr inbounds i8, ptr %0, i64 16
  store i32 %43, ptr %44, align 8, !tbaa !15
  %45 = tail call noundef ptr @_ZN4juce11MidiMessage13allocateSpaceEi(ptr noundef nonnull align 8 dereferenceable(20) %0, i32 noundef %43)
  store i8 -16, ptr %45, align 1, !tbaa !11
  %46 = getelementptr inbounds i8, ptr %45, i64 1
  %47 = load i32, ptr %44, align 8, !tbaa !15
  %48 = add nsw i32 %47, -1
  %49 = sext i32 %48 to i64
  tail call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 1 %46, ptr nonnull align 1 %38, i64 %49, i1 false)
  %50 = load i32, ptr %3, align 4, !tbaa !12
  %51 = add nsw i32 %50, %.04964
  store i32 %51, ptr %3, align 4, !tbaa !12
  br label %77

52:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #3
  %53 = getelementptr inbounds i8, ptr %.04761, i64 1
  %54 = call noundef i32 @_ZN4juce11MidiMessage21readVariableLengthValEPKhRi(ptr noundef nonnull %53, ptr noundef nonnull align 4 dereferenceable(4) %8) #3
  %55 = add nsw i32 %.062, 1
  %56 = load i32, ptr %8, align 4, !tbaa !12
  %57 = add i32 %54, 2
  %58 = add i32 %57, %56
  %59 = call noundef i32 @_ZN4juce4jminIiEET_S1_S1_(i32 noundef %55, i32 noundef %58)
  %60 = getelementptr inbounds i8, ptr %0, i64 16
  store i32 %59, ptr %60, align 8, !tbaa !15
  %61 = call noundef ptr @_ZN4juce11MidiMessage13allocateSpaceEi(ptr noundef nonnull align 8 dereferenceable(20) %0, i32 noundef %59)
  store i8 -1, ptr %61, align 1, !tbaa !11
  %62 = getelementptr inbounds i8, ptr %61, i64 1
  %63 = load i32, ptr %60, align 8, !tbaa !15
  %64 = sext i32 %63 to i64
  %65 = add nsw i64 %64, -1
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 1 %62, ptr nonnull align 1 %.04761, i64 %65, i1 false)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #3
  br label %77

66:                                               ; preds = %16
  %67 = tail call noundef i32 @_ZN4juce11MidiMessage29getMessageLengthFromFirstByteEh(i8 noundef zeroext %.048.in60) #3
  %68 = getelementptr inbounds i8, ptr %0, i64 16
  store i32 %67, ptr %68, align 8, !tbaa !15
  store i8 %.048.in60, ptr %0, align 8, !tbaa !11
  %69 = icmp sgt i32 %67, 1
  br i1 %69, label %70, label %77

70:                                               ; preds = %66
  %71 = load i8, ptr %.04761, align 1, !tbaa !11
  %72 = getelementptr inbounds i8, ptr %0, i64 1
  store i8 %71, ptr %72, align 1, !tbaa !11
  %.not = icmp eq i32 %67, 2
  br i1 %.not, label %77, label %73

73:                                               ; preds = %70
  %74 = getelementptr inbounds i8, ptr %.04761, i64 1
  %75 = load i8, ptr %74, align 1, !tbaa !11
  %76 = getelementptr inbounds i8, ptr %0, i64 2
  store i8 %75, ptr %76, align 2, !tbaa !11
  br label %77

77:                                               ; preds = %52, %70, %73, %66, %.loopexit
  %78 = getelementptr inbounds i8, ptr %0, i64 16
  %79 = load i32, ptr %78, align 8, !tbaa !15
  %80 = load i32, ptr %3, align 4, !tbaa !12
  %81 = add nsw i32 %80, %79
  store i32 %81, ptr %3, align 4, !tbaa !12
  br label %84

82:                                               ; preds = %14
  store ptr null, ptr %0, align 8, !tbaa !11
  %83 = getelementptr inbounds i8, ptr %0, i64 16
  store i32 0, ptr %83, align 8, !tbaa !15
  br label %84

84:                                               ; preds = %82, %77
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN4juce4jminIiEET_S1_S1_(i32 noundef, i32 noundef) local_unnamed_addr #2

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


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass