; LLVM IR from tangjz/acm-icpc :: hdu/5252.ll (Z5checkx)

; 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.Event = type { i64, i64, i64 }

@a = external dso_local global [50010 x %struct.Event], align 16
@n = external dso_local global i32, align 4

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_Z5checkx(i64 noundef %0) #0 {
  %2 = alloca i1, align 1
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  store i64 %0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #3
  store i64 -4611686018427387903, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #3
  store i64 4611686018427387903, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #3
  store i64 -4611686018427387903, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  store i64 4611686018427387903, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  %15 = load i64, ptr getelementptr inbounds (%struct.Event, ptr @a, i32 0, i32 2), align 16, !tbaa !9
  store i64 %15, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  store i32 0, ptr %9, align 4, !tbaa !11
  br label %16

16:                                               ; preds = %141, %1
  %17 = load i32, ptr %9, align 4, !tbaa !11
  %18 = load i32, ptr @n, align 4, !tbaa !11
  %19 = icmp slt i32 %17, %18
  br i1 %19, label %21, label %20

20:                                               ; preds = %16
  store i32 2, ptr %10, align 4
  br label %144

21:                                               ; preds = %16
  %22 = load i32, ptr %9, align 4, !tbaa !11
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds [50010 x %struct.Event], ptr @a, i64 0, i64 %23
  %25 = getelementptr inbounds %struct.Event, ptr %24, i32 0, i32 2
  %26 = load i64, ptr %25, align 8, !tbaa !9
  %27 = load i64, ptr %8, align 8, !tbaa !5
  %28 = icmp sgt i64 %26, %27
  br i1 %28, label %29, label %71

29:                                               ; preds = %21
  %30 = load i32, ptr %9, align 4, !tbaa !11
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [50010 x %struct.Event], ptr @a, i64 0, i64 %31
  %33 = getelementptr inbounds %struct.Event, ptr %32, i32 0, i32 2
  %34 = load i64, ptr %33, align 8, !tbaa !9
  %35 = load i64, ptr %8, align 8, !tbaa !5
  %36 = sub nsw i64 %34, %35
  %37 = load i64, ptr %4, align 8, !tbaa !5
  %38 = sub nsw i64 %37, %36
  store i64 %38, ptr %4, align 8, !tbaa !5
  %39 = load i32, ptr %9, align 4, !tbaa !11
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [50010 x %struct.Event], ptr @a, i64 0, i64 %40
  %42 = getelementptr inbounds %struct.Event, ptr %41, i32 0, i32 2
  %43 = load i64, ptr %42, align 8, !tbaa !9
  %44 = load i64, ptr %8, align 8, !tbaa !5
  %45 = sub nsw i64 %43, %44
  %46 = load i64, ptr %5, align 8, !tbaa !5
  %47 = add nsw i64 %46, %45
  store i64 %47, ptr %5, align 8, !tbaa !5
  %48 = load i32, ptr %9, align 4, !tbaa !11
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [50010 x %struct.Event], ptr @a, i64 0, i64 %49
  %51 = getelementptr inbounds %struct.Event, ptr %50, i32 0, i32 2
  %52 = load i64, ptr %51, align 8, !tbaa !9
  %53 = load i64, ptr %8, align 8, !tbaa !5
  %54 = sub nsw i64 %52, %53
  %55 = load i64, ptr %6, align 8, !tbaa !5
  %56 = sub nsw i64 %55, %54
  store i64 %56, ptr %6, align 8, !tbaa !5
  %57 = load i32, ptr %9, align 4, !tbaa !11
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [50010 x %struct.Event], ptr @a, i64 0, i64 %58
  %60 = getelementptr inbounds %struct.Event, ptr %59, i32 0, i32 2
  %61 = load i64, ptr %60, align 8, !tbaa !9
  %62 = load i64, ptr %8, align 8, !tbaa !5
  %63 = sub nsw i64 %61, %62
  %64 = load i64, ptr %7, align 8, !tbaa !5
  %65 = add nsw i64 %64, %63
  store i64 %65, ptr %7, align 8, !tbaa !5
  %66 = load i32, ptr %9, align 4, !tbaa !11
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [50010 x %struct.Event], ptr @a, i64 0, i64 %67
  %69 = getelementptr inbounds %struct.Event, ptr %68, i32 0, i32 2
  %70 = load i64, ptr %69, align 8, !tbaa !9
  store i64 %70, ptr %8, align 8, !tbaa !5
  br label %71

71:                                               ; preds = %29, %21
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  %72 = load i32, ptr %9, align 4, !tbaa !11
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [50010 x %struct.Event], ptr @a, i64 0, i64 %73
  %75 = getelementptr inbounds %struct.Event, ptr %74, i32 0, i32 0
  %76 = load i64, ptr %75, align 8, !tbaa !13
  %77 = load i32, ptr %9, align 4, !tbaa !11
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [50010 x %struct.Event], ptr @a, i64 0, i64 %78
  %80 = getelementptr inbounds %struct.Event, ptr %79, i32 0, i32 1
  %81 = load i64, ptr %80, align 8, !tbaa !14
  %82 = sub nsw i64 %76, %81
  %83 = load i64, ptr %3, align 8, !tbaa !5
  %84 = sub nsw i64 %82, %83
  store i64 %84, ptr %11, align 8, !tbaa !5
  %85 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %11)
  %86 = load i64, ptr %85, align 8, !tbaa !5
  store i64 %86, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  %87 = load i32, ptr %9, align 4, !tbaa !11
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [50010 x %struct.Event], ptr @a, i64 0, i64 %88
  %90 = getelementptr inbounds %struct.Event, ptr %89, i32 0, i32 0
  %91 = load i64, ptr %90, align 8, !tbaa !13
  %92 = load i32, ptr %9, align 4, !tbaa !11
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [50010 x %struct.Event], ptr @a, i64 0, i64 %93
  %95 = getelementptr inbounds %struct.Event, ptr %94, i32 0, i32 1
  %96 = load i64, ptr %95, align 8, !tbaa !14
  %97 = sub nsw i64 %91, %96
  %98 = load i64, ptr %3, align 8, !tbaa !5
  %99 = add nsw i64 %97, %98
  store i64 %99, ptr %12, align 8, !tbaa !5
  %100 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %12)
  %101 = load i64, ptr %100, align 8, !tbaa !5
  store i64 %101, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  %102 = load i32, ptr %9, align 4, !tbaa !11
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds [50010 x %struct.Event], ptr @a, i64 0, i64 %103
  %105 = getelementptr inbounds %struct.Event, ptr %104, i32 0, i32 0
  %106 = load i64, ptr %105, align 8, !tbaa !13
  %107 = load i32, ptr %9, align 4, !tbaa !11
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [50010 x %struct.Event], ptr @a, i64 0, i64 %108
  %110 = getelementptr inbounds %struct.Event, ptr %109, i32 0, i32 1
  %111 = load i64, ptr %110, align 8, !tbaa !14
  %112 = add nsw i64 %106, %111
  %113 = load i64, ptr %3, align 8, !tbaa !5
  %114 = sub nsw i64 %112, %113
  store i64 %114, ptr %13, align 8, !tbaa !5
  %115 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %13)
  %116 = load i64, ptr %115, align 8, !tbaa !5
  store i64 %116, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #3
  %117 = load i32, ptr %9, align 4, !tbaa !11
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [50010 x %struct.Event], ptr @a, i64 0, i64 %118
  %120 = getelementptr inbounds %struct.Event, ptr %119, i32 0, i32 0
  %121 = load i64, ptr %120, align 8, !tbaa !13
  %122 = load i32, ptr %9, align 4, !tbaa !11
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds [50010 x %struct.Event], ptr @a, i64 0, i64 %123
  %125 = getelementptr inbounds %struct.Event, ptr %124, i32 0, i32 1
  %126 = load i64, ptr %125, align 8, !tbaa !14
  %127 = add nsw i64 %121, %126
  %128 = load i64, ptr %3, align 8, !tbaa !5
  %129 = add nsw i64 %127, %128
  store i64 %129, ptr %14, align 8, !tbaa !5
  %130 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %14)
  %131 = load i64, ptr %130, align 8, !tbaa !5
  store i64 %131, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  %132 = load i64, ptr %4, align 8, !tbaa !5
  %133 = load i64, ptr %5, align 8, !tbaa !5
  %134 = icmp sgt i64 %132, %133
  br i1 %134, label %139, label %135

135:                                              ; preds = %71
  %136 = load i64, ptr %6, align 8, !tbaa !5
  %137 = load i64, ptr %7, align 8, !tbaa !5
  %138 = icmp sgt i64 %136, %137
  br i1 %138, label %139, label %140

139:                                              ; preds = %135, %71
  store i1 false, ptr %2, align 1
  store i32 1, ptr %10, align 4
  br label %144

140:                                              ; preds = %135
  br label %141

141:                                              ; preds = %140
  %142 = load i32, ptr %9, align 4, !tbaa !11
  %143 = add nsw i32 %142, 1
  store i32 %143, ptr %9, align 4, !tbaa !11
  br label %16, !llvm.loop !15

144:                                              ; preds = %139, %20
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  %145 = load i32, ptr %10, align 4
  switch i32 %145, label %156 [
    i32 2, label %146
  ]

146:                                              ; preds = %144
  %147 = load i64, ptr %4, align 8, !tbaa !5
  %148 = load i64, ptr %5, align 8, !tbaa !5
  %149 = icmp sle i64 %147, %148
  br i1 %149, label %150, label %154

150:                                              ; preds = %146
  %151 = load i64, ptr %6, align 8, !tbaa !5
  %152 = load i64, ptr %7, align 8, !tbaa !5
  %153 = icmp sle i64 %151, %152
  br label %154

154:                                              ; preds = %150, %146
  %155 = phi i1 [ false, %146 ], [ %153, %150 ]
  store i1 %155, ptr %2, align 1
  store i32 1, ptr %10, align 4
  br label %156

156:                                              ; preds = %154, %144
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #3
  %157 = load i1, ptr %2, align 1
  ret i1 %157
}

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

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

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

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

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 16}
!10 = !{!"_ZTS5Event", !6, i64 0, !6, i64 8, !6, i64 16}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!10, !6, i64 0}
!14 = !{!10, !6, i64 8}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}


; 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.Event = type { i64, i64, i64 }

@a = external dso_local local_unnamed_addr global [50010 x %struct.Event], align 16
@n = external dso_local local_unnamed_addr global i32, align 4

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef zeroext i1 @_Z5checkx(i64 noundef %0) local_unnamed_addr #0 {
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #3
  store i64 -4611686018427387903, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #3
  store i64 4611686018427387903, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #3
  store i64 -4611686018427387903, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #3
  store i64 4611686018427387903, ptr %5, align 8, !tbaa !5
  %10 = load i32, ptr @n, align 4, !tbaa !9
  %.not37 = icmp sgt i32 %10, 0
  br i1 %.not37, label %.lr.ph.preheader, label %.critedge

.lr.ph.preheader:                                 ; preds = %1
  %11 = load i64, ptr getelementptr inbounds (i8, ptr @a, i64 16), align 16, !tbaa !11
  br label %.lr.ph

12:                                               ; preds = %29
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %13 = load i32, ptr @n, align 4, !tbaa !9
  %14 = sext i32 %13 to i64
  %.not = icmp slt i64 %indvars.iv.next, %14
  br i1 %.not, label %.lr.ph, label %.critedge, !llvm.loop !13

.lr.ph:                                           ; preds = %.lr.ph.preheader, %12
  %15 = phi i64 [ 4611686018427387903, %.lr.ph.preheader ], [ %54, %12 ]
  %16 = phi i64 [ -4611686018427387903, %.lr.ph.preheader ], [ %58, %12 ]
  %17 = phi i64 [ 4611686018427387903, %.lr.ph.preheader ], [ %56, %12 ]
  %18 = phi i64 [ -4611686018427387903, %.lr.ph.preheader ], [ %55, %12 ]
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %12 ]
  %.02738 = phi i64 [ %11, %.lr.ph.preheader ], [ %.1, %12 ]
  %19 = getelementptr inbounds [50010 x %struct.Event], ptr @a, i64 0, i64 %indvars.iv
  %20 = getelementptr inbounds i8, ptr %19, i64 16
  %21 = load i64, ptr %20, align 8, !tbaa !11
  %22 = icmp sgt i64 %21, %.02738
  br i1 %22, label %23, label %29

23:                                               ; preds = %.lr.ph
  %.neg = sub i64 %.02738, %21
  %24 = add i64 %18, %.neg
  store i64 %24, ptr %2, align 8, !tbaa !5
  %25 = sub nsw i64 %21, %.02738
  %26 = add nsw i64 %17, %25
  store i64 %26, ptr %3, align 8, !tbaa !5
  %27 = add i64 %16, %.neg
  store i64 %27, ptr %4, align 8, !tbaa !5
  %28 = add nsw i64 %15, %25
  store i64 %28, ptr %5, align 8, !tbaa !5
  br label %29

29:                                               ; preds = %23, %.lr.ph
  %.1 = phi i64 [ %21, %23 ], [ %.02738, %.lr.ph ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #3
  %30 = load i64, ptr %19, align 8, !tbaa !15
  %31 = getelementptr inbounds i8, ptr %19, i64 8
  %32 = load i64, ptr %31, align 8, !tbaa !16
  %33 = add i64 %32, %0
  %34 = sub i64 %30, %33
  store i64 %34, ptr %6, align 8, !tbaa !5
  %35 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %6)
  %36 = load i64, ptr %35, align 8, !tbaa !5
  store i64 %36, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #3
  %37 = load i64, ptr %19, align 8, !tbaa !15
  %38 = load i64, ptr %31, align 8, !tbaa !16
  %39 = add i64 %37, %0
  %40 = sub i64 %39, %38
  store i64 %40, ptr %7, align 8, !tbaa !5
  %41 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %42 = load i64, ptr %41, align 8, !tbaa !5
  store i64 %42, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #3
  %43 = load i64, ptr %19, align 8, !tbaa !15
  %44 = load i64, ptr %31, align 8, !tbaa !16
  %45 = sub i64 %43, %0
  %46 = add i64 %45, %44
  store i64 %46, ptr %8, align 8, !tbaa !5
  %47 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %8)
  %48 = load i64, ptr %47, align 8, !tbaa !5
  store i64 %48, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #3
  %49 = load i64, ptr %19, align 8, !tbaa !15
  %50 = load i64, ptr %31, align 8, !tbaa !16
  %51 = add i64 %49, %0
  %52 = add i64 %51, %50
  store i64 %52, ptr %9, align 8, !tbaa !5
  %53 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %9)
  %54 = load i64, ptr %53, align 8, !tbaa !5
  store i64 %54, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #3
  %55 = load i64, ptr %2, align 8, !tbaa !5
  %56 = load i64, ptr %3, align 8, !tbaa !5
  %57 = icmp sgt i64 %55, %56
  %58 = load i64, ptr %4, align 8
  %59 = icmp sgt i64 %58, %54
  %or.cond = select i1 %57, i1 true, i1 %59
  br i1 %or.cond, label %.loopexit, label %12

.critedge:                                        ; preds = %12, %1
  %60 = phi i64 [ 4611686018427387903, %1 ], [ %54, %12 ]
  %61 = phi i64 [ -4611686018427387903, %1 ], [ %58, %12 ]
  %62 = phi i64 [ 4611686018427387903, %1 ], [ %56, %12 ]
  %63 = phi i64 [ -4611686018427387903, %1 ], [ %55, %12 ]
  %64 = icmp sle i64 %63, %62
  %65 = icmp sle i64 %61, %60
  %66 = select i1 %64, i1 %65, i1 false
  br label %.loopexit

.loopexit:                                        ; preds = %29, %.critedge
  %.129 = phi i1 [ %66, %.critedge ], [ false, %29 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #3
  ret i1 %.129
}

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

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

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

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

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" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = !{!"long long", !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, !6, i64 16}
!12 = !{!"_ZTS5Event", !6, i64 0, !6, i64 8, !6, i64 16}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!12, !6, i64 0}
!16 = !{!12, !6, i64 8}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass