; LLVM IR from jrouwe/JoltPhysics :: TestFramework/Renderer/VK (RendererVK)

; 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 }
%"class.JPH::Array.47" = type { i64, i64, ptr }
%class.RendererVK = type { %class.Renderer, ptr, ptr, ptr, %struct.VkPhysicalDeviceMemoryProperties, ptr, i32, i32, ptr, ptr, ptr, ptr, i8, %"class.JPH::Array", i32, %struct.VkExtent2D, %"class.JPH::Array.1", ptr, ptr, ptr, ptr, ptr, ptr, [2 x ptr], [2 x ptr], ptr, ptr, ptr, ptr, ptr, ptr, %"class.JPH::Array.4", i32, ptr, [2 x ptr], [2 x ptr], [2 x ptr], [2 x ptr], %"class.JPH::Ref", [2 x %"class.std::unique_ptr"], [2 x %"class.std::unique_ptr"], [2 x %"class.std::unique_ptr"], [2 x %"class.JPH::UnorderedMap"], %"class.JPH::UnorderedMap", %"class.JPH::UnorderedMap.9", i32, i32, i64, i64 }
%class.Renderer = type { ptr, ptr, float, i8, [11 x i8], %struct.CameraState, %"class.JPH::Vec3", %class.Frustum, %class.Frustum, i32, %"struct.Renderer::VertexShaderConstantBuffer", %"struct.Renderer::VertexShaderConstantBuffer", %"struct.Renderer::PixelShaderConstantBuffer" }
%struct.CameraState = type <{ %"class.JPH::Vec3", %"class.JPH::Vec3", %"class.JPH::Vec3", float, [12 x i8] }>
%"class.JPH::Vec3" = type { %union.anon }
%union.anon = type { <4 x float> }
%class.Frustum = type { [5 x %"class.JPH::Plane"] }
%"class.JPH::Plane" = type { %"class.JPH::Vec4" }
%"class.JPH::Vec4" = type { %union.anon.0 }
%union.anon.0 = type { <4 x float> }
%"struct.Renderer::VertexShaderConstantBuffer" = type { %"class.JPH::Mat44", %"class.JPH::Mat44", %"class.JPH::Mat44", %"class.JPH::Mat44" }
%"class.JPH::Mat44" = type { [4 x %"class.JPH::Vec4"] }
%"struct.Renderer::PixelShaderConstantBuffer" = type { %"class.JPH::Vec4", %"class.JPH::Vec4" }
%struct.VkPhysicalDeviceMemoryProperties = type { i32, [32 x %struct.VkMemoryType], i32, [16 x %struct.VkMemoryHeap] }
%struct.VkMemoryType = type { i32, i32 }
%struct.VkMemoryHeap = type { i64, i32 }
%"class.JPH::Array" = type { i64, i64, ptr }
%struct.VkExtent2D = type { i32, i32 }
%"class.JPH::Array.1" = type { i64, i64, ptr }
%"class.JPH::Array.4" = type { i64, i64, ptr }
%"class.JPH::Ref" = type { ptr }
%"class.std::unique_ptr" = type { %"struct.std::__uniq_ptr_data" }
%"struct.std::__uniq_ptr_data" = type { %"class.std::__uniq_ptr_impl" }
%"class.std::__uniq_ptr_impl" = type { %"class.std::tuple" }
%"class.std::tuple" = type { %"struct.std::_Tuple_impl" }
%"struct.std::_Tuple_impl" = type { %"struct.std::_Head_base.8" }
%"struct.std::_Head_base.8" = type { ptr }
%"class.JPH::UnorderedMap" = type { %"class.JPH::HashTable.base", [4 x i8] }
%"class.JPH::HashTable.base" = type <{ ptr, ptr, i32, i32, i32 }>
%"class.JPH::UnorderedMap.9" = type { %"class.JPH::HashTable.base.11", [4 x i8] }
%"class.JPH::HashTable.base.11" = type <{ ptr, ptr, i32, i32, i32 }>

; 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

; 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) #1

; Function Attrs: mustprogress uwtable
define dso_local i64 @_ZN10RendererVK12SelectFormatEP18VkPhysicalDevice_T(ptr noundef nonnull align 16 dereferenceable(1936) %0, ptr noundef %1) #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %struct.VkSurfaceFormatKHR, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca %"class.JPH::Array.47", align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %15 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  %16 = load ptr, ptr %5, align 8, !tbaa !5
  %17 = getelementptr inbounds %class.RendererVK, ptr %15, i32 0, i32 10
  %18 = load ptr, ptr %17, align 16, !tbaa !9
  %19 = call i32 @vkGetPhysicalDeviceSurfaceFormatsKHR(ptr noundef %16, ptr noundef %18, ptr noundef %6, ptr noundef null)
  %20 = load i32, ptr %6, align 4, !tbaa !34
  %21 = icmp eq i32 %20, 0
  br i1 %21, label %22, label %25

22:                                               ; preds = %2
  %23 = getelementptr inbounds %struct.VkSurfaceFormatKHR, ptr %3, i32 0, i32 0
  store i32 0, ptr %23, align 4, !tbaa !35
  %24 = getelementptr inbounds %struct.VkSurfaceFormatKHR, ptr %3, i32 0, i32 1
  store i32 0, ptr %24, align 4, !tbaa !38
  store i32 1, ptr %7, align 4
  br label %87

25:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 24, ptr %8) #7
  call void @_ZN3JPH5ArrayI18VkSurfaceFormatKHRNS_12STLAllocatorIS1_EEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #7
  %26 = load i32, ptr %6, align 4, !tbaa !34
  %27 = zext i32 %26 to i64
  invoke void @_ZN3JPH5ArrayI18VkSurfaceFormatKHRNS_12STLAllocatorIS1_EEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %27)
          to label %28 unwind label %47

28:                                               ; preds = %25
  %29 = load ptr, ptr %5, align 8, !tbaa !5
  %30 = getelementptr inbounds %class.RendererVK, ptr %15, i32 0, i32 10
  %31 = load ptr, ptr %30, align 16, !tbaa !9
  %32 = invoke noundef ptr @_ZN3JPH5ArrayI18VkSurfaceFormatKHRNS_12STLAllocatorIS1_EEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %8)
          to label %33 unwind label %47

33:                                               ; preds = %28
  %34 = invoke i32 @vkGetPhysicalDeviceSurfaceFormatsKHR(ptr noundef %29, ptr noundef %31, ptr noundef %6, ptr noundef %32)
          to label %35 unwind label %47

35:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  store ptr %8, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  %36 = load ptr, ptr %11, align 8, !tbaa !5
  %37 = invoke noundef ptr @_ZN3JPH5ArrayI18VkSurfaceFormatKHRNS_12STLAllocatorIS1_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %36)
          to label %38 unwind label %51

38:                                               ; preds = %35
  store ptr %37, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  %39 = load ptr, ptr %11, align 8, !tbaa !5
  %40 = invoke noundef ptr @_ZN3JPH5ArrayI18VkSurfaceFormatKHRNS_12STLAllocatorIS1_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %39)
          to label %41 unwind label %55

41:                                               ; preds = %38
  store ptr %40, ptr %13, align 8, !tbaa !5
  br label %42

42:                                               ; preds = %76, %41
  %43 = load ptr, ptr %12, align 8, !tbaa !5
  %44 = load ptr, ptr %13, align 8, !tbaa !5
  %45 = icmp ne ptr %43, %44
  br i1 %45, label %59, label %46

46:                                               ; preds = %42
  store i32 2, ptr %7, align 4
  br label %79

47:                                               ; preds = %82, %33, %28, %25
  %48 = landingpad { ptr, i32 }
          cleanup
  %49 = extractvalue { ptr, i32 } %48, 0
  store ptr %49, ptr %9, align 8
  %50 = extractvalue { ptr, i32 } %48, 1
  store i32 %50, ptr %10, align 4
  br label %86

51:                                               ; preds = %35
  %52 = landingpad { ptr, i32 }
          cleanup
  %53 = extractvalue { ptr, i32 } %52, 0
  store ptr %53, ptr %9, align 8
  %54 = extractvalue { ptr, i32 } %52, 1
  store i32 %54, ptr %10, align 4
  br label %81

55:                                               ; preds = %38
  %56 = landingpad { ptr, i32 }
          cleanup
  %57 = extractvalue { ptr, i32 } %56, 0
  store ptr %57, ptr %9, align 8
  %58 = extractvalue { ptr, i32 } %56, 1
  store i32 %58, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  br label %81

59:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  %60 = load ptr, ptr %12, align 8, !tbaa !5
  store ptr %60, ptr %14, align 8, !tbaa !5
  %61 = load ptr, ptr %14, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.VkSurfaceFormatKHR, ptr %61, i32 0, i32 0
  %63 = load i32, ptr %62, align 4, !tbaa !35
  %64 = icmp eq i32 %63, 44
  br i1 %64, label %65, label %72

65:                                               ; preds = %59
  %66 = load ptr, ptr %14, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.VkSurfaceFormatKHR, ptr %66, i32 0, i32 1
  %68 = load i32, ptr %67, align 4, !tbaa !38
  %69 = icmp eq i32 %68, 0
  br i1 %69, label %70, label %72

70:                                               ; preds = %65
  %71 = load ptr, ptr %14, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %3, ptr align 4 %71, i64 8, i1 false), !tbaa.struct !39
  store i32 1, ptr %7, align 4
  br label %73

72:                                               ; preds = %65, %59
  store i32 0, ptr %7, align 4
  br label %73

73:                                               ; preds = %72, %70
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  %74 = load i32, ptr %7, align 4
  switch i32 %74, label %79 [
    i32 0, label %75
  ]

75:                                               ; preds = %73
  br label %76

76:                                               ; preds = %75
  %77 = load ptr, ptr %12, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.VkSurfaceFormatKHR, ptr %77, i32 1
  store ptr %78, ptr %12, align 8, !tbaa !5
  br label %42

79:                                               ; preds = %73, %46
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  %80 = load i32, ptr %7, align 4
  switch i32 %80, label %85 [
    i32 2, label %82
  ]

81:                                               ; preds = %55, %51
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  br label %86

82:                                               ; preds = %79
  %83 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZN3JPH5ArrayI18VkSurfaceFormatKHRNS_12STLAllocatorIS1_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef 0)
          to label %84 unwind label %47

84:                                               ; preds = %82
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %3, ptr align 4 %83, i64 8, i1 false), !tbaa.struct !39
  store i32 1, ptr %7, align 4
  br label %85

85:                                               ; preds = %84, %79
  call void @_ZN3JPH5ArrayI18VkSurfaceFormatKHRNS_12STLAllocatorIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %8) #7
  br label %87

86:                                               ; preds = %81, %47
  call void @_ZN3JPH5ArrayI18VkSurfaceFormatKHRNS_12STLAllocatorIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  br label %89

87:                                               ; preds = %85, %22
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  %88 = load i64, ptr %3, align 4
  ret i64 %88

89:                                               ; preds = %86
  %90 = load ptr, ptr %9, align 8
  %91 = load i32, ptr %10, align 4
  %92 = insertvalue { ptr, i32 } poison, ptr %90, 0
  %93 = insertvalue { ptr, i32 } %92, i32 %91, 1
  resume { ptr, i32 } %93
}

declare i32 @vkGetPhysicalDeviceSurfaceFormatsKHR(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH5ArrayI18VkSurfaceFormatKHRNS_12STLAllocatorIS1_EEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #4 align 2

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

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

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

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

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

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

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

!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, !6, i64 1408}
!10 = !{!"_ZTS10RendererVK", !11, i64 0, !6, i64 832, !6, i64 840, !6, i64 848, !22, i64 856, !6, i64 1376, !17, i64 1384, !17, i64 1388, !6, i64 1392, !6, i64 1400, !6, i64 1408, !6, i64 1416, !13, i64 1424, !23, i64 1432, !25, i64 1456, !26, i64 1460, !27, i64 1472, !6, i64 1496, !6, i64 1504, !6, i64 1512, !6, i64 1520, !6, i64 1528, !6, i64 1536, !7, i64 1544, !7, i64 1560, !6, i64 1576, !6, i64 1584, !6, i64 1592, !6, i64 1600, !6, i64 1608, !6, i64 1616, !28, i64 1624, !17, i64 1648, !6, i64 1656, !7, i64 1664, !7, i64 1680, !7, i64 1696, !7, i64 1712, !29, i64 1728, !7, i64 1736, !7, i64 1752, !7, i64 1768, !7, i64 1784, !30, i64 1848, !32, i64 1880, !17, i64 1912, !17, i64 1916, !24, i64 1920, !24, i64 1928}
!11 = !{!"_ZTS8Renderer", !6, i64 8, !12, i64 16, !13, i64 20, !14, i64 32, !15, i64 96, !16, i64 112, !16, i64 192, !17, i64 272, !18, i64 288, !18, i64 544, !20, i64 800}
!12 = !{!"float", !7, i64 0}
!13 = !{!"bool", !7, i64 0}
!14 = !{!"_ZTS11CameraState", !15, i64 0, !15, i64 16, !15, i64 32, !12, i64 48}
!15 = !{!"_ZTSN3JPH4Vec3E", !7, i64 0}
!16 = !{!"_ZTS7Frustum", !7, i64 0}
!17 = !{!"int", !7, i64 0}
!18 = !{!"_ZTSN8Renderer26VertexShaderConstantBufferE", !19, i64 0, !19, i64 64, !19, i64 128, !19, i64 192}
!19 = !{!"_ZTSN3JPH5Mat44E", !7, i64 0}
!20 = !{!"_ZTSN8Renderer25PixelShaderConstantBufferE", !21, i64 0, !21, i64 16}
!21 = !{!"_ZTSN3JPH4Vec4E", !7, i64 0}
!22 = !{!"_ZTS32VkPhysicalDeviceMemoryProperties", !17, i64 0, !7, i64 4, !17, i64 260, !7, i64 264}
!23 = !{!"_ZTSN3JPH5ArrayIP9VkImage_TNS_12STLAllocatorIS2_EEEE", !24, i64 0, !24, i64 8, !6, i64 16}
!24 = !{!"long", !7, i64 0}
!25 = !{!"_ZTS8VkFormat", !7, i64 0}
!26 = !{!"_ZTS10VkExtent2D", !17, i64 0, !17, i64 4}
!27 = !{!"_ZTSN3JPH5ArrayIP13VkImageView_TNS_12STLAllocatorIS2_EEEE", !24, i64 0, !24, i64 8, !6, i64 16}
!28 = !{!"_ZTSN3JPH5ArrayIP15VkFramebuffer_TNS_12STLAllocatorIS2_EEEE", !24, i64 0, !24, i64 8, !6, i64 16}
!29 = !{!"_ZTSN3JPH3RefI9TextureVKEE", !6, i64 0}
!30 = !{!"_ZTSN3JPH12UnorderedMapIN10RendererVK3KeyENS_5ArrayI8BufferVKNS_12STLAllocatorIS4_EEEENS1_9KeyHasherESt8equal_toIS2_EEE", !31, i64 0}
!31 = !{!"_ZTSN3JPH9HashTableIN10RendererVK3KeyESt4pairIS2_NS_5ArrayI8BufferVKNS_12STLAllocatorIS5_EEEEENS_18UnorderedMapDetailIS2_S8_EENS1_9KeyHasherESt8equal_toIS2_EEE", !6, i64 0, !6, i64 8, !17, i64 16, !17, i64 20, !17, i64 24}
!32 = !{!"_ZTSN3JPH12UnorderedMapIN10RendererVK3KeyENS_5ArrayINS1_6MemoryENS_12STLAllocatorIS4_EEEENS1_9KeyHasherESt8equal_toIS2_EEE", !33, i64 0}
!33 = !{!"_ZTSN3JPH9HashTableIN10RendererVK3KeyESt4pairIS2_NS_5ArrayINS1_6MemoryENS_12STLAllocatorIS5_EEEEENS_18UnorderedMapDetailIS2_S8_EENS1_9KeyHasherESt8equal_toIS2_EEE", !6, i64 0, !6, i64 8, !17, i64 16, !17, i64 20, !17, i64 24}
!34 = !{!17, !17, i64 0}
!35 = !{!36, !25, i64 0}
!36 = !{!"_ZTS18VkSurfaceFormatKHR", !25, i64 0, !37, i64 4}
!37 = !{!"_ZTS15VkColorSpaceKHR", !7, i64 0}
!38 = !{!36, !37, i64 4}
!39 = !{i64 0, i64 4, !40, i64 4, i64 4, !41}
!40 = !{!25, !25, i64 0}
!41 = !{!37, !37, i64 0}


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

%"class.JPH::Array.47" = type { i64, i64, ptr }

; 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

; Function Attrs: mustprogress uwtable
define dso_local i64 @_ZN10RendererVK12SelectFormatEP18VkPhysicalDevice_T(ptr nocapture noundef nonnull readonly align 16 dereferenceable(1936) %0, ptr noundef %1) local_unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca i32, align 4
  %4 = alloca %"class.JPH::Array.47", align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  %5 = getelementptr inbounds i8, ptr %0, i64 1408
  %6 = load ptr, ptr %5, align 16, !tbaa !5
  %7 = call i32 @vkGetPhysicalDeviceSurfaceFormatsKHR(ptr noundef %1, ptr noundef %6, ptr noundef nonnull %3, ptr noundef null)
  %8 = load i32, ptr %3, align 4, !tbaa !33
  %9 = icmp eq i32 %8, 0
  br i1 %9, label %35, label %10

10:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #6
  call void @_ZN3JPH5ArrayI18VkSurfaceFormatKHRNS_12STLAllocatorIS1_EEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #6
  %11 = load i32, ptr %3, align 4, !tbaa !33
  %12 = zext i32 %11 to i64
  invoke void @_ZN3JPH5ArrayI18VkSurfaceFormatKHRNS_12STLAllocatorIS1_EEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %12)
          to label %13 unwind label %20

13:                                               ; preds = %10
  %14 = load ptr, ptr %5, align 16, !tbaa !5
  %15 = call noundef ptr @_ZN3JPH5ArrayI18VkSurfaceFormatKHRNS_12STLAllocatorIS1_EEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %4)
  %16 = invoke i32 @vkGetPhysicalDeviceSurfaceFormatsKHR(ptr noundef %1, ptr noundef %14, ptr noundef nonnull %3, ptr noundef %15)
          to label %17 unwind label %20

17:                                               ; preds = %13
  %18 = call noundef ptr @_ZN3JPH5ArrayI18VkSurfaceFormatKHRNS_12STLAllocatorIS1_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %4)
  %19 = call noundef ptr @_ZN3JPH5ArrayI18VkSurfaceFormatKHRNS_12STLAllocatorIS1_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %4)
  %.not23 = icmp eq ptr %18, %19
  br i1 %.not23, label %.critedge22, label %.lr.ph

20:                                               ; preds = %.critedge22, %13, %10
  %21 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN3JPH5ArrayI18VkSurfaceFormatKHRNS_12STLAllocatorIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  resume { ptr, i32 } %21

.lr.ph:                                           ; preds = %17, %.critedge
  %.024 = phi ptr [ %28, %.critedge ], [ %18, %17 ]
  %22 = load i32, ptr %.024, align 4, !tbaa !34
  %23 = icmp eq i32 %22, 44
  br i1 %23, label %24, label %.critedge

24:                                               ; preds = %.lr.ph
  %25 = getelementptr inbounds i8, ptr %.024, i64 4
  %26 = load i32, ptr %25, align 4, !tbaa !35
  %27 = icmp eq i32 %26, 0
  br i1 %27, label %.loopexit, label %.critedge

.critedge:                                        ; preds = %24, %.lr.ph
  %28 = getelementptr inbounds i8, ptr %.024, i64 8
  %.not = icmp eq ptr %28, %19
  br i1 %.not, label %.critedge22, label %.lr.ph

.critedge22:                                      ; preds = %.critedge, %17
  %29 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZN3JPH5ArrayI18VkSurfaceFormatKHRNS_12STLAllocatorIS1_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef 0)
          to label %30 unwind label %20

30:                                               ; preds = %.critedge22
  %.sroa.0.0.copyload16 = load i32, ptr %29, align 4, !tbaa !34
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %29, i64 4
  %.sroa.4.0.copyload17 = load i32, ptr %.sroa.4.0..sroa_idx, align 4, !tbaa !35
  %31 = zext i32 %.sroa.4.0.copyload17 to i64
  %32 = shl nuw i64 %31, 32
  %33 = zext i32 %.sroa.0.0.copyload16 to i64
  br label %.loopexit

.loopexit:                                        ; preds = %24, %30
  %.sroa.0.3 = phi i64 [ %33, %30 ], [ 44, %24 ]
  %.sroa.4.3 = phi i64 [ %32, %30 ], [ 0, %24 ]
  call void @_ZN3JPH5ArrayI18VkSurfaceFormatKHRNS_12STLAllocatorIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #6
  %34 = or disjoint i64 %.sroa.4.3, %.sroa.0.3
  br label %35

35:                                               ; preds = %2, %.loopexit
  %.sroa.0.0.insert.insert = phi i64 [ %34, %.loopexit ], [ 0, %2 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  ret i64 %.sroa.0.0.insert.insert
}

declare i32 @vkGetPhysicalDeviceSurfaceFormatsKHR(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH5ArrayI18VkSurfaceFormatKHRNS_12STLAllocatorIS1_EEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #3 align 2

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(8) ptr @_ZN3JPH5ArrayI18VkSurfaceFormatKHRNS_12STLAllocatorIS1_EEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN3JPH5ArrayI18VkSurfaceFormatKHRNS_12STLAllocatorIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #5 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { "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 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 #4 = { inlinehint 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 #5 = { inlinehint 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 }

!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, !8, i64 1408}
!6 = !{!"_ZTS10RendererVK", !7, i64 0, !8, i64 832, !8, i64 840, !8, i64 848, !21, i64 856, !8, i64 1376, !16, i64 1384, !16, i64 1388, !8, i64 1392, !8, i64 1400, !8, i64 1408, !8, i64 1416, !12, i64 1424, !22, i64 1432, !24, i64 1456, !25, i64 1460, !26, i64 1472, !8, i64 1496, !8, i64 1504, !8, i64 1512, !8, i64 1520, !8, i64 1528, !8, i64 1536, !9, i64 1544, !9, i64 1560, !8, i64 1576, !8, i64 1584, !8, i64 1592, !8, i64 1600, !8, i64 1608, !8, i64 1616, !27, i64 1624, !16, i64 1648, !8, i64 1656, !9, i64 1664, !9, i64 1680, !9, i64 1696, !9, i64 1712, !28, i64 1728, !9, i64 1736, !9, i64 1752, !9, i64 1768, !9, i64 1784, !29, i64 1848, !31, i64 1880, !16, i64 1912, !16, i64 1916, !23, i64 1920, !23, i64 1928}
!7 = !{!"_ZTS8Renderer", !8, i64 8, !11, i64 16, !12, i64 20, !13, i64 32, !14, i64 96, !15, i64 112, !15, i64 192, !16, i64 272, !17, i64 288, !17, i64 544, !19, i64 800}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"float", !9, i64 0}
!12 = !{!"bool", !9, i64 0}
!13 = !{!"_ZTS11CameraState", !14, i64 0, !14, i64 16, !14, i64 32, !11, i64 48}
!14 = !{!"_ZTSN3JPH4Vec3E", !9, i64 0}
!15 = !{!"_ZTS7Frustum", !9, i64 0}
!16 = !{!"int", !9, i64 0}
!17 = !{!"_ZTSN8Renderer26VertexShaderConstantBufferE", !18, i64 0, !18, i64 64, !18, i64 128, !18, i64 192}
!18 = !{!"_ZTSN3JPH5Mat44E", !9, i64 0}
!19 = !{!"_ZTSN8Renderer25PixelShaderConstantBufferE", !20, i64 0, !20, i64 16}
!20 = !{!"_ZTSN3JPH4Vec4E", !9, i64 0}
!21 = !{!"_ZTS32VkPhysicalDeviceMemoryProperties", !16, i64 0, !9, i64 4, !16, i64 260, !9, i64 264}
!22 = !{!"_ZTSN3JPH5ArrayIP9VkImage_TNS_12STLAllocatorIS2_EEEE", !23, i64 0, !23, i64 8, !8, i64 16}
!23 = !{!"long", !9, i64 0}
!24 = !{!"_ZTS8VkFormat", !9, i64 0}
!25 = !{!"_ZTS10VkExtent2D", !16, i64 0, !16, i64 4}
!26 = !{!"_ZTSN3JPH5ArrayIP13VkImageView_TNS_12STLAllocatorIS2_EEEE", !23, i64 0, !23, i64 8, !8, i64 16}
!27 = !{!"_ZTSN3JPH5ArrayIP15VkFramebuffer_TNS_12STLAllocatorIS2_EEEE", !23, i64 0, !23, i64 8, !8, i64 16}
!28 = !{!"_ZTSN3JPH3RefI9TextureVKEE", !8, i64 0}
!29 = !{!"_ZTSN3JPH12UnorderedMapIN10RendererVK3KeyENS_5ArrayI8BufferVKNS_12STLAllocatorIS4_EEEENS1_9KeyHasherESt8equal_toIS2_EEE", !30, i64 0}
!30 = !{!"_ZTSN3JPH9HashTableIN10RendererVK3KeyESt4pairIS2_NS_5ArrayI8BufferVKNS_12STLAllocatorIS5_EEEEENS_18UnorderedMapDetailIS2_S8_EENS1_9KeyHasherESt8equal_toIS2_EEE", !8, i64 0, !8, i64 8, !16, i64 16, !16, i64 20, !16, i64 24}
!31 = !{!"_ZTSN3JPH12UnorderedMapIN10RendererVK3KeyENS_5ArrayINS1_6MemoryENS_12STLAllocatorIS4_EEEENS1_9KeyHasherESt8equal_toIS2_EEE", !32, i64 0}
!32 = !{!"_ZTSN3JPH9HashTableIN10RendererVK3KeyESt4pairIS2_NS_5ArrayINS1_6MemoryENS_12STLAllocatorIS5_EEEEENS_18UnorderedMapDetailIS2_S8_EENS1_9KeyHasherESt8equal_toIS2_EEE", !8, i64 0, !8, i64 8, !16, i64 16, !16, i64 20, !16, i64 24}
!33 = !{!16, !16, i64 0}
!34 = !{!24, !24, i64 0}
!35 = !{!36, !36, i64 0}
!36 = !{!"_ZTS15VkColorSpaceKHR", !9, i64 0}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass