; 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 = 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 }
%"class.VmaBlockMetadata_TLSF::Block" = type { i64, i64, ptr, ptr, ptr, %union.anon.6 }
%union.anon.6 = type { ptr }

@.str.2 = external hidden unnamed_addr constant [84 x i8], align 1
@.str.120 = external hidden unnamed_addr constant [21 x i8], align 1
@__PRETTY_FUNCTION__._ZN21VmaBlockMetadata_TLSF15InsertFreeBlockEPNS_5BlockE = external hidden unnamed_addr constant [53 x i8], align 1
@.str.124 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.125 = external hidden unnamed_addr constant [21 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 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 uwtable
declare dso_local noundef zeroext i8 @_ZNK21VmaBlockMetadata_TLSF17SizeToMemoryClassEm(ptr noundef nonnull align 8 dereferenceable(400), i64 noundef) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i16 @_ZNK21VmaBlockMetadata_TLSF17SizeToSecondIndexEmh(ptr noundef nonnull align 8 dereferenceable(400), i64 noundef, i8 noundef zeroext) #3 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 void @_ZN21VmaBlockMetadata_TLSF15InsertFreeBlockEPNS_5BlockE(ptr noundef nonnull align 8 dereferenceable(400) %0, ptr noundef %1) #3 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i8, align 1
  %6 = alloca i16, align 2
  %7 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %8 = load ptr, ptr %3, align 8
  %9 = load ptr, ptr %4, align 8, !tbaa !5
  %10 = getelementptr inbounds %class.VmaBlockMetadata_TLSF, ptr %8, i32 0, i32 10
  %11 = load ptr, ptr %10, align 8, !tbaa !9
  %12 = icmp ne ptr %9, %11
  br i1 %12, label %13, label %14

13:                                               ; preds = %2
  br label %16

14:                                               ; preds = %2
  call void @__assert_fail(ptr noundef @.str.120, ptr noundef @.str.2, i32 noundef 10834, ptr noundef @__PRETTY_FUNCTION__._ZN21VmaBlockMetadata_TLSF15InsertFreeBlockEPNS_5BlockE) #4
  unreachable

15:                                               ; No predecessors!
  br label %16

16:                                               ; preds = %15, %13
  %17 = load ptr, ptr %4, align 8, !tbaa !5
  %18 = call noundef zeroext i1 @_ZNK21VmaBlockMetadata_TLSF5Block6IsFreeEv(ptr noundef nonnull align 8 dereferenceable(48) %17)
  br i1 %18, label %20, label %19

19:                                               ; preds = %16
  br label %20

20:                                               ; preds = %19, %16
  %21 = phi i1 [ false, %16 ], [ true, %19 ]
  br i1 %21, label %22, label %23

22:                                               ; preds = %20
  br label %25

23:                                               ; preds = %20
  call void @__assert_fail(ptr noundef @.str.124, ptr noundef @.str.2, i32 noundef 10835, ptr noundef @__PRETTY_FUNCTION__._ZN21VmaBlockMetadata_TLSF15InsertFreeBlockEPNS_5BlockE) #4
  unreachable

24:                                               ; No predecessors!
  br label %25

25:                                               ; preds = %24, %22
  call void @llvm.lifetime.start.p0(i64 1, ptr %5) #5
  %26 = load ptr, ptr %4, align 8, !tbaa !5
  %27 = getelementptr inbounds %"class.VmaBlockMetadata_TLSF::Block", ptr %26, i32 0, i32 1
  %28 = load i64, ptr %27, align 8, !tbaa !19
  %29 = call noundef zeroext i8 @_ZNK21VmaBlockMetadata_TLSF17SizeToMemoryClassEm(ptr noundef nonnull align 8 dereferenceable(400) %8, i64 noundef %28)
  store i8 %29, ptr %5, align 1, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 2, ptr %6) #5
  %30 = load ptr, ptr %4, align 8, !tbaa !5
  %31 = getelementptr inbounds %"class.VmaBlockMetadata_TLSF::Block", ptr %30, i32 0, i32 1
  %32 = load i64, ptr %31, align 8, !tbaa !19
  %33 = load i8, ptr %5, align 1, !tbaa !21
  %34 = call noundef zeroext i16 @_ZNK21VmaBlockMetadata_TLSF17SizeToSecondIndexEmh(ptr noundef nonnull align 8 dereferenceable(400) %8, i64 noundef %32, i8 noundef zeroext %33)
  store i16 %34, ptr %6, align 2, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  %35 = load i8, ptr %5, align 1, !tbaa !21
  %36 = load i16, ptr %6, align 2, !tbaa !22
  %37 = call noundef i32 @_ZNK21VmaBlockMetadata_TLSF12GetListIndexEht(ptr noundef nonnull align 8 dereferenceable(400) %8, i8 noundef zeroext %35, i16 noundef zeroext %36)
  store i32 %37, ptr %7, align 4, !tbaa !24
  %38 = load i32, ptr %7, align 4, !tbaa !24
  %39 = getelementptr inbounds %class.VmaBlockMetadata_TLSF, ptr %8, i32 0, i32 7
  %40 = load i32, ptr %39, align 8, !tbaa !25
  %41 = icmp ult i32 %38, %40
  br i1 %41, label %42, label %43

42:                                               ; preds = %25
  br label %45

43:                                               ; preds = %25
  call void @__assert_fail(ptr noundef @.str.125, ptr noundef @.str.2, i32 noundef 10840, ptr noundef @__PRETTY_FUNCTION__._ZN21VmaBlockMetadata_TLSF15InsertFreeBlockEPNS_5BlockE) #4
  unreachable

44:                                               ; No predecessors!
  br label %45

45:                                               ; preds = %44, %42
  %46 = load ptr, ptr %4, align 8, !tbaa !5
  %47 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN21VmaBlockMetadata_TLSF5Block8PrevFreeEv(ptr noundef nonnull align 8 dereferenceable(48) %46)
  store ptr null, ptr %47, align 8, !tbaa !5
  %48 = getelementptr inbounds %class.VmaBlockMetadata_TLSF, ptr %8, i32 0, i32 8
  %49 = load ptr, ptr %48, align 8, !tbaa !26
  %50 = load i32, ptr %7, align 4, !tbaa !24
  %51 = zext i32 %50 to i64
  %52 = getelementptr inbounds ptr, ptr %49, i64 %51
  %53 = load ptr, ptr %52, align 8, !tbaa !5
  %54 = load ptr, ptr %4, align 8, !tbaa !5
  %55 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN21VmaBlockMetadata_TLSF5Block8NextFreeEv(ptr noundef nonnull align 8 dereferenceable(48) %54)
  store ptr %53, ptr %55, align 8, !tbaa !5
  %56 = load ptr, ptr %4, align 8, !tbaa !5
  %57 = getelementptr inbounds %class.VmaBlockMetadata_TLSF, ptr %8, i32 0, i32 8
  %58 = load ptr, ptr %57, align 8, !tbaa !26
  %59 = load i32, ptr %7, align 4, !tbaa !24
  %60 = zext i32 %59 to i64
  %61 = getelementptr inbounds ptr, ptr %58, i64 %60
  store ptr %56, ptr %61, align 8, !tbaa !5
  %62 = load ptr, ptr %4, align 8, !tbaa !5
  %63 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN21VmaBlockMetadata_TLSF5Block8NextFreeEv(ptr noundef nonnull align 8 dereferenceable(48) %62)
  %64 = load ptr, ptr %63, align 8, !tbaa !5
  %65 = icmp ne ptr %64, null
  br i1 %65, label %66, label %72

66:                                               ; preds = %45
  %67 = load ptr, ptr %4, align 8, !tbaa !5
  %68 = load ptr, ptr %4, align 8, !tbaa !5
  %69 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN21VmaBlockMetadata_TLSF5Block8NextFreeEv(ptr noundef nonnull align 8 dereferenceable(48) %68)
  %70 = load ptr, ptr %69, align 8, !tbaa !5
  %71 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN21VmaBlockMetadata_TLSF5Block8PrevFreeEv(ptr noundef nonnull align 8 dereferenceable(48) %70)
  store ptr %67, ptr %71, align 8, !tbaa !5
  br label %91

72:                                               ; preds = %45
  %73 = load i16, ptr %6, align 2, !tbaa !22
  %74 = zext i16 %73 to i32
  %75 = shl i32 1, %74
  %76 = getelementptr inbounds %class.VmaBlockMetadata_TLSF, ptr %8, i32 0, i32 6
  %77 = load i8, ptr %5, align 1, !tbaa !21
  %78 = zext i8 %77 to i64
  %79 = getelementptr inbounds [58 x i32], ptr %76, i64 0, i64 %78
  %80 = load i32, ptr %79, align 4, !tbaa !24
  %81 = or i32 %80, %75
  store i32 %81, ptr %79, align 4, !tbaa !24
  %82 = load i8, ptr %5, align 1, !tbaa !21
  %83 = zext i8 %82 to i32
  %84 = zext i32 %83 to i64
  %85 = shl i64 1, %84
  %86 = getelementptr inbounds %class.VmaBlockMetadata_TLSF, ptr %8, i32 0, i32 4
  %87 = load i32, ptr %86, align 8, !tbaa !27
  %88 = zext i32 %87 to i64
  %89 = or i64 %88, %85
  %90 = trunc i64 %89 to i32
  store i32 %90, ptr %86, align 8, !tbaa !27
  br label %91

91:                                               ; preds = %72, %66
  %92 = getelementptr inbounds %class.VmaBlockMetadata_TLSF, ptr %8, i32 0, i32 2
  %93 = load i64, ptr %92, align 8, !tbaa !28
  %94 = add i64 %93, 1
  store i64 %94, ptr %92, align 8, !tbaa !28
  %95 = load ptr, ptr %4, align 8, !tbaa !5
  %96 = getelementptr inbounds %"class.VmaBlockMetadata_TLSF::Block", ptr %95, i32 0, i32 1
  %97 = load i64, ptr %96, align 8, !tbaa !19
  %98 = getelementptr inbounds %class.VmaBlockMetadata_TLSF, ptr %8, i32 0, i32 3
  %99 = load i64, ptr %98, align 8, !tbaa !29
  %100 = add i64 %99, %97
  store i64 %100, ptr %98, align 8, !tbaa !29
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 2, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #5
  ret void
}

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


; 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.120 = external hidden unnamed_addr constant [21 x i8], align 1
@__PRETTY_FUNCTION__._ZN21VmaBlockMetadata_TLSF15InsertFreeBlockEPNS_5BlockE = external hidden unnamed_addr constant [53 x i8], align 1
@.str.124 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.125 = external hidden unnamed_addr constant [21 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 nonnull align 8 dereferenceable(8) ptr @_ZN21VmaBlockMetadata_TLSF5Block8NextFreeEv(ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #1 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 #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i8 @_ZNK21VmaBlockMetadata_TLSF17SizeToMemoryClassEm(ptr noundef nonnull align 8 dereferenceable(400), i64 noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i16 @_ZNK21VmaBlockMetadata_TLSF17SizeToSecondIndexEmh(ptr noundef nonnull align 8 dereferenceable(400), i64 noundef, i8 noundef zeroext) 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 #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN21VmaBlockMetadata_TLSF15InsertFreeBlockEPNS_5BlockE(ptr noundef nonnull align 8 dereferenceable(400) %0, ptr noundef %1) local_unnamed_addr #2 align 2 {
  %3 = getelementptr inbounds i8, ptr %0, i64 368
  %4 = load ptr, ptr %3, align 8, !tbaa !5
  %.not = icmp eq ptr %4, %1
  br i1 %.not, label %5, label %6

5:                                                ; preds = %2
  tail call void @__assert_fail(ptr noundef nonnull @.str.120, ptr noundef nonnull @.str.2, i32 noundef 10834, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN21VmaBlockMetadata_TLSF15InsertFreeBlockEPNS_5BlockE) #3
  unreachable

6:                                                ; preds = %2
  %7 = tail call noundef zeroext i1 @_ZNK21VmaBlockMetadata_TLSF5Block6IsFreeEv(ptr noundef nonnull align 8 dereferenceable(48) %1)
  br i1 %7, label %8, label %9

8:                                                ; preds = %6
  tail call void @__assert_fail(ptr noundef nonnull @.str.124, ptr noundef nonnull @.str.2, i32 noundef 10835, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN21VmaBlockMetadata_TLSF15InsertFreeBlockEPNS_5BlockE) #3
  unreachable

9:                                                ; preds = %6
  %10 = getelementptr inbounds i8, ptr %1, i64 8
  %11 = load i64, ptr %10, align 8, !tbaa !18
  %12 = tail call noundef zeroext i8 @_ZNK21VmaBlockMetadata_TLSF17SizeToMemoryClassEm(ptr noundef nonnull align 8 dereferenceable(400) %0, i64 noundef %11)
  %13 = load i64, ptr %10, align 8, !tbaa !18
  %14 = tail call noundef zeroext i16 @_ZNK21VmaBlockMetadata_TLSF17SizeToSecondIndexEmh(ptr noundef nonnull align 8 dereferenceable(400) %0, i64 noundef %13, i8 noundef zeroext %12)
  %15 = tail call noundef i32 @_ZNK21VmaBlockMetadata_TLSF12GetListIndexEht(ptr noundef nonnull align 8 dereferenceable(400) %0, i8 noundef zeroext %12, i16 noundef zeroext %14)
  %16 = getelementptr inbounds i8, ptr %0, i64 304
  %17 = load i32, ptr %16, align 8, !tbaa !20
  %18 = icmp ult i32 %15, %17
  br i1 %18, label %20, label %19

19:                                               ; preds = %9
  tail call void @__assert_fail(ptr noundef nonnull @.str.125, ptr noundef nonnull @.str.2, i32 noundef 10840, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN21VmaBlockMetadata_TLSF15InsertFreeBlockEPNS_5BlockE) #3
  unreachable

20:                                               ; preds = %9
  %21 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZN21VmaBlockMetadata_TLSF5Block8PrevFreeEv(ptr noundef nonnull align 8 dereferenceable(48) %1)
  store ptr null, ptr %21, align 8, !tbaa !21
  %22 = getelementptr inbounds i8, ptr %0, i64 312
  %23 = load ptr, ptr %22, align 8, !tbaa !22
  %24 = zext i32 %15 to i64
  %25 = getelementptr inbounds ptr, ptr %23, i64 %24
  %26 = load ptr, ptr %25, align 8, !tbaa !21
  %27 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZN21VmaBlockMetadata_TLSF5Block8NextFreeEv(ptr noundef nonnull align 8 dereferenceable(48) %1)
  store ptr %26, ptr %27, align 8, !tbaa !21
  %28 = load ptr, ptr %22, align 8, !tbaa !22
  %29 = getelementptr inbounds ptr, ptr %28, i64 %24
  store ptr %1, ptr %29, align 8, !tbaa !21
  %30 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZN21VmaBlockMetadata_TLSF5Block8NextFreeEv(ptr noundef nonnull align 8 dereferenceable(48) %1)
  %31 = load ptr, ptr %30, align 8, !tbaa !21
  %.not21 = icmp eq ptr %31, null
  br i1 %.not21, label %36, label %32

32:                                               ; preds = %20
  %33 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZN21VmaBlockMetadata_TLSF5Block8NextFreeEv(ptr noundef nonnull align 8 dereferenceable(48) %1)
  %34 = load ptr, ptr %33, align 8, !tbaa !21
  %35 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZN21VmaBlockMetadata_TLSF5Block8PrevFreeEv(ptr noundef nonnull align 8 dereferenceable(48) %34)
  store ptr %1, ptr %35, align 8, !tbaa !21
  br label %49

36:                                               ; preds = %20
  %37 = zext nneg i16 %14 to i32
  %38 = shl nuw i32 1, %37
  %39 = getelementptr inbounds i8, ptr %0, i64 72
  %40 = zext i8 %12 to i64
  %41 = getelementptr inbounds [58 x i32], ptr %39, i64 0, i64 %40
  %42 = load i32, ptr %41, align 4, !tbaa !23
  %43 = or i32 %42, %38
  store i32 %43, ptr %41, align 4, !tbaa !23
  %44 = shl nuw i64 1, %40
  %45 = getelementptr inbounds i8, ptr %0, i64 64
  %46 = load i32, ptr %45, align 8, !tbaa !24
  %47 = trunc i64 %44 to i32
  %48 = or i32 %46, %47
  store i32 %48, ptr %45, align 8, !tbaa !24
  br label %49

49:                                               ; preds = %36, %32
  %50 = getelementptr inbounds i8, ptr %0, i64 48
  %51 = load i64, ptr %10, align 8, !tbaa !18
  %52 = load <2 x i64>, ptr %50, align 8, !tbaa !25
  %53 = insertelement <2 x i64> <i64 1, i64 poison>, i64 %51, i64 1
  %54 = add <2 x i64> %52, %53
  store <2 x i64> %54, ptr %50, align 8, !tbaa !25
  ret void
}

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


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass