; 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"

%"struct.juce::AudioProcessorGraph::Connection" = type { i32, i32, i32, i32 }
%"class.juce::AudioProcessorGraph::Node" = type <{ %"class.juce::ReferenceCountedObject", i32, [4 x i8], %"class.juce::NamedValueSet", %"class.juce::ScopedPointer.86", i8, [7 x i8] }>
%"class.juce::ReferenceCountedObject" = type { ptr, %"class.juce::Atomic" }
%"class.juce::Atomic" = type { i32, [4 x i8] }
%"class.juce::NamedValueSet" = type { %"class.juce::Array.78" }
%"class.juce::Array.78" = type { %"class.juce::ArrayAllocationBase.79", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.79" = type <{ %"class.juce::HeapBlock.80", i32, [4 x i8] }>
%"class.juce::HeapBlock.80" = type { ptr }
%"class.juce::ScopedPointer.86" = 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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN4juce18isPositiveAndBelowIiEEbT_S1_(i32 noundef, i32 noundef) #2

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZNK4juce19AudioProcessorGraph17isConnectionLegalEPKNS0_10ConnectionE(ptr noundef nonnull align 8 dereferenceable(417) %0, ptr noundef %1) #3 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %7 = load ptr, ptr %3, align 8
  br label %8

8:                                                ; preds = %2
  br label %9

9:                                                ; preds = %8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  %10 = load ptr, ptr %4, align 8, !tbaa !5
  %11 = getelementptr inbounds %"struct.juce::AudioProcessorGraph::Connection", ptr %10, i32 0, i32 0
  %12 = load i32, ptr %11, align 4, !tbaa !9
  %13 = call noundef ptr @_ZNK4juce19AudioProcessorGraph12getNodeForIdEj(ptr noundef nonnull align 8 dereferenceable(417) %7, i32 noundef %12)
  store ptr %13, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  %14 = load ptr, ptr %4, align 8, !tbaa !5
  %15 = getelementptr inbounds %"struct.juce::AudioProcessorGraph::Connection", ptr %14, i32 0, i32 2
  %16 = load i32, ptr %15, align 4, !tbaa !12
  %17 = call noundef ptr @_ZNK4juce19AudioProcessorGraph12getNodeForIdEj(ptr noundef nonnull align 8 dereferenceable(417) %7, i32 noundef %16)
  store ptr %17, ptr %6, align 8, !tbaa !5
  %18 = load ptr, ptr %5, align 8, !tbaa !5
  %19 = icmp ne ptr %18, null
  br i1 %19, label %20, label %69

20:                                               ; preds = %9
  %21 = load ptr, ptr %6, align 8, !tbaa !5
  %22 = icmp ne ptr %21, null
  br i1 %22, label %23, label %69

23:                                               ; preds = %20
  %24 = load ptr, ptr %4, align 8, !tbaa !5
  %25 = getelementptr inbounds %"struct.juce::AudioProcessorGraph::Connection", ptr %24, i32 0, i32 1
  %26 = load i32, ptr %25, align 4, !tbaa !13
  %27 = icmp ne i32 %26, 4096
  br i1 %27, label %28, label %37

28:                                               ; preds = %23
  %29 = load ptr, ptr %4, align 8, !tbaa !5
  %30 = getelementptr inbounds %"struct.juce::AudioProcessorGraph::Connection", ptr %29, i32 0, i32 1
  %31 = load i32, ptr %30, align 4, !tbaa !13
  %32 = load ptr, ptr %5, align 8, !tbaa !5
  %33 = getelementptr inbounds %"class.juce::AudioProcessorGraph::Node", ptr %32, i32 0, i32 4
  %34 = call noundef ptr @_ZNK4juce13ScopedPointerINS_14AudioProcessorEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %33) #4
  %35 = call noundef i32 @_ZNK4juce14AudioProcessor25getTotalNumOutputChannelsEv(ptr noundef nonnull align 8 dereferenceable(256) %34) #4
  %36 = call noundef zeroext i1 @_ZN4juce18isPositiveAndBelowIiEEbT_S1_(i32 noundef %31, i32 noundef %35) #4
  br i1 %36, label %45, label %69

37:                                               ; preds = %23
  %38 = load ptr, ptr %5, align 8, !tbaa !5
  %39 = getelementptr inbounds %"class.juce::AudioProcessorGraph::Node", ptr %38, i32 0, i32 4
  %40 = call noundef ptr @_ZNK4juce13ScopedPointerINS_14AudioProcessorEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %39) #4
  %41 = load ptr, ptr %40, align 8, !tbaa !14
  %42 = getelementptr inbounds ptr, ptr %41, i64 14
  %43 = load ptr, ptr %42, align 8
  %44 = call noundef zeroext i1 %43(ptr noundef nonnull align 8 dereferenceable(256) %40)
  br i1 %44, label %45, label %69

45:                                               ; preds = %37, %28
  %46 = load ptr, ptr %4, align 8, !tbaa !5
  %47 = getelementptr inbounds %"struct.juce::AudioProcessorGraph::Connection", ptr %46, i32 0, i32 3
  %48 = load i32, ptr %47, align 4, !tbaa !16
  %49 = icmp ne i32 %48, 4096
  br i1 %49, label %50, label %59

50:                                               ; preds = %45
  %51 = load ptr, ptr %4, align 8, !tbaa !5
  %52 = getelementptr inbounds %"struct.juce::AudioProcessorGraph::Connection", ptr %51, i32 0, i32 3
  %53 = load i32, ptr %52, align 4, !tbaa !16
  %54 = load ptr, ptr %6, align 8, !tbaa !5
  %55 = getelementptr inbounds %"class.juce::AudioProcessorGraph::Node", ptr %54, i32 0, i32 4
  %56 = call noundef ptr @_ZNK4juce13ScopedPointerINS_14AudioProcessorEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %55) #4
  %57 = call noundef i32 @_ZNK4juce14AudioProcessor24getTotalNumInputChannelsEv(ptr noundef nonnull align 8 dereferenceable(256) %56) #4
  %58 = call noundef zeroext i1 @_ZN4juce18isPositiveAndBelowIiEEbT_S1_(i32 noundef %53, i32 noundef %57) #4
  br label %67

59:                                               ; preds = %45
  %60 = load ptr, ptr %6, align 8, !tbaa !5
  %61 = getelementptr inbounds %"class.juce::AudioProcessorGraph::Node", ptr %60, i32 0, i32 4
  %62 = call noundef ptr @_ZNK4juce13ScopedPointerINS_14AudioProcessorEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %61) #4
  %63 = load ptr, ptr %62, align 8, !tbaa !14
  %64 = getelementptr inbounds ptr, ptr %63, i64 13
  %65 = load ptr, ptr %64, align 8
  %66 = call noundef zeroext i1 %65(ptr noundef nonnull align 8 dereferenceable(256) %62)
  br label %67

67:                                               ; preds = %59, %50
  %68 = phi i1 [ %58, %50 ], [ %66, %59 ]
  br label %69

69:                                               ; preds = %67, %37, %28, %20, %9
  %70 = phi i1 [ false, %37 ], [ false, %28 ], [ false, %20 ], [ false, %9 ], [ %68, %67 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  ret i1 %70
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }

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

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


; 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"

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN4juce18isPositiveAndBelowIiEEbT_S1_(i32 noundef, i32 noundef) local_unnamed_addr #1

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK4juce19AudioProcessorGraph12getNodeForIdEj(ptr noundef nonnull align 8 dereferenceable(417), i32 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZNK4juce19AudioProcessorGraph17isConnectionLegalEPKNS0_10ConnectionE(ptr noundef nonnull align 8 dereferenceable(417) %0, ptr nocapture noundef readonly %1) local_unnamed_addr #2 align 2 {
  %3 = load i32, ptr %1, align 4, !tbaa !5
  %4 = tail call noundef ptr @_ZNK4juce19AudioProcessorGraph12getNodeForIdEj(ptr noundef nonnull align 8 dereferenceable(417) %0, i32 noundef %3)
  %5 = getelementptr inbounds i8, ptr %1, i64 8
  %6 = load i32, ptr %5, align 4, !tbaa !10
  %7 = tail call noundef ptr @_ZNK4juce19AudioProcessorGraph12getNodeForIdEj(ptr noundef nonnull align 8 dereferenceable(417) %0, i32 noundef %6)
  %8 = icmp ne ptr %4, null
  %9 = icmp ne ptr %7, null
  %or.cond = and i1 %8, %9
  br i1 %or.cond, label %10, label %36

10:                                               ; preds = %2
  %11 = getelementptr inbounds i8, ptr %1, i64 4
  %12 = load i32, ptr %11, align 4, !tbaa !11
  %.not = icmp eq i32 %12, 4096
  %13 = getelementptr inbounds i8, ptr %4, i64 48
  %14 = tail call noundef ptr @_ZNK4juce13ScopedPointerINS_14AudioProcessorEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %13) #3
  br i1 %.not, label %18, label %15

15:                                               ; preds = %10
  %16 = tail call noundef i32 @_ZNK4juce14AudioProcessor25getTotalNumOutputChannelsEv(ptr noundef nonnull align 8 dereferenceable(256) %14) #3
  %17 = tail call noundef zeroext i1 @_ZN4juce18isPositiveAndBelowIiEEbT_S1_(i32 noundef %12, i32 noundef %16) #3
  br i1 %17, label %23, label %36

18:                                               ; preds = %10
  %19 = load ptr, ptr %14, align 8, !tbaa !12
  %20 = getelementptr inbounds i8, ptr %19, i64 112
  %21 = load ptr, ptr %20, align 8
  %22 = tail call noundef zeroext i1 %21(ptr noundef nonnull align 8 dereferenceable(256) %14)
  br i1 %22, label %23, label %36

23:                                               ; preds = %18, %15
  %24 = getelementptr inbounds i8, ptr %1, i64 12
  %25 = load i32, ptr %24, align 4, !tbaa !14
  %.not17 = icmp eq i32 %25, 4096
  %26 = getelementptr inbounds i8, ptr %7, i64 48
  %27 = tail call noundef ptr @_ZNK4juce13ScopedPointerINS_14AudioProcessorEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %26) #3
  br i1 %.not17, label %31, label %28

28:                                               ; preds = %23
  %29 = tail call noundef i32 @_ZNK4juce14AudioProcessor24getTotalNumInputChannelsEv(ptr noundef nonnull align 8 dereferenceable(256) %27) #3
  %30 = tail call noundef zeroext i1 @_ZN4juce18isPositiveAndBelowIiEEbT_S1_(i32 noundef %25, i32 noundef %29) #3
  br label %36

31:                                               ; preds = %23
  %32 = load ptr, ptr %27, align 8, !tbaa !12
  %33 = getelementptr inbounds i8, ptr %32, i64 104
  %34 = load ptr, ptr %33, align 8
  %35 = tail call noundef zeroext i1 %34(ptr noundef nonnull align 8 dereferenceable(256) %27)
  br label %36

36:                                               ; preds = %28, %31, %18, %15, %2
  %37 = phi i1 [ false, %18 ], [ false, %15 ], [ false, %2 ], [ %30, %28 ], [ %35, %31 ]
  ret i1 %37
}

attributes #0 = { 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 #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 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 = { 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, !7, i64 0}
!6 = !{!"_ZTSN4juce19AudioProcessorGraph10ConnectionE", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!6, !7, i64 8}
!11 = !{!6, !7, i64 4}
!12 = !{!13, !13, i64 0}
!13 = !{!"vtable pointer", !9, i64 0}
!14 = !{!6, !7, i64 12}


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