; LLVM IR from PyCee/NUS_library :: src/render (NUS_swapchain)

; 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.VkSwapchainCreateInfoKHR = type { i32, ptr, i32, ptr, i32, i32, i32, %struct.VkExtent2D, i32, i32, i32, i32, ptr, i32, i32, i32, i32, ptr }
%struct.VkExtent2D = type { i32, i32 }
%struct.NUS_binding = type { ptr, ptr, ptr, i32 }
%struct.NUS_swapchain = type { ptr, ptr, %struct.VkExtent2D, %struct.VkSurfaceFormatKHR, %struct.VkSurfaceCapabilitiesKHR, i32, i32, i32, i32, %struct.NUS_binding }
%struct.VkSurfaceFormatKHR = type { i32, i32 }
%struct.VkSurfaceCapabilitiesKHR = type { i32, i32, %struct.VkExtent2D, %struct.VkExtent2D, %struct.VkExtent2D, i32, i32, i32, i32, i32 }

@.str = external hidden unnamed_addr constant [40 x i8], align 1
@vkCreateSwapchainKHR = external dso_local global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [35 x i8], align 1
@vkGetSwapchainImagesKHR = external dso_local global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [54 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [42 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @nus_swapchain_build(ptr noundef %0, ptr noundef %1) #0 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca %struct.VkSwapchainCreateInfoKHR, align 8
  %7 = alloca i32, align 4
  %8 = alloca %struct.NUS_binding, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %9 = load ptr, ptr %4, align 8, !tbaa !5
  %10 = load ptr, ptr %5, align 8, !tbaa !5
  %11 = call i32 @nus_swapchain_build_info(ptr noundef %9, ptr noundef %10)
  %12 = icmp ne i32 %11, 1
  br i1 %12, label %13, label %15

13:                                               ; preds = %2
  %14 = call i32 (ptr, ...) @printf(ptr noundef @.str)
  store i32 0, ptr %3, align 4
  br label %109

15:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 104, ptr %6) #5
  %16 = getelementptr inbounds %struct.VkSwapchainCreateInfoKHR, ptr %6, i32 0, i32 0
  store i32 1000001000, ptr %16, align 8, !tbaa !9
  %17 = getelementptr inbounds %struct.VkSwapchainCreateInfoKHR, ptr %6, i32 0, i32 1
  store ptr null, ptr %17, align 8, !tbaa !13
  %18 = getelementptr inbounds %struct.VkSwapchainCreateInfoKHR, ptr %6, i32 0, i32 2
  store i32 0, ptr %18, align 8, !tbaa !14
  %19 = getelementptr inbounds %struct.VkSwapchainCreateInfoKHR, ptr %6, i32 0, i32 3
  %20 = load ptr, ptr %4, align 8, !tbaa !5
  store ptr %20, ptr %19, align 8, !tbaa !15
  %21 = getelementptr inbounds %struct.VkSwapchainCreateInfoKHR, ptr %6, i32 0, i32 4
  %22 = load ptr, ptr %5, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.NUS_swapchain, ptr %22, i32 0, i32 7
  %24 = load i32, ptr %23, align 4, !tbaa !16
  store i32 %24, ptr %21, align 8, !tbaa !21
  %25 = getelementptr inbounds %struct.VkSwapchainCreateInfoKHR, ptr %6, i32 0, i32 5
  %26 = load ptr, ptr %5, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.NUS_swapchain, ptr %26, i32 0, i32 3
  %28 = getelementptr inbounds %struct.VkSurfaceFormatKHR, ptr %27, i32 0, i32 0
  %29 = load i32, ptr %28, align 8, !tbaa !22
  store i32 %29, ptr %25, align 4, !tbaa !23
  %30 = getelementptr inbounds %struct.VkSwapchainCreateInfoKHR, ptr %6, i32 0, i32 6
  %31 = load ptr, ptr %5, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.NUS_swapchain, ptr %31, i32 0, i32 3
  %33 = getelementptr inbounds %struct.VkSurfaceFormatKHR, ptr %32, i32 0, i32 1
  %34 = load i32, ptr %33, align 4, !tbaa !24
  store i32 %34, ptr %30, align 8, !tbaa !25
  %35 = getelementptr inbounds %struct.VkSwapchainCreateInfoKHR, ptr %6, i32 0, i32 7
  %36 = load ptr, ptr %5, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.NUS_swapchain, ptr %36, i32 0, i32 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %35, ptr align 8 %37, i64 8, i1 false), !tbaa.struct !26
  %38 = getelementptr inbounds %struct.VkSwapchainCreateInfoKHR, ptr %6, i32 0, i32 8
  store i32 1, ptr %38, align 4, !tbaa !28
  %39 = getelementptr inbounds %struct.VkSwapchainCreateInfoKHR, ptr %6, i32 0, i32 9
  store i32 18, ptr %39, align 8, !tbaa !29
  %40 = getelementptr inbounds %struct.VkSwapchainCreateInfoKHR, ptr %6, i32 0, i32 10
  store i32 0, ptr %40, align 4, !tbaa !30
  %41 = getelementptr inbounds %struct.VkSwapchainCreateInfoKHR, ptr %6, i32 0, i32 11
  store i32 0, ptr %41, align 8, !tbaa !31
  %42 = getelementptr inbounds %struct.VkSwapchainCreateInfoKHR, ptr %6, i32 0, i32 12
  store ptr null, ptr %42, align 8, !tbaa !32
  %43 = getelementptr inbounds %struct.VkSwapchainCreateInfoKHR, ptr %6, i32 0, i32 13
  %44 = load ptr, ptr %5, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.NUS_swapchain, ptr %44, i32 0, i32 6
  %46 = load i32, ptr %45, align 8, !tbaa !33
  store i32 %46, ptr %43, align 8, !tbaa !34
  %47 = getelementptr inbounds %struct.VkSwapchainCreateInfoKHR, ptr %6, i32 0, i32 14
  store i32 1, ptr %47, align 4, !tbaa !35
  %48 = getelementptr inbounds %struct.VkSwapchainCreateInfoKHR, ptr %6, i32 0, i32 15
  %49 = load ptr, ptr %5, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.NUS_swapchain, ptr %49, i32 0, i32 5
  %51 = load i32, ptr %50, align 4, !tbaa !36
  store i32 %51, ptr %48, align 8, !tbaa !37
  %52 = getelementptr inbounds %struct.VkSwapchainCreateInfoKHR, ptr %6, i32 0, i32 16
  store i32 1, ptr %52, align 4, !tbaa !38
  %53 = getelementptr inbounds %struct.VkSwapchainCreateInfoKHR, ptr %6, i32 0, i32 17
  store ptr null, ptr %53, align 8, !tbaa !39
  %54 = load ptr, ptr @vkCreateSwapchainKHR, align 8, !tbaa !5
  %55 = call ptr @nus_get_bound_device()
  %56 = load ptr, ptr %5, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.NUS_swapchain, ptr %56, i32 0, i32 0
  %58 = call i32 %54(ptr noundef %55, ptr noundef %6, ptr noundef null, ptr noundef %57)
  %59 = icmp ne i32 %58, 0
  br i1 %59, label %60, label %62

60:                                               ; preds = %15
  %61 = call i32 (ptr, ...) @printf(ptr noundef @.str.1)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %108

62:                                               ; preds = %15
  %63 = load ptr, ptr @vkGetSwapchainImagesKHR, align 8, !tbaa !5
  %64 = call ptr @nus_get_bound_device()
  %65 = load ptr, ptr %5, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.NUS_swapchain, ptr %65, i32 0, i32 0
  %67 = load ptr, ptr %66, align 8, !tbaa !40
  %68 = load ptr, ptr %5, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.NUS_swapchain, ptr %68, i32 0, i32 7
  %70 = call i32 %63(ptr noundef %64, ptr noundef %67, ptr noundef %69, ptr noundef null)
  %71 = icmp ne i32 %70, 0
  br i1 %71, label %77, label %72

72:                                               ; preds = %62
  %73 = load ptr, ptr %5, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.NUS_swapchain, ptr %73, i32 0, i32 7
  %75 = load i32, ptr %74, align 4, !tbaa !16
  %76 = icmp eq i32 %75, 0
  br i1 %76, label %77, label %82

77:                                               ; preds = %72, %62
  %78 = load ptr, ptr %5, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.NUS_swapchain, ptr %78, i32 0, i32 7
  %80 = load i32, ptr %79, align 4, !tbaa !16
  %81 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %80)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %108

82:                                               ; preds = %72
  %83 = load ptr, ptr %5, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.NUS_swapchain, ptr %83, i32 0, i32 7
  %85 = load i32, ptr %84, align 4, !tbaa !16
  %86 = zext i32 %85 to i64
  %87 = mul i64 8, %86
  %88 = call noalias ptr @malloc(i64 noundef %87) #6
  %89 = load ptr, ptr %5, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.NUS_swapchain, ptr %89, i32 0, i32 1
  store ptr %88, ptr %90, align 8, !tbaa !41
  %91 = load ptr, ptr @vkGetSwapchainImagesKHR, align 8, !tbaa !5
  %92 = call ptr @nus_get_bound_device()
  %93 = load ptr, ptr %5, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.NUS_swapchain, ptr %93, i32 0, i32 0
  %95 = load ptr, ptr %94, align 8, !tbaa !40
  %96 = load ptr, ptr %5, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.NUS_swapchain, ptr %96, i32 0, i32 7
  %98 = load ptr, ptr %5, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.NUS_swapchain, ptr %98, i32 0, i32 1
  %100 = load ptr, ptr %99, align 8, !tbaa !41
  %101 = call i32 %91(ptr noundef %92, ptr noundef %95, ptr noundef %97, ptr noundef %100)
  %102 = icmp ne i32 %101, 0
  br i1 %102, label %103, label %105

103:                                              ; preds = %82
  %104 = call i32 (ptr, ...) @printf(ptr noundef @.str.3)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %108

105:                                              ; preds = %82
  %106 = load ptr, ptr %5, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.NUS_swapchain, ptr %106, i32 0, i32 9
  call void @llvm.lifetime.start.p0(i64 32, ptr %8) #5
  call void @nus_get_binding(ptr dead_on_unwind writable sret(%struct.NUS_binding) align 8 %8)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %107, ptr align 8 %8, i64 32, i1 false), !tbaa.struct !42
  call void @llvm.lifetime.end.p0(i64 32, ptr %8) #5
  store i32 1, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %108

108:                                              ; preds = %105, %103, %77, %60
  call void @llvm.lifetime.end.p0(i64 104, ptr %6) #5
  br label %109

109:                                              ; preds = %108, %13
  %110 = load i32, ptr %3, align 4
  ret i32 %110
}

; Function Attrs: nounwind uwtable
declare hidden i32 @nus_swapchain_build_info(ptr noundef, ptr noundef) #0

declare i32 @printf(ptr noundef, ...) #1

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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

declare ptr @nus_get_bound_device() #1

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #4

declare void @nus_get_binding(ptr dead_on_unwind writable sret(%struct.NUS_binding) align 8) #1

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

attributes #0 = { 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 #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 nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nounwind allocsize(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 }
attributes #6 = { nounwind allocsize(0) }

!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/C++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"VkSwapchainCreateInfoKHR", !11, i64 0, !6, i64 8, !11, i64 16, !6, i64 24, !11, i64 32, !11, i64 36, !11, i64 40, !12, i64 44, !11, i64 52, !11, i64 56, !11, i64 60, !11, i64 64, !6, i64 72, !11, i64 80, !11, i64 84, !11, i64 88, !11, i64 92, !6, i64 96}
!11 = !{!"int", !7, i64 0}
!12 = !{!"VkExtent2D", !11, i64 0, !11, i64 4}
!13 = !{!10, !6, i64 8}
!14 = !{!10, !11, i64 16}
!15 = !{!10, !6, i64 24}
!16 = !{!17, !11, i64 92}
!17 = !{!"NUS_swapchain", !6, i64 0, !6, i64 8, !12, i64 16, !18, i64 24, !19, i64 32, !11, i64 84, !11, i64 88, !11, i64 92, !11, i64 96, !20, i64 104}
!18 = !{!"VkSurfaceFormatKHR", !11, i64 0, !11, i64 4}
!19 = !{!"VkSurfaceCapabilitiesKHR", !11, i64 0, !11, i64 4, !12, i64 8, !12, i64 16, !12, i64 24, !11, i64 32, !11, i64 36, !11, i64 40, !11, i64 44, !11, i64 48}
!20 = !{!"NUS_binding", !6, i64 0, !6, i64 8, !6, i64 16, !11, i64 24}
!21 = !{!10, !11, i64 32}
!22 = !{!17, !11, i64 24}
!23 = !{!10, !11, i64 36}
!24 = !{!17, !11, i64 28}
!25 = !{!10, !11, i64 40}
!26 = !{i64 0, i64 4, !27, i64 4, i64 4, !27}
!27 = !{!11, !11, i64 0}
!28 = !{!10, !11, i64 52}
!29 = !{!10, !11, i64 56}
!30 = !{!10, !11, i64 60}
!31 = !{!10, !11, i64 64}
!32 = !{!10, !6, i64 72}
!33 = !{!17, !11, i64 88}
!34 = !{!10, !11, i64 80}
!35 = !{!10, !11, i64 84}
!36 = !{!17, !11, i64 84}
!37 = !{!10, !11, i64 88}
!38 = !{!10, !11, i64 92}
!39 = !{!10, !6, i64 96}
!40 = !{!17, !6, i64 0}
!41 = !{!17, !6, i64 8}
!42 = !{i64 0, i64 8, !5, i64 8, i64 8, !5, i64 16, i64 8, !5, i64 24, i64 4, !27}


; 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.VkSwapchainCreateInfoKHR = type { i32, ptr, i32, ptr, i32, i32, i32, %struct.VkExtent2D, i32, i32, i32, i32, ptr, i32, i32, i32, i32, ptr }
%struct.VkExtent2D = type { i32, i32 }
%struct.NUS_binding = type { ptr, ptr, ptr, i32 }

@.str = external hidden unnamed_addr constant [40 x i8], align 1
@vkCreateSwapchainKHR = external dso_local local_unnamed_addr global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [35 x i8], align 1
@vkGetSwapchainImagesKHR = external dso_local local_unnamed_addr global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [54 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [42 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @nus_swapchain_build(ptr noundef %0, ptr noundef %1) local_unnamed_addr #0 {
  %3 = alloca %struct.VkSwapchainCreateInfoKHR, align 8
  %4 = alloca %struct.NUS_binding, align 8
  %5 = tail call i32 @nus_swapchain_build_info(ptr noundef %0, ptr noundef %1)
  %.not = icmp eq i32 %5, 1
  br i1 %.not, label %8, label %6

6:                                                ; preds = %2
  %7 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str)
  br label %60

8:                                                ; preds = %2
  call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %3) #6
  store i32 1000001000, ptr %3, align 8, !tbaa !5
  %9 = getelementptr inbounds i8, ptr %3, i64 8
  store ptr null, ptr %9, align 8, !tbaa !12
  %10 = getelementptr inbounds i8, ptr %3, i64 16
  store i32 0, ptr %10, align 8, !tbaa !13
  %11 = getelementptr inbounds i8, ptr %3, i64 24
  store ptr %0, ptr %11, align 8, !tbaa !14
  %12 = getelementptr inbounds i8, ptr %3, i64 32
  %13 = getelementptr inbounds i8, ptr %1, i64 92
  %14 = load i32, ptr %13, align 4, !tbaa !15
  store i32 %14, ptr %12, align 8, !tbaa !20
  %15 = getelementptr inbounds i8, ptr %3, i64 36
  %16 = getelementptr inbounds i8, ptr %1, i64 24
  %17 = load <2 x i32>, ptr %16, align 8, !tbaa !21
  store <2 x i32> %17, ptr %15, align 4, !tbaa !21
  %18 = getelementptr inbounds i8, ptr %3, i64 44
  %19 = getelementptr inbounds i8, ptr %1, i64 16
  %20 = load i64, ptr %19, align 8
  store i64 %20, ptr %18, align 4
  %21 = getelementptr inbounds i8, ptr %3, i64 52
  store <4 x i32> <i32 1, i32 18, i32 0, i32 0>, ptr %21, align 4, !tbaa !21
  %22 = getelementptr inbounds i8, ptr %3, i64 72
  store ptr null, ptr %22, align 8, !tbaa !22
  %23 = getelementptr inbounds i8, ptr %3, i64 80
  %24 = getelementptr inbounds i8, ptr %1, i64 88
  %25 = load i32, ptr %24, align 8, !tbaa !23
  store i32 %25, ptr %23, align 8, !tbaa !24
  %26 = getelementptr inbounds i8, ptr %3, i64 84
  store i32 1, ptr %26, align 4, !tbaa !25
  %27 = getelementptr inbounds i8, ptr %3, i64 88
  %28 = getelementptr inbounds i8, ptr %1, i64 84
  %29 = load i32, ptr %28, align 4, !tbaa !26
  store i32 %29, ptr %27, align 8, !tbaa !27
  %30 = getelementptr inbounds i8, ptr %3, i64 92
  store i32 1, ptr %30, align 4, !tbaa !28
  %31 = getelementptr inbounds i8, ptr %3, i64 96
  store ptr null, ptr %31, align 8, !tbaa !29
  %32 = load ptr, ptr @vkCreateSwapchainKHR, align 8, !tbaa !30
  %33 = tail call ptr @nus_get_bound_device() #6
  %34 = call i32 %32(ptr noundef %33, ptr noundef nonnull %3, ptr noundef null, ptr noundef %1) #6
  %.not21 = icmp eq i32 %34, 0
  br i1 %.not21, label %37, label %35

35:                                               ; preds = %8
  %36 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
  br label %59

37:                                               ; preds = %8
  %38 = load ptr, ptr @vkGetSwapchainImagesKHR, align 8, !tbaa !30
  %39 = call ptr @nus_get_bound_device() #6
  %40 = load ptr, ptr %1, align 8, !tbaa !31
  %41 = call i32 %38(ptr noundef %39, ptr noundef %40, ptr noundef nonnull %13, ptr noundef null) #6
  %.not22 = icmp ne i32 %41, 0
  %.pre = load i32, ptr %13, align 4, !tbaa !15
  %42 = icmp eq i32 %.pre, 0
  %or.cond = select i1 %.not22, i1 true, i1 %42
  br i1 %or.cond, label %43, label %45

43:                                               ; preds = %37
  %44 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %.pre)
  br label %59

45:                                               ; preds = %37
  %46 = zext i32 %.pre to i64
  %47 = shl nuw nsw i64 %46, 3
  %48 = call noalias ptr @malloc(i64 noundef %47) #7
  %49 = getelementptr inbounds i8, ptr %1, i64 8
  store ptr %48, ptr %49, align 8, !tbaa !32
  %50 = load ptr, ptr @vkGetSwapchainImagesKHR, align 8, !tbaa !30
  %51 = call ptr @nus_get_bound_device() #6
  %52 = load ptr, ptr %1, align 8, !tbaa !31
  %53 = load ptr, ptr %49, align 8, !tbaa !32
  %54 = call i32 %50(ptr noundef %51, ptr noundef %52, ptr noundef nonnull %13, ptr noundef %53) #6
  %.not23 = icmp eq i32 %54, 0
  br i1 %.not23, label %57, label %55

55:                                               ; preds = %45
  %56 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
  br label %59

57:                                               ; preds = %45
  %58 = getelementptr inbounds i8, ptr %1, i64 104
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #6
  call void @nus_get_binding(ptr dead_on_unwind nonnull writable sret(%struct.NUS_binding) align 8 %4) #6
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(32) %58, ptr noundef nonnull align 8 dereferenceable(32) %4, i64 32, i1 false), !tbaa.struct !33
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #6
  br label %59

59:                                               ; preds = %57, %55, %43, %35
  %.0 = phi i32 [ 0, %35 ], [ 0, %43 ], [ 0, %55 ], [ 1, %57 ]
  call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %3) #6
  br label %60

60:                                               ; preds = %59, %6
  %.1 = phi i32 [ 0, %6 ], [ %.0, %59 ]
  ret i32 %.1
}

; Function Attrs: nounwind uwtable
declare hidden i32 @nus_swapchain_build_info(ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1

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

; Function Attrs: mustprogress 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

declare ptr @nus_get_bound_device() local_unnamed_addr #4

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #5

declare void @nus_get_binding(ptr dead_on_unwind writable sret(%struct.NUS_binding) align 8) local_unnamed_addr #4

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

attributes #0 = { 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 #1 = { nofree 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 nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind }
attributes #7 = { nounwind allocsize(0) }

!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 0}
!6 = !{!"VkSwapchainCreateInfoKHR", !7, i64 0, !10, i64 8, !7, i64 16, !10, i64 24, !7, i64 32, !7, i64 36, !7, i64 40, !11, i64 44, !7, i64 52, !7, i64 56, !7, i64 60, !7, i64 64, !10, i64 72, !7, i64 80, !7, i64 84, !7, i64 88, !7, i64 92, !10, i64 96}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"VkExtent2D", !7, i64 0, !7, i64 4}
!12 = !{!6, !10, i64 8}
!13 = !{!6, !7, i64 16}
!14 = !{!6, !10, i64 24}
!15 = !{!16, !7, i64 92}
!16 = !{!"NUS_swapchain", !10, i64 0, !10, i64 8, !11, i64 16, !17, i64 24, !18, i64 32, !7, i64 84, !7, i64 88, !7, i64 92, !7, i64 96, !19, i64 104}
!17 = !{!"VkSurfaceFormatKHR", !7, i64 0, !7, i64 4}
!18 = !{!"VkSurfaceCapabilitiesKHR", !7, i64 0, !7, i64 4, !11, i64 8, !11, i64 16, !11, i64 24, !7, i64 32, !7, i64 36, !7, i64 40, !7, i64 44, !7, i64 48}
!19 = !{!"NUS_binding", !10, i64 0, !10, i64 8, !10, i64 16, !7, i64 24}
!20 = !{!6, !7, i64 32}
!21 = !{!7, !7, i64 0}
!22 = !{!6, !10, i64 72}
!23 = !{!16, !7, i64 88}
!24 = !{!6, !7, i64 80}
!25 = !{!6, !7, i64 84}
!26 = !{!16, !7, i64 84}
!27 = !{!6, !7, i64 88}
!28 = !{!6, !7, i64 92}
!29 = !{!6, !10, i64 96}
!30 = !{!10, !10, i64 0}
!31 = !{!16, !10, i64 0}
!32 = !{!16, !10, i64 8}
!33 = !{i64 0, i64 8, !30, i64 8, i64 8, !30, i64 16, i64 8, !30, i64 24, i64 4, !21}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass