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

%"class.std::vector.45" = type { %"struct.std::_Vector_base.46" }
%"struct.std::_Vector_base.46" = type { %"struct.std::_Vector_base<VkDescriptorSetLayout_T *, std::allocator<VkDescriptorSetLayout_T *>>::_Vector_impl" }
%"struct.std::_Vector_base<VkDescriptorSetLayout_T *, std::allocator<VkDescriptorSetLayout_T *>>::_Vector_impl" = type { %"struct.std::_Vector_base<VkDescriptorSetLayout_T *, std::allocator<VkDescriptorSetLayout_T *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<VkDescriptorSetLayout_T *, std::allocator<VkDescriptorSetLayout_T *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator.47" = type { i8 }
%struct.VkDescriptorSetAllocateInfo = type { i32, ptr, ptr, i32, ptr }
%struct.VkDescriptorBufferInfo = type { ptr, i64, i64 }
%struct.VkWriteDescriptorSet = type { i32, ptr, ptr, i32, i32, i32, i32, ptr, ptr, 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.4 = 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 @_ZN13BufferManager20createDescriptorSetsEv(ptr noundef nonnull align 8 dereferenceable(216) %0) #4 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca %"class.std::vector.45", align 8
  %4 = alloca %"class.std::allocator.47", align 1
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca %struct.VkDescriptorSetAllocateInfo, align 8
  %8 = alloca i64, align 8
  %9 = alloca %struct.VkDescriptorBufferInfo, align 8
  %10 = alloca %struct.VkWriteDescriptorSet, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %11 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr %3) #6
  %12 = getelementptr inbounds %class.BufferManager, ptr %11, i32 0, i32 0
  call void @llvm.lifetime.start.p0(i64 1, ptr %4) #6
  call void @_ZNSaIP23VkDescriptorSetLayout_TEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #6
  invoke void @_ZNSt6vectorIP23VkDescriptorSetLayout_TSaIS1_EEC2EmRKS1_RKS2_(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef 2, ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 1 dereferenceable(1) %4)
          to label %13 unwind label %35

13:                                               ; preds = %1
  call void @_ZNSt15__new_allocatorIP23VkDescriptorSetLayout_TED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %4) #6
  call void @llvm.lifetime.start.p0(i64 40, ptr %7) #6
  call void @llvm.memset.p0.i64(ptr align 8 %7, i8 0, i64 40, i1 false)
  %14 = getelementptr inbounds %struct.VkDescriptorSetAllocateInfo, ptr %7, i32 0, i32 0
  store i32 34, ptr %14, align 8, !tbaa !9
  %15 = getelementptr inbounds %class.BufferManager, ptr %11, i32 0, i32 16
  %16 = load ptr, ptr %15, align 8, !tbaa !13
  %17 = getelementptr inbounds %struct.VkDescriptorSetAllocateInfo, ptr %7, i32 0, i32 2
  store ptr %16, ptr %17, align 8, !tbaa !32
  %18 = getelementptr inbounds %struct.VkDescriptorSetAllocateInfo, ptr %7, i32 0, i32 3
  store i32 2, ptr %18, align 8, !tbaa !33
  %19 = call noundef ptr @_ZNKSt6vectorIP23VkDescriptorSetLayout_TSaIS1_EE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  %20 = getelementptr inbounds %struct.VkDescriptorSetAllocateInfo, ptr %7, i32 0, i32 4
  store ptr %19, ptr %20, align 8, !tbaa !34
  %21 = getelementptr inbounds %class.BufferManager, ptr %11, i32 0, i32 1
  invoke void @_ZNSt6vectorIP17VkDescriptorSet_TSaIS1_EE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %21, i64 noundef 2)
          to label %22 unwind label %39

22:                                               ; preds = %13
  %23 = getelementptr inbounds %class.BufferManager, ptr %11, i32 0, i32 10
  %24 = load ptr, ptr %23, align 8, !tbaa !35
  %25 = getelementptr inbounds %class.PresentationManager, ptr %24, i32 0, i32 3
  %26 = load ptr, ptr %25, align 8, !tbaa !36
  %27 = getelementptr inbounds %class.BufferManager, ptr %11, i32 0, i32 1
  %28 = call noundef ptr @_ZNSt6vectorIP17VkDescriptorSet_TSaIS1_EE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %27) #6
  %29 = invoke i32 @vkAllocateDescriptorSets(ptr noundef %26, ptr noundef %7, ptr noundef %28)
          to label %30 unwind label %39

30:                                               ; preds = %22
  %31 = icmp ne i32 %29, 0
  br i1 %31, label %32, label %47

32:                                               ; preds = %30
  %33 = call ptr @__cxa_allocate_exception(i64 16) #6
  invoke void @_ZNSt13runtime_errorC1EPKc(ptr noundef nonnull align 8 dereferenceable(16) %33, ptr noundef @.str.4)
          to label %34 unwind label %43

34:                                               ; preds = %32
  invoke void @__cxa_throw(ptr %33, ptr @_ZTISt13runtime_error, ptr @_ZNSt13runtime_errorD1Ev) #7
          to label %91 unwind label %39

35:                                               ; preds = %1
  %36 = landingpad { ptr, i32 }
          cleanup
  %37 = extractvalue { ptr, i32 } %36, 0
  store ptr %37, ptr %5, align 8
  %38 = extractvalue { ptr, i32 } %36, 1
  store i32 %38, ptr %6, align 4
  call void @_ZNSt15__new_allocatorIP23VkDescriptorSetLayout_TED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %4) #6
  br label %85

39:                                               ; preds = %34, %22, %13
  %40 = landingpad { ptr, i32 }
          cleanup
  %41 = extractvalue { ptr, i32 } %40, 0
  store ptr %41, ptr %5, align 8
  %42 = extractvalue { ptr, i32 } %40, 1
  store i32 %42, ptr %6, align 4
  br label %84

43:                                               ; preds = %32
  %44 = landingpad { ptr, i32 }
          cleanup
  %45 = extractvalue { ptr, i32 } %44, 0
  store ptr %45, ptr %5, align 8
  %46 = extractvalue { ptr, i32 } %44, 1
  store i32 %46, ptr %6, align 4
  call void @__cxa_free_exception(ptr %33) #6
  br label %84

47:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  store i64 0, ptr %8, align 8, !tbaa !69
  br label %48

48:                                               ; preds = %76, %47
  %49 = load i64, ptr %8, align 8, !tbaa !69
  %50 = icmp ult i64 %49, 2
  br i1 %50, label %52, label %51

51:                                               ; preds = %48
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  br label %83

52:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 24, ptr %9) #6
  call void @llvm.memset.p0.i64(ptr align 8 %9, i8 0, i64 24, i1 false)
  %53 = getelementptr inbounds %class.BufferManager, ptr %11, i32 0, i32 8
  %54 = load i64, ptr %8, align 8, !tbaa !69
  %55 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP10VkBuffer_TSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %53, i64 noundef %54) #6
  %56 = load ptr, ptr %55, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.VkDescriptorBufferInfo, ptr %9, i32 0, i32 0
  store ptr %56, ptr %57, align 8, !tbaa !71
  %58 = getelementptr inbounds %struct.VkDescriptorBufferInfo, ptr %9, i32 0, i32 1
  store i64 0, ptr %58, align 8, !tbaa !73
  %59 = getelementptr inbounds %struct.VkDescriptorBufferInfo, ptr %9, i32 0, i32 2
  store i64 192, ptr %59, align 8, !tbaa !74
  call void @llvm.lifetime.start.p0(i64 64, ptr %10) #6
  call void @llvm.memset.p0.i64(ptr align 8 %10, i8 0, i64 64, i1 false)
  %60 = getelementptr inbounds %struct.VkWriteDescriptorSet, ptr %10, i32 0, i32 0
  store i32 35, ptr %60, align 8, !tbaa !75
  %61 = getelementptr inbounds %class.BufferManager, ptr %11, i32 0, i32 1
  %62 = load i64, ptr %8, align 8, !tbaa !69
  %63 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP17VkDescriptorSet_TSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %61, i64 noundef %62) #6
  %64 = load ptr, ptr %63, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.VkWriteDescriptorSet, ptr %10, i32 0, i32 2
  store ptr %64, ptr %65, align 8, !tbaa !78
  %66 = getelementptr inbounds %struct.VkWriteDescriptorSet, ptr %10, i32 0, i32 3
  store i32 0, ptr %66, align 8, !tbaa !79
  %67 = getelementptr inbounds %struct.VkWriteDescriptorSet, ptr %10, i32 0, i32 4
  store i32 0, ptr %67, align 4, !tbaa !80
  %68 = getelementptr inbounds %struct.VkWriteDescriptorSet, ptr %10, i32 0, i32 6
  store i32 6, ptr %68, align 4, !tbaa !81
  %69 = getelementptr inbounds %struct.VkWriteDescriptorSet, ptr %10, i32 0, i32 5
  store i32 1, ptr %69, align 8, !tbaa !82
  %70 = getelementptr inbounds %struct.VkWriteDescriptorSet, ptr %10, i32 0, i32 8
  store ptr %9, ptr %70, align 8, !tbaa !83
  %71 = getelementptr inbounds %class.BufferManager, ptr %11, i32 0, i32 10
  %72 = load ptr, ptr %71, align 8, !tbaa !35
  %73 = getelementptr inbounds %class.PresentationManager, ptr %72, i32 0, i32 3
  %74 = load ptr, ptr %73, align 8, !tbaa !36
  invoke void @vkUpdateDescriptorSets(ptr noundef %74, i32 noundef 1, ptr noundef %10, i32 noundef 0, ptr noundef null)
          to label %75 unwind label %79

75:                                               ; preds = %52
  call void @llvm.lifetime.end.p0(i64 64, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #6
  br label %76

76:                                               ; preds = %75
  %77 = load i64, ptr %8, align 8, !tbaa !69
  %78 = add i64 %77, 1
  store i64 %78, ptr %8, align 8, !tbaa !69
  br label %48, !llvm.loop !84

79:                                               ; preds = %52
  %80 = landingpad { ptr, i32 }
          cleanup
  %81 = extractvalue { ptr, i32 } %80, 0
  store ptr %81, ptr %5, align 8
  %82 = extractvalue { ptr, i32 } %80, 1
  store i32 %82, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 64, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  br label %84

83:                                               ; preds = %51
  call void @llvm.lifetime.end.p0(i64 40, ptr %7) #6
  call void @_ZNSt6vectorIP23VkDescriptorSetLayout_TSaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #6
  ret void

84:                                               ; preds = %79, %43, %39
  call void @llvm.lifetime.end.p0(i64 40, ptr %7) #6
  call void @_ZNSt6vectorIP23VkDescriptorSetLayout_TSaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  br label %85

85:                                               ; preds = %84, %35
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #6
  br label %86

86:                                               ; preds = %85
  %87 = load ptr, ptr %5, align 8
  %88 = load i32, ptr %6, align 4
  %89 = insertvalue { ptr, i32 } poison, ptr %87, 0
  %90 = insertvalue { ptr, i32 } %89, i32 %88, 1
  resume { ptr, i32 } %90

91:                                               ; preds = %34
  unreachable
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSaIP23VkDescriptorSetLayout_TEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIP23VkDescriptorSetLayout_TSaIS1_EEC2EmRKS1_RKS2_(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #4 align 2

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

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

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

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

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

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

declare void @vkUpdateDescriptorSets(ptr noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef) #2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIP23VkDescriptorSetLayout_TED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #5 align 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 = { 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 #6 = { nounwind }
attributes #7 = { 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 = !{!"_ZTS27VkDescriptorSetAllocateInfo", !11, i64 0, !6, i64 8, !6, i64 16, !12, i64 24, !6, i64 32}
!11 = !{!"_ZTS15VkStructureType", !7, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !6, i64 200}
!14 = !{!"_ZTS13BufferManager", !6, i64 0, !15, i64 8, !19, i64 32, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !20, i64 88, !24, i64 112, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !28, i64 168, !6, i64 192, !6, i64 200, !6, i64 208}
!15 = !{!"_ZTSSt6vectorIP17VkDescriptorSet_TSaIS1_EE", !16, i64 0}
!16 = !{!"_ZTSSt12_Vector_baseIP17VkDescriptorSet_TSaIS1_EE", !17, i64 0}
!17 = !{!"_ZTSNSt12_Vector_baseIP17VkDescriptorSet_TSaIS1_EE12_Vector_implE", !18, i64 0}
!18 = !{!"_ZTSNSt12_Vector_baseIP17VkDescriptorSet_TSaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!19 = !{!"_ZTS21VulkanMemoryAllocator", !6, i64 0, !6, i64 8}
!20 = !{!"_ZTSSt6vectorIP10VkBuffer_TSaIS1_EE", !21, i64 0}
!21 = !{!"_ZTSSt12_Vector_baseIP10VkBuffer_TSaIS1_EE", !22, i64 0}
!22 = !{!"_ZTSNSt12_Vector_baseIP10VkBuffer_TSaIS1_EE12_Vector_implE", !23, i64 0}
!23 = !{!"_ZTSNSt12_Vector_baseIP10VkBuffer_TSaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!24 = !{!"_ZTSSt6vectorIPvSaIS0_EE", !25, i64 0}
!25 = !{!"_ZTSSt12_Vector_baseIPvSaIS0_EE", !26, i64 0}
!26 = !{!"_ZTSNSt12_Vector_baseIPvSaIS0_EE12_Vector_implE", !27, i64 0}
!27 = !{!"_ZTSNSt12_Vector_baseIPvSaIS0_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!28 = !{!"_ZTSSt6vectorIP15VmaAllocation_TSaIS1_EE", !29, i64 0}
!29 = !{!"_ZTSSt12_Vector_baseIP15VmaAllocation_TSaIS1_EE", !30, i64 0}
!30 = !{!"_ZTSNSt12_Vector_baseIP15VmaAllocation_TSaIS1_EE12_Vector_implE", !31, i64 0}
!31 = !{!"_ZTSNSt12_Vector_baseIP15VmaAllocation_TSaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!32 = !{!10, !6, i64 16}
!33 = !{!10, !12, i64 24}
!34 = !{!10, !6, i64 32}
!35 = !{!14, !6, i64 136}
!36 = !{!37, !6, i64 24}
!37 = !{!"_ZTS19PresentationManager", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !38, i64 32, !6, i64 48, !44, i64 56, !45, i64 60, !46, i64 72, !43, i64 96, !50, i64 104, !54, i64 128, !58, i64 152}
!38 = !{!"_ZTS18QueueFamilyIndices", !39, i64 0, !39, i64 8}
!39 = !{!"_ZTSSt8optionalIjE", !40, i64 0}
!40 = !{!"_ZTSSt14_Optional_baseIjLb1ELb1EE", !41, i64 0}
!41 = !{!"_ZTSSt17_Optional_payloadIjLb1ELb1ELb1EE", !42, i64 0}
!42 = !{!"_ZTSSt22_Optional_payload_baseIjE", !7, i64 0, !43, i64 4}
!43 = !{!"bool", !7, i64 0}
!44 = !{!"_ZTS8VkFormat", !7, i64 0}
!45 = !{!"_ZTS10VkExtent2D", !12, i64 0, !12, i64 4}
!46 = !{!"_ZTSSt6vectorIP15VkFramebuffer_TSaIS1_EE", !47, i64 0}
!47 = !{!"_ZTSSt12_Vector_baseIP15VkFramebuffer_TSaIS1_EE", !48, i64 0}
!48 = !{!"_ZTSNSt12_Vector_baseIP15VkFramebuffer_TSaIS1_EE12_Vector_implE", !49, i64 0}
!49 = !{!"_ZTSNSt12_Vector_baseIP15VkFramebuffer_TSaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!50 = !{!"_ZTSSt6vectorIP9VkImage_TSaIS1_EE", !51, i64 0}
!51 = !{!"_ZTSSt12_Vector_baseIP9VkImage_TSaIS1_EE", !52, i64 0}
!52 = !{!"_ZTSNSt12_Vector_baseIP9VkImage_TSaIS1_EE12_Vector_implE", !53, i64 0}
!53 = !{!"_ZTSNSt12_Vector_baseIP9VkImage_TSaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!54 = !{!"_ZTSSt6vectorIP13VkImageView_TSaIS1_EE", !55, i64 0}
!55 = !{!"_ZTSSt12_Vector_baseIP13VkImageView_TSaIS1_EE", !56, i64 0}
!56 = !{!"_ZTSNSt12_Vector_baseIP13VkImageView_TSaIS1_EE12_Vector_implE", !57, i64 0}
!57 = !{!"_ZTSNSt12_Vector_baseIP13VkImageView_TSaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!58 = !{!"_ZTS23SwapChainSupportDetails", !59, i64 0, !61, i64 56, !65, i64 80}
!59 = !{!"_ZTS24VkSurfaceCapabilitiesKHR", !12, i64 0, !12, i64 4, !45, i64 8, !45, i64 16, !45, i64 24, !12, i64 32, !12, i64 36, !60, i64 40, !12, i64 44, !12, i64 48}
!60 = !{!"_ZTS29VkSurfaceTransformFlagBitsKHR", !7, i64 0}
!61 = !{!"_ZTSSt6vectorI18VkSurfaceFormatKHRSaIS0_EE", !62, i64 0}
!62 = !{!"_ZTSSt12_Vector_baseI18VkSurfaceFormatKHRSaIS0_EE", !63, i64 0}
!63 = !{!"_ZTSNSt12_Vector_baseI18VkSurfaceFormatKHRSaIS0_EE12_Vector_implE", !64, i64 0}
!64 = !{!"_ZTSNSt12_Vector_baseI18VkSurfaceFormatKHRSaIS0_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!65 = !{!"_ZTSSt6vectorI16VkPresentModeKHRSaIS0_EE", !66, i64 0}
!66 = !{!"_ZTSSt12_Vector_baseI16VkPresentModeKHRSaIS0_EE", !67, i64 0}
!67 = !{!"_ZTSNSt12_Vector_baseI16VkPresentModeKHRSaIS0_EE12_Vector_implE", !68, i64 0}
!68 = !{!"_ZTSNSt12_Vector_baseI16VkPresentModeKHRSaIS0_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!69 = !{!70, !70, i64 0}
!70 = !{!"long", !7, i64 0}
!71 = !{!72, !6, i64 0}
!72 = !{!"_ZTS22VkDescriptorBufferInfo", !6, i64 0, !70, i64 8, !70, i64 16}
!73 = !{!72, !70, i64 8}
!74 = !{!72, !70, i64 16}
!75 = !{!76, !11, i64 0}
!76 = !{!"_ZTS20VkWriteDescriptorSet", !11, i64 0, !6, i64 8, !6, i64 16, !12, i64 24, !12, i64 28, !12, i64 32, !77, i64 36, !6, i64 40, !6, i64 48, !6, i64 56}
!77 = !{!"_ZTS16VkDescriptorType", !7, i64 0}
!78 = !{!76, !6, i64 16}
!79 = !{!76, !12, i64 24}
!80 = !{!76, !12, i64 28}
!81 = !{!76, !77, i64 36}
!82 = !{!76, !12, i64 32}
!83 = !{!76, !6, i64 48}
!84 = distinct !{!84, !85}
!85 = !{!"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.std::vector.45" = type { %"struct.std::_Vector_base.46" }
%"struct.std::_Vector_base.46" = type { %"struct.std::_Vector_base<VkDescriptorSetLayout_T *, std::allocator<VkDescriptorSetLayout_T *>>::_Vector_impl" }
%"struct.std::_Vector_base<VkDescriptorSetLayout_T *, std::allocator<VkDescriptorSetLayout_T *>>::_Vector_impl" = type { %"struct.std::_Vector_base<VkDescriptorSetLayout_T *, std::allocator<VkDescriptorSetLayout_T *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<VkDescriptorSetLayout_T *, std::allocator<VkDescriptorSetLayout_T *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator.47" = type { i8 }
%struct.VkDescriptorSetAllocateInfo = type { i32, ptr, ptr, i32, ptr }
%struct.VkDescriptorBufferInfo = type { ptr, i64, i64 }
%struct.VkWriteDescriptorSet = type { i32, ptr, ptr, i32, i32, i32, i32, ptr, ptr, ptr }

@_ZTISt13runtime_error = external constant ptr
@.str.4 = 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 @_ZN13BufferManager20createDescriptorSetsEv(ptr noundef nonnull align 8 dereferenceable(216) %0) local_unnamed_addr #4 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"class.std::vector.45", align 8
  %3 = alloca %"class.std::allocator.47", align 1
  %4 = alloca %struct.VkDescriptorSetAllocateInfo, align 8
  %5 = alloca %struct.VkDescriptorBufferInfo, align 8
  %6 = alloca %struct.VkWriteDescriptorSet, align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %2) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %3) #6
  call void @_ZNSaIP23VkDescriptorSetLayout_TEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #6
  invoke void @_ZNSt6vectorIP23VkDescriptorSetLayout_TSaIS1_EEC2EmRKS1_RKS2_(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef 2, ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef nonnull align 1 dereferenceable(1) %3)
          to label %7 unwind label %39

7:                                                ; preds = %1
  call void @_ZNSt15__new_allocatorIP23VkDescriptorSetLayout_TED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %3) #6
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %4) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(40) %4, i8 0, i64 32, i1 false)
  store i32 34, ptr %4, align 8, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %0, i64 200
  %9 = load ptr, ptr %8, align 8, !tbaa !12
  %10 = getelementptr inbounds i8, ptr %4, i64 16
  store ptr %9, ptr %10, align 8, !tbaa !31
  %11 = getelementptr inbounds i8, ptr %4, i64 24
  store i32 2, ptr %11, align 8, !tbaa !32
  %12 = call noundef ptr @_ZNKSt6vectorIP23VkDescriptorSetLayout_TSaIS1_EE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  %13 = getelementptr inbounds i8, ptr %4, i64 32
  store ptr %12, ptr %13, align 8, !tbaa !33
  %14 = getelementptr inbounds i8, ptr %0, i64 8
  invoke void @_ZNSt6vectorIP17VkDescriptorSet_TSaIS1_EE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %14, i64 noundef 2)
          to label %15 unwind label %41

15:                                               ; preds = %7
  %16 = getelementptr inbounds i8, ptr %0, i64 136
  %17 = load ptr, ptr %16, align 8, !tbaa !34
  %18 = getelementptr inbounds i8, ptr %17, i64 24
  %19 = load ptr, ptr %18, align 8, !tbaa !35
  %20 = call noundef ptr @_ZNSt6vectorIP17VkDescriptorSet_TSaIS1_EE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %14) #6
  %21 = invoke i32 @vkAllocateDescriptorSets(ptr noundef %19, ptr noundef nonnull %4, ptr noundef %20)
          to label %22 unwind label %41

22:                                               ; preds = %15
  %.not = icmp eq i32 %21, 0
  br i1 %.not, label %.preheader, label %36

.preheader:                                       ; preds = %22
  %23 = getelementptr inbounds i8, ptr %0, i64 88
  %24 = getelementptr inbounds i8, ptr %5, i64 8
  %25 = getelementptr inbounds i8, ptr %5, i64 16
  %26 = getelementptr inbounds i8, ptr %6, i64 16
  %27 = getelementptr inbounds i8, ptr %6, i64 24
  %28 = getelementptr inbounds i8, ptr %6, i64 48
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #6
  %29 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP10VkBuffer_TSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %23, i64 noundef 0) #6
  %30 = load ptr, ptr %29, align 8, !tbaa !68
  store ptr %30, ptr %5, align 8, !tbaa !69
  store i64 0, ptr %24, align 8, !tbaa !72
  store i64 192, ptr %25, align 8, !tbaa !73
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %6) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(64) %6, i8 0, i64 64, i1 false)
  store i32 35, ptr %6, align 8, !tbaa !74
  %31 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP17VkDescriptorSet_TSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %14, i64 noundef 0) #6
  %32 = load ptr, ptr %31, align 8, !tbaa !68
  store ptr %32, ptr %26, align 8, !tbaa !77
  store <4 x i32> <i32 0, i32 0, i32 1, i32 6>, ptr %27, align 8, !tbaa !78
  store ptr %5, ptr %28, align 8, !tbaa !79
  %33 = load ptr, ptr %16, align 8, !tbaa !34
  %34 = getelementptr inbounds i8, ptr %33, i64 24
  %35 = load ptr, ptr %34, align 8, !tbaa !35
  invoke void @vkUpdateDescriptorSets(ptr noundef %35, i32 noundef 1, ptr noundef nonnull %6, i32 noundef 0, ptr noundef null)
          to label %45 unwind label %54

36:                                               ; preds = %22
  %37 = call ptr @__cxa_allocate_exception(i64 16) #6
  invoke void @_ZNSt13runtime_errorC1EPKc(ptr noundef nonnull align 8 dereferenceable(16) %37, ptr noundef nonnull @.str.4)
          to label %38 unwind label %43

38:                                               ; preds = %36
  invoke void @__cxa_throw(ptr nonnull %37, ptr nonnull @_ZTISt13runtime_error, ptr nonnull @_ZNSt13runtime_errorD1Ev) #7
          to label %58 unwind label %41

39:                                               ; preds = %1
  %40 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIP23VkDescriptorSetLayout_TED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %3) #6
  br label %57

41:                                               ; preds = %38, %15, %7
  %42 = landingpad { ptr, i32 }
          cleanup
  br label %56

43:                                               ; preds = %36
  %44 = landingpad { ptr, i32 }
          cleanup
  call void @__cxa_free_exception(ptr %37) #6
  br label %56

45:                                               ; preds = %.preheader
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %5, i8 0, i64 24, i1 false)
  %46 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP10VkBuffer_TSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %23, i64 noundef 1) #6
  %47 = load ptr, ptr %46, align 8, !tbaa !68
  store ptr %47, ptr %5, align 8, !tbaa !69
  store i64 0, ptr %24, align 8, !tbaa !72
  store i64 192, ptr %25, align 8, !tbaa !73
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %6) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(64) %6, i8 0, i64 64, i1 false)
  store i32 35, ptr %6, align 8, !tbaa !74
  %48 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP17VkDescriptorSet_TSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %14, i64 noundef 1) #6
  %49 = load ptr, ptr %48, align 8, !tbaa !68
  store ptr %49, ptr %26, align 8, !tbaa !77
  store <4 x i32> <i32 0, i32 0, i32 1, i32 6>, ptr %27, align 8, !tbaa !78
  store ptr %5, ptr %28, align 8, !tbaa !79
  %50 = load ptr, ptr %16, align 8, !tbaa !34
  %51 = getelementptr inbounds i8, ptr %50, i64 24
  %52 = load ptr, ptr %51, align 8, !tbaa !35
  invoke void @vkUpdateDescriptorSets(ptr noundef %52, i32 noundef 1, ptr noundef nonnull %6, i32 noundef 0, ptr noundef null)
          to label %53 unwind label %54

53:                                               ; preds = %45
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %4) #6
  call void @_ZNSt6vectorIP23VkDescriptorSetLayout_TSaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #6
  ret void

54:                                               ; preds = %45, %.preheader
  %55 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #6
  br label %56

56:                                               ; preds = %54, %43, %41
  %.pn = phi { ptr, i32 } [ %42, %41 ], [ %44, %43 ], [ %55, %54 ]
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %4) #6
  call void @_ZNSt6vectorIP23VkDescriptorSetLayout_TSaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  br label %57

57:                                               ; preds = %56, %39
  %.pn.pn = phi { ptr, i32 } [ %.pn, %56 ], [ %40, %39 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #6
  resume { ptr, i32 } %.pn.pn

58:                                               ; preds = %38
  unreachable
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSaIP23VkDescriptorSetLayout_TEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIP23VkDescriptorSetLayout_TSaIS1_EEC2EmRKS1_RKS2_(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #4 align 2

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

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

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

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

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

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

declare void @vkUpdateDescriptorSets(ptr noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIP23VkDescriptorSetLayout_TED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #5 align 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 = { 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 #6 = { nounwind }
attributes #7 = { 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 = !{!"_ZTS27VkDescriptorSetAllocateInfo", !7, i64 0, !10, i64 8, !10, i64 16, !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 = !{!13, !10, i64 200}
!13 = !{!"_ZTS13BufferManager", !10, i64 0, !14, i64 8, !18, i64 32, !10, i64 48, !10, i64 56, !10, i64 64, !10, i64 72, !10, i64 80, !19, i64 88, !23, i64 112, !10, i64 136, !10, i64 144, !10, i64 152, !10, i64 160, !27, i64 168, !10, i64 192, !10, i64 200, !10, i64 208}
!14 = !{!"_ZTSSt6vectorIP17VkDescriptorSet_TSaIS1_EE", !15, i64 0}
!15 = !{!"_ZTSSt12_Vector_baseIP17VkDescriptorSet_TSaIS1_EE", !16, i64 0}
!16 = !{!"_ZTSNSt12_Vector_baseIP17VkDescriptorSet_TSaIS1_EE12_Vector_implE", !17, i64 0}
!17 = !{!"_ZTSNSt12_Vector_baseIP17VkDescriptorSet_TSaIS1_EE17_Vector_impl_dataE", !10, i64 0, !10, i64 8, !10, i64 16}
!18 = !{!"_ZTS21VulkanMemoryAllocator", !10, i64 0, !10, i64 8}
!19 = !{!"_ZTSSt6vectorIP10VkBuffer_TSaIS1_EE", !20, i64 0}
!20 = !{!"_ZTSSt12_Vector_baseIP10VkBuffer_TSaIS1_EE", !21, i64 0}
!21 = !{!"_ZTSNSt12_Vector_baseIP10VkBuffer_TSaIS1_EE12_Vector_implE", !22, i64 0}
!22 = !{!"_ZTSNSt12_Vector_baseIP10VkBuffer_TSaIS1_EE17_Vector_impl_dataE", !10, i64 0, !10, i64 8, !10, i64 16}
!23 = !{!"_ZTSSt6vectorIPvSaIS0_EE", !24, i64 0}
!24 = !{!"_ZTSSt12_Vector_baseIPvSaIS0_EE", !25, i64 0}
!25 = !{!"_ZTSNSt12_Vector_baseIPvSaIS0_EE12_Vector_implE", !26, i64 0}
!26 = !{!"_ZTSNSt12_Vector_baseIPvSaIS0_EE17_Vector_impl_dataE", !10, i64 0, !10, i64 8, !10, i64 16}
!27 = !{!"_ZTSSt6vectorIP15VmaAllocation_TSaIS1_EE", !28, i64 0}
!28 = !{!"_ZTSSt12_Vector_baseIP15VmaAllocation_TSaIS1_EE", !29, i64 0}
!29 = !{!"_ZTSNSt12_Vector_baseIP15VmaAllocation_TSaIS1_EE12_Vector_implE", !30, i64 0}
!30 = !{!"_ZTSNSt12_Vector_baseIP15VmaAllocation_TSaIS1_EE17_Vector_impl_dataE", !10, i64 0, !10, i64 8, !10, i64 16}
!31 = !{!6, !10, i64 16}
!32 = !{!6, !11, i64 24}
!33 = !{!6, !10, i64 32}
!34 = !{!13, !10, i64 136}
!35 = !{!36, !10, i64 24}
!36 = !{!"_ZTS19PresentationManager", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !37, i64 32, !10, i64 48, !43, i64 56, !44, i64 60, !45, i64 72, !42, i64 96, !49, i64 104, !53, i64 128, !57, i64 152}
!37 = !{!"_ZTS18QueueFamilyIndices", !38, i64 0, !38, i64 8}
!38 = !{!"_ZTSSt8optionalIjE", !39, i64 0}
!39 = !{!"_ZTSSt14_Optional_baseIjLb1ELb1EE", !40, i64 0}
!40 = !{!"_ZTSSt17_Optional_payloadIjLb1ELb1ELb1EE", !41, i64 0}
!41 = !{!"_ZTSSt22_Optional_payload_baseIjE", !8, i64 0, !42, i64 4}
!42 = !{!"bool", !8, i64 0}
!43 = !{!"_ZTS8VkFormat", !8, i64 0}
!44 = !{!"_ZTS10VkExtent2D", !11, i64 0, !11, i64 4}
!45 = !{!"_ZTSSt6vectorIP15VkFramebuffer_TSaIS1_EE", !46, i64 0}
!46 = !{!"_ZTSSt12_Vector_baseIP15VkFramebuffer_TSaIS1_EE", !47, i64 0}
!47 = !{!"_ZTSNSt12_Vector_baseIP15VkFramebuffer_TSaIS1_EE12_Vector_implE", !48, i64 0}
!48 = !{!"_ZTSNSt12_Vector_baseIP15VkFramebuffer_TSaIS1_EE17_Vector_impl_dataE", !10, i64 0, !10, i64 8, !10, i64 16}
!49 = !{!"_ZTSSt6vectorIP9VkImage_TSaIS1_EE", !50, i64 0}
!50 = !{!"_ZTSSt12_Vector_baseIP9VkImage_TSaIS1_EE", !51, i64 0}
!51 = !{!"_ZTSNSt12_Vector_baseIP9VkImage_TSaIS1_EE12_Vector_implE", !52, i64 0}
!52 = !{!"_ZTSNSt12_Vector_baseIP9VkImage_TSaIS1_EE17_Vector_impl_dataE", !10, i64 0, !10, i64 8, !10, i64 16}
!53 = !{!"_ZTSSt6vectorIP13VkImageView_TSaIS1_EE", !54, i64 0}
!54 = !{!"_ZTSSt12_Vector_baseIP13VkImageView_TSaIS1_EE", !55, i64 0}
!55 = !{!"_ZTSNSt12_Vector_baseIP13VkImageView_TSaIS1_EE12_Vector_implE", !56, i64 0}
!56 = !{!"_ZTSNSt12_Vector_baseIP13VkImageView_TSaIS1_EE17_Vector_impl_dataE", !10, i64 0, !10, i64 8, !10, i64 16}
!57 = !{!"_ZTS23SwapChainSupportDetails", !58, i64 0, !60, i64 56, !64, i64 80}
!58 = !{!"_ZTS24VkSurfaceCapabilitiesKHR", !11, i64 0, !11, i64 4, !44, i64 8, !44, i64 16, !44, i64 24, !11, i64 32, !11, i64 36, !59, i64 40, !11, i64 44, !11, i64 48}
!59 = !{!"_ZTS29VkSurfaceTransformFlagBitsKHR", !8, i64 0}
!60 = !{!"_ZTSSt6vectorI18VkSurfaceFormatKHRSaIS0_EE", !61, i64 0}
!61 = !{!"_ZTSSt12_Vector_baseI18VkSurfaceFormatKHRSaIS0_EE", !62, i64 0}
!62 = !{!"_ZTSNSt12_Vector_baseI18VkSurfaceFormatKHRSaIS0_EE12_Vector_implE", !63, i64 0}
!63 = !{!"_ZTSNSt12_Vector_baseI18VkSurfaceFormatKHRSaIS0_EE17_Vector_impl_dataE", !10, i64 0, !10, i64 8, !10, i64 16}
!64 = !{!"_ZTSSt6vectorI16VkPresentModeKHRSaIS0_EE", !65, i64 0}
!65 = !{!"_ZTSSt12_Vector_baseI16VkPresentModeKHRSaIS0_EE", !66, i64 0}
!66 = !{!"_ZTSNSt12_Vector_baseI16VkPresentModeKHRSaIS0_EE12_Vector_implE", !67, i64 0}
!67 = !{!"_ZTSNSt12_Vector_baseI16VkPresentModeKHRSaIS0_EE17_Vector_impl_dataE", !10, i64 0, !10, i64 8, !10, i64 16}
!68 = !{!10, !10, i64 0}
!69 = !{!70, !10, i64 0}
!70 = !{!"_ZTS22VkDescriptorBufferInfo", !10, i64 0, !71, i64 8, !71, i64 16}
!71 = !{!"long", !8, i64 0}
!72 = !{!70, !71, i64 8}
!73 = !{!70, !71, i64 16}
!74 = !{!75, !7, i64 0}
!75 = !{!"_ZTS20VkWriteDescriptorSet", !7, i64 0, !10, i64 8, !10, i64 16, !11, i64 24, !11, i64 28, !11, i64 32, !76, i64 36, !10, i64 40, !10, i64 48, !10, i64 56}
!76 = !{!"_ZTS16VkDescriptorType", !8, i64 0}
!77 = !{!75, !10, i64 16}
!78 = !{!8, !8, i64 0}
!79 = !{!75, !10, i64 48}


; Effective O3 passes: DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,LICMPass,LoopRotatePass,LoopSimplifyPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass