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

; 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.VkSurfaceFormatKHR = type { i32, i32 }
%struct.VkExtent2D = type { i32, i32 }
%struct.VkSwapchainCreateInfoKHR = type { i32, ptr, i32, ptr, i32, i32, i32, %struct.VkExtent2D, i32, i32, i32, i32, ptr, i32, i32, i32, i32, ptr }
%class.PresentationManager = type { ptr, ptr, ptr, ptr, %struct.QueueFamilyIndices, ptr, i32, %struct.VkExtent2D, %"class.std::vector.0", i8, %"class.std::vector.5", %"class.std::vector.10", %struct.SwapChainSupportDetails }
%struct.QueueFamilyIndices = type { %"class.std::optional", %"class.std::optional" }
%"class.std::optional" = type { %"struct.std::_Optional_base" }
%"struct.std::_Optional_base" = type { %"struct.std::_Optional_payload" }
%"struct.std::_Optional_payload" = type { %"struct.std::_Optional_payload_base.base", [3 x i8] }
%"struct.std::_Optional_payload_base.base" = type <{ %"union.std::_Optional_payload_base<unsigned int>::_Storage", i8 }>
%"union.std::_Optional_payload_base<unsigned int>::_Storage" = type { i32 }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<VkFramebuffer_T *, std::allocator<VkFramebuffer_T *>>::_Vector_impl" }
%"struct.std::_Vector_base<VkFramebuffer_T *, std::allocator<VkFramebuffer_T *>>::_Vector_impl" = type { %"struct.std::_Vector_base<VkFramebuffer_T *, std::allocator<VkFramebuffer_T *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<VkFramebuffer_T *, std::allocator<VkFramebuffer_T *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.5" = type { %"struct.std::_Vector_base.6" }
%"struct.std::_Vector_base.6" = type { %"struct.std::_Vector_base<VkImage_T *, std::allocator<VkImage_T *>>::_Vector_impl" }
%"struct.std::_Vector_base<VkImage_T *, std::allocator<VkImage_T *>>::_Vector_impl" = type { %"struct.std::_Vector_base<VkImage_T *, std::allocator<VkImage_T *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<VkImage_T *, std::allocator<VkImage_T *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.10" = type { %"struct.std::_Vector_base.11" }
%"struct.std::_Vector_base.11" = type { %"struct.std::_Vector_base<VkImageView_T *, std::allocator<VkImageView_T *>>::_Vector_impl" }
%"struct.std::_Vector_base<VkImageView_T *, std::allocator<VkImageView_T *>>::_Vector_impl" = type { %"struct.std::_Vector_base<VkImageView_T *, std::allocator<VkImageView_T *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<VkImageView_T *, std::allocator<VkImageView_T *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.SwapChainSupportDetails = type { %struct.VkSurfaceCapabilitiesKHR, %"class.std::vector.15", %"class.std::vector.20" }
%struct.VkSurfaceCapabilitiesKHR = type { i32, i32, %struct.VkExtent2D, %struct.VkExtent2D, %struct.VkExtent2D, i32, i32, i32, i32, i32 }
%"class.std::vector.15" = type { %"struct.std::_Vector_base.16" }
%"struct.std::_Vector_base.16" = type { %"struct.std::_Vector_base<VkSurfaceFormatKHR, std::allocator<VkSurfaceFormatKHR>>::_Vector_impl" }
%"struct.std::_Vector_base<VkSurfaceFormatKHR, std::allocator<VkSurfaceFormatKHR>>::_Vector_impl" = type { %"struct.std::_Vector_base<VkSurfaceFormatKHR, std::allocator<VkSurfaceFormatKHR>>::_Vector_impl_data" }
%"struct.std::_Vector_base<VkSurfaceFormatKHR, std::allocator<VkSurfaceFormatKHR>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.20" = type { %"struct.std::_Vector_base.21" }
%"struct.std::_Vector_base.21" = type { %"struct.std::_Vector_base<VkPresentModeKHR, std::allocator<VkPresentModeKHR>>::_Vector_impl" }
%"struct.std::_Vector_base<VkPresentModeKHR, std::allocator<VkPresentModeKHR>>::_Vector_impl" = type { %"struct.std::_Vector_base<VkPresentModeKHR, std::allocator<VkPresentModeKHR>>::_Vector_impl_data" }
%"struct.std::_Vector_base<VkPresentModeKHR, std::allocator<VkPresentModeKHR>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@_ZTISt13runtime_error = external constant ptr
@.str.6 = external hidden unnamed_addr constant [28 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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

declare ptr @__cxa_allocate_exception(i64)

declare void @_ZNSt13runtime_errorC1EPKc(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) unnamed_addr #1

declare void @__cxa_free_exception(ptr)

; Function Attrs: nounwind
declare void @_ZNSt13runtime_errorD1Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #2

declare void @__cxa_throw(ptr, ptr, ptr)

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN19PresentationManager15createSwapChainEv(ptr noundef nonnull align 8 dereferenceable(256) %0) #3 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca %struct.VkSurfaceFormatKHR, align 4
  %4 = alloca i32, align 4
  %5 = alloca %struct.VkExtent2D, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca %struct.VkSwapchainCreateInfoKHR, align 8
  %10 = alloca [2 x i32], align 4
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %13 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #7
  %14 = getelementptr inbounds %class.PresentationManager, ptr %13, i32 0, i32 12
  %15 = getelementptr inbounds %struct.SwapChainSupportDetails, ptr %14, i32 0, i32 1
  %16 = call i64 @_ZN19PresentationManager23chooseSwapSurfaceFormatERKSt6vectorI18VkSurfaceFormatKHRSaIS1_EE(ptr noundef nonnull align 8 dereferenceable(24) %15)
  store i64 %16, ptr %3, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  %17 = getelementptr inbounds %class.PresentationManager, ptr %13, i32 0, i32 12
  %18 = getelementptr inbounds %struct.SwapChainSupportDetails, ptr %17, i32 0, i32 2
  %19 = call noundef i32 @_ZN19PresentationManager21chooseSwapPresentModeERKSt6vectorI16VkPresentModeKHRSaIS1_EE(ptr noundef nonnull align 8 dereferenceable(24) %18)
  store i32 %19, ptr %4, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #7
  %20 = getelementptr inbounds %class.PresentationManager, ptr %13, i32 0, i32 12
  %21 = getelementptr inbounds %struct.SwapChainSupportDetails, ptr %20, i32 0, i32 0
  %22 = call i64 @_ZN19PresentationManager16chooseSwapExtentERK24VkSurfaceCapabilitiesKHR(ptr noundef nonnull align 8 dereferenceable(256) %13, ptr noundef nonnull align 4 dereferenceable(52) %21)
  store i64 %22, ptr %5, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  %23 = getelementptr inbounds %class.PresentationManager, ptr %13, i32 0, i32 12
  %24 = getelementptr inbounds %struct.SwapChainSupportDetails, ptr %23, i32 0, i32 0
  %25 = getelementptr inbounds %struct.VkSurfaceCapabilitiesKHR, ptr %24, i32 0, i32 0
  %26 = load i32, ptr %25, align 8, !tbaa !11
  %27 = add i32 %26, 1
  store i32 %27, ptr %6, align 4, !tbaa !45
  %28 = getelementptr inbounds %class.PresentationManager, ptr %13, i32 0, i32 12
  %29 = getelementptr inbounds %struct.SwapChainSupportDetails, ptr %28, i32 0, i32 0
  %30 = getelementptr inbounds %struct.VkSurfaceCapabilitiesKHR, ptr %29, i32 0, i32 1
  %31 = load i32, ptr %30, align 4, !tbaa !46
  %32 = icmp ugt i32 %31, 0
  br i1 %32, label %33, label %45

33:                                               ; preds = %1
  %34 = load i32, ptr %6, align 4, !tbaa !45
  %35 = getelementptr inbounds %class.PresentationManager, ptr %13, i32 0, i32 12
  %36 = getelementptr inbounds %struct.SwapChainSupportDetails, ptr %35, i32 0, i32 0
  %37 = getelementptr inbounds %struct.VkSurfaceCapabilitiesKHR, ptr %36, i32 0, i32 1
  %38 = load i32, ptr %37, align 4, !tbaa !46
  %39 = icmp ugt i32 %34, %38
  br i1 %39, label %40, label %45

40:                                               ; preds = %33
  %41 = getelementptr inbounds %class.PresentationManager, ptr %13, i32 0, i32 12
  %42 = getelementptr inbounds %struct.SwapChainSupportDetails, ptr %41, i32 0, i32 0
  %43 = getelementptr inbounds %struct.VkSurfaceCapabilitiesKHR, ptr %42, i32 0, i32 1
  %44 = load i32, ptr %43, align 4, !tbaa !46
  store i32 %44, ptr %6, align 4, !tbaa !45
  br label %45

45:                                               ; preds = %40, %33, %1
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  store i32 1, ptr %7, align 4, !tbaa !47
  %46 = getelementptr inbounds %class.PresentationManager, ptr %13, i32 0, i32 12
  %47 = getelementptr inbounds %struct.SwapChainSupportDetails, ptr %46, i32 0, i32 0
  %48 = getelementptr inbounds %struct.VkSurfaceCapabilitiesKHR, ptr %47, i32 0, i32 8
  %49 = load i32, ptr %48, align 4, !tbaa !49
  %50 = and i32 %49, 1
  %51 = icmp ne i32 %50, 0
  br i1 %51, label %52, label %53

52:                                               ; preds = %45
  store i32 1, ptr %7, align 4, !tbaa !47
  br label %80

53:                                               ; preds = %45
  %54 = getelementptr inbounds %class.PresentationManager, ptr %13, i32 0, i32 12
  %55 = getelementptr inbounds %struct.SwapChainSupportDetails, ptr %54, i32 0, i32 0
  %56 = getelementptr inbounds %struct.VkSurfaceCapabilitiesKHR, ptr %55, i32 0, i32 8
  %57 = load i32, ptr %56, align 4, !tbaa !49
  %58 = and i32 %57, 8
  %59 = icmp ne i32 %58, 0
  br i1 %59, label %60, label %61

60:                                               ; preds = %53
  store i32 8, ptr %7, align 4, !tbaa !47
  br label %79

61:                                               ; preds = %53
  %62 = getelementptr inbounds %class.PresentationManager, ptr %13, i32 0, i32 12
  %63 = getelementptr inbounds %struct.SwapChainSupportDetails, ptr %62, i32 0, i32 0
  %64 = getelementptr inbounds %struct.VkSurfaceCapabilitiesKHR, ptr %63, i32 0, i32 8
  %65 = load i32, ptr %64, align 4, !tbaa !49
  %66 = and i32 %65, 2
  %67 = icmp ne i32 %66, 0
  br i1 %67, label %68, label %69

68:                                               ; preds = %61
  store i32 2, ptr %7, align 4, !tbaa !47
  br label %78

69:                                               ; preds = %61
  %70 = getelementptr inbounds %class.PresentationManager, ptr %13, i32 0, i32 12
  %71 = getelementptr inbounds %struct.SwapChainSupportDetails, ptr %70, i32 0, i32 0
  %72 = getelementptr inbounds %struct.VkSurfaceCapabilitiesKHR, ptr %71, i32 0, i32 8
  %73 = load i32, ptr %72, align 4, !tbaa !49
  %74 = and i32 %73, 4
  %75 = icmp ne i32 %74, 0
  br i1 %75, label %76, label %77

76:                                               ; preds = %69
  store i32 4, ptr %7, align 4, !tbaa !47
  br label %77

77:                                               ; preds = %76, %69
  br label %78

78:                                               ; preds = %77, %68
  br label %79

79:                                               ; preds = %78, %60
  br label %80

80:                                               ; preds = %79, %52
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  %81 = getelementptr inbounds %class.PresentationManager, ptr %13, i32 0, i32 5
  %82 = load ptr, ptr %81, align 8, !tbaa !50
  store ptr %82, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 104, ptr %9) #7
  call void @llvm.memset.p0.i64(ptr align 8 %9, i8 0, i64 104, i1 false)
  %83 = getelementptr inbounds %struct.VkSwapchainCreateInfoKHR, ptr %9, i32 0, i32 0
  store i32 1000001000, ptr %83, align 8, !tbaa !51
  %84 = getelementptr inbounds %class.PresentationManager, ptr %13, i32 0, i32 1
  %85 = load ptr, ptr %84, align 8, !tbaa !56
  %86 = getelementptr inbounds %struct.VkSwapchainCreateInfoKHR, ptr %9, i32 0, i32 3
  store ptr %85, ptr %86, align 8, !tbaa !57
  %87 = load i32, ptr %6, align 4, !tbaa !45
  %88 = getelementptr inbounds %struct.VkSwapchainCreateInfoKHR, ptr %9, i32 0, i32 4
  store i32 %87, ptr %88, align 8, !tbaa !58
  %89 = getelementptr inbounds %struct.VkSurfaceFormatKHR, ptr %3, i32 0, i32 0
  %90 = load i32, ptr %89, align 4, !tbaa !59
  %91 = getelementptr inbounds %struct.VkSwapchainCreateInfoKHR, ptr %9, i32 0, i32 5
  store i32 %90, ptr %91, align 4, !tbaa !61
  %92 = getelementptr inbounds %struct.VkSurfaceFormatKHR, ptr %3, i32 0, i32 1
  %93 = load i32, ptr %92, align 4, !tbaa !62
  %94 = getelementptr inbounds %struct.VkSwapchainCreateInfoKHR, ptr %9, i32 0, i32 6
  store i32 %93, ptr %94, align 8, !tbaa !63
  %95 = getelementptr inbounds %struct.VkSwapchainCreateInfoKHR, ptr %9, i32 0, i32 7
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %95, ptr align 4 %5, i64 8, i1 false), !tbaa.struct !64
  %96 = getelementptr inbounds %struct.VkSwapchainCreateInfoKHR, ptr %9, i32 0, i32 8
  store i32 1, ptr %96, align 4, !tbaa !65
  %97 = getelementptr inbounds %struct.VkSwapchainCreateInfoKHR, ptr %9, i32 0, i32 9
  store i32 16, ptr %97, align 8, !tbaa !66
  %98 = getelementptr inbounds %class.PresentationManager, ptr %13, i32 0, i32 12
  %99 = getelementptr inbounds %struct.SwapChainSupportDetails, ptr %98, i32 0, i32 0
  %100 = getelementptr inbounds %struct.VkSurfaceCapabilitiesKHR, ptr %99, i32 0, i32 7
  %101 = load i32, ptr %100, align 8, !tbaa !67
  %102 = getelementptr inbounds %struct.VkSwapchainCreateInfoKHR, ptr %9, i32 0, i32 13
  store i32 %101, ptr %102, align 8, !tbaa !68
  %103 = load i32, ptr %7, align 4, !tbaa !47
  %104 = getelementptr inbounds %struct.VkSwapchainCreateInfoKHR, ptr %9, i32 0, i32 14
  store i32 %103, ptr %104, align 4, !tbaa !69
  %105 = load i32, ptr %4, align 4, !tbaa !9
  %106 = getelementptr inbounds %struct.VkSwapchainCreateInfoKHR, ptr %9, i32 0, i32 15
  store i32 %105, ptr %106, align 8, !tbaa !70
  %107 = getelementptr inbounds %struct.VkSwapchainCreateInfoKHR, ptr %9, i32 0, i32 16
  store i32 1, ptr %107, align 4, !tbaa !71
  %108 = load ptr, ptr %8, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.VkSwapchainCreateInfoKHR, ptr %9, i32 0, i32 17
  store ptr %108, ptr %109, align 8, !tbaa !72
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  %110 = getelementptr inbounds %class.PresentationManager, ptr %13, i32 0, i32 4
  %111 = getelementptr inbounds %struct.QueueFamilyIndices, ptr %110, i32 0, i32 0
  %112 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNRSt8optionalIjE5valueEv(ptr noundef nonnull align 4 dereferenceable(8) %111)
  %113 = load i32, ptr %112, align 4, !tbaa !45
  store i32 %113, ptr %10, align 4, !tbaa !45
  %114 = getelementptr inbounds i32, ptr %10, i64 1
  %115 = getelementptr inbounds %class.PresentationManager, ptr %13, i32 0, i32 4
  %116 = getelementptr inbounds %struct.QueueFamilyIndices, ptr %115, i32 0, i32 1
  %117 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNRSt8optionalIjE5valueEv(ptr noundef nonnull align 4 dereferenceable(8) %116)
  %118 = load i32, ptr %117, align 4, !tbaa !45
  store i32 %118, ptr %114, align 4, !tbaa !45
  %119 = getelementptr inbounds %class.PresentationManager, ptr %13, i32 0, i32 4
  %120 = getelementptr inbounds %struct.QueueFamilyIndices, ptr %119, i32 0, i32 0
  %121 = getelementptr inbounds %class.PresentationManager, ptr %13, i32 0, i32 4
  %122 = getelementptr inbounds %struct.QueueFamilyIndices, ptr %121, i32 0, i32 1
  %123 = call noundef zeroext i1 @_ZStneIjjENSt9enable_ifIXsr14is_convertibleIDTneclsr3stdE7declvalIRKT_EEclsr3stdE7declvalIRKT0_EEEbEE5valueEbE4typeERKSt8optionalIS1_ERKSA_IS4_E(ptr noundef nonnull align 4 dereferenceable(8) %120, ptr noundef nonnull align 4 dereferenceable(8) %122)
  br i1 %123, label %124, label %129

124:                                              ; preds = %80
  %125 = getelementptr inbounds %struct.VkSwapchainCreateInfoKHR, ptr %9, i32 0, i32 10
  store i32 1, ptr %125, align 4, !tbaa !73
  %126 = getelementptr inbounds %struct.VkSwapchainCreateInfoKHR, ptr %9, i32 0, i32 11
  store i32 2, ptr %126, align 8, !tbaa !74
  %127 = getelementptr inbounds [2 x i32], ptr %10, i64 0, i64 0
  %128 = getelementptr inbounds %struct.VkSwapchainCreateInfoKHR, ptr %9, i32 0, i32 12
  store ptr %127, ptr %128, align 8, !tbaa !75
  br label %133

129:                                              ; preds = %80
  %130 = getelementptr inbounds %struct.VkSwapchainCreateInfoKHR, ptr %9, i32 0, i32 10
  store i32 0, ptr %130, align 4, !tbaa !73
  %131 = getelementptr inbounds %struct.VkSwapchainCreateInfoKHR, ptr %9, i32 0, i32 11
  store i32 0, ptr %131, align 8, !tbaa !74
  %132 = getelementptr inbounds %struct.VkSwapchainCreateInfoKHR, ptr %9, i32 0, i32 12
  store ptr null, ptr %132, align 8, !tbaa !75
  br label %133

133:                                              ; preds = %129, %124
  %134 = getelementptr inbounds %class.PresentationManager, ptr %13, i32 0, i32 3
  %135 = load ptr, ptr %134, align 8, !tbaa !76
  %136 = getelementptr inbounds %class.PresentationManager, ptr %13, i32 0, i32 5
  %137 = call i32 @vkCreateSwapchainKHR(ptr noundef %135, ptr noundef %9, ptr noundef null, ptr noundef %136)
  %138 = icmp ne i32 %137, 0
  br i1 %138, label %139, label %146

139:                                              ; preds = %133
  %140 = call ptr @__cxa_allocate_exception(i64 16) #7
  invoke void @_ZNSt13runtime_errorC1EPKc(ptr noundef nonnull align 8 dereferenceable(16) %140, ptr noundef @.str.6)
          to label %141 unwind label %142

141:                                              ; preds = %139
  call void @__cxa_throw(ptr %140, ptr @_ZTISt13runtime_error, ptr @_ZNSt13runtime_errorD1Ev) #8
  unreachable

142:                                              ; preds = %139
  %143 = landingpad { ptr, i32 }
          cleanup
  %144 = extractvalue { ptr, i32 } %143, 0
  store ptr %144, ptr %11, align 8
  %145 = extractvalue { ptr, i32 } %143, 1
  store i32 %145, ptr %12, align 4
  call void @__cxa_free_exception(ptr %140) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 104, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #7
  br label %175

146:                                              ; preds = %133
  %147 = getelementptr inbounds %struct.VkSwapchainCreateInfoKHR, ptr %9, i32 0, i32 17
  %148 = load ptr, ptr %147, align 8, !tbaa !72
  %149 = icmp ne ptr %148, null
  br i1 %149, label %150, label %155

150:                                              ; preds = %146
  %151 = getelementptr inbounds %class.PresentationManager, ptr %13, i32 0, i32 3
  %152 = load ptr, ptr %151, align 8, !tbaa !76
  %153 = getelementptr inbounds %struct.VkSwapchainCreateInfoKHR, ptr %9, i32 0, i32 17
  %154 = load ptr, ptr %153, align 8, !tbaa !72
  call void @vkDestroySwapchainKHR(ptr noundef %152, ptr noundef %154, ptr noundef null)
  br label %155

155:                                              ; preds = %150, %146
  %156 = getelementptr inbounds %class.PresentationManager, ptr %13, i32 0, i32 3
  %157 = load ptr, ptr %156, align 8, !tbaa !76
  %158 = getelementptr inbounds %class.PresentationManager, ptr %13, i32 0, i32 5
  %159 = load ptr, ptr %158, align 8, !tbaa !50
  %160 = call i32 @vkGetSwapchainImagesKHR(ptr noundef %157, ptr noundef %159, ptr noundef %6, ptr noundef null)
  %161 = getelementptr inbounds %class.PresentationManager, ptr %13, i32 0, i32 10
  %162 = load i32, ptr %6, align 4, !tbaa !45
  %163 = zext i32 %162 to i64
  call void @_ZNSt6vectorIP9VkImage_TSaIS1_EE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %161, i64 noundef %163)
  %164 = getelementptr inbounds %class.PresentationManager, ptr %13, i32 0, i32 3
  %165 = load ptr, ptr %164, align 8, !tbaa !76
  %166 = getelementptr inbounds %class.PresentationManager, ptr %13, i32 0, i32 5
  %167 = load ptr, ptr %166, align 8, !tbaa !50
  %168 = getelementptr inbounds %class.PresentationManager, ptr %13, i32 0, i32 10
  %169 = call noundef ptr @_ZNSt6vectorIP9VkImage_TSaIS1_EE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %168) #7
  %170 = call i32 @vkGetSwapchainImagesKHR(ptr noundef %165, ptr noundef %167, ptr noundef %6, ptr noundef %169)
  %171 = getelementptr inbounds %struct.VkSurfaceFormatKHR, ptr %3, i32 0, i32 0
  %172 = load i32, ptr %171, align 4, !tbaa !59
  %173 = getelementptr inbounds %class.PresentationManager, ptr %13, i32 0, i32 6
  store i32 %172, ptr %173, align 8, !tbaa !77
  %174 = getelementptr inbounds %class.PresentationManager, ptr %13, i32 0, i32 7
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %174, ptr align 4 %5, i64 8, i1 false), !tbaa.struct !64
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 104, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #7
  ret void

175:                                              ; preds = %142
  %176 = load ptr, ptr %11, align 8
  %177 = load i32, ptr %12, align 4
  %178 = insertvalue { ptr, i32 } poison, ptr %176, 0
  %179 = insertvalue { ptr, i32 } %178, i32 %177, 1
  resume { ptr, i32 } %179
}

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5

declare void @vkDestroySwapchainKHR(ptr noundef, ptr noundef, ptr noundef) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local i64 @_ZN19PresentationManager23chooseSwapSurfaceFormatERKSt6vectorI18VkSurfaceFormatKHRSaIS1_EE(ptr noundef nonnull align 8 dereferenceable(24)) #6 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZN19PresentationManager16chooseSwapExtentERK24VkSurfaceCapabilitiesKHR(ptr noundef nonnull align 8 dereferenceable(256), ptr noundef nonnull align 4 dereferenceable(52)) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZStneIjjENSt9enable_ifIXsr14is_convertibleIDTneclsr3stdE7declvalIRKT_EEclsr3stdE7declvalIRKT0_EEEbEE5valueEbE4typeERKSt8optionalIS1_ERKSA_IS4_E(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) #6

declare i32 @vkCreateSwapchainKHR(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #1

declare i32 @vkGetSwapchainImagesKHR(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIP9VkImage_TSaIS1_EE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #3 align 2

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 = { 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 #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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { 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 #7 = { nounwind }
attributes #8 = { noreturn }

!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 = !{!"_ZTS16VkPresentModeKHR", !7, i64 0}
!11 = !{!12, !21, i64 152}
!12 = !{!"_ZTS19PresentationManager", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !13, i64 32, !6, i64 48, !19, i64 56, !20, i64 60, !22, i64 72, !18, i64 96, !26, i64 104, !30, i64 128, !34, i64 152}
!13 = !{!"_ZTS18QueueFamilyIndices", !14, i64 0, !14, i64 8}
!14 = !{!"_ZTSSt8optionalIjE", !15, i64 0}
!15 = !{!"_ZTSSt14_Optional_baseIjLb1ELb1EE", !16, i64 0}
!16 = !{!"_ZTSSt17_Optional_payloadIjLb1ELb1ELb1EE", !17, i64 0}
!17 = !{!"_ZTSSt22_Optional_payload_baseIjE", !7, i64 0, !18, i64 4}
!18 = !{!"bool", !7, i64 0}
!19 = !{!"_ZTS8VkFormat", !7, i64 0}
!20 = !{!"_ZTS10VkExtent2D", !21, i64 0, !21, i64 4}
!21 = !{!"int", !7, i64 0}
!22 = !{!"_ZTSSt6vectorIP15VkFramebuffer_TSaIS1_EE", !23, i64 0}
!23 = !{!"_ZTSSt12_Vector_baseIP15VkFramebuffer_TSaIS1_EE", !24, i64 0}
!24 = !{!"_ZTSNSt12_Vector_baseIP15VkFramebuffer_TSaIS1_EE12_Vector_implE", !25, i64 0}
!25 = !{!"_ZTSNSt12_Vector_baseIP15VkFramebuffer_TSaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!26 = !{!"_ZTSSt6vectorIP9VkImage_TSaIS1_EE", !27, i64 0}
!27 = !{!"_ZTSSt12_Vector_baseIP9VkImage_TSaIS1_EE", !28, i64 0}
!28 = !{!"_ZTSNSt12_Vector_baseIP9VkImage_TSaIS1_EE12_Vector_implE", !29, i64 0}
!29 = !{!"_ZTSNSt12_Vector_baseIP9VkImage_TSaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!30 = !{!"_ZTSSt6vectorIP13VkImageView_TSaIS1_EE", !31, i64 0}
!31 = !{!"_ZTSSt12_Vector_baseIP13VkImageView_TSaIS1_EE", !32, i64 0}
!32 = !{!"_ZTSNSt12_Vector_baseIP13VkImageView_TSaIS1_EE12_Vector_implE", !33, i64 0}
!33 = !{!"_ZTSNSt12_Vector_baseIP13VkImageView_TSaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!34 = !{!"_ZTS23SwapChainSupportDetails", !35, i64 0, !37, i64 56, !41, i64 80}
!35 = !{!"_ZTS24VkSurfaceCapabilitiesKHR", !21, i64 0, !21, i64 4, !20, i64 8, !20, i64 16, !20, i64 24, !21, i64 32, !21, i64 36, !36, i64 40, !21, i64 44, !21, i64 48}
!36 = !{!"_ZTS29VkSurfaceTransformFlagBitsKHR", !7, i64 0}
!37 = !{!"_ZTSSt6vectorI18VkSurfaceFormatKHRSaIS0_EE", !38, i64 0}
!38 = !{!"_ZTSSt12_Vector_baseI18VkSurfaceFormatKHRSaIS0_EE", !39, i64 0}
!39 = !{!"_ZTSNSt12_Vector_baseI18VkSurfaceFormatKHRSaIS0_EE12_Vector_implE", !40, i64 0}
!40 = !{!"_ZTSNSt12_Vector_baseI18VkSurfaceFormatKHRSaIS0_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!41 = !{!"_ZTSSt6vectorI16VkPresentModeKHRSaIS0_EE", !42, i64 0}
!42 = !{!"_ZTSSt12_Vector_baseI16VkPresentModeKHRSaIS0_EE", !43, i64 0}
!43 = !{!"_ZTSNSt12_Vector_baseI16VkPresentModeKHRSaIS0_EE12_Vector_implE", !44, i64 0}
!44 = !{!"_ZTSNSt12_Vector_baseI16VkPresentModeKHRSaIS0_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!45 = !{!21, !21, i64 0}
!46 = !{!12, !21, i64 156}
!47 = !{!48, !48, i64 0}
!48 = !{!"_ZTS27VkCompositeAlphaFlagBitsKHR", !7, i64 0}
!49 = !{!12, !21, i64 196}
!50 = !{!12, !6, i64 48}
!51 = !{!52, !53, i64 0}
!52 = !{!"_ZTS24VkSwapchainCreateInfoKHR", !53, i64 0, !6, i64 8, !21, i64 16, !6, i64 24, !21, i64 32, !19, i64 36, !54, i64 40, !20, i64 44, !21, i64 52, !21, i64 56, !55, i64 60, !21, i64 64, !6, i64 72, !36, i64 80, !48, i64 84, !10, i64 88, !21, i64 92, !6, i64 96}
!53 = !{!"_ZTS15VkStructureType", !7, i64 0}
!54 = !{!"_ZTS15VkColorSpaceKHR", !7, i64 0}
!55 = !{!"_ZTS13VkSharingMode", !7, i64 0}
!56 = !{!12, !6, i64 8}
!57 = !{!52, !6, i64 24}
!58 = !{!52, !21, i64 32}
!59 = !{!60, !19, i64 0}
!60 = !{!"_ZTS18VkSurfaceFormatKHR", !19, i64 0, !54, i64 4}
!61 = !{!52, !19, i64 36}
!62 = !{!60, !54, i64 4}
!63 = !{!52, !54, i64 40}
!64 = !{i64 0, i64 4, !45, i64 4, i64 4, !45}
!65 = !{!52, !21, i64 52}
!66 = !{!52, !21, i64 56}
!67 = !{!12, !36, i64 192}
!68 = !{!52, !36, i64 80}
!69 = !{!52, !48, i64 84}
!70 = !{!52, !10, i64 88}
!71 = !{!52, !21, i64 92}
!72 = !{!52, !6, i64 96}
!73 = !{!52, !55, i64 60}
!74 = !{!52, !21, i64 64}
!75 = !{!52, !6, i64 72}
!76 = !{!12, !6, i64 24}
!77 = !{!12, !19, i64 56}


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

%struct.VkSwapchainCreateInfoKHR = type { i32, ptr, i32, ptr, i32, i32, i32, %struct.VkExtent2D, i32, i32, i32, i32, ptr, i32, i32, i32, i32, ptr }
%struct.VkExtent2D = type { i32, i32 }

@_ZTISt13runtime_error = external constant ptr
@.str.6 = external hidden unnamed_addr constant [28 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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

declare ptr @__cxa_allocate_exception(i64) local_unnamed_addr

declare void @_ZNSt13runtime_errorC1EPKc(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) unnamed_addr #1

declare void @__cxa_free_exception(ptr) local_unnamed_addr

; Function Attrs: nounwind
declare void @_ZNSt13runtime_errorD1Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #2

declare void @__cxa_throw(ptr, ptr, ptr) local_unnamed_addr

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN19PresentationManager15createSwapChainEv(ptr noundef nonnull align 8 dereferenceable(256) %0) local_unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca i32, align 4
  %3 = alloca %struct.VkSwapchainCreateInfoKHR, align 8
  %4 = alloca [2 x i32], align 4
  %5 = getelementptr inbounds i8, ptr %0, i64 152
  %6 = getelementptr inbounds i8, ptr %0, i64 208
  %7 = tail call i64 @_ZN19PresentationManager23chooseSwapSurfaceFormatERKSt6vectorI18VkSurfaceFormatKHRSaIS1_EE(ptr noundef nonnull align 8 dereferenceable(24) %6)
  %.sroa.05.0.extract.trunc = trunc i64 %7 to i32
  %.sroa.6.0.extract.shift = lshr i64 %7, 32
  %.sroa.6.0.extract.trunc = trunc nuw i64 %.sroa.6.0.extract.shift to i32
  %8 = getelementptr inbounds i8, ptr %0, i64 232
  %9 = tail call noundef i32 @_ZN19PresentationManager21chooseSwapPresentModeERKSt6vectorI16VkPresentModeKHRSaIS1_EE(ptr noundef nonnull align 8 dereferenceable(24) %8)
  %10 = tail call i64 @_ZN19PresentationManager16chooseSwapExtentERK24VkSurfaceCapabilitiesKHR(ptr noundef nonnull align 8 dereferenceable(256) %0, ptr noundef nonnull align 4 dereferenceable(52) %5)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  %11 = load i32, ptr %5, align 8, !tbaa !5
  %12 = add i32 %11, 1
  %13 = getelementptr inbounds i8, ptr %0, i64 156
  %14 = load i32, ptr %13, align 4, !tbaa !42
  %.not.not = icmp eq i32 %14, 0
  %15 = tail call i32 @llvm.umin.i32(i32 %12, i32 %14)
  %spec.store.select = select i1 %.not.not, i32 %12, i32 %15
  store i32 %spec.store.select, ptr %2, align 4
  %16 = getelementptr inbounds i8, ptr %0, i64 196
  %17 = load i32, ptr %16, align 4, !tbaa !43
  %18 = and i32 %17, 1
  %.not10 = icmp eq i32 %18, 0
  br i1 %.not10, label %19, label %25

19:                                               ; preds = %1
  %20 = and i32 %17, 8
  %.not11 = icmp eq i32 %20, 0
  br i1 %.not11, label %21, label %25

21:                                               ; preds = %19
  %22 = and i32 %17, 2
  %.not12 = icmp eq i32 %22, 0
  br i1 %.not12, label %23, label %25

23:                                               ; preds = %21
  %24 = and i32 %17, 4
  %.not13 = icmp eq i32 %24, 0
  %spec.select = select i1 %.not13, i32 1, i32 4
  br label %25

25:                                               ; preds = %23, %21, %19, %1
  %.0 = phi i32 [ 1, %1 ], [ 8, %19 ], [ 2, %21 ], [ %spec.select, %23 ]
  %26 = getelementptr inbounds i8, ptr %0, i64 48
  %27 = load ptr, ptr %26, align 8, !tbaa !44
  call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %3) #7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(104) %3, i8 0, i64 80, i1 false)
  store i32 1000001000, ptr %3, align 8, !tbaa !45
  %28 = getelementptr inbounds i8, ptr %0, i64 8
  %29 = load ptr, ptr %28, align 8, !tbaa !52
  %30 = getelementptr inbounds i8, ptr %3, i64 24
  store ptr %29, ptr %30, align 8, !tbaa !53
  %31 = getelementptr inbounds i8, ptr %3, i64 32
  store i32 %spec.store.select, ptr %31, align 8, !tbaa !54
  %32 = getelementptr inbounds i8, ptr %3, i64 36
  store i32 %.sroa.05.0.extract.trunc, ptr %32, align 4, !tbaa !55
  %33 = getelementptr inbounds i8, ptr %3, i64 40
  store i32 %.sroa.6.0.extract.trunc, ptr %33, align 8, !tbaa !56
  %34 = getelementptr inbounds i8, ptr %3, i64 44
  store i64 %10, ptr %34, align 4
  %35 = getelementptr inbounds i8, ptr %3, i64 52
  store i32 1, ptr %35, align 4, !tbaa !57
  %36 = getelementptr inbounds i8, ptr %3, i64 56
  store i32 16, ptr %36, align 8, !tbaa !58
  %37 = getelementptr inbounds i8, ptr %0, i64 192
  %38 = load i32, ptr %37, align 8, !tbaa !59
  %39 = getelementptr inbounds i8, ptr %3, i64 80
  store i32 %38, ptr %39, align 8, !tbaa !60
  %40 = getelementptr inbounds i8, ptr %3, i64 84
  store i32 %.0, ptr %40, align 4, !tbaa !61
  %41 = getelementptr inbounds i8, ptr %3, i64 88
  store i32 %9, ptr %41, align 8, !tbaa !62
  %42 = getelementptr inbounds i8, ptr %3, i64 92
  store i32 1, ptr %42, align 4, !tbaa !63
  %43 = getelementptr inbounds i8, ptr %3, i64 96
  store ptr %27, ptr %43, align 8, !tbaa !64
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  %44 = getelementptr inbounds i8, ptr %0, i64 32
  %45 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNRSt8optionalIjE5valueEv(ptr noundef nonnull align 4 dereferenceable(8) %44)
  %46 = load i32, ptr %45, align 4, !tbaa !65
  store i32 %46, ptr %4, align 4, !tbaa !65
  %47 = getelementptr inbounds i8, ptr %4, i64 4
  %48 = getelementptr inbounds i8, ptr %0, i64 40
  %49 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNRSt8optionalIjE5valueEv(ptr noundef nonnull align 4 dereferenceable(8) %48)
  %50 = load i32, ptr %49, align 4, !tbaa !65
  store i32 %50, ptr %47, align 4, !tbaa !65
  %51 = tail call noundef zeroext i1 @_ZStneIjjENSt9enable_ifIXsr14is_convertibleIDTneclsr3stdE7declvalIRKT_EEclsr3stdE7declvalIRKT0_EEEbEE5valueEbE4typeERKSt8optionalIS1_ERKSA_IS4_E(ptr noundef nonnull align 4 dereferenceable(8) %44, ptr noundef nonnull align 4 dereferenceable(8) %48)
  %.sink17 = zext i1 %51 to i32
  %.sink16 = select i1 %51, i32 2, i32 0
  %.sink = select i1 %51, ptr %4, ptr null
  %52 = getelementptr inbounds i8, ptr %3, i64 60
  store i32 %.sink17, ptr %52, align 4
  %53 = getelementptr inbounds i8, ptr %3, i64 64
  store i32 %.sink16, ptr %53, align 8
  %54 = getelementptr inbounds i8, ptr %3, i64 72
  store ptr %.sink, ptr %54, align 8
  %55 = getelementptr inbounds i8, ptr %0, i64 24
  %56 = load ptr, ptr %55, align 8, !tbaa !66
  %57 = call i32 @vkCreateSwapchainKHR(ptr noundef %56, ptr noundef nonnull %3, ptr noundef null, ptr noundef nonnull %26)
  %.not14 = icmp eq i32 %57, 0
  br i1 %.not14, label %63, label %58

58:                                               ; preds = %25
  %59 = call ptr @__cxa_allocate_exception(i64 16) #7
  invoke void @_ZNSt13runtime_errorC1EPKc(ptr noundef nonnull align 8 dereferenceable(16) %59, ptr noundef nonnull @.str.6)
          to label %60 unwind label %61

60:                                               ; preds = %58
  call void @__cxa_throw(ptr nonnull %59, ptr nonnull @_ZTISt13runtime_error, ptr nonnull @_ZNSt13runtime_errorD1Ev) #8
  unreachable

61:                                               ; preds = %58
  %62 = landingpad { ptr, i32 }
          cleanup
  call void @__cxa_free_exception(ptr %59) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  resume { ptr, i32 } %62

63:                                               ; preds = %25
  %64 = load ptr, ptr %43, align 8, !tbaa !64
  %.not15 = icmp eq ptr %64, null
  br i1 %.not15, label %67, label %65

65:                                               ; preds = %63
  %66 = load ptr, ptr %55, align 8, !tbaa !66
  call void @vkDestroySwapchainKHR(ptr noundef %66, ptr noundef nonnull %64, ptr noundef null)
  br label %67

67:                                               ; preds = %65, %63
  %68 = load ptr, ptr %55, align 8, !tbaa !66
  %69 = load ptr, ptr %26, align 8, !tbaa !44
  %70 = call i32 @vkGetSwapchainImagesKHR(ptr noundef %68, ptr noundef %69, ptr noundef nonnull %2, ptr noundef null)
  %71 = getelementptr inbounds i8, ptr %0, i64 104
  %72 = load i32, ptr %2, align 4, !tbaa !65
  %73 = zext i32 %72 to i64
  call void @_ZNSt6vectorIP9VkImage_TSaIS1_EE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %71, i64 noundef %73)
  %74 = load ptr, ptr %55, align 8, !tbaa !66
  %75 = load ptr, ptr %26, align 8, !tbaa !44
  %76 = call noundef ptr @_ZNSt6vectorIP9VkImage_TSaIS1_EE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %71) #7
  %77 = call i32 @vkGetSwapchainImagesKHR(ptr noundef %74, ptr noundef %75, ptr noundef nonnull %2, ptr noundef %76)
  %78 = getelementptr inbounds i8, ptr %0, i64 56
  store i32 %.sroa.05.0.extract.trunc, ptr %78, align 8, !tbaa !67
  %79 = getelementptr inbounds i8, ptr %0, i64 60
  store i64 %10, ptr %79, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNRSt8optionalIjE5valueEv(ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

declare void @vkDestroySwapchainKHR(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local i64 @_ZN19PresentationManager23chooseSwapSurfaceFormatERKSt6vectorI18VkSurfaceFormatKHRSaIS1_EE(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #5 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN19PresentationManager21chooseSwapPresentModeERKSt6vectorI16VkPresentModeKHRSaIS1_EE(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZN19PresentationManager16chooseSwapExtentERK24VkSurfaceCapabilitiesKHR(ptr noundef nonnull align 8 dereferenceable(256), ptr noundef nonnull align 4 dereferenceable(52)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZStneIjjENSt9enable_ifIXsr14is_convertibleIDTneclsr3stdE7declvalIRKT_EEclsr3stdE7declvalIRKT0_EEEbEE5valueEbE4typeERKSt8optionalIS1_ERKSA_IS4_E(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #5

declare i32 @vkCreateSwapchainKHR(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare i32 @vkGetSwapchainImagesKHR(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIP9VkImage_TSaIS1_EE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNSt6vectorIP9VkImage_TSaIS1_EE4dataEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #5 align 2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.umin.i32(i32, i32) #6

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 = { 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 #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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { 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 #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nounwind }
attributes #8 = { noreturn }

!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, !18, i64 152}
!6 = !{!"_ZTS19PresentationManager", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !10, i64 32, !7, i64 48, !16, i64 56, !17, i64 60, !19, i64 72, !15, i64 96, !23, i64 104, !27, i64 128, !31, i64 152}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTS18QueueFamilyIndices", !11, i64 0, !11, i64 8}
!11 = !{!"_ZTSSt8optionalIjE", !12, i64 0}
!12 = !{!"_ZTSSt14_Optional_baseIjLb1ELb1EE", !13, i64 0}
!13 = !{!"_ZTSSt17_Optional_payloadIjLb1ELb1ELb1EE", !14, i64 0}
!14 = !{!"_ZTSSt22_Optional_payload_baseIjE", !8, i64 0, !15, i64 4}
!15 = !{!"bool", !8, i64 0}
!16 = !{!"_ZTS8VkFormat", !8, i64 0}
!17 = !{!"_ZTS10VkExtent2D", !18, i64 0, !18, i64 4}
!18 = !{!"int", !8, i64 0}
!19 = !{!"_ZTSSt6vectorIP15VkFramebuffer_TSaIS1_EE", !20, i64 0}
!20 = !{!"_ZTSSt12_Vector_baseIP15VkFramebuffer_TSaIS1_EE", !21, i64 0}
!21 = !{!"_ZTSNSt12_Vector_baseIP15VkFramebuffer_TSaIS1_EE12_Vector_implE", !22, i64 0}
!22 = !{!"_ZTSNSt12_Vector_baseIP15VkFramebuffer_TSaIS1_EE17_Vector_impl_dataE", !7, i64 0, !7, i64 8, !7, i64 16}
!23 = !{!"_ZTSSt6vectorIP9VkImage_TSaIS1_EE", !24, i64 0}
!24 = !{!"_ZTSSt12_Vector_baseIP9VkImage_TSaIS1_EE", !25, i64 0}
!25 = !{!"_ZTSNSt12_Vector_baseIP9VkImage_TSaIS1_EE12_Vector_implE", !26, i64 0}
!26 = !{!"_ZTSNSt12_Vector_baseIP9VkImage_TSaIS1_EE17_Vector_impl_dataE", !7, i64 0, !7, i64 8, !7, i64 16}
!27 = !{!"_ZTSSt6vectorIP13VkImageView_TSaIS1_EE", !28, i64 0}
!28 = !{!"_ZTSSt12_Vector_baseIP13VkImageView_TSaIS1_EE", !29, i64 0}
!29 = !{!"_ZTSNSt12_Vector_baseIP13VkImageView_TSaIS1_EE12_Vector_implE", !30, i64 0}
!30 = !{!"_ZTSNSt12_Vector_baseIP13VkImageView_TSaIS1_EE17_Vector_impl_dataE", !7, i64 0, !7, i64 8, !7, i64 16}
!31 = !{!"_ZTS23SwapChainSupportDetails", !32, i64 0, !34, i64 56, !38, i64 80}
!32 = !{!"_ZTS24VkSurfaceCapabilitiesKHR", !18, i64 0, !18, i64 4, !17, i64 8, !17, i64 16, !17, i64 24, !18, i64 32, !18, i64 36, !33, i64 40, !18, i64 44, !18, i64 48}
!33 = !{!"_ZTS29VkSurfaceTransformFlagBitsKHR", !8, i64 0}
!34 = !{!"_ZTSSt6vectorI18VkSurfaceFormatKHRSaIS0_EE", !35, i64 0}
!35 = !{!"_ZTSSt12_Vector_baseI18VkSurfaceFormatKHRSaIS0_EE", !36, i64 0}
!36 = !{!"_ZTSNSt12_Vector_baseI18VkSurfaceFormatKHRSaIS0_EE12_Vector_implE", !37, i64 0}
!37 = !{!"_ZTSNSt12_Vector_baseI18VkSurfaceFormatKHRSaIS0_EE17_Vector_impl_dataE", !7, i64 0, !7, i64 8, !7, i64 16}
!38 = !{!"_ZTSSt6vectorI16VkPresentModeKHRSaIS0_EE", !39, i64 0}
!39 = !{!"_ZTSSt12_Vector_baseI16VkPresentModeKHRSaIS0_EE", !40, i64 0}
!40 = !{!"_ZTSNSt12_Vector_baseI16VkPresentModeKHRSaIS0_EE12_Vector_implE", !41, i64 0}
!41 = !{!"_ZTSNSt12_Vector_baseI16VkPresentModeKHRSaIS0_EE17_Vector_impl_dataE", !7, i64 0, !7, i64 8, !7, i64 16}
!42 = !{!6, !18, i64 156}
!43 = !{!6, !18, i64 196}
!44 = !{!6, !7, i64 48}
!45 = !{!46, !47, i64 0}
!46 = !{!"_ZTS24VkSwapchainCreateInfoKHR", !47, i64 0, !7, i64 8, !18, i64 16, !7, i64 24, !18, i64 32, !16, i64 36, !48, i64 40, !17, i64 44, !18, i64 52, !18, i64 56, !49, i64 60, !18, i64 64, !7, i64 72, !33, i64 80, !50, i64 84, !51, i64 88, !18, i64 92, !7, i64 96}
!47 = !{!"_ZTS15VkStructureType", !8, i64 0}
!48 = !{!"_ZTS15VkColorSpaceKHR", !8, i64 0}
!49 = !{!"_ZTS13VkSharingMode", !8, i64 0}
!50 = !{!"_ZTS27VkCompositeAlphaFlagBitsKHR", !8, i64 0}
!51 = !{!"_ZTS16VkPresentModeKHR", !8, i64 0}
!52 = !{!6, !7, i64 8}
!53 = !{!46, !7, i64 24}
!54 = !{!46, !18, i64 32}
!55 = !{!46, !16, i64 36}
!56 = !{!46, !48, i64 40}
!57 = !{!46, !18, i64 52}
!58 = !{!46, !18, i64 56}
!59 = !{!6, !33, i64 192}
!60 = !{!46, !33, i64 80}
!61 = !{!46, !50, i64 84}
!62 = !{!46, !51, i64 88}
!63 = !{!46, !18, i64 92}
!64 = !{!46, !7, i64 96}
!65 = !{!18, !18, i64 0}
!66 = !{!6, !7, i64 24}
!67 = !{!6, !16, i64 56}


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