; LLVM IR from tangjz/acm-icpc :: buaa/oj3rd (1135)

; 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
@k = external dso_local global i32, align 4
@x = external dso_local global i32, align 4
@f = external dso_local global [33 x [23 x i32]], align 16
@.str = external hidden unnamed_addr constant [7 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
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  br label %11

11:                                               ; preds = %139, %0
  %12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @k, ptr noundef @x, ptr noundef @n)
  %13 = icmp eq i32 %12, 3
  br i1 %13, label %14, label %140

14:                                               ; preds = %11
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #3
  store i32 0, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #3
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %15

15:                                               ; preds = %36, %14
  %16 = load i32, ptr %3, align 4, !tbaa !5
  %17 = load i32, ptr @k, align 4, !tbaa !5
  %18 = icmp slt i32 %16, %17
  br i1 %18, label %20, label %19

19:                                               ; preds = %15
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #3
  br label %39

20:                                               ; preds = %15
  %21 = load i32, ptr @x, align 4, !tbaa !5
  %22 = and i32 %21, 1
  %23 = load i32, ptr %3, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds [23 x i32], ptr @f, i64 0, i64 %24
  store i32 %22, ptr %25, align 4, !tbaa !5
  %26 = load i32, ptr %3, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [23 x i32], ptr @f, i64 0, i64 %27
  %29 = load i32, ptr %28, align 4, !tbaa !5
  %30 = icmp eq i32 %29, 1
  %31 = zext i1 %30 to i32
  %32 = load i32, ptr %2, align 4, !tbaa !5
  %33 = add nsw i32 %32, %31
  store i32 %33, ptr %2, align 4, !tbaa !5
  %34 = load i32, ptr @x, align 4, !tbaa !5
  %35 = ashr i32 %34, 1
  store i32 %35, ptr @x, align 4, !tbaa !5
  br label %36

36:                                               ; preds = %20
  %37 = load i32, ptr %3, align 4, !tbaa !5
  %38 = add nsw i32 %37, 1
  store i32 %38, ptr %3, align 4, !tbaa !5
  br label %15, !llvm.loop !9

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

40:                                               ; preds = %136, %39
  %41 = load i32, ptr %4, align 4, !tbaa !5
  %42 = load i32, ptr @n, align 4, !tbaa !5
  %43 = icmp sle i32 %41, %42
  br i1 %43, label %45, label %44

44:                                               ; preds = %40
  store i32 7, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #3
  br label %139

45:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #3
  store i32 0, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  store i32 0, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %46

46:                                               ; preds = %66, %45
  %47 = load i32, ptr %8, align 4, !tbaa !5
  %48 = load i32, ptr @k, align 4, !tbaa !5
  %49 = icmp slt i32 %47, %48
  br i1 %49, label %51, label %50

50:                                               ; preds = %46
  store i32 10, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  br label %69

51:                                               ; preds = %46
  %52 = load i32, ptr %4, align 4, !tbaa !5
  %53 = sub nsw i32 %52, 1
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [33 x [23 x i32]], ptr @f, i64 0, i64 %54
  %56 = load i32, ptr %8, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [23 x i32], ptr %55, i64 0, i64 %57
  %59 = load i32, ptr %58, align 4, !tbaa !5
  %60 = load i32, ptr %4, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [33 x [23 x i32]], ptr @f, i64 0, i64 %61
  %63 = load i32, ptr %8, align 4, !tbaa !5
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [23 x i32], ptr %62, i64 0, i64 %64
  store i32 %59, ptr %65, align 4, !tbaa !5
  br label %66

66:                                               ; preds = %51
  %67 = load i32, ptr %8, align 4, !tbaa !5
  %68 = add nsw i32 %67, 1
  store i32 %68, ptr %8, align 4, !tbaa !5
  br label %46, !llvm.loop !11

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

70:                                               ; preds = %103, %69
  %71 = load i32, ptr %9, align 4, !tbaa !5
  %72 = load i32, ptr @k, align 4, !tbaa !5
  %73 = icmp slt i32 %71, %72
  br i1 %73, label %75, label %74

74:                                               ; preds = %70
  store i32 13, ptr %5, align 4
  br label %106

75:                                               ; preds = %70
  %76 = load i32, ptr %4, align 4, !tbaa !5
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [33 x [23 x i32]], ptr @f, i64 0, i64 %77
  %79 = load i32, ptr %9, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [23 x i32], ptr %78, i64 0, i64 %80
  %82 = load i32, ptr %81, align 4, !tbaa !5
  %83 = icmp eq i32 %82, 1
  br i1 %83, label %84, label %93

84:                                               ; preds = %75
  %85 = load i32, ptr %4, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [33 x [23 x i32]], ptr @f, i64 0, i64 %86
  %88 = load i32, ptr %9, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [23 x i32], ptr %87, i64 0, i64 %89
  store i32 0, ptr %90, align 4, !tbaa !5
  %91 = load i32, ptr %6, align 4, !tbaa !5
  %92 = add nsw i32 %91, 1
  store i32 %92, ptr %6, align 4, !tbaa !5
  br label %102

93:                                               ; preds = %75
  %94 = load i32, ptr %4, align 4, !tbaa !5
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [33 x [23 x i32]], ptr @f, i64 0, i64 %95
  %97 = load i32, ptr %9, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [23 x i32], ptr %96, i64 0, i64 %98
  store i32 1, ptr %99, align 4, !tbaa !5
  %100 = load i32, ptr %6, align 4, !tbaa !5
  %101 = add nsw i32 %100, 1
  store i32 %101, ptr %6, align 4, !tbaa !5
  store i32 13, ptr %5, align 4
  br label %106

102:                                              ; preds = %84
  br label %103

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

106:                                              ; preds = %93, %74
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  br label %107

107:                                              ; preds = %106
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %108

108:                                              ; preds = %125, %107
  %109 = load i32, ptr %10, align 4, !tbaa !5
  %110 = load i32, ptr @k, align 4, !tbaa !5
  %111 = icmp slt i32 %109, %110
  br i1 %111, label %113, label %112

112:                                              ; preds = %108
  store i32 16, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  br label %128

113:                                              ; preds = %108
  %114 = load i32, ptr %4, align 4, !tbaa !5
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [33 x [23 x i32]], ptr @f, i64 0, i64 %115
  %117 = load i32, ptr %10, align 4, !tbaa !5
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [23 x i32], ptr %116, i64 0, i64 %118
  %120 = load i32, ptr %119, align 4, !tbaa !5
  %121 = icmp eq i32 %120, 1
  %122 = zext i1 %121 to i32
  %123 = load i32, ptr %7, align 4, !tbaa !5
  %124 = add nsw i32 %123, %122
  store i32 %124, ptr %7, align 4, !tbaa !5
  br label %125

125:                                              ; preds = %113
  %126 = load i32, ptr %10, align 4, !tbaa !5
  %127 = add nsw i32 %126, 1
  store i32 %127, ptr %10, align 4, !tbaa !5
  br label %108, !llvm.loop !13

128:                                              ; preds = %112
  %129 = load i32, ptr %6, align 4, !tbaa !5
  %130 = load i32, ptr %7, align 4, !tbaa !5
  %131 = add nsw i32 %129, %130
  %132 = load i32, ptr %2, align 4, !tbaa !5
  %133 = sub nsw i32 %131, %132
  %134 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %133)
  %135 = load i32, ptr %7, align 4, !tbaa !5
  store i32 %135, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  br label %136

136:                                              ; preds = %128
  %137 = load i32, ptr %4, align 4, !tbaa !5
  %138 = add nsw i32 %137, 1
  store i32 %138, ptr %4, align 4, !tbaa !5
  br label %40, !llvm.loop !14

139:                                              ; preds = %44
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #3
  br label %11, !llvm.loop !15

140:                                              ; preds = %11
  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

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 = { 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}
!15 = distinct !{!15, !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
@k = external dso_local global i32, align 4
@x = external dso_local global i32, align 4
@f = external dso_local local_unnamed_addr global [33 x [23 x i32]], align 16
@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.1 = 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 @k, ptr noundef nonnull @x, ptr noundef nonnull @n)
  %2 = icmp eq i32 %1, 3
  br i1 %2, label %.preheader43, label %._crit_edge63

.loopexit42:                                      ; preds = %._crit_edge, %.preheader41
  %3 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @k, ptr noundef nonnull @x, ptr noundef nonnull @n)
  %4 = icmp eq i32 %3, 3
  br i1 %4, label %.preheader43, label %._crit_edge63, !llvm.loop !5

.preheader43:                                     ; preds = %0, %.loopexit42
  %5 = load i32, ptr @k, align 4, !tbaa !7
  %6 = icmp sgt i32 %5, 0
  br i1 %6, label %.lr.ph.preheader, label %.preheader41

.lr.ph.preheader:                                 ; preds = %.preheader43
  %x.promoted = load i32, ptr @x, align 4, !tbaa !7
  %wide.trip.count = zext nneg i32 %5 to i64
  %xtraiter = and i64 %wide.trip.count, 3
  %7 = icmp ult i32 %5, 4
  br i1 %7, label %..preheader41_crit_edge.unr-lcssa, label %.lr.ph.preheader.new

.lr.ph.preheader.new:                             ; preds = %.lr.ph.preheader
  %unroll_iter = and i64 %wide.trip.count, 2147483644
  br label %.lr.ph

..preheader41_crit_edge.unr-lcssa:                ; preds = %.lr.ph, %.lr.ph.preheader
  %.lcssa106.ph = phi i32 [ poison, %.lr.ph.preheader ], [ %29, %.lr.ph ]
  %.lcssa.ph = phi i32 [ poison, %.lr.ph.preheader ], [ %30, %.lr.ph ]
  %indvars.iv.unr = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next.3, %.lr.ph ]
  %.03846.unr = phi i32 [ 0, %.lr.ph.preheader ], [ %29, %.lr.ph ]
  %.unr = phi i32 [ %x.promoted, %.lr.ph.preheader ], [ %30, %.lr.ph ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %..preheader41_crit_edge, label %.lr.ph.epil

.lr.ph.epil:                                      ; preds = %..preheader41_crit_edge.unr-lcssa, %.lr.ph.epil
  %indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %.lr.ph.epil ], [ %indvars.iv.unr, %..preheader41_crit_edge.unr-lcssa ]
  %.03846.epil = phi i32 [ %11, %.lr.ph.epil ], [ %.03846.unr, %..preheader41_crit_edge.unr-lcssa ]
  %8 = phi i32 [ %12, %.lr.ph.epil ], [ %.unr, %..preheader41_crit_edge.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph.epil ], [ 0, %..preheader41_crit_edge.unr-lcssa ]
  %9 = and i32 %8, 1
  %10 = getelementptr inbounds [23 x i32], ptr @f, i64 0, i64 %indvars.iv.epil
  store i32 %9, ptr %10, align 4, !tbaa !7
  %11 = add nuw nsw i32 %9, %.03846.epil
  %12 = ashr i32 %8, 1
  %indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %..preheader41_crit_edge, label %.lr.ph.epil, !llvm.loop !11

..preheader41_crit_edge:                          ; preds = %.lr.ph.epil, %..preheader41_crit_edge.unr-lcssa
  %.lcssa106 = phi i32 [ %.lcssa106.ph, %..preheader41_crit_edge.unr-lcssa ], [ %11, %.lr.ph.epil ]
  %.lcssa = phi i32 [ %.lcssa.ph, %..preheader41_crit_edge.unr-lcssa ], [ %12, %.lr.ph.epil ]
  store i32 %.lcssa, ptr @x, align 4, !tbaa !7
  br label %.preheader41

.preheader41:                                     ; preds = %..preheader41_crit_edge, %.preheader43
  %.038.lcssa = phi i32 [ %.lcssa106, %..preheader41_crit_edge ], [ 0, %.preheader43 ]
  %13 = load i32, ptr @n, align 4, !tbaa !7
  %.not60 = icmp slt i32 %13, 1
  br i1 %.not60, label %.loopexit42, label %.preheader40

.lr.ph:                                           ; preds = %.lr.ph, %.lr.ph.preheader.new
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader.new ], [ %indvars.iv.next.3, %.lr.ph ]
  %.03846 = phi i32 [ 0, %.lr.ph.preheader.new ], [ %29, %.lr.ph ]
  %14 = phi i32 [ %x.promoted, %.lr.ph.preheader.new ], [ %30, %.lr.ph ]
  %niter = phi i64 [ 0, %.lr.ph.preheader.new ], [ %niter.next.3, %.lr.ph ]
  %15 = and i32 %14, 1
  %16 = getelementptr inbounds [23 x i32], ptr @f, i64 0, i64 %indvars.iv
  store i32 %15, ptr %16, align 16, !tbaa !7
  %17 = add nuw nsw i32 %15, %.03846
  %18 = lshr i32 %14, 1
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %19 = and i32 %18, 1
  %20 = getelementptr inbounds [23 x i32], ptr @f, i64 0, i64 %indvars.iv.next
  store i32 %19, ptr %20, align 4, !tbaa !7
  %21 = add nuw nsw i32 %19, %17
  %22 = lshr i32 %14, 2
  %indvars.iv.next.1 = or disjoint i64 %indvars.iv, 2
  %23 = and i32 %22, 1
  %24 = getelementptr inbounds [23 x i32], ptr @f, i64 0, i64 %indvars.iv.next.1
  store i32 %23, ptr %24, align 8, !tbaa !7
  %25 = add nuw nsw i32 %23, %21
  %26 = lshr i32 %14, 3
  %indvars.iv.next.2 = or disjoint i64 %indvars.iv, 3
  %27 = and i32 %26, 1
  %28 = getelementptr inbounds [23 x i32], ptr @f, i64 0, i64 %indvars.iv.next.2
  store i32 %27, ptr %28, align 4, !tbaa !7
  %29 = add nuw nsw i32 %27, %25
  %30 = ashr i32 %14, 4
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %..preheader41_crit_edge.unr-lcssa, label %.lr.ph, !llvm.loop !13

.preheader40:                                     ; preds = %.preheader41, %._crit_edge
  %indvars.iv89 = phi i64 [ %indvars.iv.next90, %._crit_edge ], [ 1, %.preheader41 ]
  %.13961 = phi i32 [ %.034.lcssa, %._crit_edge ], [ %.038.lcssa, %.preheader41 ]
  %31 = load i32, ptr @k, align 4, !tbaa !7
  %32 = icmp sgt i32 %31, 0
  br i1 %32, label %.lr.ph50, label %._crit_edge

.lr.ph50:                                         ; preds = %.preheader40
  %33 = add nsw i64 %indvars.iv89, -1
  %wide.trip.count75 = zext nneg i32 %31 to i64
  %xtraiter115 = and i64 %wide.trip.count75, 3
  %34 = icmp ult i32 %31, 4
  br i1 %34, label %.preheader.unr-lcssa, label %.lr.ph50.new

.lr.ph50.new:                                     ; preds = %.lr.ph50
  %unroll_iter118 = and i64 %wide.trip.count75, 2147483644
  br label %38

.preheader.unr-lcssa:                             ; preds = %38, %.lr.ph50
  %indvars.iv72.unr = phi i64 [ 0, %.lr.ph50 ], [ %indvars.iv.next73.3, %38 ]
  %lcmp.mod117.not = icmp eq i64 %xtraiter115, 0
  br i1 %lcmp.mod117.not, label %.preheader, label %.epil.preheader

.epil.preheader:                                  ; preds = %.preheader.unr-lcssa, %.epil.preheader
  %indvars.iv72.epil = phi i64 [ %indvars.iv.next73.epil, %.epil.preheader ], [ %indvars.iv72.unr, %.preheader.unr-lcssa ]
  %epil.iter116 = phi i64 [ %epil.iter116.next, %.epil.preheader ], [ 0, %.preheader.unr-lcssa ]
  %35 = getelementptr inbounds [33 x [23 x i32]], ptr @f, i64 0, i64 %33, i64 %indvars.iv72.epil
  %36 = load i32, ptr %35, align 4, !tbaa !7
  %37 = getelementptr inbounds [33 x [23 x i32]], ptr @f, i64 0, i64 %indvars.iv89, i64 %indvars.iv72.epil
  store i32 %36, ptr %37, align 4, !tbaa !7
  %indvars.iv.next73.epil = add nuw nsw i64 %indvars.iv72.epil, 1
  %epil.iter116.next = add i64 %epil.iter116, 1
  %epil.iter116.cmp.not = icmp eq i64 %epil.iter116.next, %xtraiter115
  br i1 %epil.iter116.cmp.not, label %.preheader, label %.epil.preheader, !llvm.loop !14

.preheader:                                       ; preds = %.epil.preheader, %.preheader.unr-lcssa
  br i1 %32, label %.lr.ph54, label %._crit_edge

.lr.ph54:                                         ; preds = %.preheader
  %wide.trip.count82 = zext nneg i32 %31 to i64
  br label %51

38:                                               ; preds = %38, %.lr.ph50.new
  %indvars.iv72 = phi i64 [ 0, %.lr.ph50.new ], [ %indvars.iv.next73.3, %38 ]
  %niter119 = phi i64 [ 0, %.lr.ph50.new ], [ %niter119.next.3, %38 ]
  %39 = getelementptr inbounds [33 x [23 x i32]], ptr @f, i64 0, i64 %33, i64 %indvars.iv72
  %40 = load i32, ptr %39, align 4, !tbaa !7
  %41 = getelementptr inbounds [33 x [23 x i32]], ptr @f, i64 0, i64 %indvars.iv89, i64 %indvars.iv72
  store i32 %40, ptr %41, align 4, !tbaa !7
  %indvars.iv.next73 = or disjoint i64 %indvars.iv72, 1
  %42 = getelementptr inbounds [33 x [23 x i32]], ptr @f, i64 0, i64 %33, i64 %indvars.iv.next73
  %43 = load i32, ptr %42, align 4, !tbaa !7
  %44 = getelementptr inbounds [33 x [23 x i32]], ptr @f, i64 0, i64 %indvars.iv89, i64 %indvars.iv.next73
  store i32 %43, ptr %44, align 4, !tbaa !7
  %indvars.iv.next73.1 = or disjoint i64 %indvars.iv72, 2
  %45 = getelementptr inbounds [33 x [23 x i32]], ptr @f, i64 0, i64 %33, i64 %indvars.iv.next73.1
  %46 = load i32, ptr %45, align 4, !tbaa !7
  %47 = getelementptr inbounds [33 x [23 x i32]], ptr @f, i64 0, i64 %indvars.iv89, i64 %indvars.iv.next73.1
  store i32 %46, ptr %47, align 4, !tbaa !7
  %indvars.iv.next73.2 = or disjoint i64 %indvars.iv72, 3
  %48 = getelementptr inbounds [33 x [23 x i32]], ptr @f, i64 0, i64 %33, i64 %indvars.iv.next73.2
  %49 = load i32, ptr %48, align 4, !tbaa !7
  %50 = getelementptr inbounds [33 x [23 x i32]], ptr @f, i64 0, i64 %indvars.iv89, i64 %indvars.iv.next73.2
  store i32 %49, ptr %50, align 4, !tbaa !7
  %indvars.iv.next73.3 = add nuw nsw i64 %indvars.iv72, 4
  %niter119.next.3 = add i64 %niter119, 4
  %niter119.ncmp.3 = icmp eq i64 %niter119.next.3, %unroll_iter118
  br i1 %niter119.ncmp.3, label %.preheader.unr-lcssa, label %38, !llvm.loop !15

51:                                               ; preds = %.lr.ph54, %55
  %indvars.iv77 = phi i64 [ 0, %.lr.ph54 ], [ %indvars.iv.next78, %55 ]
  %52 = getelementptr inbounds [33 x [23 x i32]], ptr @f, i64 0, i64 %indvars.iv89, i64 %indvars.iv77
  %53 = load i32, ptr %52, align 4, !tbaa !7
  %54 = icmp eq i32 %53, 1
  br i1 %54, label %55, label %56

55:                                               ; preds = %51
  store i32 0, ptr %52, align 4, !tbaa !7
  %indvars.iv.next78 = add nuw nsw i64 %indvars.iv77, 1
  %exitcond83.not = icmp eq i64 %indvars.iv.next78, %wide.trip.count82
  br i1 %exitcond83.not, label %.loopexit, label %51, !llvm.loop !16

56:                                               ; preds = %51
  %indvars81 = trunc i64 %indvars.iv77 to i32
  store i32 1, ptr %52, align 4, !tbaa !7
  %57 = add nuw nsw i32 %indvars81, 1
  br label %.loopexit

.loopexit:                                        ; preds = %55, %56
  %.1 = phi i32 [ %57, %56 ], [ %31, %55 ]
  br i1 %32, label %.lr.ph58, label %._crit_edge

.lr.ph58:                                         ; preds = %.loopexit
  %wide.trip.count87 = zext nneg i32 %31 to i64
  %min.iters.check = icmp ult i32 %31, 8
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

scalar.ph.preheader:                              ; preds = %middle.block, %.lr.ph58
  %indvars.iv84.ph = phi i64 [ 0, %.lr.ph58 ], [ %n.vec, %middle.block ]
  %.03456.ph = phi i32 [ 0, %.lr.ph58 ], [ %67, %middle.block ]
  br label %scalar.ph

vector.ph:                                        ; preds = %.lr.ph58
  %n.vec = and i64 %wide.trip.count75, 2147483640
  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> [ zeroinitializer, %vector.ph ], [ %64, %vector.body ]
  %vec.phi104 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %65, %vector.body ]
  %58 = getelementptr inbounds [33 x [23 x i32]], ptr @f, i64 0, i64 %indvars.iv89, i64 %index
  %59 = getelementptr inbounds i8, ptr %58, i64 16
  %wide.load = load <4 x i32>, ptr %58, align 4, !tbaa !7
  %wide.load105 = load <4 x i32>, ptr %59, align 4, !tbaa !7
  %60 = icmp eq <4 x i32> %wide.load, <i32 1, i32 1, i32 1, i32 1>
  %61 = icmp eq <4 x i32> %wide.load105, <i32 1, i32 1, i32 1, i32 1>
  %62 = zext <4 x i1> %60 to <4 x i32>
  %63 = zext <4 x i1> %61 to <4 x i32>
  %64 = add <4 x i32> %vec.phi, %62
  %65 = add <4 x i32> %vec.phi104, %63
  %index.next = add nuw i64 %index, 8
  %66 = icmp eq i64 %index.next, %n.vec
  br i1 %66, label %middle.block, label %vector.body, !llvm.loop !17

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <4 x i32> %65, %64
  %67 = tail call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count75
  br i1 %cmp.n, label %._crit_edge, label %scalar.ph.preheader

._crit_edge:                                      ; preds = %scalar.ph, %middle.block, %.preheader40, %.preheader, %.loopexit
  %.193 = phi i32 [ %.1, %.loopexit ], [ 0, %.preheader ], [ 0, %.preheader40 ], [ %.1, %middle.block ], [ %.1, %scalar.ph ]
  %.034.lcssa = phi i32 [ 0, %.loopexit ], [ 0, %.preheader ], [ 0, %.preheader40 ], [ %67, %middle.block ], [ %77, %scalar.ph ]
  %68 = sub i32 %.193, %.13961
  %69 = add i32 %68, %.034.lcssa
  %70 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %69)
  %indvars.iv.next90 = add nuw nsw i64 %indvars.iv89, 1
  %71 = load i32, ptr @n, align 4, !tbaa !7
  %72 = sext i32 %71 to i64
  %.not.not = icmp slt i64 %indvars.iv89, %72
  br i1 %.not.not, label %.preheader40, label %.loopexit42, !llvm.loop !20

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv84 = phi i64 [ %indvars.iv.next85, %scalar.ph ], [ %indvars.iv84.ph, %scalar.ph.preheader ]
  %.03456 = phi i32 [ %77, %scalar.ph ], [ %.03456.ph, %scalar.ph.preheader ]
  %73 = getelementptr inbounds [33 x [23 x i32]], ptr @f, i64 0, i64 %indvars.iv89, i64 %indvars.iv84
  %74 = load i32, ptr %73, align 4, !tbaa !7
  %75 = icmp eq i32 %74, 1
  %76 = zext i1 %75 to i32
  %77 = add nuw nsw i32 %.03456, %76
  %indvars.iv.next85 = add nuw nsw i64 %indvars.iv84, 1
  %exitcond88.not = icmp eq i64 %indvars.iv.next85, %wide.trip.count87
  br i1 %exitcond88.not, label %._crit_edge, label %scalar.ph, !llvm.loop !21

._crit_edge63:                                    ; preds = %.loopexit42, %0
  ret i32 0
}

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #2

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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }

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


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