; LLVM IR from modlfo/AudioEngine :: AudioEngine/JuceLibraryCode (juce_audio_utils)

; 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::HeapBlock.139" = type { ptr }
%"class.juce::HeapBlock.146" = type { ptr }
%"class.juce::Range" = type { float, float }
%"class.juce::AudioThumbnail" = type { %"class.juce::AudioThumbnailBase", ptr, ptr, %"class.juce::ScopedPointer.115", %"class.juce::ScopedPointer.116", %"class.juce::OwnedArray.117", i32, i64, i64, i32, double, %"class.juce::CriticalSection" }
%"class.juce::AudioThumbnailBase" = type { %"class.juce::ChangeBroadcaster", %"class.juce::AudioFormatWriter::ThreadedWriter::IncomingDataReceiver" }
%"class.juce::ChangeBroadcaster" = type { ptr, %"class.juce::ChangeBroadcaster::ChangeBroadcasterCallback", %"class.juce::ListenerList.20" }
%"class.juce::ChangeBroadcaster::ChangeBroadcasterCallback" = type { %"class.juce::AsyncUpdater", ptr }
%"class.juce::AsyncUpdater" = type { ptr, %"class.juce::ReferenceCountedObjectPtr.19" }
%"class.juce::ReferenceCountedObjectPtr.19" = type { ptr }
%"class.juce::ListenerList.20" = type { %"class.juce::Array.21" }
%"class.juce::Array.21" = type { %"class.juce::ArrayAllocationBase.22", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.22" = type <{ %"class.juce::HeapBlock.23", i32, [4 x i8] }>
%"class.juce::HeapBlock.23" = type { ptr }
%"class.juce::AudioFormatWriter::ThreadedWriter::IncomingDataReceiver" = type { ptr }
%"class.juce::ScopedPointer.115" = type { ptr }
%"class.juce::ScopedPointer.116" = type { ptr }
%"class.juce::OwnedArray.117" = type { %"class.juce::ArrayAllocationBase.118", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.118" = type <{ %"class.juce::HeapBlock.119", i32, [4 x i8] }>
%"class.juce::HeapBlock.119" = type { ptr }
%"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 }
%"struct.juce::AudioThumbnail::MinMaxValue" = type { [2 x i8] }

; 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 i32 @_ZN4juce4jminIiEET_S1_S1_(i32 noundef, i32 noundef) #1

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4juce14AudioThumbnail8addBlockExRKNS_11AudioBufferIfEEii(ptr noundef nonnull align 8 dereferenceable(200) %0, i64 noundef %1, ptr noundef nonnull align 8 dereferenceable(289) %2, i32 noundef %3, i32 noundef %4) unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca %"class.juce::HeapBlock.139", align 8
  %16 = alloca %"class.juce::HeapBlock.146", align 8
  %17 = alloca ptr, align 8
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca ptr, align 8
  %22 = alloca ptr, align 8
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca %"class.juce::Range", align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store i64 %1, ptr %7, align 8, !tbaa !9
  store ptr %2, ptr %8, align 8, !tbaa !5
  store i32 %3, ptr %9, align 4, !tbaa !11
  store i32 %4, ptr %10, align 4, !tbaa !11
  %26 = load ptr, ptr %6, align 8
  br label %27

27:                                               ; preds = %5
  br label %28

28:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %29 = load i64, ptr %7, align 8, !tbaa !9
  %30 = getelementptr inbounds %"class.juce::AudioThumbnail", ptr %26, i32 0, i32 6
  %31 = load i32, ptr %30, align 8, !tbaa !13
  %32 = sext i32 %31 to i64
  %33 = sdiv i64 %29, %32
  %34 = trunc i64 %33 to i32
  store i32 %34, ptr %11, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  %35 = load i64, ptr %7, align 8, !tbaa !9
  %36 = load i32, ptr %10, align 4, !tbaa !11
  %37 = sext i32 %36 to i64
  %38 = add nsw i64 %35, %37
  %39 = getelementptr inbounds %"class.juce::AudioThumbnail", ptr %26, i32 0, i32 6
  %40 = load i32, ptr %39, align 8, !tbaa !13
  %41 = sub nsw i32 %40, 1
  %42 = sext i32 %41 to i64
  %43 = add nsw i64 %38, %42
  %44 = getelementptr inbounds %"class.juce::AudioThumbnail", ptr %26, i32 0, i32 6
  %45 = load i32, ptr %44, align 8, !tbaa !13
  %46 = sext i32 %45 to i64
  %47 = sdiv i64 %43, %46
  %48 = trunc i64 %47 to i32
  store i32 %48, ptr %12, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  %49 = load i32, ptr %12, align 4, !tbaa !11
  %50 = load i32, ptr %11, align 4, !tbaa !11
  %51 = sub nsw i32 %49, %50
  store i32 %51, ptr %13, align 4, !tbaa !11
  %52 = load i32, ptr %13, align 4, !tbaa !11
  %53 = icmp sgt i32 %52, 0
  br i1 %53, label %54, label %136

54:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  %55 = getelementptr inbounds %"class.juce::AudioThumbnail", ptr %26, i32 0, i32 5
  %56 = call noundef i32 @_ZNK4juce10OwnedArrayINS_14AudioThumbnail9ThumbDataENS_20DummyCriticalSectionEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20) %55) #5
  %57 = load ptr, ptr %8, align 8, !tbaa !5
  %58 = call noundef i32 @_ZNK4juce11AudioBufferIfE14getNumChannelsEv(ptr noundef nonnull align 8 dereferenceable(289) %57) #5
  %59 = call noundef i32 @_ZN4juce4jminIiEET_S1_S1_(i32 noundef %56, i32 noundef %58)
  store i32 %59, ptr %14, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %60 = load i32, ptr %13, align 4, !tbaa !11
  %61 = load i32, ptr %14, align 4, !tbaa !11
  %62 = mul nsw i32 %60, %61
  %63 = sext i32 %62 to i64
  call void @_ZN4juce9HeapBlockINS_14AudioThumbnail11MinMaxValueELb0EEC2Em(ptr noundef nonnull align 8 dereferenceable(8) %15, i64 noundef %63)
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %64 = load i32, ptr %14, align 4, !tbaa !11
  %65 = sext i32 %64 to i64
  invoke void @_ZN4juce9HeapBlockIPNS_14AudioThumbnail11MinMaxValueELb0EEC2Em(ptr noundef nonnull align 8 dereferenceable(8) %16, i64 noundef %65)
          to label %66 unwind label %72

66:                                               ; preds = %54
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #5
  store i32 0, ptr %19, align 4, !tbaa !11
  br label %67

67:                                               ; preds = %121, %66
  %68 = load i32, ptr %19, align 4, !tbaa !11
  %69 = load i32, ptr %14, align 4, !tbaa !11
  %70 = icmp slt i32 %68, %69
  br i1 %70, label %76, label %71

71:                                               ; preds = %67
  store i32 4, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #5
  br label %124

72:                                               ; preds = %54
  %73 = landingpad { ptr, i32 }
          cleanup
  %74 = extractvalue { ptr, i32 } %73, 0
  store ptr %74, ptr %17, align 8
  %75 = extractvalue { ptr, i32 } %73, 1
  store i32 %75, ptr %18, align 4
  br label %135

76:                                               ; preds = %67
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #5
  %77 = load ptr, ptr %8, align 8, !tbaa !5
  %78 = load i32, ptr %19, align 4, !tbaa !11
  %79 = load i32, ptr %9, align 4, !tbaa !11
  %80 = call noundef ptr @_ZNK4juce11AudioBufferIfE14getReadPointerEii(ptr noundef nonnull align 8 dereferenceable(289) %77, i32 noundef %78, i32 noundef %79) #5
  store ptr %80, ptr %21, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #5
  %81 = load i32, ptr %13, align 4, !tbaa !11
  %82 = load i32, ptr %19, align 4, !tbaa !11
  %83 = mul nsw i32 %81, %82
  %84 = call noundef ptr @_ZNK4juce9HeapBlockINS_14AudioThumbnail11MinMaxValueELb0EEplIiEEPS2_T_(ptr noundef nonnull align 8 dereferenceable(8) %15, i32 noundef %83) #5
  store ptr %84, ptr %22, align 8, !tbaa !5
  %85 = load ptr, ptr %22, align 8, !tbaa !5
  %86 = load i32, ptr %19, align 4, !tbaa !11
  %87 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK4juce9HeapBlockIPNS_14AudioThumbnail11MinMaxValueELb0EEixIiEERS3_T_(ptr noundef nonnull align 8 dereferenceable(8) %16, i32 noundef %86) #5
  store ptr %85, ptr %87, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #5
  store i32 0, ptr %23, align 4, !tbaa !11
  br label %88

88:                                               ; preds = %113, %76
  %89 = load i32, ptr %23, align 4, !tbaa !11
  %90 = load i32, ptr %13, align 4, !tbaa !11
  %91 = icmp slt i32 %89, %90
  br i1 %91, label %93, label %92

92:                                               ; preds = %88
  store i32 7, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #5
  br label %120

93:                                               ; preds = %88
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #5
  %94 = load i32, ptr %23, align 4, !tbaa !11
  %95 = getelementptr inbounds %"class.juce::AudioThumbnail", ptr %26, i32 0, i32 6
  %96 = load i32, ptr %95, align 8, !tbaa !13
  %97 = mul nsw i32 %94, %96
  store i32 %97, ptr %24, align 4, !tbaa !11
  %98 = load ptr, ptr %22, align 8, !tbaa !5
  %99 = load i32, ptr %23, align 4, !tbaa !11
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds %"struct.juce::AudioThumbnail::MinMaxValue", ptr %98, i64 %100
  %102 = load ptr, ptr %21, align 8, !tbaa !5
  %103 = load i32, ptr %24, align 4, !tbaa !11
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds float, ptr %102, i64 %104
  %106 = getelementptr inbounds %"class.juce::AudioThumbnail", ptr %26, i32 0, i32 6
  %107 = load i32, ptr %106, align 8, !tbaa !13
  %108 = load i32, ptr %10, align 4, !tbaa !11
  %109 = load i32, ptr %24, align 4, !tbaa !11
  %110 = sub nsw i32 %108, %109
  %111 = invoke noundef i32 @_ZN4juce4jminIiEET_S1_S1_(i32 noundef %107, i32 noundef %110)
          to label %112 unwind label %116

112:                                              ; preds = %93
  call void @_ZN4juce21FloatVectorOperations13findMinAndMaxEPKfi(ptr dead_on_unwind writable sret(%"class.juce::Range") align 4 %25, ptr noundef %105, i32 noundef %111) #5
  call void @_ZN4juce14AudioThumbnail11MinMaxValue8setFloatENS_5RangeIfEE(ptr noundef nonnull align 1 dereferenceable(2) %101, ptr noundef %25) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #5
  br label %113

113:                                              ; preds = %112
  %114 = load i32, ptr %23, align 4, !tbaa !11
  %115 = add nsw i32 %114, 1
  store i32 %115, ptr %23, align 4, !tbaa !11
  br label %88, !llvm.loop !32

116:                                              ; preds = %93
  %117 = landingpad { ptr, i32 }
          cleanup
  %118 = extractvalue { ptr, i32 } %117, 0
  store ptr %118, ptr %17, align 8
  %119 = extractvalue { ptr, i32 } %117, 1
  store i32 %119, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #5
  br label %134

120:                                              ; preds = %92
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #5
  br label %121

121:                                              ; preds = %120
  %122 = load i32, ptr %19, align 4, !tbaa !11
  %123 = add nsw i32 %122, 1
  store i32 %123, ptr %19, align 4, !tbaa !11
  br label %67, !llvm.loop !34

124:                                              ; preds = %71
  %125 = call noundef ptr @_ZNK4juce9HeapBlockIPNS_14AudioThumbnail11MinMaxValueELb0EEcvPS3_Ev(ptr noundef nonnull align 8 dereferenceable(8) %16) #5
  %126 = load i32, ptr %11, align 4, !tbaa !11
  %127 = load i32, ptr %14, align 4, !tbaa !11
  %128 = load i32, ptr %13, align 4, !tbaa !11
  invoke void @_ZN4juce14AudioThumbnail9setLevelsEPKPKNS0_11MinMaxValueEiii(ptr noundef nonnull align 8 dereferenceable(200) %26, ptr noundef %125, i32 noundef %126, i32 noundef %127, i32 noundef %128)
          to label %129 unwind label %130

129:                                              ; preds = %124
  call void @_ZN4juce9HeapBlockIPNS_14AudioThumbnail11MinMaxValueELb0EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @_ZN4juce9HeapBlockINS_14AudioThumbnail11MinMaxValueELb0EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %136

130:                                              ; preds = %124
  %131 = landingpad { ptr, i32 }
          cleanup
  %132 = extractvalue { ptr, i32 } %131, 0
  store ptr %132, ptr %17, align 8
  %133 = extractvalue { ptr, i32 } %131, 1
  store i32 %133, ptr %18, align 4
  br label %134

134:                                              ; preds = %130, %116
  call void @_ZN4juce9HeapBlockIPNS_14AudioThumbnail11MinMaxValueELb0EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %16) #5
  br label %135

135:                                              ; preds = %134, %72
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @_ZN4juce9HeapBlockINS_14AudioThumbnail11MinMaxValueELb0EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %137

136:                                              ; preds = %129, %28
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  ret void

137:                                              ; preds = %135
  %138 = load ptr, ptr %17, align 8
  %139 = load i32, ptr %18, align 4
  %140 = insertvalue { ptr, i32 } poison, ptr %138, 0
  %141 = insertvalue { ptr, i32 } %140, i32 %139, 1
  resume { ptr, i32 } %141
}

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN4juce14AudioThumbnail11MinMaxValue8setFloatENS_5RangeIfEE(ptr noundef nonnull align 1 dereferenceable(2), ptr noundef) #2 align 2

; Function Attrs: nounwind
declare void @_ZN4juce21FloatVectorOperations13findMinAndMaxEPKfi(ptr dead_on_unwind writable sret(%"class.juce::Range") align 4, ptr noundef, i32 noundef) #4

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4juce9HeapBlockIPNS_14AudioThumbnail11MinMaxValueELb0EED2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4juce9HeapBlockINS_14AudioThumbnail11MinMaxValueELb0EED2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #1 align 2

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

!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 = !{!"long long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !12, i64 120}
!14 = !{!"_ZTSN4juce14AudioThumbnailE", !15, i64 0, !6, i64 64, !6, i64 72, !25, i64 80, !26, i64 88, !27, i64 96, !12, i64 120, !10, i64 128, !10, i64 136, !12, i64 144, !30, i64 152, !31, i64 160}
!15 = !{!"_ZTSN4juce18AudioThumbnailBaseE", !16, i64 0, !24, i64 56}
!16 = !{!"_ZTSN4juce17ChangeBroadcasterE", !17, i64 8, !20, i64 32}
!17 = !{!"_ZTSN4juce17ChangeBroadcaster25ChangeBroadcasterCallbackE", !18, i64 0, !6, i64 16}
!18 = !{!"_ZTSN4juce12AsyncUpdaterE", !19, i64 8}
!19 = !{!"_ZTSN4juce25ReferenceCountedObjectPtrINS_12AsyncUpdater19AsyncUpdaterMessageEEE", !6, i64 0}
!20 = !{!"_ZTSN4juce12ListenerListINS_14ChangeListenerENS_5ArrayIPS1_NS_20DummyCriticalSectionELi0EEEEE", !21, i64 0}
!21 = !{!"_ZTSN4juce5ArrayIPNS_14ChangeListenerENS_20DummyCriticalSectionELi0EEE", !22, i64 0, !12, i64 16}
!22 = !{!"_ZTSN4juce19ArrayAllocationBaseIPNS_14ChangeListenerENS_20DummyCriticalSectionEEE", !23, i64 0, !12, i64 8}
!23 = !{!"_ZTSN4juce9HeapBlockIPNS_14ChangeListenerELb0EEE", !6, i64 0}
!24 = !{!"_ZTSN4juce17AudioFormatWriter14ThreadedWriter20IncomingDataReceiverE"}
!25 = !{!"_ZTSN4juce13ScopedPointerINS_14AudioThumbnail15LevelDataSourceEEE", !6, i64 0}
!26 = !{!"_ZTSN4juce13ScopedPointerINS_14AudioThumbnail12CachedWindowEEE", !6, i64 0}
!27 = !{!"_ZTSN4juce10OwnedArrayINS_14AudioThumbnail9ThumbDataENS_20DummyCriticalSectionEEE", !28, i64 0, !12, i64 16}
!28 = !{!"_ZTSN4juce19ArrayAllocationBaseIPNS_14AudioThumbnail9ThumbDataENS_20DummyCriticalSectionEEE", !29, i64 0, !12, i64 8}
!29 = !{!"_ZTSN4juce9HeapBlockIPNS_14AudioThumbnail9ThumbDataELb0EEE", !6, i64 0}
!30 = !{!"double", !7, i64 0}
!31 = !{!"_ZTSN4juce15CriticalSectionE", !7, i64 0}
!32 = distinct !{!32, !33}
!33 = !{!"llvm.loop.mustprogress"}
!34 = distinct !{!34, !33}


; 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::HeapBlock.139" = type { ptr }
%"class.juce::HeapBlock.146" = type { ptr }
%"class.juce::Range" = type { float, float }
%"struct.juce::AudioThumbnail::MinMaxValue" = type { [2 x i8] }

; 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 i32 @_ZN4juce4jminIiEET_S1_S1_(i32 noundef, i32 noundef) local_unnamed_addr #1

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4juce14AudioThumbnail8addBlockExRKNS_11AudioBufferIfEEii(ptr noundef nonnull align 8 dereferenceable(200) %0, i64 noundef %1, ptr noundef nonnull align 8 dereferenceable(289) %2, i32 noundef %3, i32 noundef %4) unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %6 = alloca %"class.juce::HeapBlock.139", align 8
  %7 = alloca %"class.juce::HeapBlock.146", align 8
  %8 = alloca %"class.juce::Range", align 4
  %9 = getelementptr inbounds i8, ptr %0, i64 120
  %10 = load i32, ptr %9, align 8, !tbaa !5
  %11 = sext i32 %10 to i64
  %12 = sdiv i64 %1, %11
  %13 = trunc i64 %12 to i32
  %14 = sext i32 %4 to i64
  %15 = add nsw i64 %14, %1
  %16 = add nsw i32 %10, -1
  %17 = sext i32 %16 to i64
  %18 = add nsw i64 %15, %17
  %19 = sdiv i64 %18, %11
  %20 = trunc i64 %19 to i32
  %21 = sub nsw i32 %20, %13
  %22 = icmp sgt i32 %21, 0
  br i1 %22, label %23, label %53

23:                                               ; preds = %5
  %24 = getelementptr inbounds i8, ptr %0, i64 96
  %25 = tail call noundef i32 @_ZNK4juce10OwnedArrayINS_14AudioThumbnail9ThumbDataENS_20DummyCriticalSectionEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20) %24) #5
  %26 = tail call noundef i32 @_ZNK4juce11AudioBufferIfE14getNumChannelsEv(ptr noundef nonnull align 8 dereferenceable(289) %2) #5
  %27 = tail call noundef i32 @_ZN4juce4jminIiEET_S1_S1_(i32 noundef %25, i32 noundef %26)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #5
  %28 = mul nsw i32 %27, %21
  %29 = sext i32 %28 to i64
  call void @_ZN4juce9HeapBlockINS_14AudioThumbnail11MinMaxValueELb0EEC2Em(ptr noundef nonnull align 8 dereferenceable(8) %6, i64 noundef %29)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #5
  %30 = sext i32 %27 to i64
  invoke void @_ZN4juce9HeapBlockIPNS_14AudioThumbnail11MinMaxValueELb0EEC2Em(ptr noundef nonnull align 8 dereferenceable(8) %7, i64 noundef %30)
          to label %.preheader unwind label %47

.preheader:                                       ; preds = %23
  %31 = icmp sgt i32 %27, 0
  br i1 %31, label %.lr.ph.us.preheader, label %._crit_edge44

.lr.ph.us.preheader:                              ; preds = %.preheader
  %wide.trip.count = zext nneg i32 %21 to i64
  br label %.lr.ph.us

.lr.ph.us:                                        ; preds = %.lr.ph.us.preheader, %._crit_edge.us
  %.03742.us = phi i32 [ %45, %._crit_edge.us ], [ 0, %.lr.ph.us.preheader ]
  %32 = call noundef ptr @_ZNK4juce11AudioBufferIfE14getReadPointerEii(ptr noundef nonnull align 8 dereferenceable(289) %2, i32 noundef %.03742.us, i32 noundef %3) #5
  %33 = mul nuw nsw i32 %.03742.us, %21
  %34 = call noundef ptr @_ZNK4juce9HeapBlockINS_14AudioThumbnail11MinMaxValueELb0EEplIiEEPS2_T_(ptr noundef nonnull align 8 dereferenceable(8) %6, i32 noundef %33) #5
  %35 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK4juce9HeapBlockIPNS_14AudioThumbnail11MinMaxValueELb0EEixIiEERS3_T_(ptr noundef nonnull align 8 dereferenceable(8) %7, i32 noundef %.03742.us) #5
  store ptr %34, ptr %35, align 8, !tbaa !29
  br label %36

36:                                               ; preds = %.lr.ph.us, %36
  %indvars.iv = phi i64 [ 0, %.lr.ph.us ], [ %indvars.iv.next, %36 ]
  %37 = load i32, ptr %9, align 8, !tbaa !5
  %38 = trunc nuw nsw i64 %indvars.iv to i32
  %39 = mul nsw i32 %37, %38
  %40 = getelementptr inbounds %"struct.juce::AudioThumbnail::MinMaxValue", ptr %34, i64 %indvars.iv
  %41 = sext i32 %39 to i64
  %42 = getelementptr inbounds float, ptr %32, i64 %41
  %43 = sub nsw i32 %4, %39
  %44 = call noundef i32 @_ZN4juce4jminIiEET_S1_S1_(i32 noundef %37, i32 noundef %43)
  call void @_ZN4juce21FloatVectorOperations13findMinAndMaxEPKfi(ptr dead_on_unwind nonnull writable sret(%"class.juce::Range") align 4 %8, ptr noundef %42, i32 noundef %44) #5
  call void @_ZN4juce14AudioThumbnail11MinMaxValue8setFloatENS_5RangeIfEE(ptr noundef nonnull align 1 dereferenceable(2) %40, ptr noundef nonnull %8) #5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge.us, label %36, !llvm.loop !30

._crit_edge.us:                                   ; preds = %36
  %45 = add nuw nsw i32 %.03742.us, 1
  %exitcond47.not = icmp eq i32 %45, %27
  br i1 %exitcond47.not, label %._crit_edge44, label %.lr.ph.us, !llvm.loop !32

._crit_edge44:                                    ; preds = %._crit_edge.us, %.preheader
  %46 = call noundef ptr @_ZNK4juce9HeapBlockIPNS_14AudioThumbnail11MinMaxValueELb0EEcvPS3_Ev(ptr noundef nonnull align 8 dereferenceable(8) %7) #5
  invoke void @_ZN4juce14AudioThumbnail9setLevelsEPKPKNS0_11MinMaxValueEiii(ptr noundef nonnull align 8 dereferenceable(200) %0, ptr noundef %46, i32 noundef %13, i32 noundef %27, i32 noundef %21)
          to label %49 unwind label %50

47:                                               ; preds = %23
  %48 = landingpad { ptr, i32 }
          cleanup
  br label %52

49:                                               ; preds = %._crit_edge44
  call void @_ZN4juce9HeapBlockIPNS_14AudioThumbnail11MinMaxValueELb0EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #5
  call void @_ZN4juce9HeapBlockINS_14AudioThumbnail11MinMaxValueELb0EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  br label %53

50:                                               ; preds = %._crit_edge44
  %51 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN4juce9HeapBlockIPNS_14AudioThumbnail11MinMaxValueELb0EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %7) #5
  br label %52

52:                                               ; preds = %50, %47
  %.pn = phi { ptr, i32 } [ %51, %50 ], [ %48, %47 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #5
  call void @_ZN4juce9HeapBlockINS_14AudioThumbnail11MinMaxValueELb0EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  resume { ptr, i32 } %.pn

53:                                               ; preds = %49, %5
  ret void
}

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN4juce14AudioThumbnail11MinMaxValue8setFloatENS_5RangeIfEE(ptr noundef nonnull align 1 dereferenceable(2), ptr noundef) local_unnamed_addr #2 align 2

; Function Attrs: nounwind
declare void @_ZN4juce21FloatVectorOperations13findMinAndMaxEPKfi(ptr dead_on_unwind writable sret(%"class.juce::Range") align 4, ptr noundef, i32 noundef) local_unnamed_addr #4

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4juce9HeapBlockIPNS_14AudioThumbnail11MinMaxValueELb0EED2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4juce9HeapBlockINS_14AudioThumbnail11MinMaxValueELb0EED2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #1 align 2

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 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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, !19, i64 120}
!6 = !{!"_ZTSN4juce14AudioThumbnailE", !7, i64 0, !12, i64 64, !12, i64 72, !21, i64 80, !22, i64 88, !23, i64 96, !19, i64 120, !26, i64 128, !26, i64 136, !19, i64 144, !27, i64 152, !28, i64 160}
!7 = !{!"_ZTSN4juce18AudioThumbnailBaseE", !8, i64 0, !20, i64 56}
!8 = !{!"_ZTSN4juce17ChangeBroadcasterE", !9, i64 8, !15, i64 32}
!9 = !{!"_ZTSN4juce17ChangeBroadcaster25ChangeBroadcasterCallbackE", !10, i64 0, !12, i64 16}
!10 = !{!"_ZTSN4juce12AsyncUpdaterE", !11, i64 8}
!11 = !{!"_ZTSN4juce25ReferenceCountedObjectPtrINS_12AsyncUpdater19AsyncUpdaterMessageEEE", !12, i64 0}
!12 = !{!"any pointer", !13, i64 0}
!13 = !{!"omnipotent char", !14, i64 0}
!14 = !{!"Simple C++ TBAA"}
!15 = !{!"_ZTSN4juce12ListenerListINS_14ChangeListenerENS_5ArrayIPS1_NS_20DummyCriticalSectionELi0EEEEE", !16, i64 0}
!16 = !{!"_ZTSN4juce5ArrayIPNS_14ChangeListenerENS_20DummyCriticalSectionELi0EEE", !17, i64 0, !19, i64 16}
!17 = !{!"_ZTSN4juce19ArrayAllocationBaseIPNS_14ChangeListenerENS_20DummyCriticalSectionEEE", !18, i64 0, !19, i64 8}
!18 = !{!"_ZTSN4juce9HeapBlockIPNS_14ChangeListenerELb0EEE", !12, i64 0}
!19 = !{!"int", !13, i64 0}
!20 = !{!"_ZTSN4juce17AudioFormatWriter14ThreadedWriter20IncomingDataReceiverE"}
!21 = !{!"_ZTSN4juce13ScopedPointerINS_14AudioThumbnail15LevelDataSourceEEE", !12, i64 0}
!22 = !{!"_ZTSN4juce13ScopedPointerINS_14AudioThumbnail12CachedWindowEEE", !12, i64 0}
!23 = !{!"_ZTSN4juce10OwnedArrayINS_14AudioThumbnail9ThumbDataENS_20DummyCriticalSectionEEE", !24, i64 0, !19, i64 16}
!24 = !{!"_ZTSN4juce19ArrayAllocationBaseIPNS_14AudioThumbnail9ThumbDataENS_20DummyCriticalSectionEEE", !25, i64 0, !19, i64 8}
!25 = !{!"_ZTSN4juce9HeapBlockIPNS_14AudioThumbnail9ThumbDataELb0EEE", !12, i64 0}
!26 = !{!"long long", !13, i64 0}
!27 = !{!"double", !13, i64 0}
!28 = !{!"_ZTSN4juce15CriticalSectionE", !13, i64 0}
!29 = !{!12, !12, i64 0}
!30 = distinct !{!30, !31}
!31 = !{!"llvm.loop.mustprogress"}
!32 = distinct !{!32, !31}


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