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

; 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.VmaAllocator_T = type <{ i8, [3 x i8], i32, i8, i8, i8, i8, i8, i8, [2 x i8], ptr, ptr, i8, [7 x i8], %struct.VkAllocationCallbacks, %struct.VmaDeviceMemoryCallbacks, %class.VmaAllocationObjectAllocator, i32, [4 x i8], %struct.VkPhysicalDeviceProperties, %struct.VkPhysicalDeviceMemoryProperties, [32 x ptr], [32 x %class.VmaDedicatedAllocationList], %struct.VmaCurrentBudgetData, %"struct.std::atomic", [4 x i8], i64, ptr, %"struct.std::atomic", %"struct.std::atomic", [32 x i32], %class.VmaRWMutex, %class.VmaIntrusiveLinkedList.14, i32, [4 x i8], %struct.VmaVulkanFunctions, i32, [4 x i8] }>
%struct.VkAllocationCallbacks = type { ptr, ptr, ptr, ptr, ptr, ptr }
%struct.VmaDeviceMemoryCallbacks = type { ptr, ptr, ptr }
%class.VmaAllocationObjectAllocator = type { %class.VmaMutex, %class.VmaPoolAllocator.11 }
%class.VmaMutex = type { %"class.std::mutex" }
%"class.std::mutex" = type { %"class.std::__mutex_base" }
%"class.std::__mutex_base" = type { %union.pthread_mutex_t }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%class.VmaPoolAllocator.11 = type { ptr, i32, %class.VmaVector.12 }
%class.VmaVector.12 = type { %struct.VmaStlAllocator.13, ptr, i64, i64 }
%struct.VmaStlAllocator.13 = type { ptr }
%struct.VkPhysicalDeviceProperties = type { i32, i32, i32, i32, i32, [256 x i8], [16 x i8], %struct.VkPhysicalDeviceLimits, %struct.VkPhysicalDeviceSparseProperties }
%struct.VkPhysicalDeviceLimits = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i64, i64, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, [3 x i32], i32, [3 x i32], i32, i32, i32, i32, i32, float, float, i32, [2 x i32], [2 x float], i32, i64, i64, i64, i64, i32, i32, i32, i32, float, float, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, float, i32, i32, i32, i32, [2 x float], [2 x float], float, float, i32, i32, i64, i64, i64 }
%struct.VkPhysicalDeviceSparseProperties = type { i32, i32, i32, i32, i32 }
%struct.VkPhysicalDeviceMemoryProperties = type { i32, [32 x %struct.VkMemoryType], i32, [16 x %struct.VkMemoryHeap] }
%struct.VkMemoryType = type { i32, i32 }
%struct.VkMemoryHeap = type { i64, i32 }
%class.VmaDedicatedAllocationList = type { i8, %class.VmaRWMutex, %class.VmaIntrusiveLinkedList }
%class.VmaIntrusiveLinkedList = type { ptr, ptr, i64 }
%struct.VmaCurrentBudgetData = type { [16 x %"struct.std::atomic"], [16 x %"struct.std::atomic"], [16 x %"struct.std::atomic.9"], [16 x %"struct.std::atomic.9"], %"struct.std::atomic", %class.VmaRWMutex, [16 x i64], [16 x i64], [16 x i64] }
%"struct.std::atomic.9" = type { %"struct.std::__atomic_base.10" }
%"struct.std::__atomic_base.10" = type { i64 }
%"struct.std::atomic" = type { %"struct.std::__atomic_base" }
%"struct.std::__atomic_base" = type { i32 }
%class.VmaRWMutex = type { %"class.std::shared_mutex" }
%"class.std::shared_mutex" = type { %"class.std::__shared_mutex_pthread" }
%"class.std::__shared_mutex_pthread" = type { %union.pthread_rwlock_t }
%union.pthread_rwlock_t = type { %struct.__pthread_rwlock_arch_t }
%struct.__pthread_rwlock_arch_t = type { i32, i32, i32, i32, i32, i32, i32, i32, i8, [7 x i8], i64, i32 }
%class.VmaIntrusiveLinkedList.14 = type { ptr, ptr, i64 }
%struct.VmaVulkanFunctions = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN20VmaCurrentBudgetData13AddAllocationEjm(ptr noundef nonnull align 8 dereferenceable(832), i32 noundef, i64 noundef) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN14VmaAllocator_T16FreeVulkanMemoryEjmP16VkDeviceMemory_T(ptr noundef nonnull align 8 dereferenceable(5916), i32 noundef, i64 noundef, ptr noundef) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN15VmaAllocation_T23InitDedicatedAllocationEP9VmaPool_TjP16VkDeviceMemory_T20VmaSuballocationTypePvm(ptr noundef nonnull align 8 dereferenceable(84), ptr noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef, i64 noundef) #2 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK14VmaAllocator_T26MemoryTypeIndexToHeapIndexEj(ptr noundef nonnull align 8 dereferenceable(5916), i32 noundef) #1 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN14VmaAllocator_T27AllocateDedicatedMemoryPageEP9VmaPool_Tm20VmaSuballocationTypejRK20VkMemoryAllocateInfobbbPvPP15VmaAllocation_T(ptr noundef nonnull align 8 dereferenceable(5916) %0, ptr noundef %1, i64 noundef %2, i32 noundef %3, i32 noundef %4, ptr noundef nonnull align 8 dereferenceable(32) %5, i1 noundef zeroext %6, i1 noundef zeroext %7, i1 noundef zeroext %8, ptr noundef %9, ptr noundef %10) #2 align 2 {
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca i64, align 8
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca ptr, align 8
  %19 = alloca i8, align 1
  %20 = alloca i8, align 1
  %21 = alloca i8, align 1
  %22 = alloca ptr, align 8
  %23 = alloca ptr, align 8
  %24 = alloca ptr, align 8
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca ptr, align 8
  store ptr %0, ptr %13, align 8, !tbaa !5
  store ptr %1, ptr %14, align 8, !tbaa !5
  store i64 %2, ptr %15, align 8, !tbaa !9
  store i32 %3, ptr %16, align 4, !tbaa !11
  store i32 %4, ptr %17, align 4, !tbaa !13
  store ptr %5, ptr %18, align 8, !tbaa !5
  %28 = zext i1 %6 to i8
  store i8 %28, ptr %19, align 1, !tbaa !15
  %29 = zext i1 %7 to i8
  store i8 %29, ptr %20, align 1, !tbaa !15
  %30 = zext i1 %8 to i8
  store i8 %30, ptr %21, align 1, !tbaa !15
  store ptr %9, ptr %22, align 8, !tbaa !5
  store ptr %10, ptr %23, align 8, !tbaa !5
  %31 = load ptr, ptr %13, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #3
  store ptr null, ptr %24, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #3
  %32 = load ptr, ptr %18, align 8, !tbaa !5
  %33 = call noundef i32 @_ZN14VmaAllocator_T20AllocateVulkanMemoryEPK20VkMemoryAllocateInfoPP16VkDeviceMemory_T(ptr noundef nonnull align 8 dereferenceable(5916) %31, ptr noundef %32, ptr noundef %24)
  store i32 %33, ptr %25, align 4, !tbaa !17
  %34 = load i32, ptr %25, align 4, !tbaa !17
  %35 = icmp slt i32 %34, 0
  br i1 %35, label %36, label %38

36:                                               ; preds = %11
  %37 = load i32, ptr %25, align 4, !tbaa !17
  store i32 %37, ptr %12, align 4
  store i32 1, ptr %26, align 4
  br label %85

38:                                               ; preds = %11
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #3
  store ptr null, ptr %27, align 8, !tbaa !5
  %39 = load i8, ptr %19, align 1, !tbaa !15, !range !19, !noundef !20
  %40 = trunc i8 %39 to i1
  br i1 %40, label %41, label %57

41:                                               ; preds = %38
  %42 = getelementptr inbounds %struct.VmaAllocator_T, ptr %31, i32 0, i32 35
  %43 = getelementptr inbounds %struct.VmaVulkanFunctions, ptr %42, i32 0, i32 6
  %44 = load ptr, ptr %43, align 8, !tbaa !21
  %45 = getelementptr inbounds %struct.VmaAllocator_T, ptr %31, i32 0, i32 10
  %46 = load ptr, ptr %45, align 8, !tbaa !46
  %47 = load ptr, ptr %24, align 8, !tbaa !5
  %48 = call noundef i32 %44(ptr noundef %46, ptr noundef %47, i64 noundef 0, i64 noundef -1, i32 noundef 0, ptr noundef %27)
  store i32 %48, ptr %25, align 4, !tbaa !17
  %49 = load i32, ptr %25, align 4, !tbaa !17
  %50 = icmp slt i32 %49, 0
  br i1 %50, label %51, label %56

51:                                               ; preds = %41
  %52 = load i32, ptr %17, align 4, !tbaa !13
  %53 = load i64, ptr %15, align 8, !tbaa !9
  %54 = load ptr, ptr %24, align 8, !tbaa !5
  call void @_ZN14VmaAllocator_T16FreeVulkanMemoryEjmP16VkDeviceMemory_T(ptr noundef nonnull align 8 dereferenceable(5916) %31, i32 noundef %52, i64 noundef %53, ptr noundef %54)
  %55 = load i32, ptr %25, align 4, !tbaa !17
  store i32 %55, ptr %12, align 4
  store i32 1, ptr %26, align 4
  br label %84

56:                                               ; preds = %41
  br label %57

57:                                               ; preds = %56, %38
  %58 = getelementptr inbounds %struct.VmaAllocator_T, ptr %31, i32 0, i32 16
  %59 = call noundef ptr @_ZN28VmaAllocationObjectAllocator8AllocateIJRbEEEP15VmaAllocation_TDpOT_(ptr noundef nonnull align 8 dereferenceable(88) %58, ptr noundef nonnull align 1 dereferenceable(1) %21)
  %60 = load ptr, ptr %23, align 8, !tbaa !5
  store ptr %59, ptr %60, align 8, !tbaa !5
  %61 = load ptr, ptr %23, align 8, !tbaa !5
  %62 = load ptr, ptr %61, align 8, !tbaa !5
  %63 = load ptr, ptr %14, align 8, !tbaa !5
  %64 = load i32, ptr %17, align 4, !tbaa !13
  %65 = load ptr, ptr %24, align 8, !tbaa !5
  %66 = load i32, ptr %16, align 4, !tbaa !11
  %67 = load ptr, ptr %27, align 8, !tbaa !5
  %68 = load i64, ptr %15, align 8, !tbaa !9
  call void @_ZN15VmaAllocation_T23InitDedicatedAllocationEP9VmaPool_TjP16VkDeviceMemory_T20VmaSuballocationTypePvm(ptr noundef nonnull align 8 dereferenceable(84) %62, ptr noundef %63, i32 noundef %64, ptr noundef %65, i32 noundef %66, ptr noundef %67, i64 noundef %68)
  %69 = load i8, ptr %20, align 1, !tbaa !15, !range !19, !noundef !20
  %70 = trunc i8 %69 to i1
  br i1 %70, label %71, label %75

71:                                               ; preds = %57
  %72 = load ptr, ptr %23, align 8, !tbaa !5
  %73 = load ptr, ptr %72, align 8, !tbaa !5
  %74 = load ptr, ptr %22, align 8, !tbaa !5
  call void @_ZN15VmaAllocation_T7SetNameEP14VmaAllocator_TPKc(ptr noundef nonnull align 8 dereferenceable(84) %73, ptr noundef %31, ptr noundef %74)
  br label %79

75:                                               ; preds = %57
  %76 = load ptr, ptr %23, align 8, !tbaa !5
  %77 = load ptr, ptr %76, align 8, !tbaa !5
  %78 = load ptr, ptr %22, align 8, !tbaa !5
  call void @_ZN15VmaAllocation_T11SetUserDataEP14VmaAllocator_TPv(ptr noundef nonnull align 8 dereferenceable(84) %77, ptr noundef %31, ptr noundef %78)
  br label %79

79:                                               ; preds = %75, %71
  %80 = getelementptr inbounds %struct.VmaAllocator_T, ptr %31, i32 0, i32 23
  %81 = load i32, ptr %17, align 4, !tbaa !13
  %82 = call noundef i32 @_ZNK14VmaAllocator_T26MemoryTypeIndexToHeapIndexEj(ptr noundef nonnull align 8 dereferenceable(5916) %31, i32 noundef %81)
  %83 = load i64, ptr %15, align 8, !tbaa !9
  call void @_ZN20VmaCurrentBudgetData13AddAllocationEjm(ptr noundef nonnull align 8 dereferenceable(832) %80, i32 noundef %82, i64 noundef %83)
  store i32 0, ptr %12, align 4
  store i32 1, ptr %26, align 4
  br label %84

84:                                               ; preds = %79, %51
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #3
  br label %85

85:                                               ; preds = %84, %36
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #3
  %86 = load i32, ptr %12, align 4
  ret i32 %86
}

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"_ZTS20VmaSuballocationType", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"bool", !7, i64 0}
!17 = !{!18, !18, i64 0}
!18 = !{!"_ZTS8VkResult", !7, i64 0}
!19 = !{i8 0, i8 2}
!20 = !{}
!21 = !{!22, !6, i64 5752}
!22 = !{!"_ZTS14VmaAllocator_T", !16, i64 0, !14, i64 4, !16, i64 8, !16, i64 9, !16, i64 10, !16, i64 11, !16, i64 12, !16, i64 13, !6, i64 16, !6, i64 24, !16, i64 32, !23, i64 40, !24, i64 88, !25, i64 112, !14, i64 200, !32, i64 208, !37, i64 1032, !7, i64 1552, !7, i64 1808, !38, i64 4624, !39, i64 5456, !10, i64 5464, !6, i64 5472, !39, i64 5480, !39, i64 5484, !7, i64 5488, !41, i64 5616, !44, i64 5672, !14, i64 5696, !45, i64 5704, !14, i64 5912}
!23 = !{!"_ZTS21VkAllocationCallbacks", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40}
!24 = !{!"_ZTS24VmaDeviceMemoryCallbacks", !6, i64 0, !6, i64 8, !6, i64 16}
!25 = !{!"_ZTS28VmaAllocationObjectAllocator", !26, i64 0, !29, i64 40}
!26 = !{!"_ZTS8VmaMutex", !27, i64 0}
!27 = !{!"_ZTSSt5mutex", !28, i64 0}
!28 = !{!"_ZTSSt12__mutex_base", !7, i64 0}
!29 = !{!"_ZTS16VmaPoolAllocatorI15VmaAllocation_TE", !6, i64 0, !14, i64 8, !30, i64 16}
!30 = !{!"_ZTS9VmaVectorIN16VmaPoolAllocatorI15VmaAllocation_TE9ItemBlockE15VmaStlAllocatorIS3_EE", !31, i64 0, !6, i64 8, !10, i64 16, !10, i64 24}
!31 = !{!"_ZTS15VmaStlAllocatorIN16VmaPoolAllocatorI15VmaAllocation_TE9ItemBlockEE", !6, i64 0}
!32 = !{!"_ZTS26VkPhysicalDeviceProperties", !14, i64 0, !14, i64 4, !14, i64 8, !14, i64 12, !33, i64 16, !7, i64 20, !7, i64 276, !34, i64 296, !36, i64 800}
!33 = !{!"_ZTS20VkPhysicalDeviceType", !7, i64 0}
!34 = !{!"_ZTS22VkPhysicalDeviceLimits", !14, i64 0, !14, i64 4, !14, i64 8, !14, i64 12, !14, i64 16, !14, i64 20, !14, i64 24, !14, i64 28, !14, i64 32, !14, i64 36, !14, i64 40, !10, i64 48, !10, i64 56, !14, i64 64, !14, i64 68, !14, i64 72, !14, i64 76, !14, i64 80, !14, i64 84, !14, i64 88, !14, i64 92, !14, i64 96, !14, i64 100, !14, i64 104, !14, i64 108, !14, i64 112, !14, i64 116, !14, i64 120, !14, i64 124, !14, i64 128, !14, i64 132, !14, i64 136, !14, i64 140, !14, i64 144, !14, i64 148, !14, i64 152, !14, i64 156, !14, i64 160, !14, i64 164, !14, i64 168, !14, i64 172, !14, i64 176, !14, i64 180, !14, i64 184, !14, i64 188, !14, i64 192, !14, i64 196, !14, i64 200, !14, i64 204, !14, i64 208, !14, i64 212, !14, i64 216, !7, i64 220, !14, i64 232, !7, i64 236, !14, i64 248, !14, i64 252, !14, i64 256, !14, i64 260, !14, i64 264, !35, i64 268, !35, i64 272, !14, i64 276, !7, i64 280, !7, i64 288, !14, i64 296, !10, i64 304, !10, i64 312, !10, i64 320, !10, i64 328, !14, i64 336, !14, i64 340, !14, i64 344, !14, i64 348, !35, i64 352, !35, i64 356, !14, i64 360, !14, i64 364, !14, i64 368, !14, i64 372, !14, i64 376, !14, i64 380, !14, i64 384, !14, i64 388, !14, i64 392, !14, i64 396, !14, i64 400, !14, i64 404, !14, i64 408, !14, i64 412, !14, i64 416, !14, i64 420, !35, i64 424, !14, i64 428, !14, i64 432, !14, i64 436, !14, i64 440, !7, i64 444, !7, i64 452, !35, i64 460, !35, i64 464, !14, i64 468, !14, i64 472, !10, i64 480, !10, i64 488, !10, i64 496}
!35 = !{!"float", !7, i64 0}
!36 = !{!"_ZTS32VkPhysicalDeviceSparseProperties", !14, i64 0, !14, i64 4, !14, i64 8, !14, i64 12, !14, i64 16}
!37 = !{!"_ZTS32VkPhysicalDeviceMemoryProperties", !14, i64 0, !7, i64 4, !14, i64 260, !7, i64 264}
!38 = !{!"_ZTS20VmaCurrentBudgetData", !7, i64 0, !7, i64 64, !7, i64 128, !7, i64 256, !39, i64 384, !41, i64 392, !7, i64 448, !7, i64 576, !7, i64 704}
!39 = !{!"_ZTSSt6atomicIjE", !40, i64 0}
!40 = !{!"_ZTSSt13__atomic_baseIjE", !14, i64 0}
!41 = !{!"_ZTS10VmaRWMutex", !42, i64 0}
!42 = !{!"_ZTSSt12shared_mutex", !43, i64 0}
!43 = !{!"_ZTSSt22__shared_mutex_pthread", !7, i64 0}
!44 = !{!"_ZTS22VmaIntrusiveLinkedListI21VmaPoolListItemTraitsE", !6, i64 0, !6, i64 8, !10, i64 16}
!45 = !{!"_ZTS18VmaVulkanFunctions", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !6, i64 184, !6, i64 192, !6, i64 200}
!46 = !{!22, !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"

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN20VmaCurrentBudgetData13AddAllocationEjm(ptr noundef nonnull align 8 dereferenceable(832), i32 noundef, i64 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN14VmaAllocator_T16FreeVulkanMemoryEjmP16VkDeviceMemory_T(ptr noundef nonnull align 8 dereferenceable(5916), i32 noundef, i64 noundef, ptr noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN15VmaAllocation_T23InitDedicatedAllocationEP9VmaPool_TjP16VkDeviceMemory_T20VmaSuballocationTypePvm(ptr noundef nonnull align 8 dereferenceable(84), ptr noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef, i64 noundef) local_unnamed_addr #2 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK14VmaAllocator_T26MemoryTypeIndexToHeapIndexEj(ptr noundef nonnull align 8 dereferenceable(5916), i32 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN15VmaAllocation_T11SetUserDataEP14VmaAllocator_TPv(ptr noundef nonnull align 8 dereferenceable(84), ptr noundef, ptr noundef) local_unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef range(i32 -2147483648, 1) i32 @_ZN14VmaAllocator_T27AllocateDedicatedMemoryPageEP9VmaPool_Tm20VmaSuballocationTypejRK20VkMemoryAllocateInfobbbPvPP15VmaAllocation_T(ptr noundef nonnull align 8 dereferenceable(5916) %0, ptr noundef %1, i64 noundef %2, i32 noundef %3, i32 noundef %4, ptr noundef nonnull align 8 dereferenceable(32) %5, i1 noundef zeroext %6, i1 noundef zeroext %7, i1 noundef zeroext %8, ptr noundef %9, ptr nocapture noundef %10) local_unnamed_addr #2 align 2 {
  %12 = alloca i8, align 1
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = zext i1 %8 to i8
  store i8 %15, ptr %12, align 1, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #3
  store ptr null, ptr %13, align 8, !tbaa !9
  %16 = call noundef i32 @_ZN14VmaAllocator_T20AllocateVulkanMemoryEPK20VkMemoryAllocateInfoPP16VkDeviceMemory_T(ptr noundef nonnull align 8 dereferenceable(5916) %0, ptr noundef nonnull %5, ptr noundef nonnull %13)
  %17 = icmp slt i32 %16, 0
  br i1 %17, label %41, label %18

18:                                               ; preds = %11
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #3
  store ptr null, ptr %14, align 8, !tbaa !9
  br i1 %6, label %19, label %29

19:                                               ; preds = %18
  %20 = getelementptr inbounds i8, ptr %0, i64 5752
  %21 = load ptr, ptr %20, align 8, !tbaa !11
  %22 = getelementptr inbounds i8, ptr %0, i64 16
  %23 = load ptr, ptr %22, align 8, !tbaa !38
  %24 = load ptr, ptr %13, align 8, !tbaa !9
  %25 = call noundef i32 %21(ptr noundef %23, ptr noundef %24, i64 noundef 0, i64 noundef -1, i32 noundef 0, ptr noundef nonnull %14)
  %26 = icmp slt i32 %25, 0
  br i1 %26, label %27, label %29

27:                                               ; preds = %19
  %28 = load ptr, ptr %13, align 8, !tbaa !9
  call void @_ZN14VmaAllocator_T16FreeVulkanMemoryEjmP16VkDeviceMemory_T(ptr noundef nonnull align 8 dereferenceable(5916) %0, i32 noundef %4, i64 noundef %2, ptr noundef %28)
  br label %40

29:                                               ; preds = %19, %18
  %30 = getelementptr inbounds i8, ptr %0, i64 112
  %31 = call noundef ptr @_ZN28VmaAllocationObjectAllocator8AllocateIJRbEEEP15VmaAllocation_TDpOT_(ptr noundef nonnull align 8 dereferenceable(88) %30, ptr noundef nonnull align 1 dereferenceable(1) %12)
  store ptr %31, ptr %10, align 8, !tbaa !9
  %32 = load ptr, ptr %13, align 8, !tbaa !9
  %33 = load ptr, ptr %14, align 8, !tbaa !9
  call void @_ZN15VmaAllocation_T23InitDedicatedAllocationEP9VmaPool_TjP16VkDeviceMemory_T20VmaSuballocationTypePvm(ptr noundef nonnull align 8 dereferenceable(84) %31, ptr noundef %1, i32 noundef %4, ptr noundef %32, i32 noundef %3, ptr noundef %33, i64 noundef %2)
  %34 = load ptr, ptr %10, align 8, !tbaa !9
  br i1 %7, label %35, label %36

35:                                               ; preds = %29
  call void @_ZN15VmaAllocation_T7SetNameEP14VmaAllocator_TPKc(ptr noundef nonnull align 8 dereferenceable(84) %34, ptr noundef nonnull %0, ptr noundef %9)
  br label %37

36:                                               ; preds = %29
  call void @_ZN15VmaAllocation_T11SetUserDataEP14VmaAllocator_TPv(ptr noundef nonnull align 8 dereferenceable(84) %34, ptr noundef nonnull %0, ptr noundef %9)
  br label %37

37:                                               ; preds = %36, %35
  %38 = getelementptr inbounds i8, ptr %0, i64 4624
  %39 = call noundef i32 @_ZNK14VmaAllocator_T26MemoryTypeIndexToHeapIndexEj(ptr noundef nonnull align 8 dereferenceable(5916) %0, i32 noundef %4)
  call void @_ZN20VmaCurrentBudgetData13AddAllocationEjm(ptr noundef nonnull align 8 dereferenceable(832) %38, i32 noundef %39, i64 noundef %2)
  br label %40

40:                                               ; preds = %37, %27
  %.0 = phi i32 [ %25, %27 ], [ 0, %37 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #3
  br label %41

41:                                               ; preds = %11, %40
  %.1 = phi i32 [ %.0, %40 ], [ %16, %11 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #3
  ret i32 %.1
}

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = !{!"bool", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !10, i64 5752}
!12 = !{!"_ZTS14VmaAllocator_T", !6, i64 0, !13, i64 4, !6, i64 8, !6, i64 9, !6, i64 10, !6, i64 11, !6, i64 12, !6, i64 13, !10, i64 16, !10, i64 24, !6, i64 32, !14, i64 40, !15, i64 88, !16, i64 112, !13, i64 200, !24, i64 208, !29, i64 1032, !7, i64 1552, !7, i64 1808, !30, i64 4624, !31, i64 5456, !23, i64 5464, !10, i64 5472, !31, i64 5480, !31, i64 5484, !7, i64 5488, !33, i64 5616, !36, i64 5672, !13, i64 5696, !37, i64 5704, !13, i64 5912}
!13 = !{!"int", !7, i64 0}
!14 = !{!"_ZTS21VkAllocationCallbacks", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40}
!15 = !{!"_ZTS24VmaDeviceMemoryCallbacks", !10, i64 0, !10, i64 8, !10, i64 16}
!16 = !{!"_ZTS28VmaAllocationObjectAllocator", !17, i64 0, !20, i64 40}
!17 = !{!"_ZTS8VmaMutex", !18, i64 0}
!18 = !{!"_ZTSSt5mutex", !19, i64 0}
!19 = !{!"_ZTSSt12__mutex_base", !7, i64 0}
!20 = !{!"_ZTS16VmaPoolAllocatorI15VmaAllocation_TE", !10, i64 0, !13, i64 8, !21, i64 16}
!21 = !{!"_ZTS9VmaVectorIN16VmaPoolAllocatorI15VmaAllocation_TE9ItemBlockE15VmaStlAllocatorIS3_EE", !22, i64 0, !10, i64 8, !23, i64 16, !23, i64 24}
!22 = !{!"_ZTS15VmaStlAllocatorIN16VmaPoolAllocatorI15VmaAllocation_TE9ItemBlockEE", !10, i64 0}
!23 = !{!"long", !7, i64 0}
!24 = !{!"_ZTS26VkPhysicalDeviceProperties", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !25, i64 16, !7, i64 20, !7, i64 276, !26, i64 296, !28, i64 800}
!25 = !{!"_ZTS20VkPhysicalDeviceType", !7, i64 0}
!26 = !{!"_ZTS22VkPhysicalDeviceLimits", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20, !13, i64 24, !13, i64 28, !13, i64 32, !13, i64 36, !13, i64 40, !23, i64 48, !23, i64 56, !13, i64 64, !13, i64 68, !13, i64 72, !13, i64 76, !13, i64 80, !13, i64 84, !13, i64 88, !13, i64 92, !13, i64 96, !13, i64 100, !13, i64 104, !13, i64 108, !13, i64 112, !13, i64 116, !13, i64 120, !13, i64 124, !13, i64 128, !13, i64 132, !13, i64 136, !13, i64 140, !13, i64 144, !13, i64 148, !13, i64 152, !13, i64 156, !13, i64 160, !13, i64 164, !13, i64 168, !13, i64 172, !13, i64 176, !13, i64 180, !13, i64 184, !13, i64 188, !13, i64 192, !13, i64 196, !13, i64 200, !13, i64 204, !13, i64 208, !13, i64 212, !13, i64 216, !7, i64 220, !13, i64 232, !7, i64 236, !13, i64 248, !13, i64 252, !13, i64 256, !13, i64 260, !13, i64 264, !27, i64 268, !27, i64 272, !13, i64 276, !7, i64 280, !7, i64 288, !13, i64 296, !23, i64 304, !23, i64 312, !23, i64 320, !23, i64 328, !13, i64 336, !13, i64 340, !13, i64 344, !13, i64 348, !27, i64 352, !27, i64 356, !13, i64 360, !13, i64 364, !13, i64 368, !13, i64 372, !13, i64 376, !13, i64 380, !13, i64 384, !13, i64 388, !13, i64 392, !13, i64 396, !13, i64 400, !13, i64 404, !13, i64 408, !13, i64 412, !13, i64 416, !13, i64 420, !27, i64 424, !13, i64 428, !13, i64 432, !13, i64 436, !13, i64 440, !7, i64 444, !7, i64 452, !27, i64 460, !27, i64 464, !13, i64 468, !13, i64 472, !23, i64 480, !23, i64 488, !23, i64 496}
!27 = !{!"float", !7, i64 0}
!28 = !{!"_ZTS32VkPhysicalDeviceSparseProperties", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !13, i64 16}
!29 = !{!"_ZTS32VkPhysicalDeviceMemoryProperties", !13, i64 0, !7, i64 4, !13, i64 260, !7, i64 264}
!30 = !{!"_ZTS20VmaCurrentBudgetData", !7, i64 0, !7, i64 64, !7, i64 128, !7, i64 256, !31, i64 384, !33, i64 392, !7, i64 448, !7, i64 576, !7, i64 704}
!31 = !{!"_ZTSSt6atomicIjE", !32, i64 0}
!32 = !{!"_ZTSSt13__atomic_baseIjE", !13, i64 0}
!33 = !{!"_ZTS10VmaRWMutex", !34, i64 0}
!34 = !{!"_ZTSSt12shared_mutex", !35, i64 0}
!35 = !{!"_ZTSSt22__shared_mutex_pthread", !7, i64 0}
!36 = !{!"_ZTS22VmaIntrusiveLinkedListI21VmaPoolListItemTraitsE", !10, i64 0, !10, i64 8, !23, i64 16}
!37 = !{!"_ZTS18VmaVulkanFunctions", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !10, i64 72, !10, i64 80, !10, i64 88, !10, i64 96, !10, i64 104, !10, i64 112, !10, i64 120, !10, i64 128, !10, i64 136, !10, i64 144, !10, i64 152, !10, i64 160, !10, i64 168, !10, i64 176, !10, i64 184, !10, i64 192, !10, i64 200}
!38 = !{!12, !10, i64 16}


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