; 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 }
%"struct.juce::AudioSourceChannelInfo" = type { ptr, i32, i32 }
%"class.juce::MixerAudioSource" = type <{ %"class.juce::AudioSource", %"class.juce::Array.99", %"class.juce::BigInteger", %"class.juce::CriticalSection", %"class.juce::AudioBuffer", double, i32, [4 x i8] }>
%"class.juce::AudioSource" = type { ptr }
%"class.juce::Array.99" = type { %"class.juce::ArrayAllocationBase.100", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.100" = type <{ %"class.juce::HeapBlock.101", i32, [4 x i8] }>
%"class.juce::HeapBlock.101" = type { ptr }
%"class.juce::BigInteger" = type <{ %"class.juce::HeapBlock.9", [4 x i32], i64, i32, i8, [3 x i8] }>
%"class.juce::HeapBlock.9" = 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::AudioBuffer" = type <{ i32, i32, i64, ptr, %"class.juce::HeapBlock.0", [32 x ptr], i8, [7 x i8] }>
%"class.juce::HeapBlock.0" = type { ptr }

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

; Function Attrs: 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

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: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN4juce17GenericScopedLockINS_15CriticalSectionEED2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #1 align 2

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4juce11AudioBufferIfE7setSizeEiibbb(ptr noundef nonnull align 8 dereferenceable(289), i32 noundef, i32 noundef, i1 noundef zeroext, i1 noundef zeroext, i1 noundef zeroext) #2 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4juce22AudioSourceChannelInfoC2EPNS_11AudioBufferIfEEii(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef, i32 noundef, i32 noundef) unnamed_addr #2 align 2

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4juce16MixerAudioSource17getNextAudioBlockERKNS_22AudioSourceChannelInfoE(ptr noundef nonnull align 8 dereferenceable(420) %0, ptr noundef nonnull align 8 dereferenceable(16) %1) unnamed_addr #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
  %8 = alloca %"struct.juce::AudioSourceChannelInfo", align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %12 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  %13 = getelementptr inbounds %"class.juce::MixerAudioSource", ptr %12, i32 0, i32 3
  call void @_ZN4juce17GenericScopedLockINS_15CriticalSectionEEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(40) %13) #4
  %14 = getelementptr inbounds %"class.juce::MixerAudioSource", ptr %12, i32 0, i32 1
  %15 = call noundef i32 @_ZNK4juce5ArrayIPNS_11AudioSourceENS_20DummyCriticalSectionELi0EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20) %14) #4
  %16 = icmp sgt i32 %15, 0
  br i1 %16, label %17, label %98

17:                                               ; preds = %2
  %18 = getelementptr inbounds %"class.juce::MixerAudioSource", ptr %12, i32 0, i32 1
  %19 = invoke noundef ptr @_ZNK4juce5ArrayIPNS_11AudioSourceENS_20DummyCriticalSectionELi0EE12getUncheckedEi(ptr noundef nonnull align 8 dereferenceable(20) %18, i32 noundef 0)
          to label %20 unwind label %51

20:                                               ; preds = %17
  %21 = load ptr, ptr %4, align 8, !tbaa !5
  %22 = load ptr, ptr %19, align 8, !tbaa !9
  %23 = getelementptr inbounds ptr, ptr %22, i64 4
  %24 = load ptr, ptr %23, align 8
  invoke void %24(ptr noundef nonnull align 8 dereferenceable(8) %19, ptr noundef nonnull align 8 dereferenceable(16) %21)
          to label %25 unwind label %51

25:                                               ; preds = %20
  %26 = getelementptr inbounds %"class.juce::MixerAudioSource", ptr %12, i32 0, i32 1
  %27 = call noundef i32 @_ZNK4juce5ArrayIPNS_11AudioSourceENS_20DummyCriticalSectionELi0EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20) %26) #4
  %28 = icmp sgt i32 %27, 1
  br i1 %28, label %29, label %97

29:                                               ; preds = %25
  %30 = getelementptr inbounds %"class.juce::MixerAudioSource", ptr %12, i32 0, i32 4
  %31 = load ptr, ptr %4, align 8, !tbaa !5
  %32 = getelementptr inbounds %"struct.juce::AudioSourceChannelInfo", ptr %31, i32 0, i32 0
  %33 = load ptr, ptr %32, align 8, !tbaa !11
  %34 = call noundef i32 @_ZNK4juce11AudioBufferIfE14getNumChannelsEv(ptr noundef nonnull align 8 dereferenceable(289) %33) #4
  %35 = invoke noundef i32 @_ZN4juce4jmaxIiEET_S1_S1_(i32 noundef 1, i32 noundef %34)
          to label %36 unwind label %51

36:                                               ; preds = %29
  %37 = load ptr, ptr %4, align 8, !tbaa !5
  %38 = getelementptr inbounds %"struct.juce::AudioSourceChannelInfo", ptr %37, i32 0, i32 0
  %39 = load ptr, ptr %38, align 8, !tbaa !11
  %40 = call noundef i32 @_ZNK4juce11AudioBufferIfE13getNumSamplesEv(ptr noundef nonnull align 8 dereferenceable(289) %39) #4
  call void @_ZN4juce11AudioBufferIfE7setSizeEiibbb(ptr noundef nonnull align 8 dereferenceable(289) %30, i32 noundef %35, i32 noundef %40, i1 noundef zeroext false, i1 noundef zeroext false, i1 noundef zeroext false) #4
  call void @llvm.lifetime.start.p0(i64 16, ptr %8) #4
  %41 = getelementptr inbounds %"class.juce::MixerAudioSource", ptr %12, i32 0, i32 4
  %42 = load ptr, ptr %4, align 8, !tbaa !5
  %43 = getelementptr inbounds %"struct.juce::AudioSourceChannelInfo", ptr %42, i32 0, i32 2
  %44 = load i32, ptr %43, align 4, !tbaa !14
  call void @_ZN4juce22AudioSourceChannelInfoC2EPNS_11AudioBufferIfEEii(ptr noundef nonnull align 8 dereferenceable(16) %8, ptr noundef %41, i32 noundef 0, i32 noundef %44) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  store i32 1, ptr %9, align 4, !tbaa !15
  br label %45

45:                                               ; preds = %93, %36
  %46 = load i32, ptr %9, align 4, !tbaa !15
  %47 = getelementptr inbounds %"class.juce::MixerAudioSource", ptr %12, i32 0, i32 1
  %48 = call noundef i32 @_ZNK4juce5ArrayIPNS_11AudioSourceENS_20DummyCriticalSectionELi0EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20) %47) #4
  %49 = icmp slt i32 %46, %48
  br i1 %49, label %55, label %50

50:                                               ; preds = %45
  store i32 2, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  br label %96

51:                                               ; preds = %98, %29, %20, %17
  %52 = landingpad { ptr, i32 }
          cleanup
  %53 = extractvalue { ptr, i32 } %52, 0
  store ptr %53, ptr %6, align 8
  %54 = extractvalue { ptr, i32 } %52, 1
  store i32 %54, ptr %7, align 4
  br label %102

55:                                               ; preds = %45
  %56 = getelementptr inbounds %"class.juce::MixerAudioSource", ptr %12, i32 0, i32 1
  %57 = load i32, ptr %9, align 4, !tbaa !15
  %58 = invoke noundef ptr @_ZNK4juce5ArrayIPNS_11AudioSourceENS_20DummyCriticalSectionELi0EE12getUncheckedEi(ptr noundef nonnull align 8 dereferenceable(20) %56, i32 noundef %57)
          to label %59 unwind label %72

59:                                               ; preds = %55
  %60 = load ptr, ptr %58, align 8, !tbaa !9
  %61 = getelementptr inbounds ptr, ptr %60, i64 4
  %62 = load ptr, ptr %61, align 8
  invoke void %62(ptr noundef nonnull align 8 dereferenceable(8) %58, ptr noundef nonnull align 8 dereferenceable(16) %8)
          to label %63 unwind label %72

63:                                               ; preds = %59
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  store i32 0, ptr %11, align 4, !tbaa !15
  br label %64

64:                                               ; preds = %89, %63
  %65 = load i32, ptr %11, align 4, !tbaa !15
  %66 = load ptr, ptr %4, align 8, !tbaa !5
  %67 = getelementptr inbounds %"struct.juce::AudioSourceChannelInfo", ptr %66, i32 0, i32 0
  %68 = load ptr, ptr %67, align 8, !tbaa !11
  %69 = call noundef i32 @_ZNK4juce11AudioBufferIfE14getNumChannelsEv(ptr noundef nonnull align 8 dereferenceable(289) %68) #4
  %70 = icmp slt i32 %65, %69
  br i1 %70, label %76, label %71

71:                                               ; preds = %64
  store i32 5, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  br label %92

72:                                               ; preds = %59, %55
  %73 = landingpad { ptr, i32 }
          cleanup
  %74 = extractvalue { ptr, i32 } %73, 0
  store ptr %74, ptr %6, align 8
  %75 = extractvalue { ptr, i32 } %73, 1
  store i32 %75, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %8) #4
  br label %102

76:                                               ; preds = %64
  %77 = load ptr, ptr %4, align 8, !tbaa !5
  %78 = getelementptr inbounds %"struct.juce::AudioSourceChannelInfo", ptr %77, i32 0, i32 0
  %79 = load ptr, ptr %78, align 8, !tbaa !11
  %80 = load i32, ptr %11, align 4, !tbaa !15
  %81 = load ptr, ptr %4, align 8, !tbaa !5
  %82 = getelementptr inbounds %"struct.juce::AudioSourceChannelInfo", ptr %81, i32 0, i32 1
  %83 = load i32, ptr %82, align 8, !tbaa !16
  %84 = getelementptr inbounds %"class.juce::MixerAudioSource", ptr %12, i32 0, i32 4
  %85 = load i32, ptr %11, align 4, !tbaa !15
  %86 = load ptr, ptr %4, align 8, !tbaa !5
  %87 = getelementptr inbounds %"struct.juce::AudioSourceChannelInfo", ptr %86, i32 0, i32 2
  %88 = load i32, ptr %87, align 4, !tbaa !14
  call void @_ZN4juce11AudioBufferIfE7addFromEiiRKS1_iiif(ptr noundef nonnull align 8 dereferenceable(289) %79, i32 noundef %80, i32 noundef %83, ptr noundef nonnull align 8 dereferenceable(289) %84, i32 noundef %85, i32 noundef 0, i32 noundef %88, float noundef 1.000000e+00) #4
  br label %89

89:                                               ; preds = %76
  %90 = load i32, ptr %11, align 4, !tbaa !15
  %91 = add nsw i32 %90, 1
  store i32 %91, ptr %11, align 4, !tbaa !15
  br label %64, !llvm.loop !17

92:                                               ; preds = %71
  br label %93

93:                                               ; preds = %92
  %94 = load i32, ptr %9, align 4, !tbaa !15
  %95 = add nsw i32 %94, 1
  store i32 %95, ptr %9, align 4, !tbaa !15
  br label %45, !llvm.loop !19

96:                                               ; preds = %50
  call void @llvm.lifetime.end.p0(i64 16, ptr %8) #4
  br label %97

97:                                               ; preds = %96, %25
  br label %101

98:                                               ; preds = %2
  %99 = load ptr, ptr %4, align 8, !tbaa !5
  invoke void @_ZNK4juce22AudioSourceChannelInfo23clearActiveBufferRegionEv(ptr noundef nonnull align 8 dereferenceable(16) %99)
          to label %100 unwind label %51

100:                                              ; preds = %98
  br label %101

101:                                              ; preds = %100, %97
  call void @_ZN4juce17GenericScopedLockINS_15CriticalSectionEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  ret void

102:                                              ; preds = %72, %51
  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 %103

103:                                              ; preds = %102
  %104 = load ptr, ptr %6, align 8
  %105 = load i32, ptr %7, align 4
  %106 = insertvalue { ptr, i32 } poison, ptr %104, 0
  %107 = insertvalue { ptr, i32 } %106, i32 %105, 1
  resume { ptr, i32 } %107
}

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

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

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


; 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 }
%"struct.juce::AudioSourceChannelInfo" = type { ptr, i32, i32 }

; 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

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: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN4juce17GenericScopedLockINS_15CriticalSectionEED2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #1 align 2

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4juce22AudioSourceChannelInfoC2EPNS_11AudioBufferIfEEii(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef, i32 noundef, i32 noundef) unnamed_addr #2 align 2

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4juce16MixerAudioSource17getNextAudioBlockERKNS_22AudioSourceChannelInfoE(ptr noundef nonnull align 8 dereferenceable(420) %0, ptr noundef nonnull align 8 dereferenceable(16) %1) unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.juce::GenericScopedLock", align 8
  %4 = alloca %"struct.juce::AudioSourceChannelInfo", align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #4
  %5 = getelementptr inbounds i8, ptr %0, i64 72
  call void @_ZN4juce17GenericScopedLockINS_15CriticalSectionEEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(40) %5) #4
  %6 = getelementptr inbounds i8, ptr %0, i64 8
  %7 = call noundef i32 @_ZNK4juce5ArrayIPNS_11AudioSourceENS_20DummyCriticalSectionELi0EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20) %6) #4
  %8 = icmp sgt i32 %7, 0
  br i1 %8, label %9, label %51

9:                                                ; preds = %2
  %10 = call noundef ptr @_ZNK4juce5ArrayIPNS_11AudioSourceENS_20DummyCriticalSectionELi0EE12getUncheckedEi(ptr noundef nonnull align 8 dereferenceable(20) %6, i32 noundef 0)
  %11 = load ptr, ptr %10, align 8, !tbaa !5
  %12 = getelementptr inbounds i8, ptr %11, i64 32
  %13 = load ptr, ptr %12, align 8
  invoke void %13(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(16) %1)
          to label %14 unwind label %29

14:                                               ; preds = %9
  %15 = call noundef i32 @_ZNK4juce5ArrayIPNS_11AudioSourceENS_20DummyCriticalSectionELi0EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20) %6) #4
  %16 = icmp sgt i32 %15, 1
  br i1 %16, label %17, label %52

17:                                               ; preds = %14
  %18 = getelementptr inbounds i8, ptr %0, i64 112
  %19 = load ptr, ptr %1, align 8, !tbaa !8
  %20 = call noundef i32 @_ZNK4juce11AudioBufferIfE14getNumChannelsEv(ptr noundef nonnull align 8 dereferenceable(289) %19) #4
  %21 = call noundef i32 @_ZN4juce4jmaxIiEET_S1_S1_(i32 noundef 1, i32 noundef %20)
  %22 = load ptr, ptr %1, align 8, !tbaa !8
  %23 = call noundef i32 @_ZNK4juce11AudioBufferIfE13getNumSamplesEv(ptr noundef nonnull align 8 dereferenceable(289) %22) #4
  call void @_ZN4juce11AudioBufferIfE7setSizeEiibbb(ptr noundef nonnull align 8 dereferenceable(289) %18, i32 noundef %21, i32 noundef %23, i1 noundef zeroext false, i1 noundef zeroext false, i1 noundef zeroext false) #4
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #4
  %24 = getelementptr inbounds i8, ptr %1, i64 12
  %25 = load i32, ptr %24, align 4, !tbaa !13
  call void @_ZN4juce22AudioSourceChannelInfoC2EPNS_11AudioBufferIfEEii(ptr noundef nonnull align 8 dereferenceable(16) %4, ptr noundef nonnull %18, i32 noundef 0, i32 noundef %25) #4
  %26 = call noundef i32 @_ZNK4juce5ArrayIPNS_11AudioSourceENS_20DummyCriticalSectionELi0EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20) %6) #4
  %27 = icmp sgt i32 %26, 1
  br i1 %27, label %.lr.ph25, label %._crit_edge26

.lr.ph25:                                         ; preds = %17
  %28 = getelementptr inbounds i8, ptr %1, i64 8
  br label %31

._crit_edge26:                                    ; preds = %._crit_edge, %17
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #4
  br label %52

29:                                               ; preds = %9
  %30 = landingpad { ptr, i32 }
          cleanup
  br label %53

31:                                               ; preds = %.lr.ph25, %._crit_edge
  %.01823 = phi i32 [ 1, %.lr.ph25 ], [ %39, %._crit_edge ]
  %32 = call noundef ptr @_ZNK4juce5ArrayIPNS_11AudioSourceENS_20DummyCriticalSectionELi0EE12getUncheckedEi(ptr noundef nonnull align 8 dereferenceable(20) %6, i32 noundef %.01823)
  %33 = load ptr, ptr %32, align 8, !tbaa !5
  %34 = getelementptr inbounds i8, ptr %33, i64 32
  %35 = load ptr, ptr %34, align 8
  invoke void %35(ptr noundef nonnull align 8 dereferenceable(8) %32, ptr noundef nonnull align 8 dereferenceable(16) %4)
          to label %.preheader unwind label %42

.preheader:                                       ; preds = %31
  %36 = load ptr, ptr %1, align 8, !tbaa !8
  %37 = call noundef i32 @_ZNK4juce11AudioBufferIfE14getNumChannelsEv(ptr noundef nonnull align 8 dereferenceable(289) %36) #4
  %38 = icmp sgt i32 %37, 0
  br i1 %38, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.preheader
  %39 = add nuw nsw i32 %.01823, 1
  %40 = call noundef i32 @_ZNK4juce5ArrayIPNS_11AudioSourceENS_20DummyCriticalSectionELi0EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20) %6) #4
  %41 = icmp slt i32 %39, %40
  br i1 %41, label %31, label %._crit_edge26, !llvm.loop !14

42:                                               ; preds = %31
  %43 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #4
  br label %53

.lr.ph:                                           ; preds = %.preheader, %.lr.ph
  %.022 = phi i32 [ %47, %.lr.ph ], [ 0, %.preheader ]
  %44 = load ptr, ptr %1, align 8, !tbaa !8
  %45 = load i32, ptr %28, align 8, !tbaa !16
  %46 = load i32, ptr %24, align 4, !tbaa !13
  call void @_ZN4juce11AudioBufferIfE7addFromEiiRKS1_iiif(ptr noundef nonnull align 8 dereferenceable(289) %44, i32 noundef %.022, i32 noundef %45, ptr noundef nonnull align 8 dereferenceable(289) %18, i32 noundef %.022, i32 noundef 0, i32 noundef %46, float noundef 1.000000e+00) #4
  %47 = add nuw nsw i32 %.022, 1
  %48 = load ptr, ptr %1, align 8, !tbaa !8
  %49 = call noundef i32 @_ZNK4juce11AudioBufferIfE14getNumChannelsEv(ptr noundef nonnull align 8 dereferenceable(289) %48) #4
  %50 = icmp slt i32 %47, %49
  br i1 %50, label %.lr.ph, label %._crit_edge, !llvm.loop !17

51:                                               ; preds = %2
  call void @_ZNK4juce22AudioSourceChannelInfo23clearActiveBufferRegionEv(ptr noundef nonnull align 8 dereferenceable(16) %1)
  br label %52

52:                                               ; preds = %14, %._crit_edge26, %51
  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
  ret void

53:                                               ; preds = %42, %29
  %.pn = phi { ptr, i32 } [ %43, %42 ], [ %30, %29 ]
  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 } %.pn
}

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 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !10, i64 0}
!9 = !{!"_ZTSN4juce22AudioSourceChannelInfoE", !10, i64 0, !12, i64 8, !12, i64 12}
!10 = !{!"any pointer", !11, i64 0}
!11 = !{!"omnipotent char", !7, i64 0}
!12 = !{!"int", !11, i64 0}
!13 = !{!9, !12, i64 12}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = !{!9, !12, i64 8}
!17 = distinct !{!17, !15}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass