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

declare void @vkDestroyBuffer(ptr noundef, ptr noundef, ptr noundef) #0

declare void @vkFreeMemory(ptr noundef, ptr noundef, ptr noundef) #0

; Function Attrs: mustprogress uwtable
define dso_local void @_Z42ImGui_ImplVulkan_DestroyFrameRenderBuffersP10VkDevice_TP35ImGui_ImplVulkan_FrameRenderBuffersPK21VkAllocationCallbacks(ptr noundef %0, ptr noundef %1, ptr noundef %2) #1 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  %7 = load ptr, ptr %5, align 8, !tbaa !5
  %8 = getelementptr inbounds %struct.ImGui_ImplVulkan_FrameRenderBuffers, ptr %7, i32 0, i32 4
  %9 = load ptr, ptr %8, align 8, !tbaa !9
  %10 = icmp ne ptr %9, null
  br i1 %10, label %11, label %19

11:                                               ; preds = %3
  %12 = load ptr, ptr %4, align 8, !tbaa !5
  %13 = load ptr, ptr %5, align 8, !tbaa !5
  %14 = getelementptr inbounds %struct.ImGui_ImplVulkan_FrameRenderBuffers, ptr %13, i32 0, i32 4
  %15 = load ptr, ptr %14, align 8, !tbaa !9
  %16 = load ptr, ptr %6, align 8, !tbaa !5
  call void @vkDestroyBuffer(ptr noundef %12, ptr noundef %15, ptr noundef %16)
  %17 = load ptr, ptr %5, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.ImGui_ImplVulkan_FrameRenderBuffers, ptr %17, i32 0, i32 4
  store ptr null, ptr %18, align 8, !tbaa !9
  br label %19

19:                                               ; preds = %11, %3
  %20 = load ptr, ptr %5, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.ImGui_ImplVulkan_FrameRenderBuffers, ptr %20, i32 0, i32 0
  %22 = load ptr, ptr %21, align 8, !tbaa !12
  %23 = icmp ne ptr %22, null
  br i1 %23, label %24, label %32

24:                                               ; preds = %19
  %25 = load ptr, ptr %4, align 8, !tbaa !5
  %26 = load ptr, ptr %5, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.ImGui_ImplVulkan_FrameRenderBuffers, ptr %26, i32 0, i32 0
  %28 = load ptr, ptr %27, align 8, !tbaa !12
  %29 = load ptr, ptr %6, align 8, !tbaa !5
  call void @vkFreeMemory(ptr noundef %25, ptr noundef %28, ptr noundef %29)
  %30 = load ptr, ptr %5, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.ImGui_ImplVulkan_FrameRenderBuffers, ptr %30, i32 0, i32 0
  store ptr null, ptr %31, align 8, !tbaa !12
  br label %32

32:                                               ; preds = %24, %19
  %33 = load ptr, ptr %5, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.ImGui_ImplVulkan_FrameRenderBuffers, ptr %33, i32 0, i32 5
  %35 = load ptr, ptr %34, align 8, !tbaa !13
  %36 = icmp ne ptr %35, null
  br i1 %36, label %37, label %45

37:                                               ; preds = %32
  %38 = load ptr, ptr %4, align 8, !tbaa !5
  %39 = load ptr, ptr %5, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.ImGui_ImplVulkan_FrameRenderBuffers, ptr %39, i32 0, i32 5
  %41 = load ptr, ptr %40, align 8, !tbaa !13
  %42 = load ptr, ptr %6, align 8, !tbaa !5
  call void @vkDestroyBuffer(ptr noundef %38, ptr noundef %41, ptr noundef %42)
  %43 = load ptr, ptr %5, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.ImGui_ImplVulkan_FrameRenderBuffers, ptr %43, i32 0, i32 5
  store ptr null, ptr %44, align 8, !tbaa !13
  br label %45

45:                                               ; preds = %37, %32
  %46 = load ptr, ptr %5, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.ImGui_ImplVulkan_FrameRenderBuffers, ptr %46, i32 0, i32 1
  %48 = load ptr, ptr %47, align 8, !tbaa !14
  %49 = icmp ne ptr %48, null
  br i1 %49, label %50, label %58

50:                                               ; preds = %45
  %51 = load ptr, ptr %4, align 8, !tbaa !5
  %52 = load ptr, ptr %5, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.ImGui_ImplVulkan_FrameRenderBuffers, ptr %52, i32 0, i32 1
  %54 = load ptr, ptr %53, align 8, !tbaa !14
  %55 = load ptr, ptr %6, align 8, !tbaa !5
  call void @vkFreeMemory(ptr noundef %51, ptr noundef %54, ptr noundef %55)
  %56 = load ptr, ptr %5, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.ImGui_ImplVulkan_FrameRenderBuffers, ptr %56, i32 0, i32 1
  store ptr null, ptr %57, align 8, !tbaa !14
  br label %58

58:                                               ; preds = %50, %45
  %59 = load ptr, ptr %5, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.ImGui_ImplVulkan_FrameRenderBuffers, ptr %59, i32 0, i32 2
  store i64 0, ptr %60, align 8, !tbaa !15
  %61 = load ptr, ptr %5, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.ImGui_ImplVulkan_FrameRenderBuffers, ptr %61, i32 0, i32 3
  store i64 0, ptr %62, align 8, !tbaa !16
  ret void
}

attributes #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 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" }

!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, !6, i64 32}
!10 = !{!"_ZTS35ImGui_ImplVulkan_FrameRenderBuffers", !6, i64 0, !6, i64 8, !11, i64 16, !11, i64 24, !6, i64 32, !6, i64 40}
!11 = !{!"long", !7, i64 0}
!12 = !{!10, !6, i64 0}
!13 = !{!10, !6, i64 40}
!14 = !{!10, !6, i64 8}
!15 = !{!10, !11, i64 16}
!16 = !{!10, !11, i64 24}


; 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"

declare void @vkDestroyBuffer(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

declare void @vkFreeMemory(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local void @_Z42ImGui_ImplVulkan_DestroyFrameRenderBuffersP10VkDevice_TP35ImGui_ImplVulkan_FrameRenderBuffersPK21VkAllocationCallbacks(ptr noundef %0, ptr nocapture noundef %1, ptr noundef %2) local_unnamed_addr #1 {
  %4 = getelementptr inbounds i8, ptr %1, i64 32
  %5 = load ptr, ptr %4, align 8, !tbaa !5
  %.not = icmp eq ptr %5, null
  br i1 %.not, label %7, label %6

6:                                                ; preds = %3
  tail call void @vkDestroyBuffer(ptr noundef %0, ptr noundef nonnull %5, ptr noundef %2)
  store ptr null, ptr %4, align 8, !tbaa !5
  br label %7

7:                                                ; preds = %6, %3
  %8 = load ptr, ptr %1, align 8, !tbaa !11
  %.not25 = icmp eq ptr %8, null
  br i1 %.not25, label %10, label %9

9:                                                ; preds = %7
  tail call void @vkFreeMemory(ptr noundef %0, ptr noundef nonnull %8, ptr noundef %2)
  store ptr null, ptr %1, align 8, !tbaa !11
  br label %10

10:                                               ; preds = %9, %7
  %11 = getelementptr inbounds i8, ptr %1, i64 40
  %12 = load ptr, ptr %11, align 8, !tbaa !12
  %.not26 = icmp eq ptr %12, null
  br i1 %.not26, label %14, label %13

13:                                               ; preds = %10
  tail call void @vkDestroyBuffer(ptr noundef %0, ptr noundef nonnull %12, ptr noundef %2)
  store ptr null, ptr %11, align 8, !tbaa !12
  br label %14

14:                                               ; preds = %13, %10
  %15 = getelementptr inbounds i8, ptr %1, i64 8
  %16 = load ptr, ptr %15, align 8, !tbaa !13
  %.not27 = icmp eq ptr %16, null
  br i1 %.not27, label %18, label %17

17:                                               ; preds = %14
  tail call void @vkFreeMemory(ptr noundef %0, ptr noundef nonnull %16, ptr noundef %2)
  store ptr null, ptr %15, align 8, !tbaa !13
  br label %18

18:                                               ; preds = %17, %14
  %19 = getelementptr inbounds i8, ptr %1, i64 16
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %19, i8 0, i64 16, i1 false)
  ret void
}

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

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

!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 32}
!6 = !{!"_ZTS35ImGui_ImplVulkan_FrameRenderBuffers", !7, i64 0, !7, i64 8, !10, i64 16, !10, i64 24, !7, i64 32, !7, i64 40}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"long", !8, i64 0}
!11 = !{!6, !7, i64 0}
!12 = !{!6, !7, i64 40}
!13 = !{!6, !7, i64 8}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InstCombinePass,MemCpyOptPass,PostOrderFunctionAttrsPass,SROAPass,TailCallElimPass