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

; 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.ImGuiTable = type { i32, i32, ptr, ptr, %struct.ImSpan, %struct.ImSpan.31, %struct.ImSpan.32, i64, i64, i64, i64, i32, i32, i32, i32, i32, i32, i16, i16, float, float, float, float, float, i32, i32, [2 x i32], i32, i32, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, %struct.ImRect, %struct.ImRect, %struct.ImRect, %struct.ImRect, %struct.ImRect, %struct.ImRect, %struct.ImRect, %struct.ImRect, %struct.ImRect, ptr, ptr, %struct.ImGuiTextBuffer, ptr, %struct.ImGuiTableColumnSortSpecs, %struct.ImVector.33, %struct.ImGuiTableSortSpecs, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }
%struct.ImSpan = type { ptr, ptr }
%struct.ImSpan.31 = type { ptr, ptr }
%struct.ImSpan.32 = type { ptr, ptr }
%struct.ImGuiTextBuffer = type { %struct.ImVector.20 }
%struct.ImVector.20 = type { i32, i32, ptr }
%struct.ImGuiTableColumnSortSpecs = type <{ i32, i16, i16, i8, [3 x i8] }>
%struct.ImVector.33 = type { i32, i32, ptr }
%struct.ImGuiTableSortSpecs = type <{ ptr, i32, i8, [3 x i8] }>
%struct.ImGuiTableColumn = type <{ i32, float, float, float, float, float, float, float, %struct.ImRect, i32, float, float, float, float, float, float, float, i16, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }>

; 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 uwtable
declare dso_local void @_ZN6ImRectC2Effff(ptr noundef nonnull align 4 dereferenceable(16), float noundef, float noundef, float noundef, float noundef) unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local { <2 x float>, <2 x float> } @_ZN5ImGui18TableGetCellBgRectEPK10ImGuiTablei(ptr noundef %0, i32 noundef %1) #1 {
  %3 = alloca %struct.ImRect, align 4
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca float, align 4
  %8 = alloca float, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #3
  %9 = load ptr, ptr %4, align 8, !tbaa !5
  %10 = getelementptr inbounds %struct.ImGuiTable, ptr %9, i32 0, i32 4
  %11 = load i32, ptr %5, align 4, !tbaa !9
  %12 = call noundef nonnull align 4 dereferenceable(103) ptr @_ZNK6ImSpanI16ImGuiTableColumnEixEi(ptr noundef nonnull align 8 dereferenceable(16) %10, i32 noundef %11)
  store ptr %12, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  %13 = load ptr, ptr %6, align 8, !tbaa !5
  %14 = getelementptr inbounds %struct.ImGuiTableColumn, ptr %13, i32 0, i32 2
  %15 = load float, ptr %14, align 4, !tbaa !11
  store float %15, ptr %7, align 4, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  %16 = load ptr, ptr %6, align 8, !tbaa !5
  %17 = getelementptr inbounds %struct.ImGuiTableColumn, ptr %16, i32 0, i32 3
  %18 = load float, ptr %17, align 4, !tbaa !19
  store float %18, ptr %8, align 4, !tbaa !18
  %19 = load ptr, ptr %6, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.ImGuiTableColumn, ptr %19, i32 0, i32 20
  %21 = load i8, ptr %20, align 4, !tbaa !20
  %22 = sext i8 %21 to i32
  %23 = icmp eq i32 %22, -1
  br i1 %23, label %24, label %30

24:                                               ; preds = %2
  %25 = load ptr, ptr %4, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.ImGuiTable, ptr %25, i32 0, i32 36
  %27 = load float, ptr %26, align 4, !tbaa !21
  %28 = load float, ptr %7, align 4, !tbaa !18
  %29 = fsub float %28, %27
  store float %29, ptr %7, align 4, !tbaa !18
  br label %30

30:                                               ; preds = %24, %2
  %31 = load ptr, ptr %6, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.ImGuiTableColumn, ptr %31, i32 0, i32 21
  %33 = load i8, ptr %32, align 1, !tbaa !32
  %34 = sext i8 %33 to i32
  %35 = icmp eq i32 %34, -1
  br i1 %35, label %36, label %42

36:                                               ; preds = %30
  %37 = load ptr, ptr %4, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.ImGuiTable, ptr %37, i32 0, i32 37
  %39 = load float, ptr %38, align 8, !tbaa !33
  %40 = load float, ptr %8, align 4, !tbaa !18
  %41 = fadd float %40, %39
  store float %41, ptr %8, align 4, !tbaa !18
  br label %42

42:                                               ; preds = %36, %30
  %43 = load float, ptr %7, align 4, !tbaa !18
  %44 = load ptr, ptr %4, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.ImGuiTable, ptr %44, i32 0, i32 19
  %46 = load float, ptr %45, align 4, !tbaa !34
  %47 = load float, ptr %8, align 4, !tbaa !18
  %48 = load ptr, ptr %4, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.ImGuiTable, ptr %48, i32 0, i32 20
  %50 = load float, ptr %49, align 8, !tbaa !35
  call void @_ZN6ImRectC2Effff(ptr noundef nonnull align 4 dereferenceable(16) %3, float noundef %43, float noundef %46, float noundef %47, float noundef %50)
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  %51 = load { <2 x float>, <2 x float> }, ptr %3, align 4
  ret { <2 x float>, <2 x float> } %51
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = !{!"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, !13, i64 8}
!12 = !{!"_ZTS16ImGuiTableColumn", !10, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20, !13, i64 24, !13, i64 28, !14, i64 32, !10, i64 48, !13, i64 52, !13, i64 56, !13, i64 60, !13, i64 64, !13, i64 68, !13, i64 72, !13, i64 76, !16, i64 80, !7, i64 82, !7, i64 83, !7, i64 84, !7, i64 85, !7, i64 86, !7, i64 87, !7, i64 88, !7, i64 89, !17, i64 90, !17, i64 91, !17, i64 92, !17, i64 93, !17, i64 94, !17, i64 95, !17, i64 96, !17, i64 97, !7, i64 98, !7, i64 99, !7, i64 100, !7, i64 101, !7, i64 101, !7, i64 101, !7, i64 102}
!13 = !{!"float", !7, i64 0}
!14 = !{!"_ZTS6ImRect", !15, i64 0, !15, i64 8}
!15 = !{!"_ZTS6ImVec2", !13, i64 0, !13, i64 4}
!16 = !{!"short", !7, i64 0}
!17 = !{!"bool", !7, i64 0}
!18 = !{!13, !13, i64 0}
!19 = !{!12, !13, i64 12}
!20 = !{!12, !7, i64 84}
!21 = !{!22, !13, i64 204}
!22 = !{!"_ZTS10ImGuiTable", !10, i64 0, !10, i64 4, !6, i64 8, !6, i64 16, !23, i64 24, !24, i64 40, !25, i64 56, !26, i64 72, !26, i64 80, !26, i64 88, !26, i64 96, !10, i64 104, !10, i64 108, !10, i64 112, !10, i64 116, !10, i64 120, !10, i64 124, !16, i64 128, !16, i64 130, !13, i64 132, !13, i64 136, !13, i64 140, !13, i64 144, !13, i64 148, !10, i64 152, !10, i64 154, !10, i64 156, !7, i64 160, !10, i64 168, !10, i64 172, !13, i64 176, !13, i64 180, !13, i64 184, !13, i64 188, !13, i64 192, !13, i64 196, !13, i64 200, !13, i64 204, !13, i64 208, !13, i64 212, !13, i64 216, !13, i64 220, !13, i64 224, !13, i64 228, !13, i64 232, !13, i64 236, !13, i64 240, !14, i64 244, !14, i64 260, !14, i64 276, !14, i64 292, !14, i64 308, !14, i64 324, !14, i64 340, !14, i64 356, !14, i64 372, !6, i64 392, !6, i64 400, !27, i64 408, !6, i64 424, !29, i64 432, !30, i64 448, !31, i64 464, !7, i64 480, !7, i64 481, !7, i64 482, !7, i64 483, !7, i64 484, !7, i64 485, !7, i64 486, !7, i64 487, !7, i64 488, !7, i64 489, !7, i64 490, !7, i64 491, !7, i64 492, !7, i64 493, !7, i64 494, !7, i64 495, !7, i64 496, !7, i64 497, !7, i64 498, !7, i64 499, !7, i64 500, !7, i64 501, !7, i64 502, !7, i64 503, !7, i64 504, !17, i64 505, !17, i64 506, !17, i64 507, !17, i64 508, !17, i64 509, !17, i64 510, !17, i64 511, !17, i64 512, !17, i64 513, !17, i64 514, !17, i64 515, !17, i64 516, !17, i64 517, !17, i64 518, !17, i64 519}
!23 = !{!"_ZTS6ImSpanI16ImGuiTableColumnE", !6, i64 0, !6, i64 8}
!24 = !{!"_ZTS6ImSpanIaE", !6, i64 0, !6, i64 8}
!25 = !{!"_ZTS6ImSpanI18ImGuiTableCellDataE", !6, i64 0, !6, i64 8}
!26 = !{!"long long", !7, i64 0}
!27 = !{!"_ZTS15ImGuiTextBuffer", !28, i64 0}
!28 = !{!"_ZTS8ImVectorIcE", !10, i64 0, !10, i64 4, !6, i64 8}
!29 = !{!"_ZTS25ImGuiTableColumnSortSpecs", !10, i64 0, !16, i64 4, !16, i64 6, !10, i64 8}
!30 = !{!"_ZTS8ImVectorI25ImGuiTableColumnSortSpecsE", !10, i64 0, !10, i64 4, !6, i64 8}
!31 = !{!"_ZTS19ImGuiTableSortSpecs", !6, i64 0, !10, i64 8, !17, i64 12}
!32 = !{!12, !7, i64 85}
!33 = !{!22, !13, i64 208}
!34 = !{!22, !13, i64 132}
!35 = !{!22, !13, i64 136}


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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6ImRectC2Effff(ptr noundef nonnull align 4 dereferenceable(16), float noundef, float noundef, float noundef, float noundef) unnamed_addr #0 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local { <2 x float>, <2 x float> } @_ZN5ImGui18TableGetCellBgRectEPK10ImGuiTablei(ptr noundef %0, i32 noundef %1) local_unnamed_addr #0 {
  %3 = alloca %struct.ImRect, align 8
  %4 = getelementptr inbounds i8, ptr %0, i64 24
  %5 = tail call noundef nonnull align 4 dereferenceable(103) ptr @_ZNK6ImSpanI16ImGuiTableColumnEixEi(ptr noundef nonnull align 8 dereferenceable(16) %4, i32 noundef %1)
  %6 = getelementptr inbounds i8, ptr %5, i64 8
  %7 = load float, ptr %6, align 4, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %5, i64 12
  %9 = load float, ptr %8, align 4, !tbaa !15
  %10 = getelementptr inbounds i8, ptr %5, i64 84
  %11 = load i8, ptr %10, align 4, !tbaa !16
  %12 = icmp eq i8 %11, -1
  br i1 %12, label %13, label %17

13:                                               ; preds = %2
  %14 = getelementptr inbounds i8, ptr %0, i64 204
  %15 = load float, ptr %14, align 4, !tbaa !17
  %16 = fsub float %7, %15
  br label %17

17:                                               ; preds = %13, %2
  %.013 = phi float [ %16, %13 ], [ %7, %2 ]
  %18 = getelementptr inbounds i8, ptr %5, i64 85
  %19 = load i8, ptr %18, align 1, !tbaa !29
  %20 = icmp eq i8 %19, -1
  br i1 %20, label %21, label %25

21:                                               ; preds = %17
  %22 = getelementptr inbounds i8, ptr %0, i64 208
  %23 = load float, ptr %22, align 8, !tbaa !30
  %24 = fadd float %9, %23
  br label %25

25:                                               ; preds = %21, %17
  %.0 = phi float [ %24, %21 ], [ %9, %17 ]
  %26 = getelementptr inbounds i8, ptr %0, i64 132
  %27 = load float, ptr %26, align 4, !tbaa !31
  %28 = getelementptr inbounds i8, ptr %0, i64 136
  %29 = load float, ptr %28, align 8, !tbaa !32
  call void @_ZN6ImRectC2Effff(ptr noundef nonnull align 4 dereferenceable(16) %3, float noundef %.013, float noundef %27, float noundef %.0, float noundef %29)
  %.fca.0.load = load <2 x float>, ptr %3, align 8
  %.fca.0.insert = insertvalue { <2 x float>, <2 x float> } poison, <2 x float> %.fca.0.load, 0
  %.fca.1.gep = getelementptr inbounds i8, ptr %3, i64 8
  %.fca.1.load = load <2 x float>, ptr %.fca.1.gep, align 8
  %.fca.1.insert = insertvalue { <2 x float>, <2 x float> } %.fca.0.insert, <2 x float> %.fca.1.load, 1
  ret { <2 x float>, <2 x float> } %.fca.1.insert
}

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

!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 8}
!6 = !{!"_ZTS16ImGuiTableColumn", !7, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !11, i64 32, !7, i64 48, !10, i64 52, !10, i64 56, !10, i64 60, !10, i64 64, !10, i64 68, !10, i64 72, !10, i64 76, !13, i64 80, !8, i64 82, !8, i64 83, !8, i64 84, !8, i64 85, !8, i64 86, !8, i64 87, !8, i64 88, !8, i64 89, !14, i64 90, !14, i64 91, !14, i64 92, !14, i64 93, !14, i64 94, !14, i64 95, !14, i64 96, !14, i64 97, !8, i64 98, !8, i64 99, !8, i64 100, !8, i64 101, !8, i64 101, !8, i64 101, !8, i64 102}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"float", !8, i64 0}
!11 = !{!"_ZTS6ImRect", !12, i64 0, !12, i64 8}
!12 = !{!"_ZTS6ImVec2", !10, i64 0, !10, i64 4}
!13 = !{!"short", !8, i64 0}
!14 = !{!"bool", !8, i64 0}
!15 = !{!6, !10, i64 12}
!16 = !{!6, !8, i64 84}
!17 = !{!18, !10, i64 204}
!18 = !{!"_ZTS10ImGuiTable", !7, i64 0, !7, i64 4, !19, i64 8, !19, i64 16, !20, i64 24, !21, i64 40, !22, i64 56, !23, i64 72, !23, i64 80, !23, i64 88, !23, i64 96, !7, i64 104, !7, i64 108, !7, i64 112, !7, i64 116, !7, i64 120, !7, i64 124, !13, i64 128, !13, i64 130, !10, i64 132, !10, i64 136, !10, i64 140, !10, i64 144, !10, i64 148, !7, i64 152, !7, i64 154, !7, i64 156, !8, i64 160, !7, i64 168, !7, i64 172, !10, i64 176, !10, i64 180, !10, i64 184, !10, i64 188, !10, i64 192, !10, i64 196, !10, i64 200, !10, i64 204, !10, i64 208, !10, i64 212, !10, i64 216, !10, i64 220, !10, i64 224, !10, i64 228, !10, i64 232, !10, i64 236, !10, i64 240, !11, i64 244, !11, i64 260, !11, i64 276, !11, i64 292, !11, i64 308, !11, i64 324, !11, i64 340, !11, i64 356, !11, i64 372, !19, i64 392, !19, i64 400, !24, i64 408, !19, i64 424, !26, i64 432, !27, i64 448, !28, i64 464, !8, i64 480, !8, i64 481, !8, i64 482, !8, i64 483, !8, i64 484, !8, i64 485, !8, i64 486, !8, i64 487, !8, i64 488, !8, i64 489, !8, i64 490, !8, i64 491, !8, i64 492, !8, i64 493, !8, i64 494, !8, i64 495, !8, i64 496, !8, i64 497, !8, i64 498, !8, i64 499, !8, i64 500, !8, i64 501, !8, i64 502, !8, i64 503, !8, i64 504, !14, i64 505, !14, i64 506, !14, i64 507, !14, i64 508, !14, i64 509, !14, i64 510, !14, i64 511, !14, i64 512, !14, i64 513, !14, i64 514, !14, i64 515, !14, i64 516, !14, i64 517, !14, i64 518, !14, i64 519}
!19 = !{!"any pointer", !8, i64 0}
!20 = !{!"_ZTS6ImSpanI16ImGuiTableColumnE", !19, i64 0, !19, i64 8}
!21 = !{!"_ZTS6ImSpanIaE", !19, i64 0, !19, i64 8}
!22 = !{!"_ZTS6ImSpanI18ImGuiTableCellDataE", !19, i64 0, !19, i64 8}
!23 = !{!"long long", !8, i64 0}
!24 = !{!"_ZTS15ImGuiTextBuffer", !25, i64 0}
!25 = !{!"_ZTS8ImVectorIcE", !7, i64 0, !7, i64 4, !19, i64 8}
!26 = !{!"_ZTS25ImGuiTableColumnSortSpecs", !7, i64 0, !13, i64 4, !13, i64 6, !7, i64 8}
!27 = !{!"_ZTS8ImVectorI25ImGuiTableColumnSortSpecsE", !7, i64 0, !7, i64 4, !19, i64 8}
!28 = !{!"_ZTS19ImGuiTableSortSpecs", !19, i64 0, !7, i64 8, !14, i64 12}
!29 = !{!6, !8, i64 85}
!30 = !{!18, !10, i64 208}
!31 = !{!18, !10, i64 132}
!32 = !{!18, !10, i64 136}


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