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

; 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::AudioChannelSet" = type { %"class.juce::BigInteger" }
%"class.juce::BigInteger" = type <{ %"class.juce::HeapBlock.50", [4 x i32], i64, i32, i8, [3 x i8] }>
%"class.juce::HeapBlock.50" = type { ptr }
%"class.juce::Array.51" = type { %"class.juce::ArrayAllocationBase.52", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.52" = type <{ %"class.juce::HeapBlock.53", i32, [4 x i8] }>
%"class.juce::HeapBlock.53" = 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK4juce15AudioChannelSet10isDisabledEv(ptr noundef nonnull align 8 dereferenceable(40)) #2 align 2

declare void @_ZN4juce15AudioChannelSet8disabledEv(ptr dead_on_unwind writable sret(%"class.juce::AudioChannelSet") align 8) #3

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK4juce14AudioProcessor3Bus17isLayoutSupportedERKNS_15AudioChannelSetEPNS0_11BusesLayoutE(ptr noundef nonnull align 8 dereferenceable(144), ptr noundef nonnull align 8 dereferenceable(40), ptr noundef) #5 align 2

declare void @_ZN4juce15AudioChannelSet15namedChannelSetEi(ptr dead_on_unwind writable sret(%"class.juce::AudioChannelSet") align 8, i32 noundef) #3

declare void @_ZN4juce15AudioChannelSet16discreteChannelsEi(ptr dead_on_unwind writable sret(%"class.juce::AudioChannelSet") align 8, i32 noundef) #3

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK4juce14AudioProcessor3Bus27supportedLayoutWithChannelsEi(ptr dead_on_unwind noalias writable sret(%"class.juce::AudioChannelSet") align 8 %0, ptr noundef nonnull align 8 dereferenceable(144) %1, i32 noundef %2) #5 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i1, align 1
  %8 = alloca %"class.juce::AudioChannelSet", align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca %"class.juce::AudioChannelSet", align 8
  %13 = alloca %"class.juce::Array.51", align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i1, align 1
  store ptr %0, ptr %4, align 8
  store ptr %1, ptr %5, align 8, !tbaa !5
  store i32 %2, ptr %6, align 4, !tbaa !9
  %17 = load ptr, ptr %5, align 8
  %18 = load i32, ptr %6, align 4, !tbaa !9
  %19 = icmp eq i32 %18, 0
  br i1 %19, label %20, label %21

20:                                               ; preds = %3
  call void @_ZN4juce15AudioChannelSet8disabledEv(ptr dead_on_unwind writable sret(%"class.juce::AudioChannelSet") align 8 %0)
  br label %112

21:                                               ; preds = %3
  store i1 false, ptr %7, align 1
  call void @_ZN4juce15AudioChannelSetC2Ev(ptr noundef nonnull align 8 dereferenceable(40) %0) #6
  call void @llvm.lifetime.start.p0(i64 40, ptr %8) #6
  %22 = load i32, ptr %6, align 4, !tbaa !9
  invoke void @_ZN4juce15AudioChannelSet15namedChannelSetEi(ptr dead_on_unwind writable sret(%"class.juce::AudioChannelSet") align 8 %8, i32 noundef %22)
          to label %23 unwind label %32

23:                                               ; preds = %21
  %24 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZN4juce15AudioChannelSetaSEOS0_(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef nonnull align 8 dereferenceable(40) %8) #6
  %25 = call noundef zeroext i1 @_ZNK4juce15AudioChannelSet10isDisabledEv(ptr noundef nonnull align 8 dereferenceable(40) %24) #6
  br i1 %25, label %29, label %26

26:                                               ; preds = %23
  %27 = invoke noundef zeroext i1 @_ZNK4juce14AudioProcessor3Bus17isLayoutSupportedERKNS_15AudioChannelSetEPNS0_11BusesLayoutE(ptr noundef nonnull align 8 dereferenceable(144) %17, ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef null)
          to label %28 unwind label %36

28:                                               ; preds = %26
  br label %29

29:                                               ; preds = %28, %23
  %30 = phi i1 [ false, %23 ], [ %27, %28 ]
  call void @_ZN4juce15AudioChannelSetD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %8) #6
  call void @llvm.lifetime.end.p0(i64 40, ptr %8) #6
  br i1 %30, label %31, label %41

31:                                               ; preds = %29
  store i1 true, ptr %7, align 1
  store i32 1, ptr %11, align 4
  br label %62

32:                                               ; preds = %21
  %33 = landingpad { ptr, i32 }
          cleanup
  %34 = extractvalue { ptr, i32 } %33, 0
  store ptr %34, ptr %9, align 8
  %35 = extractvalue { ptr, i32 } %33, 1
  store i32 %35, ptr %10, align 4
  br label %40

36:                                               ; preds = %26
  %37 = landingpad { ptr, i32 }
          cleanup
  %38 = extractvalue { ptr, i32 } %37, 0
  store ptr %38, ptr %9, align 8
  %39 = extractvalue { ptr, i32 } %37, 1
  store i32 %39, ptr %10, align 4
  call void @_ZN4juce15AudioChannelSetD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %8) #6
  br label %40

40:                                               ; preds = %36, %32
  call void @llvm.lifetime.end.p0(i64 40, ptr %8) #6
  br label %75

41:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 40, ptr %12) #6
  %42 = load i32, ptr %6, align 4, !tbaa !9
  invoke void @_ZN4juce15AudioChannelSet16discreteChannelsEi(ptr dead_on_unwind writable sret(%"class.juce::AudioChannelSet") align 8 %12, i32 noundef %42)
          to label %43 unwind label %52

43:                                               ; preds = %41
  %44 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZN4juce15AudioChannelSetaSEOS0_(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef nonnull align 8 dereferenceable(40) %12) #6
  %45 = call noundef zeroext i1 @_ZNK4juce15AudioChannelSet10isDisabledEv(ptr noundef nonnull align 8 dereferenceable(40) %44) #6
  br i1 %45, label %49, label %46

46:                                               ; preds = %43
  %47 = invoke noundef zeroext i1 @_ZNK4juce14AudioProcessor3Bus17isLayoutSupportedERKNS_15AudioChannelSetEPNS0_11BusesLayoutE(ptr noundef nonnull align 8 dereferenceable(144) %17, ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef null)
          to label %48 unwind label %56

48:                                               ; preds = %46
  br label %49

49:                                               ; preds = %48, %43
  %50 = phi i1 [ false, %43 ], [ %47, %48 ]
  call void @_ZN4juce15AudioChannelSetD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %12) #6
  call void @llvm.lifetime.end.p0(i64 40, ptr %12) #6
  br i1 %50, label %51, label %61

51:                                               ; preds = %49
  store i1 true, ptr %7, align 1
  store i32 1, ptr %11, align 4
  br label %62

52:                                               ; preds = %41
  %53 = landingpad { ptr, i32 }
          cleanup
  %54 = extractvalue { ptr, i32 } %53, 0
  store ptr %54, ptr %9, align 8
  %55 = extractvalue { ptr, i32 } %53, 1
  store i32 %55, ptr %10, align 4
  br label %60

56:                                               ; preds = %46
  %57 = landingpad { ptr, i32 }
          cleanup
  %58 = extractvalue { ptr, i32 } %57, 0
  store ptr %58, ptr %9, align 8
  %59 = extractvalue { ptr, i32 } %57, 1
  store i32 %59, ptr %10, align 4
  call void @_ZN4juce15AudioChannelSetD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %12) #6
  br label %60

60:                                               ; preds = %56, %52
  call void @llvm.lifetime.end.p0(i64 40, ptr %12) #6
  br label %75

61:                                               ; preds = %49
  store i32 0, ptr %11, align 4
  br label %62

62:                                               ; preds = %61, %51, %31
  %63 = load i1, ptr %7, align 1
  br i1 %63, label %65, label %64

64:                                               ; preds = %62
  call void @_ZN4juce15AudioChannelSetD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %0) #6
  br label %65

