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

; 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.__gnu_cxx::__normal_iterator" = type { ptr }
%"struct.AMFFactoryHelper::ComponentHolder" = type { ptr, i64, %"class.std::__cxx11::basic_string" }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<wchar_t>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<wchar_t>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%class.AMFFactoryHelper = type { ptr, ptr, ptr, ptr, ptr, i64, i64, %"class.std::vector" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<AMFFactoryHelper::ComponentHolder, std::allocator<AMFFactoryHelper::ComponentHolder>>::_Vector_impl" }
%"struct.std::_Vector_base<AMFFactoryHelper::ComponentHolder, std::allocator<AMFFactoryHelper::ComponentHolder>>::_Vector_impl" = type { %"struct.std::_Vector_base<AMFFactoryHelper::ComponentHolder, std::allocator<AMFFactoryHelper::ComponentHolder>>::_Vector_impl_data" }
%"struct.std::_Vector_base<AMFFactoryHelper::ComponentHolder, std::allocator<AMFFactoryHelper::ComponentHolder>>::_Vector_impl_data" = type { ptr, ptr, ptr }

declare i32 @__gxx_personality_v0(...)

declare i64 @amf_atomic_inc(ptr noundef) #0

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

declare ptr @amf_get_proc_address(ptr noundef, ptr noundef) #0

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN16AMFFactoryHelper21LoadExternalComponentEPN3amf10AMFContextEPKwPKcPvPPNS0_12AMFComponentE(ptr noundef nonnull align 8 dereferenceable(80) %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5) #2 align 2 personality ptr @__gxx_personality_v0 {
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %16 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %17 = alloca i32, align 4
  %18 = alloca %"struct.AMFFactoryHelper::ComponentHolder", align 8
  %19 = alloca ptr, align 8
  %20 = alloca i32, align 4
  %21 = alloca ptr, align 8
  store ptr %0, ptr %8, align 8, !tbaa !5
  store ptr %1, ptr %9, align 8, !tbaa !5
  store ptr %2, ptr %10, align 8, !tbaa !5
  store ptr %3, ptr %11, align 8, !tbaa !5
  store ptr %4, ptr %12, align 8, !tbaa !5
  store ptr %5, ptr %13, align 8, !tbaa !5
  %22 = load ptr, ptr %8, align 8
  %23 = load ptr, ptr %9, align 8, !tbaa !5
  %24 = icmp ne ptr %23, null
  br i1 %24, label %25, label %31

25:                                               ; preds = %6
  %26 = load ptr, ptr %10, align 8, !tbaa !5
  %27 = icmp ne ptr %26, null
  br i1 %27, label %28, label %31

28:                                               ; preds = %25
  %29 = load ptr, ptr %11, align 8, !tbaa !5
  %30 = icmp ne ptr %29, null
  br i1 %30, label %32, label %31

31:                                               ; preds = %28, %25, %6
  store i32 4, ptr %7, align 4
  br label %113

32:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  store ptr null, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %33 = getelementptr inbounds %class.AMFFactoryHelper, ptr %22, i32 0, i32 7
  %34 = call ptr @_ZNSt6vectorIN16AMFFactoryHelper15ComponentHolderESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %33) #6
  %35 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %15, i32 0, i32 0
  store ptr %34, ptr %35, align 8
  br label %36

36:                                               ; preds = %63, %32
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  %37 = getelementptr inbounds %class.AMFFactoryHelper, ptr %22, i32 0, i32 7
  %38 = call ptr @_ZNSt6vectorIN16AMFFactoryHelper15ComponentHolderESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %37) #6
  %39 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %16, i32 0, i32 0
  store ptr %38, ptr %39, align 8
  %40 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPN16AMFFactoryHelper15ComponentHolderESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull align 8 dereferenceable(8) %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  br i1 %40, label %42, label %41

41:                                               ; preds = %36
  store i32 2, ptr %17, align 4
  br label %65

42:                                               ; preds = %36
  %43 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPN16AMFFactoryHelper15ComponentHolderESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %15) #6
  %44 = getelementptr inbounds %"struct.AMFFactoryHelper::ComponentHolder", ptr %43, i32 0, i32 2
  %45 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %44) #6
  %46 = load ptr, ptr %10, align 8, !tbaa !5
  %47 = call i32 @wcscmp(ptr noundef %45, ptr noundef %46) #7
  %48 = icmp eq i32 %47, 0
  br i1 %48, label %49, label %62

49:                                               ; preds = %42
  %50 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPN16AMFFactoryHelper15ComponentHolderESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %15) #6
  %51 = getelementptr inbounds %"struct.AMFFactoryHelper::ComponentHolder", ptr %50, i32 0, i32 0
  %52 = load ptr, ptr %51, align 8, !tbaa !9
  %53 = icmp ne ptr %52, null
  br i1 %53, label %54, label %61

54:                                               ; preds = %49
  %55 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPN16AMFFactoryHelper15ComponentHolderESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %15) #6
  %56 = getelementptr inbounds %"struct.AMFFactoryHelper::ComponentHolder", ptr %55, i32 0, i32 0
  %57 = load ptr, ptr %56, align 8, !tbaa !9
  store ptr %57, ptr %14, align 8, !tbaa !5
  %58 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPN16AMFFactoryHelper15ComponentHolderESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %15) #6
  %59 = getelementptr inbounds %"struct.AMFFactoryHelper::ComponentHolder", ptr %58, i32 0, i32 1
  %60 = call i64 @amf_atomic_inc(ptr noundef %59)
  store i32 2, ptr %17, align 4
  br label %65

61:                                               ; preds = %49
  store i32 2, ptr %7, align 4
  store i32 1, ptr %17, align 4
  br label %65

62:                                               ; preds = %42
  br label %63

63:                                               ; preds = %62
  %64 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPN16AMFFactoryHelper15ComponentHolderESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %15) #6
  br label %36, !llvm.loop !14

65:                                               ; preds = %61, %54, %41
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  %66 = load i32, ptr %17, align 4
  switch i32 %66, label %112 [
    i32 2, label %67
  ]

67:                                               ; preds = %65
  %68 = load ptr, ptr %14, align 8, !tbaa !5
  %69 = icmp eq ptr %68, null
  br i1 %69, label %70, label %98

70:                                               ; preds = %67
  call void @llvm.lifetime.start.p0(i64 48, ptr %18) #6
  call void @_ZN16AMFFactoryHelper15ComponentHolderC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %18)
  %71 = getelementptr inbounds %"struct.AMFFactoryHelper::ComponentHolder", ptr %18, i32 0, i32 1
  store i64 0, ptr %71, align 8, !tbaa !16
  %72 = getelementptr inbounds %"struct.AMFFactoryHelper::ComponentHolder", ptr %18, i32 0, i32 0
  store ptr null, ptr %72, align 8, !tbaa !9
  %73 = load ptr, ptr %10, align 8, !tbaa !5
  %74 = getelementptr inbounds %"struct.AMFFactoryHelper::ComponentHolder", ptr %18, i32 0, i32 2
  %75 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEaSEPKw(ptr noundef nonnull align 8 dereferenceable(32) %74, ptr noundef %73)
          to label %76 unwind label %83

76:                                               ; preds = %70
  %77 = load ptr, ptr %10, align 8, !tbaa !5
  %78 = invoke ptr @amf_load_library(ptr noundef %77)
          to label %79 unwind label %83

79:                                               ; preds = %76
  store ptr %78, ptr %14, align 8, !tbaa !5
  %80 = load ptr, ptr %14, align 8, !tbaa !5
  %81 = icmp eq ptr %80, null
  br i1 %81, label %82, label %87

82:                                               ; preds = %79
  store i32 1, ptr %7, align 4
  store i32 1, ptr %17, align 4
  br label %95

83:                                               ; preds = %92, %87, %76, %70
  %84 = landingpad { ptr, i32 }
          cleanup
  %85 = extractvalue { ptr, i32 } %84, 0
  store ptr %85, ptr %19, align 8
  %86 = extractvalue { ptr, i32 } %84, 1
  store i32 %86, ptr %20, align 4
  call void @_ZN16AMFFactoryHelper15ComponentHolderD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %18) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  br label %115

87:                                               ; preds = %79
  %88 = load ptr, ptr %14, align 8, !tbaa !5
  %89 = getelementptr inbounds %"struct.AMFFactoryHelper::ComponentHolder", ptr %18, i32 0, i32 0
  store ptr %88, ptr %89, align 8, !tbaa !9
  %90 = getelementptr inbounds %"struct.AMFFactoryHelper::ComponentHolder", ptr %18, i32 0, i32 1
  %91 = invoke i64 @amf_atomic_inc(ptr noundef %90)
          to label %92 unwind label %83

92:                                               ; preds = %87
  %93 = getelementptr inbounds %class.AMFFactoryHelper, ptr %22, i32 0, i32 7
  invoke void @_ZNSt6vectorIN16AMFFactoryHelper15ComponentHolderESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %93, ptr noundef nonnull align 8 dereferenceable(48) %18)
          to label %94 unwind label %83

94:                                               ; preds = %92
  store i32 0, ptr %17, align 4
  br label %95

95:                                               ; preds = %94, %82
  call void @_ZN16AMFFactoryHelper15ComponentHolderD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %18) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr %18) #6
  %96 = load i32, ptr %17, align 4
  switch i32 %96, label %112 [
    i32 0, label %97
  ]

97:                                               ; preds = %95
  br label %98

98:                                               ; preds = %97, %67
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #6
  %99 = load ptr, ptr %14, align 8, !tbaa !5
  %100 = load ptr, ptr %11, align 8, !tbaa !5
  %101 = call ptr @amf_get_proc_address(ptr noundef %99, ptr noundef %100)
  store ptr %101, ptr %21, align 8, !tbaa !5
  %102 = load ptr, ptr %21, align 8, !tbaa !5
  %103 = icmp eq ptr %102, null
  br i1 %103, label %104, label %105

104:                                              ; preds = %98
  store i32 1, ptr %7, align 4
  store i32 1, ptr %17, align 4
  br label %111

105:                                              ; preds = %98
  %106 = load ptr, ptr %21, align 8, !tbaa !5
  %107 = load ptr, ptr %9, align 8, !tbaa !5
  %108 = load ptr, ptr %12, align 8, !tbaa !5
  %109 = load ptr, ptr %13, align 8, !tbaa !5
  %110 = call noundef i32 %106(ptr noundef %107, ptr noundef %108, ptr noundef %109)
  store i32 %110, ptr %7, align 4
  store i32 1, ptr %17, align 4
  br label %111

111:                                              ; preds = %105, %104
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  br label %112

112:                                              ; preds = %111, %95, %65
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  br label %113

113:                                              ; preds = %112, %31
  %114 = load i32, ptr %7, align 4
  ret i32 %114

115:                                              ; preds = %83
  %116 = load ptr, ptr %19, align 8
  %117 = load i32, ptr %20, align 4
  %118 = insertvalue { ptr, i32 } poison, ptr %116, 0
  %119 = insertvalue { ptr, i32 } %118, i32 %117, 1
  resume { ptr, i32 } %119
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorIN16AMFFactoryHelper15ComponentHolderESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) #3 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorIN16AMFFactoryHelper15ComponentHolderESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) #3 align 2

; Function Attrs: nounwind willreturn memory(read)
declare i32 @wcscmp(ptr noundef, ptr noundef) #5

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN16AMFFactoryHelper15ComponentHolderC2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #3 align 2

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

declare ptr @amf_load_library(ptr noundef) #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIN16AMFFactoryHelper15ComponentHolderESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(48)) #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN16AMFFactoryHelper15ComponentHolderD2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #4 align 2

attributes #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 = { 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 = { 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 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 = { nounwind willreturn memory(read) "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 }
attributes #7 = { nounwind willreturn memory(read) }

!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, !6, i64 0}
!10 = !{!"_ZTSN16AMFFactoryHelper15ComponentHolderE", !6, i64 0, !11, i64 8, !12, i64 16}
!11 = !{!"long", !7, i64 0}
!12 = !{!"_ZTSNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEE", !13, i64 0, !11, i64 8, !7, i64 16}
!13 = !{!"_ZTSNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE12_Alloc_hiderE", !6, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = !{!10, !11, i64 8}


; 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.__gnu_cxx::__normal_iterator" = type { ptr }
%"struct.AMFFactoryHelper::ComponentHolder" = type { ptr, i64, %"class.std::__cxx11::basic_string" }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<wchar_t>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<wchar_t>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }

declare i32 @__gxx_personality_v0(...)

declare i64 @amf_atomic_inc(ptr noundef) local_unnamed_addr #0

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

declare ptr @amf_get_proc_address(ptr noundef, ptr noundef) local_unnamed_addr #0

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN16AMFFactoryHelper21LoadExternalComponentEPN3amf10AMFContextEPKwPKcPvPPNS0_12AMFComponentE(ptr noundef nonnull align 8 dereferenceable(80) %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %7 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %8 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %9 = alloca %"struct.AMFFactoryHelper::ComponentHolder", align 8
  %10 = icmp ne ptr %1, null
  %11 = icmp ne ptr %2, null
  %or.cond = and i1 %10, %11
  %12 = icmp ne ptr %3, null
  %or.cond4 = and i1 %or.cond, %12
  br i1 %or.cond4, label %13, label %56

13:                                               ; preds = %6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #7
  %14 = getelementptr inbounds i8, ptr %0, i64 56
  %15 = tail call ptr @_ZNSt6vectorIN16AMFFactoryHelper15ComponentHolderESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %14) #7
  store ptr %15, ptr %7, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #7
  %16 = tail call ptr @_ZNSt6vectorIN16AMFFactoryHelper15ComponentHolderESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %14) #7
  store ptr %16, ptr %8, align 8
  %17 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPN16AMFFactoryHelper15ComponentHolderESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #7
  br i1 %17, label %.lr.ph, label %.thread37

.thread37:                                        ; preds = %26, %13
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  br label %38

.lr.ph:                                           ; preds = %13, %26
  %18 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPN16AMFFactoryHelper15ComponentHolderESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #7
  %19 = getelementptr inbounds i8, ptr %18, i64 16
  %20 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %19) #7
  %21 = call i32 @wcscmp(ptr noundef %20, ptr noundef nonnull %2) #8
  %22 = icmp eq i32 %21, 0
  br i1 %22, label %23, label %26

23:                                               ; preds = %.lr.ph
  %24 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPN16AMFFactoryHelper15ComponentHolderESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #7
  %25 = load ptr, ptr %24, align 8, !tbaa !5
  %.not = icmp eq ptr %25, null
  br i1 %.not, label %30, label %31

26:                                               ; preds = %.lr.ph
  %27 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPN16AMFFactoryHelper15ComponentHolderESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #7
  %28 = call ptr @_ZNSt6vectorIN16AMFFactoryHelper15ComponentHolderESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %14) #7
  store ptr %28, ptr %8, align 8
  %29 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPN16AMFFactoryHelper15ComponentHolderESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #7
  br i1 %29, label %.lr.ph, label %.thread37, !llvm.loop !13

30:                                               ; preds = %23
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  br label %56

31:                                               ; preds = %23
  %32 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPN16AMFFactoryHelper15ComponentHolderESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #7
  %33 = load ptr, ptr %32, align 8, !tbaa !5
  %34 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPN16AMFFactoryHelper15ComponentHolderESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #7
  %35 = getelementptr inbounds i8, ptr %34, i64 8
  %36 = call i64 @amf_atomic_inc(ptr noundef nonnull %35)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  %37 = icmp eq ptr %33, null
  br i1 %37, label %38, label %51

38:                                               ; preds = %.thread37, %31
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %9) #7
  call void @_ZN16AMFFactoryHelper15ComponentHolderC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %9)
  %39 = getelementptr inbounds i8, ptr %9, i64 8
  %40 = getelementptr inbounds i8, ptr %9, i64 16
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %9, i8 0, i64 16, i1 false)
  %41 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEaSEPKw(ptr noundef nonnull align 8 dereferenceable(32) %40, ptr noundef nonnull %2)
          to label %42 unwind label %45

42:                                               ; preds = %38
  %43 = invoke ptr @amf_load_library(ptr noundef nonnull %2)
          to label %44 unwind label %45

44:                                               ; preds = %42
  %.not33 = icmp eq ptr %43, null
  br i1 %.not33, label %.thread39, label %47

.thread39:                                        ; preds = %44
  call void @_ZN16AMFFactoryHelper15ComponentHolderD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %9) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %9) #7
  br label %56

45:                                               ; preds = %49, %47, %42, %38
  %46 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN16AMFFactoryHelper15ComponentHolderD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %9) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %9) #7
  resume { ptr, i32 } %46

47:                                               ; preds = %44
  store ptr %43, ptr %9, align 8, !tbaa !5
  %48 = invoke i64 @amf_atomic_inc(ptr noundef nonnull %39)
          to label %49 unwind label %45

49:                                               ; preds = %47
  invoke void @_ZNSt6vectorIN16AMFFactoryHelper15ComponentHolderESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %14, ptr noundef nonnull align 8 dereferenceable(48) %9)
          to label %50 unwind label %45

50:                                               ; preds = %49
  call void @_ZN16AMFFactoryHelper15ComponentHolderD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %9) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %9) #7
  br label %51

51:                                               ; preds = %50, %31
  %.126 = phi ptr [ %43, %50 ], [ %33, %31 ]
  %52 = call ptr @amf_get_proc_address(ptr noundef nonnull %.126, ptr noundef nonnull %3)
  %53 = icmp eq ptr %52, null
  br i1 %53, label %56, label %54

54:                                               ; preds = %51
  %55 = call noundef i32 %52(ptr noundef nonnull %1, ptr noundef %4, ptr noundef %5)
  br label %56

56:                                               ; preds = %.thread39, %30, %51, %54, %6
  %.4 = phi i32 [ 4, %6 ], [ 2, %30 ], [ %55, %54 ], [ 1, %51 ], [ 1, %.thread39 ]
  ret i32 %.4
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorIN16AMFFactoryHelper15ComponentHolderESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorIN16AMFFactoryHelper15ComponentHolderESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nofree nounwind willreturn memory(read)
declare i32 @wcscmp(ptr noundef, ptr noundef) local_unnamed_addr #5

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN16AMFFactoryHelper15ComponentHolderC2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #3 align 2

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

declare ptr @amf_load_library(ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIN16AMFFactoryHelper15ComponentHolderESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN16AMFFactoryHelper15ComponentHolderD2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #4 align 2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #6

attributes #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 = { 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 = { 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 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 = { mustprogress nofree nounwind willreturn memory(read) "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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #7 = { nounwind }
attributes #8 = { nounwind willreturn memory(read) }

!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, !7, i64 0}
!6 = !{!"_ZTSN16AMFFactoryHelper15ComponentHolderE", !7, i64 0, !10, i64 8, !11, i64 16}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"long", !8, i64 0}
!11 = !{!"_ZTSNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEE", !12, i64 0, !10, i64 8, !8, i64 16}
!12 = !{!"_ZTSNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE12_Alloc_hiderE", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,MemCpyOptPass,SROAPass,SimplifyCFGPass,TailCallElimPass