; 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.VkBufferCreateInfo = type { i32, ptr, i32, i64, i32, i32, i32, 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 }
%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 }

@.str.2 = external hidden unnamed_addr constant [84 x i8], align 1
@.str.360 = external hidden unnamed_addr constant [149 x i8], align 1
@.str.362 = external hidden unnamed_addr constant [56 x i8], align 1
@__PRETTY_FUNCTION__.vmaCreateAliasingBuffer2 = external hidden unnamed_addr constant [164 x i8], align 1
@.str.363 = external hidden unnamed_addr constant [73 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 i64 @_ZNK15VmaAllocation_T7GetSizeEv(ptr noundef nonnull align 8 dereferenceable(84)) #2 align 2

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

; 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 uwtable
declare dso_local noundef i32 @_ZN14VmaAllocator_T16BindBufferMemoryEP15VmaAllocation_TmP10VkBuffer_TPKv(ptr noundef nonnull align 8 dereferenceable(5916), ptr noundef, i64 noundef, ptr noundef, ptr noundef) #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local i32 @vmaCreateAliasingBuffer2(ptr noundef %0, ptr noundef %1, i64 noundef %2, ptr noundef %3, ptr noundef %4) #3 {
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i64, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  store i64 %2, ptr %9, align 8, !tbaa !9
  store ptr %3, ptr %10, align 8, !tbaa !5
  store ptr %4, ptr %11, align 8, !tbaa !5
  %14 = load ptr, ptr %7, align 8, !tbaa !5
  %15 = icmp ne ptr %14, null
  br i1 %15, label %16, label %25

16:                                               ; preds = %5
  %17 = load ptr, ptr %10, align 8, !tbaa !5
  %18 = icmp ne ptr %17, null
  br i1 %18, label %19, label %25

19:                                               ; preds = %16
  %20 = load ptr, ptr %11, align 8, !tbaa !5
  %21 = icmp ne ptr %20, null
  br i1 %21, label %22, label %25

22:                                               ; preds = %19
  %23 = load ptr, ptr %8, align 8, !tbaa !5
  %24 = icmp ne ptr %23, null
  br label %25

25:                                               ; preds = %22, %19, %16, %5
  %26 = phi i1 [ false, %19 ], [ false, %16 ], [ false, %5 ], [ %24, %22 ]
  br i1 %26, label %27, label %28

27:                                               ; preds = %25
  br label %30

28:                                               ; preds = %25
  call void @__assert_fail(ptr noundef @.str.362, ptr noundef @.str.2, i32 noundef 17340, ptr noundef @__PRETTY_FUNCTION__.vmaCreateAliasingBuffer2) #4
  unreachable

29:                                               ; No predecessors!
  br label %30

30:                                               ; preds = %29, %27
  %31 = load i64, ptr %9, align 8, !tbaa !9
  %32 = load ptr, ptr %10, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.VkBufferCreateInfo, ptr %32, i32 0, i32 3
  %34 = load i64, ptr %33, align 8, !tbaa !11
  %35 = add i64 %31, %34
  %36 = load ptr, ptr %8, align 8, !tbaa !5
  %37 = call noundef i64 @_ZNK15VmaAllocation_T7GetSizeEv(ptr noundef nonnull align 8 dereferenceable(84) %36)
  %38 = icmp ule i64 %35, %37
  br i1 %38, label %39, label %40

39:                                               ; preds = %30
  br label %42

40:                                               ; preds = %30
  call void @__assert_fail(ptr noundef @.str.363, ptr noundef @.str.2, i32 noundef 17341, ptr noundef @__PRETTY_FUNCTION__.vmaCreateAliasingBuffer2) #4
  unreachable

41:                                               ; No predecessors!
  br label %42

42:                                               ; preds = %41, %39
  %43 = load ptr, ptr %11, align 8, !tbaa !5
  store ptr null, ptr %43, align 8, !tbaa !5
  %44 = load ptr, ptr %10, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.VkBufferCreateInfo, ptr %44, i32 0, i32 3
  %46 = load i64, ptr %45, align 8, !tbaa !11
  %47 = icmp eq i64 %46, 0
  br i1 %47, label %48, label %49

48:                                               ; preds = %42
  store i32 -3, ptr %6, align 4
  br label %101

49:                                               ; preds = %42
  %50 = load ptr, ptr %10, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.VkBufferCreateInfo, ptr %50, i32 0, i32 4
  %52 = load i32, ptr %51, align 8, !tbaa !16
  %53 = and i32 %52, 131072
  %54 = icmp ne i32 %53, 0
  br i1 %54, label %55, label %61

55:                                               ; preds = %49
  %56 = load ptr, ptr %7, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.VmaAllocator_T, ptr %56, i32 0, i32 7
  %58 = load i8, ptr %57, align 4, !tbaa !17, !range !43, !noundef !44
  %59 = trunc i8 %58 to i1
  br i1 %59, label %61, label %60

60:                                               ; preds = %55
  call void @__assert_fail(ptr noundef @.str.360, ptr noundef @.str.2, i32 noundef 17354, ptr noundef @__PRETTY_FUNCTION__.vmaCreateAliasingBuffer2) #4
  unreachable

61:                                               ; preds = %55, %49
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  %62 = load ptr, ptr %7, align 8, !tbaa !5
  %63 = call noundef nonnull align 8 dereferenceable(208) ptr @_ZNK14VmaAllocator_T18GetVulkanFunctionsEv(ptr noundef nonnull align 8 dereferenceable(5916) %62)
  %64 = getelementptr inbounds %struct.VmaVulkanFunctions, ptr %63, i32 0, i32 14
  %65 = load ptr, ptr %64, align 8, !tbaa !45
  %66 = load ptr, ptr %7, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.VmaAllocator_T, ptr %66, i32 0, i32 10
  %68 = load ptr, ptr %67, align 8, !tbaa !46
  %69 = load ptr, ptr %10, align 8, !tbaa !5
  %70 = load ptr, ptr %7, align 8, !tbaa !5
  %71 = call noundef ptr @_ZNK14VmaAllocator_T22GetAllocationCallbacksEv(ptr noundef nonnull align 8 dereferenceable(5916) %70)
  %72 = load ptr, ptr %11, align 8, !tbaa !5
  %73 = call noundef i32 %65(ptr noundef %68, ptr noundef %69, ptr noundef %71, ptr noundef %72)
  store i32 %73, ptr %12, align 4, !tbaa !47
  %74 = load i32, ptr %12, align 4, !tbaa !47
  %75 = icmp sge i32 %74, 0
  br i1 %75, label %76, label %98

76:                                               ; preds = %61
  %77 = load ptr, ptr %7, align 8, !tbaa !5
  %78 = load ptr, ptr %8, align 8, !tbaa !5
  %79 = load i64, ptr %9, align 8, !tbaa !9
  %80 = load ptr, ptr %11, align 8, !tbaa !5
  %81 = load ptr, ptr %80, align 8, !tbaa !5
  %82 = call noundef i32 @_ZN14VmaAllocator_T16BindBufferMemoryEP15VmaAllocation_TmP10VkBuffer_TPKv(ptr noundef nonnull align 8 dereferenceable(5916) %77, ptr noundef %78, i64 noundef %79, ptr noundef %81, ptr noundef null)
  store i32 %82, ptr %12, align 4, !tbaa !47
  %83 = load i32, ptr %12, align 4, !tbaa !47
  %84 = icmp sge i32 %83, 0
  br i1 %84, label %85, label %86

85:                                               ; preds = %76
  store i32 0, ptr %6, align 4
  store i32 1, ptr %13, align 4
  br label %100

86:                                               ; preds = %76
  %87 = load ptr, ptr %7, align 8, !tbaa !5
  %88 = call noundef nonnull align 8 dereferenceable(208) ptr @_ZNK14VmaAllocator_T18GetVulkanFunctionsEv(ptr noundef nonnull align 8 dereferenceable(5916) %87)
  %89 = getelementptr inbounds %struct.VmaVulkanFunctions, ptr %88, i32 0, i32 15
  %90 = load ptr, ptr %89, align 8, !tbaa !49
  %91 = load ptr, ptr %7, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.VmaAllocator_T, ptr %91, i32 0, i32 10
  %93 = load ptr, ptr %92, align 8, !tbaa !46
  %94 = load ptr, ptr %11, align 8, !tbaa !5
  %95 = load ptr, ptr %94, align 8, !tbaa !5
  %96 = load ptr, ptr %7, align 8, !tbaa !5
  %97 = call noundef ptr @_ZNK14VmaAllocator_T22GetAllocationCallbacksEv(ptr noundef nonnull align 8 dereferenceable(5916) %96)
  call void %90(ptr noundef %93, ptr noundef %95, ptr noundef %97)
  br label %98

98:                                               ; preds = %86, %61
  %99 = load i32, ptr %12, align 4, !tbaa !47
  store i32 %99, ptr %6, align 4
  store i32 1, ptr %13, align 4
  br label %100

100:                                              ; preds = %98, %85
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %101

101:                                              ; preds = %100, %48
  %102 = load i32, ptr %6, align 4
  ret i32 %102
}

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


; 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.360 = external hidden unnamed_addr constant [149 x i8], align 1
@.str.362 = external hidden unnamed_addr constant [56 x i8], align 1
@__PRETTY_FUNCTION__.vmaCreateAliasingBuffer2 = external hidden unnamed_addr constant [164 x i8], align 1
@.str.363 = external hidden unnamed_addr constant [73 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 i64 @_ZNK15VmaAllocation_T7GetSizeEv(ptr noundef nonnull align 8 dereferenceable(84)) local_unnamed_addr #1 align 2

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

; 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 uwtable
declare dso_local noundef i32 @_ZN14VmaAllocator_T16BindBufferMemoryEP15VmaAllocation_TmP10VkBuffer_TPKv(ptr noundef nonnull align 8 dereferenceable(5916), ptr noundef, i64 noundef, ptr noundef, ptr noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local range(i32 -2147483648, 1) i32 @vmaCreateAliasingBuffer2(ptr noundef %0, ptr noundef %1, i64 noundef %2, ptr noundef %3, ptr noundef %4) local_unnamed_addr #2 {
  %6 = insertelement <4 x ptr> poison, ptr %0, i64 0
  %7 = insertelement <4 x ptr> %6, ptr %3, i64 1
  %8 = insertelement <4 x ptr> %7, ptr %4, i64 2
  %9 = insertelement <4 x ptr> %8, ptr %1, i64 3
  %10 = icmp eq <4 x ptr> %9, zeroinitializer
  %11 = bitcast <4 x i1> %10 to i4
  %12 = icmp eq i4 %11, 0
  br i1 %12, label %13, label %.critedge

.critedge:                                        ; preds = %5
  tail call void @__assert_fail(ptr noundef nonnull @.str.362, ptr noundef nonnull @.str.2, i32 noundef 17340, ptr noundef nonnull @__PRETTY_FUNCTION__.vmaCreateAliasingBuffer2) #3
  unreachable

13:                                               ; preds = %5
  %14 = getelementptr inbounds i8, ptr %3, i64 24
  %15 = load i64, ptr %14, align 8, !tbaa !5
  %16 = add i64 %15, %2
  %17 = tail call noundef i64 @_ZNK15VmaAllocation_T7GetSizeEv(ptr noundef nonnull align 8 dereferenceable(84) %1)
  %.not = icmp ugt i64 %16, %17
  br i1 %.not, label %18, label %19

18:                                               ; preds = %13
  tail call void @__assert_fail(ptr noundef nonnull @.str.363, ptr noundef nonnull @.str.2, i32 noundef 17341, ptr noundef nonnull @__PRETTY_FUNCTION__.vmaCreateAliasingBuffer2) #3
  unreachable

19:                                               ; preds = %13
  store ptr null, ptr %4, align 8, !tbaa !14
  %20 = load i64, ptr %14, align 8, !tbaa !5
  %21 = icmp eq i64 %20, 0
  br i1 %21, label %51, label %22

22:                                               ; preds = %19
  %23 = getelementptr inbounds i8, ptr %3, i64 32
  %24 = load i32, ptr %23, align 8, !tbaa !15
  %25 = and i32 %24, 131072
  %.not39 = icmp eq i32 %25, 0
  br i1 %.not39, label %31, label %26

26:                                               ; preds = %22
  %27 = getelementptr inbounds i8, ptr %0, i64 12
  %28 = load i8, ptr %27, align 4, !tbaa !16, !range !42, !noundef !43
  %29 = trunc nuw i8 %28 to i1
  br i1 %29, label %31, label %30

30:                                               ; preds = %26
  tail call void @__assert_fail(ptr noundef nonnull @.str.360, ptr noundef nonnull @.str.2, i32 noundef 17354, ptr noundef nonnull @__PRETTY_FUNCTION__.vmaCreateAliasingBuffer2) #3
  unreachable

31:                                               ; preds = %26, %22
  %32 = tail call noundef nonnull align 8 dereferenceable(208) ptr @_ZNK14VmaAllocator_T18GetVulkanFunctionsEv(ptr noundef nonnull align 8 dereferenceable(5916) %0)
  %33 = getelementptr inbounds i8, ptr %32, i64 112
  %34 = load ptr, ptr %33, align 8, !tbaa !44
  %35 = getelementptr inbounds i8, ptr %0, i64 16
  %36 = load ptr, ptr %35, align 8, !tbaa !45
  %37 = tail call noundef ptr @_ZNK14VmaAllocator_T22GetAllocationCallbacksEv(ptr noundef nonnull align 8 dereferenceable(5916) %0)
  %38 = tail call noundef i32 %34(ptr noundef %36, ptr noundef nonnull %3, ptr noundef %37, ptr noundef nonnull %4)
  %39 = icmp sgt i32 %38, -1
  br i1 %39, label %40, label %51

40:                                               ; preds = %31
  %41 = load ptr, ptr %4, align 8, !tbaa !14
  %42 = tail call noundef i32 @_ZN14VmaAllocator_T16BindBufferMemoryEP15VmaAllocation_TmP10VkBuffer_TPKv(ptr noundef nonnull align 8 dereferenceable(5916) %0, ptr noundef nonnull %1, i64 noundef %2, ptr noundef %41, ptr noundef null)
  %43 = icmp sgt i32 %42, -1
  br i1 %43, label %51, label %44

44:                                               ; preds = %40
  %45 = tail call noundef nonnull align 8 dereferenceable(208) ptr @_ZNK14VmaAllocator_T18GetVulkanFunctionsEv(ptr noundef nonnull align 8 dereferenceable(5916) %0)
  %46 = getelementptr inbounds i8, ptr %45, i64 120
  %47 = load ptr, ptr %46, align 8, !tbaa !46
  %48 = load ptr, ptr %35, align 8, !tbaa !45
  %49 = load ptr, ptr %4, align 8, !tbaa !14
  %50 = tail call noundef ptr @_ZNK14VmaAllocator_T22GetAllocationCallbacksEv(ptr noundef nonnull align 8 dereferenceable(5916) %0)
  tail call void %47(ptr noundef %48, ptr noundef %49, ptr noundef %50)
  br label %51

51:                                               ; preds = %40, %44, %31, %19
  %.1 = phi i32 [ -3, %19 ], [ 0, %40 ], [ %42, %44 ], [ %38, %31 ]
  ret i32 %.1
}

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, !12, i64 24}
!6 = !{!"_ZTS18VkBufferCreateInfo", !7, i64 0, !10, i64 8, !11, i64 16, !12, i64 24, !11, i64 32, !13, i64 36, !11, i64 40, !10, i64 48}
!7 = !{!"_ZTS15VkStructureType", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"int", !8, i64 0}
!12 = !{!"long", !8, i64 0}
!13 = !{!"_ZTS13VkSharingMode", !8, i64 0}
!14 = !{!10, !10, i64 0}
!15 = !{!6, !11, i64 32}
!16 = !{!17, !18, i64 12}
!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, !8, i64 1552, !8, i64 1808, !34, i64 4624, !35, i64 5456, !12, i64 5464, !10, i64 5472, !35, i64 5480, !35, i64 5484, !8, i64 5488, !37, i64 5616, !40, i64 5672, !11, i64 5696, !41, i64 5704, !11, i64 5912}
!18 = !{!"bool", !8, 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", !8, i64 0}
!25 = !{!"_ZTS16VmaPoolAllocatorI15VmaAllocation_TE", !10, i64 0, !11, i64 8, !26, i64 16}
!26 = !{!"_ZTS9VmaVectorIN16VmaPoolAllocatorI15VmaAllocation_TE9ItemBlockE15VmaStlAllocatorIS3_EE", !27, i64 0, !10, i64 8, !12, i64 16, !12, 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, !8, i64 20, !8, i64 276, !30, i64 296, !32, i64 800}
!29 = !{!"_ZTS20VkPhysicalDeviceType", !8, 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, !12, i64 48, !12, 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, !8, i64 220, !11, i64 232, !8, 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, !8, i64 280, !8, i64 288, !11, i64 296, !12, i64 304, !12, i64 312, !12, i64 320, !12, 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, !8, i64 444, !8, i64 452, !31, i64 460, !31, i64 464, !11, i64 468, !11, i64 472, !12, i64 480, !12, i64 488, !12, i64 496}
!31 = !{!"float", !8, i64 0}
!32 = !{!"_ZTS32VkPhysicalDeviceSparseProperties", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16}
!33 = !{!"_ZTS32VkPhysicalDeviceMemoryProperties", !11, i64 0, !8, i64 4, !11, i64 260, !8, i64 264}
!34 = !{!"_ZTS20VmaCurrentBudgetData", !8, i64 0, !8, i64 64, !8, i64 128, !8, i64 256, !35, i64 384, !37, i64 392, !8, i64 448, !8, i64 576, !8, 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", !8, i64 0}
!40 = !{!"_ZTS22VmaIntrusiveLinkedListI21VmaPoolListItemTraitsE", !10, i64 0, !10, i64 8, !12, i64 16}
!41 = !{!"_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}
!42 = !{i8 0, i8 2}
!43 = !{}
!44 = !{!41, !10, i64 112}
!45 = !{!17, !10, i64 16}
!46 = !{!41, !10, i64 120}


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