; LLVM IR from GPUOpen-LibrariesAndSDKs/TAN :: amf/public/common/PropertyStorageExImpl.ll (ZN3amf19AMFPropertyInfoImplC2ERKS0_)

; 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"

%"struct.amf::AMFVariantStruct" = type { i32, %union.anon.0 }
%union.anon.0 = type { i64, [8 x i8] }
%"class.amf::AMFPropertyInfoImpl" = type { %"struct.amf::AMFPropertyInfo", %"class.std::__cxx11::basic_string", %"class.std::__cxx11::basic_string" }
%"struct.amf::AMFPropertyInfo" = type { ptr, ptr, ptr, i32, i32, %"struct.amf::AMFVariantStruct", %"struct.amf::AMFVariantStruct", %"struct.amf::AMFVariantStruct", i32, ptr }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, amf::amf_allocator<wchar_t>>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, amf::amf_allocator<wchar_t>>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }

@_ZTVN3amf19AMFPropertyInfoImplE = external dso_local unnamed_addr constant { [4 x ptr] }, align 8

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwEN3amf13amf_allocatorIwEEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3amf15AMFPropertyInfoC2Ev(ptr noundef nonnull align 8 dereferenceable(120)) unnamed_addr #0 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3amf19AMFPropertyInfoImpl4InitEPKwS2_NS_16AMF_VARIANT_TYPEEjNS_16AMFVariantStructES4_S4_NS_24AMF_PROPERTY_ACCESS_TYPEEPKNS_23AMFEnumDescriptionEntryE(ptr noundef nonnull align 8 dereferenceable(184), ptr noundef, ptr noundef, i32 noundef, i32 noundef, ptr noundef byval(%"struct.amf::AMFVariantStruct") align 8, ptr noundef byval(%"struct.amf::AMFVariantStruct") align 8, ptr noundef byval(%"struct.amf::AMFVariantStruct") align 8, i32 noundef, ptr noundef) #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) #2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3amf19AMFPropertyInfoImplC2ERKS0_(ptr noundef nonnull align 8 dereferenceable(184) %0, ptr noundef nonnull align 8 dereferenceable(184) %1) unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca %"struct.amf::AMFVariantStruct", align 8
  %8 = alloca %"struct.amf::AMFVariantStruct", align 8
  %9 = alloca %"struct.amf::AMFVariantStruct", align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %10 = load ptr, ptr %3, align 8
  call void @_ZN3amf15AMFPropertyInfoC2Ev(ptr noundef nonnull align 8 dereferenceable(120) %10)
  store ptr getelementptr inbounds inrange(-16, 16) ({ [4 x ptr] }, ptr @_ZTVN3amf19AMFPropertyInfoImplE, i32 0, i32 0, i32 2), ptr %10, align 8, !tbaa !9
  %11 = getelementptr inbounds %"class.amf::AMFPropertyInfoImpl", ptr %10, i32 0, i32 1
  invoke void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwEN3amf13amf_allocatorIwEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11)
          to label %12 unwind label %40

12:                                               ; preds = %2
  %13 = getelementptr inbounds %"class.amf::AMFPropertyInfoImpl", ptr %10, i32 0, i32 2
  invoke void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwEN3amf13amf_allocatorIwEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %13)
          to label %14 unwind label %44

14:                                               ; preds = %12
  %15 = load ptr, ptr %4, align 8, !tbaa !5
  %16 = getelementptr inbounds %"struct.amf::AMFPropertyInfo", ptr %15, i32 0, i32 1
  %17 = load ptr, ptr %16, align 8, !tbaa !11
  %18 = load ptr, ptr %4, align 8, !tbaa !5
  %19 = getelementptr inbounds %"struct.amf::AMFPropertyInfo", ptr %18, i32 0, i32 2
  %20 = load ptr, ptr %19, align 8, !tbaa !17
  %21 = load ptr, ptr %4, align 8, !tbaa !5
  %22 = getelementptr inbounds %"struct.amf::AMFPropertyInfo", ptr %21, i32 0, i32 3
  %23 = load i32, ptr %22, align 8, !tbaa !18
  %24 = load ptr, ptr %4, align 8, !tbaa !5
  %25 = getelementptr inbounds %"struct.amf::AMFPropertyInfo", ptr %24, i32 0, i32 4
  %26 = load i32, ptr %25, align 4, !tbaa !19
  %27 = load ptr, ptr %4, align 8, !tbaa !5
  %28 = getelementptr inbounds %"struct.amf::AMFPropertyInfo", ptr %27, i32 0, i32 5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %7, ptr align 8 %28, i64 24, i1 false), !tbaa.struct !20
  %29 = load ptr, ptr %4, align 8, !tbaa !5
  %30 = getelementptr inbounds %"struct.amf::AMFPropertyInfo", ptr %29, i32 0, i32 6
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %8, ptr align 8 %30, i64 24, i1 false), !tbaa.struct !20
  %31 = load ptr, ptr %4, align 8, !tbaa !5
  %32 = getelementptr inbounds %"struct.amf::AMFPropertyInfo", ptr %31, i32 0, i32 7
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %9, ptr align 8 %32, i64 24, i1 false), !tbaa.struct !20
  %33 = load ptr, ptr %4, align 8, !tbaa !5
  %34 = getelementptr inbounds %"struct.amf::AMFPropertyInfo", ptr %33, i32 0, i32 8
  %35 = load i32, ptr %34, align 8, !tbaa !23
  %36 = load ptr, ptr %4, align 8, !tbaa !5
  %37 = getelementptr inbounds %"struct.amf::AMFPropertyInfo", ptr %36, i32 0, i32 9
  %38 = load ptr, ptr %37, align 8, !tbaa !24
  invoke void @_ZN3amf19AMFPropertyInfoImpl4InitEPKwS2_NS_16AMF_VARIANT_TYPEEjNS_16AMFVariantStructES4_S4_NS_24AMF_PROPERTY_ACCESS_TYPEEPKNS_23AMFEnumDescriptionEntryE(ptr noundef nonnull align 8 dereferenceable(184) %10, ptr noundef %17, ptr noundef %20, i32 noundef %23, i32 noundef %26, ptr noundef byval(%"struct.amf::AMFVariantStruct") align 8 %7, ptr noundef byval(%"struct.amf::AMFVariantStruct") align 8 %8, ptr noundef byval(%"struct.amf::AMFVariantStruct") align 8 %9, i32 noundef %35, ptr noundef %38)
          to label %39 unwind label %48

39:                                               ; preds = %14
  ret void

40:                                               ; preds = %2
  %41 = landingpad { ptr, i32 }
          cleanup
  %42 = extractvalue { ptr, i32 } %41, 0
  store ptr %42, ptr %5, align 8
  %43 = extractvalue { ptr, i32 } %41, 1
  store i32 %43, ptr %6, align 4
  br label %53

44:                                               ; preds = %12
  %45 = landingpad { ptr, i32 }
          cleanup
  %46 = extractvalue { ptr, i32 } %45, 0
  store ptr %46, ptr %5, align 8
  %47 = extractvalue { ptr, i32 } %45, 1
  store i32 %47, ptr %6, align 4
  br label %52

48:                                               ; preds = %14
  %49 = landingpad { ptr, i32 }
          cleanup
  %50 = extractvalue { ptr, i32 } %49, 0
  store ptr %50, ptr %5, align 8
  %51 = extractvalue { ptr, i32 } %49, 1
  store i32 %51, ptr %6, align 4
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwEN3amf13amf_allocatorIwEEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %13) #3
  br label %52

52:                                               ; preds = %48, %44
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwEN3amf13amf_allocatorIwEEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #3
  br label %53

53:                                               ; preds = %52, %40
  call void @_ZN3amf15AMFPropertyInfoD2Ev(ptr noundef nonnull align 8 dereferenceable(120) %10) #3
  br label %54

54:                                               ; preds = %53
  %55 = load ptr, ptr %5, align 8
  %56 = load i32, ptr %6, align 4
  %57 = insertvalue { ptr, i32 } poison, ptr %55, 0
  %58 = insertvalue { ptr, i32 } %57, i32 %56, 1
  resume { ptr, i32 } %58
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3amf15AMFPropertyInfoD2Ev(ptr noundef nonnull align 8 dereferenceable(120)) unnamed_addr #0 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = !{!"vtable pointer", !8, i64 0}
!11 = !{!12, !6, i64 8}
!12 = !{!"_ZTSN3amf15AMFPropertyInfoE", !6, i64 8, !6, i64 16, !13, i64 24, !14, i64 28, !15, i64 32, !15, i64 56, !15, i64 80, !16, i64 104, !6, i64 112}
!13 = !{!"_ZTSN3amf16AMF_VARIANT_TYPEE", !7, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = !{!"_ZTSN3amf16AMFVariantStructE", !13, i64 0, !7, i64 8}
!16 = !{!"_ZTSN3amf24AMF_PROPERTY_ACCESS_TYPEE", !7, i64 0}
!17 = !{!12, !6, i64 16}
!18 = !{!12, !13, i64 24}
!19 = !{!12, !14, i64 28}
!20 = !{i64 0, i64 4, !21, i64 8, i64 16, !22}
!21 = !{!13, !13, i64 0}
!22 = !{!7, !7, i64 0}
!23 = !{!12, !16, i64 104}
!24 = !{!12, !6, i64 112}


; 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"

%"struct.amf::AMFVariantStruct" = type { i32, %union.anon.0 }
%union.anon.0 = type { i64, [8 x i8] }

@_ZTVN3amf19AMFPropertyInfoImplE = external dso_local unnamed_addr constant { [4 x ptr] }, align 8

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwEN3amf13amf_allocatorIwEEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3amf15AMFPropertyInfoC2Ev(ptr noundef nonnull align 8 dereferenceable(120)) unnamed_addr #0 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3amf19AMFPropertyInfoImpl4InitEPKwS2_NS_16AMF_VARIANT_TYPEEjNS_16AMFVariantStructES4_S4_NS_24AMF_PROPERTY_ACCESS_TYPEEPKNS_23AMFEnumDescriptionEntryE(ptr noundef nonnull align 8 dereferenceable(184), ptr noundef, ptr noundef, i32 noundef, i32 noundef, ptr noundef byval(%"struct.amf::AMFVariantStruct") align 8, ptr noundef byval(%"struct.amf::AMFVariantStruct") align 8, ptr noundef byval(%"struct.amf::AMFVariantStruct") align 8, i32 noundef, ptr noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3amf19AMFPropertyInfoImplC2ERKS0_(ptr noundef nonnull align 8 dereferenceable(184) %0, ptr nocapture noundef nonnull readonly align 8 dereferenceable(184) %1) unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  tail call void @_ZN3amf15AMFPropertyInfoC2Ev(ptr noundef nonnull align 8 dereferenceable(120) %0)
  store ptr getelementptr inbounds inrange(-16, 16) (i8, ptr @_ZTVN3amf19AMFPropertyInfoImplE, i64 16), ptr %0, align 8, !tbaa !5
  %3 = getelementptr inbounds i8, ptr %0, i64 120
  invoke void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwEN3amf13amf_allocatorIwEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3)
          to label %4 unwind label %23

4:                                                ; preds = %2
  %5 = getelementptr inbounds i8, ptr %0, i64 152
  invoke void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwEN3amf13amf_allocatorIwEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5)
          to label %6 unwind label %25

6:                                                ; preds = %4
  %7 = getelementptr inbounds i8, ptr %1, i64 8
  %8 = load ptr, ptr %7, align 8, !tbaa !8
  %9 = getelementptr inbounds i8, ptr %1, i64 16
  %10 = load ptr, ptr %9, align 8, !tbaa !16
  %11 = getelementptr inbounds i8, ptr %1, i64 24
  %12 = load i32, ptr %11, align 8, !tbaa !17
  %13 = getelementptr inbounds i8, ptr %1, i64 28
  %14 = load i32, ptr %13, align 4, !tbaa !18
  %15 = getelementptr inbounds i8, ptr %1, i64 32
  %16 = getelementptr inbounds i8, ptr %1, i64 56
  %17 = getelementptr inbounds i8, ptr %1, i64 80
  %18 = getelementptr inbounds i8, ptr %1, i64 104
  %19 = load i32, ptr %18, align 8, !tbaa !19
  %20 = getelementptr inbounds i8, ptr %1, i64 112
  %21 = load ptr, ptr %20, align 8, !tbaa !20
  invoke void @_ZN3amf19AMFPropertyInfoImpl4InitEPKwS2_NS_16AMF_VARIANT_TYPEEjNS_16AMFVariantStructES4_S4_NS_24AMF_PROPERTY_ACCESS_TYPEEPKNS_23AMFEnumDescriptionEntryE(ptr noundef nonnull align 8 dereferenceable(184) %0, ptr noundef %8, ptr noundef %10, i32 noundef %12, i32 noundef %14, ptr noundef nonnull byval(%"struct.amf::AMFVariantStruct") align 8 %15, ptr noundef nonnull byval(%"struct.amf::AMFVariantStruct") align 8 %16, ptr noundef nonnull byval(%"struct.amf::AMFVariantStruct") align 8 %17, i32 noundef %19, ptr noundef %21)
          to label %22 unwind label %27

22:                                               ; preds = %6
  ret void

23:                                               ; preds = %2
  %24 = landingpad { ptr, i32 }
          cleanup
  br label %30

25:                                               ; preds = %4
  %26 = landingpad { ptr, i32 }
          cleanup
  br label %29

27:                                               ; preds = %6
  %28 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwEN3amf13amf_allocatorIwEEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #2
  br label %29

29:                                               ; preds = %27, %25
  %.pn = phi { ptr, i32 } [ %28, %27 ], [ %26, %25 ]
  tail call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwEN3amf13amf_allocatorIwEEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #2
  br label %30

30:                                               ; preds = %29, %23
  %.pn.pn = phi { ptr, i32 } [ %.pn, %29 ], [ %24, %23 ]
  tail call void @_ZN3amf15AMFPropertyInfoD2Ev(ptr noundef nonnull align 8 dereferenceable(120) %0) #2
  resume { ptr, i32 } %.pn.pn
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3amf15AMFPropertyInfoD2Ev(ptr noundef nonnull align 8 dereferenceable(120)) unnamed_addr #0 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !10, i64 8}
!9 = !{!"_ZTSN3amf15AMFPropertyInfoE", !10, i64 8, !10, i64 16, !12, i64 24, !13, i64 28, !14, i64 32, !14, i64 56, !14, i64 80, !15, i64 104, !10, i64 112}
!10 = !{!"any pointer", !11, i64 0}
!11 = !{!"omnipotent char", !7, i64 0}
!12 = !{!"_ZTSN3amf16AMF_VARIANT_TYPEE", !11, i64 0}
!13 = !{!"int", !11, i64 0}
!14 = !{!"_ZTSN3amf16AMFVariantStructE", !12, i64 0, !11, i64 8}
!15 = !{!"_ZTSN3amf24AMF_PROPERTY_ACCESS_TYPEE", !11, i64 0}
!16 = !{!9, !10, i64 16}
!17 = !{!9, !12, i64 24}
!18 = !{!9, !13, i64 28}
!19 = !{!9, !15, i64 104}
!20 = !{!9, !10, i64 112}


; Effective O3 passes: DSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,MemCpyOptPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass