; LLVM IR from Razakhel/RaZ :: extern/openxr/src/loader/loader_logger.ll (ZN12LoaderLogger17RemoveLogRecorderEm)

; 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::unique_lock" = type <{ ptr, i8, [7 x i8] }>
%class.anon = type { i64 }
%"struct.std::__detail::_Node_iterator.54" = type { %"struct.std::__detail::_Node_iterator_base.55" }
%"struct.std::__detail::_Node_iterator_base.55" = type { ptr }
%class.LoaderLogger = type { %"class.std::shared_timed_mutex", %"class.std::vector.3", %"class.std::unordered_map", %class.DebugUtilsData }
%"class.std::shared_timed_mutex" = type { %"class.std::__shared_mutex_pthread" }
%"class.std::__shared_mutex_pthread" = type { %union.pthread_rwlock_t }
%union.pthread_rwlock_t = type { %struct.__pthread_rwlock_arch_t }
%struct.__pthread_rwlock_arch_t = type { i32, i32, i32, i32, i32, i32, i32, i32, i8, [7 x i8], i64, i32 }
%"class.std::vector.3" = type { %"struct.std::_Vector_base.4" }
%"struct.std::_Vector_base.4" = type { %"struct.std::_Vector_base<std::unique_ptr<LoaderLogRecorder>, std::allocator<std::unique_ptr<LoaderLogRecorder>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::unique_ptr<LoaderLogRecorder>, std::allocator<std::unique_ptr<LoaderLogRecorder>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::unique_ptr<LoaderLogRecorder>, std::allocator<std::unique_ptr<LoaderLogRecorder>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::unique_ptr<LoaderLogRecorder>, std::allocator<std::unique_ptr<LoaderLogRecorder>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::unordered_map" = type { %"class.std::_Hashtable" }
%"class.std::_Hashtable" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }
%"struct.std::__detail::_Hash_node_base" = type { ptr }
%"struct.std::__detail::_Prime_rehash_policy" = type { float, i64 }
%class.DebugUtilsData = type { %"class.std::unordered_map.13", %class.ObjectInfoCollection }
%"class.std::unordered_map.13" = type { %"class.std::_Hashtable.14" }
%"class.std::_Hashtable.14" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }
%class.ObjectInfoCollection = type { %"class.std::vector" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<XrSdkLogObjectInfo, std::allocator<XrSdkLogObjectInfo>>::_Vector_impl" }
%"struct.std::_Vector_base<XrSdkLogObjectInfo, std::allocator<XrSdkLogObjectInfo>>::_Vector_impl" = type { %"struct.std::_Vector_base<XrSdkLogObjectInfo, std::allocator<XrSdkLogObjectInfo>>::_Vector_impl_data" }
%"struct.std::_Vector_base<XrSdkLogObjectInfo, std::allocator<XrSdkLogObjectInfo>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::pair.56" = type { ptr, %"class.std::unordered_set" }
%"class.std::unordered_set" = type { %"class.std::_Hashtable.35" }
%"class.std::_Hashtable.35" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt11unique_lockISt18shared_timed_mutexEC2ERS0_(ptr noundef nonnull align 8 dereferenceable(9), ptr noundef nonnull align 8 dereferenceable(56)) unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN12LoaderLogger17RemoveLogRecorderEm(ptr noundef nonnull align 8 dereferenceable(216) %0, i64 noundef %1) #1 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca i64, align 8
  %5 = alloca %"class.std::unique_lock", align 8
  %6 = alloca %class.anon, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca %"struct.std::__detail::_Node_iterator.54", align 8
  %11 = alloca %"struct.std::__detail::_Node_iterator.54", align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store i64 %1, ptr %4, align 8, !tbaa !9
  %14 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %5) #4
  %15 = getelementptr inbounds %class.LoaderLogger, ptr %14, i32 0, i32 0
  call void @_ZNSt11unique_lockISt18shared_timed_mutexEC2ERS0_(ptr noundef nonnull align 8 dereferenceable(9) %5, ptr noundef nonnull align 8 dereferenceable(56) %15)
  %16 = getelementptr inbounds %class.LoaderLogger, ptr %14, i32 0, i32 1
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  %17 = getelementptr inbounds %class.anon, ptr %6, i32 0, i32 0
  %18 = load i64, ptr %4, align 8, !tbaa !9
  store i64 %18, ptr %17, align 8, !tbaa !11
  invoke void @"_ZL26vector_remove_if_and_eraseISt10unique_ptrI17LoaderLogRecorderSt14default_deleteIS1_EESaIS4_EZN12LoaderLogger17RemoveLogRecorderEmE3$_0EvRSt6vectorIT_T0_EOT1_"(ptr noundef nonnull align 8 dereferenceable(24) %16, ptr noundef nonnull align 8 dereferenceable(8) %6)
          to label %19 unwind label %32

19:                                               ; preds = %2
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %20 = getelementptr inbounds %class.LoaderLogger, ptr %14, i32 0, i32 2
  store ptr %20, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %21 = load ptr, ptr %9, align 8, !tbaa !5
  %22 = call ptr @_ZNSt13unordered_mapIP12XrInstance_TSt13unordered_setImSt4hashImESt8equal_toImESaImEES3_IS1_ES5_IS1_ESaISt4pairIKS1_S8_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(56) %21) #4
  %23 = getelementptr inbounds %"struct.std::__detail::_Node_iterator.54", ptr %10, i32 0, i32 0
  %24 = getelementptr inbounds %"struct.std::__detail::_Node_iterator_base.55", ptr %23, i32 0, i32 0
  store ptr %22, ptr %24, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  %25 = load ptr, ptr %9, align 8, !tbaa !5
  %26 = call ptr @_ZNSt13unordered_mapIP12XrInstance_TSt13unordered_setImSt4hashImESt8equal_toImESaImEES3_IS1_ES5_IS1_ESaISt4pairIKS1_S8_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(56) %25) #4
  %27 = getelementptr inbounds %"struct.std::__detail::_Node_iterator.54", ptr %11, i32 0, i32 0
  %28 = getelementptr inbounds %"struct.std::__detail::_Node_iterator_base.55", ptr %27, i32 0, i32 0
  store ptr %26, ptr %28, align 8
  br label %29

29:                                               ; preds = %53, %19
  %30 = call noundef zeroext i1 @_ZNSt8__detailneERKNS_19_Node_iterator_baseISt4pairIKP12XrInstance_TSt13unordered_setImSt4hashImESt8equal_toImESaImEEELb0EEESF_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %11) #4
  br i1 %30, label %36, label %31

31:                                               ; preds = %29
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  br label %55

32:                                               ; preds = %2
  %33 = landingpad { ptr, i32 }
          cleanup
  %34 = extractvalue { ptr, i32 } %33, 0
  store ptr %34, ptr %7, align 8
  %35 = extractvalue { ptr, i32 } %33, 1
  store i32 %35, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  br label %56

36:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  %37 = call noundef nonnull align 8 dereferenceable(64) ptr @_ZNKSt8__detail14_Node_iteratorISt4pairIKP12XrInstance_TSt13unordered_setImSt4hashImESt8equal_toImESaImEEELb0ELb0EEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #4
  store ptr %37, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  %38 = load ptr, ptr %12, align 8, !tbaa !5
  %39 = getelementptr inbounds %"struct.std::pair.56", ptr %38, i32 0, i32 1
  store ptr %39, ptr %13, align 8, !tbaa !5
  %40 = load ptr, ptr %13, align 8, !tbaa !5
  %41 = invoke noundef i64 @_ZNKSt13unordered_setImSt4hashImESt8equal_toImESaImEE5countERKm(ptr noundef nonnull align 8 dereferenceable(56) %40, ptr noundef nonnull align 8 dereferenceable(8) %4)
          to label %42 unwind label %48

42:                                               ; preds = %36
  %43 = icmp ugt i64 %41, 0
  br i1 %43, label %44, label %52

44:                                               ; preds = %42
  %45 = load ptr, ptr %13, align 8, !tbaa !5
  %46 = invoke noundef i64 @_ZNSt13unordered_setImSt4hashImESt8equal_toImESaImEE5eraseERKm(ptr noundef nonnull align 8 dereferenceable(56) %45, ptr noundef nonnull align 8 dereferenceable(8) %4)
          to label %47 unwind label %48

47:                                               ; preds = %44
  br label %52

48:                                               ; preds = %44, %36
  %49 = landingpad { ptr, i32 }
          cleanup
  %50 = extractvalue { ptr, i32 } %49, 0
  store ptr %50, ptr %7, align 8
  %51 = extractvalue { ptr, i32 } %49, 1
  store i32 %51, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  br label %56

52:                                               ; preds = %47, %42
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  br label %53

53:                                               ; preds = %52
  %54 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt8__detail14_Node_iteratorISt4pairIKP12XrInstance_TSt13unordered_setImSt4hashImESt8equal_toImESaImEEELb0ELb0EEppEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #4
  br label %29

55:                                               ; preds = %31
  call void @_ZNSt11unique_lockISt18shared_timed_mutexED2Ev(ptr noundef nonnull align 8 dereferenceable(9) %5) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %5) #4
  ret void

56:                                               ; preds = %48, %32
  call void @_ZNSt11unique_lockISt18shared_timed_mutexED2Ev(ptr noundef nonnull align 8 dereferenceable(9) %5) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %5) #4
  br label %57

57:                                               ; preds = %56
  %58 = load ptr, ptr %7, align 8
  %59 = load i32, ptr %8, align 4
  %60 = insertvalue { ptr, i32 } poison, ptr %58, 0
  %61 = insertvalue { ptr, i32 } %60, i32 %59, 1
  resume { ptr, i32 } %61
}

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZL26vector_remove_if_and_eraseISt10unique_ptrI17LoaderLogRecorderSt14default_deleteIS1_EESaIS4_EZN12LoaderLogger17RemoveLogRecorderEmE3$_0EvRSt6vectorIT_T0_EOT1_"(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(8)) #3

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZNKSt13unordered_setImSt4hashImESt8equal_toImESaImEE5countERKm(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 8 dereferenceable(8)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZNSt13unordered_setImSt4hashImESt8equal_toImESaImEE5eraseERKm(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 8 dereferenceable(8)) #1 align 2

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 = { 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 = !{!"long", !7, i64 0}
!11 = !{!12, !10, i64 0}
!12 = !{!"_ZTSZN12LoaderLogger17RemoveLogRecorderEmE3$_0", !10, i64 0}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::unique_lock" = type <{ ptr, i8, [7 x i8] }>
%class.anon = type { i64 }
%"struct.std::__detail::_Node_iterator.54" = type { %"struct.std::__detail::_Node_iterator_base.55" }
%"struct.std::__detail::_Node_iterator_base.55" = type { ptr }

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt11unique_lockISt18shared_timed_mutexEC2ERS0_(ptr noundef nonnull align 8 dereferenceable(9), ptr noundef nonnull align 8 dereferenceable(56)) unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN12LoaderLogger17RemoveLogRecorderEm(ptr noundef nonnull align 8 dereferenceable(216) %0, i64 noundef %1) local_unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca i64, align 8
  %4 = alloca %"class.std::unique_lock", align 8
  %5 = alloca %class.anon, align 8
  %6 = alloca %"struct.std::__detail::_Node_iterator.54", align 8
  %7 = alloca %"struct.std::__detail::_Node_iterator.54", align 8
  store i64 %1, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #4
  call void @_ZNSt11unique_lockISt18shared_timed_mutexEC2ERS0_(ptr noundef nonnull align 8 dereferenceable(9) %4, ptr noundef nonnull align 8 dereferenceable(56) %0)
  %8 = getelementptr inbounds i8, ptr %0, i64 56
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #4
  store i64 %1, ptr %5, align 8, !tbaa !9
  invoke void @"_ZL26vector_remove_if_and_eraseISt10unique_ptrI17LoaderLogRecorderSt14default_deleteIS1_EESaIS4_EZN12LoaderLogger17RemoveLogRecorderEmE3$_0EvRSt6vectorIT_T0_EOT1_"(ptr noundef nonnull align 8 dereferenceable(24) %8, ptr noundef nonnull align 8 dereferenceable(8) %5)
          to label %9 unwind label %14

9:                                                ; preds = %2
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #4
  %10 = getelementptr inbounds i8, ptr %0, i64 80
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #4
  %11 = call ptr @_ZNSt13unordered_mapIP12XrInstance_TSt13unordered_setImSt4hashImESt8equal_toImESaImEES3_IS1_ES5_IS1_ESaISt4pairIKS1_S8_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(56) %10) #4
  store ptr %11, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #4
  %12 = call ptr @_ZNSt13unordered_mapIP12XrInstance_TSt13unordered_setImSt4hashImESt8equal_toImESaImEES3_IS1_ES5_IS1_ESaISt4pairIKS1_S8_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(56) %10) #4
  store ptr %12, ptr %7, align 8
  %13 = call noundef zeroext i1 @_ZNSt8__detailneERKNS_19_Node_iterator_baseISt4pairIKP12XrInstance_TSt13unordered_setImSt4hashImESt8equal_toImESaImEEELb0EEESF_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7) #4
  br i1 %13, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %24, %9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  call void @_ZNSt11unique_lockISt18shared_timed_mutexED2Ev(ptr noundef nonnull align 8 dereferenceable(9) %4) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #4
  ret void

14:                                               ; preds = %2
  %15 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #4
  br label %27

.lr.ph:                                           ; preds = %9, %24
  %16 = call noundef nonnull align 8 dereferenceable(64) ptr @_ZNKSt8__detail14_Node_iteratorISt4pairIKP12XrInstance_TSt13unordered_setImSt4hashImESt8equal_toImESaImEEELb0ELb0EEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #4
  %17 = getelementptr inbounds i8, ptr %16, i64 8
  %18 = invoke noundef i64 @_ZNKSt13unordered_setImSt4hashImESt8equal_toImESaImEE5countERKm(ptr noundef nonnull align 8 dereferenceable(56) %17, ptr noundef nonnull align 8 dereferenceable(8) %3)
          to label %19 unwind label %22

19:                                               ; preds = %.lr.ph
  %.not = icmp eq i64 %18, 0
  br i1 %.not, label %24, label %20

20:                                               ; preds = %19
  %21 = invoke noundef i64 @_ZNSt13unordered_setImSt4hashImESt8equal_toImESaImEE5eraseERKm(ptr noundef nonnull align 8 dereferenceable(56) %17, ptr noundef nonnull align 8 dereferenceable(8) %3)
          to label %24 unwind label %22

22:                                               ; preds = %20, %.lr.ph
  %23 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  br label %27

24:                                               ; preds = %20, %19
  %25 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt8__detail14_Node_iteratorISt4pairIKP12XrInstance_TSt13unordered_setImSt4hashImESt8equal_toImESaImEEELb0ELb0EEppEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #4
  %26 = call noundef zeroext i1 @_ZNSt8__detailneERKNS_19_Node_iterator_baseISt4pairIKP12XrInstance_TSt13unordered_setImSt4hashImESt8equal_toImESaImEEELb0EEESF_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7) #4
  br i1 %26, label %.lr.ph, label %._crit_edge

27:                                               ; preds = %22, %14
  %.pn = phi { ptr, i32 } [ %23, %22 ], [ %15, %14 ]
  call void @_ZNSt11unique_lockISt18shared_timed_mutexED2Ev(ptr noundef nonnull align 8 dereferenceable(9) %4) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #4
  resume { ptr, i32 } %.pn
}

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZL26vector_remove_if_and_eraseISt10unique_ptrI17LoaderLogRecorderSt14default_deleteIS1_EESaIS4_EZN12LoaderLogger17RemoveLogRecorderEmE3$_0EvRSt6vectorIT_T0_EOT1_"(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZNKSt13unordered_setImSt4hashImESt8equal_toImESaImEE5countERKm(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZNSt13unordered_setImSt4hashImESt8equal_toImESaImEE5eraseERKm(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1 align 2

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 = { 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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 0}
!10 = !{!"_ZTSZN12LoaderLogger17RemoveLogRecorderEmE3$_0", !6, i64 0}


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