; LLVM IR from Devaniti/BoolkaEngine :: ThirdParty/imgui/backends (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.9 = type { i32, i32, ptr }

@.str.1 = external hidden unnamed_addr constant [103 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [26 x i8], align 1
@__PRETTY_FUNCTION__._Z37ImGui_ImplVulkanH_SelectSurfaceFormatP18VkPhysicalDevice_TP14VkSurfaceKHR_TPK8VkFormati15VkColorSpaceKHR = external hidden unnamed_addr constant [129 x i8], align 1
@.str.13 = 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

; 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.9, 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 ptr, ptr %9, align 8, !tbaa !5
  %20 = icmp ne ptr %19, null
  br i1 %20, label %21, label %22

21:                                               ; preds = %5
  br label %24

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

23:                                               ; No predecessors!
  br label %24

24:                                               ; preds = %23, %21
  %25 = load i32, ptr %10, align 4, !tbaa !9
  %26 = icmp sgt i32 %25, 0
  br i1 %26, label %27, label %28

27:                                               ; preds = %24
  br label %30

28:                                               ; preds = %24
  call void @__assert_fail(ptr noundef @.str.13, ptr noundef @.str.1, i32 noundef 956, ptr noundef @__PRETTY_FUNCTION__._Z37ImGui_ImplVulkanH_SelectSurfaceFormatP18VkPhysicalDevice_TP14VkSurfaceKHR_TPK8VkFormati15VkColorSpaceKHR) #7
  unreachable

29:                                               ; No predecessors!
  br label %30

30:                                               ; preds = %29, %27
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #8
  %31 = load ptr, ptr %7, align 8, !tbaa !5
  %32 = load ptr, ptr %8, align 8, !tbaa !5
  %33 = call i32 @vkGetPhysicalDeviceSurfaceFormatsKHR(ptr noundef %31, ptr noundef %32, 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)
  %34 = load i32, ptr %12, align 4, !tbaa !9
  invoke void @_ZN8ImVectorI18VkSurfaceFormatKHRE6resizeEi(ptr noundef nonnull align 8 dereferenceable(16) %13, i32 noundef %34)
          to label %35 unwind label %57

35:                                               ; preds = %30
  %36 = load ptr, ptr %7, align 8, !tbaa !5
  %37 = load ptr, ptr %8, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.ImVector.9, ptr %13, i32 0, i32 2
  %39 = load ptr, ptr %38, align 8, !tbaa !13
  %40 = invoke i32 @vkGetPhysicalDeviceSurfaceFormatsKHR(ptr noundef %36, ptr noundef %37, ptr noundef %12, ptr noundef %39)
          to label %41 unwind label %57

41:                                               ; preds = %35
  %42 = load i32, ptr %12, align 4, !tbaa !9
  %43 = icmp eq i32 %42, 1
  br i1 %43, label %44, label %64

44:                                               ; preds = %41
  %45 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZN8ImVectorI18VkSurfaceFormatKHREixEi(ptr noundef nonnull align 8 dereferenceable(16) %13, i32 noundef 0)
          to label %46 unwind label %57

46:                                               ; preds = %44
  %47 = getelementptr inbounds %struct.VkSurfaceFormatKHR, ptr %45, i32 0, i32 0
  %48 = load i32, ptr %47, align 4, !tbaa !15
  %49 = icmp eq i32 %48, 0
  br i1 %49, label %50, label %61

50:                                               ; preds = %46
  %51 = load ptr, ptr %9, align 8, !tbaa !5
  %52 = getelementptr inbounds i32, ptr %51, i64 0
  %53 = load i32, ptr %52, align 4, !tbaa !18
  %54 = getelementptr inbounds %struct.VkSurfaceFormatKHR, ptr %6, i32 0, i32 0
  store i32 %53, ptr %54, align 4, !tbaa !15
  %55 = load i32, ptr %11, align 4, !tbaa !11
  %56 = getelementptr inbounds %struct.VkSurfaceFormatKHR, ptr %6, i32 0, i32 1
  store i32 %55, ptr %56, align 4, !tbaa !19
  store i32 1, ptr %16, align 4
  br label %119

57:                                               ; preds = %116, %61, %44, %35, %30
  %58 = landingpad { ptr, i32 }
          cleanup
  %59 = extractvalue { ptr, i32 } %58, 0
  store ptr %59, ptr %14, align 8
  %60 = extractvalue { ptr, i32 } %58, 1
  store i32 %60, ptr %15, align 4
  br label %121

61:                                               ; preds = %46
  %62 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZN8ImVectorI18VkSurfaceFormatKHREixEi(ptr noundef nonnull align 8 dereferenceable(16) %13, i32 noundef 0)
          to label %63 unwind label %57

63:                                               ; preds = %61
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %6, ptr align 4 %62, i64 8, i1 false), !tbaa.struct !20
  store i32 1, ptr %16, align 4
  br label %119

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

65:                                               ; preds = %111, %64
  %66 = load i32, ptr %17, align 4, !tbaa !9
  %67 = load i32, ptr %10, align 4, !tbaa !9
  %68 = icmp slt i32 %66, %67
  br i1 %68, label %70, label %69

69:                                               ; preds = %65
  store i32 2, ptr %16, align 4
  br label %114

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

71:                                               ; preds = %105, %70
  %72 = load i32, ptr %18, align 4, !tbaa !9
  %73 = load i32, ptr %12, align 4, !tbaa !9
  %74 = icmp ult i32 %72, %73
  br i1 %74, label %76, label %75

75:                                               ; preds = %71
  store i32 5, ptr %16, align 4
  br label %108

76:                                               ; preds = %71
  %77 = load i32, ptr %18, align 4, !tbaa !9
  %78 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZN8ImVectorI18VkSurfaceFormatKHREixEi(ptr noundef nonnull align 8 dereferenceable(16) %13, i32 noundef %77)
          to label %79 unwind label %100

79:                                               ; preds = %76
  %80 = getelementptr inbounds %struct.VkSurfaceFormatKHR, ptr %78, i32 0, i32 0
  %81 = load i32, ptr %80, align 4, !tbaa !15
  %82 = load ptr, ptr %9, align 8, !tbaa !5
  %83 = load i32, ptr %17, align 4, !tbaa !9
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds i32, ptr %82, i64 %84
  %86 = load i32, ptr %85, align 4, !tbaa !18
  %87 = icmp eq i32 %81, %86
  br i1 %87, label %88, label %104

88:                                               ; preds = %79
  %89 = load i32, ptr %18, align 4, !tbaa !9
  %90 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZN8ImVectorI18VkSurfaceFormatKHREixEi(ptr noundef nonnull align 8 dereferenceable(16) %13, i32 noundef %89)
          to label %91 unwind label %100

91:                                               ; preds = %88
  %92 = getelementptr inbounds %struct.VkSurfaceFormatKHR, ptr %90, i32 0, i32 1
  %93 = load i32, ptr %92, align 4, !tbaa !19
  %94 = load i32, ptr %11, align 4, !tbaa !11
  %95 = icmp eq i32 %93, %94
  br i1 %95, label %96, label %104

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

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

100:                                              ; preds = %96, %88, %76
  %101 = landingpad { ptr, i32 }
          cleanup
  %102 = extractvalue { ptr, i32 } %101, 0
  store ptr %102, ptr %14, align 8
  %103 = extractvalue { ptr, i32 } %101, 1
  store i32 %103, 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 %121

104:                                              ; preds = %91, %79
  br label %105

105:                                              ; preds = %104
  %106 = load i32, ptr %18, align 4, !tbaa !9
  %107 = add i32 %106, 1
  store i32 %107, ptr %18, align 4, !tbaa !9
  br label %71, !llvm.loop !21

108:                                              ; preds = %99, %75
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #8
  %109 = load i32, ptr %16, align 4
  switch i32 %109, label %114 [
    i32 5, label %110
  ]

110:                                              ; preds = %108
  br label %111

111:                                              ; preds = %110
  %112 = load i32, ptr %17, align 4, !tbaa !9
  %113 = add nsw i32 %112, 1
  store i32 %113, ptr %17, align 4, !tbaa !9
  br label %65, !llvm.loop !23

114:                                              ; preds = %108, %69
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #8
  %115 = load i32, ptr %16, align 4
  switch i32 %115, label %119 [
    i32 2, label %116
  ]

116:                                              ; preds = %114
  %117 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZN8ImVectorI18VkSurfaceFormatKHREixEi(ptr noundef nonnull align 8 dereferenceable(16) %13, i32 noundef 0)
          to label %118 unwind label %57

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

119:                                              ; preds = %118, %114, %63, %50
  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
  %120 = load i64, ptr %6, align 4
  ret i64 %120

121:                                              ; preds = %100, %57
  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 %122

122:                                              ; preds = %121
  %123 = load ptr, ptr %14, align 8
  %124 = load i32, ptr %15, align 4
  %125 = insertvalue { ptr, i32 } poison, ptr %123, 0
  %126 = insertvalue { ptr, i32 } %125, i32 %124, 1
  resume { ptr, i32 } %126
}

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

declare i32 @__gxx_personality_v0(...)

; 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, !6, i64 8}
!14 = !{!"_ZTS8ImVectorI18VkSurfaceFormatKHRE", !10, i64 0, !10, i64 4, !6, i64 8}
!15 = !{!16, !17, i64 0}
!16 = !{!"_ZTS18VkSurfaceFormatKHR", !17, i64 0, !12, i64 4}
!17 = !{!"_ZTS8VkFormat", !7, i64 0}
!18 = !{!17, !17, i64 0}
!19 = !{!16, !12, i64 4}
!20 = !{i64 0, i64 4, !18, i64 4, i64 4, !11}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = distinct !{!23, !22}


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

@.str.1 = external hidden unnamed_addr constant [103 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [26 x i8], align 1
@__PRETTY_FUNCTION__._Z37ImGui_ImplVulkanH_SelectSurfaceFormatP18VkPhysicalDevice_TP14VkSurfaceKHR_TPK8VkFormati15VkColorSpaceKHR = external hidden unnamed_addr constant [129 x i8], align 1
@.str.13 = 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

; 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.9, align 8
  %.not = icmp eq ptr %2, null
  br i1 %.not, label %8, label %9

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

9:                                                ; preds = %5
  %10 = icmp sgt i32 %3, 0
  br i1 %10, label %12, label %11

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

12:                                               ; preds = %9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #7
  %13 = 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)
  %14 = load i32, ptr %6, align 4, !tbaa !5
  invoke void @_ZN8ImVectorI18VkSurfaceFormatKHRE6resizeEi(ptr noundef nonnull align 8 dereferenceable(16) %7, i32 noundef %14)
          to label %15 unwind label %25

15:                                               ; preds = %12
  %16 = getelementptr inbounds i8, ptr %7, i64 8
  %17 = load ptr, ptr %16, align 8, !tbaa !9
  %18 = invoke i32 @vkGetPhysicalDeviceSurfaceFormatsKHR(ptr noundef %0, ptr noundef %1, ptr noundef nonnull %6, ptr noundef %17)
          to label %19 unwind label %25

19:                                               ; preds = %15
  %20 = load i32, ptr %6, align 4, !tbaa !5
  switch i32 %20, label %.preheader.preheader [
    i32 1, label %21
    i32 0, label %.sink.split
  ]

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

21:                                               ; preds = %19
  %22 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZN8ImVectorI18VkSurfaceFormatKHREixEi(ptr noundef nonnull align 8 dereferenceable(16) %7, i32 noundef 0)
  %23 = load i32, ptr %22, align 4, !tbaa !12
  %24 = icmp eq i32 %23, 0
  br i1 %24, label %44, label %.sink.split

25:                                               ; preds = %15, %12
  %26 = 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 } %26

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

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

29:                                               ; preds = %.lr.ph, %39
  %.043 = phi i32 [ 0, %.lr.ph ], [ %40, %39 ]
  %30 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZN8ImVectorI18VkSurfaceFormatKHREixEi(ptr noundef nonnull align 8 dereferenceable(16) %7, i32 noundef %.043)
  %31 = load i32, ptr %30, align 4, !tbaa !12
  %32 = load i32, ptr %28, align 4, !tbaa !16
  %33 = icmp eq i32 %31, %32
  br i1 %33, label %34, label %39

34:                                               ; preds = %29
  %35 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZN8ImVectorI18VkSurfaceFormatKHREixEi(ptr noundef nonnull align 8 dereferenceable(16) %7, i32 noundef %.043)
  %36 = getelementptr inbounds i8, ptr %35, i64 4
  %37 = load i32, ptr %36, align 4, !tbaa !17
  %38 = icmp eq i32 %37, %4
  br i1 %38, label %.sink.split, label %39

39:                                               ; preds = %29, %34
  %40 = add nuw i32 %.043, 1
  %41 = load i32, ptr %6, align 4, !tbaa !5
  %.not33 = icmp ult i32 %40, %41
  br i1 %.not33, label %29, label %._crit_edge, !llvm.loop !18

._crit_edge:                                      ; preds = %39, %.preheader
  %42 = phi i32 [ 0, %.preheader ], [ %41, %39 ]
  %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 !20

.sink.split:                                      ; preds = %._crit_edge, %34, %19, %21
  %.043.lcssa.sink = phi i32 [ 0, %21 ], [ %20, %19 ], [ %.043, %34 ], [ 0, %._crit_edge ]
  %43 = 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 %43, i64 4
  %.sroa.5.0.copyload26 = load i32, ptr %.sroa.5.0..sroa_idx25, align 4, !tbaa !22
  br label %44

44:                                               ; preds = %.sink.split, %21
  %.sroa.0.3.in = phi ptr [ %2, %21 ], [ %43, %.sink.split ]
  %.sroa.5.3 = phi i32 [ %4, %21 ], [ %.sroa.5.0.copyload26, %.sink.split ]
  %.sroa.0.3 = load i32, ptr %.sroa.0.3.in, align 4, !tbaa !16
  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

declare i32 @__gxx_personality_v0(...)

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