; LLVM IR from tangjz/acm-icpc :: poj (2063)

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

@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@v = external dso_local global i32, align 4
@c = external dso_local global [11 x i32], align 16
@w = external dso_local global [11 x i32], align 16
@f = external dso_local global [45260 x i32], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = 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
  %7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @t)
  br label %8

8:                                                ; preds = %111, %0
  %9 = load i32, ptr @t, align 4, !tbaa !5
  %10 = add nsw i32 %9, -1
  store i32 %10, ptr @t, align 4, !tbaa !5
  %11 = icmp ne i32 %9, 0
  br i1 %11, label %12, label %114

12:                                               ; preds = %8
  %13 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef @v, ptr noundef @m, ptr noundef @n)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %14

14:                                               ; preds = %32, %12
  %15 = load i32, ptr %2, align 4, !tbaa !5
  %16 = load i32, ptr @n, align 4, !tbaa !5
  %17 = icmp slt i32 %15, %16
  br i1 %17, label %19, label %18

18:                                               ; preds = %14
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #4
  br label %35

19:                                               ; preds = %14
  %20 = load i32, ptr %2, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds i32, ptr @c, i64 %21
  %23 = load i32, ptr %2, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds i32, ptr @w, i64 %24
  %26 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef %22, ptr noundef %25)
  %27 = load i32, ptr %2, align 4, !tbaa !5
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [11 x i32], ptr @c, i64 0, i64 %28
  %30 = load i32, ptr %29, align 4, !tbaa !5
  %31 = sdiv i32 %30, 1000
  store i32 %31, ptr %29, align 4, !tbaa !5
  br label %32

32:                                               ; preds = %19
  %33 = load i32, ptr %2, align 4, !tbaa !5
  %34 = add nsw i32 %33, 1
  store i32 %34, ptr %2, align 4, !tbaa !5
  br label %14, !llvm.loop !9

35:                                               ; preds = %18
  br label %36

36:                                               ; preds = %104, %35
  %37 = load i32, ptr @m, align 4, !tbaa !5
  %38 = add nsw i32 %37, -1
  store i32 %38, ptr @m, align 4, !tbaa !5
  %39 = icmp ne i32 %37, 0
  br i1 %39, label %40, label %111

40:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  %41 = load i32, ptr @v, align 4, !tbaa !5
  %42 = sdiv i32 %41, 1000
  store i32 %42, ptr %3, align 4, !tbaa !5
  call void @llvm.memset.p0.i64(ptr align 16 @f, i8 0, i64 181040, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %43

43:                                               ; preds = %101, %40
  %44 = load i32, ptr %4, align 4, !tbaa !5
  %45 = load i32, ptr @n, align 4, !tbaa !5
  %46 = icmp slt i32 %44, %45
  br i1 %46, label %48, label %47

47:                                               ; preds = %43
  store i32 9, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  br label %104

48:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  %49 = load i32, ptr %4, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [11 x i32], ptr @c, i64 0, i64 %50
  %52 = load i32, ptr %51, align 4, !tbaa !5
  store i32 %52, ptr %6, align 4, !tbaa !5
  br label %53

53:                                               ; preds = %97, %48
  %54 = load i32, ptr %6, align 4, !tbaa !5
  %55 = load i32, ptr %3, align 4, !tbaa !5
  %56 = icmp sle i32 %54, %55
  br i1 %56, label %58, label %57

57:                                               ; preds = %53
  store i32 12, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  br label %100

58:                                               ; preds = %53
  %59 = load i32, ptr %6, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [45260 x i32], ptr @f, i64 0, i64 %60
  %62 = load i32, ptr %61, align 4, !tbaa !5
  %63 = load i32, ptr %6, align 4, !tbaa !5
  %64 = load i32, ptr %4, align 4, !tbaa !5
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [11 x i32], ptr @c, i64 0, i64 %65
  %67 = load i32, ptr %66, align 4, !tbaa !5
  %68 = sub nsw i32 %63, %67
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [45260 x i32], ptr @f, i64 0, i64 %69
  %71 = load i32, ptr %70, align 4, !tbaa !5
  %72 = load i32, ptr %4, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [11 x i32], ptr @w, i64 0, i64 %73
  %75 = load i32, ptr %74, align 4, !tbaa !5
  %76 = add nsw i32 %71, %75
  %77 = icmp slt i32 %62, %76
  br i1 %77, label %78, label %96

78:                                               ; preds = %58
  %79 = load i32, ptr %6, align 4, !tbaa !5
  %80 = load i32, ptr %4, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [11 x i32], ptr @c, i64 0, i64 %81
  %83 = load i32, ptr %82, align 4, !tbaa !5
  %84 = sub nsw i32 %79, %83
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [45260 x i32], ptr @f, i64 0, i64 %85
  %87 = load i32, ptr %86, align 4, !tbaa !5
  %88 = load i32, ptr %4, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [11 x i32], ptr @w, i64 0, i64 %89
  %91 = load i32, ptr %90, align 4, !tbaa !5
  %92 = add nsw i32 %87, %91
  %93 = load i32, ptr %6, align 4, !tbaa !5
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [45260 x i32], ptr @f, i64 0, i64 %94
  store i32 %92, ptr %95, align 4, !tbaa !5
  br label %96

96:                                               ; preds = %78, %58
  br label %97

97:                                               ; preds = %96
  %98 = load i32, ptr %6, align 4, !tbaa !5
  %99 = add nsw i32 %98, 1
  store i32 %99, ptr %6, align 4, !tbaa !5
  br label %53, !llvm.loop !11

100:                                              ; preds = %57
  br label %101

101:                                              ; preds = %100
  %102 = load i32, ptr %4, align 4, !tbaa !5
  %103 = add nsw i32 %102, 1
  store i32 %103, ptr %4, align 4, !tbaa !5
  br label %43, !llvm.loop !12

104:                                              ; preds = %47
  %105 = load i32, ptr %3, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [45260 x i32], ptr @f, i64 0, i64 %106
  %108 = load i32, ptr %107, align 4, !tbaa !5
  %109 = load i32, ptr @v, align 4, !tbaa !5
  %110 = add nsw i32 %109, %108
  store i32 %110, ptr @v, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  br label %36, !llvm.loop !13

111:                                              ; preds = %36
  %112 = load i32, ptr @v, align 4, !tbaa !5
  %113 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %112)
  br label %8, !llvm.loop !14

114:                                              ; preds = %8
  ret i32 0
}

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

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

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

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

declare i32 @printf(ptr noundef, ...) #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 = { "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 nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !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"

@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@v = external dso_local global i32, align 4
@c = external dso_local global [11 x i32], align 16
@w = external dso_local global [11 x i32], align 16
@f = external dso_local local_unnamed_addr global [45260 x i32], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress nofree norecurse nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @t)
  %2 = load i32, ptr @t, align 4, !tbaa !5
  %3 = add nsw i32 %2, -1
  store i32 %3, ptr @t, align 4, !tbaa !5
  %.not40 = icmp eq i32 %2, 0
  br i1 %.not40, label %._crit_edge, label %.lr.ph41

.lr.ph41:                                         ; preds = %0, %.preheader._crit_edge
  %4 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @v, ptr noundef nonnull @m, ptr noundef nonnull @n)
  %5 = load i32, ptr @n, align 4, !tbaa !5
  %6 = icmp sgt i32 %5, 0
  br i1 %6, label %.lr.ph, label %.preheader

.preheader:                                       ; preds = %.lr.ph, %.lr.ph41
  %.lcssa = phi i32 [ %5, %.lr.ph41 ], [ %113, %.lr.ph ]
  %m.promoted = load i32, ptr @m, align 4, !tbaa !5
  %7 = add i32 %m.promoted, -1
  %.not2334 = icmp eq i32 %m.promoted, 0
  %.pre = load i32, ptr @v, align 4, !tbaa !5
  br i1 %.not2334, label %.preheader._crit_edge, label %.lr.ph35

.lr.ph35:                                         ; preds = %.preheader
  %8 = icmp sgt i32 %.lcssa, 0
  br i1 %8, label %.lr.ph31.us.preheader, label %.lr.ph35.split.preheader

.lr.ph35.split.preheader:                         ; preds = %.lr.ph35
  %xtraiter = and i32 %m.promoted, 1
  %lcmp.mod.not = icmp eq i32 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.lr.ph35.split.prol.loopexit, label %.lr.ph35.split.prol

.lr.ph35.split.prol:                              ; preds = %.lr.ph35.split.preheader
  %9 = sdiv i32 %.pre, 1000
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(181040) @f, i8 0, i64 181040, i1 false)
  %10 = sext i32 %9 to i64
  %11 = getelementptr inbounds [45260 x i32], ptr @f, i64 0, i64 %10
  %12 = load i32, ptr %11, align 4, !tbaa !5
  %13 = add nsw i32 %12, %.pre
  %14 = add i32 %m.promoted, -2
  br label %.lr.ph35.split.prol.loopexit

.lr.ph35.split.prol.loopexit:                     ; preds = %.lr.ph35.split.prol, %.lr.ph35.split.preheader
  %.lcssa85.unr = phi i32 [ poison, %.lr.ph35.split.preheader ], [ %13, %.lr.ph35.split.prol ]
  %.unr = phi i32 [ %7, %.lr.ph35.split.preheader ], [ %14, %.lr.ph35.split.prol ]
  %.unr87 = phi i32 [ %.pre, %.lr.ph35.split.preheader ], [ %13, %.lr.ph35.split.prol ]
  %15 = icmp eq i32 %7, 0
  br i1 %15, label %._crit_edge36, label %.lr.ph35.split

.lr.ph31.us.preheader:                            ; preds = %.lr.ph35
  %wide.trip.count = zext nneg i32 %.lcssa to i64
  br label %.lr.ph31.us

.lr.ph31.us:                                      ; preds = %.lr.ph31.us.preheader, %._crit_edge32.us
  %16 = phi i32 [ %107, %._crit_edge32.us ], [ %7, %.lr.ph31.us.preheader ]
  %17 = phi i32 [ %106, %._crit_edge32.us ], [ %.pre, %.lr.ph31.us.preheader ]
  %18 = sdiv i32 %17, 1000
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(181040) @f, i8 0, i64 181040, i1 false)
  %19 = add nsw i32 %18, 1
  br label %20

20:                                               ; preds = %.lr.ph31.us, %._crit_edge.us
  %indvars.iv52 = phi i64 [ 0, %.lr.ph31.us ], [ %indvars.iv.next53, %._crit_edge.us ]
  %21 = getelementptr inbounds [11 x i32], ptr @c, i64 0, i64 %indvars.iv52
  %22 = load i32, ptr %21, align 4, !tbaa !5
  %.not2426.us = icmp sgt i32 %22, %18
  br i1 %.not2426.us, label %._crit_edge.us, label %.lr.ph28.us

scalar.ph:                                        ; preds = %scalar.ph.prol.loopexit, %39
  %indvars.iv49 = phi i64 [ %indvars.iv.next50.1, %39 ], [ %indvars.iv49.unr, %scalar.ph.prol.loopexit ]
  %23 = getelementptr inbounds [45260 x i32], ptr @f, i64 0, i64 %indvars.iv49
  %24 = load i32, ptr %23, align 4, !tbaa !5
  %25 = sub nsw i64 %indvars.iv49, %42
  %26 = getelementptr inbounds [45260 x i32], ptr @f, i64 0, i64 %25
  %27 = load i32, ptr %26, align 4, !tbaa !5
  %28 = add nsw i32 %41, %27
  %29 = icmp slt i32 %24, %28
  br i1 %29, label %30, label %scalar.ph.1

30:                                               ; preds = %scalar.ph
  store i32 %28, ptr %23, align 4, !tbaa !5
  br label %scalar.ph.1

scalar.ph.1:                                      ; preds = %30, %scalar.ph
  %indvars.iv.next50 = add nsw i64 %indvars.iv49, 1
  %31 = getelementptr inbounds [45260 x i32], ptr @f, i64 0, i64 %indvars.iv.next50
  %32 = load i32, ptr %31, align 4, !tbaa !5
  %33 = sub nsw i64 %indvars.iv.next50, %42
  %34 = getelementptr inbounds [45260 x i32], ptr @f, i64 0, i64 %33
  %35 = load i32, ptr %34, align 4, !tbaa !5
  %36 = add nsw i32 %41, %35
  %37 = icmp slt i32 %32, %36
  br i1 %37, label %38, label %39

38:                                               ; preds = %scalar.ph.1
  store i32 %36, ptr %31, align 4, !tbaa !5
  br label %39

39:                                               ; preds = %38, %scalar.ph.1
  %indvars.iv.next50.1 = add nsw i64 %indvars.iv49, 2
  %lftr.wideiv.1 = trunc i64 %indvars.iv.next50.1 to i32
  %exitcond.not.1 = icmp eq i32 %19, %lftr.wideiv.1
  br i1 %exitcond.not.1, label %._crit_edge.us, label %scalar.ph, !llvm.loop !9

._crit_edge.us:                                   ; preds = %scalar.ph.prol.loopexit, %39, %middle.block, %20
  %indvars.iv.next53 = add nuw nsw i64 %indvars.iv52, 1
  %exitcond55.not = icmp eq i64 %indvars.iv.next53, %wide.trip.count
  br i1 %exitcond55.not, label %._crit_edge32.us, label %20, !llvm.loop !12

.lr.ph28.us:                                      ; preds = %20
  %40 = getelementptr inbounds [11 x i32], ptr @w, i64 0, i64 %indvars.iv52
  %41 = load i32, ptr %40, align 4, !tbaa !5
  %42 = sext i32 %22 to i64
  %43 = sub i32 %18, %22
  %44 = zext i32 %43 to i64
  %45 = add nuw nsw i64 %44, 1
  %min.iters.check = icmp ult i32 %43, 7
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.memcheck

scalar.ph.preheader:                              ; preds = %middle.block, %vector.memcheck, %.lr.ph28.us
  %indvars.iv49.ph = phi i64 [ %42, %vector.memcheck ], [ %42, %.lr.ph28.us ], [ %ind.end, %middle.block ]
  %46 = trunc i64 %indvars.iv49.ph to i32
  %47 = add i32 %18, %46
  %48 = and i32 %47, 1
  %lcmp.mod89.not.not = icmp eq i32 %48, 0
  br i1 %lcmp.mod89.not.not, label %scalar.ph.prol, label %scalar.ph.prol.loopexit

scalar.ph.prol:                                   ; preds = %scalar.ph.preheader
  %49 = getelementptr inbounds [45260 x i32], ptr @f, i64 0, i64 %indvars.iv49.ph
  %50 = load i32, ptr %49, align 4, !tbaa !5
  %51 = sub nsw i64 %indvars.iv49.ph, %42
  %52 = getelementptr inbounds [45260 x i32], ptr @f, i64 0, i64 %51
  %53 = load i32, ptr %52, align 4, !tbaa !5
  %54 = add nsw i32 %41, %53
  %55 = icmp slt i32 %50, %54
  br i1 %55, label %56, label %scalar.ph.prol.loopexit.unr-lcssa

56:                                               ; preds = %scalar.ph.prol
  store i32 %54, ptr %49, align 4, !tbaa !5
  br label %scalar.ph.prol.loopexit.unr-lcssa

scalar.ph.prol.loopexit.unr-lcssa:                ; preds = %56, %scalar.ph.prol
  %indvars.iv.next50.prol = add nsw i64 %indvars.iv49.ph, 1
  br label %scalar.ph.prol.loopexit

scalar.ph.prol.loopexit:                          ; preds = %scalar.ph.prol.loopexit.unr-lcssa, %scalar.ph.preheader
  %indvars.iv49.unr = phi i64 [ %indvars.iv49.ph, %scalar.ph.preheader ], [ %indvars.iv.next50.prol, %scalar.ph.prol.loopexit.unr-lcssa ]
  %57 = icmp eq i32 %18, %46
  br i1 %57, label %._crit_edge.us, label %scalar.ph

vector.memcheck:                                  ; preds = %.lr.ph28.us
  %58 = shl nsw i64 %42, 2
  %scevgep = getelementptr i8, ptr @f, i64 %58
  %59 = sub i32 %18, %22
  %60 = zext i32 %59 to i64
  %61 = shl nuw nsw i64 %60, 2
  %62 = getelementptr i8, ptr getelementptr inbounds (i8, ptr @f, i64 4), i64 %58
  %scevgep64 = getelementptr i8, ptr %62, i64 %61
  %scevgep65 = getelementptr i8, ptr getelementptr inbounds (i8, ptr @f, i64 4), i64 %61
  %bound0 = icmp ult ptr %scevgep, %scevgep65
  %bound1 = icmp ugt ptr %scevgep64, @f
  %found.conflict = and i1 %bound0, %bound1
  br i1 %found.conflict, label %scalar.ph.preheader, label %vector.ph

vector.ph:                                        ; preds = %vector.memcheck
  %n.vec = and i64 %45, 8589934584
  %ind.end = add nsw i64 %n.vec, %42
  %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %41, i64 0
  %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %pred.store.continue82, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %pred.store.continue82 ]
  %offset.idx = add i64 %index, %42
  %63 = add i64 %offset.idx, 4
  %64 = getelementptr inbounds [45260 x i32], ptr @f, i64 0, i64 %offset.idx
  %65 = getelementptr inbounds i8, ptr %64, i64 16
  %wide.load = load <4 x i32>, ptr %64, align 4, !tbaa !5, !alias.scope !13, !noalias !16
  %wide.load66 = load <4 x i32>, ptr %65, align 4, !tbaa !5, !alias.scope !13, !noalias !16
  %66 = getelementptr inbounds [45260 x i32], ptr @f, i64 0, i64 %index
  %67 = getelementptr inbounds i8, ptr %66, i64 16
  %wide.load67 = load <4 x i32>, ptr %66, align 16, !tbaa !5, !alias.scope !16
  %wide.load68 = load <4 x i32>, ptr %67, align 16, !tbaa !5, !alias.scope !16
  %68 = add nsw <4 x i32> %broadcast.splat, %wide.load67
  %69 = add nsw <4 x i32> %broadcast.splat, %wide.load68
  %70 = icmp slt <4 x i32> %wide.load, %68
  %71 = icmp slt <4 x i32> %wide.load66, %69
  %72 = extractelement <4 x i1> %70, i64 0
  br i1 %72, label %pred.store.if, label %pred.store.continue

pred.store.if:                                    ; preds = %vector.body
  %73 = getelementptr inbounds [45260 x i32], ptr @f, i64 0, i64 %offset.idx
  %74 = extractelement <4 x i32> %68, i64 0
  store i32 %74, ptr %73, align 4, !tbaa !5, !alias.scope !13, !noalias !16
  br label %pred.store.continue

pred.store.continue:                              ; preds = %pred.store.if, %vector.body
  %75 = extractelement <4 x i1> %70, i64 1
  br i1 %75, label %pred.store.if69, label %pred.store.continue70

pred.store.if69:                                  ; preds = %pred.store.continue
  %76 = add i64 %offset.idx, 1
  %77 = getelementptr inbounds [45260 x i32], ptr @f, i64 0, i64 %76
  %78 = extractelement <4 x i32> %68, i64 1
  store i32 %78, ptr %77, align 4, !tbaa !5, !alias.scope !13, !noalias !16
  br label %pred.store.continue70

pred.store.continue70:                            ; preds = %pred.store.if69, %pred.store.continue
  %79 = extractelement <4 x i1> %70, i64 2
  br i1 %79, label %pred.store.if71, label %pred.store.continue72

pred.store.if71:                                  ; preds = %pred.store.continue70
  %80 = add i64 %offset.idx, 2
  %81 = getelementptr inbounds [45260 x i32], ptr @f, i64 0, i64 %80
  %82 = extractelement <4 x i32> %68, i64 2
  store i32 %82, ptr %81, align 4, !tbaa !5, !alias.scope !13, !noalias !16
  br label %pred.store.continue72

pred.store.continue72:                            ; preds = %pred.store.if71, %pred.store.continue70
  %83 = extractelement <4 x i1> %70, i64 3
  br i1 %83, label %pred.store.if73, label %pred.store.continue74

pred.store.if73:                                  ; preds = %pred.store.continue72
  %84 = add i64 %offset.idx, 3
  %85 = getelementptr inbounds [45260 x i32], ptr @f, i64 0, i64 %84
  %86 = extractelement <4 x i32> %68, i64 3
  store i32 %86, ptr %85, align 4, !tbaa !5, !alias.scope !13, !noalias !16
  br label %pred.store.continue74

pred.store.continue74:                            ; preds = %pred.store.if73, %pred.store.continue72
  %87 = extractelement <4 x i1> %71, i64 0
  br i1 %87, label %pred.store.if75, label %pred.store.continue76

pred.store.if75:                                  ; preds = %pred.store.continue74
  %88 = getelementptr inbounds [45260 x i32], ptr @f, i64 0, i64 %63
  %89 = extractelement <4 x i32> %69, i64 0
  store i32 %89, ptr %88, align 4, !tbaa !5, !alias.scope !13, !noalias !16
  br label %pred.store.continue76

pred.store.continue76:                            ; preds = %pred.store.if75, %pred.store.continue74
  %90 = extractelement <4 x i1> %71, i64 1
  br i1 %90, label %pred.store.if77, label %pred.store.continue78

pred.store.if77:                                  ; preds = %pred.store.continue76
  %91 = add i64 %offset.idx, 5
  %92 = getelementptr inbounds [45260 x i32], ptr @f, i64 0, i64 %91
  %93 = extractelement <4 x i32> %69, i64 1
  store i32 %93, ptr %92, align 4, !tbaa !5, !alias.scope !13, !noalias !16
  br label %pred.store.continue78

pred.store.continue78:                            ; preds = %pred.store.if77, %pred.store.continue76
  %94 = extractelement <4 x i1> %71, i64 2
  br i1 %94, label %pred.store.if79, label %pred.store.continue80

pred.store.if79:                                  ; preds = %pred.store.continue78
  %95 = add i64 %offset.idx, 6
  %96 = getelementptr inbounds [45260 x i32], ptr @f, i64 0, i64 %95
  %97 = extractelement <4 x i32> %69, i64 2
  store i32 %97, ptr %96, align 4, !tbaa !5, !alias.scope !13, !noalias !16
  br label %pred.store.continue80

pred.store.continue80:                            ; preds = %pred.store.if79, %pred.store.continue78
  %98 = extractelement <4 x i1> %71, i64 3
  br i1 %98, label %pred.store.if81, label %pred.store.continue82

pred.store.if81:                                  ; preds = %pred.store.continue80
  %99 = add i64 %offset.idx, 7
  %100 = getelementptr inbounds [45260 x i32], ptr @f, i64 0, i64 %99
  %101 = extractelement <4 x i32> %69, i64 3
  store i32 %101, ptr %100, align 4, !tbaa !5, !alias.scope !13, !noalias !16
  br label %pred.store.continue82

pred.store.continue82:                            ; preds = %pred.store.if81, %pred.store.continue80
  %index.next = add nuw i64 %index, 8
  %102 = icmp eq i64 %index.next, %n.vec
  br i1 %102, label %middle.block, label %vector.body, !llvm.loop !18

middle.block:                                     ; preds = %pred.store.continue82
  %cmp.n = icmp eq i64 %45, %n.vec
  br i1 %cmp.n, label %._crit_edge.us, label %scalar.ph.preheader

._crit_edge32.us:                                 ; preds = %._crit_edge.us
  %103 = sext i32 %18 to i64
  %104 = getelementptr inbounds [45260 x i32], ptr @f, i64 0, i64 %103
  %105 = load i32, ptr %104, align 4, !tbaa !5
  %106 = add nsw i32 %105, %17
  %107 = add nsw i32 %16, -1
  %.not23.us = icmp eq i32 %16, 0
  br i1 %.not23.us, label %._crit_edge36, label %.lr.ph31.us, !llvm.loop !20

.lr.ph:                                           ; preds = %.lr.ph41, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.lr.ph41 ]
  %108 = getelementptr inbounds i32, ptr @c, i64 %indvars.iv
  %109 = getelementptr inbounds i32, ptr @w, i64 %indvars.iv
  %110 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %108, ptr noundef nonnull %109)
  %111 = load i32, ptr %108, align 4, !tbaa !5
  %112 = sdiv i32 %111, 1000
  store i32 %112, ptr %108, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %113 = load i32, ptr @n, align 4, !tbaa !5
  %114 = sext i32 %113 to i64
  %115 = icmp slt i64 %indvars.iv.next, %114
  br i1 %115, label %.lr.ph, label %.preheader, !llvm.loop !21

.lr.ph35.split:                                   ; preds = %.lr.ph35.split.prol.loopexit, %.lr.ph35.split
  %116 = phi i32 [ %128, %.lr.ph35.split ], [ %.unr, %.lr.ph35.split.prol.loopexit ]
  %117 = phi i32 [ %127, %.lr.ph35.split ], [ %.unr87, %.lr.ph35.split.prol.loopexit ]
  %118 = sdiv i32 %117, 1000
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(181040) @f, i8 0, i64 181040, i1 false)
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [45260 x i32], ptr @f, i64 0, i64 %119
  %121 = load i32, ptr %120, align 4, !tbaa !5
  %122 = add nsw i32 %121, %117
  %123 = sdiv i32 %122, 1000
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(181040) @f, i8 0, i64 181040, i1 false)
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds [45260 x i32], ptr @f, i64 0, i64 %124
  %126 = load i32, ptr %125, align 4, !tbaa !5
  %127 = add nsw i32 %126, %122
  %128 = add nsw i32 %116, -2
  %.not23.1 = icmp eq i32 %116, 1
  br i1 %.not23.1, label %._crit_edge36, label %.lr.ph35.split, !llvm.loop !20

._crit_edge36:                                    ; preds = %.lr.ph35.split.prol.loopexit, %.lr.ph35.split, %._crit_edge32.us
  %.us-phi = phi i32 [ %106, %._crit_edge32.us ], [ %.lcssa85.unr, %.lr.ph35.split.prol.loopexit ], [ %127, %.lr.ph35.split ]
  store i32 %.us-phi, ptr @v, align 4, !tbaa !5
  br label %.preheader._crit_edge

.preheader._crit_edge:                            ; preds = %.preheader, %._crit_edge36
  %129 = phi i32 [ %.us-phi, %._crit_edge36 ], [ %.pre, %.preheader ]
  store i32 -1, ptr @m, align 4, !tbaa !5
  %130 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %129)
  %131 = load i32, ptr @t, align 4, !tbaa !5
  %132 = add nsw i32 %131, -1
  store i32 %132, ptr @t, align 4, !tbaa !5
  %.not = icmp eq i32 %131, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph41, !llvm.loop !22

._crit_edge:                                      ; preds = %.preheader._crit_edge, %0
  ret i32 0
}

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

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

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

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

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10, !11}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = distinct !{!12, !10}
!13 = !{!14}
!14 = distinct !{!14, !15}
!15 = distinct !{!15, !"LVerDomain"}
!16 = !{!17}
!17 = distinct !{!17, !15}
!18 = distinct !{!18, !10, !11, !19}
!19 = !{!"llvm.loop.unroll.runtime.disable"}
!20 = distinct !{!20, !10}
!21 = distinct !{!21, !10}
!22 = distinct !{!22, !10}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass