; 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::ScopedPointer.95" = type { ptr }
%"class.juce::ScopedPointer.448" = type { ptr }
%"struct.juce::PopupMenuCompletionCallback" = type { %"class.juce::ModalComponentManager::Callback", ptr, %"class.juce::ScopedPointer.159", %"class.juce::WeakReference", %"class.juce::WeakReference" }
%"class.juce::ModalComponentManager::Callback" = type { ptr }
%"class.juce::ScopedPointer.159" = type { ptr }
%"class.juce::WeakReference" = type { %"class.juce::ReferenceCountedObjectPtr" }
%"class.juce::ReferenceCountedObjectPtr" = type { ptr }

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) #0

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4juce9Component7toFrontEb(ptr noundef nonnull align 8 dereferenceable(197), i1 noundef zeroext) #3 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4juce9Component15enterModalStateEbPNS_21ModalComponentManager8CallbackEb(ptr noundef nonnull align 8 dereferenceable(197), i1 noundef zeroext, ptr noundef, i1 noundef zeroext) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN4juce21ModalComponentManager11getInstanceEv() #3 align 2

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZNK4juce9PopupMenu12createWindowERKNS0_7OptionsEPPNS_25ApplicationCommandManagerE(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(48), ptr noundef) #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN4juce9PopupMenu24showWithOptionalCallbackERKNS0_7OptionsEPNS_21ModalComponentManager8CallbackEb(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull align 8 dereferenceable(48) %1, ptr noundef %2, i1 noundef zeroext %3) #3 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i8, align 1
  %10 = alloca %"class.juce::ScopedPointer.95", align 8
  %11 = alloca %"class.juce::ScopedPointer.448", align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  %16 = zext i1 %3 to i8
  store i8 %16, ptr %9, align 1, !tbaa !9
  %17 = load ptr, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %18 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN4juce13ScopedPointerINS_21ModalComponentManager8CallbackEEC2EPS2_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef %18) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %19 = invoke noalias noundef nonnull ptr @_Znwm(i64 noundef 40) #7
          to label %20 unwind label %58

20:                                               ; preds = %4
  invoke void @_ZN4juce27PopupMenuCompletionCallbackC2Ev(ptr noundef nonnull align 8 dereferenceable(40) %19)
          to label %21 unwind label %62

21:                                               ; preds = %20
  call void @_ZN4juce13ScopedPointerINS_27PopupMenuCompletionCallbackEEC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef %19) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %22 = load ptr, ptr %7, align 8, !tbaa !5
  %23 = call noundef ptr @_ZNK4juce13ScopedPointerINS_27PopupMenuCompletionCallbackEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %11) #6
  %24 = getelementptr inbounds %"struct.juce::PopupMenuCompletionCallback", ptr %23, i32 0, i32 1
  %25 = invoke noundef ptr @_ZNK4juce9PopupMenu12createWindowERKNS0_7OptionsEPPNS_25ApplicationCommandManagerE(ptr noundef nonnull align 8 dereferenceable(32) %17, ptr noundef nonnull align 8 dereferenceable(48) %22, ptr noundef %24)
          to label %26 unwind label %66

26:                                               ; preds = %21
  store ptr %25, ptr %14, align 8, !tbaa !5
  %27 = load ptr, ptr %14, align 8, !tbaa !5
  %28 = icmp ne ptr %27, null
  br i1 %28, label %29, label %71

29:                                               ; preds = %26
  %30 = load ptr, ptr %14, align 8, !tbaa !5
  %31 = call noundef ptr @_ZNK4juce13ScopedPointerINS_27PopupMenuCompletionCallbackEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %11) #6
  %32 = getelementptr inbounds %"struct.juce::PopupMenuCompletionCallback", ptr %31, i32 0, i32 2
  %33 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN4juce13ScopedPointerINS_9ComponentEEaSEPS1_(ptr noundef nonnull align 8 dereferenceable(8) %32, ptr noundef %30)
          to label %34 unwind label %66

34:                                               ; preds = %29
  %35 = load ptr, ptr %14, align 8, !tbaa !5
  %36 = load ptr, ptr %35, align 8, !tbaa !11
  %37 = getelementptr inbounds ptr, ptr %36, i64 11
  %38 = load ptr, ptr %37, align 8
  invoke void %38(ptr noundef nonnull align 8 dereferenceable(197) %35, i1 noundef zeroext true)
          to label %39 unwind label %66

39:                                               ; preds = %34
  %40 = load ptr, ptr %14, align 8, !tbaa !5
  %41 = call noundef ptr @_ZN4juce13ScopedPointerINS_21ModalComponentManager8CallbackEE7releaseEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #6
  invoke void @_ZN4juce9Component15enterModalStateEbPNS_21ModalComponentManager8CallbackEb(ptr noundef nonnull align 8 dereferenceable(197) %40, i1 noundef zeroext false, ptr noundef %41, i1 noundef zeroext false)
          to label %42 unwind label %66

42:                                               ; preds = %39
  %43 = invoke noundef ptr @_ZN4juce21ModalComponentManager11getInstanceEv()
          to label %44 unwind label %66

44:                                               ; preds = %42
  %45 = load ptr, ptr %14, align 8, !tbaa !5
  %46 = call noundef ptr @_ZN4juce13ScopedPointerINS_27PopupMenuCompletionCallbackEE7releaseEv(ptr noundef nonnull align 8 dereferenceable(8) %11) #6
  call void @_ZN4juce21ModalComponentManager14attachCallbackEPNS_9ComponentEPNS0_8CallbackE(ptr noundef nonnull align 8 dereferenceable(48) %43, ptr noundef %45, ptr noundef %46)
  %47 = load ptr, ptr %14, align 8, !tbaa !5
  invoke void @_ZN4juce9Component7toFrontEb(ptr noundef nonnull align 8 dereferenceable(197) %47, i1 noundef zeroext false)
          to label %48 unwind label %66

48:                                               ; preds = %44
  %49 = load ptr, ptr %8, align 8, !tbaa !5
  %50 = icmp eq ptr %49, null
  br i1 %50, label %51, label %70

51:                                               ; preds = %48
  %52 = load i8, ptr %9, align 1, !tbaa !9, !range !13, !noundef !14
  %53 = trunc i8 %52 to i1
  br i1 %53, label %54, label %70

54:                                               ; preds = %51
  %55 = load ptr, ptr %14, align 8, !tbaa !5
  %56 = invoke noundef i32 @_ZN4juce9Component12runModalLoopEv(ptr noundef nonnull align 8 dereferenceable(197) %55)
          to label %57 unwind label %66

57:                                               ; preds = %54
  store i32 %56, ptr %5, align 4
  store i32 1, ptr %15, align 4
  br label %72

58:                                               ; preds = %4
  %59 = landingpad { ptr, i32 }
          cleanup
  %60 = extractvalue { ptr, i32 } %59, 0
  store ptr %60, ptr %12, align 8
  %61 = extractvalue { ptr, i32 } %59, 1
  store i32 %61, ptr %13, align 4
  br label %77

62:                                               ; preds = %20
  %63 = landingpad { ptr, i32 }
          cleanup
  %64 = extractvalue { ptr, i32 } %63, 0
  store ptr %64, ptr %12, align 8
  %65 = extractvalue { ptr, i32 } %63, 1
  store i32 %65, ptr %13, align 4
  call void @_ZdlPvm(ptr noundef %19, i64 noundef 40) #8
  br label %77

66:                                               ; preds = %54, %44, %42, %39, %34, %29, %21
  %67 = landingpad { ptr, i32 }
          cleanup
  %68 = extractvalue { ptr, i32 } %67, 0
  store ptr %68, ptr %12, align 8
  %69 = extractvalue { ptr, i32 } %67, 1
  store i32 %69, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @_ZN4juce13ScopedPointerINS_27PopupMenuCompletionCallbackEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %11) #6
  br label %77

70:                                               ; preds = %51, %48
  br label %71

71:                                               ; preds = %70, %26
  store i32 0, ptr %15, align 4
  br label %72

72:                                               ; preds = %71, %57
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  %73 = load i32, ptr %15, align 4
  switch i32 %73, label %75 [
    i32 0, label %74
  ]

74:                                               ; preds = %72
  store i32 0, ptr %5, align 4
  store i32 1, ptr %15, align 4
  br label %75

75:                                               ; preds = %74, %72
  call void @_ZN4juce13ScopedPointerINS_27PopupMenuCompletionCallbackEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @_ZN4juce13ScopedPointerINS_21ModalComponentManager8CallbackEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  %76 = load i32, ptr %5, align 4
  ret i32 %76

77:                                               ; preds = %66, %62, %58
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @_ZN4juce13ScopedPointerINS_21ModalComponentManager8CallbackEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  br label %78

78:                                               ; preds = %77
  %79 = load ptr, ptr %12, align 8
  %80 = load i32, ptr %13, align 4
  %81 = insertvalue { ptr, i32 } poison, ptr %79, 0
  %82 = insertvalue { ptr, i32 } %81, i32 %80, 1
  resume { ptr, i32 } %82
}

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

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

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

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

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

attributes #0 = { nobuiltin nounwind "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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nobuiltin allocsize(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 = { 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 = { 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 #6 = { nounwind }
attributes #7 = { builtin allocsize(0) }
attributes #8 = { builtin 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 = !{!"bool", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"vtable pointer", !8, i64 0}
!13 = !{i8 0, i8 2}
!14 = !{}


; 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::ScopedPointer.95" = type { ptr }
%"class.juce::ScopedPointer.448" = type { ptr }

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4juce9Component7toFrontEb(ptr noundef nonnull align 8 dereferenceable(197), i1 noundef zeroext) local_unnamed_addr #3 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4juce9Component15enterModalStateEbPNS_21ModalComponentManager8CallbackEb(ptr noundef nonnull align 8 dereferenceable(197), i1 noundef zeroext, ptr noundef, i1 noundef zeroext) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN4juce21ModalComponentManager11getInstanceEv() local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4juce21ModalComponentManager14attachCallbackEPNS_9ComponentEPNS0_8CallbackE(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef, ptr noundef) local_unnamed_addr #4 align 2

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZNK4juce9PopupMenu12createWindowERKNS0_7OptionsEPPNS_25ApplicationCommandManagerE(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(48), ptr noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN4juce9PopupMenu24showWithOptionalCallbackERKNS0_7OptionsEPNS_21ModalComponentManager8CallbackEb(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull align 8 dereferenceable(48) %1, ptr noundef %2, i1 noundef zeroext %3) local_unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca %"class.juce::ScopedPointer.95", align 8
  %6 = alloca %"class.juce::ScopedPointer.448", align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  call void @_ZN4juce13ScopedPointerINS_21ModalComponentManager8CallbackEEC2EPS2_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef %2) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #6
  %7 = invoke noalias noundef nonnull dereferenceable(40) ptr @_Znwm(i64 noundef 40) #7
          to label %8 unwind label %31

8:                                                ; preds = %4
  invoke void @_ZN4juce27PopupMenuCompletionCallbackC2Ev(ptr noundef nonnull align 8 dereferenceable(40) %7)
          to label %9 unwind label %33

9:                                                ; preds = %8
  call void @_ZN4juce13ScopedPointerINS_27PopupMenuCompletionCallbackEEC2EPS1_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull %7) #6
  %10 = call noundef ptr @_ZNK4juce13ScopedPointerINS_27PopupMenuCompletionCallbackEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #6
  %11 = getelementptr inbounds i8, ptr %10, i64 8
  %12 = invoke noundef ptr @_ZNK4juce9PopupMenu12createWindowERKNS0_7OptionsEPPNS_25ApplicationCommandManagerE(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull align 8 dereferenceable(48) %1, ptr noundef nonnull %11)
          to label %13 unwind label %35

13:                                               ; preds = %9
  %.not = icmp eq ptr %12, null
  br i1 %.not, label %37, label %14

14:                                               ; preds = %13
  %15 = call noundef ptr @_ZNK4juce13ScopedPointerINS_27PopupMenuCompletionCallbackEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #6
  %16 = getelementptr inbounds i8, ptr %15, i64 16
  %17 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN4juce13ScopedPointerINS_9ComponentEEaSEPS1_(ptr noundef nonnull align 8 dereferenceable(8) %16, ptr noundef nonnull %12)
  %18 = load ptr, ptr %12, align 8, !tbaa !5
  %19 = getelementptr inbounds i8, ptr %18, i64 88
  %20 = load ptr, ptr %19, align 8
  invoke void %20(ptr noundef nonnull align 8 dereferenceable(197) %12, i1 noundef zeroext true)
          to label %21 unwind label %35

21:                                               ; preds = %14
  %22 = call noundef ptr @_ZN4juce13ScopedPointerINS_21ModalComponentManager8CallbackEE7releaseEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #6
  invoke void @_ZN4juce9Component15enterModalStateEbPNS_21ModalComponentManager8CallbackEb(ptr noundef nonnull align 8 dereferenceable(197) %12, i1 noundef zeroext false, ptr noundef %22, i1 noundef zeroext false)
          to label %23 unwind label %35

23:                                               ; preds = %21
  %24 = invoke noundef ptr @_ZN4juce21ModalComponentManager11getInstanceEv()
          to label %25 unwind label %35

25:                                               ; preds = %23
  %26 = call noundef ptr @_ZN4juce13ScopedPointerINS_27PopupMenuCompletionCallbackEE7releaseEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #6
  call void @_ZN4juce21ModalComponentManager14attachCallbackEPNS_9ComponentEPNS0_8CallbackE(ptr noundef nonnull align 8 dereferenceable(48) %24, ptr noundef nonnull %12, ptr noundef %26)
  invoke void @_ZN4juce9Component7toFrontEb(ptr noundef nonnull align 8 dereferenceable(197) %12, i1 noundef zeroext false)
          to label %27 unwind label %35

27:                                               ; preds = %25
  %28 = icmp eq ptr %2, null
  %brmerge.not = and i1 %28, %3
  br i1 %brmerge.not, label %29, label %37

29:                                               ; preds = %27
  %30 = invoke noundef i32 @_ZN4juce9Component12runModalLoopEv(ptr noundef nonnull align 8 dereferenceable(197) %12)
          to label %37 unwind label %35

31:                                               ; preds = %4
  %32 = landingpad { ptr, i32 }
          cleanup
  br label %39

33:                                               ; preds = %8
  %34 = landingpad { ptr, i32 }
          cleanup
  call void @_ZdlPvm(ptr noundef nonnull %7, i64 noundef 40) #8
  br label %39

35:                                               ; preds = %29, %25, %23, %21, %14, %9
  %36 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN4juce13ScopedPointerINS_27PopupMenuCompletionCallbackEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6) #6
  br label %39

37:                                               ; preds = %13, %27, %29
  %38 = phi i32 [ %30, %29 ], [ 0, %27 ], [ 0, %13 ]
  call void @_ZN4juce13ScopedPointerINS_27PopupMenuCompletionCallbackEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  call void @_ZN4juce13ScopedPointerINS_21ModalComponentManager8CallbackEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  ret i32 %38

39:                                               ; preds = %35, %33, %31
  %.pn = phi { ptr, i32 } [ %36, %35 ], [ %34, %33 ], [ %32, %31 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  call void @_ZN4juce13ScopedPointerINS_21ModalComponentManager8CallbackEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  resume { ptr, i32 } %.pn
}

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

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

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

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

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

attributes #0 = { nobuiltin nounwind "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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nobuiltin allocsize(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 = { 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 = { 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 #6 = { nounwind }
attributes #7 = { builtin allocsize(0) }
attributes #8 = { builtin 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: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,SROAPass,SimplifyCFGPass