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

; 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
@m = external dso_local global i32, align 4
@f = external dso_local global [2 x [4096 x i32]], align 16
@cur = external dso_local global i32, align 4
@pre = external dso_local global i32, align 4
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = 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
  %11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @m)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %12

12:                                               ; preds = %25, %0
  %13 = load i32, ptr %2, align 4, !tbaa !5
  %14 = load i32, ptr @m, align 4, !tbaa !5
  %15 = shl i32 1, %14
  %16 = icmp slt i32 %13, %15
  br i1 %16, label %18, label %17

17:                                               ; preds = %12
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #4
  br label %28

18:                                               ; preds = %12
  %19 = load i32, ptr @cur, align 4, !tbaa !5
  %20 = sext i32 %19 to i64
  %21 = getelementptr inbounds [2 x [4096 x i32]], ptr @f, i64 0, i64 %20
  %22 = load i32, ptr %2, align 4, !tbaa !5
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds [4096 x i32], ptr %21, i64 0, i64 %23
  store i32 1, ptr %24, align 4, !tbaa !5
  br label %25

25:                                               ; preds = %18
  %26 = load i32, ptr %2, align 4, !tbaa !5
  %27 = add nsw i32 %26, 1
  store i32 %27, ptr %2, align 4, !tbaa !5
  br label %12, !llvm.loop !9

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

29:                                               ; preds = %162, %28
  %30 = load i32, ptr %3, align 4, !tbaa !5
  %31 = load i32, ptr @n, align 4, !tbaa !5
  %32 = icmp slt i32 %30, %31
  br i1 %32, label %34, label %33

33:                                               ; preds = %29
  store i32 5, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  br label %165

34:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  store i32 0, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  store i32 0, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  br label %35

35:                                               ; preds = %47, %34
  %36 = load i32, ptr %6, align 4, !tbaa !5
  %37 = load i32, ptr @m, align 4, !tbaa !5
  %38 = icmp slt i32 %36, %37
  br i1 %38, label %40, label %39

39:                                               ; preds = %35
  store i32 8, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  br label %50

40:                                               ; preds = %35
  %41 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %7)
  %42 = load i32, ptr %7, align 4, !tbaa !5
  %43 = load i32, ptr %6, align 4, !tbaa !5
  %44 = shl i32 %42, %43
  %45 = load i32, ptr %5, align 4, !tbaa !5
  %46 = or i32 %45, %44
  store i32 %46, ptr %5, align 4, !tbaa !5
  br label %47

47:                                               ; preds = %40
  %48 = load i32, ptr %6, align 4, !tbaa !5
  %49 = add nsw i32 %48, 1
  store i32 %49, ptr %6, align 4, !tbaa !5
  br label %35, !llvm.loop !11

50:                                               ; preds = %39
  %51 = load i32, ptr @cur, align 4, !tbaa !5
  %52 = xor i32 %51, 1
  store i32 %52, ptr @cur, align 4, !tbaa !5
  %53 = load i32, ptr @pre, align 4, !tbaa !5
  %54 = xor i32 %53, 1
  store i32 %54, ptr @pre, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %55

55:                                               ; preds = %90, %50
  %56 = load i32, ptr %8, align 4, !tbaa !5
  %57 = load i32, ptr @m, align 4, !tbaa !5
  %58 = shl i32 1, %57
  %59 = icmp slt i32 %56, %58
  br i1 %59, label %61, label %60

60:                                               ; preds = %55
  store i32 11, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  br label %93

61:                                               ; preds = %55
  %62 = load i32, ptr %8, align 4, !tbaa !5
  %63 = load i32, ptr %5, align 4, !tbaa !5
  %64 = and i32 %62, %63
  %65 = load i32, ptr %8, align 4, !tbaa !5
  %66 = icmp eq i32 %64, %65
  br i1 %66, label %67, label %81

67:                                               ; preds = %61
  %68 = load i32, ptr %8, align 4, !tbaa !5
  %69 = load i32, ptr %8, align 4, !tbaa !5
  %70 = ashr i32 %69, 1
  %71 = and i32 %68, %70
  %72 = icmp ne i32 %71, 0
  br i1 %72, label %81, label %73

73:                                               ; preds = %67
  %74 = load i32, ptr @pre, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [2 x [4096 x i32]], ptr @f, i64 0, i64 %75
  %77 = load i32, ptr %8, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [4096 x i32], ptr %76, i64 0, i64 %78
  %80 = load i32, ptr %79, align 4, !tbaa !5
  br label %82

81:                                               ; preds = %67, %61
  br label %82

82:                                               ; preds = %81, %73
  %83 = phi i32 [ %80, %73 ], [ 0, %81 ]
  %84 = load i32, ptr @cur, align 4, !tbaa !5
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [2 x [4096 x i32]], ptr @f, i64 0, i64 %85
  %87 = load i32, ptr %8, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [4096 x i32], ptr %86, i64 0, i64 %88
  store i32 %83, ptr %89, align 4, !tbaa !5
  br label %90

90:                                               ; preds = %82
  %91 = load i32, ptr %8, align 4, !tbaa !5
  %92 = add nsw i32 %91, 1
  store i32 %92, ptr %8, align 4, !tbaa !5
  br label %55, !llvm.loop !12

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

94:                                               ; preds = %146, %93
  %95 = load i32, ptr %9, align 4, !tbaa !5
  %96 = load i32, ptr @m, align 4, !tbaa !5
  %97 = icmp slt i32 %95, %96
  br i1 %97, label %99, label %98

98:                                               ; preds = %94
  store i32 14, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  br label %149

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

100:                                              ; preds = %142, %99
  %101 = load i32, ptr %10, align 4, !tbaa !5
  %102 = load i32, ptr @m, align 4, !tbaa !5
  %103 = shl i32 1, %102
  %104 = icmp slt i32 %101, %103
  br i1 %104, label %106, label %105

105:                                              ; preds = %100
  store i32 17, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  br label %145

106:                                              ; preds = %100
  %107 = load i32, ptr %10, align 4, !tbaa !5
  %108 = load i32, ptr %9, align 4, !tbaa !5
  %109 = shl i32 1, %108
  %110 = and i32 %107, %109
  %111 = icmp ne i32 %110, 0
  br i1 %111, label %112, label %141

112:                                              ; preds = %106
  %113 = load i32, ptr @cur, align 4, !tbaa !5
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [2 x [4096 x i32]], ptr @f, i64 0, i64 %114
  %116 = load i32, ptr %10, align 4, !tbaa !5
  %117 = load i32, ptr %9, align 4, !tbaa !5
  %118 = shl i32 1, %117
  %119 = xor i32 %116, %118
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds [4096 x i32], ptr %115, i64 0, i64 %120
  %122 = load i32, ptr %121, align 4, !tbaa !5
  %123 = load i32, ptr @cur, align 4, !tbaa !5
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds [2 x [4096 x i32]], ptr @f, i64 0, i64 %124
  %126 = load i32, ptr %10, align 4, !tbaa !5
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds [4096 x i32], ptr %125, i64 0, i64 %127
  %129 = load i32, ptr %128, align 4, !tbaa !5
  %130 = add nsw i32 %129, %122
  store i32 %130, ptr %128, align 4, !tbaa !5
  %131 = icmp sge i32 %130, 1000000000
  br i1 %131, label %132, label %141

132:                                              ; preds = %112
  %133 = load i32, ptr @cur, align 4, !tbaa !5
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds [2 x [4096 x i32]], ptr @f, i64 0, i64 %134
  %136 = load i32, ptr %10, align 4, !tbaa !5
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds [4096 x i32], ptr %135, i64 0, i64 %137
  %139 = load i32, ptr %138, align 4, !tbaa !5
  %140 = sub nsw i32 %139, 1000000000
  store i32 %140, ptr %138, align 4, !tbaa !5
  br label %141

141:                                              ; preds = %132, %112, %106
  br label %142

142:                                              ; preds = %141
  %143 = load i32, ptr %10, align 4, !tbaa !5
  %144 = add nsw i32 %143, 1
  store i32 %144, ptr %10, align 4, !tbaa !5
  br label %100, !llvm.loop !13

145:                                              ; preds = %105
  br label %146

146:                                              ; preds = %145
  %147 = load i32, ptr %9, align 4, !tbaa !5
  %148 = add nsw i32 %147, 1
  store i32 %148, ptr %9, align 4, !tbaa !5
  br label %94, !llvm.loop !14

149:                                              ; preds = %98
  %150 = load i32, ptr @cur, align 4, !tbaa !5
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds [2 x [4096 x i32]], ptr @f, i64 0, i64 %151
  %153 = getelementptr inbounds [4096 x i32], ptr %152, i64 0, i64 0
  %154 = load i32, ptr @cur, align 4, !tbaa !5
  %155 = sext i32 %154 to i64
  %156 = getelementptr inbounds [2 x [4096 x i32]], ptr @f, i64 0, i64 %155
  %157 = getelementptr inbounds [4096 x i32], ptr %156, i64 0, i64 0
  %158 = load i32, ptr @m, align 4, !tbaa !5
  %159 = shl i32 1, %158
  %160 = sext i32 %159 to i64
  %161 = getelementptr inbounds i32, ptr %157, i64 %160
  call void @_ZSt7reverseIPiEvT_S1_(ptr noundef %153, ptr noundef %161)
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  br label %162

162:                                              ; preds = %149
  %163 = load i32, ptr %3, align 4, !tbaa !5
  %164 = add nsw i32 %163, 1
  store i32 %164, ptr %3, align 4, !tbaa !5
  br label %29, !llvm.loop !15

165:                                              ; preds = %33
  %166 = load i32, ptr @cur, align 4, !tbaa !5
  %167 = sext i32 %166 to i64
  %168 = getelementptr inbounds [2 x [4096 x i32]], ptr @f, i64 0, i64 %167
  %169 = getelementptr inbounds [4096 x i32], ptr %168, i64 0, i64 0
  %170 = load i32, ptr %169, align 16, !tbaa !5
  %171 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %170)
  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: inlinehint mustprogress uwtable
declare dso_local void @_ZSt7reverseIPiEvT_S1_(ptr noundef, ptr noundef) #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 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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}
!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
@m = external dso_local global i32, align 4
@f = external dso_local global [2 x [4096 x i32]], align 16
@cur = external dso_local local_unnamed_addr global i32, align 4
@pre = external dso_local local_unnamed_addr global i32, align 4
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @m)
  %3 = load i32, ptr @m, align 4, !tbaa !5
  %.not = icmp eq i32 %3, 31
  br i1 %.not, label %.preheader37, label %.lr.ph

.lr.ph:                                           ; preds = %0
  %4 = shl nuw nsw i32 1, %3
  %5 = load i32, ptr @cur, align 4, !tbaa !5
  %6 = sext i32 %5 to i64
  %wide.trip.count = zext nneg i32 %4 to i64
  %min.iters.check = icmp ult i32 %3, 3
  br i1 %min.iters.check, label %scalar.ph, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph
  %n.vec = and i64 %wide.trip.count, 2147483640
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %7 = getelementptr inbounds [2 x [4096 x i32]], ptr @f, i64 0, i64 %6, i64 %index
  %8 = getelementptr inbounds i8, ptr %7, i64 16
  store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %7, align 16, !tbaa !5
  store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %8, align 16, !tbaa !5
  %index.next = add nuw i64 %index, 8
  %9 = icmp eq i64 %index.next, %n.vec
  br i1 %9, label %.preheader37, label %vector.body, !llvm.loop !9

.preheader37:                                     ; preds = %vector.body, %scalar.ph, %0
  %10 = load i32, ptr @n, align 4, !tbaa !5
  %11 = icmp sgt i32 %10, 0
  br i1 %11, label %.lr.ph54, label %._crit_edge55

scalar.ph:                                        ; preds = %.lr.ph, %scalar.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %scalar.ph ], [ 0, %.lr.ph ]
  %12 = getelementptr inbounds [2 x [4096 x i32]], ptr @f, i64 0, i64 %6, i64 %indvars.iv
  store i32 1, ptr %12, 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 %.preheader37, label %scalar.ph, !llvm.loop !13

._crit_edge55:                                    ; preds = %._crit_edge52, %.preheader37
  %13 = load i32, ptr @cur, align 4, !tbaa !5
  %14 = sext i32 %13 to i64
  %15 = getelementptr inbounds [2 x [4096 x i32]], ptr @f, i64 0, i64 %14
  %16 = load i32, ptr %15, align 16, !tbaa !5
  %17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %16)
  ret i32 0

.lr.ph54:                                         ; preds = %.preheader37, %._crit_edge52
  %.03253 = phi i32 [ %71, %._crit_edge52 ], [ 0, %.preheader37 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  %18 = load i32, ptr @m, align 4, !tbaa !5
  %19 = icmp sgt i32 %18, 0
  br i1 %19, label %.lr.ph42, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph42, %.lr.ph54
  %.031.lcssa = phi i32 [ 0, %.lr.ph54 ], [ %31, %.lr.ph42 ]
  %.lcssa = phi i32 [ %18, %.lr.ph54 ], [ %33, %.lr.ph42 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  %20 = load i32, ptr @cur, align 4, !tbaa !5
  %21 = xor i32 %20, 1
  store i32 %21, ptr @cur, align 4, !tbaa !5
  %22 = load i32, ptr @pre, align 4, !tbaa !5
  %23 = xor i32 %22, 1
  store i32 %23, ptr @pre, align 4, !tbaa !5
  %24 = shl nuw i32 1, %.lcssa
  %.not56 = icmp eq i32 %.lcssa, 31
  br i1 %.not56, label %.preheader.lr.ph.thread, label %.lr.ph46

.preheader.lr.ph.thread:                          ; preds = %._crit_edge
  %25 = sext i32 %21 to i64
  br label %._crit_edge52

.lr.ph46:                                         ; preds = %._crit_edge
  %26 = sext i32 %23 to i64
  %27 = sext i32 %21 to i64
  %smax65 = call i32 @llvm.smax.i32(i32 %24, i32 1)
  %wide.trip.count66 = zext nneg i32 %smax65 to i64
  br label %54

.lr.ph42:                                         ; preds = %.lr.ph54, %.lr.ph42
  %.03041 = phi i32 [ %32, %.lr.ph42 ], [ 0, %.lr.ph54 ]
  %.03140 = phi i32 [ %31, %.lr.ph42 ], [ 0, %.lr.ph54 ]
  %28 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %1)
  %29 = load i32, ptr %1, align 4, !tbaa !5
  %30 = shl i32 %29, %.03041
  %31 = or i32 %30, %.03140
  %32 = add nuw nsw i32 %.03041, 1
  %33 = load i32, ptr @m, align 4, !tbaa !5
  %34 = icmp slt i32 %32, %33
  br i1 %34, label %.lr.ph42, label %._crit_edge, !llvm.loop !14

.preheader36:                                     ; preds = %65
  %35 = icmp slt i32 %.lcssa, 1
  %36 = sext i32 %21 to i64
  %brmerge = or i1 %35, %.not56
  br i1 %brmerge, label %._crit_edge52, label %.preheader.us.preheader

.preheader.us.preheader:                          ; preds = %.preheader36
  %smax71 = call i32 @llvm.smax.i32(i32 %24, i32 1)
  %wide.trip.count72 = zext nneg i32 %smax71 to i64
  br label %.preheader.us

.preheader.us:                                    ; preds = %.preheader.us.preheader, %._crit_edge50.us
  %.02851.us = phi i32 [ %53, %._crit_edge50.us ], [ 0, %.preheader.us.preheader ]
  %37 = shl nuw i32 1, %.02851.us
  br label %38

38:                                               ; preds = %.preheader.us, %52
  %indvars.iv68 = phi i64 [ 0, %.preheader.us ], [ %indvars.iv.next69, %52 ]
  %39 = trunc nuw nsw i64 %indvars.iv68 to i32
  %40 = and i32 %37, %39
  %.not.us = icmp eq i32 %40, 0
  br i1 %.not.us, label %52, label %41

41:                                               ; preds = %38
  %42 = xor i32 %37, %39
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds [2 x [4096 x i32]], ptr @f, i64 0, i64 %36, i64 %43
  %45 = load i32, ptr %44, align 4, !tbaa !5
  %46 = getelementptr inbounds [2 x [4096 x i32]], ptr @f, i64 0, i64 %36, i64 %indvars.iv68
  %47 = load i32, ptr %46, align 4, !tbaa !5
  %48 = add nsw i32 %47, %45
  store i32 %48, ptr %46, align 4, !tbaa !5
  %49 = icmp sgt i32 %48, 999999999
  br i1 %49, label %50, label %52

50:                                               ; preds = %41
  %51 = add nsw i32 %48, -1000000000
  store i32 %51, ptr %46, align 4, !tbaa !5
  br label %52

52:                                               ; preds = %50, %41, %38
  %indvars.iv.next69 = add nuw nsw i64 %indvars.iv68, 1
  %exitcond73.not = icmp eq i64 %indvars.iv.next69, %wide.trip.count72
  br i1 %exitcond73.not, label %._crit_edge50.us, label %38, !llvm.loop !15

._crit_edge50.us:                                 ; preds = %52
  %53 = add nuw nsw i32 %.02851.us, 1
  %exitcond74.not = icmp eq i32 %53, %.lcssa
  br i1 %exitcond74.not, label %._crit_edge52, label %.preheader.us, !llvm.loop !16

54:                                               ; preds = %.lr.ph46, %65
  %indvars.iv62 = phi i64 [ 0, %.lr.ph46 ], [ %indvars.iv.next63, %65 ]
  %55 = trunc nuw nsw i64 %indvars.iv62 to i32
  %56 = and i32 %.031.lcssa, %55
  %57 = zext i32 %56 to i64
  %58 = icmp eq i64 %indvars.iv62, %57
  br i1 %58, label %59, label %65

59:                                               ; preds = %54
  %60 = lshr i32 %55, 1
  %61 = and i32 %60, %55
  %.not35 = icmp eq i32 %61, 0
  br i1 %.not35, label %62, label %65

62:                                               ; preds = %59
  %63 = getelementptr inbounds [2 x [4096 x i32]], ptr @f, i64 0, i64 %26, i64 %indvars.iv62
  %64 = load i32, ptr %63, align 4, !tbaa !5
  br label %65

65:                                               ; preds = %54, %59, %62
  %66 = phi i32 [ %64, %62 ], [ 0, %59 ], [ 0, %54 ]
  %67 = getelementptr inbounds [2 x [4096 x i32]], ptr @f, i64 0, i64 %27, i64 %indvars.iv62
  store i32 %66, ptr %67, align 4, !tbaa !5
  %indvars.iv.next63 = add nuw nsw i64 %indvars.iv62, 1
  %exitcond67.not = icmp eq i64 %indvars.iv.next63, %wide.trip.count66
  br i1 %exitcond67.not, label %.preheader36, label %54, !llvm.loop !17

._crit_edge52:                                    ; preds = %._crit_edge50.us, %.preheader36, %.preheader.lr.ph.thread
  %.pre-phi = phi i64 [ %25, %.preheader.lr.ph.thread ], [ %36, %.preheader36 ], [ %36, %._crit_edge50.us ]
  %68 = getelementptr inbounds [2 x [4096 x i32]], ptr @f, i64 0, i64 %.pre-phi
  %69 = sext i32 %24 to i64
  %70 = getelementptr inbounds i32, ptr %68, i64 %69
  call void @_ZSt7reverseIPiEvT_S1_(ptr noundef nonnull %68, ptr noundef nonnull %70)
  %71 = add nuw nsw i32 %.03253, 1
  %72 = load i32, ptr @n, align 4, !tbaa !5
  %73 = icmp slt i32 %71, %72
  br i1 %73, label %.lr.ph54, label %._crit_edge55, !llvm.loop !18
}

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt7reverseIPiEvT_S1_(ptr noundef, ptr noundef) local_unnamed_addr #3

; 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.smax.i32(i32, i32) #4

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 = { 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 nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}


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