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

; 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.VkImageCreateInfo = type { i32, ptr, i32, i32, i32, %struct.VkExtent3D, i32, i32, i32, i32, i32, i32, i32, ptr, i32 }
%struct.VkExtent3D = type { i32, i32, i32 }
%struct.VkMemoryRequirements = type { i64, i64, i32 }
%struct.VkMemoryAllocateInfo = type { i32, ptr, i64, i32 }
%struct.NUS_binding = type { ptr, ptr, ptr, i32 }
%struct.NUS_texture = type { ptr, ptr, i32, i32, i32, i32, i32, %struct.NUS_binding }
%struct.NUS_gpu = type { ptr, ptr, ptr, %struct.NUS_vk_device_functions, ptr, ptr, %struct.VkPhysicalDeviceMemoryProperties, i32, i32 }
%struct.NUS_vk_device_functions = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.VkPhysicalDeviceMemoryProperties = type { i32, [32 x %struct.VkMemoryType], i32, [16 x %struct.VkMemoryHeap] }
%struct.VkMemoryType = type { i32, i32 }
%struct.VkMemoryHeap = type { i64, i32 }

@vkCreateImage = external dso_local global ptr, align 8
@.str = external hidden unnamed_addr constant [48 x i8], align 1
@vkGetImageMemoryRequirements = external dso_local global ptr, align 8
@vkAllocateMemory = external dso_local global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [55 x i8], align 1
@vkBindImageMemory = external dso_local global ptr, align 8

; Function Attrs: nounwind uwtable
define dso_local i32 @nus_texture_build(i32 noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4, i32 noundef %5, ptr noundef %6) #0 {
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca %struct.VkImageCreateInfo, align 8
  %17 = alloca i32, align 4
  %18 = alloca %struct.VkMemoryRequirements, align 8
  %19 = alloca %struct.VkMemoryAllocateInfo, align 8
  %20 = alloca %struct.NUS_binding, align 8
  store i32 %0, ptr %9, align 4, !tbaa !5
  store i32 %1, ptr %10, align 4, !tbaa !5
  store i32 %2, ptr %11, align 4, !tbaa !5
  store i32 %3, ptr %12, align 4, !tbaa !5
  store i32 %4, ptr %13, align 4, !tbaa !5
  store i32 %5, ptr %14, align 4, !tbaa !5
  store ptr %6, ptr %15, align 8, !tbaa !9
  %21 = load i32, ptr %11, align 4, !tbaa !5
  %22 = load ptr, ptr %15, align 8, !tbaa !9
  %23 = getelementptr inbounds %struct.NUS_texture, ptr %22, i32 0, i32 2
  store i32 %21, ptr %23, align 8, !tbaa !11
  %24 = load i32, ptr %9, align 4, !tbaa !5
  %25 = load ptr, ptr %15, align 8, !tbaa !9
  %26 = getelementptr inbounds %struct.NUS_texture, ptr %25, i32 0, i32 4
  store i32 %24, ptr %26, align 8, !tbaa !14
  %27 = load i32, ptr %10, align 4, !tbaa !5
  %28 = load ptr, ptr %15, align 8, !tbaa !9
  %29 = getelementptr inbounds %struct.NUS_texture, ptr %28, i32 0, i32 5
  store i32 %27, ptr %29, align 4, !tbaa !15
  %30 = load i32, ptr %14, align 4, !tbaa !5
  %31 = load ptr, ptr %15, align 8, !tbaa !9
  %32 = getelementptr inbounds %struct.NUS_texture, ptr %31, i32 0, i32 3
  store i32 %30, ptr %32, align 4, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 88, ptr %16) #4
  %33 = getelementptr inbounds %struct.VkImageCreateInfo, ptr %16, i32 0, i32 0
  store i32 14, ptr %33, align 8, !tbaa !17
  %34 = getelementptr inbounds %struct.VkImageCreateInfo, ptr %16, i32 0, i32 1
  store ptr null, ptr %34, align 8, !tbaa !20
  %35 = getelementptr inbounds %struct.VkImageCreateInfo, ptr %16, i32 0, i32 2
  store i32 0, ptr %35, align 8, !tbaa !21
  %36 = getelementptr inbounds %struct.VkImageCreateInfo, ptr %16, i32 0, i32 3
  store i32 1, ptr %36, align 4, !tbaa !22
  %37 = getelementptr inbounds %struct.VkImageCreateInfo, ptr %16, i32 0, i32 4
  %38 = load ptr, ptr %15, align 8, !tbaa !9
  %39 = getelementptr inbounds %struct.NUS_texture, ptr %38, i32 0, i32 2
  %40 = load i32, ptr %39, align 8, !tbaa !11
  store i32 %40, ptr %37, align 8, !tbaa !23
  %41 = getelementptr inbounds %struct.VkImageCreateInfo, ptr %16, i32 0, i32 5
  %42 = getelementptr inbounds %struct.VkExtent3D, ptr %41, i32 0, i32 0
  %43 = load ptr, ptr %15, align 8, !tbaa !9
  %44 = getelementptr inbounds %struct.NUS_texture, ptr %43, i32 0, i32 4
  %45 = load i32, ptr %44, align 8, !tbaa !14
  store i32 %45, ptr %42, align 4, !tbaa !24
  %46 = getelementptr inbounds %struct.VkExtent3D, ptr %41, i32 0, i32 1
  %47 = load ptr, ptr %15, align 8, !tbaa !9
  %48 = getelementptr inbounds %struct.NUS_texture, ptr %47, i32 0, i32 5
  %49 = load i32, ptr %48, align 4, !tbaa !15
  store i32 %49, ptr %46, align 4, !tbaa !25
  %50 = getelementptr inbounds %struct.VkExtent3D, ptr %41, i32 0, i32 2
  store i32 1, ptr %50, align 4, !tbaa !26
  %51 = getelementptr inbounds %struct.VkImageCreateInfo, ptr %16, i32 0, i32 6
  store i32 1, ptr %51, align 8, !tbaa !27
  %52 = getelementptr inbounds %struct.VkImageCreateInfo, ptr %16, i32 0, i32 7
  store i32 1, ptr %52, align 4, !tbaa !28
  %53 = getelementptr inbounds %struct.VkImageCreateInfo, ptr %16, i32 0, i32 8
  store i32 1, ptr %53, align 8, !tbaa !29
  %54 = getelementptr inbounds %struct.VkImageCreateInfo, ptr %16, i32 0, i32 9
  store i32 0, ptr %54, align 4, !tbaa !30
  %55 = getelementptr inbounds %struct.VkImageCreateInfo, ptr %16, i32 0, i32 10
  %56 = load i32, ptr %12, align 4, !tbaa !5
  store i32 %56, ptr %55, align 8, !tbaa !31
  %57 = getelementptr inbounds %struct.VkImageCreateInfo, ptr %16, i32 0, i32 11
  store i32 0, ptr %57, align 4, !tbaa !32
  %58 = getelementptr inbounds %struct.VkImageCreateInfo, ptr %16, i32 0, i32 12
  store i32 0, ptr %58, align 8, !tbaa !33
  %59 = getelementptr inbounds %struct.VkImageCreateInfo, ptr %16, i32 0, i32 13
  store ptr null, ptr %59, align 8, !tbaa !34
  %60 = getelementptr inbounds %struct.VkImageCreateInfo, ptr %16, i32 0, i32 14
  store i32 8, ptr %60, align 8, !tbaa !35
  %61 = load ptr, ptr @vkCreateImage, align 8, !tbaa !9
  %62 = call ptr @nus_get_bound_device()
  %63 = load ptr, ptr %15, align 8, !tbaa !9
  %64 = getelementptr inbounds %struct.NUS_texture, ptr %63, i32 0, i32 0
  %65 = call i32 %61(ptr noundef %62, ptr noundef %16, ptr noundef null, ptr noundef %64)
  %66 = icmp ne i32 %65, 0
  br i1 %66, label %67, label %69

67:                                               ; preds = %7
  %68 = call i32 (ptr, ...) @printf(ptr noundef @.str)
  store i32 0, ptr %8, align 4
  store i32 1, ptr %17, align 4
  br label %105

69:                                               ; preds = %7
  call void @llvm.lifetime.start.p0(i64 24, ptr %18) #4
  %70 = load ptr, ptr @vkGetImageMemoryRequirements, align 8, !tbaa !9
  %71 = call ptr @nus_get_bound_device()
  %72 = load ptr, ptr %15, align 8, !tbaa !9
  %73 = getelementptr inbounds %struct.NUS_texture, ptr %72, i32 0, i32 0
  %74 = load ptr, ptr %73, align 8, !tbaa !36
  call void %70(ptr noundef %71, ptr noundef %74, ptr noundef %18)
  call void @llvm.lifetime.start.p0(i64 32, ptr %19) #4
  %75 = getelementptr inbounds %struct.VkMemoryAllocateInfo, ptr %19, i32 0, i32 0
  store i32 5, ptr %75, align 8, !tbaa !37
  %76 = getelementptr inbounds %struct.VkMemoryAllocateInfo, ptr %19, i32 0, i32 1
  store ptr null, ptr %76, align 8, !tbaa !40
  %77 = getelementptr inbounds %struct.VkMemoryAllocateInfo, ptr %19, i32 0, i32 2
  %78 = getelementptr inbounds %struct.VkMemoryRequirements, ptr %18, i32 0, i32 0
  %79 = load i64, ptr %78, align 8, !tbaa !41
  store i64 %79, ptr %77, align 8, !tbaa !43
  %80 = getelementptr inbounds %struct.VkMemoryAllocateInfo, ptr %19, i32 0, i32 3
  %81 = call ptr @nus_get_bound_gpu()
  %82 = load i32, ptr %13, align 4, !tbaa !5
  %83 = call i32 @nus_gpu_memory_type_index(ptr noundef byval(%struct.NUS_gpu) align 8 %81, ptr noundef byval(%struct.VkMemoryRequirements) align 8 %18, i32 noundef %82)
  store i32 %83, ptr %80, align 8, !tbaa !44
  %84 = load ptr, ptr @vkAllocateMemory, align 8, !tbaa !9
  %85 = call ptr @nus_get_bound_device()
  %86 = load ptr, ptr %15, align 8, !tbaa !9
  %87 = getelementptr inbounds %struct.NUS_texture, ptr %86, i32 0, i32 1
  %88 = call i32 %84(ptr noundef %85, ptr noundef %19, ptr noundef null, ptr noundef %87)
  %89 = icmp ne i32 %88, 0
  br i1 %89, label %90, label %92

90:                                               ; preds = %69
  %91 = call i32 (ptr, ...) @printf(ptr noundef @.str.1)
  store i32 0, ptr %8, align 4
  store i32 1, ptr %17, align 4
  br label %104

92:                                               ; preds = %69
  %93 = load ptr, ptr @vkBindImageMemory, align 8, !tbaa !9
  %94 = call ptr @nus_get_bound_device()
  %95 = load ptr, ptr %15, align 8, !tbaa !9
  %96 = getelementptr inbounds %struct.NUS_texture, ptr %95, i32 0, i32 0
  %97 = load ptr, ptr %96, align 8, !tbaa !36
  %98 = load ptr, ptr %15, align 8, !tbaa !9
  %99 = getelementptr inbounds %struct.NUS_texture, ptr %98, i32 0, i32 1
  %100 = load ptr, ptr %99, align 8, !tbaa !45
  %101 = call i32 %93(ptr noundef %94, ptr noundef %97, ptr noundef %100, i64 noundef 0)
  %102 = load ptr, ptr %15, align 8, !tbaa !9
  %103 = getelementptr inbounds %struct.NUS_texture, ptr %102, i32 0, i32 7
  call void @llvm.lifetime.start.p0(i64 32, ptr %20) #4
  call void @nus_get_binding(ptr dead_on_unwind writable sret(%struct.NUS_binding) align 8 %20)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %103, ptr align 8 %20, i64 32, i1 false), !tbaa.struct !46
  call void @llvm.lifetime.end.p0(i64 32, ptr %20) #4
  store i32 1, ptr %8, align 4
  store i32 1, ptr %17, align 4
  br label %104

104:                                              ; preds = %92, %90
  call void @llvm.lifetime.end.p0(i64 32, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %18) #4
  br label %105

105:                                              ; preds = %104, %67
  call void @llvm.lifetime.end.p0(i64 88, ptr %16) #4
  %106 = load i32, ptr %8, align 4
  ret i32 %106
}

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

declare ptr @nus_get_bound_device() #2

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

declare i32 @nus_gpu_memory_type_index(ptr noundef byval(%struct.NUS_gpu) align 8, ptr noundef byval(%struct.VkMemoryRequirements) align 8, i32 noundef) #2

declare ptr @nus_get_bound_gpu() #2

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

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

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

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !6, i64 16}
!12 = !{!"NUS_texture", !10, i64 0, !10, i64 8, !6, i64 16, !6, i64 20, !6, i64 24, !6, i64 28, !6, i64 32, !13, i64 40}
!13 = !{!"NUS_binding", !10, i64 0, !10, i64 8, !10, i64 16, !6, i64 24}
!14 = !{!12, !6, i64 24}
!15 = !{!12, !6, i64 28}
!16 = !{!12, !6, i64 20}
!17 = !{!18, !6, i64 0}
!18 = !{!"VkImageCreateInfo", !6, i64 0, !10, i64 8, !6, i64 16, !6, i64 20, !6, i64 24, !19, i64 28, !6, i64 40, !6, i64 44, !6, i64 48, !6, i64 52, !6, i64 56, !6, i64 60, !6, i64 64, !10, i64 72, !6, i64 80}
!19 = !{!"VkExtent3D", !6, i64 0, !6, i64 4, !6, i64 8}
!20 = !{!18, !10, i64 8}
!21 = !{!18, !6, i64 16}
!22 = !{!18, !6, i64 20}
!23 = !{!18, !6, i64 24}
!24 = !{!19, !6, i64 0}
!25 = !{!19, !6, i64 4}
!26 = !{!19, !6, i64 8}
!27 = !{!18, !6, i64 40}
!28 = !{!18, !6, i64 44}
!29 = !{!18, !6, i64 48}
!30 = !{!18, !6, i64 52}
!31 = !{!18, !6, i64 56}
!32 = !{!18, !6, i64 60}
!33 = !{!18, !6, i64 64}
!34 = !{!18, !10, i64 72}
!35 = !{!18, !6, i64 80}
!36 = !{!12, !10, i64 0}
!37 = !{!38, !6, i64 0}
!38 = !{!"VkMemoryAllocateInfo", !6, i64 0, !10, i64 8, !39, i64 16, !6, i64 24}
!39 = !{!"long", !7, i64 0}
!40 = !{!38, !10, i64 8}
!41 = !{!42, !39, i64 0}
!42 = !{!"VkMemoryRequirements", !39, i64 0, !39, i64 8, !6, i64 16}
!43 = !{!38, !39, i64 16}
!44 = !{!38, !6, i64 24}
!45 = !{!12, !10, i64 8}
!46 = !{i64 0, i64 8, !9, i64 8, i64 8, !9, i64 16, i64 8, !9, i64 24, i64 4, !5}


; 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.VkImageCreateInfo = type { i32, ptr, i32, i32, i32, %struct.VkExtent3D, i32, i32, i32, i32, i32, i32, i32, ptr, i32 }
%struct.VkExtent3D = type { i32, i32, i32 }
%struct.VkMemoryRequirements = type { i64, i64, i32 }
%struct.VkMemoryAllocateInfo = type { i32, ptr, i64, i32 }
%struct.NUS_binding = type { ptr, ptr, ptr, i32 }
%struct.NUS_gpu = type { ptr, ptr, ptr, %struct.NUS_vk_device_functions, ptr, ptr, %struct.VkPhysicalDeviceMemoryProperties, i32, i32 }
%struct.NUS_vk_device_functions = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.VkPhysicalDeviceMemoryProperties = type { i32, [32 x %struct.VkMemoryType], i32, [16 x %struct.VkMemoryHeap] }
%struct.VkMemoryType = type { i32, i32 }
%struct.VkMemoryHeap = type { i64, i32 }

@vkCreateImage = external dso_local local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [48 x i8], align 1
@vkGetImageMemoryRequirements = external dso_local local_unnamed_addr global ptr, align 8
@vkAllocateMemory = external dso_local local_unnamed_addr global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [55 x i8], align 1
@vkBindImageMemory = external dso_local local_unnamed_addr global ptr, align 8

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @nus_texture_build(i32 noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4, i32 noundef %5, ptr noundef %6) local_unnamed_addr #0 {
  %8 = alloca %struct.VkImageCreateInfo, align 8
  %9 = alloca %struct.VkMemoryRequirements, align 8
  %10 = alloca %struct.VkMemoryAllocateInfo, align 8
  %11 = alloca %struct.NUS_binding, align 8
  %12 = getelementptr inbounds i8, ptr %6, i64 16
  store i32 %2, ptr %12, align 8, !tbaa !5
  %13 = getelementptr inbounds i8, ptr %6, i64 24
  store i32 %0, ptr %13, align 8, !tbaa !12
  %14 = getelementptr inbounds i8, ptr %6, i64 28
  store i32 %1, ptr %14, align 4, !tbaa !13
  %15 = getelementptr inbounds i8, ptr %6, i64 20
  store i32 %5, ptr %15, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 88, ptr nonnull %8) #5
  store i32 14, ptr %8, align 8, !tbaa !15
  %16 = getelementptr inbounds i8, ptr %8, i64 8
  store ptr null, ptr %16, align 8, !tbaa !18
  %17 = getelementptr inbounds i8, ptr %8, i64 16
  store i32 0, ptr %17, align 8, !tbaa !19
  %18 = getelementptr inbounds i8, ptr %8, i64 20
  store i32 1, ptr %18, align 4, !tbaa !20
  %19 = getelementptr inbounds i8, ptr %8, i64 24
  store i32 %2, ptr %19, align 8, !tbaa !21
  %20 = getelementptr inbounds i8, ptr %8, i64 28
  store i32 %0, ptr %20, align 4, !tbaa !22
  %21 = getelementptr inbounds i8, ptr %8, i64 32
  store i32 %1, ptr %21, align 8, !tbaa !23
  %22 = getelementptr inbounds i8, ptr %8, i64 36
  store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %22, align 4, !tbaa !24
  %23 = getelementptr inbounds i8, ptr %8, i64 52
  store i32 0, ptr %23, align 4, !tbaa !25
  %24 = getelementptr inbounds i8, ptr %8, i64 56
  store i32 %3, ptr %24, align 8, !tbaa !26
  %25 = getelementptr inbounds i8, ptr %8, i64 60
  store i32 0, ptr %25, align 4, !tbaa !27
  %26 = getelementptr inbounds i8, ptr %8, i64 64
  store i32 0, ptr %26, align 8, !tbaa !28
  %27 = getelementptr inbounds i8, ptr %8, i64 72
  store ptr null, ptr %27, align 8, !tbaa !29
  %28 = getelementptr inbounds i8, ptr %8, i64 80
  store i32 8, ptr %28, align 8, !tbaa !30
  %29 = load ptr, ptr @vkCreateImage, align 8, !tbaa !31
  %30 = tail call ptr @nus_get_bound_device() #5
  %31 = call i32 %29(ptr noundef %30, ptr noundef nonnull %8, ptr noundef null, ptr noundef %6) #5
  %.not = icmp eq i32 %31, 0
  br i1 %.not, label %34, label %32

32:                                               ; preds = %7
  %33 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str)
  br label %58

34:                                               ; preds = %7
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %9) #5
  %35 = load ptr, ptr @vkGetImageMemoryRequirements, align 8, !tbaa !31
  %36 = call ptr @nus_get_bound_device() #5
  %37 = load ptr, ptr %6, align 8, !tbaa !32
  call void %35(ptr noundef %36, ptr noundef %37, ptr noundef nonnull %9) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %10) #5
  store i32 5, ptr %10, align 8, !tbaa !33
  %38 = getelementptr inbounds i8, ptr %10, i64 8
  store ptr null, ptr %38, align 8, !tbaa !36
  %39 = getelementptr inbounds i8, ptr %10, i64 16
  %40 = load i64, ptr %9, align 8, !tbaa !37
  store i64 %40, ptr %39, align 8, !tbaa !39
  %41 = getelementptr inbounds i8, ptr %10, i64 24
  %42 = call ptr @nus_get_bound_gpu() #5
  %43 = call i32 @nus_gpu_memory_type_index(ptr noundef byval(%struct.NUS_gpu) align 8 %42, ptr noundef nonnull byval(%struct.VkMemoryRequirements) align 8 %9, i32 noundef %4) #5
  store i32 %43, ptr %41, align 8, !tbaa !40
  %44 = load ptr, ptr @vkAllocateMemory, align 8, !tbaa !31
  %45 = call ptr @nus_get_bound_device() #5
  %46 = getelementptr inbounds i8, ptr %6, i64 8
  %47 = call i32 %44(ptr noundef %45, ptr noundef nonnull %10, ptr noundef null, ptr noundef nonnull %46) #5
  %.not19 = icmp eq i32 %47, 0
  br i1 %.not19, label %50, label %48

48:                                               ; preds = %34
  %49 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
  br label %57

50:                                               ; preds = %34
  %51 = load ptr, ptr @vkBindImageMemory, align 8, !tbaa !31
  %52 = call ptr @nus_get_bound_device() #5
  %53 = load ptr, ptr %6, align 8, !tbaa !32
  %54 = load ptr, ptr %46, align 8, !tbaa !41
  %55 = call i32 %51(ptr noundef %52, ptr noundef %53, ptr noundef %54, i64 noundef 0) #5
  %56 = getelementptr inbounds i8, ptr %6, i64 40
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %11) #5
  call void @nus_get_binding(ptr dead_on_unwind nonnull writable sret(%struct.NUS_binding) align 8 %11) #5
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(32) %56, ptr noundef nonnull align 8 dereferenceable(32) %11, i64 32, i1 false), !tbaa.struct !42
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %11) #5
  br label %57

57:                                               ; preds = %50, %48
  %.0 = phi i32 [ 0, %48 ], [ 1, %50 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %10) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #5
  br label %58

58:                                               ; preds = %57, %32
  %.1 = phi i32 [ 0, %32 ], [ %.0, %57 ]
  call void @llvm.lifetime.end.p0(i64 88, ptr nonnull %8) #5
  ret i32 %.1
}

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

declare ptr @nus_get_bound_device() local_unnamed_addr #2

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

declare i32 @nus_gpu_memory_type_index(ptr noundef byval(%struct.NUS_gpu) align 8, ptr noundef byval(%struct.VkMemoryRequirements) align 8, i32 noundef) local_unnamed_addr #2

declare ptr @nus_get_bound_gpu() local_unnamed_addr #2

declare void @nus_get_binding(ptr dead_on_unwind writable sret(%struct.NUS_binding) align 8) local_unnamed_addr #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) #4

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

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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 = { 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 #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !10, i64 16}
!6 = !{!"NUS_texture", !7, i64 0, !7, i64 8, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !11, i64 40}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"NUS_binding", !7, i64 0, !7, i64 8, !7, i64 16, !10, i64 24}
!12 = !{!6, !10, i64 24}
!13 = !{!6, !10, i64 28}
!14 = !{!6, !10, i64 20}
!15 = !{!16, !10, i64 0}
!16 = !{!"VkImageCreateInfo", !10, i64 0, !7, i64 8, !10, i64 16, !10, i64 20, !10, i64 24, !17, i64 28, !10, i64 40, !10, i64 44, !10, i64 48, !10, i64 52, !10, i64 56, !10, i64 60, !10, i64 64, !7, i64 72, !10, i64 80}
!17 = !{!"VkExtent3D", !10, i64 0, !10, i64 4, !10, i64 8}
!18 = !{!16, !7, i64 8}
!19 = !{!16, !10, i64 16}
!20 = !{!16, !10, i64 20}
!21 = !{!16, !10, i64 24}
!22 = !{!17, !10, i64 0}
!23 = !{!17, !10, i64 4}
!24 = !{!10, !10, i64 0}
!25 = !{!16, !10, i64 52}
!26 = !{!16, !10, i64 56}
!27 = !{!16, !10, i64 60}
!28 = !{!16, !10, i64 64}
!29 = !{!16, !7, i64 72}
!30 = !{!16, !10, i64 80}
!31 = !{!7, !7, i64 0}
!32 = !{!6, !7, i64 0}
!33 = !{!34, !10, i64 0}
!34 = !{!"VkMemoryAllocateInfo", !10, i64 0, !7, i64 8, !35, i64 16, !10, i64 24}
!35 = !{!"long", !8, i64 0}
!36 = !{!34, !7, i64 8}
!37 = !{!38, !35, i64 0}
!38 = !{!"VkMemoryRequirements", !35, i64 0, !35, i64 8, !10, i64 16}
!39 = !{!34, !35, i64 16}
!40 = !{!34, !10, i64 24}
!41 = !{!6, !7, i64 8}
!42 = !{i64 0, i64 8, !31, i64 8, i64 8, !31, i64 16, i64 8, !31, i64 24, i64 4, !24}


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