; LLVM IR from hadryansalles/Luz :: deps/imgui/imgui.ll (ZN5ImGui42FindHoveredViewportFromPlatformWindowStackERK6ImVec2)

; 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.ImRect = type { %struct.ImVec2, %struct.ImVec2 }
%struct.ImVec2 = type { float, float }
%struct.ImGuiContext = type { i8, i8, %struct.ImGuiIO, %struct.ImGuiPlatformIO, %struct.ImGuiStyle, i32, i32, ptr, float, float, %struct.ImDrawListSharedData, double, i32, i32, i32, i32, i8, i8, i8, i8, i8, ptr, %struct.ImVector.3, %struct.ImVector.3, i32, i32, %struct.ImVector.4, %struct.ImVector.4, %struct.ImVector.4, %struct.ImVector.5, %struct.ImGuiStorage, i32, %struct.ImVec2, i32, ptr, ptr, ptr, ptr, ptr, %struct.ImVec2, i32, i32, float, %struct.ImVec2, %struct.ImVec2, i32, i32, i32, i8, i8, float, float, i32, i32, float, i8, i8, i8, i8, i8, i8, i8, i8, %struct.ImVec2, ptr, i32, i32, i8, i8, ptr, i32, float, double, double, double, %struct.ImBitArray, [154 x %struct.ImGuiKeyOwnerData], %struct.ImGuiKeyRoutingTable, i32, i8, i32, i32, i32, i32, i32, [4 x i8], %struct.ImGuiNextItemData, %struct.ImGuiLastItemData, [4 x i8], %struct.ImGuiNextWindowData, i8, i32, %struct.ImVector.8, %struct.ImVector.9, %struct.ImVector.10, %struct.ImVector.11, %struct.ImVector.12, %struct.ImVector.13, %struct.ImVector.14, %struct.ImVector.14, %struct.ImVector.15, i32, %struct.ImVector.16, float, ptr, ptr, ptr, i32, %struct.ImGuiPlatformMonitor, i32, i32, i32, ptr, i32, i32, %struct.ImVector.11, i32, i32, i32, i32, i32, float, i32, i32, i32, i32, i32, i32, i32, i64, i8, i8, i8, i8, i8, i8, i8, i8, %struct.ImGuiNavItemData, i8, i8, i8, i32, i32, i32, i32, i32, i32, %struct.ImRect, %struct.ImRect, i32, i32, i32, %struct.ImGuiNavItemData, %struct.ImGuiNavItemData, %struct.ImGuiNavItemData, %struct.ImGuiNavItemData, i32, i32, ptr, ptr, ptr, float, float, i8, %struct.ImVec2, %struct.ImVec2, float, i8, i8, i8, i32, i32, i32, %struct.ImGuiPayload, %struct.ImRect, %struct.ImRect, i32, i32, float, i32, i32, i32, i32, %struct.ImVector.17, [16 x i8], i32, %struct.ImVector.18, ptr, i32, i32, %struct.ImVector.19, %struct.ImPool, %struct.ImVector.21, %struct.ImVector.22, ptr, %struct.ImPool.23, %struct.ImVector.25, %struct.ImVector.26, i32, i32, float, float, i32, i32, i32, float, %struct.ImVec2, %struct.ImGuiInputTextState, %struct.ImGuiInputTextDeactivatedState, %struct.ImFont, i32, i32, i32, i32, float, float, i32, %struct.ImVec4, %struct.ImGuiComboPreviewData, %struct.ImRect, i8, float, float, i8, i8, float, float, float, float, i16, i16, i16, %struct.ImVector.27, %struct.ImVector.29, %struct.ImGuiTypingSelectState, %struct.ImGuiPlatformImeData, %struct.ImGuiPlatformImeData, i32, [4 x i8], %struct.ImGuiDockContext, ptr, i8, float, %struct.ImGuiTextBuffer, %struct.ImVector.32, %struct.ImChunkStream, %struct.ImChunkStream.33, %struct.ImVector.34, i32, [11 x ptr], i8, i32, ptr, %struct.ImGuiTextBuffer, ptr, ptr, float, i8, i32, i32, i32, i32, %struct.ImGuiTextBuffer, %struct.ImGuiTextIndex, i32, i8, i8, i8, i32, i8, i8, i8, i32, float, %struct.ImVec4, %struct.ImGuiMetricsConfig, %struct.ImGuiIDStackTool, %struct.ImGuiDebugAllocInfo, ptr, [60 x float], i32, i32, float, i32, i32, i32, %struct.ImVector.27, [64 x i8] }
%struct.ImGuiIO = type { i32, i32, %struct.ImVec2, float, float, ptr, ptr, ptr, ptr, float, i8, ptr, %struct.ImVec2, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, float, float, float, float, float, float, i8, i8, i8, i8, i8, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i16, i8, i8, i8, i8, i8, i8, i8, float, i32, i32, i32, i32, %struct.ImVec2, [666 x i32], [666 x i8], [16 x float], ptr, %struct.ImVec2, [5 x i8], float, float, i32, i32, i8, i8, i8, i8, i32, [666 x %struct.ImGuiKeyData], i8, %struct.ImVec2, [5 x %struct.ImVec2], [5 x double], [5 x i8], [5 x i8], [5 x i16], [5 x i16], [5 x i8], [5 x i8], [5 x i8], i8, [5 x float], [5 x float], [5 x %struct.ImVec2], [5 x float], float, i8, i8, i8, i8, i16, %struct.ImVector }
%struct.ImGuiKeyData = type { i8, float, float, float }
%struct.ImVector = type { i32, i32, ptr }
%struct.ImGuiPlatformIO = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, %struct.ImVector.0, %struct.ImVector.1 }
%struct.ImVector.0 = type { i32, i32, ptr }
%struct.ImVector.1 = type { i32, i32, ptr }
%struct.ImGuiStyle = type { float, float, %struct.ImVec2, float, float, %struct.ImVec2, %struct.ImVec2, i32, float, float, float, float, %struct.ImVec2, float, float, %struct.ImVec2, %struct.ImVec2, %struct.ImVec2, %struct.ImVec2, float, float, float, float, float, float, float, float, float, float, float, float, i32, %struct.ImVec2, %struct.ImVec2, float, %struct.ImVec2, %struct.ImVec2, %struct.ImVec2, %struct.ImVec2, float, float, i8, i8, i8, float, float, [55 x %struct.ImVec4], float, float, float, i32, i32 }
%struct.ImDrawListSharedData = type { %struct.ImVec2, ptr, float, float, float, %struct.ImVec4, i32, %struct.ImVector.2, [48 x %struct.ImVec2], float, [64 x i8], ptr }
%struct.ImVector.2 = type { i32, i32, ptr }
%struct.ImVector.3 = type { i32, i32, ptr }
%struct.ImVector.4 = type { i32, i32, ptr }
%struct.ImVector.5 = type { i32, i32, ptr }
%struct.ImGuiStorage = type { %struct.ImVector.6 }
%struct.ImVector.6 = type { i32, i32, ptr }
%struct.ImBitArray = type { [5 x i32] }
%struct.ImGuiKeyOwnerData = type <{ i32, i32, i8, i8, [2 x i8] }>
%struct.ImGuiKeyRoutingTable = type { [154 x i16], %struct.ImVector.7, %struct.ImVector.7 }
%struct.ImVector.7 = type { i32, i32, ptr }
%struct.ImGuiNextItemData = type <{ i32, i32, i64, float, i32, i8, i8, [6 x i8] }>
%struct.ImGuiLastItemData = type { i32, i32, i32, %struct.ImRect, %struct.ImRect, %struct.ImRect, %struct.ImRect }
%struct.ImGuiNextWindowData = type <{ i32, i32, i32, i32, i32, %struct.ImVec2, %struct.ImVec2, %struct.ImVec2, %struct.ImVec2, %struct.ImVec2, i32, i8, i8, [2 x i8], %struct.ImRect, [4 x i8], ptr, ptr, float, i32, i32, %struct.ImGuiWindowClass, %struct.ImVec2, [4 x i8] }>
%struct.ImGuiWindowClass = type <{ i32, i32, i32, i32, i32, i32, i32, i8, i8, [2 x i8] }>
%struct.ImVector.8 = type { i32, i32, ptr }
%struct.ImVector.9 = type { i32, i32, ptr }
%struct.ImVector.10 = type { i32, i32, ptr }
%struct.ImVector.12 = type { i32, i32, ptr }
%struct.ImVector.13 = type { i32, i32, ptr }
%struct.ImVector.14 = type { i32, i32, ptr }
%struct.ImVector.15 = type { i32, i32, ptr }
%struct.ImVector.16 = type { i32, i32, ptr }
%struct.ImGuiPlatformMonitor = type { %struct.ImVec2, %struct.ImVec2, %struct.ImVec2, %struct.ImVec2, float, ptr }
%struct.ImVector.11 = type { i32, i32, ptr }
%struct.ImGuiNavItemData = type <{ ptr, i32, i32, %struct.ImRect, i32, [4 x i8], i64, float, float, float, [4 x i8] }>
%struct.ImGuiPayload = type <{ ptr, i32, i32, i32, i32, [33 x i8], i8, i8, [5 x i8] }>
%struct.ImVector.17 = type { i32, i32, ptr }
%struct.ImVector.18 = type { i32, i32, ptr }
%struct.ImVector.19 = type { i32, i32, ptr }
%struct.ImPool = type { %struct.ImVector.20, %struct.ImGuiStorage, i32, i32 }
%struct.ImVector.20 = type { i32, i32, ptr }
%struct.ImVector.21 = type { i32, i32, ptr }
%struct.ImVector.22 = type { i32, i32, ptr }
%struct.ImPool.23 = type { %struct.ImVector.24, %struct.ImGuiStorage, i32, i32 }
%struct.ImVector.24 = type { i32, i32, ptr }
%struct.ImVector.25 = type { i32, i32, ptr }
%struct.ImVector.26 = type { i32, i32, ptr }
%struct.ImGuiInputTextState = type <{ ptr, i32, i32, i32, [4 x i8], %struct.ImVector, %struct.ImVector.27, %struct.ImVector.27, i8, [3 x i8], i32, float, %"struct.ImStb::STB_TexteditState", float, i8, i8, i8, i8, i32, [4 x i8] }>
%"struct.ImStb::STB_TexteditState" = type { i32, i32, i32, i8, i32, i8, i8, i8, i8, i8, i8, i8, float, %"struct.ImStb::StbUndoState" }
%"struct.ImStb::StbUndoState" = type { [99 x %"struct.ImStb::StbUndoRecord"], [999 x i16], i16, i16, i32, i32 }
%"struct.ImStb::StbUndoRecord" = type { i32, i32, i32, i32 }
%struct.ImGuiInputTextDeactivatedState = type { i32, %struct.ImVector.27 }
%struct.ImFont = type <{ %struct.ImVector.21, float, float, %struct.ImVector, %struct.ImVector.28, ptr, ptr, ptr, i16, i16, i16, i16, float, float, i8, [3 x i8], float, float, float, i32, [2 x i8], [2 x i8] }>
%struct.ImVector.28 = type { i32, i32, ptr }
%struct.ImGuiComboPreviewData = type { %struct.ImRect, %struct.ImVec2, %struct.ImVec2, %struct.ImVec2, float, i32 }
%struct.ImVector.29 = type { i32, i32, ptr }
%struct.ImGuiTypingSelectState = type <{ %struct.ImGuiTypingSelectRequest, [64 x i8], i32, i32, float, i8, [3 x i8] }>
%struct.ImGuiTypingSelectRequest = type { i32, i32, ptr, i8, i8, i8 }
%struct.ImGuiPlatformImeData = type { i8, %struct.ImVec2, float }
%struct.ImGuiDockContext = type <{ %struct.ImGuiStorage, %struct.ImVector.30, %struct.ImVector.31, i8, [7 x i8] }>
%struct.ImVector.30 = type { i32, i32, ptr }
%struct.ImVector.31 = type { i32, i32, ptr }
%struct.ImVector.32 = type { i32, i32, ptr }
%struct.ImChunkStream = type { %struct.ImVector.27 }
%struct.ImChunkStream.33 = type { %struct.ImVector.27 }
%struct.ImVector.34 = type { i32, i32, ptr }
%struct.ImGuiTextBuffer = type { %struct.ImVector.27 }
%struct.ImGuiTextIndex = type <{ %struct.ImVector.12, i32, [4 x i8] }>
%struct.ImVec4 = type { float, float, float, float }
%struct.ImGuiMetricsConfig = type { i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i32, i32 }
%struct.ImGuiIDStackTool = type { i32, i32, i32, %struct.ImVector.35, i8, float }
%struct.ImVector.35 = type { i32, i32, ptr }
%struct.ImGuiDebugAllocInfo = type { i32, i32, i16, [6 x %struct.ImGuiDebugAllocEntry] }
%struct.ImGuiDebugAllocEntry = type { i32, i16, i16 }
%struct.ImVector.27 = type { i32, i32, ptr }
%struct.ImGuiViewport = type <{ i32, i32, %struct.ImVec2, %struct.ImVec2, %struct.ImVec2, %struct.ImVec2, float, i32, ptr, ptr, ptr, ptr, ptr, i8, i8, i8, i8, [4 x i8] }>
%struct.ImGuiViewportP = type { %struct.ImGuiViewport.base, ptr, i32, i32, i32, i32, %struct.ImVec2, float, float, i8, i16, [2 x i32], [2 x ptr], %struct.ImDrawData, %struct.ImDrawDataBuilder, %struct.ImVec2, %struct.ImVec2, %struct.ImVec2, %struct.ImVec2, %struct.ImVec2, %struct.ImVec2, %struct.ImVec2 }
%struct.ImGuiViewport.base = type <{ i32, i32, %struct.ImVec2, %struct.ImVec2, %struct.ImVec2, %struct.ImVec2, float, i32, ptr, ptr, ptr, ptr, ptr, i8, i8, i8, i8 }>
%struct.ImDrawData = type { i8, i32, i32, i32, %struct.ImVector.51, %struct.ImVec2, %struct.ImVec2, %struct.ImVec2, ptr }
%struct.ImVector.51 = type { i32, i32, ptr }
%struct.ImDrawDataBuilder = type { [2 x ptr], %struct.ImVector.51 }

@GImGui = external dso_local global ptr, align 8

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN8ImVectorIP14ImGuiViewportPE5beginEv(ptr noundef nonnull align 8 dereferenceable(16)) #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN8ImVectorIP14ImGuiViewportPE3endEv(ptr noundef nonnull align 8 dereferenceable(16)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local { <2 x float>, <2 x float> } @_ZNK14ImGuiViewportP11GetMainRectEv(ptr noundef nonnull align 8 dereferenceable(320)) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK6ImRect8ContainsERK6ImVec2(ptr noundef nonnull align 4 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(8)) #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZN5ImGui42FindHoveredViewportFromPlatformWindowStackERK6ImVec2(ptr noundef nonnull align 4 dereferenceable(8) %0) #4 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca %struct.ImRect, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #5
  %10 = load ptr, ptr @GImGui, align 8, !tbaa !5
  store ptr %10, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #5
  store ptr null, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  %11 = load ptr, ptr %3, align 8, !tbaa !5
  %12 = getelementptr inbounds %struct.ImGuiContext, ptr %11, i32 0, i32 102
  store ptr %12, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %13 = load ptr, ptr %5, align 8, !tbaa !5
  %14 = call noundef ptr @_ZN8ImVectorIP14ImGuiViewportPE5beginEv(ptr noundef nonnull align 8 dereferenceable(16) %13)
  store ptr %14, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %15 = load ptr, ptr %5, align 8, !tbaa !5
  %16 = call noundef ptr @_ZN8ImVectorIP14ImGuiViewportPE3endEv(ptr noundef nonnull align 8 dereferenceable(16) %15)
  store ptr %16, ptr %7, align 8, !tbaa !5
  br label %17

17:                                               ; preds = %56, %1
  %18 = load ptr, ptr %6, align 8, !tbaa !5
  %19 = load ptr, ptr %7, align 8, !tbaa !5
  %20 = icmp ne ptr %18, %19
  br i1 %20, label %22, label %21

21:                                               ; preds = %17
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  br label %59

22:                                               ; preds = %17
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %23 = load ptr, ptr %6, align 8, !tbaa !5
  %24 = load ptr, ptr %23, align 8, !tbaa !5
  store ptr %24, ptr %8, align 8, !tbaa !5
  %25 = load ptr, ptr %8, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.ImGuiViewport, ptr %25, i32 0, i32 1
  %27 = load i32, ptr %26, align 4, !tbaa !9
  %28 = and i32 %27, 4224
  %29 = icmp ne i32 %28, 0
  call void @llvm.lifetime.start.p0(i64 16, ptr %9) #5
  br i1 %29, label %39, label %30

30:                                               ; preds = %22
  %31 = load ptr, ptr %8, align 8, !tbaa !5
  %32 = call { <2 x float>, <2 x float> } @_ZNK14ImGuiViewportP11GetMainRectEv(ptr noundef nonnull align 8 dereferenceable(320) %31)
  %33 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %9, i32 0, i32 0
  %34 = extractvalue { <2 x float>, <2 x float> } %32, 0
  store <2 x float> %34, ptr %33, align 4
  %35 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %9, i32 0, i32 1
  %36 = extractvalue { <2 x float>, <2 x float> } %32, 1
  store <2 x float> %36, ptr %35, align 4
  %37 = load ptr, ptr %2, align 8, !tbaa !5
  %38 = call noundef zeroext i1 @_ZNK6ImRect8ContainsERK6ImVec2(ptr noundef nonnull align 4 dereferenceable(16) %9, ptr noundef nonnull align 4 dereferenceable(8) %37)
  br label %39

39:                                               ; preds = %30, %22
  %40 = phi i1 [ false, %22 ], [ %38, %30 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #5
  br i1 %40, label %41, label %55

41:                                               ; preds = %39
  %42 = load ptr, ptr %4, align 8, !tbaa !5
  %43 = icmp eq ptr %42, null
  br i1 %43, label %52, label %44

44:                                               ; preds = %41
  %45 = load ptr, ptr %4, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.ImGuiViewportP, ptr %45, i32 0, i32 4
  %47 = load i32, ptr %46, align 8, !tbaa !15
  %48 = load ptr, ptr %8, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.ImGuiViewportP, ptr %48, i32 0, i32 4
  %50 = load i32, ptr %49, align 8, !tbaa !15
  %51 = icmp slt i32 %47, %50
  br i1 %51, label %52, label %54

52:                                               ; preds = %44, %41
  %53 = load ptr, ptr %8, align 8, !tbaa !5
  store ptr %53, ptr %4, align 8, !tbaa !5
  br label %54

54:                                               ; preds = %52, %44
  br label %55

55:                                               ; preds = %54, %39
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  br label %56

56:                                               ; preds = %55
  %57 = load ptr, ptr %6, align 8, !tbaa !5
  %58 = getelementptr inbounds ptr, ptr %57, i32 1
  store ptr %58, ptr %6, align 8, !tbaa !5
  br label %17

59:                                               ; preds = %21
  %60 = load ptr, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  ret ptr %60
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { 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 #4 = { mustprogress uwtable "min-legal-vector-width"="64" "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 }

!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, !11, i64 4}
!10 = !{!"_ZTS13ImGuiViewport", !11, i64 0, !11, i64 4, !12, i64 8, !12, i64 16, !12, i64 24, !12, i64 32, !13, i64 40, !11, i64 44, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !14, i64 88, !14, i64 89, !14, i64 90, !14, i64 91}
!11 = !{!"int", !7, i64 0}
!12 = !{!"_ZTS6ImVec2", !13, i64 0, !13, i64 4}
!13 = !{!"float", !7, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = !{!16, !11, i64 112}
!16 = !{!"_ZTS14ImGuiViewportP", !10, i64 0, !6, i64 96, !11, i64 104, !11, i64 108, !11, i64 112, !11, i64 116, !12, i64 120, !13, i64 128, !13, i64 132, !14, i64 136, !17, i64 138, !7, i64 140, !7, i64 152, !18, i64 168, !20, i64 232, !12, i64 264, !12, i64 272, !12, i64 280, !12, i64 288, !12, i64 296, !12, i64 304, !12, i64 312}
!17 = !{!"short", !7, i64 0}
!18 = !{!"_ZTS10ImDrawData", !14, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !19, i64 16, !12, i64 32, !12, i64 40, !12, i64 48, !6, i64 56}
!19 = !{!"_ZTS8ImVectorIP10ImDrawListE", !11, i64 0, !11, i64 4, !6, i64 8}
!20 = !{!"_ZTS17ImDrawDataBuilder", !7, i64 0, !19, i64 16}


; 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.ImRect = type { %struct.ImVec2, %struct.ImVec2 }
%struct.ImVec2 = type { float, float }

@GImGui = external dso_local local_unnamed_addr global ptr, align 8

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN8ImVectorIP14ImGuiViewportPE5beginEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN8ImVectorIP14ImGuiViewportPE3endEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local { <2 x float>, <2 x float> } @_ZNK14ImGuiViewportP11GetMainRectEv(ptr noundef nonnull align 8 dereferenceable(320)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK6ImRect8ContainsERK6ImVec2(ptr noundef nonnull align 4 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZN5ImGui42FindHoveredViewportFromPlatformWindowStackERK6ImVec2(ptr noundef nonnull align 4 dereferenceable(8) %0) local_unnamed_addr #4 {
  %2 = alloca %struct.ImRect, align 8
  %3 = load ptr, ptr @GImGui, align 8, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %3, i64 19576
  %5 = tail call noundef ptr @_ZN8ImVectorIP14ImGuiViewportPE5beginEv(ptr noundef nonnull align 8 dereferenceable(16) %4)
  %6 = tail call noundef ptr @_ZN8ImVectorIP14ImGuiViewportPE3endEv(ptr noundef nonnull align 8 dereferenceable(16) %4)
  %.not17 = icmp eq ptr %5, %6
  br i1 %.not17, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %1
  %7 = getelementptr inbounds i8, ptr %2, i64 8
  br label %8

._crit_edge:                                      ; preds = %27, %1
  %.0.lcssa = phi ptr [ null, %1 ], [ %.1, %27 ]
  ret ptr %.0.lcssa

8:                                                ; preds = %.lr.ph, %27
  %.019 = phi ptr [ null, %.lr.ph ], [ %.1, %27 ]
  %.01518 = phi ptr [ %5, %.lr.ph ], [ %28, %27 ]
  %9 = load ptr, ptr %.01518, align 8, !tbaa !5
  %10 = getelementptr inbounds i8, ptr %9, i64 4
  %11 = load i32, ptr %10, align 4, !tbaa !9
  %12 = and i32 %11, 4224
  %.not16 = icmp eq i32 %12, 0
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %2) #5
  br i1 %.not16, label %13, label %.critedge

13:                                               ; preds = %8
  %14 = call { <2 x float>, <2 x float> } @_ZNK14ImGuiViewportP11GetMainRectEv(ptr noundef nonnull align 8 dereferenceable(320) %9)
  %15 = extractvalue { <2 x float>, <2 x float> } %14, 0
  store <2 x float> %15, ptr %2, align 8
  %16 = extractvalue { <2 x float>, <2 x float> } %14, 1
  store <2 x float> %16, ptr %7, align 8
  %17 = call noundef zeroext i1 @_ZNK6ImRect8ContainsERK6ImVec2(ptr noundef nonnull align 4 dereferenceable(16) %2, ptr noundef nonnull align 4 dereferenceable(8) %0)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %2) #5
  br i1 %17, label %18, label %27

18:                                               ; preds = %13
  %19 = icmp eq ptr %.019, null
  br i1 %19, label %26, label %20

20:                                               ; preds = %18
  %21 = getelementptr inbounds i8, ptr %.019, i64 112
  %22 = load i32, ptr %21, align 8, !tbaa !15
  %23 = getelementptr inbounds i8, ptr %9, i64 112
  %24 = load i32, ptr %23, align 8, !tbaa !15
  %25 = icmp slt i32 %22, %24
  br i1 %25, label %26, label %27

26:                                               ; preds = %20, %18
  br label %27

.critedge:                                        ; preds = %8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %2) #5
  br label %27

27:                                               ; preds = %20, %26, %.critedge, %13
  %.1 = phi ptr [ %.019, %.critedge ], [ %9, %26 ], [ %.019, %20 ], [ %.019, %13 ]
  %28 = getelementptr inbounds i8, ptr %.01518, i64 8
  %.not = icmp eq ptr %28, %6
  br i1 %.not, label %._crit_edge, label %8
}

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { 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 #4 = { mustprogress uwtable "min-legal-vector-width"="64" "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 }

!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, !11, i64 4}
!10 = !{!"_ZTS13ImGuiViewport", !11, i64 0, !11, i64 4, !12, i64 8, !12, i64 16, !12, i64 24, !12, i64 32, !13, i64 40, !11, i64 44, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !14, i64 88, !14, i64 89, !14, i64 90, !14, i64 91}
!11 = !{!"int", !7, i64 0}
!12 = !{!"_ZTS6ImVec2", !13, i64 0, !13, i64 4}
!13 = !{!"float", !7, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = !{!16, !11, i64 112}
!16 = !{!"_ZTS14ImGuiViewportP", !10, i64 0, !6, i64 96, !11, i64 104, !11, i64 108, !11, i64 112, !11, i64 116, !12, i64 120, !13, i64 128, !13, i64 132, !14, i64 136, !17, i64 138, !7, i64 140, !7, i64 152, !18, i64 168, !20, i64 232, !12, i64 264, !12, i64 272, !12, i64 280, !12, i64 288, !12, i64 296, !12, i64 304, !12, i64 312}
!17 = !{!"short", !7, i64 0}
!18 = !{!"_ZTS10ImDrawData", !14, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !19, i64 16, !12, i64 32, !12, i64 40, !12, i64 48, !6, i64 56}
!19 = !{!"_ZTS8ImVectorIP10ImDrawListE", !11, i64 0, !11, i64 4, !6, i64 8}
!20 = !{!"_ZTS17ImDrawDataBuilder", !7, i64 0, !19, i64 16}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass