; 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::DocumentWindow" = type { %"class.juce::ResizableWindow", i32, i32, i32, i8, i8, [3 x %"class.juce::ScopedPointer.282"], %"class.juce::Image", %"class.juce::ScopedPointer.159", ptr, %"class.juce::ScopedPointer.360" }
%"class.juce::ResizableWindow" = type { %"class.juce::TopLevelWindow", %"class.juce::ScopedPointer.294", %"class.juce::ScopedPointer.295", %"class.juce::Component::SafePointer", i8, i8, i8, i8, i8, %"class.juce::ComponentDragger", %"class.juce::Rectangle", %"class.juce::ComponentBoundsConstrainer", ptr }
%"class.juce::TopLevelWindow" = type { %"class.juce::Component.base", i8, i8, i8, %"class.juce::ScopedPointer.293" }
%"class.juce::Component.base" = type <{ %"class.juce::MouseListener", %"class.juce::String", %"class.juce::String", ptr, %"class.juce::Rectangle", %"class.juce::ScopedPointer", %"class.juce::ScopedPointer.0", %"class.juce::Array", ptr, %"class.juce::MouseCursor", ptr, %"class.juce::ScopedPointer.1", %"class.juce::ScopedPointer.2", %"class.juce::ScopedPointer.3", %"class.juce::ListenerList", %"class.juce::NamedValueSet", %"class.juce::WeakReference<juce::Component>::Master", %union.anon, i8 }>
%"class.juce::MouseListener" = type { ptr }
%"class.juce::String" = type { %"class.juce::CharPointer_UTF8" }
%"class.juce::CharPointer_UTF8" = type { ptr }
%"class.juce::ScopedPointer" = type { ptr }
%"class.juce::ScopedPointer.0" = type { ptr }
%"class.juce::Array" = type { %"class.juce::ArrayAllocationBase", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase" = type <{ %"class.juce::HeapBlock", i32, [4 x i8] }>
%"class.juce::HeapBlock" = type { ptr }
%"class.juce::MouseCursor" = type { ptr }
%"class.juce::ScopedPointer.1" = type { ptr }
%"class.juce::ScopedPointer.2" = type { ptr }
%"class.juce::ScopedPointer.3" = type { ptr }
%"class.juce::ListenerList" = type { %"class.juce::Array.4" }
%"class.juce::Array.4" = type { %"class.juce::ArrayAllocationBase.5", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.5" = type <{ %"class.juce::HeapBlock.6", i32, [4 x i8] }>
%"class.juce::HeapBlock.6" = type { ptr }
%"class.juce::NamedValueSet" = type { %"class.juce::Array.9" }
%"class.juce::Array.9" = type { %"class.juce::ArrayAllocationBase.10", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.10" = type <{ %"class.juce::HeapBlock.11", i32, [4 x i8] }>
%"class.juce::HeapBlock.11" = type { ptr }
%"class.juce::WeakReference<juce::Component>::Master" = type { %"class.juce::ReferenceCountedObjectPtr" }
%"class.juce::ReferenceCountedObjectPtr" = type { ptr }
%union.anon = type { i32 }
%"class.juce::ScopedPointer.293" = type { ptr }
%"class.juce::ScopedPointer.294" = type { ptr }
%"class.juce::ScopedPointer.295" = type { ptr }
%"class.juce::Component::SafePointer" = type { %"class.juce::WeakReference" }
%"class.juce::WeakReference" = type { %"class.juce::ReferenceCountedObjectPtr" }
%"class.juce::ComponentDragger" = type { ptr, %"class.juce::Point" }
%"class.juce::Point" = type { i32, i32 }
%"class.juce::Rectangle" = type { %"class.juce::Point", i32, i32 }
%"class.juce::ComponentBoundsConstrainer" = type { ptr, i32, i32, i32, i32, i32, i32, i32, i32, double }
%"class.juce::ScopedPointer.282" = type { ptr }
%"class.juce::Image" = type { %"class.juce::ReferenceCountedObjectPtr.48" }
%"class.juce::ReferenceCountedObjectPtr.48" = type { ptr }
%"class.juce::ScopedPointer.159" = type { ptr }
%"class.juce::ScopedPointer.360" = 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 uwtable
declare dso_local void @_ZN4juce9Component10setEnabledEb(ptr noundef nonnull align 8 dereferenceable(197), i1 noundef zeroext) #1 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4juce14DocumentWindow25activeWindowStatusChangedEv(ptr noundef nonnull align 8 dereferenceable(400) %0) unnamed_addr #1 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %5 = load ptr, ptr %2, align 8
  call void @_ZN4juce15ResizableWindow25activeWindowStatusChangedEv(ptr noundef nonnull align 8 dereferenceable(328) %5)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  %6 = getelementptr inbounds %"class.juce::DocumentWindow", ptr %5, i32 0, i32 6
  %7 = call noundef i32 @_ZN4juce18numElementsInArrayINS_13ScopedPointerINS_6ButtonEEELi3EEEiRAT0__T_(ptr noundef nonnull align 8 dereferenceable(24) %6)
  store i32 %7, ptr %3, align 4, !tbaa !9
  br label %8

8:                                                ; preds = %24, %1
  %9 = load i32, ptr %3, align 4, !tbaa !9
  %10 = add nsw i32 %9, -1
  store i32 %10, ptr %3, align 4, !tbaa !9
  %11 = icmp sge i32 %10, 0
  br i1 %11, label %13, label %12

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

13:                                               ; preds = %8
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #4
  %14 = getelementptr inbounds %"class.juce::DocumentWindow", ptr %5, i32 0, i32 6
  %15 = load i32, ptr %3, align 4, !tbaa !9
  %16 = sext i32 %15 to i64
  %17 = getelementptr inbounds [3 x %"class.juce::ScopedPointer.282"], ptr %14, i64 0, i64 %16
  %18 = call noundef ptr @_ZNK4juce13ScopedPointerINS_6ButtonEEcvPS1_Ev(ptr noundef nonnull align 8 dereferenceable(8) %17) #4
  store ptr %18, ptr %4, align 8, !tbaa !5
  %19 = load ptr, ptr %4, align 8, !tbaa !5
  %20 = icmp ne ptr %19, null
  br i1 %20, label %21, label %24

21:                                               ; preds = %13
  %22 = load ptr, ptr %4, align 8, !tbaa !5
  %23 = call noundef zeroext i1 @_ZNK4juce14TopLevelWindow14isActiveWindowEv(ptr noundef nonnull align 8 dereferenceable(208) %5) #4
  call void @_ZN4juce9Component10setEnabledEb(ptr noundef nonnull align 8 dereferenceable(197) %22, i1 noundef zeroext %23)
  br label %24

24:                                               ; preds = %21, %13
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #4
  br label %8, !llvm.loop !11

25:                                               ; preds = %12
  %26 = getelementptr inbounds %"class.juce::DocumentWindow", ptr %5, i32 0, i32 8
  %27 = call noundef ptr @_ZNK4juce13ScopedPointerINS_9ComponentEEcvPS1_Ev(ptr noundef nonnull align 8 dereferenceable(8) %26) #4
  %28 = icmp ne ptr %27, null
  br i1 %28, label %29, label %33

29:                                               ; preds = %25
  %30 = getelementptr inbounds %"class.juce::DocumentWindow", ptr %5, i32 0, i32 8
  %31 = call noundef ptr @_ZNK4juce13ScopedPointerINS_9ComponentEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %30) #4
  %32 = call noundef zeroext i1 @_ZNK4juce14TopLevelWindow14isActiveWindowEv(ptr noundef nonnull align 8 dereferenceable(208) %5) #4
  call void @_ZN4juce9Component10setEnabledEb(ptr noundef nonnull align 8 dereferenceable(197) %31, i1 noundef zeroext %32)
  br label %33

33:                                               ; preds = %29, %25
  ret void
}

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4juce15ResizableWindow25activeWindowStatusChangedEv(ptr noundef nonnull align 8 dereferenceable(328)) unnamed_addr #1 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 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 = { 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::ScopedPointer.282" = type { ptr }

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4juce9Component10setEnabledEb(ptr noundef nonnull align 8 dereferenceable(197), i1 noundef zeroext) local_unnamed_addr #0 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 #1 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4juce14DocumentWindow25activeWindowStatusChangedEv(ptr noundef nonnull align 8 dereferenceable(400) %0) unnamed_addr #0 align 2 {
  tail call void @_ZN4juce15ResizableWindow25activeWindowStatusChangedEv(ptr noundef nonnull align 8 dereferenceable(328) %0)
  %2 = getelementptr inbounds i8, ptr %0, i64 344
  %3 = tail call noundef i32 @_ZN4juce18numElementsInArrayINS_13ScopedPointerINS_6ButtonEEELi3EEEiRAT0__T_(ptr noundef nonnull align 8 dereferenceable(24) %2)
  %4 = icmp sgt i32 %3, 0
  br i1 %4, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %1
  %5 = zext nneg i32 %3 to i64
  br label %.lr.ph

._crit_edge:                                      ; preds = %12, %1
  %6 = getelementptr inbounds i8, ptr %0, i64 376
  %7 = tail call noundef ptr @_ZNK4juce13ScopedPointerINS_9ComponentEEcvPS1_Ev(ptr noundef nonnull align 8 dereferenceable(8) %6) #3
  %.not = icmp eq ptr %7, null
  br i1 %.not, label %17, label %14

.lr.ph:                                           ; preds = %.lr.ph.preheader, %12
  %indvars.iv = phi i64 [ %5, %.lr.ph.preheader ], [ %indvars.iv.next, %12 ]
  %indvars.iv.next = add nsw i64 %indvars.iv, -1
  %8 = getelementptr inbounds [3 x %"class.juce::ScopedPointer.282"], ptr %2, i64 0, i64 %indvars.iv.next
  %9 = tail call noundef ptr @_ZNK4juce13ScopedPointerINS_6ButtonEEcvPS1_Ev(ptr noundef nonnull align 8 dereferenceable(8) %8) #3
  %.not6 = icmp eq ptr %9, null
  br i1 %.not6, label %12, label %10

10:                                               ; preds = %.lr.ph
  %11 = tail call noundef zeroext i1 @_ZNK4juce14TopLevelWindow14isActiveWindowEv(ptr noundef nonnull align 8 dereferenceable(208) %0) #3
  tail call void @_ZN4juce9Component10setEnabledEb(ptr noundef nonnull align 8 dereferenceable(197) %9, i1 noundef zeroext %11)
  br label %12

12:                                               ; preds = %10, %.lr.ph
  %13 = icmp ugt i64 %indvars.iv, 1
  br i1 %13, label %.lr.ph, label %._crit_edge, !llvm.loop !5

14:                                               ; preds = %._crit_edge
  %15 = tail call noundef ptr @_ZNK4juce13ScopedPointerINS_9ComponentEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #3
  %16 = tail call noundef zeroext i1 @_ZNK4juce14TopLevelWindow14isActiveWindowEv(ptr noundef nonnull align 8 dereferenceable(208) %0) #3
  tail call void @_ZN4juce9Component10setEnabledEb(ptr noundef nonnull align 8 dereferenceable(197) %15, i1 noundef zeroext %16)
  br label %17

17:                                               ; preds = %14, %._crit_edge
  ret void
}

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4juce15ResizableWindow25activeWindowStatusChangedEv(ptr noundef nonnull align 8 dereferenceable(328)) unnamed_addr #0 align 2

attributes #0 = { 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 #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 = { 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: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass