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

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.juce::GenericScopedLock" = type { ptr }
%"class.juce::BufferingAudioSource" = type <{ %"class.juce::PositionableAudioSource", %"class.juce::TimeSliceClient", %"class.juce::OptionalScopedPointer", ptr, i32, i32, %"class.juce::AudioBuffer", %"class.juce::CriticalSection", %"class.juce::WaitableEvent", i64, i64, i64, double, i8, i8, i8, [5 x i8] }>
%"class.juce::PositionableAudioSource" = type { %"class.juce::AudioSource" }
%"class.juce::AudioSource" = type { ptr }
%"class.juce::TimeSliceClient" = type { ptr, %"class.juce::Time" }
%"class.juce::Time" = type { i64 }
%"class.juce::OptionalScopedPointer" = type <{ %"class.juce::ScopedPointer.79", i8, [7 x i8] }>
%"class.juce::ScopedPointer.79" = type { ptr }
%"class.juce::AudioBuffer" = type <{ i32, i32, i64, ptr, %"class.juce::HeapBlock.0", [32 x ptr], i8, [7 x i8] }>
%"class.juce::HeapBlock.0" = 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::WaitableEvent" = type <{ %union.pthread_cond_t, %union.pthread_mutex_t, i8, i8, [6 x i8] }>
%union.pthread_cond_t = type { %struct.__pthread_cond_s }
%struct.__pthread_cond_s = type { %union.__atomic_wide_counter, %union.__atomic_wide_counter, [2 x i32], [2 x i32], i32, i32, [2 x i32] }
%union.__atomic_wide_counter = type { i64 }
%"struct.juce::AudioSourceChannelInfo" = type { ptr, i32, i32 }

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

; 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 #1 align 2

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

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

; Function Attrs: nounwind
declare noundef i32 @_ZN4juce4Time21getMillisecondCounterEv() #2

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN4juce20BufferingAudioSource26waitForNextAudioBlockReadyERKNS_22AudioSourceChannelInfoEj(ptr noundef nonnull align 8 dereferenceable(523) %0, ptr noundef nonnull align 8 dereferenceable(16) %1, i32 noundef %2) #4 align 2 {
  %4 = alloca i1, align 1
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %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 i32, align 4
  %14 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store i32 %2, ptr %7, align 4, !tbaa !9
  %15 = load ptr, ptr %5, align 8
  %16 = getelementptr inbounds %"class.juce::BufferingAudioSource", ptr %15, i32 0, i32 2
  %17 = call noundef ptr @_ZNK4juce21OptionalScopedPointerINS_23PositionableAudioSourceEEcvPS1_Ev(ptr noundef nonnull align 8 dereferenceable(9) %16) #5
  %18 = icmp ne ptr %17, null
  br i1 %18, label %19, label %27

19:                                               ; preds = %3
  %20 = getelementptr inbounds %"class.juce::BufferingAudioSource", ptr %15, i32 0, i32 2
  %21 = call noundef ptr @_ZNK4juce21OptionalScopedPointerINS_23PositionableAudioSourceEEptEv(ptr noundef nonnull align 8 dereferenceable(9) %20) #5
  %22 = load ptr, ptr %21, align 8, !tbaa !11
  %23 = getelementptr inbounds ptr, ptr %22, i64 7
  %24 = load ptr, ptr %23, align 8
  %25 = call noundef i64 %24(ptr noundef nonnull align 8 dereferenceable(8) %21)
  %26 = icmp sle i64 %25, 0
  br i1 %26, label %27, label %28

27:                                               ; preds = %19, %3
  store i1 false, ptr %4, align 1
  br label %149

28:                                               ; preds = %19
  %29 = getelementptr inbounds %"class.juce::BufferingAudioSource", ptr %15, i32 0, i32 11
  %30 = load volatile i64, ptr %29, align 8, !tbaa !13
  %31 = load ptr, ptr %6, align 8, !tbaa !5
  %32 = getelementptr inbounds %"struct.juce::AudioSourceChannelInfo", ptr %31, i32 0, i32 2
  %33 = load i32, ptr %32, align 4, !tbaa !29
  %34 = sext i32 %33 to i64
  %35 = add nsw i64 %30, %34
  %36 = icmp slt i64 %35, 0
  br i1 %36, label %37, label %38

37:                                               ; preds = %28
  store i1 true, ptr %4, align 1
  br label %149

38:                                               ; preds = %28
  %39 = load ptr, ptr %15, align 8, !tbaa !11
  %40 = getelementptr inbounds ptr, ptr %39, i64 8
  %41 = load ptr, ptr %40, align 8
  %42 = call noundef zeroext i1 %41(ptr noundef nonnull align 8 dereferenceable(523) %15)
  br i1 %42, label %52, label %43

43:                                               ; preds = %38
  %44 = getelementptr inbounds %"class.juce::BufferingAudioSource", ptr %15, i32 0, i32 11
  %45 = load volatile i64, ptr %44, align 8, !tbaa !13
  %46 = load ptr, ptr %15, align 8, !tbaa !11
  %47 = getelementptr inbounds ptr, ptr %46, i64 7
  %48 = load ptr, ptr %47, align 8
  %49 = call noundef i64 %48(ptr noundef nonnull align 8 dereferenceable(523) %15)
  %50 = icmp sgt i64 %45, %49
  br i1 %50, label %51, label %52

51:                                               ; preds = %43
  store i1 true, ptr %4, align 1
  br label %149

52:                                               ; preds = %43, %38
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  %53 = call noundef i32 @_ZN4juce4Time21getMillisecondCounterEv() #5
  store i32 %53, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  %54 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %54, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %55 = load i32, ptr %8, align 4, !tbaa !9
  %56 = load i32, ptr %9, align 4, !tbaa !9
  %57 = icmp uge i32 %55, %56
  br i1 %57, label %58, label %62

58:                                               ; preds = %52
  %59 = load i32, ptr %8, align 4, !tbaa !9
  %60 = load i32, ptr %9, align 4, !tbaa !9
  %61 = sub i32 %59, %60
  br label %68

62:                                               ; preds = %52
  %63 = call noundef i32 @_ZNSt14numeric_limitsIjE3maxEv() #5
  %64 = load i32, ptr %9, align 4, !tbaa !9
  %65 = sub i32 %63, %64
  %66 = load i32, ptr %8, align 4, !tbaa !9
  %67 = add i32 %65, %66
  br label %68

68:                                               ; preds = %62, %58
  %69 = phi i32 [ %61, %58 ], [ %67, %62 ]
  store i32 %69, ptr %10, align 4, !tbaa !9
  br label %70

70:                                               ; preds = %145, %68
  %71 = load i32, ptr %10, align 4, !tbaa !9
  %72 = load i32, ptr %7, align 4, !tbaa !9
  %73 = icmp ule i32 %71, %72
  br i1 %73, label %74, label %147

74:                                               ; preds = %70
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %75 = getelementptr inbounds %"class.juce::BufferingAudioSource", ptr %15, i32 0, i32 7
  call void @_ZN4juce17GenericScopedLockINS_15CriticalSectionEEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(40) %75) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  %76 = getelementptr inbounds %"class.juce::BufferingAudioSource", ptr %15, i32 0, i32 9
  %77 = load volatile i64, ptr %76, align 8, !tbaa !31
  %78 = getelementptr inbounds %"class.juce::BufferingAudioSource", ptr %15, i32 0, i32 10
  %79 = load volatile i64, ptr %78, align 8, !tbaa !32
  %80 = getelementptr inbounds %"class.juce::BufferingAudioSource", ptr %15, i32 0, i32 11
  %81 = load volatile i64, ptr %80, align 8, !tbaa !13
  %82 = call noundef i64 @_ZN4juce6jlimitIxEET_S1_S1_S1_(i64 noundef %77, i64 noundef %79, i64 noundef %81) #5
  %83 = getelementptr inbounds %"class.juce::BufferingAudioSource", ptr %15, i32 0, i32 11
  %84 = load volatile i64, ptr %83, align 8, !tbaa !13
  %85 = sub nsw i64 %82, %84
  %86 = trunc i64 %85 to i32
  store i32 %86, ptr %12, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  %87 = getelementptr inbounds %"class.juce::BufferingAudioSource", ptr %15, i32 0, i32 9
  %88 = load volatile i64, ptr %87, align 8, !tbaa !31
  %89 = getelementptr inbounds %"class.juce::BufferingAudioSource", ptr %15, i32 0, i32 10
  %90 = load volatile i64, ptr %89, align 8, !tbaa !32
  %91 = getelementptr inbounds %"class.juce::BufferingAudioSource", ptr %15, i32 0, i32 11
  %92 = load volatile i64, ptr %91, align 8, !tbaa !13
  %93 = load ptr, ptr %6, align 8, !tbaa !5
  %94 = getelementptr inbounds %"struct.juce::AudioSourceChannelInfo", ptr %93, i32 0, i32 2
  %95 = load i32, ptr %94, align 4, !tbaa !29
  %96 = sext i32 %95 to i64
  %97 = add nsw i64 %92, %96
  %98 = call noundef i64 @_ZN4juce6jlimitIxEET_S1_S1_S1_(i64 noundef %88, i64 noundef %90, i64 noundef %97) #5
  %99 = getelementptr inbounds %"class.juce::BufferingAudioSource", ptr %15, i32 0, i32 11
  %100 = load volatile i64, ptr %99, align 8, !tbaa !13
  %101 = sub nsw i64 %98, %100
  %102 = trunc i64 %101 to i32
  store i32 %102, ptr %13, align 4, !tbaa !9
  %103 = load i32, ptr %12, align 4, !tbaa !9
  %104 = icmp sle i32 %103, 0
  br i1 %104, label %105, label %116

105:                                              ; preds = %74
  %106 = load i32, ptr %12, align 4, !tbaa !9
  %107 = load i32, ptr %13, align 4, !tbaa !9
  %108 = icmp slt i32 %106, %107
  br i1 %108, label %109, label %116

109:                                              ; preds = %105
  %110 = load i32, ptr %13, align 4, !tbaa !9
  %111 = load ptr, ptr %6, align 8, !tbaa !5
  %112 = getelementptr inbounds %"struct.juce::AudioSourceChannelInfo", ptr %111, i32 0, i32 2
  %113 = load i32, ptr %112, align 4, !tbaa !29
  %114 = icmp sge i32 %110, %113
  br i1 %114, label %115, label %116

115:                                              ; preds = %109
  store i1 true, ptr %4, align 1
  store i32 1, ptr %14, align 4
  br label %117

116:                                              ; preds = %109, %105, %74
  store i32 0, ptr %14, align 4
  br label %117

117:                                              ; preds = %116, %115
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #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
  %118 = load i32, ptr %14, align 4
  switch i32 %118, label %148 [
    i32 0, label %119
  ]

119:                                              ; preds = %117
  %120 = load i32, ptr %10, align 4, !tbaa !9
  %121 = load i32, ptr %7, align 4, !tbaa !9
  %122 = icmp ult i32 %120, %121
  br i1 %122, label %123, label %130

123:                                              ; preds = %119
  %124 = getelementptr inbounds %"class.juce::BufferingAudioSource", ptr %15, i32 0, i32 8
  %125 = load i32, ptr %7, align 4, !tbaa !9
  %126 = load i32, ptr %10, align 4, !tbaa !9
  %127 = sub i32 %125, %126
  %128 = call noundef zeroext i1 @_ZNK4juce13WaitableEvent4waitEi(ptr noundef nonnull align 8 dereferenceable(90) %124, i32 noundef %127) #5
  br i1 %128, label %130, label %129

129:                                              ; preds = %123
  store i1 false, ptr %4, align 1
  store i32 1, ptr %14, align 4
  br label %148

130:                                              ; preds = %123, %119
  %131 = call noundef i32 @_ZN4juce4Time21getMillisecondCounterEv() #5
  store i32 %131, ptr %8, align 4, !tbaa !9
  %132 = load i32, ptr %8, align 4, !tbaa !9
  %133 = load i32, ptr %9, align 4, !tbaa !9
  %134 = icmp uge i32 %132, %133
  br i1 %134, label %135, label %139

135:                                              ; preds = %130
  %136 = load i32, ptr %8, align 4, !tbaa !9
  %137 = load i32, ptr %9, align 4, !tbaa !9
  %138 = sub i32 %136, %137
  br label %145

139:                                              ; preds = %130
  %140 = call noundef i32 @_ZNSt14numeric_limitsIjE3maxEv() #5
  %141 = load i32, ptr %9, align 4, !tbaa !9
  %142 = sub i32 %140, %141
  %143 = load i32, ptr %8, align 4, !tbaa !9
  %144 = add i32 %142, %143
  br label %145

145:                                              ; preds = %139, %135
  %146 = phi i32 [ %138, %135 ], [ %144, %139 ]
  store i32 %146, ptr %10, align 4, !tbaa !9
  br label %70, !llvm.loop !33

147:                                              ; preds = %70
  store i1 false, ptr %4, align 1
  store i32 1, ptr %14, align 4
  br label %148

148:                                              ; preds = %147, %129, %117
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %149

149:                                              ; preds = %148, %51, %37, %27
  %150 = load i1, ptr %4, align 1
  ret i1 %150
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNSt14numeric_limitsIjE3maxEv() #3 align 2

; Function Attrs: nounwind
declare noundef zeroext i1 @_ZNK4juce13WaitableEvent4waitEi(ptr noundef nonnull align 8 dereferenceable(90), i32 noundef) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 #3 = { 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 #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 = !{!12, !12, i64 0}
!12 = !{!"vtable pointer", !8, i64 0}
!13 = !{!14, !19, i64 504}
!14 = !{!"_ZTSN4juce20BufferingAudioSourceE", !15, i64 0, !17, i64 8, !20, i64 24, !6, i64 40, !10, i64 48, !10, i64 52, !23, i64 56, !26, i64 352, !27, i64 392, !19, i64 488, !19, i64 496, !19, i64 504, !28, i64 512, !22, i64 520, !22, i64 521, !22, i64 522}
!15 = !{!"_ZTSN4juce23PositionableAudioSourceE", !16, i64 0}
!16 = !{!"_ZTSN4juce11AudioSourceE"}
!17 = !{!"_ZTSN4juce15TimeSliceClientE", !18, i64 8}
!18 = !{!"_ZTSN4juce4TimeE", !19, i64 0}
!19 = !{!"long long", !7, i64 0}
!20 = !{!"_ZTSN4juce21OptionalScopedPointerINS_23PositionableAudioSourceEEE", !21, i64 0, !22, i64 8}
!21 = !{!"_ZTSN4juce13ScopedPointerINS_23PositionableAudioSourceEEE", !6, i64 0}
!22 = !{!"bool", !7, i64 0}
!23 = !{!"_ZTSN4juce11AudioBufferIfEE", !10, i64 0, !10, i64 4, !24, i64 8, !6, i64 16, !25, i64 24, !7, i64 32, !22, i64 288}
!24 = !{!"long", !7, i64 0}
!25 = !{!"_ZTSN4juce9HeapBlockIcLb1EEE", !6, i64 0}
!26 = !{!"_ZTSN4juce15CriticalSectionE", !7, i64 0}
!27 = !{!"_ZTSN4juce13WaitableEventE", !7, i64 0, !7, i64 48, !22, i64 88, !22, i64 89}
!28 = !{!"double", !7, i64 0}
!29 = !{!30, !10, i64 12}
!30 = !{!"_ZTSN4juce22AudioSourceChannelInfoE", !6, i64 0, !10, i64 8, !10, i64 12}
!31 = !{!14, !19, i64 488}
!32 = !{!14, !19, i64 496}
!33 = distinct !{!33, !34}
!34 = !{!"llvm.loop.mustprogress"}


; 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

; 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 #1 align 2

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

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

; Function Attrs: nounwind
declare noundef i32 @_ZN4juce4Time21getMillisecondCounterEv() local_unnamed_addr #2

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN4juce20BufferingAudioSource26waitForNextAudioBlockReadyERKNS_22AudioSourceChannelInfoEj(ptr noundef nonnull align 8 dereferenceable(523) %0, ptr nocapture noundef nonnull readonly align 8 dereferenceable(16) %1, i32 noundef %2) local_unnamed_addr #4 align 2 {
  %4 = alloca %"class.juce::GenericScopedLock", align 8
  %5 = getelementptr inbounds i8, ptr %0, i64 24
  %6 = tail call noundef ptr @_ZNK4juce21OptionalScopedPointerINS_23PositionableAudioSourceEEcvPS1_Ev(ptr noundef nonnull align 8 dereferenceable(9) %5) #5
  %.not = icmp eq ptr %6, null
  br i1 %.not, label %.loopexit, label %7

7:                                                ; preds = %3
  %8 = tail call noundef ptr @_ZNK4juce21OptionalScopedPointerINS_23PositionableAudioSourceEEptEv(ptr noundef nonnull align 8 dereferenceable(9) %5) #5
  %9 = load ptr, ptr %8, align 8, !tbaa !5
  %10 = getelementptr inbounds i8, ptr %9, i64 56
  %11 = load ptr, ptr %10, align 8
  %12 = tail call noundef i64 %11(ptr noundef nonnull align 8 dereferenceable(8) %8)
  %13 = icmp slt i64 %12, 1
  br i1 %13, label %.loopexit, label %14

14:                                               ; preds = %7
  %15 = getelementptr inbounds i8, ptr %0, i64 504
  %16 = load volatile i64, ptr %15, align 8, !tbaa !8
  %17 = getelementptr inbounds i8, ptr %1, i64 12
  %18 = load i32, ptr %17, align 4, !tbaa !27
  %19 = sext i32 %18 to i64
  %20 = add nsw i64 %16, %19
  %21 = icmp slt i64 %20, 0
  br i1 %21, label %.loopexit, label %22

22:                                               ; preds = %14
  %23 = load ptr, ptr %0, align 8, !tbaa !5
  %24 = getelementptr inbounds i8, ptr %23, i64 64
  %25 = load ptr, ptr %24, align 8
  %26 = tail call noundef zeroext i1 %25(ptr noundef nonnull align 8 dereferenceable(523) %0)
  br i1 %26, label %34, label %27

27:                                               ; preds = %22
  %28 = load volatile i64, ptr %15, align 8, !tbaa !8
  %29 = load ptr, ptr %0, align 8, !tbaa !5
  %30 = getelementptr inbounds i8, ptr %29, i64 56
  %31 = load ptr, ptr %30, align 8
  %32 = tail call noundef i64 %31(ptr noundef nonnull align 8 dereferenceable(523) %0)
  %33 = icmp sgt i64 %28, %32
  br i1 %33, label %.loopexit, label %34

34:                                               ; preds = %27, %22
  %35 = tail call noundef i32 @_ZN4juce4Time21getMillisecondCounterEv() #5
  %36 = getelementptr inbounds i8, ptr %0, i64 352
  %37 = getelementptr inbounds i8, ptr %0, i64 488
  %38 = getelementptr inbounds i8, ptr %0, i64 496
  %39 = getelementptr inbounds i8, ptr %0, i64 392
  br label %40

40:                                               ; preds = %34, %73
  %.02944 = phi i32 [ 0, %34 ], [ %74, %73 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  call void @_ZN4juce17GenericScopedLockINS_15CriticalSectionEEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(40) %36) #5
  %41 = load volatile i64, ptr %37, align 8, !tbaa !29
  %42 = load volatile i64, ptr %38, align 8, !tbaa !30
  %43 = load volatile i64, ptr %15, align 8, !tbaa !8
  %44 = call noundef i64 @_ZN4juce6jlimitIxEET_S1_S1_S1_(i64 noundef %41, i64 noundef %42, i64 noundef %43) #5
  %45 = load volatile i64, ptr %15, align 8, !tbaa !8
  %46 = sub nsw i64 %44, %45
  %47 = trunc i64 %46 to i32
  %48 = load volatile i64, ptr %37, align 8, !tbaa !29
  %49 = load volatile i64, ptr %38, align 8, !tbaa !30
  %50 = load volatile i64, ptr %15, align 8, !tbaa !8
  %51 = load i32, ptr %17, align 4, !tbaa !27
  %52 = sext i32 %51 to i64
  %53 = add nsw i64 %50, %52
  %54 = call noundef i64 @_ZN4juce6jlimitIxEET_S1_S1_S1_(i64 noundef %48, i64 noundef %49, i64 noundef %53) #5
  %55 = load volatile i64, ptr %15, align 8, !tbaa !8
  %56 = sub nsw i64 %54, %55
  %57 = trunc i64 %56 to i32
  %58 = icmp slt i32 %47, 1
  %59 = icmp slt i32 %47, %57
  %or.cond.not43.not47 = select i1 %58, i1 %59, i1 false
  %60 = load i32, ptr %17, align 4
  %.not38 = icmp sle i32 %60, %57
  %or.cond40.not = select i1 %or.cond.not43.not47, i1 %.not38, i1 false
  call void @_ZN4juce17GenericScopedLockINS_15CriticalSectionEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  br i1 %or.cond40.not, label %.loopexit, label %.critedge

.critedge:                                        ; preds = %40
  %61 = icmp ult i32 %.02944, %2
  br i1 %61, label %62, label %65

62:                                               ; preds = %.critedge
  %63 = sub i32 %2, %.02944
  %64 = call noundef zeroext i1 @_ZNK4juce13WaitableEvent4waitEi(ptr noundef nonnull align 8 dereferenceable(90) %39, i32 noundef %63) #5
  br i1 %64, label %65, label %.loopexit

65:                                               ; preds = %62, %.critedge
  %66 = call noundef i32 @_ZN4juce4Time21getMillisecondCounterEv() #5
  %.not39 = icmp ult i32 %66, %35
  br i1 %.not39, label %69, label %67

67:                                               ; preds = %65
  %68 = sub i32 %66, %35
  br label %73

69:                                               ; preds = %65
  %70 = call noundef i32 @_ZNSt14numeric_limitsIjE3maxEv() #5
  %71 = sub i32 %66, %35
  %72 = add i32 %71, %70
  br label %73

73:                                               ; preds = %69, %67
  %74 = phi i32 [ %68, %67 ], [ %72, %69 ]
  %.not37 = icmp ugt i32 %74, %2
  br i1 %.not37, label %.loopexit, label %40, !llvm.loop !31

.loopexit:                                        ; preds = %62, %73, %40, %27, %14, %3, %7
  %.3 = phi i1 [ false, %7 ], [ false, %3 ], [ true, %14 ], [ true, %27 ], [ %or.cond40.not, %40 ], [ %or.cond40.not, %73 ], [ %or.cond40.not, %62 ]
  ret i1 %.3
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNSt14numeric_limitsIjE3maxEv() local_unnamed_addr #3 align 2

; Function Attrs: nounwind
declare noundef zeroext i1 @_ZNK4juce13WaitableEvent4waitEi(ptr noundef nonnull align 8 dereferenceable(90), i32 noundef) local_unnamed_addr #2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 #3 = { 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 #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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !14, i64 504}
!9 = !{!"_ZTSN4juce20BufferingAudioSourceE", !10, i64 0, !12, i64 8, !16, i64 24, !18, i64 40, !20, i64 48, !20, i64 52, !21, i64 56, !24, i64 352, !25, i64 392, !14, i64 488, !14, i64 496, !14, i64 504, !26, i64 512, !19, i64 520, !19, i64 521, !19, i64 522}
!10 = !{!"_ZTSN4juce23PositionableAudioSourceE", !11, i64 0}
!11 = !{!"_ZTSN4juce11AudioSourceE"}
!12 = !{!"_ZTSN4juce15TimeSliceClientE", !13, i64 8}
!13 = !{!"_ZTSN4juce4TimeE", !14, i64 0}
!14 = !{!"long long", !15, i64 0}
!15 = !{!"omnipotent char", !7, i64 0}
!16 = !{!"_ZTSN4juce21OptionalScopedPointerINS_23PositionableAudioSourceEEE", !17, i64 0, !19, i64 8}
!17 = !{!"_ZTSN4juce13ScopedPointerINS_23PositionableAudioSourceEEE", !18, i64 0}
!18 = !{!"any pointer", !15, i64 0}
!19 = !{!"bool", !15, i64 0}
!20 = !{!"int", !15, i64 0}
!21 = !{!"_ZTSN4juce11AudioBufferIfEE", !20, i64 0, !20, i64 4, !22, i64 8, !18, i64 16, !23, i64 24, !15, i64 32, !19, i64 288}
!22 = !{!"long", !15, i64 0}
!23 = !{!"_ZTSN4juce9HeapBlockIcLb1EEE", !18, i64 0}
!24 = !{!"_ZTSN4juce15CriticalSectionE", !15, i64 0}
!25 = !{!"_ZTSN4juce13WaitableEventE", !15, i64 0, !15, i64 48, !19, i64 88, !19, i64 89}
!26 = !{!"double", !15, i64 0}
!27 = !{!28, !20, i64 12}
!28 = !{!"_ZTSN4juce22AudioSourceChannelInfoE", !18, i64 0, !20, i64 8, !20, i64 12}
!29 = !{!9, !14, i64 488}
!30 = !{!9, !14, i64 496}
!31 = distinct !{!31, !32}
!32 = !{!"llvm.loop.mustprogress"}


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