; 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] }>
%struct.ImGuiTableColumn = type <{ i32, float, float, float, float, float, float, float, %struct.ImRect, i32, float, float, float, float, float, float, float, i16, i16, i16, i16, i16, i16, i16, i16, i16, 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: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(111) ptr @_ZN6ImSpanI16ImGuiTableColumnEixEi(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN5ImGui29TableSetColumnWidthAutoSingleEP10ImGuiTablei(ptr noundef %0, i32 noundef %1) #2 {
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store i32 %1, ptr %4, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #3
  %7 = load ptr, ptr %3, align 8, !tbaa !5
  %8 = getelementptr inbounds %struct.ImGuiTable, ptr %7, i32 0, i32 4
  %9 = load i32, ptr %4, align 4, !tbaa !9
  %10 = call noundef nonnull align 4 dereferenceable(111) ptr @_ZN6ImSpanI16ImGuiTableColumnEixEi(ptr noundef nonnull align 8 dereferenceable(16) %8, i32 noundef %9)
  store ptr %10, ptr %5, align 8, !tbaa !5
  %11 = load ptr, ptr %5, align 8, !tbaa !5
  %12 = getelementptr inbounds %struct.ImGuiTableColumn, ptr %11, i32 0, i32 26
  %13 = load i8, ptr %12, align 2, !tbaa !11, !range !18, !noundef !19
  %14 = trunc i8 %13 to i1
  br i1 %14, label %16, label %15

15:                                               ; preds = %2
  store i32 1, ptr %6, align 4
  br label %23

16:                                               ; preds = %2
  %17 = load ptr, ptr %5, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.ImGuiTableColumn, ptr %17, i32 0, i32 36
  store i8 1, ptr %18, align 4, !tbaa !20
  %19 = load i32, ptr %4, align 4, !tbaa !9
  %20 = trunc i32 %19 to i16
  %21 = load ptr, ptr %3, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.ImGuiTable, ptr %21, i32 0, i32 69
  store i16 %20, ptr %22, align 4, !tbaa !21
  store i32 0, ptr %6, align 4
  br label %23

23:                                               ; preds = %16, %15
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #3
  %24 = load i32, ptr %6, align 4
  switch i32 %24, label %26 [
    i32 0, label %25
    i32 1, label %25
  ]

25:                                               ; preds = %23, %23
  ret void

26:                                               ; preds = %23
  unreachable
}

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 = { 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, !17, i64 98}
!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, !16, i64 82, !16, i64 84, !16, i64 86, !16, i64 88, !16, i64 90, !16, i64 92, !16, i64 94, !16, i64 96, !17, i64 98, !17, i64 99, !17, i64 100, !17, i64 101, !17, i64 102, !17, i64 103, !17, i64 104, !17, i64 105, !7, i64 106, !7, i64 107, !7, i64 108, !7, i64 109, !7, i64 109, !7, i64 109, !7, i64 110}
!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 = !{i8 0, i8 2}
!19 = !{}
!20 = !{!12, !7, i64 108}
!21 = !{!22, !16, i64 508}
!22 = !{!"_ZTS10ImGuiTable", !10, i64 0, !10, i64 4, !6, i64 8, !6, i64 16, !23, i64 24, !24, i64 40, !25, 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, !13, i64 124, !13, i64 128, !13, i64 132, !13, i64 136, !13, i64 140, !10, i64 144, !10, i64 146, !10, i64 148, !7, i64 152, !10, i64 160, !10, i64 164, !13, i64 168, !13, 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, !14, i64 232, !14, i64 248, !14, i64 264, !14, i64 280, !14, i64 296, !14, i64 312, !14, i64 328, !14, i64 344, !14, i64 360, !6, i64 376, !6, i64 384, !26, i64 392, !6, i64 408, !28, i64 416, !29, i64 432, !30, i64 448, !31, i64 464, !32, 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, !17, i64 546, !17, i64 547, !17, i64 548, !17, i64 549, !17, i64 550, !17, i64 551, !17, i64 552, !17, i64 553, !17, i64 554, !17, i64 555, !17, i64 556, !17, i64 557, !17, i64 558, !17, i64 559, !17, i64 560, !17, i64 561, !17, i64 562}
!23 = !{!"_ZTS6ImSpanI16ImGuiTableColumnE", !6, i64 0, !6, i64 8}
!24 = !{!"_ZTS6ImSpanIsE", !6, i64 0, !6, i64 8}
!25 = !{!"_ZTS6ImSpanI18ImGuiTableCellDataE", !6, i64 0, !6, i64 8}
!26 = !{!"_ZTS15ImGuiTextBuffer", !27, i64 0}
!27 = !{!"_ZTS8ImVectorIcE", !10, i64 0, !10, i64 4, !6, i64 8}
!28 = !{!"_ZTS22ImGuiTableInstanceData", !10, i64 0, !13, i64 4, !13, i64 8, !13, i64 12}
!29 = !{!"_ZTS8ImVectorI22ImGuiTableInstanceDataE", !10, i64 0, !10, i64 4, !6, i64 8}
!30 = !{!"_ZTS25ImGuiTableColumnSortSpecs", !10, i64 0, !16, i64 4, !16, i64 6, !10, i64 8}
!31 = !{!"_ZTS8ImVectorI25ImGuiTableColumnSortSpecsE", !10, i64 0, !10, i64 4, !6, i64 8}
!32 = !{!"_ZTS19ImGuiTableSortSpecs", !6, i64 0, !10, i64 8, !17, 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: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(111) ptr @_ZN6ImSpanI16ImGuiTableColumnEixEi(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN5ImGui29TableSetColumnWidthAutoSingleEP10ImGuiTablei(ptr noundef %0, i32 noundef %1) local_unnamed_addr #1 {
  %3 = getelementptr inbounds i8, ptr %0, i64 24
  %4 = tail call noundef nonnull align 4 dereferenceable(111) ptr @_ZN6ImSpanI16ImGuiTableColumnEixEi(ptr noundef nonnull align 8 dereferenceable(16) %3, i32 noundef %1)
  %5 = getelementptr inbounds i8, ptr %4, i64 98
  %6 = load i8, ptr %5, align 2, !tbaa !5, !range !15, !noundef !16
  %7 = trunc nuw i8 %6 to i1
  br i1 %7, label %8, label %12

8:                                                ; preds = %2
  %9 = getelementptr inbounds i8, ptr %4, i64 108
  store i8 1, ptr %9, align 4, !tbaa !17
  %10 = trunc i32 %1 to i16
  %11 = getelementptr inbounds i8, ptr %0, i64 508
  store i16 %10, ptr %11, align 4, !tbaa !18
  br label %12

12:                                               ; preds = %2, %8
  ret void
}

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

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


; Effective O3 passes: GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass