; LLVM IR from modlfo/AudioEngine :: AudioEngine/JuceLibraryCode (juce_gui_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::ComponentBuilder" = type { %"class.juce::ValueTree::Listener", %"class.juce::ValueTree", %"class.juce::OwnedArray.181", %"class.juce::ScopedPointer.159", ptr }
%"class.juce::ValueTree::Listener" = type { ptr }
%"class.juce::ValueTree" = type { %"class.juce::ReferenceCountedObjectPtr.174", %"class.juce::ListenerList.175" }
%"class.juce::ReferenceCountedObjectPtr.174" = type { ptr }
%"class.juce::ListenerList.175" = type { %"class.juce::Array.176" }
%"class.juce::Array.176" = type { %"class.juce::ArrayAllocationBase.177", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.177" = type <{ %"class.juce::HeapBlock.178", i32, [4 x i8] }>
%"class.juce::HeapBlock.178" = type { ptr }
%"class.juce::OwnedArray.181" = type { %"class.juce::ArrayAllocationBase.182", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.182" = type <{ %"class.juce::HeapBlock.183", i32, [4 x i8] }>
%"class.juce::HeapBlock.183" = type { ptr }
%"class.juce::ScopedPointer.159" = type { ptr }

@_ZTIN4juce9ComponentE = external dso_local constant { ptr, ptr, ptr }, align 8
@_ZTIN4juce8DrawableE = external dso_local constant { ptr, ptr, ptr }, align 8

declare i32 @__gxx_personality_v0(...)

; 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: nounwind willreturn memory(read)
declare ptr @__dynamic_cast(ptr, ptr, ptr, i64) #1

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

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZN4juce8Drawable19createFromValueTreeERKNS_9ValueTreeEPNS_16ComponentBuilder13ImageProviderE(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef %1) #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca %"class.juce::ComponentBuilder", align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca %"class.juce::ScopedPointer.159", align 8
  %9 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 80, ptr %5) #5
  %10 = load ptr, ptr %3, align 8, !tbaa !5
  call void @_ZN4juce16ComponentBuilderC1ERKNS_9ValueTreeE(ptr noundef nonnull align 8 dereferenceable(80) %5, ptr noundef nonnull align 8 dereferenceable(32) %10)
  %11 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZN4juce16ComponentBuilder16setImageProviderEPNS0_13ImageProviderE(ptr noundef nonnull align 8 dereferenceable(80) %5, ptr noundef %11) #5
  invoke void @_ZN4juce8Drawable28registerDrawableTypeHandlersERNS_16ComponentBuilderE(ptr noundef nonnull align 8 dereferenceable(80) %5)
          to label %12 unwind label %19

12:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %13 = invoke noundef ptr @_ZN4juce16ComponentBuilder15createComponentEv(ptr noundef nonnull align 8 dereferenceable(80) %5)
          to label %14 unwind label %23

14:                                               ; preds = %12
  call void @_ZN4juce13ScopedPointerINS_9ComponentEEC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef %13) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %15 = call noundef ptr @_ZNK4juce13ScopedPointerINS_9ComponentEEcvPS1_Ev(ptr noundef nonnull align 8 dereferenceable(8) %8) #5
  %16 = icmp eq ptr %15, null
  br i1 %16, label %27, label %17

17:                                               ; preds = %14
  %18 = call ptr @__dynamic_cast(ptr %15, ptr @_ZTIN4juce9ComponentE, ptr @_ZTIN4juce8DrawableE, i64 0) #5
  br label %28

19:                                               ; preds = %2
  %20 = landingpad { ptr, i32 }
          cleanup
  %21 = extractvalue { ptr, i32 } %20, 0
  store ptr %21, ptr %6, align 8
  %22 = extractvalue { ptr, i32 } %20, 1
  store i32 %22, ptr %7, align 4
  br label %36

23:                                               ; preds = %12
  %24 = landingpad { ptr, i32 }
          cleanup
  %25 = extractvalue { ptr, i32 } %24, 0
  store ptr %25, ptr %6, align 8
  %26 = extractvalue { ptr, i32 } %24, 1
  store i32 %26, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  br label %36

27:                                               ; preds = %14
  br label %28

28:                                               ; preds = %27, %17
  %29 = phi ptr [ %18, %17 ], [ null, %27 ]
  store ptr %29, ptr %9, align 8, !tbaa !5
  %30 = load ptr, ptr %9, align 8, !tbaa !5
  %31 = icmp ne ptr %30, null
  br i1 %31, label %32, label %34

32:                                               ; preds = %28
  %33 = call noundef ptr @_ZN4juce13ScopedPointerINS_9ComponentEE7releaseEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #5
  br label %34

34:                                               ; preds = %32, %28
  %35 = load ptr, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @_ZN4juce13ScopedPointerINS_9ComponentEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @_ZN4juce16ComponentBuilderD1Ev(ptr noundef nonnull align 8 dereferenceable(80) %5) #5
  call void @llvm.lifetime.end.p0(i64 80, ptr %5) #5
  ret ptr %35

36:                                               ; preds = %23, %19
  call void @_ZN4juce16ComponentBuilderD1Ev(ptr noundef nonnull align 8 dereferenceable(80) %5) #5
  call void @llvm.lifetime.end.p0(i64 80, ptr %5) #5
  br label %37

37:                                               ; preds = %36
  %38 = load ptr, ptr %6, align 8
  %39 = load i32, ptr %7, align 4
  %40 = insertvalue { ptr, i32 } poison, ptr %38, 0
  %41 = insertvalue { ptr, i32 } %40, i32 %39, 1
  resume { ptr, i32 } %41
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4juce16ComponentBuilder16setImageProviderEPNS0_13ImageProviderE(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN4juce16ComponentBuilder15createComponentEv(ptr noundef nonnull align 8 dereferenceable(80)) #2 align 2

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

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

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

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

declare void @_ZN4juce16ComponentBuilderC1ERKNS_9ValueTreeE(ptr, ptr)

declare void @_ZN4juce16ComponentBuilderD1Ev(ptr)

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind willreturn memory(read) }
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 = { 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 #4 = { 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 #5 = { 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"}


; 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::ComponentBuilder" = type { %"class.juce::ValueTree::Listener", %"class.juce::ValueTree", %"class.juce::OwnedArray.181", %"class.juce::ScopedPointer.159", ptr }
%"class.juce::ValueTree::Listener" = type { ptr }
%"class.juce::ValueTree" = type { %"class.juce::ReferenceCountedObjectPtr.174", %"class.juce::ListenerList.175" }
%"class.juce::ReferenceCountedObjectPtr.174" = type { ptr }
%"class.juce::ListenerList.175" = type { %"class.juce::Array.176" }
%"class.juce::Array.176" = type { %"class.juce::ArrayAllocationBase.177", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.177" = type <{ %"class.juce::HeapBlock.178", i32, [4 x i8] }>
%"class.juce::HeapBlock.178" = type { ptr }
%"class.juce::OwnedArray.181" = type { %"class.juce::ArrayAllocationBase.182", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.182" = type <{ %"class.juce::HeapBlock.183", i32, [4 x i8] }>
%"class.juce::HeapBlock.183" = type { ptr }
%"class.juce::ScopedPointer.159" = type { ptr }

@_ZTIN4juce9ComponentE = external dso_local constant { ptr, ptr, ptr }, align 8
@_ZTIN4juce8DrawableE = external dso_local constant { ptr, ptr, ptr }, align 8

declare i32 @__gxx_personality_v0(...)

; 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

; Function Attrs: mustprogress nofree nounwind willreturn memory(read)
declare ptr @__dynamic_cast(ptr, ptr, ptr, i64) local_unnamed_addr #1

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

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZN4juce8Drawable19createFromValueTreeERKNS_9ValueTreeEPNS_16ComponentBuilder13ImageProviderE(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef %1) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.juce::ComponentBuilder", align 8
  %4 = alloca %"class.juce::ScopedPointer.159", align 8
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %3) #5
  call void @_ZN4juce16ComponentBuilderC1ERKNS_9ValueTreeE(ptr noundef nonnull align 8 dereferenceable(80) %3, ptr noundef nonnull align 8 dereferenceable(32) %0)
  call void @_ZN4juce16ComponentBuilder16setImageProviderEPNS0_13ImageProviderE(ptr noundef nonnull align 8 dereferenceable(80) %3, ptr noundef %1) #5
  invoke void @_ZN4juce8Drawable28registerDrawableTypeHandlersERNS_16ComponentBuilderE(ptr noundef nonnull align 8 dereferenceable(80) %3)
          to label %5 unwind label %10

5:                                                ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  %6 = invoke noundef ptr @_ZN4juce16ComponentBuilder15createComponentEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
          to label %7 unwind label %12

7:                                                ; preds = %5
  call void @_ZN4juce13ScopedPointerINS_9ComponentEEC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef %6) #5
  %8 = call noundef ptr @_ZNK4juce13ScopedPointerINS_9ComponentEEcvPS1_Ev(ptr noundef nonnull align 8 dereferenceable(8) %4) #5
  %9 = icmp eq ptr %8, null
  br i1 %9, label %.thread, label %14

10:                                               ; preds = %2
  %11 = landingpad { ptr, i32 }
          cleanup
  br label %19

12:                                               ; preds = %5
  %13 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  br label %19

14:                                               ; preds = %7
  %15 = call ptr @__dynamic_cast(ptr nonnull %8, ptr nonnull @_ZTIN4juce9ComponentE, ptr nonnull @_ZTIN4juce8DrawableE, i64 0) #5
  %.not = icmp eq ptr %15, null
  br i1 %.not, label %.thread, label %16

16:                                               ; preds = %14
  %17 = call noundef ptr @_ZN4juce13ScopedPointerINS_9ComponentEE7releaseEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #5
  br label %.thread

.thread:                                          ; preds = %7, %16, %14
  %18 = phi ptr [ %15, %16 ], [ null, %14 ], [ null, %7 ]
  call void @_ZN4juce13ScopedPointerINS_9ComponentEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  call void @_ZN4juce16ComponentBuilderD1Ev(ptr noundef nonnull align 8 dereferenceable(80) %3) #5
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %3) #5
  ret ptr %18

19:                                               ; preds = %12, %10
  %.pn = phi { ptr, i32 } [ %13, %12 ], [ %11, %10 ]
  call void @_ZN4juce16ComponentBuilderD1Ev(ptr noundef nonnull align 8 dereferenceable(80) %3) #5
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %3) #5
  resume { ptr, i32 } %.pn
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4juce16ComponentBuilder16setImageProviderEPNS0_13ImageProviderE(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN4juce16ComponentBuilder15createComponentEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #2 align 2

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

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

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

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

declare void @_ZN4juce16ComponentBuilderC1ERKNS_9ValueTreeE(ptr, ptr) local_unnamed_addr

declare void @_ZN4juce16ComponentBuilderD1Ev(ptr) local_unnamed_addr

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nofree nounwind willreturn memory(read) }
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 = { 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 #4 = { 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 #5 = { 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)"}


; Effective O3 passes: CorrelatedValuePropagationPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,SROAPass,SimplifyCFGPass