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

; 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 }
%"class.__gnu_cxx::__normal_iterator.3" = type { ptr }
%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 }
%"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] }

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

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

declare i64 @amf_atomic_dec(ptr noundef) #1

declare i32 @amf_free_library(ptr noundef) #1

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNKSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32)) #2 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)) #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN16AMFFactoryHelper23UnLoadExternalComponentEPKw(ptr noundef nonnull align 8 dereferenceable(80) %0, ptr noundef %1) #5 align 2 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %7 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %8 = alloca i32, align 4
  %9 = alloca %"class.__gnu_cxx::__normal_iterator.3", align 8
  %10 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %11 = load ptr, ptr %4, align 8
  %12 = load ptr, ptr %5, align 8, !tbaa !5
  %13 = icmp ne ptr %12, null
  br i1 %13, label %15, label %14

14:                                               ; preds = %2
  store i32 4, ptr %3, align 4
  br label %63

15:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  %16 = getelementptr inbounds %class.AMFFactoryHelper, ptr %11, i32 0, i32 7
  %17 = call ptr @_ZNSt6vectorIN16AMFFactoryHelper15ComponentHolderESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %16) #6
  %18 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %6, i32 0, i32 0
  store ptr %17, ptr %18, align 8
  br label %19

19:                                               ; preds = %58, %15
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %20 = getelementptr inbounds %class.AMFFactoryHelper, ptr %11, i32 0, i32 7
  %21 = call ptr @_ZNSt6vectorIN16AMFFactoryHelper15ComponentHolderESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %20) #6
  %22 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %7, i32 0, i32 0
  store ptr %21, ptr %22, align 8
  %23 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPN16AMFFactoryHelper15ComponentHolderESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  br i1 %23, label %25, label %24

24:                                               ; preds = %19
  store i32 2, ptr %8, align 4
  br label %60

25:                                               ; preds = %19
  %26 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPN16AMFFactoryHelper15ComponentHolderESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #6
  %27 = getelementptr inbounds %"struct.AMFFactoryHelper::ComponentHolder", ptr %26, i32 0, i32 2
  %28 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %27) #6
  %29 = load ptr, ptr %5, align 8, !tbaa !5
  %30 = call i32 @wcscmp(ptr noundef %28, ptr noundef %29) #7
  %31 = icmp eq i32 %30, 0
  br i1 %31, label %32, label %57

32:                                               ; preds = %25
  %33 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPN16AMFFactoryHelper15ComponentHolderESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #6
  %34 = getelementptr inbounds %"struct.AMFFactoryHelper::ComponentHolder", ptr %33, i32 0, i32 0
  %35 = load ptr, ptr %34, align 8, !tbaa !9
  %36 = icmp eq ptr %35, null
  br i1 %36, label %37, label %38

37:                                               ; preds = %32
  store i32 2, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %60

38:                                               ; preds = %32
  %39 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPN16AMFFactoryHelper15ComponentHolderESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #6
  %40 = getelementptr inbounds %"struct.AMFFactoryHelper::ComponentHolder", ptr %39, i32 0, i32 1
  %41 = call i64 @amf_atomic_dec(ptr noundef %40)
  %42 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPN16AMFFactoryHelper15ComponentHolderESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #6
  %43 = getelementptr inbounds %"struct.AMFFactoryHelper::ComponentHolder", ptr %42, i32 0, i32 1
  %44 = load i64, ptr %43, align 8, !tbaa !14
  %45 = icmp eq i64 %44, 0
  br i1 %45, label %46, label %56

46:                                               ; preds = %38
  %47 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPN16AMFFactoryHelper15ComponentHolderESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #6
  %48 = getelementptr inbounds %"struct.AMFFactoryHelper::ComponentHolder", ptr %47, i32 0, i32 0
  %49 = load ptr, ptr %48, align 8, !tbaa !9
  %50 = call i32 @amf_free_library(ptr noundef %49)
  %51 = getelementptr inbounds %class.AMFFactoryHelper, ptr %11, i32 0, i32 7
  call void @_ZN9__gnu_cxx17__normal_iteratorIPKN16AMFFactoryHelper15ComponentHolderESt6vectorIS2_SaIS2_EEEC2IPS2_vEERKNS0_IT_S7_EE(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %6) #6
  %52 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.3", ptr %9, i32 0, i32 0
  %53 = load ptr, ptr %52, align 8
  %54 = call ptr @_ZNSt6vectorIN16AMFFactoryHelper15ComponentHolderESaIS1_EE5eraseEN9__gnu_cxx17__normal_iteratorIPKS1_S3_EE(ptr noundef nonnull align 8 dereferenceable(24) %51, ptr %53)
  %55 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %10, i32 0, i32 0
  store ptr %54, ptr %55, align 8
  br label %56

56:                                               ; preds = %46, %38
  store i32 2, ptr %8, align 4
  br label %60

57:                                               ; preds = %25
  br label %58

58:                                               ; preds = %57
  %59 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPN16AMFFactoryHelper15ComponentHolderESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #6
  br label %19, !llvm.loop !15

60:                                               ; preds = %56, %37, %24
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  %61 = load i32, ptr %8, align 4
  switch i32 %61, label %65 [
    i32 2, label %62
    i32 1, label %63
  ]

62:                                               ; preds = %60
  store i32 0, ptr %3, align 4
  br label %63

63:                                               ; preds = %62, %60, %14
  %64 = load i32, ptr %3, align 4
  ret i32 %64

65:                                               ; preds = %60
  unreachable
}

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 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 = { 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 #5 = { 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 #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 = !{!10, !11, i64 8}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}


; 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 }
%"class.__gnu_cxx::__normal_iterator.3" = type { ptr }

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

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

declare i64 @amf_atomic_dec(ptr noundef) local_unnamed_addr #1

declare i32 @amf_free_library(ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorIN16AMFFactoryHelper15ComponentHolderESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2 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 #3

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef range(i32 0, 5) i32 @_ZN16AMFFactoryHelper23UnLoadExternalComponentEPKw(ptr noundef nonnull align 8 dereferenceable(80) %0, ptr noundef readonly %1) local_unnamed_addr #5 align 2 {
  %3 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %4 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %5 = alloca %"class.__gnu_cxx::__normal_iterator.3", align 8
  %.not = icmp eq ptr %1, null
  br i1 %.not, label %38, label %6

6:                                                ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  %7 = getelementptr inbounds i8, ptr %0, i64 56
  %8 = tail call ptr @_ZNSt6vectorIN16AMFFactoryHelper15ComponentHolderESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #6
  store ptr %8, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  %9 = tail call ptr @_ZNSt6vectorIN16AMFFactoryHelper15ComponentHolderESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #6
  store ptr %9, ptr %4, align 8
  %10 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPN16AMFFactoryHelper15ComponentHolderESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  br i1 %10, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %6, %34
  %11 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPN16AMFFactoryHelper15ComponentHolderESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  %12 = getelementptr inbounds i8, ptr %11, i64 16
  %13 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %12) #6
  %14 = call i32 @wcscmp(ptr noundef %13, ptr noundef nonnull %1) #7
  %15 = icmp eq i32 %14, 0
  br i1 %15, label %16, label %34

16:                                               ; preds = %.lr.ph
  %17 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPN16AMFFactoryHelper15ComponentHolderESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  %18 = load ptr, ptr %17, align 8, !tbaa !5
  %19 = icmp eq ptr %18, null
  br i1 %19, label %.loopexit, label %20

20:                                               ; preds = %16
  %21 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPN16AMFFactoryHelper15ComponentHolderESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  %22 = getelementptr inbounds i8, ptr %21, i64 8
  %23 = call i64 @amf_atomic_dec(ptr noundef nonnull %22)
  %24 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPN16AMFFactoryHelper15ComponentHolderESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  %25 = getelementptr inbounds i8, ptr %24, i64 8
  %26 = load i64, ptr %25, align 8, !tbaa !13
  %27 = icmp eq i64 %26, 0
  br i1 %27, label %28, label %.loopexit

28:                                               ; preds = %20
  %29 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPN16AMFFactoryHelper15ComponentHolderESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  %30 = load ptr, ptr %29, align 8, !tbaa !5
  %31 = call i32 @amf_free_library(ptr noundef %30)
  call void @_ZN9__gnu_cxx17__normal_iteratorIPKN16AMFFactoryHelper15ComponentHolderESt6vectorIS2_SaIS2_EEEC2IPS2_vEERKNS0_IT_S7_EE(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  %32 = load ptr, ptr %5, align 8
  %33 = call ptr @_ZNSt6vectorIN16AMFFactoryHelper15ComponentHolderESaIS1_EE5eraseEN9__gnu_cxx17__normal_iteratorIPKS1_S3_EE(ptr noundef nonnull align 8 dereferenceable(24) %7, ptr %32)
  br label %.loopexit

34:                                               ; preds = %.lr.ph
  %35 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPN16AMFFactoryHelper15ComponentHolderESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  %36 = call ptr @_ZNSt6vectorIN16AMFFactoryHelper15ComponentHolderESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #6
  store ptr %36, ptr %4, align 8
  %37 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPN16AMFFactoryHelper15ComponentHolderESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  br i1 %37, label %.lr.ph, label %.loopexit, !llvm.loop !14

.loopexit:                                        ; preds = %34, %6, %20, %28, %16
  %switch = phi i32 [ 2, %16 ], [ 0, %28 ], [ 0, %20 ], [ 0, %6 ], [ 0, %34 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  br label %38

38:                                               ; preds = %.loopexit, %2
  %.1 = phi i32 [ 4, %2 ], [ %switch, %.loopexit ]
  ret i32 %.1
}

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 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 = { 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 #5 = { 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 #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, !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 = !{!6, !10, i64 8}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}


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