; 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.VkImageViewCreateInfo = type { i32, ptr, i32, ptr, i32, i32, %struct.VkComponentMapping, %struct.VkImageSubresourceRange }
%struct.VkComponentMapping = type { i32, i32, i32, i32 }
%struct.VkImageSubresourceRange = type { i32, i32, i32, i32, i32 }
%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 }
%struct.VkExtent2D = type { i32, 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.7 = external hidden unnamed_addr constant [30 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 @_ZN19PresentationManager16createImageViewsEv(ptr noundef nonnull align 8 dereferenceable(256) %0) #3 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca i64, align 8
  %4 = alloca %struct.VkImageViewCreateInfo, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %7 = load ptr, ptr %2, align 8
  %8 = getelementptr inbounds %class.PresentationManager, ptr %7, i32 0, i32 11
  %9 = getelementptr inbounds %class.PresentationManager, ptr %7, i32 0, i32 10
  %10 = call noundef i64 @_ZNKSt6vectorIP9VkImage_TSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %9) #6
  call void @_ZNSt6vectorIP13VkImageView_TSaIS1_EE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %10)
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #6
  store i64 0, ptr %3, align 8, !tbaa !9
  br label %11

11:                                               ; preds = %61, %1
  %12 = load i64, ptr %3, align 8, !tbaa !9
  %13 = getelementptr inbounds %class.PresentationManager, ptr %7, i32 0, i32 10
  %14 = call noundef i64 @_ZNKSt6vectorIP9VkImage_TSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %13) #6
  %15 = icmp ult i64 %12, %14
  br i1 %15, label %17, label %16

16:                                               ; preds = %11
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  br label %64

17:                                               ; preds = %11
  call void @llvm.lifetime.start.p0(i64 80, ptr %4) #6
  call void @llvm.memset.p0.i64(ptr align 8 %4, i8 0, i64 80, i1 false)
  %18 = getelementptr inbounds %struct.VkImageViewCreateInfo, ptr %4, i32 0, i32 0
  store i32 15, ptr %18, align 8, !tbaa !11
  %19 = getelementptr inbounds %class.PresentationManager, ptr %7, i32 0, i32 10
  %20 = load i64, ptr %3, align 8, !tbaa !9
  %21 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP9VkImage_TSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %19, i64 noundef %20) #6
  %22 = load ptr, ptr %21, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.VkImageViewCreateInfo, ptr %4, i32 0, i32 3
  store ptr %22, ptr %23, align 8, !tbaa !20
  %24 = getelementptr inbounds %struct.VkImageViewCreateInfo, ptr %4, i32 0, i32 4
  store i32 1, ptr %24, align 8, !tbaa !21
  %25 = getelementptr inbounds %class.PresentationManager, ptr %7, i32 0, i32 6
  %26 = load i32, ptr %25, align 8, !tbaa !22
  %27 = getelementptr inbounds %struct.VkImageViewCreateInfo, ptr %4, i32 0, i32 5
  store i32 %26, ptr %27, align 4, !tbaa !54
  %28 = getelementptr inbounds %struct.VkImageViewCreateInfo, ptr %4, i32 0, i32 6
  %29 = getelementptr inbounds %struct.VkComponentMapping, ptr %28, i32 0, i32 0
  store i32 0, ptr %29, align 8, !tbaa !55
  %30 = getelementptr inbounds %struct.VkImageViewCreateInfo, ptr %4, i32 0, i32 6
  %31 = getelementptr inbounds %struct.VkComponentMapping, ptr %30, i32 0, i32 1
  store i32 0, ptr %31, align 4, !tbaa !56
  %32 = getelementptr inbounds %struct.VkImageViewCreateInfo, ptr %4, i32 0, i32 6
  %33 = getelementptr inbounds %struct.VkComponentMapping, ptr %32, i32 0, i32 2
  store i32 0, ptr %33, align 8, !tbaa !57
  %34 = getelementptr inbounds %struct.VkImageViewCreateInfo, ptr %4, i32 0, i32 6
  %35 = getelementptr inbounds %struct.VkComponentMapping, ptr %34, i32 0, i32 3
  store i32 0, ptr %35, align 4, !tbaa !58
  %36 = getelementptr inbounds %struct.VkImageViewCreateInfo, ptr %4, i32 0, i32 7
  %37 = getelementptr inbounds %struct.VkImageSubresourceRange, ptr %36, i32 0, i32 0
  store i32 1, ptr %37, align 8, !tbaa !59
  %38 = getelementptr inbounds %struct.VkImageViewCreateInfo, ptr %4, i32 0, i32 7
  %39 = getelementptr inbounds %struct.VkImageSubresourceRange, ptr %38, i32 0, i32 1
  store i32 0, ptr %39, align 4, !tbaa !60
  %40 = getelementptr inbounds %struct.VkImageViewCreateInfo, ptr %4, i32 0, i32 7
  %41 = getelementptr inbounds %struct.VkImageSubresourceRange, ptr %40, i32 0, i32 2
  store i32 1, ptr %41, align 8, !tbaa !61
  %42 = getelementptr inbounds %struct.VkImageViewCreateInfo, ptr %4, i32 0, i32 7
  %43 = getelementptr inbounds %struct.VkImageSubresourceRange, ptr %42, i32 0, i32 3
  store i32 0, ptr %43, align 4, !tbaa !62
  %44 = getelementptr inbounds %struct.VkImageViewCreateInfo, ptr %4, i32 0, i32 7
  %45 = getelementptr inbounds %struct.VkImageSubresourceRange, ptr %44, i32 0, i32 4
  store i32 1, ptr %45, align 8, !tbaa !63
  %46 = getelementptr inbounds %class.PresentationManager, ptr %7, i32 0, i32 3
  %47 = load ptr, ptr %46, align 8, !tbaa !64
  %48 = getelementptr inbounds %class.PresentationManager, ptr %7, i32 0, i32 11
  %49 = load i64, ptr %3, align 8, !tbaa !9
  %50 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP13VkImageView_TSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %48, i64 noundef %49) #6
  %51 = call i32 @vkCreateImageView(ptr noundef %47, ptr noundef %4, ptr noundef null, ptr noundef %50)
  %52 = icmp ne i32 %51, 0
  br i1 %52, label %53, label %60

53:                                               ; preds = %17
  %54 = call ptr @__cxa_allocate_exception(i64 16) #6
  invoke void @_ZNSt13runtime_errorC1EPKc(ptr noundef nonnull align 8 dereferenceable(16) %54, ptr noundef @.str.7)
          to label %55 unwind label %56

55:                                               ; preds = %53
  call void @__cxa_throw(ptr %54, ptr @_ZTISt13runtime_error, ptr @_ZNSt13runtime_errorD1Ev) #7
  unreachable

56:                                               ; preds = %53
  %57 = landingpad { ptr, i32 }
          cleanup
  %58 = extractvalue { ptr, i32 } %57, 0
  store ptr %58, ptr %5, align 8
  %59 = extractvalue { ptr, i32 } %57, 1
  store i32 %59, ptr %6, align 4
  call void @__cxa_free_exception(ptr %54) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  br label %65

60:                                               ; preds = %17
  call void @llvm.lifetime.end.p0(i64 80, ptr %4) #6
  br label %61

61:                                               ; preds = %60
  %62 = load i64, ptr %3, align 8, !tbaa !9
  %63 = add i64 %62, 1
  store i64 %63, ptr %3, align 8, !tbaa !9
  br label %11, !llvm.loop !65

64:                                               ; preds = %16
  ret void

65:                                               ; preds = %56
  %66 = load ptr, ptr %5, align 8
  %67 = load i32, ptr %6, align 4
  %68 = insertvalue { ptr, i32 } poison, ptr %66, 0
  %69 = insertvalue { ptr, i32 } %68, i32 %67, 1
  resume { ptr, i32 } %69
}

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP13VkImageView_TSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #5 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: 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 = { nounwind }
attributes #7 = { 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 = !{!"long", !7, i64 0}
!11 = !{!12, !13, i64 0}
!12 = !{!"_ZTS21VkImageViewCreateInfo", !13, i64 0, !6, i64 8, !14, i64 16, !6, i64 24, !15, i64 32, !16, i64 36, !17, i64 40, !19, i64 56}
!13 = !{!"_ZTS15VkStructureType", !7, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = !{!"_ZTS15VkImageViewType", !7, i64 0}
!16 = !{!"_ZTS8VkFormat", !7, i64 0}
!17 = !{!"_ZTS18VkComponentMapping", !18, i64 0, !18, i64 4, !18, i64 8, !18, i64 12}
!18 = !{!"_ZTS18VkComponentSwizzle", !7, i64 0}
!19 = !{!"_ZTS23VkImageSubresourceRange", !14, i64 0, !14, i64 4, !14, i64 8, !14, i64 12, !14, i64 16}
!20 = !{!12, !6, i64 24}
!21 = !{!12, !15, i64 32}
!22 = !{!23, !16, i64 56}
!23 = !{!"_ZTS19PresentationManager", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !24, i64 32, !6, i64 48, !16, i64 56, !30, i64 60, !31, i64 72, !29, i64 96, !35, i64 104, !39, i64 128, !43, i64 152}
!24 = !{!"_ZTS18QueueFamilyIndices", !25, i64 0, !25, i64 8}
!25 = !{!"_ZTSSt8optionalIjE", !26, i64 0}
!26 = !{!"_ZTSSt14_Optional_baseIjLb1ELb1EE", !27, i64 0}
!27 = !{!"_ZTSSt17_Optional_payloadIjLb1ELb1ELb1EE", !28, i64 0}
!28 = !{!"_ZTSSt22_Optional_payload_baseIjE", !7, i64 0, !29, i64 4}
!29 = !{!"bool", !7, i64 0}
!30 = !{!"_ZTS10VkExtent2D", !14, i64 0, !14, i64 4}
!31 = !{!"_ZTSSt6vectorIP15VkFramebuffer_TSaIS1_EE", !32, i64 0}
!32 = !{!"_ZTSSt12_Vector_baseIP15VkFramebuffer_TSaIS1_EE", !33, i64 0}
!33 = !{!"_ZTSNSt12_Vector_baseIP15VkFramebuffer_TSaIS1_EE12_Vector_implE", !34, i64 0}
!34 = !{!"_ZTSNSt12_Vector_baseIP15VkFramebuffer_TSaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!35 = !{!"_ZTSSt6vectorIP9VkImage_TSaIS1_EE", !36, i64 0}
!36 = !{!"_ZTSSt12_Vector_baseIP9VkImage_TSaIS1_EE", !37, i64 0}
!37 = !{!"_ZTSNSt12_Vector_baseIP9VkImage_TSaIS1_EE12_Vector_implE", !38, i64 0}
!38 = !{!"_ZTSNSt12_Vector_baseIP9VkImage_TSaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!39 = !{!"_ZTSSt6vectorIP13VkImageView_TSaIS1_EE", !40, i64 0}
!40 = !{!"_ZTSSt12_Vector_baseIP13VkImageView_TSaIS1_EE", !41, i64 0}
!41 = !{!"_ZTSNSt12_Vector_baseIP13VkImageView_TSaIS1_EE12_Vector_implE", !42, i64 0}
!42 = !{!"_ZTSNSt12_Vector_baseIP13VkImageView_TSaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!43 = !{!"_ZTS23SwapChainSupportDetails", !44, i64 0, !46, i64 56, !50, i64 80}
!44 = !{!"_ZTS24VkSurfaceCapabilitiesKHR", !14, i64 0, !14, i64 4, !30, i64 8, !30, i64 16, !30, i64 24, !14, i64 32, !14, i64 36, !45, i64 40, !14, i64 44, !14, i64 48}
!45 = !{!"_ZTS29VkSurfaceTransformFlagBitsKHR", !7, i64 0}
!46 = !{!"_ZTSSt6vectorI18VkSurfaceFormatKHRSaIS0_EE", !47, i64 0}
!47 = !{!"_ZTSSt12_Vector_baseI18VkSurfaceFormatKHRSaIS0_EE", !48, i64 0}
!48 = !{!"_ZTSNSt12_Vector_baseI18VkSurfaceFormatKHRSaIS0_EE12_Vector_implE", !49, i64 0}
!49 = !{!"_ZTSNSt12_Vector_baseI18VkSurfaceFormatKHRSaIS0_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!50 = !{!"_ZTSSt6vectorI16VkPresentModeKHRSaIS0_EE", !51, i64 0}
!51 = !{!"_ZTSSt12_Vector_baseI16VkPresentModeKHRSaIS0_EE", !52, i64 0}
!52 = !{!"_ZTSNSt12_Vector_baseI16VkPresentModeKHRSaIS0_EE12_Vector_implE", !53, i64 0}
!53 = !{!"_ZTSNSt12_Vector_baseI16VkPresentModeKHRSaIS0_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!54 = !{!12, !16, i64 36}
!55 = !{!12, !18, i64 40}
!56 = !{!12, !18, i64 44}
!57 = !{!12, !18, i64 48}
!58 = !{!12, !18, i64 52}
!59 = !{!12, !14, i64 56}
!60 = !{!12, !14, i64 60}
!61 = !{!12, !14, i64 64}
!62 = !{!12, !14, i64 68}
!63 = !{!12, !14, i64 72}
!64 = !{!23, !6, i64 24}
!65 = distinct !{!65, !66}
!66 = !{!"llvm.loop.mustprogress"}


; 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.VkImageViewCreateInfo = type { i32, ptr, i32, ptr, i32, i32, %struct.VkComponentMapping, %struct.VkImageSubresourceRange }
%struct.VkComponentMapping = type { i32, i32, i32, i32 }
%struct.VkImageSubresourceRange = type { i32, i32, i32, i32, i32 }

@_ZTISt13runtime_error = external constant ptr
@.str.7 = external hidden unnamed_addr constant [30 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 @_ZN19PresentationManager16createImageViewsEv(ptr noundef nonnull align 8 dereferenceable(256) %0) local_unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %struct.VkImageViewCreateInfo, align 8
  %3 = getelementptr inbounds i8, ptr %0, i64 128
  %4 = getelementptr inbounds i8, ptr %0, i64 104
  %5 = tail call noundef i64 @_ZNKSt6vectorIP9VkImage_TSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #6
  tail call void @_ZNSt6vectorIP13VkImageView_TSaIS1_EE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %5)
  %6 = tail call noundef i64 @_ZNKSt6vectorIP9VkImage_TSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #6
  %.not7 = icmp eq i64 %6, 0
  br i1 %.not7, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %1
  %7 = getelementptr inbounds i8, ptr %2, i64 24
  %8 = getelementptr inbounds i8, ptr %2, i64 32
  %9 = getelementptr inbounds i8, ptr %0, i64 56
  %10 = getelementptr inbounds i8, ptr %2, i64 36
  %11 = getelementptr inbounds i8, ptr %2, i64 40
  %12 = getelementptr inbounds i8, ptr %2, i64 56
  %13 = getelementptr inbounds i8, ptr %2, i64 72
  %14 = getelementptr inbounds i8, ptr %0, i64 24
  br label %15

._crit_edge:                                      ; preds = %27, %1
  ret void

15:                                               ; preds = %.lr.ph, %27
  %.06 = phi i64 [ 0, %.lr.ph ], [ %28, %27 ]
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %2) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(80) %2, i8 0, i64 80, i1 false)
  store i32 15, ptr %2, align 8, !tbaa !5
  %16 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP9VkImage_TSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %.06) #6
  %17 = load ptr, ptr %16, align 8, !tbaa !17
  store ptr %17, ptr %7, align 8, !tbaa !18
  store i32 1, ptr %8, align 8, !tbaa !19
  %18 = load i32, ptr %9, align 8, !tbaa !20
  store i32 %18, ptr %10, align 4, !tbaa !52
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %11, i8 0, i64 16, i1 false)
  store <4 x i32> <i32 1, i32 0, i32 1, i32 0>, ptr %12, align 8, !tbaa !53
  store i32 1, ptr %13, align 8, !tbaa !54
  %19 = load ptr, ptr %14, align 8, !tbaa !55
  %20 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP13VkImageView_TSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.06) #6
  %21 = call i32 @vkCreateImageView(ptr noundef %19, ptr noundef nonnull %2, ptr noundef null, ptr noundef nonnull %20)
  %.not = icmp eq i32 %21, 0
  br i1 %.not, label %27, label %22

22:                                               ; preds = %15
  %23 = call ptr @__cxa_allocate_exception(i64 16) #6
  invoke void @_ZNSt13runtime_errorC1EPKc(ptr noundef nonnull align 8 dereferenceable(16) %23, ptr noundef nonnull @.str.7)
          to label %24 unwind label %25

24:                                               ; preds = %22
  call void @__cxa_throw(ptr nonnull %23, ptr nonnull @_ZTISt13runtime_error, ptr nonnull @_ZNSt13runtime_errorD1Ev) #7
  unreachable

25:                                               ; preds = %22
  %26 = landingpad { ptr, i32 }
          cleanup
  call void @__cxa_free_exception(ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %2) #6
  resume { ptr, i32 } %26

27:                                               ; preds = %15
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %2) #6
  %28 = add nuw i64 %.06, 1
  %29 = call noundef i64 @_ZNKSt6vectorIP9VkImage_TSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #6
  %30 = icmp ult i64 %28, %29
  br i1 %30, label %15, label %._crit_edge, !llvm.loop !56
}

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIP13VkImageView_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 i64 @_ZNKSt6vectorIP9VkImage_TSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #5 align 2

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

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

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

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 = { nounwind }
attributes #7 = { 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, !7, i64 0}
!6 = !{!"_ZTS21VkImageViewCreateInfo", !7, i64 0, !10, i64 8, !11, i64 16, !10, i64 24, !12, i64 32, !13, i64 36, !14, i64 40, !16, i64 56}
!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 = !{!"_ZTS15VkImageViewType", !8, i64 0}
!13 = !{!"_ZTS8VkFormat", !8, i64 0}
!14 = !{!"_ZTS18VkComponentMapping", !15, i64 0, !15, i64 4, !15, i64 8, !15, i64 12}
!15 = !{!"_ZTS18VkComponentSwizzle", !8, i64 0}
!16 = !{!"_ZTS23VkImageSubresourceRange", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16}
!17 = !{!10, !10, i64 0}
!18 = !{!6, !10, i64 24}
!19 = !{!6, !12, i64 32}
!20 = !{!21, !13, i64 56}
!21 = !{!"_ZTS19PresentationManager", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !22, i64 32, !10, i64 48, !13, i64 56, !28, i64 60, !29, i64 72, !27, i64 96, !33, i64 104, !37, i64 128, !41, i64 152}
!22 = !{!"_ZTS18QueueFamilyIndices", !23, i64 0, !23, i64 8}
!23 = !{!"_ZTSSt8optionalIjE", !24, i64 0}
!24 = !{!"_ZTSSt14_Optional_baseIjLb1ELb1EE", !25, i64 0}
!25 = !{!"_ZTSSt17_Optional_payloadIjLb1ELb1ELb1EE", !26, i64 0}
!26 = !{!"_ZTSSt22_Optional_payload_baseIjE", !8, i64 0, !27, i64 4}
!27 = !{!"bool", !8, i64 0}
!28 = !{!"_ZTS10VkExtent2D", !11, i64 0, !11, i64 4}
!29 = !{!"_ZTSSt6vectorIP15VkFramebuffer_TSaIS1_EE", !30, i64 0}
!30 = !{!"_ZTSSt12_Vector_baseIP15VkFramebuffer_TSaIS1_EE", !31, i64 0}
!31 = !{!"_ZTSNSt12_Vector_baseIP15VkFramebuffer_TSaIS1_EE12_Vector_implE", !32, i64 0}
!32 = !{!"_ZTSNSt12_Vector_baseIP15VkFramebuffer_TSaIS1_EE17_Vector_impl_dataE", !10, i64 0, !10, i64 8, !10, i64 16}
!33 = !{!"_ZTSSt6vectorIP9VkImage_TSaIS1_EE", !34, i64 0}
!34 = !{!"_ZTSSt12_Vector_baseIP9VkImage_TSaIS1_EE", !35, i64 0}
!35 = !{!"_ZTSNSt12_Vector_baseIP9VkImage_TSaIS1_EE12_Vector_implE", !36, i64 0}
!36 = !{!"_ZTSNSt12_Vector_baseIP9VkImage_TSaIS1_EE17_Vector_impl_dataE", !10, i64 0, !10, i64 8, !10, i64 16}
!37 = !{!"_ZTSSt6vectorIP13VkImageView_TSaIS1_EE", !38, i64 0}
!38 = !{!"_ZTSSt12_Vector_baseIP13VkImageView_TSaIS1_EE", !39, i64 0}
!39 = !{!"_ZTSNSt12_Vector_baseIP13VkImageView_TSaIS1_EE12_Vector_implE", !40, i64 0}
!40 = !{!"_ZTSNSt12_Vector_baseIP13VkImageView_TSaIS1_EE17_Vector_impl_dataE", !10, i64 0, !10, i64 8, !10, i64 16}
!41 = !{!"_ZTS23SwapChainSupportDetails", !42, i64 0, !44, i64 56, !48, i64 80}
!42 = !{!"_ZTS24VkSurfaceCapabilitiesKHR", !11, i64 0, !11, i64 4, !28, i64 8, !28, i64 16, !28, i64 24, !11, i64 32, !11, i64 36, !43, i64 40, !11, i64 44, !11, i64 48}
!43 = !{!"_ZTS29VkSurfaceTransformFlagBitsKHR", !8, i64 0}
!44 = !{!"_ZTSSt6vectorI18VkSurfaceFormatKHRSaIS0_EE", !45, i64 0}
!45 = !{!"_ZTSSt12_Vector_baseI18VkSurfaceFormatKHRSaIS0_EE", !46, i64 0}
!46 = !{!"_ZTSNSt12_Vector_baseI18VkSurfaceFormatKHRSaIS0_EE12_Vector_implE", !47, i64 0}
!47 = !{!"_ZTSNSt12_Vector_baseI18VkSurfaceFormatKHRSaIS0_EE17_Vector_impl_dataE", !10, i64 0, !10, i64 8, !10, i64 16}
!48 = !{!"_ZTSSt6vectorI16VkPresentModeKHRSaIS0_EE", !49, i64 0}
!49 = !{!"_ZTSSt12_Vector_baseI16VkPresentModeKHRSaIS0_EE", !50, i64 0}
!50 = !{!"_ZTSNSt12_Vector_baseI16VkPresentModeKHRSaIS0_EE12_Vector_implE", !51, i64 0}
!51 = !{!"_ZTSNSt12_Vector_baseI16VkPresentModeKHRSaIS0_EE17_Vector_impl_dataE", !10, i64 0, !10, i64 8, !10, i64 16}
!52 = !{!6, !13, i64 36}
!53 = !{!11, !11, i64 0}
!54 = !{!6, !11, i64 72}
!55 = !{!21, !10, i64 24}
!56 = distinct !{!56, !57}
!57 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,MemCpyOptPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass