; LLVM IR from Samson-Mano/EM_Propogation_simulation :: EM_Propogation_simulation/src/ImGui (imgui_tables)

; 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, ptr, %struct.ImSpan, %struct.ImSpan.35, %struct.ImSpan.36, ptr, ptr, ptr, 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, %struct.ImRect, %struct.ImRect, %struct.ImRect, %struct.ImRect, %struct.ImRect, %struct.ImRect, %struct.ImRect, %struct.ImRect, %struct.ImRect, ptr, ptr, %struct.ImGuiTextBuffer, ptr, %struct.ImGuiTableInstanceData, %struct.ImVector.37, %struct.ImGuiTableColumnSortSpecs, [4 x i8], %struct.ImVector.38, %struct.ImGuiTableSortSpecs, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, [5 x i8] }>
%struct.ImSpan = type { ptr, ptr }
%struct.ImSpan.35 = type { ptr, ptr }
%struct.ImSpan.36 = type { ptr, ptr }
%struct.ImRect = type { %struct.ImVec2, %struct.ImVec2 }
%struct.ImVec2 = type { float, float }
%struct.ImGuiTextBuffer = type { %struct.ImVector.24 }
%struct.ImVector.24 = type { i32, i32, ptr }
%struct.ImGuiTableInstanceData = type { i32, float, float, float }
%struct.ImVector.37 = type { i32, i32, ptr }
%struct.ImGuiTableColumnSortSpecs = type <{ i32, i16, i16, i8, [3 x i8] }>
%struct.ImVector.38 = type { i32, i32, ptr }
%struct.ImGuiTableSortSpecs = type <{ ptr, i32, i8, [3 x i8] }>

@.str.1 = external hidden unnamed_addr constant [124 x i8], align 1
@.str.44 = external hidden unnamed_addr constant [48 x i8], align 1
@__PRETTY_FUNCTION__._ZN5ImGui22TableGetColumnResizeIDEP10ImGuiTableii = external hidden unnamed_addr constant [62 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: mustprogress uwtable
define dso_local noundef i32 @_ZN5ImGui22TableGetColumnResizeIDEP10ImGuiTableii(ptr noundef %0, i32 noundef %1, i32 noundef %2) #2 {
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !9
  store i32 %2, ptr %6, align 4, !tbaa !9
  %8 = load i32, ptr %5, align 4, !tbaa !9
  %9 = icmp sge i32 %8, 0
  br i1 %9, label %10, label %16

10:                                               ; preds = %3
  %11 = load i32, ptr %5, align 4, !tbaa !9
  %12 = load ptr, ptr %4, align 8, !tbaa !5
  %13 = getelementptr inbounds %struct.ImGuiTable, ptr %12, i32 0, i32 13
  %14 = load i32, ptr %13, align 4, !tbaa !11
  %15 = icmp slt i32 %11, %14
  br label %16

16:                                               ; preds = %10, %3
  %17 = phi i1 [ false, %3 ], [ %15, %10 ]
  br i1 %17, label %18, label %19

18:                                               ; preds = %16
  br label %21

19:                                               ; preds = %16
  call void @__assert_fail(ptr noundef @.str.44, ptr noundef @.str.1, i32 noundef 1641, ptr noundef @__PRETTY_FUNCTION__._ZN5ImGui22TableGetColumnResizeIDEP10ImGuiTableii) #4
  unreachable

20:                                               ; No predecessors!
  br label %21

21:                                               ; preds = %20, %18
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  %22 = load ptr, ptr %4, align 8, !tbaa !5
  %23 = load i32, ptr %6, align 4, !tbaa !9
  %24 = call noundef i32 @_ZN5ImGui18TableGetInstanceIDEP10ImGuiTablei(ptr noundef %22, i32 noundef %23)
  store i32 %24, ptr %7, align 4, !tbaa !9
  %25 = load i32, ptr %7, align 4, !tbaa !9
  %26 = add i32 %25, 1
  %27 = load i32, ptr %5, align 4, !tbaa !9
  %28 = add i32 %26, %27
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  ret i32 %28
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZN5ImGui18TableGetInstanceIDEP10ImGuiTablei(ptr noundef, i32 noundef) #3

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 = { 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 }
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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 108}
!12 = !{!"_ZTS10ImGuiTable", !10, i64 0, !10, i64 4, !6, i64 8, !6, i64 16, !13, i64 24, !14, i64 40, !15, i64 56, !6, i64 72, !6, i64 80, !6, i64 88, !10, i64 96, !10, i64 100, !10, i64 104, !10, i64 108, !10, i64 112, !10, i64 116, !16, i64 120, !16, i64 122, !17, i64 124, !17, i64 128, !17, i64 132, !17, i64 136, !17, i64 140, !10, i64 144, !10, i64 146, !10, i64 148, !7, i64 152, !10, i64 160, !10, 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, !18, i64 232, !18, i64 248, !18, i64 264, !18, i64 280, !18, i64 296, !18, i64 312, !18, i64 328, !18, i64 344, !18, i64 360, !6, i64 376, !6, i64 384, !20, i64 392, !6, i64 408, !22, i64 416, !23, i64 432, !24, i64 448, !25, i64 464, !26, i64 480, !16, i64 496, !16, i64 498, !16, i64 500, !16, i64 502, !16, i64 504, !16, i64 506, !16, i64 508, !16, i64 510, !16, i64 512, !16, i64 514, !16, i64 516, !16, i64 518, !16, i64 520, !16, i64 522, !16, i64 524, !16, i64 526, !16, i64 528, !16, i64 530, !16, i64 532, !16, i64 534, !16, i64 536, !16, i64 538, !16, i64 540, !16, i64 542, !16, i64 544, !27, i64 546, !27, i64 547, !27, i64 548, !27, i64 549, !27, i64 550, !27, i64 551, !27, i64 552, !27, i64 553, !27, i64 554, !27, i64 555, !27, i64 556, !27, i64 557, !27, i64 558, !27, i64 559, !27, i64 560, !27, i64 561, !27, i64 562}
!13 = !{!"_ZTS6ImSpanI16ImGuiTableColumnE", !6, i64 0, !6, i64 8}
!14 = !{!"_ZTS6ImSpanIsE", !6, i64 0, !6, i64 8}
!15 = !{!"_ZTS6ImSpanI18ImGuiTableCellDataE", !6, i64 0, !6, i64 8}
!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 = !{!"_ZTS15ImGuiTextBuffer", !21, i64 0}
!21 = !{!"_ZTS8ImVectorIcE", !10, i64 0, !10, i64 4, !6, i64 8}
!22 = !{!"_ZTS22ImGuiTableInstanceData", !10, i64 0, !17, i64 4, !17, i64 8, !17, i64 12}
!23 = !{!"_ZTS8ImVectorI22ImGuiTableInstanceDataE", !10, i64 0, !10, i64 4, !6, i64 8}
!24 = !{!"_ZTS25ImGuiTableColumnSortSpecs", !10, i64 0, !16, i64 4, !16, i64 6, !10, i64 8}
!25 = !{!"_ZTS8ImVectorI25ImGuiTableColumnSortSpecsE", !10, i64 0, !10, i64 4, !6, i64 8}
!26 = !{!"_ZTS19ImGuiTableSortSpecs", !6, i64 0, !10, i64 8, !27, i64 12}
!27 = !{!"bool", !7, i64 0}


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

@.str.1 = external hidden unnamed_addr constant [124 x i8], align 1
@.str.44 = external hidden unnamed_addr constant [48 x i8], align 1
@__PRETTY_FUNCTION__._ZN5ImGui22TableGetColumnResizeIDEP10ImGuiTableii = external hidden unnamed_addr constant [62 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: mustprogress uwtable
define dso_local noundef i32 @_ZN5ImGui22TableGetColumnResizeIDEP10ImGuiTableii(ptr noundef %0, i32 noundef %1, i32 noundef %2) local_unnamed_addr #1 {
  %4 = icmp sgt i32 %1, -1
  br i1 %4, label %5, label %.critedge

5:                                                ; preds = %3
  %6 = getelementptr inbounds i8, ptr %0, i64 108
  %7 = load i32, ptr %6, align 4, !tbaa !5
  %8 = icmp sgt i32 %7, %1
  br i1 %8, label %9, label %.critedge

.critedge:                                        ; preds = %3, %5
  tail call void @__assert_fail(ptr noundef nonnull @.str.44, ptr noundef nonnull @.str.1, i32 noundef 1641, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN5ImGui22TableGetColumnResizeIDEP10ImGuiTableii) #3
  unreachable

9:                                                ; preds = %5
  %10 = tail call noundef i32 @_ZN5ImGui18TableGetInstanceIDEP10ImGuiTablei(ptr noundef nonnull %0, i32 noundef %2)
  %11 = add nuw nsw i32 %1, 1
  %12 = add i32 %11, %10
  ret i32 %12
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZN5ImGui18TableGetInstanceIDEP10ImGuiTablei(ptr noundef, i32 noundef) local_unnamed_addr #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 = { 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 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 = { 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, !7, i64 108}
!6 = !{!"_ZTS10ImGuiTable", !7, i64 0, !7, i64 4, !10, i64 8, !10, i64 16, !11, i64 24, !12, i64 40, !13, i64 56, !10, i64 72, !10, i64 80, !10, i64 88, !7, i64 96, !7, i64 100, !7, i64 104, !7, i64 108, !7, i64 112, !7, i64 116, !14, i64 120, !14, i64 122, !15, i64 124, !15, i64 128, !15, i64 132, !15, i64 136, !15, i64 140, !7, i64 144, !7, i64 146, !7, i64 148, !8, i64 152, !7, i64 160, !7, i64 164, !15, i64 168, !15, i64 172, !15, i64 176, !15, i64 180, !15, i64 184, !15, i64 188, !15, i64 192, !15, i64 196, !15, i64 200, !15, i64 204, !15, i64 208, !15, i64 212, !15, i64 216, !15, i64 220, !15, i64 224, !15, i64 228, !16, i64 232, !16, i64 248, !16, i64 264, !16, i64 280, !16, i64 296, !16, i64 312, !16, i64 328, !16, i64 344, !16, i64 360, !10, i64 376, !10, i64 384, !18, i64 392, !10, i64 408, !20, i64 416, !21, i64 432, !22, i64 448, !23, i64 464, !24, i64 480, !14, i64 496, !14, i64 498, !14, i64 500, !14, i64 502, !14, i64 504, !14, i64 506, !14, i64 508, !14, i64 510, !14, i64 512, !14, i64 514, !14, i64 516, !14, i64 518, !14, i64 520, !14, i64 522, !14, i64 524, !14, i64 526, !14, i64 528, !14, i64 530, !14, i64 532, !14, i64 534, !14, i64 536, !14, i64 538, !14, i64 540, !14, i64 542, !14, i64 544, !25, i64 546, !25, i64 547, !25, i64 548, !25, i64 549, !25, i64 550, !25, i64 551, !25, i64 552, !25, i64 553, !25, i64 554, !25, i64 555, !25, i64 556, !25, i64 557, !25, i64 558, !25, i64 559, !25, i64 560, !25, i64 561, !25, i64 562}
!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 = !{!"_ZTS6ImSpanIsE", !10, i64 0, !10, i64 8}
!13 = !{!"_ZTS6ImSpanI18ImGuiTableCellDataE", !10, i64 0, !10, i64 8}
!14 = !{!"short", !8, i64 0}
!15 = !{!"float", !8, i64 0}
!16 = !{!"_ZTS6ImRect", !17, i64 0, !17, i64 8}
!17 = !{!"_ZTS6ImVec2", !15, i64 0, !15, i64 4}
!18 = !{!"_ZTS15ImGuiTextBuffer", !19, i64 0}
!19 = !{!"_ZTS8ImVectorIcE", !7, i64 0, !7, i64 4, !10, i64 8}
!20 = !{!"_ZTS22ImGuiTableInstanceData", !7, i64 0, !15, i64 4, !15, i64 8, !15, i64 12}
!21 = !{!"_ZTS8ImVectorI22ImGuiTableInstanceDataE", !7, i64 0, !7, i64 4, !10, i64 8}
!22 = !{!"_ZTS25ImGuiTableColumnSortSpecs", !7, i64 0, !14, i64 4, !14, i64 6, !7, i64 8}
!23 = !{!"_ZTS8ImVectorI25ImGuiTableColumnSortSpecsE", !7, i64 0, !7, i64 4, !10, i64 8}
!24 = !{!"_ZTS19ImGuiTableSortSpecs", !10, i64 0, !7, i64 8, !25, i64 12}
!25 = !{!"bool", !8, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass