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

%"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] }
%"class.amf::amf_allocator" = type { i8 }
%"struct.amf::AMFEnumDescriptionEntry" = type { i32, ptr }

@.str = external hidden unnamed_addr constant [24 x i32], align 4
@.str.1 = external hidden unnamed_addr constant [106 x i32], align 4
@.str.2 = external hidden unnamed_addr constant [25 x i32], align 4

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN3amf24CastVariantToAMFPropertyEPNS_16AMFVariantStructEPKS0_NS_16AMF_VARIANT_TYPEEjPKNS_23AMFEnumDescriptionEntryE(ptr noundef %0, ptr noundef %1, i32 noundef %2, i32 noundef %3, ptr noundef %4) #0 personality ptr @__gxx_personality_v0 {
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca %"class.std::__cxx11::basic_string", align 8
  %14 = alloca %"class.std::__cxx11::basic_string", align 8
  %15 = alloca %"class.std::__cxx11::basic_string", align 8
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca ptr, align 8
  %21 = alloca i8, align 1
  %22 = alloca %"class.std::__cxx11::basic_string", align 8
  %23 = alloca %"class.amf::amf_allocator", align 1
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  store i32 %2, ptr %9, align 4, !tbaa !9
  store i32 %3, ptr %10, align 4, !tbaa !11
  store ptr %4, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  %24 = load ptr, ptr %7, align 8, !tbaa !5
  %25 = icmp ne ptr %24, null
  %26 = zext i1 %25 to i32
  store i32 %26, ptr %12, align 4, !tbaa !11
  %27 = load i32, ptr %12, align 4, !tbaa !11
  %28 = call noundef zeroext i1 @_ZN3amf18AMFCheckExpressionEi(i32 noundef %27)
  br i1 %28, label %49, label %29

29:                                               ; preds = %5
  call void @llvm.lifetime.start.p0(i64 32, ptr %13) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr %14) #6
  %30 = load i32, ptr %12, align 4, !tbaa !11
  call void @_ZN3amf15AMFFormatAssertB5cxx11Ei(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %14, i32 noundef %30)
  call void @llvm.lifetime.start.p0(i64 32, ptr %15) #6
  invoke void @_ZN3amf15__FormatMessageB5cxx11EiPKw(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %15, i32 noundef -1, ptr noundef @.str)
          to label %31 unwind label %35

31:                                               ; preds = %29
  invoke void @_ZStplIwSt11char_traitsIwEN3amf13amf_allocatorIwEEENSt7__cxx1112basic_stringIT_T0_T1_EEOSA_SB_(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %13, ptr noundef nonnull align 8 dereferenceable(32) %14, ptr noundef nonnull align 8 dereferenceable(32) %15)
          to label %32 unwind label %39

32:                                               ; preds = %31
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwEN3amf13amf_allocatorIwEEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %15) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %15) #6
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwEN3amf13amf_allocatorIwEEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %14) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %14) #6
  %33 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIwSt11char_traitsIwEN3amf13amf_allocatorIwEEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %13) #6
  invoke void (ptr, i32, i32, ptr, i32, ptr, ...) @AMFTraceW(ptr noundef @.str.1, i32 noundef 51, i32 noundef 0, ptr noundef @.str.2, i32 noundef 0, ptr noundef %33)
          to label %34 unwind label %44

34:                                               ; preds = %32
  store i32 7, ptr %6, align 4
  store i32 1, ptr %18, align 4
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwEN3amf13amf_allocatorIwEEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %13) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %13) #6
  br label %50

35:                                               ; preds = %29
  %36 = landingpad { ptr, i32 }
          cleanup
  %37 = extractvalue { ptr, i32 } %36, 0
  store ptr %37, ptr %16, align 8
  %38 = extractvalue { ptr, i32 } %36, 1
  store i32 %38, ptr %17, align 4
  br label %43

39:                                               ; preds = %31
  %40 = landingpad { ptr, i32 }
          cleanup
  %41 = extractvalue { ptr, i32 } %40, 0
  store ptr %41, ptr %16, align 8
  %42 = extractvalue { ptr, i32 } %40, 1
  store i32 %42, ptr %17, align 4
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwEN3amf13amf_allocatorIwEEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %15) #6
  br label %43

43:                                               ; preds = %39, %35
  call void @llvm.lifetime.end.p0(i64 32, ptr %15) #6
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwEN3amf13amf_allocatorIwEEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %14) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %14) #6
  br label %48

44:                                               ; preds = %32
  %45 = landingpad { ptr, i32 }
          cleanup
  %46 = extractvalue { ptr, i32 } %45, 0
  store ptr %46, ptr %16, align 8
  %47 = extractvalue { ptr, i32 } %45, 1
  store i32 %47, ptr %17, align 4
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwEN3amf13amf_allocatorIwEEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %13) #6
  br label %48

48:                                               ; preds = %44, %43
  call void @llvm.lifetime.end.p0(i64 32, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %159

49:                                               ; preds = %5
  store i32 0, ptr %18, align 4
  br label %50

50:                                               ; preds = %49, %34
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  %51 = load i32, ptr %18, align 4
  switch i32 %51, label %164 [
    i32 0, label %52
    i32 1, label %157
  ]

52:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  store i32 0, ptr %19, align 4, !tbaa !13
  %53 = load i32, ptr %9, align 4, !tbaa !9
  switch i32 %53, label %150 [
    i32 2, label %54
  ]

54:                                               ; preds = %52
  %55 = load ptr, ptr %11, align 8, !tbaa !5
  %56 = icmp ne ptr %55, null
  br i1 %56, label %57, label %145

57:                                               ; preds = %54
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #6
  %58 = load ptr, ptr %11, align 8, !tbaa !5
  store ptr %58, ptr %20, align 8, !tbaa !5
  %59 = load ptr, ptr %7, align 8, !tbaa !5
  %60 = load ptr, ptr %8, align 8, !tbaa !5
  %61 = call noundef i32 @_ZN3amfL20AMFVariantChangeTypeEPNS_16AMFVariantStructEPKS0_NS_16AMF_VARIANT_TYPEE(ptr noundef %59, ptr noundef %60, i32 noundef 2)
  store i32 %61, ptr %19, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 1, ptr %21) #6
  store i8 0, ptr %21, align 1, !tbaa !15
  %62 = load i32, ptr %19, align 4, !tbaa !13
  %63 = icmp eq i32 %62, 0
  br i1 %63, label %64, label %93

64:                                               ; preds = %57
  br label %65

65:                                               ; preds = %85, %64
  %66 = load ptr, ptr %20, align 8, !tbaa !5
  %67 = getelementptr inbounds %"struct.amf::AMFEnumDescriptionEntry", ptr %66, i32 0, i32 1
  %68 = load ptr, ptr %67, align 8, !tbaa !17
  %69 = icmp ne ptr %68, null
  br i1 %69, label %70, label %88

70:                                               ; preds = %65
  %71 = load ptr, ptr %20, align 8, !tbaa !5
  %72 = getelementptr inbounds %"struct.amf::AMFEnumDescriptionEntry", ptr %71, i32 0, i32 0
  %73 = load i32, ptr %72, align 8, !tbaa !19
  %74 = sext i32 %73 to i64
  %75 = load ptr, ptr %7, align 8, !tbaa !5
  %76 = call noundef i64 @_ZN3amfL18AMFVariantGetInt64EPKNS_16AMFVariantStructE(ptr noundef %75)
  %77 = icmp eq i64 %74, %76
  br i1 %77, label %78, label %85

78:                                               ; preds = %70
  %79 = load ptr, ptr %7, align 8, !tbaa !5
  %80 = load ptr, ptr %20, align 8, !tbaa !5
  %81 = getelementptr inbounds %"struct.amf::AMFEnumDescriptionEntry", ptr %80, i32 0, i32 0
  %82 = load i32, ptr %81, align 8, !tbaa !19
  %83 = sext i32 %82 to i64
  %84 = call noundef i32 @_ZN3amfL21AMFVariantAssignInt64EPNS_16AMFVariantStructEl(ptr noundef %79, i64 noundef %83)
  store i8 1, ptr %21, align 1, !tbaa !15
  br label %88

85:                                               ; preds = %70
  %86 = load ptr, ptr %20, align 8, !tbaa !5
  %87 = getelementptr inbounds %"struct.amf::AMFEnumDescriptionEntry", ptr %86, i32 1
  store ptr %87, ptr %20, align 8, !tbaa !5
  br label %65, !llvm.loop !20

88:                                               ; preds = %78, %65
  %89 = load i8, ptr %21, align 1, !tbaa !15, !range !22, !noundef !23
  %90 = trunc i8 %89 to i1
  %91 = zext i1 %90 to i64
  %92 = select i1 %90, i32 0, i32 4
  store i32 %92, ptr %19, align 4, !tbaa !13
  br label %93

93:                                               ; preds = %88, %57
  %94 = load i8, ptr %21, align 1, !tbaa !15, !range !22, !noundef !23
  %95 = trunc i8 %94 to i1
  br i1 %95, label %144, label %96

96:                                               ; preds = %93
  %97 = load ptr, ptr %11, align 8, !tbaa !5
  store ptr %97, ptr %20, align 8, !tbaa !5
  %98 = load ptr, ptr %7, align 8, !tbaa !5
  %99 = load ptr, ptr %8, align 8, !tbaa !5
  %100 = call noundef i32 @_ZN3amfL20AMFVariantChangeTypeEPNS_16AMFVariantStructEPKS0_NS_16AMF_VARIANT_TYPEE(ptr noundef %98, ptr noundef %99, i32 noundef 11)
  store i32 %100, ptr %19, align 4, !tbaa !13
  %101 = load i32, ptr %19, align 4, !tbaa !13
  %102 = icmp eq i32 %101, 0
  br i1 %102, label %103, label %143

103:                                              ; preds = %96
  store i8 0, ptr %21, align 1, !tbaa !15
  br label %104

104:                                              ; preds = %135, %103
  %105 = load ptr, ptr %20, align 8, !tbaa !5
  %106 = getelementptr inbounds %"struct.amf::AMFEnumDescriptionEntry", ptr %105, i32 0, i32 1
  %107 = load ptr, ptr %106, align 8, !tbaa !17
  %108 = icmp ne ptr %107, null
  br i1 %108, label %109, label %138

109:                                              ; preds = %104
  call void @llvm.lifetime.start.p0(i64 32, ptr %22) #6
  %110 = load ptr, ptr %20, align 8, !tbaa !5
  %111 = getelementptr inbounds %"struct.amf::AMFEnumDescriptionEntry", ptr %110, i32 0, i32 1
  %112 = load ptr, ptr %111, align 8, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 1, ptr %23) #6
  call void @_ZN3amf13amf_allocatorIwEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %23)
  invoke void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwEN3amf13amf_allocatorIwEEEC2IS5_EEPKwRKS5_(ptr noundef nonnull align 8 dereferenceable(32) %22, ptr noundef %112, ptr noundef nonnull align 1 dereferenceable(1) %23)
          to label %113 unwind label %126

113:                                              ; preds = %109
  %114 = load ptr, ptr %7, align 8, !tbaa !5
  %115 = invoke noundef ptr @_ZN3amfL20AMFVariantGetWStringEPKNS_16AMFVariantStructE(ptr noundef %114)
          to label %116 unwind label %130

116:                                              ; preds = %113
  %117 = invoke noundef zeroext i1 @_ZSteqIwSt11char_traitsIwEN3amf13amf_allocatorIwEEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS7_(ptr noundef nonnull align 8 dereferenceable(32) %22, ptr noundef %115)
          to label %118 unwind label %130

118:                                              ; preds = %116
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwEN3amf13amf_allocatorIwEEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %22) #6
  call void @_ZNSt15__new_allocatorIwED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %23) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %22) #6
  br i1 %117, label %119, label %135

119:                                              ; preds = %118
  %120 = load ptr, ptr %7, align 8, !tbaa !5
  %121 = load ptr, ptr %20, align 8, !tbaa !5
  %122 = getelementptr inbounds %"struct.amf::AMFEnumDescriptionEntry", ptr %121, i32 0, i32 0
  %123 = load i32, ptr %122, align 8, !tbaa !19
  %124 = sext i32 %123 to i64
  %125 = call noundef i32 @_ZN3amfL21AMFVariantAssignInt64EPNS_16AMFVariantStructEl(ptr noundef %120, i64 noundef %124)
  store i8 1, ptr %21, align 1, !tbaa !15
  br label %138

126:                                              ; preds = %109
  %127 = landingpad { ptr, i32 }
          cleanup
  %128 = extractvalue { ptr, i32 } %127, 0
  store ptr %128, ptr %16, align 8
  %129 = extractvalue { ptr, i32 } %127, 1
  store i32 %129, ptr %17, align 4
  br label %134

130:                                              ; preds = %116, %113
  %131 = landingpad { ptr, i32 }
          cleanup
  %132 = extractvalue { ptr, i32 } %131, 0
  store ptr %132, ptr %16, align 8
  %133 = extractvalue { ptr, i32 } %131, 1
  store i32 %133, ptr %17, align 4
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwEN3amf13amf_allocatorIwEEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %22) #6
  br label %134

134:                                              ; preds = %130, %126
  call void @_ZNSt15__new_allocatorIwED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %23) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  br label %159

135:                                              ; preds = %118
  %136 = load ptr, ptr %20, align 8, !tbaa !5
  %137 = getelementptr inbounds %"struct.amf::AMFEnumDescriptionEntry", ptr %136, i32 1
  store ptr %137, ptr %20, align 8, !tbaa !5
  br label %104, !llvm.loop !24

138:                                              ; preds = %119, %104
  %139 = load i8, ptr %21, align 1, !tbaa !15, !range !22, !noundef !23
  %140 = trunc i8 %139 to i1
  %141 = zext i1 %140 to i64
  %142 = select i1 %140, i32 0, i32 4
  store i32 %142, ptr %19, align 4, !tbaa !13
  br label %143

143:                                              ; preds = %138, %96
  br label %144

144:                                              ; preds = %143, %93
  call void @llvm.lifetime.end.p0(i64 1, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  br label %149

145:                                              ; preds = %54
  %146 = load ptr, ptr %7, align 8, !tbaa !5
  %147 = load ptr, ptr %8, align 8, !tbaa !5
  %148 = call noundef i32 @_ZN3amfL20AMFVariantChangeTypeEPNS_16AMFVariantStructEPKS0_NS_16AMF_VARIANT_TYPEE(ptr noundef %146, ptr noundef %147, i32 noundef 2)
  store i32 %148, ptr %19, align 4, !tbaa !13
  br label %149

149:                                              ; preds = %145, %144
  br label %155

150:                                              ; preds = %52
  %151 = load ptr, ptr %7, align 8, !tbaa !5
  %152 = load ptr, ptr %8, align 8, !tbaa !5
  %153 = load i32, ptr %9, align 4, !tbaa !9
  %154 = call noundef i32 @_ZN3amfL20AMFVariantChangeTypeEPNS_16AMFVariantStructEPKS0_NS_16AMF_VARIANT_TYPEE(ptr noundef %151, ptr noundef %152, i32 noundef %153)
  store i32 %154, ptr %19, align 4, !tbaa !13
  br label %155

155:                                              ; preds = %150, %149
  %156 = load i32, ptr %19, align 4, !tbaa !13
  store i32 %156, ptr %6, align 4
  store i32 1, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  br label %157

157:                                              ; preds = %155, %50
  %158 = load i32, ptr %6, align 4
  ret i32 %158

159:                                              ; preds = %134, %48
  %160 = load ptr, ptr %16, align 8
  %161 = load i32, ptr %17, align 4
  %162 = insertvalue { ptr, i32 } poison, ptr %160, 0
  %163 = insertvalue { ptr, i32 } %162, i32 %161, 1
  resume { ptr, i32 } %163

164:                                              ; preds = %50
  unreachable
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN3amf18AMFCheckExpressionEi(i32 noundef) #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZStplIwSt11char_traitsIwEN3amf13amf_allocatorIwEEENSt7__cxx1112basic_stringIT_T0_T1_EEOSA_SB_(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3amf15AMFFormatAssertB5cxx11Ei(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, i32 noundef) #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3amf15__FormatMessageB5cxx11EiPKw(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, i32 noundef, ptr noundef) #3

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

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

declare void @AMFTraceW(ptr noundef, i32 noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef, ...) #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNKSt7__cxx1112basic_stringIwSt11char_traitsIwEN3amf13amf_allocatorIwEEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32)) #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare hidden noundef i32 @_ZN3amfL20AMFVariantChangeTypeEPNS_16AMFVariantStructEPKS0_NS_16AMF_VARIANT_TYPEE(ptr noundef, ptr noundef, i32 noundef) #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef i64 @_ZN3amfL18AMFVariantGetInt64EPKNS_16AMFVariantStructE(ptr noundef) #2

; Function Attrs: inlinehint mustprogress uwtable
declare hidden noundef i32 @_ZN3amfL21AMFVariantAssignInt64EPNS_16AMFVariantStructEl(ptr noundef, i64 noundef) #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZSteqIwSt11char_traitsIwEN3amf13amf_allocatorIwEEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS7_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef) #2

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef ptr @_ZN3amfL20AMFVariantGetWStringEPKNS_16AMFVariantStructE(ptr noundef) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIwED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #4 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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" }
attributes #4 = { 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 #5 = { "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 #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 = !{!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 = !{!"_ZTS10AMF_RESULT", !7, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"bool", !7, i64 0}
!17 = !{!18, !6, i64 8}
!18 = !{!"_ZTSN3amf23AMFEnumDescriptionEntryE", !12, i64 0, !6, i64 8}
!19 = !{!18, !12, i64 0}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = !{i8 0, i8 2}
!23 = !{}
!24 = distinct !{!24, !21}


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

%"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] }
%"class.amf::amf_allocator" = type { i8 }

@.str = external hidden unnamed_addr constant [24 x i32], align 4
@.str.1 = external hidden unnamed_addr constant [106 x i32], align 4
@.str.2 = external hidden unnamed_addr constant [25 x i32], align 4

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN3amf24CastVariantToAMFPropertyEPNS_16AMFVariantStructEPKS0_NS_16AMF_VARIANT_TYPEEjPKNS_23AMFEnumDescriptionEntryE(ptr noundef %0, ptr noundef %1, i32 noundef %2, i32 noundef %3, ptr noundef readonly %4) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %6 = alloca %"class.std::__cxx11::basic_string", align 8
  %7 = alloca %"class.std::__cxx11::basic_string", align 8
  %8 = alloca %"class.std::__cxx11::basic_string", align 8
  %9 = alloca %"class.std::__cxx11::basic_string", align 8
  %10 = alloca %"class.amf::amf_allocator", align 1
  %11 = icmp ne ptr %0, null
  %12 = zext i1 %11 to i32
  %13 = tail call noundef zeroext i1 @_ZN3amf18AMFCheckExpressionEi(i32 noundef %12)
  br i1 %13, label %27, label %14

14:                                               ; preds = %5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %7) #6
  call void @_ZN3amf15AMFFormatAssertB5cxx11Ei(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %7, i32 noundef %12)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %8) #6
  invoke void @_ZN3amf15__FormatMessageB5cxx11EiPKw(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %8, i32 noundef -1, ptr noundef nonnull @.str)
          to label %15 unwind label %18

15:                                               ; preds = %14
  invoke void @_ZStplIwSt11char_traitsIwEN3amf13amf_allocatorIwEEENSt7__cxx1112basic_stringIT_T0_T1_EEOSA_SB_(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %6, ptr noundef nonnull align 8 dereferenceable(32) %7, ptr noundef nonnull align 8 dereferenceable(32) %8)
          to label %16 unwind label %20

16:                                               ; preds = %15
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwEN3amf13amf_allocatorIwEEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #6
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwEN3amf13amf_allocatorIwEEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #6
  %17 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIwSt11char_traitsIwEN3amf13amf_allocatorIwEEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %6) #6
  invoke void (ptr, i32, i32, ptr, i32, ptr, ...) @AMFTraceW(ptr noundef nonnull @.str.1, i32 noundef 51, i32 noundef 0, ptr noundef nonnull @.str.2, i32 noundef 0, ptr noundef %17)
          to label %26 unwind label %23

18:                                               ; preds = %14
  %19 = landingpad { ptr, i32 }
          cleanup
  br label %22

20:                                               ; preds = %15
  %21 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwEN3amf13amf_allocatorIwEEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #6
  br label %22

22:                                               ; preds = %20, %18
  %.pn = phi { ptr, i32 } [ %21, %20 ], [ %19, %18 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #6
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwEN3amf13amf_allocatorIwEEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #6
  br label %25

23:                                               ; preds = %16
  %24 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwEN3amf13amf_allocatorIwEEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #6
  br label %25

25:                                               ; preds = %23, %22
  %.pn56 = phi { ptr, i32 } [ %24, %23 ], [ %.pn, %22 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #6
  br label %66

26:                                               ; preds = %16
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwEN3amf13amf_allocatorIwEEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #6
  br label %.loopexit

27:                                               ; preds = %5
  %cond = icmp eq i32 %2, 2
  br i1 %cond, label %28, label %64

28:                                               ; preds = %27
  %.not = icmp eq ptr %4, null
  %29 = tail call noundef i32 @_ZN3amfL20AMFVariantChangeTypeEPNS_16AMFVariantStructEPKS0_NS_16AMF_VARIANT_TYPEE(ptr noundef %0, ptr noundef %1, i32 noundef 2)
  br i1 %.not, label %.loopexit, label %30

30:                                               ; preds = %28
  %31 = icmp eq i32 %29, 0
  br i1 %31, label %.preheader66, label %.loopexit67

.preheader66:                                     ; preds = %30
  %32 = getelementptr inbounds i8, ptr %4, i64 8
  %33 = load ptr, ptr %32, align 8, !tbaa !5
  %.not58.not71 = icmp eq ptr %33, null
  br i1 %.not58.not71, label %.loopexit67, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader66, %38
  %.03772 = phi ptr [ %39, %38 ], [ %4, %.preheader66 ]
  %34 = load i32, ptr %.03772, align 8, !tbaa !11
  %35 = sext i32 %34 to i64
  %36 = tail call noundef i64 @_ZN3amfL18AMFVariantGetInt64EPKNS_16AMFVariantStructE(ptr noundef %0)
  %37 = icmp eq i64 %36, %35
  br i1 %37, label %42, label %38

38:                                               ; preds = %.lr.ph
  %39 = getelementptr inbounds i8, ptr %.03772, i64 16
  %40 = getelementptr inbounds i8, ptr %.03772, i64 24
  %41 = load ptr, ptr %40, align 8, !tbaa !5
  %.not58.not = icmp eq ptr %41, null
  br i1 %.not58.not, label %.loopexit67, label %.lr.ph, !llvm.loop !12

42:                                               ; preds = %.lr.ph
  %43 = load i32, ptr %.03772, align 8, !tbaa !11
  %44 = sext i32 %43 to i64
  %45 = tail call noundef i32 @_ZN3amfL21AMFVariantAssignInt64EPNS_16AMFVariantStructEl(ptr noundef %0, i64 noundef %44)
  br label %.loopexit

.loopexit67:                                      ; preds = %38, %.preheader66, %30
  %46 = tail call noundef i32 @_ZN3amfL20AMFVariantChangeTypeEPNS_16AMFVariantStructEPKS0_NS_16AMF_VARIANT_TYPEE(ptr noundef %0, ptr noundef %1, i32 noundef 11)
  %47 = icmp eq i32 %46, 0
  br i1 %47, label %.preheader, label %.loopexit

.preheader:                                       ; preds = %.loopexit67
  %48 = getelementptr inbounds i8, ptr %4, i64 8
  %49 = load ptr, ptr %48, align 8, !tbaa !5
  %.not59.not73 = icmp eq ptr %49, null
  br i1 %.not59.not73, label %.loopexit, label %.lr.ph75

.lr.ph75:                                         ; preds = %.preheader, %60
  %50 = phi ptr [ %63, %60 ], [ %49, %.preheader ]
  %.13874 = phi ptr [ %61, %60 ], [ %4, %.preheader ]
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %9) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %10) #6
  call void @_ZN3amf13amf_allocatorIwEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10)
  invoke void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwEN3amf13amf_allocatorIwEEEC2IS5_EEPKwRKS5_(ptr noundef nonnull align 8 dereferenceable(32) %9, ptr noundef nonnull %50, ptr noundef nonnull align 1 dereferenceable(1) %10)
          to label %51 unwind label %58

51:                                               ; preds = %.lr.ph75
  %52 = call noundef ptr @_ZN3amfL20AMFVariantGetWStringEPKNS_16AMFVariantStructE(ptr noundef %0)
  %53 = call noundef zeroext i1 @_ZSteqIwSt11char_traitsIwEN3amf13amf_allocatorIwEEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS7_(ptr noundef nonnull align 8 dereferenceable(32) %9, ptr noundef %52)
  call void @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwEN3amf13amf_allocatorIwEEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #6
  call void @_ZNSt15__new_allocatorIwED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %10) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %9) #6
  br i1 %53, label %54, label %60

54:                                               ; preds = %51
  %55 = load i32, ptr %.13874, align 8, !tbaa !11
  %56 = sext i32 %55 to i64
  %57 = call noundef i32 @_ZN3amfL21AMFVariantAssignInt64EPNS_16AMFVariantStructEl(ptr noundef %0, i64 noundef %56)
  br label %.loopexit

58:                                               ; preds = %.lr.ph75
  %59 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIwED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %10) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %9) #6
  br label %66

60:                                               ; preds = %51
  %61 = getelementptr inbounds i8, ptr %.13874, i64 16
  %62 = getelementptr inbounds i8, ptr %.13874, i64 24
  %63 = load ptr, ptr %62, align 8, !tbaa !5
  %.not59.not = icmp eq ptr %63, null
  br i1 %.not59.not, label %.loopexit, label %.lr.ph75, !llvm.loop !14

64:                                               ; preds = %27
  %65 = tail call noundef i32 @_ZN3amfL20AMFVariantChangeTypeEPNS_16AMFVariantStructEPKS0_NS_16AMF_VARIANT_TYPEE(ptr noundef %0, ptr noundef %1, i32 noundef %2)
  br label %.loopexit

.loopexit:                                        ; preds = %60, %28, %.preheader, %42, %26, %64, %54, %.loopexit67
  %.150 = phi i32 [ 7, %26 ], [ %65, %64 ], [ 0, %42 ], [ %46, %.loopexit67 ], [ 0, %54 ], [ 4, %.preheader ], [ %29, %28 ], [ 4, %60 ]
  ret i32 %.150

66:                                               ; preds = %58, %25
  %.pn60 = phi { ptr, i32 } [ %59, %58 ], [ %.pn56, %25 ]
  resume { ptr, i32 } %.pn60
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN3amf18AMFCheckExpressionEi(i32 noundef) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZStplIwSt11char_traitsIwEN3amf13amf_allocatorIwEEENSt7__cxx1112basic_stringIT_T0_T1_EEOSA_SB_(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3amf15AMFFormatAssertB5cxx11Ei(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, i32 noundef) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3amf15__FormatMessageB5cxx11EiPKw(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, i32 noundef, ptr noundef) local_unnamed_addr #3

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

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

declare void @AMFTraceW(ptr noundef, i32 noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef, ...) local_unnamed_addr #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNKSt7__cxx1112basic_stringIwSt11char_traitsIwEN3amf13amf_allocatorIwEEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare hidden noundef i32 @_ZN3amfL20AMFVariantChangeTypeEPNS_16AMFVariantStructEPKS0_NS_16AMF_VARIANT_TYPEE(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef i64 @_ZN3amfL18AMFVariantGetInt64EPKNS_16AMFVariantStructE(ptr noundef) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress uwtable
declare hidden noundef i32 @_ZN3amfL21AMFVariantAssignInt64EPNS_16AMFVariantStructEl(ptr noundef, i64 noundef) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZSteqIwSt11char_traitsIwEN3amf13amf_allocatorIwEEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS7_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef) local_unnamed_addr #2

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIwED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #4 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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" }
attributes #4 = { 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 #5 = { "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 #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, !10, i64 8}
!6 = !{!"_ZTSN3amf23AMFEnumDescriptionEntryE", !7, i64 0, !10, i64 8}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!6, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass