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

; 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
@num = external dso_local global [701 x [701 x i32]], align 16
@flag = external dso_local global [701 x [701 x i8]], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z2dpii(i32 noundef, i32 noundef) #0

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_Z6updateRii(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) #2

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #3 {
  %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 [2 x i8], align 1
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 2, ptr %9) #5
  %10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n)
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %11

11:                                               ; preds = %27, %0
  %12 = load i32, ptr %2, align 4, !tbaa !5
  %13 = load i32, ptr @n, align 4, !tbaa !5
  %14 = add nsw i32 %13, 1
  %15 = icmp sle i32 %12, %14
  br i1 %15, label %16, label %30

16:                                               ; preds = %11
  %17 = load i32, ptr @n, align 4, !tbaa !5
  %18 = add nsw i32 %17, 1
  %19 = sext i32 %18 to i64
  %20 = getelementptr inbounds [701 x [701 x i8]], ptr @flag, i64 0, i64 %19
  %21 = load i32, ptr %2, align 4, !tbaa !5
  %22 = sext i32 %21 to i64
  %23 = getelementptr inbounds [701 x i8], ptr %20, i64 0, i64 %22
  store i8 1, ptr %23, align 1, !tbaa !9
  %24 = load i32, ptr %2, align 4, !tbaa !5
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds [701 x i8], ptr @flag, i64 0, i64 %25
  store i8 1, ptr %26, align 1, !tbaa !9
  br label %27

27:                                               ; preds = %16
  %28 = load i32, ptr %2, align 4, !tbaa !5
  %29 = add nsw i32 %28, 1
  store i32 %29, ptr %2, align 4, !tbaa !5
  br label %11, !llvm.loop !11

30:                                               ; preds = %11
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %31

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

35:                                               ; preds = %31
  %36 = load i32, ptr %2, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [701 x [701 x i8]], ptr @flag, i64 0, i64 %37
  %39 = load i32, ptr @n, align 4, !tbaa !5
  %40 = add nsw i32 %39, 1
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [701 x i8], ptr %38, i64 0, i64 %41
  store i8 1, ptr %42, align 1, !tbaa !9
  %43 = load i32, ptr %2, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [701 x [701 x i8]], ptr @flag, i64 0, i64 %44
  %46 = getelementptr inbounds [701 x i8], ptr %45, i64 0, i64 0
  store i8 1, ptr %46, align 1, !tbaa !9
  br label %47

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

50:                                               ; preds = %31
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %51

51:                                               ; preds = %72, %50
  %52 = load i32, ptr %2, align 4, !tbaa !5
  %53 = load i32, ptr @n, align 4, !tbaa !5
  %54 = icmp sle i32 %52, %53
  br i1 %54, label %55, label %75

55:                                               ; preds = %51
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %56

56:                                               ; preds = %68, %55
  %57 = load i32, ptr %3, align 4, !tbaa !5
  %58 = load i32, ptr @n, align 4, !tbaa !5
  %59 = icmp sle i32 %57, %58
  br i1 %59, label %60, label %71

60:                                               ; preds = %56
  %61 = load i32, ptr %2, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [701 x [701 x i32]], ptr @num, i64 0, i64 %62
  %64 = load i32, ptr %3, align 4, !tbaa !5
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [701 x i32], ptr %63, i64 0, i64 %65
  %67 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %66)
  br label %68

68:                                               ; preds = %60
  %69 = load i32, ptr %3, align 4, !tbaa !5
  %70 = add nsw i32 %69, 1
  store i32 %70, ptr %3, align 4, !tbaa !5
  br label %56, !llvm.loop !14

71:                                               ; preds = %56
  br label %72

72:                                               ; preds = %71
  %73 = load i32, ptr %2, align 4, !tbaa !5
  %74 = add nsw i32 %73, 1
  store i32 %74, ptr %2, align 4, !tbaa !5
  br label %51, !llvm.loop !15

75:                                               ; preds = %51
  %76 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @m)
  br label %77

77:                                               ; preds = %199, %75
  %78 = load i32, ptr @m, align 4, !tbaa !5
  %79 = icmp ne i32 %78, 0
  br i1 %79, label %80, label %202

80:                                               ; preds = %77
  %81 = getelementptr inbounds [2 x i8], ptr %9, i64 0, i64 0
  %82 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %81)
  %83 = getelementptr inbounds [2 x i8], ptr %9, i64 0, i64 0
  %84 = load i8, ptr %83, align 1, !tbaa !16
  %85 = sext i8 %84 to i32
  %86 = icmp eq i32 %85, 67
  br i1 %86, label %87, label %96

87:                                               ; preds = %80
  %88 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef %4, ptr noundef %5, ptr noundef %6)
  %89 = load i32, ptr %6, align 4, !tbaa !5
  %90 = load i32, ptr %4, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [701 x [701 x i32]], ptr @num, i64 0, i64 %91
  %93 = load i32, ptr %5, align 4, !tbaa !5
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [701 x i32], ptr %92, i64 0, i64 %94
  store i32 %89, ptr %95, align 4, !tbaa !5
  br label %198

96:                                               ; preds = %80
  %97 = getelementptr inbounds [2 x i8], ptr %9, i64 0, i64 0
  %98 = load i8, ptr %97, align 1, !tbaa !16
  %99 = sext i8 %98 to i32
  %100 = icmp eq i32 %99, 83
  br i1 %100, label %101, label %129

101:                                              ; preds = %96
  %102 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.3, ptr noundef %4, ptr noundef %5, ptr noundef %6, ptr noundef %7)
  %103 = load i32, ptr %4, align 4, !tbaa !5
  store i32 %103, ptr %2, align 4, !tbaa !5
  br label %104

104:                                              ; preds = %125, %101
  %105 = load i32, ptr %2, align 4, !tbaa !5
  %106 = load i32, ptr %6, align 4, !tbaa !5
  %107 = icmp sle i32 %105, %106
  br i1 %107, label %108, label %128

108:                                              ; preds = %104
  %109 = load i32, ptr %5, align 4, !tbaa !5
  store i32 %109, ptr %3, align 4, !tbaa !5
  br label %110

110:                                              ; preds = %121, %108
  %111 = load i32, ptr %3, align 4, !tbaa !5
  %112 = load i32, ptr %7, align 4, !tbaa !5
  %113 = icmp sle i32 %111, %112
  br i1 %113, label %114, label %124

114:                                              ; preds = %110
  %115 = load i32, ptr %2, align 4, !tbaa !5
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [701 x [701 x i8]], ptr @flag, i64 0, i64 %116
  %118 = load i32, ptr %3, align 4, !tbaa !5
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [701 x i8], ptr %117, i64 0, i64 %119
  store i8 1, ptr %120, align 1, !tbaa !9
  br label %121

121:                                              ; preds = %114
  %122 = load i32, ptr %3, align 4, !tbaa !5
  %123 = add nsw i32 %122, 1
  store i32 %123, ptr %3, align 4, !tbaa !5
  br label %110, !llvm.loop !17

124:                                              ; preds = %110
  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
  br label %104, !llvm.loop !18

128:                                              ; preds = %104
  br label %197

129:                                              ; preds = %96
  %130 = getelementptr inbounds [2 x i8], ptr %9, i64 0, i64 0
  %131 = load i8, ptr %130, align 1, !tbaa !16
  %132 = sext i8 %131 to i32
  %133 = icmp eq i32 %132, 66
  br i1 %133, label %134, label %162

134:                                              ; preds = %129
  %135 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.3, ptr noundef %4, ptr noundef %5, ptr noundef %6, ptr noundef %7)
  %136 = load i32, ptr %4, align 4, !tbaa !5
  store i32 %136, ptr %2, align 4, !tbaa !5
  br label %137

137:                                              ; preds = %158, %134
  %138 = load i32, ptr %2, align 4, !tbaa !5
  %139 = load i32, ptr %6, align 4, !tbaa !5
  %140 = icmp sle i32 %138, %139
  br i1 %140, label %141, label %161

141:                                              ; preds = %137
  %142 = load i32, ptr %5, align 4, !tbaa !5
  store i32 %142, ptr %3, align 4, !tbaa !5
  br label %143

143:                                              ; preds = %154, %141
  %144 = load i32, ptr %3, align 4, !tbaa !5
  %145 = load i32, ptr %7, align 4, !tbaa !5
  %146 = icmp sle i32 %144, %145
  br i1 %146, label %147, label %157

147:                                              ; preds = %143
  %148 = load i32, ptr %2, align 4, !tbaa !5
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds [701 x [701 x i8]], ptr @flag, i64 0, i64 %149
  %151 = load i32, ptr %3, align 4, !tbaa !5
  %152 = sext i32 %151 to i64
  %153 = getelementptr inbounds [701 x i8], ptr %150, i64 0, i64 %152
  store i8 0, ptr %153, align 1, !tbaa !9
  br label %154

154:                                              ; preds = %147
  %155 = load i32, ptr %3, align 4, !tbaa !5
  %156 = add nsw i32 %155, 1
  store i32 %156, ptr %3, align 4, !tbaa !5
  br label %143, !llvm.loop !19

157:                                              ; preds = %143
  br label %158

158:                                              ; preds = %157
  %159 = load i32, ptr %2, align 4, !tbaa !5
  %160 = add nsw i32 %159, 1
  store i32 %160, ptr %2, align 4, !tbaa !5
  br label %137, !llvm.loop !20

161:                                              ; preds = %137
  br label %196

162:                                              ; preds = %129
  store i32 0, ptr %8, align 4, !tbaa !5
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %163

163:                                              ; preds = %190, %162
  %164 = load i32, ptr %2, align 4, !tbaa !5
  %165 = load i32, ptr @n, align 4, !tbaa !5
  %166 = icmp sle i32 %164, %165
  br i1 %166, label %167, label %193

167:                                              ; preds = %163
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %168

168:                                              ; preds = %186, %167
  %169 = load i32, ptr %3, align 4, !tbaa !5
  %170 = load i32, ptr @n, align 4, !tbaa !5
  %171 = icmp sle i32 %169, %170
  br i1 %171, label %172, label %189

172:                                              ; preds = %168
  %173 = load i32, ptr %2, align 4, !tbaa !5
  %174 = sext i32 %173 to i64
  %175 = getelementptr inbounds [701 x [701 x i8]], ptr @flag, i64 0, i64 %174
  %176 = load i32, ptr %3, align 4, !tbaa !5
  %177 = sext i32 %176 to i64
  %178 = getelementptr inbounds [701 x i8], ptr %175, i64 0, i64 %177
  %179 = load i8, ptr %178, align 1, !tbaa !9, !range !21, !noundef !22
  %180 = trunc i8 %179 to i1
  br i1 %180, label %185, label %181

181:                                              ; preds = %172
  %182 = load i32, ptr %2, align 4, !tbaa !5
  %183 = load i32, ptr %3, align 4, !tbaa !5
  %184 = call noundef i32 @_Z2dpii(i32 noundef %182, i32 noundef %183)
  call void @_Z6updateRii(ptr noundef nonnull align 4 dereferenceable(4) %8, i32 noundef %184)
  br label %185

185:                                              ; preds = %181, %172
  br label %186

186:                                              ; preds = %185
  %187 = load i32, ptr %3, align 4, !tbaa !5
  %188 = add nsw i32 %187, 1
  store i32 %188, ptr %3, align 4, !tbaa !5
  br label %168, !llvm.loop !23

189:                                              ; preds = %168
  br label %190

190:                                              ; preds = %189
  %191 = load i32, ptr %2, align 4, !tbaa !5
  %192 = add nsw i32 %191, 1
  store i32 %192, ptr %2, align 4, !tbaa !5
  br label %163, !llvm.loop !24

193:                                              ; preds = %163
  %194 = load i32, ptr %8, align 4, !tbaa !5
  %195 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, i32 noundef %194)
  br label %196

196:                                              ; preds = %193, %161
  br label %197

197:                                              ; preds = %196, %128
  br label %198

198:                                              ; preds = %197, %87
  br label %199

199:                                              ; preds = %198
  %200 = load i32, ptr @m, align 4, !tbaa !5
  %201 = add nsw i32 %200, -1
  store i32 %201, ptr @m, align 4, !tbaa !5
  br label %77, !llvm.loop !25

202:                                              ; preds = %77
  call void @llvm.lifetime.end.p0(i64 2, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  ret i32 0
}

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

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

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 #4 = { "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 #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 = !{!10, !10, i64 0}
!10 = !{!"bool", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = !{!7, !7, i64 0}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}
!21 = !{i8 0, i8 2}
!22 = !{}
!23 = distinct !{!23, !12}
!24 = distinct !{!24, !12}
!25 = distinct !{!25, !12}


; 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
@num = external dso_local global [701 x [701 x i32]], align 16
@flag = external dso_local local_unnamed_addr global [701 x [701 x i8]], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z2dpii(i32 noundef, i32 noundef) local_unnamed_addr #0

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_Z6updateRii(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) local_unnamed_addr #2

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #3 {
  %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 [2 x i8], align 1
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #6
  call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %6) #6
  %7 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
  %8 = load i32, ptr @n, align 4, !tbaa !5
  %9 = add i32 %8, 1
  %.not56 = icmp slt i32 %8, -1
  br i1 %.not56, label %._crit_edge67, label %iter.check

iter.check:                                       ; preds = %0
  %10 = sext i32 %9 to i64
  %11 = add i32 %8, 2
  %wide.trip.count = zext i32 %11 to i64
  %min.iters.check = icmp ult i32 %11, 8
  %12 = mul nsw i64 %10, -701
  %diff.check = icmp ult i64 %12, 32
  %or.cond = select i1 %min.iters.check, i1 true, i1 %diff.check
  br i1 %or.cond, label %vec.epilog.scalar.ph.preheader, label %vector.main.loop.iter.check

vector.main.loop.iter.check:                      ; preds = %iter.check
  %min.iters.check143 = icmp ult i32 %11, 32
  br i1 %min.iters.check143, label %vec.epilog.ph, label %vector.ph

vector.ph:                                        ; preds = %vector.main.loop.iter.check
  %n.vec = and i64 %wide.trip.count, 4294967264
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %13 = getelementptr inbounds [701 x [701 x i8]], ptr @flag, i64 0, i64 %10, i64 %index
  %14 = getelementptr inbounds i8, ptr %13, i64 16
  store <16 x i8> <i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1>, ptr %13, align 1, !tbaa !9
  store <16 x i8> <i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1>, ptr %14, align 1, !tbaa !9
  %15 = getelementptr inbounds [701 x i8], ptr @flag, i64 0, i64 %index
  %16 = getelementptr inbounds i8, ptr %15, i64 16
  store <16 x i8> <i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1>, ptr %15, align 16, !tbaa !9
  store <16 x i8> <i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1>, ptr %16, align 16, !tbaa !9
  %index.next = add nuw i64 %index, 32
  %17 = icmp eq i64 %index.next, %n.vec
  br i1 %17, label %middle.block, label %vector.body, !llvm.loop !11

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br i1 %cmp.n, label %.preheader54, label %vec.epilog.iter.check

vec.epilog.iter.check:                            ; preds = %middle.block
  %n.vec.remaining = and i64 %wide.trip.count, 24
  %min.epilog.iters.check = icmp eq i64 %n.vec.remaining, 0
  br i1 %min.epilog.iters.check, label %vec.epilog.scalar.ph.preheader, label %vec.epilog.ph

vec.epilog.scalar.ph.preheader:                   ; preds = %vec.epilog.middle.block, %iter.check, %vec.epilog.iter.check
  %indvars.iv.ph = phi i64 [ 0, %iter.check ], [ %n.vec, %vec.epilog.iter.check ], [ %n.vec145, %vec.epilog.middle.block ]
  %xtraiter = and i64 %wide.trip.count, 3
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %vec.epilog.scalar.ph.prol.loopexit, label %vec.epilog.scalar.ph.prol

vec.epilog.scalar.ph.prol:                        ; preds = %vec.epilog.scalar.ph.preheader, %vec.epilog.scalar.ph.prol
  %indvars.iv.prol = phi i64 [ %indvars.iv.next.prol, %vec.epilog.scalar.ph.prol ], [ %indvars.iv.ph, %vec.epilog.scalar.ph.preheader ]
  %prol.iter = phi i64 [ %prol.iter.next, %vec.epilog.scalar.ph.prol ], [ 0, %vec.epilog.scalar.ph.preheader ]
  %18 = getelementptr inbounds [701 x [701 x i8]], ptr @flag, i64 0, i64 %10, i64 %indvars.iv.prol
  store i8 1, ptr %18, align 1, !tbaa !9
  %19 = getelementptr inbounds [701 x i8], ptr @flag, i64 0, i64 %indvars.iv.prol
  store i8 1, ptr %19, align 1, !tbaa !9
  %indvars.iv.next.prol = add nuw nsw i64 %indvars.iv.prol, 1
  %prol.iter.next = add i64 %prol.iter, 1
  %prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
  br i1 %prol.iter.cmp.not, label %vec.epilog.scalar.ph.prol.loopexit, label %vec.epilog.scalar.ph.prol, !llvm.loop !15

vec.epilog.scalar.ph.prol.loopexit:               ; preds = %vec.epilog.scalar.ph.prol, %vec.epilog.scalar.ph.preheader
  %indvars.iv.unr = phi i64 [ %indvars.iv.ph, %vec.epilog.scalar.ph.preheader ], [ %indvars.iv.next.prol, %vec.epilog.scalar.ph.prol ]
  %20 = sub nsw i64 %indvars.iv.ph, %wide.trip.count
  %21 = icmp ugt i64 %20, -4
  br i1 %21, label %.preheader54, label %vec.epilog.scalar.ph

vec.epilog.ph:                                    ; preds = %vector.main.loop.iter.check, %vec.epilog.iter.check
  %vec.epilog.resume.val = phi i64 [ %n.vec, %vec.epilog.iter.check ], [ 0, %vector.main.loop.iter.check ]
  %n.vec145 = and i64 %wide.trip.count, 4294967288
  br label %vec.epilog.vector.body

vec.epilog.vector.body:                           ; preds = %vec.epilog.vector.body, %vec.epilog.ph
  %index146 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next147, %vec.epilog.vector.body ]
  %22 = getelementptr inbounds [701 x [701 x i8]], ptr @flag, i64 0, i64 %10, i64 %index146
  store <8 x i8> <i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1>, ptr %22, align 1, !tbaa !9
  %23 = getelementptr inbounds [701 x i8], ptr @flag, i64 0, i64 %index146
  store <8 x i8> <i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1>, ptr %23, align 8, !tbaa !9
  %index.next147 = add nuw i64 %index146, 8
  %24 = icmp eq i64 %index.next147, %n.vec145
  br i1 %24, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !17

vec.epilog.middle.block:                          ; preds = %vec.epilog.vector.body
  %cmp.n148 = icmp eq i64 %n.vec145, %wide.trip.count
  br i1 %cmp.n148, label %.preheader54, label %vec.epilog.scalar.ph.preheader

.preheader54:                                     ; preds = %vec.epilog.scalar.ph.prol.loopexit, %vec.epilog.scalar.ph, %vec.epilog.middle.block, %middle.block
  %.not4159 = icmp slt i32 %8, 1
  br i1 %.not4159, label %._crit_edge67, label %.lr.ph61

.lr.ph61:                                         ; preds = %.preheader54
  %25 = zext i32 %9 to i64
  %26 = add nsw i64 %25, -1
  %xtraiter152 = and i64 %26, 1
  %27 = icmp eq i32 %9, 2
  br i1 %27, label %.preheader53.unr-lcssa, label %.lr.ph61.new

.lr.ph61.new:                                     ; preds = %.lr.ph61
  %unroll_iter = and i64 %26, -2
  br label %38

vec.epilog.scalar.ph:                             ; preds = %vec.epilog.scalar.ph.prol.loopexit, %vec.epilog.scalar.ph
  %indvars.iv = phi i64 [ %indvars.iv.next.3, %vec.epilog.scalar.ph ], [ %indvars.iv.unr, %vec.epilog.scalar.ph.prol.loopexit ]
  %28 = getelementptr inbounds [701 x [701 x i8]], ptr @flag, i64 0, i64 %10, i64 %indvars.iv
  store i8 1, ptr %28, align 1, !tbaa !9
  %29 = getelementptr inbounds [701 x i8], ptr @flag, i64 0, i64 %indvars.iv
  store i8 1, ptr %29, align 1, !tbaa !9
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %30 = getelementptr inbounds [701 x [701 x i8]], ptr @flag, i64 0, i64 %10, i64 %indvars.iv.next
  store i8 1, ptr %30, align 1, !tbaa !9
  %31 = getelementptr inbounds [701 x i8], ptr @flag, i64 0, i64 %indvars.iv.next
  store i8 1, ptr %31, align 1, !tbaa !9
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %32 = getelementptr inbounds [701 x [701 x i8]], ptr @flag, i64 0, i64 %10, i64 %indvars.iv.next.1
  store i8 1, ptr %32, align 1, !tbaa !9
  %33 = getelementptr inbounds [701 x i8], ptr @flag, i64 0, i64 %indvars.iv.next.1
  store i8 1, ptr %33, align 1, !tbaa !9
  %indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
  %34 = getelementptr inbounds [701 x [701 x i8]], ptr @flag, i64 0, i64 %10, i64 %indvars.iv.next.2
  store i8 1, ptr %34, align 1, !tbaa !9
  %35 = getelementptr inbounds [701 x i8], ptr @flag, i64 0, i64 %indvars.iv.next.2
  store i8 1, ptr %35, align 1, !tbaa !9
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
  %exitcond.3 = icmp eq i64 %indvars.iv.next.3, %wide.trip.count
  br i1 %exitcond.3, label %.preheader54, label %vec.epilog.scalar.ph, !llvm.loop !18

.preheader53.unr-lcssa:                           ; preds = %38, %.lr.ph61
  %indvars.iv103.unr = phi i64 [ 1, %.lr.ph61 ], [ %indvars.iv.next104.1, %38 ]
  %lcmp.mod153.not = icmp eq i64 %xtraiter152, 0
  br i1 %lcmp.mod153.not, label %.preheader53, label %.preheader53.epilog-lcssa

.preheader53.epilog-lcssa:                        ; preds = %.preheader53.unr-lcssa
  %36 = getelementptr inbounds [701 x [701 x i8]], ptr @flag, i64 0, i64 %indvars.iv103.unr
  %37 = getelementptr inbounds [701 x [701 x i8]], ptr @flag, i64 0, i64 %indvars.iv103.unr, i64 %25
  store i8 1, ptr %37, align 1, !tbaa !9
  store i8 1, ptr %36, align 1, !tbaa !9
  br label %.preheader53

.preheader53:                                     ; preds = %.preheader53.unr-lcssa, %.preheader53.epilog-lcssa
  br i1 %.not4159, label %._crit_edge67, label %.preheader52

38:                                               ; preds = %38, %.lr.ph61.new
  %indvars.iv103 = phi i64 [ 1, %.lr.ph61.new ], [ %indvars.iv.next104.1, %38 ]
  %niter = phi i64 [ 0, %.lr.ph61.new ], [ %niter.next.1, %38 ]
  %39 = getelementptr inbounds [701 x [701 x i8]], ptr @flag, i64 0, i64 %indvars.iv103
  %40 = getelementptr inbounds [701 x [701 x i8]], ptr @flag, i64 0, i64 %indvars.iv103, i64 %25
  store i8 1, ptr %40, align 1, !tbaa !9
  store i8 1, ptr %39, align 1, !tbaa !9
  %indvars.iv.next104 = add nuw nsw i64 %indvars.iv103, 1
  %41 = getelementptr inbounds [701 x [701 x i8]], ptr @flag, i64 0, i64 %indvars.iv.next104
  %42 = getelementptr inbounds [701 x [701 x i8]], ptr @flag, i64 0, i64 %indvars.iv.next104, i64 %25
  store i8 1, ptr %42, align 1, !tbaa !9
  store i8 1, ptr %41, align 1, !tbaa !9
  %indvars.iv.next104.1 = add nuw nsw i64 %indvars.iv103, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %.preheader53.unr-lcssa, label %38, !llvm.loop !19

.preheader52:                                     ; preds = %.preheader53, %._crit_edge
  %43 = phi i32 [ %48, %._crit_edge ], [ %8, %.preheader53 ]
  %indvars.iv111 = phi i64 [ %indvars.iv.next112, %._crit_edge ], [ 1, %.preheader53 ]
  %.not5062 = icmp slt i32 %43, 1
  br i1 %.not5062, label %.preheader52.._crit_edge_crit_edge, label %.lr.ph64

.preheader52.._crit_edge_crit_edge:               ; preds = %.preheader52
  %.pre133 = sext i32 %43 to i64
  br label %._crit_edge

.lr.ph64:                                         ; preds = %.preheader52, %.lr.ph64
  %indvars.iv108 = phi i64 [ %indvars.iv.next109, %.lr.ph64 ], [ 1, %.preheader52 ]
  %44 = getelementptr inbounds [701 x [701 x i32]], ptr @num, i64 0, i64 %indvars.iv111, i64 %indvars.iv108
  %45 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %44)
  %indvars.iv.next109 = add nuw nsw i64 %indvars.iv108, 1
  %46 = load i32, ptr @n, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %.not50.not = icmp slt i64 %indvars.iv108, %47
  br i1 %.not50.not, label %.lr.ph64, label %._crit_edge, !llvm.loop !20

._crit_edge:                                      ; preds = %.lr.ph64, %.preheader52.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre133, %.preheader52.._crit_edge_crit_edge ], [ %47, %.lr.ph64 ]
  %48 = phi i32 [ %43, %.preheader52.._crit_edge_crit_edge ], [ %46, %.lr.ph64 ]
  %indvars.iv.next112 = add nuw nsw i64 %indvars.iv111, 1
  %.not42.not = icmp slt i64 %indvars.iv111, %.pre-phi
  br i1 %.not42.not, label %.preheader52, label %._crit_edge67, !llvm.loop !21

._crit_edge67:                                    ; preds = %._crit_edge, %0, %.preheader54, %.preheader53
  %49 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @m)
  %.pr = load i32, ptr @m, align 4, !tbaa !5
  %.not4393 = icmp eq i32 %.pr, 0
  br i1 %.not4393, label %._crit_edge96, label %.lr.ph95

.lr.ph95:                                         ; preds = %._crit_edge67, %.loopexit
  %50 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %6)
  %51 = load i8, ptr %6, align 1, !tbaa !23
  switch i8 %51, label %112 [
    i8 67, label %52
    i8 83, label %60
    i8 66, label %86
  ]

52:                                               ; preds = %.lr.ph95
  %53 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %1, ptr noundef nonnull %2, ptr noundef nonnull %3)
  %54 = load i32, ptr %3, align 4, !tbaa !5
  %55 = load i32, ptr %1, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = load i32, ptr %2, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [701 x [701 x i32]], ptr @num, i64 0, i64 %56, i64 %58
  store i32 %54, ptr %59, align 4, !tbaa !5
  br label %.loopexit

60:                                               ; preds = %.lr.ph95
  %61 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %1, ptr noundef nonnull %2, ptr noundef nonnull %3, ptr noundef nonnull %4)
  %62 = load i32, ptr %1, align 4, !tbaa !5
  %63 = load i32, ptr %3, align 4, !tbaa !5
  %.not4882 = icmp sgt i32 %62, %63
  br i1 %.not4882, label %.loopexit, label %.lr.ph85

.lr.ph85:                                         ; preds = %60
  %64 = load i32, ptr %2, align 4, !tbaa !5
  %65 = load i32, ptr %4, align 4, !tbaa !5
  %.not4977 = icmp sgt i32 %64, %65
  br i1 %.not4977, label %.loopexit, label %.lr.ph80.preheader

.lr.ph80.preheader:                               ; preds = %.lr.ph85
  %66 = sext i32 %62 to i64
  %67 = mul nsw i64 %66, 701
  %68 = sext i32 %64 to i64
  %69 = sub i32 %65, %64
  %70 = zext i32 %69 to i64
  %71 = add nuw nsw i64 %70, 1
  %72 = add i32 %63, 1
  %73 = sub i32 %72, %62
  %74 = getelementptr i8, ptr @flag, i64 %67
  %75 = getelementptr i8, ptr %74, i64 %68
  %76 = sub i32 %63, %62
  %xtraiter158 = and i32 %73, 7
  %77 = icmp ult i32 %76, 7
  br i1 %77, label %.loopexit.loopexit.unr-lcssa, label %.lr.ph80.preheader.new

.lr.ph80.preheader.new:                           ; preds = %.lr.ph80.preheader
  %unroll_iter161 = and i32 %73, -8
  %invariant.gep177 = getelementptr i8, ptr %75, i64 701
  %invariant.gep179 = getelementptr i8, ptr %75, i64 1402
  %invariant.gep181 = getelementptr i8, ptr %75, i64 2103
  %invariant.gep183 = getelementptr i8, ptr %75, i64 2804
  %invariant.gep185 = getelementptr i8, ptr %75, i64 3505
  %invariant.gep187 = getelementptr i8, ptr %75, i64 4206
  %invariant.gep189 = getelementptr i8, ptr %75, i64 4907
  br label %.lr.ph80

.lr.ph80:                                         ; preds = %.lr.ph80, %.lr.ph80.preheader.new
  %indvar118 = phi i64 [ 0, %.lr.ph80.preheader.new ], [ %indvar.next119.7, %.lr.ph80 ]
  %niter162 = phi i32 [ 0, %.lr.ph80.preheader.new ], [ %niter162.next.7, %.lr.ph80 ]
  %78 = mul nuw nsw i64 %indvar118, 701
  %scevgep120 = getelementptr i8, ptr %75, i64 %78
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(1) %scevgep120, i8 1, i64 %71, i1 false), !tbaa !9
  %79 = mul nuw i64 %indvar118, 701
  %gep178 = getelementptr i8, ptr %invariant.gep177, i64 %79
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(1) %gep178, i8 1, i64 %71, i1 false), !tbaa !9
  %80 = mul nuw i64 %indvar118, 701
  %gep180 = getelementptr i8, ptr %invariant.gep179, i64 %80
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(1) %gep180, i8 1, i64 %71, i1 false), !tbaa !9
  %81 = mul nuw i64 %indvar118, 701
  %gep182 = getelementptr i8, ptr %invariant.gep181, i64 %81
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(1) %gep182, i8 1, i64 %71, i1 false), !tbaa !9
  %82 = mul nuw i64 %indvar118, 701
  %gep184 = getelementptr i8, ptr %invariant.gep183, i64 %82
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(1) %gep184, i8 1, i64 %71, i1 false), !tbaa !9
  %83 = mul nuw i64 %indvar118, 701
  %gep186 = getelementptr i8, ptr %invariant.gep185, i64 %83
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(1) %gep186, i8 1, i64 %71, i1 false), !tbaa !9
  %84 = mul nuw i64 %indvar118, 701
  %gep188 = getelementptr i8, ptr %invariant.gep187, i64 %84
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(1) %gep188, i8 1, i64 %71, i1 false), !tbaa !9
  %85 = mul nuw i64 %indvar118, 701
  %gep190 = getelementptr i8, ptr %invariant.gep189, i64 %85
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(1) %gep190, i8 1, i64 %71, i1 false), !tbaa !9
  %indvar.next119.7 = add nuw nsw i64 %indvar118, 8
  %niter162.next.7 = add i32 %niter162, 8
  %niter162.ncmp.7 = icmp eq i32 %niter162.next.7, %unroll_iter161
  br i1 %niter162.ncmp.7, label %.loopexit.loopexit.unr-lcssa, label %.lr.ph80, !llvm.loop !24

86:                                               ; preds = %.lr.ph95
  %87 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %1, ptr noundef nonnull %2, ptr noundef nonnull %3, ptr noundef nonnull %4)
  %88 = load i32, ptr %1, align 4, !tbaa !5
  %89 = load i32, ptr %3, align 4, !tbaa !5
  %.not4673 = icmp sgt i32 %88, %89
  br i1 %.not4673, label %.loopexit, label %.lr.ph76

.lr.ph76:                                         ; preds = %86
  %90 = load i32, ptr %2, align 4, !tbaa !5
  %91 = load i32, ptr %4, align 4, !tbaa !5
  %.not4768 = icmp sgt i32 %90, %91
  br i1 %.not4768, label %.loopexit, label %.lr.ph71.preheader

.lr.ph71.preheader:                               ; preds = %.lr.ph76
  %92 = sext i32 %88 to i64
  %93 = mul nsw i64 %92, 701
  %94 = sext i32 %90 to i64
  %95 = sub i32 %91, %90
  %96 = zext i32 %95 to i64
  %97 = add nuw nsw i64 %96, 1
  %98 = add i32 %89, 1
  %99 = sub i32 %98, %88
  %100 = getelementptr i8, ptr @flag, i64 %93
  %101 = getelementptr i8, ptr %100, i64 %94
  %102 = sub i32 %89, %88
  %xtraiter154 = and i32 %99, 7
  %103 = icmp ult i32 %102, 7
  br i1 %103, label %.loopexit.loopexit149.unr-lcssa, label %.lr.ph71.preheader.new

.lr.ph71.preheader.new:                           ; preds = %.lr.ph71.preheader
  %unroll_iter156 = and i32 %99, -8
  %invariant.gep = getelementptr i8, ptr %101, i64 701
  %invariant.gep165 = getelementptr i8, ptr %101, i64 1402
  %invariant.gep167 = getelementptr i8, ptr %101, i64 2103
  %invariant.gep169 = getelementptr i8, ptr %101, i64 2804
  %invariant.gep171 = getelementptr i8, ptr %101, i64 3505
  %invariant.gep173 = getelementptr i8, ptr %101, i64 4206
  %invariant.gep175 = getelementptr i8, ptr %101, i64 4907
  br label %.lr.ph71

.lr.ph71:                                         ; preds = %.lr.ph71, %.lr.ph71.preheader.new
  %indvar = phi i64 [ 0, %.lr.ph71.preheader.new ], [ %indvar.next.7, %.lr.ph71 ]
  %niter157 = phi i32 [ 0, %.lr.ph71.preheader.new ], [ %niter157.next.7, %.lr.ph71 ]
  %104 = mul nuw nsw i64 %indvar, 701
  %scevgep = getelementptr i8, ptr %101, i64 %104
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(1) %scevgep, i8 0, i64 %97, i1 false), !tbaa !9
  %105 = mul nuw i64 %indvar, 701
  %gep = getelementptr i8, ptr %invariant.gep, i64 %105
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(1) %gep, i8 0, i64 %97, i1 false), !tbaa !9
  %106 = mul nuw i64 %indvar, 701
  %gep166 = getelementptr i8, ptr %invariant.gep165, i64 %106
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(1) %gep166, i8 0, i64 %97, i1 false), !tbaa !9
  %107 = mul nuw i64 %indvar, 701
  %gep168 = getelementptr i8, ptr %invariant.gep167, i64 %107
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(1) %gep168, i8 0, i64 %97, i1 false), !tbaa !9
  %108 = mul nuw i64 %indvar, 701
  %gep170 = getelementptr i8, ptr %invariant.gep169, i64 %108
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(1) %gep170, i8 0, i64 %97, i1 false), !tbaa !9
  %109 = mul nuw i64 %indvar, 701
  %gep172 = getelementptr i8, ptr %invariant.gep171, i64 %109
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(1) %gep172, i8 0, i64 %97, i1 false), !tbaa !9
  %110 = mul nuw i64 %indvar, 701
  %gep174 = getelementptr i8, ptr %invariant.gep173, i64 %110
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(1) %gep174, i8 0, i64 %97, i1 false), !tbaa !9
  %111 = mul nuw i64 %indvar, 701
  %gep176 = getelementptr i8, ptr %invariant.gep175, i64 %111
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(1) %gep176, i8 0, i64 %97, i1 false), !tbaa !9
  %indvar.next.7 = add nuw nsw i64 %indvar, 8
  %niter157.next.7 = add i32 %niter157, 8
  %niter157.ncmp.7 = icmp eq i32 %niter157.next.7, %unroll_iter156
  br i1 %niter157.ncmp.7, label %.loopexit.loopexit149.unr-lcssa, label %.lr.ph71, !llvm.loop !25

112:                                              ; preds = %.lr.ph95
  store i32 0, ptr %5, align 4, !tbaa !5
  %113 = load i32, ptr @n, align 4, !tbaa !5
  %.not4490 = icmp slt i32 %113, 1
  br i1 %.not4490, label %._crit_edge92, label %.preheader

.preheader:                                       ; preds = %112, %._crit_edge89
  %114 = phi i32 [ %129, %._crit_edge89 ], [ %113, %112 ]
  %indvars.iv129 = phi i64 [ %indvars.iv.next130, %._crit_edge89 ], [ 1, %112 ]
  %.not4586 = icmp slt i32 %114, 1
  br i1 %.not4586, label %._crit_edge89, label %.lr.ph88

.lr.ph88:                                         ; preds = %.preheader
  %115 = trunc nuw nsw i64 %indvars.iv129 to i32
  br label %116

116:                                              ; preds = %.lr.ph88, %125
  %117 = phi i32 [ %114, %.lr.ph88 ], [ %126, %125 ]
  %118 = phi i32 [ %114, %.lr.ph88 ], [ %127, %125 ]
  %indvars.iv126 = phi i64 [ 1, %.lr.ph88 ], [ %indvars.iv.next127, %125 ]
  %119 = getelementptr inbounds [701 x [701 x i8]], ptr @flag, i64 0, i64 %indvars.iv129, i64 %indvars.iv126
  %120 = load i8, ptr %119, align 1, !tbaa !9, !range !26, !noundef !27
  %121 = trunc nuw i8 %120 to i1
  br i1 %121, label %125, label %122

122:                                              ; preds = %116
  %123 = trunc nuw nsw i64 %indvars.iv126 to i32
  %124 = call noundef i32 @_Z2dpii(i32 noundef %115, i32 noundef %123)
  call void @_Z6updateRii(ptr noundef nonnull align 4 dereferenceable(4) %5, i32 noundef %124)
  %.pre = load i32, ptr @n, align 4, !tbaa !5
  br label %125

125:                                              ; preds = %116, %122
  %126 = phi i32 [ %117, %116 ], [ %.pre, %122 ]
  %127 = phi i32 [ %118, %116 ], [ %.pre, %122 ]
  %indvars.iv.next127 = add nuw nsw i64 %indvars.iv126, 1
  %128 = sext i32 %127 to i64
  %.not45.not = icmp slt i64 %indvars.iv126, %128
  br i1 %.not45.not, label %116, label %._crit_edge89, !llvm.loop !28

._crit_edge89:                                    ; preds = %125, %.preheader
  %129 = phi i32 [ %114, %.preheader ], [ %126, %125 ]
  %indvars.iv.next130 = add nuw nsw i64 %indvars.iv129, 1
  %130 = sext i32 %129 to i64
  %.not44.not = icmp slt i64 %indvars.iv129, %130
  br i1 %.not44.not, label %.preheader, label %._crit_edge92.loopexit97, !llvm.loop !29

._crit_edge92.loopexit97:                         ; preds = %._crit_edge89
  %.pre132 = load i32, ptr %5, align 4, !tbaa !5
  br label %._crit_edge92

._crit_edge92:                                    ; preds = %._crit_edge92.loopexit97, %112
  %131 = phi i32 [ %.pre132, %._crit_edge92.loopexit97 ], [ 0, %112 ]
  %132 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %131)
  br label %.loopexit

.loopexit.loopexit.unr-lcssa:                     ; preds = %.lr.ph80, %.lr.ph80.preheader
  %indvar118.unr = phi i64 [ 0, %.lr.ph80.preheader ], [ %indvar.next119.7, %.lr.ph80 ]
  %lcmp.mod160.not = icmp eq i32 %xtraiter158, 0
  br i1 %lcmp.mod160.not, label %.loopexit, label %.lr.ph80.epil

.lr.ph80.epil:                                    ; preds = %.loopexit.loopexit.unr-lcssa, %.lr.ph80.epil
  %indvar118.epil = phi i64 [ %indvar.next119.epil, %.lr.ph80.epil ], [ %indvar118.unr, %.loopexit.loopexit.unr-lcssa ]
  %epil.iter159 = phi i32 [ %epil.iter159.next, %.lr.ph80.epil ], [ 0, %.loopexit.loopexit.unr-lcssa ]
  %133 = mul nuw nsw i64 %indvar118.epil, 701
  %scevgep120.epil = getelementptr i8, ptr %75, i64 %133
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(1) %scevgep120.epil, i8 1, i64 %71, i1 false), !tbaa !9
  %indvar.next119.epil = add nuw nsw i64 %indvar118.epil, 1
  %epil.iter159.next = add i32 %epil.iter159, 1
  %epil.iter159.cmp.not = icmp eq i32 %epil.iter159.next, %xtraiter158
  br i1 %epil.iter159.cmp.not, label %.loopexit, label %.lr.ph80.epil, !llvm.loop !30

.loopexit.loopexit149.unr-lcssa:                  ; preds = %.lr.ph71, %.lr.ph71.preheader
  %indvar.unr = phi i64 [ 0, %.lr.ph71.preheader ], [ %indvar.next.7, %.lr.ph71 ]
  %lcmp.mod155.not = icmp eq i32 %xtraiter154, 0
  br i1 %lcmp.mod155.not, label %.loopexit, label %.lr.ph71.epil

.lr.ph71.epil:                                    ; preds = %.loopexit.loopexit149.unr-lcssa, %.lr.ph71.epil
  %indvar.epil = phi i64 [ %indvar.next.epil, %.lr.ph71.epil ], [ %indvar.unr, %.loopexit.loopexit149.unr-lcssa ]
  %epil.iter = phi i32 [ %epil.iter.next, %.lr.ph71.epil ], [ 0, %.loopexit.loopexit149.unr-lcssa ]
  %134 = mul nuw nsw i64 %indvar.epil, 701
  %scevgep.epil = getelementptr i8, ptr %101, i64 %134
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(1) %scevgep.epil, i8 0, i64 %97, i1 false), !tbaa !9
  %indvar.next.epil = add nuw nsw i64 %indvar.epil, 1
  %epil.iter.next = add i32 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i32 %epil.iter.next, %xtraiter154
  br i1 %epil.iter.cmp.not, label %.loopexit, label %.lr.ph71.epil, !llvm.loop !31

.loopexit:                                        ; preds = %.loopexit.loopexit149.unr-lcssa, %.lr.ph71.epil, %.loopexit.loopexit.unr-lcssa, %.lr.ph80.epil, %.lr.ph76, %.lr.ph85, %86, %60, %52, %._crit_edge92
  %135 = load i32, ptr @m, align 4, !tbaa !5
  %136 = add nsw i32 %135, -1
  store i32 %136, ptr @m, align 4, !tbaa !5
  %.not43 = icmp eq i32 %136, 0
  br i1 %.not43, label %._crit_edge96, label %.lr.ph95, !llvm.loop !32

._crit_edge96:                                    ; preds = %.loopexit, %._crit_edge67
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  ret i32 0
}

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

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

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

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 #4 = { 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 #5 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { 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 = !{!10, !10, i64 0}
!10 = !{!"bool", !7, i64 0}
!11 = distinct !{!11, !12, !13, !14}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!"llvm.loop.isvectorized", i32 1}
!14 = !{!"llvm.loop.unroll.runtime.disable"}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.unroll.disable"}
!17 = distinct !{!17, !12, !13, !14}
!18 = distinct !{!18, !12, !13}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}
!21 = distinct !{!21, !12, !22}
!22 = !{!"llvm.loop.unswitch.partial.disable"}
!23 = !{!7, !7, i64 0}
!24 = distinct !{!24, !12}
!25 = distinct !{!25, !12}
!26 = !{i8 0, i8 2}
!27 = !{}
!28 = distinct !{!28, !12}
!29 = distinct !{!29, !12, !22}
!30 = distinct !{!30, !16}
!31 = distinct !{!31, !16}
!32 = distinct !{!32, !12}


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