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

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

@w = external dso_local global [8 x i32], align 16
@f = external dso_local global [8 x [20001 x i32]], align 16
@g = external dso_local global [8 x [20001 x i32]], align 16
@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@k = external dso_local global i32, align 4
@sz = external dso_local global i32, align 4
@out = external dso_local global [41 x i32], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  store i32 1, ptr @w, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #3
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %12

12:                                               ; preds = %31, %0
  %13 = load i32, ptr %2, align 4, !tbaa !5
  %14 = icmp slt i32 %13, 8
  br i1 %14, label %16, label %15

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

16:                                               ; preds = %12
  %17 = load i32, ptr %2, align 4, !tbaa !5
  %18 = sub nsw i32 %17, 1
  %19 = sext i32 %18 to i64
  %20 = getelementptr inbounds [8 x i32], ptr @w, i64 0, i64 %19
  %21 = load i32, ptr %20, align 4, !tbaa !5
  %22 = load i32, ptr %2, align 4, !tbaa !5
  %23 = sub nsw i32 14, %22
  %24 = add nsw i32 %23, 1
  %25 = mul nsw i32 %21, %24
  %26 = load i32, ptr %2, align 4, !tbaa !5
  %27 = sdiv i32 %25, %26
  %28 = load i32, ptr %2, align 4, !tbaa !5
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds [8 x i32], ptr @w, i64 0, i64 %29
  store i32 %27, ptr %30, align 4, !tbaa !5
  br label %31

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

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

35:                                               ; preds = %177, %34
  %36 = load i32, ptr %3, align 4, !tbaa !5
  %37 = icmp slt i32 %36, 8
  br i1 %37, label %39, label %38

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

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

40:                                               ; preds = %173, %39
  %41 = load i32, ptr %5, align 4, !tbaa !5
  %42 = icmp slt i32 %41, 20001
  br i1 %42, label %44, label %43

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

44:                                               ; preds = %40
  %45 = load i32, ptr %3, align 4, !tbaa !5
  %46 = icmp ne i32 %45, 0
  br i1 %46, label %51, label %47

47:                                               ; preds = %44
  %48 = load i32, ptr %5, align 4, !tbaa !5
  %49 = icmp ne i32 %48, 0
  br i1 %49, label %51, label %50

50:                                               ; preds = %47
  br label %173

51:                                               ; preds = %47, %44
  %52 = load i32, ptr %3, align 4, !tbaa !5
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [8 x [20001 x i32]], ptr @g, i64 0, i64 %53
  %55 = load i32, ptr %5, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [20001 x i32], ptr %54, i64 0, i64 %56
  store i32 1061109567, ptr %57, align 4, !tbaa !5
  %58 = load i32, ptr %3, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [8 x [20001 x i32]], ptr @f, i64 0, i64 %59
  %61 = load i32, ptr %5, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [20001 x i32], ptr %60, i64 0, i64 %62
  store i32 1061109567, ptr %63, align 4, !tbaa !5
  %64 = load i32, ptr %3, align 4, !tbaa !5
  %65 = icmp sgt i32 %64, 0
  br i1 %65, label %66, label %104

66:                                               ; preds = %51
  %67 = load i32, ptr %3, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [8 x [20001 x i32]], ptr @f, i64 0, i64 %68
  %70 = load i32, ptr %5, align 4, !tbaa !5
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [20001 x i32], ptr %69, i64 0, i64 %71
  %73 = load i32, ptr %72, align 4, !tbaa !5
  %74 = load i32, ptr %3, align 4, !tbaa !5
  %75 = sub nsw i32 %74, 1
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [8 x [20001 x i32]], ptr @f, i64 0, i64 %76
  %78 = load i32, ptr %5, align 4, !tbaa !5
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [20001 x i32], ptr %77, i64 0, i64 %79
  %81 = load i32, ptr %80, align 4, !tbaa !5
  %82 = icmp sgt i32 %73, %81
  br i1 %82, label %83, label %104

83:                                               ; preds = %66
  %84 = load i32, ptr %3, align 4, !tbaa !5
  %85 = sub nsw i32 %84, 1
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [8 x [20001 x i32]], ptr @f, i64 0, i64 %86
  %88 = load i32, ptr %5, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [20001 x i32], ptr %87, i64 0, i64 %89
  %91 = load i32, ptr %90, align 4, !tbaa !5
  %92 = load i32, ptr %3, align 4, !tbaa !5
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [8 x [20001 x i32]], ptr @f, i64 0, i64 %93
  %95 = load i32, ptr %5, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [20001 x i32], ptr %94, i64 0, i64 %96
  store i32 %91, ptr %97, align 4, !tbaa !5
  %98 = load i32, ptr %3, align 4, !tbaa !5
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [8 x [20001 x i32]], ptr @g, i64 0, i64 %99
  %101 = load i32, ptr %5, align 4, !tbaa !5
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [20001 x i32], ptr %100, i64 0, i64 %102
  store i32 0, ptr %103, align 4, !tbaa !5
  br label %104

104:                                              ; preds = %83, %66, %51
  %105 = load i32, ptr %5, align 4, !tbaa !5
  %106 = load i32, ptr %3, align 4, !tbaa !5
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [8 x i32], ptr @w, i64 0, i64 %107
  %109 = load i32, ptr %108, align 4, !tbaa !5
  %110 = icmp sge i32 %105, %109
  br i1 %110, label %111, label %172

111:                                              ; preds = %104
  %112 = load i32, ptr %3, align 4, !tbaa !5
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds [8 x [20001 x i32]], ptr @f, i64 0, i64 %113
  %115 = load i32, ptr %5, align 4, !tbaa !5
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [20001 x i32], ptr %114, i64 0, i64 %116
  %118 = load i32, ptr %117, align 4, !tbaa !5
  %119 = load i32, ptr %3, align 4, !tbaa !5
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds [8 x [20001 x i32]], ptr @f, i64 0, i64 %120
  %122 = load i32, ptr %5, align 4, !tbaa !5
  %123 = load i32, ptr %3, align 4, !tbaa !5
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds [8 x i32], ptr @w, i64 0, i64 %124
  %126 = load i32, ptr %125, align 4, !tbaa !5
  %127 = sub nsw i32 %122, %126
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [20001 x i32], ptr %121, i64 0, i64 %128
  %130 = load i32, ptr %129, align 4, !tbaa !5
  %131 = add nsw i32 %130, 1
  %132 = icmp sgt i32 %118, %131
  br i1 %132, label %133, label %172

133:                                              ; preds = %111
  %134 = load i32, ptr %3, align 4, !tbaa !5
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds [8 x [20001 x i32]], ptr @f, i64 0, i64 %135
  %137 = load i32, ptr %5, align 4, !tbaa !5
  %138 = load i32, ptr %3, align 4, !tbaa !5
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds [8 x i32], ptr @w, i64 0, i64 %139
  %141 = load i32, ptr %140, align 4, !tbaa !5
  %142 = sub nsw i32 %137, %141
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds [20001 x i32], ptr %136, i64 0, i64 %143
  %145 = load i32, ptr %144, align 4, !tbaa !5
  %146 = add nsw i32 %145, 1
  %147 = load i32, ptr %3, align 4, !tbaa !5
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds [8 x [20001 x i32]], ptr @f, i64 0, i64 %148
  %150 = load i32, ptr %5, align 4, !tbaa !5
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds [20001 x i32], ptr %149, i64 0, i64 %151
  store i32 %146, ptr %152, align 4, !tbaa !5
  %153 = load i32, ptr %3, align 4, !tbaa !5
  %154 = sext i32 %153 to i64
  %155 = getelementptr inbounds [8 x [20001 x i32]], ptr @g, i64 0, i64 %154
  %156 = load i32, ptr %5, align 4, !tbaa !5
  %157 = load i32, ptr %3, align 4, !tbaa !5
  %158 = sext i32 %157 to i64
  %159 = getelementptr inbounds [8 x i32], ptr @w, i64 0, i64 %158
  %160 = load i32, ptr %159, align 4, !tbaa !5
  %161 = sub nsw i32 %156, %160
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds [20001 x i32], ptr %155, i64 0, i64 %162
  %164 = load i32, ptr %163, align 4, !tbaa !5
  %165 = add nsw i32 %164, 1
  %166 = load i32, ptr %3, align 4, !tbaa !5
  %167 = sext i32 %166 to i64
  %168 = getelementptr inbounds [8 x [20001 x i32]], ptr @g, i64 0, i64 %167
  %169 = load i32, ptr %5, align 4, !tbaa !5
  %170 = sext i32 %169 to i64
  %171 = getelementptr inbounds [20001 x i32], ptr %168, i64 0, i64 %170
  store i32 %165, ptr %171, align 4, !tbaa !5
  br label %172

172:                                              ; preds = %133, %111, %104
  br label %173

173:                                              ; preds = %172, %50
  %174 = load i32, ptr %5, align 4, !tbaa !5
  %175 = add nsw i32 %174, 1
  store i32 %175, ptr %5, align 4, !tbaa !5
  br label %40, !llvm.loop !11

176:                                              ; preds = %43
  br label %177

177:                                              ; preds = %176
  %178 = load i32, ptr %3, align 4, !tbaa !5
  %179 = add nsw i32 %178, 1
  store i32 %179, ptr %3, align 4, !tbaa !5
  br label %35, !llvm.loop !12

180:                                              ; preds = %38
  %181 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @t)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #3
  store i32 1, ptr %6, align 4, !tbaa !5
  br label %182

182:                                              ; preds = %274, %180
  %183 = load i32, ptr %6, align 4, !tbaa !5
  %184 = load i32, ptr @t, align 4, !tbaa !5
  %185 = icmp sle i32 %183, %184
  br i1 %185, label %187, label %186

186:                                              ; preds = %182
  store i32 11, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  br label %277

187:                                              ; preds = %182
  %188 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef @n, ptr noundef @m, ptr noundef @k)
  store i32 0, ptr @sz, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %189

189:                                              ; preds = %198, %187
  %190 = load i32, ptr %7, align 4, !tbaa !5
  %191 = icmp slt i32 %190, 14
  br i1 %191, label %193, label %192

192:                                              ; preds = %189
  store i32 14, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  br label %201

193:                                              ; preds = %189
  %194 = load i32, ptr @sz, align 4, !tbaa !5
  %195 = add nsw i32 %194, 1
  store i32 %195, ptr @sz, align 4, !tbaa !5
  %196 = sext i32 %194 to i64
  %197 = getelementptr inbounds [41 x i32], ptr @out, i64 0, i64 %196
  store i32 1, ptr %197, align 4, !tbaa !5
  br label %198

198:                                              ; preds = %193
  %199 = load i32, ptr %7, align 4, !tbaa !5
  %200 = add nsw i32 %199, 1
  store i32 %200, ptr %7, align 4, !tbaa !5
  br label %189, !llvm.loop !13

201:                                              ; preds = %192
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  store i32 7, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  %202 = load i32, ptr @k, align 4, !tbaa !5
  store i32 %202, ptr %9, align 4, !tbaa !5
  br label %203

203:                                              ; preds = %231, %201
  %204 = load i32, ptr %8, align 4, !tbaa !5
  %205 = icmp sge i32 %204, 0
  br i1 %205, label %207, label %206

206:                                              ; preds = %203
  store i32 17, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  br label %248

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

208:                                              ; preds = %227, %207
  %209 = load i32, ptr %10, align 4, !tbaa !5
  %210 = load i32, ptr %8, align 4, !tbaa !5
  %211 = sext i32 %210 to i64
  %212 = getelementptr inbounds [8 x [20001 x i32]], ptr @g, i64 0, i64 %211
  %213 = load i32, ptr %9, align 4, !tbaa !5
  %214 = sext i32 %213 to i64
  %215 = getelementptr inbounds [20001 x i32], ptr %212, i64 0, i64 %214
  %216 = load i32, ptr %215, align 4, !tbaa !5
  %217 = icmp slt i32 %209, %216
  br i1 %217, label %219, label %218

218:                                              ; preds = %208
  store i32 20, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  br label %230

219:                                              ; preds = %208
  %220 = load i32, ptr @n, align 4, !tbaa !5
  %221 = load i32, ptr %8, align 4, !tbaa !5
  %222 = sub nsw i32 %220, %221
  %223 = load i32, ptr @sz, align 4, !tbaa !5
  %224 = add nsw i32 %223, 1
  store i32 %224, ptr @sz, align 4, !tbaa !5
  %225 = sext i32 %223 to i64
  %226 = getelementptr inbounds [41 x i32], ptr @out, i64 0, i64 %225
  store i32 %222, ptr %226, align 4, !tbaa !5
  br label %227

227:                                              ; preds = %219
  %228 = load i32, ptr %10, align 4, !tbaa !5
  %229 = add nsw i32 %228, 1
  store i32 %229, ptr %10, align 4, !tbaa !5
  br label %208, !llvm.loop !14

230:                                              ; preds = %218
  br label %231

231:                                              ; preds = %230
  %232 = load i32, ptr %8, align 4, !tbaa !5
  %233 = sext i32 %232 to i64
  %234 = getelementptr inbounds [8 x i32], ptr @w, i64 0, i64 %233
  %235 = load i32, ptr %234, align 4, !tbaa !5
  %236 = load i32, ptr %8, align 4, !tbaa !5
  %237 = sext i32 %236 to i64
  %238 = getelementptr inbounds [8 x [20001 x i32]], ptr @g, i64 0, i64 %237
  %239 = load i32, ptr %9, align 4, !tbaa !5
  %240 = sext i32 %239 to i64
  %241 = getelementptr inbounds [20001 x i32], ptr %238, i64 0, i64 %240
  %242 = load i32, ptr %241, align 4, !tbaa !5
  %243 = mul nsw i32 %235, %242
  %244 = load i32, ptr %9, align 4, !tbaa !5
  %245 = sub nsw i32 %244, %243
  store i32 %245, ptr %9, align 4, !tbaa !5
  %246 = load i32, ptr %8, align 4, !tbaa !5
  %247 = add nsw i32 %246, -1
  store i32 %247, ptr %8, align 4, !tbaa !5
  br label %203, !llvm.loop !15

248:                                              ; preds = %206
  %249 = load i32, ptr @sz, align 4, !tbaa !5
  %250 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %249)
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %251

251:                                              ; preds = %270, %248
  %252 = load i32, ptr %11, align 4, !tbaa !5
  %253 = load i32, ptr @sz, align 4, !tbaa !5
  %254 = icmp slt i32 %252, %253
  br i1 %254, label %256, label %255

255:                                              ; preds = %251
  store i32 23, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  br label %273

256:                                              ; preds = %251
  %257 = load i32, ptr %11, align 4, !tbaa !5
  %258 = sext i32 %257 to i64
  %259 = getelementptr inbounds [41 x i32], ptr @out, i64 0, i64 %258
  %260 = load i32, ptr %259, align 4, !tbaa !5
  %261 = load i32, ptr %11, align 4, !tbaa !5
  %262 = load i32, ptr @sz, align 4, !tbaa !5
  %263 = sub nsw i32 %262, 1
  %264 = icmp eq i32 %261, %263
  %265 = zext i1 %264 to i64
  %266 = getelementptr inbounds [3 x i8], ptr @.str.4, i64 0, i64 %265
  %267 = load i8, ptr %266, align 1, !tbaa !16
  %268 = sext i8 %267 to i32
  %269 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %260, i32 noundef %268)
  br label %270

270:                                              ; preds = %256
  %271 = load i32, ptr %11, align 4, !tbaa !5
  %272 = add nsw i32 %271, 1
  store i32 %272, ptr %11, align 4, !tbaa !5
  br label %251, !llvm.loop !17

273:                                              ; preds = %255
  br label %274

274:                                              ; preds = %273
  %275 = load i32, ptr %6, align 4, !tbaa !5
  %276 = add nsw i32 %275, 1
  store i32 %276, ptr %6, align 4, !tbaa !5
  br label %182, !llvm.loop !18

277:                                              ; preds = %186
  ret i32 0
}

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

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

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

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

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

@w = external dso_local local_unnamed_addr global [8 x i32], align 16
@f = external dso_local local_unnamed_addr global [8 x [20001 x i32]], align 16
@g = external dso_local local_unnamed_addr global [8 x [20001 x i32]], align 16
@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@k = external dso_local global i32, align 4
@sz = external dso_local local_unnamed_addr global i32, align 4
@out = external dso_local local_unnamed_addr global [41 x i32], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress nofree norecurse nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
.preheader79.preheader:
  store <4 x i32> <i32 1, i32 14, i32 91, i32 364>, ptr @w, align 16, !tbaa !5
  store <4 x i32> <i32 1001, i32 2002, i32 3003, i32 3432>, ptr getelementptr inbounds (i8, ptr @w, i64 16), align 16, !tbaa !5
  br label %.preheader79

.preheader79:                                     ; preds = %.preheader79.preheader, %.split.us
  %indvars.iv115 = phi i64 [ 0, %.preheader79.preheader ], [ %indvars.iv.next116, %.split.us ]
  %.not77 = icmp eq i64 %indvars.iv115, 0
  %0 = add nsw i64 %indvars.iv115, -1
  %1 = getelementptr inbounds [8 x i32], ptr @w, i64 0, i64 %indvars.iv115
  %2 = load i32, ptr %1, align 4, !tbaa !5
  %3 = sext i32 %2 to i64
  br i1 %.not77, label %.preheader79.split.us.peel.next, label %.preheader79.split.preheader

.preheader79.split.us.peel.next:                  ; preds = %.preheader79, %18
  %indvars.iv110 = phi i64 [ %indvars.iv.next111, %18 ], [ 1, %.preheader79 ]
  %4 = getelementptr inbounds [8 x [20001 x i32]], ptr @g, i64 0, i64 0, i64 %indvars.iv110
  store i32 1061109567, ptr %4, align 4, !tbaa !5
  %5 = getelementptr inbounds [8 x [20001 x i32]], ptr @f, i64 0, i64 0, i64 %indvars.iv110
  store i32 1061109567, ptr %5, align 4, !tbaa !5
  %.not78.us = icmp slt i64 %indvars.iv110, %3
  br i1 %.not78.us, label %18, label %6

6:                                                ; preds = %.preheader79.split.us.peel.next
  %7 = trunc nuw nsw i64 %indvars.iv110 to i32
  %8 = sub nsw i32 %7, %2
  %9 = sext i32 %8 to i64
  %10 = getelementptr inbounds [8 x [20001 x i32]], ptr @f, i64 0, i64 0, i64 %9
  %11 = load i32, ptr %10, align 4, !tbaa !5
  %12 = icmp slt i32 %11, 1061109566
  br i1 %12, label %13, label %18

13:                                               ; preds = %6
  %14 = add nsw i32 %11, 1
  store i32 %14, ptr %5, align 4, !tbaa !5
  %15 = getelementptr inbounds [8 x [20001 x i32]], ptr @g, i64 0, i64 0, i64 %9
  %16 = load i32, ptr %15, align 4, !tbaa !5
  %17 = add nsw i32 %16, 1
  store i32 %17, ptr %4, align 4, !tbaa !5
  br label %18

18:                                               ; preds = %13, %6, %.preheader79.split.us.peel.next
  %indvars.iv.next111 = add nuw nsw i64 %indvars.iv110, 1
  %exitcond113.not = icmp eq i64 %indvars.iv.next111, 20001
  br i1 %exitcond113.not, label %.split.us, label %.preheader79.split.us.peel.next, !llvm.loop !9

19:                                               ; preds = %.split.us
  %20 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @t)
  %21 = load i32, ptr @t, align 4, !tbaa !5
  %.not101 = icmp slt i32 %21, 1
  br i1 %.not101, label %._crit_edge105, label %.lr.ph104

.split.us:                                        ; preds = %42, %18
  %indvars.iv.next116 = add nuw nsw i64 %indvars.iv115, 1
  %exitcond118.not = icmp eq i64 %indvars.iv.next116, 8
  br i1 %exitcond118.not, label %19, label %.preheader79, !llvm.loop !12

.preheader79.split.preheader:                     ; preds = %.preheader79, %42
  %indvars.iv = phi i64 [ %indvars.iv.next, %42 ], [ 0, %.preheader79 ]
  %22 = getelementptr inbounds [8 x [20001 x i32]], ptr @g, i64 0, i64 %indvars.iv115, i64 %indvars.iv
  store i32 1061109567, ptr %22, align 4, !tbaa !5
  %23 = getelementptr inbounds [8 x [20001 x i32]], ptr @f, i64 0, i64 %indvars.iv115, i64 %indvars.iv
  store i32 1061109567, ptr %23, align 4, !tbaa !5
  %24 = getelementptr inbounds [8 x [20001 x i32]], ptr @f, i64 0, i64 %0, i64 %indvars.iv
  %25 = load i32, ptr %24, align 4, !tbaa !5
  %26 = icmp slt i32 %25, 1061109567
  br i1 %26, label %27, label %28

27:                                               ; preds = %.preheader79.split.preheader
  store i32 %25, ptr %23, align 4, !tbaa !5
  store i32 0, ptr %22, align 4, !tbaa !5
  br label %28

28:                                               ; preds = %27, %.preheader79.split.preheader
  %29 = phi i32 [ %25, %27 ], [ 1061109567, %.preheader79.split.preheader ]
  %.not78 = icmp slt i64 %indvars.iv, %3
  br i1 %.not78, label %42, label %30

30:                                               ; preds = %28
  %31 = trunc nuw nsw i64 %indvars.iv to i32
  %32 = sub nsw i32 %31, %2
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [8 x [20001 x i32]], ptr @f, i64 0, i64 %indvars.iv115, i64 %33
  %35 = load i32, ptr %34, align 4, !tbaa !5
  %36 = add nsw i32 %35, 1
  %37 = icmp sgt i32 %29, %36
  br i1 %37, label %38, label %42

38:                                               ; preds = %30
  store i32 %36, ptr %23, align 4, !tbaa !5
  %39 = getelementptr inbounds [8 x [20001 x i32]], ptr @g, i64 0, i64 %indvars.iv115, i64 %33
  %40 = load i32, ptr %39, align 4, !tbaa !5
  %41 = add nsw i32 %40, 1
  store i32 %41, ptr %22, align 4, !tbaa !5
  br label %42

42:                                               ; preds = %28, %30, %38
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 20001
  br i1 %exitcond.not, label %.split.us, label %.preheader79.split.preheader, !llvm.loop !13

._crit_edge105:                                   ; preds = %._crit_edge100, %19
  ret i32 0

.lr.ph104:                                        ; preds = %19, %._crit_edge100
  %.068102 = phi i32 [ %174, %._crit_edge100 ], [ 1, %19 ]
  %43 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @n, ptr noundef nonnull @m, ptr noundef nonnull @k)
  store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr @out, align 16, !tbaa !5
  store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr getelementptr inbounds (i8, ptr @out, i64 16), align 16, !tbaa !5
  store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr getelementptr inbounds (i8, ptr @out, i64 32), align 16, !tbaa !5
  store i32 1, ptr getelementptr inbounds (i8, ptr @out, i64 48), align 16, !tbaa !5
  store i32 1, ptr getelementptr inbounds (i8, ptr @out, i64 52), align 4, !tbaa !5
  store i32 14, ptr @sz, align 4, !tbaa !5
  %44 = load i32, ptr @k, align 4, !tbaa !5
  %45 = load i32, ptr @n, align 4
  %46 = sext i32 %44 to i64
  %47 = getelementptr inbounds [8 x [20001 x i32]], ptr @g, i64 0, i64 7, i64 %46
  %48 = load i32, ptr %47, align 4, !tbaa !5
  %49 = icmp sgt i32 %48, 0
  br i1 %49, label %.lr.ph, label %.preheader.1

.lr.ph:                                           ; preds = %.lr.ph104
  %50 = add i32 %45, -7
  %51 = zext nneg i32 %48 to i64
  %min.iters.check245 = icmp ult i32 %48, 8
  br i1 %min.iters.check245, label %scalar.ph244.preheader, label %vector.ph246

scalar.ph244.preheader:                           ; preds = %middle.block243, %.lr.ph
  %indvars.iv125.ph = phi i64 [ 14, %.lr.ph ], [ %ind.end249, %middle.block243 ]
  %.06488.ph = phi i32 [ 0, %.lr.ph ], [ %ind.end251, %middle.block243 ]
  br label %scalar.ph244

vector.ph246:                                     ; preds = %.lr.ph
  %n.vec248 = and i64 %51, 2147483640
  %ind.end249 = add nuw nsw i64 %n.vec248, 14
  %ind.end251 = trunc nuw nsw i64 %n.vec248 to i32
  %broadcast.splatinsert256 = insertelement <4 x i32> poison, i32 %50, i64 0
  %broadcast.splat257 = shufflevector <4 x i32> %broadcast.splatinsert256, <4 x i32> poison, <4 x i32> zeroinitializer
  br label %vector.body253

vector.body253:                                   ; preds = %vector.body253, %vector.ph246
  %index254 = phi i64 [ 0, %vector.ph246 ], [ %index.next258, %vector.body253 ]
  %offset.idx255 = add i64 %index254, 14
  %52 = getelementptr inbounds [41 x i32], ptr @out, i64 0, i64 %offset.idx255
  %53 = getelementptr inbounds i8, ptr %52, i64 16
  store <4 x i32> %broadcast.splat257, ptr %52, align 8, !tbaa !5
  store <4 x i32> %broadcast.splat257, ptr %53, align 8, !tbaa !5
  %index.next258 = add nuw i64 %index254, 8
  %54 = icmp eq i64 %index.next258, %n.vec248
  br i1 %54, label %middle.block243, label %vector.body253, !llvm.loop !14

middle.block243:                                  ; preds = %vector.body253
  %cmp.n259 = icmp eq i64 %n.vec248, %51
  br i1 %cmp.n259, label %._crit_edge, label %scalar.ph244.preheader

._crit_edge:                                      ; preds = %scalar.ph244, %middle.block243
  %indvars.iv.next126.lcssa = phi i64 [ %ind.end249, %middle.block243 ], [ %indvars.iv.next126, %scalar.ph244 ]
  %55 = trunc nsw i64 %indvars.iv.next126.lcssa to i32
  store i32 %55, ptr @sz, align 4, !tbaa !5
  br label %.preheader.1

.preheader.1:                                     ; preds = %._crit_edge, %.lr.ph104
  %.lcssa9092 = phi i32 [ %55, %._crit_edge ], [ 14, %.lr.ph104 ]
  %56 = load i32, ptr getelementptr inbounds (i8, ptr @w, i64 28), align 4, !tbaa !5
  %57 = mul nsw i32 %56, %48
  %58 = sub nsw i32 %44, %57
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [8 x [20001 x i32]], ptr @g, i64 0, i64 6, i64 %59
  %61 = load i32, ptr %60, align 4, !tbaa !5
  %62 = icmp sgt i32 %61, 0
  br i1 %62, label %.lr.ph.1, label %.preheader.2

.lr.ph.1:                                         ; preds = %.preheader.1
  %63 = add i32 %45, -6
  %64 = sext i32 %.lcssa9092 to i64
  %65 = zext nneg i32 %61 to i64
  %min.iters.check228 = icmp ult i32 %61, 8
  br i1 %min.iters.check228, label %scalar.ph227.preheader, label %vector.ph229

vector.ph229:                                     ; preds = %.lr.ph.1
  %n.vec231 = and i64 %65, 2147483640
  %ind.end232 = add nsw i64 %n.vec231, %64
  %ind.end234 = trunc nuw nsw i64 %n.vec231 to i32
  %broadcast.splatinsert239 = insertelement <4 x i32> poison, i32 %63, i64 0
  %broadcast.splat240 = shufflevector <4 x i32> %broadcast.splatinsert239, <4 x i32> poison, <4 x i32> zeroinitializer
  br label %vector.body236

vector.body236:                                   ; preds = %vector.body236, %vector.ph229
  %index237 = phi i64 [ 0, %vector.ph229 ], [ %index.next241, %vector.body236 ]
  %offset.idx238 = add i64 %index237, %64
  %66 = getelementptr inbounds [41 x i32], ptr @out, i64 0, i64 %offset.idx238
  %67 = getelementptr inbounds i8, ptr %66, i64 16
  store <4 x i32> %broadcast.splat240, ptr %66, align 4, !tbaa !5
  store <4 x i32> %broadcast.splat240, ptr %67, align 4, !tbaa !5
  %index.next241 = add nuw i64 %index237, 8
  %68 = icmp eq i64 %index.next241, %n.vec231
  br i1 %68, label %middle.block226, label %vector.body236, !llvm.loop !17

middle.block226:                                  ; preds = %vector.body236
  %cmp.n242 = icmp eq i64 %n.vec231, %65
  br i1 %cmp.n242, label %._crit_edge.1, label %scalar.ph227.preheader

scalar.ph227.preheader:                           ; preds = %middle.block226, %.lr.ph.1
  %indvars.iv125.1.ph = phi i64 [ %64, %.lr.ph.1 ], [ %ind.end232, %middle.block226 ]
  %.06488.1.ph = phi i32 [ 0, %.lr.ph.1 ], [ %ind.end234, %middle.block226 ]
  br label %scalar.ph227

scalar.ph227:                                     ; preds = %scalar.ph227.preheader, %scalar.ph227
  %indvars.iv125.1 = phi i64 [ %indvars.iv.next126.1, %scalar.ph227 ], [ %indvars.iv125.1.ph, %scalar.ph227.preheader ]
  %.06488.1 = phi i32 [ %70, %scalar.ph227 ], [ %.06488.1.ph, %scalar.ph227.preheader ]
  %indvars.iv.next126.1 = add nsw i64 %indvars.iv125.1, 1
  %69 = getelementptr inbounds [41 x i32], ptr @out, i64 0, i64 %indvars.iv125.1
  store i32 %63, ptr %69, align 4, !tbaa !5
  %70 = add nuw nsw i32 %.06488.1, 1
  %exitcond128.1.not = icmp eq i32 %70, %61
  br i1 %exitcond128.1.not, label %._crit_edge.1, label %scalar.ph227, !llvm.loop !18

._crit_edge.1:                                    ; preds = %scalar.ph227, %middle.block226
  %indvars.iv.next126.1.lcssa = phi i64 [ %ind.end232, %middle.block226 ], [ %indvars.iv.next126.1, %scalar.ph227 ]
  %71 = trunc nsw i64 %indvars.iv.next126.1.lcssa to i32
  store i32 %71, ptr @sz, align 4, !tbaa !5
  br label %.preheader.2

.preheader.2:                                     ; preds = %._crit_edge.1, %.preheader.1
  %.lcssa9092.1 = phi i32 [ %71, %._crit_edge.1 ], [ %.lcssa9092, %.preheader.1 ]
  %72 = load i32, ptr getelementptr inbounds (i8, ptr @w, i64 24), align 8, !tbaa !5
  %73 = mul nsw i32 %72, %61
  %74 = sub nsw i32 %58, %73
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [8 x [20001 x i32]], ptr @g, i64 0, i64 5, i64 %75
  %77 = load i32, ptr %76, align 4, !tbaa !5
  %78 = icmp sgt i32 %77, 0
  br i1 %78, label %.lr.ph.2, label %.preheader.3

.lr.ph.2:                                         ; preds = %.preheader.2
  %79 = add i32 %45, -5
  %80 = sext i32 %.lcssa9092.1 to i64
  %81 = zext nneg i32 %77 to i64
  %min.iters.check211 = icmp ult i32 %77, 8
  br i1 %min.iters.check211, label %scalar.ph210.preheader, label %vector.ph212

vector.ph212:                                     ; preds = %.lr.ph.2
  %n.vec214 = and i64 %81, 2147483640
  %ind.end215 = add nsw i64 %n.vec214, %80
  %ind.end217 = trunc nuw nsw i64 %n.vec214 to i32
  %broadcast.splatinsert222 = insertelement <4 x i32> poison, i32 %79, i64 0
  %broadcast.splat223 = shufflevector <4 x i32> %broadcast.splatinsert222, <4 x i32> poison, <4 x i32> zeroinitializer
  br label %vector.body219

vector.body219:                                   ; preds = %vector.body219, %vector.ph212
  %index220 = phi i64 [ 0, %vector.ph212 ], [ %index.next224, %vector.body219 ]
  %offset.idx221 = add i64 %index220, %80
  %82 = getelementptr inbounds [41 x i32], ptr @out, i64 0, i64 %offset.idx221
  %83 = getelementptr inbounds i8, ptr %82, i64 16
  store <4 x i32> %broadcast.splat223, ptr %82, align 4, !tbaa !5
  store <4 x i32> %broadcast.splat223, ptr %83, align 4, !tbaa !5
  %index.next224 = add nuw i64 %index220, 8
  %84 = icmp eq i64 %index.next224, %n.vec214
  br i1 %84, label %middle.block209, label %vector.body219, !llvm.loop !19

middle.block209:                                  ; preds = %vector.body219
  %cmp.n225 = icmp eq i64 %n.vec214, %81
  br i1 %cmp.n225, label %._crit_edge.2, label %scalar.ph210.preheader

scalar.ph210.preheader:                           ; preds = %middle.block209, %.lr.ph.2
  %indvars.iv125.2.ph = phi i64 [ %80, %.lr.ph.2 ], [ %ind.end215, %middle.block209 ]
  %.06488.2.ph = phi i32 [ 0, %.lr.ph.2 ], [ %ind.end217, %middle.block209 ]
  br label %scalar.ph210

scalar.ph210:                                     ; preds = %scalar.ph210.preheader, %scalar.ph210
  %indvars.iv125.2 = phi i64 [ %indvars.iv.next126.2, %scalar.ph210 ], [ %indvars.iv125.2.ph, %scalar.ph210.preheader ]
  %.06488.2 = phi i32 [ %86, %scalar.ph210 ], [ %.06488.2.ph, %scalar.ph210.preheader ]
  %indvars.iv.next126.2 = add nsw i64 %indvars.iv125.2, 1
  %85 = getelementptr inbounds [41 x i32], ptr @out, i64 0, i64 %indvars.iv125.2
  store i32 %79, ptr %85, align 4, !tbaa !5
  %86 = add nuw nsw i32 %.06488.2, 1
  %exitcond128.2.not = icmp eq i32 %86, %77
  br i1 %exitcond128.2.not, label %._crit_edge.2, label %scalar.ph210, !llvm.loop !20

._crit_edge.2:                                    ; preds = %scalar.ph210, %middle.block209
  %indvars.iv.next126.2.lcssa = phi i64 [ %ind.end215, %middle.block209 ], [ %indvars.iv.next126.2, %scalar.ph210 ]
  %87 = trunc nsw i64 %indvars.iv.next126.2.lcssa to i32
  store i32 %87, ptr @sz, align 4, !tbaa !5
  br label %.preheader.3

.preheader.3:                                     ; preds = %._crit_edge.2, %.preheader.2
  %.lcssa9092.2 = phi i32 [ %87, %._crit_edge.2 ], [ %.lcssa9092.1, %.preheader.2 ]
  %88 = load i32, ptr getelementptr inbounds (i8, ptr @w, i64 20), align 4, !tbaa !5
  %89 = mul nsw i32 %88, %77
  %90 = sub nsw i32 %74, %89
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [8 x [20001 x i32]], ptr @g, i64 0, i64 4, i64 %91
  %93 = load i32, ptr %92, align 4, !tbaa !5
  %94 = icmp sgt i32 %93, 0
  br i1 %94, label %.lr.ph.3, label %.preheader.4

.lr.ph.3:                                         ; preds = %.preheader.3
  %95 = add i32 %45, -4
  %96 = sext i32 %.lcssa9092.2 to i64
  %97 = zext nneg i32 %93 to i64
  %min.iters.check194 = icmp ult i32 %93, 8
  br i1 %min.iters.check194, label %scalar.ph193.preheader, label %vector.ph195

vector.ph195:                                     ; preds = %.lr.ph.3
  %n.vec197 = and i64 %97, 2147483640
  %ind.end198 = add nsw i64 %n.vec197, %96
  %ind.end200 = trunc nuw nsw i64 %n.vec197 to i32
  %broadcast.splatinsert205 = insertelement <4 x i32> poison, i32 %95, i64 0
  %broadcast.splat206 = shufflevector <4 x i32> %broadcast.splatinsert205, <4 x i32> poison, <4 x i32> zeroinitializer
  br label %vector.body202

vector.body202:                                   ; preds = %vector.body202, %vector.ph195
  %index203 = phi i64 [ 0, %vector.ph195 ], [ %index.next207, %vector.body202 ]
  %offset.idx204 = add i64 %index203, %96
  %98 = getelementptr inbounds [41 x i32], ptr @out, i64 0, i64 %offset.idx204
  %99 = getelementptr inbounds i8, ptr %98, i64 16
  store <4 x i32> %broadcast.splat206, ptr %98, align 4, !tbaa !5
  store <4 x i32> %broadcast.splat206, ptr %99, align 4, !tbaa !5
  %index.next207 = add nuw i64 %index203, 8
  %100 = icmp eq i64 %index.next207, %n.vec197
  br i1 %100, label %middle.block192, label %vector.body202, !llvm.loop !21

middle.block192:                                  ; preds = %vector.body202
  %cmp.n208 = icmp eq i64 %n.vec197, %97
  br i1 %cmp.n208, label %._crit_edge.3, label %scalar.ph193.preheader

scalar.ph193.preheader:                           ; preds = %middle.block192, %.lr.ph.3
  %indvars.iv125.3.ph = phi i64 [ %96, %.lr.ph.3 ], [ %ind.end198, %middle.block192 ]
  %.06488.3.ph = phi i32 [ 0, %.lr.ph.3 ], [ %ind.end200, %middle.block192 ]
  br label %scalar.ph193

scalar.ph193:                                     ; preds = %scalar.ph193.preheader, %scalar.ph193
  %indvars.iv125.3 = phi i64 [ %indvars.iv.next126.3, %scalar.ph193 ], [ %indvars.iv125.3.ph, %scalar.ph193.preheader ]
  %.06488.3 = phi i32 [ %102, %scalar.ph193 ], [ %.06488.3.ph, %scalar.ph193.preheader ]
  %indvars.iv.next126.3 = add nsw i64 %indvars.iv125.3, 1
  %101 = getelementptr inbounds [41 x i32], ptr @out, i64 0, i64 %indvars.iv125.3
  store i32 %95, ptr %101, align 4, !tbaa !5
  %102 = add nuw nsw i32 %.06488.3, 1
  %exitcond128.3.not = icmp eq i32 %102, %93
  br i1 %exitcond128.3.not, label %._crit_edge.3, label %scalar.ph193, !llvm.loop !22

._crit_edge.3:                                    ; preds = %scalar.ph193, %middle.block192
  %indvars.iv.next126.3.lcssa = phi i64 [ %ind.end198, %middle.block192 ], [ %indvars.iv.next126.3, %scalar.ph193 ]
  %103 = trunc nsw i64 %indvars.iv.next126.3.lcssa to i32
  store i32 %103, ptr @sz, align 4, !tbaa !5
  br label %.preheader.4

.preheader.4:                                     ; preds = %._crit_edge.3, %.preheader.3
  %.lcssa9092.3 = phi i32 [ %103, %._crit_edge.3 ], [ %.lcssa9092.2, %.preheader.3 ]
  %104 = load i32, ptr getelementptr inbounds (i8, ptr @w, i64 16), align 16, !tbaa !5
  %105 = mul nsw i32 %104, %93
  %106 = sub nsw i32 %90, %105
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [8 x [20001 x i32]], ptr @g, i64 0, i64 3, i64 %107
  %109 = load i32, ptr %108, align 4, !tbaa !5
  %110 = icmp sgt i32 %109, 0
  br i1 %110, label %.lr.ph.4, label %.preheader.5

.lr.ph.4:                                         ; preds = %.preheader.4
  %111 = add i32 %45, -3
  %112 = sext i32 %.lcssa9092.3 to i64
  %113 = zext nneg i32 %109 to i64
  %min.iters.check177 = icmp ult i32 %109, 8
  br i1 %min.iters.check177, label %scalar.ph176.preheader, label %vector.ph178

vector.ph178:                                     ; preds = %.lr.ph.4
  %n.vec180 = and i64 %113, 2147483640
  %ind.end181 = add nsw i64 %n.vec180, %112
  %ind.end183 = trunc nuw nsw i64 %n.vec180 to i32
  %broadcast.splatinsert188 = insertelement <4 x i32> poison, i32 %111, i64 0
  %broadcast.splat189 = shufflevector <4 x i32> %broadcast.splatinsert188, <4 x i32> poison, <4 x i32> zeroinitializer
  br label %vector.body185

vector.body185:                                   ; preds = %vector.body185, %vector.ph178
  %index186 = phi i64 [ 0, %vector.ph178 ], [ %index.next190, %vector.body185 ]
  %offset.idx187 = add i64 %index186, %112
  %114 = getelementptr inbounds [41 x i32], ptr @out, i64 0, i64 %offset.idx187
  %115 = getelementptr inbounds i8, ptr %114, i64 16
  store <4 x i32> %broadcast.splat189, ptr %114, align 4, !tbaa !5
  store <4 x i32> %broadcast.splat189, ptr %115, align 4, !tbaa !5
  %index.next190 = add nuw i64 %index186, 8
  %116 = icmp eq i64 %index.next190, %n.vec180
  br i1 %116, label %middle.block175, label %vector.body185, !llvm.loop !23

middle.block175:                                  ; preds = %vector.body185
  %cmp.n191 = icmp eq i64 %n.vec180, %113
  br i1 %cmp.n191, label %._crit_edge.4, label %scalar.ph176.preheader

scalar.ph176.preheader:                           ; preds = %middle.block175, %.lr.ph.4
  %indvars.iv125.4.ph = phi i64 [ %112, %.lr.ph.4 ], [ %ind.end181, %middle.block175 ]
  %.06488.4.ph = phi i32 [ 0, %.lr.ph.4 ], [ %ind.end183, %middle.block175 ]
  br label %scalar.ph176

scalar.ph176:                                     ; preds = %scalar.ph176.preheader, %scalar.ph176
  %indvars.iv125.4 = phi i64 [ %indvars.iv.next126.4, %scalar.ph176 ], [ %indvars.iv125.4.ph, %scalar.ph176.preheader ]
  %.06488.4 = phi i32 [ %118, %scalar.ph176 ], [ %.06488.4.ph, %scalar.ph176.preheader ]
  %indvars.iv.next126.4 = add nsw i64 %indvars.iv125.4, 1
  %117 = getelementptr inbounds [41 x i32], ptr @out, i64 0, i64 %indvars.iv125.4
  store i32 %111, ptr %117, align 4, !tbaa !5
  %118 = add nuw nsw i32 %.06488.4, 1
  %exitcond128.4.not = icmp eq i32 %118, %109
  br i1 %exitcond128.4.not, label %._crit_edge.4, label %scalar.ph176, !llvm.loop !24

._crit_edge.4:                                    ; preds = %scalar.ph176, %middle.block175
  %indvars.iv.next126.4.lcssa = phi i64 [ %ind.end181, %middle.block175 ], [ %indvars.iv.next126.4, %scalar.ph176 ]
  %119 = trunc nsw i64 %indvars.iv.next126.4.lcssa to i32
  store i32 %119, ptr @sz, align 4, !tbaa !5
  br label %.preheader.5

.preheader.5:                                     ; preds = %._crit_edge.4, %.preheader.4
  %.lcssa9092.4 = phi i32 [ %119, %._crit_edge.4 ], [ %.lcssa9092.3, %.preheader.4 ]
  %120 = load i32, ptr getelementptr inbounds (i8, ptr @w, i64 12), align 4, !tbaa !5
  %121 = mul nsw i32 %120, %109
  %122 = sub nsw i32 %106, %121
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds [8 x [20001 x i32]], ptr @g, i64 0, i64 2, i64 %123
  %125 = load i32, ptr %124, align 4, !tbaa !5
  %126 = icmp sgt i32 %125, 0
  br i1 %126, label %.lr.ph.5, label %.preheader.6

.lr.ph.5:                                         ; preds = %.preheader.5
  %127 = add i32 %45, -2
  %128 = sext i32 %.lcssa9092.4 to i64
  %129 = zext nneg i32 %125 to i64
  %min.iters.check160 = icmp ult i32 %125, 8
  br i1 %min.iters.check160, label %scalar.ph159.preheader, label %vector.ph161

vector.ph161:                                     ; preds = %.lr.ph.5
  %n.vec163 = and i64 %129, 2147483640
  %ind.end164 = add nsw i64 %n.vec163, %128
  %ind.end166 = trunc nuw nsw i64 %n.vec163 to i32
  %broadcast.splatinsert171 = insertelement <4 x i32> poison, i32 %127, i64 0
  %broadcast.splat172 = shufflevector <4 x i32> %broadcast.splatinsert171, <4 x i32> poison, <4 x i32> zeroinitializer
  br label %vector.body168

vector.body168:                                   ; preds = %vector.body168, %vector.ph161
  %index169 = phi i64 [ 0, %vector.ph161 ], [ %index.next173, %vector.body168 ]
  %offset.idx170 = add i64 %index169, %128
  %130 = getelementptr inbounds [41 x i32], ptr @out, i64 0, i64 %offset.idx170
  %131 = getelementptr inbounds i8, ptr %130, i64 16
  store <4 x i32> %broadcast.splat172, ptr %130, align 4, !tbaa !5
  store <4 x i32> %broadcast.splat172, ptr %131, align 4, !tbaa !5
  %index.next173 = add nuw i64 %index169, 8
  %132 = icmp eq i64 %index.next173, %n.vec163
  br i1 %132, label %middle.block158, label %vector.body168, !llvm.loop !25

middle.block158:                                  ; preds = %vector.body168
  %cmp.n174 = icmp eq i64 %n.vec163, %129
  br i1 %cmp.n174, label %._crit_edge.5, label %scalar.ph159.preheader

scalar.ph159.preheader:                           ; preds = %middle.block158, %.lr.ph.5
  %indvars.iv125.5.ph = phi i64 [ %128, %.lr.ph.5 ], [ %ind.end164, %middle.block158 ]
  %.06488.5.ph = phi i32 [ 0, %.lr.ph.5 ], [ %ind.end166, %middle.block158 ]
  br label %scalar.ph159

scalar.ph159:                                     ; preds = %scalar.ph159.preheader, %scalar.ph159
  %indvars.iv125.5 = phi i64 [ %indvars.iv.next126.5, %scalar.ph159 ], [ %indvars.iv125.5.ph, %scalar.ph159.preheader ]
  %.06488.5 = phi i32 [ %134, %scalar.ph159 ], [ %.06488.5.ph, %scalar.ph159.preheader ]
  %indvars.iv.next126.5 = add nsw i64 %indvars.iv125.5, 1
  %133 = getelementptr inbounds [41 x i32], ptr @out, i64 0, i64 %indvars.iv125.5
  store i32 %127, ptr %133, align 4, !tbaa !5
  %134 = add nuw nsw i32 %.06488.5, 1
  %exitcond128.5.not = icmp eq i32 %134, %125
  br i1 %exitcond128.5.not, label %._crit_edge.5, label %scalar.ph159, !llvm.loop !26

._crit_edge.5:                                    ; preds = %scalar.ph159, %middle.block158
  %indvars.iv.next126.5.lcssa = phi i64 [ %ind.end164, %middle.block158 ], [ %indvars.iv.next126.5, %scalar.ph159 ]
  %135 = trunc nsw i64 %indvars.iv.next126.5.lcssa to i32
  store i32 %135, ptr @sz, align 4, !tbaa !5
  br label %.preheader.6

.preheader.6:                                     ; preds = %._crit_edge.5, %.preheader.5
  %.lcssa9092.5 = phi i32 [ %135, %._crit_edge.5 ], [ %.lcssa9092.4, %.preheader.5 ]
  %136 = load i32, ptr getelementptr inbounds (i8, ptr @w, i64 8), align 8, !tbaa !5
  %137 = mul nsw i32 %136, %125
  %138 = sub nsw i32 %122, %137
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds [8 x [20001 x i32]], ptr @g, i64 0, i64 1, i64 %139
  %141 = load i32, ptr %140, align 4, !tbaa !5
  %142 = icmp sgt i32 %141, 0
  br i1 %142, label %.lr.ph.6, label %.preheader.7

.lr.ph.6:                                         ; preds = %.preheader.6
  %143 = add i32 %45, -1
  %144 = sext i32 %.lcssa9092.5 to i64
  %145 = zext nneg i32 %141 to i64
  %min.iters.check143 = icmp ult i32 %141, 8
  br i1 %min.iters.check143, label %scalar.ph142.preheader, label %vector.ph144

vector.ph144:                                     ; preds = %.lr.ph.6
  %n.vec146 = and i64 %145, 2147483640
  %ind.end147 = add nsw i64 %n.vec146, %144
  %ind.end149 = trunc nuw nsw i64 %n.vec146 to i32
  %broadcast.splatinsert154 = insertelement <4 x i32> poison, i32 %143, i64 0
  %broadcast.splat155 = shufflevector <4 x i32> %broadcast.splatinsert154, <4 x i32> poison, <4 x i32> zeroinitializer
  br label %vector.body151

vector.body151:                                   ; preds = %vector.body151, %vector.ph144
  %index152 = phi i64 [ 0, %vector.ph144 ], [ %index.next156, %vector.body151 ]
  %offset.idx153 = add i64 %index152, %144
  %146 = getelementptr inbounds [41 x i32], ptr @out, i64 0, i64 %offset.idx153
  %147 = getelementptr inbounds i8, ptr %146, i64 16
  store <4 x i32> %broadcast.splat155, ptr %146, align 4, !tbaa !5
  store <4 x i32> %broadcast.splat155, ptr %147, align 4, !tbaa !5
  %index.next156 = add nuw i64 %index152, 8
  %148 = icmp eq i64 %index.next156, %n.vec146
  br i1 %148, label %middle.block141, label %vector.body151, !llvm.loop !27

middle.block141:                                  ; preds = %vector.body151
  %cmp.n157 = icmp eq i64 %n.vec146, %145
  br i1 %cmp.n157, label %._crit_edge.6, label %scalar.ph142.preheader

scalar.ph142.preheader:                           ; preds = %middle.block141, %.lr.ph.6
  %indvars.iv125.6.ph = phi i64 [ %144, %.lr.ph.6 ], [ %ind.end147, %middle.block141 ]
  %.06488.6.ph = phi i32 [ 0, %.lr.ph.6 ], [ %ind.end149, %middle.block141 ]
  br label %scalar.ph142

scalar.ph142:                                     ; preds = %scalar.ph142.preheader, %scalar.ph142
  %indvars.iv125.6 = phi i64 [ %indvars.iv.next126.6, %scalar.ph142 ], [ %indvars.iv125.6.ph, %scalar.ph142.preheader ]
  %.06488.6 = phi i32 [ %150, %scalar.ph142 ], [ %.06488.6.ph, %scalar.ph142.preheader ]
  %indvars.iv.next126.6 = add nsw i64 %indvars.iv125.6, 1
  %149 = getelementptr inbounds [41 x i32], ptr @out, i64 0, i64 %indvars.iv125.6
  store i32 %143, ptr %149, align 4, !tbaa !5
  %150 = add nuw nsw i32 %.06488.6, 1
  %exitcond128.6.not = icmp eq i32 %150, %141
  br i1 %exitcond128.6.not, label %._crit_edge.6, label %scalar.ph142, !llvm.loop !28

._crit_edge.6:                                    ; preds = %scalar.ph142, %middle.block141
  %indvars.iv.next126.6.lcssa = phi i64 [ %ind.end147, %middle.block141 ], [ %indvars.iv.next126.6, %scalar.ph142 ]
  %151 = trunc nsw i64 %indvars.iv.next126.6.lcssa to i32
  store i32 %151, ptr @sz, align 4, !tbaa !5
  br label %.preheader.7

.preheader.7:                                     ; preds = %._crit_edge.6, %.preheader.6
  %.lcssa9092.6 = phi i32 [ %151, %._crit_edge.6 ], [ %.lcssa9092.5, %.preheader.6 ]
  %152 = load i32, ptr getelementptr inbounds (i8, ptr @w, i64 4), align 4, !tbaa !5
  %153 = mul nsw i32 %152, %141
  %154 = sub nsw i32 %138, %153
  %155 = sext i32 %154 to i64
  %156 = getelementptr inbounds [8 x [20001 x i32]], ptr @g, i64 0, i64 0, i64 %155
  %157 = load i32, ptr %156, align 4, !tbaa !5
  %158 = icmp sgt i32 %157, 0
  br i1 %158, label %.lr.ph.7, label %167

.lr.ph.7:                                         ; preds = %.preheader.7
  %159 = sext i32 %.lcssa9092.6 to i64
  %160 = zext nneg i32 %157 to i64
  %min.iters.check = icmp ult i32 %157, 8
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph.7
  %n.vec = and i64 %160, 2147483640
  %ind.end = add nsw i64 %n.vec, %159
  %ind.end139 = trunc nuw nsw i64 %n.vec to i32
  %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %45, i64 0
  %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %offset.idx = add i64 %index, %159
  %161 = getelementptr inbounds [41 x i32], ptr @out, i64 0, i64 %offset.idx
  %162 = getelementptr inbounds i8, ptr %161, i64 16
  store <4 x i32> %broadcast.splat, ptr %161, align 4, !tbaa !5
  store <4 x i32> %broadcast.splat, ptr %162, align 4, !tbaa !5
  %index.next = add nuw i64 %index, 8
  %163 = icmp eq i64 %index.next, %n.vec
  br i1 %163, label %middle.block, label %vector.body, !llvm.loop !29

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %160
  br i1 %cmp.n, label %._crit_edge.7, label %scalar.ph.preheader

scalar.ph.preheader:                              ; preds = %middle.block, %.lr.ph.7
  %indvars.iv125.7.ph = phi i64 [ %159, %.lr.ph.7 ], [ %ind.end, %middle.block ]
  %.06488.7.ph = phi i32 [ 0, %.lr.ph.7 ], [ %ind.end139, %middle.block ]
  br label %scalar.ph

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv125.7 = phi i64 [ %indvars.iv.next126.7, %scalar.ph ], [ %indvars.iv125.7.ph, %scalar.ph.preheader ]
  %.06488.7 = phi i32 [ %165, %scalar.ph ], [ %.06488.7.ph, %scalar.ph.preheader ]
  %indvars.iv.next126.7 = add nsw i64 %indvars.iv125.7, 1
  %164 = getelementptr inbounds [41 x i32], ptr @out, i64 0, i64 %indvars.iv125.7
  store i32 %45, ptr %164, align 4, !tbaa !5
  %165 = add nuw nsw i32 %.06488.7, 1
  %exitcond128.7.not = icmp eq i32 %165, %157
  br i1 %exitcond128.7.not, label %._crit_edge.7, label %scalar.ph, !llvm.loop !30

._crit_edge.7:                                    ; preds = %scalar.ph, %middle.block
  %indvars.iv.next126.7.lcssa = phi i64 [ %ind.end, %middle.block ], [ %indvars.iv.next126.7, %scalar.ph ]
  %166 = trunc nsw i64 %indvars.iv.next126.7.lcssa to i32
  store i32 %166, ptr @sz, align 4, !tbaa !5
  br label %167

167:                                              ; preds = %._crit_edge.7, %.preheader.7
  %168 = phi i32 [ %166, %._crit_edge.7 ], [ %.lcssa9092.6, %.preheader.7 ]
  %169 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %168)
  %170 = load i32, ptr @sz, align 4, !tbaa !5
  %171 = icmp sgt i32 %170, 0
  br i1 %171, label %.lr.ph99, label %._crit_edge100

scalar.ph244:                                     ; preds = %scalar.ph244.preheader, %scalar.ph244
  %indvars.iv125 = phi i64 [ %indvars.iv.next126, %scalar.ph244 ], [ %indvars.iv125.ph, %scalar.ph244.preheader ]
  %.06488 = phi i32 [ %173, %scalar.ph244 ], [ %.06488.ph, %scalar.ph244.preheader ]
  %indvars.iv.next126 = add nuw nsw i64 %indvars.iv125, 1
  %172 = getelementptr inbounds [41 x i32], ptr @out, i64 0, i64 %indvars.iv125
  store i32 %50, ptr %172, align 4, !tbaa !5
  %173 = add nuw nsw i32 %.06488, 1
  %exitcond128.not = icmp eq i32 %173, %48
  br i1 %exitcond128.not, label %._crit_edge, label %scalar.ph244, !llvm.loop !31

._crit_edge100:                                   ; preds = %.lr.ph99, %167
  %174 = add nuw nsw i32 %.068102, 1
  %175 = load i32, ptr @t, align 4, !tbaa !5
  %.not.not = icmp slt i32 %.068102, %175
  br i1 %.not.not, label %.lr.ph104, label %._crit_edge105, !llvm.loop !32

.lr.ph99:                                         ; preds = %167, %.lr.ph99
  %indvars.iv132 = phi i64 [ %indvars.iv.next133, %.lr.ph99 ], [ 0, %167 ]
  %176 = phi i32 [ %187, %.lr.ph99 ], [ %170, %167 ]
  %177 = getelementptr inbounds [41 x i32], ptr @out, i64 0, i64 %indvars.iv132
  %178 = load i32, ptr %177, align 4, !tbaa !5
  %179 = add nsw i32 %176, -1
  %180 = zext i32 %179 to i64
  %181 = icmp eq i64 %indvars.iv132, %180
  %182 = zext i1 %181 to i64
  %183 = getelementptr inbounds [3 x i8], ptr @.str.4, i64 0, i64 %182
  %184 = load i8, ptr %183, align 1, !tbaa !33
  %185 = sext i8 %184 to i32
  %186 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %178, i32 noundef %185)
  %indvars.iv.next133 = add nuw nsw i64 %indvars.iv132, 1
  %187 = load i32, ptr @sz, align 4, !tbaa !5
  %188 = sext i32 %187 to i64
  %189 = icmp slt i64 %indvars.iv.next133, %188
  br i1 %189, label %.lr.ph99, label %._crit_edge100, !llvm.loop !34
}

; 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

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

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

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


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