; 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.VkImageCreateInfo = type { i32, ptr, i32, i32, i32, %struct.VkExtent3D, i32, i32, i32, i32, i32, i32, i32, ptr, i32 }
%struct.VkExtent3D = type { i32, i32, i32 }
%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.365 = external hidden unnamed_addr constant [54 x i8], align 1
@__PRETTY_FUNCTION__.vmaCreateAliasingImage2 = external hidden unnamed_addr constant [161 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 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_T15BindImageMemoryEP15VmaAllocation_TmP9VkImage_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 @vmaCreateAliasingImage2(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.365, ptr noundef @.str.2, i32 noundef 17516, ptr noundef @__PRETTY_FUNCTION__.vmaCreateAliasingImage2) #4
  unreachable

29:                                               ; No predecessors!
  br label %30

30:                                               ; preds = %29, %27
  %31 = load ptr, ptr %11, align 8, !tbaa !5
  store ptr null, ptr %31, align 8, !tbaa !5
  %32 = load ptr, ptr %10, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.VkImageCreateInfo, ptr %32, i32 0, i32 5
  %34 = getelementptr inbounds %struct.VkExtent3D, ptr %33, i32 0, i32 0
  %35 = load i32, ptr %34, align 4, !tbaa !11
  %36 = icmp eq i32 %35, 0
  br i1 %36, label %59, label %37

37:                                               ; preds = %30
  %38 = load ptr, ptr %10, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.VkImageCreateInfo, ptr %38, i32 0, i32 5
  %40 = getelementptr inbounds %struct.VkExtent3D, ptr %39, i32 0, i32 1
  %41 = load i32, ptr %40, align 4, !tbaa !22
  %42 = icmp eq i32 %41, 0
  br i1 %42, label %59, label %43

43:                                               ; preds = %37
  %44 = load ptr, ptr %10, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.VkImageCreateInfo, ptr %44, i32 0, i32 5
  %46 = getelementptr inbounds %struct.VkExtent3D, ptr %45, i32 0, i32 2
  %47 = load i32, ptr %46, align 4, !tbaa !23
  %48 = icmp eq i32 %47, 0
  br i1 %48, label %59, label %49

49:                                               ; preds = %43
  %50 = load ptr, ptr %10, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.VkImageCreateInfo, ptr %50, i32 0, i32 6
  %52 = load i32, ptr %51, align 8, !tbaa !24
  %53 = icmp eq i32 %52, 0
  br i1 %53, label %59, label %54

54:                                               ; preds = %49
  %55 = load ptr, ptr %10, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.VkImageCreateInfo, ptr %55, i32 0, i32 7
  %57 = load i32, ptr %56, align 4, !tbaa !25
  %58 = icmp eq i32 %57, 0
  br i1 %58, label %59, label %60

59:                                               ; preds = %54, %49, %43, %37, %30
  store i32 -3, ptr %6, align 4
  br label %100

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

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

84:                                               ; preds = %75
  store i32 0, ptr %6, align 4
  store i32 1, ptr %13, align 4
  br label %99

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

97:                                               ; preds = %85, %60
  %98 = load i32, ptr %12, align 4, !tbaa !53
  store i32 %98, ptr %6, align 4
  store i32 1, ptr %13, align 4
  br label %99

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

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

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, !14, i64 28}
!12 = !{!"_ZTS17VkImageCreateInfo", !13, i64 0, !6, i64 8, !14, i64 16, !15, i64 20, !16, i64 24, !17, i64 28, !14, i64 40, !14, i64 44, !18, i64 48, !19, i64 52, !14, i64 56, !20, i64 60, !14, i64 64, !6, i64 72, !21, i64 80}
!13 = !{!"_ZTS15VkStructureType", !7, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = !{!"_ZTS11VkImageType", !7, i64 0}
!16 = !{!"_ZTS8VkFormat", !7, i64 0}
!17 = !{!"_ZTS10VkExtent3D", !14, i64 0, !14, i64 4, !14, i64 8}
!18 = !{!"_ZTS21VkSampleCountFlagBits", !7, i64 0}
!19 = !{!"_ZTS13VkImageTiling", !7, i64 0}
!20 = !{!"_ZTS13VkSharingMode", !7, i64 0}
!21 = !{!"_ZTS13VkImageLayout", !7, i64 0}
!22 = !{!12, !14, i64 32}
!23 = !{!12, !14, i64 36}
!24 = !{!12, !14, i64 40}
!25 = !{!12, !14, i64 44}
!26 = !{!27, !6, i64 128}
!27 = !{!"_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}
!28 = !{!29, !6, i64 16}
!29 = !{!"_ZTS14VmaAllocator_T", !30, i64 0, !14, i64 4, !30, i64 8, !30, i64 9, !30, i64 10, !30, i64 11, !30, i64 12, !30, i64 13, !6, i64 16, !6, i64 24, !30, i64 32, !31, i64 40, !32, i64 88, !33, i64 112, !14, i64 200, !40, i64 208, !45, i64 1032, !7, i64 1552, !7, i64 1808, !46, i64 4624, !47, i64 5456, !10, i64 5464, !6, i64 5472, !47, i64 5480, !47, i64 5484, !7, i64 5488, !49, i64 5616, !52, i64 5672, !14, i64 5696, !27, i64 5704, !14, i64 5912}
!30 = !{!"bool", !7, i64 0}
!31 = !{!"_ZTS21VkAllocationCallbacks", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40}
!32 = !{!"_ZTS24VmaDeviceMemoryCallbacks", !6, i64 0, !6, i64 8, !6, i64 16}
!33 = !{!"_ZTS28VmaAllocationObjectAllocator", !34, i64 0, !37, i64 40}
!34 = !{!"_ZTS8VmaMutex", !35, i64 0}
!35 = !{!"_ZTSSt5mutex", !36, i64 0}
!36 = !{!"_ZTSSt12__mutex_base", !7, i64 0}
!37 = !{!"_ZTS16VmaPoolAllocatorI15VmaAllocation_TE", !6, i64 0, !14, i64 8, !38, i64 16}
!38 = !{!"_ZTS9VmaVectorIN16VmaPoolAllocatorI15VmaAllocation_TE9ItemBlockE15VmaStlAllocatorIS3_EE", !39, i64 0, !6, i64 8, !10, i64 16, !10, i64 24}
!39 = !{!"_ZTS15VmaStlAllocatorIN16VmaPoolAllocatorI15VmaAllocation_TE9ItemBlockEE", !6, i64 0}
!40 = !{!"_ZTS26VkPhysicalDeviceProperties", !14, i64 0, !14, i64 4, !14, i64 8, !14, i64 12, !41, i64 16, !7, i64 20, !7, i64 276, !42, i64 296, !44, i64 800}
!41 = !{!"_ZTS20VkPhysicalDeviceType", !7, i64 0}
!42 = !{!"_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, !43, i64 268, !43, 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, !43, i64 352, !43, 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, !43, i64 424, !14, i64 428, !14, i64 432, !14, i64 436, !14, i64 440, !7, i64 444, !7, i64 452, !43, i64 460, !43, i64 464, !14, i64 468, !14, i64 472, !10, i64 480, !10, i64 488, !10, i64 496}
!43 = !{!"float", !7, i64 0}
!44 = !{!"_ZTS32VkPhysicalDeviceSparseProperties", !14, i64 0, !14, i64 4, !14, i64 8, !14, i64 12, !14, i64 16}
!45 = !{!"_ZTS32VkPhysicalDeviceMemoryProperties", !14, i64 0, !7, i64 4, !14, i64 260, !7, i64 264}
!46 = !{!"_ZTS20VmaCurrentBudgetData", !7, i64 0, !7, i64 64, !7, i64 128, !7, i64 256, !47, i64 384, !49, i64 392, !7, i64 448, !7, i64 576, !7, i64 704}
!47 = !{!"_ZTSSt6atomicIjE", !48, i64 0}
!48 = !{!"_ZTSSt13__atomic_baseIjE", !14, i64 0}
!49 = !{!"_ZTS10VmaRWMutex", !50, i64 0}
!50 = !{!"_ZTSSt12shared_mutex", !51, i64 0}
!51 = !{!"_ZTSSt22__shared_mutex_pthread", !7, i64 0}
!52 = !{!"_ZTS22VmaIntrusiveLinkedListI21VmaPoolListItemTraitsE", !6, i64 0, !6, i64 8, !10, i64 16}
!53 = !{!54, !54, i64 0}
!54 = !{!"_ZTS8VkResult", !7, i64 0}
!55 = !{!27, !6, i64 136}


; 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.365 = external hidden unnamed_addr constant [54 x i8], align 1
@__PRETTY_FUNCTION__.vmaCreateAliasingImage2 = external hidden unnamed_addr constant [161 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 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_T15BindImageMemoryEP15VmaAllocation_TmP9VkImage_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 @vmaCreateAliasingImage2(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.365, ptr noundef nonnull @.str.2, i32 noundef 17516, ptr noundef nonnull @__PRETTY_FUNCTION__.vmaCreateAliasingImage2) #3
  unreachable

13:                                               ; preds = %5
  store ptr null, ptr %4, align 8, !tbaa !5
  %14 = getelementptr inbounds i8, ptr %3, i64 28
  %15 = load i32, ptr %14, align 4, !tbaa !9
  %16 = icmp eq i32 %15, 0
  br i1 %16, label %53, label %17

17:                                               ; preds = %13
  %18 = getelementptr inbounds i8, ptr %3, i64 32
  %19 = load i32, ptr %18, align 4, !tbaa !20
  %20 = icmp eq i32 %19, 0
  br i1 %20, label %53, label %21

21:                                               ; preds = %17
  %22 = getelementptr inbounds i8, ptr %3, i64 36
  %23 = load i32, ptr %22, align 4, !tbaa !21
  %24 = icmp eq i32 %23, 0
  br i1 %24, label %53, label %25

25:                                               ; preds = %21
  %26 = getelementptr inbounds i8, ptr %3, i64 40
  %27 = load i32, ptr %26, align 8, !tbaa !22
  %28 = icmp eq i32 %27, 0
  br i1 %28, label %53, label %29

29:                                               ; preds = %25
  %30 = getelementptr inbounds i8, ptr %3, i64 44
  %31 = load i32, ptr %30, align 4, !tbaa !23
  %32 = icmp eq i32 %31, 0
  br i1 %32, label %53, label %33

33:                                               ; preds = %29
  %34 = tail call noundef nonnull align 8 dereferenceable(208) ptr @_ZNK14VmaAllocator_T18GetVulkanFunctionsEv(ptr noundef nonnull align 8 dereferenceable(5916) %0)
  %35 = getelementptr inbounds i8, ptr %34, i64 128
  %36 = load ptr, ptr %35, align 8, !tbaa !24
  %37 = getelementptr inbounds i8, ptr %0, i64 16
  %38 = load ptr, ptr %37, align 8, !tbaa !26
  %39 = tail call noundef ptr @_ZNK14VmaAllocator_T22GetAllocationCallbacksEv(ptr noundef nonnull align 8 dereferenceable(5916) %0)
  %40 = tail call noundef i32 %36(ptr noundef %38, ptr noundef nonnull %3, ptr noundef %39, ptr noundef nonnull %4)
  %41 = icmp sgt i32 %40, -1
  br i1 %41, label %42, label %53

42:                                               ; preds = %33
  %43 = load ptr, ptr %4, align 8, !tbaa !5
  %44 = tail call noundef i32 @_ZN14VmaAllocator_T15BindImageMemoryEP15VmaAllocation_TmP9VkImage_TPKv(ptr noundef nonnull align 8 dereferenceable(5916) %0, ptr noundef nonnull %1, i64 noundef %2, ptr noundef %43, ptr noundef null)
  %45 = icmp sgt i32 %44, -1
  br i1 %45, label %53, label %46

46:                                               ; preds = %42
  %47 = tail call noundef nonnull align 8 dereferenceable(208) ptr @_ZNK14VmaAllocator_T18GetVulkanFunctionsEv(ptr noundef nonnull align 8 dereferenceable(5916) %0)
  %48 = getelementptr inbounds i8, ptr %47, i64 136
  %49 = load ptr, ptr %48, align 8, !tbaa !52
  %50 = load ptr, ptr %37, align 8, !tbaa !26
  %51 = load ptr, ptr %4, align 8, !tbaa !5
  %52 = tail call noundef ptr @_ZNK14VmaAllocator_T22GetAllocationCallbacksEv(ptr noundef nonnull align 8 dereferenceable(5916) %0)
  tail call void %49(ptr noundef %50, ptr noundef %51, ptr noundef %52)
  br label %53

53:                                               ; preds = %42, %46, %33, %13, %17, %21, %25, %29
  %.1 = phi i32 [ -3, %29 ], [ -3, %25 ], [ -3, %21 ], [ -3, %17 ], [ -3, %13 ], [ 0, %42 ], [ %44, %46 ], [ %40, %33 ]
  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, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !12, i64 28}
!10 = !{!"_ZTS17VkImageCreateInfo", !11, i64 0, !6, i64 8, !12, i64 16, !13, i64 20, !14, i64 24, !15, i64 28, !12, i64 40, !12, i64 44, !16, i64 48, !17, i64 52, !12, i64 56, !18, i64 60, !12, i64 64, !6, i64 72, !19, i64 80}
!11 = !{!"_ZTS15VkStructureType", !7, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!"_ZTS11VkImageType", !7, i64 0}
!14 = !{!"_ZTS8VkFormat", !7, i64 0}
!15 = !{!"_ZTS10VkExtent3D", !12, i64 0, !12, i64 4, !12, i64 8}
!16 = !{!"_ZTS21VkSampleCountFlagBits", !7, i64 0}
!17 = !{!"_ZTS13VkImageTiling", !7, i64 0}
!18 = !{!"_ZTS13VkSharingMode", !7, i64 0}
!19 = !{!"_ZTS13VkImageLayout", !7, i64 0}
!20 = !{!10, !12, i64 32}
!21 = !{!10, !12, i64 36}
!22 = !{!10, !12, i64 40}
!23 = !{!10, !12, i64 44}
!24 = !{!25, !6, i64 128}
!25 = !{!"_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}
!26 = !{!27, !6, i64 16}
!27 = !{!"_ZTS14VmaAllocator_T", !28, i64 0, !12, i64 4, !28, i64 8, !28, i64 9, !28, i64 10, !28, i64 11, !28, i64 12, !28, i64 13, !6, i64 16, !6, i64 24, !28, i64 32, !29, i64 40, !30, i64 88, !31, i64 112, !12, i64 200, !39, i64 208, !44, i64 1032, !7, i64 1552, !7, i64 1808, !45, i64 4624, !46, i64 5456, !38, i64 5464, !6, i64 5472, !46, i64 5480, !46, i64 5484, !7, i64 5488, !48, i64 5616, !51, i64 5672, !12, i64 5696, !25, i64 5704, !12, i64 5912}
!28 = !{!"bool", !7, i64 0}
!29 = !{!"_ZTS21VkAllocationCallbacks", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40}
!30 = !{!"_ZTS24VmaDeviceMemoryCallbacks", !6, i64 0, !6, i64 8, !6, i64 16}
!31 = !{!"_ZTS28VmaAllocationObjectAllocator", !32, i64 0, !35, i64 40}
!32 = !{!"_ZTS8VmaMutex", !33, i64 0}
!33 = !{!"_ZTSSt5mutex", !34, i64 0}
!34 = !{!"_ZTSSt12__mutex_base", !7, i64 0}
!35 = !{!"_ZTS16VmaPoolAllocatorI15VmaAllocation_TE", !6, i64 0, !12, i64 8, !36, i64 16}
!36 = !{!"_ZTS9VmaVectorIN16VmaPoolAllocatorI15VmaAllocation_TE9ItemBlockE15VmaStlAllocatorIS3_EE", !37, i64 0, !6, i64 8, !38, i64 16, !38, i64 24}
!37 = !{!"_ZTS15VmaStlAllocatorIN16VmaPoolAllocatorI15VmaAllocation_TE9ItemBlockEE", !6, i64 0}
!38 = !{!"long", !7, i64 0}
!39 = !{!"_ZTS26VkPhysicalDeviceProperties", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !40, i64 16, !7, i64 20, !7, i64 276, !41, i64 296, !43, i64 800}
!40 = !{!"_ZTS20VkPhysicalDeviceType", !7, i64 0}
!41 = !{!"_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, !38, i64 48, !38, 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, !42, i64 268, !42, i64 272, !12, i64 276, !7, i64 280, !7, i64 288, !12, i64 296, !38, i64 304, !38, i64 312, !38, i64 320, !38, i64 328, !12, i64 336, !12, i64 340, !12, i64 344, !12, i64 348, !42, i64 352, !42, 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, !42, i64 424, !12, i64 428, !12, i64 432, !12, i64 436, !12, i64 440, !7, i64 444, !7, i64 452, !42, i64 460, !42, i64 464, !12, i64 468, !12, i64 472, !38, i64 480, !38, i64 488, !38, i64 496}
!42 = !{!"float", !7, i64 0}
!43 = !{!"_ZTS32VkPhysicalDeviceSparseProperties", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !12, i64 16}
!44 = !{!"_ZTS32VkPhysicalDeviceMemoryProperties", !12, i64 0, !7, i64 4, !12, i64 260, !7, i64 264}
!45 = !{!"_ZTS20VmaCurrentBudgetData", !7, i64 0, !7, i64 64, !7, i64 128, !7, i64 256, !46, i64 384, !48, i64 392, !7, i64 448, !7, i64 576, !7, i64 704}
!46 = !{!"_ZTSSt6atomicIjE", !47, i64 0}
!47 = !{!"_ZTSSt13__atomic_baseIjE", !12, i64 0}
!48 = !{!"_ZTS10VmaRWMutex", !49, i64 0}
!49 = !{!"_ZTSSt12shared_mutex", !50, i64 0}
!50 = !{!"_ZTSSt22__shared_mutex_pthread", !7, i64 0}
!51 = !{!"_ZTS22VmaIntrusiveLinkedListI21VmaPoolListItemTraitsE", !6, i64 0, !6, i64 8, !38, i64 16}
!52 = !{!25, !6, i64 136}


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