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

; 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

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

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 #1 align 2

; 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 @_ZN3amf19AMFPropertyInfoImplC2EPKwS2_NS_16AMF_VARIANT_TYPEEjNS_16AMFVariantStructES4_S4_bPKNS_23AMFEnumDescriptionEntryE(ptr noundef nonnull align 8 dereferenceable(184) %0, ptr noundef %1, ptr noundef %2, i32 noundef %3, i32 noundef %4, ptr noundef byval(%"struct.amf::AMFVariantStruct") align 8 %5, ptr noundef byval(%"struct.amf::AMFVariantStruct") align 8 %6, ptr noundef byval(%"struct.amf::AMFVariantStruct") align 8 %7, i1 noundef zeroext %8, ptr noundef %9) unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i8, align 1
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca %"struct.amf::AMFVariantStruct", align 8
  %22 = alloca %"struct.amf::AMFVariantStruct", align 8
  %23 = alloca %"struct.amf::AMFVariantStruct", align 8
  store ptr %0, ptr %11, align 8, !tbaa !5
  store ptr %1, ptr %12, align 8, !tbaa !5
  store ptr %2, ptr %13, align 8, !tbaa !5
  store i32 %3, ptr %14, align 4, !tbaa !9
  store i32 %4, ptr %15, align 4, !tbaa !11
  %24 = zext i1 %8 to i8
  store i8 %24, ptr %16, align 1, !tbaa !13
  store ptr %9, ptr %17, align 8, !tbaa !5
  %25 = load ptr, ptr %11, align 8
  call void @_ZN3amf15AMFPropertyInfoC2Ev(ptr noundef nonnull align 8 dereferenceable(120) %25)
  store ptr getelementptr inbounds inrange(-16, 16) ({ [4 x ptr] }, ptr @_ZTVN3amf19AMFPropertyInfoImplE, i32 0, i32 0, i32 2), ptr %25, align 8, !tbaa !15
  %26 = getelementptr inbounds %"class.amf::AMFPropertyInfoImpl", ptr %25, i32 0, i32 1
  invoke void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwEN3amf13amf_allocatorIwEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %26)
          to label %27 unwind label %41

27:                                               ; preds = %10
  %28 = getelementptr inbounds %"class.amf::AMFPropertyInfoImpl", ptr %25, i32 0, i32 2
  invoke void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwEN3amf13amf_allocatorIwEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %28)
          to label %29 unwind label %45

29:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #4
  %30 = load i8, ptr %16, align 1, !tbaa !13, !range !17, !noundef !18
  %31 = trunc i8 %30 to i1
  %32 = zext i1 %31 to i64
  %33 = select i1 %31, i32 255, i32 3
  store i32 %33, ptr %20, align 4, !tbaa !19
  %34 = load ptr, ptr %12, align 8, !tbaa !5
  %35 = load ptr, ptr %13, align 8, !tbaa !5
  %36 = load i32, ptr %14, align 4, !tbaa !9
  %37 = load i32, ptr %15, align 4, !tbaa !11
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %21, ptr align 8 %5, i64 24, i1 false), !tbaa.struct !21
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %22, ptr align 8 %6, i64 24, i1 false), !tbaa.struct !21
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %23, ptr align 8 %7, i64 24, i1 false), !tbaa.struct !21
  %38 = load i32, ptr %20, align 4, !tbaa !19
  %39 = load ptr, ptr %17, align 8, !tbaa !5
  invoke void @_ZN3amf19AMFPropertyInfoImpl4InitEPKwS2_NS_16AMF_VARIANT_TYPEEjNS_16AMFVariantStructES4_S4_NS_24AMF_PROPERTY_ACCESS_TYPEEPKNS_23AMFEnumDescriptionEntryE(ptr noundef nonnull align 8 dereferenceable(184) %25, ptr noundef %34, ptr noundef %35, i32 noundef %36, i32 noundef %37, ptr noundef byval(%"struct.amf::AMFVariantStruct") align 8 %21, ptr noundef byval(%"struct.amf::AMFVariantStruct") align 8 %22, ptr noundef byval(%"struct.amf::AMFVariantStruct") align 8 %23, i32 noundef %38, ptr noundef %39)
          to label %40 unwind label %49

40:                                               ; preds = %29
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #4
  ret void

41:                                               ; preds = %10
  %42 = landingpad { ptr, i32 }
          cleanup
  %43 = extractvalue { ptr, i32 } %42, 0
  store ptr %43, ptr %18, align 8
  %44 = extractvalue { ptr, i32 } %42, 1
  store i32 %44, ptr %19, align 4
  br label %54

45:                                               ; preds = %27
  %46 = landingpad { ptr, i32 }
          cleanup
  %47 = extractvalue { ptr, i32 } %46, 0
  store ptr %47, ptr %18, align 8
  %48 = extractvalue { ptr, i32 } %46, 1
  store i32 %48, ptr %19, align 4
  br label %53

49:                                               ; preds = %29
  %50 = landingpad { ptr, i32 }
          cleanup
  %51 = extractvalue { ptr, i32 } %50, 0
  store ptr %51, ptr %18, align 8
  %52 = extractvalue { ptr, i32 } %50, 1
  store i32 %52, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #4
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwEN3amf13amf_allocatorIwEEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %28) #4
  br label %53

53:                                               ; preds = %49, %45
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwEN3amf13amf_allocatorIwEEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %26) #4
  br label %54

54:                                               ; preds = %53, %41
  call void @_ZN3amf15AMFPropertyInfoD2Ev(ptr noundef nonnull align 8 dereferenceable(120) %25) #4
  br label %55

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwEN3amf13amf_allocatorIwEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #2 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) #2 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) #3

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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, !10, i64 0}
!10 = !{!"_ZTSN3amf16AMF_VARIANT_TYPEE", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"vtable pointer", !8, i64 0}
!17 = !{i8 0, i8 2}
!18 = !{}
!19 = !{!20, !20, i64 0}
!20 = !{!"_ZTSN3amf24AMF_PROPERTY_ACCESS_TYPEE", !7, i64 0}
!21 = !{i64 0, i64 4, !9, i64 8, i64 16, !22}
!22 = !{!7, !7, 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"

%"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 uwtable
define dso_local void @_ZN3amf19AMFPropertyInfoImplC2EPKwS2_NS_16AMF_VARIANT_TYPEEjNS_16AMFVariantStructES4_S4_bPKNS_23AMFEnumDescriptionEntryE(ptr noundef nonnull align 8 dereferenceable(184) %0, ptr noundef %1, ptr noundef %2, i32 noundef %3, i32 noundef %4, ptr nocapture noundef readonly byval(%"struct.amf::AMFVariantStruct") align 8 %5, ptr nocapture noundef readonly byval(%"struct.amf::AMFVariantStruct") align 8 %6, ptr nocapture noundef readonly byval(%"struct.amf::AMFVariantStruct") align 8 %7, i1 noundef zeroext %8, ptr noundef %9) 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
  %11 = getelementptr inbounds i8, ptr %0, i64 120
  invoke void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwEN3amf13amf_allocatorIwEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11)
          to label %12 unwind label %17

12:                                               ; preds = %10
  %13 = getelementptr inbounds i8, ptr %0, i64 152
  invoke void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwEN3amf13amf_allocatorIwEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %13)
          to label %14 unwind label %19

14:                                               ; preds = %12
  %15 = select i1 %8, i32 255, i32 3
  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 %1, ptr noundef %2, i32 noundef %3, i32 noundef %4, ptr noundef nonnull byval(%"struct.amf::AMFVariantStruct") align 8 %5, ptr noundef nonnull byval(%"struct.amf::AMFVariantStruct") align 8 %6, ptr noundef nonnull byval(%"struct.amf::AMFVariantStruct") align 8 %7, i32 noundef %15, ptr noundef %9)
          to label %16 unwind label %21

16:                                               ; preds = %14
  ret void

17:                                               ; preds = %10
  %18 = landingpad { ptr, i32 }
          cleanup
  br label %24

19:                                               ; preds = %12
  %20 = landingpad { ptr, i32 }
          cleanup
  br label %23

21:                                               ; preds = %14
  %22 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwEN3amf13amf_allocatorIwEEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %13) #2
  br label %23

23:                                               ; preds = %21, %19
  %.pn = phi { ptr, i32 } [ %22, %21 ], [ %20, %19 ]
  tail call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwEN3amf13amf_allocatorIwEEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #2
  br label %24

24:                                               ; preds = %23, %17
  %.pn.pn = phi { ptr, i32 } [ %.pn, %23 ], [ %18, %17 ]
  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 @_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 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"}


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