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

; 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.VkSubmitInfo = type { i32, ptr, i32, ptr, ptr, i32, ptr, i32, ptr }
%struct.VkPresentInfoKHR = type { i32, ptr, i32, ptr, i32, ptr, ptr, 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 }>

@__const._ZN10RendererVK8EndFrameEv.wait_stages = external hidden unnamed_addr constant [1 x i32], align 4

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

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

declare void @_Z18FatalErrorIfFailed8VkResult(i32 noundef) #1

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN10RendererVK16GetCommandBufferEv(ptr noundef nonnull align 16 dereferenceable(1936)) #4 align 2

declare void @vkCmdEndRenderPass(ptr noundef) #1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN10RendererVK8EndFrameEv(ptr noundef nonnull align 16 dereferenceable(1936) %0) unnamed_addr #4 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca [1 x ptr], align 8
  %5 = alloca [1 x ptr], align 8
  %6 = alloca [1 x i32], align 4
  %7 = alloca %struct.VkSubmitInfo, align 8
  %8 = alloca [1 x ptr], align 8
  %9 = alloca %struct.VkPresentInfoKHR, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %10 = load ptr, ptr %2, align 8
  %11 = getelementptr inbounds %class.RendererVK, ptr %10, i32 0, i32 11
  %12 = load ptr, ptr %11, align 8, !tbaa !9
  %13 = icmp eq ptr %12, null
  br i1 %13, label %14, label %15

14:                                               ; preds = %1
  call void @_ZN8Renderer8EndFrameEv(ptr noundef nonnull align 16 dereferenceable(832) %10)
  br label %66

15:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #5
  %16 = call noundef ptr @_ZN10RendererVK16GetCommandBufferEv(ptr noundef nonnull align 16 dereferenceable(1936) %10)
  store ptr %16, ptr %3, align 8, !tbaa !5
  %17 = load ptr, ptr %3, align 8, !tbaa !5
  call void @vkCmdEndRenderPass(ptr noundef %17)
  %18 = load ptr, ptr %3, align 8, !tbaa !5
  %19 = call i32 @vkEndCommandBuffer(ptr noundef %18)
  call void @_Z18FatalErrorIfFailed8VkResult(i32 noundef %19)
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #5
  %20 = getelementptr inbounds %class.RendererVK, ptr %10, i32 0, i32 35
  %21 = getelementptr inbounds %class.Renderer, ptr %10, i32 0, i32 9
  %22 = load i32, ptr %21, align 16, !tbaa !34
  %23 = zext i32 %22 to i64
  %24 = getelementptr inbounds [2 x ptr], ptr %20, i64 0, i64 %23
  %25 = load ptr, ptr %24, align 8, !tbaa !5
  store ptr %25, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  %26 = getelementptr inbounds %class.RendererVK, ptr %10, i32 0, i32 36
  %27 = getelementptr inbounds %class.Renderer, ptr %10, i32 0, i32 9
  %28 = load i32, ptr %27, align 16, !tbaa !34
  %29 = zext i32 %28 to i64
  %30 = getelementptr inbounds [2 x ptr], ptr %26, i64 0, i64 %29
  %31 = load ptr, ptr %30, align 8, !tbaa !5
  store ptr %31, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %6, ptr align 4 @__const._ZN10RendererVK8EndFrameEv.wait_stages, i64 4, i1 false)
  call void @llvm.lifetime.start.p0(i64 72, ptr %7) #5
  call void @llvm.memset.p0.i64(ptr align 8 %7, i8 0, i64 72, i1 false)
  %32 = getelementptr inbounds %struct.VkSubmitInfo, ptr %7, i32 0, i32 0
  store i32 4, ptr %32, align 8, !tbaa !35
  %33 = getelementptr inbounds %struct.VkSubmitInfo, ptr %7, i32 0, i32 2
  store i32 1, ptr %33, align 8, !tbaa !38
  %34 = getelementptr inbounds [1 x ptr], ptr %4, i64 0, i64 0
  %35 = getelementptr inbounds %struct.VkSubmitInfo, ptr %7, i32 0, i32 3
  store ptr %34, ptr %35, align 8, !tbaa !39
  %36 = getelementptr inbounds [1 x i32], ptr %6, i64 0, i64 0
  %37 = getelementptr inbounds %struct.VkSubmitInfo, ptr %7, i32 0, i32 4
  store ptr %36, ptr %37, align 8, !tbaa !40
  %38 = getelementptr inbounds %struct.VkSubmitInfo, ptr %7, i32 0, i32 5
  store i32 1, ptr %38, align 8, !tbaa !41
  %39 = getelementptr inbounds %struct.VkSubmitInfo, ptr %7, i32 0, i32 6
  store ptr %3, ptr %39, align 8, !tbaa !42
  %40 = getelementptr inbounds %struct.VkSubmitInfo, ptr %7, i32 0, i32 7
  store i32 1, ptr %40, align 8, !tbaa !43
  %41 = getelementptr inbounds [1 x ptr], ptr %5, i64 0, i64 0
  %42 = getelementptr inbounds %struct.VkSubmitInfo, ptr %7, i32 0, i32 8
  store ptr %41, ptr %42, align 8, !tbaa !44
  %43 = getelementptr inbounds %class.RendererVK, ptr %10, i32 0, i32 8
  %44 = load ptr, ptr %43, align 16, !tbaa !45
  %45 = getelementptr inbounds %class.RendererVK, ptr %10, i32 0, i32 37
  %46 = getelementptr inbounds %class.Renderer, ptr %10, i32 0, i32 9
  %47 = load i32, ptr %46, align 16, !tbaa !34
  %48 = zext i32 %47 to i64
  %49 = getelementptr inbounds [2 x ptr], ptr %45, i64 0, i64 %48
  %50 = load ptr, ptr %49, align 8, !tbaa !5
  %51 = call i32 @vkQueueSubmit(ptr noundef %44, i32 noundef 1, ptr noundef %7, ptr noundef %50)
  call void @_Z18FatalErrorIfFailed8VkResult(i32 noundef %51)
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %52 = getelementptr inbounds %class.RendererVK, ptr %10, i32 0, i32 11
  %53 = load ptr, ptr %52, align 8, !tbaa !9
  store ptr %53, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 64, ptr %9) #5
  call void @llvm.memset.p0.i64(ptr align 8 %9, i8 0, i64 64, i1 false)
  %54 = getelementptr inbounds %struct.VkPresentInfoKHR, ptr %9, i32 0, i32 0
  store i32 1000001001, ptr %54, align 8, !tbaa !46
  %55 = getelementptr inbounds %struct.VkPresentInfoKHR, ptr %9, i32 0, i32 2
  store i32 1, ptr %55, align 8, !tbaa !48
  %56 = getelementptr inbounds [1 x ptr], ptr %5, i64 0, i64 0
  %57 = getelementptr inbounds %struct.VkPresentInfoKHR, ptr %9, i32 0, i32 3
  store ptr %56, ptr %57, align 8, !tbaa !49
  %58 = getelementptr inbounds %struct.VkPresentInfoKHR, ptr %9, i32 0, i32 4
  store i32 1, ptr %58, align 8, !tbaa !50
  %59 = getelementptr inbounds [1 x ptr], ptr %8, i64 0, i64 0
  %60 = getelementptr inbounds %struct.VkPresentInfoKHR, ptr %9, i32 0, i32 5
  store ptr %59, ptr %60, align 8, !tbaa !51
  %61 = getelementptr inbounds %class.RendererVK, ptr %10, i32 0, i32 32
  %62 = getelementptr inbounds %struct.VkPresentInfoKHR, ptr %9, i32 0, i32 6
  store ptr %61, ptr %62, align 8, !tbaa !52
  %63 = getelementptr inbounds %class.RendererVK, ptr %10, i32 0, i32 9
  %64 = load ptr, ptr %63, align 8, !tbaa !53
  %65 = call i32 @vkQueuePresentKHR(ptr noundef %64, ptr noundef %9)
  call void @_ZN8Renderer8EndFrameEv(ptr noundef nonnull align 16 dereferenceable(832) %10)
  call void @llvm.lifetime.end.p0(i64 64, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 72, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  br label %66

66:                                               ; preds = %15, %14
  ret void
}

declare void @_ZN8Renderer8EndFrameEv(ptr noundef nonnull align 16 dereferenceable(832)) unnamed_addr #1

declare i32 @vkEndCommandBuffer(ptr noundef) #1

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

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

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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 = { 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 1416}
!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 = !{!11, !17, i64 272}
!35 = !{!36, !37, i64 0}
!36 = !{!"_ZTS12VkSubmitInfo", !37, i64 0, !6, i64 8, !17, i64 16, !6, i64 24, !6, i64 32, !17, i64 40, !6, i64 48, !17, i64 56, !6, i64 64}
!37 = !{!"_ZTS15VkStructureType", !7, i64 0}
!38 = !{!36, !17, i64 16}
!39 = !{!36, !6, i64 24}
!40 = !{!36, !6, i64 32}
!41 = !{!36, !17, i64 40}
!42 = !{!36, !6, i64 48}
!43 = !{!36, !17, i64 56}
!44 = !{!36, !6, i64 64}
!45 = !{!10, !6, i64 1392}
!46 = !{!47, !37, i64 0}
!47 = !{!"_ZTS16VkPresentInfoKHR", !37, i64 0, !6, i64 8, !17, i64 16, !6, i64 24, !17, i64 32, !6, i64 40, !6, i64 48, !6, i64 56}
!48 = !{!47, !17, i64 16}
!49 = !{!47, !6, i64 24}
!50 = !{!47, !17, i64 32}
!51 = !{!47, !6, i64 40}
!52 = !{!47, !6, i64 48}
!53 = !{!10, !6, i64 1400}


; 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.VkSubmitInfo = type { i32, ptr, i32, ptr, ptr, i32, ptr, i32, ptr }
%struct.VkPresentInfoKHR = type { i32, ptr, i32, ptr, i32, ptr, ptr, ptr }

@__const._ZN10RendererVK8EndFrameEv.wait_stages = external hidden unnamed_addr constant [1 x i32], align 4

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

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

declare void @_Z18FatalErrorIfFailed8VkResult(i32 noundef) local_unnamed_addr #1

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN10RendererVK16GetCommandBufferEv(ptr noundef nonnull align 16 dereferenceable(1936)) local_unnamed_addr #3 align 2

declare void @vkCmdEndRenderPass(ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN10RendererVK8EndFrameEv(ptr noundef nonnull align 16 dereferenceable(1936) %0) unnamed_addr #3 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca [1 x ptr], align 8
  %4 = alloca [1 x ptr], align 8
  %5 = alloca [1 x i32], align 4
  %6 = alloca %struct.VkSubmitInfo, align 8
  %7 = alloca [1 x ptr], align 8
  %8 = alloca %struct.VkPresentInfoKHR, align 8
  %9 = getelementptr inbounds i8, ptr %0, i64 1416
  %10 = load ptr, ptr %9, align 8, !tbaa !5
  %11 = icmp eq ptr %10, null
  br i1 %11, label %12, label %13

12:                                               ; preds = %1
  tail call void @_ZN8Renderer8EndFrameEv(ptr noundef nonnull align 16 dereferenceable(832) %0)
  br label %49

13:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #4
  %14 = tail call noundef ptr @_ZN10RendererVK16GetCommandBufferEv(ptr noundef nonnull align 16 dereferenceable(1936) %0)
  store ptr %14, ptr %2, align 8, !tbaa !33
  tail call void @vkCmdEndRenderPass(ptr noundef %14)
  %15 = tail call i32 @vkEndCommandBuffer(ptr noundef %14)
  tail call void @_Z18FatalErrorIfFailed8VkResult(i32 noundef %15)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #4
  %16 = getelementptr inbounds i8, ptr %0, i64 1680
  %17 = getelementptr inbounds i8, ptr %0, i64 272
  %18 = load i32, ptr %17, align 16, !tbaa !34
  %19 = zext i32 %18 to i64
  %20 = getelementptr inbounds [2 x ptr], ptr %16, i64 0, i64 %19
  %21 = load ptr, ptr %20, align 8, !tbaa !33
  store ptr %21, ptr %3, align 8, !tbaa !33
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #4
  %22 = getelementptr inbounds i8, ptr %0, i64 1696
  %23 = getelementptr inbounds [2 x ptr], ptr %22, i64 0, i64 %19
  %24 = load ptr, ptr %23, align 8, !tbaa !33
  store ptr %24, ptr %4, align 8, !tbaa !33
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #4
  %25 = load i32, ptr @__const._ZN10RendererVK8EndFrameEv.wait_stages, align 4
  store i32 %25, ptr %5, align 4
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %6) #4
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(72) %6, i8 0, i64 64, i1 false)
  store i32 4, ptr %6, align 8, !tbaa !35
  %26 = getelementptr inbounds i8, ptr %6, i64 16
  store i32 1, ptr %26, align 8, !tbaa !38
  %27 = getelementptr inbounds i8, ptr %6, i64 24
  store ptr %3, ptr %27, align 8, !tbaa !39
  %28 = getelementptr inbounds i8, ptr %6, i64 32
  store ptr %5, ptr %28, align 8, !tbaa !40
  %29 = getelementptr inbounds i8, ptr %6, i64 40
  store i32 1, ptr %29, align 8, !tbaa !41
  %30 = getelementptr inbounds i8, ptr %6, i64 48
  store ptr %2, ptr %30, align 8, !tbaa !42
  %31 = getelementptr inbounds i8, ptr %6, i64 56
  store i32 1, ptr %31, align 8, !tbaa !43
  %32 = getelementptr inbounds i8, ptr %6, i64 64
  store ptr %4, ptr %32, align 8, !tbaa !44
  %33 = getelementptr inbounds i8, ptr %0, i64 1392
  %34 = load ptr, ptr %33, align 16, !tbaa !45
  %35 = getelementptr inbounds i8, ptr %0, i64 1712
  %36 = getelementptr inbounds [2 x ptr], ptr %35, i64 0, i64 %19
  %37 = load ptr, ptr %36, align 8, !tbaa !33
  %38 = call i32 @vkQueueSubmit(ptr noundef %34, i32 noundef 1, ptr noundef nonnull %6, ptr noundef %37)
  call void @_Z18FatalErrorIfFailed8VkResult(i32 noundef %38)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #4
  %39 = load ptr, ptr %9, align 8, !tbaa !5
  store ptr %39, ptr %7, align 8, !tbaa !33
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %8) #4
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(64) %8, i8 0, i64 64, i1 false)
  store i32 1000001001, ptr %8, align 8, !tbaa !46
  %40 = getelementptr inbounds i8, ptr %8, i64 16
  store i32 1, ptr %40, align 8, !tbaa !48
  %41 = getelementptr inbounds i8, ptr %8, i64 24
  store ptr %4, ptr %41, align 8, !tbaa !49
  %42 = getelementptr inbounds i8, ptr %8, i64 32
  store i32 1, ptr %42, align 8, !tbaa !50
  %43 = getelementptr inbounds i8, ptr %8, i64 40
  store ptr %7, ptr %43, align 8, !tbaa !51
  %44 = getelementptr inbounds i8, ptr %0, i64 1648
  %45 = getelementptr inbounds i8, ptr %8, i64 48
  store ptr %44, ptr %45, align 8, !tbaa !52
  %46 = getelementptr inbounds i8, ptr %0, i64 1400
  %47 = load ptr, ptr %46, align 8, !tbaa !53
  %48 = call i32 @vkQueuePresentKHR(ptr noundef %47, ptr noundef nonnull %8)
  call void @_ZN8Renderer8EndFrameEv(ptr noundef nonnull align 16 dereferenceable(832) %0)
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #4
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #4
  br label %49

49:                                               ; preds = %13, %12
  ret void
}

declare void @_ZN8Renderer8EndFrameEv(ptr noundef nonnull align 16 dereferenceable(832)) unnamed_addr #1

declare i32 @vkEndCommandBuffer(ptr noundef) local_unnamed_addr #1

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

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

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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { 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 1416}
!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 = !{!8, !8, i64 0}
!34 = !{!7, !16, i64 272}
!35 = !{!36, !37, i64 0}
!36 = !{!"_ZTS12VkSubmitInfo", !37, i64 0, !8, i64 8, !16, i64 16, !8, i64 24, !8, i64 32, !16, i64 40, !8, i64 48, !16, i64 56, !8, i64 64}
!37 = !{!"_ZTS15VkStructureType", !9, i64 0}
!38 = !{!36, !16, i64 16}
!39 = !{!36, !8, i64 24}
!40 = !{!36, !8, i64 32}
!41 = !{!36, !16, i64 40}
!42 = !{!36, !8, i64 48}
!43 = !{!36, !16, i64 56}
!44 = !{!36, !8, i64 64}
!45 = !{!6, !8, i64 1392}
!46 = !{!47, !37, i64 0}
!47 = !{!"_ZTS16VkPresentInfoKHR", !37, i64 0, !8, i64 8, !16, i64 16, !8, i64 24, !16, i64 32, !8, i64 40, !8, i64 48, !8, i64 56}
!48 = !{!47, !16, i64 16}
!49 = !{!47, !8, i64 24}
!50 = !{!47, !16, i64 32}
!51 = !{!47, !8, i64 40}
!52 = !{!47, !8, i64 48}
!53 = !{!6, !8, i64 1400}


; Effective O3 passes: DSEPass,EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,TailCallElimPass