; LLVM IR from BabitMF/bmf :: bmf_lite/src/media/video_buffer (video_buffer_pool)

; 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::shared_ptr.8" = type { %"class.std::__shared_ptr.9" }
%"class.std::__shared_ptr.9" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%"class.__gnu_cxx::__normal_iterator.11" = type { ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%"class.std::shared_ptr.0" = type { %"class.std::__shared_ptr.1" }
%"class.std::__shared_ptr.1" = type { ptr, %"class.std::__shared_count" }
%class.anon = type { i8 }
%"class.bmf_lite::VideoBufferPool" = type { %"class.bmf_lite::Pool", i32, i32, %"class.bmf_lite::HardwareDataInfo", i32, %"class.std::vector", %"class.std::vector.3", %"class.std::shared_ptr.0", %"class.std::shared_ptr" }
%"class.bmf_lite::Pool" = type { ptr }
%"class.bmf_lite::HardwareDataInfo" = type { i32, i32, i32, i32, i32 }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<bmf_lite::VideoBuffer *, std::allocator<bmf_lite::VideoBuffer *>>::_Vector_impl" }
%"struct.std::_Vector_base<bmf_lite::VideoBuffer *, std::allocator<bmf_lite::VideoBuffer *>>::_Vector_impl" = type { %"struct.std::_Vector_base<bmf_lite::VideoBuffer *, std::allocator<bmf_lite::VideoBuffer *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<bmf_lite::VideoBuffer *, std::allocator<bmf_lite::VideoBuffer *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.3" = type { %"struct.std::_Vector_base.4" }
%"struct.std::_Vector_base.4" = type { %"struct.std::_Vector_base<std::shared_ptr<bmf_lite::VideoBuffer>, std::allocator<std::shared_ptr<bmf_lite::VideoBuffer>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::shared_ptr<bmf_lite::VideoBuffer>, std::allocator<std::shared_ptr<bmf_lite::VideoBuffer>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::shared_ptr<bmf_lite::VideoBuffer>, std::allocator<std::shared_ptr<bmf_lite::VideoBuffer>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::shared_ptr<bmf_lite::VideoBuffer>, std::allocator<std::shared_ptr<bmf_lite::VideoBuffer>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::shared_ptr" = type { %"class.std::__shared_ptr" }
%"class.std::__shared_ptr" = type { ptr, %"class.std::__shared_count" }

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

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

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

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

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) #1

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN8bmf_lite15VideoBufferPool13acquireObjectEv(ptr dead_on_unwind noalias writable sret(%"class.std::shared_ptr.8") align 8 %0, ptr noundef nonnull align 8 dereferenceable(120) %1) #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i1, align 1
  %6 = alloca %"class.__gnu_cxx::__normal_iterator.11", align 8
  %7 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %11 = alloca ptr, align 8
  %12 = alloca %"class.std::shared_ptr.0", align 8
  %13 = alloca i1, align 1
  %14 = alloca %class.anon, align 1
  %15 = alloca i32, align 4
  store ptr %0, ptr %3, align 8
  store ptr %1, ptr %4, align 8, !tbaa !5
  %16 = load ptr, ptr %4, align 8
  %17 = getelementptr inbounds %"class.bmf_lite::VideoBufferPool", ptr %16, i32 0, i32 6
  %18 = call noundef i64 @_ZNKSt6vectorISt10shared_ptrIN8bmf_lite11VideoBufferEESaIS3_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %17) #3
  %19 = icmp ugt i64 %18, 0
  br i1 %19, label %20, label %39

20:                                               ; preds = %2
  store i1 false, ptr %5, align 1
  %21 = getelementptr inbounds %"class.bmf_lite::VideoBufferPool", ptr %16, i32 0, i32 6
  %22 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt10shared_ptrIN8bmf_lite11VideoBufferEESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %21, i64 noundef 0) #3
  call void @_ZNSt10shared_ptrIN8bmf_lite11VideoBufferEEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef nonnull align 8 dereferenceable(16) %22) #3
  %23 = getelementptr inbounds %"class.bmf_lite::VideoBufferPool", ptr %16, i32 0, i32 6
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  %24 = getelementptr inbounds %"class.bmf_lite::VideoBufferPool", ptr %16, i32 0, i32 6
  %25 = call ptr @_ZNSt6vectorISt10shared_ptrIN8bmf_lite11VideoBufferEESaIS3_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %24) #3
  %26 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %7, i32 0, i32 0
  store ptr %25, ptr %26, align 8
  call void @_ZN9__gnu_cxx17__normal_iteratorIPKSt10shared_ptrIN8bmf_lite11VideoBufferEESt6vectorIS4_SaIS4_EEEC2IPS4_vEERKNS0_IT_S9_EE(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7) #3
  %27 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.11", ptr %6, i32 0, i32 0
  %28 = load ptr, ptr %27, align 8
  %29 = invoke ptr @_ZNSt6vectorISt10shared_ptrIN8bmf_lite11VideoBufferEESaIS3_EE5eraseEN9__gnu_cxx17__normal_iteratorIPKS3_S5_EE(ptr noundef nonnull align 8 dereferenceable(24) %23, ptr %28)
          to label %30 unwind label %33

30:                                               ; preds = %20
  %31 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %10, i32 0, i32 0
  store ptr %29, ptr %31, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  store i1 true, ptr %5, align 1
  %32 = load i1, ptr %5, align 1
  br i1 %32, label %38, label %37

33:                                               ; preds = %20
  %34 = landingpad { ptr, i32 }
          cleanup
  %35 = extractvalue { ptr, i32 } %34, 0
  store ptr %35, ptr %8, align 8
  %36 = extractvalue { ptr, i32 } %34, 1
  store i32 %36, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  call void @_ZNSt12__shared_ptrIN8bmf_lite11VideoBufferELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %0) #3
  br label %87

37:                                               ; preds = %30
  call void @_ZNSt12__shared_ptrIN8bmf_lite11VideoBufferELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %0) #3
  br label %38

38:                                               ; preds = %37, %30
  br label %86

39:                                               ; preds = %2
  %40 = getelementptr inbounds %"class.bmf_lite::VideoBufferPool", ptr %16, i32 0, i32 5
  %41 = call noundef i64 @_ZNKSt6vectorIPN8bmf_lite11VideoBufferESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %40) #3
  %42 = getelementptr inbounds %"class.bmf_lite::VideoBufferPool", ptr %16, i32 0, i32 4
  %43 = load i32, ptr %42, align 4, !tbaa !9
  %44 = sext i32 %43 to i64
  %45 = icmp uge i64 %41, %44
  br i1 %45, label %46, label %47

46:                                               ; preds = %39
  call void @_ZNSt10shared_ptrIN8bmf_lite11VideoBufferEEC2EDn(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr null) #3
  br label %86

47:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  store ptr null, ptr %11, align 8, !tbaa !5
  %48 = getelementptr inbounds %"class.bmf_lite::VideoBufferPool", ptr %16, i32 0, i32 8
  %49 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN8bmf_lite20VideoBufferAllocatorELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %48) #3
  %50 = getelementptr inbounds %"class.bmf_lite::VideoBufferPool", ptr %16, i32 0, i32 1
  %51 = load i32, ptr %50, align 8, !tbaa !28
  %52 = getelementptr inbounds %"class.bmf_lite::VideoBufferPool", ptr %16, i32 0, i32 2
  %53 = load i32, ptr %52, align 4, !tbaa !29
  %54 = getelementptr inbounds %"class.bmf_lite::VideoBufferPool", ptr %16, i32 0, i32 3
  %55 = getelementptr inbounds %"class.bmf_lite::VideoBufferPool", ptr %16, i32 0, i32 7
  call void @_ZNSt10shared_ptrIN8bmf_lite15HWDeviceContextEEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(16) %12, ptr noundef nonnull align 8 dereferenceable(16) %55) #3
  %56 = load ptr, ptr %49, align 8, !tbaa !30
  %57 = getelementptr inbounds ptr, ptr %56, i64 2
  %58 = load ptr, ptr %57, align 8
  %59 = invoke noundef i32 %58(ptr noundef nonnull align 8 dereferenceable(8) %49, i32 noundef %51, i32 noundef %53, ptr noundef %54, ptr noundef %12, ptr noundef nonnull align 8 dereferenceable(8) %11)
          to label %60 unwind label %69

60:                                               ; preds = %47
  %61 = icmp eq i32 %59, 0
  call void @_ZNSt12__shared_ptrIN8bmf_lite15HWDeviceContextELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %12) #3
  br i1 %61, label %62, label %79

62:                                               ; preds = %60
  store i1 false, ptr %13, align 1
  %63 = load ptr, ptr %11, align 8, !tbaa !5
  call void @"_ZNSt10shared_ptrIN8bmf_lite11VideoBufferEEC2IS1_ZNS0_15VideoBufferPool13acquireObjectEvE3$_0vEEPT_T0_"(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef %63)
  %64 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN8bmf_lite11VideoBufferELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %0) #3
  invoke void @_ZN8bmf_lite11VideoBuffer7setPoolEPNS_4PoolE(ptr noundef nonnull align 8 dereferenceable(76) %64, ptr noundef %16)
          to label %65 unwind label %73

65:                                               ; preds = %62
  %66 = getelementptr inbounds %"class.bmf_lite::VideoBufferPool", ptr %16, i32 0, i32 5
  invoke void @_ZNSt6vectorIPN8bmf_lite11VideoBufferESaIS2_EE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %66, ptr noundef nonnull align 8 dereferenceable(8) %11)
          to label %67 unwind label %73

67:                                               ; preds = %65
  store i1 true, ptr %13, align 1
  store i32 1, ptr %15, align 4
  %68 = load i1, ptr %13, align 1
  br i1 %68, label %78, label %77

69:                                               ; preds = %47
  %70 = landingpad { ptr, i32 }
          cleanup
  %71 = extractvalue { ptr, i32 } %70, 0
  store ptr %71, ptr %8, align 8
  %72 = extractvalue { ptr, i32 } %70, 1
  store i32 %72, ptr %9, align 4
  call void @_ZNSt12__shared_ptrIN8bmf_lite15HWDeviceContextELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %12) #3
  br label %83

73:                                               ; preds = %65, %62
  %74 = landingpad { ptr, i32 }
          cleanup
  %75 = extractvalue { ptr, i32 } %74, 0
  store ptr %75, ptr %8, align 8
  %76 = extractvalue { ptr, i32 } %74, 1
  store i32 %76, ptr %9, align 4
  call void @_ZNSt12__shared_ptrIN8bmf_lite11VideoBufferELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %0) #3
  br label %83

77:                                               ; preds = %67
  call void @_ZNSt12__shared_ptrIN8bmf_lite11VideoBufferELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %0) #3
  br label %78

78:                                               ; preds = %77, %67
  br label %80

79:                                               ; preds = %60
  store i32 0, ptr %15, align 4
  br label %80

80:                                               ; preds = %79, %78
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  %81 = load i32, ptr %15, align 4
  switch i32 %81, label %92 [
    i32 0, label %82
    i32 1, label %86
  ]

82:                                               ; preds = %80
  br label %84

83:                                               ; preds = %73, %69
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  br label %87

84:                                               ; preds = %82
  br label %85

85:                                               ; preds = %84
  call void @_ZNSt10shared_ptrIN8bmf_lite11VideoBufferEEC2EDn(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr null) #3
  br label %86

86:                                               ; preds = %85, %80, %46, %38
  ret void

87:                                               ; preds = %83, %33
  %88 = load ptr, ptr %8, align 8
  %89 = load i32, ptr %9, align 4
  %90 = insertvalue { ptr, i32 } poison, ptr %88, 0
  %91 = insertvalue { ptr, i32 } %90, i32 %89, 1
  resume { ptr, i32 } %91

92:                                               ; preds = %80
  unreachable
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt10shared_ptrIN8bmf_lite11VideoBufferEESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #0 align 2

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNKSt19__shared_ptr_accessIN8bmf_lite20VideoBufferAllocatorELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1)) #0 align 2

; Function Attrs: mustprogress uwtable
declare hidden void @"_ZNSt10shared_ptrIN8bmf_lite11VideoBufferEEC2IS1_ZNS0_15VideoBufferPool13acquireObjectEvE3$_0vEEPT_T0_"(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNKSt19__shared_ptr_accessIN8bmf_lite11VideoBufferELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1)) #0 align 2

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

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

attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { 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 = { 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, !12, i64 36}
!10 = !{!"_ZTSN8bmf_lite15VideoBufferPoolE", !11, i64 0, !12, i64 8, !12, i64 12, !13, i64 16, !12, i64 36, !15, i64 40, !19, i64 64, !23, i64 88, !26, i64 104}
!11 = !{!"_ZTSN8bmf_lite4PoolE"}
!12 = !{!"int", !7, i64 0}
!13 = !{!"_ZTSN8bmf_lite16HardwareDataInfoE", !14, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !12, i64 16}
!14 = !{!"_ZTSN8bmf_lite10MemoryTypeE", !7, i64 0}
!15 = !{!"_ZTSSt6vectorIPN8bmf_lite11VideoBufferESaIS2_EE", !16, i64 0}
!16 = !{!"_ZTSSt12_Vector_baseIPN8bmf_lite11VideoBufferESaIS2_EE", !17, i64 0}
!17 = !{!"_ZTSNSt12_Vector_baseIPN8bmf_lite11VideoBufferESaIS2_EE12_Vector_implE", !18, i64 0}
!18 = !{!"_ZTSNSt12_Vector_baseIPN8bmf_lite11VideoBufferESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!19 = !{!"_ZTSSt6vectorISt10shared_ptrIN8bmf_lite11VideoBufferEESaIS3_EE", !20, i64 0}
!20 = !{!"_ZTSSt12_Vector_baseISt10shared_ptrIN8bmf_lite11VideoBufferEESaIS3_EE", !21, i64 0}
!21 = !{!"_ZTSNSt12_Vector_baseISt10shared_ptrIN8bmf_lite11VideoBufferEESaIS3_EE12_Vector_implE", !22, i64 0}
!22 = !{!"_ZTSNSt12_Vector_baseISt10shared_ptrIN8bmf_lite11VideoBufferEESaIS3_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!23 = !{!"_ZTSSt10shared_ptrIN8bmf_lite15HWDeviceContextEE", !24, i64 0}
!24 = !{!"_ZTSSt12__shared_ptrIN8bmf_lite15HWDeviceContextELN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0, !25, i64 8}
!25 = !{!"_ZTSSt14__shared_countILN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0}
!26 = !{!"_ZTSSt10shared_ptrIN8bmf_lite20VideoBufferAllocatorEE", !27, i64 0}
!27 = !{!"_ZTSSt12__shared_ptrIN8bmf_lite20VideoBufferAllocatorELN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0, !25, i64 8}
!28 = !{!10, !12, i64 8}
!29 = !{!10, !12, i64 12}
!30 = !{!31, !31, i64 0}
!31 = !{!"vtable pointer", !8, 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::shared_ptr.8" = type { %"class.std::__shared_ptr.9" }
%"class.std::__shared_ptr.9" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%"class.__gnu_cxx::__normal_iterator.11" = type { ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%"class.std::shared_ptr.0" = type { %"class.std::__shared_ptr.1" }
%"class.std::__shared_ptr.1" = type { ptr, %"class.std::__shared_count" }

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN8bmf_lite11VideoBuffer7setPoolEPNS_4PoolE(ptr noundef nonnull align 8 dereferenceable(76), ptr noundef) local_unnamed_addr #0 align 2

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) #1

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN8bmf_lite15VideoBufferPool13acquireObjectEv(ptr dead_on_unwind noalias writable sret(%"class.std::shared_ptr.8") align 8 %0, ptr noundef nonnull align 8 dereferenceable(120) %1) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.__gnu_cxx::__normal_iterator.11", align 8
  %4 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %5 = alloca ptr, align 8
  %6 = alloca %"class.std::shared_ptr.0", align 8
  %7 = getelementptr inbounds i8, ptr %1, i64 64
  %8 = tail call noundef i64 @_ZNKSt6vectorISt10shared_ptrIN8bmf_lite11VideoBufferEESaIS3_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #3
  %.not = icmp eq i64 %8, 0
  br i1 %.not, label %17, label %9

9:                                                ; preds = %2
  %10 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt10shared_ptrIN8bmf_lite11VideoBufferEESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef 0) #3
  tail call void @_ZNSt10shared_ptrIN8bmf_lite11VideoBufferEEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef nonnull align 8 dereferenceable(16) %10) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #3
  %11 = tail call ptr @_ZNSt6vectorISt10shared_ptrIN8bmf_lite11VideoBufferEESaIS3_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #3
  store ptr %11, ptr %4, align 8
  call void @_ZN9__gnu_cxx17__normal_iteratorIPKSt10shared_ptrIN8bmf_lite11VideoBufferEESt6vectorIS4_SaIS4_EEEC2IPS4_vEERKNS0_IT_S9_EE(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #3
  %12 = load ptr, ptr %3, align 8
  %13 = invoke ptr @_ZNSt6vectorISt10shared_ptrIN8bmf_lite11VideoBufferEESaIS3_EE5eraseEN9__gnu_cxx17__normal_iteratorIPKS3_S5_EE(ptr noundef nonnull align 8 dereferenceable(24) %7, ptr %12)
          to label %14 unwind label %15

14:                                               ; preds = %9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #3
  br label %49

15:                                               ; preds = %9
  %16 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #3
  call void @_ZNSt12__shared_ptrIN8bmf_lite11VideoBufferELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %0) #3
  br label %50

17:                                               ; preds = %2
  %18 = getelementptr inbounds i8, ptr %1, i64 40
  %19 = tail call noundef i64 @_ZNKSt6vectorIPN8bmf_lite11VideoBufferESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %18) #3
  %20 = getelementptr inbounds i8, ptr %1, i64 36
  %21 = load i32, ptr %20, align 4, !tbaa !5
  %22 = sext i32 %21 to i64
  %.not8 = icmp ult i64 %19, %22
  br i1 %.not8, label %24, label %23

23:                                               ; preds = %17
  tail call void @_ZNSt10shared_ptrIN8bmf_lite11VideoBufferEEC2EDn(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr null) #3
  br label %49

24:                                               ; preds = %17
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #3
  store ptr null, ptr %5, align 8, !tbaa !27
  %25 = getelementptr inbounds i8, ptr %1, i64 104
  %26 = tail call noundef ptr @_ZNKSt19__shared_ptr_accessIN8bmf_lite20VideoBufferAllocatorELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %25) #3
  %27 = getelementptr inbounds i8, ptr %1, i64 8
  %28 = load i32, ptr %27, align 8, !tbaa !28
  %29 = getelementptr inbounds i8, ptr %1, i64 12
  %30 = load i32, ptr %29, align 4, !tbaa !29
  %31 = getelementptr inbounds i8, ptr %1, i64 16
  %32 = getelementptr inbounds i8, ptr %1, i64 88
  call void @_ZNSt10shared_ptrIN8bmf_lite15HWDeviceContextEEC2ERKS2_(ptr noundef nonnull align 8 dereferenceable(16) %6, ptr noundef nonnull align 8 dereferenceable(16) %32) #3
  %33 = load ptr, ptr %26, align 8, !tbaa !30
  %34 = getelementptr inbounds i8, ptr %33, i64 16
  %35 = load ptr, ptr %34, align 8
  %36 = invoke noundef i32 %35(ptr noundef nonnull align 8 dereferenceable(8) %26, i32 noundef %28, i32 noundef %30, ptr noundef nonnull %31, ptr noundef nonnull %6, ptr noundef nonnull align 8 dereferenceable(8) %5)
          to label %37 unwind label %42

37:                                               ; preds = %24
  %38 = icmp eq i32 %36, 0
  call void @_ZNSt12__shared_ptrIN8bmf_lite15HWDeviceContextELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %6) #3
  br i1 %38, label %39, label %48

39:                                               ; preds = %37
  %40 = load ptr, ptr %5, align 8, !tbaa !27
  call void @"_ZNSt10shared_ptrIN8bmf_lite11VideoBufferEEC2IS1_ZNS0_15VideoBufferPool13acquireObjectEvE3$_0vEEPT_T0_"(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef %40)
  %41 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN8bmf_lite11VideoBufferELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %0) #3
  call void @_ZN8bmf_lite11VideoBuffer7setPoolEPNS_4PoolE(ptr noundef nonnull align 8 dereferenceable(76) %41, ptr noundef nonnull %1)
  invoke void @_ZNSt6vectorIPN8bmf_lite11VideoBufferESaIS2_EE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %18, ptr noundef nonnull align 8 dereferenceable(8) %5)
          to label %46 unwind label %44

42:                                               ; preds = %24
  %43 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt12__shared_ptrIN8bmf_lite15HWDeviceContextELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %6) #3
  br label %47

44:                                               ; preds = %39
  %45 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt12__shared_ptrIN8bmf_lite11VideoBufferELN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %0) #3
  br label %47

46:                                               ; preds = %39
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #3
  br label %49

47:                                               ; preds = %44, %42
  %.pn = phi { ptr, i32 } [ %45, %44 ], [ %43, %42 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #3
  br label %50

48:                                               ; preds = %37
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #3
  call void @_ZNSt10shared_ptrIN8bmf_lite11VideoBufferEEC2EDn(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr null) #3
  br label %49

49:                                               ; preds = %46, %14, %48, %23
  ret void

50:                                               ; preds = %47, %15
  %.pn10 = phi { ptr, i32 } [ %16, %15 ], [ %.pn, %47 ]
  resume { ptr, i32 } %.pn10
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt10shared_ptrIN8bmf_lite11VideoBufferEESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #0 align 2

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare hidden void @"_ZNSt10shared_ptrIN8bmf_lite11VideoBufferEEC2IS1_ZNS0_15VideoBufferPool13acquireObjectEvE3$_0vEEPT_T0_"(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) unnamed_addr #2 align 2

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

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

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

attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress 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 = { 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, !8, i64 36}
!6 = !{!"_ZTSN8bmf_lite15VideoBufferPoolE", !7, i64 0, !8, i64 8, !8, i64 12, !11, i64 16, !8, i64 36, !13, i64 40, !18, i64 64, !22, i64 88, !25, i64 104}
!7 = !{!"_ZTSN8bmf_lite4PoolE"}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"_ZTSN8bmf_lite16HardwareDataInfoE", !12, i64 0, !8, i64 4, !8, i64 8, !8, i64 12, !8, i64 16}
!12 = !{!"_ZTSN8bmf_lite10MemoryTypeE", !9, i64 0}
!13 = !{!"_ZTSSt6vectorIPN8bmf_lite11VideoBufferESaIS2_EE", !14, i64 0}
!14 = !{!"_ZTSSt12_Vector_baseIPN8bmf_lite11VideoBufferESaIS2_EE", !15, i64 0}
!15 = !{!"_ZTSNSt12_Vector_baseIPN8bmf_lite11VideoBufferESaIS2_EE12_Vector_implE", !16, i64 0}
!16 = !{!"_ZTSNSt12_Vector_baseIPN8bmf_lite11VideoBufferESaIS2_EE17_Vector_impl_dataE", !17, i64 0, !17, i64 8, !17, i64 16}
!17 = !{!"any pointer", !9, i64 0}
!18 = !{!"_ZTSSt6vectorISt10shared_ptrIN8bmf_lite11VideoBufferEESaIS3_EE", !19, i64 0}
!19 = !{!"_ZTSSt12_Vector_baseISt10shared_ptrIN8bmf_lite11VideoBufferEESaIS3_EE", !20, i64 0}
!20 = !{!"_ZTSNSt12_Vector_baseISt10shared_ptrIN8bmf_lite11VideoBufferEESaIS3_EE12_Vector_implE", !21, i64 0}
!21 = !{!"_ZTSNSt12_Vector_baseISt10shared_ptrIN8bmf_lite11VideoBufferEESaIS3_EE17_Vector_impl_dataE", !17, i64 0, !17, i64 8, !17, i64 16}
!22 = !{!"_ZTSSt10shared_ptrIN8bmf_lite15HWDeviceContextEE", !23, i64 0}
!23 = !{!"_ZTSSt12__shared_ptrIN8bmf_lite15HWDeviceContextELN9__gnu_cxx12_Lock_policyE2EE", !17, i64 0, !24, i64 8}
!24 = !{!"_ZTSSt14__shared_countILN9__gnu_cxx12_Lock_policyE2EE", !17, i64 0}
!25 = !{!"_ZTSSt10shared_ptrIN8bmf_lite20VideoBufferAllocatorEE", !26, i64 0}
!26 = !{!"_ZTSSt12__shared_ptrIN8bmf_lite20VideoBufferAllocatorELN9__gnu_cxx12_Lock_policyE2EE", !17, i64 0, !24, i64 8}
!27 = !{!17, !17, i64 0}
!28 = !{!6, !8, i64 8}
!29 = !{!6, !8, i64 12}
!30 = !{!31, !31, i64 0}
!31 = !{!"vtable pointer", !10, i64 0}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,SROAPass,SimplifyCFGPass,TailCallElimPass