; 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 }
%"class.juce::AudioThumbnail::LevelDataSource" = type <{ %"class.juce::TimeSliceClient", i64, i64, double, i32, [4 x i8], i64, ptr, %"class.juce::ScopedPointer.144", %"class.juce::ScopedPointer.145", %"class.juce::CriticalSection", i32, [4 x i8] }>
%"class.juce::TimeSliceClient" = type { ptr, %"class.juce::Time" }
%"class.juce::Time" = type { i64 }
%"class.juce::ScopedPointer.144" = type { ptr }
%"class.juce::ScopedPointer.145" = type { 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 nonnull align 8 dereferenceable(8) ptr @_ZN4juce13ScopedPointerINS_14AudioThumbnail15LevelDataSourceEEaSEPS2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #1 align 2

; 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: mustprogress uwtable
declare dso_local void @_ZN4juce14AudioThumbnail14createChannelsEi(ptr noundef nonnull align 8 dereferenceable(200), i32 noundef) #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN4juce14AudioThumbnail13setDataSourceEPNS0_15LevelDataSourceE(ptr noundef nonnull align 8 dereferenceable(200) %0, ptr noundef %1) #3 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca %"class.juce::GenericScopedLock", align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %8 = load ptr, ptr %3, align 8
  br label %9

9:                                                ; preds = %2
  br label %10

10:                                               ; preds = %9
  %11 = getelementptr inbounds %"class.juce::AudioThumbnail", ptr %8, i32 0, i32 8
  store i64 0, ptr %11, align 8, !tbaa !9
  %12 = getelementptr inbounds %"class.juce::AudioThumbnail", ptr %8, i32 0, i32 2
  %13 = load ptr, ptr %12, align 8, !tbaa !30
  %14 = load ptr, ptr %4, align 8, !tbaa !5
  %15 = getelementptr inbounds %"class.juce::AudioThumbnail::LevelDataSource", ptr %14, i32 0, i32 6
  %16 = load i64, ptr %15, align 8, !tbaa !31
  %17 = call noundef zeroext i1 @_ZN4juce19AudioThumbnailCache9loadThumbERNS_18AudioThumbnailBaseEx(ptr noundef nonnull align 8 dereferenceable(476) %13, ptr noundef nonnull align 8 dereferenceable(64) %8, i64 noundef %16)
  br i1 %17, label %18, label %47

18:                                               ; preds = %10
  %19 = load ptr, ptr %8, align 8, !tbaa !37
  %20 = getelementptr inbounds ptr, ptr %19, i64 11
  %21 = load ptr, ptr %20, align 8
  %22 = call noundef zeroext i1 %21(ptr noundef nonnull align 8 dereferenceable(200) %8) #4
  br i1 %22, label %23, label %47

23:                                               ; preds = %18
  %24 = load ptr, ptr %4, align 8, !tbaa !5
  %25 = getelementptr inbounds %"class.juce::AudioThumbnail", ptr %8, i32 0, i32 3
  %26 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN4juce13ScopedPointerINS_14AudioThumbnail15LevelDataSourceEEaSEPS2_(ptr noundef nonnull align 8 dereferenceable(8) %25, ptr noundef %24)
  %27 = getelementptr inbounds %"class.juce::AudioThumbnail", ptr %8, i32 0, i32 7
  %28 = load i64, ptr %27, align 8, !tbaa !39
  %29 = getelementptr inbounds %"class.juce::AudioThumbnail", ptr %8, i32 0, i32 3
  %30 = call noundef ptr @_ZNK4juce13ScopedPointerINS_14AudioThumbnail15LevelDataSourceEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %29) #4
  %31 = getelementptr inbounds %"class.juce::AudioThumbnail::LevelDataSource", ptr %30, i32 0, i32 1
  store i64 %28, ptr %31, align 8, !tbaa !40
  %32 = getelementptr inbounds %"class.juce::AudioThumbnail", ptr %8, i32 0, i32 10
  %33 = load double, ptr %32, align 8, !tbaa !41
  %34 = getelementptr inbounds %"class.juce::AudioThumbnail", ptr %8, i32 0, i32 3
  %35 = call noundef ptr @_ZNK4juce13ScopedPointerINS_14AudioThumbnail15LevelDataSourceEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %34) #4
  %36 = getelementptr inbounds %"class.juce::AudioThumbnail::LevelDataSource", ptr %35, i32 0, i32 3
  store double %33, ptr %36, align 8, !tbaa !42
  %37 = getelementptr inbounds %"class.juce::AudioThumbnail", ptr %8, i32 0, i32 9
  %38 = load i32, ptr %37, align 8, !tbaa !43
  %39 = getelementptr inbounds %"class.juce::AudioThumbnail", ptr %8, i32 0, i32 3
  %40 = call noundef ptr @_ZNK4juce13ScopedPointerINS_14AudioThumbnail15LevelDataSourceEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %39) #4
  %41 = getelementptr inbounds %"class.juce::AudioThumbnail::LevelDataSource", ptr %40, i32 0, i32 4
  store i32 %38, ptr %41, align 8, !tbaa !44
  %42 = getelementptr inbounds %"class.juce::AudioThumbnail", ptr %8, i32 0, i32 8
  %43 = load i64, ptr %42, align 8, !tbaa !9
  %44 = getelementptr inbounds %"class.juce::AudioThumbnail", ptr %8, i32 0, i32 3
  %45 = call noundef ptr @_ZNK4juce13ScopedPointerINS_14AudioThumbnail15LevelDataSourceEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %44) #4
  %46 = getelementptr inbounds %"class.juce::AudioThumbnail::LevelDataSource", ptr %45, i32 0, i32 2
  store i64 %43, ptr %46, align 8, !tbaa !45
  br label %85

47:                                               ; preds = %18, %10
  %48 = load ptr, ptr %4, align 8, !tbaa !5
  %49 = getelementptr inbounds %"class.juce::AudioThumbnail", ptr %8, i32 0, i32 3
  %50 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN4juce13ScopedPointerINS_14AudioThumbnail15LevelDataSourceEEaSEPS2_(ptr noundef nonnull align 8 dereferenceable(8) %49, ptr noundef %48)
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  %51 = getelementptr inbounds %"class.juce::AudioThumbnail", ptr %8, i32 0, i32 11
  call void @_ZN4juce17GenericScopedLockINS_15CriticalSectionEEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(40) %51) #4
  %52 = getelementptr inbounds %"class.juce::AudioThumbnail", ptr %8, i32 0, i32 3
  %53 = call noundef ptr @_ZNK4juce13ScopedPointerINS_14AudioThumbnail15LevelDataSourceEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %52) #4
  %54 = getelementptr inbounds %"class.juce::AudioThumbnail", ptr %8, i32 0, i32 8
  %55 = load i64, ptr %54, align 8, !tbaa !9
  invoke void @_ZN4juce14AudioThumbnail15LevelDataSource10initialiseEx(ptr noundef nonnull align 8 dereferenceable(124) %53, i64 noundef %55)
          to label %56 unwind label %81

56:                                               ; preds = %47
  %57 = getelementptr inbounds %"class.juce::AudioThumbnail", ptr %8, i32 0, i32 3
  %58 = call noundef ptr @_ZNK4juce13ScopedPointerINS_14AudioThumbnail15LevelDataSourceEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %57) #4
  %59 = getelementptr inbounds %"class.juce::AudioThumbnail::LevelDataSource", ptr %58, i32 0, i32 1
  %60 = load i64, ptr %59, align 8, !tbaa !40
  %61 = getelementptr inbounds %"class.juce::AudioThumbnail", ptr %8, i32 0, i32 7
  store i64 %60, ptr %61, align 8, !tbaa !39
  %62 = getelementptr inbounds %"class.juce::AudioThumbnail", ptr %8, i32 0, i32 3
  %63 = call noundef ptr @_ZNK4juce13ScopedPointerINS_14AudioThumbnail15LevelDataSourceEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %62) #4
  %64 = getelementptr inbounds %"class.juce::AudioThumbnail::LevelDataSource", ptr %63, i32 0, i32 3
  %65 = load double, ptr %64, align 8, !tbaa !42
  %66 = getelementptr inbounds %"class.juce::AudioThumbnail", ptr %8, i32 0, i32 10
  store double %65, ptr %66, align 8, !tbaa !41
  %67 = getelementptr inbounds %"class.juce::AudioThumbnail", ptr %8, i32 0, i32 3
  %68 = call noundef ptr @_ZNK4juce13ScopedPointerINS_14AudioThumbnail15LevelDataSourceEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %67) #4
  %69 = getelementptr inbounds %"class.juce::AudioThumbnail::LevelDataSource", ptr %68, i32 0, i32 4
  %70 = load i32, ptr %69, align 8, !tbaa !44
  %71 = getelementptr inbounds %"class.juce::AudioThumbnail", ptr %8, i32 0, i32 9
  store i32 %70, ptr %71, align 8, !tbaa !43
  %72 = getelementptr inbounds %"class.juce::AudioThumbnail", ptr %8, i32 0, i32 7
  %73 = load i64, ptr %72, align 8, !tbaa !39
  %74 = getelementptr inbounds %"class.juce::AudioThumbnail", ptr %8, i32 0, i32 6
  %75 = load i32, ptr %74, align 8, !tbaa !46
  %76 = sext i32 %75 to i64
  %77 = sdiv i64 %73, %76
  %78 = trunc i64 %77 to i32
  %79 = add nsw i32 1, %78
  invoke void @_ZN4juce14AudioThumbnail14createChannelsEi(ptr noundef nonnull align 8 dereferenceable(200) %8, i32 noundef %79)
          to label %80 unwind label %81

80:                                               ; preds = %56
  call void @_ZN4juce17GenericScopedLockINS_15CriticalSectionEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  br label %85

81:                                               ; preds = %56, %47
  %82 = landingpad { ptr, i32 }
          cleanup
  %83 = extractvalue { ptr, i32 } %82, 0
  store ptr %83, ptr %6, align 8
  %84 = extractvalue { ptr, i32 } %82, 1
  store i32 %84, ptr %7, align 4
  call void @_ZN4juce17GenericScopedLockINS_15CriticalSectionEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  br label %95

85:                                               ; preds = %80, %23
  %86 = getelementptr inbounds %"class.juce::AudioThumbnail", ptr %8, i32 0, i32 10
  %87 = load double, ptr %86, align 8, !tbaa !41
  %88 = fcmp ogt double %87, 0.000000e+00
  br i1 %88, label %89, label %93

89:                                               ; preds = %85
  %90 = getelementptr inbounds %"class.juce::AudioThumbnail", ptr %8, i32 0, i32 7
  %91 = load i64, ptr %90, align 8, !tbaa !39
  %92 = icmp sgt i64 %91, 0
  br label %93

93:                                               ; preds = %89, %85
  %94 = phi i1 [ false, %85 ], [ %92, %89 ]
  ret i1 %94

95:                                               ; preds = %81
  %96 = load ptr, ptr %6, align 8
  %97 = load i32, ptr %7, align 4
  %98 = insertvalue { ptr, i32 } poison, ptr %96, 0
  %99 = insertvalue { ptr, i32 } %98, i32 %97, 1
  resume { ptr, i32 } %99
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN4juce19AudioThumbnailCache9loadThumbERNS_18AudioThumbnailBaseEx(ptr noundef nonnull align 8 dereferenceable(476), ptr noundef nonnull align 8 dereferenceable(64), i64 noundef) #3 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4juce14AudioThumbnail15LevelDataSource10initialiseEx(ptr noundef nonnull align 8 dereferenceable(124), i64 noundef) #3 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 }

!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, !27, i64 136}
!10 = !{!"_ZTSN4juce14AudioThumbnailE", !11, i64 0, !6, i64 64, !6, i64 72, !22, i64 80, !23, i64 88, !24, i64 96, !20, i64 120, !27, i64 128, !27, i64 136, !20, i64 144, !28, i64 152, !29, i64 160}
!11 = !{!"_ZTSN4juce18AudioThumbnailBaseE", !12, i64 0, !21, i64 56}
!12 = !{!"_ZTSN4juce17ChangeBroadcasterE", !13, i64 8, !16, i64 32}
!13 = !{!"_ZTSN4juce17ChangeBroadcaster25ChangeBroadcasterCallbackE", !14, i64 0, !6, i64 16}
!14 = !{!"_ZTSN4juce12AsyncUpdaterE", !15, i64 8}
!15 = !{!"_ZTSN4juce25ReferenceCountedObjectPtrINS_12AsyncUpdater19AsyncUpdaterMessageEEE", !6, i64 0}
!16 = !{!"_ZTSN4juce12ListenerListINS_14ChangeListenerENS_5ArrayIPS1_NS_20DummyCriticalSectionELi0EEEEE", !17, i64 0}
!17 = !{!"_ZTSN4juce5ArrayIPNS_14ChangeListenerENS_20DummyCriticalSectionELi0EEE", !18, i64 0, !20, i64 16}
!18 = !{!"_ZTSN4juce19ArrayAllocationBaseIPNS_14ChangeListenerENS_20DummyCriticalSectionEEE", !19, i64 0, !20, i64 8}
!19 = !{!"_ZTSN4juce9HeapBlockIPNS_14ChangeListenerELb0EEE", !6, i64 0}
!20 = !{!"int", !7, i64 0}
!21 = !{!"_ZTSN4juce17AudioFormatWriter14ThreadedWriter20IncomingDataReceiverE"}
!22 = !{!"_ZTSN4juce13ScopedPointerINS_14AudioThumbnail15LevelDataSourceEEE", !6, i64 0}
!23 = !{!"_ZTSN4juce13ScopedPointerINS_14AudioThumbnail12CachedWindowEEE", !6, i64 0}
!24 = !{!"_ZTSN4juce10OwnedArrayINS_14AudioThumbnail9ThumbDataENS_20DummyCriticalSectionEEE", !25, i64 0, !20, i64 16}
!25 = !{!"_ZTSN4juce19ArrayAllocationBaseIPNS_14AudioThumbnail9ThumbDataENS_20DummyCriticalSectionEEE", !26, i64 0, !20, i64 8}
!26 = !{!"_ZTSN4juce9HeapBlockIPNS_14AudioThumbnail9ThumbDataELb0EEE", !6, i64 0}
!27 = !{!"long long", !7, i64 0}
!28 = !{!"double", !7, i64 0}
!29 = !{!"_ZTSN4juce15CriticalSectionE", !7, i64 0}
!30 = !{!10, !6, i64 72}
!31 = !{!32, !27, i64 48}
!32 = !{!"_ZTSN4juce14AudioThumbnail15LevelDataSourceE", !33, i64 0, !27, i64 16, !27, i64 24, !28, i64 32, !20, i64 40, !27, i64 48, !6, i64 56, !35, i64 64, !36, i64 72, !29, i64 80, !20, i64 120}
!33 = !{!"_ZTSN4juce15TimeSliceClientE", !34, i64 8}
!34 = !{!"_ZTSN4juce4TimeE", !27, i64 0}
!35 = !{!"_ZTSN4juce13ScopedPointerINS_11InputSourceEEE", !6, i64 0}
!36 = !{!"_ZTSN4juce13ScopedPointerINS_17AudioFormatReaderEEE", !6, i64 0}
!37 = !{!38, !38, i64 0}
!38 = !{!"vtable pointer", !8, i64 0}
!39 = !{!10, !27, i64 128}
!40 = !{!32, !27, i64 16}
!41 = !{!10, !28, i64 152}
!42 = !{!32, !28, i64 32}
!43 = !{!10, !20, i64 144}
!44 = !{!32, !20, i64 40}
!45 = !{!32, !27, i64 24}
!46 = !{!10, !20, i64 120}


; 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 nonnull align 8 dereferenceable(8) ptr @_ZN4juce13ScopedPointerINS_14AudioThumbnail15LevelDataSourceEEaSEPS2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #1 align 2

; 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: mustprogress uwtable
declare dso_local void @_ZN4juce14AudioThumbnail14createChannelsEi(ptr noundef nonnull align 8 dereferenceable(200), i32 noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN4juce14AudioThumbnail13setDataSourceEPNS0_15LevelDataSourceE(ptr noundef nonnull align 8 dereferenceable(200) %0, ptr noundef %1) local_unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.juce::GenericScopedLock", align 8
  %4 = getelementptr inbounds i8, ptr %0, i64 136
  store i64 0, ptr %4, align 8, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %0, i64 72
  %6 = load ptr, ptr %5, align 8, !tbaa !29
  %7 = getelementptr inbounds i8, ptr %1, i64 48
  %8 = load i64, ptr %7, align 8, !tbaa !30
  %9 = tail call noundef zeroext i1 @_ZN4juce19AudioThumbnailCache9loadThumbERNS_18AudioThumbnailBaseEx(ptr noundef nonnull align 8 dereferenceable(476) %6, ptr noundef nonnull align 8 dereferenceable(64) %0, i64 noundef %8)
  br i1 %9, label %10, label %33

10:                                               ; preds = %2
  %11 = load ptr, ptr %0, align 8, !tbaa !36
  %12 = getelementptr inbounds i8, ptr %11, i64 88
  %13 = load ptr, ptr %12, align 8
  %14 = tail call noundef zeroext i1 %13(ptr noundef nonnull align 8 dereferenceable(200) %0) #4
  br i1 %14, label %15, label %33

15:                                               ; preds = %10
  %16 = getelementptr inbounds i8, ptr %0, i64 80
  %17 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZN4juce13ScopedPointerINS_14AudioThumbnail15LevelDataSourceEEaSEPS2_(ptr noundef nonnull align 8 dereferenceable(8) %16, ptr noundef nonnull %1)
  %18 = getelementptr inbounds i8, ptr %0, i64 128
  %19 = load i64, ptr %18, align 8, !tbaa !38
  %20 = tail call noundef ptr @_ZNK4juce13ScopedPointerINS_14AudioThumbnail15LevelDataSourceEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %16) #4
  %21 = getelementptr inbounds i8, ptr %20, i64 16
  store i64 %19, ptr %21, align 8, !tbaa !39
  %22 = getelementptr inbounds i8, ptr %0, i64 152
  %23 = load double, ptr %22, align 8, !tbaa !40
  %24 = tail call noundef ptr @_ZNK4juce13ScopedPointerINS_14AudioThumbnail15LevelDataSourceEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %16) #4
  %25 = getelementptr inbounds i8, ptr %24, i64 32
  store double %23, ptr %25, align 8, !tbaa !41
  %26 = getelementptr inbounds i8, ptr %0, i64 144
  %27 = load i32, ptr %26, align 8, !tbaa !42
  %28 = tail call noundef ptr @_ZNK4juce13ScopedPointerINS_14AudioThumbnail15LevelDataSourceEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %16) #4
  %29 = getelementptr inbounds i8, ptr %28, i64 40
  store i32 %27, ptr %29, align 8, !tbaa !43
  %30 = load i64, ptr %4, align 8, !tbaa !5
  %31 = tail call noundef ptr @_ZNK4juce13ScopedPointerINS_14AudioThumbnail15LevelDataSourceEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %16) #4
  %32 = getelementptr inbounds i8, ptr %31, i64 24
  store i64 %30, ptr %32, align 8, !tbaa !44
  br label %62

33:                                               ; preds = %10, %2
  %34 = getelementptr inbounds i8, ptr %0, i64 80
  %35 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZN4juce13ScopedPointerINS_14AudioThumbnail15LevelDataSourceEEaSEPS2_(ptr noundef nonnull align 8 dereferenceable(8) %34, ptr noundef nonnull %1)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #4
  %36 = getelementptr inbounds i8, ptr %0, i64 160
  call void @_ZN4juce17GenericScopedLockINS_15CriticalSectionEEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(40) %36) #4
  %37 = call noundef ptr @_ZNK4juce13ScopedPointerINS_14AudioThumbnail15LevelDataSourceEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %34) #4
  %38 = load i64, ptr %4, align 8, !tbaa !5
  invoke void @_ZN4juce14AudioThumbnail15LevelDataSource10initialiseEx(ptr noundef nonnull align 8 dereferenceable(124) %37, i64 noundef %38)
          to label %39 unwind label %60

39:                                               ; preds = %33
  %40 = call noundef ptr @_ZNK4juce13ScopedPointerINS_14AudioThumbnail15LevelDataSourceEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %34) #4
  %41 = getelementptr inbounds i8, ptr %40, i64 16
  %42 = load i64, ptr %41, align 8, !tbaa !39
  %43 = getelementptr inbounds i8, ptr %0, i64 128
  store i64 %42, ptr %43, align 8, !tbaa !38
  %44 = call noundef ptr @_ZNK4juce13ScopedPointerINS_14AudioThumbnail15LevelDataSourceEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %34) #4
  %45 = getelementptr inbounds i8, ptr %44, i64 32
  %46 = load double, ptr %45, align 8, !tbaa !41
  %47 = getelementptr inbounds i8, ptr %0, i64 152
  store double %46, ptr %47, align 8, !tbaa !40
  %48 = call noundef ptr @_ZNK4juce13ScopedPointerINS_14AudioThumbnail15LevelDataSourceEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %34) #4
  %49 = getelementptr inbounds i8, ptr %48, i64 40
  %50 = load i32, ptr %49, align 8, !tbaa !43
  %51 = getelementptr inbounds i8, ptr %0, i64 144
  store i32 %50, ptr %51, align 8, !tbaa !42
  %52 = load i64, ptr %43, align 8, !tbaa !38
  %53 = getelementptr inbounds i8, ptr %0, i64 120
  %54 = load i32, ptr %53, align 8, !tbaa !45
  %55 = sext i32 %54 to i64
  %56 = sdiv i64 %52, %55
  %57 = trunc i64 %56 to i32
  %58 = add nsw i32 %57, 1
  invoke void @_ZN4juce14AudioThumbnail14createChannelsEi(ptr noundef nonnull align 8 dereferenceable(200) %0, i32 noundef %58)
          to label %59 unwind label %60

59:                                               ; preds = %39
  call void @_ZN4juce17GenericScopedLockINS_15CriticalSectionEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %3) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #4
  br label %62

60:                                               ; preds = %39, %33
  %61 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN4juce17GenericScopedLockINS_15CriticalSectionEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %3) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #4
  resume { ptr, i32 } %61

62:                                               ; preds = %59, %15
  %63 = getelementptr inbounds i8, ptr %0, i64 152
  %64 = load double, ptr %63, align 8, !tbaa !40
  %65 = fcmp ogt double %64, 0.000000e+00
  %66 = getelementptr inbounds i8, ptr %0, i64 128
  %67 = load i64, ptr %66, align 8
  %68 = icmp sgt i64 %67, 0
  %69 = select i1 %65, i1 %68, i1 false
  ret i1 %69
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN4juce19AudioThumbnailCache9loadThumbERNS_18AudioThumbnailBaseEx(ptr noundef nonnull align 8 dereferenceable(476), ptr noundef nonnull align 8 dereferenceable(64), i64 noundef) local_unnamed_addr #3 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4juce14AudioThumbnail15LevelDataSource10initialiseEx(ptr noundef nonnull align 8 dereferenceable(124), i64 noundef) local_unnamed_addr #3 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 }

!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, !26, i64 136}
!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, !12, i64 72}
!30 = !{!31, !26, i64 48}
!31 = !{!"_ZTSN4juce14AudioThumbnail15LevelDataSourceE", !32, i64 0, !26, i64 16, !26, i64 24, !27, i64 32, !19, i64 40, !26, i64 48, !12, i64 56, !34, i64 64, !35, i64 72, !28, i64 80, !19, i64 120}
!32 = !{!"_ZTSN4juce15TimeSliceClientE", !33, i64 8}
!33 = !{!"_ZTSN4juce4TimeE", !26, i64 0}
!34 = !{!"_ZTSN4juce13ScopedPointerINS_11InputSourceEEE", !12, i64 0}
!35 = !{!"_ZTSN4juce13ScopedPointerINS_17AudioFormatReaderEEE", !12, i64 0}
!36 = !{!37, !37, i64 0}
!37 = !{!"vtable pointer", !14, i64 0}
!38 = !{!6, !26, i64 128}
!39 = !{!31, !26, i64 16}
!40 = !{!6, !27, i64 152}
!41 = !{!31, !27, i64 32}
!42 = !{!6, !19, i64 144}
!43 = !{!31, !19, i64 40}
!44 = !{!31, !26, i64 24}
!45 = !{!6, !19, i64 120}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,SimplifyCFGPass,TailCallElimPass