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

; 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.ImPlot::GetterFuncPtr" = type <{ ptr, ptr, i32, [4 x i8] }>
%"struct.ImPlot::GetterOverrideX" = type <{ %"struct.ImPlot::GetterFuncPtr", double, i32, [4 x i8] }>
%"struct.ImPlot::GetterOverrideY" = type <{ %"struct.ImPlot::GetterFuncPtr", double, i32, [4 x 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 hidden noundef zeroext i1 @_ZL9ImHasFlagIi16ImPlotBarsFlags_EbT_T0_(i32 noundef, i32 noundef) #1

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6ImPlot13GetterFuncPtrC2EPF11ImPlotPointiPvES2_i(ptr noundef nonnull align 8 dereferenceable(20), ptr noundef, ptr noundef, i32 noundef) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6ImPlot9PlotBarsGEPKcPF11ImPlotPointiPvES3_idi(ptr noundef %0, ptr noundef %1, ptr noundef %2, i32 noundef %3, double noundef %4, i32 noundef %5) #4 {
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca double, align 8
  %12 = alloca i32, align 4
  %13 = alloca %"struct.ImPlot::GetterFuncPtr", align 8
  %14 = alloca %"struct.ImPlot::GetterOverrideX", align 8
  %15 = alloca %"struct.ImPlot::GetterFuncPtr", align 8
  %16 = alloca %"struct.ImPlot::GetterFuncPtr", align 8
  %17 = alloca %"struct.ImPlot::GetterOverrideY", align 8
  %18 = alloca %"struct.ImPlot::GetterFuncPtr", align 8
  %19 = alloca %"struct.ImPlot::GetterOverrideY", align 8
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  store ptr %2, ptr %9, align 8, !tbaa !5
  store i32 %3, ptr %10, align 4, !tbaa !9
  store double %4, ptr %11, align 8, !tbaa !11
  store i32 %5, ptr %12, align 4, !tbaa !9
  %20 = load i32, ptr %12, align 4, !tbaa !9
  %21 = call noundef zeroext i1 @_ZL9ImHasFlagIi16ImPlotBarsFlags_EbT_T0_(i32 noundef %20, i32 noundef 1024)
  br i1 %21, label %22, label %29

22:                                               ; preds = %6
  call void @llvm.lifetime.start.p0(i64 24, ptr %13) #5
  %23 = load ptr, ptr %8, align 8, !tbaa !5
  %24 = load ptr, ptr %9, align 8, !tbaa !5
  %25 = load i32, ptr %10, align 4, !tbaa !9
  call void @_ZN6ImPlot13GetterFuncPtrC2EPF11ImPlotPointiPvES2_i(ptr noundef nonnull align 8 dereferenceable(20) %13, ptr noundef %23, ptr noundef %24, i32 noundef %25)
  call void @llvm.lifetime.start.p0(i64 40, ptr %14) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %15, ptr align 8 %13, i64 24, i1 false), !tbaa.struct !13
  call void @_ZN6ImPlot15GetterOverrideXINS_13GetterFuncPtrEEC2ES1_d(ptr noundef nonnull align 8 dereferenceable(36) %14, ptr noundef byval(%"struct.ImPlot::GetterFuncPtr") align 8 %15, double noundef 0.000000e+00)
  %26 = load ptr, ptr %7, align 8, !tbaa !5
  %27 = load double, ptr %11, align 8, !tbaa !11
  %28 = load i32, ptr %12, align 4, !tbaa !9
  call void @_ZN6ImPlot11PlotBarsHExINS_13GetterFuncPtrENS_15GetterOverrideXIS1_EEEEvPKcRKT_RKT0_di(ptr noundef %26, ptr noundef nonnull align 8 dereferenceable(20) %13, ptr noundef nonnull align 8 dereferenceable(36) %14, double noundef %27, i32 noundef %28)
  call void @llvm.lifetime.end.p0(i64 40, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %13) #5
  br label %36

29:                                               ; preds = %6
  call void @llvm.lifetime.start.p0(i64 24, ptr %16) #5
  %30 = load ptr, ptr %8, align 8, !tbaa !5
  %31 = load ptr, ptr %9, align 8, !tbaa !5
  %32 = load i32, ptr %10, align 4, !tbaa !9
  call void @_ZN6ImPlot13GetterFuncPtrC2EPF11ImPlotPointiPvES2_i(ptr noundef nonnull align 8 dereferenceable(20) %16, ptr noundef %30, ptr noundef %31, i32 noundef %32)
  call void @llvm.lifetime.start.p0(i64 40, ptr %17) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %18, ptr align 8 %16, i64 24, i1 false), !tbaa.struct !13
  call void @_ZN6ImPlot15GetterOverrideYINS_13GetterFuncPtrEEC2ES1_d(ptr noundef nonnull align 8 dereferenceable(36) %17, ptr noundef byval(%"struct.ImPlot::GetterFuncPtr") align 8 %18, double noundef 0.000000e+00)
  %33 = load ptr, ptr %7, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %19, ptr align 8 %17, i64 40, i1 false), !tbaa.struct !14
  %34 = load double, ptr %11, align 8, !tbaa !11
  %35 = load i32, ptr %12, align 4, !tbaa !9
  call void @_ZN6ImPlot11PlotBarsVExINS_13GetterFuncPtrENS_15GetterOverrideYIS1_EEEEvPKcRKT_T0_di(ptr noundef %33, ptr noundef nonnull align 8 dereferenceable(20) %16, ptr noundef byval(%"struct.ImPlot::GetterOverrideY") align 8 %19, double noundef %34, i32 noundef %35)
  call void @llvm.lifetime.end.p0(i64 40, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %16) #5
  br label %36

36:                                               ; preds = %29, %22
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6ImPlot15GetterOverrideXINS_13GetterFuncPtrEEC2ES1_d(ptr noundef nonnull align 8 dereferenceable(36), ptr noundef byval(%"struct.ImPlot::GetterFuncPtr") align 8, double noundef) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6ImPlot11PlotBarsHExINS_13GetterFuncPtrENS_15GetterOverrideXIS1_EEEEvPKcRKT_RKT0_di(ptr noundef, ptr noundef nonnull align 8 dereferenceable(20), ptr noundef nonnull align 8 dereferenceable(36), double noundef, i32 noundef) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6ImPlot15GetterOverrideYINS_13GetterFuncPtrEEC2ES1_d(ptr noundef nonnull align 8 dereferenceable(36), ptr noundef byval(%"struct.ImPlot::GetterFuncPtr") align 8, double noundef) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6ImPlot11PlotBarsVExINS_13GetterFuncPtrENS_15GetterOverrideYIS1_EEEEvPKcRKT_T0_di(ptr noundef, ptr noundef nonnull align 8 dereferenceable(20), ptr noundef byval(%"struct.ImPlot::GetterOverrideY") align 8, double noundef, i32 noundef) #4

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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { 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 = { 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, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = !{i64 0, i64 8, !5, i64 8, i64 8, !5, i64 16, i64 4, !9}
!14 = !{i64 0, i64 8, !5, i64 8, i64 8, !5, i64 16, i64 4, !9, i64 24, i64 8, !11, i64 32, i64 4, !9}


; 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.ImPlot::GetterFuncPtr" = type <{ ptr, ptr, i32, [4 x i8] }>
%"struct.ImPlot::GetterOverrideX" = type <{ %"struct.ImPlot::GetterFuncPtr", double, i32, [4 x i8] }>
%"struct.ImPlot::GetterOverrideY" = type <{ %"struct.ImPlot::GetterFuncPtr", double, i32, [4 x i8] }>

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress 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 hidden noundef zeroext i1 @_ZL9ImHasFlagIi16ImPlotBarsFlags_EbT_T0_(i32 noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6ImPlot13GetterFuncPtrC2EPF11ImPlotPointiPvES2_i(ptr noundef nonnull align 8 dereferenceable(20), ptr noundef, ptr noundef, i32 noundef) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6ImPlot9PlotBarsGEPKcPF11ImPlotPointiPvES3_idi(ptr noundef %0, ptr noundef %1, ptr noundef %2, i32 noundef %3, double noundef %4, i32 noundef %5) local_unnamed_addr #3 {
  %7 = alloca %"struct.ImPlot::GetterFuncPtr", align 8
  %8 = alloca %"struct.ImPlot::GetterOverrideX", align 8
  %9 = alloca %"struct.ImPlot::GetterFuncPtr", align 8
  %10 = alloca %"struct.ImPlot::GetterOverrideY", align 8
  %11 = tail call noundef zeroext i1 @_ZL9ImHasFlagIi16ImPlotBarsFlags_EbT_T0_(i32 noundef %5, i32 noundef 1024)
  br i1 %11, label %12, label %13

12:                                               ; preds = %6
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #4
  call void @_ZN6ImPlot13GetterFuncPtrC2EPF11ImPlotPointiPvES2_i(ptr noundef nonnull align 8 dereferenceable(20) %7, ptr noundef %1, ptr noundef %2, i32 noundef %3)
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %8) #4
  call void @_ZN6ImPlot15GetterOverrideXINS_13GetterFuncPtrEEC2ES1_d(ptr noundef nonnull align 8 dereferenceable(36) %8, ptr noundef nonnull byval(%"struct.ImPlot::GetterFuncPtr") align 8 %7, double noundef 0.000000e+00)
  call void @_ZN6ImPlot11PlotBarsHExINS_13GetterFuncPtrENS_15GetterOverrideXIS1_EEEEvPKcRKT_RKT0_di(ptr noundef %0, ptr noundef nonnull align 8 dereferenceable(20) %7, ptr noundef nonnull align 8 dereferenceable(36) %8, double noundef %4, i32 noundef %5)
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %8) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #4
  br label %14

13:                                               ; preds = %6
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %9) #4
  call void @_ZN6ImPlot13GetterFuncPtrC2EPF11ImPlotPointiPvES2_i(ptr noundef nonnull align 8 dereferenceable(20) %9, ptr noundef %1, ptr noundef %2, i32 noundef %3)
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %10) #4
  call void @_ZN6ImPlot15GetterOverrideYINS_13GetterFuncPtrEEC2ES1_d(ptr noundef nonnull align 8 dereferenceable(36) %10, ptr noundef nonnull byval(%"struct.ImPlot::GetterFuncPtr") align 8 %9, double noundef 0.000000e+00)
  call void @_ZN6ImPlot11PlotBarsVExINS_13GetterFuncPtrENS_15GetterOverrideYIS1_EEEEvPKcRKT_T0_di(ptr noundef %0, ptr noundef nonnull align 8 dereferenceable(20) %9, ptr noundef nonnull byval(%"struct.ImPlot::GetterOverrideY") align 8 %10, double noundef %4, i32 noundef %5)
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %10) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #4
  br label %14

14:                                               ; preds = %13, %12
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6ImPlot15GetterOverrideXINS_13GetterFuncPtrEEC2ES1_d(ptr noundef nonnull align 8 dereferenceable(36), ptr noundef byval(%"struct.ImPlot::GetterFuncPtr") align 8, double noundef) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6ImPlot11PlotBarsHExINS_13GetterFuncPtrENS_15GetterOverrideXIS1_EEEEvPKcRKT_RKT0_di(ptr noundef, ptr noundef nonnull align 8 dereferenceable(20), ptr noundef nonnull align 8 dereferenceable(36), double noundef, i32 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6ImPlot15GetterOverrideYINS_13GetterFuncPtrEEC2ES1_d(ptr noundef nonnull align 8 dereferenceable(36), ptr noundef byval(%"struct.ImPlot::GetterFuncPtr") align 8, double noundef) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6ImPlot11PlotBarsVExINS_13GetterFuncPtrENS_15GetterOverrideYIS1_EEEEvPKcRKT_T0_di(ptr noundef, ptr noundef nonnull align 8 dereferenceable(20), ptr noundef byval(%"struct.ImPlot::GetterOverrideY") align 8, double noundef, i32 noundef) local_unnamed_addr #3

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


; Effective O3 passes: DSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,MemCpyOptPass,SROAPass,TailCallElimPass