; LLVM IR from Devaniti/BoolkaEngine :: ThirdParty/imgui/imgui_tables.ll (ZN5ImGui19TableSortSpecsBuildEP10ImGuiTable)

; 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.ImGuiTable = type <{ i32, i32, ptr, %struct.ImSpan, %struct.ImSpan.30, %struct.ImSpan.31, 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, %struct.ImRect, %struct.ImRect, %struct.ImVec2, %struct.ImVec2, %struct.ImVec2, %struct.ImVec2, %struct.ImVec1, float, i32, ptr, ptr, %struct.ImGuiTextBuffer, %struct.ImDrawListSplitter, %struct.ImGuiTableColumnSortSpecs, [4 x i8], %struct.ImVector.32, %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.30 = type { ptr, ptr }
%struct.ImSpan.31 = type { ptr, ptr }
%struct.ImRect = type { %struct.ImVec2, %struct.ImVec2 }
%struct.ImVec2 = type { float, float }
%struct.ImVec1 = type { float }
%struct.ImGuiTextBuffer = type { %struct.ImVector.24 }
%struct.ImVector.24 = type { i32, i32, ptr }
%struct.ImDrawListSplitter = type { i32, i32, %struct.ImVector.15 }
%struct.ImVector.15 = type { i32, i32, ptr }
%struct.ImGuiTableColumnSortSpecs = type <{ i32, i16, i16, i8, [3 x i8] }>
%struct.ImVector.32 = 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, [2 x i8] }>

@.str.2 = external hidden unnamed_addr constant [89 x i8], align 1
@.str.70 = external hidden unnamed_addr constant [24 x i8], align 1
@__PRETTY_FUNCTION__._ZN5ImGui19TableSortSpecsBuildEP10ImGuiTable = external hidden unnamed_addr constant [46 x i8], align 1
@.str.71 = external hidden unnamed_addr constant [42 x i8], align 1

; 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: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #1

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN5ImGui19TableSortSpecsBuildEP10ImGuiTable(ptr noundef %0) #3 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %8 = load ptr, ptr %2, align 8, !tbaa !5
  %9 = getelementptr inbounds %struct.ImGuiTable, ptr %8, i32 0, i32 98
  %10 = load i8, ptr %9, align 1, !tbaa !9, !range !29, !noundef !30
  %11 = trunc i8 %10 to i1
  br i1 %11, label %12, label %13

12:                                               ; preds = %1
  br label %15

13:                                               ; preds = %1
  call void @__assert_fail(ptr noundef @.str.70, ptr noundef @.str.2, i32 noundef 2645, ptr noundef @__PRETTY_FUNCTION__._ZN5ImGui19TableSortSpecsBuildEP10ImGuiTable) #5
  unreachable

14:                                               ; No predecessors!
  br label %15

15:                                               ; preds = %14, %12
  %16 = load ptr, ptr %2, align 8, !tbaa !5
  call void @_ZN5ImGui22TableSortSpecsSanitizeEP10ImGuiTable(ptr noundef %16)
  %17 = load ptr, ptr %2, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.ImGuiTable, ptr %17, i32 0, i32 69
  %19 = load ptr, ptr %2, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.ImGuiTable, ptr %19, i32 0, i32 71
  %21 = load i8, ptr %20, align 8, !tbaa !31
  %22 = sext i8 %21 to i32
  %23 = icmp sle i32 %22, 1
  br i1 %23, label %24, label %25

24:                                               ; preds = %15
  br label %30

25:                                               ; preds = %15
  %26 = load ptr, ptr %2, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.ImGuiTable, ptr %26, i32 0, i32 71
  %28 = load i8, ptr %27, align 8, !tbaa !31
  %29 = sext i8 %28 to i32
  br label %30

30:                                               ; preds = %25, %24
  %31 = phi i32 [ 0, %24 ], [ %29, %25 ]
  call void @_ZN8ImVectorI25ImGuiTableColumnSortSpecsE6resizeEi(ptr noundef nonnull align 8 dereferenceable(16) %18, i32 noundef %31)
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #6
  %32 = load ptr, ptr %2, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.ImGuiTable, ptr %32, i32 0, i32 71
  %34 = load i8, ptr %33, align 8, !tbaa !31
  %35 = sext i8 %34 to i32
  %36 = icmp eq i32 %35, 0
  br i1 %36, label %37, label %38

37:                                               ; preds = %30
  br label %54

38:                                               ; preds = %30
  %39 = load ptr, ptr %2, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.ImGuiTable, ptr %39, i32 0, i32 71
  %41 = load i8, ptr %40, align 8, !tbaa !31
  %42 = sext i8 %41 to i32
  %43 = icmp eq i32 %42, 1
  br i1 %43, label %44, label %47

44:                                               ; preds = %38
  %45 = load ptr, ptr %2, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.ImGuiTable, ptr %45, i32 0, i32 67
  br label %52

47:                                               ; preds = %38
  %48 = load ptr, ptr %2, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.ImGuiTable, ptr %48, i32 0, i32 69
  %50 = getelementptr inbounds %struct.ImVector.32, ptr %49, i32 0, i32 2
  %51 = load ptr, ptr %50, align 8, !tbaa !32
  br label %52

52:                                               ; preds = %47, %44
  %53 = phi ptr [ %46, %44 ], [ %51, %47 ]
  br label %54

54:                                               ; preds = %52, %37
  %55 = phi ptr [ null, %37 ], [ %53, %52 ]
  store ptr %55, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 0, ptr %4, align 4, !tbaa !33
  br label %56

56:                                               ; preds = %121, %54
  %57 = load i32, ptr %4, align 4, !tbaa !33
  %58 = load ptr, ptr %2, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.ImGuiTable, ptr %58, i32 0, i32 13
  %60 = load i32, ptr %59, align 4, !tbaa !34
  %61 = icmp slt i32 %57, %60
  br i1 %61, label %63, label %62

62:                                               ; preds = %56
  store i32 2, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  br label %124

63:                                               ; preds = %56
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  %64 = load ptr, ptr %2, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.ImGuiTable, ptr %64, i32 0, i32 3
  %66 = load i32, ptr %4, align 4, !tbaa !33
  %67 = call noundef nonnull align 4 dereferenceable(102) ptr @_ZN6ImSpanI16ImGuiTableColumnEixEi(ptr noundef nonnull align 8 dereferenceable(16) %65, i32 noundef %66)
  store ptr %67, ptr %6, align 8, !tbaa !5
  %68 = load ptr, ptr %6, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.ImGuiTableColumn, ptr %68, i32 0, i32 22
  %70 = load i8, ptr %69, align 2, !tbaa !35
  %71 = sext i8 %70 to i32
  %72 = icmp eq i32 %71, -1
  br i1 %72, label %73, label %74

73:                                               ; preds = %63
  store i32 4, ptr %5, align 4
  br label %118

74:                                               ; preds = %63
  %75 = load ptr, ptr %6, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.ImGuiTableColumn, ptr %75, i32 0, i32 22
  %77 = load i8, ptr %76, align 2, !tbaa !35
  %78 = sext i8 %77 to i32
  %79 = load ptr, ptr %2, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.ImGuiTable, ptr %79, i32 0, i32 71
  %81 = load i8, ptr %80, align 8, !tbaa !31
  %82 = sext i8 %81 to i32
  %83 = icmp slt i32 %78, %82
  br i1 %83, label %84, label %85

84:                                               ; preds = %74
  br label %87

85:                                               ; preds = %74
  call void @__assert_fail(ptr noundef @.str.71, ptr noundef @.str.2, i32 noundef 2656, ptr noundef @__PRETTY_FUNCTION__._ZN5ImGui19TableSortSpecsBuildEP10ImGuiTable) #5
  unreachable

86:                                               ; No predecessors!
  br label %87

87:                                               ; preds = %86, %84
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %88 = load ptr, ptr %3, align 8, !tbaa !5
  %89 = load ptr, ptr %6, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.ImGuiTableColumn, ptr %89, i32 0, i32 22
  %91 = load i8, ptr %90, align 2, !tbaa !35
  %92 = sext i8 %91 to i64
  %93 = getelementptr inbounds %struct.ImGuiTableColumnSortSpecs, ptr %88, i64 %92
  store ptr %93, ptr %7, align 8, !tbaa !5
  %94 = load ptr, ptr %6, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.ImGuiTableColumn, ptr %94, i32 0, i32 9
  %96 = load i32, ptr %95, align 4, !tbaa !37
  %97 = load ptr, ptr %7, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.ImGuiTableColumnSortSpecs, ptr %97, i32 0, i32 0
  store i32 %96, ptr %98, align 4, !tbaa !38
  %99 = load i32, ptr %4, align 4, !tbaa !33
  %100 = trunc i32 %99 to i8
  %101 = sext i8 %100 to i16
  %102 = load ptr, ptr %7, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.ImGuiTableColumnSortSpecs, ptr %102, i32 0, i32 1
  store i16 %101, ptr %103, align 4, !tbaa !39
  %104 = load ptr, ptr %6, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.ImGuiTableColumn, ptr %104, i32 0, i32 22
  %106 = load i8, ptr %105, align 2, !tbaa !35
  %107 = sext i8 %106 to i16
  %108 = load ptr, ptr %7, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.ImGuiTableColumnSortSpecs, ptr %108, i32 0, i32 2
  store i16 %107, ptr %109, align 2, !tbaa !40
  %110 = load ptr, ptr %6, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.ImGuiTableColumn, ptr %110, i32 0, i32 36
  %112 = load i8, ptr %111, align 4
  %113 = and i8 %112, 3
  %114 = zext i8 %113 to i32
  %115 = load ptr, ptr %7, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.ImGuiTableColumnSortSpecs, ptr %115, i32 0, i32 3
  %117 = trunc i32 %114 to i8
  store i8 %117, ptr %116, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  store i32 0, ptr %5, align 4
  br label %118

118:                                              ; preds = %87, %73
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  %119 = load i32, ptr %5, align 4
  switch i32 %119, label %141 [
    i32 0, label %120
    i32 4, label %121
  ]

120:                                              ; preds = %118
  br label %121

121:                                              ; preds = %120, %118
  %122 = load i32, ptr %4, align 4, !tbaa !33
  %123 = add nsw i32 %122, 1
  store i32 %123, ptr %4, align 4, !tbaa !33
  br label %56, !llvm.loop !41

124:                                              ; preds = %62
  %125 = load ptr, ptr %3, align 8, !tbaa !5
  %126 = load ptr, ptr %2, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.ImGuiTable, ptr %126, i32 0, i32 70
  %128 = getelementptr inbounds %struct.ImGuiTableSortSpecs, ptr %127, i32 0, i32 0
  store ptr %125, ptr %128, align 8, !tbaa !43
  %129 = load ptr, ptr %2, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.ImGuiTable, ptr %129, i32 0, i32 71
  %131 = load i8, ptr %130, align 8, !tbaa !31
  %132 = sext i8 %131 to i32
  %133 = load ptr, ptr %2, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct.ImGuiTable, ptr %133, i32 0, i32 70
  %135 = getelementptr inbounds %struct.ImGuiTableSortSpecs, ptr %134, i32 0, i32 1
  store i32 %132, ptr %135, align 8, !tbaa !44
  %136 = load ptr, ptr %2, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct.ImGuiTable, ptr %136, i32 0, i32 70
  %138 = getelementptr inbounds %struct.ImGuiTableSortSpecs, ptr %137, i32 0, i32 2
  store i8 1, ptr %138, align 4, !tbaa !45
  %139 = load ptr, ptr %2, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.ImGuiTable, ptr %139, i32 0, i32 98
  store i8 0, ptr %140, align 1, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  ret void

141:                                              ; preds = %118
  unreachable
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5ImGui22TableSortSpecsSanitizeEP10ImGuiTable(ptr noundef) #3

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { noreturn 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 #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 = { inlinehint 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 #5 = { noreturn nounwind }
attributes #6 = { 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, !28, i64 587}
!10 = !{!"_ZTS10ImGuiTable", !11, i64 0, !11, i64 4, !6, i64 8, !12, i64 16, !13, i64 32, !14, i64 48, !15, i64 64, !15, i64 72, !15, i64 80, !15, i64 88, !11, i64 96, !11, i64 100, !11, i64 104, !11, i64 108, !11, i64 112, !11, i64 116, !16, i64 120, !16, i64 122, !17, i64 124, !17, i64 128, !17, i64 132, !17, i64 136, !17, i64 140, !11, i64 144, !11, i64 146, !11, i64 148, !7, i64 152, !11, i64 160, !11, i64 164, !17, i64 168, !17, i64 172, !17, i64 176, !17, i64 180, !17, i64 184, !17, i64 188, !17, i64 192, !17, i64 196, !17, i64 200, !17, i64 204, !17, i64 208, !17, i64 212, !17, i64 216, !17, i64 220, !17, i64 224, !17, i64 228, !17, i64 232, !18, i64 236, !18, i64 252, !18, i64 268, !18, i64 284, !18, i64 300, !18, i64 316, !18, i64 332, !18, i64 348, !18, i64 364, !18, i64 380, !18, i64 396, !19, i64 412, !19, i64 420, !19, i64 428, !19, i64 436, !20, i64 444, !17, i64 448, !11, i64 452, !6, i64 456, !6, i64 464, !21, i64 472, !23, i64 488, !25, i64 512, !26, i64 528, !27, i64 544, !7, i64 560, !7, i64 561, !7, i64 562, !7, i64 563, !7, i64 564, !7, i64 565, !7, i64 566, !7, i64 567, !7, i64 568, !7, i64 569, !7, i64 570, !7, i64 571, !7, i64 572, !7, i64 573, !7, i64 574, !7, i64 575, !7, i64 576, !7, i64 577, !7, i64 578, !7, i64 579, !7, i64 580, !7, i64 581, !7, i64 582, !7, i64 583, !28, i64 584, !28, i64 585, !28, i64 586, !28, i64 587, !28, i64 588, !28, i64 589, !28, i64 590, !28, i64 591, !28, i64 592, !28, i64 593, !28, i64 594, !28, i64 595, !28, i64 596, !28, i64 597, !28, i64 598}
!11 = !{!"int", !7, i64 0}
!12 = !{!"_ZTS6ImSpanI16ImGuiTableColumnE", !6, i64 0, !6, i64 8}
!13 = !{!"_ZTS6ImSpanIaE", !6, i64 0, !6, i64 8}
!14 = !{!"_ZTS6ImSpanI18ImGuiTableCellDataE", !6, i64 0, !6, i64 8}
!15 = !{!"long long", !7, i64 0}
!16 = !{!"short", !7, i64 0}
!17 = !{!"float", !7, i64 0}
!18 = !{!"_ZTS6ImRect", !19, i64 0, !19, i64 8}
!19 = !{!"_ZTS6ImVec2", !17, i64 0, !17, i64 4}
!20 = !{!"_ZTS6ImVec1", !17, i64 0}
!21 = !{!"_ZTS15ImGuiTextBuffer", !22, i64 0}
!22 = !{!"_ZTS8ImVectorIcE", !11, i64 0, !11, i64 4, !6, i64 8}
!23 = !{!"_ZTS18ImDrawListSplitter", !11, i64 0, !11, i64 4, !24, i64 8}
!24 = !{!"_ZTS8ImVectorI13ImDrawChannelE", !11, i64 0, !11, i64 4, !6, i64 8}
!25 = !{!"_ZTS25ImGuiTableColumnSortSpecs", !11, i64 0, !16, i64 4, !16, i64 6, !11, i64 8}
!26 = !{!"_ZTS8ImVectorI25ImGuiTableColumnSortSpecsE", !11, i64 0, !11, i64 4, !6, i64 8}
!27 = !{!"_ZTS19ImGuiTableSortSpecs", !6, i64 0, !11, i64 8, !28, i64 12}
!28 = !{!"bool", !7, i64 0}
!29 = !{i8 0, i8 2}
!30 = !{}
!31 = !{!10, !7, i64 560}
!32 = !{!10, !6, i64 536}
!33 = !{!11, !11, i64 0}
!34 = !{!10, !11, i64 108}
!35 = !{!36, !7, i64 86}
!36 = !{!"_ZTS16ImGuiTableColumn", !11, i64 0, !17, i64 4, !17, i64 8, !17, i64 12, !17, i64 16, !17, i64 20, !17, i64 24, !17, i64 28, !18, i64 32, !11, i64 48, !17, i64 52, !17, i64 56, !17, i64 60, !17, i64 64, !17, i64 68, !17, i64 72, !17, 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, !28, i64 90, !28, i64 91, !28, i64 92, !28, i64 93, !28, i64 94, !28, i64 95, !28, i64 96, !7, i64 97, !7, i64 98, !7, i64 99, !7, i64 100, !7, i64 100, !7, i64 100, !7, i64 101}
!37 = !{!36, !11, i64 48}
!38 = !{!25, !11, i64 0}
!39 = !{!25, !16, i64 4}
!40 = !{!25, !16, i64 6}
!41 = distinct !{!41, !42}
!42 = !{!"llvm.loop.mustprogress"}
!43 = !{!10, !6, i64 544}
!44 = !{!10, !11, i64 552}
!45 = !{!10, !28, i64 556}


; 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.ImGuiTableColumnSortSpecs = type <{ i32, i16, i16, i8, [3 x i8] }>

@.str.2 = external hidden unnamed_addr constant [89 x i8], align 1
@.str.70 = external hidden unnamed_addr constant [24 x i8], align 1
@__PRETTY_FUNCTION__._ZN5ImGui19TableSortSpecsBuildEP10ImGuiTable = external hidden unnamed_addr constant [46 x i8], align 1
@.str.71 = external hidden unnamed_addr constant [42 x i8], align 1

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #0

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN5ImGui19TableSortSpecsBuildEP10ImGuiTable(ptr noundef %0) local_unnamed_addr #2 {
  %2 = getelementptr inbounds i8, ptr %0, i64 587
  %3 = load i8, ptr %2, align 1, !tbaa !5, !range !28, !noundef !29
  %4 = trunc nuw i8 %3 to i1
  br i1 %4, label %6, label %5

5:                                                ; preds = %1
  tail call void @__assert_fail(ptr noundef nonnull @.str.70, ptr noundef nonnull @.str.2, i32 noundef 2645, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN5ImGui19TableSortSpecsBuildEP10ImGuiTable) #4
  unreachable

6:                                                ; preds = %1
  tail call void @_ZN5ImGui22TableSortSpecsSanitizeEP10ImGuiTable(ptr noundef nonnull %0)
  %7 = getelementptr inbounds i8, ptr %0, i64 528
  %8 = getelementptr inbounds i8, ptr %0, i64 560
  %9 = load i8, ptr %8, align 8, !tbaa !30
  %10 = icmp slt i8 %9, 2
  %narrow = select i1 %10, i8 0, i8 %9
  %spec.select = sext i8 %narrow to i32
  tail call void @_ZN8ImVectorI25ImGuiTableColumnSortSpecsE6resizeEi(ptr noundef nonnull align 8 dereferenceable(16) %7, i32 noundef %spec.select)
  %11 = load i8, ptr %8, align 8, !tbaa !30
  switch i8 %11, label %14 [
    i8 0, label %17
    i8 1, label %12
  ]

12:                                               ; preds = %6
  %13 = getelementptr inbounds i8, ptr %0, i64 512
  br label %17

14:                                               ; preds = %6
  %15 = getelementptr inbounds i8, ptr %0, i64 536
  %16 = load ptr, ptr %15, align 8, !tbaa !31
  br label %17

17:                                               ; preds = %6, %12, %14
  %18 = phi ptr [ null, %6 ], [ %13, %12 ], [ %16, %14 ]
  %19 = getelementptr inbounds i8, ptr %0, i64 108
  %20 = load i32, ptr %19, align 4, !tbaa !32
  %21 = icmp sgt i32 %20, 0
  br i1 %21, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %17
  %22 = getelementptr inbounds i8, ptr %0, i64 16
  br label %28

._crit_edge.loopexit:                             ; preds = %51
  %.pre = load i8, ptr %8, align 8, !tbaa !30
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %17
  %23 = phi i8 [ %.pre, %._crit_edge.loopexit ], [ %11, %17 ]
  %24 = getelementptr inbounds i8, ptr %0, i64 544
  store ptr %18, ptr %24, align 8, !tbaa !33
  %25 = sext i8 %23 to i32
  %26 = getelementptr inbounds i8, ptr %0, i64 552
  store i32 %25, ptr %26, align 8, !tbaa !34
  %27 = getelementptr inbounds i8, ptr %0, i64 556
  store i8 1, ptr %27, align 4, !tbaa !35
  store i8 0, ptr %2, align 1, !tbaa !5
  ret void

28:                                               ; preds = %.lr.ph, %51
  %.035 = phi i32 [ 0, %.lr.ph ], [ %52, %51 ]
  %29 = tail call noundef nonnull align 4 dereferenceable(102) ptr @_ZN6ImSpanI16ImGuiTableColumnEixEi(ptr noundef nonnull align 8 dereferenceable(16) %22, i32 noundef %.035)
  %30 = getelementptr inbounds i8, ptr %29, i64 86
  %31 = load i8, ptr %30, align 2, !tbaa !36
  %32 = icmp eq i8 %31, -1
  br i1 %32, label %51, label %33

33:                                               ; preds = %28
  %34 = load i8, ptr %8, align 8, !tbaa !30
  %35 = icmp slt i8 %31, %34
  br i1 %35, label %37, label %36

36:                                               ; preds = %33
  tail call void @__assert_fail(ptr noundef nonnull @.str.71, ptr noundef nonnull @.str.2, i32 noundef 2656, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN5ImGui19TableSortSpecsBuildEP10ImGuiTable) #4
  unreachable

37:                                               ; preds = %33
  %38 = sext i8 %31 to i64
  %39 = getelementptr inbounds %struct.ImGuiTableColumnSortSpecs, ptr %18, i64 %38
  %40 = getelementptr inbounds i8, ptr %29, i64 48
  %41 = load i32, ptr %40, align 4, !tbaa !38
  store i32 %41, ptr %39, align 4, !tbaa !39
  %42 = trunc i32 %.035 to i16
  %sext = shl i16 %42, 8
  %43 = ashr exact i16 %sext, 8
  %44 = getelementptr inbounds i8, ptr %39, i64 4
  store i16 %43, ptr %44, align 4, !tbaa !40
  %45 = sext i8 %31 to i16
  %46 = getelementptr inbounds i8, ptr %39, i64 6
  store i16 %45, ptr %46, align 2, !tbaa !41
  %47 = getelementptr inbounds i8, ptr %29, i64 100
  %48 = load i8, ptr %47, align 4
  %49 = and i8 %48, 3
  %50 = getelementptr inbounds i8, ptr %39, i64 8
  store i8 %49, ptr %50, align 4
  br label %51

51:                                               ; preds = %28, %37
  %52 = add nuw nsw i32 %.035, 1
  %53 = load i32, ptr %19, align 4, !tbaa !32
  %54 = icmp slt i32 %52, %53
  br i1 %54, label %28, label %._crit_edge.loopexit, !llvm.loop !42
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5ImGui22TableSortSpecsSanitizeEP10ImGuiTable(ptr noundef) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN8ImVectorI25ImGuiTableColumnSortSpecsE6resizeEi(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) local_unnamed_addr #3 align 2

attributes #0 = { noreturn 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 #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 = { inlinehint 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 = { noreturn 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, !27, i64 587}
!6 = !{!"_ZTS10ImGuiTable", !7, i64 0, !7, i64 4, !10, i64 8, !11, i64 16, !12, i64 32, !13, i64 48, !14, i64 64, !14, i64 72, !14, i64 80, !14, i64 88, !7, i64 96, !7, i64 100, !7, i64 104, !7, i64 108, !7, i64 112, !7, i64 116, !15, i64 120, !15, i64 122, !16, i64 124, !16, i64 128, !16, i64 132, !16, i64 136, !16, i64 140, !7, i64 144, !7, i64 146, !7, i64 148, !8, i64 152, !7, i64 160, !7, i64 164, !16, i64 168, !16, i64 172, !16, i64 176, !16, i64 180, !16, i64 184, !16, i64 188, !16, i64 192, !16, i64 196, !16, i64 200, !16, i64 204, !16, i64 208, !16, i64 212, !16, i64 216, !16, i64 220, !16, i64 224, !16, i64 228, !16, i64 232, !17, i64 236, !17, i64 252, !17, i64 268, !17, i64 284, !17, i64 300, !17, i64 316, !17, i64 332, !17, i64 348, !17, i64 364, !17, i64 380, !17, i64 396, !18, i64 412, !18, i64 420, !18, i64 428, !18, i64 436, !19, i64 444, !16, i64 448, !7, i64 452, !10, i64 456, !10, i64 464, !20, i64 472, !22, i64 488, !24, i64 512, !25, i64 528, !26, i64 544, !8, i64 560, !8, i64 561, !8, i64 562, !8, i64 563, !8, i64 564, !8, i64 565, !8, i64 566, !8, i64 567, !8, i64 568, !8, i64 569, !8, i64 570, !8, i64 571, !8, i64 572, !8, i64 573, !8, i64 574, !8, i64 575, !8, i64 576, !8, i64 577, !8, i64 578, !8, i64 579, !8, i64 580, !8, i64 581, !8, i64 582, !8, i64 583, !27, i64 584, !27, i64 585, !27, i64 586, !27, i64 587, !27, i64 588, !27, i64 589, !27, i64 590, !27, i64 591, !27, i64 592, !27, i64 593, !27, i64 594, !27, i64 595, !27, i64 596, !27, i64 597, !27, i64 598}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"_ZTS6ImSpanI16ImGuiTableColumnE", !10, i64 0, !10, i64 8}
!12 = !{!"_ZTS6ImSpanIaE", !10, i64 0, !10, i64 8}
!13 = !{!"_ZTS6ImSpanI18ImGuiTableCellDataE", !10, i64 0, !10, i64 8}
!14 = !{!"long long", !8, i64 0}
!15 = !{!"short", !8, i64 0}
!16 = !{!"float", !8, i64 0}
!17 = !{!"_ZTS6ImRect", !18, i64 0, !18, i64 8}
!18 = !{!"_ZTS6ImVec2", !16, i64 0, !16, i64 4}
!19 = !{!"_ZTS6ImVec1", !16, i64 0}
!20 = !{!"_ZTS15ImGuiTextBuffer", !21, i64 0}
!21 = !{!"_ZTS8ImVectorIcE", !7, i64 0, !7, i64 4, !10, i64 8}
!22 = !{!"_ZTS18ImDrawListSplitter", !7, i64 0, !7, i64 4, !23, i64 8}
!23 = !{!"_ZTS8ImVectorI13ImDrawChannelE", !7, i64 0, !7, i64 4, !10, i64 8}
!24 = !{!"_ZTS25ImGuiTableColumnSortSpecs", !7, i64 0, !15, i64 4, !15, i64 6, !7, i64 8}
!25 = !{!"_ZTS8ImVectorI25ImGuiTableColumnSortSpecsE", !7, i64 0, !7, i64 4, !10, i64 8}
!26 = !{!"_ZTS19ImGuiTableSortSpecs", !10, i64 0, !7, i64 8, !27, i64 12}
!27 = !{!"bool", !8, i64 0}
!28 = !{i8 0, i8 2}
!29 = !{}
!30 = !{!6, !8, i64 560}
!31 = !{!6, !10, i64 536}
!32 = !{!6, !7, i64 108}
!33 = !{!6, !10, i64 544}
!34 = !{!6, !7, i64 552}
!35 = !{!6, !27, i64 556}
!36 = !{!37, !8, i64 86}
!37 = !{!"_ZTS16ImGuiTableColumn", !7, i64 0, !16, i64 4, !16, i64 8, !16, i64 12, !16, i64 16, !16, i64 20, !16, i64 24, !16, i64 28, !17, i64 32, !7, i64 48, !16, i64 52, !16, i64 56, !16, i64 60, !16, i64 64, !16, i64 68, !16, i64 72, !16, i64 76, !15, 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, !27, i64 90, !27, i64 91, !27, i64 92, !27, i64 93, !27, i64 94, !27, i64 95, !27, i64 96, !8, i64 97, !8, i64 98, !8, i64 99, !8, i64 100, !8, i64 100, !8, i64 100, !8, i64 101}
!38 = !{!37, !7, i64 48}
!39 = !{!24, !7, i64 0}
!40 = !{!24, !15, i64 4}
!41 = !{!24, !15, i64 6}
!42 = distinct !{!42, !43}
!43 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,LICMPass,LoopRotatePass,LoopSimplifyPass,SROAPass,SimplifyCFGPass,TailCallElimPass