; 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.VmaStatistics = type { i32, i32, i64, i64 }
%class.VmaBlockMetadata_Linear = type { %class.VmaBlockMetadata.base, i64, %class.VmaVector.2, %class.VmaVector.2, i32, i32, i64, i64, i64 }
%class.VmaBlockMetadata.base = type <{ ptr, i64, ptr, i64, i8 }>
%class.VmaVector.2 = type { %struct.VmaStlAllocator.3, ptr, i64, i64 }
%struct.VmaStlAllocator.3 = type { ptr }
%struct.VmaSuballocation = type { i64, i64, ptr, i32 }

; 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 noundef i64 @_ZNK16VmaBlockMetadata7GetSizeEv(ptr noundef nonnull align 8 dereferenceable(33)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(32) ptr @_ZNK23VmaBlockMetadata_Linear23AccessSuballocations1stEv(ptr noundef nonnull align 8 dereferenceable(144)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(32) ptr @_ZNK23VmaBlockMetadata_Linear23AccessSuballocations2ndEv(ptr noundef nonnull align 8 dereferenceable(144)) #1 align 2

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK23VmaBlockMetadata_Linear13AddStatisticsER13VmaStatistics(ptr noundef nonnull align 8 dereferenceable(144) %0, ptr noundef nonnull align 8 dereferenceable(24) %1) unnamed_addr #2 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca ptr, align 8
  %17 = alloca i64, align 8
  %18 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %19 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #3
  %20 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNK23VmaBlockMetadata_Linear23AccessSuballocations1stEv(ptr noundef nonnull align 8 dereferenceable(144) %19)
  store ptr %20, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #3
  %21 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNK23VmaBlockMetadata_Linear23AccessSuballocations2ndEv(ptr noundef nonnull align 8 dereferenceable(144) %19)
  store ptr %21, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  %22 = call noundef i64 @_ZNK16VmaBlockMetadata7GetSizeEv(ptr noundef nonnull align 8 dereferenceable(33) %19)
  store i64 %22, ptr %7, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  %23 = load ptr, ptr %5, align 8, !tbaa !5
  %24 = call noundef i64 @_ZNK9VmaVectorI16VmaSuballocation15VmaStlAllocatorIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %23)
  store i64 %24, ptr %8, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  %25 = load ptr, ptr %6, align 8, !tbaa !5
  %26 = call noundef i64 @_ZNK9VmaVectorI16VmaSuballocation15VmaStlAllocatorIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %25)
  store i64 %26, ptr %9, align 8, !tbaa !9
  %27 = load ptr, ptr %4, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.VmaStatistics, ptr %27, i32 0, i32 0
  %29 = load i32, ptr %28, align 8, !tbaa !11
  %30 = add i32 %29, 1
  store i32 %30, ptr %28, align 8, !tbaa !11
  %31 = load i64, ptr %7, align 8, !tbaa !9
  %32 = load ptr, ptr %4, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.VmaStatistics, ptr %32, i32 0, i32 2
  %34 = load i64, ptr %33, align 8, !tbaa !14
  %35 = add i64 %34, %31
  store i64 %35, ptr %33, align 8, !tbaa !14
  %36 = load i64, ptr %7, align 8, !tbaa !9
  %37 = getelementptr inbounds %class.VmaBlockMetadata_Linear, ptr %19, i32 0, i32 1
  %38 = load i64, ptr %37, align 8, !tbaa !15
  %39 = sub i64 %36, %38
  %40 = load ptr, ptr %4, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.VmaStatistics, ptr %40, i32 0, i32 3
  %42 = load i64, ptr %41, align 8, !tbaa !22
  %43 = add i64 %42, %39
  store i64 %43, ptr %41, align 8, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  store i64 0, ptr %10, align 8, !tbaa !9
  %44 = getelementptr inbounds %class.VmaBlockMetadata_Linear, ptr %19, i32 0, i32 5
  %45 = load i32, ptr %44, align 4, !tbaa !23
  %46 = icmp eq i32 %45, 1
  br i1 %46, label %47, label %102

47:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  %48 = load ptr, ptr %5, align 8, !tbaa !5
  %49 = getelementptr inbounds %class.VmaBlockMetadata_Linear, ptr %19, i32 0, i32 6
  %50 = load i64, ptr %49, align 8, !tbaa !24
  %51 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNK9VmaVectorI16VmaSuballocation15VmaStlAllocatorIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(32) %48, i64 noundef %50)
  %52 = getelementptr inbounds %struct.VmaSuballocation, ptr %51, i32 0, i32 0
  %53 = load i64, ptr %52, align 8, !tbaa !25
  store i64 %53, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  %54 = getelementptr inbounds %class.VmaBlockMetadata_Linear, ptr %19, i32 0, i32 6
  %55 = load i64, ptr %54, align 8, !tbaa !24
  store i64 %55, ptr %12, align 8, !tbaa !9
  br label %56

56:                                               ; preds = %100, %47
  %57 = load i64, ptr %10, align 8, !tbaa !9
  %58 = load i64, ptr %11, align 8, !tbaa !9
  %59 = icmp ult i64 %57, %58
  br i1 %59, label %60, label %101

60:                                               ; preds = %56
  br label %61

61:                                               ; preds = %74, %60
  %62 = load i64, ptr %12, align 8, !tbaa !9
  %63 = load i64, ptr %9, align 8, !tbaa !9
  %64 = icmp ult i64 %62, %63
  br i1 %64, label %65, label %72

65:                                               ; preds = %61
  %66 = load ptr, ptr %6, align 8, !tbaa !5
  %67 = load i64, ptr %12, align 8, !tbaa !9
  %68 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNK9VmaVectorI16VmaSuballocation15VmaStlAllocatorIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(32) %66, i64 noundef %67)
  %69 = getelementptr inbounds %struct.VmaSuballocation, ptr %68, i32 0, i32 2
  %70 = load ptr, ptr %69, align 8, !tbaa !28
  %71 = icmp eq ptr %70, null
  br label %72

72:                                               ; preds = %65, %61
  %73 = phi i1 [ false, %61 ], [ %71, %65 ]
  br i1 %73, label %74, label %77

74:                                               ; preds = %72
  %75 = load i64, ptr %12, align 8, !tbaa !9
  %76 = add i64 %75, 1
  store i64 %76, ptr %12, align 8, !tbaa !9
  br label %61, !llvm.loop !29

77:                                               ; preds = %72
  %78 = load i64, ptr %12, align 8, !tbaa !9
  %79 = load i64, ptr %9, align 8, !tbaa !9
  %80 = icmp ult i64 %78, %79
  br i1 %80, label %81, label %98

81:                                               ; preds = %77
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  %82 = load ptr, ptr %6, align 8, !tbaa !5
  %83 = load i64, ptr %12, align 8, !tbaa !9
  %84 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNK9VmaVectorI16VmaSuballocation15VmaStlAllocatorIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(32) %82, i64 noundef %83)
  store ptr %84, ptr %13, align 8, !tbaa !5
  %85 = load ptr, ptr %4, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.VmaStatistics, ptr %85, i32 0, i32 1
  %87 = load i32, ptr %86, align 4, !tbaa !31
  %88 = add i32 %87, 1
  store i32 %88, ptr %86, align 4, !tbaa !31
  %89 = load ptr, ptr %13, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.VmaSuballocation, ptr %89, i32 0, i32 0
  %91 = load i64, ptr %90, align 8, !tbaa !25
  %92 = load ptr, ptr %13, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.VmaSuballocation, ptr %92, i32 0, i32 1
  %94 = load i64, ptr %93, align 8, !tbaa !32
  %95 = add i64 %91, %94
  store i64 %95, ptr %10, align 8, !tbaa !9
  %96 = load i64, ptr %12, align 8, !tbaa !9
  %97 = add i64 %96, 1
  store i64 %97, ptr %12, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  br label %100

98:                                               ; preds = %77
  %99 = load i64, ptr %11, align 8, !tbaa !9
  store i64 %99, ptr %10, align 8, !tbaa !9
  br label %100

100:                                              ; preds = %98, %81
  br label %56, !llvm.loop !33

101:                                              ; preds = %56
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  br label %102

102:                                              ; preds = %101, %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #3
  %103 = getelementptr inbounds %class.VmaBlockMetadata_Linear, ptr %19, i32 0, i32 6
  %104 = load i64, ptr %103, align 8, !tbaa !24
  store i64 %104, ptr %14, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #3
  %105 = getelementptr inbounds %class.VmaBlockMetadata_Linear, ptr %19, i32 0, i32 5
  %106 = load i32, ptr %105, align 4, !tbaa !23
  %107 = icmp eq i32 %106, 2
  br i1 %107, label %108, label %113

108:                                              ; preds = %102
  %109 = load ptr, ptr %6, align 8, !tbaa !5
  %110 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNK9VmaVectorI16VmaSuballocation15VmaStlAllocatorIS0_EE4backEv(ptr noundef nonnull align 8 dereferenceable(32) %109)
  %111 = getelementptr inbounds %struct.VmaSuballocation, ptr %110, i32 0, i32 0
  %112 = load i64, ptr %111, align 8, !tbaa !25
  br label %115

113:                                              ; preds = %102
  %114 = load i64, ptr %7, align 8, !tbaa !9
  br label %115

115:                                              ; preds = %113, %108
  %116 = phi i64 [ %112, %108 ], [ %114, %113 ]
  store i64 %116, ptr %15, align 8, !tbaa !9
  br label %117

117:                                              ; preds = %161, %115
  %118 = load i64, ptr %10, align 8, !tbaa !9
  %119 = load i64, ptr %15, align 8, !tbaa !9
  %120 = icmp ult i64 %118, %119
  br i1 %120, label %121, label %162

121:                                              ; preds = %117
  br label %122

122:                                              ; preds = %135, %121
  %123 = load i64, ptr %14, align 8, !tbaa !9
  %124 = load i64, ptr %8, align 8, !tbaa !9
  %125 = icmp ult i64 %123, %124
  br i1 %125, label %126, label %133

126:                                              ; preds = %122
  %127 = load ptr, ptr %5, align 8, !tbaa !5
  %128 = load i64, ptr %14, align 8, !tbaa !9
  %129 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNK9VmaVectorI16VmaSuballocation15VmaStlAllocatorIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(32) %127, i64 noundef %128)
  %130 = getelementptr inbounds %struct.VmaSuballocation, ptr %129, i32 0, i32 2
  %131 = load ptr, ptr %130, align 8, !tbaa !28
  %132 = icmp eq ptr %131, null
  br label %133

133:                                              ; preds = %126, %122
  %134 = phi i1 [ false, %122 ], [ %132, %126 ]
  br i1 %134, label %135, label %138

135:                                              ; preds = %133
  %136 = load i64, ptr %14, align 8, !tbaa !9
  %137 = add i64 %136, 1
  store i64 %137, ptr %14, align 8, !tbaa !9
  br label %122, !llvm.loop !34

138:                                              ; preds = %133
  %139 = load i64, ptr %14, align 8, !tbaa !9
  %140 = load i64, ptr %8, align 8, !tbaa !9
  %141 = icmp ult i64 %139, %140
  br i1 %141, label %142, label %159

142:                                              ; preds = %138
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #3
  %143 = load ptr, ptr %5, align 8, !tbaa !5
  %144 = load i64, ptr %14, align 8, !tbaa !9
  %145 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNK9VmaVectorI16VmaSuballocation15VmaStlAllocatorIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(32) %143, i64 noundef %144)
  store ptr %145, ptr %16, align 8, !tbaa !5
  %146 = load ptr, ptr %4, align 8, !tbaa !5
  %147 = getelementptr inbounds %struct.VmaStatistics, ptr %146, i32 0, i32 1
  %148 = load i32, ptr %147, align 4, !tbaa !31
  %149 = add i32 %148, 1
  store i32 %149, ptr %147, align 4, !tbaa !31
  %150 = load ptr, ptr %16, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct.VmaSuballocation, ptr %150, i32 0, i32 0
  %152 = load i64, ptr %151, align 8, !tbaa !25
  %153 = load ptr, ptr %16, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct.VmaSuballocation, ptr %153, i32 0, i32 1
  %155 = load i64, ptr %154, align 8, !tbaa !32
  %156 = add i64 %152, %155
  store i64 %156, ptr %10, align 8, !tbaa !9
  %157 = load i64, ptr %14, align 8, !tbaa !9
  %158 = add i64 %157, 1
  store i64 %158, ptr %14, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #3
  br label %161

159:                                              ; preds = %138
  %160 = load i64, ptr %15, align 8, !tbaa !9
  store i64 %160, ptr %10, align 8, !tbaa !9
  br label %161

161:                                              ; preds = %159, %142
  br label %117, !llvm.loop !35

162:                                              ; preds = %117
  %163 = getelementptr inbounds %class.VmaBlockMetadata_Linear, ptr %19, i32 0, i32 5
  %164 = load i32, ptr %163, align 4, !tbaa !23
  %165 = icmp eq i32 %164, 2
  br i1 %165, label %166, label %214

166:                                              ; preds = %162
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #3
  %167 = load ptr, ptr %6, align 8, !tbaa !5
  %168 = call noundef i64 @_ZNK9VmaVectorI16VmaSuballocation15VmaStlAllocatorIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %167)
  %169 = sub i64 %168, 1
  store i64 %169, ptr %17, align 8, !tbaa !9
  br label %170

170:                                              ; preds = %212, %166
  %171 = load i64, ptr %10, align 8, !tbaa !9
  %172 = load i64, ptr %7, align 8, !tbaa !9
  %173 = icmp ult i64 %171, %172
  br i1 %173, label %174, label %213

174:                                              ; preds = %170
  br label %175

175:                                              ; preds = %187, %174
  %176 = load i64, ptr %17, align 8, !tbaa !9
  %177 = icmp ne i64 %176, -1
  br i1 %177, label %178, label %185

178:                                              ; preds = %175
  %179 = load ptr, ptr %6, align 8, !tbaa !5
  %180 = load i64, ptr %17, align 8, !tbaa !9
  %181 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNK9VmaVectorI16VmaSuballocation15VmaStlAllocatorIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(32) %179, i64 noundef %180)
  %182 = getelementptr inbounds %struct.VmaSuballocation, ptr %181, i32 0, i32 2
  %183 = load ptr, ptr %182, align 8, !tbaa !28
  %184 = icmp eq ptr %183, null
  br label %185

185:                                              ; preds = %178, %175
  %186 = phi i1 [ false, %175 ], [ %184, %178 ]
  br i1 %186, label %187, label %190

187:                                              ; preds = %185
  %188 = load i64, ptr %17, align 8, !tbaa !9
  %189 = add i64 %188, -1
  store i64 %189, ptr %17, align 8, !tbaa !9
  br label %175, !llvm.loop !36

190:                                              ; preds = %185
  %191 = load i64, ptr %17, align 8, !tbaa !9
  %192 = icmp ne i64 %191, -1
  br i1 %192, label %193, label %210

193:                                              ; preds = %190
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #3
  %194 = load ptr, ptr %6, align 8, !tbaa !5
  %195 = load i64, ptr %17, align 8, !tbaa !9
  %196 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNK9VmaVectorI16VmaSuballocation15VmaStlAllocatorIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(32) %194, i64 noundef %195)
  store ptr %196, ptr %18, align 8, !tbaa !5
  %197 = load ptr, ptr %4, align 8, !tbaa !5
  %198 = getelementptr inbounds %struct.VmaStatistics, ptr %197, i32 0, i32 1
  %199 = load i32, ptr %198, align 4, !tbaa !31
  %200 = add i32 %199, 1
  store i32 %200, ptr %198, align 4, !tbaa !31
  %201 = load ptr, ptr %18, align 8, !tbaa !5
  %202 = getelementptr inbounds %struct.VmaSuballocation, ptr %201, i32 0, i32 0
  %203 = load i64, ptr %202, align 8, !tbaa !25
  %204 = load ptr, ptr %18, align 8, !tbaa !5
  %205 = getelementptr inbounds %struct.VmaSuballocation, ptr %204, i32 0, i32 1
  %206 = load i64, ptr %205, align 8, !tbaa !32
  %207 = add i64 %203, %206
  store i64 %207, ptr %10, align 8, !tbaa !9
  %208 = load i64, ptr %17, align 8, !tbaa !9
  %209 = add i64 %208, -1
  store i64 %209, ptr %17, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #3
  br label %212

210:                                              ; preds = %190
  %211 = load i64, ptr %7, align 8, !tbaa !9
  store i64 %211, ptr %10, align 8, !tbaa !9
  br label %212

212:                                              ; preds = %210, %193
  br label %170, !llvm.loop !37

213:                                              ; preds = %170
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #3
  br label %214

214:                                              ; preds = %213, %162
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #3
  ret void
}

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, !13, i64 0}
!12 = !{!"_ZTS13VmaStatistics", !13, i64 0, !13, i64 4, !10, i64 8, !10, i64 16}
!13 = !{!"int", !7, i64 0}
!14 = !{!12, !10, i64 8}
!15 = !{!16, !10, i64 40}
!16 = !{!"_ZTS23VmaBlockMetadata_Linear", !17, i64 0, !10, i64 40, !19, i64 48, !19, i64 80, !13, i64 112, !21, i64 116, !10, i64 120, !10, i64 128, !10, i64 136}
!17 = !{!"_ZTS16VmaBlockMetadata", !10, i64 8, !6, i64 16, !10, i64 24, !18, i64 32}
!18 = !{!"bool", !7, i64 0}
!19 = !{!"_ZTS9VmaVectorI16VmaSuballocation15VmaStlAllocatorIS0_EE", !20, i64 0, !6, i64 8, !10, i64 16, !10, i64 24}
!20 = !{!"_ZTS15VmaStlAllocatorI16VmaSuballocationE", !6, i64 0}
!21 = !{!"_ZTSN23VmaBlockMetadata_Linear18SECOND_VECTOR_MODEE", !7, i64 0}
!22 = !{!12, !10, i64 16}
!23 = !{!16, !21, i64 116}
!24 = !{!16, !10, i64 120}
!25 = !{!26, !10, i64 0}
!26 = !{!"_ZTS16VmaSuballocation", !10, i64 0, !10, i64 8, !6, i64 16, !27, i64 24}
!27 = !{!"_ZTS20VmaSuballocationType", !7, i64 0}
!28 = !{!26, !6, i64 16}
!29 = distinct !{!29, !30}
!30 = !{!"llvm.loop.mustprogress"}
!31 = !{!12, !13, i64 4}
!32 = !{!26, !10, i64 8}
!33 = distinct !{!33, !30}
!34 = distinct !{!34, !30}
!35 = distinct !{!35, !30}
!36 = distinct !{!36, !30}
!37 = distinct !{!37, !30}


; 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 nounwind uwtable
declare dso_local noundef i64 @_ZNK16VmaBlockMetadata7GetSizeEv(ptr noundef nonnull align 8 dereferenceable(33)) local_unnamed_addr #0 align 2

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZNK23VmaBlockMetadata_Linear13AddStatisticsER13VmaStatistics(ptr noundef nonnull align 8 dereferenceable(144) %0, ptr nocapture noundef nonnull align 8 dereferenceable(24) %1) unnamed_addr #0 align 2 {
  %3 = tail call noundef nonnull align 8 dereferenceable(32) ptr @_ZNK23VmaBlockMetadata_Linear23AccessSuballocations1stEv(ptr noundef nonnull align 8 dereferenceable(144) %0)
  %4 = tail call noundef nonnull align 8 dereferenceable(32) ptr @_ZNK23VmaBlockMetadata_Linear23AccessSuballocations2ndEv(ptr noundef nonnull align 8 dereferenceable(144) %0)
  %5 = tail call noundef i64 @_ZNK16VmaBlockMetadata7GetSizeEv(ptr noundef nonnull align 8 dereferenceable(33) %0)
  %6 = tail call noundef i64 @_ZNK9VmaVectorI16VmaSuballocation15VmaStlAllocatorIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %3)
  %7 = tail call noundef i64 @_ZNK9VmaVectorI16VmaSuballocation15VmaStlAllocatorIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %4)
  %8 = load i32, ptr %1, align 8, !tbaa !5
  %9 = add i32 %8, 1
  store i32 %9, ptr %1, align 8, !tbaa !5
  %10 = getelementptr inbounds i8, ptr %1, i64 8
  %11 = load i64, ptr %10, align 8, !tbaa !11
  %12 = add i64 %11, %5
  store i64 %12, ptr %10, align 8, !tbaa !11
  %13 = getelementptr inbounds i8, ptr %0, i64 40
  %14 = load i64, ptr %13, align 8, !tbaa !12
  %15 = sub i64 %5, %14
  %16 = getelementptr inbounds i8, ptr %1, i64 16
  %17 = load i64, ptr %16, align 8, !tbaa !20
  %18 = add i64 %15, %17
  store i64 %18, ptr %16, align 8, !tbaa !20
  %19 = getelementptr inbounds i8, ptr %0, i64 116
  %20 = load i32, ptr %19, align 4, !tbaa !21
  %21 = icmp eq i32 %20, 1
  br i1 %21, label %22, label %45

22:                                               ; preds = %2
  %23 = getelementptr inbounds i8, ptr %0, i64 120
  %24 = load i64, ptr %23, align 8, !tbaa !22
  %25 = tail call noundef nonnull align 8 dereferenceable(32) ptr @_ZNK9VmaVectorI16VmaSuballocation15VmaStlAllocatorIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef %24)
  %26 = load i64, ptr %25, align 8, !tbaa !23
  %.not90 = icmp eq i64 %26, 0
  br i1 %.not90, label %thread-pre-split, label %.preheader74.lr.ph

.preheader74.lr.ph:                               ; preds = %22
  %27 = load i64, ptr %23, align 8, !tbaa !22
  %28 = getelementptr inbounds i8, ptr %1, i64 4
  br label %.preheader74

.preheader74:                                     ; preds = %.preheader74.lr.ph, %.critedge70
  %.06479 = phi i64 [ %27, %.preheader74.lr.ph ], [ %43, %.critedge70 ]
  %29 = icmp ult i64 %.06479, %7
  br i1 %29, label %.lr.ph, label %thread-pre-split

.lr.ph:                                           ; preds = %.preheader74, %34
  %.16578 = phi i64 [ %35, %34 ], [ %.06479, %.preheader74 ]
  %30 = tail call noundef nonnull align 8 dereferenceable(32) ptr @_ZNK9VmaVectorI16VmaSuballocation15VmaStlAllocatorIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(32) %4, i64 noundef %.16578)
  %31 = getelementptr inbounds i8, ptr %30, i64 16
  %32 = load ptr, ptr %31, align 8, !tbaa !26
  %33 = icmp eq ptr %32, null
  br i1 %33, label %34, label %.critedge70

34:                                               ; preds = %.lr.ph
  %35 = add i64 %.16578, 1
  %exitcond.not = icmp eq i64 %35, %7
  br i1 %exitcond.not, label %thread-pre-split, label %.lr.ph, !llvm.loop !27

.critedge70:                                      ; preds = %.lr.ph
  %36 = tail call noundef nonnull align 8 dereferenceable(32) ptr @_ZNK9VmaVectorI16VmaSuballocation15VmaStlAllocatorIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(32) %4, i64 noundef %.16578)
  %37 = load i32, ptr %28, align 4, !tbaa !29
  %38 = add i32 %37, 1
  store i32 %38, ptr %28, align 4, !tbaa !29
  %39 = load i64, ptr %36, align 8, !tbaa !23
  %40 = getelementptr inbounds i8, ptr %36, i64 8
  %41 = load i64, ptr %40, align 8, !tbaa !30
  %42 = add i64 %41, %39
  %43 = add nuw i64 %.16578, 1
  %44 = icmp ult i64 %42, %26
  br i1 %44, label %.preheader74, label %thread-pre-split, !llvm.loop !31

thread-pre-split:                                 ; preds = %.preheader74, %.critedge70, %34, %22
  %.0.lcssa = phi i64 [ 0, %22 ], [ %26, %34 ], [ %26, %.preheader74 ], [ %42, %.critedge70 ]
  %.pr = load i32, ptr %19, align 4, !tbaa !21
  br label %45

45:                                               ; preds = %thread-pre-split, %2
  %46 = phi i32 [ %.pr, %thread-pre-split ], [ %20, %2 ]
  %.2 = phi i64 [ %.0.lcssa, %thread-pre-split ], [ 0, %2 ]
  %47 = getelementptr inbounds i8, ptr %0, i64 120
  %48 = load i64, ptr %47, align 8, !tbaa !22
  %49 = icmp eq i32 %46, 2
  br i1 %49, label %50, label %53

50:                                               ; preds = %45
  %51 = tail call noundef nonnull align 8 dereferenceable(32) ptr @_ZNK9VmaVectorI16VmaSuballocation15VmaStlAllocatorIS0_EE4backEv(ptr noundef nonnull align 8 dereferenceable(32) %4)
  %52 = load i64, ptr %51, align 8, !tbaa !23
  br label %53

53:                                               ; preds = %45, %50
  %54 = phi i64 [ %52, %50 ], [ %5, %45 ]
  %55 = icmp ult i64 %.2, %54
  br i1 %55, label %.preheader73.lr.ph, label %._crit_edge

.preheader73.lr.ph:                               ; preds = %53
  %56 = getelementptr inbounds i8, ptr %1, i64 4
  br label %.preheader73

.preheader73:                                     ; preds = %.preheader73.lr.ph, %.critedge71
  %.06784 = phi i64 [ %48, %.preheader73.lr.ph ], [ %71, %.critedge71 ]
  %57 = icmp ult i64 %.06784, %6
  br i1 %57, label %.lr.ph82, label %._crit_edge

.lr.ph82:                                         ; preds = %.preheader73, %62
  %.16881 = phi i64 [ %63, %62 ], [ %.06784, %.preheader73 ]
  %58 = tail call noundef nonnull align 8 dereferenceable(32) ptr @_ZNK9VmaVectorI16VmaSuballocation15VmaStlAllocatorIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef %.16881)
  %59 = getelementptr inbounds i8, ptr %58, i64 16
  %60 = load ptr, ptr %59, align 8, !tbaa !26
  %61 = icmp eq ptr %60, null
  br i1 %61, label %62, label %.critedge71

62:                                               ; preds = %.lr.ph82
  %63 = add i64 %.16881, 1
  %exitcond95.not = icmp eq i64 %63, %6
  br i1 %exitcond95.not, label %._crit_edge, label %.lr.ph82, !llvm.loop !32

.critedge71:                                      ; preds = %.lr.ph82
  %64 = tail call noundef nonnull align 8 dereferenceable(32) ptr @_ZNK9VmaVectorI16VmaSuballocation15VmaStlAllocatorIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef %.16881)
  %65 = load i32, ptr %56, align 4, !tbaa !29
  %66 = add i32 %65, 1
  store i32 %66, ptr %56, align 4, !tbaa !29
  %67 = load i64, ptr %64, align 8, !tbaa !23
  %68 = getelementptr inbounds i8, ptr %64, i64 8
  %69 = load i64, ptr %68, align 8, !tbaa !30
  %70 = add i64 %69, %67
  %71 = add nuw i64 %.16881, 1
  %72 = icmp ult i64 %70, %54
  br i1 %72, label %.preheader73, label %._crit_edge, !llvm.loop !33

._crit_edge:                                      ; preds = %.preheader73, %.critedge71, %62, %53
  %.3.lcssa = phi i64 [ %.2, %53 ], [ %54, %62 ], [ %54, %.preheader73 ], [ %70, %.critedge71 ]
  %73 = load i32, ptr %19, align 4, !tbaa !21
  %74 = icmp eq i32 %73, 2
  br i1 %74, label %75, label %.loopexit

75:                                               ; preds = %._crit_edge
  %76 = tail call noundef i64 @_ZNK9VmaVectorI16VmaSuballocation15VmaStlAllocatorIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %4)
  %77 = icmp ult i64 %.3.lcssa, %5
  br i1 %77, label %.preheader.lr.ph, label %.loopexit

.preheader.lr.ph:                                 ; preds = %75
  %78 = getelementptr inbounds i8, ptr %1, i64 4
  br label %.preheader

.preheader:                                       ; preds = %.preheader.lr.ph, %.critedge72
  %.06189.in = phi i64 [ %76, %.preheader.lr.ph ], [ %.16287, %.critedge72 ]
  %.not86 = icmp eq i64 %.06189.in, 0
  br i1 %.not86, label %.loopexit, label %.lr.ph88

.lr.ph88:                                         ; preds = %.preheader, %83
  %.16287.in = phi i64 [ %.16287, %83 ], [ %.06189.in, %.preheader ]
  %.16287 = add i64 %.16287.in, -1
  %79 = tail call noundef nonnull align 8 dereferenceable(32) ptr @_ZNK9VmaVectorI16VmaSuballocation15VmaStlAllocatorIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(32) %4, i64 noundef %.16287)
  %80 = getelementptr inbounds i8, ptr %79, i64 16
  %81 = load ptr, ptr %80, align 8, !tbaa !26
  %82 = icmp eq ptr %81, null
  br i1 %82, label %83, label %.critedge72

83:                                               ; preds = %.lr.ph88
  %.not = icmp eq i64 %.16287, 0
  br i1 %.not, label %.loopexit, label %.lr.ph88, !llvm.loop !34

.critedge72:                                      ; preds = %.lr.ph88
  %84 = tail call noundef nonnull align 8 dereferenceable(32) ptr @_ZNK9VmaVectorI16VmaSuballocation15VmaStlAllocatorIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(32) %4, i64 noundef %.16287)
  %85 = load i32, ptr %78, align 4, !tbaa !29
  %86 = add i32 %85, 1
  store i32 %86, ptr %78, align 4, !tbaa !29
  %87 = load i64, ptr %84, align 8, !tbaa !23
  %88 = getelementptr inbounds i8, ptr %84, i64 8
  %89 = load i64, ptr %88, align 8, !tbaa !30
  %90 = add i64 %89, %87
  %91 = icmp ult i64 %90, %5
  br i1 %91, label %.preheader, label %.loopexit, !llvm.loop !35

.loopexit:                                        ; preds = %.preheader, %.critedge72, %83, %75, %._crit_edge
  ret void
}

attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }

!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 = !{!"_ZTS13VmaStatistics", !7, i64 0, !7, i64 4, !10, i64 8, !10, i64 16}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"long", !8, i64 0}
!11 = !{!6, !10, i64 8}
!12 = !{!13, !10, i64 40}
!13 = !{!"_ZTS23VmaBlockMetadata_Linear", !14, i64 0, !10, i64 40, !17, i64 48, !17, i64 80, !7, i64 112, !19, i64 116, !10, i64 120, !10, i64 128, !10, i64 136}
!14 = !{!"_ZTS16VmaBlockMetadata", !10, i64 8, !15, i64 16, !10, i64 24, !16, i64 32}
!15 = !{!"any pointer", !8, i64 0}
!16 = !{!"bool", !8, i64 0}
!17 = !{!"_ZTS9VmaVectorI16VmaSuballocation15VmaStlAllocatorIS0_EE", !18, i64 0, !15, i64 8, !10, i64 16, !10, i64 24}
!18 = !{!"_ZTS15VmaStlAllocatorI16VmaSuballocationE", !15, i64 0}
!19 = !{!"_ZTSN23VmaBlockMetadata_Linear18SECOND_VECTOR_MODEE", !8, i64 0}
!20 = !{!6, !10, i64 16}
!21 = !{!13, !19, i64 116}
!22 = !{!13, !10, i64 120}
!23 = !{!24, !10, i64 0}
!24 = !{!"_ZTS16VmaSuballocation", !10, i64 0, !10, i64 8, !15, i64 16, !25, i64 24}
!25 = !{!"_ZTS20VmaSuballocationType", !8, i64 0}
!26 = !{!24, !15, i64 16}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.mustprogress"}
!29 = !{!6, !7, i64 4}
!30 = !{!24, !10, i64 8}
!31 = distinct !{!31, !28}
!32 = distinct !{!32, !28}
!33 = distinct !{!33, !28}
!34 = distinct !{!34, !28}
!35 = distinct !{!35, !28}


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