; LLVM IR from tangjz/acm-icpc :: self_training/2014-12-26 (F)

; 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
@aa = external dso_local global i32, align 4
@bb = external dso_local global i32, align 4
@a = external dso_local global [101 x i32], align 16
@b = external dso_local global [101 x i32], align 16
@f = external dso_local global [1001 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 [14 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [3 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
  %7 = alloca i32, align 4
  %8 = alloca i8, align 1
  %9 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  store i32 0, ptr %2, align 4, !tbaa !5
  %10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @t)
  br label %11

11:                                               ; preds = %125, %0
  %12 = load i32, ptr @t, align 4, !tbaa !5
  %13 = add nsw i32 %12, -1
  store i32 %13, ptr @t, align 4, !tbaa !5
  %14 = icmp ne i32 %12, 0
  br i1 %14, label %15, label %133

15:                                               ; preds = %11
  call void @llvm.memset.p0.i64(ptr align 16 @f, i8 0, i64 4004, i1 false)
  %16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef @aa, ptr noundef @bb, ptr noundef @n)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %17

17:                                               ; preds = %27, %15
  %18 = load i32, ptr %3, align 4, !tbaa !5
  %19 = load i32, ptr @n, align 4, !tbaa !5
  %20 = icmp sle i32 %18, %19
  br i1 %20, label %22, label %21

21:                                               ; preds = %17
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  br label %30

22:                                               ; preds = %17
  %23 = load i32, ptr %3, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds i32, ptr @a, i64 %24
  %26 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %25)
  br label %27

27:                                               ; preds = %22
  %28 = load i32, ptr %3, align 4, !tbaa !5
  %29 = add nsw i32 %28, 1
  store i32 %29, ptr %3, align 4, !tbaa !5
  br label %17, !llvm.loop !9

30:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  store i32 1, ptr %4, align 4, !tbaa !5
  br label %31

31:                                               ; preds = %41, %30
  %32 = load i32, ptr %4, align 4, !tbaa !5
  %33 = load i32, ptr @n, align 4, !tbaa !5
  %34 = icmp sle i32 %32, %33
  br i1 %34, label %36, label %35

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

36:                                               ; preds = %31
  %37 = load i32, ptr %4, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds i32, ptr @b, i64 %38
  %40 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %39)
  br label %41

41:                                               ; preds = %36
  %42 = load i32, ptr %4, align 4, !tbaa !5
  %43 = add nsw i32 %42, 1
  store i32 %43, ptr %4, align 4, !tbaa !5
  br label %31, !llvm.loop !11

44:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  store i32 1, ptr %5, align 4, !tbaa !5
  br label %45

45:                                               ; preds = %103, %44
  %46 = load i32, ptr %5, align 4, !tbaa !5
  %47 = load i32, ptr @n, align 4, !tbaa !5
  %48 = icmp sle i32 %46, %47
  br i1 %48, label %50, label %49

49:                                               ; preds = %45
  store i32 10, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  br label %106

50:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  %51 = load i32, ptr @aa, align 4, !tbaa !5
  store i32 %51, ptr %7, align 4, !tbaa !5
  br label %52

52:                                               ; preds = %99, %50
  %53 = load i32, ptr %7, align 4, !tbaa !5
  %54 = load i32, ptr %5, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [101 x i32], ptr @a, i64 0, i64 %55
  %57 = load i32, ptr %56, align 4, !tbaa !5
  %58 = icmp sge i32 %53, %57
  br i1 %58, label %60, label %59

59:                                               ; preds = %52
  store i32 13, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %102

60:                                               ; preds = %52
  %61 = load i32, ptr %7, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [1001 x i32], ptr @f, i64 0, i64 %62
  %64 = load i32, ptr %63, align 4, !tbaa !5
  %65 = load i32, ptr %7, align 4, !tbaa !5
  %66 = load i32, ptr %5, align 4, !tbaa !5
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [101 x i32], ptr @a, i64 0, i64 %67
  %69 = load i32, ptr %68, align 4, !tbaa !5
  %70 = sub nsw i32 %65, %69
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [1001 x i32], ptr @f, i64 0, i64 %71
  %73 = load i32, ptr %72, align 4, !tbaa !5
  %74 = load i32, ptr %5, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [101 x i32], ptr @b, i64 0, i64 %75
  %77 = load i32, ptr %76, align 4, !tbaa !5
  %78 = add nsw i32 %73, %77
  %79 = icmp slt i32 %64, %78
  br i1 %79, label %80, label %98

80:                                               ; preds = %60
  %81 = load i32, ptr %7, align 4, !tbaa !5
  %82 = load i32, ptr %5, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [101 x i32], ptr @a, i64 0, i64 %83
  %85 = load i32, ptr %84, align 4, !tbaa !5
  %86 = sub nsw i32 %81, %85
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [1001 x i32], ptr @f, i64 0, i64 %87
  %89 = load i32, ptr %88, align 4, !tbaa !5
  %90 = load i32, ptr %5, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [101 x i32], ptr @b, i64 0, i64 %91
  %93 = load i32, ptr %92, align 4, !tbaa !5
  %94 = add nsw i32 %89, %93
  %95 = load i32, ptr %7, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [1001 x i32], ptr @f, i64 0, i64 %96
  store i32 %94, ptr %97, align 4, !tbaa !5
  br label %98

98:                                               ; preds = %80, %60
  br label %99

99:                                               ; preds = %98
  %100 = load i32, ptr %7, align 4, !tbaa !5
  %101 = add nsw i32 %100, -1
  store i32 %101, ptr %7, align 4, !tbaa !5
  br label %52, !llvm.loop !12

102:                                              ; preds = %59
  br label %103

103:                                              ; preds = %102
  %104 = load i32, ptr %5, align 4, !tbaa !5
  %105 = add nsw i32 %104, 1
  store i32 %105, ptr %5, align 4, !tbaa !5
  br label %45, !llvm.loop !13

106:                                              ; preds = %49
  call void @llvm.lifetime.start.p0(i64 1, ptr %8) #4
  store i8 0, ptr %8, align 1, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %107

107:                                              ; preds = %121, %106
  %108 = load i32, ptr %9, align 4, !tbaa !5
  %109 = load i32, ptr @aa, align 4, !tbaa !5
  %110 = icmp sle i32 %108, %109
  br i1 %110, label %112, label %111

111:                                              ; preds = %107
  store i32 16, ptr %6, align 4
  br label %124

112:                                              ; preds = %107
  %113 = load i32, ptr %9, align 4, !tbaa !5
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [1001 x i32], ptr @f, i64 0, i64 %114
  %116 = load i32, ptr %115, align 4, !tbaa !5
  %117 = load i32, ptr @bb, align 4, !tbaa !5
  %118 = icmp sge i32 %116, %117
  br i1 %118, label %119, label %120

119:                                              ; preds = %112
  store i8 1, ptr %8, align 1, !tbaa !14
  store i32 16, ptr %6, align 4
  br label %124

120:                                              ; preds = %112
  br label %121

121:                                              ; preds = %120
  %122 = load i32, ptr %9, align 4, !tbaa !5
  %123 = add nsw i32 %122, 1
  store i32 %123, ptr %9, align 4, !tbaa !5
  br label %107, !llvm.loop !16

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

125:                                              ; preds = %124
  %126 = load i32, ptr %2, align 4, !tbaa !5
  %127 = add nsw i32 %126, 1
  store i32 %127, ptr %2, align 4, !tbaa !5
  %128 = load i8, ptr %8, align 1, !tbaa !14, !range !17, !noundef !18
  %129 = trunc i8 %128 to i1
  %130 = zext i1 %129 to i64
  %131 = select i1 %129, ptr @.str.3, ptr @.str.4
  %132 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %127, ptr noundef %131)
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #4
  br label %11, !llvm.loop !19

133:                                              ; preds = %11
  store i32 0, ptr %1, align 4
  store i32 1, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #4
  %134 = load i32, ptr %1, align 4
  ret i32 %134
}

; 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: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

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

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

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 = { 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 = !{!15, !15, i64 0}
!15 = !{!"bool", !7, i64 0}
!16 = distinct !{!16, !10}
!17 = !{i8 0, i8 2}
!18 = !{}
!19 = distinct !{!19, !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
@aa = external dso_local global i32, align 4
@bb = external dso_local global i32, align 4
@a = external dso_local global [101 x i32], align 16
@b = external dso_local global [101 x i32], align 16
@f = external dso_local local_unnamed_addr global [1001 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 [14 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [3 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
  %.not59 = icmp eq i32 %2, 0
  br i1 %.not59, label %._crit_edge63, label %.lr.ph62

.lr.ph62:                                         ; preds = %0, %._crit_edge55
  %.03060 = phi i32 [ %95, %._crit_edge55 ], [ 0, %0 ]
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4004) @f, i8 0, i64 4004, i1 false)
  %4 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @aa, ptr noundef nonnull @bb, ptr noundef nonnull @n)
  %5 = load i32, ptr @n, align 4, !tbaa !5
  %.not3341 = icmp slt i32 %5, 1
  br i1 %.not3341, label %.preheader39.thread, label %.lr.ph

.preheader40:                                     ; preds = %.lr.ph
  %.not3443 = icmp slt i32 %8, 1
  br i1 %.not3443, label %.preheader39.thread, label %.lr.ph45

.lr.ph:                                           ; preds = %.lr.ph62, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %.lr.ph62 ]
  %6 = getelementptr inbounds i32, ptr @a, i64 %indvars.iv
  %7 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %6)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %8 = load i32, ptr @n, align 4, !tbaa !5
  %9 = sext i32 %8 to i64
  %.not33.not = icmp slt i64 %indvars.iv, %9
  br i1 %.not33.not, label %.lr.ph, label %.preheader40, !llvm.loop !9

.preheader39.thread:                              ; preds = %.preheader40, %.lr.ph62
  %.pre83 = load i32, ptr @aa, align 4, !tbaa !5
  br label %.preheader

.preheader39:                                     ; preds = %.lr.ph45
  %.not3549 = icmp slt i32 %17, 1
  %.pre = load i32, ptr @aa, align 4, !tbaa !5
  br i1 %.not3549, label %.preheader, label %.lr.ph51

.lr.ph51:                                         ; preds = %.preheader39
  %10 = sext i32 %.pre to i64
  %11 = add nuw i32 %17, 1
  %wide.trip.count = zext i32 %11 to i64
  %12 = shl nsw i64 %10, 2
  %scevgep = getelementptr i8, ptr @f, i64 %12
  %scevgep87 = getelementptr i8, ptr @f, i64 %12
  %13 = shl nsw i64 %10, 2
  %scevgep93 = getelementptr i8, ptr getelementptr inbounds (i8, ptr @f, i64 4), i64 %13
  %scevgep94 = getelementptr i8, ptr getelementptr inbounds (i8, ptr @f, i64 4), i64 %13
  %14 = add nsw i64 %10, 1
  %bound1 = icmp ugt ptr %scevgep93, @f
  br label %21

.lr.ph45:                                         ; preds = %.preheader40, %.lr.ph45
  %indvars.iv66 = phi i64 [ %indvars.iv.next67, %.lr.ph45 ], [ 1, %.preheader40 ]
  %15 = getelementptr inbounds i32, ptr @b, i64 %indvars.iv66
  %16 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %15)
  %indvars.iv.next67 = add nuw nsw i64 %indvars.iv66, 1
  %17 = load i32, ptr @n, align 4, !tbaa !5
  %18 = sext i32 %17 to i64
  %.not34.not = icmp slt i64 %indvars.iv66, %18
  br i1 %.not34.not, label %.lr.ph45, label %.preheader39, !llvm.loop !11

.preheader:                                       ; preds = %._crit_edge, %.preheader39.thread, %.preheader39
  %.pre84 = phi i32 [ %.pre83, %.preheader39.thread ], [ %.pre, %.preheader39 ], [ %.pre, %._crit_edge ]
  %.not36.not52 = icmp slt i32 %.pre84, 0
  br i1 %.not36.not52, label %._crit_edge55, label %.lr.ph54

.lr.ph54:                                         ; preds = %.preheader
  %19 = load i32, ptr @bb, align 4, !tbaa !5
  %20 = add nuw i32 %.pre84, 1
  %wide.trip.count78 = zext i32 %20 to i64
  br label %91

21:                                               ; preds = %.lr.ph51, %._crit_edge
  %indvars.iv72 = phi i64 [ 1, %.lr.ph51 ], [ %indvars.iv.next73, %._crit_edge ]
  %22 = getelementptr inbounds [101 x i32], ptr @a, i64 0, i64 %indvars.iv72
  %23 = load i32, ptr %22, align 4, !tbaa !5
  %.not3846 = icmp slt i32 %.pre, %23
  br i1 %.not3846, label %._crit_edge, label %.lr.ph48

.lr.ph48:                                         ; preds = %21
  %24 = getelementptr inbounds [101 x i32], ptr @b, i64 0, i64 %indvars.iv72
  %25 = load i32, ptr %24, align 4, !tbaa !5
  %26 = sext i32 %23 to i64
  %27 = sub nsw i64 %14, %26
  %min.iters.check = icmp ult i64 %27, 28
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.scevcheck

scalar.ph.preheader:                              ; preds = %middle.block, %vector.memcheck, %vector.scevcheck, %.lr.ph48
  %indvars.iv69.ph = phi i64 [ %10, %vector.memcheck ], [ %10, %vector.scevcheck ], [ %10, %.lr.ph48 ], [ %ind.end, %middle.block ]
  br label %scalar.ph

vector.scevcheck:                                 ; preds = %.lr.ph48
  %28 = sub nsw i64 %10, %26
  %mul.result.neg = mul nsw i64 %28, -4
  %29 = getelementptr i8, ptr %scevgep, i64 %mul.result.neg
  %30 = icmp ugt ptr %29, %scevgep
  %31 = mul nsw i64 %26, -4
  %scevgep88 = getelementptr i8, ptr %scevgep87, i64 %31
  %mul.result90.neg = mul nsw i64 %28, -4
  %mul.overflow91 = icmp ugt i64 %28, 4611686018427387903
  %32 = getelementptr i8, ptr %scevgep88, i64 %mul.result90.neg
  %33 = icmp ugt ptr %32, %scevgep88
  %34 = or i1 %33, %mul.overflow91
  %35 = or i1 %30, %34
  br i1 %35, label %scalar.ph.preheader, label %vector.memcheck

vector.memcheck:                                  ; preds = %vector.scevcheck
  %36 = shl nsw i64 %26, 2
  %scevgep92 = getelementptr i8, ptr @f, i64 %36
  %37 = mul nsw i64 %26, -4
  %scevgep95 = getelementptr i8, ptr %scevgep94, i64 %37
  %bound0 = icmp ult ptr %scevgep92, %scevgep95
  %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 %27, -8
  %ind.end = sub nsw i64 %10, %n.vec
  %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %25, 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.continue115, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %pred.store.continue115 ]
  %offset.idx = sub i64 %10, %index
  %38 = add i64 %offset.idx, -4
  %39 = getelementptr inbounds [1001 x i32], ptr @f, i64 0, i64 %offset.idx
  %40 = getelementptr inbounds i8, ptr %39, i64 -12
  %41 = getelementptr inbounds i8, ptr %39, i64 -28
  %wide.load = load <4 x i32>, ptr %40, align 4, !tbaa !5, !alias.scope !12, !noalias !15
  %reverse = shufflevector <4 x i32> %wide.load, <4 x i32> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
  %wide.load96 = load <4 x i32>, ptr %41, align 4, !tbaa !5, !alias.scope !12, !noalias !15
  %reverse97 = shufflevector <4 x i32> %wide.load96, <4 x i32> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
  %42 = sub nsw i64 %offset.idx, %26
  %43 = getelementptr inbounds [1001 x i32], ptr @f, i64 0, i64 %42
  %44 = getelementptr inbounds i8, ptr %43, i64 -12
  %45 = getelementptr inbounds i8, ptr %43, i64 -28
  %wide.load98 = load <4 x i32>, ptr %44, align 4, !tbaa !5, !alias.scope !15
  %reverse99 = shufflevector <4 x i32> %wide.load98, <4 x i32> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
  %wide.load100 = load <4 x i32>, ptr %45, align 4, !tbaa !5, !alias.scope !15
  %reverse101 = shufflevector <4 x i32> %wide.load100, <4 x i32> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
  %46 = add nsw <4 x i32> %broadcast.splat, %reverse99
  %47 = add nsw <4 x i32> %broadcast.splat, %reverse101
  %48 = icmp slt <4 x i32> %reverse, %46
  %49 = icmp slt <4 x i32> %reverse97, %47
  %50 = extractelement <4 x i1> %48, i64 0
  br i1 %50, label %pred.store.if, label %pred.store.continue

pred.store.if:                                    ; preds = %vector.body
  %51 = getelementptr inbounds [1001 x i32], ptr @f, i64 0, i64 %offset.idx
  %52 = extractelement <4 x i32> %46, i64 0
  store i32 %52, ptr %51, align 4, !tbaa !5, !alias.scope !12, !noalias !15
  br label %pred.store.continue

pred.store.continue:                              ; preds = %pred.store.if, %vector.body
  %53 = extractelement <4 x i1> %48, i64 1
  br i1 %53, label %pred.store.if102, label %pred.store.continue103

pred.store.if102:                                 ; preds = %pred.store.continue
  %54 = add i64 %offset.idx, -1
  %55 = getelementptr inbounds [1001 x i32], ptr @f, i64 0, i64 %54
  %56 = extractelement <4 x i32> %46, i64 1
  store i32 %56, ptr %55, align 4, !tbaa !5, !alias.scope !12, !noalias !15
  br label %pred.store.continue103

pred.store.continue103:                           ; preds = %pred.store.if102, %pred.store.continue
  %57 = extractelement <4 x i1> %48, i64 2
  br i1 %57, label %pred.store.if104, label %pred.store.continue105

pred.store.if104:                                 ; preds = %pred.store.continue103
  %58 = add i64 %offset.idx, -2
  %59 = getelementptr inbounds [1001 x i32], ptr @f, i64 0, i64 %58
  %60 = extractelement <4 x i32> %46, i64 2
  store i32 %60, ptr %59, align 4, !tbaa !5, !alias.scope !12, !noalias !15
  br label %pred.store.continue105

pred.store.continue105:                           ; preds = %pred.store.if104, %pred.store.continue103
  %61 = extractelement <4 x i1> %48, i64 3
  br i1 %61, label %pred.store.if106, label %pred.store.continue107

pred.store.if106:                                 ; preds = %pred.store.continue105
  %62 = add i64 %offset.idx, -3
  %63 = getelementptr inbounds [1001 x i32], ptr @f, i64 0, i64 %62
  %64 = extractelement <4 x i32> %46, i64 3
  store i32 %64, ptr %63, align 4, !tbaa !5, !alias.scope !12, !noalias !15
  br label %pred.store.continue107

pred.store.continue107:                           ; preds = %pred.store.if106, %pred.store.continue105
  %65 = extractelement <4 x i1> %49, i64 0
  br i1 %65, label %pred.store.if108, label %pred.store.continue109

pred.store.if108:                                 ; preds = %pred.store.continue107
  %66 = getelementptr inbounds [1001 x i32], ptr @f, i64 0, i64 %38
  %67 = extractelement <4 x i32> %47, i64 0
  store i32 %67, ptr %66, align 4, !tbaa !5, !alias.scope !12, !noalias !15
  br label %pred.store.continue109

pred.store.continue109:                           ; preds = %pred.store.if108, %pred.store.continue107
  %68 = extractelement <4 x i1> %49, i64 1
  br i1 %68, label %pred.store.if110, label %pred.store.continue111

pred.store.if110:                                 ; preds = %pred.store.continue109
  %69 = add i64 %offset.idx, -5
  %70 = getelementptr inbounds [1001 x i32], ptr @f, i64 0, i64 %69
  %71 = extractelement <4 x i32> %47, i64 1
  store i32 %71, ptr %70, align 4, !tbaa !5, !alias.scope !12, !noalias !15
  br label %pred.store.continue111

pred.store.continue111:                           ; preds = %pred.store.if110, %pred.store.continue109
  %72 = extractelement <4 x i1> %49, i64 2
  br i1 %72, label %pred.store.if112, label %pred.store.continue113

pred.store.if112:                                 ; preds = %pred.store.continue111
  %73 = add i64 %offset.idx, -6
  %74 = getelementptr inbounds [1001 x i32], ptr @f, i64 0, i64 %73
  %75 = extractelement <4 x i32> %47, i64 2
  store i32 %75, ptr %74, align 4, !tbaa !5, !alias.scope !12, !noalias !15
  br label %pred.store.continue113

pred.store.continue113:                           ; preds = %pred.store.if112, %pred.store.continue111
  %76 = extractelement <4 x i1> %49, i64 3
  br i1 %76, label %pred.store.if114, label %pred.store.continue115

pred.store.if114:                                 ; preds = %pred.store.continue113
  %77 = add i64 %offset.idx, -7
  %78 = getelementptr inbounds [1001 x i32], ptr @f, i64 0, i64 %77
  %79 = extractelement <4 x i32> %47, i64 3
  store i32 %79, ptr %78, align 4, !tbaa !5, !alias.scope !12, !noalias !15
  br label %pred.store.continue115

pred.store.continue115:                           ; preds = %pred.store.if114, %pred.store.continue113
  %index.next = add nuw i64 %index, 8
  %80 = icmp eq i64 %index.next, %n.vec
  br i1 %80, label %middle.block, label %vector.body, !llvm.loop !17

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

._crit_edge:                                      ; preds = %89, %middle.block, %21
  %indvars.iv.next73 = add nuw nsw i64 %indvars.iv72, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next73, %wide.trip.count
  br i1 %exitcond.not, label %.preheader, label %21, !llvm.loop !20

scalar.ph:                                        ; preds = %scalar.ph.preheader, %89
  %indvars.iv69 = phi i64 [ %indvars.iv.next70, %89 ], [ %indvars.iv69.ph, %scalar.ph.preheader ]
  %81 = getelementptr inbounds [1001 x i32], ptr @f, i64 0, i64 %indvars.iv69
  %82 = load i32, ptr %81, align 4, !tbaa !5
  %83 = sub nsw i64 %indvars.iv69, %26
  %84 = getelementptr inbounds [1001 x i32], ptr @f, i64 0, i64 %83
  %85 = load i32, ptr %84, align 4, !tbaa !5
  %86 = add nsw i32 %25, %85
  %87 = icmp slt i32 %82, %86
  br i1 %87, label %88, label %89

88:                                               ; preds = %scalar.ph
  store i32 %86, ptr %81, align 4, !tbaa !5
  br label %89

89:                                               ; preds = %scalar.ph, %88
  %indvars.iv.next70 = add nsw i64 %indvars.iv69, -1
  %.not38.not = icmp sgt i64 %indvars.iv69, %26
  br i1 %.not38.not, label %scalar.ph, label %._crit_edge, !llvm.loop !21

90:                                               ; preds = %91
  %indvars.iv.next76 = add nuw nsw i64 %indvars.iv75, 1
  %exitcond79.not = icmp eq i64 %indvars.iv.next76, %wide.trip.count78
  br i1 %exitcond79.not, label %._crit_edge55, label %91, !llvm.loop !22

91:                                               ; preds = %.lr.ph54, %90
  %indvars.iv75 = phi i64 [ 0, %.lr.ph54 ], [ %indvars.iv.next76, %90 ]
  %92 = getelementptr inbounds [1001 x i32], ptr @f, i64 0, i64 %indvars.iv75
  %93 = load i32, ptr %92, align 4, !tbaa !5
  %.not37 = icmp slt i32 %93, %19
  br i1 %.not37, label %90, label %._crit_edge55

._crit_edge55:                                    ; preds = %90, %91, %.preheader
  %94 = phi ptr [ @.str.4, %.preheader ], [ @.str.3, %91 ], [ @.str.4, %90 ]
  %95 = add nuw nsw i32 %.03060, 1
  %96 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %95, ptr noundef nonnull %94)
  %97 = load i32, ptr @t, align 4, !tbaa !5
  %98 = add nsw i32 %97, -1
  store i32 %98, ptr @t, align 4, !tbaa !5
  %.not = icmp eq i32 %97, 0
  br i1 %.not, label %._crit_edge63, label %.lr.ph62, !llvm.loop !23

._crit_edge63:                                    ; preds = %._crit_edge55, %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}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = !{!13}
!13 = distinct !{!13, !14}
!14 = distinct !{!14, !"LVerDomain"}
!15 = !{!16}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !10, !18, !19}
!18 = !{!"llvm.loop.isvectorized", i32 1}
!19 = !{!"llvm.loop.unroll.runtime.disable"}
!20 = distinct !{!20, !10}
!21 = distinct !{!21, !10, !18}
!22 = distinct !{!22, !10}
!23 = distinct !{!23, !10}


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