; 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_TLSF::Block" = type { i64, i64, ptr, ptr, ptr, %union.anon.6 }
%union.anon.6 = type { ptr }
%class.VmaBlockMetadata_TLSF = type { %class.VmaBlockMetadata.base, i64, i64, i64, i32, i8, [58 x i32], i32, ptr, %class.VmaPoolAllocator, ptr, %class.VmaBlockBufferImageGranularity }
%class.VmaBlockMetadata.base = type <{ ptr, i64, ptr, i64, i8 }>
%class.VmaPoolAllocator = type { ptr, i32, %class.VmaVector.4 }
%class.VmaVector.4 = type { %struct.VmaStlAllocator.5, ptr, i64, i64 }
%struct.VmaStlAllocator.5 = type { ptr }
%class.VmaBlockBufferImageGranularity = type { i64, i32, ptr }
%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.133 = external hidden unnamed_addr constant [44 x i8], align 1
@__PRETTY_FUNCTION__._ZN21VmaBlockMetadata_TLSF10CheckBlockERNS_5BlockEjmm20VmaSuballocationTypeP20VmaAllocationRequest = external hidden unnamed_addr constant [132 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 zeroext i1 @_ZNK16VmaBlockMetadata9IsVirtualEv(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: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK30VmaBlockBufferImageGranularity23CheckConflictAndAlignUpERmmmm20VmaSuballocationType(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(8), i64 noundef, i64 noundef, i64 noundef, i32 noundef) #4 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 nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN21VmaBlockMetadata_TLSF5Block8NextFreeEv(ptr noundef nonnull align 8 dereferenceable(48)) #2 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN21VmaBlockMetadata_TLSF10CheckBlockERNS_5BlockEjmm20VmaSuballocationTypeP20VmaAllocationRequest(ptr noundef nonnull align 8 dereferenceable(400) %0, ptr noundef nonnull align 8 dereferenceable(48) %1, i32 noundef %2, i64 noundef %3, i64 noundef %4, i32 noundef %5, ptr noundef %6) #4 align 2 {
  %8 = alloca i1, align 1
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca i64, align 8
  %17 = alloca i32, align 4
  store ptr %0, ptr %9, align 8, !tbaa !5
  store ptr %1, ptr %10, align 8, !tbaa !5
  store i32 %2, ptr %11, align 4, !tbaa !9
  store i64 %3, ptr %12, align 8, !tbaa !11
  store i64 %4, ptr %13, align 8, !tbaa !11
  store i32 %5, ptr %14, align 4, !tbaa !13
  store ptr %6, ptr %15, align 8, !tbaa !5
  %18 = load ptr, ptr %9, align 8
  %19 = load ptr, ptr %10, align 8, !tbaa !5
  %20 = call noundef zeroext i1 @_ZNK21VmaBlockMetadata_TLSF5Block6IsFreeEv(ptr noundef nonnull align 8 dereferenceable(48) %19)
  br i1 %20, label %21, label %22

21:                                               ; preds = %7
  br label %22

22:                                               ; preds = %21, %7
  %23 = phi i1 [ false, %7 ], [ true, %21 ]
  br i1 %23, label %24, label %25

24:                                               ; preds = %22
  br label %27

25:                                               ; preds = %22
  call void @__assert_fail(ptr noundef @.str.133, ptr noundef @.str.2, i32 noundef 10898, ptr noundef @__PRETTY_FUNCTION__._ZN21VmaBlockMetadata_TLSF10CheckBlockERNS_5BlockEjmm20VmaSuballocationTypeP20VmaAllocationRequest) #5
  unreachable

26:                                               ; No predecessors!
  br label %27

27:                                               ; preds = %26, %24
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  %28 = load ptr, ptr %10, align 8, !tbaa !5
  %29 = getelementptr inbounds %"class.VmaBlockMetadata_TLSF::Block", ptr %28, i32 0, i32 0
  %30 = load i64, ptr %29, align 8, !tbaa !15
  %31 = load i64, ptr %13, align 8, !tbaa !11
  %32 = call noundef i64 @_ZL10VmaAlignUpImET_S0_S0_(i64 noundef %30, i64 noundef %31)
  store i64 %32, ptr %16, align 8, !tbaa !11
  %33 = load ptr, ptr %10, align 8, !tbaa !5
  %34 = getelementptr inbounds %"class.VmaBlockMetadata_TLSF::Block", ptr %33, i32 0, i32 1
  %35 = load i64, ptr %34, align 8, !tbaa !17
  %36 = load i64, ptr %12, align 8, !tbaa !11
  %37 = load i64, ptr %16, align 8, !tbaa !11
  %38 = add i64 %36, %37
  %39 = load ptr, ptr %10, align 8, !tbaa !5
  %40 = getelementptr inbounds %"class.VmaBlockMetadata_TLSF::Block", ptr %39, i32 0, i32 0
  %41 = load i64, ptr %40, align 8, !tbaa !15
  %42 = sub i64 %38, %41
  %43 = icmp ult i64 %35, %42
  br i1 %43, label %44, label %45

44:                                               ; preds = %27
  store i1 false, ptr %8, align 1
  store i32 1, ptr %17, align 4
  br label %136

45:                                               ; preds = %27
  %46 = call noundef zeroext i1 @_ZNK16VmaBlockMetadata9IsVirtualEv(ptr noundef nonnull align 8 dereferenceable(33) %18)
  br i1 %46, label %59, label %47

47:                                               ; preds = %45
  %48 = getelementptr inbounds %class.VmaBlockMetadata_TLSF, ptr %18, i32 0, i32 11
  %49 = load i64, ptr %12, align 8, !tbaa !11
  %50 = load ptr, ptr %10, align 8, !tbaa !5
  %51 = getelementptr inbounds %"class.VmaBlockMetadata_TLSF::Block", ptr %50, i32 0, i32 0
  %52 = load i64, ptr %51, align 8, !tbaa !15
  %53 = load ptr, ptr %10, align 8, !tbaa !5
  %54 = getelementptr inbounds %"class.VmaBlockMetadata_TLSF::Block", ptr %53, i32 0, i32 1
  %55 = load i64, ptr %54, align 8, !tbaa !17
  %56 = load i32, ptr %14, align 4, !tbaa !13
  %57 = call noundef zeroext i1 @_ZNK30VmaBlockBufferImageGranularity23CheckConflictAndAlignUpERmmmm20VmaSuballocationType(ptr noundef nonnull align 8 dereferenceable(24) %48, ptr noundef nonnull align 8 dereferenceable(8) %16, i64 noundef %49, i64 noundef %52, i64 noundef %55, i32 noundef %56)
  br i1 %57, label %58, label %59

58:                                               ; preds = %47
  store i1 false, ptr %8, align 1
  store i32 1, ptr %17, align 4
  br label %136

59:                                               ; preds = %47, %45
  %60 = load ptr, ptr %15, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.VmaAllocationRequest, ptr %60, i32 0, i32 5
  store i32 1, ptr %61, align 8, !tbaa !18
  %62 = load ptr, ptr %10, align 8, !tbaa !5
  %63 = load ptr, ptr %15, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.VmaAllocationRequest, ptr %63, i32 0, i32 0
  store ptr %62, ptr %64, align 8, !tbaa !22
  %65 = load i64, ptr %12, align 8, !tbaa !11
  %66 = call noundef i64 @_ZNK16VmaBlockMetadata14GetDebugMarginEv(ptr noundef nonnull align 8 dereferenceable(33) %18)
  %67 = sub i64 %65, %66
  %68 = load ptr, ptr %15, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.VmaAllocationRequest, ptr %68, i32 0, i32 1
  store i64 %67, ptr %69, align 8, !tbaa !23
  %70 = load i32, ptr %14, align 4, !tbaa !13
  %71 = zext i32 %70 to i64
  %72 = inttoptr i64 %71 to ptr
  %73 = load ptr, ptr %15, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.VmaAllocationRequest, ptr %73, i32 0, i32 3
  store ptr %72, ptr %74, align 8, !tbaa !24
  %75 = load i64, ptr %16, align 8, !tbaa !11
  %76 = load ptr, ptr %15, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.VmaAllocationRequest, ptr %76, i32 0, i32 4
  store i64 %75, ptr %77, align 8, !tbaa !25
  %78 = load i32, ptr %11, align 4, !tbaa !9
  %79 = getelementptr inbounds %class.VmaBlockMetadata_TLSF, ptr %18, i32 0, i32 7
  %80 = load i32, ptr %79, align 8, !tbaa !26
  %81 = icmp ne i32 %78, %80
  br i1 %81, label %82, label %135

82:                                               ; preds = %59
  %83 = load ptr, ptr %10, align 8, !tbaa !5
  %84 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN21VmaBlockMetadata_TLSF5Block8PrevFreeEv(ptr noundef nonnull align 8 dereferenceable(48) %83)
  %85 = load ptr, ptr %84, align 8, !tbaa !5
  %86 = icmp ne ptr %85, null
  br i1 %86, label %87, label %135

87:                                               ; preds = %82
  %88 = load ptr, ptr %10, align 8, !tbaa !5
  %89 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN21VmaBlockMetadata_TLSF5Block8NextFreeEv(ptr noundef nonnull align 8 dereferenceable(48) %88)
  %90 = load ptr, ptr %89, align 8, !tbaa !5
  %91 = load ptr, ptr %10, align 8, !tbaa !5
  %92 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN21VmaBlockMetadata_TLSF5Block8PrevFreeEv(ptr noundef nonnull align 8 dereferenceable(48) %91)
  %93 = load ptr, ptr %92, align 8, !tbaa !5
  %94 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN21VmaBlockMetadata_TLSF5Block8NextFreeEv(ptr noundef nonnull align 8 dereferenceable(48) %93)
  store ptr %90, ptr %94, align 8, !tbaa !5
  %95 = load ptr, ptr %10, align 8, !tbaa !5
  %96 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN21VmaBlockMetadata_TLSF5Block8NextFreeEv(ptr noundef nonnull align 8 dereferenceable(48) %95)
  %97 = load ptr, ptr %96, align 8, !tbaa !5
  %98 = icmp ne ptr %97, null
  br i1 %98, label %99, label %107

99:                                               ; preds = %87
  %100 = load ptr, ptr %10, align 8, !tbaa !5
  %101 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN21VmaBlockMetadata_TLSF5Block8PrevFreeEv(ptr noundef nonnull align 8 dereferenceable(48) %100)
  %102 = load ptr, ptr %101, align 8, !tbaa !5
  %103 = load ptr, ptr %10, align 8, !tbaa !5
  %104 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN21VmaBlockMetadata_TLSF5Block8NextFreeEv(ptr noundef nonnull align 8 dereferenceable(48) %103)
  %105 = load ptr, ptr %104, align 8, !tbaa !5
  %106 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN21VmaBlockMetadata_TLSF5Block8PrevFreeEv(ptr noundef nonnull align 8 dereferenceable(48) %105)
  store ptr %102, ptr %106, align 8, !tbaa !5
  br label %107

107:                                              ; preds = %99, %87
  %108 = load ptr, ptr %10, align 8, !tbaa !5
  %109 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN21VmaBlockMetadata_TLSF5Block8PrevFreeEv(ptr noundef nonnull align 8 dereferenceable(48) %108)
  store ptr null, ptr %109, align 8, !tbaa !5
  %110 = getelementptr inbounds %class.VmaBlockMetadata_TLSF, ptr %18, i32 0, i32 8
  %111 = load ptr, ptr %110, align 8, !tbaa !34
  %112 = load i32, ptr %11, align 4, !tbaa !9
  %113 = zext i32 %112 to i64
  %114 = getelementptr inbounds ptr, ptr %111, i64 %113
  %115 = load ptr, ptr %114, align 8, !tbaa !5
  %116 = load ptr, ptr %10, align 8, !tbaa !5
  %117 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN21VmaBlockMetadata_TLSF5Block8NextFreeEv(ptr noundef nonnull align 8 dereferenceable(48) %116)
  store ptr %115, ptr %117, align 8, !tbaa !5
  %118 = load ptr, ptr %10, align 8, !tbaa !5
  %119 = getelementptr inbounds %class.VmaBlockMetadata_TLSF, ptr %18, i32 0, i32 8
  %120 = load ptr, ptr %119, align 8, !tbaa !34
  %121 = load i32, ptr %11, align 4, !tbaa !9
  %122 = zext i32 %121 to i64
  %123 = getelementptr inbounds ptr, ptr %120, i64 %122
  store ptr %118, ptr %123, align 8, !tbaa !5
  %124 = load ptr, ptr %10, align 8, !tbaa !5
  %125 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN21VmaBlockMetadata_TLSF5Block8NextFreeEv(ptr noundef nonnull align 8 dereferenceable(48) %124)
  %126 = load ptr, ptr %125, align 8, !tbaa !5
  %127 = icmp ne ptr %126, null
  br i1 %127, label %128, label %134

128:                                              ; preds = %107
  %129 = load ptr, ptr %10, align 8, !tbaa !5
  %130 = load ptr, ptr %10, align 8, !tbaa !5
  %131 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN21VmaBlockMetadata_TLSF5Block8NextFreeEv(ptr noundef nonnull align 8 dereferenceable(48) %130)
  %132 = load ptr, ptr %131, align 8, !tbaa !5
  %133 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN21VmaBlockMetadata_TLSF5Block8PrevFreeEv(ptr noundef nonnull align 8 dereferenceable(48) %132)
  store ptr %129, ptr %133, align 8, !tbaa !5
  br label %134

134:                                              ; preds = %128, %107
  br label %135

135:                                              ; preds = %134, %82, %59
  store i1 true, ptr %8, align 1
  store i32 1, ptr %17, align 4
  br label %136

136:                                              ; preds = %135, %58, %44
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  %137 = load i1, ptr %8, align 1
  ret i1 %137
}

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 = { noreturn nounwind }
attributes #6 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"_ZTS20VmaSuballocationType", !7, i64 0}
!15 = !{!16, !12, i64 0}
!16 = !{!"_ZTSN21VmaBlockMetadata_TLSF5BlockE", !12, i64 0, !12, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !7, i64 40}
!17 = !{!16, !12, i64 8}
!18 = !{!19, !21, i64 48}
!19 = !{!"_ZTS20VmaAllocationRequest", !6, i64 0, !12, i64 8, !20, i64 16, !6, i64 32, !12, i64 40, !21, i64 48}
!20 = !{!"_ZTSN7VmaListI16VmaSuballocation15VmaStlAllocatorIS0_EE8iteratorE", !6, i64 0, !6, i64 8}
!21 = !{!"_ZTS24VmaAllocationRequestType", !7, i64 0}
!22 = !{!19, !6, i64 0}
!23 = !{!19, !12, i64 8}
!24 = !{!19, !6, i64 32}
!25 = !{!19, !12, i64 40}
!26 = !{!27, !10, i64 304}
!27 = !{!"_ZTS21VmaBlockMetadata_TLSF", !28, i64 0, !12, i64 40, !12, i64 48, !12, i64 56, !10, i64 64, !7, i64 68, !7, i64 72, !10, i64 304, !6, i64 312, !30, i64 320, !6, i64 368, !33, i64 376}
!28 = !{!"_ZTS16VmaBlockMetadata", !12, i64 8, !6, i64 16, !12, i64 24, !29, i64 32}
!29 = !{!"bool", !7, i64 0}
!30 = !{!"_ZTS16VmaPoolAllocatorIN21VmaBlockMetadata_TLSF5BlockEE", !6, i64 0, !10, i64 8, !31, i64 16}
!31 = !{!"_ZTS9VmaVectorIN16VmaPoolAllocatorIN21VmaBlockMetadata_TLSF5BlockEE9ItemBlockE15VmaStlAllocatorIS4_EE", !32, i64 0, !6, i64 8, !12, i64 16, !12, i64 24}
!32 = !{!"_ZTS15VmaStlAllocatorIN16VmaPoolAllocatorIN21VmaBlockMetadata_TLSF5BlockEE9ItemBlockEE", !6, i64 0}
!33 = !{!"_ZTS30VmaBlockBufferImageGranularity", !12, i64 0, !10, i64 8, !6, i64 16}
!34 = !{!27, !6, i64 312}


; 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.133 = external hidden unnamed_addr constant [44 x i8], align 1
@__PRETTY_FUNCTION__._ZN21VmaBlockMetadata_TLSF10CheckBlockERNS_5BlockEjmm20VmaSuballocationTypeP20VmaAllocationRequest = external hidden unnamed_addr constant [132 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 zeroext i1 @_ZNK16VmaBlockMetadata9IsVirtualEv(ptr noundef nonnull align 8 dereferenceable(33)) local_unnamed_addr #2 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK30VmaBlockBufferImageGranularity23CheckConflictAndAlignUpERmmmm20VmaSuballocationType(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(8), i64 noundef, i64 noundef, i64 noundef, i32 noundef) local_unnamed_addr #4 align 2

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN21VmaBlockMetadata_TLSF10CheckBlockERNS_5BlockEjmm20VmaSuballocationTypeP20VmaAllocationRequest(ptr noundef nonnull align 8 dereferenceable(400) %0, ptr noundef nonnull align 8 dereferenceable(48) %1, i32 noundef %2, i64 noundef %3, i64 noundef %4, i32 noundef %5, ptr nocapture noundef writeonly %6) local_unnamed_addr #4 align 2 {
  %8 = alloca i64, align 8
  %9 = tail call noundef zeroext i1 @_ZNK21VmaBlockMetadata_TLSF5Block6IsFreeEv(ptr noundef nonnull align 8 dereferenceable(48) %1)
  br i1 %9, label %11, label %10

10:                                               ; preds = %7
  tail call void @__assert_fail(ptr noundef nonnull @.str.133, ptr noundef nonnull @.str.2, i32 noundef 10898, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN21VmaBlockMetadata_TLSF10CheckBlockERNS_5BlockEjmm20VmaSuballocationTypeP20VmaAllocationRequest) #5
  unreachable

11:                                               ; preds = %7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #6
  %12 = load i64, ptr %1, align 8, !tbaa !5
  %13 = tail call noundef i64 @_ZL10VmaAlignUpImET_S0_S0_(i64 noundef %12, i64 noundef %4)
  store i64 %13, ptr %8, align 8, !tbaa !11
  %14 = getelementptr inbounds i8, ptr %1, i64 8
  %15 = load i64, ptr %14, align 8, !tbaa !12
  %16 = add i64 %13, %3
  %17 = load i64, ptr %1, align 8, !tbaa !5
  %18 = sub i64 %16, %17
  %19 = icmp ult i64 %15, %18
  br i1 %19, label %72, label %20

20:                                               ; preds = %11
  %21 = tail call noundef zeroext i1 @_ZNK16VmaBlockMetadata9IsVirtualEv(ptr noundef nonnull align 8 dereferenceable(33) %0)
  br i1 %21, label %27, label %22

22:                                               ; preds = %20
  %23 = getelementptr inbounds i8, ptr %0, i64 376
  %24 = load i64, ptr %1, align 8, !tbaa !5
  %25 = load i64, ptr %14, align 8, !tbaa !12
  %26 = call noundef zeroext i1 @_ZNK30VmaBlockBufferImageGranularity23CheckConflictAndAlignUpERmmmm20VmaSuballocationType(ptr noundef nonnull align 8 dereferenceable(24) %23, ptr noundef nonnull align 8 dereferenceable(8) %8, i64 noundef %3, i64 noundef %24, i64 noundef %25, i32 noundef %5)
  br i1 %26, label %72, label %27

27:                                               ; preds = %22, %20
  %28 = getelementptr inbounds i8, ptr %6, i64 48
  store i32 1, ptr %28, align 8, !tbaa !13
  store ptr %1, ptr %6, align 8, !tbaa !17
  %29 = call noundef i64 @_ZNK16VmaBlockMetadata14GetDebugMarginEv(ptr noundef nonnull align 8 dereferenceable(33) %0)
  %30 = sub i64 %3, %29
  %31 = getelementptr inbounds i8, ptr %6, i64 8
  store i64 %30, ptr %31, align 8, !tbaa !18
  %32 = zext i32 %5 to i64
  %33 = inttoptr i64 %32 to ptr
  %34 = getelementptr inbounds i8, ptr %6, i64 32
  store ptr %33, ptr %34, align 8, !tbaa !19
  %35 = load i64, ptr %8, align 8, !tbaa !11
  %36 = getelementptr inbounds i8, ptr %6, i64 40
  store i64 %35, ptr %36, align 8, !tbaa !20
  %37 = getelementptr inbounds i8, ptr %0, i64 304
  %38 = load i32, ptr %37, align 8, !tbaa !21
  %.not = icmp eq i32 %38, %2
  br i1 %.not, label %72, label %39

39:                                               ; preds = %27
  %40 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN21VmaBlockMetadata_TLSF5Block8PrevFreeEv(ptr noundef nonnull align 8 dereferenceable(48) %1)
  %41 = load ptr, ptr %40, align 8, !tbaa !30
  %.not35 = icmp eq ptr %41, null
  br i1 %.not35, label %72, label %42

42:                                               ; preds = %39
  %43 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN21VmaBlockMetadata_TLSF5Block8NextFreeEv(ptr noundef nonnull align 8 dereferenceable(48) %1)
  %44 = load ptr, ptr %43, align 8, !tbaa !30
  %45 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN21VmaBlockMetadata_TLSF5Block8PrevFreeEv(ptr noundef nonnull align 8 dereferenceable(48) %1)
  %46 = load ptr, ptr %45, align 8, !tbaa !30
  %47 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN21VmaBlockMetadata_TLSF5Block8NextFreeEv(ptr noundef nonnull align 8 dereferenceable(48) %46)
  store ptr %44, ptr %47, align 8, !tbaa !30
  %48 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN21VmaBlockMetadata_TLSF5Block8NextFreeEv(ptr noundef nonnull align 8 dereferenceable(48) %1)
  %49 = load ptr, ptr %48, align 8, !tbaa !30
  %.not36 = icmp eq ptr %49, null
  br i1 %.not36, label %56, label %50

50:                                               ; preds = %42
  %51 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN21VmaBlockMetadata_TLSF5Block8PrevFreeEv(ptr noundef nonnull align 8 dereferenceable(48) %1)
  %52 = load ptr, ptr %51, align 8, !tbaa !30
  %53 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN21VmaBlockMetadata_TLSF5Block8NextFreeEv(ptr noundef nonnull align 8 dereferenceable(48) %1)
  %54 = load ptr, ptr %53, align 8, !tbaa !30
  %55 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN21VmaBlockMetadata_TLSF5Block8PrevFreeEv(ptr noundef nonnull align 8 dereferenceable(48) %54)
  store ptr %52, ptr %55, align 8, !tbaa !30
  br label %56

56:                                               ; preds = %50, %42
  %57 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN21VmaBlockMetadata_TLSF5Block8PrevFreeEv(ptr noundef nonnull align 8 dereferenceable(48) %1)
  store ptr null, ptr %57, align 8, !tbaa !30
  %58 = getelementptr inbounds i8, ptr %0, i64 312
  %59 = load ptr, ptr %58, align 8, !tbaa !31
  %60 = zext i32 %2 to i64
  %61 = getelementptr inbounds ptr, ptr %59, i64 %60
  %62 = load ptr, ptr %61, align 8, !tbaa !30
  %63 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN21VmaBlockMetadata_TLSF5Block8NextFreeEv(ptr noundef nonnull align 8 dereferenceable(48) %1)
  store ptr %62, ptr %63, align 8, !tbaa !30
  %64 = load ptr, ptr %58, align 8, !tbaa !31
  %65 = getelementptr inbounds ptr, ptr %64, i64 %60
  store ptr %1, ptr %65, align 8, !tbaa !30
  %66 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN21VmaBlockMetadata_TLSF5Block8NextFreeEv(ptr noundef nonnull align 8 dereferenceable(48) %1)
  %67 = load ptr, ptr %66, align 8, !tbaa !30
  %.not37 = icmp eq ptr %67, null
  br i1 %.not37, label %72, label %68

68:                                               ; preds = %56
  %69 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN21VmaBlockMetadata_TLSF5Block8NextFreeEv(ptr noundef nonnull align 8 dereferenceable(48) %1)
  %70 = load ptr, ptr %69, align 8, !tbaa !30
  %71 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN21VmaBlockMetadata_TLSF5Block8PrevFreeEv(ptr noundef nonnull align 8 dereferenceable(48) %70)
  store ptr %1, ptr %71, align 8, !tbaa !30
  br label %72

72:                                               ; preds = %27, %39, %68, %56, %22, %11
  %.0 = phi i1 [ false, %11 ], [ false, %22 ], [ true, %56 ], [ true, %68 ], [ true, %39 ], [ true, %27 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  ret i1 %.0
}

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 = { 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 = { noreturn nounwind }
attributes #6 = { 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 = !{!"_ZTSN21VmaBlockMetadata_TLSF5BlockE", !7, i64 0, !7, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !8, i64 40}
!7 = !{!"long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!7, !7, i64 0}
!12 = !{!6, !7, i64 8}
!13 = !{!14, !16, i64 48}
!14 = !{!"_ZTS20VmaAllocationRequest", !10, i64 0, !7, i64 8, !15, i64 16, !10, i64 32, !7, i64 40, !16, i64 48}
!15 = !{!"_ZTSN7VmaListI16VmaSuballocation15VmaStlAllocatorIS0_EE8iteratorE", !10, i64 0, !10, i64 8}
!16 = !{!"_ZTS24VmaAllocationRequestType", !8, i64 0}
!17 = !{!14, !10, i64 0}
!18 = !{!14, !7, i64 8}
!19 = !{!14, !10, i64 32}
!20 = !{!14, !7, i64 40}
!21 = !{!22, !25, i64 304}
!22 = !{!"_ZTS21VmaBlockMetadata_TLSF", !23, i64 0, !7, i64 40, !7, i64 48, !7, i64 56, !25, i64 64, !8, i64 68, !8, i64 72, !25, i64 304, !10, i64 312, !26, i64 320, !10, i64 368, !29, i64 376}
!23 = !{!"_ZTS16VmaBlockMetadata", !7, i64 8, !10, i64 16, !7, i64 24, !24, i64 32}
!24 = !{!"bool", !8, i64 0}
!25 = !{!"int", !8, i64 0}
!26 = !{!"_ZTS16VmaPoolAllocatorIN21VmaBlockMetadata_TLSF5BlockEE", !10, i64 0, !25, i64 8, !27, i64 16}
!27 = !{!"_ZTS9VmaVectorIN16VmaPoolAllocatorIN21VmaBlockMetadata_TLSF5BlockEE9ItemBlockE15VmaStlAllocatorIS4_EE", !28, i64 0, !10, i64 8, !7, i64 16, !7, i64 24}
!28 = !{!"_ZTS15VmaStlAllocatorIN16VmaPoolAllocatorIN21VmaBlockMetadata_TLSF5BlockEE9ItemBlockEE", !10, i64 0}
!29 = !{!"_ZTS30VmaBlockBufferImageGranularity", !7, i64 0, !25, i64 8, !10, i64 16}
!30 = !{!10, !10, i64 0}
!31 = !{!22, !10, i64 312}


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