; 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.VkSurfaceFormatKHR = type { i32, i32 }
%struct.ImVector.10 = type { i32, i32, ptr }

@.str.1 = external hidden unnamed_addr constant [84 x i8], align 1
@_ZL17g_FunctionsLoaded = external hidden global i8, align 1
@.str.4 = external hidden unnamed_addr constant [133 x i8], align 1
@__PRETTY_FUNCTION__._Z37ImGui_ImplVulkanH_SelectSurfaceFormatP18VkPhysicalDevice_TP14VkSurfaceKHR_TPK8VkFormati15VkColorSpaceKHR = external hidden unnamed_addr constant [129 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [26 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: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
define dso_local i64 @_Z37ImGui_ImplVulkanH_SelectSurfaceFormatP18VkPhysicalDevice_TP14VkSurfaceKHR_TPK8VkFormati15VkColorSpaceKHR(ptr noundef %0, ptr noundef %1, ptr noundef %2, i32 noundef %3, i32 noundef %4) #3 personality ptr @__gxx_personality_v0 {
  %6 = alloca %struct.VkSurfaceFormatKHR, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca %struct.ImVector.10, align 8
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  store ptr %2, ptr %9, align 8, !tbaa !5
  store i32 %3, ptr %10, align 4, !tbaa !9
  store i32 %4, ptr %11, align 4, !tbaa !11
  %19 = load i8, ptr @_ZL17g_FunctionsLoaded, align 1, !tbaa !13, !range !15, !noundef !16
  %20 = trunc i8 %19 to i1
  br i1 %20, label %21, label %22

21:                                               ; preds = %5
  br label %22

22:                                               ; preds = %21, %5
  %23 = phi i1 [ false, %5 ], [ true, %21 ]
  br i1 %23, label %24, label %25

24:                                               ; preds = %22
  br label %27

25:                                               ; preds = %22
  call void @__assert_fail(ptr noundef @.str.4, ptr noundef @.str.1, i32 noundef 1289, ptr noundef @__PRETTY_FUNCTION__._Z37ImGui_ImplVulkanH_SelectSurfaceFormatP18VkPhysicalDevice_TP14VkSurfaceKHR_TPK8VkFormati15VkColorSpaceKHR) #7
  unreachable

26:                                               ; No predecessors!
  br label %27

27:                                               ; preds = %26, %24
  %28 = load ptr, ptr %9, align 8, !tbaa !5
  %29 = icmp ne ptr %28, null
  br i1 %29, label %30, label %31

30:                                               ; preds = %27
  br label %33

31:                                               ; preds = %27
  call void @__assert_fail(ptr noundef @.str.26, ptr noundef @.str.1, i32 noundef 1290, ptr noundef @__PRETTY_FUNCTION__._Z37ImGui_ImplVulkanH_SelectSurfaceFormatP18VkPhysicalDevice_TP14VkSurfaceKHR_TPK8VkFormati15VkColorSpaceKHR) #7
  unreachable

32:                                               ; No predecessors!
  br label %33

33:                                               ; preds = %32, %30
  %34 = load i32, ptr %10, align 4, !tbaa !9
  %35 = icmp sgt i32 %34, 0
  br i1 %35, label %36, label %37

36:                                               ; preds = %33
  br label %39

37:                                               ; preds = %33
  call void @__assert_fail(ptr noundef @.str.27, ptr noundef @.str.1, i32 noundef 1291, ptr noundef @__PRETTY_FUNCTION__._Z37ImGui_ImplVulkanH_SelectSurfaceFormatP18VkPhysicalDevice_TP14VkSurfaceKHR_TPK8VkFormati15VkColorSpaceKHR) #7
  unreachable

38:                                               ; No predecessors!
  br label %39

39:                                               ; preds = %38, %36
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #8
  %40 = load ptr, ptr %7, align 8, !tbaa !5
  %41 = load ptr, ptr %8, align 8, !tbaa !5
  %42 = call i32 @vkGetPhysicalDeviceSurfaceFormatsKHR(ptr noundef %40, ptr noundef %41, ptr noundef %12, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 16, ptr %13) #8
  call void @_ZN8ImVectorI18VkSurfaceFormatKHREC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %13)
  %43 = load i32, ptr %12, align 4, !tbaa !9
  invoke void @_ZN8ImVectorI18VkSurfaceFormatKHRE6resizeEi(ptr noundef nonnull align 8 dereferenceable(16) %13, i32 noundef %43)
          to label %44 unwind label %66

44:                                               ; preds = %39
  %45 = load ptr, ptr %7, align 8, !tbaa !5
  %46 = load ptr, ptr %8, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.ImVector.10, ptr %13, i32 0, i32 2
  %48 = load ptr, ptr %47, align 8, !tbaa !17
  %49 = invoke i32 @vkGetPhysicalDeviceSurfaceFormatsKHR(ptr noundef %45, ptr noundef %46, ptr noundef %12, ptr noundef %48)
          to label %50 unwind label %66

50:                                               ; preds = %44
  %51 = load i32, ptr %12, align 4, !tbaa !9
  %52 = icmp eq i32 %51, 1
  br i1 %52, label %53, label %73

53:                                               ; preds = %50
  %54 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZN8ImVectorI18VkSurfaceFormatKHREixEi(ptr noundef nonnull align 8 dereferenceable(16) %13, i32 noundef 0)
          to label %55 unwind label %66

55:                                               ; preds = %53
  %56 = getelementptr inbounds %struct.VkSurfaceFormatKHR, ptr %54, i32 0, i32 0
  %57 = load i32, ptr %56, align 4, !tbaa !19
  %58 = icmp eq i32 %57, 0
  br i1 %58, label %59, label %70

59:                                               ; preds = %55
  %60 = load ptr, ptr %9, align 8, !tbaa !5
  %61 = getelementptr inbounds i32, ptr %60, i64 0
  %62 = load i32, ptr %61, align 4, !tbaa !22
  %63 = getelementptr inbounds %struct.VkSurfaceFormatKHR, ptr %6, i32 0, i32 0
  store i32 %62, ptr %63, align 4, !tbaa !19
  %64 = load i32, ptr %11, align 4, !tbaa !11
  %65 = getelementptr inbounds %struct.VkSurfaceFormatKHR, ptr %6, i32 0, i32 1
  store i32 %64, ptr %65, align 4, !tbaa !23
  store i32 1, ptr %16, align 4
  br label %128

66:                                               ; preds = %125, %70, %53, %44, %39
  %67 = landingpad { ptr, i32 }
          cleanup
  %68 = extractvalue { ptr, i32 } %67, 0
  store ptr %68, ptr %14, align 8
  %69 = extractvalue { ptr, i32 } %67, 1
  store i32 %69, ptr %15, align 4
  br label %130

70:                                               ; preds = %55
  %71 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZN8ImVectorI18VkSurfaceFormatKHREixEi(ptr noundef nonnull align 8 dereferenceable(16) %13, i32 noundef 0)
          to label %72 unwind label %66

72:                                               ; preds = %70
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %6, ptr align 4 %71, i64 8, i1 false), !tbaa.struct !24
  store i32 1, ptr %16, align 4
  br label %128

73:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #8
  store i32 0, ptr %17, align 4, !tbaa !9
  br label %74

74:                                               ; preds = %120, %73
  %75 = load i32, ptr %17, align 4, !tbaa !9
  %76 = load i32, ptr %10, align 4, !tbaa !9
  %77 = icmp slt i32 %75, %76
  br i1 %77, label %79, label %78

78:                                               ; preds = %74
  store i32 2, ptr %16, align 4
  br label %123

79:                                               ; preds = %74
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #8
  store i32 0, ptr %18, align 4, !tbaa !9
  br label %80

80:                                               ; preds = %114, %79
  %81 = load i32, ptr %18, align 4, !tbaa !9
  %82 = load i32, ptr %12, align 4, !tbaa !9
  %83 = icmp ult i32 %81, %82
  br i1 %83, label %85, label %84

84:                                               ; preds = %80
  store i32 5, ptr %16, align 4
  br label %117

85:                                               ; preds = %80
  %86 = load i32, ptr %18, align 4, !tbaa !9
  %87 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZN8ImVectorI18VkSurfaceFormatKHREixEi(ptr noundef nonnull align 8 dereferenceable(16) %13, i32 noundef %86)
          to label %88 unwind label %109

88:                                               ; preds = %85
  %89 = getelementptr inbounds %struct.VkSurfaceFormatKHR, ptr %87, i32 0, i32 0
  %90 = load i32, ptr %89, align 4, !tbaa !19
  %91 = load ptr, ptr %9, align 8, !tbaa !5
  %92 = load i32, ptr %17, align 4, !tbaa !9
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds i32, ptr %91, i64 %93
  %95 = load i32, ptr %94, align 4, !tbaa !22
  %96 = icmp eq i32 %90, %95
  br i1 %96, label %97, label %113

97:                                               ; preds = %88
  %98 = load i32, ptr %18, align 4, !tbaa !9
  %99 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZN8ImVectorI18VkSurfaceFormatKHREixEi(ptr noundef nonnull align 8 dereferenceable(16) %13, i32 noundef %98)
          to label %100 unwind label %109

100:                                              ; preds = %97
  %101 = getelementptr inbounds %struct.VkSurfaceFormatKHR, ptr %99, i32 0, i32 1
  %102 = load i32, ptr %101, align 4, !tbaa !23
  %103 = load i32, ptr %11, align 4, !tbaa !11
  %104 = icmp eq i32 %102, %103
  br i1 %104, label %105, label %113

105:                                              ; preds = %100
  %106 = load i32, ptr %18, align 4, !tbaa !9
  %107 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZN8ImVectorI18VkSurfaceFormatKHREixEi(ptr noundef nonnull align 8 dereferenceable(16) %13, i32 noundef %106)
          to label %108 unwind label %109

108:                                              ; preds = %105
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %6, ptr align 4 %107, i64 8, i1 false), !tbaa.struct !24
  store i32 1, ptr %16, align 4
  br label %117

109:                                              ; preds = %105, %97, %85
  %110 = landingpad { ptr, i32 }
          cleanup
  %111 = extractvalue { ptr, i32 } %110, 0
  store ptr %111, ptr %14, align 8
  %112 = extractvalue { ptr, i32 } %110, 1
  store i32 %112, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #8
  br label %130

113:                                              ; preds = %100, %88
  br label %114

114:                                              ; preds = %113
  %115 = load i32, ptr %18, align 4, !tbaa !9
  %116 = add i32 %115, 1
  store i32 %116, ptr %18, align 4, !tbaa !9
  br label %80, !llvm.loop !25

117:                                              ; preds = %108, %84
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #8
  %118 = load i32, ptr %16, align 4
  switch i32 %118, label %123 [
    i32 5, label %119
  ]

119:                                              ; preds = %117
  br label %120

120:                                              ; preds = %119
  %121 = load i32, ptr %17, align 4, !tbaa !9
  %122 = add nsw i32 %121, 1
  store i32 %122, ptr %17, align 4, !tbaa !9
  br label %74, !llvm.loop !27

123:                                              ; preds = %117, %78
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #8
  %124 = load i32, ptr %16, align 4
  switch i32 %124, label %128 [
    i32 2, label %125
  ]

125:                                              ; preds = %123
  %126 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZN8ImVectorI18VkSurfaceFormatKHREixEi(ptr noundef nonnull align 8 dereferenceable(16) %13, i32 noundef 0)
          to label %127 unwind label %66

127:                                              ; preds = %125
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %6, ptr align 4 %126, i64 8, i1 false), !tbaa.struct !24
  store i32 1, ptr %16, align 4
  br label %128

128:                                              ; preds = %127, %123, %72, %59
  call void @_ZN8ImVectorI18VkSurfaceFormatKHRED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %13) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  %129 = load i64, ptr %6, align 4
  ret i64 %129

130:                                              ; preds = %109, %66
  call void @_ZN8ImVectorI18VkSurfaceFormatKHRED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %13) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  br label %131

131:                                              ; preds = %130
  %132 = load ptr, ptr %14, align 8
  %133 = load i32, ptr %15, align 4
  %134 = insertvalue { ptr, i32 } poison, ptr %132, 0
  %135 = insertvalue { ptr, i32 } %134, i32 %133, 1
  resume { ptr, i32 } %135
}

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN8ImVectorI18VkSurfaceFormatKHRE6resizeEi(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) #6 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(8) ptr @_ZN8ImVectorI18VkSurfaceFormatKHREixEi(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) #5 align 2

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

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: readwrite) }
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 = { 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 = { 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 #7 = { noreturn nounwind }
attributes #8 = { 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, !12, i64 0}
!12 = !{!"_ZTS15VkColorSpaceKHR", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = !{i8 0, i8 2}
!16 = !{}
!17 = !{!18, !6, i64 8}
!18 = !{!"_ZTS8ImVectorI18VkSurfaceFormatKHRE", !10, i64 0, !10, i64 4, !6, i64 8}
!19 = !{!20, !21, i64 0}
!20 = !{!"_ZTS18VkSurfaceFormatKHR", !21, i64 0, !12, i64 4}
!21 = !{!"_ZTS8VkFormat", !7, i64 0}
!22 = !{!21, !21, i64 0}
!23 = !{!20, !12, i64 4}
!24 = !{i64 0, i64 4, !22, i64 4, i64 4, !11}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}
!27 = distinct !{!27, !26}


; 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.ImVector.10 = type { i32, i32, ptr }

@.str.1 = external hidden unnamed_addr constant [84 x i8], align 1
@_ZL17g_FunctionsLoaded = external hidden local_unnamed_addr global i8, align 1
@.str.4 = external hidden unnamed_addr constant [133 x i8], align 1
@__PRETTY_FUNCTION__._Z37ImGui_ImplVulkanH_SelectSurfaceFormatP18VkPhysicalDevice_TP14VkSurfaceKHR_TPK8VkFormati15VkColorSpaceKHR = external hidden unnamed_addr constant [129 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [26 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 nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
define dso_local i64 @_Z37ImGui_ImplVulkanH_SelectSurfaceFormatP18VkPhysicalDevice_TP14VkSurfaceKHR_TPK8VkFormati15VkColorSpaceKHR(ptr noundef %0, ptr noundef %1, ptr noundef readonly %2, i32 noundef %3, i32 noundef %4) local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %6 = alloca i32, align 4
  %7 = alloca %struct.ImVector.10, align 8
  %8 = load i8, ptr @_ZL17g_FunctionsLoaded, align 1, !tbaa !5, !range !9, !noundef !10
  %9 = trunc nuw i8 %8 to i1
  br i1 %9, label %11, label %10

10:                                               ; preds = %5
  tail call void @__assert_fail(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.1, i32 noundef 1289, ptr noundef nonnull @__PRETTY_FUNCTION__._Z37ImGui_ImplVulkanH_SelectSurfaceFormatP18VkPhysicalDevice_TP14VkSurfaceKHR_TPK8VkFormati15VkColorSpaceKHR) #6
  unreachable

11:                                               ; preds = %5
  %.not = icmp eq ptr %2, null
  br i1 %.not, label %12, label %13

12:                                               ; preds = %11
  tail call void @__assert_fail(ptr noundef nonnull @.str.26, ptr noundef nonnull @.str.1, i32 noundef 1290, ptr noundef nonnull @__PRETTY_FUNCTION__._Z37ImGui_ImplVulkanH_SelectSurfaceFormatP18VkPhysicalDevice_TP14VkSurfaceKHR_TPK8VkFormati15VkColorSpaceKHR) #6
  unreachable

13:                                               ; preds = %11
  %14 = icmp sgt i32 %3, 0
  br i1 %14, label %16, label %15

15:                                               ; preds = %13
  tail call void @__assert_fail(ptr noundef nonnull @.str.27, ptr noundef nonnull @.str.1, i32 noundef 1291, ptr noundef nonnull @__PRETTY_FUNCTION__._Z37ImGui_ImplVulkanH_SelectSurfaceFormatP18VkPhysicalDevice_TP14VkSurfaceKHR_TPK8VkFormati15VkColorSpaceKHR) #6
  unreachable

16:                                               ; preds = %13
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #7
  %17 = call i32 @vkGetPhysicalDeviceSurfaceFormatsKHR(ptr noundef %0, ptr noundef %1, ptr noundef nonnull %6, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #7
  call void @_ZN8ImVectorI18VkSurfaceFormatKHREC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %7)
  %18 = load i32, ptr %6, align 4, !tbaa !11
  invoke void @_ZN8ImVectorI18VkSurfaceFormatKHRE6resizeEi(ptr noundef nonnull align 8 dereferenceable(16) %7, i32 noundef %18)
          to label %19 unwind label %29

19:                                               ; preds = %16
  %20 = getelementptr inbounds i8, ptr %7, i64 8
  %21 = load ptr, ptr %20, align 8, !tbaa !13
  %22 = invoke i32 @vkGetPhysicalDeviceSurfaceFormatsKHR(ptr noundef %0, ptr noundef %1, ptr noundef nonnull %6, ptr noundef %21)
          to label %23 unwind label %29

23:                                               ; preds = %19
  %24 = load i32, ptr %6, align 4, !tbaa !11
  switch i32 %24, label %.preheader.preheader [
    i32 1, label %25
    i32 0, label %.sink.split
  ]

.preheader.preheader:                             ; preds = %23
  %wide.trip.count = zext nneg i32 %3 to i64
  br label %.preheader

25:                                               ; preds = %23
  %26 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZN8ImVectorI18VkSurfaceFormatKHREixEi(ptr noundef nonnull align 8 dereferenceable(16) %7, i32 noundef 0)
  %27 = load i32, ptr %26, align 4, !tbaa !16
  %28 = icmp eq i32 %27, 0
  br i1 %28, label %48, label %.sink.split

29:                                               ; preds = %19, %16
  %30 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN8ImVectorI18VkSurfaceFormatKHRED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %7) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #7
  resume { ptr, i32 } %30

.preheader:                                       ; preds = %.preheader.preheader, %._crit_edge
  %31 = phi i32 [ 1, %.preheader.preheader ], [ %46, %._crit_edge ]
  %indvars.iv = phi i64 [ 0, %.preheader.preheader ], [ %indvars.iv.next, %._crit_edge ]
  %.not3342.not = icmp eq i32 %31, 0
  br i1 %.not3342.not, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader
  %32 = getelementptr inbounds i32, ptr %2, i64 %indvars.iv
  br label %33

33:                                               ; preds = %.lr.ph, %43
  %.043 = phi i32 [ 0, %.lr.ph ], [ %44, %43 ]
  %34 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZN8ImVectorI18VkSurfaceFormatKHREixEi(ptr noundef nonnull align 8 dereferenceable(16) %7, i32 noundef %.043)
  %35 = load i32, ptr %34, align 4, !tbaa !16
  %36 = load i32, ptr %32, align 4, !tbaa !20
  %37 = icmp eq i32 %35, %36
  br i1 %37, label %38, label %43

38:                                               ; preds = %33
  %39 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZN8ImVectorI18VkSurfaceFormatKHREixEi(ptr noundef nonnull align 8 dereferenceable(16) %7, i32 noundef %.043)
  %40 = getelementptr inbounds i8, ptr %39, i64 4
  %41 = load i32, ptr %40, align 4, !tbaa !21
  %42 = icmp eq i32 %41, %4
  br i1 %42, label %.sink.split, label %43

43:                                               ; preds = %33, %38
  %44 = add nuw i32 %.043, 1
  %45 = load i32, ptr %6, align 4, !tbaa !11
  %.not33 = icmp ult i32 %44, %45
  br i1 %.not33, label %33, label %._crit_edge, !llvm.loop !22

._crit_edge:                                      ; preds = %43, %.preheader
  %46 = phi i32 [ 0, %.preheader ], [ %45, %43 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %.sink.split, label %.preheader, !llvm.loop !24

.sink.split:                                      ; preds = %._crit_edge, %38, %23, %25
  %.043.lcssa.sink = phi i32 [ 0, %25 ], [ %24, %23 ], [ %.043, %38 ], [ 0, %._crit_edge ]
  %47 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZN8ImVectorI18VkSurfaceFormatKHREixEi(ptr noundef nonnull align 8 dereferenceable(16) %7, i32 noundef %.043.lcssa.sink)
  %.sroa.5.0..sroa_idx25 = getelementptr inbounds i8, ptr %47, i64 4
  %.sroa.5.0.copyload26 = load i32, ptr %.sroa.5.0..sroa_idx25, align 4, !tbaa !26
  br label %48

48:                                               ; preds = %.sink.split, %25
  %.sroa.0.3.in = phi ptr [ %2, %25 ], [ %47, %.sink.split ]
  %.sroa.5.3 = phi i32 [ %4, %25 ], [ %.sroa.5.0.copyload26, %.sink.split ]
  %.sroa.0.3 = load i32, ptr %.sroa.0.3.in, align 4, !tbaa !20
  call void @_ZN8ImVectorI18VkSurfaceFormatKHRED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %7) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #7
  %.sroa.5.0.insert.ext = zext i32 %.sroa.5.3 to i64
  %.sroa.5.0.insert.shift = shl nuw i64 %.sroa.5.0.insert.ext, 32
  %.sroa.0.0.insert.ext = zext i32 %.sroa.0.3 to i64
  %.sroa.0.0.insert.insert = or disjoint i64 %.sroa.5.0.insert.shift, %.sroa.0.0.insert.ext
  ret i64 %.sroa.0.0.insert.insert
}

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN8ImVectorI18VkSurfaceFormatKHRE6resizeEi(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) local_unnamed_addr #5 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(8) ptr @_ZN8ImVectorI18VkSurfaceFormatKHREixEi(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) local_unnamed_addr #4 align 2

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

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 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 = { 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 #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 = { noreturn nounwind }
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 = !{!"bool", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{i8 0, i8 2}
!10 = !{}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !15, i64 8}
!14 = !{!"_ZTS8ImVectorI18VkSurfaceFormatKHRE", !12, i64 0, !12, i64 4, !15, i64 8}
!15 = !{!"any pointer", !7, i64 0}
!16 = !{!17, !18, i64 0}
!17 = !{!"_ZTS18VkSurfaceFormatKHR", !18, i64 0, !19, i64 4}
!18 = !{!"_ZTS8VkFormat", !7, i64 0}
!19 = !{!"_ZTS15VkColorSpaceKHR", !7, i64 0}
!20 = !{!18, !18, i64 0}
!21 = !{!17, !19, i64 4}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = distinct !{!24, !23, !25}
!25 = !{!"llvm.loop.unswitch.partial.disable"}
!26 = !{!19, !19, i64 0}


; Effective O3 passes: ConstraintEliminationPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SCCPPass,SROAPass,SimpleLoopUnswitchPass,SimplifyCFGPass,TailCallElimPass