; 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.VmaMutexLockRead = type { ptr }
%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 }
%struct.VmaBudget = type { %struct.VmaStatistics, i64, i64 }
%struct.VmaStatistics = type { i32, i32, i64, i64 }

; 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

declare i32 @__gxx_personality_v0(...)

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNKSt13__atomic_baseIjEcvjEv(ptr noundef nonnull align 4 dereferenceable(4)) #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN14VmaAllocator_T14GetHeapBudgetsEP9VmaBudgetjj(ptr noundef nonnull align 8 dereferenceable(5916) %0, ptr noundef %1, i32 noundef %2, i32 noundef %3) #1 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca %struct.VmaMutexLockRead, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store i32 %2, ptr %7, align 4, !tbaa !9
  store i32 %3, ptr %8, align 4, !tbaa !9
  %16 = load ptr, ptr %5, align 8
  %17 = getelementptr inbounds %struct.VmaAllocator_T, ptr %16, i32 0, i32 5
  %18 = load i8, ptr %17, align 2, !tbaa !11, !range !38, !noundef !39
  %19 = trunc i8 %18 to i1
  br i1 %19, label %20, label %150

20:                                               ; preds = %4
  %21 = getelementptr inbounds %struct.VmaAllocator_T, ptr %16, i32 0, i32 23
  %22 = getelementptr inbounds %struct.VmaCurrentBudgetData, ptr %21, i32 0, i32 4
  %23 = call noundef i32 @_ZNKSt13__atomic_baseIjEcvjEv(ptr noundef nonnull align 4 dereferenceable(4) %22) #4
  %24 = icmp ult i32 %23, 30
  br i1 %24, label %25, label %145

25:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %26 = getelementptr inbounds %struct.VmaAllocator_T, ptr %16, i32 0, i32 23
  %27 = getelementptr inbounds %struct.VmaCurrentBudgetData, ptr %26, i32 0, i32 5
  %28 = getelementptr inbounds %struct.VmaAllocator_T, ptr %16, i32 0, i32 0
  %29 = load i8, ptr %28, align 8, !tbaa !40, !range !38, !noundef !39
  %30 = trunc i8 %29 to i1
  call void @_ZN16VmaMutexLockReadC2ER10VmaRWMutexb(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(56) %27, i1 noundef zeroext %30)
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  store i32 0, ptr %10, align 4, !tbaa !9
  br label %31

31:                                               ; preds = %135, %25
  %32 = load i32, ptr %10, align 4, !tbaa !9
  %33 = load i32, ptr %8, align 4, !tbaa !9
  %34 = icmp ult i32 %32, %33
  br i1 %34, label %36, label %35

35:                                               ; preds = %31
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  br label %144

36:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  %37 = load i32, ptr %7, align 4, !tbaa !9
  %38 = load i32, ptr %10, align 4, !tbaa !9
  %39 = add i32 %37, %38
  store i32 %39, ptr %11, align 4, !tbaa !9
  %40 = getelementptr inbounds %struct.VmaAllocator_T, ptr %16, i32 0, i32 23
  %41 = getelementptr inbounds %struct.VmaCurrentBudgetData, ptr %40, i32 0, i32 0
  %42 = load i32, ptr %11, align 4, !tbaa !9
  %43 = zext i32 %42 to i64
  %44 = getelementptr inbounds [16 x %"struct.std::atomic"], ptr %41, i64 0, i64 %43
  %45 = call noundef i32 @_ZNKSt13__atomic_baseIjEcvjEv(ptr noundef nonnull align 4 dereferenceable(4) %44) #4
  %46 = load ptr, ptr %6, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.VmaBudget, ptr %46, i32 0, i32 0
  %48 = getelementptr inbounds %struct.VmaStatistics, ptr %47, i32 0, i32 0
  store i32 %45, ptr %48, align 8, !tbaa !41
  %49 = getelementptr inbounds %struct.VmaAllocator_T, ptr %16, i32 0, i32 23
  %50 = getelementptr inbounds %struct.VmaCurrentBudgetData, ptr %49, i32 0, i32 1
  %51 = load i32, ptr %11, align 4, !tbaa !9
  %52 = zext i32 %51 to i64
  %53 = getelementptr inbounds [16 x %"struct.std::atomic"], ptr %50, i64 0, i64 %52
  %54 = call noundef i32 @_ZNKSt13__atomic_baseIjEcvjEv(ptr noundef nonnull align 4 dereferenceable(4) %53) #4
  %55 = load ptr, ptr %6, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.VmaBudget, ptr %55, i32 0, i32 0
  %57 = getelementptr inbounds %struct.VmaStatistics, ptr %56, i32 0, i32 1
  store i32 %54, ptr %57, align 4, !tbaa !44
  %58 = getelementptr inbounds %struct.VmaAllocator_T, ptr %16, i32 0, i32 23
  %59 = getelementptr inbounds %struct.VmaCurrentBudgetData, ptr %58, i32 0, i32 2
  %60 = load i32, ptr %11, align 4, !tbaa !9
  %61 = zext i32 %60 to i64
  %62 = getelementptr inbounds [16 x %"struct.std::atomic.9"], ptr %59, i64 0, i64 %61
  %63 = call noundef i64 @_ZNKSt13__atomic_baseImEcvmEv(ptr noundef nonnull align 8 dereferenceable(8) %62) #4
  %64 = load ptr, ptr %6, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.VmaBudget, ptr %64, i32 0, i32 0
  %66 = getelementptr inbounds %struct.VmaStatistics, ptr %65, i32 0, i32 2
  store i64 %63, ptr %66, align 8, !tbaa !45
  %67 = getelementptr inbounds %struct.VmaAllocator_T, ptr %16, i32 0, i32 23
  %68 = getelementptr inbounds %struct.VmaCurrentBudgetData, ptr %67, i32 0, i32 3
  %69 = load i32, ptr %11, align 4, !tbaa !9
  %70 = zext i32 %69 to i64
  %71 = getelementptr inbounds [16 x %"struct.std::atomic.9"], ptr %68, i64 0, i64 %70
  %72 = call noundef i64 @_ZNKSt13__atomic_baseImEcvmEv(ptr noundef nonnull align 8 dereferenceable(8) %71) #4
  %73 = load ptr, ptr %6, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.VmaBudget, ptr %73, i32 0, i32 0
  %75 = getelementptr inbounds %struct.VmaStatistics, ptr %74, i32 0, i32 3
  store i64 %72, ptr %75, align 8, !tbaa !46
  %76 = getelementptr inbounds %struct.VmaAllocator_T, ptr %16, i32 0, i32 23
  %77 = getelementptr inbounds %struct.VmaCurrentBudgetData, ptr %76, i32 0, i32 6
  %78 = load i32, ptr %11, align 4, !tbaa !9
  %79 = zext i32 %78 to i64
  %80 = getelementptr inbounds [16 x i64], ptr %77, i64 0, i64 %79
  %81 = load i64, ptr %80, align 8, !tbaa !47
  %82 = load ptr, ptr %6, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.VmaBudget, ptr %82, i32 0, i32 0
  %84 = getelementptr inbounds %struct.VmaStatistics, ptr %83, i32 0, i32 2
  %85 = load i64, ptr %84, align 8, !tbaa !45
  %86 = add i64 %81, %85
  %87 = getelementptr inbounds %struct.VmaAllocator_T, ptr %16, i32 0, i32 23
  %88 = getelementptr inbounds %struct.VmaCurrentBudgetData, ptr %87, i32 0, i32 8
  %89 = load i32, ptr %11, align 4, !tbaa !9
  %90 = zext i32 %89 to i64
  %91 = getelementptr inbounds [16 x i64], ptr %88, i64 0, i64 %90
  %92 = load i64, ptr %91, align 8, !tbaa !47
  %93 = icmp ugt i64 %86, %92
  br i1 %93, label %94, label %115

94:                                               ; preds = %36
  %95 = getelementptr inbounds %struct.VmaAllocator_T, ptr %16, i32 0, i32 23
  %96 = getelementptr inbounds %struct.VmaCurrentBudgetData, ptr %95, i32 0, i32 6
  %97 = load i32, ptr %11, align 4, !tbaa !9
  %98 = zext i32 %97 to i64
  %99 = getelementptr inbounds [16 x i64], ptr %96, i64 0, i64 %98
  %100 = load i64, ptr %99, align 8, !tbaa !47
  %101 = load ptr, ptr %6, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.VmaBudget, ptr %101, i32 0, i32 0
  %103 = getelementptr inbounds %struct.VmaStatistics, ptr %102, i32 0, i32 2
  %104 = load i64, ptr %103, align 8, !tbaa !45
  %105 = add i64 %100, %104
  %106 = getelementptr inbounds %struct.VmaAllocator_T, ptr %16, i32 0, i32 23
  %107 = getelementptr inbounds %struct.VmaCurrentBudgetData, ptr %106, i32 0, i32 8
  %108 = load i32, ptr %11, align 4, !tbaa !9
  %109 = zext i32 %108 to i64
  %110 = getelementptr inbounds [16 x i64], ptr %107, i64 0, i64 %109
  %111 = load i64, ptr %110, align 8, !tbaa !47
  %112 = sub i64 %105, %111
  %113 = load ptr, ptr %6, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.VmaBudget, ptr %113, i32 0, i32 1
  store i64 %112, ptr %114, align 8, !tbaa !48
  br label %118

115:                                              ; preds = %36
  %116 = load ptr, ptr %6, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.VmaBudget, ptr %116, i32 0, i32 1
  store i64 0, ptr %117, align 8, !tbaa !48
  br label %118

118:                                              ; preds = %115, %94
  %119 = getelementptr inbounds %struct.VmaAllocator_T, ptr %16, i32 0, i32 23
  %120 = getelementptr inbounds %struct.VmaCurrentBudgetData, ptr %119, i32 0, i32 7
  %121 = load i32, ptr %11, align 4, !tbaa !9
  %122 = zext i32 %121 to i64
  %123 = getelementptr inbounds [16 x i64], ptr %120, i64 0, i64 %122
  %124 = getelementptr inbounds %struct.VmaAllocator_T, ptr %16, i32 0, i32 20
  %125 = getelementptr inbounds %struct.VkPhysicalDeviceMemoryProperties, ptr %124, i32 0, i32 3
  %126 = load i32, ptr %11, align 4, !tbaa !9
  %127 = zext i32 %126 to i64
  %128 = getelementptr inbounds [16 x %struct.VkMemoryHeap], ptr %125, i64 0, i64 %127
  %129 = getelementptr inbounds %struct.VkMemoryHeap, ptr %128, i32 0, i32 0
  %130 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minImERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %123, ptr noundef nonnull align 8 dereferenceable(8) %129)
          to label %131 unwind label %140

131:                                              ; preds = %118
  %132 = load i64, ptr %130, align 8, !tbaa !47
  %133 = load ptr, ptr %6, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct.VmaBudget, ptr %133, i32 0, i32 2
  store i64 %132, ptr %134, align 8, !tbaa !49
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  br label %135

135:                                              ; preds = %131
  %136 = load i32, ptr %10, align 4, !tbaa !9
  %137 = add i32 %136, 1
  store i32 %137, ptr %10, align 4, !tbaa !9
  %138 = load ptr, ptr %6, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct.VmaBudget, ptr %138, i32 1
  store ptr %139, ptr %6, align 8, !tbaa !5
  br label %31, !llvm.loop !50

140:                                              ; preds = %118
  %141 = landingpad { ptr, i32 }
          cleanup
  %142 = extractvalue { ptr, i32 } %141, 0
  store ptr %142, ptr %12, align 8
  %143 = extractvalue { ptr, i32 } %141, 1
  store i32 %143, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  call void @_ZN16VmaMutexLockReadD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  br label %220

144:                                              ; preds = %35
  call void @_ZN16VmaMutexLockReadD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  br label %149

145:                                              ; preds = %20
  call void @_ZN14VmaAllocator_T18UpdateVulkanBudgetEv(ptr noundef nonnull align 8 dereferenceable(5916) %16)
  %146 = load ptr, ptr %6, align 8, !tbaa !5
  %147 = load i32, ptr %7, align 4, !tbaa !9
  %148 = load i32, ptr %8, align 4, !tbaa !9
  call void @_ZN14VmaAllocator_T14GetHeapBudgetsEP9VmaBudgetjj(ptr noundef nonnull align 8 dereferenceable(5916) %16, ptr noundef %146, i32 noundef %147, i32 noundef %148)
  br label %149

149:                                              ; preds = %145, %144
  br label %219

150:                                              ; preds = %4
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  store i32 0, ptr %14, align 4, !tbaa !9
  br label %151

151:                                              ; preds = %213, %150
  %152 = load i32, ptr %14, align 4, !tbaa !9
  %153 = load i32, ptr %8, align 4, !tbaa !9
  %154 = icmp ult i32 %152, %153
  br i1 %154, label %156, label %155

155:                                              ; preds = %151
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  br label %218

156:                                              ; preds = %151
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  %157 = load i32, ptr %7, align 4, !tbaa !9
  %158 = load i32, ptr %14, align 4, !tbaa !9
  %159 = add i32 %157, %158
  store i32 %159, ptr %15, align 4, !tbaa !9
  %160 = getelementptr inbounds %struct.VmaAllocator_T, ptr %16, i32 0, i32 23
  %161 = getelementptr inbounds %struct.VmaCurrentBudgetData, ptr %160, i32 0, i32 0
  %162 = load i32, ptr %15, align 4, !tbaa !9
  %163 = zext i32 %162 to i64
  %164 = getelementptr inbounds [16 x %"struct.std::atomic"], ptr %161, i64 0, i64 %163
  %165 = call noundef i32 @_ZNKSt13__atomic_baseIjEcvjEv(ptr noundef nonnull align 4 dereferenceable(4) %164) #4
  %166 = load ptr, ptr %6, align 8, !tbaa !5
  %167 = getelementptr inbounds %struct.VmaBudget, ptr %166, i32 0, i32 0
  %168 = getelementptr inbounds %struct.VmaStatistics, ptr %167, i32 0, i32 0
  store i32 %165, ptr %168, align 8, !tbaa !41
  %169 = getelementptr inbounds %struct.VmaAllocator_T, ptr %16, i32 0, i32 23
  %170 = getelementptr inbounds %struct.VmaCurrentBudgetData, ptr %169, i32 0, i32 1
  %171 = load i32, ptr %15, align 4, !tbaa !9
  %172 = zext i32 %171 to i64
  %173 = getelementptr inbounds [16 x %"struct.std::atomic"], ptr %170, i64 0, i64 %172
  %174 = call noundef i32 @_ZNKSt13__atomic_baseIjEcvjEv(ptr noundef nonnull align 4 dereferenceable(4) %173) #4
  %175 = load ptr, ptr %6, align 8, !tbaa !5
  %176 = getelementptr inbounds %struct.VmaBudget, ptr %175, i32 0, i32 0
  %177 = getelementptr inbounds %struct.VmaStatistics, ptr %176, i32 0, i32 1
  store i32 %174, ptr %177, align 4, !tbaa !44
  %178 = getelementptr inbounds %struct.VmaAllocator_T, ptr %16, i32 0, i32 23
  %179 = getelementptr inbounds %struct.VmaCurrentBudgetData, ptr %178, i32 0, i32 2
  %180 = load i32, ptr %15, align 4, !tbaa !9
  %181 = zext i32 %180 to i64
  %182 = getelementptr inbounds [16 x %"struct.std::atomic.9"], ptr %179, i64 0, i64 %181
  %183 = call noundef i64 @_ZNKSt13__atomic_baseImEcvmEv(ptr noundef nonnull align 8 dereferenceable(8) %182) #4
  %184 = load ptr, ptr %6, align 8, !tbaa !5
  %185 = getelementptr inbounds %struct.VmaBudget, ptr %184, i32 0, i32 0
  %186 = getelementptr inbounds %struct.VmaStatistics, ptr %185, i32 0, i32 2
  store i64 %183, ptr %186, align 8, !tbaa !45
  %187 = getelementptr inbounds %struct.VmaAllocator_T, ptr %16, i32 0, i32 23
  %188 = getelementptr inbounds %struct.VmaCurrentBudgetData, ptr %187, i32 0, i32 3
  %189 = load i32, ptr %15, align 4, !tbaa !9
  %190 = zext i32 %189 to i64
  %191 = getelementptr inbounds [16 x %"struct.std::atomic.9"], ptr %188, i64 0, i64 %190
  %192 = call noundef i64 @_ZNKSt13__atomic_baseImEcvmEv(ptr noundef nonnull align 8 dereferenceable(8) %191) #4
  %193 = load ptr, ptr %6, align 8, !tbaa !5
  %194 = getelementptr inbounds %struct.VmaBudget, ptr %193, i32 0, i32 0
  %195 = getelementptr inbounds %struct.VmaStatistics, ptr %194, i32 0, i32 3
  store i64 %192, ptr %195, align 8, !tbaa !46
  %196 = load ptr, ptr %6, align 8, !tbaa !5
  %197 = getelementptr inbounds %struct.VmaBudget, ptr %196, i32 0, i32 0
  %198 = getelementptr inbounds %struct.VmaStatistics, ptr %197, i32 0, i32 2
  %199 = load i64, ptr %198, align 8, !tbaa !45
  %200 = load ptr, ptr %6, align 8, !tbaa !5
  %201 = getelementptr inbounds %struct.VmaBudget, ptr %200, i32 0, i32 1
  store i64 %199, ptr %201, align 8, !tbaa !48
  %202 = getelementptr inbounds %struct.VmaAllocator_T, ptr %16, i32 0, i32 20
  %203 = getelementptr inbounds %struct.VkPhysicalDeviceMemoryProperties, ptr %202, i32 0, i32 3
  %204 = load i32, ptr %15, align 4, !tbaa !9
  %205 = zext i32 %204 to i64
  %206 = getelementptr inbounds [16 x %struct.VkMemoryHeap], ptr %203, i64 0, i64 %205
  %207 = getelementptr inbounds %struct.VkMemoryHeap, ptr %206, i32 0, i32 0
  %208 = load i64, ptr %207, align 8, !tbaa !52
  %209 = mul i64 %208, 8
  %210 = udiv i64 %209, 10
  %211 = load ptr, ptr %6, align 8, !tbaa !5
  %212 = getelementptr inbounds %struct.VmaBudget, ptr %211, i32 0, i32 2
  store i64 %210, ptr %212, align 8, !tbaa !49
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  br label %213

213:                                              ; preds = %156
  %214 = load i32, ptr %14, align 4, !tbaa !9
  %215 = add i32 %214, 1
  store i32 %215, ptr %14, align 4, !tbaa !9
  %216 = load ptr, ptr %6, align 8, !tbaa !5
  %217 = getelementptr inbounds %struct.VmaBudget, ptr %216, i32 1
  store ptr %217, ptr %6, align 8, !tbaa !5
  br label %151, !llvm.loop !54

218:                                              ; preds = %155
  br label %219

219:                                              ; preds = %218, %149
  ret void

220:                                              ; preds = %140
  %221 = load ptr, ptr %12, align 8
  %222 = load i32, ptr %13, align 4
  %223 = insertvalue { ptr, i32 } poison, ptr %221, 0
  %224 = insertvalue { ptr, i32 } %223, i32 %222, 1
  resume { ptr, i32 } %224
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN14VmaAllocator_T18UpdateVulkanBudgetEv(ptr noundef nonnull align 8 dereferenceable(5916)) #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minImERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #3

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

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !13, i64 10}
!12 = !{!"_ZTS14VmaAllocator_T", !13, i64 0, !10, i64 4, !13, i64 8, !13, i64 9, !13, i64 10, !13, i64 11, !13, i64 12, !13, i64 13, !6, i64 16, !6, i64 24, !13, i64 32, !14, i64 40, !15, i64 88, !16, i64 112, !10, i64 200, !24, i64 208, !29, i64 1032, !7, i64 1552, !7, i64 1808, !30, i64 4624, !31, i64 5456, !23, i64 5464, !6, i64 5472, !31, i64 5480, !31, i64 5484, !7, i64 5488, !33, i64 5616, !36, i64 5672, !10, i64 5696, !37, i64 5704, !10, i64 5912}
!13 = !{!"bool", !7, i64 0}
!14 = !{!"_ZTS21VkAllocationCallbacks", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40}
!15 = !{!"_ZTS24VmaDeviceMemoryCallbacks", !6, i64 0, !6, i64 8, !6, 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", !6, i64 0, !10, i64 8, !21, i64 16}
!21 = !{!"_ZTS9VmaVectorIN16VmaPoolAllocatorI15VmaAllocation_TE9ItemBlockE15VmaStlAllocatorIS3_EE", !22, i64 0, !6, i64 8, !23, i64 16, !23, i64 24}
!22 = !{!"_ZTS15VmaStlAllocatorIN16VmaPoolAllocatorI15VmaAllocation_TE9ItemBlockEE", !6, i64 0}
!23 = !{!"long", !7, i64 0}
!24 = !{!"_ZTS26VkPhysicalDeviceProperties", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !25, i64 16, !7, i64 20, !7, i64 276, !26, i64 296, !28, i64 800}
!25 = !{!"_ZTS20VkPhysicalDeviceType", !7, i64 0}
!26 = !{!"_ZTS22VkPhysicalDeviceLimits", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !10, i64 40, !23, i64 48, !23, i64 56, !10, i64 64, !10, i64 68, !10, i64 72, !10, i64 76, !10, i64 80, !10, i64 84, !10, i64 88, !10, i64 92, !10, i64 96, !10, i64 100, !10, i64 104, !10, i64 108, !10, i64 112, !10, i64 116, !10, i64 120, !10, i64 124, !10, i64 128, !10, i64 132, !10, i64 136, !10, i64 140, !10, i64 144, !10, i64 148, !10, i64 152, !10, i64 156, !10, i64 160, !10, i64 164, !10, i64 168, !10, i64 172, !10, i64 176, !10, i64 180, !10, i64 184, !10, i64 188, !10, i64 192, !10, i64 196, !10, i64 200, !10, i64 204, !10, i64 208, !10, i64 212, !10, i64 216, !7, i64 220, !10, i64 232, !7, i64 236, !10, i64 248, !10, i64 252, !10, i64 256, !10, i64 260, !10, i64 264, !27, i64 268, !27, i64 272, !10, i64 276, !7, i64 280, !7, i64 288, !10, i64 296, !23, i64 304, !23, i64 312, !23, i64 320, !23, i64 328, !10, i64 336, !10, i64 340, !10, i64 344, !10, i64 348, !27, i64 352, !27, i64 356, !10, i64 360, !10, i64 364, !10, i64 368, !10, i64 372, !10, i64 376, !10, i64 380, !10, i64 384, !10, i64 388, !10, i64 392, !10, i64 396, !10, i64 400, !10, i64 404, !10, i64 408, !10, i64 412, !10, i64 416, !10, i64 420, !27, i64 424, !10, i64 428, !10, i64 432, !10, i64 436, !10, i64 440, !7, i64 444, !7, i64 452, !27, i64 460, !27, i64 464, !10, i64 468, !10, i64 472, !23, i64 480, !23, i64 488, !23, i64 496}
!27 = !{!"float", !7, i64 0}
!28 = !{!"_ZTS32VkPhysicalDeviceSparseProperties", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16}
!29 = !{!"_ZTS32VkPhysicalDeviceMemoryProperties", !10, i64 0, !7, i64 4, !10, 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", !10, i64 0}
!33 = !{!"_ZTS10VmaRWMutex", !34, i64 0}
!34 = !{!"_ZTSSt12shared_mutex", !35, i64 0}
!35 = !{!"_ZTSSt22__shared_mutex_pthread", !7, i64 0}
!36 = !{!"_ZTS22VmaIntrusiveLinkedListI21VmaPoolListItemTraitsE", !6, i64 0, !6, i64 8, !23, i64 16}
!37 = !{!"_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}
!38 = !{i8 0, i8 2}
!39 = !{}
!40 = !{!12, !13, i64 0}
!41 = !{!42, !10, i64 0}
!42 = !{!"_ZTS9VmaBudget", !43, i64 0, !23, i64 24, !23, i64 32}
!43 = !{!"_ZTS13VmaStatistics", !10, i64 0, !10, i64 4, !23, i64 8, !23, i64 16}
!44 = !{!42, !10, i64 4}
!45 = !{!42, !23, i64 8}
!46 = !{!42, !23, i64 16}
!47 = !{!23, !23, i64 0}
!48 = !{!42, !23, i64 24}
!49 = !{!42, !23, i64 32}
!50 = distinct !{!50, !51}
!51 = !{!"llvm.loop.mustprogress"}
!52 = !{!53, !23, i64 0}
!53 = !{!"_ZTS12VkMemoryHeap", !23, i64 0, !10, i64 8}
!54 = distinct !{!54, !51}


; 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.VmaMutexLockRead = type { ptr }
%"struct.std::atomic" = type { %"struct.std::__atomic_base" }
%"struct.std::__atomic_base" = type { i32 }
%"struct.std::atomic.9" = type { %"struct.std::__atomic_base.10" }
%"struct.std::__atomic_base.10" = type { i64 }
%struct.VkMemoryHeap = type { i64, i32 }

; 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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN14VmaAllocator_T14GetHeapBudgetsEP9VmaBudgetjj(ptr noundef nonnull align 8 dereferenceable(5916) %0, ptr nocapture noundef %1, i32 noundef %2, i32 noundef %3) local_unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca %struct.VmaMutexLockRead, align 8
  %6 = getelementptr inbounds i8, ptr %0, i64 10
  %7 = load i8, ptr %6, align 2, !tbaa !5, !range !36, !noundef !37
  %8 = trunc nuw i8 %7 to i1
  br i1 %8, label %.lr.ph, label %.preheader

.lr.ph:                                           ; preds = %4
  %9 = getelementptr inbounds i8, ptr %0, i64 5008
  br label %15

.preheader:                                       ; preds = %tailrecurse, %4
  %.not = icmp eq i32 %3, 0
  br i1 %.not, label %.loopexit, label %.lr.ph55

.lr.ph55:                                         ; preds = %.preheader
  %10 = getelementptr inbounds i8, ptr %0, i64 4624
  %11 = getelementptr inbounds i8, ptr %0, i64 4688
  %12 = getelementptr inbounds i8, ptr %0, i64 4752
  %13 = getelementptr inbounds i8, ptr %0, i64 4880
  %14 = getelementptr inbounds i8, ptr %0, i64 1296
  %wide.trip.count = zext i32 %3 to i64
  br label %60

15:                                               ; preds = %.lr.ph, %tailrecurse
  %16 = tail call noundef i32 @_ZNKSt13__atomic_baseIjEcvjEv(ptr noundef nonnull align 4 dereferenceable(4) %9) #5
  %17 = icmp ult i32 %16, 30
  br i1 %17, label %18, label %tailrecurse

18:                                               ; preds = %15
  %19 = getelementptr inbounds i8, ptr %0, i64 4624
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  %20 = getelementptr inbounds i8, ptr %0, i64 5016
  %21 = load i8, ptr %0, align 8, !tbaa !38, !range !36, !noundef !37
  %22 = trunc nuw i8 %21 to i1
  call void @_ZN16VmaMutexLockReadC2ER10VmaRWMutexb(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(56) %20, i1 noundef zeroext %22)
  %.not59 = icmp eq i32 %3, 0
  br i1 %.not59, label %._crit_edge, label %.lr.ph58

.lr.ph58:                                         ; preds = %18
  %23 = getelementptr inbounds i8, ptr %0, i64 4688
  %24 = getelementptr inbounds i8, ptr %0, i64 4752
  %25 = getelementptr inbounds i8, ptr %0, i64 4880
  %26 = getelementptr inbounds i8, ptr %0, i64 5072
  %27 = getelementptr inbounds i8, ptr %0, i64 5328
  %28 = getelementptr inbounds i8, ptr %0, i64 5200
  %29 = getelementptr inbounds i8, ptr %0, i64 1296
  %wide.trip.count64 = zext i32 %3 to i64
  br label %30

._crit_edge:                                      ; preds = %30, %18
  call void @_ZN16VmaMutexLockReadD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  br label %.loopexit

30:                                               ; preds = %.lr.ph58, %30
  %indvars.iv61 = phi i64 [ 0, %.lr.ph58 ], [ %indvars.iv.next62, %30 ]
  %.057 = phi ptr [ %1, %.lr.ph58 ], [ %57, %30 ]
  %31 = trunc nuw i64 %indvars.iv61 to i32
  %32 = add i32 %31, %2
  %33 = zext i32 %32 to i64
  %34 = getelementptr inbounds [16 x %"struct.std::atomic"], ptr %19, i64 0, i64 %33
  %35 = call noundef i32 @_ZNKSt13__atomic_baseIjEcvjEv(ptr noundef nonnull align 4 dereferenceable(4) %34) #5
  store i32 %35, ptr %.057, align 8, !tbaa !39
  %36 = getelementptr inbounds [16 x %"struct.std::atomic"], ptr %23, i64 0, i64 %33
  %37 = call noundef i32 @_ZNKSt13__atomic_baseIjEcvjEv(ptr noundef nonnull align 4 dereferenceable(4) %36) #5
  %38 = getelementptr inbounds i8, ptr %.057, i64 4
  store i32 %37, ptr %38, align 4, !tbaa !42
  %39 = getelementptr inbounds [16 x %"struct.std::atomic.9"], ptr %24, i64 0, i64 %33
  %40 = call noundef i64 @_ZNKSt13__atomic_baseImEcvmEv(ptr noundef nonnull align 8 dereferenceable(8) %39) #5
  %41 = getelementptr inbounds i8, ptr %.057, i64 8
  store i64 %40, ptr %41, align 8, !tbaa !43
  %42 = getelementptr inbounds [16 x %"struct.std::atomic.9"], ptr %25, i64 0, i64 %33
  %43 = call noundef i64 @_ZNKSt13__atomic_baseImEcvmEv(ptr noundef nonnull align 8 dereferenceable(8) %42) #5
  %44 = getelementptr inbounds i8, ptr %.057, i64 16
  store i64 %43, ptr %44, align 8, !tbaa !44
  %45 = getelementptr inbounds [16 x i64], ptr %26, i64 0, i64 %33
  %46 = load i64, ptr %45, align 8, !tbaa !45
  %47 = load i64, ptr %41, align 8, !tbaa !43
  %48 = add i64 %47, %46
  %49 = getelementptr inbounds [16 x i64], ptr %27, i64 0, i64 %33
  %50 = load i64, ptr %49, align 8, !tbaa !45
  %spec.select = call i64 @llvm.usub.sat.i64(i64 %48, i64 %50)
  %51 = getelementptr inbounds i8, ptr %.057, i64 24
  store i64 %spec.select, ptr %51, align 8
  %52 = getelementptr inbounds [16 x i64], ptr %28, i64 0, i64 %33
  %53 = getelementptr inbounds [16 x %struct.VkMemoryHeap], ptr %29, i64 0, i64 %33
  %54 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minImERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %52, ptr noundef nonnull align 8 dereferenceable(8) %53)
  %55 = load i64, ptr %54, align 8, !tbaa !45
  %56 = getelementptr inbounds i8, ptr %.057, i64 32
  store i64 %55, ptr %56, align 8, !tbaa !46
  %indvars.iv.next62 = add nuw nsw i64 %indvars.iv61, 1
  %57 = getelementptr inbounds i8, ptr %.057, i64 40
  %exitcond65.not = icmp eq i64 %indvars.iv.next62, %wide.trip.count64
  br i1 %exitcond65.not, label %._crit_edge, label %30, !llvm.loop !47

tailrecurse:                                      ; preds = %15
  tail call void @_ZN14VmaAllocator_T18UpdateVulkanBudgetEv(ptr noundef nonnull align 8 dereferenceable(5916) %0)
  %58 = load i8, ptr %6, align 2, !tbaa !5, !range !36, !noundef !37
  %59 = trunc nuw i8 %58 to i1
  br i1 %59, label %15, label %.preheader

60:                                               ; preds = %.lr.ph55, %60
  %indvars.iv = phi i64 [ 0, %.lr.ph55 ], [ %indvars.iv.next, %60 ]
  %.154 = phi ptr [ %1, %.lr.ph55 ], [ %82, %60 ]
  %61 = trunc nuw i64 %indvars.iv to i32
  %62 = add i32 %61, %2
  %63 = zext i32 %62 to i64
  %64 = getelementptr inbounds [16 x %"struct.std::atomic"], ptr %10, i64 0, i64 %63
  %65 = tail call noundef i32 @_ZNKSt13__atomic_baseIjEcvjEv(ptr noundef nonnull align 4 dereferenceable(4) %64) #5
  store i32 %65, ptr %.154, align 8, !tbaa !39
  %66 = getelementptr inbounds [16 x %"struct.std::atomic"], ptr %11, i64 0, i64 %63
  %67 = tail call noundef i32 @_ZNKSt13__atomic_baseIjEcvjEv(ptr noundef nonnull align 4 dereferenceable(4) %66) #5
  %68 = getelementptr inbounds i8, ptr %.154, i64 4
  store i32 %67, ptr %68, align 4, !tbaa !42
  %69 = getelementptr inbounds [16 x %"struct.std::atomic.9"], ptr %12, i64 0, i64 %63
  %70 = tail call noundef i64 @_ZNKSt13__atomic_baseImEcvmEv(ptr noundef nonnull align 8 dereferenceable(8) %69) #5
  %71 = getelementptr inbounds i8, ptr %.154, i64 8
  store i64 %70, ptr %71, align 8, !tbaa !43
  %72 = getelementptr inbounds [16 x %"struct.std::atomic.9"], ptr %13, i64 0, i64 %63
  %73 = tail call noundef i64 @_ZNKSt13__atomic_baseImEcvmEv(ptr noundef nonnull align 8 dereferenceable(8) %72) #5
  %74 = getelementptr inbounds i8, ptr %.154, i64 16
  store i64 %73, ptr %74, align 8, !tbaa !44
  %75 = load i64, ptr %71, align 8, !tbaa !43
  %76 = getelementptr inbounds i8, ptr %.154, i64 24
  store i64 %75, ptr %76, align 8, !tbaa !49
  %77 = getelementptr inbounds [16 x %struct.VkMemoryHeap], ptr %14, i64 0, i64 %63
  %78 = load i64, ptr %77, align 8, !tbaa !50
  %79 = shl i64 %78, 3
  %80 = udiv i64 %79, 10
  %81 = getelementptr inbounds i8, ptr %.154, i64 32
  store i64 %80, ptr %81, align 8, !tbaa !46
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %82 = getelementptr inbounds i8, ptr %.154, i64 40
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %.loopexit, label %60, !llvm.loop !52

.loopexit:                                        ; preds = %60, %.preheader, %._crit_edge
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN14VmaAllocator_T18UpdateVulkanBudgetEv(ptr noundef nonnull align 8 dereferenceable(5916)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minImERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.usub.sat.i64(i64, i64) #4

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


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,MergedLoadStoreMotionPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass