; 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::ComponentMovementWatcher" = type <{ %"class.juce::ComponentListener", %"class.juce::WeakReference", i32, [4 x i8], %"class.juce::Array", i8, i8, [2 x i8], %"class.juce::Rectangle", [4 x i8] }>
%"class.juce::ComponentListener" = type { ptr }
%"class.juce::WeakReference" = type { %"class.juce::ReferenceCountedObjectPtr" }
%"class.juce::ReferenceCountedObjectPtr" = 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::Rectangle" = type { %"class.juce::Point", i32, i32 }
%"class.juce::Point" = type { i32, i32 }

; 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 zeroext i1 @_ZNK4juce13WeakReferenceINS_9ComponentENS_22ReferenceCountedObjectEEneEPS1_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #1 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4juce24ComponentMovementWatcher26componentVisibilityChangedERNS_9ComponentE(ptr noundef nonnull align 8 dereferenceable(68) %0, ptr noundef nonnull align 8 dereferenceable(197) %1) unnamed_addr #2 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i8, align 1
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %6 = load ptr, ptr %3, align 8
  %7 = getelementptr inbounds %"class.juce::ComponentMovementWatcher", ptr %6, i32 0, i32 1
  %8 = call noundef zeroext i1 @_ZNK4juce13WeakReferenceINS_9ComponentENS_22ReferenceCountedObjectEEneEPS1_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef null) #3
  br i1 %8, label %9, label %31

9:                                                ; preds = %2
  call void @llvm.lifetime.start.p0(i64 1, ptr %5) #3
  %10 = getelementptr inbounds %"class.juce::ComponentMovementWatcher", ptr %6, i32 0, i32 1
  %11 = call noundef ptr @_ZN4juce13WeakReferenceINS_9ComponentENS_22ReferenceCountedObjectEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #3
  %12 = call noundef zeroext i1 @_ZNK4juce9Component9isShowingEv(ptr noundef nonnull align 8 dereferenceable(197) %11)
  %13 = zext i1 %12 to i8
  store i8 %13, ptr %5, align 1, !tbaa !9
  %14 = getelementptr inbounds %"class.juce::ComponentMovementWatcher", ptr %6, i32 0, i32 6
  %15 = load i8, ptr %14, align 1, !tbaa !11, !range !22, !noundef !23
  %16 = trunc i8 %15 to i1
  %17 = zext i1 %16 to i32
  %18 = load i8, ptr %5, align 1, !tbaa !9, !range !22, !noundef !23
  %19 = trunc i8 %18 to i1
  %20 = zext i1 %19 to i32
  %21 = icmp ne i32 %17, %20
  br i1 %21, label %22, label %30

22:                                               ; preds = %9
  %23 = load i8, ptr %5, align 1, !tbaa !9, !range !22, !noundef !23
  %24 = trunc i8 %23 to i1
  %25 = getelementptr inbounds %"class.juce::ComponentMovementWatcher", ptr %6, i32 0, i32 6
  %26 = zext i1 %24 to i8
  store i8 %26, ptr %25, align 1, !tbaa !11
  %27 = load ptr, ptr %6, align 8, !tbaa !24
  %28 = getelementptr inbounds ptr, ptr %27, i64 11
  %29 = load ptr, ptr %28, align 8
  call void %29(ptr noundef nonnull align 8 dereferenceable(68) %6)
  br label %30

30:                                               ; preds = %22, %9
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #3
  br label %31

31:                                               ; preds = %30, %2
  ret void
}

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 = { 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 = !{!"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, !10, i64 49}
!12 = !{!"_ZTSN4juce24ComponentMovementWatcherE", !13, i64 0, !14, i64 8, !16, i64 16, !17, i64 24, !10, i64 48, !10, i64 49, !20, i64 52}
!13 = !{!"_ZTSN4juce17ComponentListenerE"}
!14 = !{!"_ZTSN4juce13WeakReferenceINS_9ComponentENS_22ReferenceCountedObjectEEE", !15, i64 0}
!15 = !{!"_ZTSN4juce25ReferenceCountedObjectPtrINS_13WeakReferenceINS_9ComponentENS_22ReferenceCountedObjectEE13SharedPointerEEE", !6, i64 0}
!16 = !{!"int", !7, i64 0}
!17 = !{!"_ZTSN4juce5ArrayIPNS_9ComponentENS_20DummyCriticalSectionELi0EEE", !18, i64 0, !16, i64 16}
!18 = !{!"_ZTSN4juce19ArrayAllocationBaseIPNS_9ComponentENS_20DummyCriticalSectionEEE", !19, i64 0, !16, i64 8}
!19 = !{!"_ZTSN4juce9HeapBlockIPNS_9ComponentELb0EEE", !6, i64 0}
!20 = !{!"_ZTSN4juce9RectangleIiEE", !21, i64 0, !16, i64 8, !16, i64 12}
!21 = !{!"_ZTSN4juce5PointIiEE", !16, i64 0, !16, i64 4}
!22 = !{i8 0, i8 2}
!23 = !{}
!24 = !{!25, !25, i64 0}
!25 = !{!"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 zeroext i1 @_ZNK4juce13WeakReferenceINS_9ComponentENS_22ReferenceCountedObjectEEneEPS1_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK4juce9Component9isShowingEv(ptr noundef nonnull align 8 dereferenceable(197)) local_unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4juce24ComponentMovementWatcher26componentVisibilityChangedERNS_9ComponentE(ptr noundef nonnull align 8 dereferenceable(68) %0, ptr nocapture noundef nonnull readnone align 8 dereferenceable(197) %1) unnamed_addr #1 align 2 {
  %3 = getelementptr inbounds i8, ptr %0, i64 8
  %4 = tail call noundef zeroext i1 @_ZNK4juce13WeakReferenceINS_9ComponentENS_22ReferenceCountedObjectEEneEPS1_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef null) #2
  br i1 %4, label %5, label %15

5:                                                ; preds = %2
  %6 = tail call noundef ptr @_ZN4juce13WeakReferenceINS_9ComponentENS_22ReferenceCountedObjectEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #2
  %7 = tail call noundef zeroext i1 @_ZNK4juce9Component9isShowingEv(ptr noundef nonnull align 8 dereferenceable(197) %6)
  %8 = getelementptr inbounds i8, ptr %0, i64 49
  %9 = load i8, ptr %8, align 1, !tbaa !5, !range !20, !noundef !21
  %10 = zext i1 %7 to i8
  %.not = icmp eq i8 %9, %10
  br i1 %.not, label %15, label %11

11:                                               ; preds = %5
  store i8 %10, ptr %8, align 1, !tbaa !5
  %12 = load ptr, ptr %0, align 8, !tbaa !22
  %13 = getelementptr inbounds i8, ptr %12, i64 88
  %14 = load ptr, ptr %13, align 8
  tail call void %14(ptr noundef nonnull align 8 dereferenceable(68) %0)
  br label %15

15:                                               ; preds = %5, %11, %2
  ret void
}

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 = { 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 = { 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, !17, i64 49}
!6 = !{!"_ZTSN4juce24ComponentMovementWatcherE", !7, i64 0, !8, i64 8, !13, i64 16, !14, i64 24, !17, i64 48, !17, i64 49, !18, i64 52}
!7 = !{!"_ZTSN4juce17ComponentListenerE"}
!8 = !{!"_ZTSN4juce13WeakReferenceINS_9ComponentENS_22ReferenceCountedObjectEEE", !9, i64 0}
!9 = !{!"_ZTSN4juce25ReferenceCountedObjectPtrINS_13WeakReferenceINS_9ComponentENS_22ReferenceCountedObjectEE13SharedPointerEEE", !10, i64 0}
!10 = !{!"any pointer", !11, i64 0}
!11 = !{!"omnipotent char", !12, i64 0}
!12 = !{!"Simple C++ TBAA"}
!13 = !{!"int", !11, i64 0}
!14 = !{!"_ZTSN4juce5ArrayIPNS_9ComponentENS_20DummyCriticalSectionELi0EEE", !15, i64 0, !13, i64 16}
!15 = !{!"_ZTSN4juce19ArrayAllocationBaseIPNS_9ComponentENS_20DummyCriticalSectionEEE", !16, i64 0, !13, i64 8}
!16 = !{!"_ZTSN4juce9HeapBlockIPNS_9ComponentELb0EEE", !10, i64 0}
!17 = !{!"bool", !11, i64 0}
!18 = !{!"_ZTSN4juce9RectangleIiEE", !19, i64 0, !13, i64 8, !13, i64 12}
!19 = !{!"_ZTSN4juce5PointIiEE", !13, i64 0, !13, i64 4}
!20 = !{i8 0, i8 2}
!21 = !{}
!22 = !{!23, !23, i64 0}
!23 = !{!"vtable pointer", !12, i64 0}


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