; LLVM IR from jrouwe/JoltPhysics :: TestFramework/UI/UISlider.ll (ZNK8UISlider6CopyToEP9UIElement)

; 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.UISlider = type <{ %class.UIElement, float, float, float, float, ptr, ptr, ptr, i32, [4 x i8], %class.UITexturedQuad, %class.UITexturedQuad, %"class.std::function", i32, [4 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.UITexturedQuad = type { %"class.JPH::RefConst", i32, i32, i32, i32, i32, i32, i32, i32 }
%"class.JPH::RefConst" = type { 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 @_ZNK8UISlider6CopyToEP9UIElement(ptr noundef nonnull align 8 dereferenceable(308) %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) #5
  %8 = load ptr, ptr %4, align 8, !tbaa !5
  %9 = call noundef ptr @_ZN3JPH10StaticCastI8UISlider9UIElementTnNSt9enable_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.UISlider, ptr %6, i32 0, i32 1
  %11 = load float, ptr %10, align 8, !tbaa !9
  %12 = load ptr, ptr %5, align 8, !tbaa !5
  %13 = getelementptr inbounds %class.UISlider, ptr %12, i32 0, i32 1
  store float %11, ptr %13, align 8, !tbaa !9
  %14 = getelementptr inbounds %class.UISlider, ptr %6, i32 0, i32 2
  %15 = load float, ptr %14, align 4, !tbaa !27
  %16 = load ptr, ptr %5, align 8, !tbaa !5
  %17 = getelementptr inbounds %class.UISlider, ptr %16, i32 0, i32 2
  store float %15, ptr %17, align 4, !tbaa !27
  %18 = getelementptr inbounds %class.UISlider, ptr %6, i32 0, i32 3
  %19 = load float, ptr %18, align 8, !tbaa !28
  %20 = load ptr, ptr %5, align 8, !tbaa !5
  %21 = getelementptr inbounds %class.UISlider, ptr %20, i32 0, i32 3
  store float %19, ptr %21, align 8, !tbaa !28
  %22 = getelementptr inbounds %class.UISlider, ptr %6, i32 0, i32 4
  %23 = load float, ptr %22, align 4, !tbaa !29
  %24 = load ptr, ptr %5, align 8, !tbaa !5
  %25 = getelementptr inbounds %class.UISlider, ptr %24, i32 0, i32 4
  store float %23, ptr %25, align 4, !tbaa !29
  %26 = getelementptr inbounds %class.UISlider, ptr %6, i32 0, i32 5
  %27 = load ptr, ptr %26, align 8, !tbaa !30
  %28 = load ptr, ptr %5, align 8, !tbaa !5
  %29 = getelementptr inbounds %class.UISlider, ptr %28, i32 0, i32 5
  store ptr %27, ptr %29, align 8, !tbaa !30
  %30 = getelementptr inbounds %class.UISlider, ptr %6, i32 0, i32 6
  %31 = load ptr, ptr %30, align 8, !tbaa !31
  %32 = load ptr, ptr %5, align 8, !tbaa !5
  %33 = getelementptr inbounds %class.UISlider, ptr %32, i32 0, i32 6
  store ptr %31, ptr %33, align 8, !tbaa !31
  %34 = getelementptr inbounds %class.UISlider, ptr %6, i32 0, i32 8
  %35 = load i32, ptr %34, align 8, !tbaa !32
  %36 = load ptr, ptr %5, align 8, !tbaa !5
  %37 = getelementptr inbounds %class.UISlider, ptr %36, i32 0, i32 8
  store i32 %35, ptr %37, align 8, !tbaa !32
  %38 = getelementptr inbounds %class.UISlider, ptr %6, i32 0, i32 10
  %39 = load ptr, ptr %5, align 8, !tbaa !5
  %40 = getelementptr inbounds %class.UISlider, ptr %39, i32 0, i32 10
  %41 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZN14UITexturedQuadaSERKS_(ptr noundef nonnull align 8 dereferenceable(40) %40, ptr noundef nonnull align 8 dereferenceable(40) %38)
  %42 = getelementptr inbounds %class.UISlider, ptr %6, i32 0, i32 11
  %43 = load ptr, ptr %5, align 8, !tbaa !5
  %44 = getelementptr inbounds %class.UISlider, ptr %43, i32 0, i32 11
  %45 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZN14UITexturedQuadaSERKS_(ptr noundef nonnull align 8 dereferenceable(40) %44, ptr noundef nonnull align 8 dereferenceable(40) %42)
  %46 = getelementptr inbounds %class.UISlider, ptr %6, i32 0, i32 12
  %47 = load ptr, ptr %5, align 8, !tbaa !5
  %48 = getelementptr inbounds %class.UISlider, ptr %47, i32 0, i32 12
  %49 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt8functionIFvfEEaSERKS1_(ptr noundef nonnull align 8 dereferenceable(32) %48, ptr noundef nonnull align 8 dereferenceable(32) %46)
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  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 @_ZN3JPH10StaticCastI8UISlider9UIElementTnNSt9enable_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(40) ptr @_ZN14UITexturedQuadaSERKS_(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef nonnull align 8 dereferenceable(40)) #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt8functionIFvfEEaSERKS1_(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 = { 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 = { 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, !22, i64 144}
!10 = !{!"_ZTS8UISlider", !11, i64 0, !22, i64 144, !22, i64 148, !22, i64 152, !22, i64 156, !6, i64 160, !6, i64 168, !6, i64 176, !13, i64 184, !23, i64 192, !23, i64 232, !25, i64 272, !13, i64 304}
!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 = !{!"float", !7, i64 0}
!23 = !{!"_ZTS14UITexturedQuad", !24, i64 0, !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20, !13, i64 24, !13, i64 28, !13, i64 32, !13, i64 36}
!24 = !{!"_ZTSN3JPH8RefConstI7TextureEE", !6, i64 0}
!25 = !{!"_ZTSSt8functionIFvfEE", !26, i64 0, !6, i64 24}
!26 = !{!"_ZTSSt14_Function_base", !7, i64 0, !6, i64 16}
!27 = !{!10, !22, i64 148}
!28 = !{!10, !22, i64 152}
!29 = !{!10, !22, i64 156}
!30 = !{!10, !6, i64 160}
!31 = !{!10, !6, i64 168}
!32 = !{!10, !13, i64 184}


; 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 @_ZNK8UISlider6CopyToEP9UIElement(ptr noundef nonnull align 8 dereferenceable(308) %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 @_ZN3JPH10StaticCastI8UISlider9UIElementTnNSt9enable_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 = load <4 x float>, ptr %4, align 8, !tbaa !5
  store <4 x float> %6, ptr %5, align 8, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %0, i64 160
  %8 = getelementptr inbounds i8, ptr %3, i64 160
  %9 = load <2 x ptr>, ptr %7, align 8, !tbaa !9
  store <2 x ptr> %9, ptr %8, align 8, !tbaa !9
  %10 = getelementptr inbounds i8, ptr %0, i64 184
  %11 = load i32, ptr %10, align 8, !tbaa !11
  %12 = getelementptr inbounds i8, ptr %3, i64 184
  store i32 %11, ptr %12, align 8, !tbaa !11
  %13 = getelementptr inbounds i8, ptr %0, i64 192
  %14 = getelementptr inbounds i8, ptr %3, i64 192
  %15 = tail call noundef nonnull align 8 dereferenceable(40) ptr @_ZN14UITexturedQuadaSERKS_(ptr noundef nonnull align 8 dereferenceable(40) %14, ptr noundef nonnull align 8 dereferenceable(40) %13)
  %16 = getelementptr inbounds i8, ptr %0, i64 232
  %17 = getelementptr inbounds i8, ptr %3, i64 232
  %18 = tail call noundef nonnull align 8 dereferenceable(40) ptr @_ZN14UITexturedQuadaSERKS_(ptr noundef nonnull align 8 dereferenceable(40) %17, ptr noundef nonnull align 8 dereferenceable(40) %16)
  %19 = getelementptr inbounds i8, ptr %0, i64 272
  %20 = getelementptr inbounds i8, ptr %3, i64 272
  %21 = tail call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt8functionIFvfEEaSERKS1_(ptr noundef nonnull align 8 dereferenceable(32) %20, ptr noundef nonnull align 8 dereferenceable(32) %19)
  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 @_ZN3JPH10StaticCastI8UISlider9UIElementTnNSt9enable_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(40) ptr @_ZN14UITexturedQuadaSERKS_(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt8functionIFvfEEaSERKS1_(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 = !{!"float", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !15, i64 184}
!12 = !{!"_ZTS8UISlider", !13, i64 0, !6, i64 144, !6, i64 148, !6, i64 152, !6, i64 156, !10, i64 160, !10, i64 168, !10, i64 176, !15, i64 184, !24, i64 192, !24, i64 232, !26, i64 272, !15, i64 304}
!13 = !{!"_ZTS9UIElement", !14, i64 0, !15, i64 8, !10, 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, !10, i64 136}
!14 = !{!"_ZTS15UIEventListener"}
!15 = !{!"int", !7, i64 0}
!16 = !{!"_ZTSN3JPH5ArrayIP9UIElementNS_12STLAllocatorIS2_EEEE", !17, i64 0, !17, i64 8, !10, 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, !10, i64 16}
!24 = !{!"_ZTS14UITexturedQuad", !25, i64 0, !15, i64 8, !15, i64 12, !15, i64 16, !15, i64 20, !15, i64 24, !15, i64 28, !15, i64 32, !15, i64 36}
!25 = !{!"_ZTSN3JPH8RefConstI7TextureEE", !10, i64 0}
!26 = !{!"_ZTSSt8functionIFvfEE", !27, i64 0, !10, i64 24}
!27 = !{!"_ZTSSt14_Function_base", !7, i64 0, !10, i64 16}


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