65:                                               ; preds = %64, %62
  %66 = load i32, ptr %11, align 4
  switch i32 %66, label %118 [
    i32 0, label %67
    i32 1, label %112
  ]

67:                                               ; preds = %65
  call void @llvm.lifetime.start.p0(i64 24, ptr %13) #6
  %68 = load i32, ptr %6, align 4, !tbaa !9
  call void @_ZN4juce15AudioChannelSet31channelSetsWithNumberOfChannelsEi(ptr dead_on_unwind writable sret(%"class.juce::Array.51") align 8 %13, i32 noundef %68)
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  %69 = call noundef i32 @_ZNK4juce5ArrayINS_15AudioChannelSetENS_20DummyCriticalSectionELi0EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20) %13) #6
  store i32 %69, ptr %14, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  store i32 0, ptr %15, align 4, !tbaa !9
  br label %70

70:                                               ; preds = %98, %67
  %71 = load i32, ptr %15, align 4, !tbaa !9
  %72 = load i32, ptr %14, align 4, !tbaa !9
  %73 = icmp slt i32 %71, %72
  br i1 %73, label %76, label %74

74:                                               ; preds = %70
  store i32 2, ptr %11, align 4
  br label %101

75:                                               ; preds = %60, %40
  call void @_ZN4juce15AudioChannelSetD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %0) #6
  br label %113

76:                                               ; preds = %70
  store i1 false, ptr %16, align 1
  %77 = load i32, ptr %15, align 4, !tbaa !9
  %78 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNK4juce5ArrayINS_15AudioChannelSetENS_20DummyCriticalSectionELi0EE12getReferenceEi(ptr noundef nonnull align 8 dereferenceable(20) %13, i32 noundef %77) #6
  invoke void @_ZN4juce15AudioChannelSetC2ERKS0_(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef nonnull align 8 dereferenceable(40) %78)
          to label %79 unwind label %83

79:                                               ; preds = %76
  %80 = invoke noundef zeroext i1 @_ZNK4juce14AudioProcessor3Bus17isLayoutSupportedERKNS_15AudioChannelSetEPNS0_11BusesLayoutE(ptr noundef nonnull align 8 dereferenceable(144) %17, ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef null)
          to label %81 unwind label %87

81:                                               ; preds = %79
  br i1 %80, label %82, label %91

82:                                               ; preds = %81
  store i1 true, ptr %16, align 1
  store i32 1, ptr %11, align 4
  br label %92

83:                                               ; preds = %76
  %84 = landingpad { ptr, i32 }
          cleanup
  %85 = extractvalue { ptr, i32 } %84, 0
  store ptr %85, ptr %9, align 8
  %86 = extractvalue { ptr, i32 } %84, 1
  store i32 %86, ptr %10, align 4
  br label %103

87:                                               ; preds = %79
  %88 = landingpad { ptr, i32 }
          cleanup
  %89 = extractvalue { ptr, i32 } %88, 0
  store ptr %89, ptr %9, align 8
  %90 = extractvalue { ptr, i32 } %88, 1
  store i32 %90, ptr %10, align 4
  call void @_ZN4juce15AudioChannelSetD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %0) #6
  br label %103

91:                                               ; preds = %81
  store i32 0, ptr %11, align 4
  br label %92

92:                                               ; preds = %91, %82
  %93 = load i1, ptr %16, align 1
  br i1 %93, label %95, label %94

94:                                               ; preds = %92
  call void @_ZN4juce15AudioChannelSetD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %0) #6
  br label %95

95:                                               ; preds = %94, %92
  %96 = load i32, ptr %11, align 4
  switch i32 %96, label %101 [
    i32 0, label %97
  ]

97:                                               ; preds = %95
  br label %98

98:                                               ; preds = %97
  %99 = load i32, ptr %15, align 4, !tbaa !9
  %100 = add nsw i32 %99, 1
  store i32 %100, ptr %15, align 4, !tbaa !9
  br label %70, !llvm.loop !11

101:                                              ; preds = %95, %74
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  %102 = load i32, ptr %11, align 4
  switch i32 %102, label %110 [
    i32 2, label %104
  ]

103:                                              ; preds = %87, %83
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %111

104:                                              ; preds = %101
  invoke void @_ZN4juce15AudioChannelSet8disabledEv(ptr dead_on_unwind writable sret(%"class.juce::AudioChannelSet") align 8 %0)
          to label %105 unwind label %106

105:                                              ; preds = %104
  store i32 1, ptr %11, align 4
  br label %110

106:                                              ; preds = %104
  %107 = landingpad { ptr, i32 }
          cleanup
  %108 = extractvalue { ptr, i32 } %107, 0
  store ptr %108, ptr %9, align 8
  %109 = extractvalue { ptr, i32 } %107, 1
  store i32 %109, ptr %10, align 4
  br label %111

110:                                              ; preds = %105, %101
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  call void @_ZN4juce5ArrayINS_15AudioChannelSetENS_20DummyCriticalSectionELi0EED2Ev(ptr noundef nonnull align 8 dereferenceable(20) %13) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %13) #6
  br label %112

111:                                              ; preds = %106, %103
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  call void @_ZN4juce5ArrayINS_15AudioChannelSetENS_20DummyCriticalSectionELi0EED2Ev(ptr noundef nonnull align 8 dereferenceable(20) %13) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %13) #6
  br label %113

112:                                              ; preds = %110, %65, %20
  ret void

113:                                              ; preds = %111, %75
  %114 = load ptr, ptr %9, align 8
  %115 = load i32, ptr %10, align 4
  %116 = insertvalue { ptr, i32 } poison, ptr %114, 0
  %117 = insertvalue { ptr, i32 } %116, i32 %115, 1
  resume { ptr, i32 } %117

118:                                              ; preds = %65
  unreachable
}

declare void @_ZN4juce15AudioChannelSet31channelSetsWithNumberOfChannelsEi(ptr dead_on_unwind writable sret(%"class.juce::Array.51") align 8, i32 noundef) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4juce5ArrayINS_15AudioChannelSetENS_20DummyCriticalSectionELi0EED2Ev(ptr noundef nonnull align 8 dereferenceable(20)) unnamed_addr #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 = { "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 = { inlinehint 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 = { 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 #6 = { nounwind }

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

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


; 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::AudioChannelSet" = type { %"class.juce::BigInteger" }
%"class.juce::BigInteger" = type <{ %"class.juce::HeapBlock.50", [4 x i32], i64, i32, i8, [3 x i8] }>
%"class.juce::HeapBlock.50" = type { ptr }
%"class.juce::Array.51" = type { %"class.juce::ArrayAllocationBase.52", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.52" = type <{ %"class.juce::HeapBlock.53", i32, [4 x i8] }>
%"class.juce::HeapBlock.53" = 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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK4juce15AudioChannelSet10isDisabledEv(ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #2 align 2

declare void @_ZN4juce15AudioChannelSet8disabledEv(ptr dead_on_unwind writable sret(%"class.juce::AudioChannelSet") align 8) local_unnamed_addr #3

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK4juce14AudioProcessor3Bus17isLayoutSupportedERKNS_15AudioChannelSetEPNS0_11BusesLayoutE(ptr noundef nonnull align 8 dereferenceable(144), ptr noundef nonnull align 8 dereferenceable(40), ptr noundef) local_unnamed_addr #5 align 2

declare void @_ZN4juce15AudioChannelSet15namedChannelSetEi(ptr dead_on_unwind writable sret(%"class.juce::AudioChannelSet") align 8, i32 noundef) local_unnamed_addr #3

declare void @_ZN4juce15AudioChannelSet16discreteChannelsEi(ptr dead_on_unwind writable sret(%"class.juce::AudioChannelSet") align 8, i32 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK4juce14AudioProcessor3Bus27supportedLayoutWithChannelsEi(ptr dead_on_unwind noalias writable sret(%"class.juce::AudioChannelSet") align 8 %0, ptr noundef nonnull align 8 dereferenceable(144) %1, i32 noundef %2) local_unnamed_addr #5 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"class.juce::AudioChannelSet", align 8
  %5 = alloca %"class.juce::AudioChannelSet", align 8
  %6 = alloca %"class.juce::Array.51", align 8
  %7 = icmp eq i32 %2, 0
  br i1 %7, label %8, label %9

8:                                                ; preds = %3
  tail call void @_ZN4juce15AudioChannelSet8disabledEv(ptr dead_on_unwind writable sret(%"class.juce::AudioChannelSet") align 8 %0)
  br label %49

9:                                                ; preds = %3
  tail call void @_ZN4juce15AudioChannelSetC2Ev(ptr noundef nonnull align 8 dereferenceable(40) %0) #6
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %4) #6
  invoke void @_ZN4juce15AudioChannelSet15namedChannelSetEi(ptr dead_on_unwind nonnull writable sret(%"class.juce::AudioChannelSet") align 8 %4, i32 noundef %2)
          to label %10 unwind label %16

10:                                               ; preds = %9
  %11 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZN4juce15AudioChannelSetaSEOS0_(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef nonnull align 8 dereferenceable(40) %4) #6
  %12 = call noundef zeroext i1 @_ZNK4juce15AudioChannelSet10isDisabledEv(ptr noundef nonnull align 8 dereferenceable(40) %11) #6
  br i1 %12, label %.critedge, label %13

13:                                               ; preds = %10
  %14 = invoke noundef zeroext i1 @_ZNK4juce14AudioProcessor3Bus17isLayoutSupportedERKNS_15AudioChannelSetEPNS0_11BusesLayoutE(ptr noundef nonnull align 8 dereferenceable(144) %1, ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef null)
          to label %15 unwind label %18

15:                                               ; preds = %13
  call void @_ZN4juce15AudioChannelSetD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %4) #6
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %4) #6
  br i1 %14, label %49, label %21

16:                                               ; preds = %9
  %17 = landingpad { ptr, i32 }
          cleanup
  br label %20

18:                                               ; preds = %13
  %19 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN4juce15AudioChannelSetD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %4) #6
  br label %20

20:                                               ; preds = %18, %16
  %.pn = phi { ptr, i32 } [ %19, %18 ], [ %17, %16 ]
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %4) #6
  br label %35

.critedge:                                        ; preds = %10
  call void @_ZN4juce15AudioChannelSetD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %4) #6
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %4) #6
  br label %21

21:                                               ; preds = %.critedge, %15
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %5) #6
  invoke void @_ZN4juce15AudioChannelSet16discreteChannelsEi(ptr dead_on_unwind nonnull writable sret(%"class.juce::AudioChannelSet") align 8 %5, i32 noundef %2)
          to label %22 unwind label %28

22:                                               ; preds = %21
  %23 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZN4juce15AudioChannelSetaSEOS0_(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef nonnull align 8 dereferenceable(40) %5) #6
  %24 = call noundef zeroext i1 @_ZNK4juce15AudioChannelSet10isDisabledEv(ptr noundef nonnull align 8 dereferenceable(40) %23) #6
  br i1 %24, label %.critedge3, label %25

25:                                               ; preds = %22
  %26 = invoke noundef zeroext i1 @_ZNK4juce14AudioProcessor3Bus17isLayoutSupportedERKNS_15AudioChannelSetEPNS0_11BusesLayoutE(ptr noundef nonnull align 8 dereferenceable(144) %1, ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef null)
          to label %27 unwind label %30

27:                                               ; preds = %25
  call void @_ZN4juce15AudioChannelSetD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %5) #6
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %5) #6
  br i1 %26, label %49, label %33

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

30:                                               ; preds = %25
  %31 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN4juce15AudioChannelSetD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %5) #6
  br label %32

32:                                               ; preds = %30, %28
  %.pn32 = phi { ptr, i32 } [ %31, %30 ], [ %29, %28 ]
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %5) #6
  br label %35

.critedge3:                                       ; preds = %22
  call void @_ZN4juce15AudioChannelSetD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %5) #6
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %5) #6
  br label %33

33:                                               ; preds = %27, %.critedge3
  call void @_ZN4juce15AudioChannelSetD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %0) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #6
  call void @_ZN4juce15AudioChannelSet31channelSetsWithNumberOfChannelsEi(ptr dead_on_unwind nonnull writable sret(%"class.juce::Array.51") align 8 %6, i32 noundef %2)
  %34 = call noundef i32 @_ZNK4juce5ArrayINS_15AudioChannelSetENS_20DummyCriticalSectionELi0EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(20) %6) #6
  %.not48 = icmp sgt i32 %34, 0
  br i1 %.not48, label %.lr.ph, label %.critedge42

35:                                               ; preds = %32, %20
  %.pn32.pn = phi { ptr, i32 } [ %.pn32, %32 ], [ %.pn, %20 ]
  call void @_ZN4juce15AudioChannelSetD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %0) #6
  br label %50

.lr.ph:                                           ; preds = %33, %44
  %.01849 = phi i32 [ %45, %44 ], [ 0, %33 ]
  %36 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNK4juce5ArrayINS_15AudioChannelSetENS_20DummyCriticalSectionELi0EE12getReferenceEi(ptr noundef nonnull align 8 dereferenceable(20) %6, i32 noundef %.01849) #6
  invoke void @_ZN4juce15AudioChannelSetC2ERKS0_(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef nonnull align 8 dereferenceable(40) %36)
          to label %37 unwind label %39

37:                                               ; preds = %.lr.ph
  %38 = invoke noundef zeroext i1 @_ZNK4juce14AudioProcessor3Bus17isLayoutSupportedERKNS_15AudioChannelSetEPNS0_11BusesLayoutE(ptr noundef nonnull align 8 dereferenceable(144) %1, ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef null)
          to label %43 unwind label %41

39:                                               ; preds = %.lr.ph
  %40 = landingpad { ptr, i32 }
          cleanup
  br label %48

41:                                               ; preds = %37
  %42 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN4juce15AudioChannelSetD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %0) #6
  br label %48

43:                                               ; preds = %37
  br i1 %38, label %.critedge41, label %44

44:                                               ; preds = %43
  call void @_ZN4juce15AudioChannelSetD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %0) #6
  %45 = add nuw nsw i32 %.01849, 1
  %exitcond.not = icmp eq i32 %45, %34
  br i1 %exitcond.not, label %.critedge42, label %.lr.ph, !llvm.loop !5

.critedge42:                                      ; preds = %44, %33
  invoke void @_ZN4juce15AudioChannelSet8disabledEv(ptr dead_on_unwind nonnull writable sret(%"class.juce::AudioChannelSet") align 8 %0)
          to label %.critedge41 unwind label %46

46:                                               ; preds = %.critedge42
  %47 = landingpad { ptr, i32 }
          cleanup
  br label %48

.critedge41:                                      ; preds = %43, %.critedge42
  call void @_ZN4juce5ArrayINS_15AudioChannelSetENS_20DummyCriticalSectionELi0EED2Ev(ptr noundef nonnull align 8 dereferenceable(20) %6) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #6
  br label %49

48:                                               ; preds = %39, %41, %46
  %.pn37 = phi { ptr, i32 } [ %47, %46 ], [ %42, %41 ], [ %40, %39 ]
  call void @_ZN4juce5ArrayINS_15AudioChannelSetENS_20DummyCriticalSectionELi0EED2Ev(ptr noundef nonnull align 8 dereferenceable(20) %6) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #6
  br label %50

49:                                               ; preds = %27, %15, %.critedge41, %8
  ret void

50:                                               ; preds = %48, %35
  %.pn37.pn = phi { ptr, i32 } [ %.pn37, %48 ], [ %.pn32.pn, %35 ]
  resume { ptr, i32 } %.pn37.pn
}

declare void @_ZN4juce15AudioChannelSet31channelSetsWithNumberOfChannelsEi(ptr dead_on_unwind writable sret(%"class.juce::Array.51") align 8, i32 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4juce5ArrayINS_15AudioChannelSetENS_20DummyCriticalSectionELi0EED2Ev(ptr noundef nonnull align 8 dereferenceable(20)) 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 = { "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 = { inlinehint 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 = { 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 #6 = { 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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}


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