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

%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 }
%struct.VmaAllocationRequest = type <{ ptr, i64, %"class.VmaList<VmaSuballocation, VmaStlAllocator<VmaSuballocation>>::iterator", ptr, i64, i32, [4 x i8] }>
%"class.VmaList<VmaSuballocation, VmaStlAllocator<VmaSuballocation>>::iterator" = type { ptr, ptr }

@.str.2 = external hidden unnamed_addr constant [84 x i8], align 1
@.str.75 = external hidden unnamed_addr constant [27 x i8], align 1
@__PRETTY_FUNCTION__._ZN23VmaBlockMetadata_Linear36CreateAllocationRequest_LowerAddressEmm20VmaSuballocationTypejP20VmaAllocationRequest = external hidden unnamed_addr constant [151 x i8], align 1

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

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #1

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef i64 @_ZL10VmaAlignUpImET_S0_S0_(i64 noundef, i64 noundef) #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef zeroext i1 @_ZL35VmaIsBufferImageGranularityConflict20VmaSuballocationTypeS_(i32 noundef, i32 noundef) #3

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

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

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

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

47:                                               ; preds = %6
  %48 = getelementptr inbounds %class.VmaBlockMetadata_Linear, ptr %38, i32 0, i32 5
  %49 = load i32, ptr %48, align 4, !tbaa !15
  %50 = icmp eq i32 %49, 2
  br i1 %50, label %51, label %204

51:                                               ; preds = %47, %6
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  store i64 0, ptr %19, align 8, !tbaa !9
  %52 = load ptr, ptr %17, align 8, !tbaa !5
  %53 = call noundef zeroext i1 @_ZNK9VmaVectorI16VmaSuballocation15VmaStlAllocatorIS0_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(32) %52)
  br i1 %53, label %66, label %54

54:                                               ; preds = %51
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #5
  %55 = load ptr, ptr %17, align 8, !tbaa !5
  %56 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN9VmaVectorI16VmaSuballocation15VmaStlAllocatorIS0_EE4backEv(ptr noundef nonnull align 8 dereferenceable(32) %55)
  store ptr %56, ptr %20, align 8, !tbaa !5
  %57 = load ptr, ptr %20, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.VmaSuballocation, ptr %57, i32 0, i32 0
  %59 = load i64, ptr %58, align 8, !tbaa !22
  %60 = load ptr, ptr %20, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.VmaSuballocation, ptr %60, i32 0, i32 1
  %62 = load i64, ptr %61, align 8, !tbaa !24
  %63 = add i64 %59, %62
  %64 = load i64, ptr %15, align 8, !tbaa !9
  %65 = add i64 %63, %64
  store i64 %65, ptr %19, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  br label %66

66:                                               ; preds = %54, %51
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #5
  %67 = load i64, ptr %19, align 8, !tbaa !9
  store i64 %67, ptr %21, align 8, !tbaa !9
  %68 = load i64, ptr %21, align 8, !tbaa !9
  %69 = load i64, ptr %10, align 8, !tbaa !9
  %70 = call noundef i64 @_ZL10VmaAlignUpImET_S0_S0_(i64 noundef %68, i64 noundef %69)
  store i64 %70, ptr %21, align 8, !tbaa !9
  %71 = load i64, ptr %16, align 8, !tbaa !9
  %72 = icmp ugt i64 %71, 1
  br i1 %72, label %73, label %123

73:                                               ; preds = %66
  %74 = load i64, ptr %16, align 8, !tbaa !9
  %75 = load i64, ptr %10, align 8, !tbaa !9
  %76 = icmp ne i64 %74, %75
  br i1 %76, label %77, label %123

77:                                               ; preds = %73
  %78 = load ptr, ptr %17, align 8, !tbaa !5
  %79 = call noundef zeroext i1 @_ZNK9VmaVectorI16VmaSuballocation15VmaStlAllocatorIS0_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(32) %78)
  br i1 %79, label %123, label %80

80:                                               ; preds = %77
  call void @llvm.lifetime.start.p0(i64 1, ptr %22) #5
  store i8 0, ptr %22, align 1, !tbaa !25
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #5
  %81 = load ptr, ptr %17, align 8, !tbaa !5
  %82 = call noundef i64 @_ZNK9VmaVectorI16VmaSuballocation15VmaStlAllocatorIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %81)
  store i64 %82, ptr %23, align 8, !tbaa !9
  br label %83

83:                                               ; preds = %113, %80
  %84 = load i64, ptr %23, align 8, !tbaa !9
  %85 = add i64 %84, -1
  store i64 %85, ptr %23, align 8, !tbaa !9
  %86 = icmp ne i64 %84, 0
  br i1 %86, label %88, label %87

87:                                               ; preds = %83
  store i32 2, ptr %24, align 4
  br label %114

88:                                               ; preds = %83
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #5
  %89 = load ptr, ptr %17, align 8, !tbaa !5
  %90 = load i64, ptr %23, align 8, !tbaa !9
  %91 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN9VmaVectorI16VmaSuballocation15VmaStlAllocatorIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(32) %89, i64 noundef %90)
  store ptr %91, ptr %25, align 8, !tbaa !5
  %92 = load ptr, ptr %25, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.VmaSuballocation, ptr %92, i32 0, i32 0
  %94 = load i64, ptr %93, align 8, !tbaa !22
  %95 = load ptr, ptr %25, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.VmaSuballocation, ptr %95, i32 0, i32 1
  %97 = load i64, ptr %96, align 8, !tbaa !24
  %98 = load i64, ptr %21, align 8, !tbaa !9
  %99 = load i64, ptr %16, align 8, !tbaa !9
  %100 = call noundef zeroext i1 @_ZL19VmaBlocksOnSamePagemmmm(i64 noundef %94, i64 noundef %97, i64 noundef %98, i64 noundef %99)
  br i1 %100, label %101, label %109

101:                                              ; preds = %88
  %102 = load ptr, ptr %25, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.VmaSuballocation, ptr %102, i32 0, i32 3
  %104 = load i32, ptr %103, align 8, !tbaa !26
  %105 = load i32, ptr %11, align 4, !tbaa !11
  %106 = call noundef zeroext i1 @_ZL35VmaIsBufferImageGranularityConflict20VmaSuballocationTypeS_(i32 noundef %104, i32 noundef %105)
  br i1 %106, label %107, label %108

107:                                              ; preds = %101
  store i8 1, ptr %22, align 1, !tbaa !25
  store i32 2, ptr %24, align 4
  br label %111

108:                                              ; preds = %101
  br label %110

109:                                              ; preds = %88
  store i32 2, ptr %24, align 4
  br label %111

110:                                              ; preds = %108
  store i32 0, ptr %24, align 4
  br label %111

111:                                              ; preds = %110, %109, %107
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #5
  %112 = load i32, ptr %24, align 4
  switch i32 %112, label %114 [
    i32 0, label %113
  ]

113:                                              ; preds = %111
  br label %83, !llvm.loop !27

114:                                              ; preds = %111, %87
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #5
  br label %115

115:                                              ; preds = %114
  %116 = load i8, ptr %22, align 1, !tbaa !25, !range !29, !noundef !30
  %117 = trunc i8 %116 to i1
  br i1 %117, label %118, label %122

118:                                              ; preds = %115
  %119 = load i64, ptr %21, align 8, !tbaa !9
  %120 = load i64, ptr %16, align 8, !tbaa !9
  %121 = call noundef i64 @_ZL10VmaAlignUpImET_S0_S0_(i64 noundef %119, i64 noundef %120)
  store i64 %121, ptr %21, align 8, !tbaa !9
  br label %122

122:                                              ; preds = %118, %115
  call void @llvm.lifetime.end.p0(i64 1, ptr %22) #5
  br label %123

123:                                              ; preds = %122, %77, %73, %66
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #5
  %124 = getelementptr inbounds %class.VmaBlockMetadata_Linear, ptr %38, i32 0, i32 5
  %125 = load i32, ptr %124, align 4, !tbaa !15
  %126 = icmp eq i32 %125, 2
  br i1 %126, label %127, label %132

127:                                              ; preds = %123
  %128 = load ptr, ptr %18, align 8, !tbaa !5
  %129 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN9VmaVectorI16VmaSuballocation15VmaStlAllocatorIS0_EE4backEv(ptr noundef nonnull align 8 dereferenceable(32) %128)
  %130 = getelementptr inbounds %struct.VmaSuballocation, ptr %129, i32 0, i32 0
  %131 = load i64, ptr %130, align 8, !tbaa !22
  br label %134

132:                                              ; preds = %123
  %133 = load i64, ptr %14, align 8, !tbaa !9
  br label %134

134:                                              ; preds = %132, %127
  %135 = phi i64 [ %131, %127 ], [ %133, %132 ]
  store i64 %135, ptr %26, align 8, !tbaa !9
  %136 = load i64, ptr %21, align 8, !tbaa !9
  %137 = load i64, ptr %9, align 8, !tbaa !9
  %138 = add i64 %136, %137
  %139 = load i64, ptr %15, align 8, !tbaa !9
  %140 = add i64 %138, %139
  %141 = load i64, ptr %26, align 8, !tbaa !9
  %142 = icmp ule i64 %140, %141
  br i1 %142, label %143, label %200

143:                                              ; preds = %134
  %144 = load i64, ptr %9, align 8, !tbaa !9
  %145 = load i64, ptr %16, align 8, !tbaa !9
  %146 = urem i64 %144, %145
  %147 = icmp ne i64 %146, 0
  br i1 %147, label %153, label %148

148:                                              ; preds = %143
  %149 = load i64, ptr %21, align 8, !tbaa !9
  %150 = load i64, ptr %16, align 8, !tbaa !9
  %151 = urem i64 %149, %150
  %152 = icmp ne i64 %151, 0
  br i1 %152, label %153, label %192

153:                                              ; preds = %148, %143
  %154 = getelementptr inbounds %class.VmaBlockMetadata_Linear, ptr %38, i32 0, i32 5
  %155 = load i32, ptr %154, align 4, !tbaa !15
  %156 = icmp eq i32 %155, 2
  br i1 %156, label %157, label %192

157:                                              ; preds = %153
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #5
  %158 = load ptr, ptr %18, align 8, !tbaa !5
  %159 = call noundef i64 @_ZNK9VmaVectorI16VmaSuballocation15VmaStlAllocatorIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %158)
  store i64 %159, ptr %27, align 8, !tbaa !9
  br label %160

160:                                              ; preds = %188, %157
  %161 = load i64, ptr %27, align 8, !tbaa !9
  %162 = add i64 %161, -1
  store i64 %162, ptr %27, align 8, !tbaa !9
  %163 = icmp ne i64 %161, 0
  br i1 %163, label %165, label %164

164:                                              ; preds = %160
  store i32 4, ptr %24, align 4
  br label %189

165:                                              ; preds = %160
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #5
  %166 = load ptr, ptr %18, align 8, !tbaa !5
  %167 = load i64, ptr %27, align 8, !tbaa !9
  %168 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN9VmaVectorI16VmaSuballocation15VmaStlAllocatorIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(32) %166, i64 noundef %167)
  store ptr %168, ptr %28, align 8, !tbaa !5
  %169 = load i64, ptr %21, align 8, !tbaa !9
  %170 = load i64, ptr %9, align 8, !tbaa !9
  %171 = load ptr, ptr %28, align 8, !tbaa !5
  %172 = getelementptr inbounds %struct.VmaSuballocation, ptr %171, i32 0, i32 0
  %173 = load i64, ptr %172, align 8, !tbaa !22
  %174 = load i64, ptr %16, align 8, !tbaa !9
  %175 = call noundef zeroext i1 @_ZL19VmaBlocksOnSamePagemmmm(i64 noundef %169, i64 noundef %170, i64 noundef %173, i64 noundef %174)
  br i1 %175, label %176, label %184

176:                                              ; preds = %165
  %177 = load i32, ptr %11, align 4, !tbaa !11
  %178 = load ptr, ptr %28, align 8, !tbaa !5
  %179 = getelementptr inbounds %struct.VmaSuballocation, ptr %178, i32 0, i32 3
  %180 = load i32, ptr %179, align 8, !tbaa !26
  %181 = call noundef zeroext i1 @_ZL35VmaIsBufferImageGranularityConflict20VmaSuballocationTypeS_(i32 noundef %177, i32 noundef %180)
  br i1 %181, label %182, label %183

182:                                              ; preds = %176
  store i1 false, ptr %7, align 1
  store i32 1, ptr %24, align 4
  br label %186

183:                                              ; preds = %176
  br label %185

184:                                              ; preds = %165
  store i32 4, ptr %24, align 4
  br label %186

185:                                              ; preds = %183
  store i32 0, ptr %24, align 4
  br label %186

186:                                              ; preds = %185, %184, %182
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #5
  %187 = load i32, ptr %24, align 4
  switch i32 %187, label %189 [
    i32 0, label %188
  ]

188:                                              ; preds = %186
  br label %160, !llvm.loop !31

189:                                              ; preds = %186, %164
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #5
  %190 = load i32, ptr %24, align 4
  switch i32 %190, label %201 [
    i32 4, label %191
  ]

191:                                              ; preds = %189
  br label %192

192:                                              ; preds = %191, %153, %148
  %193 = load i64, ptr %21, align 8, !tbaa !9
  %194 = add i64 %193, 1
  %195 = inttoptr i64 %194 to ptr
  %196 = load ptr, ptr %13, align 8, !tbaa !5
  %197 = getelementptr inbounds %struct.VmaAllocationRequest, ptr %196, i32 0, i32 0
  store ptr %195, ptr %197, align 8, !tbaa !32
  %198 = load ptr, ptr %13, align 8, !tbaa !5
  %199 = getelementptr inbounds %struct.VmaAllocationRequest, ptr %198, i32 0, i32 5
  store i32 3, ptr %199, align 8, !tbaa !36
  store i1 true, ptr %7, align 1
  store i32 1, ptr %24, align 4
  br label %201

200:                                              ; preds = %134
  store i32 0, ptr %24, align 4
  br label %201

201:                                              ; preds = %200, %192, %189
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  %202 = load i32, ptr %24, align 4
  switch i32 %202, label %384 [
    i32 0, label %203
  ]

203:                                              ; preds = %201
  br label %204

204:                                              ; preds = %203, %47
  %205 = getelementptr inbounds %class.VmaBlockMetadata_Linear, ptr %38, i32 0, i32 5
  %206 = load i32, ptr %205, align 4, !tbaa !15
  %207 = icmp eq i32 %206, 0
  br i1 %207, label %212, label %208

208:                                              ; preds = %204
  %209 = getelementptr inbounds %class.VmaBlockMetadata_Linear, ptr %38, i32 0, i32 5
  %210 = load i32, ptr %209, align 4, !tbaa !15
  %211 = icmp eq i32 %210, 1
  br i1 %211, label %212, label %383

212:                                              ; preds = %208, %204
  %213 = load ptr, ptr %17, align 8, !tbaa !5
  %214 = call noundef zeroext i1 @_ZNK9VmaVectorI16VmaSuballocation15VmaStlAllocatorIS0_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(32) %213)
  %215 = xor i1 %214, true
  br i1 %215, label %216, label %217

216:                                              ; preds = %212
  br label %219

217:                                              ; preds = %212
  call void @__assert_fail(ptr noundef @.str.75, ptr noundef @.str.2, i32 noundef 9091, ptr noundef @__PRETTY_FUNCTION__._ZN23VmaBlockMetadata_Linear36CreateAllocationRequest_LowerAddressEmm20VmaSuballocationTypejP20VmaAllocationRequest) #6
  unreachable

218:                                              ; No predecessors!
  br label %219

219:                                              ; preds = %218, %216
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #5
  store i64 0, ptr %29, align 8, !tbaa !9
  %220 = load ptr, ptr %18, align 8, !tbaa !5
  %221 = call noundef zeroext i1 @_ZNK9VmaVectorI16VmaSuballocation15VmaStlAllocatorIS0_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(32) %220)
  br i1 %221, label %234, label %222

222:                                              ; preds = %219
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #5
  %223 = load ptr, ptr %18, align 8, !tbaa !5
  %224 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN9VmaVectorI16VmaSuballocation15VmaStlAllocatorIS0_EE4backEv(ptr noundef nonnull align 8 dereferenceable(32) %223)
  store ptr %224, ptr %30, align 8, !tbaa !5
  %225 = load ptr, ptr %30, align 8, !tbaa !5
  %226 = getelementptr inbounds %struct.VmaSuballocation, ptr %225, i32 0, i32 0
  %227 = load i64, ptr %226, align 8, !tbaa !22
  %228 = load ptr, ptr %30, align 8, !tbaa !5
  %229 = getelementptr inbounds %struct.VmaSuballocation, ptr %228, i32 0, i32 1
  %230 = load i64, ptr %229, align 8, !tbaa !24
  %231 = add i64 %227, %230
  %232 = load i64, ptr %15, align 8, !tbaa !9
  %233 = add i64 %231, %232
  store i64 %233, ptr %29, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #5
  br label %234

234:                                              ; preds = %222, %219
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #5
  %235 = load i64, ptr %29, align 8, !tbaa !9
  store i64 %235, ptr %31, align 8, !tbaa !9
  %236 = load i64, ptr %31, align 8, !tbaa !9
  %237 = load i64, ptr %10, align 8, !tbaa !9
  %238 = call noundef i64 @_ZL10VmaAlignUpImET_S0_S0_(i64 noundef %236, i64 noundef %237)
  store i64 %238, ptr %31, align 8, !tbaa !9
  %239 = load i64, ptr %16, align 8, !tbaa !9
  %240 = icmp ugt i64 %239, 1
  br i1 %240, label %241, label %291

241:                                              ; preds = %234
  %242 = load i64, ptr %16, align 8, !tbaa !9
  %243 = load i64, ptr %10, align 8, !tbaa !9
  %244 = icmp ne i64 %242, %243
  br i1 %244, label %245, label %291

245:                                              ; preds = %241
  %246 = load ptr, ptr %18, align 8, !tbaa !5
  %247 = call noundef zeroext i1 @_ZNK9VmaVectorI16VmaSuballocation15VmaStlAllocatorIS0_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(32) %246)
  br i1 %247, label %291, label %248

248:                                              ; preds = %245
  call void @llvm.lifetime.start.p0(i64 1, ptr %32) #5
  store i8 0, ptr %32, align 1, !tbaa !25
  call void @llvm.lifetime.start.p0(i64 8, ptr %33) #5
  %249 = load ptr, ptr %18, align 8, !tbaa !5
  %250 = call noundef i64 @_ZNK9VmaVectorI16VmaSuballocation15VmaStlAllocatorIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %249)
  store i64 %250, ptr %33, align 8, !tbaa !9
  br label %251

251:                                              ; preds = %281, %248
  %252 = load i64, ptr %33, align 8, !tbaa !9
  %253 = add i64 %252, -1
  store i64 %253, ptr %33, align 8, !tbaa !9
  %254 = icmp ne i64 %252, 0
  br i1 %254, label %256, label %255

255:                                              ; preds = %251
  store i32 6, ptr %24, align 4
  br label %282

256:                                              ; preds = %251
  call void @llvm.lifetime.start.p0(i64 8, ptr %34) #5
  %257 = load ptr, ptr %18, align 8, !tbaa !5
  %258 = load i64, ptr %33, align 8, !tbaa !9
  %259 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN9VmaVectorI16VmaSuballocation15VmaStlAllocatorIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(32) %257, i64 noundef %258)
  store ptr %259, ptr %34, align 8, !tbaa !5
  %260 = load ptr, ptr %34, align 8, !tbaa !5
  %261 = getelementptr inbounds %struct.VmaSuballocation, ptr %260, i32 0, i32 0
  %262 = load i64, ptr %261, align 8, !tbaa !22
  %263 = load ptr, ptr %34, align 8, !tbaa !5
  %264 = getelementptr inbounds %struct.VmaSuballocation, ptr %263, i32 0, i32 1
  %265 = load i64, ptr %264, align 8, !tbaa !24
  %266 = load i64, ptr %31, align 8, !tbaa !9
  %267 = load i64, ptr %16, align 8, !tbaa !9
  %268 = call noundef zeroext i1 @_ZL19VmaBlocksOnSamePagemmmm(i64 noundef %262, i64 noundef %265, i64 noundef %266, i64 noundef %267)
  br i1 %268, label %269, label %277

269:                                              ; preds = %256
  %270 = load ptr, ptr %34, align 8, !tbaa !5
  %271 = getelementptr inbounds %struct.VmaSuballocation, ptr %270, i32 0, i32 3
  %272 = load i32, ptr %271, align 8, !tbaa !26
  %273 = load i32, ptr %11, align 4, !tbaa !11
  %274 = call noundef zeroext i1 @_ZL35VmaIsBufferImageGranularityConflict20VmaSuballocationTypeS_(i32 noundef %272, i32 noundef %273)
  br i1 %274, label %275, label %276

275:                                              ; preds = %269
  store i8 1, ptr %32, align 1, !tbaa !25
  store i32 6, ptr %24, align 4
  br label %279

276:                                              ; preds = %269
  br label %278

277:                                              ; preds = %256
  store i32 6, ptr %24, align 4
  br label %279

278:                                              ; preds = %276
  store i32 0, ptr %24, align 4
  br label %279

279:                                              ; preds = %278, %277, %275
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #5
  %280 = load i32, ptr %24, align 4
  switch i32 %280, label %282 [
    i32 0, label %281
  ]

281:                                              ; preds = %279
  br label %251, !llvm.loop !37

282:                                              ; preds = %279, %255
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #5
  br label %283

283:                                              ; preds = %282
  %284 = load i8, ptr %32, align 1, !tbaa !25, !range !29, !noundef !30
  %285 = trunc i8 %284 to i1
  br i1 %285, label %286, label %290

286:                                              ; preds = %283
  %287 = load i64, ptr %31, align 8, !tbaa !9
  %288 = load i64, ptr %16, align 8, !tbaa !9
  %289 = call noundef i64 @_ZL10VmaAlignUpImET_S0_S0_(i64 noundef %287, i64 noundef %288)
  store i64 %289, ptr %31, align 8, !tbaa !9
  br label %290

290:                                              ; preds = %286, %283
  call void @llvm.lifetime.end.p0(i64 1, ptr %32) #5
  br label %291

291:                                              ; preds = %290, %245, %241, %234
  call void @llvm.lifetime.start.p0(i64 8, ptr %35) #5
  %292 = getelementptr inbounds %class.VmaBlockMetadata_Linear, ptr %38, i32 0, i32 6
  %293 = load i64, ptr %292, align 8, !tbaa !38
  store i64 %293, ptr %35, align 8, !tbaa !9
  %294 = load i64, ptr %35, align 8, !tbaa !9
  %295 = load ptr, ptr %17, align 8, !tbaa !5
  %296 = call noundef i64 @_ZNK9VmaVectorI16VmaSuballocation15VmaStlAllocatorIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %295)
  %297 = icmp eq i64 %294, %296
  br i1 %297, label %298, label %306

298:                                              ; preds = %291
  %299 = load i64, ptr %31, align 8, !tbaa !9
  %300 = load i64, ptr %9, align 8, !tbaa !9
  %301 = add i64 %299, %300
  %302 = load i64, ptr %15, align 8, !tbaa !9
  %303 = add i64 %301, %302
  %304 = load i64, ptr %14, align 8, !tbaa !9
  %305 = icmp ule i64 %303, %304
  br i1 %305, label %323, label %306

306:                                              ; preds = %298, %291
  %307 = load i64, ptr %35, align 8, !tbaa !9
  %308 = load ptr, ptr %17, align 8, !tbaa !5
  %309 = call noundef i64 @_ZNK9VmaVectorI16VmaSuballocation15VmaStlAllocatorIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %308)
  %310 = icmp ult i64 %307, %309
  br i1 %310, label %311, label %379

311:                                              ; preds = %306
  %312 = load i64, ptr %31, align 8, !tbaa !9
  %313 = load i64, ptr %9, align 8, !tbaa !9
  %314 = add i64 %312, %313
  %315 = load i64, ptr %15, align 8, !tbaa !9
  %316 = add i64 %314, %315
  %317 = load ptr, ptr %17, align 8, !tbaa !5
  %318 = load i64, ptr %35, align 8, !tbaa !9
  %319 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN9VmaVectorI16VmaSuballocation15VmaStlAllocatorIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(32) %317, i64 noundef %318)
  %320 = getelementptr inbounds %struct.VmaSuballocation, ptr %319, i32 0, i32 0
  %321 = load i64, ptr %320, align 8, !tbaa !22
  %322 = icmp ule i64 %316, %321
  br i1 %322, label %323, label %379

323:                                              ; preds = %311, %298
  %324 = load i64, ptr %9, align 8, !tbaa !9
  %325 = load i64, ptr %16, align 8, !tbaa !9
  %326 = urem i64 %324, %325
  %327 = icmp ne i64 %326, 0
  br i1 %327, label %333, label %328

328:                                              ; preds = %323
  %329 = load i64, ptr %31, align 8, !tbaa !9
  %330 = load i64, ptr %16, align 8, !tbaa !9
  %331 = urem i64 %329, %330
  %332 = icmp ne i64 %331, 0
  br i1 %332, label %333, label %371

333:                                              ; preds = %328, %323
  call void @llvm.lifetime.start.p0(i64 8, ptr %36) #5
  %334 = load i64, ptr %35, align 8, !tbaa !9
  store i64 %334, ptr %36, align 8, !tbaa !9
  br label %335

335:                                              ; preds = %365, %333
  %336 = load i64, ptr %36, align 8, !tbaa !9
  %337 = load ptr, ptr %17, align 8, !tbaa !5
  %338 = call noundef i64 @_ZNK9VmaVectorI16VmaSuballocation15VmaStlAllocatorIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %337)
  %339 = icmp ult i64 %336, %338
  br i1 %339, label %341, label %340

340:                                              ; preds = %335
  store i32 8, ptr %24, align 4
  br label %368

341:                                              ; preds = %335
  call void @llvm.lifetime.start.p0(i64 8, ptr %37) #5
  %342 = load ptr, ptr %17, align 8, !tbaa !5
  %343 = load i64, ptr %36, align 8, !tbaa !9
  %344 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN9VmaVectorI16VmaSuballocation15VmaStlAllocatorIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(32) %342, i64 noundef %343)
  store ptr %344, ptr %37, align 8, !tbaa !5
  %345 = load i64, ptr %31, align 8, !tbaa !9
  %346 = load i64, ptr %9, align 8, !tbaa !9
  %347 = load ptr, ptr %37, align 8, !tbaa !5
  %348 = getelementptr inbounds %struct.VmaSuballocation, ptr %347, i32 0, i32 0
  %349 = load i64, ptr %348, align 8, !tbaa !22
  %350 = load i64, ptr %16, align 8, !tbaa !9
  %351 = call noundef zeroext i1 @_ZL19VmaBlocksOnSamePagemmmm(i64 noundef %345, i64 noundef %346, i64 noundef %349, i64 noundef %350)
  br i1 %351, label %352, label %360

352:                                              ; preds = %341
  %353 = load i32, ptr %11, align 4, !tbaa !11
  %354 = load ptr, ptr %37, align 8, !tbaa !5
  %355 = getelementptr inbounds %struct.VmaSuballocation, ptr %354, i32 0, i32 3
  %356 = load i32, ptr %355, align 8, !tbaa !26
  %357 = call noundef zeroext i1 @_ZL35VmaIsBufferImageGranularityConflict20VmaSuballocationTypeS_(i32 noundef %353, i32 noundef %356)
  br i1 %357, label %358, label %359

358:                                              ; preds = %352
  store i1 false, ptr %7, align 1
  store i32 1, ptr %24, align 4
  br label %362

359:                                              ; preds = %352
  br label %361

360:                                              ; preds = %341
  store i32 8, ptr %24, align 4
  br label %362

361:                                              ; preds = %359
  store i32 0, ptr %24, align 4
  br label %362

362:                                              ; preds = %361, %360, %358
  call void @llvm.lifetime.end.p0(i64 8, ptr %37) #5
  %363 = load i32, ptr %24, align 4
  switch i32 %363, label %368 [
    i32 0, label %364
  ]

364:                                              ; preds = %362
  br label %365

365:                                              ; preds = %364
  %366 = load i64, ptr %36, align 8, !tbaa !9
  %367 = add i64 %366, 1
  store i64 %367, ptr %36, align 8, !tbaa !9
  br label %335, !llvm.loop !39

368:                                              ; preds = %362, %340
  call void @llvm.lifetime.end.p0(i64 8, ptr %36) #5
  %369 = load i32, ptr %24, align 4
  switch i32 %369, label %380 [
    i32 8, label %370
  ]

370:                                              ; preds = %368
  br label %371

371:                                              ; preds = %370, %328
  %372 = load i64, ptr %31, align 8, !tbaa !9
  %373 = add i64 %372, 1
  %374 = inttoptr i64 %373 to ptr
  %375 = load ptr, ptr %13, align 8, !tbaa !5
  %376 = getelementptr inbounds %struct.VmaAllocationRequest, ptr %375, i32 0, i32 0
  store ptr %374, ptr %376, align 8, !tbaa !32
  %377 = load ptr, ptr %13, align 8, !tbaa !5
  %378 = getelementptr inbounds %struct.VmaAllocationRequest, ptr %377, i32 0, i32 5
  store i32 4, ptr %378, align 8, !tbaa !36
  store i1 true, ptr %7, align 1
  store i32 1, ptr %24, align 4
  br label %380

379:                                              ; preds = %311, %306
  store i32 0, ptr %24, align 4
  br label %380

380:                                              ; preds = %379, %371, %368
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #5
  %381 = load i32, ptr %24, align 4
  switch i32 %381, label %384 [
    i32 0, label %382
  ]

382:                                              ; preds = %380
  br label %383

383:                                              ; preds = %382, %208
  store i1 false, ptr %7, align 1
  store i32 1, ptr %24, align 4
  br label %384

384:                                              ; preds = %383, %380, %201
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  %385 = load i1, ptr %7, align 1
  ret i1 %385
}

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef zeroext i1 @_ZL19VmaBlocksOnSamePagemmmm(i64 noundef, i64 noundef, i64 noundef, i64 noundef) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
attributes #6 = { noreturn 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, !21, i64 116}
!16 = !{!"_ZTS23VmaBlockMetadata_Linear", !17, i64 0, !10, i64 40, !19, i64 48, !19, i64 80, !14, 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 = !{!23, !10, i64 0}
!23 = !{!"_ZTS16VmaSuballocation", !10, i64 0, !10, i64 8, !6, i64 16, !12, i64 24}
!24 = !{!23, !10, i64 8}
!25 = !{!18, !18, i64 0}
!26 = !{!23, !12, i64 24}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.mustprogress"}
!29 = !{i8 0, i8 2}
!30 = !{}
!31 = distinct !{!31, !28}
!32 = !{!33, !6, i64 0}
!33 = !{!"_ZTS20VmaAllocationRequest", !6, i64 0, !10, i64 8, !34, i64 16, !6, i64 32, !10, i64 40, !35, i64 48}
!34 = !{!"_ZTSN7VmaListI16VmaSuballocation15VmaStlAllocatorIS0_EE8iteratorE", !6, i64 0, !6, i64 8}
!35 = !{!"_ZTS24VmaAllocationRequestType", !7, i64 0}
!36 = !{!33, !35, i64 48}
!37 = distinct !{!37, !28}
!38 = !{!16, !10, i64 120}
!39 = distinct !{!39, !28}


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

@.str.2 = external hidden unnamed_addr constant [84 x i8], align 1
@.str.75 = external hidden unnamed_addr constant [27 x i8], align 1
@__PRETTY_FUNCTION__._ZN23VmaBlockMetadata_Linear36CreateAllocationRequest_LowerAddressEmm20VmaSuballocationTypejP20VmaAllocationRequest = external hidden unnamed_addr constant [151 x i8], align 1

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #0

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef i64 @_ZL10VmaAlignUpImET_S0_S0_(i64 noundef, i64 noundef) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef zeroext i1 @_ZL35VmaIsBufferImageGranularityConflict20VmaSuballocationTypeS_(i32 noundef, i32 noundef) local_unnamed_addr #2

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

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

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef zeroext i1 @_ZN23VmaBlockMetadata_Linear36CreateAllocationRequest_LowerAddressEmm20VmaSuballocationTypejP20VmaAllocationRequest(ptr noundef nonnull align 8 dereferenceable(144) %0, i64 noundef %1, i64 noundef %2, i32 noundef %3, i32 noundef %4, ptr nocapture noundef writeonly %5) local_unnamed_addr #1 align 2 {
  %7 = tail call noundef i64 @_ZNK16VmaBlockMetadata7GetSizeEv(ptr noundef nonnull align 8 dereferenceable(33) %0)
  %8 = tail call noundef i64 @_ZNK16VmaBlockMetadata14GetDebugMarginEv(ptr noundef nonnull align 8 dereferenceable(33) %0)
  %9 = tail call noundef i64 @_ZNK16VmaBlockMetadata25GetBufferImageGranularityEv(ptr noundef nonnull align 8 dereferenceable(33) %0)
  %10 = tail call noundef nonnull align 8 dereferenceable(32) ptr @_ZN23VmaBlockMetadata_Linear23AccessSuballocations1stEv(ptr noundef nonnull align 8 dereferenceable(144) %0)
  %11 = tail call noundef nonnull align 8 dereferenceable(32) ptr @_ZN23VmaBlockMetadata_Linear23AccessSuballocations2ndEv(ptr noundef nonnull align 8 dereferenceable(144) %0)
  %12 = getelementptr inbounds i8, ptr %0, i64 116
  %13 = load i32, ptr %12, align 4, !tbaa !5
  switch i32 %13, label %71 [
    i32 0, label %14
    i32 2, label %14
  ]

14:                                               ; preds = %6, %6
  %15 = tail call noundef zeroext i1 @_ZNK9VmaVectorI16VmaSuballocation15VmaStlAllocatorIS0_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(32) %10)
  br i1 %15, label %23, label %16

16:                                               ; preds = %14
  %17 = tail call noundef nonnull align 8 dereferenceable(32) ptr @_ZN9VmaVectorI16VmaSuballocation15VmaStlAllocatorIS0_EE4backEv(ptr noundef nonnull align 8 dereferenceable(32) %10)
  %18 = load i64, ptr %17, align 8, !tbaa !17
  %19 = getelementptr inbounds i8, ptr %17, i64 8
  %20 = load i64, ptr %19, align 8, !tbaa !20
  %21 = add i64 %18, %8
  %22 = add i64 %21, %20
  br label %23

23:                                               ; preds = %16, %14
  %.0123 = phi i64 [ 0, %14 ], [ %22, %16 ]
  %24 = tail call noundef i64 @_ZL10VmaAlignUpImET_S0_S0_(i64 noundef %.0123, i64 noundef %2)
  %25 = icmp ult i64 %9, 2
  %.not = icmp eq i64 %9, %2
  %or.cond = or i1 %25, %.not
  br i1 %or.cond, label %.thread, label %26

26:                                               ; preds = %23
  %27 = tail call noundef zeroext i1 @_ZNK9VmaVectorI16VmaSuballocation15VmaStlAllocatorIS0_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(32) %10)
  br i1 %27, label %.thread, label %28

28:                                               ; preds = %26
  %29 = tail call noundef i64 @_ZNK9VmaVectorI16VmaSuballocation15VmaStlAllocatorIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %10)
  br label %30

30:                                               ; preds = %38, %28
  %.0136 = phi i64 [ %29, %28 ], [ %31, %38 ]
  %31 = add i64 %.0136, -1
  %.not151 = icmp eq i64 %.0136, 0
  br i1 %.not151, label %.thread, label %32

32:                                               ; preds = %30
  %33 = tail call noundef nonnull align 8 dereferenceable(32) ptr @_ZN9VmaVectorI16VmaSuballocation15VmaStlAllocatorIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(32) %10, i64 noundef %31)
  %34 = load i64, ptr %33, align 8, !tbaa !17
  %35 = getelementptr inbounds i8, ptr %33, i64 8
  %36 = load i64, ptr %35, align 8, !tbaa !20
  %37 = tail call noundef zeroext i1 @_ZL19VmaBlocksOnSamePagemmmm(i64 noundef %34, i64 noundef %36, i64 noundef %24, i64 noundef %9)
  br i1 %37, label %38, label %.thread

38:                                               ; preds = %32
  %39 = getelementptr inbounds i8, ptr %33, i64 24
  %40 = load i32, ptr %39, align 8, !tbaa !21
  %41 = tail call noundef zeroext i1 @_ZL35VmaIsBufferImageGranularityConflict20VmaSuballocationTypeS_(i32 noundef %40, i32 noundef %3)
  br i1 %41, label %.critedge, label %30, !llvm.loop !22

.critedge:                                        ; preds = %38
  %42 = tail call noundef i64 @_ZL10VmaAlignUpImET_S0_S0_(i64 noundef %24, i64 noundef %9)
  br label %.thread

.thread:                                          ; preds = %30, %32, %.critedge, %26, %23
  %.1125 = phi i64 [ %24, %26 ], [ %24, %23 ], [ %42, %.critedge ], [ %24, %32 ], [ %24, %30 ]
  %43 = load i32, ptr %12, align 4, !tbaa !5
  %44 = icmp eq i32 %43, 2
  br i1 %44, label %45, label %48

45:                                               ; preds = %.thread
  %46 = tail call noundef nonnull align 8 dereferenceable(32) ptr @_ZN9VmaVectorI16VmaSuballocation15VmaStlAllocatorIS0_EE4backEv(ptr noundef nonnull align 8 dereferenceable(32) %11)
  %47 = load i64, ptr %46, align 8, !tbaa !17
  br label %48

48:                                               ; preds = %.thread, %45
  %49 = phi i64 [ %47, %45 ], [ %7, %.thread ]
  %50 = add i64 %8, %1
  %51 = add i64 %50, %.1125
  %.not152 = icmp ugt i64 %51, %49
  br i1 %.not152, label %thread-pre-split, label %52

52:                                               ; preds = %48
  %53 = urem i64 %1, %9
  %.not153 = icmp eq i64 %53, 0
  br i1 %.not153, label %54, label %58

54:                                               ; preds = %52
  %55 = urem i64 %.1125, %9
  %.not154 = icmp ne i64 %55, 0
  %56 = load i32, ptr %12, align 4
  %57 = icmp eq i32 %56, 2
  %or.cond163 = select i1 %.not154, i1 %57, i1 false
  br i1 %or.cond163, label %59, label %.thread199.sink.split

58:                                               ; preds = %52
  %.old = load i32, ptr %12, align 4, !tbaa !5
  %.old162 = icmp eq i32 %.old, 2
  br i1 %.old162, label %59, label %.thread199.sink.split

59:                                               ; preds = %54, %58
  %60 = tail call noundef i64 @_ZNK9VmaVectorI16VmaSuballocation15VmaStlAllocatorIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %11)
  br label %61

61:                                               ; preds = %67, %59
  %.0137 = phi i64 [ %60, %59 ], [ %62, %67 ]
  %62 = add i64 %.0137, -1
  %.not155 = icmp eq i64 %.0137, 0
  br i1 %.not155, label %.thread199.sink.split, label %63

63:                                               ; preds = %61
  %64 = tail call noundef nonnull align 8 dereferenceable(32) ptr @_ZN9VmaVectorI16VmaSuballocation15VmaStlAllocatorIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(32) %11, i64 noundef %62)
  %65 = load i64, ptr %64, align 8, !tbaa !17
  %66 = tail call noundef zeroext i1 @_ZL19VmaBlocksOnSamePagemmmm(i64 noundef %.1125, i64 noundef %1, i64 noundef %65, i64 noundef %9)
  br i1 %66, label %67, label %.thread199.sink.split

67:                                               ; preds = %63
  %68 = getelementptr inbounds i8, ptr %64, i64 24
  %69 = load i32, ptr %68, align 8, !tbaa !21
  %70 = tail call noundef zeroext i1 @_ZL35VmaIsBufferImageGranularityConflict20VmaSuballocationTypeS_(i32 noundef %3, i32 noundef %69)
  br i1 %70, label %.thread199, label %61, !llvm.loop !24

thread-pre-split:                                 ; preds = %48
  %.pr = load i32, ptr %12, align 4, !tbaa !5
  br label %71

71:                                               ; preds = %thread-pre-split, %6
  %72 = phi i32 [ %.pr, %thread-pre-split ], [ %13, %6 ]
  %switch = icmp ult i32 %72, 2
  br i1 %switch, label %73, label %.thread199

73:                                               ; preds = %71
  %74 = tail call noundef zeroext i1 @_ZNK9VmaVectorI16VmaSuballocation15VmaStlAllocatorIS0_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(32) %10)
  br i1 %74, label %75, label %76

75:                                               ; preds = %73
  tail call void @__assert_fail(ptr noundef nonnull @.str.75, ptr noundef nonnull @.str.2, i32 noundef 9091, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN23VmaBlockMetadata_Linear36CreateAllocationRequest_LowerAddressEmm20VmaSuballocationTypejP20VmaAllocationRequest) #3
  unreachable

76:                                               ; preds = %73
  %77 = tail call noundef zeroext i1 @_ZNK9VmaVectorI16VmaSuballocation15VmaStlAllocatorIS0_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(32) %11)
  br i1 %77, label %85, label %78

78:                                               ; preds = %76
  %79 = tail call noundef nonnull align 8 dereferenceable(32) ptr @_ZN9VmaVectorI16VmaSuballocation15VmaStlAllocatorIS0_EE4backEv(ptr noundef nonnull align 8 dereferenceable(32) %11)
  %80 = load i64, ptr %79, align 8, !tbaa !17
  %81 = getelementptr inbounds i8, ptr %79, i64 8
  %82 = load i64, ptr %81, align 8, !tbaa !20
  %83 = add i64 %80, %8
  %84 = add i64 %83, %82
  br label %85

85:                                               ; preds = %78, %76
  %.0135 = phi i64 [ 0, %76 ], [ %84, %78 ]
  %86 = tail call noundef i64 @_ZL10VmaAlignUpImET_S0_S0_(i64 noundef %.0135, i64 noundef %2)
  %87 = icmp ult i64 %9, 2
  %.not156 = icmp eq i64 %9, %2
  %or.cond166 = or i1 %87, %.not156
  br i1 %or.cond166, label %.thread186, label %88

88:                                               ; preds = %85
  %89 = tail call noundef zeroext i1 @_ZNK9VmaVectorI16VmaSuballocation15VmaStlAllocatorIS0_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(32) %11)
  br i1 %89, label %.thread186, label %90

90:                                               ; preds = %88
  %91 = tail call noundef i64 @_ZNK9VmaVectorI16VmaSuballocation15VmaStlAllocatorIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %11)
  br label %92

92:                                               ; preds = %100, %90
  %.0126 = phi i64 [ %91, %90 ], [ %93, %100 ]
  %93 = add i64 %.0126, -1
  %.not157 = icmp eq i64 %.0126, 0
  br i1 %.not157, label %.thread186, label %94

94:                                               ; preds = %92
  %95 = tail call noundef nonnull align 8 dereferenceable(32) ptr @_ZN9VmaVectorI16VmaSuballocation15VmaStlAllocatorIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(32) %11, i64 noundef %93)
  %96 = load i64, ptr %95, align 8, !tbaa !17
  %97 = getelementptr inbounds i8, ptr %95, i64 8
  %98 = load i64, ptr %97, align 8, !tbaa !20
  %99 = tail call noundef zeroext i1 @_ZL19VmaBlocksOnSamePagemmmm(i64 noundef %96, i64 noundef %98, i64 noundef %86, i64 noundef %9)
  br i1 %99, label %100, label %.thread186

100:                                              ; preds = %94
  %101 = getelementptr inbounds i8, ptr %95, i64 24
  %102 = load i32, ptr %101, align 8, !tbaa !21
  %103 = tail call noundef zeroext i1 @_ZL35VmaIsBufferImageGranularityConflict20VmaSuballocationTypeS_(i32 noundef %102, i32 noundef %3)
  br i1 %103, label %.critedge214, label %92, !llvm.loop !25

.critedge214:                                     ; preds = %100
  %104 = tail call noundef i64 @_ZL10VmaAlignUpImET_S0_S0_(i64 noundef %86, i64 noundef %9)
  br label %.thread186

.thread186:                                       ; preds = %92, %94, %.critedge214, %88, %85
  %.1131 = phi i64 [ %86, %88 ], [ %86, %85 ], [ %104, %.critedge214 ], [ %86, %94 ], [ %86, %92 ]
  %105 = getelementptr inbounds i8, ptr %0, i64 120
  %106 = load i64, ptr %105, align 8, !tbaa !26
  %107 = tail call noundef i64 @_ZNK9VmaVectorI16VmaSuballocation15VmaStlAllocatorIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %10)
  %108 = icmp eq i64 %106, %107
  br i1 %108, label %109, label %112

109:                                              ; preds = %.thread186
  %110 = add i64 %8, %1
  %111 = add i64 %110, %.1131
  %.not158 = icmp ugt i64 %111, %7
  br i1 %.not158, label %112, label %120

112:                                              ; preds = %109, %.thread186
  %113 = tail call noundef i64 @_ZNK9VmaVectorI16VmaSuballocation15VmaStlAllocatorIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %10)
  %114 = icmp ult i64 %106, %113
  br i1 %114, label %115, label %.thread199

115:                                              ; preds = %112
  %116 = add i64 %8, %1
  %117 = add i64 %116, %.1131
  %118 = tail call noundef nonnull align 8 dereferenceable(32) ptr @_ZN9VmaVectorI16VmaSuballocation15VmaStlAllocatorIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(32) %10, i64 noundef %106)
  %119 = load i64, ptr %118, align 8, !tbaa !17
  %.not159 = icmp ugt i64 %117, %119
  br i1 %.not159, label %.thread199, label %120

120:                                              ; preds = %115, %109
  %121 = urem i64 %1, %9
  %.not160 = icmp eq i64 %121, 0
  br i1 %.not160, label %122, label %124

122:                                              ; preds = %120
  %123 = urem i64 %.1131, %9
  %.not161 = icmp eq i64 %123, 0
  br i1 %.not161, label %.thread199.sink.split, label %124

124:                                              ; preds = %122, %120
  %125 = tail call noundef i64 @_ZNK9VmaVectorI16VmaSuballocation15VmaStlAllocatorIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %10)
  %126 = icmp ult i64 %106, %125
  br i1 %126, label %.lr.ph, label %.thread199.sink.split

127:                                              ; preds = %134
  %128 = add nuw i64 %.0122209, 1
  %129 = tail call noundef i64 @_ZNK9VmaVectorI16VmaSuballocation15VmaStlAllocatorIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(32) %10)
  %130 = icmp ult i64 %128, %129
  br i1 %130, label %.lr.ph, label %.thread199.sink.split, !llvm.loop !27

.lr.ph:                                           ; preds = %124, %127
  %.0122209 = phi i64 [ %128, %127 ], [ %106, %124 ]
  %131 = tail call noundef nonnull align 8 dereferenceable(32) ptr @_ZN9VmaVectorI16VmaSuballocation15VmaStlAllocatorIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(32) %10, i64 noundef %.0122209)
  %132 = load i64, ptr %131, align 8, !tbaa !17
  %133 = tail call noundef zeroext i1 @_ZL19VmaBlocksOnSamePagemmmm(i64 noundef %.1131, i64 noundef %1, i64 noundef %132, i64 noundef %9)
  br i1 %133, label %134, label %.thread199.sink.split

134:                                              ; preds = %.lr.ph
  %135 = getelementptr inbounds i8, ptr %131, i64 24
  %136 = load i32, ptr %135, align 8, !tbaa !21
  %137 = tail call noundef zeroext i1 @_ZL35VmaIsBufferImageGranularityConflict20VmaSuballocationTypeS_(i32 noundef %3, i32 noundef %136)
  br i1 %137, label %.thread199, label %127

.thread199.sink.split:                            ; preds = %63, %61, %127, %.lr.ph, %122, %124, %58, %54
  %.1131.sink = phi i64 [ %.1125, %54 ], [ %.1125, %58 ], [ %.1131, %124 ], [ %.1131, %122 ], [ %.1131, %.lr.ph ], [ %.1131, %127 ], [ %.1125, %61 ], [ %.1125, %63 ]
  %.sink = phi i32 [ 3, %54 ], [ 3, %58 ], [ 4, %124 ], [ 4, %122 ], [ 4, %.lr.ph ], [ 4, %127 ], [ 3, %61 ], [ 3, %63 ]
  %138 = add i64 %.1131.sink, 1
  %139 = inttoptr i64 %138 to ptr
  store ptr %139, ptr %5, align 8, !tbaa !28
  %140 = getelementptr inbounds i8, ptr %5, i64 48
  store i32 %.sink, ptr %140, align 8, !tbaa !32
  br label %.thread199

.thread199:                                       ; preds = %67, %134, %.thread199.sink.split, %71, %115, %112
  %.9 = phi i1 [ false, %112 ], [ false, %115 ], [ false, %71 ], [ true, %.thread199.sink.split ], [ false, %134 ], [ false, %67 ]
  ret i1 %.9
}

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef zeroext i1 @_ZL19VmaBlocksOnSamePagemmmm(i64 noundef, i64 noundef, i64 noundef, i64 noundef) local_unnamed_addr #2

attributes #0 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 = { 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 #3 = { noreturn 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, !16, i64 116}
!6 = !{!"_ZTS23VmaBlockMetadata_Linear", !7, i64 0, !8, i64 40, !13, i64 48, !13, i64 80, !15, i64 112, !16, i64 116, !8, i64 120, !8, i64 128, !8, i64 136}
!7 = !{!"_ZTS16VmaBlockMetadata", !8, i64 8, !11, i64 16, !8, i64 24, !12, i64 32}
!8 = !{!"long", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"any pointer", !9, i64 0}
!12 = !{!"bool", !9, i64 0}
!13 = !{!"_ZTS9VmaVectorI16VmaSuballocation15VmaStlAllocatorIS0_EE", !14, i64 0, !11, i64 8, !8, i64 16, !8, i64 24}
!14 = !{!"_ZTS15VmaStlAllocatorI16VmaSuballocationE", !11, i64 0}
!15 = !{!"int", !9, i64 0}
!16 = !{!"_ZTSN23VmaBlockMetadata_Linear18SECOND_VECTOR_MODEE", !9, i64 0}
!17 = !{!18, !8, i64 0}
!18 = !{!"_ZTS16VmaSuballocation", !8, i64 0, !8, i64 8, !11, i64 16, !19, i64 24}
!19 = !{!"_ZTS20VmaSuballocationType", !9, i64 0}
!20 = !{!18, !8, i64 8}
!21 = !{!18, !19, i64 24}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = distinct !{!24, !23}
!25 = distinct !{!25, !23}
!26 = !{!6, !8, i64 120}
!27 = distinct !{!27, !23}
!28 = !{!29, !11, i64 0}
!29 = !{!"_ZTS20VmaAllocationRequest", !11, i64 0, !8, i64 8, !30, i64 16, !11, i64 32, !8, i64 40, !31, i64 48}
!30 = !{!"_ZTSN7VmaListI16VmaSuballocation15VmaStlAllocatorIS0_EE8iteratorE", !11, i64 0, !11, i64 8}
!31 = !{!"_ZTS24VmaAllocationRequestType", !9, i64 0}
!32 = !{!29, !31, i64 48}


; Effective O3 passes: ADCEPass,AggressiveInstCombinePass,BDCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass