; 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.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 }
%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 }

@.str.2 = external hidden unnamed_addr constant [84 x i8], align 1
@.str.57 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.64 = external hidden unnamed_addr constant [155 x i8], align 1
@__PRETTY_FUNCTION__._ZN23VmaBlockMetadata_Linear5AllocERK20VmaAllocationRequest20VmaSuballocationTypePv = external hidden unnamed_addr constant [104 x i8], align 1
@.str.65 = external hidden unnamed_addr constant [103 x i8], align 1
@.str.66 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.67 = external hidden unnamed_addr constant [106 x i8], align 1
@.str.68 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.69 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.70 = external hidden unnamed_addr constant [112 x i8], align 1
@.str.71 = external hidden unnamed_addr constant [32 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: 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 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 uwtable
define dso_local void @_ZN23VmaBlockMetadata_Linear5AllocERK20VmaAllocationRequest20VmaSuballocationTypePv(ptr noundef nonnull align 8 dereferenceable(144) %0, ptr noundef nonnull align 8 dereferenceable(52) %1, i32 noundef %2, ptr noundef %3) unnamed_addr #3 align 2 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i64, align 8
  %10 = alloca %struct.VmaSuballocation, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store i32 %2, ptr %7, align 4, !tbaa !9
  store ptr %3, ptr %8, align 8, !tbaa !5
  %15 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %16 = load ptr, ptr %6, align 8, !tbaa !5
  %17 = getelementptr inbounds %struct.VmaAllocationRequest, ptr %16, i32 0, i32 0
  %18 = load ptr, ptr %17, align 8, !tbaa !11
  %19 = ptrtoint ptr %18 to i64
  %20 = sub i64 %19, 1
  store i64 %20, ptr %9, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 32, ptr %10) #4
  %21 = getelementptr inbounds %struct.VmaSuballocation, ptr %10, i32 0, i32 0
  %22 = load i64, ptr %9, align 8, !tbaa !16
  store i64 %22, ptr %21, align 8, !tbaa !17
  %23 = getelementptr inbounds %struct.VmaSuballocation, ptr %10, i32 0, i32 1
  %24 = load ptr, ptr %6, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.VmaAllocationRequest, ptr %24, i32 0, i32 1
  %26 = load i64, ptr %25, align 8, !tbaa !19
  store i64 %26, ptr %23, align 8, !tbaa !20
  %27 = getelementptr inbounds %struct.VmaSuballocation, ptr %10, i32 0, i32 2
  %28 = load ptr, ptr %8, align 8, !tbaa !5
  store ptr %28, ptr %27, align 8, !tbaa !21
  %29 = getelementptr inbounds %struct.VmaSuballocation, ptr %10, i32 0, i32 3
  %30 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %30, ptr %29, align 8, !tbaa !22
  %31 = load ptr, ptr %6, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.VmaAllocationRequest, ptr %31, i32 0, i32 5
  %33 = load i32, ptr %32, align 8, !tbaa !23
  switch i32 %33, label %128 [
    i32 2, label %34
    i32 3, label %48
    i32 4, label %82
  ]

34:                                               ; preds = %4
  %35 = getelementptr inbounds %class.VmaBlockMetadata_Linear, ptr %15, i32 0, i32 5
  %36 = load i32, ptr %35, align 4, !tbaa !24
  %37 = icmp ne i32 %36, 1
  br i1 %37, label %38, label %39

38:                                               ; preds = %34
  br label %39

39:                                               ; preds = %38, %34
  %40 = phi i1 [ false, %34 ], [ true, %38 ]
  br i1 %40, label %41, label %42

41:                                               ; preds = %39
  br label %44

42:                                               ; preds = %39
  call void @__assert_fail(ptr noundef @.str.64, ptr noundef @.str.2, i32 noundef 8637, ptr noundef @__PRETTY_FUNCTION__._ZN23VmaBlockMetadata_Linear5AllocERK20VmaAllocationRequest20VmaSuballocationTypePv) #5
  unreachable

43:                                               ; No predecessors!
  br label %44

44:                                               ; preds = %43, %41
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  %45 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN23VmaBlockMetadata_Linear23AccessSuballocations2ndEv(ptr noundef nonnull align 8 dereferenceable(144) %15)
  store ptr %45, ptr %11, align 8, !tbaa !5
  %46 = load ptr, ptr %11, align 8, !tbaa !5
  call void @_ZN9VmaVectorI16VmaSuballocation15VmaStlAllocatorIS0_EE9push_backERKS0_(ptr noundef nonnull align 8 dereferenceable(32) %46, ptr noundef nonnull align 8 dereferenceable(32) %10)
  %47 = getelementptr inbounds %class.VmaBlockMetadata_Linear, ptr %15, i32 0, i32 5
  store i32 2, ptr %47, align 4, !tbaa !24
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  br label %129

48:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  %49 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN23VmaBlockMetadata_Linear23AccessSuballocations1stEv(ptr noundef nonnull align 8 dereferenceable(144) %15)
  store ptr %49, ptr %12, align 8, !tbaa !5
  %50 = load ptr, ptr %12, align 8, !tbaa !5
  %51 = call noundef zeroext i1 @_ZNK9VmaVectorI16VmaSuballocation15VmaStlAllocatorIS0_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(32) %50)
  br i1 %51, label %64, label %52

52:                                               ; preds = %48
  %53 = load i64, ptr %9, align 8, !tbaa !16
  %54 = load ptr, ptr %12, align 8, !tbaa !5
  %55 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN9VmaVectorI16VmaSuballocation15VmaStlAllocatorIS0_EE4backEv(ptr noundef nonnull align 8 dereferenceable(32) %54)
  %56 = getelementptr inbounds %struct.VmaSuballocation, ptr %55, i32 0, i32 0
  %57 = load i64, ptr %56, align 8, !tbaa !17
  %58 = load ptr, ptr %12, align 8, !tbaa !5
  %59 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN9VmaVectorI16VmaSuballocation15VmaStlAllocatorIS0_EE4backEv(ptr noundef nonnull align 8 dereferenceable(32) %58)
  %60 = getelementptr inbounds %struct.VmaSuballocation, ptr %59, i32 0, i32 1
  %61 = load i64, ptr %60, align 8, !tbaa !20
  %62 = add i64 %57, %61
  %63 = icmp uge i64 %53, %62
  br label %64

64:                                               ; preds = %52, %48
  %65 = phi i1 [ true, %48 ], [ %63, %52 ]
  br i1 %65, label %66, label %67

66:                                               ; preds = %64
  br label %69

67:                                               ; preds = %64
  call void @__assert_fail(ptr noundef @.str.65, ptr noundef @.str.2, i32 noundef 8648, ptr noundef @__PRETTY_FUNCTION__._ZN23VmaBlockMetadata_Linear5AllocERK20VmaAllocationRequest20VmaSuballocationTypePv) #5
  unreachable

68:                                               ; No predecessors!
  br label %69

69:                                               ; preds = %68, %66
  %70 = load i64, ptr %9, align 8, !tbaa !16
  %71 = load ptr, ptr %6, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.VmaAllocationRequest, ptr %71, i32 0, i32 1
  %73 = load i64, ptr %72, align 8, !tbaa !19
  %74 = add i64 %70, %73
  %75 = call noundef i64 @_ZNK16VmaBlockMetadata7GetSizeEv(ptr noundef nonnull align 8 dereferenceable(33) %15)
  %76 = icmp ule i64 %74, %75
  br i1 %76, label %77, label %78

77:                                               ; preds = %69
  br label %80

78:                                               ; preds = %69
  call void @__assert_fail(ptr noundef @.str.66, ptr noundef @.str.2, i32 noundef 8650, ptr noundef @__PRETTY_FUNCTION__._ZN23VmaBlockMetadata_Linear5AllocERK20VmaAllocationRequest20VmaSuballocationTypePv) #5
  unreachable

79:                                               ; No predecessors!
  br label %80

80:                                               ; preds = %79, %77
  %81 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN9VmaVectorI16VmaSuballocation15VmaStlAllocatorIS0_EE9push_backERKS0_(ptr noundef nonnull align 8 dereferenceable(32) %81, ptr noundef nonnull align 8 dereferenceable(32) %10)
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  br label %129

82:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  %83 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN23VmaBlockMetadata_Linear23AccessSuballocations1stEv(ptr noundef nonnull align 8 dereferenceable(144) %15)
  store ptr %83, ptr %13, align 8, !tbaa !5
  %84 = load ptr, ptr %13, align 8, !tbaa !5
  %85 = call noundef zeroext i1 @_ZNK9VmaVectorI16VmaSuballocation15VmaStlAllocatorIS0_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(32) %84)
  br i1 %85, label %99, label %86

86:                                               ; preds = %82
  %87 = load i64, ptr %9, align 8, !tbaa !16
  %88 = load ptr, ptr %6, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.VmaAllocationRequest, ptr %88, i32 0, i32 1
  %90 = load i64, ptr %89, align 8, !tbaa !19
  %91 = add i64 %87, %90
  %92 = load ptr, ptr %13, align 8, !tbaa !5
  %93 = getelementptr inbounds %class.VmaBlockMetadata_Linear, ptr %15, i32 0, i32 6
  %94 = load i64, ptr %93, align 8, !tbaa !32
  %95 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN9VmaVectorI16VmaSuballocation15VmaStlAllocatorIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(32) %92, i64 noundef %94)
  %96 = getelementptr inbounds %struct.VmaSuballocation, ptr %95, i32 0, i32 0
  %97 = load i64, ptr %96, align 8, !tbaa !17
  %98 = icmp ule i64 %91, %97
  br label %99

99:                                               ; preds = %86, %82
  %100 = phi i1 [ false, %82 ], [ %98, %86 ]
  br i1 %100, label %101, label %102

101:                                              ; preds = %99
  br label %104

102:                                              ; preds = %99
  call void @__assert_fail(ptr noundef @.str.67, ptr noundef @.str.2, i32 noundef 8660, ptr noundef @__PRETTY_FUNCTION__._ZN23VmaBlockMetadata_Linear5AllocERK20VmaAllocationRequest20VmaSuballocationTypePv) #5
  unreachable

103:                                              ; No predecessors!
  br label %104

104:                                              ; preds = %103, %101
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  %105 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN23VmaBlockMetadata_Linear23AccessSuballocations2ndEv(ptr noundef nonnull align 8 dereferenceable(144) %15)
  store ptr %105, ptr %14, align 8, !tbaa !5
  %106 = getelementptr inbounds %class.VmaBlockMetadata_Linear, ptr %15, i32 0, i32 5
  %107 = load i32, ptr %106, align 4, !tbaa !24
  switch i32 %107, label %125 [
    i32 0, label %108
    i32 1, label %116
    i32 2, label %124
  ]

108:                                              ; preds = %104
  %109 = load ptr, ptr %14, align 8, !tbaa !5
  %110 = call noundef zeroext i1 @_ZNK9VmaVectorI16VmaSuballocation15VmaStlAllocatorIS0_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(32) %109)
  br i1 %110, label %111, label %112

111:                                              ; preds = %108
  br label %114

112:                                              ; preds = %108
  call void @__assert_fail(ptr noundef @.str.68, ptr noundef @.str.2, i32 noundef 8667, ptr noundef @__PRETTY_FUNCTION__._ZN23VmaBlockMetadata_Linear5AllocERK20VmaAllocationRequest20VmaSuballocationTypePv) #5
  unreachable

113:                                              ; No predecessors!
  br label %114

114:                                              ; preds = %113, %111
  %115 = getelementptr inbounds %class.VmaBlockMetadata_Linear, ptr %15, i32 0, i32 5
  store i32 1, ptr %115, align 4, !tbaa !24
  br label %126

116:                                              ; preds = %104
  %117 = load ptr, ptr %14, align 8, !tbaa !5
  %118 = call noundef zeroext i1 @_ZNK9VmaVectorI16VmaSuballocation15VmaStlAllocatorIS0_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(32) %117)
  %119 = xor i1 %118, true
  br i1 %119, label %120, label %121

120:                                              ; preds = %116
  br label %123

121:                                              ; preds = %116
  call void @__assert_fail(ptr noundef @.str.69, ptr noundef @.str.2, i32 noundef 8672, ptr noundef @__PRETTY_FUNCTION__._ZN23VmaBlockMetadata_Linear5AllocERK20VmaAllocationRequest20VmaSuballocationTypePv) #5
  unreachable

122:                                              ; No predecessors!
  br label %123

123:                                              ; preds = %122, %120
  br label %126

124:                                              ; preds = %104
  call void @__assert_fail(ptr noundef @.str.70, ptr noundef @.str.2, i32 noundef 8675, ptr noundef @__PRETTY_FUNCTION__._ZN23VmaBlockMetadata_Linear5AllocERK20VmaAllocationRequest20VmaSuballocationTypePv) #5
  unreachable

125:                                              ; preds = %104
  call void @__assert_fail(ptr noundef @.str.57, ptr noundef @.str.2, i32 noundef 8678, ptr noundef @__PRETTY_FUNCTION__._ZN23VmaBlockMetadata_Linear5AllocERK20VmaAllocationRequest20VmaSuballocationTypePv) #5
  unreachable

126:                                              ; preds = %123, %114
  %127 = load ptr, ptr %14, align 8, !tbaa !5
  call void @_ZN9VmaVectorI16VmaSuballocation15VmaStlAllocatorIS0_EE9push_backERKS0_(ptr noundef nonnull align 8 dereferenceable(32) %127, ptr noundef nonnull align 8 dereferenceable(32) %10)
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  br label %129

128:                                              ; preds = %4
  call void @__assert_fail(ptr noundef @.str.71, ptr noundef @.str.2, i32 noundef 8685, ptr noundef @__PRETTY_FUNCTION__._ZN23VmaBlockMetadata_Linear5AllocERK20VmaAllocationRequest20VmaSuballocationTypePv) #5
  unreachable

129:                                              ; preds = %126, %80, %44
  %130 = getelementptr inbounds %struct.VmaSuballocation, ptr %10, i32 0, i32 1
  %131 = load i64, ptr %130, align 8, !tbaa !20
  %132 = getelementptr inbounds %class.VmaBlockMetadata_Linear, ptr %15, i32 0, i32 1
  %133 = load i64, ptr %132, align 8, !tbaa !33
  %134 = sub i64 %133, %131
  store i64 %134, ptr %132, align 8, !tbaa !33
  call void @llvm.lifetime.end.p0(i64 32, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN9VmaVectorI16VmaSuballocation15VmaStlAllocatorIS0_EE9push_backERKS0_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) #3 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

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 = { 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 #4 = { nounwind }
attributes #5 = { 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 = !{!"_ZTS20VmaSuballocationType", !7, i64 0}
!11 = !{!12, !6, i64 0}
!12 = !{!"_ZTS20VmaAllocationRequest", !6, i64 0, !13, i64 8, !14, i64 16, !6, i64 32, !13, i64 40, !15, i64 48}
!13 = !{!"long", !7, i64 0}
!14 = !{!"_ZTSN7VmaListI16VmaSuballocation15VmaStlAllocatorIS0_EE8iteratorE", !6, i64 0, !6, i64 8}
!15 = !{!"_ZTS24VmaAllocationRequestType", !7, i64 0}
!16 = !{!13, !13, i64 0}
!17 = !{!18, !13, i64 0}
!18 = !{!"_ZTS16VmaSuballocation", !13, i64 0, !13, i64 8, !6, i64 16, !10, i64 24}
!19 = !{!12, !13, i64 8}
!20 = !{!18, !13, i64 8}
!21 = !{!18, !6, i64 16}
!22 = !{!18, !10, i64 24}
!23 = !{!12, !15, i64 48}
!24 = !{!25, !31, i64 116}
!25 = !{!"_ZTS23VmaBlockMetadata_Linear", !26, i64 0, !13, i64 40, !28, i64 48, !28, i64 80, !30, i64 112, !31, i64 116, !13, i64 120, !13, i64 128, !13, i64 136}
!26 = !{!"_ZTS16VmaBlockMetadata", !13, i64 8, !6, i64 16, !13, i64 24, !27, i64 32}
!27 = !{!"bool", !7, i64 0}
!28 = !{!"_ZTS9VmaVectorI16VmaSuballocation15VmaStlAllocatorIS0_EE", !29, i64 0, !6, i64 8, !13, i64 16, !13, i64 24}
!29 = !{!"_ZTS15VmaStlAllocatorI16VmaSuballocationE", !6, i64 0}
!30 = !{!"int", !7, i64 0}
!31 = !{!"_ZTSN23VmaBlockMetadata_Linear18SECOND_VECTOR_MODEE", !7, i64 0}
!32 = !{!25, !13, i64 120}
!33 = !{!25, !13, i64 40}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.VmaSuballocation = type { i64, i64, ptr, i32 }

@.str.2 = external hidden unnamed_addr constant [84 x i8], align 1
@.str.57 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.64 = external hidden unnamed_addr constant [155 x i8], align 1
@__PRETTY_FUNCTION__._ZN23VmaBlockMetadata_Linear5AllocERK20VmaAllocationRequest20VmaSuballocationTypePv = external hidden unnamed_addr constant [104 x i8], align 1
@.str.65 = external hidden unnamed_addr constant [103 x i8], align 1
@.str.66 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.67 = external hidden unnamed_addr constant [106 x i8], align 1
@.str.68 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.69 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.70 = external hidden unnamed_addr constant [112 x i8], align 1
@.str.71 = external hidden unnamed_addr constant [32 x i8], align 1

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

; Function Attrs: mustprogress 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) local_unnamed_addr #1

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

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

; 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 #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) local_unnamed_addr #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)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN23VmaBlockMetadata_Linear5AllocERK20VmaAllocationRequest20VmaSuballocationTypePv(ptr noundef nonnull align 8 dereferenceable(144) %0, ptr nocapture noundef nonnull readonly align 8 dereferenceable(52) %1, i32 noundef %2, ptr noundef %3) unnamed_addr #3 align 2 {
  %5 = alloca %struct.VmaSuballocation, align 8
  %6 = load ptr, ptr %1, align 8, !tbaa !5
  %7 = ptrtoint ptr %6 to i64
  %8 = add i64 %7, -1
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #4
  store i64 %8, ptr %5, align 8, !tbaa !13
  %9 = getelementptr inbounds i8, ptr %5, i64 8
  %10 = getelementptr inbounds i8, ptr %1, i64 8
  %11 = load i64, ptr %10, align 8, !tbaa !16
  store i64 %11, ptr %9, align 8, !tbaa !17
  %12 = getelementptr inbounds i8, ptr %5, i64 16
  store ptr %3, ptr %12, align 8, !tbaa !18
  %13 = getelementptr inbounds i8, ptr %5, i64 24
  store i32 %2, ptr %13, align 8, !tbaa !19
  %14 = getelementptr inbounds i8, ptr %1, i64 48
  %15 = load i32, ptr %14, align 8, !tbaa !20
  switch i32 %15, label %62 [
    i32 2, label %16
    i32 3, label %22
    i32 4, label %38
  ]

16:                                               ; preds = %4
  %17 = getelementptr inbounds i8, ptr %0, i64 116
  %18 = load i32, ptr %17, align 4, !tbaa !21
  %.not25 = icmp eq i32 %18, 1
  br i1 %.not25, label %19, label %20

19:                                               ; preds = %16
  tail call void @__assert_fail(ptr noundef nonnull @.str.64, ptr noundef nonnull @.str.2, i32 noundef 8637, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN23VmaBlockMetadata_Linear5AllocERK20VmaAllocationRequest20VmaSuballocationTypePv) #5
  unreachable

20:                                               ; preds = %16
  %21 = tail call noundef nonnull align 8 dereferenceable(32) ptr @_ZN23VmaBlockMetadata_Linear23AccessSuballocations2ndEv(ptr noundef nonnull align 8 dereferenceable(144) %0)
  call void @_ZN9VmaVectorI16VmaSuballocation15VmaStlAllocatorIS0_EE9push_backERKS0_(ptr noundef nonnull align 8 dereferenceable(32) %21, ptr noundef nonnull align 8 dereferenceable(32) %5)
  store i32 2, ptr %17, align 4, !tbaa !21
  br label %63

22:                                               ; preds = %4
  %23 = tail call noundef nonnull align 8 dereferenceable(32) ptr @_ZN23VmaBlockMetadata_Linear23AccessSuballocations1stEv(ptr noundef nonnull align 8 dereferenceable(144) %0)
  %24 = tail call noundef zeroext i1 @_ZNK9VmaVectorI16VmaSuballocation15VmaStlAllocatorIS0_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(32) %23)
  br i1 %24, label %.critedge, label %25

25:                                               ; preds = %22
  %26 = tail call noundef nonnull align 8 dereferenceable(32) ptr @_ZN9VmaVectorI16VmaSuballocation15VmaStlAllocatorIS0_EE4backEv(ptr noundef nonnull align 8 dereferenceable(32) %23)
  %27 = load i64, ptr %26, align 8, !tbaa !13
  %28 = tail call noundef nonnull align 8 dereferenceable(32) ptr @_ZN9VmaVectorI16VmaSuballocation15VmaStlAllocatorIS0_EE4backEv(ptr noundef nonnull align 8 dereferenceable(32) %23)
  %29 = getelementptr inbounds i8, ptr %28, i64 8
  %30 = load i64, ptr %29, align 8, !tbaa !17
  %31 = add i64 %30, %27
  %.not23 = icmp ult i64 %8, %31
  br i1 %.not23, label %32, label %.critedge

32:                                               ; preds = %25
  tail call void @__assert_fail(ptr noundef nonnull @.str.65, ptr noundef nonnull @.str.2, i32 noundef 8648, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN23VmaBlockMetadata_Linear5AllocERK20VmaAllocationRequest20VmaSuballocationTypePv) #5
  unreachable

.critedge:                                        ; preds = %22, %25
  %33 = load i64, ptr %10, align 8, !tbaa !16
  %34 = add i64 %33, %8
  %35 = tail call noundef i64 @_ZNK16VmaBlockMetadata7GetSizeEv(ptr noundef nonnull align 8 dereferenceable(33) %0)
  %.not24 = icmp ugt i64 %34, %35
  br i1 %.not24, label %36, label %37

36:                                               ; preds = %.critedge
  tail call void @__assert_fail(ptr noundef nonnull @.str.66, ptr noundef nonnull @.str.2, i32 noundef 8650, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN23VmaBlockMetadata_Linear5AllocERK20VmaAllocationRequest20VmaSuballocationTypePv) #5
  unreachable

37:                                               ; preds = %.critedge
  call void @_ZN9VmaVectorI16VmaSuballocation15VmaStlAllocatorIS0_EE9push_backERKS0_(ptr noundef nonnull align 8 dereferenceable(32) %23, ptr noundef nonnull align 8 dereferenceable(32) %5)
  br label %63

38:                                               ; preds = %4
  %39 = tail call noundef nonnull align 8 dereferenceable(32) ptr @_ZN23VmaBlockMetadata_Linear23AccessSuballocations1stEv(ptr noundef nonnull align 8 dereferenceable(144) %0)
  %40 = tail call noundef zeroext i1 @_ZNK9VmaVectorI16VmaSuballocation15VmaStlAllocatorIS0_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(32) %39)
  br i1 %40, label %.critedge2, label %41

41:                                               ; preds = %38
  %42 = load i64, ptr %10, align 8, !tbaa !16
  %43 = add i64 %42, %8
  %44 = getelementptr inbounds i8, ptr %0, i64 120
  %45 = load i64, ptr %44, align 8, !tbaa !29
  %46 = tail call noundef nonnull align 8 dereferenceable(32) ptr @_ZN9VmaVectorI16VmaSuballocation15VmaStlAllocatorIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(32) %39, i64 noundef %45)
  %47 = load i64, ptr %46, align 8, !tbaa !13
  %.not = icmp ugt i64 %43, %47
  br i1 %.not, label %.critedge2, label %48

.critedge2:                                       ; preds = %38, %41
  tail call void @__assert_fail(ptr noundef nonnull @.str.67, ptr noundef nonnull @.str.2, i32 noundef 8660, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN23VmaBlockMetadata_Linear5AllocERK20VmaAllocationRequest20VmaSuballocationTypePv) #5
  unreachable

48:                                               ; preds = %41
  %49 = tail call noundef nonnull align 8 dereferenceable(32) ptr @_ZN23VmaBlockMetadata_Linear23AccessSuballocations2ndEv(ptr noundef nonnull align 8 dereferenceable(144) %0)
  %50 = getelementptr inbounds i8, ptr %0, i64 116
  %51 = load i32, ptr %50, align 4, !tbaa !21
  switch i32 %51, label %60 [
    i32 0, label %52
    i32 1, label %56
    i32 2, label %59
  ]

52:                                               ; preds = %48
  %53 = tail call noundef zeroext i1 @_ZNK9VmaVectorI16VmaSuballocation15VmaStlAllocatorIS0_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(32) %49)
  br i1 %53, label %55, label %54

54:                                               ; preds = %52
  tail call void @__assert_fail(ptr noundef nonnull @.str.68, ptr noundef nonnull @.str.2, i32 noundef 8667, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN23VmaBlockMetadata_Linear5AllocERK20VmaAllocationRequest20VmaSuballocationTypePv) #5
  unreachable

55:                                               ; preds = %52
  store i32 1, ptr %50, align 4, !tbaa !21
  br label %61

56:                                               ; preds = %48
  %57 = tail call noundef zeroext i1 @_ZNK9VmaVectorI16VmaSuballocation15VmaStlAllocatorIS0_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(32) %49)
  br i1 %57, label %58, label %61

58:                                               ; preds = %56
  tail call void @__assert_fail(ptr noundef nonnull @.str.69, ptr noundef nonnull @.str.2, i32 noundef 8672, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN23VmaBlockMetadata_Linear5AllocERK20VmaAllocationRequest20VmaSuballocationTypePv) #5
  unreachable

59:                                               ; preds = %48
  tail call void @__assert_fail(ptr noundef nonnull @.str.70, ptr noundef nonnull @.str.2, i32 noundef 8675, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN23VmaBlockMetadata_Linear5AllocERK20VmaAllocationRequest20VmaSuballocationTypePv) #5
  unreachable

60:                                               ; preds = %48
  tail call void @__assert_fail(ptr noundef nonnull @.str.57, ptr noundef nonnull @.str.2, i32 noundef 8678, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN23VmaBlockMetadata_Linear5AllocERK20VmaAllocationRequest20VmaSuballocationTypePv) #5
  unreachable

61:                                               ; preds = %56, %55
  call void @_ZN9VmaVectorI16VmaSuballocation15VmaStlAllocatorIS0_EE9push_backERKS0_(ptr noundef nonnull align 8 dereferenceable(32) %49, ptr noundef nonnull align 8 dereferenceable(32) %5)
  br label %63

62:                                               ; preds = %4
  tail call void @__assert_fail(ptr noundef nonnull @.str.71, ptr noundef nonnull @.str.2, i32 noundef 8685, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN23VmaBlockMetadata_Linear5AllocERK20VmaAllocationRequest20VmaSuballocationTypePv) #5
  unreachable

63:                                               ; preds = %61, %37, %20
  %64 = load i64, ptr %9, align 8, !tbaa !17
  %65 = getelementptr inbounds i8, ptr %0, i64 40
  %66 = load i64, ptr %65, align 8, !tbaa !30
  %67 = sub i64 %66, %64
  store i64 %67, ptr %65, align 8, !tbaa !30
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #4
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN9VmaVectorI16VmaSuballocation15VmaStlAllocatorIS0_EE9push_backERKS0_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #3 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 #2 align 2

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


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