; 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::ChannelRemappingAudioSource" = type { %"class.juce::AudioSource", %"class.juce::OptionalScopedPointer.85", %"class.juce::Array.88", %"class.juce::Array.88", i32, [4 x i8], %"class.juce::AudioBuffer", %"struct.juce::AudioSourceChannelInfo", %"class.juce::CriticalSection" }
%"class.juce::AudioSource" = type { ptr }
%"class.juce::OptionalScopedPointer.85" = type <{ %"class.juce::ScopedPointer.86", i8, [7 x i8] }>
%"class.juce::ScopedPointer.86" = type { ptr }
%"class.juce::Array.88" = type { %"class.juce::ArrayAllocationBase.89", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.89" = type <{ %"class.juce::HeapBlock.90", i32, [4 x i8] }>
%"class.juce::HeapBlock.90" = 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 }
%"struct.juce::AudioSourceChannelInfo" = type { ptr, i32, i32 }
%"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

; 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 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 @_ZN4juce11AudioBufferIfE8copyFromEiiRKS1_iii(ptr noundef nonnull align 8 dereferenceable(289), i32 noundef, i32 noundef, ptr noundef nonnull align 8 dereferenceable(289), i32 noundef, i32 noundef, i32 noundef) #2 align 2

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4juce27ChannelRemappingAudioSource17getNextAudioBlockERKNS_22AudioSourceChannelInfoE(ptr noundef nonnull align 8 dereferenceable(432) %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 i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %13 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  %14 = getelementptr inbounds %"class.juce::ChannelRemappingAudioSource", ptr %13, i32 0, i32 8
  call void @_ZN4juce17GenericScopedLockINS_15CriticalSectionEEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(40) %14) #4
  %15 = getelementptr inbounds %"class.juce::ChannelRemappingAudioSource", ptr %13, i32 0, i32 6
  %16 = getelementptr inbounds %"class.juce::ChannelRemappingAudioSource", ptr %13, i32 0, i32 4
  %17 = load i32, ptr %16, align 8, !tbaa !9
  %18 = load ptr, ptr %4, align 8, !tbaa !5
  %19 = getelementptr inbounds %"struct.juce::AudioSourceChannelInfo", ptr %18, i32 0, i32 2
  %20 = load i32, ptr %19, align 4, !tbaa !24
  call void @_ZN4juce11AudioBufferIfE7setSizeEiibbb(ptr noundef nonnull align 8 dereferenceable(289) %15, i32 noundef %17, i32 noundef %20, i1 noundef zeroext false, i1 noundef zeroext false, i1 noundef zeroext true) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  %21 = load ptr, ptr %4, align 8, !tbaa !5
  %22 = getelementptr inbounds %"struct.juce::AudioSourceChannelInfo", ptr %21, i32 0, i32 0
  %23 = load ptr, ptr %22, align 8, !tbaa !25
  %24 = call noundef i32 @_ZNK4juce11AudioBufferIfE14getNumChannelsEv(ptr noundef nonnull align 8 dereferenceable(289) %23) #4
  store i32 %24, ptr %6, align 4, !tbaa !26
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  store i32 0, ptr %7, align 4, !tbaa !26
  br label %25

25:                                               ; preds = %65, %2
  %26 = load i32, ptr %7, align 4, !tbaa !26
  %27 = getelementptr inbounds %"class.juce::ChannelRemappingAudioSource", ptr %13, i32 0, i32 6
  %28 = call noundef i32 @_ZNK4juce11AudioBufferIfE14getNumChannelsEv(ptr noundef nonnull align 8 dereferenceable(289) %27) #4
  %29 = icmp slt i32 %26, %28
  br i1 %29, label %31, label %30

30:                                               ; preds = %25
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %68

31:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  %32 = load i32, ptr %7, align 4, !tbaa !26
  %33 = invoke noundef i32 @_ZNK4juce27ChannelRemappingAudioSource23getRemappedInputChannelEi(ptr noundef nonnull align 8 dereferenceable(432) %13, i32 noundef %32)
          to label %34 unwind label %54

34:                                               ; preds = %31
  store i32 %33, ptr %8, align 4, !tbaa !26
  %35 = load i32, ptr %8, align 4, !tbaa !26
  %36 = icmp sge i32 %35, 0
  br i1 %36, label %37, label %58

37:                                               ; preds = %34
  %38 = load i32, ptr %8, align 4, !tbaa !26
  %39 = load i32, ptr %6, align 4, !tbaa !26
  %40 = icmp slt i32 %38, %39
  br i1 %40, label %41, label %58

41:                                               ; preds = %37
  %42 = getelementptr inbounds %"class.juce::ChannelRemappingAudioSource", ptr %13, i32 0, i32 6
  %43 = load i32, ptr %7, align 4, !tbaa !26
  %44 = load ptr, ptr %4, align 8, !tbaa !5
  %45 = getelementptr inbounds %"struct.juce::AudioSourceChannelInfo", ptr %44, i32 0, i32 0
  %46 = load ptr, ptr %45, align 8, !tbaa !25
  %47 = load i32, ptr %8, align 4, !tbaa !26
  %48 = load ptr, ptr %4, align 8, !tbaa !5
  %49 = getelementptr inbounds %"struct.juce::AudioSourceChannelInfo", ptr %48, i32 0, i32 1
  %50 = load i32, ptr %49, align 8, !tbaa !27
  %51 = load ptr, ptr %4, align 8, !tbaa !5
  %52 = getelementptr inbounds %"struct.juce::AudioSourceChannelInfo", ptr %51, i32 0, i32 2
  %53 = load i32, ptr %52, align 4, !tbaa !24
  call void @_ZN4juce11AudioBufferIfE8copyFromEiiRKS1_iii(ptr noundef nonnull align 8 dereferenceable(289) %42, i32 noundef %43, i32 noundef 0, ptr noundef nonnull align 8 dereferenceable(289) %46, i32 noundef %47, i32 noundef %50, i32 noundef %53) #4
  br label %64

54:                                               ; preds = %31
  %55 = landingpad { ptr, i32 }
          cleanup
  %56 = extractvalue { ptr, i32 } %55, 0
  store ptr %56, ptr %9, align 8
  %57 = extractvalue { ptr, i32 } %55, 1
  store i32 %57, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %125

58:                                               ; preds = %37, %34
  %59 = getelementptr inbounds %"class.juce::ChannelRemappingAudioSource", ptr %13, i32 0, i32 6
  %60 = load i32, ptr %7, align 4, !tbaa !26
  %61 = load ptr, ptr %4, align 8, !tbaa !5
  %62 = getelementptr inbounds %"struct.juce::AudioSourceChannelInfo", ptr %61, i32 0, i32 2
  %63 = load i32, ptr %62, align 4, !tbaa !24
  call void @_ZN4juce11AudioBufferIfE5clearEiii(ptr noundef nonnull align 8 dereferenceable(289) %59, i32 noundef %60, i32 noundef 0, i32 noundef %63) #4
  br label %64

64:                                               ; preds = %58, %41
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  br label %65

65:                                               ; preds = %64
  %66 = load i32, ptr %7, align 4, !tbaa !26
  %67 = add nsw i32 %66, 1
  store i32 %67, ptr %7, align 4, !tbaa !26
  br label %25, !llvm.loop !28

68:                                               ; preds = %30
  %69 = load ptr, ptr %4, align 8, !tbaa !5
  %70 = getelementptr inbounds %"struct.juce::AudioSourceChannelInfo", ptr %69, i32 0, i32 2
  %71 = load i32, ptr %70, align 4, !tbaa !24
  %72 = getelementptr inbounds %"class.juce::ChannelRemappingAudioSource", ptr %13, i32 0, i32 7
  %73 = getelementptr inbounds %"struct.juce::AudioSourceChannelInfo", ptr %72, i32 0, i32 2
  store i32 %71, ptr %73, align 4, !tbaa !30
  %74 = getelementptr inbounds %"class.juce::ChannelRemappingAudioSource", ptr %13, i32 0, i32 1
  %75 = call noundef ptr @_ZNK4juce21OptionalScopedPointerINS_11AudioSourceEEptEv(ptr noundef nonnull align 8 dereferenceable(9) %74) #4
  %76 = getelementptr inbounds %"class.juce::ChannelRemappingAudioSource", ptr %13, i32 0, i32 7
  %77 = load ptr, ptr %75, align 8, !tbaa !31
  %78 = getelementptr inbounds ptr, ptr %77, i64 4
  %79 = load ptr, ptr %78, align 8
  invoke void %79(ptr noundef nonnull align 8 dereferenceable(8) %75, ptr noundef nonnull align 8 dereferenceable(16) %76)
          to label %80 unwind label %89

80:                                               ; preds = %68
  %81 = load ptr, ptr %4, align 8, !tbaa !5
  invoke void @_ZNK4juce22AudioSourceChannelInfo23clearActiveBufferRegionEv(ptr noundef nonnull align 8 dereferenceable(16) %81)
          to label %82 unwind label %89

82:                                               ; preds = %80
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  store i32 0, ptr %11, align 4, !tbaa !26
  br label %83

83:                                               ; preds = %121, %82
  %84 = load i32, ptr %11, align 4, !tbaa !26
  %85 = getelementptr inbounds %"class.juce::ChannelRemappingAudioSource", ptr %13, i32 0, i32 4
  %86 = load i32, ptr %85, align 8, !tbaa !9
  %87 = icmp slt i32 %84, %86
  br i1 %87, label %93, label %88

88:                                               ; preds = %83
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  br label %124

89:                                               ; preds = %80, %68
  %90 = landingpad { ptr, i32 }
          cleanup
  %91 = extractvalue { ptr, i32 } %90, 0
  store ptr %91, ptr %9, align 8
  %92 = extractvalue { ptr, i32 } %90, 1
  store i32 %92, ptr %10, align 4
  br label %125

93:                                               ; preds = %83
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  %94 = load i32, ptr %11, align 4, !tbaa !26
  %95 = invoke noundef i32 @_ZNK4juce27ChannelRemappingAudioSource24getRemappedOutputChannelEi(ptr noundef nonnull align 8 dereferenceable(432) %13, i32 noundef %94)
          to label %96 unwind label %116

96:                                               ; preds = %93
  store i32 %95, ptr %12, align 4, !tbaa !26
  %97 = load i32, ptr %12, align 4, !tbaa !26
  %98 = icmp sge i32 %97, 0
  br i1 %98, label %99, label %120

99:                                               ; preds = %96
  %100 = load i32, ptr %12, align 4, !tbaa !26
  %101 = load i32, ptr %6, align 4, !tbaa !26
  %102 = icmp slt i32 %100, %101
  br i1 %102, label %103, label %120

103:                                              ; preds = %99
  %104 = load ptr, ptr %4, align 8, !tbaa !5
  %105 = getelementptr inbounds %"struct.juce::AudioSourceChannelInfo", ptr %104, i32 0, i32 0
  %106 = load ptr, ptr %105, align 8, !tbaa !25
  %107 = load i32, ptr %12, align 4, !tbaa !26
  %108 = load ptr, ptr %4, align 8, !tbaa !5
  %109 = getelementptr inbounds %"struct.juce::AudioSourceChannelInfo", ptr %108, i32 0, i32 1
  %110 = load i32, ptr %109, align 8, !tbaa !27
  %111 = getelementptr inbounds %"class.juce::ChannelRemappingAudioSource", ptr %13, i32 0, i32 6
  %112 = load i32, ptr %11, align 4, !tbaa !26
  %113 = load ptr, ptr %4, align 8, !tbaa !5
  %114 = getelementptr inbounds %"struct.juce::AudioSourceChannelInfo", ptr %113, i32 0, i32 2
  %115 = load i32, ptr %114, align 4, !tbaa !24
  call void @_ZN4juce11AudioBufferIfE7addFromEiiRKS1_iiif(ptr noundef nonnull align 8 dereferenceable(289) %106, i32 noundef %107, i32 noundef %110, ptr noundef nonnull align 8 dereferenceable(289) %111, i32 noundef %112, i32 noundef 0, i32 noundef %115, float noundef 1.000000e+00) #4
  br label %120

116:                                              ; preds = %93
  %117 = landingpad { ptr, i32 }
          cleanup
  %118 = extractvalue { ptr, i32 } %117, 0
  store ptr %118, ptr %9, align 8
  %119 = extractvalue { ptr, i32 } %117, 1
  store i32 %119, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  br label %125

120:                                              ; preds = %103, %99, %96
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  br label %121

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

124:                                              ; preds = %88
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #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
  ret void

125:                                              ; preds = %116, %89, %54
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #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 %126

126:                                              ; preds = %125
  %127 = load ptr, ptr %9, align 8
  %128 = load i32, ptr %10, align 4
  %129 = insertvalue { ptr, i32 } poison, ptr %127, 0
  %130 = insertvalue { ptr, i32 } %129, i32 %128, 1
  resume { ptr, i32 } %130
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4juce11AudioBufferIfE5clearEiii(ptr noundef nonnull align 8 dereferenceable(289), i32 noundef, i32 noundef, i32 noundef) #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

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, !18, i64 72}
!10 = !{!"_ZTSN4juce27ChannelRemappingAudioSourceE", !11, i64 0, !12, i64 8, !15, i64 24, !15, i64 48, !18, i64 72, !19, i64 80, !22, i64 376, !23, i64 392}
!11 = !{!"_ZTSN4juce11AudioSourceE"}
!12 = !{!"_ZTSN4juce21OptionalScopedPointerINS_11AudioSourceEEE", !13, i64 0, !14, i64 8}
!13 = !{!"_ZTSN4juce13ScopedPointerINS_11AudioSourceEEE", !6, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = !{!"_ZTSN4juce5ArrayIiNS_20DummyCriticalSectionELi0EEE", !16, i64 0, !18, i64 16}
!16 = !{!"_ZTSN4juce19ArrayAllocationBaseIiNS_20DummyCriticalSectionEEE", !17, i64 0, !18, i64 8}
!17 = !{!"_ZTSN4juce9HeapBlockIiLb0EEE", !6, i64 0}
!18 = !{!"int", !7, i64 0}
!19 = !{!"_ZTSN4juce11AudioBufferIfEE", !18, i64 0, !18, i64 4, !20, i64 8, !6, i64 16, !21, i64 24, !7, i64 32, !14, i64 288}
!20 = !{!"long", !7, i64 0}
!21 = !{!"_ZTSN4juce9HeapBlockIcLb1EEE", !6, i64 0}
!22 = !{!"_ZTSN4juce22AudioSourceChannelInfoE", !6, i64 0, !18, i64 8, !18, i64 12}
!23 = !{!"_ZTSN4juce15CriticalSectionE", !7, i64 0}
!24 = !{!22, !18, i64 12}
!25 = !{!22, !6, i64 0}
!26 = !{!18, !18, i64 0}
!27 = !{!22, !18, i64 8}
!28 = distinct !{!28, !29}
!29 = !{!"llvm.loop.mustprogress"}
!30 = !{!10, !18, i64 388}
!31 = !{!32, !32, i64 0}
!32 = !{!"vtable pointer", !8, i64 0}
!33 = distinct !{!33, !29}


; 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

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 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 @_ZN4juce11AudioBufferIfE8copyFromEiiRKS1_iii(ptr noundef nonnull align 8 dereferenceable(289), i32 noundef, i32 noundef, ptr noundef nonnull align 8 dereferenceable(289), i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #2 align 2

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4juce27ChannelRemappingAudioSource17getNextAudioBlockERKNS_22AudioSourceChannelInfoE(ptr noundef nonnull align 8 dereferenceable(432) %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
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #4
  %4 = getelementptr inbounds i8, ptr %0, i64 392
  call void @_ZN4juce17GenericScopedLockINS_15CriticalSectionEEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(40) %4) #4
  %5 = getelementptr inbounds i8, ptr %0, i64 80
  %6 = getelementptr inbounds i8, ptr %0, i64 72
  %7 = load i32, ptr %6, align 8, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %1, i64 12
  %9 = load i32, ptr %8, align 4, !tbaa !23
  call void @_ZN4juce11AudioBufferIfE7setSizeEiibbb(ptr noundef nonnull align 8 dereferenceable(289) %5, i32 noundef %7, i32 noundef %9, i1 noundef zeroext false, i1 noundef zeroext false, i1 noundef zeroext true) #4
  %10 = load ptr, ptr %1, align 8, !tbaa !24
  %11 = call noundef i32 @_ZNK4juce11AudioBufferIfE14getNumChannelsEv(ptr noundef nonnull align 8 dereferenceable(289) %10) #4
  %12 = call noundef i32 @_ZNK4juce11AudioBufferIfE14getNumChannelsEv(ptr noundef nonnull align 8 dereferenceable(289) %5) #4
  %13 = icmp sgt i32 %12, 0
  br i1 %13, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %2
  %14 = getelementptr inbounds i8, ptr %1, i64 8
  br label %23

._crit_edge:                                      ; preds = %36, %2
  %15 = load i32, ptr %8, align 4, !tbaa !23
  %16 = getelementptr inbounds i8, ptr %0, i64 376
  %17 = getelementptr inbounds i8, ptr %0, i64 388
  store i32 %15, ptr %17, align 4, !tbaa !25
  %18 = getelementptr inbounds i8, ptr %0, i64 8
  %19 = call noundef ptr @_ZNK4juce21OptionalScopedPointerINS_11AudioSourceEEptEv(ptr noundef nonnull align 8 dereferenceable(9) %18) #4
  %20 = load ptr, ptr %19, align 8, !tbaa !26
  %21 = getelementptr inbounds i8, ptr %20, i64 32
  %22 = load ptr, ptr %21, align 8
  invoke void %22(ptr noundef nonnull align 8 dereferenceable(8) %19, ptr noundef nonnull align 8 dereferenceable(16) %16)
          to label %40 unwind label %44

23:                                               ; preds = %.lr.ph, %36
  %.037 = phi i32 [ 0, %.lr.ph ], [ %37, %36 ]
  %24 = invoke noundef i32 @_ZNK4juce27ChannelRemappingAudioSource23getRemappedInputChannelEi(ptr noundef nonnull align 8 dereferenceable(432) %0, i32 noundef %.037)
          to label %25 unwind label %32

25:                                               ; preds = %23
  %26 = icmp sgt i32 %24, -1
  %27 = icmp slt i32 %24, %11
  %or.cond = and i1 %26, %27
  br i1 %or.cond, label %28, label %34

28:                                               ; preds = %25
  %29 = load ptr, ptr %1, align 8, !tbaa !24
  %30 = load i32, ptr %14, align 8, !tbaa !28
  %31 = load i32, ptr %8, align 4, !tbaa !23
  call void @_ZN4juce11AudioBufferIfE8copyFromEiiRKS1_iii(ptr noundef nonnull align 8 dereferenceable(289) %5, i32 noundef %.037, i32 noundef 0, ptr noundef nonnull align 8 dereferenceable(289) %29, i32 noundef %24, i32 noundef %30, i32 noundef %31) #4
  br label %36

32:                                               ; preds = %23
  %33 = landingpad { ptr, i32 }
          cleanup
  br label %61

34:                                               ; preds = %25
  %35 = load i32, ptr %8, align 4, !tbaa !23
  call void @_ZN4juce11AudioBufferIfE5clearEiii(ptr noundef nonnull align 8 dereferenceable(289) %5, i32 noundef %.037, i32 noundef 0, i32 noundef %35) #4
  br label %36

36:                                               ; preds = %34, %28
  %37 = add nuw nsw i32 %.037, 1
  %38 = call noundef i32 @_ZNK4juce11AudioBufferIfE14getNumChannelsEv(ptr noundef nonnull align 8 dereferenceable(289) %5) #4
  %39 = icmp slt i32 %37, %38
  br i1 %39, label %23, label %._crit_edge, !llvm.loop !29

40:                                               ; preds = %._crit_edge
  call void @_ZNK4juce22AudioSourceChannelInfo23clearActiveBufferRegionEv(ptr noundef nonnull align 8 dereferenceable(16) %1)
  %41 = load i32, ptr %6, align 8, !tbaa !5
  %42 = icmp sgt i32 %41, 0
  br i1 %42, label %.lr.ph40, label %._crit_edge41

.lr.ph40:                                         ; preds = %40
  %43 = getelementptr inbounds i8, ptr %1, i64 8
  br label %46

._crit_edge41:                                    ; preds = %57, %40
  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

44:                                               ; preds = %._crit_edge
  %45 = landingpad { ptr, i32 }
          cleanup
  br label %61

46:                                               ; preds = %.lr.ph40, %57
  %.03038 = phi i32 [ 0, %.lr.ph40 ], [ %58, %57 ]
  %47 = invoke noundef i32 @_ZNK4juce27ChannelRemappingAudioSource24getRemappedOutputChannelEi(ptr noundef nonnull align 8 dereferenceable(432) %0, i32 noundef %.03038)
          to label %48 unwind label %55

48:                                               ; preds = %46
  %49 = icmp sgt i32 %47, -1
  %50 = icmp slt i32 %47, %11
  %or.cond36 = and i1 %49, %50
  br i1 %or.cond36, label %51, label %57

51:                                               ; preds = %48
  %52 = load ptr, ptr %1, align 8, !tbaa !24
  %53 = load i32, ptr %43, align 8, !tbaa !28
  %54 = load i32, ptr %8, align 4, !tbaa !23
  call void @_ZN4juce11AudioBufferIfE7addFromEiiRKS1_iiif(ptr noundef nonnull align 8 dereferenceable(289) %52, i32 noundef %47, i32 noundef %53, ptr noundef nonnull align 8 dereferenceable(289) %5, i32 noundef %.03038, i32 noundef 0, i32 noundef %54, float noundef 1.000000e+00) #4
  br label %57

55:                                               ; preds = %46
  %56 = landingpad { ptr, i32 }
          cleanup
  br label %61

57:                                               ; preds = %51, %48
  %58 = add nuw nsw i32 %.03038, 1
  %59 = load i32, ptr %6, align 8, !tbaa !5
  %60 = icmp slt i32 %58, %59
  br i1 %60, label %46, label %._crit_edge41, !llvm.loop !31

61:                                               ; preds = %55, %44, %32
  %.pn = phi { ptr, i32 } [ %33, %32 ], [ %56, %55 ], [ %45, %44 ]
  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
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4juce11AudioBufferIfE5clearEiii(ptr noundef nonnull align 8 dereferenceable(289), i32 noundef, i32 noundef, i32 noundef) local_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

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, !17, i64 72}
!6 = !{!"_ZTSN4juce27ChannelRemappingAudioSourceE", !7, i64 0, !8, i64 8, !14, i64 24, !14, i64 48, !17, i64 72, !18, i64 80, !21, i64 376, !22, i64 392}
!7 = !{!"_ZTSN4juce11AudioSourceE"}
!8 = !{!"_ZTSN4juce21OptionalScopedPointerINS_11AudioSourceEEE", !9, i64 0, !13, i64 8}
!9 = !{!"_ZTSN4juce13ScopedPointerINS_11AudioSourceEEE", !10, i64 0}
!10 = !{!"any pointer", !11, i64 0}
!11 = !{!"omnipotent char", !12, i64 0}
!12 = !{!"Simple C++ TBAA"}
!13 = !{!"bool", !11, i64 0}
!14 = !{!"_ZTSN4juce5ArrayIiNS_20DummyCriticalSectionELi0EEE", !15, i64 0, !17, i64 16}
!15 = !{!"_ZTSN4juce19ArrayAllocationBaseIiNS_20DummyCriticalSectionEEE", !16, i64 0, !17, i64 8}
!16 = !{!"_ZTSN4juce9HeapBlockIiLb0EEE", !10, i64 0}
!17 = !{!"int", !11, i64 0}
!18 = !{!"_ZTSN4juce11AudioBufferIfEE", !17, i64 0, !17, i64 4, !19, i64 8, !10, i64 16, !20, i64 24, !11, i64 32, !13, i64 288}
!19 = !{!"long", !11, i64 0}
!20 = !{!"_ZTSN4juce9HeapBlockIcLb1EEE", !10, i64 0}
!21 = !{!"_ZTSN4juce22AudioSourceChannelInfoE", !10, i64 0, !17, i64 8, !17, i64 12}
!22 = !{!"_ZTSN4juce15CriticalSectionE", !11, i64 0}
!23 = !{!21, !17, i64 12}
!24 = !{!21, !10, i64 0}
!25 = !{!6, !17, i64 388}
!26 = !{!27, !27, i64 0}
!27 = !{!"vtable pointer", !12, i64 0}
!28 = !{!21, !17, i64 8}
!29 = distinct !{!29, !30}
!30 = !{!"llvm.loop.mustprogress"}
!31 = distinct !{!31, !30}


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