; LLVM IR from modlfo/AudioEngine :: AudioEngine/JuceLibraryCode/juce_gui_basics.ll (ZN4juce9Component10setEnabledEb)

; 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::Component" = 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, [3 x i8] }>
%"class.juce::MouseListener" = type { ptr }
%"class.juce::String" = type { %"class.juce::CharPointer_UTF8" }
%"class.juce::CharPointer_UTF8" = type { ptr }
%"class.juce::Rectangle" = type { %"class.juce::Point", i32, i32 }
%"class.juce::Point" = type { i32, i32 }
%"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 }

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4juce9Component10setEnabledEb(ptr noundef nonnull align 8 dereferenceable(197) %0, i1 noundef zeroext %1) #1 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca i8, align 1
  store ptr %0, ptr %3, align 8, !tbaa !5
  %5 = zext i1 %1 to i8
  store i8 %5, ptr %4, align 1, !tbaa !9
  %6 = load ptr, ptr %3, align 8
  %7 = getelementptr inbounds %"class.juce::Component", ptr %6, i32 0, i32 17
  %8 = load i16, ptr %7, align 8
  %9 = lshr i16 %8, 12
  %10 = and i16 %9, 1
  %11 = trunc i16 %10 to i1
  %12 = zext i1 %11 to i32
  %13 = load i8, ptr %4, align 1, !tbaa !9, !range !11, !noundef !12
  %14 = trunc i8 %13 to i1
  %15 = zext i1 %14 to i32
  %16 = icmp eq i32 %12, %15
  br i1 %16, label %17, label %36

17:                                               ; preds = %2
  %18 = load i8, ptr %4, align 1, !tbaa !9, !range !11, !noundef !12
  %19 = trunc i8 %18 to i1
  %20 = xor i1 %19, true
  %21 = getelementptr inbounds %"class.juce::Component", ptr %6, i32 0, i32 17
  %22 = zext i1 %20 to i16
  %23 = load i16, ptr %21, align 8
  %24 = shl i16 %22, 12
  %25 = and i16 %23, -4097
  %26 = or i16 %25, %24
  store i16 %26, ptr %21, align 8
  %27 = getelementptr inbounds %"class.juce::Component", ptr %6, i32 0, i32 3
  %28 = load ptr, ptr %27, align 8, !tbaa !13
  %29 = icmp eq ptr %28, null
  br i1 %29, label %34, label %30

30:                                               ; preds = %17
  %31 = getelementptr inbounds %"class.juce::Component", ptr %6, i32 0, i32 3
  %32 = load ptr, ptr %31, align 8, !tbaa !13
  %33 = call noundef zeroext i1 @_ZNK4juce9Component9isEnabledEv(ptr noundef nonnull align 8 dereferenceable(197) %32) #2
  br i1 %33, label %34, label %35

34:                                               ; preds = %30, %17
  call void @_ZN4juce9Component27sendEnablementChangeMessageEv(ptr noundef nonnull align 8 dereferenceable(197) %6)
  br label %35

35:                                               ; preds = %34, %30
  br label %36

36:                                               ; preds = %35, %2
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4juce9Component27sendEnablementChangeMessageEv(ptr noundef nonnull align 8 dereferenceable(197)) #1 align 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 = { 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, !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 = !{i8 0, i8 2}
!12 = !{}
!13 = !{!14, !6, i64 24}
!14 = !{!"_ZTSN4juce9ComponentE", !15, i64 0, !16, i64 8, !16, i64 16, !6, i64 24, !18, i64 32, !21, i64 48, !22, i64 56, !23, i64 64, !6, i64 88, !26, i64 96, !6, i64 104, !27, i64 112, !28, i64 120, !29, i64 128, !30, i64 136, !34, i64 160, !38, i64 184, !7, i64 192, !7, i64 196}
!15 = !{!"_ZTSN4juce13MouseListenerE"}
!16 = !{!"_ZTSN4juce6StringE", !17, i64 0}
!17 = !{!"_ZTSN4juce16CharPointer_UTF8E", !6, i64 0}
!18 = !{!"_ZTSN4juce9RectangleIiEE", !19, i64 0, !20, i64 8, !20, i64 12}
!19 = !{!"_ZTSN4juce5PointIiEE", !20, i64 0, !20, i64 4}
!20 = !{!"int", !7, i64 0}
!21 = !{!"_ZTSN4juce13ScopedPointerINS_9Component10PositionerEEE", !6, i64 0}
!22 = !{!"_ZTSN4juce13ScopedPointerINS_15AffineTransformEEE", !6, i64 0}
!23 = !{!"_ZTSN4juce5ArrayIPNS_9ComponentENS_20DummyCriticalSectionELi0EEE", !24, i64 0, !20, i64 16}
!24 = !{!"_ZTSN4juce19ArrayAllocationBaseIPNS_9ComponentENS_20DummyCriticalSectionEEE", !25, i64 0, !20, i64 8}
!25 = !{!"_ZTSN4juce9HeapBlockIPNS_9ComponentELb0EEE", !6, i64 0}
!26 = !{!"_ZTSN4juce11MouseCursorE", !6, i64 0}
!27 = !{!"_ZTSN4juce13ScopedPointerINS_20CachedComponentImageEEE", !6, i64 0}
!28 = !{!"_ZTSN4juce13ScopedPointerINS_9Component17MouseListenerListEEE", !6, i64 0}
!29 = !{!"_ZTSN4juce13ScopedPointerINS_5ArrayIPNS_11KeyListenerENS_20DummyCriticalSectionELi0EEEEE", !6, i64 0}
!30 = !{!"_ZTSN4juce12ListenerListINS_17ComponentListenerENS_5ArrayIPS1_NS_20DummyCriticalSectionELi0EEEEE", !31, i64 0}
!31 = !{!"_ZTSN4juce5ArrayIPNS_17ComponentListenerENS_20DummyCriticalSectionELi0EEE", !32, i64 0, !20, i64 16}
!32 = !{!"_ZTSN4juce19ArrayAllocationBaseIPNS_17ComponentListenerENS_20DummyCriticalSectionEEE", !33, i64 0, !20, i64 8}
!33 = !{!"_ZTSN4juce9HeapBlockIPNS_17ComponentListenerELb0EEE", !6, i64 0}
!34 = !{!"_ZTSN4juce13NamedValueSetE", !35, i64 0}
!35 = !{!"_ZTSN4juce5ArrayINS_13NamedValueSet10NamedValueENS_20DummyCriticalSectionELi0EEE", !36, i64 0, !20, i64 16}
!36 = !{!"_ZTSN4juce19ArrayAllocationBaseINS_13NamedValueSet10NamedValueENS_20DummyCriticalSectionEEE", !37, i64 0, !20, i64 8}
!37 = !{!"_ZTSN4juce9HeapBlockINS_13NamedValueSet10NamedValueELb0EEE", !6, i64 0}
!38 = !{!"_ZTSN4juce13WeakReferenceINS_9ComponentENS_22ReferenceCountedObjectEE6MasterE", !39, i64 0}
!39 = !{!"_ZTSN4juce25ReferenceCountedObjectPtrINS_13WeakReferenceINS_9ComponentENS_22ReferenceCountedObjectEE13SharedPointerEEE", !6, 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 @_ZNK4juce9Component9isEnabledEv(ptr noundef nonnull align 8 dereferenceable(197)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4juce9Component10setEnabledEb(ptr noundef nonnull align 8 dereferenceable(197) %0, i1 noundef zeroext %1) local_unnamed_addr #1 align 2 {
  %3 = getelementptr inbounds i8, ptr %0, i64 192
  %4 = load i16, ptr %3, align 8
  %5 = and i16 %4, 4096
  %6 = icmp eq i16 %5, 0
  %7 = xor i1 %6, %1
  br i1 %7, label %8, label %18

8:                                                ; preds = %2
  %9 = select i1 %1, i16 0, i16 4096
  %10 = and i16 %4, -4097
  %11 = or disjoint i16 %10, %9
  store i16 %11, ptr %3, align 8
  %12 = getelementptr inbounds i8, ptr %0, i64 24
  %13 = load ptr, ptr %12, align 8, !tbaa !5
  %14 = icmp eq ptr %13, null
  br i1 %14, label %17, label %15

15:                                               ; preds = %8
  %16 = tail call noundef zeroext i1 @_ZNK4juce9Component9isEnabledEv(ptr noundef nonnull align 8 dereferenceable(197) %13) #2
  br i1 %16, label %17, label %18

17:                                               ; preds = %15, %8
  tail call void @_ZN4juce9Component27sendEnablementChangeMessageEv(ptr noundef nonnull align 8 dereferenceable(197) %0)
  br label %18

18:                                               ; preds = %15, %17, %2
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4juce9Component27sendEnablementChangeMessageEv(ptr noundef nonnull align 8 dereferenceable(197)) local_unnamed_addr #1 align 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 = { 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, !10, i64 24}
!6 = !{!"_ZTSN4juce9ComponentE", !7, i64 0, !8, i64 8, !8, i64 16, !10, i64 24, !13, i64 32, !16, i64 48, !17, i64 56, !18, i64 64, !10, i64 88, !21, i64 96, !10, i64 104, !22, i64 112, !23, i64 120, !24, i64 128, !25, i64 136, !29, i64 160, !33, i64 184, !11, i64 192, !11, i64 196}
!7 = !{!"_ZTSN4juce13MouseListenerE"}
!8 = !{!"_ZTSN4juce6StringE", !9, i64 0}
!9 = !{!"_ZTSN4juce16CharPointer_UTF8E", !10, i64 0}
!10 = !{!"any pointer", !11, i64 0}
!11 = !{!"omnipotent char", !12, i64 0}
!12 = !{!"Simple C++ TBAA"}
!13 = !{!"_ZTSN4juce9RectangleIiEE", !14, i64 0, !15, i64 8, !15, i64 12}
!14 = !{!"_ZTSN4juce5PointIiEE", !15, i64 0, !15, i64 4}
!15 = !{!"int", !11, i64 0}
!16 = !{!"_ZTSN4juce13ScopedPointerINS_9Component10PositionerEEE", !10, i64 0}
!17 = !{!"_ZTSN4juce13ScopedPointerINS_15AffineTransformEEE", !10, i64 0}
!18 = !{!"_ZTSN4juce5ArrayIPNS_9ComponentENS_20DummyCriticalSectionELi0EEE", !19, i64 0, !15, i64 16}
!19 = !{!"_ZTSN4juce19ArrayAllocationBaseIPNS_9ComponentENS_20DummyCriticalSectionEEE", !20, i64 0, !15, i64 8}
!20 = !{!"_ZTSN4juce9HeapBlockIPNS_9ComponentELb0EEE", !10, i64 0}
!21 = !{!"_ZTSN4juce11MouseCursorE", !10, i64 0}
!22 = !{!"_ZTSN4juce13ScopedPointerINS_20CachedComponentImageEEE", !10, i64 0}
!23 = !{!"_ZTSN4juce13ScopedPointerINS_9Component17MouseListenerListEEE", !10, i64 0}
!24 = !{!"_ZTSN4juce13ScopedPointerINS_5ArrayIPNS_11KeyListenerENS_20DummyCriticalSectionELi0EEEEE", !10, i64 0}
!25 = !{!"_ZTSN4juce12ListenerListINS_17ComponentListenerENS_5ArrayIPS1_NS_20DummyCriticalSectionELi0EEEEE", !26, i64 0}
!26 = !{!"_ZTSN4juce5ArrayIPNS_17ComponentListenerENS_20DummyCriticalSectionELi0EEE", !27, i64 0, !15, i64 16}
!27 = !{!"_ZTSN4juce19ArrayAllocationBaseIPNS_17ComponentListenerENS_20DummyCriticalSectionEEE", !28, i64 0, !15, i64 8}
!28 = !{!"_ZTSN4juce9HeapBlockIPNS_17ComponentListenerELb0EEE", !10, i64 0}
!29 = !{!"_ZTSN4juce13NamedValueSetE", !30, i64 0}
!30 = !{!"_ZTSN4juce5ArrayINS_13NamedValueSet10NamedValueENS_20DummyCriticalSectionELi0EEE", !31, i64 0, !15, i64 16}
!31 = !{!"_ZTSN4juce19ArrayAllocationBaseINS_13NamedValueSet10NamedValueENS_20DummyCriticalSectionEEE", !32, i64 0, !15, i64 8}
!32 = !{!"_ZTSN4juce9HeapBlockINS_13NamedValueSet10NamedValueELb0EEE", !10, i64 0}
!33 = !{!"_ZTSN4juce13WeakReferenceINS_9ComponentENS_22ReferenceCountedObjectEE6MasterE", !34, i64 0}
!34 = !{!"_ZTSN4juce25ReferenceCountedObjectPtrINS_13WeakReferenceINS_9ComponentENS_22ReferenceCountedObjectEE13SharedPointerEEE", !10, i64 0}


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