; LLVM IR from tangjz/acm-icpc :: uvalive (7218)

; 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 [40 x i32], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [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 = %275, %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 %278

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 [40 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 [40 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 %6, align 4, !tbaa !5
  %250 = load i32, ptr @sz, align 4, !tbaa !5
  %251 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %249, i32 noundef %250)
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %252

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

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

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

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

274:                                              ; preds = %256
  br label %275

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

278:                                              ; 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 [40 x i32], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [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 {
.preheader80.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 %.preheader80

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

.preheader80.split.us.peel.next:                  ; preds = %.preheader80, %18
  %indvars.iv111 = phi i64 [ %indvars.iv.next112, %18 ], [ 1, %.preheader80 ]
  %4 = getelementptr inbounds [8 x [20001 x i32]], ptr @g, i64 0, i64 0, i64 %indvars.iv111
  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.iv111
  store i32 1061109567, ptr %5, align 4, !tbaa !5
  %.not79.us = icmp slt i64 %indvars.iv111, %3
  br i1 %.not79.us, label %18, label %6

6:                                                ; preds = %.preheader80.split.us.peel.next
  %7 = trunc nuw nsw i64 %indvars.iv111 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, %.preheader80.split.us.peel.next
  %indvars.iv.next112 = add nuw nsw i64 %indvars.iv111, 1
  %exitcond114.not = icmp eq i64 %indvars.iv.next112, 20001
  br i1 %exitcond114.not, label %.split.us, label %.preheader80.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
  %.not102 = icmp slt i32 %21, 1
  br i1 %.not102, label %._crit_edge106, label %.lr.ph105

.split.us:                                        ; preds = %42, %18
  %indvars.iv.next117 = add nuw nsw i64 %indvars.iv116, 1
  %exitcond119.not = icmp eq i64 %indvars.iv.next117, 8
  br i1 %exitcond119.not, label %19, label %.preheader80, !llvm.loop !12

.preheader80.split.preheader:                     ; preds = %.preheader80, %42
  %indvars.iv = phi i64 [ %indvars.iv.next, %42 ], [ 0, %.preheader80 ]
  %22 = getelementptr inbounds [8 x [20001 x i32]], ptr @g, i64 0, i64 %indvars.iv116, 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.iv116, 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 = %.preheader80.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, %.preheader80.split.preheader
  %29 = phi i32 [ %25, %27 ], [ 1061109567, %.preheader80.split.preheader ]
  %.not79 = icmp slt i64 %indvars.iv, %3
  br i1 %.not79, 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.iv116, 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.iv116, 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 %.preheader80.split.preheader, !llvm.loop !13

._crit_edge106:                                   ; preds = %._crit_edge101, %19
  ret i32 0

.lr.ph105:                                        ; preds = %19, %._crit_edge101
  %.069103 = phi i32 [ %174, %._crit_edge101 ], [ 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.ph105
  %50 = add i32 %45, -7
  %51 = zext nneg i32 %48 to i64
  %min.iters.check246 = icmp ult i32 %48, 8
  br i1 %min.iters.check246, label %scalar.ph245.preheader, label %vector.ph247

scalar.ph245.preheader:                           ; preds = %middle.block244, %.lr.ph
  %indvars.iv126.ph = phi i64 [ 14, %.lr.ph ], [ %ind.end250, %middle.block244 ]
  %.06589.ph = phi i32 [ 0, %.lr.ph ], [ %ind.end252, %middle.block244 ]
  br label %scalar.ph245

vector.ph247:                                     ; preds = %.lr.ph
  %n.vec249 = and i64 %51, 2147483640
  %ind.end250 = add nuw nsw i64 %n.vec249, 14
  %ind.end252 = trunc nuw nsw i64 %n.vec249 to i32
  %broadcast.splatinsert257 = insertelement <4 x i32> poison, i32 %50, i64 0
  %broadcast.splat258 = shufflevector <4 x i32> %broadcast.splatinsert257, <4 x i32> poison, <4 x i32> zeroinitializer
  br label %vector.body254

vector.body254:                                   ; preds = %vector.body254, %vector.ph247
  %index255 = phi i64 [ 0, %vector.ph247 ], [ %index.next259, %vector.body254 ]
  %offset.idx256 = add i64 %index255, 14
  %52 = getelementptr inbounds [40 x i32], ptr @out, i64 0, i64 %offset.idx256
  %53 = getelementptr inbounds i8, ptr %52, i64 16
  store <4 x i32> %broadcast.splat258, ptr %52, align 8, !tbaa !5
  store <4 x i32> %broadcast.splat258, ptr %53, align 8, !tbaa !5
  %index.next259 = add nuw i64 %index255, 8
  %54 = icmp eq i64 %index.next259, %n.vec249
  br i1 %54, label %middle.block244, label %vector.body254, !llvm.loop !14

middle.block244:                                  ; preds = %vector.body254
  %cmp.n260 = icmp eq i64 %n.vec249, %51
  br i1 %cmp.n260, label %._crit_edge, label %scalar.ph245.preheader

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

.preheader.1:                                     ; preds = %._crit_edge, %.lr.ph105
  %.lcssa9193 = phi i32 [ %55, %._crit_edge ], [ 14, %.lr.ph105 ]
  %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 %.lcssa9193 to i64
  %65 = zext nneg i32 %61 to i64
  %min.iters.check229 = icmp ult i32 %61, 8
  br i1 %min.iters.check229, label %scalar.ph228.preheader, label %vector.ph230

vector.ph230:                                     ; preds = %.lr.ph.1
  %n.vec232 = and i64 %65, 2147483640
  %ind.end233 = add nsw i64 %n.vec232, %64
  %ind.end235 = trunc nuw nsw i64 %n.vec232 to i32
  %broadcast.splatinsert240 = insertelement <4 x i32> poison, i32 %63, i64 0
  %broadcast.splat241 = shufflevector <4 x i32> %broadcast.splatinsert240, <4 x i32> poison, <4 x i32> zeroinitializer
  br label %vector.body237

vector.body237:                                   ; preds = %vector.body237, %vector.ph230
  %index238 = phi i64 [ 0, %vector.ph230 ], [ %index.next242, %vector.body237 ]
  %offset.idx239 = add i64 %index238, %64
  %66 = getelementptr inbounds [40 x i32], ptr @out, i64 0, i64 %offset.idx239
  %67 = getelementptr inbounds i8, ptr %66, i64 16
  store <4 x i32> %broadcast.splat241, ptr %66, align 4, !tbaa !5
  store <4 x i32> %broadcast.splat241, ptr %67, align 4, !tbaa !5
  %index.next242 = add nuw i64 %index238, 8
  %68 = icmp eq i64 %index.next242, %n.vec232
  br i1 %68, label %middle.block227, label %vector.body237, !llvm.loop !17

middle.block227:                                  ; preds = %vector.body237
  %cmp.n243 = icmp eq i64 %n.vec232, %65
  br i1 %cmp.n243, label %._crit_edge.1, label %scalar.ph228.preheader

scalar.ph228.preheader:                           ; preds = %middle.block227, %.lr.ph.1
  %indvars.iv126.1.ph = phi i64 [ %64, %.lr.ph.1 ], [ %ind.end233, %middle.block227 ]
  %.06589.1.ph = phi i32 [ 0, %.lr.ph.1 ], [ %ind.end235, %middle.block227 ]
  br label %scalar.ph228

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

._crit_edge.1:                                    ; preds = %scalar.ph228, %middle.block227
  %indvars.iv.next127.1.lcssa = phi i64 [ %ind.end233, %middle.block227 ], [ %indvars.iv.next127.1, %scalar.ph228 ]
  %71 = trunc nsw i64 %indvars.iv.next127.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
  %.lcssa9193.1 = phi i32 [ %71, %._crit_edge.1 ], [ %.lcssa9193, %.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 %.lcssa9193.1 to i64
  %81 = zext nneg i32 %77 to i64
  %min.iters.check212 = icmp ult i32 %77, 8
  br i1 %min.iters.check212, label %scalar.ph211.preheader, label %vector.ph213

vector.ph213:                                     ; preds = %.lr.ph.2
  %n.vec215 = and i64 %81, 2147483640
  %ind.end216 = add nsw i64 %n.vec215, %80
  %ind.end218 = trunc nuw nsw i64 %n.vec215 to i32
  %broadcast.splatinsert223 = insertelement <4 x i32> poison, i32 %79, i64 0
  %broadcast.splat224 = shufflevector <4 x i32> %broadcast.splatinsert223, <4 x i32> poison, <4 x i32> zeroinitializer
  br label %vector.body220

vector.body220:                                   ; preds = %vector.body220, %vector.ph213
  %index221 = phi i64 [ 0, %vector.ph213 ], [ %index.next225, %vector.body220 ]
  %offset.idx222 = add i64 %index221, %80
  %82 = getelementptr inbounds [40 x i32], ptr @out, i64 0, i64 %offset.idx222
  %83 = getelementptr inbounds i8, ptr %82, i64 16
  store <4 x i32> %broadcast.splat224, ptr %82, align 4, !tbaa !5
  store <4 x i32> %broadcast.splat224, ptr %83, align 4, !tbaa !5
  %index.next225 = add nuw i64 %index221, 8
  %84 = icmp eq i64 %index.next225, %n.vec215
  br i1 %84, label %middle.block210, label %vector.body220, !llvm.loop !19

middle.block210:                                  ; preds = %vector.body220
  %cmp.n226 = icmp eq i64 %n.vec215, %81
  br i1 %cmp.n226, label %._crit_edge.2, label %scalar.ph211.preheader

scalar.ph211.preheader:                           ; preds = %middle.block210, %.lr.ph.2
  %indvars.iv126.2.ph = phi i64 [ %80, %.lr.ph.2 ], [ %ind.end216, %middle.block210 ]
  %.06589.2.ph = phi i32 [ 0, %.lr.ph.2 ], [ %ind.end218, %middle.block210 ]
  br label %scalar.ph211

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

._crit_edge.2:                                    ; preds = %scalar.ph211, %middle.block210
  %indvars.iv.next127.2.lcssa = phi i64 [ %ind.end216, %middle.block210 ], [ %indvars.iv.next127.2, %scalar.ph211 ]
  %87 = trunc nsw i64 %indvars.iv.next127.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
  %.lcssa9193.2 = phi i32 [ %87, %._crit_edge.2 ], [ %.lcssa9193.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 %.lcssa9193.2 to i64
  %97 = zext nneg i32 %93 to i64
  %min.iters.check195 = icmp ult i32 %93, 8
  br i1 %min.iters.check195, label %scalar.ph194.preheader, label %vector.ph196

vector.ph196:                                     ; preds = %.lr.ph.3
  %n.vec198 = and i64 %97, 2147483640
  %ind.end199 = add nsw i64 %n.vec198, %96
  %ind.end201 = trunc nuw nsw i64 %n.vec198 to i32
  %broadcast.splatinsert206 = insertelement <4 x i32> poison, i32 %95, i64 0
  %broadcast.splat207 = shufflevector <4 x i32> %broadcast.splatinsert206, <4 x i32> poison, <4 x i32> zeroinitializer
  br label %vector.body203

vector.body203:                                   ; preds = %vector.body203, %vector.ph196
  %index204 = phi i64 [ 0, %vector.ph196 ], [ %index.next208, %vector.body203 ]
  %offset.idx205 = add i64 %index204, %96
  %98 = getelementptr inbounds [40 x i32], ptr @out, i64 0, i64 %offset.idx205
  %99 = getelementptr inbounds i8, ptr %98, i64 16
  store <4 x i32> %broadcast.splat207, ptr %98, align 4, !tbaa !5
  store <4 x i32> %broadcast.splat207, ptr %99, align 4, !tbaa !5
  %index.next208 = add nuw i64 %index204, 8
  %100 = icmp eq i64 %index.next208, %n.vec198
  br i1 %100, label %middle.block193, label %vector.body203, !llvm.loop !21

middle.block193:                                  ; preds = %vector.body203
  %cmp.n209 = icmp eq i64 %n.vec198, %97
  br i1 %cmp.n209, label %._crit_edge.3, label %scalar.ph194.preheader

scalar.ph194.preheader:                           ; preds = %middle.block193, %.lr.ph.3
  %indvars.iv126.3.ph = phi i64 [ %96, %.lr.ph.3 ], [ %ind.end199, %middle.block193 ]
  %.06589.3.ph = phi i32 [ 0, %.lr.ph.3 ], [ %ind.end201, %middle.block193 ]
  br label %scalar.ph194

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

._crit_edge.3:                                    ; preds = %scalar.ph194, %middle.block193
  %indvars.iv.next127.3.lcssa = phi i64 [ %ind.end199, %middle.block193 ], [ %indvars.iv.next127.3, %scalar.ph194 ]
  %103 = trunc nsw i64 %indvars.iv.next127.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
  %.lcssa9193.3 = phi i32 [ %103, %._crit_edge.3 ], [ %.lcssa9193.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 %.lcssa9193.3 to i64
  %113 = zext nneg i32 %109 to i64
  %min.iters.check178 = icmp ult i32 %109, 8
  br i1 %min.iters.check178, label %scalar.ph177.preheader, label %vector.ph179

vector.ph179:                                     ; preds = %.lr.ph.4
  %n.vec181 = and i64 %113, 2147483640
  %ind.end182 = add nsw i64 %n.vec181, %112
  %ind.end184 = trunc nuw nsw i64 %n.vec181 to i32
  %broadcast.splatinsert189 = insertelement <4 x i32> poison, i32 %111, i64 0
  %broadcast.splat190 = shufflevector <4 x i32> %broadcast.splatinsert189, <4 x i32> poison, <4 x i32> zeroinitializer
  br label %vector.body186

vector.body186:                                   ; preds = %vector.body186, %vector.ph179
  %index187 = phi i64 [ 0, %vector.ph179 ], [ %index.next191, %vector.body186 ]
  %offset.idx188 = add i64 %index187, %112
  %114 = getelementptr inbounds [40 x i32], ptr @out, i64 0, i64 %offset.idx188
  %115 = getelementptr inbounds i8, ptr %114, i64 16
  store <4 x i32> %broadcast.splat190, ptr %114, align 4, !tbaa !5
  store <4 x i32> %broadcast.splat190, ptr %115, align 4, !tbaa !5
  %index.next191 = add nuw i64 %index187, 8
  %116 = icmp eq i64 %index.next191, %n.vec181
  br i1 %116, label %middle.block176, label %vector.body186, !llvm.loop !23

middle.block176:                                  ; preds = %vector.body186
  %cmp.n192 = icmp eq i64 %n.vec181, %113
  br i1 %cmp.n192, label %._crit_edge.4, label %scalar.ph177.preheader

scalar.ph177.preheader:                           ; preds = %middle.block176, %.lr.ph.4
  %indvars.iv126.4.ph = phi i64 [ %112, %.lr.ph.4 ], [ %ind.end182, %middle.block176 ]
  %.06589.4.ph = phi i32 [ 0, %.lr.ph.4 ], [ %ind.end184, %middle.block176 ]
  br label %scalar.ph177

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

._crit_edge.4:                                    ; preds = %scalar.ph177, %middle.block176
  %indvars.iv.next127.4.lcssa = phi i64 [ %ind.end182, %middle.block176 ], [ %indvars.iv.next127.4, %scalar.ph177 ]
  %119 = trunc nsw i64 %indvars.iv.next127.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
  %.lcssa9193.4 = phi i32 [ %119, %._crit_edge.4 ], [ %.lcssa9193.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 %.lcssa9193.4 to i64
  %129 = zext nneg i32 %125 to i64
  %min.iters.check161 = icmp ult i32 %125, 8
  br i1 %min.iters.check161, label %scalar.ph160.preheader, label %vector.ph162

vector.ph162:                                     ; preds = %.lr.ph.5
  %n.vec164 = and i64 %129, 2147483640
  %ind.end165 = add nsw i64 %n.vec164, %128
  %ind.end167 = trunc nuw nsw i64 %n.vec164 to i32
  %broadcast.splatinsert172 = insertelement <4 x i32> poison, i32 %127, i64 0
  %broadcast.splat173 = shufflevector <4 x i32> %broadcast.splatinsert172, <4 x i32> poison, <4 x i32> zeroinitializer
  br label %vector.body169

vector.body169:                                   ; preds = %vector.body169, %vector.ph162
  %index170 = phi i64 [ 0, %vector.ph162 ], [ %index.next174, %vector.body169 ]
  %offset.idx171 = add i64 %index170, %128
  %130 = getelementptr inbounds [40 x i32], ptr @out, i64 0, i64 %offset.idx171
  %131 = getelementptr inbounds i8, ptr %130, i64 16
  store <4 x i32> %broadcast.splat173, ptr %130, align 4, !tbaa !5
  store <4 x i32> %broadcast.splat173, ptr %131, align 4, !tbaa !5
  %index.next174 = add nuw i64 %index170, 8
  %132 = icmp eq i64 %index.next174, %n.vec164
  br i1 %132, label %middle.block159, label %vector.body169, !llvm.loop !25

middle.block159:                                  ; preds = %vector.body169
  %cmp.n175 = icmp eq i64 %n.vec164, %129
  br i1 %cmp.n175, label %._crit_edge.5, label %scalar.ph160.preheader

scalar.ph160.preheader:                           ; preds = %middle.block159, %.lr.ph.5
  %indvars.iv126.5.ph = phi i64 [ %128, %.lr.ph.5 ], [ %ind.end165, %middle.block159 ]
  %.06589.5.ph = phi i32 [ 0, %.lr.ph.5 ], [ %ind.end167, %middle.block159 ]
  br label %scalar.ph160

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

._crit_edge.5:                                    ; preds = %scalar.ph160, %middle.block159
  %indvars.iv.next127.5.lcssa = phi i64 [ %ind.end165, %middle.block159 ], [ %indvars.iv.next127.5, %scalar.ph160 ]
  %135 = trunc nsw i64 %indvars.iv.next127.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
  %.lcssa9193.5 = phi i32 [ %135, %._crit_edge.5 ], [ %.lcssa9193.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 %.lcssa9193.5 to i64
  %145 = zext nneg i32 %141 to i64
  %min.iters.check144 = icmp ult i32 %141, 8
  br i1 %min.iters.check144, label %scalar.ph143.preheader, label %vector.ph145

vector.ph145:                                     ; preds = %.lr.ph.6
  %n.vec147 = and i64 %145, 2147483640
  %ind.end148 = add nsw i64 %n.vec147, %144
  %ind.end150 = trunc nuw nsw i64 %n.vec147 to i32
  %broadcast.splatinsert155 = insertelement <4 x i32> poison, i32 %143, i64 0
  %broadcast.splat156 = shufflevector <4 x i32> %broadcast.splatinsert155, <4 x i32> poison, <4 x i32> zeroinitializer
  br label %vector.body152

vector.body152:                                   ; preds = %vector.body152, %vector.ph145
  %index153 = phi i64 [ 0, %vector.ph145 ], [ %index.next157, %vector.body152 ]
  %offset.idx154 = add i64 %index153, %144
  %146 = getelementptr inbounds [40 x i32], ptr @out, i64 0, i64 %offset.idx154
  %147 = getelementptr inbounds i8, ptr %146, i64 16
  store <4 x i32> %broadcast.splat156, ptr %146, align 4, !tbaa !5
  store <4 x i32> %broadcast.splat156, ptr %147, align 4, !tbaa !5
  %index.next157 = add nuw i64 %index153, 8
  %148 = icmp eq i64 %index.next157, %n.vec147
  br i1 %148, label %middle.block142, label %vector.body152, !llvm.loop !27

middle.block142:                                  ; preds = %vector.body152
  %cmp.n158 = icmp eq i64 %n.vec147, %145
  br i1 %cmp.n158, label %._crit_edge.6, label %scalar.ph143.preheader

scalar.ph143.preheader:                           ; preds = %middle.block142, %.lr.ph.6
  %indvars.iv126.6.ph = phi i64 [ %144, %.lr.ph.6 ], [ %ind.end148, %middle.block142 ]
  %.06589.6.ph = phi i32 [ 0, %.lr.ph.6 ], [ %ind.end150, %middle.block142 ]
  br label %scalar.ph143

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

._crit_edge.6:                                    ; preds = %scalar.ph143, %middle.block142
  %indvars.iv.next127.6.lcssa = phi i64 [ %ind.end148, %middle.block142 ], [ %indvars.iv.next127.6, %scalar.ph143 ]
  %151 = trunc nsw i64 %indvars.iv.next127.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
  %.lcssa9193.6 = phi i32 [ %151, %._crit_edge.6 ], [ %.lcssa9193.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 %.lcssa9193.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.end140 = 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 [40 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.iv126.7.ph = phi i64 [ %159, %.lr.ph.7 ], [ %ind.end, %middle.block ]
  %.06589.7.ph = phi i32 [ 0, %.lr.ph.7 ], [ %ind.end140, %middle.block ]
  br label %scalar.ph

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

._crit_edge.7:                                    ; preds = %scalar.ph, %middle.block
  %indvars.iv.next127.7.lcssa = phi i64 [ %ind.end, %middle.block ], [ %indvars.iv.next127.7, %scalar.ph ]
  %166 = trunc nsw i64 %indvars.iv.next127.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 ], [ %.lcssa9193.6, %.preheader.7 ]
  %169 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %.069103, i32 noundef %168)
  %170 = load i32, ptr @sz, align 4, !tbaa !5
  %171 = icmp sgt i32 %170, 0
  br i1 %171, label %.lr.ph100, label %._crit_edge101

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

._crit_edge101:                                   ; preds = %.lr.ph100, %167
  %174 = add nuw nsw i32 %.069103, 1
  %175 = load i32, ptr @t, align 4, !tbaa !5
  %.not.not = icmp slt i32 %.069103, %175
  br i1 %.not.not, label %.lr.ph105, label %._crit_edge106, !llvm.loop !32

.lr.ph100:                                        ; preds = %167, %.lr.ph100
  %indvars.iv133 = phi i64 [ %indvars.iv.next134, %.lr.ph100 ], [ 0, %167 ]
  %176 = phi i32 [ %187, %.lr.ph100 ], [ %170, %167 ]
  %177 = getelementptr inbounds [40 x i32], ptr @out, i64 0, i64 %indvars.iv133
  %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.iv133, %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.next134 = add nuw nsw i64 %indvars.iv133, 1
  %187 = load i32, ptr @sz, align 4, !tbaa !5
  %188 = sext i32 %187 to i64
  %189 = icmp slt i64 %indvars.iv.next134, %188
  br i1 %189, label %.lr.ph100, label %._crit_edge101, !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