; LLVM IR from khushmmehta/Scorch-V :: src/ScorchVkEngine/Abstractions/Rendering (BufferManager)

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

%struct.VkDescriptorPoolSize = type { i32, i32 }
%struct.VkDescriptorPoolCreateInfo = type { i32, ptr, i32, i32, i32, ptr }
%class.BufferManager = type { ptr, %"class.std::vector.0", %class.VulkanMemoryAllocator, ptr, ptr, ptr, ptr, ptr, %"class.std::vector.5", %"class.std::vector.10", ptr, ptr, ptr, ptr, %"class.std::vector.15", ptr, ptr, ptr }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<VkDescriptorSet_T *, std::allocator<VkDescriptorSet_T *>>::_Vector_impl" }
%"struct.std::_Vector_base<VkDescriptorSet_T *, std::allocator<VkDescriptorSet_T *>>::_Vector_impl" = type { %"struct.std::_Vector_base<VkDescriptorSet_T *, std::allocator<VkDescriptorSet_T *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<VkDescriptorSet_T *, std::allocator<VkDescriptorSet_T *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%class.VulkanMemoryAllocator = type { ptr, ptr }
%"class.std::vector.5" = type { %"struct.std::_Vector_base.6" }
%"struct.std::_Vector_base.6" = type { %"struct.std::_Vector_base<VkBuffer_T *, std::allocator<VkBuffer_T *>>::_Vector_impl" }
%"struct.std::_Vector_base<VkBuffer_T *, std::allocator<VkBuffer_T *>>::_Vector_impl" = type { %"struct.std::_Vector_base<VkBuffer_T *, std::allocator<VkBuffer_T *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<VkBuffer_T *, std::allocator<VkBuffer_T *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.10" = type { %"struct.std::_Vector_base.11" }
%"struct.std::_Vector_base.11" = type { %"struct.std::_Vector_base<void *, std::allocator<void *>>::_Vector_impl" }
%"struct.std::_Vector_base<void *, std::allocator<void *>>::_Vector_impl" = type { %"struct.std::_Vector_base<void *, std::allocator<void *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<void *, std::allocator<void *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.15" = type { %"struct.std::_Vector_base.16" }
%"struct.std::_Vector_base.16" = type { %"struct.std::_Vector_base<VmaAllocation_T *, std::allocator<VmaAllocation_T *>>::_Vector_impl" }
%"struct.std::_Vector_base<VmaAllocation_T *, std::allocator<VmaAllocation_T *>>::_Vector_impl" = type { %"struct.std::_Vector_base<VmaAllocation_T *, std::allocator<VmaAllocation_T *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<VmaAllocation_T *, std::allocator<VmaAllocation_T *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%class.PresentationManager = type { ptr, ptr, ptr, ptr, %struct.QueueFamilyIndices, ptr, i32, %struct.VkExtent2D, %"class.std::vector.20", i8, %"class.std::vector.25", %"class.std::vector.30", %struct.SwapChainSupportDetails }
%struct.QueueFamilyIndices = type { %"class.std::optional", %"class.std::optional" }
%"class.std::optional" = type { %"struct.std::_Optional_base" }
%"struct.std::_Optional_base" = type { %"struct.std::_Optional_payload" }
%"struct.std::_Optional_payload" = type { %"struct.std::_Optional_payload_base.base", [3 x i8] }
%"struct.std::_Optional_payload_base.base" = type <{ %"union.std::_Optional_payload_base<unsigned int>::_Storage", i8 }>
%"union.std::_Optional_payload_base<unsigned int>::_Storage" = type { i32 }
%struct.VkExtent2D = type { i32, i32 }
%"class.std::vector.20" = type { %"struct.std::_Vector_base.21" }
%"struct.std::_Vector_base.21" = type { %"struct.std::_Vector_base<VkFramebuffer_T *, std::allocator<VkFramebuffer_T *>>::_Vector_impl" }
%"struct.std::_Vector_base<VkFramebuffer_T *, std::allocator<VkFramebuffer_T *>>::_Vector_impl" = type { %"struct.std::_Vector_base<VkFramebuffer_T *, std::allocator<VkFramebuffer_T *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<VkFramebuffer_T *, std::allocator<VkFramebuffer_T *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.25" = type { %"struct.std::_Vector_base.26" }
%"struct.std::_Vector_base.26" = type { %"struct.std::_Vector_base<VkImage_T *, std::allocator<VkImage_T *>>::_Vector_impl" }
%"struct.std::_Vector_base<VkImage_T *, std::allocator<VkImage_T *>>::_Vector_impl" = type { %"struct.std::_Vector_base<VkImage_T *, std::allocator<VkImage_T *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<VkImage_T *, std::allocator<VkImage_T *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.30" = type { %"struct.std::_Vector_base.31" }
%"struct.std::_Vector_base.31" = type { %"struct.std::_Vector_base<VkImageView_T *, std::allocator<VkImageView_T *>>::_Vector_impl" }
%"struct.std::_Vector_base<VkImageView_T *, std::allocator<VkImageView_T *>>::_Vector_impl" = type { %"struct.std::_Vector_base<VkImageView_T *, std::allocator<VkImageView_T *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<VkImageView_T *, std::allocator<VkImageView_T *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.SwapChainSupportDetails = type { %struct.VkSurfaceCapabilitiesKHR, %"class.std::vector.35", %"class.std::vector.40" }
%struct.VkSurfaceCapabilitiesKHR = type { i32, i32, %struct.VkExtent2D, %struct.VkExtent2D, %struct.VkExtent2D, i32, i32, i32, i32, i32 }
%"class.std::vector.35" = type { %"struct.std::_Vector_base.36" }
%"struct.std::_Vector_base.36" = type { %"struct.std::_Vector_base<VkSurfaceFormatKHR, std::allocator<VkSurfaceFormatKHR>>::_Vector_impl" }
%"struct.std::_Vector_base<VkSurfaceFormatKHR, std::allocator<VkSurfaceFormatKHR>>::_Vector_impl" = type { %"struct.std::_Vector_base<VkSurfaceFormatKHR, std::allocator<VkSurfaceFormatKHR>>::_Vector_impl_data" }
%"struct.std::_Vector_base<VkSurfaceFormatKHR, std::allocator<VkSurfaceFormatKHR>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.40" = type { %"struct.std::_Vector_base.41" }
%"struct.std::_Vector_base.41" = type { %"struct.std::_Vector_base<VkPresentModeKHR, std::allocator<VkPresentModeKHR>>::_Vector_impl" }
%"struct.std::_Vector_base<VkPresentModeKHR, std::allocator<VkPresentModeKHR>>::_Vector_impl" = type { %"struct.std::_Vector_base<VkPresentModeKHR, std::allocator<VkPresentModeKHR>>::_Vector_impl_data" }
%"struct.std::_Vector_base<VkPresentModeKHR, std::allocator<VkPresentModeKHR>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@_ZTISt13runtime_error = external constant ptr
@.str.3 = external hidden unnamed_addr constant [36 x i8], align 1

; 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: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1

declare ptr @__cxa_allocate_exception(i64)

declare void @_ZNSt13runtime_errorC1EPKc(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) unnamed_addr #2

declare void @__cxa_free_exception(ptr)

; Function Attrs: nounwind
declare void @_ZNSt13runtime_errorD1Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #3

declare void @__cxa_throw(ptr, ptr, ptr)

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN13BufferManager20createDescriptorPoolEv(ptr noundef nonnull align 8 dereferenceable(216) %0) #4 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca %struct.VkDescriptorPoolSize, align 4
  %4 = alloca %struct.VkDescriptorPoolCreateInfo, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %7 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #5
  call void @llvm.memset.p0.i64(ptr align 4 %3, i8 0, i64 8, i1 false)
  %8 = getelementptr inbounds %struct.VkDescriptorPoolSize, ptr %3, i32 0, i32 0
  store i32 6, ptr %8, align 4, !tbaa !9
  %9 = getelementptr inbounds %struct.VkDescriptorPoolSize, ptr %3, i32 0, i32 1
  store i32 2, ptr %9, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 40, ptr %4) #5
  call void @llvm.memset.p0.i64(ptr align 8 %4, i8 0, i64 40, i1 false)
  %10 = getelementptr inbounds %struct.VkDescriptorPoolCreateInfo, ptr %4, i32 0, i32 0
  store i32 33, ptr %10, align 8, !tbaa !14
  %11 = getelementptr inbounds %struct.VkDescriptorPoolCreateInfo, ptr %4, i32 0, i32 4
  store i32 1, ptr %11, align 8, !tbaa !17
  %12 = getelementptr inbounds %struct.VkDescriptorPoolCreateInfo, ptr %4, i32 0, i32 5
  store ptr %3, ptr %12, align 8, !tbaa !18
  %13 = getelementptr inbounds %struct.VkDescriptorPoolCreateInfo, ptr %4, i32 0, i32 3
  store i32 2, ptr %13, align 4, !tbaa !19
  %14 = getelementptr inbounds %class.BufferManager, ptr %7, i32 0, i32 10
  %15 = load ptr, ptr %14, align 8, !tbaa !20
  %16 = getelementptr inbounds %class.PresentationManager, ptr %15, i32 0, i32 3
  %17 = load ptr, ptr %16, align 8, !tbaa !39
  %18 = getelementptr inbounds %class.BufferManager, ptr %7, i32 0, i32 16
  %19 = call i32 @vkCreateDescriptorPool(ptr noundef %17, ptr noundef %4, ptr noundef null, ptr noundef %18)
  %20 = icmp ne i32 %19, 0
  br i1 %20, label %21, label %28

21:                                               ; preds = %1
  %22 = call ptr @__cxa_allocate_exception(i64 16) #5
  invoke void @_ZNSt13runtime_errorC1EPKc(ptr noundef nonnull align 8 dereferenceable(16) %22, ptr noundef @.str.3)
          to label %23 unwind label %24

23:                                               ; preds = %21
  call void @__cxa_throw(ptr %22, ptr @_ZTISt13runtime_error, ptr @_ZNSt13runtime_errorD1Ev) #6
  unreachable

24:                                               ; preds = %21
  %25 = landingpad { ptr, i32 }
          cleanup
  %26 = extractvalue { ptr, i32 } %25, 0
  store ptr %26, ptr %5, align 8
  %27 = extractvalue { ptr, i32 } %25, 1
  store i32 %27, ptr %6, align 4
  call void @__cxa_free_exception(ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  br label %29

28:                                               ; preds = %1
  call void @llvm.lifetime.end.p0(i64 40, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  ret void

29:                                               ; preds = %24
  %30 = load ptr, ptr %5, align 8
  %31 = load i32, ptr %6, align 4
  %32 = insertvalue { ptr, i32 } poison, ptr %30, 0
  %33 = insertvalue { ptr, i32 } %32, i32 %31, 1
  resume { ptr, i32 } %33
}

declare i32 @vkCreateDescriptorPool(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #2 = { "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 "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 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 }
attributes #6 = { noreturn }

!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, !11, i64 0}
!10 = !{!"_ZTS20VkDescriptorPoolSize", !11, i64 0, !12, i64 4}
!11 = !{!"_ZTS16VkDescriptorType", !7, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!10, !12, i64 4}
!14 = !{!15, !16, i64 0}
!15 = !{!"_ZTS26VkDescriptorPoolCreateInfo", !16, i64 0, !6, i64 8, !12, i64 16, !12, i64 20, !12, i64 24, !6, i64 32}
!16 = !{!"_ZTS15VkStructureType", !7, i64 0}
!17 = !{!15, !12, i64 24}
!18 = !{!15, !6, i64 32}
!19 = !{!15, !12, i64 20}
!20 = !{!21, !6, i64 136}
!21 = !{!"_ZTS13BufferManager", !6, i64 0, !22, i64 8, !26, i64 32, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !27, i64 88, !31, i64 112, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !35, i64 168, !6, i64 192, !6, i64 200, !6, i64 208}
!22 = !{!"_ZTSSt6vectorIP17VkDescriptorSet_TSaIS1_EE", !23, i64 0}
!23 = !{!"_ZTSSt12_Vector_baseIP17VkDescriptorSet_TSaIS1_EE", !24, i64 0}
!24 = !{!"_ZTSNSt12_Vector_baseIP17VkDescriptorSet_TSaIS1_EE12_Vector_implE", !25, i64 0}
!25 = !{!"_ZTSNSt12_Vector_baseIP17VkDescriptorSet_TSaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!26 = !{!"_ZTS21VulkanMemoryAllocator", !6, i64 0, !6, i64 8}
!27 = !{!"_ZTSSt6vectorIP10VkBuffer_TSaIS1_EE", !28, i64 0}
!28 = !{!"_ZTSSt12_Vector_baseIP10VkBuffer_TSaIS1_EE", !29, i64 0}
!29 = !{!"_ZTSNSt12_Vector_baseIP10VkBuffer_TSaIS1_EE12_Vector_implE", !30, i64 0}
!30 = !{!"_ZTSNSt12_Vector_baseIP10VkBuffer_TSaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!31 = !{!"_ZTSSt6vectorIPvSaIS0_EE", !32, i64 0}
!32 = !{!"_ZTSSt12_Vector_baseIPvSaIS0_EE", !33, i64 0}
!33 = !{!"_ZTSNSt12_Vector_baseIPvSaIS0_EE12_Vector_implE", !34, i64 0}
!34 = !{!"_ZTSNSt12_Vector_baseIPvSaIS0_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!35 = !{!"_ZTSSt6vectorIP15VmaAllocation_TSaIS1_EE", !36, i64 0}
!36 = !{!"_ZTSSt12_Vector_baseIP15VmaAllocation_TSaIS1_EE", !37, i64 0}
!37 = !{!"_ZTSNSt12_Vector_baseIP15VmaAllocation_TSaIS1_EE12_Vector_implE", !38, i64 0}
!38 = !{!"_ZTSNSt12_Vector_baseIP15VmaAllocation_TSaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!39 = !{!40, !6, i64 24}
!40 = !{!"_ZTS19PresentationManager", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !41, i64 32, !6, i64 48, !47, i64 56, !48, i64 60, !49, i64 72, !46, i64 96, !53, i64 104, !57, i64 128, !61, i64 152}
!41 = !{!"_ZTS18QueueFamilyIndices", !42, i64 0, !42, i64 8}
!42 = !{!"_ZTSSt8optionalIjE", !43, i64 0}
!43 = !{!"_ZTSSt14_Optional_baseIjLb1ELb1EE", !44, i64 0}
!44 = !{!"_ZTSSt17_Optional_payloadIjLb1ELb1ELb1EE", !45, i64 0}
!45 = !{!"_ZTSSt22_Optional_payload_baseIjE", !7, i64 0, !46, i64 4}
!46 = !{!"bool", !7, i64 0}
!47 = !{!"_ZTS8VkFormat", !7, i64 0}
!48 = !{!"_ZTS10VkExtent2D", !12, i64 0, !12, i64 4}
!49 = !{!"_ZTSSt6vectorIP15VkFramebuffer_TSaIS1_EE", !50, i64 0}
!50 = !{!"_ZTSSt12_Vector_baseIP15VkFramebuffer_TSaIS1_EE", !51, i64 0}
!51 = !{!"_ZTSNSt12_Vector_baseIP15VkFramebuffer_TSaIS1_EE12_Vector_implE", !52, i64 0}
!52 = !{!"_ZTSNSt12_Vector_baseIP15VkFramebuffer_TSaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!53 = !{!"_ZTSSt6vectorIP9VkImage_TSaIS1_EE", !54, i64 0}
!54 = !{!"_ZTSSt12_Vector_baseIP9VkImage_TSaIS1_EE", !55, i64 0}
!55 = !{!"_ZTSNSt12_Vector_baseIP9VkImage_TSaIS1_EE12_Vector_implE", !56, i64 0}
!56 = !{!"_ZTSNSt12_Vector_baseIP9VkImage_TSaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!57 = !{!"_ZTSSt6vectorIP13VkImageView_TSaIS1_EE", !58, i64 0}
!58 = !{!"_ZTSSt12_Vector_baseIP13VkImageView_TSaIS1_EE", !59, i64 0}
!59 = !{!"_ZTSNSt12_Vector_baseIP13VkImageView_TSaIS1_EE12_Vector_implE", !60, i64 0}
!60 = !{!"_ZTSNSt12_Vector_baseIP13VkImageView_TSaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!61 = !{!"_ZTS23SwapChainSupportDetails", !62, i64 0, !64, i64 56, !68, i64 80}
!62 = !{!"_ZTS24VkSurfaceCapabilitiesKHR", !12, i64 0, !12, i64 4, !48, i64 8, !48, i64 16, !48, i64 24, !12, i64 32, !12, i64 36, !63, i64 40, !12, i64 44, !12, i64 48}
!63 = !{!"_ZTS29VkSurfaceTransformFlagBitsKHR", !7, i64 0}
!64 = !{!"_ZTSSt6vectorI18VkSurfaceFormatKHRSaIS0_EE", !65, i64 0}
!65 = !{!"_ZTSSt12_Vector_baseI18VkSurfaceFormatKHRSaIS0_EE", !66, i64 0}
!66 = !{!"_ZTSNSt12_Vector_baseI18VkSurfaceFormatKHRSaIS0_EE12_Vector_implE", !67, i64 0}
!67 = !{!"_ZTSNSt12_Vector_baseI18VkSurfaceFormatKHRSaIS0_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!68 = !{!"_ZTSSt6vectorI16VkPresentModeKHRSaIS0_EE", !69, i64 0}
!69 = !{!"_ZTSSt12_Vector_baseI16VkPresentModeKHRSaIS0_EE", !70, i64 0}
!70 = !{!"_ZTSNSt12_Vector_baseI16VkPresentModeKHRSaIS0_EE12_Vector_implE", !71, i64 0}
!71 = !{!"_ZTSNSt12_Vector_baseI16VkPresentModeKHRSaIS0_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}


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

%struct.VkDescriptorPoolSize = type { i32, i32 }
%struct.VkDescriptorPoolCreateInfo = type { i32, ptr, i32, i32, i32, ptr }

@_ZTISt13runtime_error = external constant ptr
@.str.3 = external hidden unnamed_addr constant [36 x i8], align 1

; 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 nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1

declare ptr @__cxa_allocate_exception(i64) local_unnamed_addr

declare void @_ZNSt13runtime_errorC1EPKc(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) unnamed_addr #2

declare void @__cxa_free_exception(ptr) local_unnamed_addr

; Function Attrs: nounwind
declare void @_ZNSt13runtime_errorD1Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #3

declare void @__cxa_throw(ptr, ptr, ptr) local_unnamed_addr

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN13BufferManager20createDescriptorPoolEv(ptr noundef nonnull align 8 dereferenceable(216) %0) local_unnamed_addr #4 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %struct.VkDescriptorPoolSize, align 8
  %3 = alloca %struct.VkDescriptorPoolCreateInfo, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #5
  store i64 8589934598, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %3) #5
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(40) %3, i8 0, i64 32, i1 false)
  store i32 33, ptr %3, align 8, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %3, i64 24
  store i32 1, ptr %4, align 8, !tbaa !12
  %5 = getelementptr inbounds i8, ptr %3, i64 32
  store ptr %2, ptr %5, align 8, !tbaa !13
  %6 = getelementptr inbounds i8, ptr %3, i64 20
  store i32 2, ptr %6, align 4, !tbaa !14
  %7 = getelementptr inbounds i8, ptr %0, i64 136
  %8 = load ptr, ptr %7, align 8, !tbaa !15
  %9 = getelementptr inbounds i8, ptr %8, i64 24
  %10 = load ptr, ptr %9, align 8, !tbaa !34
  %11 = getelementptr inbounds i8, ptr %0, i64 200
  %12 = call i32 @vkCreateDescriptorPool(ptr noundef %10, ptr noundef nonnull %3, ptr noundef null, ptr noundef nonnull %11)
  %.not = icmp eq i32 %12, 0
  br i1 %.not, label %18, label %13

13:                                               ; preds = %1
  %14 = call ptr @__cxa_allocate_exception(i64 16) #5
  invoke void @_ZNSt13runtime_errorC1EPKc(ptr noundef nonnull align 8 dereferenceable(16) %14, ptr noundef nonnull @.str.3)
          to label %15 unwind label %16

15:                                               ; preds = %13
  call void @__cxa_throw(ptr nonnull %14, ptr nonnull @_ZTISt13runtime_error, ptr nonnull @_ZNSt13runtime_errorD1Ev) #6
  unreachable

16:                                               ; preds = %13
  %17 = landingpad { ptr, i32 }
          cleanup
  call void @__cxa_free_exception(ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #5
  resume { ptr, i32 } %17

18:                                               ; preds = %1
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #5
  ret void
}

declare i32 @vkCreateDescriptorPool(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #2 = { "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 "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 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 }
attributes #6 = { noreturn }

!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 = !{!"_ZTS26VkDescriptorPoolCreateInfo", !7, i64 0, !10, i64 8, !11, i64 16, !11, i64 20, !11, i64 24, !10, i64 32}
!7 = !{!"_ZTS15VkStructureType", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"int", !8, i64 0}
!12 = !{!6, !11, i64 24}
!13 = !{!6, !10, i64 32}
!14 = !{!6, !11, i64 20}
!15 = !{!16, !10, i64 136}
!16 = !{!"_ZTS13BufferManager", !10, i64 0, !17, i64 8, !21, i64 32, !10, i64 48, !10, i64 56, !10, i64 64, !10, i64 72, !10, i64 80, !22, i64 88, !26, i64 112, !10, i64 136, !10, i64 144, !10, i64 152, !10, i64 160, !30, i64 168, !10, i64 192, !10, i64 200, !10, i64 208}
!17 = !{!"_ZTSSt6vectorIP17VkDescriptorSet_TSaIS1_EE", !18, i64 0}
!18 = !{!"_ZTSSt12_Vector_baseIP17VkDescriptorSet_TSaIS1_EE", !19, i64 0}
!19 = !{!"_ZTSNSt12_Vector_baseIP17VkDescriptorSet_TSaIS1_EE12_Vector_implE", !20, i64 0}
!20 = !{!"_ZTSNSt12_Vector_baseIP17VkDescriptorSet_TSaIS1_EE17_Vector_impl_dataE", !10, i64 0, !10, i64 8, !10, i64 16}
!21 = !{!"_ZTS21VulkanMemoryAllocator", !10, i64 0, !10, i64 8}
!22 = !{!"_ZTSSt6vectorIP10VkBuffer_TSaIS1_EE", !23, i64 0}
!23 = !{!"_ZTSSt12_Vector_baseIP10VkBuffer_TSaIS1_EE", !24, i64 0}
!24 = !{!"_ZTSNSt12_Vector_baseIP10VkBuffer_TSaIS1_EE12_Vector_implE", !25, i64 0}
!25 = !{!"_ZTSNSt12_Vector_baseIP10VkBuffer_TSaIS1_EE17_Vector_impl_dataE", !10, i64 0, !10, i64 8, !10, i64 16}
!26 = !{!"_ZTSSt6vectorIPvSaIS0_EE", !27, i64 0}
!27 = !{!"_ZTSSt12_Vector_baseIPvSaIS0_EE", !28, i64 0}
!28 = !{!"_ZTSNSt12_Vector_baseIPvSaIS0_EE12_Vector_implE", !29, i64 0}
!29 = !{!"_ZTSNSt12_Vector_baseIPvSaIS0_EE17_Vector_impl_dataE", !10, i64 0, !10, i64 8, !10, i64 16}
!30 = !{!"_ZTSSt6vectorIP15VmaAllocation_TSaIS1_EE", !31, i64 0}
!31 = !{!"_ZTSSt12_Vector_baseIP15VmaAllocation_TSaIS1_EE", !32, i64 0}
!32 = !{!"_ZTSNSt12_Vector_baseIP15VmaAllocation_TSaIS1_EE12_Vector_implE", !33, i64 0}
!33 = !{!"_ZTSNSt12_Vector_baseIP15VmaAllocation_TSaIS1_EE17_Vector_impl_dataE", !10, i64 0, !10, i64 8, !10, i64 16}
!34 = !{!35, !10, i64 24}
!35 = !{!"_ZTS19PresentationManager", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !36, i64 32, !10, i64 48, !42, i64 56, !43, i64 60, !44, i64 72, !41, i64 96, !48, i64 104, !52, i64 128, !56, i64 152}
!36 = !{!"_ZTS18QueueFamilyIndices", !37, i64 0, !37, i64 8}
!37 = !{!"_ZTSSt8optionalIjE", !38, i64 0}
!38 = !{!"_ZTSSt14_Optional_baseIjLb1ELb1EE", !39, i64 0}
!39 = !{!"_ZTSSt17_Optional_payloadIjLb1ELb1ELb1EE", !40, i64 0}
!40 = !{!"_ZTSSt22_Optional_payload_baseIjE", !8, i64 0, !41, i64 4}
!41 = !{!"bool", !8, i64 0}
!42 = !{!"_ZTS8VkFormat", !8, i64 0}
!43 = !{!"_ZTS10VkExtent2D", !11, i64 0, !11, i64 4}
!44 = !{!"_ZTSSt6vectorIP15VkFramebuffer_TSaIS1_EE", !45, i64 0}
!45 = !{!"_ZTSSt12_Vector_baseIP15VkFramebuffer_TSaIS1_EE", !46, i64 0}
!46 = !{!"_ZTSNSt12_Vector_baseIP15VkFramebuffer_TSaIS1_EE12_Vector_implE", !47, i64 0}
!47 = !{!"_ZTSNSt12_Vector_baseIP15VkFramebuffer_TSaIS1_EE17_Vector_impl_dataE", !10, i64 0, !10, i64 8, !10, i64 16}
!48 = !{!"_ZTSSt6vectorIP9VkImage_TSaIS1_EE", !49, i64 0}
!49 = !{!"_ZTSSt12_Vector_baseIP9VkImage_TSaIS1_EE", !50, i64 0}
!50 = !{!"_ZTSNSt12_Vector_baseIP9VkImage_TSaIS1_EE12_Vector_implE", !51, i64 0}
!51 = !{!"_ZTSNSt12_Vector_baseIP9VkImage_TSaIS1_EE17_Vector_impl_dataE", !10, i64 0, !10, i64 8, !10, i64 16}
!52 = !{!"_ZTSSt6vectorIP13VkImageView_TSaIS1_EE", !53, i64 0}
!53 = !{!"_ZTSSt12_Vector_baseIP13VkImageView_TSaIS1_EE", !54, i64 0}
!54 = !{!"_ZTSNSt12_Vector_baseIP13VkImageView_TSaIS1_EE12_Vector_implE", !55, i64 0}
!55 = !{!"_ZTSNSt12_Vector_baseIP13VkImageView_TSaIS1_EE17_Vector_impl_dataE", !10, i64 0, !10, i64 8, !10, i64 16}
!56 = !{!"_ZTS23SwapChainSupportDetails", !57, i64 0, !59, i64 56, !63, i64 80}
!57 = !{!"_ZTS24VkSurfaceCapabilitiesKHR", !11, i64 0, !11, i64 4, !43, i64 8, !43, i64 16, !43, i64 24, !11, i64 32, !11, i64 36, !58, i64 40, !11, i64 44, !11, i64 48}
!58 = !{!"_ZTS29VkSurfaceTransformFlagBitsKHR", !8, i64 0}
!59 = !{!"_ZTSSt6vectorI18VkSurfaceFormatKHRSaIS0_EE", !60, i64 0}
!60 = !{!"_ZTSSt12_Vector_baseI18VkSurfaceFormatKHRSaIS0_EE", !61, i64 0}
!61 = !{!"_ZTSNSt12_Vector_baseI18VkSurfaceFormatKHRSaIS0_EE12_Vector_implE", !62, i64 0}
!62 = !{!"_ZTSNSt12_Vector_baseI18VkSurfaceFormatKHRSaIS0_EE17_Vector_impl_dataE", !10, i64 0, !10, i64 8, !10, i64 16}
!63 = !{!"_ZTSSt6vectorI16VkPresentModeKHRSaIS0_EE", !64, i64 0}
!64 = !{!"_ZTSSt12_Vector_baseI16VkPresentModeKHRSaIS0_EE", !65, i64 0}
!65 = !{!"_ZTSNSt12_Vector_baseI16VkPresentModeKHRSaIS0_EE12_Vector_implE", !66, i64 0}
!66 = !{!"_ZTSNSt12_Vector_baseI16VkPresentModeKHRSaIS0_EE17_Vector_impl_dataE", !10, i64 0, !10, i64 8, !10, i64 16}


; Effective O3 passes: DSEPass,EarlyCSEPass,GlobalOptPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,SimplifyCFGPass