; LLVM IR from theolundqvist/parallax-voxel-ray-marcher :: src/external/Dear ImGui/imgui.ll (ZN11ImGuiWindow18GetIDFromRectangleERK6ImRect)

; 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.ImGuiWindow = type <{ ptr, i32, i32, %struct.ImVec2, %struct.ImVec2, %struct.ImVec2, %struct.ImVec2, %struct.ImVec2, %struct.ImVec2, %struct.ImVec2, float, float, i32, i32, i32, %struct.ImVec2, %struct.ImVec2, %struct.ImVec2, %struct.ImVec2, %struct.ImVec2, %struct.ImVec2, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i16, i16, i16, i16, [2 x i8], i32, i8, i8, i8, i8, i32, i8, i8, i8, i8, i32, %struct.ImVec2, %struct.ImVec2, %struct.ImVector.8, %struct.ImGuiWindowTempData, %struct.ImRect, %struct.ImRect, %struct.ImRect, %struct.ImRect, %struct.ImRect, %struct.ImRect, %struct.ImRect, %struct.ImVec2ih, %struct.ImVec2ih, i32, float, float, [4 x i8], %struct.ImGuiStorage, %struct.ImVector.26, float, i32, ptr, %struct.ImDrawList, ptr, ptr, ptr, ptr, ptr, [2 x i32], [2 x %struct.ImRect], i32, i32, i8, [7 x i8] }>
%struct.ImVec2 = type { float, float }
%struct.ImVector.8 = type { i32, i32, ptr }
%struct.ImGuiWindowTempData = type <{ %struct.ImVec2, %struct.ImVec2, %struct.ImVec2, %struct.ImVec2, %struct.ImVec2, %struct.ImVec2, %struct.ImVec2, float, float, %struct.ImVec1, %struct.ImVec1, %struct.ImVec1, i32, i16, i16, i32, i8, i8, i8, i8, %struct.ImVec2, %struct.ImGuiMenuColumns, i32, i32, %struct.ImVector.3, ptr, ptr, i32, i32, i32, i32, i32, float, float, [4 x i8], %struct.ImVector.16, %struct.ImVector.16, %struct.ImGuiStackSizes, [2 x i8] }>
%struct.ImVec1 = type { float }
%struct.ImGuiMenuColumns = type <{ i32, i32, i16, i16, i16, i16, i16, [4 x i16], [2 x i8] }>
%struct.ImVector.3 = type { i32, i32, ptr }
%struct.ImVector.16 = type { i32, i32, ptr }
%struct.ImGuiStackSizes = type { i16, i16, i16, i16, i16, i16, i16 }
%struct.ImRect = type { %struct.ImVec2, %struct.ImVec2 }
%struct.ImVec2ih = type { i16, i16 }
%struct.ImGuiStorage = type { %struct.ImVector.0 }
%struct.ImVector.0 = type { i32, i32, ptr }
%struct.ImVector.26 = type { i32, i32, ptr }
%struct.ImDrawList = type <{ %struct.ImVector.27, %struct.ImVector, %struct.ImVector.28, i32, i32, ptr, ptr, ptr, ptr, %struct.ImVector.29, %struct.ImVector.30, %struct.ImVector.31, %struct.ImDrawCmdHeader, %struct.ImDrawListSplitter, float, [4 x i8] }>
%struct.ImVector.27 = type { i32, i32, ptr }
%struct.ImVector = type { i32, i32, ptr }
%struct.ImVector.28 = type { i32, i32, ptr }
%struct.ImVector.29 = type { i32, i32, ptr }
%struct.ImVector.30 = type { i32, i32, ptr }
%struct.ImVector.31 = type { i32, i32, ptr }
%struct.ImDrawCmdHeader = type <{ %struct.ImVec4, ptr, i32, [4 x i8] }>
%struct.ImVec4 = type { float, float, float, float }
%struct.ImDrawListSplitter = type { i32, i32, %struct.ImVector.17 }
%struct.ImVector.17 = type { i32, i32, ptr }

; 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: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z10ImHashDataPKvmj(ptr noundef, i64 noundef, i32 noundef) #1

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN5ImGui11KeepAliveIDEj(i32 noundef) #1

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN11ImGuiWindow18GetIDFromRectangleERK6ImRect(ptr noundef nonnull align 8 dereferenceable(937) %0, ptr noundef nonnull align 4 dereferenceable(16) %1) #3 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca [4 x i32], align 16
  %7 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %8 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  %9 = getelementptr inbounds %struct.ImGuiWindow, ptr %8, i32 0, i32 53
  %10 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN8ImVectorIjE4backEv(ptr noundef nonnull align 8 dereferenceable(16) %9)
  %11 = load i32, ptr %10, align 4, !tbaa !9
  store i32 %11, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr %6) #4
  %12 = load ptr, ptr %4, align 8, !tbaa !5
  %13 = getelementptr inbounds %struct.ImRect, ptr %12, i32 0, i32 0
  %14 = getelementptr inbounds %struct.ImVec2, ptr %13, i32 0, i32 0
  %15 = load float, ptr %14, align 4, !tbaa !11
  %16 = getelementptr inbounds %struct.ImGuiWindow, ptr %8, i32 0, i32 3
  %17 = getelementptr inbounds %struct.ImVec2, ptr %16, i32 0, i32 0
  %18 = load float, ptr %17, align 8, !tbaa !15
  %19 = fsub float %15, %18
  %20 = fptosi float %19 to i32
  store i32 %20, ptr %6, align 4, !tbaa !9
  %21 = getelementptr inbounds i32, ptr %6, i64 1
  %22 = load ptr, ptr %4, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.ImRect, ptr %22, i32 0, i32 0
  %24 = getelementptr inbounds %struct.ImVec2, ptr %23, i32 0, i32 1
  %25 = load float, ptr %24, align 4, !tbaa !42
  %26 = getelementptr inbounds %struct.ImGuiWindow, ptr %8, i32 0, i32 3
  %27 = getelementptr inbounds %struct.ImVec2, ptr %26, i32 0, i32 1
  %28 = load float, ptr %27, align 4, !tbaa !43
  %29 = fsub float %25, %28
  %30 = fptosi float %29 to i32
  store i32 %30, ptr %21, align 4, !tbaa !9
  %31 = getelementptr inbounds i32, ptr %6, i64 2
  %32 = load ptr, ptr %4, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.ImRect, ptr %32, i32 0, i32 1
  %34 = getelementptr inbounds %struct.ImVec2, ptr %33, i32 0, i32 0
  %35 = load float, ptr %34, align 4, !tbaa !44
  %36 = getelementptr inbounds %struct.ImGuiWindow, ptr %8, i32 0, i32 3
  %37 = getelementptr inbounds %struct.ImVec2, ptr %36, i32 0, i32 0
  %38 = load float, ptr %37, align 8, !tbaa !15
  %39 = fsub float %35, %38
  %40 = fptosi float %39 to i32
  store i32 %40, ptr %31, align 4, !tbaa !9
  %41 = getelementptr inbounds i32, ptr %6, i64 3
  %42 = load ptr, ptr %4, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.ImRect, ptr %42, i32 0, i32 1
  %44 = getelementptr inbounds %struct.ImVec2, ptr %43, i32 0, i32 1
  %45 = load float, ptr %44, align 4, !tbaa !45
  %46 = getelementptr inbounds %struct.ImGuiWindow, ptr %8, i32 0, i32 3
  %47 = getelementptr inbounds %struct.ImVec2, ptr %46, i32 0, i32 1
  %48 = load float, ptr %47, align 4, !tbaa !43
  %49 = fsub float %45, %48
  %50 = fptosi float %49 to i32
  store i32 %50, ptr %41, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  %51 = load i32, ptr %5, align 4, !tbaa !9
  %52 = call noundef i32 @_Z10ImHashDataPKvmj(ptr noundef %6, i64 noundef 16, i32 noundef %51)
  store i32 %52, ptr %7, align 4, !tbaa !9
  %53 = load i32, ptr %7, align 4, !tbaa !9
  call void @_ZN5ImGui11KeepAliveIDEj(i32 noundef %53)
  %54 = load i32, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  ret i32 %54
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 = { 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 #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 = { 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, !14, i64 0}
!12 = !{!"_ZTS6ImRect", !13, i64 0, !13, i64 8}
!13 = !{!"_ZTS6ImVec2", !14, i64 0, !14, i64 4}
!14 = !{!"float", !7, i64 0}
!15 = !{!16, !14, i64 16}
!16 = !{!"_ZTS11ImGuiWindow", !6, i64 0, !10, i64 8, !10, i64 12, !13, i64 16, !13, i64 24, !13, i64 32, !13, i64 40, !13, i64 48, !13, i64 56, !13, i64 64, !14, i64 72, !14, i64 76, !10, i64 80, !10, i64 84, !10, i64 88, !13, i64 92, !13, i64 100, !13, i64 108, !13, i64 116, !13, i64 124, !13, i64 132, !17, i64 140, !17, i64 141, !17, i64 142, !17, i64 143, !17, i64 144, !17, i64 145, !17, i64 146, !17, i64 147, !17, i64 148, !17, i64 149, !17, i64 150, !17, i64 151, !7, i64 152, !18, i64 154, !18, i64 156, !18, i64 158, !18, i64 160, !10, i64 164, !7, i64 168, !7, i64 169, !7, i64 170, !17, i64 171, !10, i64 172, !7, i64 176, !7, i64 177, !7, i64 178, !7, i64 179, !10, i64 180, !10, i64 181, !10, i64 182, !13, i64 184, !13, i64 192, !19, i64 200, !20, i64 216, !12, i64 464, !12, i64 480, !12, i64 496, !12, i64 512, !12, i64 528, !12, i64 544, !12, i64 560, !27, i64 576, !27, i64 580, !10, i64 584, !14, i64 588, !14, i64 592, !28, i64 600, !30, i64 616, !14, i64 632, !10, i64 636, !6, i64 640, !31, i64 648, !6, i64 848, !6, i64 856, !6, i64 864, !6, i64 872, !6, i64 880, !7, i64 888, !7, i64 896, !10, i64 928, !10, i64 932, !17, i64 936}
!17 = !{!"bool", !7, i64 0}
!18 = !{!"short", !7, i64 0}
!19 = !{!"_ZTS8ImVectorIjE", !10, i64 0, !10, i64 4, !6, i64 8}
!20 = !{!"_ZTS19ImGuiWindowTempData", !13, i64 0, !13, i64 8, !13, i64 16, !13, i64 24, !13, i64 32, !13, i64 40, !13, i64 48, !14, i64 56, !14, i64 60, !21, i64 64, !21, i64 68, !21, i64 72, !22, i64 76, !18, i64 80, !18, i64 82, !10, i64 84, !17, i64 88, !17, i64 89, !17, i64 90, !13, i64 92, !23, i64 100, !10, i64 128, !10, i64 132, !24, i64 136, !6, i64 152, !6, i64 160, !10, i64 168, !10, i64 172, !10, i64 176, !10, i64 180, !10, i64 184, !14, i64 188, !14, i64 192, !25, i64 200, !25, i64 216, !26, i64 232}
!21 = !{!"_ZTS6ImVec1", !14, i64 0}
!22 = !{!"_ZTS13ImGuiNavLayer", !7, i64 0}
!23 = !{!"_ZTS16ImGuiMenuColumns", !10, i64 0, !10, i64 4, !18, i64 8, !18, i64 10, !18, i64 12, !18, i64 14, !18, i64 16, !7, i64 18}
!24 = !{!"_ZTS8ImVectorIP11ImGuiWindowE", !10, i64 0, !10, i64 4, !6, i64 8}
!25 = !{!"_ZTS8ImVectorIfE", !10, i64 0, !10, i64 4, !6, i64 8}
!26 = !{!"_ZTS15ImGuiStackSizes", !18, i64 0, !18, i64 2, !18, i64 4, !18, i64 6, !18, i64 8, !18, i64 10, !18, i64 12}
!27 = !{!"_ZTS8ImVec2ih", !18, i64 0, !18, i64 2}
!28 = !{!"_ZTS12ImGuiStorage", !29, i64 0}
!29 = !{!"_ZTS8ImVectorIN12ImGuiStorage16ImGuiStoragePairEE", !10, i64 0, !10, i64 4, !6, i64 8}
!30 = !{!"_ZTS8ImVectorI15ImGuiOldColumnsE", !10, i64 0, !10, i64 4, !6, i64 8}
!31 = !{!"_ZTS10ImDrawList", !32, i64 0, !33, i64 16, !34, i64 32, !10, i64 48, !10, i64 52, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !35, i64 88, !36, i64 104, !37, i64 120, !38, i64 136, !40, i64 168, !14, i64 192}
!32 = !{!"_ZTS8ImVectorI9ImDrawCmdE", !10, i64 0, !10, i64 4, !6, i64 8}
!33 = !{!"_ZTS8ImVectorItE", !10, i64 0, !10, i64 4, !6, i64 8}
!34 = !{!"_ZTS8ImVectorI10ImDrawVertE", !10, i64 0, !10, i64 4, !6, i64 8}
!35 = !{!"_ZTS8ImVectorI6ImVec4E", !10, i64 0, !10, i64 4, !6, i64 8}
!36 = !{!"_ZTS8ImVectorIPvE", !10, i64 0, !10, i64 4, !6, i64 8}
!37 = !{!"_ZTS8ImVectorI6ImVec2E", !10, i64 0, !10, i64 4, !6, i64 8}
!38 = !{!"_ZTS15ImDrawCmdHeader", !39, i64 0, !6, i64 16, !10, i64 24}
!39 = !{!"_ZTS6ImVec4", !14, i64 0, !14, i64 4, !14, i64 8, !14, i64 12}
!40 = !{!"_ZTS18ImDrawListSplitter", !10, i64 0, !10, i64 4, !41, i64 8}
!41 = !{!"_ZTS8ImVectorI13ImDrawChannelE", !10, i64 0, !10, i64 4, !6, i64 8}
!42 = !{!12, !14, i64 4}
!43 = !{!16, !14, i64 20}
!44 = !{!12, !14, i64 8}
!45 = !{!12, !14, i64 12}


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

; 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: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z10ImHashDataPKvmj(ptr noundef, i64 noundef, i32 noundef) local_unnamed_addr #1

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN5ImGui11KeepAliveIDEj(i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef i32 @_ZN11ImGuiWindow18GetIDFromRectangleERK6ImRect(ptr noundef nonnull align 8 dereferenceable(937) %0, ptr nocapture noundef nonnull readonly align 4 dereferenceable(16) %1) local_unnamed_addr #1 align 2 {
  %3 = alloca [4 x i32], align 16
  %4 = getelementptr inbounds i8, ptr %0, i64 200
  %5 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZN8ImVectorIjE4backEv(ptr noundef nonnull align 8 dereferenceable(16) %4)
  %6 = load i32, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #3
  %7 = getelementptr inbounds i8, ptr %0, i64 16
  %8 = load <2 x float>, ptr %7, align 8, !tbaa !9
  %9 = shufflevector <2 x float> %8, <2 x float> poison, <4 x i32> <i32 0, i32 1, i32 0, i32 1>
  %10 = load <4 x float>, ptr %1, align 4, !tbaa !9
  %11 = fsub <4 x float> %10, %9
  %12 = fptosi <4 x float> %11 to <4 x i32>
  store <4 x i32> %12, ptr %3, align 16, !tbaa !5
  %13 = call noundef i32 @_Z10ImHashDataPKvmj(ptr noundef nonnull %3, i64 noundef 16, i32 noundef %6)
  call void @_ZN5ImGui11KeepAliveIDEj(i32 noundef %13)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #3
  ret i32 %13
}

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 = { 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 #3 = { 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, !10, i64 0}
!10 = !{!"float", !7, i64 0}


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