; LLVM IR from khushmmehta/Scorch-V :: src/ScorchVkEngine/Abstractions (VulkanMemoryAllocator)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.VmaStlAllocator.7 = type { ptr }
%class.VmaVector.8 = type { %struct.VmaStlAllocator.7, ptr, i64, i64 }
%struct.VmaDetailedStatistics = type { %struct.VmaStatistics, i32, i64, i64, i64, i64 }
%struct.VmaStatistics = type { i32, i32, i64, i64 }
%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.96 = external hidden unnamed_addr constant [7 x i8], align 1
@__PRETTY_FUNCTION__._ZNK21VmaBlockMetadata_TLSF16PrintDetailedMapER13VmaJsonWriter = external hidden unnamed_addr constant [82 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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK16VmaBlockMetadata22PrintDetailedMap_BeginER13VmaJsonWritermmm(ptr noundef nonnull align 8 dereferenceable(33), ptr noundef nonnull align 8 dereferenceable(41), i64 noundef, i64 noundef, i64 noundef) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK16VmaBlockMetadata27PrintDetailedMap_AllocationER13VmaJsonWritermmPv(ptr noundef nonnull align 8 dereferenceable(33), ptr noundef nonnull align 8 dereferenceable(41), i64 noundef, i64 noundef, ptr noundef) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK16VmaBlockMetadata28PrintDetailedMap_UnusedRangeER13VmaJsonWritermm(ptr noundef nonnull align 8 dereferenceable(33), ptr noundef nonnull align 8 dereferenceable(41), i64 noundef, i64 noundef) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK16VmaBlockMetadata20PrintDetailedMap_EndER13VmaJsonWriter(ptr noundef nonnull align 8 dereferenceable(33), ptr noundef nonnull align 8 dereferenceable(41)) #2 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK21VmaBlockMetadata_TLSF16PrintDetailedMapER13VmaJsonWriter(ptr noundef nonnull align 8 dereferenceable(400) %0, ptr noundef nonnull align 8 dereferenceable(41) %1) unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i64, align 8
  %6 = alloca %struct.VmaStlAllocator.7, align 8
  %7 = alloca %class.VmaVector.8, align 8
  %8 = alloca i64, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca %struct.VmaDetailedStatistics, align 8
  %13 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %14 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  %15 = getelementptr inbounds %class.VmaBlockMetadata_TLSF, ptr %14, i32 0, i32 1
  %16 = load i64, ptr %15, align 8, !tbaa !9
  %17 = getelementptr inbounds %class.VmaBlockMetadata_TLSF, ptr %14, i32 0, i32 2
  %18 = load i64, ptr %17, align 8, !tbaa !19
  %19 = add i64 %16, %18
  store i64 %19, ptr %5, align 8, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  %20 = call noundef ptr @_ZNK16VmaBlockMetadata22GetAllocationCallbacksEv(ptr noundef nonnull align 8 dereferenceable(33) %14)
  call void @_ZN15VmaStlAllocatorIPN21VmaBlockMetadata_TLSF5BlockEEC2EPK21VkAllocationCallbacks(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef %20)
  call void @llvm.lifetime.start.p0(i64 32, ptr %7) #4
  %21 = load i64, ptr %5, align 8, !tbaa !20
  call void @_ZN9VmaVectorIPN21VmaBlockMetadata_TLSF5BlockE15VmaStlAllocatorIS2_EEC2EmRKS4_(ptr noundef nonnull align 8 dereferenceable(32) %7, i64 noundef %21, ptr noundef nonnull align 8 dereferenceable(8) %6)
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %22 = load i64, ptr %5, align 8, !tbaa !20
  store i64 %22, ptr %8, align 8, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %23 = getelementptr inbounds %class.VmaBlockMetadata_TLSF, ptr %14, i32 0, i32 10
  %24 = load ptr, ptr %23, align 8, !tbaa !21
  %25 = getelementptr inbounds %"class.VmaBlockMetadata_TLSF::Block", ptr %24, i32 0, i32 2
  %26 = load ptr, ptr %25, align 8, !tbaa !22
  store ptr %26, ptr %9, align 8, !tbaa !5
  br label %27

27:                                               ; preds = %37, %2
  %28 = load ptr, ptr %9, align 8, !tbaa !5
  %29 = icmp ne ptr %28, null
  br i1 %29, label %31, label %30

30:                                               ; preds = %27
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  br label %45

31:                                               ; preds = %27
  %32 = load ptr, ptr %9, align 8, !tbaa !5
  %33 = load i64, ptr %8, align 8, !tbaa !20
  %34 = add i64 %33, -1
  store i64 %34, ptr %8, align 8, !tbaa !20
  %35 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN9VmaVectorIPN21VmaBlockMetadata_TLSF5BlockE15VmaStlAllocatorIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(32) %7, i64 noundef %34)
          to label %36 unwind label %41

36:                                               ; preds = %31
  store ptr %32, ptr %35, align 8, !tbaa !5
  br label %37

37:                                               ; preds = %36
  %38 = load ptr, ptr %9, align 8, !tbaa !5
  %39 = getelementptr inbounds %"class.VmaBlockMetadata_TLSF::Block", ptr %38, i32 0, i32 2
  %40 = load ptr, ptr %39, align 8, !tbaa !22
  store ptr %40, ptr %9, align 8, !tbaa !5
  br label %27, !llvm.loop !24

41:                                               ; preds = %31
  %42 = landingpad { ptr, i32 }
          cleanup
  %43 = extractvalue { ptr, i32 } %42, 0
  store ptr %43, ptr %10, align 8
  %44 = extractvalue { ptr, i32 } %42, 1
  store i32 %44, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  br label %140

45:                                               ; preds = %30
  %46 = load i64, ptr %8, align 8, !tbaa !20
  %47 = icmp eq i64 %46, 0
  br i1 %47, label %48, label %49

48:                                               ; preds = %45
  br label %51

49:                                               ; preds = %45
  call void @__assert_fail(ptr noundef @.str.96, ptr noundef @.str.2, i32 noundef 10308, ptr noundef @__PRETTY_FUNCTION__._ZNK21VmaBlockMetadata_TLSF16PrintDetailedMapER13VmaJsonWriter) #5
  unreachable

50:                                               ; No predecessors!
  br label %51

51:                                               ; preds = %50, %48
  call void @llvm.lifetime.start.p0(i64 64, ptr %12) #4
  invoke void @_ZL26VmaClearDetailedStatisticsR21VmaDetailedStatistics(ptr noundef nonnull align 8 dereferenceable(64) %12)
          to label %52 unwind label %94

52:                                               ; preds = %51
  %53 = load ptr, ptr %14, align 8, !tbaa !26
  %54 = getelementptr inbounds ptr, ptr %53, i64 14
  %55 = load ptr, ptr %54, align 8
  invoke void %55(ptr noundef nonnull align 8 dereferenceable(400) %14, ptr noundef nonnull align 8 dereferenceable(64) %12)
          to label %56 unwind label %94

56:                                               ; preds = %52
  %57 = load ptr, ptr %4, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.VmaDetailedStatistics, ptr %12, i32 0, i32 0
  %59 = getelementptr inbounds %struct.VmaStatistics, ptr %58, i32 0, i32 2
  %60 = load i64, ptr %59, align 8, !tbaa !28
  %61 = getelementptr inbounds %struct.VmaDetailedStatistics, ptr %12, i32 0, i32 0
  %62 = getelementptr inbounds %struct.VmaStatistics, ptr %61, i32 0, i32 3
  %63 = load i64, ptr %62, align 8, !tbaa !31
  %64 = sub i64 %60, %63
  %65 = getelementptr inbounds %struct.VmaDetailedStatistics, ptr %12, i32 0, i32 0
  %66 = getelementptr inbounds %struct.VmaStatistics, ptr %65, i32 0, i32 1
  %67 = load i32, ptr %66, align 4, !tbaa !32
  %68 = zext i32 %67 to i64
  %69 = getelementptr inbounds %struct.VmaDetailedStatistics, ptr %12, i32 0, i32 1
  %70 = load i32, ptr %69, align 8, !tbaa !33
  %71 = zext i32 %70 to i64
  invoke void @_ZNK16VmaBlockMetadata22PrintDetailedMap_BeginER13VmaJsonWritermmm(ptr noundef nonnull align 8 dereferenceable(33) %14, ptr noundef nonnull align 8 dereferenceable(41) %57, i64 noundef %64, i64 noundef %68, i64 noundef %71)
          to label %72 unwind label %94

72:                                               ; preds = %56
  br label %73

73:                                               ; preds = %116, %72
  %74 = load i64, ptr %8, align 8, !tbaa !20
  %75 = load i64, ptr %5, align 8, !tbaa !20
  %76 = icmp ult i64 %74, %75
  br i1 %76, label %77, label %119

77:                                               ; preds = %73
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  %78 = load i64, ptr %8, align 8, !tbaa !20
  %79 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN9VmaVectorIPN21VmaBlockMetadata_TLSF5BlockE15VmaStlAllocatorIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(32) %7, i64 noundef %78)
          to label %80 unwind label %98

80:                                               ; preds = %77
  %81 = load ptr, ptr %79, align 8, !tbaa !5
  store ptr %81, ptr %13, align 8, !tbaa !5
  %82 = load ptr, ptr %13, align 8, !tbaa !5
  %83 = invoke noundef zeroext i1 @_ZNK21VmaBlockMetadata_TLSF5Block6IsFreeEv(ptr noundef nonnull align 8 dereferenceable(48) %82)
          to label %84 unwind label %98

84:                                               ; preds = %80
  br i1 %83, label %85, label %102

85:                                               ; preds = %84
  %86 = load ptr, ptr %4, align 8, !tbaa !5
  %87 = load ptr, ptr %13, align 8, !tbaa !5
  %88 = getelementptr inbounds %"class.VmaBlockMetadata_TLSF::Block", ptr %87, i32 0, i32 0
  %89 = load i64, ptr %88, align 8, !tbaa !34
  %90 = load ptr, ptr %13, align 8, !tbaa !5
  %91 = getelementptr inbounds %"class.VmaBlockMetadata_TLSF::Block", ptr %90, i32 0, i32 1
  %92 = load i64, ptr %91, align 8, !tbaa !35
  invoke void @_ZNK16VmaBlockMetadata28PrintDetailedMap_UnusedRangeER13VmaJsonWritermm(ptr noundef nonnull align 8 dereferenceable(33) %14, ptr noundef nonnull align 8 dereferenceable(41) %86, i64 noundef %89, i64 noundef %92)
          to label %93 unwind label %98

93:                                               ; preds = %85
  br label %115

94:                                               ; preds = %136, %125, %56, %52, %51
  %95 = landingpad { ptr, i32 }
          cleanup
  %96 = extractvalue { ptr, i32 } %95, 0
  store ptr %96, ptr %10, align 8
  %97 = extractvalue { ptr, i32 } %95, 1
  store i32 %97, ptr %11, align 4
  br label %139

98:                                               ; preds = %112, %102, %85, %80, %77
  %99 = landingpad { ptr, i32 }
          cleanup
  %100 = extractvalue { ptr, i32 } %99, 0
  store ptr %100, ptr %10, align 8
  %101 = extractvalue { ptr, i32 } %99, 1
  store i32 %101, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  br label %139

102:                                              ; preds = %84
  %103 = load ptr, ptr %4, align 8, !tbaa !5
  %104 = load ptr, ptr %13, align 8, !tbaa !5
  %105 = getelementptr inbounds %"class.VmaBlockMetadata_TLSF::Block", ptr %104, i32 0, i32 0
  %106 = load i64, ptr %105, align 8, !tbaa !34
  %107 = load ptr, ptr %13, align 8, !tbaa !5
  %108 = getelementptr inbounds %"class.VmaBlockMetadata_TLSF::Block", ptr %107, i32 0, i32 1
  %109 = load i64, ptr %108, align 8, !tbaa !35
  %110 = load ptr, ptr %13, align 8, !tbaa !5
  %111 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN21VmaBlockMetadata_TLSF5Block8UserDataEv(ptr noundef nonnull align 8 dereferenceable(48) %110)
          to label %112 unwind label %98

112:                                              ; preds = %102
  %113 = load ptr, ptr %111, align 8, !tbaa !5
  invoke void @_ZNK16VmaBlockMetadata27PrintDetailedMap_AllocationER13VmaJsonWritermmPv(ptr noundef nonnull align 8 dereferenceable(33) %14, ptr noundef nonnull align 8 dereferenceable(41) %103, i64 noundef %106, i64 noundef %109, ptr noundef %113)
          to label %114 unwind label %98

114:                                              ; preds = %112
  br label %115

115:                                              ; preds = %114, %93
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  br label %116

116:                                              ; preds = %115
  %117 = load i64, ptr %8, align 8, !tbaa !20
  %118 = add i64 %117, 1
  store i64 %118, ptr %8, align 8, !tbaa !20
  br label %73, !llvm.loop !36

119:                                              ; preds = %73
  %120 = getelementptr inbounds %class.VmaBlockMetadata_TLSF, ptr %14, i32 0, i32 10
  %121 = load ptr, ptr %120, align 8, !tbaa !21
  %122 = getelementptr inbounds %"class.VmaBlockMetadata_TLSF::Block", ptr %121, i32 0, i32 1
  %123 = load i64, ptr %122, align 8, !tbaa !35
  %124 = icmp ugt i64 %123, 0
  br i1 %124, label %125, label %136

125:                                              ; preds = %119
  %126 = load ptr, ptr %4, align 8, !tbaa !5
  %127 = getelementptr inbounds %class.VmaBlockMetadata_TLSF, ptr %14, i32 0, i32 10
  %128 = load ptr, ptr %127, align 8, !tbaa !21
  %129 = getelementptr inbounds %"class.VmaBlockMetadata_TLSF::Block", ptr %128, i32 0, i32 0
  %130 = load i64, ptr %129, align 8, !tbaa !34
  %131 = getelementptr inbounds %class.VmaBlockMetadata_TLSF, ptr %14, i32 0, i32 10
  %132 = load ptr, ptr %131, align 8, !tbaa !21
  %133 = getelementptr inbounds %"class.VmaBlockMetadata_TLSF::Block", ptr %132, i32 0, i32 1
  %134 = load i64, ptr %133, align 8, !tbaa !35
  invoke void @_ZNK16VmaBlockMetadata28PrintDetailedMap_UnusedRangeER13VmaJsonWritermm(ptr noundef nonnull align 8 dereferenceable(33) %14, ptr noundef nonnull align 8 dereferenceable(41) %126, i64 noundef %130, i64 noundef %134)
          to label %135 unwind label %94

135:                                              ; preds = %125
  br label %136

136:                                              ; preds = %135, %119
  %137 = load ptr, ptr %4, align 8, !tbaa !5
  invoke void @_ZNK16VmaBlockMetadata20PrintDetailedMap_EndER13VmaJsonWriter(ptr noundef nonnull align 8 dereferenceable(33) %14, ptr noundef nonnull align 8 dereferenceable(41) %137)
          to label %138 unwind label %94

138:                                              ; preds = %136
  call void @llvm.lifetime.end.p0(i64 64, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @_ZN9VmaVectorIPN21VmaBlockMetadata_TLSF5BlockE15VmaStlAllocatorIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #4
  call void @llvm.lifetime.end.p0(i64 32, 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

139:                                              ; preds = %98, %94
  call void @llvm.lifetime.end.p0(i64 64, ptr %12) #4
  br label %140

140:                                              ; preds = %139, %41
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @_ZN9VmaVectorIPN21VmaBlockMetadata_TLSF5BlockE15VmaStlAllocatorIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #4
  call void @llvm.lifetime.end.p0(i64 32, 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
  br label %141

141:                                              ; preds = %140
  %142 = load ptr, ptr %10, align 8
  %143 = load i32, ptr %11, align 4
  %144 = insertvalue { ptr, i32 } poison, ptr %142, 0
  %145 = insertvalue { ptr, i32 } %144, i32 %143, 1
  resume { ptr, i32 } %145
}

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN9VmaVectorIPN21VmaBlockMetadata_TLSF5BlockE15VmaStlAllocatorIS2_EEC2EmRKS4_(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef, ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN9VmaVectorIPN21VmaBlockMetadata_TLSF5BlockE15VmaStlAllocatorIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef) #3 align 2

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL26VmaClearDetailedStatisticsR21VmaDetailedStatistics(ptr noundef nonnull align 8 dereferenceable(64)) #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)) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN9VmaVectorIPN21VmaBlockMetadata_TLSF5BlockE15VmaStlAllocatorIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #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 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 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 = { 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, !12, i64 40}
!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 = !{!10, !12, i64 48}
!20 = !{!12, !12, i64 0}
!21 = !{!10, !6, i64 368}
!22 = !{!23, !6, i64 16}
!23 = !{!"_ZTSN21VmaBlockMetadata_TLSF5BlockE", !12, i64 0, !12, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !7, i64 40}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}
!26 = !{!27, !27, i64 0}
!27 = !{!"vtable pointer", !8, i64 0}
!28 = !{!29, !12, i64 8}
!29 = !{!"_ZTS21VmaDetailedStatistics", !30, i64 0, !14, i64 24, !12, i64 32, !12, i64 40, !12, i64 48, !12, i64 56}
!30 = !{!"_ZTS13VmaStatistics", !14, i64 0, !14, i64 4, !12, i64 8, !12, i64 16}
!31 = !{!29, !12, i64 16}
!32 = !{!29, !14, i64 4}
!33 = !{!29, !14, i64 24}
!34 = !{!23, !12, i64 0}
!35 = !{!23, !12, i64 8}
!36 = distinct !{!36, !25}


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

%struct.VmaStlAllocator.7 = type { ptr }
%class.VmaVector.8 = type { %struct.VmaStlAllocator.7, ptr, i64, i64 }
%struct.VmaDetailedStatistics = type { %struct.VmaStatistics, i32, i64, i64, i64, i64 }
%struct.VmaStatistics = type { i32, i32, i64, i64 }

@.str.2 = external hidden unnamed_addr constant [84 x i8], align 1
@.str.96 = external hidden unnamed_addr constant [7 x i8], align 1
@__PRETTY_FUNCTION__._ZNK21VmaBlockMetadata_TLSF16PrintDetailedMapER13VmaJsonWriter = external hidden unnamed_addr constant [82 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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK16VmaBlockMetadata22PrintDetailedMap_BeginER13VmaJsonWritermmm(ptr noundef nonnull align 8 dereferenceable(33), ptr noundef nonnull align 8 dereferenceable(41), i64 noundef, i64 noundef, i64 noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK16VmaBlockMetadata27PrintDetailedMap_AllocationER13VmaJsonWritermmPv(ptr noundef nonnull align 8 dereferenceable(33), ptr noundef nonnull align 8 dereferenceable(41), i64 noundef, i64 noundef, ptr noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK16VmaBlockMetadata28PrintDetailedMap_UnusedRangeER13VmaJsonWritermm(ptr noundef nonnull align 8 dereferenceable(33), ptr noundef nonnull align 8 dereferenceable(41), i64 noundef, i64 noundef) local_unnamed_addr #2 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK21VmaBlockMetadata_TLSF16PrintDetailedMapER13VmaJsonWriter(ptr noundef nonnull align 8 dereferenceable(400) %0, ptr noundef nonnull align 8 dereferenceable(41) %1) unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %struct.VmaStlAllocator.7, align 8
  %4 = alloca %class.VmaVector.8, align 8
  %5 = alloca %struct.VmaDetailedStatistics, align 8
  %6 = getelementptr inbounds i8, ptr %0, i64 40
  %7 = load i64, ptr %6, align 8, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %0, i64 48
  %9 = load i64, ptr %8, align 8, !tbaa !18
  %10 = add i64 %9, %7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #4
  %11 = tail call noundef ptr @_ZNK16VmaBlockMetadata22GetAllocationCallbacksEv(ptr noundef nonnull align 8 dereferenceable(33) %0)
  call void @_ZN15VmaStlAllocatorIPN21VmaBlockMetadata_TLSF5BlockEEC2EPK21VkAllocationCallbacks(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef %11)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #4
  call void @_ZN9VmaVectorIPN21VmaBlockMetadata_TLSF5BlockE15VmaStlAllocatorIS2_EEC2EmRKS4_(ptr noundef nonnull align 8 dereferenceable(32) %4, i64 noundef %10, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %12 = getelementptr inbounds i8, ptr %0, i64 368
  %13 = load ptr, ptr %12, align 8, !tbaa !19
  %.026.in31 = getelementptr inbounds i8, ptr %13, i64 16
  %.02632 = load ptr, ptr %.026.in31, align 8, !tbaa !20
  %.not33 = icmp eq ptr %.02632, null
  br i1 %.not33, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %2
  %.0.lcssa = phi i64 [ %10, %2 ], [ %15, %.lr.ph ]
  %14 = icmp eq i64 %.0.lcssa, 0
  br i1 %14, label %18, label %17

.lr.ph:                                           ; preds = %2, %.lr.ph
  %.02635 = phi ptr [ %.026, %.lr.ph ], [ %.02632, %2 ]
  %.034 = phi i64 [ %15, %.lr.ph ], [ %10, %2 ]
  %15 = add i64 %.034, -1
  %16 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9VmaVectorIPN21VmaBlockMetadata_TLSF5BlockE15VmaStlAllocatorIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(32) %4, i64 noundef %15)
  store ptr %.02635, ptr %16, align 8, !tbaa !22
  %.026.in = getelementptr inbounds i8, ptr %.02635, i64 16
  %.026 = load ptr, ptr %.026.in, align 8, !tbaa !20
  %.not = icmp eq ptr %.026, null
  br i1 %.not, label %._crit_edge, label %.lr.ph, !llvm.loop !23

17:                                               ; preds = %._crit_edge
  call void @__assert_fail(ptr noundef nonnull @.str.96, ptr noundef nonnull @.str.2, i32 noundef 10308, ptr noundef nonnull @__PRETTY_FUNCTION__._ZNK21VmaBlockMetadata_TLSF16PrintDetailedMapER13VmaJsonWriter) #5
  unreachable

18:                                               ; preds = %._crit_edge
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %5) #4
  invoke void @_ZL26VmaClearDetailedStatisticsR21VmaDetailedStatistics(ptr noundef nonnull align 8 dereferenceable(64) %5)
          to label %19 unwind label %42

19:                                               ; preds = %18
  %20 = load ptr, ptr %0, align 8, !tbaa !25
  %21 = getelementptr inbounds i8, ptr %20, i64 112
  %22 = load ptr, ptr %21, align 8
  invoke void %22(ptr noundef nonnull align 8 dereferenceable(400) %0, ptr noundef nonnull align 8 dereferenceable(64) %5)
          to label %23 unwind label %42

23:                                               ; preds = %19
  %24 = getelementptr inbounds i8, ptr %5, i64 8
  %25 = load i64, ptr %24, align 8, !tbaa !27
  %26 = getelementptr inbounds i8, ptr %5, i64 16
  %27 = load i64, ptr %26, align 8, !tbaa !30
  %28 = sub i64 %25, %27
  %29 = getelementptr inbounds i8, ptr %5, i64 4
  %30 = load i32, ptr %29, align 4, !tbaa !31
  %31 = zext i32 %30 to i64
  %32 = getelementptr inbounds i8, ptr %5, i64 24
  %33 = load i32, ptr %32, align 8, !tbaa !32
  %34 = zext i32 %33 to i64
  invoke void @_ZNK16VmaBlockMetadata22PrintDetailedMap_BeginER13VmaJsonWritermmm(ptr noundef nonnull align 8 dereferenceable(33) %0, ptr noundef nonnull align 8 dereferenceable(41) %1, i64 noundef %28, i64 noundef %31, i64 noundef %34)
          to label %.preheader unwind label %42

.preheader:                                       ; preds = %23
  %.not39 = icmp eq i64 %10, 0
  br i1 %.not39, label %._crit_edge38, label %.lr.ph37

.lr.ph37:                                         ; preds = %.preheader, %49
  %.136 = phi i64 [ %50, %49 ], [ 0, %.preheader ]
  %35 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9VmaVectorIPN21VmaBlockMetadata_TLSF5BlockE15VmaStlAllocatorIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(32) %4, i64 noundef %.136)
  %36 = load ptr, ptr %35, align 8, !tbaa !22
  %37 = call noundef zeroext i1 @_ZNK21VmaBlockMetadata_TLSF5Block6IsFreeEv(ptr noundef nonnull align 8 dereferenceable(48) %36)
  %38 = load i64, ptr %36, align 8, !tbaa !33
  %39 = getelementptr inbounds i8, ptr %36, i64 8
  %40 = load i64, ptr %39, align 8, !tbaa !34
  br i1 %37, label %41, label %46

41:                                               ; preds = %.lr.ph37
  invoke void @_ZNK16VmaBlockMetadata28PrintDetailedMap_UnusedRangeER13VmaJsonWritermm(ptr noundef nonnull align 8 dereferenceable(33) %0, ptr noundef nonnull align 8 dereferenceable(41) %1, i64 noundef %38, i64 noundef %40)
          to label %49 unwind label %44

42:                                               ; preds = %56, %54, %23, %19, %18
  %43 = landingpad { ptr, i32 }
          cleanup
  br label %58

44:                                               ; preds = %46, %41
  %45 = landingpad { ptr, i32 }
          cleanup
  br label %58

46:                                               ; preds = %.lr.ph37
  %47 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN21VmaBlockMetadata_TLSF5Block8UserDataEv(ptr noundef nonnull align 8 dereferenceable(48) %36)
  %48 = load ptr, ptr %47, align 8, !tbaa !22
  invoke void @_ZNK16VmaBlockMetadata27PrintDetailedMap_AllocationER13VmaJsonWritermmPv(ptr noundef nonnull align 8 dereferenceable(33) %0, ptr noundef nonnull align 8 dereferenceable(41) %1, i64 noundef %38, i64 noundef %40, ptr noundef %48)
          to label %49 unwind label %44

49:                                               ; preds = %46, %41
  %50 = add nuw i64 %.136, 1
  %exitcond.not = icmp eq i64 %50, %10
  br i1 %exitcond.not, label %._crit_edge38, label %.lr.ph37, !llvm.loop !35

._crit_edge38:                                    ; preds = %49, %.preheader
  %51 = load ptr, ptr %12, align 8, !tbaa !19
  %52 = getelementptr inbounds i8, ptr %51, i64 8
  %53 = load i64, ptr %52, align 8, !tbaa !34
  %.not28 = icmp eq i64 %53, 0
  br i1 %.not28, label %56, label %54

54:                                               ; preds = %._crit_edge38
  %55 = load i64, ptr %51, align 8, !tbaa !33
  invoke void @_ZNK16VmaBlockMetadata28PrintDetailedMap_UnusedRangeER13VmaJsonWritermm(ptr noundef nonnull align 8 dereferenceable(33) %0, ptr noundef nonnull align 8 dereferenceable(41) %1, i64 noundef %55, i64 noundef %53)
          to label %56 unwind label %42

56:                                               ; preds = %54, %._crit_edge38
  invoke void @_ZNK16VmaBlockMetadata20PrintDetailedMap_EndER13VmaJsonWriter(ptr noundef nonnull align 8 dereferenceable(33) %0, ptr noundef nonnull align 8 dereferenceable(41) %1)
          to label %57 unwind label %42

57:                                               ; preds = %56
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %5) #4
  call void @_ZN9VmaVectorIPN21VmaBlockMetadata_TLSF5BlockE15VmaStlAllocatorIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #4
  ret void

58:                                               ; preds = %44, %42
  %.pn = phi { ptr, i32 } [ %45, %44 ], [ %43, %42 ]
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %5) #4
  call void @_ZN9VmaVectorIPN21VmaBlockMetadata_TLSF5BlockE15VmaStlAllocatorIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #4
  resume { ptr, i32 } %.pn
}

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN9VmaVectorIPN21VmaBlockMetadata_TLSF5BlockE15VmaStlAllocatorIS2_EEC2EmRKS4_(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef, ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN9VmaVectorIPN21VmaBlockMetadata_TLSF5BlockE15VmaStlAllocatorIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef) local_unnamed_addr #3 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN9VmaVectorIPN21VmaBlockMetadata_TLSF5BlockE15VmaStlAllocatorIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #3 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress 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 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 = { 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, !8, i64 40}
!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 = !{!6, !8, i64 48}
!19 = !{!6, !11, i64 368}
!20 = !{!21, !11, i64 16}
!21 = !{!"_ZTSN21VmaBlockMetadata_TLSF5BlockE", !8, i64 0, !8, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !9, i64 40}
!22 = !{!11, !11, i64 0}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}
!25 = !{!26, !26, i64 0}
!26 = !{!"vtable pointer", !10, i64 0}
!27 = !{!28, !8, i64 8}
!28 = !{!"_ZTS21VmaDetailedStatistics", !29, i64 0, !13, i64 24, !8, i64 32, !8, i64 40, !8, i64 48, !8, i64 56}
!29 = !{!"_ZTS13VmaStatistics", !13, i64 0, !13, i64 4, !8, i64 8, !8, i64 16}
!30 = !{!28, !8, i64 16}
!31 = !{!28, !13, i64 4}
!32 = !{!28, !13, i64 24}
!33 = !{!21, !8, i64 0}
!34 = !{!21, !8, i64 8}
!35 = distinct !{!35, !24}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass