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

; 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.ImPlotTime = type <{ i64, i32, [4 x i8] }>
%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 }

@GImPlot = external dso_local global ptr, align 8

; 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 nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN6ImPlot7GetYearERK10ImPlotTime(ptr noundef nonnull align 8 dereferenceable(12)) #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN6ImPlot7GetTimeERK10ImPlotTimeP2tm(ptr noundef nonnull align 8 dereferenceable(12), ptr noundef) #3

; Function Attrs: mustprogress uwtable
define dso_local { i64, i32 } @_ZN6ImPlot7AddTimeERK10ImPlotTimeii(ptr noundef nonnull align 8 dereferenceable(12) %0, i32 noundef %1, i32 noundef %2) #2 {
  %4 = alloca %struct.ImPlotTime, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i32 %1, ptr %6, align 4, !tbaa !9
  store i32 %2, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  %11 = load ptr, ptr @GImPlot, align 8, !tbaa !5
  %12 = getelementptr inbounds %struct.ImPlotContext, ptr %11, i32 0, i32 17
  store ptr %12, ptr %8, align 8, !tbaa !5
  %13 = load ptr, ptr %5, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %4, ptr align 8 %13, i64 16, i1 false), !tbaa.struct !11
  %14 = load i32, ptr %6, align 4, !tbaa !9
  switch i32 %14, label %158 [
    i32 0, label %15
    i32 1, label %20
    i32 2, label %26
    i32 3, label %32
    i32 4, label %39
    i32 5, label %46
    i32 6, label %53
    i32 7, label %118
  ]

15:                                               ; preds = %3
  %16 = load i32, ptr %7, align 4, !tbaa !9
  %17 = getelementptr inbounds %struct.ImPlotTime, ptr %4, i32 0, i32 1
  %18 = load i32, ptr %17, align 8, !tbaa !14
  %19 = add nsw i32 %18, %16
  store i32 %19, ptr %17, align 8, !tbaa !14
  br label %159

20:                                               ; preds = %3
  %21 = load i32, ptr %7, align 4, !tbaa !9
  %22 = mul nsw i32 %21, 1000
  %23 = getelementptr inbounds %struct.ImPlotTime, ptr %4, i32 0, i32 1
  %24 = load i32, ptr %23, align 8, !tbaa !14
  %25 = add nsw i32 %24, %22
  store i32 %25, ptr %23, align 8, !tbaa !14
  br label %159

26:                                               ; preds = %3
  %27 = load i32, ptr %7, align 4, !tbaa !9
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds %struct.ImPlotTime, ptr %4, i32 0, i32 0
  %30 = load i64, ptr %29, align 8, !tbaa !16
  %31 = add nsw i64 %30, %28
  store i64 %31, ptr %29, align 8, !tbaa !16
  br label %159

32:                                               ; preds = %3
  %33 = load i32, ptr %7, align 4, !tbaa !9
  %34 = mul nsw i32 %33, 60
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds %struct.ImPlotTime, ptr %4, i32 0, i32 0
  %37 = load i64, ptr %36, align 8, !tbaa !16
  %38 = add nsw i64 %37, %35
  store i64 %38, ptr %36, align 8, !tbaa !16
  br label %159

39:                                               ; preds = %3
  %40 = load i32, ptr %7, align 4, !tbaa !9
  %41 = mul nsw i32 %40, 3600
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds %struct.ImPlotTime, ptr %4, i32 0, i32 0
  %44 = load i64, ptr %43, align 8, !tbaa !16
  %45 = add nsw i64 %44, %42
  store i64 %45, ptr %43, align 8, !tbaa !16
  br label %159

46:                                               ; preds = %3
  %47 = load i32, ptr %7, align 4, !tbaa !9
  %48 = mul nsw i32 %47, 86400
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds %struct.ImPlotTime, ptr %4, i32 0, i32 0
  %51 = load i64, ptr %50, align 8, !tbaa !16
  %52 = add nsw i64 %51, %49
  store i64 %52, ptr %50, align 8, !tbaa !16
  br label %159

53:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %54

54:                                               ; preds = %114, %53
  %55 = load i32, ptr %9, align 4, !tbaa !9
  %56 = load i32, ptr %7, align 4, !tbaa !9
  %57 = call i32 @llvm.abs.i32(i32 %56, i1 true)
  %58 = icmp slt i32 %55, %57
  br i1 %58, label %60, label %59

59:                                               ; preds = %54
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %117

60:                                               ; preds = %54
  %61 = load ptr, ptr %8, align 8, !tbaa !5
  %62 = call noundef ptr @_ZN6ImPlot7GetTimeERK10ImPlotTimeP2tm(ptr noundef nonnull align 8 dereferenceable(12) %4, ptr noundef %61)
  %63 = load i32, ptr %7, align 4, !tbaa !9
  %64 = icmp sgt i32 %63, 0
  br i1 %64, label %65, label %79

65:                                               ; preds = %60
  %66 = load ptr, ptr %8, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.tm, ptr %66, i32 0, i32 5
  %68 = load i32, ptr %67, align 4, !tbaa !17
  %69 = add nsw i32 %68, 1900
  %70 = load ptr, ptr %8, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.tm, ptr %70, i32 0, i32 4
  %72 = load i32, ptr %71, align 8, !tbaa !19
  %73 = call noundef i32 @_ZN6ImPlotL14GetDaysInMonthEii(i32 noundef %69, i32 noundef %72)
  %74 = mul nsw i32 86400, %73
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds %struct.ImPlotTime, ptr %4, i32 0, i32 0
  %77 = load i64, ptr %76, align 8, !tbaa !16
  %78 = add nsw i64 %77, %75
  store i64 %78, ptr %76, align 8, !tbaa !16
  br label %113

79:                                               ; preds = %60
  %80 = load i32, ptr %7, align 4, !tbaa !9
  %81 = icmp slt i32 %80, 0
  br i1 %81, label %82, label %112

82:                                               ; preds = %79
  %83 = load ptr, ptr %8, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.tm, ptr %83, i32 0, i32 5
  %85 = load i32, ptr %84, align 4, !tbaa !17
  %86 = add nsw i32 %85, 1900
  %87 = load ptr, ptr %8, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.tm, ptr %87, i32 0, i32 4
  %89 = load i32, ptr %88, align 8, !tbaa !19
  %90 = icmp eq i32 %89, 0
  %91 = zext i1 %90 to i64
  %92 = select i1 %90, i32 1, i32 0
  %93 = sub nsw i32 %86, %92
  %94 = load ptr, ptr %8, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.tm, ptr %94, i32 0, i32 4
  %96 = load i32, ptr %95, align 8, !tbaa !19
  %97 = icmp eq i32 %96, 0
  br i1 %97, label %98, label %99

98:                                               ; preds = %82
  br label %104

99:                                               ; preds = %82
  %100 = load ptr, ptr %8, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.tm, ptr %100, i32 0, i32 4
  %102 = load i32, ptr %101, align 8, !tbaa !19
  %103 = sub nsw i32 %102, 1
  br label %104

104:                                              ; preds = %99, %98
  %105 = phi i32 [ 11, %98 ], [ %103, %99 ]
  %106 = call noundef i32 @_ZN6ImPlotL14GetDaysInMonthEii(i32 noundef %93, i32 noundef %105)
  %107 = mul nsw i32 86400, %106
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds %struct.ImPlotTime, ptr %4, i32 0, i32 0
  %110 = load i64, ptr %109, align 8, !tbaa !16
  %111 = sub nsw i64 %110, %108
  store i64 %111, ptr %109, align 8, !tbaa !16
  br label %112

112:                                              ; preds = %104, %79
  br label %113

113:                                              ; preds = %112, %65
  br label %114

114:                                              ; preds = %113
  %115 = load i32, ptr %9, align 4, !tbaa !9
  %116 = add nsw i32 %115, 1
  store i32 %116, ptr %9, align 4, !tbaa !9
  br label %54, !llvm.loop !20

117:                                              ; preds = %59
  br label %159

118:                                              ; preds = %3
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  store i32 0, ptr %10, align 4, !tbaa !9
  br label %119

119:                                              ; preds = %154, %118
  %120 = load i32, ptr %10, align 4, !tbaa !9
  %121 = load i32, ptr %7, align 4, !tbaa !9
  %122 = call i32 @llvm.abs.i32(i32 %121, i1 true)
  %123 = icmp slt i32 %120, %122
  br i1 %123, label %125, label %124

124:                                              ; preds = %119
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %157

125:                                              ; preds = %119
  %126 = load i32, ptr %7, align 4, !tbaa !9
  %127 = icmp sgt i32 %126, 0
  br i1 %127, label %128, label %138

128:                                              ; preds = %125
  %129 = call noundef i32 @_ZN6ImPlot7GetYearERK10ImPlotTime(ptr noundef nonnull align 8 dereferenceable(12) %4)
  %130 = call noundef zeroext i1 @_ZN6ImPlotL10IsLeapYearEi(i32 noundef %129)
  %131 = zext i1 %130 to i32
  %132 = add nsw i32 365, %131
  %133 = mul nsw i32 86400, %132
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds %struct.ImPlotTime, ptr %4, i32 0, i32 0
  %136 = load i64, ptr %135, align 8, !tbaa !16
  %137 = add nsw i64 %136, %134
  store i64 %137, ptr %135, align 8, !tbaa !16
  br label %153

138:                                              ; preds = %125
  %139 = load i32, ptr %7, align 4, !tbaa !9
  %140 = icmp slt i32 %139, 0
  br i1 %140, label %141, label %152

141:                                              ; preds = %138
  %142 = call noundef i32 @_ZN6ImPlot7GetYearERK10ImPlotTime(ptr noundef nonnull align 8 dereferenceable(12) %4)
  %143 = sub nsw i32 %142, 1
  %144 = call noundef zeroext i1 @_ZN6ImPlotL10IsLeapYearEi(i32 noundef %143)
  %145 = zext i1 %144 to i32
  %146 = add nsw i32 365, %145
  %147 = mul nsw i32 86400, %146
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds %struct.ImPlotTime, ptr %4, i32 0, i32 0
  %150 = load i64, ptr %149, align 8, !tbaa !16
  %151 = sub nsw i64 %150, %148
  store i64 %151, ptr %149, align 8, !tbaa !16
  br label %152

152:                                              ; preds = %141, %138
  br label %153

153:                                              ; preds = %152, %128
  br label %154

154:                                              ; preds = %153
  %155 = load i32, ptr %10, align 4, !tbaa !9
  %156 = add nsw i32 %155, 1
  store i32 %156, ptr %10, align 4, !tbaa !9
  br label %119, !llvm.loop !22

157:                                              ; preds = %124
  br label %159

158:                                              ; preds = %3
  br label %159

159:                                              ; preds = %158, %157, %117, %46, %39, %32, %26, %20, %15
  call void @_ZN10ImPlotTime8RollOverEv(ptr noundef nonnull align 8 dereferenceable(12) %4)
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  %160 = load { i64, i32 }, ptr %4, align 8
  ret { i64, i32 } %160
}

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #4

; Function Attrs: inlinehint mustprogress uwtable
declare hidden noundef i32 @_ZN6ImPlotL14GetDaysInMonthEii(i32 noundef, i32 noundef) #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef zeroext i1 @_ZN6ImPlotL10IsLeapYearEi(i32 noundef) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN10ImPlotTime8RollOverEv(ptr noundef nonnull align 8 dereferenceable(12)) #6 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { 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 #6 = { 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 #7 = { 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 = !{i64 0, i64 8, !12, i64 8, i64 4, !9}
!12 = !{!13, !13, i64 0}
!13 = !{!"long", !7, i64 0}
!14 = !{!15, !10, i64 8}
!15 = !{!"_ZTS10ImPlotTime", !13, i64 0, !10, i64 8}
!16 = !{!15, !13, i64 0}
!17 = !{!18, !10, i64 20}
!18 = !{!"_ZTS2tm", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !13, i64 40, !6, i64 48}
!19 = !{!18, !10, i64 16}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = distinct !{!22, !21}


; 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.ImPlotTime = type <{ i64, i32, [4 x i8] }>

@GImPlot = external dso_local local_unnamed_addr global ptr, align 8

; Function Attrs: mustprogress 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) #0

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN6ImPlot7GetYearERK10ImPlotTime(ptr noundef nonnull align 8 dereferenceable(12)) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN6ImPlot7GetTimeERK10ImPlotTimeP2tm(ptr noundef nonnull align 8 dereferenceable(12), ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local { i64, i32 } @_ZN6ImPlot7AddTimeERK10ImPlotTimeii(ptr nocapture noundef nonnull readonly align 8 dereferenceable(12) %0, i32 noundef %1, i32 noundef %2) local_unnamed_addr #1 {
  %4 = alloca %struct.ImPlotTime, align 8
  %5 = load ptr, ptr @GImPlot, align 8, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %5, i64 992
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %4, ptr noundef nonnull align 8 dereferenceable(16) %0, i64 16, i1 false), !tbaa.struct !9
  switch i32 %1, label %.loopexit [
    i32 0, label %46
    i32 1, label %50
    i32 2, label %55
    i32 3, label %59
    i32 4, label %64
    i32 5, label %69
    i32 6, label %.preheader
    i32 7, label %.preheader28
  ]

.preheader28:                                     ; preds = %3
  %.not = icmp eq i32 %2, 0
  br i1 %.not, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader28
  %7 = icmp sgt i32 %2, 0
  br i1 %7, label %.lr.ph.split.us, label %.lr.ph.split.split.us.preheader

.lr.ph.split.us:                                  ; preds = %.lr.ph, %.lr.ph.split.us
  %.030.us = phi i32 [ %13, %.lr.ph.split.us ], [ 0, %.lr.ph ]
  %8 = call noundef i32 @_ZN6ImPlot7GetYearERK10ImPlotTime(ptr noundef nonnull align 8 dereferenceable(12) %4)
  %9 = call noundef zeroext i1 @_ZN6ImPlotL10IsLeapYearEi(i32 noundef %8)
  %10 = select i1 %9, i64 31622400, i64 31536000
  %11 = load i64, ptr %4, align 8, !tbaa !14
  %12 = add nsw i64 %11, %10
  store i64 %12, ptr %4, align 8, !tbaa !14
  %13 = add nuw i32 %.030.us, 1
  %exitcond42.not = icmp eq i32 %13, %2
  br i1 %exitcond42.not, label %.loopexit, label %.lr.ph.split.us, !llvm.loop !16

.lr.ph.split.split.us.preheader:                  ; preds = %.lr.ph
  %smax = sub i32 0, %2
  br label %.lr.ph.split.split.us

.lr.ph.split.split.us:                            ; preds = %.lr.ph.split.split.us.preheader, %.lr.ph.split.split.us
  %.030.us31 = phi i32 [ %19, %.lr.ph.split.split.us ], [ 0, %.lr.ph.split.split.us.preheader ]
  %14 = call noundef i32 @_ZN6ImPlot7GetYearERK10ImPlotTime(ptr noundef nonnull align 8 dereferenceable(12) %4)
  %15 = add nsw i32 %14, -1
  %16 = call noundef zeroext i1 @_ZN6ImPlotL10IsLeapYearEi(i32 noundef %15)
  %.neg.us = select i1 %16, i64 -31622400, i64 -31536000
  %17 = load i64, ptr %4, align 8, !tbaa !14
  %18 = add i64 %.neg.us, %17
  store i64 %18, ptr %4, align 8, !tbaa !14
  %19 = add nuw i32 %.030.us31, 1
  %exitcond.not = icmp eq i32 %19, %smax
  br i1 %exitcond.not, label %.loopexit, label %.lr.ph.split.split.us, !llvm.loop !16

.preheader:                                       ; preds = %3
  %.not35 = icmp eq i32 %2, 0
  br i1 %.not35, label %.loopexit, label %.lr.ph33

.lr.ph33:                                         ; preds = %.preheader
  %20 = icmp sgt i32 %2, 0
  %21 = getelementptr inbounds i8, ptr %5, i64 1012
  %22 = getelementptr inbounds i8, ptr %5, i64 1008
  br i1 %20, label %.lr.ph33.split.us, label %.lr.ph33.split.split.us.preheader

.lr.ph33.split.us:                                ; preds = %.lr.ph33, %.lr.ph33.split.us
  %.02432.us = phi i32 [ %32, %.lr.ph33.split.us ], [ 0, %.lr.ph33 ]
  %23 = call noundef ptr @_ZN6ImPlot7GetTimeERK10ImPlotTimeP2tm(ptr noundef nonnull align 8 dereferenceable(12) %4, ptr noundef nonnull %6)
  %24 = load i32, ptr %21, align 4, !tbaa !18
  %25 = add nsw i32 %24, 1900
  %26 = load i32, ptr %22, align 8, !tbaa !20
  %27 = call noundef i32 @_ZN6ImPlotL14GetDaysInMonthEii(i32 noundef %25, i32 noundef %26)
  %28 = mul nsw i32 %27, 86400
  %29 = sext i32 %28 to i64
  %30 = load i64, ptr %4, align 8, !tbaa !14
  %31 = add nsw i64 %30, %29
  store i64 %31, ptr %4, align 8, !tbaa !14
  %32 = add nuw i32 %.02432.us, 1
  %exitcond48.not = icmp eq i32 %32, %2
  br i1 %exitcond48.not, label %.loopexit, label %.lr.ph33.split.us, !llvm.loop !21

.lr.ph33.split.split.us.preheader:                ; preds = %.lr.ph33
  %smax45 = sub i32 0, %2
  br label %.lr.ph33.split.split.us

.lr.ph33.split.split.us:                          ; preds = %.lr.ph33.split.split.us.preheader, %.lr.ph33.split.split.us
  %.02432.us34 = phi i32 [ %45, %.lr.ph33.split.split.us ], [ 0, %.lr.ph33.split.split.us.preheader ]
  %33 = call noundef ptr @_ZN6ImPlot7GetTimeERK10ImPlotTimeP2tm(ptr noundef nonnull align 8 dereferenceable(12) %4, ptr noundef nonnull %6)
  %34 = load i32, ptr %21, align 4, !tbaa !18
  %35 = add nsw i32 %34, 1900
  %36 = load i32, ptr %22, align 8, !tbaa !20
  %37 = icmp eq i32 %36, 0
  %.neg27.us = sext i1 %37 to i32
  %38 = add nsw i32 %35, %.neg27.us
  %39 = add nsw i32 %36, -1
  %spec.select.us = select i1 %37, i32 11, i32 %39
  %40 = call noundef i32 @_ZN6ImPlotL14GetDaysInMonthEii(i32 noundef %38, i32 noundef %spec.select.us)
  %41 = mul nsw i32 %40, 86400
  %42 = sext i32 %41 to i64
  %43 = load i64, ptr %4, align 8, !tbaa !14
  %44 = sub nsw i64 %43, %42
  store i64 %44, ptr %4, align 8, !tbaa !14
  %45 = add nuw i32 %.02432.us34, 1
  %exitcond46.not = icmp eq i32 %45, %smax45
  br i1 %exitcond46.not, label %.loopexit, label %.lr.ph33.split.split.us, !llvm.loop !21

46:                                               ; preds = %3
  %47 = getelementptr inbounds i8, ptr %4, i64 8
  %48 = load i32, ptr %47, align 8, !tbaa !22
  %49 = add nsw i32 %48, %2
  store i32 %49, ptr %47, align 8, !tbaa !22
  br label %.loopexit

50:                                               ; preds = %3
  %51 = mul nsw i32 %2, 1000
  %52 = getelementptr inbounds i8, ptr %4, i64 8
  %53 = load i32, ptr %52, align 8, !tbaa !22
  %54 = add nsw i32 %53, %51
  store i32 %54, ptr %52, align 8, !tbaa !22
  br label %.loopexit

55:                                               ; preds = %3
  %56 = sext i32 %2 to i64
  %57 = load i64, ptr %4, align 8, !tbaa !14
  %58 = add nsw i64 %57, %56
  store i64 %58, ptr %4, align 8, !tbaa !14
  br label %.loopexit

59:                                               ; preds = %3
  %60 = mul nsw i32 %2, 60
  %61 = sext i32 %60 to i64
  %62 = load i64, ptr %4, align 8, !tbaa !14
  %63 = add nsw i64 %62, %61
  store i64 %63, ptr %4, align 8, !tbaa !14
  br label %.loopexit

64:                                               ; preds = %3
  %65 = mul nsw i32 %2, 3600
  %66 = sext i32 %65 to i64
  %67 = load i64, ptr %4, align 8, !tbaa !14
  %68 = add nsw i64 %67, %66
  store i64 %68, ptr %4, align 8, !tbaa !14
  br label %.loopexit

69:                                               ; preds = %3
  %70 = mul nsw i32 %2, 86400
  %71 = sext i32 %70 to i64
  %72 = load i64, ptr %4, align 8, !tbaa !14
  %73 = add nsw i64 %72, %71
  store i64 %73, ptr %4, align 8, !tbaa !14
  br label %.loopexit

.loopexit:                                        ; preds = %.lr.ph.split.split.us, %.lr.ph.split.us, %.lr.ph33.split.split.us, %.lr.ph33.split.us, %.preheader28, %.preheader, %3, %69, %64, %59, %55, %50, %46
  call void @_ZN10ImPlotTime8RollOverEv(ptr noundef nonnull align 8 dereferenceable(12) %4)
  %.fca.0.load = load i64, ptr %4, align 8
  %.fca.0.insert = insertvalue { i64, i32 } poison, i64 %.fca.0.load, 0
  %.fca.1.gep = getelementptr inbounds i8, ptr %4, i64 8
  %.fca.1.load = load i32, ptr %.fca.1.gep, align 8
  %.fca.1.insert = insertvalue { i64, i32 } %.fca.0.insert, i32 %.fca.1.load, 1
  ret { i64, i32 } %.fca.1.insert
}

; Function Attrs: inlinehint mustprogress uwtable
declare hidden noundef i32 @_ZN6ImPlotL14GetDaysInMonthEii(i32 noundef, i32 noundef) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef zeroext i1 @_ZN6ImPlotL10IsLeapYearEi(i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN10ImPlotTime8RollOverEv(ptr noundef nonnull align 8 dereferenceable(12)) local_unnamed_addr #4 align 2

attributes #0 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 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 = { 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 = { 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 = !{i64 0, i64 8, !10, i64 8, i64 4, !12}
!10 = !{!11, !11, i64 0}
!11 = !{!"long", !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!15, !11, i64 0}
!15 = !{!"_ZTS10ImPlotTime", !11, i64 0, !13, i64 8}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = !{!19, !13, i64 20}
!19 = !{!"_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, !11, i64 40, !6, i64 48}
!20 = !{!19, !13, i64 16}
!21 = distinct !{!21, !17}
!22 = !{!15, !13, i64 8}


; Effective O3 passes: ADCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass