; LLVM IR from jrouwe/JoltPhysics :: TestFramework/UI/UIStaticText.ll (ZNK12UIStaticText6CopyToEP9UIElement)

; 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.UIStaticText = type <{ %class.UIElement, %"class.JPH::RefConst", %"class.std::__cxx11::basic_string", %"class.JPH::Color", %"class.JPH::Color", i32, i32, i32, i32, i32, i8, [3 x i8] }>
%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::RefConst" = type { ptr }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char, std::char_traits<char>, JPH::STLAllocator<char>>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char, std::char_traits<char>, JPH::STLAllocator<char>>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.JPH::Color" = type { %union.anon.7 }
%union.anon.7 = type { 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 uwtable
define dso_local void @_ZNK12UIStaticText6CopyToEP9UIElement(ptr noundef nonnull align 8 dereferenceable(213) %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) #6
  %8 = load ptr, ptr %4, align 8, !tbaa !5
  %9 = call noundef ptr @_ZN3JPH10StaticCastI12UIStaticText9UIElementTnNSt9enable_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.UIStaticText, ptr %6, i32 0, i32 1
  %11 = load ptr, ptr %5, align 8, !tbaa !5
  %12 = getelementptr inbounds %class.UIStaticText, ptr %11, i32 0, i32 1
  %13 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN3JPH8RefConstI4FontEaSERKS2_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %10)
  %14 = getelementptr inbounds %class.UIStaticText, ptr %6, i32 0, i32 2
  %15 = load ptr, ptr %5, align 8, !tbaa !5
  %16 = getelementptr inbounds %class.UIStaticText, ptr %15, i32 0, i32 2
  %17 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcEN3JPH12STLAllocatorIcEEEaSERKS6_(ptr noundef nonnull align 8 dereferenceable(32) %16, ptr noundef nonnull align 8 dereferenceable(32) %14)
  %18 = getelementptr inbounds %class.UIStaticText, ptr %6, i32 0, i32 3
  %19 = load ptr, ptr %5, align 8, !tbaa !5
  %20 = getelementptr inbounds %class.UIStaticText, ptr %19, i32 0, i32 3
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %20, ptr align 8 %18, i64 4, i1 false), !tbaa.struct !9
  %21 = getelementptr inbounds %class.UIStaticText, ptr %6, i32 0, i32 4
  %22 = load ptr, ptr %5, align 8, !tbaa !5
  %23 = getelementptr inbounds %class.UIStaticText, ptr %22, i32 0, i32 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %23, ptr align 4 %21, i64 4, i1 false), !tbaa.struct !9
  %24 = getelementptr inbounds %class.UIStaticText, ptr %6, i32 0, i32 5
  %25 = load i32, ptr %24, align 8, !tbaa !11
  %26 = load ptr, ptr %5, align 8, !tbaa !5
  %27 = getelementptr inbounds %class.UIStaticText, ptr %26, i32 0, i32 5
  store i32 %25, ptr %27, align 8, !tbaa !11
  %28 = getelementptr inbounds %class.UIStaticText, ptr %6, i32 0, i32 6
  %29 = load i32, ptr %28, align 4, !tbaa !28
  %30 = load ptr, ptr %5, align 8, !tbaa !5
  %31 = getelementptr inbounds %class.UIStaticText, ptr %30, i32 0, i32 6
  store i32 %29, ptr %31, align 4, !tbaa !28
  %32 = getelementptr inbounds %class.UIStaticText, ptr %6, i32 0, i32 7
  %33 = load i32, ptr %32, align 8, !tbaa !29
  %34 = load ptr, ptr %5, align 8, !tbaa !5
  %35 = getelementptr inbounds %class.UIStaticText, ptr %34, i32 0, i32 7
  store i32 %33, ptr %35, align 8, !tbaa !29
  %36 = getelementptr inbounds %class.UIStaticText, ptr %6, i32 0, i32 8
  %37 = load i32, ptr %36, align 4, !tbaa !30
  %38 = load ptr, ptr %5, align 8, !tbaa !5
  %39 = getelementptr inbounds %class.UIStaticText, ptr %38, i32 0, i32 8
  store i32 %37, ptr %39, align 4, !tbaa !30
  %40 = getelementptr inbounds %class.UIStaticText, ptr %6, i32 0, i32 9
  %41 = load i32, ptr %40, align 8, !tbaa !31
  %42 = load ptr, ptr %5, align 8, !tbaa !5
  %43 = getelementptr inbounds %class.UIStaticText, ptr %42, i32 0, i32 9
  store i32 %41, ptr %43, align 8, !tbaa !31
  %44 = getelementptr inbounds %class.UIStaticText, ptr %6, i32 0, i32 10
  %45 = load i8, ptr %44, align 4, !tbaa !32, !range !33, !noundef !34
  %46 = trunc i8 %45 to i1
  %47 = load ptr, ptr %5, align 8, !tbaa !5
  %48 = getelementptr inbounds %class.UIStaticText, ptr %47, i32 0, i32 10
  %49 = zext i1 %46 to i8
  store i8 %49, ptr %48, align 4, !tbaa !32
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  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 @_ZN3JPH10StaticCastI12UIStaticText9UIElementTnNSt9enable_ifIXoosr3stdE12is_base_of_vIT_T0_Esr3stdE12is_base_of_vIS5_S4_EEbE4typeELb1EEEPS4_PS5_(ptr noundef) #3

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #5

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 = { inlinehint 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 #5 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { 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 = !{i64 0, i64 4, !10}
!10 = !{!7, !7, i64 0}
!11 = !{!12, !15, i64 192}
!12 = !{!"_ZTS12UIStaticText", !13, i64 0, !24, i64 144, !25, i64 152, !27, i64 184, !27, i64 188, !15, i64 192, !15, i64 196, !15, i64 200, !15, i64 204, !19, i64 208, !22, i64 212}
!13 = !{!"_ZTS9UIElement", !14, i64 0, !15, i64 8, !6, i64 16, !16, i64 24, !18, i64 48, !18, i64 60, !20, i64 72, !20, i64 80, !20, i64 88, !20, i64 96, !22, i64 104, !22, i64 105, !22, i64 106, !22, i64 107, !22, i64 108, !22, i64 109, !22, i64 110, !23, i64 112, !6, i64 136}
!14 = !{!"_ZTS15UIEventListener"}
!15 = !{!"int", !7, i64 0}
!16 = !{!"_ZTSN3JPH5ArrayIP9UIElementNS_12STLAllocatorIS2_EEEE", !17, i64 0, !17, i64 8, !6, i64 16}
!17 = !{!"long", !7, i64 0}
!18 = !{!"_ZTSN9UIElement8PositionE", !19, i64 0, !20, i64 4}
!19 = !{!"_ZTSN9UIElement10EAlignmentE", !7, i64 0}
!20 = !{!"_ZTSN9UIElement4SizeE", !15, i64 0, !21, i64 4}
!21 = !{!"_ZTSN9UIElement6EUnitsE", !7, i64 0}
!22 = !{!"bool", !7, i64 0}
!23 = !{!"_ZTSN3JPH5ArrayIP11UIAnimationNS_12STLAllocatorIS2_EEEE", !17, i64 0, !17, i64 8, !6, i64 16}
!24 = !{!"_ZTSN3JPH8RefConstI4FontEE", !6, i64 0}
!25 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcEN3JPH12STLAllocatorIcEEEE", !26, i64 0, !17, i64 8, !7, i64 16}
!26 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcEN3JPH12STLAllocatorIcEEE12_Alloc_hiderE", !6, i64 0}
!27 = !{!"_ZTSN3JPH5ColorE", !7, i64 0}
!28 = !{!12, !15, i64 196}
!29 = !{!12, !15, i64 200}
!30 = !{!12, !15, i64 204}
!31 = !{!12, !19, i64 208}
!32 = !{!12, !22, i64 212}
!33 = !{i8 0, i8 2}
!34 = !{}


; 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 @_ZNK12UIStaticText6CopyToEP9UIElement(ptr noundef nonnull align 8 dereferenceable(213) %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 @_ZN3JPH10StaticCastI12UIStaticText9UIElementTnNSt9enable_ifIXoosr3stdE12is_base_of_vIT_T0_Esr3stdE12is_base_of_vIS5_S4_EEbE4typeELb1EEEPS4_PS5_(ptr noundef %1)
  %4 = getelementptr inbounds i8, ptr %0, i64 144
  %5 = getelementptr inbounds i8, ptr %3, i64 144
  %6 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZN3JPH8RefConstI4FontEaSERKS2_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %7 = getelementptr inbounds i8, ptr %0, i64 152
  %8 = getelementptr inbounds i8, ptr %3, i64 152
  %9 = tail call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcEN3JPH12STLAllocatorIcEEEaSERKS6_(ptr noundef nonnull align 8 dereferenceable(32) %8, ptr noundef nonnull align 8 dereferenceable(32) %7)
  %10 = getelementptr inbounds i8, ptr %0, i64 184
  %11 = getelementptr inbounds i8, ptr %3, i64 184
  %12 = load i32, ptr %10, align 8, !tbaa !5
  store i32 %12, ptr %11, align 8, !tbaa !5
  %13 = getelementptr inbounds i8, ptr %0, i64 188
  %14 = getelementptr inbounds i8, ptr %3, i64 188
  %15 = load i32, ptr %13, align 4, !tbaa !5
  store i32 %15, ptr %14, align 4, !tbaa !5
  %16 = getelementptr inbounds i8, ptr %0, i64 192
  %17 = getelementptr inbounds i8, ptr %3, i64 192
  %18 = load <4 x i32>, ptr %16, align 8, !tbaa !8
  store <4 x i32> %18, ptr %17, align 8, !tbaa !8
  %19 = getelementptr inbounds i8, ptr %0, i64 208
  %20 = load i32, ptr %19, align 8, !tbaa !10
  %21 = getelementptr inbounds i8, ptr %3, i64 208
  store i32 %20, ptr %21, align 8, !tbaa !10
  %22 = getelementptr inbounds i8, ptr %0, i64 212
  %23 = load i8, ptr %22, align 4, !tbaa !27, !range !28, !noundef !29
  %24 = getelementptr inbounds i8, ptr %3, i64 212
  store i8 %23, ptr %24, align 4, !tbaa !27
  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 @_ZN3JPH10StaticCastI12UIStaticText9UIElementTnNSt9enable_ifIXoosr3stdE12is_base_of_vIT_T0_Esr3stdE12is_base_of_vIS5_S4_EEbE4typeELb1EEEPS4_PS5_(ptr noundef) local_unnamed_addr #2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcEN3JPH12STLAllocatorIcEEEaSERKS6_(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" }
attributes #3 = { inlinehint 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" }

!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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
!10 = !{!11, !18, i64 208}
!11 = !{!"_ZTS12UIStaticText", !12, i64 0, !23, i64 144, !24, i64 152, !26, i64 184, !26, i64 188, !9, i64 192, !9, i64 196, !9, i64 200, !9, i64 204, !18, i64 208, !21, i64 212}
!12 = !{!"_ZTS9UIElement", !13, i64 0, !9, i64 8, !14, i64 16, !15, i64 24, !17, i64 48, !17, i64 60, !19, i64 72, !19, i64 80, !19, i64 88, !19, i64 96, !21, i64 104, !21, i64 105, !21, i64 106, !21, i64 107, !21, i64 108, !21, i64 109, !21, i64 110, !22, i64 112, !14, i64 136}
!13 = !{!"_ZTS15UIEventListener"}
!14 = !{!"any pointer", !6, i64 0}
!15 = !{!"_ZTSN3JPH5ArrayIP9UIElementNS_12STLAllocatorIS2_EEEE", !16, i64 0, !16, i64 8, !14, i64 16}
!16 = !{!"long", !6, i64 0}
!17 = !{!"_ZTSN9UIElement8PositionE", !18, i64 0, !19, i64 4}
!18 = !{!"_ZTSN9UIElement10EAlignmentE", !6, i64 0}
!19 = !{!"_ZTSN9UIElement4SizeE", !9, i64 0, !20, i64 4}
!20 = !{!"_ZTSN9UIElement6EUnitsE", !6, i64 0}
!21 = !{!"bool", !6, i64 0}
!22 = !{!"_ZTSN3JPH5ArrayIP11UIAnimationNS_12STLAllocatorIS2_EEEE", !16, i64 0, !16, i64 8, !14, i64 16}
!23 = !{!"_ZTSN3JPH8RefConstI4FontEE", !14, i64 0}
!24 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcEN3JPH12STLAllocatorIcEEEE", !25, i64 0, !16, i64 8, !6, i64 16}
!25 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcEN3JPH12STLAllocatorIcEEE12_Alloc_hiderE", !14, i64 0}
!26 = !{!"_ZTSN3JPH5ColorE", !6, i64 0}
!27 = !{!11, !21, i64 212}
!28 = !{i8 0, i8 2}
!29 = !{}


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