; LLVM IR from jrouwe/JoltPhysics :: TestFramework/UI/UIComboBox.ll (ZNK10UIComboBox6CopyToEP9UIElement)

; 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.UIComboBox = type { %class.UIElement, %"class.JPH::Array.5", i32, ptr, ptr, ptr, %"class.std::function" }
%class.UIElement = type { %class.UIEventListener, i32, ptr, %"class.JPH::Array", %"class.UIElement::Position", %"class.UIElement::Position", %"class.UIElement::Size", %"class.UIElement::Size", %"class.UIElement::Size", %"class.UIElement::Size", i8, i8, i8, i8, i8, i8, i8, %"class.JPH::Array.2", ptr }
%class.UIEventListener = type { ptr }
%"class.JPH::Array" = type { i64, i64, ptr }
%"class.UIElement::Position" = type { i32, %"class.UIElement::Size" }
%"class.UIElement::Size" = type { i32, i32 }
%"class.JPH::Array.2" = type { i64, i64, ptr }
%"class.JPH::Array.5" = type { i64, i64, ptr }
%"class.std::function" = type { %"class.std::_Function_base", ptr }
%"class.std::_Function_base" = type { %"union.std::_Any_data", ptr }
%"union.std::_Any_data" = type { %"union.std::_Nocopy_types" }
%"union.std::_Nocopy_types" = type { { i64, i64 } }

; 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
define dso_local void @_ZNK10UIComboBox6CopyToEP9UIElement(ptr noundef nonnull align 8 dereferenceable(232) %0, ptr noundef %1) unnamed_addr #1 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  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 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZNK9UIElement6CopyToEPS_(ptr noundef nonnull align 8 dereferenceable(144) %6, ptr noundef %7)
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  %8 = load ptr, ptr %4, align 8, !tbaa !5
  %9 = call noundef ptr @_ZN3JPH10StaticCastI10UIComboBox9UIElementTnNSt9enable_ifIXoosr3stdE12is_base_of_vIT_T0_Esr3stdE12is_base_of_vIS5_S4_EEbE4typeELb1EEEPS4_PS5_(ptr noundef %8)
  store ptr %9, ptr %5, align 8, !tbaa !5
  %10 = getelementptr inbounds %class.UIComboBox, ptr %6, i32 0, i32 2
  %11 = load i32, ptr %10, align 8, !tbaa !9
  %12 = load ptr, ptr %5, align 8, !tbaa !5
  %13 = getelementptr inbounds %class.UIComboBox, ptr %12, i32 0, i32 2
  store i32 %11, ptr %13, align 8, !tbaa !9
  %14 = getelementptr inbounds %class.UIComboBox, ptr %6, i32 0, i32 1
  %15 = load ptr, ptr %5, align 8, !tbaa !5
  %16 = getelementptr inbounds %class.UIComboBox, ptr %15, i32 0, i32 1
  %17 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZN3JPH5ArrayINSt7__cxx1112basic_stringIcSt11char_traitsIcENS_12STLAllocatorIcEEEENS5_IS7_EEEaSERKS9_(ptr noundef nonnull align 8 dereferenceable(24) %16, ptr noundef nonnull align 8 dereferenceable(24) %14)
  %18 = getelementptr inbounds %class.UIComboBox, ptr %6, i32 0, i32 3
  %19 = load ptr, ptr %18, align 8, !tbaa !25
  %20 = load ptr, ptr %5, align 8, !tbaa !5
  %21 = getelementptr inbounds %class.UIComboBox, ptr %20, i32 0, i32 3
  store ptr %19, ptr %21, align 8, !tbaa !25
  %22 = getelementptr inbounds %class.UIComboBox, ptr %6, i32 0, i32 4
  %23 = load ptr, ptr %22, align 8, !tbaa !26
  %24 = load ptr, ptr %5, align 8, !tbaa !5
  %25 = getelementptr inbounds %class.UIComboBox, ptr %24, i32 0, i32 4
  store ptr %23, ptr %25, align 8, !tbaa !26
  %26 = getelementptr inbounds %class.UIComboBox, ptr %6, i32 0, i32 5
  %27 = load ptr, ptr %26, align 8, !tbaa !27
  %28 = load ptr, ptr %5, align 8, !tbaa !5
  %29 = getelementptr inbounds %class.UIComboBox, ptr %28, i32 0, i32 5
  store ptr %27, ptr %29, align 8, !tbaa !27
  %30 = getelementptr inbounds %class.UIComboBox, ptr %6, i32 0, i32 6
  %31 = load ptr, ptr %5, align 8, !tbaa !5
  %32 = getelementptr inbounds %class.UIComboBox, ptr %31, i32 0, i32 6
  %33 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt8functionIFviEEaSERKS1_(ptr noundef nonnull align 8 dereferenceable(32) %32, ptr noundef nonnull align 8 dereferenceable(32) %30)
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  ret void
}

declare void @_ZNK9UIElement6CopyToEPS_(ptr noundef nonnull align 8 dereferenceable(144), ptr noundef) unnamed_addr #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN3JPH10StaticCastI10UIComboBox9UIElementTnNSt9enable_ifIXoosr3stdE12is_base_of_vIT_T0_Esr3stdE12is_base_of_vIS5_S4_EEbE4typeELb1EEEPS4_PS5_(ptr noundef) #3

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt8functionIFviEEaSERKS1_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) #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 = { "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 = { 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 #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, !13, i64 168}
!10 = !{!"_ZTS10UIComboBox", !11, i64 0, !22, i64 144, !13, i64 168, !6, i64 176, !6, i64 184, !6, i64 192, !23, i64 200}
!11 = !{!"_ZTS9UIElement", !12, i64 0, !13, i64 8, !6, i64 16, !14, i64 24, !16, i64 48, !16, i64 60, !18, i64 72, !18, i64 80, !18, i64 88, !18, i64 96, !20, i64 104, !20, i64 105, !20, i64 106, !20, i64 107, !20, i64 108, !20, i64 109, !20, i64 110, !21, i64 112, !6, i64 136}
!12 = !{!"_ZTS15UIEventListener"}
!13 = !{!"int", !7, i64 0}
!14 = !{!"_ZTSN3JPH5ArrayIP9UIElementNS_12STLAllocatorIS2_EEEE", !15, i64 0, !15, i64 8, !6, i64 16}
!15 = !{!"long", !7, i64 0}
!16 = !{!"_ZTSN9UIElement8PositionE", !17, i64 0, !18, i64 4}
!17 = !{!"_ZTSN9UIElement10EAlignmentE", !7, i64 0}
!18 = !{!"_ZTSN9UIElement4SizeE", !13, i64 0, !19, i64 4}
!19 = !{!"_ZTSN9UIElement6EUnitsE", !7, i64 0}
!20 = !{!"bool", !7, i64 0}
!21 = !{!"_ZTSN3JPH5ArrayIP11UIAnimationNS_12STLAllocatorIS2_EEEE", !15, i64 0, !15, i64 8, !6, i64 16}
!22 = !{!"_ZTSN3JPH5ArrayINSt7__cxx1112basic_stringIcSt11char_traitsIcENS_12STLAllocatorIcEEEENS5_IS7_EEEE", !15, i64 0, !15, i64 8, !6, i64 16}
!23 = !{!"_ZTSSt8functionIFviEE", !24, i64 0, !6, i64 24}
!24 = !{!"_ZTSSt14_Function_base", !7, i64 0, !6, i64 16}
!25 = !{!10, !6, i64 176}
!26 = !{!10, !6, i64 184}
!27 = !{!10, !6, i64 192}


; 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 uwtable
define dso_local void @_ZNK10UIComboBox6CopyToEP9UIElement(ptr noundef nonnull align 8 dereferenceable(232) %0, ptr noundef %1) unnamed_addr #0 align 2 {
  tail call void @_ZNK9UIElement6CopyToEPS_(ptr noundef nonnull align 8 dereferenceable(144) %0, ptr noundef %1)
  %3 = tail call noundef ptr @_ZN3JPH10StaticCastI10UIComboBox9UIElementTnNSt9enable_ifIXoosr3stdE12is_base_of_vIT_T0_Esr3stdE12is_base_of_vIS5_S4_EEbE4typeELb1EEEPS4_PS5_(ptr noundef %1)
  %4 = getelementptr inbounds i8, ptr %0, i64 168
  %5 = load i32, ptr %4, align 8, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %3, i64 168
  store i32 %5, ptr %6, align 8, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %0, i64 144
  %8 = getelementptr inbounds i8, ptr %3, i64 144
  %9 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZN3JPH5ArrayINSt7__cxx1112basic_stringIcSt11char_traitsIcENS_12STLAllocatorIcEEEENS5_IS7_EEEaSERKS9_(ptr noundef nonnull align 8 dereferenceable(24) %8, ptr noundef nonnull align 8 dereferenceable(24) %7)
  %10 = getelementptr inbounds i8, ptr %0, i64 176
  %11 = getelementptr inbounds i8, ptr %3, i64 176
  %12 = load <2 x ptr>, ptr %10, align 8, !tbaa !24
  store <2 x ptr> %12, ptr %11, align 8, !tbaa !24
  %13 = getelementptr inbounds i8, ptr %0, i64 192
  %14 = load ptr, ptr %13, align 8, !tbaa !25
  %15 = getelementptr inbounds i8, ptr %3, i64 192
  store ptr %14, ptr %15, align 8, !tbaa !25
  %16 = getelementptr inbounds i8, ptr %0, i64 200
  %17 = getelementptr inbounds i8, ptr %3, i64 200
  %18 = tail call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt8functionIFviEEaSERKS1_(ptr noundef nonnull align 8 dereferenceable(32) %17, ptr noundef nonnull align 8 dereferenceable(32) %16)
  ret void
}

declare void @_ZNK9UIElement6CopyToEPS_(ptr noundef nonnull align 8 dereferenceable(144), ptr noundef) unnamed_addr #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN3JPH10StaticCastI10UIComboBox9UIElementTnNSt9enable_ifIXoosr3stdE12is_base_of_vIT_T0_Esr3stdE12is_base_of_vIS5_S4_EEbE4typeELb1EEEPS4_PS5_(ptr noundef) local_unnamed_addr #2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt8functionIFviEEaSERKS1_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) local_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 = { "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" }

!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, !9, i64 168}
!6 = !{!"_ZTS10UIComboBox", !7, i64 0, !21, i64 144, !9, i64 168, !12, i64 176, !12, i64 184, !12, i64 192, !22, i64 200}
!7 = !{!"_ZTS9UIElement", !8, i64 0, !9, i64 8, !12, i64 16, !13, i64 24, !15, i64 48, !15, i64 60, !17, i64 72, !17, i64 80, !17, i64 88, !17, i64 96, !19, i64 104, !19, i64 105, !19, i64 106, !19, i64 107, !19, i64 108, !19, i64 109, !19, i64 110, !20, i64 112, !12, i64 136}
!8 = !{!"_ZTS15UIEventListener"}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !11, i64 0}
!11 = !{!"Simple C++ TBAA"}
!12 = !{!"any pointer", !10, i64 0}
!13 = !{!"_ZTSN3JPH5ArrayIP9UIElementNS_12STLAllocatorIS2_EEEE", !14, i64 0, !14, i64 8, !12, i64 16}
!14 = !{!"long", !10, i64 0}
!15 = !{!"_ZTSN9UIElement8PositionE", !16, i64 0, !17, i64 4}
!16 = !{!"_ZTSN9UIElement10EAlignmentE", !10, i64 0}
!17 = !{!"_ZTSN9UIElement4SizeE", !9, i64 0, !18, i64 4}
!18 = !{!"_ZTSN9UIElement6EUnitsE", !10, i64 0}
!19 = !{!"bool", !10, i64 0}
!20 = !{!"_ZTSN3JPH5ArrayIP11UIAnimationNS_12STLAllocatorIS2_EEEE", !14, i64 0, !14, i64 8, !12, i64 16}
!21 = !{!"_ZTSN3JPH5ArrayINSt7__cxx1112basic_stringIcSt11char_traitsIcENS_12STLAllocatorIcEEEENS5_IS7_EEEE", !14, i64 0, !14, i64 8, !12, i64 16}
!22 = !{!"_ZTSSt8functionIFviEE", !23, i64 0, !12, i64 24}
!23 = !{!"_ZTSSt14_Function_base", !10, i64 0, !12, i64 16}
!24 = !{!12, !12, i64 0}
!25 = !{!6, !12, i64 192}


; Effective O3 passes: GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,SLPVectorizerPass,SROAPass,TailCallElimPass