; 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_TLSF15RemoveFreeBlockEPNS_5BlockE = external hidden unnamed_addr constant [53 x i8], align 1
@.str.121 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.122 = external hidden unnamed_addr constant [27 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 nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN21VmaBlockMetadata_TLSF5Block8UserDataEv(ptr noundef nonnull align 8 dereferenceable(48)) #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN21VmaBlockMetadata_TLSF15RemoveFreeBlockEPNS_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 10805, ptr noundef @__PRETTY_FUNCTION__._ZN21VmaBlockMetadata_TLSF15RemoveFreeBlockEPNS_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 %19, label %20

19:                                               ; preds = %16
  br label %22

20:                                               ; preds = %16
  call void @__assert_fail(ptr noundef @.str.121, ptr noundef @.str.2, i32 noundef 10806, ptr noundef @__PRETTY_FUNCTION__._ZN21VmaBlockMetadata_TLSF15RemoveFreeBlockEPNS_5BlockE) #4
  unreachable

21:                                               ; No predecessors!
  br label %22

22:                                               ; preds = %21, %19
  %23 = load ptr, ptr %4, align 8, !tbaa !5
  %24 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN21VmaBlockMetadata_TLSF5Block8NextFreeEv(ptr noundef nonnull align 8 dereferenceable(48) %23)
  %25 = load ptr, ptr %24, align 8, !tbaa !5
  %26 = icmp ne ptr %25, null
  br i1 %26, label %27, label %35

27:                                               ; preds = %22
  %28 = load ptr, ptr %4, align 8, !tbaa !5
  %29 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN21VmaBlockMetadata_TLSF5Block8PrevFreeEv(ptr noundef nonnull align 8 dereferenceable(48) %28)
  %30 = load ptr, ptr %29, align 8, !tbaa !5
  %31 = load ptr, ptr %4, align 8, !tbaa !5
  %32 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN21VmaBlockMetadata_TLSF5Block8NextFreeEv(ptr noundef nonnull align 8 dereferenceable(48) %31)
  %33 = load ptr, ptr %32, align 8, !tbaa !5
  %34 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN21VmaBlockMetadata_TLSF5Block8PrevFreeEv(ptr noundef nonnull align 8 dereferenceable(48) %33)
  store ptr %30, ptr %34, align 8, !tbaa !5
  br label %35

35:                                               ; preds = %27, %22
  %36 = load ptr, ptr %4, align 8, !tbaa !5
  %37 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN21VmaBlockMetadata_TLSF5Block8PrevFreeEv(ptr noundef nonnull align 8 dereferenceable(48) %36)
  %38 = load ptr, ptr %37, align 8, !tbaa !5
  %39 = icmp ne ptr %38, null
  br i1 %39, label %40, label %48

40:                                               ; preds = %35
  %41 = load ptr, ptr %4, align 8, !tbaa !5
  %42 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN21VmaBlockMetadata_TLSF5Block8NextFreeEv(ptr noundef nonnull align 8 dereferenceable(48) %41)
  %43 = load ptr, ptr %42, align 8, !tbaa !5
  %44 = load ptr, ptr %4, align 8, !tbaa !5
  %45 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN21VmaBlockMetadata_TLSF5Block8PrevFreeEv(ptr noundef nonnull align 8 dereferenceable(48) %44)
  %46 = load ptr, ptr %45, align 8, !tbaa !5
  %47 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN21VmaBlockMetadata_TLSF5Block8NextFreeEv(ptr noundef nonnull align 8 dereferenceable(48) %46)
  store ptr %43, ptr %47, align 8, !tbaa !5
  br label %115

48:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 1, ptr %5) #5
  %49 = load ptr, ptr %4, align 8, !tbaa !5
  %50 = getelementptr inbounds %"class.VmaBlockMetadata_TLSF::Block", ptr %49, i32 0, i32 1
  %51 = load i64, ptr %50, align 8, !tbaa !19
  %52 = call noundef zeroext i8 @_ZNK21VmaBlockMetadata_TLSF17SizeToMemoryClassEm(ptr noundef nonnull align 8 dereferenceable(400) %8, i64 noundef %51)
  store i8 %52, ptr %5, align 1, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 2, ptr %6) #5
  %53 = load ptr, ptr %4, 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 !19
  %56 = load i8, ptr %5, align 1, !tbaa !21
  %57 = call noundef zeroext i16 @_ZNK21VmaBlockMetadata_TLSF17SizeToSecondIndexEmh(ptr noundef nonnull align 8 dereferenceable(400) %8, i64 noundef %55, i8 noundef zeroext %56)
  store i16 %57, ptr %6, align 2, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  %58 = load i8, ptr %5, align 1, !tbaa !21
  %59 = load i16, ptr %6, align 2, !tbaa !22
  %60 = call noundef i32 @_ZNK21VmaBlockMetadata_TLSF12GetListIndexEht(ptr noundef nonnull align 8 dereferenceable(400) %8, i8 noundef zeroext %58, i16 noundef zeroext %59)
  store i32 %60, ptr %7, align 4, !tbaa !24
  %61 = getelementptr inbounds %class.VmaBlockMetadata_TLSF, ptr %8, i32 0, i32 8
  %62 = load ptr, ptr %61, align 8, !tbaa !25
  %63 = load i32, ptr %7, align 4, !tbaa !24
  %64 = zext i32 %63 to i64
  %65 = getelementptr inbounds ptr, ptr %62, i64 %64
  %66 = load ptr, ptr %65, align 8, !tbaa !5
  %67 = load ptr, ptr %4, align 8, !tbaa !5
  %68 = icmp eq ptr %66, %67
  br i1 %68, label %69, label %70

69:                                               ; preds = %48
  br label %72

70:                                               ; preds = %48
  call void @__assert_fail(ptr noundef @.str.122, ptr noundef @.str.2, i32 noundef 10817, ptr noundef @__PRETTY_FUNCTION__._ZN21VmaBlockMetadata_TLSF15RemoveFreeBlockEPNS_5BlockE) #4
  unreachable

71:                                               ; No predecessors!
  br label %72

72:                                               ; preds = %71, %69
  %73 = load ptr, ptr %4, align 8, !tbaa !5
  %74 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN21VmaBlockMetadata_TLSF5Block8NextFreeEv(ptr noundef nonnull align 8 dereferenceable(48) %73)
  %75 = load ptr, ptr %74, align 8, !tbaa !5
  %76 = getelementptr inbounds %class.VmaBlockMetadata_TLSF, ptr %8, i32 0, i32 8
  %77 = load ptr, ptr %76, align 8, !tbaa !25
  %78 = load i32, ptr %7, align 4, !tbaa !24
  %79 = zext i32 %78 to i64
  %80 = getelementptr inbounds ptr, ptr %77, i64 %79
  store ptr %75, ptr %80, align 8, !tbaa !5
  %81 = load ptr, ptr %4, align 8, !tbaa !5
  %82 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN21VmaBlockMetadata_TLSF5Block8NextFreeEv(ptr noundef nonnull align 8 dereferenceable(48) %81)
  %83 = load ptr, ptr %82, align 8, !tbaa !5
  %84 = icmp eq ptr %83, null
  br i1 %84, label %85, label %114

85:                                               ; preds = %72
  %86 = load i16, ptr %6, align 2, !tbaa !22
  %87 = zext i16 %86 to i32
  %88 = shl i32 1, %87
  %89 = xor i32 %88, -1
  %90 = getelementptr inbounds %class.VmaBlockMetadata_TLSF, ptr %8, i32 0, i32 6
  %91 = load i8, ptr %5, align 1, !tbaa !21
  %92 = zext i8 %91 to i64
  %93 = getelementptr inbounds [58 x i32], ptr %90, i64 0, i64 %92
  %94 = load i32, ptr %93, align 4, !tbaa !24
  %95 = and i32 %94, %89
  store i32 %95, ptr %93, align 4, !tbaa !24
  %96 = getelementptr inbounds %class.VmaBlockMetadata_TLSF, ptr %8, i32 0, i32 6
  %97 = load i8, ptr %5, align 1, !tbaa !21
  %98 = zext i8 %97 to i64
  %99 = getelementptr inbounds [58 x i32], ptr %96, i64 0, i64 %98
  %100 = load i32, ptr %99, align 4, !tbaa !24
  %101 = icmp eq i32 %100, 0
  br i1 %101, label %102, label %113

102:                                              ; preds = %85
  %103 = load i8, ptr %5, align 1, !tbaa !21
  %104 = zext i8 %103 to i32
  %105 = zext i32 %104 to i64
  %106 = shl i64 1, %105
  %107 = xor i64 %106, -1
  %108 = getelementptr inbounds %class.VmaBlockMetadata_TLSF, ptr %8, i32 0, i32 4
  %109 = load i32, ptr %108, align 8, !tbaa !26
  %110 = zext i32 %109 to i64
  %111 = and i64 %110, %107
  %112 = trunc i64 %111 to i32
  store i32 %112, ptr %108, align 8, !tbaa !26
  br label %113

113:                                              ; preds = %102, %85
  br label %114

114:                                              ; preds = %113, %72
  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
  br label %115

115:                                              ; preds = %114, %40
  %116 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZN21VmaBlockMetadata_TLSF5Block9MarkTakenEv(ptr noundef nonnull align 8 dereferenceable(48) %116)
  %117 = load ptr, ptr %4, align 8, !tbaa !5
  %118 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN21VmaBlockMetadata_TLSF5Block8UserDataEv(ptr noundef nonnull align 8 dereferenceable(48) %117)
  store ptr null, ptr %118, align 8, !tbaa !5
  %119 = getelementptr inbounds %class.VmaBlockMetadata_TLSF, ptr %8, i32 0, i32 2
  %120 = load i64, ptr %119, align 8, !tbaa !27
  %121 = add i64 %120, -1
  store i64 %121, ptr %119, align 8, !tbaa !27
  %122 = load ptr, ptr %4, align 8, !tbaa !5
  %123 = getelementptr inbounds %"class.VmaBlockMetadata_TLSF::Block", ptr %122, i32 0, i32 1
  %124 = load i64, ptr %123, align 8, !tbaa !19
  %125 = getelementptr inbounds %class.VmaBlockMetadata_TLSF, ptr %8, i32 0, i32 3
  %126 = load i64, ptr %125, align 8, !tbaa !28
  %127 = sub i64 %126, %124
  store i64 %127, ptr %125, align 8, !tbaa !28
  ret void
}

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

; 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, !6, i64 312}
!26 = !{!10, !14, i64 64}
!27 = !{!10, !12, i64 48}
!28 = !{!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_TLSF15RemoveFreeBlockEPNS_5BlockE = external hidden unnamed_addr constant [53 x i8], align 1
@.str.121 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.122 = external hidden unnamed_addr constant [27 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 nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN21VmaBlockMetadata_TLSF5Block8UserDataEv(ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN21VmaBlockMetadata_TLSF15RemoveFreeBlockEPNS_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 10805, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN21VmaBlockMetadata_TLSF15RemoveFreeBlockEPNS_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 %9, label %8

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

9:                                                ; preds = %6
  %10 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZN21VmaBlockMetadata_TLSF5Block8NextFreeEv(ptr noundef nonnull align 8 dereferenceable(48) %1)
  %11 = load ptr, ptr %10, align 8, !tbaa !18
  %.not25 = icmp eq ptr %11, null
  br i1 %.not25, label %18, label %12

12:                                               ; preds = %9
  %13 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZN21VmaBlockMetadata_TLSF5Block8PrevFreeEv(ptr noundef nonnull align 8 dereferenceable(48) %1)
  %14 = load ptr, ptr %13, align 8, !tbaa !18
  %15 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZN21VmaBlockMetadata_TLSF5Block8NextFreeEv(ptr noundef nonnull align 8 dereferenceable(48) %1)
  %16 = load ptr, ptr %15, align 8, !tbaa !18
  %17 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZN21VmaBlockMetadata_TLSF5Block8PrevFreeEv(ptr noundef nonnull align 8 dereferenceable(48) %16)
  store ptr %14, ptr %17, align 8, !tbaa !18
  br label %18

18:                                               ; preds = %12, %9
  %19 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZN21VmaBlockMetadata_TLSF5Block8PrevFreeEv(ptr noundef nonnull align 8 dereferenceable(48) %1)
  %20 = load ptr, ptr %19, align 8, !tbaa !18
  %.not26 = icmp eq ptr %20, null
  br i1 %.not26, label %27, label %21

21:                                               ; preds = %18
  %22 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZN21VmaBlockMetadata_TLSF5Block8NextFreeEv(ptr noundef nonnull align 8 dereferenceable(48) %1)
  %23 = load ptr, ptr %22, align 8, !tbaa !18
  %24 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZN21VmaBlockMetadata_TLSF5Block8PrevFreeEv(ptr noundef nonnull align 8 dereferenceable(48) %1)
  %25 = load ptr, ptr %24, align 8, !tbaa !18
  %26 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZN21VmaBlockMetadata_TLSF5Block8NextFreeEv(ptr noundef nonnull align 8 dereferenceable(48) %25)
  store ptr %23, ptr %26, align 8, !tbaa !18
  br label %66

27:                                               ; preds = %18
  %28 = getelementptr inbounds i8, ptr %1, i64 8
  %29 = load i64, ptr %28, align 8, !tbaa !19
  %30 = tail call noundef zeroext i8 @_ZNK21VmaBlockMetadata_TLSF17SizeToMemoryClassEm(ptr noundef nonnull align 8 dereferenceable(400) %0, i64 noundef %29)
  %31 = load i64, ptr %28, align 8, !tbaa !19
  %32 = tail call noundef zeroext i16 @_ZNK21VmaBlockMetadata_TLSF17SizeToSecondIndexEmh(ptr noundef nonnull align 8 dereferenceable(400) %0, i64 noundef %31, i8 noundef zeroext %30)
  %33 = tail call noundef i32 @_ZNK21VmaBlockMetadata_TLSF12GetListIndexEht(ptr noundef nonnull align 8 dereferenceable(400) %0, i8 noundef zeroext %30, i16 noundef zeroext %32)
  %34 = getelementptr inbounds i8, ptr %0, i64 312
  %35 = load ptr, ptr %34, align 8, !tbaa !21
  %36 = zext i32 %33 to i64
  %37 = getelementptr inbounds ptr, ptr %35, i64 %36
  %38 = load ptr, ptr %37, align 8, !tbaa !18
  %39 = icmp eq ptr %38, %1
  br i1 %39, label %41, label %40

40:                                               ; preds = %27
  tail call void @__assert_fail(ptr noundef nonnull @.str.122, ptr noundef nonnull @.str.2, i32 noundef 10817, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN21VmaBlockMetadata_TLSF15RemoveFreeBlockEPNS_5BlockE) #3
  unreachable

41:                                               ; preds = %27
  %42 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZN21VmaBlockMetadata_TLSF5Block8NextFreeEv(ptr noundef nonnull align 8 dereferenceable(48) %1)
  %43 = load ptr, ptr %42, align 8, !tbaa !18
  %44 = load ptr, ptr %34, align 8, !tbaa !21
  %45 = getelementptr inbounds ptr, ptr %44, i64 %36
  store ptr %43, ptr %45, align 8, !tbaa !18
  %46 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZN21VmaBlockMetadata_TLSF5Block8NextFreeEv(ptr noundef nonnull align 8 dereferenceable(48) %1)
  %47 = load ptr, ptr %46, align 8, !tbaa !18
  %48 = icmp eq ptr %47, null
  br i1 %48, label %49, label %66

49:                                               ; preds = %41
  %50 = zext nneg i16 %32 to i32
  %51 = shl nuw i32 1, %50
  %52 = xor i32 %51, -1
  %53 = getelementptr inbounds i8, ptr %0, i64 72
  %54 = zext i8 %30 to i64
  %55 = getelementptr inbounds [58 x i32], ptr %53, i64 0, i64 %54
  %56 = load i32, ptr %55, align 4, !tbaa !22
  %57 = and i32 %56, %52
  store i32 %57, ptr %55, align 4, !tbaa !22
  %58 = icmp eq i32 %57, 0
  br i1 %58, label %59, label %66

59:                                               ; preds = %49
  %60 = shl nuw i64 1, %54
  %61 = getelementptr inbounds i8, ptr %0, i64 64
  %62 = load i32, ptr %61, align 8, !tbaa !23
  %63 = trunc i64 %60 to i32
  %64 = xor i32 %63, -1
  %65 = and i32 %62, %64
  store i32 %65, ptr %61, align 8, !tbaa !23
  br label %66

66:                                               ; preds = %41, %59, %49, %21
  tail call void @_ZN21VmaBlockMetadata_TLSF5Block9MarkTakenEv(ptr noundef nonnull align 8 dereferenceable(48) %1)
  %67 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZN21VmaBlockMetadata_TLSF5Block8UserDataEv(ptr noundef nonnull align 8 dereferenceable(48) %1)
  store ptr null, ptr %67, align 8, !tbaa !18
  %68 = getelementptr inbounds i8, ptr %0, i64 48
  %69 = load i64, ptr %68, align 8, !tbaa !24
  %70 = add i64 %69, -1
  store i64 %70, ptr %68, align 8, !tbaa !24
  %71 = getelementptr inbounds i8, ptr %1, i64 8
  %72 = load i64, ptr %71, align 8, !tbaa !19
  %73 = getelementptr inbounds i8, ptr %0, i64 56
  %74 = load i64, ptr %73, align 8, !tbaa !25
  %75 = sub i64 %74, %72
  store i64 %75, ptr %73, align 8, !tbaa !25
  ret void
}

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

; 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 = !{!11, !11, i64 0}
!19 = !{!20, !8, i64 8}
!20 = !{!"_ZTSN21VmaBlockMetadata_TLSF5BlockE", !8, i64 0, !8, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !9, i64 40}
!21 = !{!6, !11, i64 312}
!22 = !{!13, !13, i64 0}
!23 = !{!6, !13, i64 64}
!24 = !{!6, !8, i64 48}
!25 = !{!6, !8, i64 56}


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