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

@.str.2 = external hidden unnamed_addr constant [84 x i8], align 1
@.str.109 = external hidden unnamed_addr constant [45 x i8], align 1
@__PRETTY_FUNCTION__._ZN21VmaBlockMetadata_TLSF4FreeEP16VmaAllocHandle_T = external hidden unnamed_addr constant [57 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: mustprogress uwtable
declare dso_local void @_ZN30VmaBlockBufferImageGranularity9FreePagesEmm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, i64 noundef) #3 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 zeroext i1 @_ZNK21VmaBlockMetadata_TLSF5Block6IsFreeEv(ptr noundef nonnull align 8 dereferenceable(48)) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN21VmaBlockMetadata_TLSF15RemoveFreeBlockEPNS_5BlockE(ptr noundef nonnull align 8 dereferenceable(400), ptr noundef) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN21VmaBlockMetadata_TLSF15InsertFreeBlockEPNS_5BlockE(ptr noundef nonnull align 8 dereferenceable(400), ptr noundef) #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN21VmaBlockMetadata_TLSF4FreeEP16VmaAllocHandle_T(ptr noundef nonnull align 8 dereferenceable(400) %0, ptr noundef %1) unnamed_addr #3 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %9 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  %10 = load ptr, ptr %4, align 8, !tbaa !5
  store ptr %10, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  %11 = load ptr, ptr %5, align 8, !tbaa !5
  %12 = getelementptr inbounds %"class.VmaBlockMetadata_TLSF::Block", ptr %11, i32 0, i32 3
  %13 = load ptr, ptr %12, align 8, !tbaa !9
  store ptr %13, ptr %6, align 8, !tbaa !5
  %14 = load ptr, ptr %5, align 8, !tbaa !5
  %15 = call noundef zeroext i1 @_ZNK21VmaBlockMetadata_TLSF5Block6IsFreeEv(ptr noundef nonnull align 8 dereferenceable(48) %14)
  br i1 %15, label %17, label %16

16:                                               ; preds = %2
  br label %17

17:                                               ; preds = %16, %2
  %18 = phi i1 [ false, %2 ], [ true, %16 ]
  br i1 %18, label %19, label %20

19:                                               ; preds = %17
  br label %22

20:                                               ; preds = %17
  call void @__assert_fail(ptr noundef @.str.109, ptr noundef @.str.2, i32 noundef 10643, ptr noundef @__PRETTY_FUNCTION__._ZN21VmaBlockMetadata_TLSF4FreeEP16VmaAllocHandle_T) #5
  unreachable

21:                                               ; No predecessors!
  br label %22

22:                                               ; preds = %21, %19
  %23 = call noundef zeroext i1 @_ZNK16VmaBlockMetadata9IsVirtualEv(ptr noundef nonnull align 8 dereferenceable(33) %9)
  br i1 %23, label %32, label %24

24:                                               ; preds = %22
  %25 = getelementptr inbounds %class.VmaBlockMetadata_TLSF, ptr %9, i32 0, i32 11
  %26 = load ptr, ptr %5, align 8, !tbaa !5
  %27 = getelementptr inbounds %"class.VmaBlockMetadata_TLSF::Block", ptr %26, i32 0, i32 0
  %28 = load i64, ptr %27, align 8, !tbaa !12
  %29 = load ptr, ptr %5, align 8, !tbaa !5
  %30 = getelementptr inbounds %"class.VmaBlockMetadata_TLSF::Block", ptr %29, i32 0, i32 1
  %31 = load i64, ptr %30, align 8, !tbaa !13
  call void @_ZN30VmaBlockBufferImageGranularity9FreePagesEmm(ptr noundef nonnull align 8 dereferenceable(24) %25, i64 noundef %28, i64 noundef %31)
  br label %32

32:                                               ; preds = %24, %22
  %33 = getelementptr inbounds %class.VmaBlockMetadata_TLSF, ptr %9, i32 0, i32 1
  %34 = load i64, ptr %33, align 8, !tbaa !14
  %35 = add i64 %34, -1
  store i64 %35, ptr %33, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  %36 = call noundef i64 @_ZNK16VmaBlockMetadata14GetDebugMarginEv(ptr noundef nonnull align 8 dereferenceable(33) %9)
  store i64 %36, ptr %7, align 8, !tbaa !23
  %37 = load i64, ptr %7, align 8, !tbaa !23
  %38 = icmp ugt i64 %37, 0
  br i1 %38, label %39, label %47

39:                                               ; preds = %32
  %40 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN21VmaBlockMetadata_TLSF15RemoveFreeBlockEPNS_5BlockE(ptr noundef nonnull align 8 dereferenceable(400) %9, ptr noundef %40)
  %41 = load ptr, ptr %6, align 8, !tbaa !5
  %42 = load ptr, ptr %5, align 8, !tbaa !5
  call void @_ZN21VmaBlockMetadata_TLSF10MergeBlockEPNS_5BlockES1_(ptr noundef nonnull align 8 dereferenceable(400) %9, ptr noundef %41, ptr noundef %42)
  %43 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %43, ptr %5, align 8, !tbaa !5
  %44 = load ptr, ptr %6, align 8, !tbaa !5
  %45 = getelementptr inbounds %"class.VmaBlockMetadata_TLSF::Block", ptr %44, i32 0, i32 3
  %46 = load ptr, ptr %45, align 8, !tbaa !9
  store ptr %46, ptr %6, align 8, !tbaa !5
  br label %47

47:                                               ; preds = %39, %32
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %48 = load ptr, ptr %5, align 8, !tbaa !5
  %49 = getelementptr inbounds %"class.VmaBlockMetadata_TLSF::Block", ptr %48, i32 0, i32 2
  %50 = load ptr, ptr %49, align 8, !tbaa !24
  store ptr %50, ptr %8, align 8, !tbaa !5
  %51 = load ptr, ptr %8, align 8, !tbaa !5
  %52 = icmp ne ptr %51, null
  br i1 %52, label %53, label %66

53:                                               ; preds = %47
  %54 = load ptr, ptr %8, align 8, !tbaa !5
  %55 = call noundef zeroext i1 @_ZNK21VmaBlockMetadata_TLSF5Block6IsFreeEv(ptr noundef nonnull align 8 dereferenceable(48) %54)
  br i1 %55, label %56, label %66

56:                                               ; preds = %53
  %57 = load ptr, ptr %8, align 8, !tbaa !5
  %58 = getelementptr inbounds %"class.VmaBlockMetadata_TLSF::Block", ptr %57, i32 0, i32 1
  %59 = load i64, ptr %58, align 8, !tbaa !13
  %60 = load i64, ptr %7, align 8, !tbaa !23
  %61 = icmp ne i64 %59, %60
  br i1 %61, label %62, label %66

62:                                               ; preds = %56
  %63 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN21VmaBlockMetadata_TLSF15RemoveFreeBlockEPNS_5BlockE(ptr noundef nonnull align 8 dereferenceable(400) %9, ptr noundef %63)
  %64 = load ptr, ptr %5, align 8, !tbaa !5
  %65 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN21VmaBlockMetadata_TLSF10MergeBlockEPNS_5BlockES1_(ptr noundef nonnull align 8 dereferenceable(400) %9, ptr noundef %64, ptr noundef %65)
  br label %66

66:                                               ; preds = %62, %56, %53, %47
  %67 = load ptr, ptr %6, align 8, !tbaa !5
  %68 = call noundef zeroext i1 @_ZNK21VmaBlockMetadata_TLSF5Block6IsFreeEv(ptr noundef nonnull align 8 dereferenceable(48) %67)
  br i1 %68, label %71, label %69

69:                                               ; preds = %66
  %70 = load ptr, ptr %5, align 8, !tbaa !5
  call void @_ZN21VmaBlockMetadata_TLSF15InsertFreeBlockEPNS_5BlockE(ptr noundef nonnull align 8 dereferenceable(400) %9, ptr noundef %70)
  br label %86

71:                                               ; preds = %66
  %72 = load ptr, ptr %6, align 8, !tbaa !5
  %73 = getelementptr inbounds %class.VmaBlockMetadata_TLSF, ptr %9, i32 0, i32 10
  %74 = load ptr, ptr %73, align 8, !tbaa !25
  %75 = icmp eq ptr %72, %74
  br i1 %75, label %76, label %80

76:                                               ; preds = %71
  %77 = getelementptr inbounds %class.VmaBlockMetadata_TLSF, ptr %9, i32 0, i32 10
  %78 = load ptr, ptr %77, align 8, !tbaa !25
  %79 = load ptr, ptr %5, align 8, !tbaa !5
  call void @_ZN21VmaBlockMetadata_TLSF10MergeBlockEPNS_5BlockES1_(ptr noundef nonnull align 8 dereferenceable(400) %9, ptr noundef %78, ptr noundef %79)
  br label %85

80:                                               ; preds = %71
  %81 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN21VmaBlockMetadata_TLSF15RemoveFreeBlockEPNS_5BlockE(ptr noundef nonnull align 8 dereferenceable(400) %9, ptr noundef %81)
  %82 = load ptr, ptr %6, align 8, !tbaa !5
  %83 = load ptr, ptr %5, align 8, !tbaa !5
  call void @_ZN21VmaBlockMetadata_TLSF10MergeBlockEPNS_5BlockES1_(ptr noundef nonnull align 8 dereferenceable(400) %9, ptr noundef %82, ptr noundef %83)
  %84 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN21VmaBlockMetadata_TLSF15InsertFreeBlockEPNS_5BlockE(ptr noundef nonnull align 8 dereferenceable(400) %9, ptr noundef %84)
  br label %85

85:                                               ; preds = %80, %76
  br label %86

86:                                               ; preds = %85, %69
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN21VmaBlockMetadata_TLSF10MergeBlockEPNS_5BlockES1_(ptr noundef nonnull align 8 dereferenceable(400), ptr noundef, ptr noundef) #3 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, !6, i64 24}
!10 = !{!"_ZTSN21VmaBlockMetadata_TLSF5BlockE", !11, i64 0, !11, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !7, i64 40}
!11 = !{!"long", !7, i64 0}
!12 = !{!10, !11, i64 0}
!13 = !{!10, !11, i64 8}
!14 = !{!15, !11, i64 40}
!15 = !{!"_ZTS21VmaBlockMetadata_TLSF", !16, i64 0, !11, i64 40, !11, i64 48, !11, i64 56, !18, i64 64, !7, i64 68, !7, i64 72, !18, i64 304, !6, i64 312, !19, i64 320, !6, i64 368, !22, i64 376}
!16 = !{!"_ZTS16VmaBlockMetadata", !11, i64 8, !6, i64 16, !11, i64 24, !17, i64 32}
!17 = !{!"bool", !7, i64 0}
!18 = !{!"int", !7, i64 0}
!19 = !{!"_ZTS16VmaPoolAllocatorIN21VmaBlockMetadata_TLSF5BlockEE", !6, i64 0, !18, i64 8, !20, i64 16}
!20 = !{!"_ZTS9VmaVectorIN16VmaPoolAllocatorIN21VmaBlockMetadata_TLSF5BlockEE9ItemBlockE15VmaStlAllocatorIS4_EE", !21, i64 0, !6, i64 8, !11, i64 16, !11, i64 24}
!21 = !{!"_ZTS15VmaStlAllocatorIN16VmaPoolAllocatorIN21VmaBlockMetadata_TLSF5BlockEE9ItemBlockEE", !6, i64 0}
!22 = !{!"_ZTS30VmaBlockBufferImageGranularity", !11, i64 0, !18, i64 8, !6, i64 16}
!23 = !{!11, !11, i64 0}
!24 = !{!10, !6, i64 16}
!25 = !{!15, !6, i64 368}


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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN30VmaBlockBufferImageGranularity9FreePagesEmm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, i64 noundef) local_unnamed_addr #2 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
declare dso_local noundef zeroext i1 @_ZNK21VmaBlockMetadata_TLSF5Block6IsFreeEv(ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN21VmaBlockMetadata_TLSF15RemoveFreeBlockEPNS_5BlockE(ptr noundef nonnull align 8 dereferenceable(400), ptr noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN21VmaBlockMetadata_TLSF15InsertFreeBlockEPNS_5BlockE(ptr noundef nonnull align 8 dereferenceable(400), ptr noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN21VmaBlockMetadata_TLSF4FreeEP16VmaAllocHandle_T(ptr noundef nonnull align 8 dereferenceable(400) %0, ptr noundef nonnull %1) unnamed_addr #2 align 2 {
  %3 = getelementptr inbounds i8, ptr %1, i64 24
  %4 = load ptr, ptr %3, align 8, !tbaa !5
  %5 = tail call noundef zeroext i1 @_ZNK21VmaBlockMetadata_TLSF5Block6IsFreeEv(ptr noundef nonnull align 8 dereferenceable(48) %1)
  br i1 %5, label %6, label %7

6:                                                ; preds = %2
  tail call void @__assert_fail(ptr noundef nonnull @.str.109, ptr noundef nonnull @.str.2, i32 noundef 10643, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN21VmaBlockMetadata_TLSF4FreeEP16VmaAllocHandle_T) #3
  unreachable

7:                                                ; preds = %2
  %8 = tail call noundef zeroext i1 @_ZNK16VmaBlockMetadata9IsVirtualEv(ptr noundef nonnull align 8 dereferenceable(33) %0)
  br i1 %8, label %14, label %9

9:                                                ; preds = %7
  %10 = getelementptr inbounds i8, ptr %0, i64 376
  %11 = load i64, ptr %1, align 8, !tbaa !11
  %12 = getelementptr inbounds i8, ptr %1, i64 8
  %13 = load i64, ptr %12, align 8, !tbaa !12
  tail call void @_ZN30VmaBlockBufferImageGranularity9FreePagesEmm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %11, i64 noundef %13)
  br label %14

14:                                               ; preds = %9, %7
  %15 = getelementptr inbounds i8, ptr %0, i64 40
  %16 = load i64, ptr %15, align 8, !tbaa !13
  %17 = add i64 %16, -1
  store i64 %17, ptr %15, align 8, !tbaa !13
  %18 = tail call noundef i64 @_ZNK16VmaBlockMetadata14GetDebugMarginEv(ptr noundef nonnull align 8 dereferenceable(33) %0)
  %.not = icmp eq i64 %18, 0
  br i1 %.not, label %22, label %19

19:                                               ; preds = %14
  tail call void @_ZN21VmaBlockMetadata_TLSF15RemoveFreeBlockEPNS_5BlockE(ptr noundef nonnull align 8 dereferenceable(400) %0, ptr noundef %4)
  tail call void @_ZN21VmaBlockMetadata_TLSF10MergeBlockEPNS_5BlockES1_(ptr noundef nonnull align 8 dereferenceable(400) %0, ptr noundef %4, ptr noundef nonnull %1)
  %20 = getelementptr inbounds i8, ptr %4, i64 24
  %21 = load ptr, ptr %20, align 8, !tbaa !5
  br label %22

22:                                               ; preds = %19, %14
  %.027 = phi ptr [ %21, %19 ], [ %4, %14 ]
  %.0 = phi ptr [ %4, %19 ], [ %1, %14 ]
  %23 = getelementptr inbounds i8, ptr %.0, i64 16
  %24 = load ptr, ptr %23, align 8, !tbaa !22
  %.not30 = icmp eq ptr %24, null
  br i1 %.not30, label %31, label %25

25:                                               ; preds = %22
  %26 = tail call noundef zeroext i1 @_ZNK21VmaBlockMetadata_TLSF5Block6IsFreeEv(ptr noundef nonnull align 8 dereferenceable(48) %24)
  br i1 %26, label %27, label %31

27:                                               ; preds = %25
  %28 = getelementptr inbounds i8, ptr %24, i64 8
  %29 = load i64, ptr %28, align 8, !tbaa !12
  %.not31 = icmp eq i64 %29, %18
  br i1 %.not31, label %31, label %30

30:                                               ; preds = %27
  tail call void @_ZN21VmaBlockMetadata_TLSF15RemoveFreeBlockEPNS_5BlockE(ptr noundef nonnull align 8 dereferenceable(400) %0, ptr noundef nonnull %24)
  tail call void @_ZN21VmaBlockMetadata_TLSF10MergeBlockEPNS_5BlockES1_(ptr noundef nonnull align 8 dereferenceable(400) %0, ptr noundef nonnull %.0, ptr noundef nonnull %24)
  br label %31

31:                                               ; preds = %30, %27, %25, %22
  %32 = tail call noundef zeroext i1 @_ZNK21VmaBlockMetadata_TLSF5Block6IsFreeEv(ptr noundef nonnull align 8 dereferenceable(48) %.027)
  br i1 %32, label %34, label %33

33:                                               ; preds = %31
  tail call void @_ZN21VmaBlockMetadata_TLSF15InsertFreeBlockEPNS_5BlockE(ptr noundef nonnull align 8 dereferenceable(400) %0, ptr noundef nonnull %.0)
  br label %40

34:                                               ; preds = %31
  %35 = getelementptr inbounds i8, ptr %0, i64 368
  %36 = load ptr, ptr %35, align 8, !tbaa !23
  %37 = icmp eq ptr %.027, %36
  br i1 %37, label %38, label %39

38:                                               ; preds = %34
  tail call void @_ZN21VmaBlockMetadata_TLSF10MergeBlockEPNS_5BlockES1_(ptr noundef nonnull align 8 dereferenceable(400) %0, ptr noundef %36, ptr noundef nonnull %.0)
  br label %40

39:                                               ; preds = %34
  tail call void @_ZN21VmaBlockMetadata_TLSF15RemoveFreeBlockEPNS_5BlockE(ptr noundef nonnull align 8 dereferenceable(400) %0, ptr noundef nonnull %.027)
  tail call void @_ZN21VmaBlockMetadata_TLSF10MergeBlockEPNS_5BlockES1_(ptr noundef nonnull align 8 dereferenceable(400) %0, ptr noundef nonnull %.027, ptr noundef nonnull %.0)
  tail call void @_ZN21VmaBlockMetadata_TLSF15InsertFreeBlockEPNS_5BlockE(ptr noundef nonnull align 8 dereferenceable(400) %0, ptr noundef nonnull %.027)
  br label %40

40:                                               ; preds = %38, %39, %33
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN21VmaBlockMetadata_TLSF10MergeBlockEPNS_5BlockES1_(ptr noundef nonnull align 8 dereferenceable(400), ptr noundef, ptr noundef) local_unnamed_addr #2 align 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 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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, !10, i64 24}
!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 = !{!6, !7, i64 0}
!12 = !{!6, !7, i64 8}
!13 = !{!14, !7, i64 40}
!14 = !{!"_ZTS21VmaBlockMetadata_TLSF", !15, i64 0, !7, i64 40, !7, i64 48, !7, i64 56, !17, i64 64, !8, i64 68, !8, i64 72, !17, i64 304, !10, i64 312, !18, i64 320, !10, i64 368, !21, i64 376}
!15 = !{!"_ZTS16VmaBlockMetadata", !7, i64 8, !10, i64 16, !7, i64 24, !16, i64 32}
!16 = !{!"bool", !8, i64 0}
!17 = !{!"int", !8, i64 0}
!18 = !{!"_ZTS16VmaPoolAllocatorIN21VmaBlockMetadata_TLSF5BlockEE", !10, i64 0, !17, i64 8, !19, i64 16}
!19 = !{!"_ZTS9VmaVectorIN16VmaPoolAllocatorIN21VmaBlockMetadata_TLSF5BlockEE9ItemBlockE15VmaStlAllocatorIS4_EE", !20, i64 0, !10, i64 8, !7, i64 16, !7, i64 24}
!20 = !{!"_ZTS15VmaStlAllocatorIN16VmaPoolAllocatorIN21VmaBlockMetadata_TLSF5BlockEE9ItemBlockEE", !10, i64 0}
!21 = !{!"_ZTS30VmaBlockBufferImageGranularity", !7, i64 0, !17, i64 8, !10, i64 16}
!22 = !{!6, !10, i64 16}
!23 = !{!14, !10, i64 368}


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