; 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::GenericScopedLock" = type { ptr }
%"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 }

; 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 void @_ZN4juce17GenericScopedLockINS_15CriticalSectionEEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #2 align 2

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

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

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

declare void @_ZN4juce17ChangeBroadcaster17sendChangeMessageEv(ptr noundef nonnull align 8 dereferenceable(56)) #3

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4juce14AudioThumbnail9setLevelsEPKPKNS0_11MinMaxValueEiii(ptr noundef nonnull align 8 dereferenceable(200) %0, ptr noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4) #4 align 2 personality ptr @__gxx_personality_v0 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca %"class.juce::GenericScopedLock", align 8
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca i64, align 8
  %16 = alloca i64, align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store i32 %2, ptr %8, align 4, !tbaa !9
  store i32 %3, ptr %9, align 4, !tbaa !9
  store i32 %4, ptr %10, align 4, !tbaa !9
  %17 = load ptr, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %18 = getelementptr inbounds %"class.juce::AudioThumbnail", ptr %17, i32 0, i32 11
  call void @_ZN4juce17GenericScopedLockINS_15CriticalSectionEEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(40) %18) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  %19 = load i32, ptr %9, align 4, !tbaa !9
  %20 = getelementptr inbounds %"class.juce::AudioThumbnail", ptr %17, i32 0, i32 5
  %21 = call noundef i32 @_ZNK4juce10OwnedArrayINS_14AudioThumbnail9ThumbDataENS_20DummyCriticalSectionEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20) %20) #5
  %22 = invoke noundef i32 @_ZN4juce4jminIiEET_S1_S1_(i32 noundef %19, i32 noundef %21)
          to label %23 unwind label %29

23:                                               ; preds = %5
  store i32 %22, ptr %12, align 4, !tbaa !9
  br label %24

24:                                               ; preds = %44, %23
  %25 = load i32, ptr %12, align 4, !tbaa !9
  %26 = add nsw i32 %25, -1
  store i32 %26, ptr %12, align 4, !tbaa !9
  %27 = icmp sge i32 %26, 0
  br i1 %27, label %33, label %28

28:                                               ; preds = %24
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %45

29:                                               ; preds = %33, %5
  %30 = landingpad { ptr, i32 }
          cleanup
  %31 = extractvalue { ptr, i32 } %30, 0
  store ptr %31, ptr %13, align 8
  %32 = extractvalue { ptr, i32 } %30, 1
  store i32 %32, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %88

33:                                               ; preds = %24
  %34 = getelementptr inbounds %"class.juce::AudioThumbnail", ptr %17, i32 0, i32 5
  %35 = load i32, ptr %12, align 4, !tbaa !9
  %36 = call noundef ptr @_ZNK4juce10OwnedArrayINS_14AudioThumbnail9ThumbDataENS_20DummyCriticalSectionEE12getUncheckedEi(ptr noundef nonnull align 8 dereferenceable(20) %34, i32 noundef %35) #5
  %37 = load ptr, ptr %7, align 8, !tbaa !5
  %38 = load i32, ptr %12, align 4, !tbaa !9
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds ptr, ptr %37, i64 %39
  %41 = load ptr, ptr %40, align 8, !tbaa !5
  %42 = load i32, ptr %8, align 4, !tbaa !9
  %43 = load i32, ptr %10, align 4, !tbaa !9
  invoke void @_ZN4juce14AudioThumbnail9ThumbData5writeEPKNS0_11MinMaxValueEii(ptr noundef nonnull align 8 dereferenceable(28) %36, ptr noundef %41, i32 noundef %42, i32 noundef %43)
          to label %44 unwind label %29

44:                                               ; preds = %33
  br label %24, !llvm.loop !11

45:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %46 = load i32, ptr %8, align 4, !tbaa !9
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds %"class.juce::AudioThumbnail", ptr %17, i32 0, i32 6
  %49 = load i32, ptr %48, align 8, !tbaa !13
  %50 = sext i32 %49 to i64
  %51 = mul nsw i64 %47, %50
  store i64 %51, ptr %15, align 8, !tbaa !33
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %52 = load i32, ptr %8, align 4, !tbaa !9
  %53 = load i32, ptr %10, align 4, !tbaa !9
  %54 = add nsw i32 %52, %53
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds %"class.juce::AudioThumbnail", ptr %17, i32 0, i32 6
  %57 = load i32, ptr %56, align 8, !tbaa !13
  %58 = sext i32 %57 to i64
  %59 = mul nsw i64 %55, %58
  store i64 %59, ptr %16, align 8, !tbaa !33
  %60 = getelementptr inbounds %"class.juce::AudioThumbnail", ptr %17, i32 0, i32 8
  %61 = load i64, ptr %60, align 8, !tbaa !34
  %62 = load i64, ptr %15, align 8, !tbaa !33
  %63 = icmp sge i64 %61, %62
  br i1 %63, label %64, label %72

64:                                               ; preds = %45
  %65 = load i64, ptr %16, align 8, !tbaa !33
  %66 = getelementptr inbounds %"class.juce::AudioThumbnail", ptr %17, i32 0, i32 8
  %67 = load i64, ptr %66, align 8, !tbaa !34
  %68 = icmp sgt i64 %65, %67
  br i1 %68, label %69, label %72

69:                                               ; preds = %64
  %70 = load i64, ptr %16, align 8, !tbaa !33
  %71 = getelementptr inbounds %"class.juce::AudioThumbnail", ptr %17, i32 0, i32 8
  store i64 %70, ptr %71, align 8, !tbaa !34
  br label %72

72:                                               ; preds = %69, %64, %45
  %73 = getelementptr inbounds %"class.juce::AudioThumbnail", ptr %17, i32 0, i32 8
  %74 = load i64, ptr %73, align 8, !tbaa !34
  %75 = getelementptr inbounds %"class.juce::AudioThumbnail", ptr %17, i32 0, i32 7
  %76 = load i64, ptr %75, align 8, !tbaa !35
  %77 = invoke noundef i64 @_ZN4juce4jmaxIxEET_S1_S1_(i64 noundef %74, i64 noundef %76)
          to label %78 unwind label %84

78:                                               ; preds = %72
  %79 = getelementptr inbounds %"class.juce::AudioThumbnail", ptr %17, i32 0, i32 7
  store i64 %77, ptr %79, align 8, !tbaa !35
  %80 = getelementptr inbounds %"class.juce::AudioThumbnail", ptr %17, i32 0, i32 4
  %81 = call noundef ptr @_ZNK4juce13ScopedPointerINS_14AudioThumbnail12CachedWindowEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %80) #5
  invoke void @_ZN4juce14AudioThumbnail12CachedWindow10invalidateEv(ptr noundef nonnull align 8 dereferenceable(49) %81)
          to label %82 unwind label %84

82:                                               ; preds = %78
  invoke void @_ZN4juce17ChangeBroadcaster17sendChangeMessageEv(ptr noundef nonnull align 8 dereferenceable(56) %17)
          to label %83 unwind label %84

83:                                               ; preds = %82
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @_ZN4juce17GenericScopedLockINS_15CriticalSectionEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  ret void

84:                                               ; preds = %82, %78, %72
  %85 = landingpad { ptr, i32 }
          cleanup
  %86 = extractvalue { ptr, i32 } %85, 0
  store ptr %86, ptr %13, align 8
  %87 = extractvalue { ptr, i32 } %85, 1
  store i32 %87, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  br label %88

88:                                               ; preds = %84, %29
  call void @_ZN4juce17GenericScopedLockINS_15CriticalSectionEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  br label %89

89:                                               ; preds = %88
  %90 = load ptr, ptr %13, align 8
  %91 = load i32, ptr %14, align 4
  %92 = insertvalue { ptr, i32 } poison, ptr %90, 0
  %93 = insertvalue { ptr, i32 } %92, i32 %91, 1
  resume { ptr, i32 } %93
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4juce14AudioThumbnail9ThumbData5writeEPKNS0_11MinMaxValueEii(ptr noundef nonnull align 8 dereferenceable(28), ptr noundef, i32 noundef, i32 noundef) #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN4juce4jmaxIxEET_S1_S1_(i64 noundef, i64 noundef) #1

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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }

!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 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !10, i64 120}
!14 = !{!"_ZTSN4juce14AudioThumbnailE", !15, i64 0, !6, i64 64, !6, i64 72, !25, i64 80, !26, i64 88, !27, i64 96, !10, i64 120, !30, i64 128, !30, i64 136, !10, i64 144, !31, i64 152, !32, 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, !10, i64 16}
!22 = !{!"_ZTSN4juce19ArrayAllocationBaseIPNS_14ChangeListenerENS_20DummyCriticalSectionEEE", !23, i64 0, !10, 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, !10, i64 16}
!28 = !{!"_ZTSN4juce19ArrayAllocationBaseIPNS_14AudioThumbnail9ThumbDataENS_20DummyCriticalSectionEEE", !29, i64 0, !10, i64 8}
!29 = !{!"_ZTSN4juce9HeapBlockIPNS_14AudioThumbnail9ThumbDataELb0EEE", !6, i64 0}
!30 = !{!"long long", !7, i64 0}
!31 = !{!"double", !7, i64 0}
!32 = !{!"_ZTSN4juce15CriticalSectionE", !7, i64 0}
!33 = !{!30, !30, i64 0}
!34 = !{!14, !30, i64 136}
!35 = !{!14, !30, i64 128}


; 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::GenericScopedLock" = type { ptr }

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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN4juce17GenericScopedLockINS_15CriticalSectionEEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #2 align 2

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

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

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

declare void @_ZN4juce17ChangeBroadcaster17sendChangeMessageEv(ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #3

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4juce14AudioThumbnail9setLevelsEPKPKNS0_11MinMaxValueEiii(ptr noundef nonnull align 8 dereferenceable(200) %0, ptr nocapture noundef readonly %1, i32 noundef %2, i32 noundef %3, i32 noundef %4) local_unnamed_addr #4 align 2 personality ptr @__gxx_personality_v0 {
  %6 = alloca %"class.juce::GenericScopedLock", align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #5
  %7 = getelementptr inbounds i8, ptr %0, i64 160
  call void @_ZN4juce17GenericScopedLockINS_15CriticalSectionEEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(40) %7) #5
  %8 = getelementptr inbounds i8, ptr %0, i64 96
  %9 = call noundef i32 @_ZNK4juce10OwnedArrayINS_14AudioThumbnail9ThumbDataENS_20DummyCriticalSectionEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20) %8) #5
  %10 = call noundef i32 @_ZN4juce4jminIiEET_S1_S1_(i32 noundef %3, i32 noundef %9)
  %11 = zext i32 %10 to i64
  br label %12

12:                                               ; preds = %29, %5
  %indvars.iv = phi i64 [ %indvars.iv.next, %29 ], [ %11, %5 ]
  %13 = trunc nuw i64 %indvars.iv to i32
  %14 = icmp sgt i32 %13, 0
  br i1 %14, label %29, label %15

15:                                               ; preds = %12
  %16 = sext i32 %2 to i64
  %17 = getelementptr inbounds i8, ptr %0, i64 120
  %18 = load i32, ptr %17, align 8, !tbaa !5
  %19 = sext i32 %18 to i64
  %20 = mul nsw i64 %19, %16
  %21 = add nsw i32 %4, %2
  %22 = sext i32 %21 to i64
  %23 = mul nsw i64 %19, %22
  %24 = getelementptr inbounds i8, ptr %0, i64 136
  %25 = load i64, ptr %24, align 8, !tbaa !29
  %.not = icmp sge i64 %25, %20
  %26 = icmp sgt i64 %23, %25
  %or.cond = select i1 %.not, i1 %26, i1 false
  br i1 %or.cond, label %34, label %35

27:                                               ; preds = %29
  %28 = landingpad { ptr, i32 }
          cleanup
  br label %45

29:                                               ; preds = %12
  %indvars.iv.next = add nsw i64 %indvars.iv, -1
  %indvars = trunc i64 %indvars.iv.next to i32
  %30 = call noundef ptr @_ZNK4juce10OwnedArrayINS_14AudioThumbnail9ThumbDataENS_20DummyCriticalSectionEE12getUncheckedEi(ptr noundef nonnull align 8 dereferenceable(20) %8, i32 noundef %indvars) #5
  %31 = and i64 %indvars.iv.next, 4294967295
  %32 = getelementptr inbounds ptr, ptr %1, i64 %31
  %33 = load ptr, ptr %32, align 8, !tbaa !30
  invoke void @_ZN4juce14AudioThumbnail9ThumbData5writeEPKNS0_11MinMaxValueEii(ptr noundef nonnull align 8 dereferenceable(28) %30, ptr noundef %33, i32 noundef %2, i32 noundef %4)
          to label %12 unwind label %27, !llvm.loop !31

34:                                               ; preds = %15
  store i64 %23, ptr %24, align 8, !tbaa !29
  br label %35

35:                                               ; preds = %34, %15
  %36 = phi i64 [ %23, %34 ], [ %25, %15 ]
  %37 = getelementptr inbounds i8, ptr %0, i64 128
  %38 = load i64, ptr %37, align 8, !tbaa !33
  %39 = call noundef i64 @_ZN4juce4jmaxIxEET_S1_S1_(i64 noundef %36, i64 noundef %38)
  store i64 %39, ptr %37, align 8, !tbaa !33
  %40 = getelementptr inbounds i8, ptr %0, i64 88
  %41 = call noundef ptr @_ZNK4juce13ScopedPointerINS_14AudioThumbnail12CachedWindowEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %40) #5
  call void @_ZN4juce14AudioThumbnail12CachedWindow10invalidateEv(ptr noundef nonnull align 8 dereferenceable(49) %41)
  invoke void @_ZN4juce17ChangeBroadcaster17sendChangeMessageEv(ptr noundef nonnull align 8 dereferenceable(56) %0)
          to label %42 unwind label %43

42:                                               ; preds = %35
  call void @_ZN4juce17GenericScopedLockINS_15CriticalSectionEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  ret void

43:                                               ; preds = %35
  %44 = landingpad { ptr, i32 }
          cleanup
  br label %45

45:                                               ; preds = %43, %27
  %.pn = phi { ptr, i32 } [ %28, %27 ], [ %44, %43 ]
  call void @_ZN4juce17GenericScopedLockINS_15CriticalSectionEED2Ev(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
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN4juce4jmaxIxEET_S1_S1_(i64 noundef, i64 noundef) local_unnamed_addr #1

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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }

!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 = !{!6, !26, i64 136}
!30 = !{!12, !12, i64 0}
!31 = distinct !{!31, !32}
!32 = !{!"llvm.loop.mustprogress"}
!33 = !{!6, !26, i64 128}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass