; 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::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 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 nounwind uwtable
declare dso_local noundef ptr @_ZNK4juce19AudioProcessorGraph20getConnectionBetweenEjiji(ptr noundef nonnull align 8 dereferenceable(417), i32 noundef, i32 noundef, i32 noundef, i32 noundef) #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZNK4juce19AudioProcessorGraph10canConnectEjiji(ptr noundef nonnull align 8 dereferenceable(417) %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4) #3 align 2 {
  %6 = alloca i1, align 1
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  store ptr %0, ptr %7, align 8, !tbaa !5
  store i32 %1, ptr %8, align 4, !tbaa !9
  store i32 %2, ptr %9, align 4, !tbaa !9
  store i32 %3, ptr %10, align 4, !tbaa !9
  store i32 %4, ptr %11, align 4, !tbaa !9
  %15 = load ptr, ptr %7, align 8
  %16 = load i32, ptr %9, align 4, !tbaa !9
  %17 = icmp slt i32 %16, 0
  br i1 %17, label %33, label %18

18:                                               ; preds = %5
  %19 = load i32, ptr %11, align 4, !tbaa !9
  %20 = icmp slt i32 %19, 0
  br i1 %20, label %33, label %21

21:                                               ; preds = %18
  %22 = load i32, ptr %8, align 4, !tbaa !9
  %23 = load i32, ptr %10, align 4, !tbaa !9
  %24 = icmp eq i32 %22, %23
  br i1 %24, label %33, label %25

25:                                               ; preds = %21
  %26 = load i32, ptr %11, align 4, !tbaa !9
  %27 = icmp eq i32 %26, 4096
  %28 = zext i1 %27 to i32
  %29 = load i32, ptr %9, align 4, !tbaa !9
  %30 = icmp eq i32 %29, 4096
  %31 = zext i1 %30 to i32
  %32 = icmp ne i32 %28, %31
  br i1 %32, label %33, label %34

33:                                               ; preds = %25, %21, %18, %5
  store i1 false, ptr %6, align 1
  br label %97

34:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  %35 = load i32, ptr %8, align 4, !tbaa !9
  %36 = call noundef ptr @_ZNK4juce19AudioProcessorGraph12getNodeForIdEj(ptr noundef nonnull align 8 dereferenceable(417) %15, i32 noundef %35)
  store ptr %36, ptr %12, align 8, !tbaa !5
  %37 = load ptr, ptr %12, align 8, !tbaa !5
  %38 = icmp eq ptr %37, null
  br i1 %38, label %60, label %39

39:                                               ; preds = %34
  %40 = load i32, ptr %9, align 4, !tbaa !9
  %41 = icmp ne i32 %40, 4096
  br i1 %41, label %42, label %49

42:                                               ; preds = %39
  %43 = load i32, ptr %9, align 4, !tbaa !9
  %44 = load ptr, ptr %12, align 8, !tbaa !5
  %45 = getelementptr inbounds %"class.juce::AudioProcessorGraph::Node", ptr %44, i32 0, i32 4
  %46 = call noundef ptr @_ZNK4juce13ScopedPointerINS_14AudioProcessorEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %45) #4
  %47 = call noundef i32 @_ZNK4juce14AudioProcessor25getTotalNumOutputChannelsEv(ptr noundef nonnull align 8 dereferenceable(256) %46) #4
  %48 = icmp sge i32 %43, %47
  br i1 %48, label %60, label %49

49:                                               ; preds = %42, %39
  %50 = load i32, ptr %9, align 4, !tbaa !9
  %51 = icmp eq i32 %50, 4096
  br i1 %51, label %52, label %61

52:                                               ; preds = %49
  %53 = load ptr, ptr %12, align 8, !tbaa !5
  %54 = getelementptr inbounds %"class.juce::AudioProcessorGraph::Node", ptr %53, i32 0, i32 4
  %55 = call noundef ptr @_ZNK4juce13ScopedPointerINS_14AudioProcessorEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %54) #4
  %56 = load ptr, ptr %55, align 8, !tbaa !11
  %57 = getelementptr inbounds ptr, ptr %56, i64 14
  %58 = load ptr, ptr %57, align 8
  %59 = call noundef zeroext i1 %58(ptr noundef nonnull align 8 dereferenceable(256) %55)
  br i1 %59, label %61, label %60

60:                                               ; preds = %52, %42, %34
  store i1 false, ptr %6, align 1
  store i32 1, ptr %13, align 4
  br label %96

61:                                               ; preds = %52, %49
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  %62 = load i32, ptr %10, align 4, !tbaa !9
  %63 = call noundef ptr @_ZNK4juce19AudioProcessorGraph12getNodeForIdEj(ptr noundef nonnull align 8 dereferenceable(417) %15, i32 noundef %62)
  store ptr %63, ptr %14, align 8, !tbaa !5
  %64 = load ptr, ptr %14, align 8, !tbaa !5
  %65 = icmp eq ptr %64, null
  br i1 %65, label %87, label %66

66:                                               ; preds = %61
  %67 = load i32, ptr %11, align 4, !tbaa !9
  %68 = icmp ne i32 %67, 4096
  br i1 %68, label %69, label %76

69:                                               ; preds = %66
  %70 = load i32, ptr %11, align 4, !tbaa !9
  %71 = load ptr, ptr %14, align 8, !tbaa !5
  %72 = getelementptr inbounds %"class.juce::AudioProcessorGraph::Node", ptr %71, i32 0, i32 4
  %73 = call noundef ptr @_ZNK4juce13ScopedPointerINS_14AudioProcessorEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %72) #4
  %74 = call noundef i32 @_ZNK4juce14AudioProcessor24getTotalNumInputChannelsEv(ptr noundef nonnull align 8 dereferenceable(256) %73) #4
  %75 = icmp sge i32 %70, %74
  br i1 %75, label %87, label %76

76:                                               ; preds = %69, %66
  %77 = load i32, ptr %11, align 4, !tbaa !9
  %78 = icmp eq i32 %77, 4096
  br i1 %78, label %79, label %88

79:                                               ; preds = %76
  %80 = load ptr, ptr %14, align 8, !tbaa !5
  %81 = getelementptr inbounds %"class.juce::AudioProcessorGraph::Node", ptr %80, i32 0, i32 4
  %82 = call noundef ptr @_ZNK4juce13ScopedPointerINS_14AudioProcessorEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %81) #4
  %83 = load ptr, ptr %82, align 8, !tbaa !11
  %84 = getelementptr inbounds ptr, ptr %83, i64 13
  %85 = load ptr, ptr %84, align 8
  %86 = call noundef zeroext i1 %85(ptr noundef nonnull align 8 dereferenceable(256) %82)
  br i1 %86, label %88, label %87

87:                                               ; preds = %79, %69, %61
  store i1 false, ptr %6, align 1
  store i32 1, ptr %13, align 4
  br label %95

88:                                               ; preds = %79, %76
  %89 = load i32, ptr %8, align 4, !tbaa !9
  %90 = load i32, ptr %9, align 4, !tbaa !9
  %91 = load i32, ptr %10, align 4, !tbaa !9
  %92 = load i32, ptr %11, align 4, !tbaa !9
  %93 = call noundef ptr @_ZNK4juce19AudioProcessorGraph20getConnectionBetweenEjiji(ptr noundef nonnull align 8 dereferenceable(417) %15, i32 noundef %89, i32 noundef %90, i32 noundef %91, i32 noundef %92)
  %94 = icmp eq ptr %93, null
  store i1 %94, ptr %6, align 1
  store i32 1, ptr %13, align 4
  br label %95

95:                                               ; preds = %88, %87
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  br label %96

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

97:                                               ; preds = %96, %33
  %98 = load i1, ptr %6, align 1
  ret i1 %98
}

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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"vtable pointer", !8, i64 0}


; 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 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 nounwind uwtable
declare dso_local noundef ptr @_ZNK4juce19AudioProcessorGraph20getConnectionBetweenEjiji(ptr noundef nonnull align 8 dereferenceable(417), i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZNK4juce19AudioProcessorGraph10canConnectEjiji(ptr noundef nonnull align 8 dereferenceable(417) %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4) local_unnamed_addr #2 align 2 {
  %6 = or i32 %4, %2
  %or.cond.not = icmp slt i32 %6, 0
  %7 = icmp eq i32 %1, %3
  %or.cond = or i1 %7, %or.cond.not
  br i1 %or.cond, label %41, label %8

8:                                                ; preds = %5
  %9 = icmp eq i32 %4, 4096
  %10 = icmp eq i32 %2, 4096
  %11 = xor i1 %10, %9
  br i1 %11, label %41, label %12

12:                                               ; preds = %8
  %13 = tail call noundef ptr @_ZNK4juce19AudioProcessorGraph12getNodeForIdEj(ptr noundef nonnull align 8 dereferenceable(417) %0, i32 noundef %1)
  %14 = icmp eq ptr %13, null
  br i1 %14, label %41, label %15

15:                                               ; preds = %12
  %16 = getelementptr inbounds i8, ptr %13, i64 48
  %17 = tail call noundef ptr @_ZNK4juce13ScopedPointerINS_14AudioProcessorEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %16) #3
  br i1 %10, label %20, label %18

18:                                               ; preds = %15
  %19 = tail call noundef i32 @_ZNK4juce14AudioProcessor25getTotalNumOutputChannelsEv(ptr noundef nonnull align 8 dereferenceable(256) %17) #3
  %.not32 = icmp sgt i32 %19, %2
  br i1 %.not32, label %25, label %41

20:                                               ; preds = %15
  %21 = load ptr, ptr %17, align 8, !tbaa !5
  %22 = getelementptr inbounds i8, ptr %21, i64 112
  %23 = load ptr, ptr %22, align 8
  %24 = tail call noundef zeroext i1 %23(ptr noundef nonnull align 8 dereferenceable(256) %17)
  br i1 %24, label %25, label %41

25:                                               ; preds = %18, %20
  %26 = tail call noundef ptr @_ZNK4juce19AudioProcessorGraph12getNodeForIdEj(ptr noundef nonnull align 8 dereferenceable(417) %0, i32 noundef %3)
  %27 = icmp eq ptr %26, null
  br i1 %27, label %41, label %28

28:                                               ; preds = %25
  %29 = getelementptr inbounds i8, ptr %26, i64 48
  %30 = tail call noundef ptr @_ZNK4juce13ScopedPointerINS_14AudioProcessorEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %29) #3
  br i1 %9, label %33, label %31

31:                                               ; preds = %28
  %32 = tail call noundef i32 @_ZNK4juce14AudioProcessor24getTotalNumInputChannelsEv(ptr noundef nonnull align 8 dereferenceable(256) %30) #3
  %.not34 = icmp sgt i32 %32, %4
  br i1 %.not34, label %38, label %41

33:                                               ; preds = %28
  %34 = load ptr, ptr %30, align 8, !tbaa !5
  %35 = getelementptr inbounds i8, ptr %34, i64 104
  %36 = load ptr, ptr %35, align 8
  %37 = tail call noundef zeroext i1 %36(ptr noundef nonnull align 8 dereferenceable(256) %30)
  br i1 %37, label %38, label %41

38:                                               ; preds = %31, %33
  %39 = tail call noundef ptr @_ZNK4juce19AudioProcessorGraph20getConnectionBetweenEjiji(ptr noundef nonnull align 8 dereferenceable(417) %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4)
  %40 = icmp eq ptr %39, null
  br label %41

41:                                               ; preds = %20, %18, %12, %25, %31, %33, %38, %5, %8
  %.2 = phi i1 [ false, %8 ], [ false, %5 ], [ false, %20 ], [ false, %18 ], [ false, %12 ], [ %40, %38 ], [ false, %33 ], [ false, %31 ], [ false, %25 ]
  ret i1 %.2
}

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, !6, i64 0}
!6 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}


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