; 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.VmaAllocation_T = type <{ %union.anon, i64, i64, ptr, ptr, i32, i8, i8, i8, i8, i32, [4 x i8] }>
%union.anon = type { %"struct.VmaAllocation_T::DedicatedAllocation" }
%"struct.VmaAllocation_T::DedicatedAllocation" = type { ptr, ptr, ptr, ptr, ptr }
%struct.VmaVulkanFunctions = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.VmaAllocator_T = type <{ i8, [3 x i8], i32, i8, i8, i8, i8, i8, i8, [2 x i8], ptr, ptr, i8, [7 x i8], %struct.VkAllocationCallbacks, %struct.VmaDeviceMemoryCallbacks, %class.VmaAllocationObjectAllocator, i32, [4 x i8], %struct.VkPhysicalDeviceProperties, %struct.VkPhysicalDeviceMemoryProperties, [32 x ptr], [32 x %class.VmaDedicatedAllocationList], %struct.VmaCurrentBudgetData, %"struct.std::atomic", [4 x i8], i64, ptr, %"struct.std::atomic", %"struct.std::atomic", [32 x i32], %class.VmaRWMutex, %class.VmaIntrusiveLinkedList.14, i32, [4 x i8], %struct.VmaVulkanFunctions, i32, [4 x i8] }>
%struct.VkAllocationCallbacks = type { ptr, ptr, ptr, ptr, ptr, ptr }
%struct.VmaDeviceMemoryCallbacks = type { ptr, ptr, ptr }
%class.VmaAllocationObjectAllocator = type { %class.VmaMutex, %class.VmaPoolAllocator.11 }
%class.VmaMutex = type { %"class.std::mutex" }
%"class.std::mutex" = type { %"class.std::__mutex_base" }
%"class.std::__mutex_base" = type { %union.pthread_mutex_t }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%class.VmaPoolAllocator.11 = type { ptr, i32, %class.VmaVector.12 }
%class.VmaVector.12 = type { %struct.VmaStlAllocator.13, ptr, i64, i64 }
%struct.VmaStlAllocator.13 = type { ptr }
%struct.VkPhysicalDeviceProperties = type { i32, i32, i32, i32, i32, [256 x i8], [16 x i8], %struct.VkPhysicalDeviceLimits, %struct.VkPhysicalDeviceSparseProperties }
%struct.VkPhysicalDeviceLimits = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i64, i64, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, [3 x i32], i32, [3 x i32], i32, i32, i32, i32, i32, float, float, i32, [2 x i32], [2 x float], i32, i64, i64, i64, i64, i32, i32, i32, i32, float, float, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, float, i32, i32, i32, i32, [2 x float], [2 x float], float, float, i32, i32, i64, i64, i64 }
%struct.VkPhysicalDeviceSparseProperties = type { i32, i32, i32, i32, i32 }
%struct.VkPhysicalDeviceMemoryProperties = type { i32, [32 x %struct.VkMemoryType], i32, [16 x %struct.VkMemoryHeap] }
%struct.VkMemoryType = type { i32, i32 }
%struct.VkMemoryHeap = type { i64, i32 }
%class.VmaDedicatedAllocationList = type { i8, %class.VmaRWMutex, %class.VmaIntrusiveLinkedList }
%class.VmaIntrusiveLinkedList = type { ptr, ptr, i64 }
%struct.VmaCurrentBudgetData = type { [16 x %"struct.std::atomic"], [16 x %"struct.std::atomic"], [16 x %"struct.std::atomic.9"], [16 x %"struct.std::atomic.9"], %"struct.std::atomic", %class.VmaRWMutex, [16 x i64], [16 x i64], [16 x i64] }
%"struct.std::atomic.9" = type { %"struct.std::__atomic_base.10" }
%"struct.std::__atomic_base.10" = type { i64 }
%"struct.std::atomic" = type { %"struct.std::__atomic_base" }
%"struct.std::__atomic_base" = type { i32 }
%class.VmaRWMutex = type { %"class.std::shared_mutex" }
%"class.std::shared_mutex" = type { %"class.std::__shared_mutex_pthread" }
%"class.std::__shared_mutex_pthread" = type { %union.pthread_rwlock_t }
%union.pthread_rwlock_t = type { %struct.__pthread_rwlock_arch_t }
%struct.__pthread_rwlock_arch_t = type { i32, i32, i32, i32, i32, i32, i32, i32, i8, [7 x i8], i64, i32 }
%class.VmaIntrusiveLinkedList.14 = type { ptr, ptr, i64 }

@.str.2 = external hidden unnamed_addr constant [84 x i8], align 1
@.str.160 = external hidden unnamed_addr constant [153 x i8], align 1
@.str.171 = external hidden unnamed_addr constant [39 x i8], align 1
@__PRETTY_FUNCTION__._ZN15VmaAllocation_T17DedicatedAllocMapEP14VmaAllocator_TPPv = external hidden unnamed_addr constant [67 x i8], align 1
@.str.172 = external hidden unnamed_addr constant [47 x i8], align 1
@.str.173 = external hidden unnamed_addr constant [66 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(208) ptr @_ZNK14VmaAllocator_T18GetVulkanFunctionsEv(ptr noundef nonnull align 8 dereferenceable(5916)) #2 align 2

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN15VmaAllocation_T17DedicatedAllocMapEP14VmaAllocator_TPPv(ptr noundef nonnull align 8 dereferenceable(84) %0, ptr noundef %1, ptr noundef %2) #3 align 2 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  %9 = load ptr, ptr %5, align 8
  %10 = call noundef i32 @_ZNK15VmaAllocation_T7GetTypeEv(ptr noundef nonnull align 8 dereferenceable(84) %9)
  %11 = icmp eq i32 %10, 2
  br i1 %11, label %12, label %13

12:                                               ; preds = %3
  br label %15

13:                                               ; preds = %3
  call void @__assert_fail(ptr noundef @.str.171, ptr noundef @.str.2, i32 noundef 12260, ptr noundef @__PRETTY_FUNCTION__._ZN15VmaAllocation_T17DedicatedAllocMapEP14VmaAllocator_TPPv) #4
  unreachable

14:                                               ; No predecessors!
  br label %15

15:                                               ; preds = %14, %12
  %16 = call noundef zeroext i1 @_ZNK15VmaAllocation_T16IsMappingAllowedEv(ptr noundef nonnull align 8 dereferenceable(84) %9)
  br i1 %16, label %17, label %18

17:                                               ; preds = %15
  br label %18

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

20:                                               ; preds = %18
  br label %23

21:                                               ; preds = %18
  call void @__assert_fail(ptr noundef @.str.160, ptr noundef @.str.2, i32 noundef 12261, ptr noundef @__PRETTY_FUNCTION__._ZN15VmaAllocation_T17DedicatedAllocMapEP14VmaAllocator_TPPv) #4
  unreachable

22:                                               ; No predecessors!
  br label %23

23:                                               ; preds = %22, %20
  %24 = getelementptr inbounds %struct.VmaAllocation_T, ptr %9, i32 0, i32 8
  %25 = load i8, ptr %24, align 2, !tbaa !9
  %26 = zext i8 %25 to i32
  %27 = icmp ne i32 %26, 0
  br i1 %27, label %30, label %28

28:                                               ; preds = %23
  %29 = call noundef zeroext i1 @_ZNK15VmaAllocation_T15IsPersistentMapEv(ptr noundef nonnull align 8 dereferenceable(84) %9)
  br i1 %29, label %30, label %52

30:                                               ; preds = %28, %23
  %31 = getelementptr inbounds %struct.VmaAllocation_T, ptr %9, i32 0, i32 8
  %32 = load i8, ptr %31, align 2, !tbaa !9
  %33 = zext i8 %32 to i32
  %34 = icmp slt i32 %33, 255
  br i1 %34, label %35, label %51

35:                                               ; preds = %30
  %36 = getelementptr inbounds %struct.VmaAllocation_T, ptr %9, i32 0, i32 0
  %37 = getelementptr inbounds %"struct.VmaAllocation_T::DedicatedAllocation", ptr %36, i32 0, i32 2
  %38 = load ptr, ptr %37, align 8, !tbaa !13
  %39 = icmp ne ptr %38, null
  br i1 %39, label %40, label %41

40:                                               ; preds = %35
  br label %43

41:                                               ; preds = %35
  call void @__assert_fail(ptr noundef @.str.172, ptr noundef @.str.2, i32 noundef 12267, ptr noundef @__PRETTY_FUNCTION__._ZN15VmaAllocation_T17DedicatedAllocMapEP14VmaAllocator_TPPv) #4
  unreachable

42:                                               ; No predecessors!
  br label %43

43:                                               ; preds = %42, %40
  %44 = getelementptr inbounds %struct.VmaAllocation_T, ptr %9, i32 0, i32 0
  %45 = getelementptr inbounds %"struct.VmaAllocation_T::DedicatedAllocation", ptr %44, i32 0, i32 2
  %46 = load ptr, ptr %45, align 8, !tbaa !13
  %47 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %46, ptr %47, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.VmaAllocation_T, ptr %9, i32 0, i32 8
  %49 = load i8, ptr %48, align 2, !tbaa !9
  %50 = add i8 %49, 1
  store i8 %50, ptr %48, align 2, !tbaa !9
  store i32 0, ptr %4, align 4
  br label %75

51:                                               ; preds = %30
  call void @__assert_fail(ptr noundef @.str.173, ptr noundef @.str.2, i32 noundef 12274, ptr noundef @__PRETTY_FUNCTION__._ZN15VmaAllocation_T17DedicatedAllocMapEP14VmaAllocator_TPPv) #4
  unreachable

52:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  %53 = load ptr, ptr %6, align 8, !tbaa !5
  %54 = call noundef nonnull align 8 dereferenceable(208) ptr @_ZNK14VmaAllocator_T18GetVulkanFunctionsEv(ptr noundef nonnull align 8 dereferenceable(5916) %53)
  %55 = getelementptr inbounds %struct.VmaVulkanFunctions, ptr %54, i32 0, i32 6
  %56 = load ptr, ptr %55, align 8, !tbaa !14
  %57 = load ptr, ptr %6, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.VmaAllocator_T, ptr %57, i32 0, i32 10
  %59 = load ptr, ptr %58, align 8, !tbaa !16
  %60 = getelementptr inbounds %struct.VmaAllocation_T, ptr %9, i32 0, i32 0
  %61 = getelementptr inbounds %"struct.VmaAllocation_T::DedicatedAllocation", ptr %60, i32 0, i32 1
  %62 = load ptr, ptr %61, align 8, !tbaa !13
  %63 = load ptr, ptr %7, align 8, !tbaa !5
  %64 = call noundef i32 %56(ptr noundef %59, ptr noundef %62, i64 noundef 0, i64 noundef -1, i32 noundef 0, ptr noundef %63)
  store i32 %64, ptr %8, align 4, !tbaa !41
  %65 = load i32, ptr %8, align 4, !tbaa !41
  %66 = icmp eq i32 %65, 0
  br i1 %66, label %67, label %73

67:                                               ; preds = %52
  %68 = load ptr, ptr %7, align 8, !tbaa !5
  %69 = load ptr, ptr %68, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.VmaAllocation_T, ptr %9, i32 0, i32 0
  %71 = getelementptr inbounds %"struct.VmaAllocation_T::DedicatedAllocation", ptr %70, i32 0, i32 2
  store ptr %69, ptr %71, align 8, !tbaa !13
  %72 = getelementptr inbounds %struct.VmaAllocation_T, ptr %9, i32 0, i32 8
  store i8 1, ptr %72, align 2, !tbaa !9
  br label %73

73:                                               ; preds = %67, %52
  %74 = load i32, ptr %8, align 4, !tbaa !41
  store i32 %74, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %75

75:                                               ; preds = %73, %43
  %76 = load i32, ptr %4, align 4
  ret i32 %76
}

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, !7, i64 78}
!10 = !{!"_ZTS15VmaAllocation_T", !7, i64 0, !11, i64 40, !11, i64 48, !6, i64 56, !6, i64 64, !12, i64 72, !7, i64 76, !7, i64 77, !7, i64 78, !7, i64 79, !12, i64 80}
!11 = !{!"long", !7, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!7, !7, i64 0}
!14 = !{!15, !6, i64 48}
!15 = !{!"_ZTS18VmaVulkanFunctions", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !6, i64 184, !6, i64 192, !6, i64 200}
!16 = !{!17, !6, i64 16}
!17 = !{!"_ZTS14VmaAllocator_T", !18, i64 0, !12, i64 4, !18, i64 8, !18, i64 9, !18, i64 10, !18, i64 11, !18, i64 12, !18, i64 13, !6, i64 16, !6, i64 24, !18, i64 32, !19, i64 40, !20, i64 88, !21, i64 112, !12, i64 200, !28, i64 208, !33, i64 1032, !7, i64 1552, !7, i64 1808, !34, i64 4624, !35, i64 5456, !11, i64 5464, !6, i64 5472, !35, i64 5480, !35, i64 5484, !7, i64 5488, !37, i64 5616, !40, i64 5672, !12, i64 5696, !15, i64 5704, !12, i64 5912}
!18 = !{!"bool", !7, i64 0}
!19 = !{!"_ZTS21VkAllocationCallbacks", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40}
!20 = !{!"_ZTS24VmaDeviceMemoryCallbacks", !6, i64 0, !6, i64 8, !6, i64 16}
!21 = !{!"_ZTS28VmaAllocationObjectAllocator", !22, i64 0, !25, i64 40}
!22 = !{!"_ZTS8VmaMutex", !23, i64 0}
!23 = !{!"_ZTSSt5mutex", !24, i64 0}
!24 = !{!"_ZTSSt12__mutex_base", !7, i64 0}
!25 = !{!"_ZTS16VmaPoolAllocatorI15VmaAllocation_TE", !6, i64 0, !12, i64 8, !26, i64 16}
!26 = !{!"_ZTS9VmaVectorIN16VmaPoolAllocatorI15VmaAllocation_TE9ItemBlockE15VmaStlAllocatorIS3_EE", !27, i64 0, !6, i64 8, !11, i64 16, !11, i64 24}
!27 = !{!"_ZTS15VmaStlAllocatorIN16VmaPoolAllocatorI15VmaAllocation_TE9ItemBlockEE", !6, i64 0}
!28 = !{!"_ZTS26VkPhysicalDeviceProperties", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !29, i64 16, !7, i64 20, !7, i64 276, !30, i64 296, !32, i64 800}
!29 = !{!"_ZTS20VkPhysicalDeviceType", !7, i64 0}
!30 = !{!"_ZTS22VkPhysicalDeviceLimits", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20, !12, i64 24, !12, i64 28, !12, i64 32, !12, i64 36, !12, i64 40, !11, i64 48, !11, i64 56, !12, i64 64, !12, i64 68, !12, i64 72, !12, i64 76, !12, i64 80, !12, i64 84, !12, i64 88, !12, i64 92, !12, i64 96, !12, i64 100, !12, i64 104, !12, i64 108, !12, i64 112, !12, i64 116, !12, i64 120, !12, i64 124, !12, i64 128, !12, i64 132, !12, i64 136, !12, i64 140, !12, i64 144, !12, i64 148, !12, i64 152, !12, i64 156, !12, i64 160, !12, i64 164, !12, i64 168, !12, i64 172, !12, i64 176, !12, i64 180, !12, i64 184, !12, i64 188, !12, i64 192, !12, i64 196, !12, i64 200, !12, i64 204, !12, i64 208, !12, i64 212, !12, i64 216, !7, i64 220, !12, i64 232, !7, i64 236, !12, i64 248, !12, i64 252, !12, i64 256, !12, i64 260, !12, i64 264, !31, i64 268, !31, i64 272, !12, i64 276, !7, i64 280, !7, i64 288, !12, i64 296, !11, i64 304, !11, i64 312, !11, i64 320, !11, i64 328, !12, i64 336, !12, i64 340, !12, i64 344, !12, i64 348, !31, i64 352, !31, i64 356, !12, i64 360, !12, i64 364, !12, i64 368, !12, i64 372, !12, i64 376, !12, i64 380, !12, i64 384, !12, i64 388, !12, i64 392, !12, i64 396, !12, i64 400, !12, i64 404, !12, i64 408, !12, i64 412, !12, i64 416, !12, i64 420, !31, i64 424, !12, i64 428, !12, i64 432, !12, i64 436, !12, i64 440, !7, i64 444, !7, i64 452, !31, i64 460, !31, i64 464, !12, i64 468, !12, i64 472, !11, i64 480, !11, i64 488, !11, i64 496}
!31 = !{!"float", !7, i64 0}
!32 = !{!"_ZTS32VkPhysicalDeviceSparseProperties", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !12, i64 16}
!33 = !{!"_ZTS32VkPhysicalDeviceMemoryProperties", !12, i64 0, !7, i64 4, !12, i64 260, !7, i64 264}
!34 = !{!"_ZTS20VmaCurrentBudgetData", !7, i64 0, !7, i64 64, !7, i64 128, !7, i64 256, !35, i64 384, !37, i64 392, !7, i64 448, !7, i64 576, !7, i64 704}
!35 = !{!"_ZTSSt6atomicIjE", !36, i64 0}
!36 = !{!"_ZTSSt13__atomic_baseIjE", !12, i64 0}
!37 = !{!"_ZTS10VmaRWMutex", !38, i64 0}
!38 = !{!"_ZTSSt12shared_mutex", !39, i64 0}
!39 = !{!"_ZTSSt22__shared_mutex_pthread", !7, i64 0}
!40 = !{!"_ZTS22VmaIntrusiveLinkedListI21VmaPoolListItemTraitsE", !6, i64 0, !6, i64 8, !11, i64 16}
!41 = !{!42, !42, i64 0}
!42 = !{!"_ZTS8VkResult", !7, i64 0}


; 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.160 = external hidden unnamed_addr constant [153 x i8], align 1
@.str.171 = external hidden unnamed_addr constant [39 x i8], align 1
@__PRETTY_FUNCTION__._ZN15VmaAllocation_T17DedicatedAllocMapEP14VmaAllocator_TPPv = external hidden unnamed_addr constant [67 x i8], align 1
@.str.172 = external hidden unnamed_addr constant [47 x i8], align 1
@.str.173 = external hidden unnamed_addr constant [66 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(208) ptr @_ZNK14VmaAllocator_T18GetVulkanFunctionsEv(ptr noundef nonnull align 8 dereferenceable(5916)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK15VmaAllocation_T7GetTypeEv(ptr noundef nonnull align 8 dereferenceable(84)) local_unnamed_addr #1 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN15VmaAllocation_T17DedicatedAllocMapEP14VmaAllocator_TPPv(ptr noundef nonnull align 8 dereferenceable(84) %0, ptr noundef %1, ptr noundef %2) local_unnamed_addr #2 align 2 {
  %4 = tail call noundef i32 @_ZNK15VmaAllocation_T7GetTypeEv(ptr noundef nonnull align 8 dereferenceable(84) %0)
  %5 = icmp eq i32 %4, 2
  br i1 %5, label %7, label %6

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

7:                                                ; preds = %3
  %8 = tail call noundef zeroext i1 @_ZNK15VmaAllocation_T16IsMappingAllowedEv(ptr noundef nonnull align 8 dereferenceable(84) %0)
  br i1 %8, label %10, label %9

9:                                                ; preds = %7
  tail call void @__assert_fail(ptr noundef nonnull @.str.160, ptr noundef nonnull @.str.2, i32 noundef 12261, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN15VmaAllocation_T17DedicatedAllocMapEP14VmaAllocator_TPPv) #3
  unreachable

10:                                               ; preds = %7
  %11 = getelementptr inbounds i8, ptr %0, i64 78
  %12 = load i8, ptr %11, align 2, !tbaa !5
  %.not = icmp eq i8 %12, 0
  br i1 %.not, label %13, label %15

13:                                               ; preds = %10
  %14 = tail call noundef zeroext i1 @_ZNK15VmaAllocation_T15IsPersistentMapEv(ptr noundef nonnull align 8 dereferenceable(84) %0)
  br i1 %14, label %thread-pre-split, label %24

thread-pre-split:                                 ; preds = %13
  %.pr = load i8, ptr %11, align 2, !tbaa !5
  br label %15

15:                                               ; preds = %thread-pre-split, %10
  %16 = phi i8 [ %.pr, %thread-pre-split ], [ %12, %10 ]
  %.not9 = icmp eq i8 %16, -1
  br i1 %.not9, label %23, label %17

17:                                               ; preds = %15
  %18 = getelementptr inbounds i8, ptr %0, i64 16
  %19 = load ptr, ptr %18, align 8, !tbaa !12
  %.not10 = icmp eq ptr %19, null
  br i1 %.not10, label %20, label %21

20:                                               ; preds = %17
  tail call void @__assert_fail(ptr noundef nonnull @.str.172, ptr noundef nonnull @.str.2, i32 noundef 12267, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN15VmaAllocation_T17DedicatedAllocMapEP14VmaAllocator_TPPv) #3
  unreachable

21:                                               ; preds = %17
  store ptr %19, ptr %2, align 8, !tbaa !13
  %22 = add nuw i8 %16, 1
  br label %.sink.split

23:                                               ; preds = %15
  tail call void @__assert_fail(ptr noundef nonnull @.str.173, ptr noundef nonnull @.str.2, i32 noundef 12274, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN15VmaAllocation_T17DedicatedAllocMapEP14VmaAllocator_TPPv) #3
  unreachable

24:                                               ; preds = %13
  %25 = tail call noundef nonnull align 8 dereferenceable(208) ptr @_ZNK14VmaAllocator_T18GetVulkanFunctionsEv(ptr noundef nonnull align 8 dereferenceable(5916) %1)
  %26 = getelementptr inbounds i8, ptr %25, i64 48
  %27 = load ptr, ptr %26, align 8, !tbaa !14
  %28 = getelementptr inbounds i8, ptr %1, i64 16
  %29 = load ptr, ptr %28, align 8, !tbaa !16
  %30 = getelementptr inbounds i8, ptr %0, i64 8
  %31 = load ptr, ptr %30, align 8, !tbaa !12
  %32 = tail call noundef i32 %27(ptr noundef %29, ptr noundef %31, i64 noundef 0, i64 noundef -1, i32 noundef 0, ptr noundef %2)
  %33 = icmp eq i32 %32, 0
  br i1 %33, label %34, label %37

34:                                               ; preds = %24
  %35 = load ptr, ptr %2, align 8, !tbaa !13
  %36 = getelementptr inbounds i8, ptr %0, i64 16
  store ptr %35, ptr %36, align 8, !tbaa !12
  br label %.sink.split

.sink.split:                                      ; preds = %21, %34
  %.sink = phi i8 [ 1, %34 ], [ %22, %21 ]
  store i8 %.sink, ptr %11, align 2, !tbaa !5
  br label %37

37:                                               ; preds = %.sink.split, %24
  %.0 = phi i32 [ %32, %24 ], [ 0, %.sink.split ]
  ret i32 %.0
}

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, !7, i64 78}
!6 = !{!"_ZTS15VmaAllocation_T", !7, i64 0, !9, i64 40, !9, i64 48, !10, i64 56, !10, i64 64, !11, i64 72, !7, i64 76, !7, i64 77, !7, i64 78, !7, i64 79, !11, i64 80}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!"long", !7, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!"int", !7, i64 0}
!12 = !{!7, !7, i64 0}
!13 = !{!10, !10, i64 0}
!14 = !{!15, !10, i64 48}
!15 = !{!"_ZTS18VmaVulkanFunctions", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !10, i64 72, !10, i64 80, !10, i64 88, !10, i64 96, !10, i64 104, !10, i64 112, !10, i64 120, !10, i64 128, !10, i64 136, !10, i64 144, !10, i64 152, !10, i64 160, !10, i64 168, !10, i64 176, !10, i64 184, !10, i64 192, !10, i64 200}
!16 = !{!17, !10, i64 16}
!17 = !{!"_ZTS14VmaAllocator_T", !18, i64 0, !11, i64 4, !18, i64 8, !18, i64 9, !18, i64 10, !18, i64 11, !18, i64 12, !18, i64 13, !10, i64 16, !10, i64 24, !18, i64 32, !19, i64 40, !20, i64 88, !21, i64 112, !11, i64 200, !28, i64 208, !33, i64 1032, !7, i64 1552, !7, i64 1808, !34, i64 4624, !35, i64 5456, !9, i64 5464, !10, i64 5472, !35, i64 5480, !35, i64 5484, !7, i64 5488, !37, i64 5616, !40, i64 5672, !11, i64 5696, !15, i64 5704, !11, i64 5912}
!18 = !{!"bool", !7, i64 0}
!19 = !{!"_ZTS21VkAllocationCallbacks", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40}
!20 = !{!"_ZTS24VmaDeviceMemoryCallbacks", !10, i64 0, !10, i64 8, !10, i64 16}
!21 = !{!"_ZTS28VmaAllocationObjectAllocator", !22, i64 0, !25, i64 40}
!22 = !{!"_ZTS8VmaMutex", !23, i64 0}
!23 = !{!"_ZTSSt5mutex", !24, i64 0}
!24 = !{!"_ZTSSt12__mutex_base", !7, i64 0}
!25 = !{!"_ZTS16VmaPoolAllocatorI15VmaAllocation_TE", !10, i64 0, !11, i64 8, !26, i64 16}
!26 = !{!"_ZTS9VmaVectorIN16VmaPoolAllocatorI15VmaAllocation_TE9ItemBlockE15VmaStlAllocatorIS3_EE", !27, i64 0, !10, i64 8, !9, i64 16, !9, i64 24}
!27 = !{!"_ZTS15VmaStlAllocatorIN16VmaPoolAllocatorI15VmaAllocation_TE9ItemBlockEE", !10, i64 0}
!28 = !{!"_ZTS26VkPhysicalDeviceProperties", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !29, i64 16, !7, i64 20, !7, i64 276, !30, i64 296, !32, i64 800}
!29 = !{!"_ZTS20VkPhysicalDeviceType", !7, i64 0}
!30 = !{!"_ZTS22VkPhysicalDeviceLimits", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !11, i64 40, !9, i64 48, !9, i64 56, !11, i64 64, !11, i64 68, !11, i64 72, !11, i64 76, !11, i64 80, !11, i64 84, !11, i64 88, !11, i64 92, !11, i64 96, !11, i64 100, !11, i64 104, !11, i64 108, !11, i64 112, !11, i64 116, !11, i64 120, !11, i64 124, !11, i64 128, !11, i64 132, !11, i64 136, !11, i64 140, !11, i64 144, !11, i64 148, !11, i64 152, !11, i64 156, !11, i64 160, !11, i64 164, !11, i64 168, !11, i64 172, !11, i64 176, !11, i64 180, !11, i64 184, !11, i64 188, !11, i64 192, !11, i64 196, !11, i64 200, !11, i64 204, !11, i64 208, !11, i64 212, !11, i64 216, !7, i64 220, !11, i64 232, !7, i64 236, !11, i64 248, !11, i64 252, !11, i64 256, !11, i64 260, !11, i64 264, !31, i64 268, !31, i64 272, !11, i64 276, !7, i64 280, !7, i64 288, !11, i64 296, !9, i64 304, !9, i64 312, !9, i64 320, !9, i64 328, !11, i64 336, !11, i64 340, !11, i64 344, !11, i64 348, !31, i64 352, !31, i64 356, !11, i64 360, !11, i64 364, !11, i64 368, !11, i64 372, !11, i64 376, !11, i64 380, !11, i64 384, !11, i64 388, !11, i64 392, !11, i64 396, !11, i64 400, !11, i64 404, !11, i64 408, !11, i64 412, !11, i64 416, !11, i64 420, !31, i64 424, !11, i64 428, !11, i64 432, !11, i64 436, !11, i64 440, !7, i64 444, !7, i64 452, !31, i64 460, !31, i64 464, !11, i64 468, !11, i64 472, !9, i64 480, !9, i64 488, !9, i64 496}
!31 = !{!"float", !7, i64 0}
!32 = !{!"_ZTS32VkPhysicalDeviceSparseProperties", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16}
!33 = !{!"_ZTS32VkPhysicalDeviceMemoryProperties", !11, i64 0, !7, i64 4, !11, i64 260, !7, i64 264}
!34 = !{!"_ZTS20VmaCurrentBudgetData", !7, i64 0, !7, i64 64, !7, i64 128, !7, i64 256, !35, i64 384, !37, i64 392, !7, i64 448, !7, i64 576, !7, i64 704}
!35 = !{!"_ZTSSt6atomicIjE", !36, i64 0}
!36 = !{!"_ZTSSt13__atomic_baseIjE", !11, i64 0}
!37 = !{!"_ZTS10VmaRWMutex", !38, i64 0}
!38 = !{!"_ZTSSt12shared_mutex", !39, i64 0}
!39 = !{!"_ZTSSt22__shared_mutex_pthread", !7, i64 0}
!40 = !{!"_ZTS22VmaIntrusiveLinkedListI21VmaPoolListItemTraitsE", !10, i64 0, !10, i64 8, !9, i64 16}


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