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

; 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.ImPlotContext = type { %struct.ImPool.34, %struct.ImPool.36, ptr, ptr, ptr, ptr, ptr, %struct.ImPlotTicker, %struct.ImPlotAnnotationCollection, %struct.ImPlotTagCollection, i8, [3 x i8], %struct.ImPlotStyle, %struct.ImVector.6, %struct.ImVector.7, %struct.ImPlotColormapData, %struct.ImVector.10, %struct.tm, %struct.ImVector.42, %struct.ImVector.42, %struct.ImVector.10, i32, i32, %struct.ImPlotNextPlotData, %struct.ImPlotNextItemData, %struct.ImPlotInputMap, i8, %struct.ImGuiTextBuffer, ptr, %struct.ImPool.43, ptr, ptr }
%struct.ImPool.34 = type { %struct.ImVector.35, %struct.ImGuiStorage, i32, i32 }
%struct.ImVector.35 = type { i32, i32, ptr }
%struct.ImGuiStorage = type { %struct.ImVector.4 }
%struct.ImVector.4 = type { i32, i32, ptr }
%struct.ImPool.36 = type { %struct.ImVector.37, %struct.ImGuiStorage, i32, i32 }
%struct.ImVector.37 = type { i32, i32, ptr }
%struct.ImPlotTicker = type <{ %struct.ImVector.38, %struct.ImGuiTextBuffer, %struct.ImVec2, %struct.ImVec2, i32, [4 x i8] }>
%struct.ImVector.38 = type { i32, i32, ptr }
%struct.ImVec2 = type { float, float }
%struct.ImPlotAnnotationCollection = type <{ %struct.ImVector.39, %struct.ImGuiTextBuffer, i32, [4 x i8] }>
%struct.ImVector.39 = type { i32, i32, ptr }
%struct.ImPlotTagCollection = type <{ %struct.ImVector.40, %struct.ImGuiTextBuffer, i32, [4 x i8] }>
%struct.ImVector.40 = type { i32, i32, ptr }
%struct.ImPlotStyle = type <{ float, i32, float, float, float, float, float, float, float, float, float, %struct.ImVec2, %struct.ImVec2, %struct.ImVec2, %struct.ImVec2, %struct.ImVec2, %struct.ImVec2, %struct.ImVec2, %struct.ImVec2, %struct.ImVec2, %struct.ImVec2, %struct.ImVec2, %struct.ImVec2, %struct.ImVec2, %struct.ImVec2, %struct.ImVec2, %struct.ImVec2, [21 x %struct.ImVec4], i32, i8, i8, i8, i8 }>
%struct.ImVec4 = type { float, float, float, float }
%struct.ImVector.6 = type { i32, i32, ptr }
%struct.ImVector.7 = type { i32, i32, ptr }
%struct.ImPlotColormapData = type <{ %struct.ImVector.9, %struct.ImVector.10, %struct.ImVector.10, %struct.ImVector.9, %struct.ImVector.10, %struct.ImVector.10, %struct.ImGuiTextBuffer, %struct.ImVector.10, %struct.ImVector.41, %struct.ImGuiStorage, i32, [4 x i8] }>
%struct.ImVector.9 = type { i32, i32, ptr }
%struct.ImVector.41 = type { i32, i32, ptr }
%struct.tm = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i64, ptr }
%struct.ImVector.42 = type { i32, i32, ptr }
%struct.ImVector.10 = type { i32, i32, ptr }
%struct.ImPlotNextPlotData = type { [6 x i32], [6 x %struct.ImPlotRange], [6 x i8], [6 x i8], [6 x ptr], [6 x ptr] }
%struct.ImPlotRange = type { double, double }
%struct.ImPlotNextItemData = type { [5 x %struct.ImVec4], float, i32, float, float, float, float, float, float, float, i8, i8, i8, i8, i8, i8, i32 }
%struct.ImPlotInputMap = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, float }
%struct.ImGuiTextBuffer = type { %struct.ImVector.24 }
%struct.ImVector.24 = type { i32, i32, ptr }
%struct.ImPool.43 = type { %struct.ImVector.44, %struct.ImGuiStorage, i32, i32 }
%struct.ImVector.44 = type { i32, i32, ptr }

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN6ImPlot22ResetCtxForNextSubplotEP13ImPlotContext(ptr noundef %0) #0 {
  %2 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %3 = load ptr, ptr %2, align 8, !tbaa !5
  %4 = getelementptr inbounds %struct.ImPlotContext, ptr %3, i32 0, i32 3
  store ptr null, ptr %4, align 8, !tbaa !9
  %5 = load ptr, ptr %2, align 8, !tbaa !5
  %6 = getelementptr inbounds %struct.ImPlotContext, ptr %5, i32 0, i32 30
  store ptr null, ptr %6, align 8, !tbaa !44
  %7 = load ptr, ptr %2, align 8, !tbaa !5
  %8 = getelementptr inbounds %struct.ImPlotContext, ptr %7, i32 0, i32 31
  store ptr null, ptr %8, align 8, !tbaa !45
  ret void
}

attributes #0 = { 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, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 88}
!10 = !{!"_ZTS13ImPlotContext", !11, i64 0, !16, i64 40, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !18, i64 120, !24, i64 176, !26, i64 216, !28, i64 256, !29, i64 260, !30, i64 776, !31, i64 792, !32, i64 808, !34, i64 976, !36, i64 992, !38, i64 1048, !38, i64 1064, !34, i64 1080, !13, i64 1096, !13, i64 1100, !39, i64 1104, !40, i64 1336, !41, i64 1464, !28, i64 1512, !20, i64 1520, !6, i64 1536, !42, i64 1544, !6, i64 1584, !6, i64 1592}
!11 = !{!"_ZTS6ImPoolI10ImPlotPlotE", !12, i64 0, !14, i64 16, !13, i64 32, !13, i64 36}
!12 = !{!"_ZTS8ImVectorI10ImPlotPlotE", !13, i64 0, !13, i64 4, !6, i64 8}
!13 = !{!"int", !7, i64 0}
!14 = !{!"_ZTS12ImGuiStorage", !15, i64 0}
!15 = !{!"_ZTS8ImVectorIN12ImGuiStorage16ImGuiStoragePairEE", !13, i64 0, !13, i64 4, !6, i64 8}
!16 = !{!"_ZTS6ImPoolI13ImPlotSubplotE", !17, i64 0, !14, i64 16, !13, i64 32, !13, i64 36}
!17 = !{!"_ZTS8ImVectorI13ImPlotSubplotE", !13, i64 0, !13, i64 4, !6, i64 8}
!18 = !{!"_ZTS12ImPlotTicker", !19, i64 0, !20, i64 16, !22, i64 32, !22, i64 40, !13, i64 48}
!19 = !{!"_ZTS8ImVectorI10ImPlotTickE", !13, i64 0, !13, i64 4, !6, i64 8}
!20 = !{!"_ZTS15ImGuiTextBuffer", !21, i64 0}
!21 = !{!"_ZTS8ImVectorIcE", !13, i64 0, !13, i64 4, !6, i64 8}
!22 = !{!"_ZTS6ImVec2", !23, i64 0, !23, i64 4}
!23 = !{!"float", !7, i64 0}
!24 = !{!"_ZTS26ImPlotAnnotationCollection", !25, i64 0, !20, i64 16, !13, i64 32}
!25 = !{!"_ZTS8ImVectorI16ImPlotAnnotationE", !13, i64 0, !13, i64 4, !6, i64 8}
!26 = !{!"_ZTS19ImPlotTagCollection", !27, i64 0, !20, i64 16, !13, i64 32}
!27 = !{!"_ZTS8ImVectorI9ImPlotTagE", !13, i64 0, !13, i64 4, !6, i64 8}
!28 = !{!"bool", !7, i64 0}
!29 = !{!"_ZTS11ImPlotStyle", !23, i64 0, !13, i64 4, !23, i64 8, !23, i64 12, !23, i64 16, !23, i64 20, !23, i64 24, !23, i64 28, !23, i64 32, !23, i64 36, !23, i64 40, !22, i64 44, !22, i64 52, !22, i64 60, !22, i64 68, !22, i64 76, !22, i64 84, !22, i64 92, !22, i64 100, !22, i64 108, !22, i64 116, !22, i64 124, !22, i64 132, !22, i64 140, !22, i64 148, !22, i64 156, !22, i64 164, !7, i64 172, !13, i64 508, !28, i64 512, !28, i64 513, !28, i64 514}
!30 = !{!"_ZTS8ImVectorI13ImGuiColorModE", !13, i64 0, !13, i64 4, !6, i64 8}
!31 = !{!"_ZTS8ImVectorI13ImGuiStyleModE", !13, i64 0, !13, i64 4, !6, i64 8}
!32 = !{!"_ZTS18ImPlotColormapData", !33, i64 0, !34, i64 16, !34, i64 32, !33, i64 48, !34, i64 64, !34, i64 80, !20, i64 96, !34, i64 112, !35, i64 128, !14, i64 144, !13, i64 160}
!33 = !{!"_ZTS8ImVectorIjE", !13, i64 0, !13, i64 4, !6, i64 8}
!34 = !{!"_ZTS8ImVectorIiE", !13, i64 0, !13, i64 4, !6, i64 8}
!35 = !{!"_ZTS8ImVectorIbE", !13, i64 0, !13, i64 4, !6, i64 8}
!36 = !{!"_ZTS2tm", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20, !13, i64 24, !13, i64 28, !13, i64 32, !37, i64 40, !6, i64 48}
!37 = !{!"long", !7, i64 0}
!38 = !{!"_ZTS8ImVectorIdE", !13, i64 0, !13, i64 4, !6, i64 8}
!39 = !{!"_ZTS18ImPlotNextPlotData", !7, i64 0, !7, i64 24, !7, i64 120, !7, i64 126, !7, i64 136, !7, i64 184}
!40 = !{!"_ZTS18ImPlotNextItemData", !7, i64 0, !23, i64 80, !13, i64 84, !23, i64 88, !23, i64 92, !23, i64 96, !23, i64 100, !23, i64 104, !23, i64 108, !23, i64 112, !28, i64 116, !28, i64 117, !28, i64 118, !28, i64 119, !28, i64 120, !28, i64 121, !13, i64 124}
!41 = !{!"_ZTS14ImPlotInputMap", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20, !13, i64 24, !13, i64 28, !13, i64 32, !13, i64 36, !13, i64 40, !23, i64 44}
!42 = !{!"_ZTS6ImPoolI19ImPlotAlignmentDataE", !43, i64 0, !14, i64 16, !13, i64 32, !13, i64 36}
!43 = !{!"_ZTS8ImVectorI19ImPlotAlignmentDataE", !13, i64 0, !13, i64 4, !6, i64 8}
!44 = !{!10, !6, i64 1584}
!45 = !{!10, !6, i64 1592}


; 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 nofree norecurse nosync nounwind willreturn memory(argmem: write) uwtable
define dso_local void @_ZN6ImPlot22ResetCtxForNextSubplotEP13ImPlotContext(ptr nocapture noundef writeonly %0) local_unnamed_addr #0 {
  %2 = getelementptr inbounds i8, ptr %0, i64 88
  store ptr null, ptr %2, align 8, !tbaa !5
  %3 = getelementptr inbounds i8, ptr %0, i64 1584
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %3, i8 0, i64 16, i1 false)
  ret void
}

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1

attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) 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 = { nocallback nofree nounwind willreturn memory(argmem: write) }

!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, !12, i64 88}
!6 = !{!"_ZTS13ImPlotContext", !7, i64 0, !15, i64 40, !12, i64 80, !12, i64 88, !12, i64 96, !12, i64 104, !12, i64 112, !17, i64 120, !23, i64 176, !25, i64 216, !27, i64 256, !28, i64 260, !29, i64 776, !30, i64 792, !31, i64 808, !33, i64 976, !35, i64 992, !37, i64 1048, !37, i64 1064, !33, i64 1080, !9, i64 1096, !9, i64 1100, !38, i64 1104, !39, i64 1336, !40, i64 1464, !27, i64 1512, !19, i64 1520, !12, i64 1536, !41, i64 1544, !12, i64 1584, !12, i64 1592}
!7 = !{!"_ZTS6ImPoolI10ImPlotPlotE", !8, i64 0, !13, i64 16, !9, i64 32, !9, i64 36}
!8 = !{!"_ZTS8ImVectorI10ImPlotPlotE", !9, i64 0, !9, i64 4, !12, i64 8}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !11, i64 0}
!11 = !{!"Simple C++ TBAA"}
!12 = !{!"any pointer", !10, i64 0}
!13 = !{!"_ZTS12ImGuiStorage", !14, i64 0}
!14 = !{!"_ZTS8ImVectorIN12ImGuiStorage16ImGuiStoragePairEE", !9, i64 0, !9, i64 4, !12, i64 8}
!15 = !{!"_ZTS6ImPoolI13ImPlotSubplotE", !16, i64 0, !13, i64 16, !9, i64 32, !9, i64 36}
!16 = !{!"_ZTS8ImVectorI13ImPlotSubplotE", !9, i64 0, !9, i64 4, !12, i64 8}
!17 = !{!"_ZTS12ImPlotTicker", !18, i64 0, !19, i64 16, !21, i64 32, !21, i64 40, !9, i64 48}
!18 = !{!"_ZTS8ImVectorI10ImPlotTickE", !9, i64 0, !9, i64 4, !12, i64 8}
!19 = !{!"_ZTS15ImGuiTextBuffer", !20, i64 0}
!20 = !{!"_ZTS8ImVectorIcE", !9, i64 0, !9, i64 4, !12, i64 8}
!21 = !{!"_ZTS6ImVec2", !22, i64 0, !22, i64 4}
!22 = !{!"float", !10, i64 0}
!23 = !{!"_ZTS26ImPlotAnnotationCollection", !24, i64 0, !19, i64 16, !9, i64 32}
!24 = !{!"_ZTS8ImVectorI16ImPlotAnnotationE", !9, i64 0, !9, i64 4, !12, i64 8}
!25 = !{!"_ZTS19ImPlotTagCollection", !26, i64 0, !19, i64 16, !9, i64 32}
!26 = !{!"_ZTS8ImVectorI9ImPlotTagE", !9, i64 0, !9, i64 4, !12, i64 8}
!27 = !{!"bool", !10, i64 0}
!28 = !{!"_ZTS11ImPlotStyle", !22, i64 0, !9, i64 4, !22, i64 8, !22, i64 12, !22, i64 16, !22, i64 20, !22, i64 24, !22, i64 28, !22, i64 32, !22, i64 36, !22, i64 40, !21, i64 44, !21, i64 52, !21, i64 60, !21, i64 68, !21, i64 76, !21, i64 84, !21, i64 92, !21, i64 100, !21, i64 108, !21, i64 116, !21, i64 124, !21, i64 132, !21, i64 140, !21, i64 148, !21, i64 156, !21, i64 164, !10, i64 172, !9, i64 508, !27, i64 512, !27, i64 513, !27, i64 514}
!29 = !{!"_ZTS8ImVectorI13ImGuiColorModE", !9, i64 0, !9, i64 4, !12, i64 8}
!30 = !{!"_ZTS8ImVectorI13ImGuiStyleModE", !9, i64 0, !9, i64 4, !12, i64 8}
!31 = !{!"_ZTS18ImPlotColormapData", !32, i64 0, !33, i64 16, !33, i64 32, !32, i64 48, !33, i64 64, !33, i64 80, !19, i64 96, !33, i64 112, !34, i64 128, !13, i64 144, !9, i64 160}
!32 = !{!"_ZTS8ImVectorIjE", !9, i64 0, !9, i64 4, !12, i64 8}
!33 = !{!"_ZTS8ImVectorIiE", !9, i64 0, !9, i64 4, !12, i64 8}
!34 = !{!"_ZTS8ImVectorIbE", !9, i64 0, !9, i64 4, !12, i64 8}
!35 = !{!"_ZTS2tm", !9, i64 0, !9, i64 4, !9, i64 8, !9, i64 12, !9, i64 16, !9, i64 20, !9, i64 24, !9, i64 28, !9, i64 32, !36, i64 40, !12, i64 48}
!36 = !{!"long", !10, i64 0}
!37 = !{!"_ZTS8ImVectorIdE", !9, i64 0, !9, i64 4, !12, i64 8}
!38 = !{!"_ZTS18ImPlotNextPlotData", !10, i64 0, !10, i64 24, !10, i64 120, !10, i64 126, !10, i64 136, !10, i64 184}
!39 = !{!"_ZTS18ImPlotNextItemData", !10, i64 0, !22, i64 80, !9, i64 84, !22, i64 88, !22, i64 92, !22, i64 96, !22, i64 100, !22, i64 104, !22, i64 108, !22, i64 112, !27, i64 116, !27, i64 117, !27, i64 118, !27, i64 119, !27, i64 120, !27, i64 121, !9, i64 124}
!40 = !{!"_ZTS14ImPlotInputMap", !9, i64 0, !9, i64 4, !9, i64 8, !9, i64 12, !9, i64 16, !9, i64 20, !9, i64 24, !9, i64 28, !9, i64 32, !9, i64 36, !9, i64 40, !22, i64 44}
!41 = !{!"_ZTS6ImPoolI19ImPlotAlignmentDataE", !42, i64 0, !13, i64 16, !9, i64 32, !9, i64 36}
!42 = !{!"_ZTS8ImVectorI19ImPlotAlignmentDataE", !9, i64 0, !9, i64 4, !12, i64 8}


; Effective O3 passes: GlobalOptPass,InstCombinePass,MemCpyOptPass,PostOrderFunctionAttrsPass,SROAPass,TailCallElimPass