; LLVM IR from hadryansalles/Luz :: deps/imgui (imgui_impl_vulkan)

; 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.VkCommandPoolCreateInfo = type { i32, ptr, i32, i32 }
%struct.VkCommandBufferAllocateInfo = type { i32, ptr, ptr, i32, i32 }
%struct.VkFenceCreateInfo = type { i32, ptr, i32 }
%struct.VkSemaphoreCreateInfo = type { i32, ptr, i32 }
%struct.ImGui_ImplVulkanH_Window = type { i32, i32, ptr, ptr, %struct.VkSurfaceFormatKHR, i32, ptr, ptr, i8, i8, %union.VkClearValue, i32, i32, i32, i32, ptr, ptr }
%struct.VkSurfaceFormatKHR = type { i32, i32 }
%union.VkClearValue = type { %union.VkClearColorValue }
%union.VkClearColorValue = type { [4 x float] }
%struct.ImGui_ImplVulkanH_Frame = type { ptr, ptr, ptr, ptr, ptr, ptr }
%struct.ImGui_ImplVulkanH_FrameSemaphores = type { ptr, ptr }

@.str.1 = external hidden unnamed_addr constant [84 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [48 x i8], align 1
@__PRETTY_FUNCTION__._Z44ImGui_ImplVulkanH_CreateWindowCommandBuffersP18VkPhysicalDevice_TP10VkDevice_TP24ImGui_ImplVulkanH_WindowjPK21VkAllocationCallbacks = external hidden unnamed_addr constant [147 x i8], align 1

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr 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: mustprogress uwtable
declare hidden void @_ZL15check_vk_result8VkResult(i32 noundef) #3

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

declare i32 @vkCreateCommandPool(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #4

declare i32 @vkAllocateCommandBuffers(ptr noundef, ptr noundef, ptr noundef) #4

; Function Attrs: mustprogress uwtable
define dso_local void @_Z44ImGui_ImplVulkanH_CreateWindowCommandBuffersP18VkPhysicalDevice_TP10VkDevice_TP24ImGui_ImplVulkanH_WindowjPK21VkAllocationCallbacks(ptr noundef %0, ptr noundef %1, ptr noundef %2, i32 noundef %3, ptr noundef %4) #3 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca %struct.VkCommandPoolCreateInfo, align 8
  %15 = alloca %struct.VkCommandBufferAllocateInfo, align 8
  %16 = alloca %struct.VkFenceCreateInfo, align 8
  %17 = alloca i32, align 4
  %18 = alloca ptr, align 8
  %19 = alloca %struct.VkSemaphoreCreateInfo, align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store i32 %3, ptr %9, align 4, !tbaa !9
  store ptr %4, ptr %10, align 8, !tbaa !5
  %20 = load ptr, ptr %6, align 8, !tbaa !5
  %21 = icmp ne ptr %20, null
  br i1 %21, label %22, label %25

22:                                               ; preds = %5
  %23 = load ptr, ptr %7, align 8, !tbaa !5
  %24 = icmp ne ptr %23, null
  br label %25

25:                                               ; preds = %22, %5
  %26 = phi i1 [ false, %5 ], [ %24, %22 ]
  br i1 %26, label %27, label %28

27:                                               ; preds = %25
  br label %30

28:                                               ; preds = %25
  call void @__assert_fail(ptr noundef @.str.30, ptr noundef @.str.1, i32 noundef 1357, ptr noundef @__PRETTY_FUNCTION__._Z44ImGui_ImplVulkanH_CreateWindowCommandBuffersP18VkPhysicalDevice_TP10VkDevice_TP24ImGui_ImplVulkanH_WindowjPK21VkAllocationCallbacks) #5
  unreachable

29:                                               ; No predecessors!
  br label %30

30:                                               ; preds = %29, %27
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %31

31:                                               ; preds = %75, %30
  %32 = load i32, ptr %12, align 4, !tbaa !9
  %33 = load ptr, ptr %8, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.ImGui_ImplVulkanH_Window, ptr %33, i32 0, i32 12
  %35 = load i32, ptr %34, align 8, !tbaa !11
  %36 = icmp ult i32 %32, %35
  br i1 %36, label %38, label %37

37:                                               ; preds = %31
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %78

38:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %39 = load ptr, ptr %8, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.ImGui_ImplVulkanH_Window, ptr %39, i32 0, i32 15
  %41 = load ptr, ptr %40, align 8, !tbaa !18
  %42 = load i32, ptr %12, align 4, !tbaa !9
  %43 = zext i32 %42 to i64
  %44 = getelementptr inbounds %struct.ImGui_ImplVulkanH_Frame, ptr %41, i64 %43
  store ptr %44, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %14) #6
  call void @llvm.memset.p0.i64(ptr align 8 %14, i8 0, i64 24, i1 false)
  %45 = getelementptr inbounds %struct.VkCommandPoolCreateInfo, ptr %14, i32 0, i32 0
  store i32 39, ptr %45, align 8, !tbaa !19
  %46 = getelementptr inbounds %struct.VkCommandPoolCreateInfo, ptr %14, i32 0, i32 2
  store i32 0, ptr %46, align 8, !tbaa !22
  %47 = load i32, ptr %9, align 4, !tbaa !9
  %48 = getelementptr inbounds %struct.VkCommandPoolCreateInfo, ptr %14, i32 0, i32 3
  store i32 %47, ptr %48, align 4, !tbaa !23
  %49 = load ptr, ptr %7, align 8, !tbaa !5
  %50 = load ptr, ptr %10, align 8, !tbaa !5
  %51 = load ptr, ptr %13, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.ImGui_ImplVulkanH_Frame, ptr %51, i32 0, i32 0
  %53 = call i32 @vkCreateCommandPool(ptr noundef %49, ptr noundef %14, ptr noundef %50, ptr noundef %52)
  store i32 %53, ptr %11, align 4, !tbaa !24
  %54 = load i32, ptr %11, align 4, !tbaa !24
  call void @_ZL15check_vk_result8VkResult(i32 noundef %54)
  call void @llvm.lifetime.end.p0(i64 24, ptr %14) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr %15) #6
  call void @llvm.memset.p0.i64(ptr align 8 %15, i8 0, i64 32, i1 false)
  %55 = getelementptr inbounds %struct.VkCommandBufferAllocateInfo, ptr %15, i32 0, i32 0
  store i32 40, ptr %55, align 8, !tbaa !26
  %56 = load ptr, ptr %13, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.ImGui_ImplVulkanH_Frame, ptr %56, i32 0, i32 0
  %58 = load ptr, ptr %57, align 8, !tbaa !29
  %59 = getelementptr inbounds %struct.VkCommandBufferAllocateInfo, ptr %15, i32 0, i32 2
  store ptr %58, ptr %59, align 8, !tbaa !31
  %60 = getelementptr inbounds %struct.VkCommandBufferAllocateInfo, ptr %15, i32 0, i32 3
  store i32 0, ptr %60, align 8, !tbaa !32
  %61 = getelementptr inbounds %struct.VkCommandBufferAllocateInfo, ptr %15, i32 0, i32 4
  store i32 1, ptr %61, align 4, !tbaa !33
  %62 = load ptr, ptr %7, align 8, !tbaa !5
  %63 = load ptr, ptr %13, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.ImGui_ImplVulkanH_Frame, ptr %63, i32 0, i32 1
  %65 = call i32 @vkAllocateCommandBuffers(ptr noundef %62, ptr noundef %15, ptr noundef %64)
  store i32 %65, ptr %11, align 4, !tbaa !24
  %66 = load i32, ptr %11, align 4, !tbaa !24
  call void @_ZL15check_vk_result8VkResult(i32 noundef %66)
  call void @llvm.lifetime.end.p0(i64 32, ptr %15) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr %16) #6
  call void @llvm.memset.p0.i64(ptr align 8 %16, i8 0, i64 24, i1 false)
  %67 = getelementptr inbounds %struct.VkFenceCreateInfo, ptr %16, i32 0, i32 0
  store i32 8, ptr %67, align 8, !tbaa !34
  %68 = getelementptr inbounds %struct.VkFenceCreateInfo, ptr %16, i32 0, i32 2
  store i32 1, ptr %68, align 8, !tbaa !36
  %69 = load ptr, ptr %7, align 8, !tbaa !5
  %70 = load ptr, ptr %10, align 8, !tbaa !5
  %71 = load ptr, ptr %13, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.ImGui_ImplVulkanH_Frame, ptr %71, i32 0, i32 2
  %73 = call i32 @vkCreateFence(ptr noundef %69, ptr noundef %16, ptr noundef %70, ptr noundef %72)
  store i32 %73, ptr %11, align 4, !tbaa !24
  %74 = load i32, ptr %11, align 4, !tbaa !24
  call void @_ZL15check_vk_result8VkResult(i32 noundef %74)
  call void @llvm.lifetime.end.p0(i64 24, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  br label %75

75:                                               ; preds = %38
  %76 = load i32, ptr %12, align 4, !tbaa !9
  %77 = add i32 %76, 1
  store i32 %77, ptr %12, align 4, !tbaa !9
  br label %31, !llvm.loop !37

78:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  store i32 0, ptr %17, align 4, !tbaa !9
  br label %79

79:                                               ; preds = %106, %78
  %80 = load i32, ptr %17, align 4, !tbaa !9
  %81 = load ptr, ptr %8, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.ImGui_ImplVulkanH_Window, ptr %81, i32 0, i32 13
  %83 = load i32, ptr %82, align 4, !tbaa !39
  %84 = icmp ult i32 %80, %83
  br i1 %84, label %86, label %85

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

86:                                               ; preds = %79
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  %87 = load ptr, ptr %8, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.ImGui_ImplVulkanH_Window, ptr %87, i32 0, i32 16
  %89 = load ptr, ptr %88, align 8, !tbaa !40
  %90 = load i32, ptr %17, align 4, !tbaa !9
  %91 = zext i32 %90 to i64
  %92 = getelementptr inbounds %struct.ImGui_ImplVulkanH_FrameSemaphores, ptr %89, i64 %91
  store ptr %92, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %19) #6
  call void @llvm.memset.p0.i64(ptr align 8 %19, i8 0, i64 24, i1 false)
  %93 = getelementptr inbounds %struct.VkSemaphoreCreateInfo, ptr %19, i32 0, i32 0
  store i32 9, ptr %93, align 8, !tbaa !41
  %94 = load ptr, ptr %7, align 8, !tbaa !5
  %95 = load ptr, ptr %10, align 8, !tbaa !5
  %96 = load ptr, ptr %18, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.ImGui_ImplVulkanH_FrameSemaphores, ptr %96, i32 0, i32 0
  %98 = call i32 @vkCreateSemaphore(ptr noundef %94, ptr noundef %19, ptr noundef %95, ptr noundef %97)
  store i32 %98, ptr %11, align 4, !tbaa !24
  %99 = load i32, ptr %11, align 4, !tbaa !24
  call void @_ZL15check_vk_result8VkResult(i32 noundef %99)
  %100 = load ptr, ptr %7, align 8, !tbaa !5
  %101 = load ptr, ptr %10, align 8, !tbaa !5
  %102 = load ptr, ptr %18, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.ImGui_ImplVulkanH_FrameSemaphores, ptr %102, i32 0, i32 1
  %104 = call i32 @vkCreateSemaphore(ptr noundef %100, ptr noundef %19, ptr noundef %101, ptr noundef %103)
  store i32 %104, ptr %11, align 4, !tbaa !24
  %105 = load i32, ptr %11, align 4, !tbaa !24
  call void @_ZL15check_vk_result8VkResult(i32 noundef %105)
  call void @llvm.lifetime.end.p0(i64 24, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  br label %106

106:                                              ; preds = %86
  %107 = load i32, ptr %17, align 4, !tbaa !9
  %108 = add i32 %107, 1
  store i32 %108, ptr %17, align 4, !tbaa !9
  br label %79, !llvm.loop !43

109:                                              ; preds = %85
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  ret void
}

declare i32 @vkCreateFence(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #4

declare i32 @vkCreateSemaphore(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #4

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 = { "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 = { noreturn nounwind }
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, !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 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 80}
!12 = !{!"_ZTS24ImGui_ImplVulkanH_Window", !10, i64 0, !10, i64 4, !6, i64 8, !6, i64 16, !13, i64 24, !16, i64 32, !6, i64 40, !6, i64 48, !17, i64 56, !17, i64 57, !7, i64 60, !10, i64 76, !10, i64 80, !10, i64 84, !10, i64 88, !6, i64 96, !6, i64 104}
!13 = !{!"_ZTS18VkSurfaceFormatKHR", !14, i64 0, !15, i64 4}
!14 = !{!"_ZTS8VkFormat", !7, i64 0}
!15 = !{!"_ZTS15VkColorSpaceKHR", !7, i64 0}
!16 = !{!"_ZTS16VkPresentModeKHR", !7, i64 0}
!17 = !{!"bool", !7, i64 0}
!18 = !{!12, !6, i64 96}
!19 = !{!20, !21, i64 0}
!20 = !{!"_ZTS23VkCommandPoolCreateInfo", !21, i64 0, !6, i64 8, !10, i64 16, !10, i64 20}
!21 = !{!"_ZTS15VkStructureType", !7, i64 0}
!22 = !{!20, !10, i64 16}
!23 = !{!20, !10, i64 20}
!24 = !{!25, !25, i64 0}
!25 = !{!"_ZTS8VkResult", !7, i64 0}
!26 = !{!27, !21, i64 0}
!27 = !{!"_ZTS27VkCommandBufferAllocateInfo", !21, i64 0, !6, i64 8, !6, i64 16, !28, i64 24, !10, i64 28}
!28 = !{!"_ZTS20VkCommandBufferLevel", !7, i64 0}
!29 = !{!30, !6, i64 0}
!30 = !{!"_ZTS23ImGui_ImplVulkanH_Frame", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40}
!31 = !{!27, !6, i64 16}
!32 = !{!27, !28, i64 24}
!33 = !{!27, !10, i64 28}
!34 = !{!35, !21, i64 0}
!35 = !{!"_ZTS17VkFenceCreateInfo", !21, i64 0, !6, i64 8, !10, i64 16}
!36 = !{!35, !10, i64 16}
!37 = distinct !{!37, !38}
!38 = !{!"llvm.loop.mustprogress"}
!39 = !{!12, !10, i64 84}
!40 = !{!12, !6, i64 104}
!41 = !{!42, !21, i64 0}
!42 = !{!"_ZTS21VkSemaphoreCreateInfo", !21, i64 0, !6, i64 8, !10, i64 16}
!43 = distinct !{!43, !38}


; 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.VkCommandPoolCreateInfo = type { i32, ptr, i32, i32 }
%struct.VkCommandBufferAllocateInfo = type { i32, ptr, ptr, i32, i32 }
%struct.VkFenceCreateInfo = type { i32, ptr, i32 }
%struct.VkSemaphoreCreateInfo = type { i32, ptr, i32 }
%struct.ImGui_ImplVulkanH_Frame = type { ptr, ptr, ptr, ptr, ptr, ptr }
%struct.ImGui_ImplVulkanH_FrameSemaphores = type { ptr, ptr }

@.str.1 = external hidden unnamed_addr constant [84 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [48 x i8], align 1
@__PRETTY_FUNCTION__._Z44ImGui_ImplVulkanH_CreateWindowCommandBuffersP18VkPhysicalDevice_TP10VkDevice_TP24ImGui_ImplVulkanH_WindowjPK21VkAllocationCallbacks = external hidden unnamed_addr constant [147 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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr 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 hidden void @_ZL15check_vk_result8VkResult(i32 noundef) local_unnamed_addr #3

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

declare i32 @vkCreateCommandPool(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

declare i32 @vkAllocateCommandBuffers(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
define dso_local void @_Z44ImGui_ImplVulkanH_CreateWindowCommandBuffersP18VkPhysicalDevice_TP10VkDevice_TP24ImGui_ImplVulkanH_WindowjPK21VkAllocationCallbacks(ptr noundef readnone %0, ptr noundef %1, ptr nocapture noundef readonly %2, i32 noundef %3, ptr noundef %4) local_unnamed_addr #3 {
  %6 = alloca %struct.VkCommandPoolCreateInfo, align 8
  %7 = alloca %struct.VkCommandBufferAllocateInfo, align 8
  %8 = alloca %struct.VkFenceCreateInfo, align 8
  %9 = alloca %struct.VkSemaphoreCreateInfo, align 8
  %10 = icmp ne ptr %0, null
  %11 = icmp ne ptr %1, null
  %12 = and i1 %10, %11
  br i1 %12, label %.preheader34, label %21

.preheader34:                                     ; preds = %5
  %13 = getelementptr inbounds i8, ptr %2, i64 80
  %14 = load i32, ptr %13, align 8, !tbaa !5
  %.not = icmp eq i32 %14, 0
  br i1 %.not, label %.preheader, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader34
  %15 = getelementptr inbounds i8, ptr %2, i64 96
  %16 = getelementptr inbounds i8, ptr %6, i64 16
  %17 = getelementptr inbounds i8, ptr %6, i64 20
  %18 = getelementptr inbounds i8, ptr %7, i64 16
  %19 = getelementptr inbounds i8, ptr %7, i64 28
  %20 = getelementptr inbounds i8, ptr %8, i64 16
  br label %25

21:                                               ; preds = %5
  tail call void @__assert_fail(ptr noundef nonnull @.str.30, ptr noundef nonnull @.str.1, i32 noundef 1357, ptr noundef nonnull @__PRETTY_FUNCTION__._Z44ImGui_ImplVulkanH_CreateWindowCommandBuffersP18VkPhysicalDevice_TP10VkDevice_TP24ImGui_ImplVulkanH_WindowjPK21VkAllocationCallbacks) #5
  unreachable

.preheader:                                       ; preds = %25, %.preheader34
  %22 = getelementptr inbounds i8, ptr %2, i64 84
  %23 = load i32, ptr %22, align 4, !tbaa !16
  %.not38 = icmp eq i32 %23, 0
  br i1 %.not38, label %._crit_edge, label %.lr.ph37

.lr.ph37:                                         ; preds = %.preheader
  %24 = getelementptr inbounds i8, ptr %2, i64 104
  br label %37

25:                                               ; preds = %.lr.ph, %25
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %25 ]
  %26 = load ptr, ptr %15, align 8, !tbaa !17
  %27 = getelementptr inbounds %struct.ImGui_ImplVulkanH_Frame, ptr %26, i64 %indvars.iv
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %6, i8 0, i64 16, i1 false)
  store i32 39, ptr %6, align 8, !tbaa !18
  store i32 0, ptr %16, align 8, !tbaa !21
  store i32 %3, ptr %17, align 4, !tbaa !22
  %28 = call i32 @vkCreateCommandPool(ptr noundef nonnull %1, ptr noundef nonnull %6, ptr noundef %4, ptr noundef %27)
  call void @_ZL15check_vk_result8VkResult(i32 noundef %28)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %7) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(32) %7, i8 0, i64 32, i1 false)
  store i32 40, ptr %7, align 8, !tbaa !23
  %29 = load ptr, ptr %27, align 8, !tbaa !26
  store ptr %29, ptr %18, align 8, !tbaa !28
  store i32 1, ptr %19, align 4, !tbaa !29
  %30 = getelementptr inbounds i8, ptr %27, i64 8
  %31 = call i32 @vkAllocateCommandBuffers(ptr noundef nonnull %1, ptr noundef nonnull %7, ptr noundef nonnull %30)
  call void @_ZL15check_vk_result8VkResult(i32 noundef %31)
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %8, i8 0, i64 24, i1 false)
  store i32 8, ptr %8, align 8, !tbaa !30
  store i32 1, ptr %20, align 8, !tbaa !32
  %32 = getelementptr inbounds i8, ptr %27, i64 16
  %33 = call i32 @vkCreateFence(ptr noundef nonnull %1, ptr noundef nonnull %8, ptr noundef %4, ptr noundef nonnull %32)
  call void @_ZL15check_vk_result8VkResult(i32 noundef %33)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #6
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %34 = load i32, ptr %13, align 8, !tbaa !5
  %35 = zext i32 %34 to i64
  %36 = icmp ult i64 %indvars.iv.next, %35
  br i1 %36, label %25, label %.preheader, !llvm.loop !33

._crit_edge:                                      ; preds = %37, %.preheader
  ret void

37:                                               ; preds = %.lr.ph37, %37
  %indvars.iv40 = phi i64 [ 0, %.lr.ph37 ], [ %indvars.iv.next41, %37 ]
  %38 = load ptr, ptr %24, align 8, !tbaa !35
  %39 = getelementptr inbounds %struct.ImGui_ImplVulkanH_FrameSemaphores, ptr %38, i64 %indvars.iv40
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %9) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %9, i8 0, i64 24, i1 false)
  store i32 9, ptr %9, align 8, !tbaa !36
  %40 = call i32 @vkCreateSemaphore(ptr noundef nonnull %1, ptr noundef nonnull %9, ptr noundef %4, ptr noundef %39)
  call void @_ZL15check_vk_result8VkResult(i32 noundef %40)
  %41 = getelementptr inbounds i8, ptr %39, i64 8
  %42 = call i32 @vkCreateSemaphore(ptr noundef nonnull %1, ptr noundef nonnull %9, ptr noundef %4, ptr noundef nonnull %41)
  call void @_ZL15check_vk_result8VkResult(i32 noundef %42)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #6
  %indvars.iv.next41 = add nuw nsw i64 %indvars.iv40, 1
  %43 = load i32, ptr %22, align 4, !tbaa !16
  %44 = zext i32 %43 to i64
  %45 = icmp ult i64 %indvars.iv.next41, %44
  br i1 %45, label %37, label %._crit_edge, !llvm.loop !38
}

declare i32 @vkCreateFence(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

declare i32 @vkCreateSemaphore(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress 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 = { "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 = { noreturn nounwind }
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, !7, i64 80}
!6 = !{!"_ZTS24ImGui_ImplVulkanH_Window", !7, i64 0, !7, i64 4, !10, i64 8, !10, i64 16, !11, i64 24, !14, i64 32, !10, i64 40, !10, i64 48, !15, i64 56, !15, i64 57, !8, i64 60, !7, i64 76, !7, i64 80, !7, i64 84, !7, i64 88, !10, i64 96, !10, i64 104}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"_ZTS18VkSurfaceFormatKHR", !12, i64 0, !13, i64 4}
!12 = !{!"_ZTS8VkFormat", !8, i64 0}
!13 = !{!"_ZTS15VkColorSpaceKHR", !8, i64 0}
!14 = !{!"_ZTS16VkPresentModeKHR", !8, i64 0}
!15 = !{!"bool", !8, i64 0}
!16 = !{!6, !7, i64 84}
!17 = !{!6, !10, i64 96}
!18 = !{!19, !20, i64 0}
!19 = !{!"_ZTS23VkCommandPoolCreateInfo", !20, i64 0, !10, i64 8, !7, i64 16, !7, i64 20}
!20 = !{!"_ZTS15VkStructureType", !8, i64 0}
!21 = !{!19, !7, i64 16}
!22 = !{!19, !7, i64 20}
!23 = !{!24, !20, i64 0}
!24 = !{!"_ZTS27VkCommandBufferAllocateInfo", !20, i64 0, !10, i64 8, !10, i64 16, !25, i64 24, !7, i64 28}
!25 = !{!"_ZTS20VkCommandBufferLevel", !8, i64 0}
!26 = !{!27, !10, i64 0}
!27 = !{!"_ZTS23ImGui_ImplVulkanH_Frame", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40}
!28 = !{!24, !10, i64 16}
!29 = !{!24, !7, i64 28}
!30 = !{!31, !20, i64 0}
!31 = !{!"_ZTS17VkFenceCreateInfo", !20, i64 0, !10, i64 8, !7, i64 16}
!32 = !{!31, !7, i64 16}
!33 = distinct !{!33, !34}
!34 = !{!"llvm.loop.mustprogress"}
!35 = !{!6, !10, i64 104}
!36 = !{!37, !20, i64 0}
!37 = !{!"_ZTS21VkSemaphoreCreateInfo", !20, i64 0, !10, i64 8, !7, i64 16}
!38 = distinct !{!38, !34}


; Effective O3 passes: CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass