; LLVM IR from tangjz/acm-icpc :: lydsy (1600)

; 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"

@n = external dso_local global i32, align 4
@f = external dso_local global [2501 x i32], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  %7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n)
  %8 = load i32, ptr @n, align 4, !tbaa !5
  %9 = sdiv i32 %8, 2
  %10 = load i32, ptr @n, align 4, !tbaa !5
  %11 = xor i32 %10, -1
  %12 = and i32 %11, 1
  %13 = sub nsw i32 %9, %12
  store i32 %13, ptr %5, align 4, !tbaa !5
  store i32 1, ptr @f, align 16, !tbaa !5
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %14

14:                                               ; preds = %52, %0
  %15 = load i32, ptr %4, align 4, !tbaa !5
  %16 = icmp sle i32 %15, 3
  br i1 %16, label %17, label %55

17:                                               ; preds = %14
  %18 = load i32, ptr @n, align 4, !tbaa !5
  store i32 %18, ptr %2, align 4, !tbaa !5
  br label %19

19:                                               ; preds = %48, %17
  %20 = load i32, ptr %2, align 4, !tbaa !5
  %21 = icmp sge i32 %20, 0
  br i1 %21, label %22, label %51

22:                                               ; preds = %19
  %23 = load i32, ptr %2, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds [2501 x i32], ptr @f, i64 0, i64 %24
  store i32 0, ptr %25, align 4, !tbaa !5
  %26 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %27 = load i32, ptr %26, align 4, !tbaa !5
  store i32 %27, ptr %6, align 4, !tbaa !5
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %28

28:                                               ; preds = %44, %22
  %29 = load i32, ptr %3, align 4, !tbaa !5
  %30 = load i32, ptr %6, align 4, !tbaa !5
  %31 = icmp sle i32 %29, %30
  br i1 %31, label %32, label %47

32:                                               ; preds = %28
  %33 = load i32, ptr %2, align 4, !tbaa !5
  %34 = load i32, ptr %3, align 4, !tbaa !5
  %35 = sub nsw i32 %33, %34
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [2501 x i32], ptr @f, i64 0, i64 %36
  %38 = load i32, ptr %37, align 4, !tbaa !5
  %39 = load i32, ptr %2, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [2501 x i32], ptr @f, i64 0, i64 %40
  %42 = load i32, ptr %41, align 4, !tbaa !5
  %43 = add nsw i32 %42, %38
  store i32 %43, ptr %41, align 4, !tbaa !5
  br label %44

44:                                               ; preds = %32
  %45 = load i32, ptr %3, align 4, !tbaa !5
  %46 = add nsw i32 %45, 1
  store i32 %46, ptr %3, align 4, !tbaa !5
  br label %28, !llvm.loop !9

47:                                               ; preds = %28
  br label %48

48:                                               ; preds = %47
  %49 = load i32, ptr %2, align 4, !tbaa !5
  %50 = add nsw i32 %49, -1
  store i32 %50, ptr %2, align 4, !tbaa !5
  br label %19, !llvm.loop !11

51:                                               ; preds = %19
  br label %52

52:                                               ; preds = %51
  %53 = load i32, ptr %4, align 4, !tbaa !5
  %54 = add nsw i32 %53, 1
  store i32 %54, ptr %4, align 4, !tbaa !5
  br label %14, !llvm.loop !12

55:                                               ; preds = %14
  %56 = load i32, ptr @n, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [2501 x i32], ptr @f, i64 0, i64 %57
  %59 = load i32, ptr %58, align 4, !tbaa !5
  %60 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %59)
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #4
  ret i32 0
}

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

declare i32 @__isoc99_scanf(ptr noundef, ...) #2

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

declare i32 @printf(ptr noundef, ...) #2

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

attributes #0 = { mustprogress norecurse 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 = { "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 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}


; 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"

@n = external dso_local global i32, align 4
@f = external dso_local local_unnamed_addr global [2501 x i32], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #5
  %3 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
  %4 = load i32, ptr @n, align 4, !tbaa !5
  %5 = sdiv i32 %4, 2
  %6 = and i32 %4, 1
  %7 = xor i32 %6, 1
  %8 = sub nsw i32 %5, %7
  store i32 %8, ptr %2, align 4, !tbaa !5
  store i32 1, ptr @f, align 16, !tbaa !5
  %9 = icmp sgt i32 %4, -1
  store i32 %4, ptr %1, align 4, !tbaa !5
  br i1 %9, label %.lr.ph12, label %.split16.us

.lr.ph12:                                         ; preds = %0, %._crit_edge
  %storemerge10 = phi i32 [ %32, %._crit_edge ], [ %4, %0 ]
  %10 = zext nneg i32 %storemerge10 to i64
  %11 = getelementptr inbounds [2501 x i32], ptr @f, i64 0, i64 %10
  store i32 0, ptr %11, align 4, !tbaa !5
  %12 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %13 = load i32, ptr %12, align 4, !tbaa !5
  %.not8 = icmp slt i32 %13, 1
  %.pre = load i32, ptr %1, align 4, !tbaa !5
  br i1 %.not8, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph12
  %14 = sext i32 %.pre to i64
  %15 = getelementptr inbounds [2501 x i32], ptr @f, i64 0, i64 %14
  %.promoted = load i32, ptr %15, align 4, !tbaa !5
  %16 = add nuw i32 %13, 1
  %wide.trip.count = zext i32 %16 to i64
  %17 = zext nneg i32 %13 to i64
  %min.iters.check = icmp ult i32 %13, 8
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph
  %n.vec = and i64 %17, 2147483640
  %ind.end = or disjoint i64 %n.vec, 1
  %18 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %.promoted, i64 0
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.phi = phi <4 x i32> [ %18, %vector.ph ], [ %23, %vector.body ]
  %vec.phi28 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %24, %vector.body ]
  %offset.idx.neg = xor i64 %index, -1
  %19 = add i64 %offset.idx.neg, %14
  %20 = getelementptr inbounds [2501 x i32], ptr @f, i64 0, i64 %19
  %21 = getelementptr inbounds i8, ptr %20, i64 -12
  %22 = getelementptr inbounds i8, ptr %20, i64 -28
  %wide.load = load <4 x i32>, ptr %21, align 4, !tbaa !5
  %reverse = shufflevector <4 x i32> %wide.load, <4 x i32> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
  %wide.load29 = load <4 x i32>, ptr %22, align 4, !tbaa !5
  %reverse30 = shufflevector <4 x i32> %wide.load29, <4 x i32> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
  %23 = add <4 x i32> %vec.phi, %reverse
  %24 = add <4 x i32> %vec.phi28, %reverse30
  %index.next = add nuw i64 %index, 8
  %25 = icmp eq i64 %index.next, %n.vec
  br i1 %25, label %middle.block, label %vector.body, !llvm.loop !9

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <4 x i32> %24, %23
  %26 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
  store i32 %26, ptr %15, align 4, !tbaa !5
  %cmp.n = icmp eq i64 %n.vec, %17
  br i1 %cmp.n, label %._crit_edge, label %scalar.ph.preheader

scalar.ph.preheader:                              ; preds = %middle.block, %.lr.ph
  %indvars.iv.ph = phi i64 [ 1, %.lr.ph ], [ %ind.end, %middle.block ]
  %.ph102 = phi i32 [ %.promoted, %.lr.ph ], [ %26, %middle.block ]
  br label %scalar.ph

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %scalar.ph ], [ %indvars.iv.ph, %scalar.ph.preheader ]
  %27 = phi i32 [ %31, %scalar.ph ], [ %.ph102, %scalar.ph.preheader ]
  %28 = sub nsw i64 %14, %indvars.iv
  %29 = getelementptr inbounds [2501 x i32], ptr @f, i64 0, i64 %28
  %30 = load i32, ptr %29, align 4, !tbaa !5
  %31 = add nsw i32 %27, %30
  store i32 %31, ptr %15, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %scalar.ph, !llvm.loop !13

._crit_edge:                                      ; preds = %scalar.ph, %middle.block, %.lr.ph12
  %32 = add nsw i32 %.pre, -1
  store i32 %32, ptr %1, align 4, !tbaa !5
  %33 = icmp sgt i32 %.pre, 0
  br i1 %33, label %.lr.ph12, label %._crit_edge13, !llvm.loop !14

._crit_edge13:                                    ; preds = %._crit_edge
  %.pre20 = load i32, ptr @n, align 4, !tbaa !5
  store i32 %.pre20, ptr %1, align 4, !tbaa !5
  %34 = icmp sgt i32 %.pre20, -1
  br i1 %34, label %.lr.ph12.1, label %._crit_edge13.2.thread

.lr.ph12.1:                                       ; preds = %._crit_edge13, %._crit_edge.1
  %storemerge10.1 = phi i32 [ %57, %._crit_edge.1 ], [ %.pre20, %._crit_edge13 ]
  %35 = zext nneg i32 %storemerge10.1 to i64
  %36 = getelementptr inbounds [2501 x i32], ptr @f, i64 0, i64 %35
  store i32 0, ptr %36, align 4, !tbaa !5
  %37 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %38 = load i32, ptr %37, align 4, !tbaa !5
  %.not8.1 = icmp slt i32 %38, 1
  %.pre21 = load i32, ptr %1, align 4, !tbaa !5
  br i1 %.not8.1, label %._crit_edge.1, label %.lr.ph.1

.lr.ph.1:                                         ; preds = %.lr.ph12.1
  %39 = sext i32 %.pre21 to i64
  %40 = getelementptr inbounds [2501 x i32], ptr @f, i64 0, i64 %39
  %.promoted.1 = load i32, ptr %40, align 4, !tbaa !5
  %41 = add nuw i32 %38, 1
  %wide.trip.count.1 = zext i32 %41 to i64
  %42 = zext nneg i32 %38 to i64
  %min.iters.check33 = icmp ult i32 %38, 8
  br i1 %min.iters.check33, label %scalar.ph32.preheader, label %vector.ph34

vector.ph34:                                      ; preds = %.lr.ph.1
  %n.vec36 = and i64 %42, 2147483640
  %ind.end37 = or disjoint i64 %n.vec36, 1
  %43 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %.promoted.1, i64 0
  br label %vector.body39

vector.body39:                                    ; preds = %vector.body39, %vector.ph34
  %index40 = phi i64 [ 0, %vector.ph34 ], [ %index.next48, %vector.body39 ]
  %vec.phi41 = phi <4 x i32> [ %43, %vector.ph34 ], [ %48, %vector.body39 ]
  %vec.phi42 = phi <4 x i32> [ zeroinitializer, %vector.ph34 ], [ %49, %vector.body39 ]
  %offset.idx43.neg = xor i64 %index40, -1
  %44 = add i64 %offset.idx43.neg, %39
  %45 = getelementptr inbounds [2501 x i32], ptr @f, i64 0, i64 %44
  %46 = getelementptr inbounds i8, ptr %45, i64 -12
  %47 = getelementptr inbounds i8, ptr %45, i64 -28
  %wide.load44 = load <4 x i32>, ptr %46, align 4, !tbaa !5
  %reverse45 = shufflevector <4 x i32> %wide.load44, <4 x i32> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
  %wide.load46 = load <4 x i32>, ptr %47, align 4, !tbaa !5
  %reverse47 = shufflevector <4 x i32> %wide.load46, <4 x i32> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
  %48 = add <4 x i32> %vec.phi41, %reverse45
  %49 = add <4 x i32> %vec.phi42, %reverse47
  %index.next48 = add nuw i64 %index40, 8
  %50 = icmp eq i64 %index.next48, %n.vec36
  br i1 %50, label %middle.block31, label %vector.body39, !llvm.loop !15

middle.block31:                                   ; preds = %vector.body39
  %bin.rdx49 = add <4 x i32> %49, %48
  %51 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx49)
  store i32 %51, ptr %40, align 4, !tbaa !5
  %cmp.n50 = icmp eq i64 %n.vec36, %42
  br i1 %cmp.n50, label %._crit_edge.1, label %scalar.ph32.preheader

scalar.ph32.preheader:                            ; preds = %middle.block31, %.lr.ph.1
  %indvars.iv.1.ph = phi i64 [ 1, %.lr.ph.1 ], [ %ind.end37, %middle.block31 ]
  %.ph99 = phi i32 [ %.promoted.1, %.lr.ph.1 ], [ %51, %middle.block31 ]
  br label %scalar.ph32

scalar.ph32:                                      ; preds = %scalar.ph32.preheader, %scalar.ph32
  %indvars.iv.1 = phi i64 [ %indvars.iv.next.1, %scalar.ph32 ], [ %indvars.iv.1.ph, %scalar.ph32.preheader ]
  %52 = phi i32 [ %56, %scalar.ph32 ], [ %.ph99, %scalar.ph32.preheader ]
  %53 = sub nsw i64 %39, %indvars.iv.1
  %54 = getelementptr inbounds [2501 x i32], ptr @f, i64 0, i64 %53
  %55 = load i32, ptr %54, align 4, !tbaa !5
  %56 = add nsw i32 %52, %55
  store i32 %56, ptr %40, align 4, !tbaa !5
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv.1, 1
  %exitcond.1.not = icmp eq i64 %indvars.iv.next.1, %wide.trip.count.1
  br i1 %exitcond.1.not, label %._crit_edge.1, label %scalar.ph32, !llvm.loop !16

._crit_edge.1:                                    ; preds = %scalar.ph32, %middle.block31, %.lr.ph12.1
  %57 = add nsw i32 %.pre21, -1
  store i32 %57, ptr %1, align 4, !tbaa !5
  %58 = icmp sgt i32 %.pre21, 0
  br i1 %58, label %.lr.ph12.1, label %._crit_edge13.1, !llvm.loop !14

._crit_edge13.1:                                  ; preds = %._crit_edge.1
  %.pre22 = load i32, ptr @n, align 4, !tbaa !5
  store i32 %.pre22, ptr %1, align 4, !tbaa !5
  %59 = icmp sgt i32 %.pre22, -1
  br i1 %59, label %.lr.ph12.2, label %._crit_edge13.2.thread

.lr.ph12.2:                                       ; preds = %._crit_edge13.1, %._crit_edge.2
  %storemerge10.2 = phi i32 [ %82, %._crit_edge.2 ], [ %.pre22, %._crit_edge13.1 ]
  %60 = zext nneg i32 %storemerge10.2 to i64
  %61 = getelementptr inbounds [2501 x i32], ptr @f, i64 0, i64 %60
  store i32 0, ptr %61, align 4, !tbaa !5
  %62 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %63 = load i32, ptr %62, align 4, !tbaa !5
  %.not8.2 = icmp slt i32 %63, 1
  %.pre23 = load i32, ptr %1, align 4, !tbaa !5
  br i1 %.not8.2, label %._crit_edge.2, label %.lr.ph.2

.lr.ph.2:                                         ; preds = %.lr.ph12.2
  %64 = sext i32 %.pre23 to i64
  %65 = getelementptr inbounds [2501 x i32], ptr @f, i64 0, i64 %64
  %.promoted.2 = load i32, ptr %65, align 4, !tbaa !5
  %66 = add nuw i32 %63, 1
  %wide.trip.count.2 = zext i32 %66 to i64
  %67 = zext nneg i32 %63 to i64
  %min.iters.check54 = icmp ult i32 %63, 8
  br i1 %min.iters.check54, label %scalar.ph53.preheader, label %vector.ph55

vector.ph55:                                      ; preds = %.lr.ph.2
  %n.vec57 = and i64 %67, 2147483640
  %ind.end58 = or disjoint i64 %n.vec57, 1
  %68 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %.promoted.2, i64 0
  br label %vector.body60

vector.body60:                                    ; preds = %vector.body60, %vector.ph55
  %index61 = phi i64 [ 0, %vector.ph55 ], [ %index.next69, %vector.body60 ]
  %vec.phi62 = phi <4 x i32> [ %68, %vector.ph55 ], [ %73, %vector.body60 ]
  %vec.phi63 = phi <4 x i32> [ zeroinitializer, %vector.ph55 ], [ %74, %vector.body60 ]
  %offset.idx64.neg = xor i64 %index61, -1
  %69 = add i64 %offset.idx64.neg, %64
  %70 = getelementptr inbounds [2501 x i32], ptr @f, i64 0, i64 %69
  %71 = getelementptr inbounds i8, ptr %70, i64 -12
  %72 = getelementptr inbounds i8, ptr %70, i64 -28
  %wide.load65 = load <4 x i32>, ptr %71, align 4, !tbaa !5
  %reverse66 = shufflevector <4 x i32> %wide.load65, <4 x i32> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
  %wide.load67 = load <4 x i32>, ptr %72, align 4, !tbaa !5
  %reverse68 = shufflevector <4 x i32> %wide.load67, <4 x i32> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
  %73 = add <4 x i32> %vec.phi62, %reverse66
  %74 = add <4 x i32> %vec.phi63, %reverse68
  %index.next69 = add nuw i64 %index61, 8
  %75 = icmp eq i64 %index.next69, %n.vec57
  br i1 %75, label %middle.block52, label %vector.body60, !llvm.loop !17

middle.block52:                                   ; preds = %vector.body60
  %bin.rdx70 = add <4 x i32> %74, %73
  %76 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx70)
  store i32 %76, ptr %65, align 4, !tbaa !5
  %cmp.n71 = icmp eq i64 %n.vec57, %67
  br i1 %cmp.n71, label %._crit_edge.2, label %scalar.ph53.preheader

scalar.ph53.preheader:                            ; preds = %middle.block52, %.lr.ph.2
  %indvars.iv.2.ph = phi i64 [ 1, %.lr.ph.2 ], [ %ind.end58, %middle.block52 ]
  %.ph96 = phi i32 [ %.promoted.2, %.lr.ph.2 ], [ %76, %middle.block52 ]
  br label %scalar.ph53

scalar.ph53:                                      ; preds = %scalar.ph53.preheader, %scalar.ph53
  %indvars.iv.2 = phi i64 [ %indvars.iv.next.2, %scalar.ph53 ], [ %indvars.iv.2.ph, %scalar.ph53.preheader ]
  %77 = phi i32 [ %81, %scalar.ph53 ], [ %.ph96, %scalar.ph53.preheader ]
  %78 = sub nsw i64 %64, %indvars.iv.2
  %79 = getelementptr inbounds [2501 x i32], ptr @f, i64 0, i64 %78
  %80 = load i32, ptr %79, align 4, !tbaa !5
  %81 = add nsw i32 %77, %80
  store i32 %81, ptr %65, align 4, !tbaa !5
  %indvars.iv.next.2 = add nuw nsw i64 %indvars.iv.2, 1
  %exitcond.2.not = icmp eq i64 %indvars.iv.next.2, %wide.trip.count.2
  br i1 %exitcond.2.not, label %._crit_edge.2, label %scalar.ph53, !llvm.loop !18

._crit_edge.2:                                    ; preds = %scalar.ph53, %middle.block52, %.lr.ph12.2
  %82 = add nsw i32 %.pre23, -1
  store i32 %82, ptr %1, align 4, !tbaa !5
  %83 = icmp sgt i32 %.pre23, 0
  br i1 %83, label %.lr.ph12.2, label %._crit_edge13.2, !llvm.loop !14

._crit_edge13.2.thread:                           ; preds = %._crit_edge13, %._crit_edge13.1
  %.ph = phi i32 [ %.pre22, %._crit_edge13.1 ], [ %.pre20, %._crit_edge13 ]
  store i32 %.ph, ptr %1, align 4, !tbaa !5
  br label %.split16.us

._crit_edge13.2:                                  ; preds = %._crit_edge.2
  %.pre24 = load i32, ptr @n, align 4, !tbaa !5
  store i32 %.pre24, ptr %1, align 4, !tbaa !5
  %84 = icmp sgt i32 %.pre24, -1
  br i1 %84, label %.lr.ph12.3, label %.split16.us

.lr.ph12.3:                                       ; preds = %._crit_edge13.2, %._crit_edge.3
  %storemerge10.3 = phi i32 [ %107, %._crit_edge.3 ], [ %.pre24, %._crit_edge13.2 ]
  %85 = zext nneg i32 %storemerge10.3 to i64
  %86 = getelementptr inbounds [2501 x i32], ptr @f, i64 0, i64 %85
  store i32 0, ptr %86, align 4, !tbaa !5
  %87 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %88 = load i32, ptr %87, align 4, !tbaa !5
  %.not8.3 = icmp slt i32 %88, 1
  %.pre25 = load i32, ptr %1, align 4, !tbaa !5
  br i1 %.not8.3, label %._crit_edge.3, label %.lr.ph.3

.lr.ph.3:                                         ; preds = %.lr.ph12.3
  %89 = sext i32 %.pre25 to i64
  %90 = getelementptr inbounds [2501 x i32], ptr @f, i64 0, i64 %89
  %.promoted.3 = load i32, ptr %90, align 4, !tbaa !5
  %91 = add nuw i32 %88, 1
  %wide.trip.count.3 = zext i32 %91 to i64
  %92 = zext nneg i32 %88 to i64
  %min.iters.check75 = icmp ult i32 %88, 8
  br i1 %min.iters.check75, label %scalar.ph74.preheader, label %vector.ph76

vector.ph76:                                      ; preds = %.lr.ph.3
  %n.vec78 = and i64 %92, 2147483640
  %ind.end79 = or disjoint i64 %n.vec78, 1
  %93 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %.promoted.3, i64 0
  br label %vector.body81

vector.body81:                                    ; preds = %vector.body81, %vector.ph76
  %index82 = phi i64 [ 0, %vector.ph76 ], [ %index.next90, %vector.body81 ]
  %vec.phi83 = phi <4 x i32> [ %93, %vector.ph76 ], [ %98, %vector.body81 ]
  %vec.phi84 = phi <4 x i32> [ zeroinitializer, %vector.ph76 ], [ %99, %vector.body81 ]
  %offset.idx85.neg = xor i64 %index82, -1
  %94 = add i64 %offset.idx85.neg, %89
  %95 = getelementptr inbounds [2501 x i32], ptr @f, i64 0, i64 %94
  %96 = getelementptr inbounds i8, ptr %95, i64 -12
  %97 = getelementptr inbounds i8, ptr %95, i64 -28
  %wide.load86 = load <4 x i32>, ptr %96, align 4, !tbaa !5
  %reverse87 = shufflevector <4 x i32> %wide.load86, <4 x i32> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
  %wide.load88 = load <4 x i32>, ptr %97, align 4, !tbaa !5
  %reverse89 = shufflevector <4 x i32> %wide.load88, <4 x i32> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
  %98 = add <4 x i32> %vec.phi83, %reverse87
  %99 = add <4 x i32> %vec.phi84, %reverse89
  %index.next90 = add nuw i64 %index82, 8
  %100 = icmp eq i64 %index.next90, %n.vec78
  br i1 %100, label %middle.block73, label %vector.body81, !llvm.loop !19

middle.block73:                                   ; preds = %vector.body81
  %bin.rdx91 = add <4 x i32> %99, %98
  %101 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx91)
  store i32 %101, ptr %90, align 4, !tbaa !5
  %cmp.n92 = icmp eq i64 %n.vec78, %92
  br i1 %cmp.n92, label %._crit_edge.3, label %scalar.ph74.preheader

scalar.ph74.preheader:                            ; preds = %middle.block73, %.lr.ph.3
  %indvars.iv.3.ph = phi i64 [ 1, %.lr.ph.3 ], [ %ind.end79, %middle.block73 ]
  %.ph94 = phi i32 [ %.promoted.3, %.lr.ph.3 ], [ %101, %middle.block73 ]
  br label %scalar.ph74

scalar.ph74:                                      ; preds = %scalar.ph74.preheader, %scalar.ph74
  %indvars.iv.3 = phi i64 [ %indvars.iv.next.3, %scalar.ph74 ], [ %indvars.iv.3.ph, %scalar.ph74.preheader ]
  %102 = phi i32 [ %106, %scalar.ph74 ], [ %.ph94, %scalar.ph74.preheader ]
  %103 = sub nsw i64 %89, %indvars.iv.3
  %104 = getelementptr inbounds [2501 x i32], ptr @f, i64 0, i64 %103
  %105 = load i32, ptr %104, align 4, !tbaa !5
  %106 = add nsw i32 %102, %105
  store i32 %106, ptr %90, align 4, !tbaa !5
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv.3, 1
  %exitcond.3.not = icmp eq i64 %indvars.iv.next.3, %wide.trip.count.3
  br i1 %exitcond.3.not, label %._crit_edge.3, label %scalar.ph74, !llvm.loop !20

._crit_edge.3:                                    ; preds = %scalar.ph74, %middle.block73, %.lr.ph12.3
  %107 = add nsw i32 %.pre25, -1
  store i32 %107, ptr %1, align 4, !tbaa !5
  %108 = icmp sgt i32 %.pre25, 0
  br i1 %108, label %.lr.ph12.3, label %._crit_edge13.loopexit.3, !llvm.loop !14

._crit_edge13.loopexit.3:                         ; preds = %._crit_edge.3
  %.pre26.pre = load i32, ptr @n, align 4, !tbaa !5
  br label %.split16.us

.split16.us:                                      ; preds = %0, %._crit_edge13.2, %._crit_edge13.loopexit.3, %._crit_edge13.2.thread
  %109 = phi i32 [ %.pre26.pre, %._crit_edge13.loopexit.3 ], [ %.pre24, %._crit_edge13.2 ], [ %.ph, %._crit_edge13.2.thread ], [ %4, %0 ]
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [2501 x i32], ptr @f, i64 0, i64 %110
  %112 = load i32, ptr %111, align 4, !tbaa !5
  %113 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %112)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  ret i32 0
}

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

; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) 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: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #4

attributes #0 = { mustprogress norecurse 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 = { nofree nounwind "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 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10, !12, !11}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10, !11, !12}
!16 = distinct !{!16, !10, !12, !11}
!17 = distinct !{!17, !10, !11, !12}
!18 = distinct !{!18, !10, !12, !11}
!19 = distinct !{!19, !10, !11, !12}
!20 = distinct !{!20, !10, !12, !11}


; Effective O3 passes: DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,PostOrderFunctionAttrsPass,SCCPPass,SROAPass,SimpleLoopUnswitchPass,SimplifyCFGPass,TailCallElimPass