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

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

%struct.Edge = type { i32, i32 }
%struct.SparseTable = type { i32, [3 x [3 x i32]], [3 x [3 x i32]] }

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@a = external dso_local global [100003 x i32], align 16
@ord = external dso_local global [100003 x i32], align 16
@dep = external dso_local global [100003 x i32], align 16
@lnk = external dso_local global [100003 x i32], align 16
@e = external dso_local global [200007 x %struct.Edge], align 16
@st = external dso_local global [17 x [100003 x %struct.SparseTable]], align 16
@tot = external dso_local global i32, align 4
@pr = external dso_local global ptr, align 8
@d = external dso_local global ptr, align 8
@inv = external dso_local global ptr, align 8
@val = external dso_local global i32, align 4
@c = external dso_local global ptr, align 8
@mx = external dso_local global i32, align 4
@.str.5 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [3 x i8], align 1
@_ZL4maxm = external hidden constant i32, align 4
@_ZZ4mainE3que = external hidden global [17 x [2 x i32]], align 16
@.str.7 = external hidden unnamed_addr constant [10 x i8], align 1

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

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z3lcaii(i32 noundef, i32 noundef) #3

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #4 {
  %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 %struct.Edge, align 4
  %7 = alloca %struct.Edge, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca [3 x i32], align 4
  %27 = alloca i32, align 4
  %28 = alloca i32, align 4
  %29 = alloca i32, align 4
  %30 = alloca i32, align 4
  %31 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %32 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.5, ptr noundef @n, ptr noundef @m)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #9
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %33

33:                                               ; preds = %56, %0
  %34 = load i32, ptr %2, align 4, !tbaa !5
  %35 = load i32, ptr @n, align 4, !tbaa !5
  %36 = icmp sle i32 %34, %35
  br i1 %36, label %38, label %37

37:                                               ; preds = %33
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #9
  br label %59

38:                                               ; preds = %33
  %39 = load i32, ptr %2, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds i32, ptr @a, i64 %40
  %42 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.6, ptr noundef %41)
  br label %43

43:                                               ; preds = %52, %38
  %44 = load i32, ptr @mx, align 4, !tbaa !5
  %45 = shl i32 1, %44
  %46 = load i32, ptr %2, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [100003 x i32], ptr @a, i64 0, i64 %47
  %49 = load i32, ptr %48, align 4, !tbaa !5
  %50 = icmp sle i32 %45, %49
  br i1 %50, label %51, label %55

51:                                               ; preds = %43
  br label %52

52:                                               ; preds = %51
  %53 = load i32, ptr @mx, align 4, !tbaa !5
  %54 = add nsw i32 %53, 1
  store i32 %54, ptr @mx, align 4, !tbaa !5
  br label %43, !llvm.loop !9

55:                                               ; preds = %43
  br label %56

56:                                               ; preds = %55
  %57 = load i32, ptr %2, align 4, !tbaa !5
  %58 = add nsw i32 %57, 1
  store i32 %58, ptr %2, align 4, !tbaa !5
  br label %33, !llvm.loop !11

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

60:                                               ; preds = %101, %59
  %61 = load i32, ptr %3, align 4, !tbaa !5
  %62 = load i32, ptr @n, align 4, !tbaa !5
  %63 = icmp slt i32 %61, %62
  br i1 %63, label %65, label %64

64:                                               ; preds = %60
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #9
  br label %104

65:                                               ; preds = %60
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #9
  %66 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.5, ptr noundef %4, ptr noundef %5)
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #9
  %67 = getelementptr inbounds %struct.Edge, ptr %6, i32 0, i32 0
  %68 = load i32, ptr %4, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [100003 x i32], ptr @lnk, i64 0, i64 %69
  %71 = load i32, ptr %70, align 4, !tbaa !5
  store i32 %71, ptr %67, align 4, !tbaa !12
  %72 = getelementptr inbounds %struct.Edge, ptr %6, i32 0, i32 1
  %73 = load i32, ptr %5, align 4, !tbaa !5
  store i32 %73, ptr %72, align 4, !tbaa !14
  %74 = load i32, ptr %3, align 4, !tbaa !5
  %75 = shl i32 %74, 1
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [200007 x %struct.Edge], ptr @e, i64 0, i64 %76
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %77, ptr align 4 %6, i64 8, i1 false), !tbaa.struct !15
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #9
  %78 = load i32, ptr %3, align 4, !tbaa !5
  %79 = shl i32 %78, 1
  %80 = load i32, ptr %4, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [100003 x i32], ptr @lnk, i64 0, i64 %81
  store i32 %79, ptr %82, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #9
  %83 = getelementptr inbounds %struct.Edge, ptr %7, i32 0, i32 0
  %84 = load i32, ptr %5, align 4, !tbaa !5
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [100003 x i32], ptr @lnk, i64 0, i64 %85
  %87 = load i32, ptr %86, align 4, !tbaa !5
  store i32 %87, ptr %83, align 4, !tbaa !12
  %88 = getelementptr inbounds %struct.Edge, ptr %7, i32 0, i32 1
  %89 = load i32, ptr %4, align 4, !tbaa !5
  store i32 %89, ptr %88, align 4, !tbaa !14
  %90 = load i32, ptr %3, align 4, !tbaa !5
  %91 = shl i32 %90, 1
  %92 = or i32 %91, 1
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [200007 x %struct.Edge], ptr @e, i64 0, i64 %93
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %94, ptr align 4 %7, i64 8, i1 false), !tbaa.struct !15
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #9
  %95 = load i32, ptr %3, align 4, !tbaa !5
  %96 = shl i32 %95, 1
  %97 = or i32 %96, 1
  %98 = load i32, ptr %5, align 4, !tbaa !5
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [100003 x i32], ptr @lnk, i64 0, i64 %99
  store i32 %97, ptr %100, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #9
  br label %101

101:                                              ; preds = %65
  %102 = load i32, ptr %3, align 4, !tbaa !5
  %103 = add nsw i32 %102, 1
  store i32 %103, ptr %3, align 4, !tbaa !5
  br label %60, !llvm.loop !16

104:                                              ; preds = %64
  %105 = load ptr, ptr @inv, align 8, !tbaa !17
  %106 = getelementptr inbounds i32, ptr %105, i64 1
  store i32 1, ptr %106, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #9
  store i32 2, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #9
  %107 = load i32, ptr @mx, align 4, !tbaa !5
  %108 = shl i32 1, %107
  store i32 %108, ptr %11, align 4, !tbaa !5
  %109 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %11, ptr noundef nonnull align 4 dereferenceable(4) @_ZL4maxm)
  %110 = load i32, ptr %109, align 4, !tbaa !5
  %111 = sub nsw i32 %110, 1
  store i32 %111, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #9
  %112 = load i32, ptr @n, align 4, !tbaa !5
  %113 = load i32, ptr @mx, align 4, !tbaa !5
  %114 = sub nsw i32 %113, 1
  %115 = mul nsw i32 %112, %114
  store i32 %115, ptr %12, align 4, !tbaa !5
  %116 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %10, ptr noundef nonnull align 4 dereferenceable(4) %12)
  %117 = load i32, ptr %116, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #9
  store i32 %117, ptr %9, align 4, !tbaa !5
  br label %118

118:                                              ; preds = %142, %104
  %119 = load i32, ptr %8, align 4, !tbaa !5
  %120 = load i32, ptr %9, align 4, !tbaa !5
  %121 = icmp sle i32 %119, %120
  br i1 %121, label %123, label %122

122:                                              ; preds = %118
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #9
  br label %145

123:                                              ; preds = %118
  %124 = load i32, ptr %8, align 4, !tbaa !5
  %125 = sdiv i32 1000000007, %124
  %126 = sext i32 %125 to i64
  %127 = load ptr, ptr @inv, align 8, !tbaa !17
  %128 = load i32, ptr %8, align 4, !tbaa !5
  %129 = srem i32 1000000007, %128
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds i32, ptr %127, i64 %130
  %132 = load i32, ptr %131, align 4, !tbaa !5
  %133 = sext i32 %132 to i64
  %134 = mul nsw i64 %126, %133
  %135 = srem i64 %134, 1000000007
  %136 = trunc i64 %135 to i32
  %137 = sub nsw i32 1000000007, %136
  %138 = load ptr, ptr @inv, align 8, !tbaa !17
  %139 = load i32, ptr %8, align 4, !tbaa !5
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds i32, ptr %138, i64 %140
  store i32 %137, ptr %141, align 4, !tbaa !5
  br label %142

142:                                              ; preds = %123
  %143 = load i32, ptr %8, align 4, !tbaa !5
  %144 = add nsw i32 %143, 1
  store i32 %144, ptr %8, align 4, !tbaa !5
  br label %118, !llvm.loop !19

145:                                              ; preds = %122
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #9
  store i32 2, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #9
  %146 = load i32, ptr @mx, align 4, !tbaa !5
  %147 = shl i32 1, %146
  store i32 %147, ptr %15, align 4, !tbaa !5
  %148 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %15, ptr noundef nonnull align 4 dereferenceable(4) @_ZL4maxm)
  %149 = load i32, ptr %148, align 4, !tbaa !5
  %150 = sub nsw i32 %149, 1
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #9
  store i32 %150, ptr %14, align 4, !tbaa !5
  br label %151

151:                                              ; preds = %207, %145
  %152 = load i32, ptr %13, align 4, !tbaa !5
  %153 = load i32, ptr %14, align 4, !tbaa !5
  %154 = icmp sle i32 %152, %153
  br i1 %154, label %156, label %155

155:                                              ; preds = %151
  store i32 14, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #9
  br label %210

156:                                              ; preds = %151
  %157 = load ptr, ptr @d, align 8, !tbaa !17
  %158 = load i32, ptr %13, align 4, !tbaa !5
  %159 = sext i32 %158 to i64
  %160 = getelementptr inbounds i32, ptr %157, i64 %159
  %161 = load i32, ptr %160, align 4, !tbaa !5
  %162 = icmp ne i32 %161, 0
  br i1 %162, label %175, label %163

163:                                              ; preds = %156
  %164 = load i32, ptr %13, align 4, !tbaa !5
  %165 = load ptr, ptr @pr, align 8, !tbaa !17
  %166 = load i32, ptr @tot, align 4, !tbaa !5
  %167 = add nsw i32 %166, 1
  store i32 %167, ptr @tot, align 4, !tbaa !5
  %168 = sext i32 %167 to i64
  %169 = getelementptr inbounds i32, ptr %165, i64 %168
  store i32 %164, ptr %169, align 4, !tbaa !5
  %170 = load i32, ptr @tot, align 4, !tbaa !5
  %171 = load ptr, ptr @d, align 8, !tbaa !17
  %172 = load i32, ptr %13, align 4, !tbaa !5
  %173 = sext i32 %172 to i64
  %174 = getelementptr inbounds i32, ptr %171, i64 %173
  store i32 %170, ptr %174, align 4, !tbaa !5
  br label %175

175:                                              ; preds = %163, %156
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #9
  store i32 1, ptr %17, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #9
  br label %176

176:                                              ; preds = %202, %175
  %177 = load i32, ptr %13, align 4, !tbaa !5
  %178 = load ptr, ptr @pr, align 8, !tbaa !17
  %179 = load i32, ptr %17, align 4, !tbaa !5
  %180 = sext i32 %179 to i64
  %181 = getelementptr inbounds i32, ptr %178, i64 %180
  %182 = load i32, ptr %181, align 4, !tbaa !5
  %183 = mul nsw i32 %177, %182
  store i32 %183, ptr %18, align 4, !tbaa !5
  %184 = load i32, ptr %14, align 4, !tbaa !5
  %185 = icmp sle i32 %183, %184
  br i1 %185, label %187, label %186

186:                                              ; preds = %176
  store i32 17, ptr %16, align 4
  br label %205

187:                                              ; preds = %176
  %188 = load i32, ptr %17, align 4, !tbaa !5
  %189 = load ptr, ptr @d, align 8, !tbaa !17
  %190 = load i32, ptr %18, align 4, !tbaa !5
  %191 = sext i32 %190 to i64
  %192 = getelementptr inbounds i32, ptr %189, i64 %191
  store i32 %188, ptr %192, align 4, !tbaa !5
  %193 = load ptr, ptr @d, align 8, !tbaa !17
  %194 = load i32, ptr %13, align 4, !tbaa !5
  %195 = sext i32 %194 to i64
  %196 = getelementptr inbounds i32, ptr %193, i64 %195
  %197 = load i32, ptr %196, align 4, !tbaa !5
  %198 = load i32, ptr %17, align 4, !tbaa !5
  %199 = icmp eq i32 %197, %198
  br i1 %199, label %200, label %201

200:                                              ; preds = %187
  store i32 17, ptr %16, align 4
  br label %205

201:                                              ; preds = %187
  br label %202

202:                                              ; preds = %201
  %203 = load i32, ptr %17, align 4, !tbaa !5
  %204 = add nsw i32 %203, 1
  store i32 %204, ptr %17, align 4, !tbaa !5
  br label %176, !llvm.loop !20

205:                                              ; preds = %200, %186
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #9
  br label %206

206:                                              ; preds = %205
  br label %207

207:                                              ; preds = %206
  %208 = load i32, ptr %13, align 4, !tbaa !5
  %209 = add nsw i32 %208, 1
  store i32 %209, ptr %13, align 4, !tbaa !5
  br label %151, !llvm.loop !21

210:                                              ; preds = %155
  store i32 0, ptr @tot, align 4, !tbaa !5
  store i32 1, ptr @val, align 4, !tbaa !5
  store i32 -1, ptr @dep, align 16, !tbaa !5
  store i32 0, ptr getelementptr inbounds ([100003 x i32], ptr @dep, i64 0, i64 1), align 4, !tbaa !5
  %211 = call noundef i32 @_Z3dfsi(i32 noundef 1)
  %212 = load ptr, ptr @pr, align 8, !tbaa !17
  %213 = load ptr, ptr @c, align 8, !tbaa !17
  %214 = getelementptr inbounds i32, ptr %213, i64 125001
  %215 = load ptr, ptr @pr, align 8, !tbaa !17
  %216 = ptrtoint ptr %214 to i64
  %217 = ptrtoint ptr %215 to i64
  %218 = sub i64 %216, %217
  %219 = sdiv exact i64 %218, 4
  %220 = mul i64 %219, 4
  call void @llvm.memset.p0.i64(ptr align 4 %212, i8 0, i64 %220, i1 false)
  store i32 0, ptr @mx, align 4, !tbaa !5
  br label %221

221:                                              ; preds = %227, %210
  %222 = load i32, ptr @mx, align 4, !tbaa !5
  %223 = shl i32 1, %222
  %224 = load i32, ptr @n, align 4, !tbaa !5
  %225 = icmp sle i32 %223, %224
  br i1 %225, label %226, label %230

226:                                              ; preds = %221
  br label %227

227:                                              ; preds = %226
  %228 = load i32, ptr @mx, align 4, !tbaa !5
  %229 = add nsw i32 %228, 1
  store i32 %229, ptr @mx, align 4, !tbaa !5
  br label %221, !llvm.loop !22

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

231:                                              ; preds = %332, %230
  %232 = load i32, ptr %19, align 4, !tbaa !5
  %233 = load i32, ptr @n, align 4, !tbaa !5
  %234 = icmp sle i32 %232, %233
  br i1 %234, label %236, label %235

235:                                              ; preds = %231
  store i32 23, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #9
  br label %335

236:                                              ; preds = %231
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #9
  %237 = load i32, ptr %19, align 4, !tbaa !5
  %238 = sext i32 %237 to i64
  %239 = getelementptr inbounds [100003 x i32], ptr @ord, i64 0, i64 %238
  %240 = load i32, ptr %239, align 4, !tbaa !5
  store i32 %240, ptr %20, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #9
  store i32 0, ptr %21, align 4, !tbaa !5
  br label %241

241:                                              ; preds = %328, %236
  %242 = load i32, ptr %21, align 4, !tbaa !5
  %243 = add nsw i32 %242, 1
  %244 = load i32, ptr @mx, align 4, !tbaa !5
  %245 = icmp slt i32 %243, %244
  br i1 %245, label %246, label %256

246:                                              ; preds = %241
  %247 = load i32, ptr %21, align 4, !tbaa !5
  %248 = sext i32 %247 to i64
  %249 = getelementptr inbounds [17 x [100003 x %struct.SparseTable]], ptr @st, i64 0, i64 %248
  %250 = load i32, ptr %20, align 4, !tbaa !5
  %251 = sext i32 %250 to i64
  %252 = getelementptr inbounds [100003 x %struct.SparseTable], ptr %249, i64 0, i64 %251
  %253 = getelementptr inbounds %struct.SparseTable, ptr %252, i32 0, i32 0
  %254 = load i32, ptr %253, align 4, !tbaa !23
  %255 = icmp ne i32 %254, 0
  br label %256

256:                                              ; preds = %246, %241
  %257 = phi i1 [ false, %241 ], [ %255, %246 ]
  br i1 %257, label %259, label %258

258:                                              ; preds = %256
  store i32 26, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #9
  br label %331

259:                                              ; preds = %256
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #9
  %260 = load i32, ptr %21, align 4, !tbaa !5
  %261 = sext i32 %260 to i64
  %262 = getelementptr inbounds [17 x [100003 x %struct.SparseTable]], ptr @st, i64 0, i64 %261
  %263 = load i32, ptr %20, align 4, !tbaa !5
  %264 = sext i32 %263 to i64
  %265 = getelementptr inbounds [100003 x %struct.SparseTable], ptr %262, i64 0, i64 %264
  %266 = getelementptr inbounds %struct.SparseTable, ptr %265, i32 0, i32 0
  %267 = load i32, ptr %266, align 4, !tbaa !23
  store i32 %267, ptr %22, align 4, !tbaa !5
  %268 = load i32, ptr %21, align 4, !tbaa !5
  %269 = sext i32 %268 to i64
  %270 = getelementptr inbounds [17 x [100003 x %struct.SparseTable]], ptr @st, i64 0, i64 %269
  %271 = load i32, ptr %22, align 4, !tbaa !5
  %272 = sext i32 %271 to i64
  %273 = getelementptr inbounds [100003 x %struct.SparseTable], ptr %270, i64 0, i64 %272
  %274 = getelementptr inbounds %struct.SparseTable, ptr %273, i32 0, i32 0
  %275 = load i32, ptr %274, align 4, !tbaa !23
  %276 = load i32, ptr %21, align 4, !tbaa !5
  %277 = add nsw i32 %276, 1
  %278 = sext i32 %277 to i64
  %279 = getelementptr inbounds [17 x [100003 x %struct.SparseTable]], ptr @st, i64 0, i64 %278
  %280 = load i32, ptr %20, align 4, !tbaa !5
  %281 = sext i32 %280 to i64
  %282 = getelementptr inbounds [100003 x %struct.SparseTable], ptr %279, i64 0, i64 %281
  %283 = getelementptr inbounds %struct.SparseTable, ptr %282, i32 0, i32 0
  store i32 %275, ptr %283, align 4, !tbaa !23
  %284 = load i32, ptr %21, align 4, !tbaa !5
  %285 = sext i32 %284 to i64
  %286 = getelementptr inbounds [17 x [100003 x %struct.SparseTable]], ptr @st, i64 0, i64 %285
  %287 = load i32, ptr %20, align 4, !tbaa !5
  %288 = sext i32 %287 to i64
  %289 = getelementptr inbounds [100003 x %struct.SparseTable], ptr %286, i64 0, i64 %288
  %290 = getelementptr inbounds %struct.SparseTable, ptr %289, i32 0, i32 1
  %291 = load i32, ptr %21, align 4, !tbaa !5
  %292 = sext i32 %291 to i64
  %293 = getelementptr inbounds [17 x [100003 x %struct.SparseTable]], ptr @st, i64 0, i64 %292
  %294 = load i32, ptr %22, align 4, !tbaa !5
  %295 = sext i32 %294 to i64
  %296 = getelementptr inbounds [100003 x %struct.SparseTable], ptr %293, i64 0, i64 %295
  %297 = getelementptr inbounds %struct.SparseTable, ptr %296, i32 0, i32 1
  %298 = load i32, ptr %21, align 4, !tbaa !5
  %299 = add nsw i32 %298, 1
  %300 = sext i32 %299 to i64
  %301 = getelementptr inbounds [17 x [100003 x %struct.SparseTable]], ptr @st, i64 0, i64 %300
  %302 = load i32, ptr %20, align 4, !tbaa !5
  %303 = sext i32 %302 to i64
  %304 = getelementptr inbounds [100003 x %struct.SparseTable], ptr %301, i64 0, i64 %303
  %305 = getelementptr inbounds %struct.SparseTable, ptr %304, i32 0, i32 1
  call void @_Z6matMulRA3_A3_iS1_S1_(ptr noundef nonnull align 4 dereferenceable(36) %290, ptr noundef nonnull align 4 dereferenceable(36) %297, ptr noundef nonnull align 4 dereferenceable(36) %305)
  %306 = load i32, ptr %21, align 4, !tbaa !5
  %307 = sext i32 %306 to i64
  %308 = getelementptr inbounds [17 x [100003 x %struct.SparseTable]], ptr @st, i64 0, i64 %307
  %309 = load i32, ptr %22, align 4, !tbaa !5
  %310 = sext i32 %309 to i64
  %311 = getelementptr inbounds [100003 x %struct.SparseTable], ptr %308, i64 0, i64 %310
  %312 = getelementptr inbounds %struct.SparseTable, ptr %311, i32 0, i32 2
  %313 = load i32, ptr %21, align 4, !tbaa !5
  %314 = sext i32 %313 to i64
  %315 = getelementptr inbounds [17 x [100003 x %struct.SparseTable]], ptr @st, i64 0, i64 %314
  %316 = load i32, ptr %20, align 4, !tbaa !5
  %317 = sext i32 %316 to i64
  %318 = getelementptr inbounds [100003 x %struct.SparseTable], ptr %315, i64 0, i64 %317
  %319 = getelementptr inbounds %struct.SparseTable, ptr %318, i32 0, i32 2
  %320 = load i32, ptr %21, align 4, !tbaa !5
  %321 = add nsw i32 %320, 1
  %322 = sext i32 %321 to i64
  %323 = getelementptr inbounds [17 x [100003 x %struct.SparseTable]], ptr @st, i64 0, i64 %322
  %324 = load i32, ptr %20, align 4, !tbaa !5
  %325 = sext i32 %324 to i64
  %326 = getelementptr inbounds [100003 x %struct.SparseTable], ptr %323, i64 0, i64 %325
  %327 = getelementptr inbounds %struct.SparseTable, ptr %326, i32 0, i32 2
  call void @_Z6matMulRA3_A3_iS1_S1_(ptr noundef nonnull align 4 dereferenceable(36) %312, ptr noundef nonnull align 4 dereferenceable(36) %319, ptr noundef nonnull align 4 dereferenceable(36) %327)
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #9
  br label %328

328:                                              ; preds = %259
  %329 = load i32, ptr %21, align 4, !tbaa !5
  %330 = add nsw i32 %329, 1
  store i32 %330, ptr %21, align 4, !tbaa !5
  br label %241, !llvm.loop !25

331:                                              ; preds = %258
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #9
  br label %332

332:                                              ; preds = %331
  %333 = load i32, ptr %19, align 4, !tbaa !5
  %334 = add nsw i32 %333, 1
  store i32 %334, ptr %19, align 4, !tbaa !5
  br label %231, !llvm.loop !26

335:                                              ; preds = %235
  br label %336

336:                                              ; preds = %478, %335
  %337 = load i32, ptr @m, align 4, !tbaa !5
  %338 = add nsw i32 %337, -1
  store i32 %338, ptr @m, align 4, !tbaa !5
  %339 = icmp ne i32 %337, 0
  br i1 %339, label %340, label %486

340:                                              ; preds = %336
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #9
  %341 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.5, ptr noundef %23, ptr noundef %24)
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #9
  %342 = load i32, ptr %23, align 4, !tbaa !5
  %343 = load i32, ptr %24, align 4, !tbaa !5
  %344 = call noundef i32 @_Z3lcaii(i32 noundef %342, i32 noundef %343)
  store i32 %344, ptr %25, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 12, ptr %26) #9
  %345 = load i32, ptr %23, align 4, !tbaa !5
  %346 = sext i32 %345 to i64
  %347 = getelementptr inbounds [100003 x %struct.SparseTable], ptr @st, i64 0, i64 %346
  %348 = getelementptr inbounds %struct.SparseTable, ptr %347, i32 0, i32 1
  %349 = getelementptr inbounds [3 x [3 x i32]], ptr %348, i64 0, i64 1
  %350 = getelementptr inbounds [3 x i32], ptr %349, i64 0, i64 2
  %351 = load i32, ptr %350, align 4, !tbaa !5
  store i32 %351, ptr %26, align 4, !tbaa !5
  %352 = getelementptr inbounds i32, ptr %26, i64 1
  %353 = load i32, ptr %23, align 4, !tbaa !5
  %354 = sext i32 %353 to i64
  %355 = getelementptr inbounds [100003 x %struct.SparseTable], ptr @st, i64 0, i64 %354
  %356 = getelementptr inbounds %struct.SparseTable, ptr %355, i32 0, i32 1
  %357 = getelementptr inbounds [3 x [3 x i32]], ptr %356, i64 0, i64 2
  %358 = getelementptr inbounds [3 x i32], ptr %357, i64 0, i64 0
  %359 = load i32, ptr %358, align 4, !tbaa !5
  store i32 %359, ptr %352, align 4, !tbaa !5
  %360 = getelementptr inbounds i32, ptr %26, i64 2
  %361 = load i32, ptr %23, align 4, !tbaa !5
  %362 = sext i32 %361 to i64
  %363 = getelementptr inbounds [100003 x %struct.SparseTable], ptr @st, i64 0, i64 %362
  %364 = getelementptr inbounds %struct.SparseTable, ptr %363, i32 0, i32 1
  %365 = getelementptr inbounds [3 x [3 x i32]], ptr %364, i64 0, i64 0
  %366 = getelementptr inbounds [3 x i32], ptr %365, i64 0, i64 1
  %367 = load i32, ptr %366, align 4, !tbaa !5
  store i32 %367, ptr %360, align 4, !tbaa !5
  %368 = load i32, ptr %23, align 4, !tbaa !5
  %369 = sext i32 %368 to i64
  %370 = getelementptr inbounds [100003 x %struct.SparseTable], ptr @st, i64 0, i64 %369
  %371 = getelementptr inbounds %struct.SparseTable, ptr %370, i32 0, i32 0
  %372 = load i32, ptr %371, align 4, !tbaa !23
  store i32 %372, ptr %23, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #9
  %373 = load i32, ptr %23, align 4, !tbaa !5
  %374 = sext i32 %373 to i64
  %375 = getelementptr inbounds [100003 x i32], ptr @dep, i64 0, i64 %374
  %376 = load i32, ptr %375, align 4, !tbaa !5
  %377 = load i32, ptr %25, align 4, !tbaa !5
  %378 = sext i32 %377 to i64
  %379 = getelementptr inbounds [100003 x i32], ptr @dep, i64 0, i64 %378
  %380 = load i32, ptr %379, align 4, !tbaa !5
  %381 = sub nsw i32 %376, %380
  %382 = add nsw i32 %381, 1
  store i32 %382, ptr %27, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #9
  store i32 0, ptr %28, align 4, !tbaa !5
  br label %383

383:                                              ; preds = %408, %340
  %384 = load i32, ptr %27, align 4, !tbaa !5
  %385 = icmp sgt i32 %384, 0
  br i1 %385, label %387, label %386

386:                                              ; preds = %383
  store i32 31, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #9
  br label %413

387:                                              ; preds = %383
  %388 = load i32, ptr %27, align 4, !tbaa !5
  %389 = and i32 %388, 1
  %390 = icmp ne i32 %389, 0
  br i1 %390, label %391, label %407

391:                                              ; preds = %387
  %392 = load i32, ptr %28, align 4, !tbaa !5
  %393 = sext i32 %392 to i64
  %394 = getelementptr inbounds [17 x [100003 x %struct.SparseTable]], ptr @st, i64 0, i64 %393
  %395 = load i32, ptr %23, align 4, !tbaa !5
  %396 = sext i32 %395 to i64
  %397 = getelementptr inbounds [100003 x %struct.SparseTable], ptr %394, i64 0, i64 %396
  %398 = getelementptr inbounds %struct.SparseTable, ptr %397, i32 0, i32 2
  call void @_Z6vecMulRA3_A3_iRS_S2_(ptr noundef nonnull align 4 dereferenceable(36) %398, ptr noundef nonnull align 4 dereferenceable(12) %26, ptr noundef nonnull align 4 dereferenceable(12) %26)
  %399 = load i32, ptr %28, align 4, !tbaa !5
  %400 = sext i32 %399 to i64
  %401 = getelementptr inbounds [17 x [100003 x %struct.SparseTable]], ptr @st, i64 0, i64 %400
  %402 = load i32, ptr %23, align 4, !tbaa !5
  %403 = sext i32 %402 to i64
  %404 = getelementptr inbounds [100003 x %struct.SparseTable], ptr %401, i64 0, i64 %403
  %405 = getelementptr inbounds %struct.SparseTable, ptr %404, i32 0, i32 0
  %406 = load i32, ptr %405, align 4, !tbaa !23
  store i32 %406, ptr %23, align 4, !tbaa !5
  br label %407

407:                                              ; preds = %391, %387
  br label %408

408:                                              ; preds = %407
  %409 = load i32, ptr %27, align 4, !tbaa !5
  %410 = ashr i32 %409, 1
  store i32 %410, ptr %27, align 4, !tbaa !5
  %411 = load i32, ptr %28, align 4, !tbaa !5
  %412 = add nsw i32 %411, 1
  store i32 %412, ptr %28, align 4, !tbaa !5
  br label %383, !llvm.loop !27

413:                                              ; preds = %386
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #9
  store i32 0, ptr %29, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #9
  %414 = load i32, ptr %24, align 4, !tbaa !5
  %415 = sext i32 %414 to i64
  %416 = getelementptr inbounds [100003 x i32], ptr @dep, i64 0, i64 %415
  %417 = load i32, ptr %416, align 4, !tbaa !5
  %418 = load i32, ptr %25, align 4, !tbaa !5
  %419 = sext i32 %418 to i64
  %420 = getelementptr inbounds [100003 x i32], ptr @dep, i64 0, i64 %419
  %421 = load i32, ptr %420, align 4, !tbaa !5
  %422 = sub nsw i32 %417, %421
  store i32 %422, ptr %30, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #9
  store i32 0, ptr %31, align 4, !tbaa !5
  br label %423

423:                                              ; preds = %452, %413
  %424 = load i32, ptr %30, align 4, !tbaa !5
  %425 = icmp sgt i32 %424, 0
  br i1 %425, label %427, label %426

426:                                              ; preds = %423
  store i32 34, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #9
  br label %457

427:                                              ; preds = %423
  %428 = load i32, ptr %30, align 4, !tbaa !5
  %429 = and i32 %428, 1
  %430 = icmp ne i32 %429, 0
  br i1 %430, label %431, label %451

431:                                              ; preds = %427
  %432 = load i32, ptr %31, align 4, !tbaa !5
  %433 = load i32, ptr %29, align 4, !tbaa !5
  %434 = sext i32 %433 to i64
  %435 = getelementptr inbounds [17 x [2 x i32]], ptr @_ZZ4mainE3que, i64 0, i64 %434
  %436 = getelementptr inbounds [2 x i32], ptr %435, i64 0, i64 0
  store i32 %432, ptr %436, align 8, !tbaa !5
  %437 = load i32, ptr %24, align 4, !tbaa !5
  %438 = load i32, ptr %29, align 4, !tbaa !5
  %439 = add nsw i32 %438, 1
  store i32 %439, ptr %29, align 4, !tbaa !5
  %440 = sext i32 %438 to i64
  %441 = getelementptr inbounds [17 x [2 x i32]], ptr @_ZZ4mainE3que, i64 0, i64 %440
  %442 = getelementptr inbounds [2 x i32], ptr %441, i64 0, i64 1
  store i32 %437, ptr %442, align 4, !tbaa !5
  %443 = load i32, ptr %31, align 4, !tbaa !5
  %444 = sext i32 %443 to i64
  %445 = getelementptr inbounds [17 x [100003 x %struct.SparseTable]], ptr @st, i64 0, i64 %444
  %446 = load i32, ptr %24, align 4, !tbaa !5
  %447 = sext i32 %446 to i64
  %448 = getelementptr inbounds [100003 x %struct.SparseTable], ptr %445, i64 0, i64 %447
  %449 = getelementptr inbounds %struct.SparseTable, ptr %448, i32 0, i32 0
  %450 = load i32, ptr %449, align 4, !tbaa !23
  store i32 %450, ptr %24, align 4, !tbaa !5
  br label %451

451:                                              ; preds = %431, %427
  br label %452

452:                                              ; preds = %451
  %453 = load i32, ptr %30, align 4, !tbaa !5
  %454 = ashr i32 %453, 1
  store i32 %454, ptr %30, align 4, !tbaa !5
  %455 = load i32, ptr %31, align 4, !tbaa !5
  %456 = add nsw i32 %455, 1
  store i32 %456, ptr %31, align 4, !tbaa !5
  br label %423, !llvm.loop !28

457:                                              ; preds = %426
  br label %458

458:                                              ; preds = %462, %457
  %459 = load i32, ptr %29, align 4, !tbaa !5
  %460 = add nsw i32 %459, -1
  store i32 %460, ptr %29, align 4, !tbaa !5
  %461 = icmp ne i32 %459, 0
  br i1 %461, label %462, label %478

462:                                              ; preds = %458
  %463 = load i32, ptr %29, align 4, !tbaa !5
  %464 = sext i32 %463 to i64
  %465 = getelementptr inbounds [17 x [2 x i32]], ptr @_ZZ4mainE3que, i64 0, i64 %464
  %466 = getelementptr inbounds [2 x i32], ptr %465, i64 0, i64 0
  %467 = load i32, ptr %466, align 8, !tbaa !5
  %468 = sext i32 %467 to i64
  %469 = getelementptr inbounds [17 x [100003 x %struct.SparseTable]], ptr @st, i64 0, i64 %468
  %470 = load i32, ptr %29, align 4, !tbaa !5
  %471 = sext i32 %470 to i64
  %472 = getelementptr inbounds [17 x [2 x i32]], ptr @_ZZ4mainE3que, i64 0, i64 %471
  %473 = getelementptr inbounds [2 x i32], ptr %472, i64 0, i64 1
  %474 = load i32, ptr %473, align 4, !tbaa !5
  %475 = sext i32 %474 to i64
  %476 = getelementptr inbounds [100003 x %struct.SparseTable], ptr %469, i64 0, i64 %475
  %477 = getelementptr inbounds %struct.SparseTable, ptr %476, i32 0, i32 1
  call void @_Z6vecMulRA3_A3_iRS_S2_(ptr noundef nonnull align 4 dereferenceable(36) %477, ptr noundef nonnull align 4 dereferenceable(12) %26, ptr noundef nonnull align 4 dereferenceable(12) %26)
  br label %458, !llvm.loop !29

478:                                              ; preds = %458
  %479 = getelementptr inbounds [3 x i32], ptr %26, i64 0, i64 0
  %480 = load i32, ptr %479, align 4, !tbaa !5
  %481 = getelementptr inbounds [3 x i32], ptr %26, i64 0, i64 1
  %482 = load i32, ptr %481, align 4, !tbaa !5
  %483 = getelementptr inbounds [3 x i32], ptr %26, i64 0, i64 2
  %484 = load i32, ptr %483, align 4, !tbaa !5
  %485 = call i32 (ptr, ...) @printf(ptr noundef @.str.7, i32 noundef %480, i32 noundef %482, i32 noundef %484)
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #9
  call void @llvm.lifetime.end.p0(i64 12, ptr %26) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #9
  br label %336, !llvm.loop !30

486:                                              ; preds = %336
  ret i32 0
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #6

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #6

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_Z6matMulRA3_A3_iS1_S1_(ptr noundef nonnull align 4 dereferenceable(36), ptr noundef nonnull align 4 dereferenceable(36), ptr noundef nonnull align 4 dereferenceable(36)) #8

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_Z6vecMulRA3_A3_iRS_S2_(ptr noundef nonnull align 4 dereferenceable(36), ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) #6

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

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 #5 = { "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 #6 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #8 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #9 = { 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 = !{!13, !6, i64 0}
!13 = !{!"_ZTS4Edge", !6, i64 0, !6, i64 4}
!14 = !{!13, !6, i64 4}
!15 = !{i64 0, i64 4, !5, i64 4, i64 4, !5}
!16 = distinct !{!16, !10}
!17 = !{!18, !18, i64 0}
!18 = !{!"any pointer", !7, i64 0}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10}
!21 = distinct !{!21, !10}
!22 = distinct !{!22, !10}
!23 = !{!24, !6, i64 0}
!24 = !{!"_ZTS11SparseTable", !6, i64 0, !7, i64 4, !7, i64 40}
!25 = distinct !{!25, !10}
!26 = distinct !{!26, !10}
!27 = distinct !{!27, !10}
!28 = distinct !{!28, !10}
!29 = distinct !{!29, !10}
!30 = distinct !{!30, !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"

%struct.Edge = type { i32, i32 }
%struct.SparseTable = type { i32, [3 x [3 x i32]], [3 x [3 x i32]] }

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@a = external dso_local global [100003 x i32], align 16
@ord = external dso_local local_unnamed_addr global [100003 x i32], align 16
@dep = external dso_local local_unnamed_addr global [100003 x i32], align 16
@lnk = external dso_local local_unnamed_addr global [100003 x i32], align 16
@e = external dso_local local_unnamed_addr global [200007 x %struct.Edge], align 16
@st = external dso_local global [17 x [100003 x %struct.SparseTable]], align 16
@tot = external dso_local local_unnamed_addr global i32, align 4
@pr = external dso_local local_unnamed_addr global ptr, align 8
@d = external dso_local local_unnamed_addr global ptr, align 8
@inv = external dso_local local_unnamed_addr global ptr, align 8
@val = external dso_local local_unnamed_addr global i32, align 4
@c = external dso_local local_unnamed_addr global ptr, align 8
@mx = external dso_local local_unnamed_addr global i32, align 4
@.str.5 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [3 x i8], align 1
@_ZL4maxm = external hidden constant i32, align 4
@_ZZ4mainE3que = external hidden local_unnamed_addr global [17 x [2 x i32]], align 16
@.str.7 = external hidden unnamed_addr constant [10 x i8], align 1

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z3lcaii(i32 noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #3 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca [3 x i32], align 8
  %10 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.5, ptr noundef nonnull @n, ptr noundef nonnull @m)
  %11 = load i32, ptr @n, align 4, !tbaa !5
  %.not107 = icmp slt i32 %11, 1
  br i1 %.not107, label %._crit_edge113, label %.lr.ph110

.preheader105:                                    ; preds = %20
  %12 = icmp sgt i32 %21, 1
  br i1 %12, label %.lr.ph112, label %._crit_edge113

.lr.ph110:                                        ; preds = %0, %20
  %indvars.iv = phi i64 [ %indvars.iv.next, %20 ], [ 1, %0 ]
  %13 = getelementptr inbounds i32, ptr @a, i64 %indvars.iv
  %14 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.6, ptr noundef nonnull %13)
  %15 = load i32, ptr %13, align 4, !tbaa !5
  %mx.promoted = load i32, ptr @mx, align 4, !tbaa !5
  %16 = shl nuw i32 1, %mx.promoted
  %.not102106 = icmp sgt i32 %16, %15
  br i1 %.not102106, label %20, label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph110, %.lr.ph
  %17 = phi i32 [ %18, %.lr.ph ], [ %mx.promoted, %.lr.ph110 ]
  %18 = add nsw i32 %17, 1
  %19 = shl nuw i32 1, %18
  %.not102 = icmp sgt i32 %19, %15
  br i1 %.not102, label %._crit_edge, label %.lr.ph, !llvm.loop !9

._crit_edge:                                      ; preds = %.lr.ph
  store i32 %18, ptr @mx, align 4, !tbaa !5
  br label %20

20:                                               ; preds = %._crit_edge, %.lr.ph110
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %21 = load i32, ptr @n, align 4, !tbaa !5
  %22 = sext i32 %21 to i64
  %.not.not = icmp slt i64 %indvars.iv, %22
  br i1 %.not.not, label %.lr.ph110, label %.preheader105, !llvm.loop !11

._crit_edge113:                                   ; preds = %.lr.ph112, %0, %.preheader105
  %23 = load ptr, ptr @inv, align 8, !tbaa !12
  %24 = getelementptr inbounds i8, ptr %23, i64 4
  store i32 1, ptr %24, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #8
  %25 = load i32, ptr @mx, align 4, !tbaa !5
  %26 = shl nuw i32 1, %25
  store i32 %26, ptr %4, align 4, !tbaa !5
  %27 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) @_ZL4maxm)
  %28 = load i32, ptr %27, align 4, !tbaa !5
  %29 = add nsw i32 %28, -1
  store i32 %29, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #8
  %30 = load i32, ptr @n, align 4, !tbaa !5
  %31 = load i32, ptr @mx, align 4, !tbaa !5
  %32 = add nsw i32 %31, -1
  %33 = mul nsw i32 %32, %30
  store i32 %33, ptr %5, align 4, !tbaa !5
  %34 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %35 = load i32, ptr %34, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #8
  %.not91114 = icmp slt i32 %35, 2
  br i1 %.not91114, label %._crit_edge118, label %.lr.ph117

.lr.ph117:                                        ; preds = %._crit_edge113
  %36 = load ptr, ptr @inv, align 8, !tbaa !12
  %37 = add nuw i32 %35, 1
  %wide.trip.count = zext i32 %37 to i64
  br label %65

.lr.ph112:                                        ; preds = %.preheader105, %.lr.ph112
  %indvars.iv157 = phi i64 [ %indvars.iv.next158, %.lr.ph112 ], [ 1, %.preheader105 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #8
  %38 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.5, ptr noundef nonnull %1, ptr noundef nonnull %2)
  %39 = load i32, ptr %1, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [100003 x i32], ptr @lnk, i64 0, i64 %40
  %42 = load i32, ptr %41, align 4, !tbaa !5
  %43 = load i32, ptr %2, align 4, !tbaa !5
  %44 = shl nuw i64 %indvars.iv157, 1
  %45 = trunc nuw i64 %44 to i32
  %sext = shl i64 %indvars.iv157, 33
  %46 = ashr exact i64 %sext, 32
  %47 = getelementptr inbounds [200007 x %struct.Edge], ptr @e, i64 0, i64 %46
  store i32 %42, ptr %47, align 16, !tbaa !5
  %.sroa.465.0..sroa_idx = getelementptr inbounds i8, ptr %47, i64 4
  store i32 %43, ptr %.sroa.465.0..sroa_idx, align 4, !tbaa !5
  store i32 %45, ptr %41, align 4, !tbaa !5
  %48 = sext i32 %43 to i64
  %49 = getelementptr inbounds [100003 x i32], ptr @lnk, i64 0, i64 %48
  %50 = load i32, ptr %49, align 4, !tbaa !5
  %51 = trunc i64 %44 to i32
  %52 = or disjoint i32 %51, 1
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [200007 x %struct.Edge], ptr @e, i64 0, i64 %53
  store i32 %50, ptr %54, align 8, !tbaa !5
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %54, i64 4
  store i32 %39, ptr %.sroa.4.0..sroa_idx, align 4, !tbaa !5
  store i32 %52, ptr %49, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #8
  %indvars.iv.next158 = add nuw nsw i64 %indvars.iv157, 1
  %55 = load i32, ptr @n, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = icmp slt i64 %indvars.iv.next158, %56
  br i1 %57, label %.lr.ph112, label %._crit_edge113, !llvm.loop !14

._crit_edge118:                                   ; preds = %65, %._crit_edge113
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #8
  %58 = load i32, ptr @mx, align 4, !tbaa !5
  %59 = shl nuw i32 1, %58
  store i32 %59, ptr %6, align 4, !tbaa !5
  %60 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) @_ZL4maxm)
  %61 = load i32, ptr %60, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #8
  %.not92.not125 = icmp sgt i32 %61, 2
  br i1 %.not92.not125, label %.lr.ph128, label %._crit_edge129

.lr.ph128:                                        ; preds = %._crit_edge118
  %62 = load ptr, ptr @d, align 8, !tbaa !12
  %63 = load ptr, ptr @pr, align 8
  %64 = getelementptr inbounds i8, ptr %63, i64 4
  %wide.trip.count169 = zext nneg i32 %61 to i64
  br label %87

65:                                               ; preds = %.lr.ph117, %65
  %indvars.iv160 = phi i64 [ 2, %.lr.ph117 ], [ %indvars.iv.next161, %65 ]
  %66 = trunc nuw nsw i64 %indvars.iv160 to i32
  %67 = udiv i32 1000000007, %66
  %68 = zext nneg i32 %67 to i64
  %69 = urem i32 1000000007, %66
  %70 = zext nneg i32 %69 to i64
  %71 = getelementptr inbounds i32, ptr %36, i64 %70
  %72 = load i32, ptr %71, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = mul nsw i64 %73, %68
  %75 = srem i64 %74, 1000000007
  %76 = trunc nsw i64 %75 to i32
  %77 = sub nsw i32 1000000007, %76
  %78 = getelementptr inbounds i32, ptr %36, i64 %indvars.iv160
  store i32 %77, ptr %78, align 4, !tbaa !5
  %indvars.iv.next161 = add nuw nsw i64 %indvars.iv160, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next161, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge118, label %65, !llvm.loop !15

._crit_edge129:                                   ; preds = %._crit_edge123, %._crit_edge118
  store i32 0, ptr @tot, align 4, !tbaa !5
  store i32 1, ptr @val, align 4, !tbaa !5
  store i32 -1, ptr @dep, align 16, !tbaa !5
  store i32 0, ptr getelementptr inbounds (i8, ptr @dep, i64 4), align 4, !tbaa !5
  %79 = call noundef i32 @_Z3dfsi(i32 noundef 1)
  %80 = load ptr, ptr @pr, align 8, !tbaa !12
  %81 = load ptr, ptr @c, align 8, !tbaa !12
  %82 = getelementptr inbounds i8, ptr %81, i64 500004
  %83 = ptrtoint ptr %82 to i64
  %84 = ptrtoint ptr %80 to i64
  %85 = sub i64 %83, %84
  call void @llvm.memset.p0.i64(ptr align 4 %80, i8 0, i64 %85, i1 false)
  %86 = load i32, ptr @n, align 4, !tbaa !5
  br label %111

87:                                               ; preds = %.lr.ph128, %._crit_edge123
  %indvars.iv166 = phi i64 [ 2, %.lr.ph128 ], [ %indvars.iv.next167, %._crit_edge123 ]
  %88 = getelementptr inbounds i32, ptr %62, i64 %indvars.iv166
  %89 = load i32, ptr %88, align 4, !tbaa !5
  %.not100 = icmp eq i32 %89, 0
  br i1 %.not100, label %90, label %._crit_edge191

._crit_edge191:                                   ; preds = %87
  %.pre192 = trunc nuw nsw i64 %indvars.iv166 to i32
  br label %97

90:                                               ; preds = %87
  %91 = load i32, ptr @tot, align 4, !tbaa !5
  %92 = add nsw i32 %91, 1
  store i32 %92, ptr @tot, align 4, !tbaa !5
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds i32, ptr %63, i64 %93
  %95 = trunc nuw nsw i64 %indvars.iv166 to i32
  store i32 %95, ptr %94, align 4, !tbaa !5
  %96 = load i32, ptr @tot, align 4, !tbaa !5
  store i32 %96, ptr %88, align 4, !tbaa !5
  br label %97

97:                                               ; preds = %._crit_edge191, %90
  %.pre-phi = phi i32 [ %.pre192, %._crit_edge191 ], [ %95, %90 ]
  %98 = load i32, ptr %64, align 4, !tbaa !5
  %99 = mul nsw i32 %98, %.pre-phi
  %.not101.not119 = icmp slt i32 %99, %61
  br i1 %.not101.not119, label %.lr.ph122, label %._crit_edge123

100:                                              ; preds = %.lr.ph122
  %indvars.iv.next164 = add nuw nsw i64 %indvars.iv163, 1
  %101 = getelementptr inbounds i32, ptr %63, i64 %indvars.iv.next164
  %102 = load i32, ptr %101, align 4, !tbaa !5
  %103 = mul nsw i32 %102, %.pre-phi
  %.not101.not = icmp slt i32 %103, %61
  br i1 %.not101.not, label %.lr.ph122, label %._crit_edge123, !llvm.loop !16

.lr.ph122:                                        ; preds = %97, %100
  %indvars.iv163 = phi i64 [ %indvars.iv.next164, %100 ], [ 1, %97 ]
  %104 = phi i32 [ %103, %100 ], [ %99, %97 ]
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds i32, ptr %62, i64 %105
  %107 = trunc nuw nsw i64 %indvars.iv163 to i32
  store i32 %107, ptr %106, align 4, !tbaa !5
  %108 = load i32, ptr %88, align 4, !tbaa !5
  %109 = zext i32 %108 to i64
  %110 = icmp eq i64 %indvars.iv163, %109
  br i1 %110, label %._crit_edge123, label %100

._crit_edge123:                                   ; preds = %100, %.lr.ph122, %97
  %indvars.iv.next167 = add nuw nsw i64 %indvars.iv166, 1
  %exitcond170.not = icmp eq i64 %indvars.iv.next167, %wide.trip.count169
  br i1 %exitcond170.not, label %._crit_edge129, label %87, !llvm.loop !17

111:                                              ; preds = %111, %._crit_edge129
  %112 = phi i32 [ 0, %._crit_edge129 ], [ %114, %111 ]
  %113 = shl nuw i32 1, %112
  %.not93 = icmp sgt i32 %113, %86
  %114 = add nuw nsw i32 %112, 1
  br i1 %.not93, label %.preheader104, label %111, !llvm.loop !18

.preheader104:                                    ; preds = %111
  store i32 %112, ptr @mx, align 4, !tbaa !5
  %.not94134 = icmp sgt i32 %86, 0
  %115 = icmp ugt i32 %112, 1
  %or.cond = and i1 %.not94134, %115
  br i1 %or.cond, label %.lr.ph136.split, label %.preheader103

.preheader103:                                    ; preds = %.critedge, %.preheader104
  %116 = load i32, ptr @m, align 4, !tbaa !5
  %117 = add nsw i32 %116, -1
  store i32 %117, ptr @m, align 4, !tbaa !5
  %.not95151 = icmp eq i32 %116, 0
  br i1 %.not95151, label %._crit_edge153, label %.lr.ph152

.lr.ph152:                                        ; preds = %.preheader103
  %118 = getelementptr inbounds i8, ptr %9, i64 4
  %119 = getelementptr inbounds i8, ptr %9, i64 8
  br label %150

.lr.ph136.split:                                  ; preds = %.preheader104, %.critedge
  %120 = phi i32 [ %132, %.critedge ], [ %86, %.preheader104 ]
  %121 = phi i32 [ %133, %.critedge ], [ %112, %.preheader104 ]
  %indvars.iv178 = phi i64 [ %indvars.iv.next179, %.critedge ], [ 1, %.preheader104 ]
  %122 = icmp sgt i32 %121, 1
  br i1 %122, label %.lr.ph132, label %.critedge

.lr.ph132:                                        ; preds = %.lr.ph136.split
  %123 = getelementptr inbounds [100003 x i32], ptr @ord, i64 0, i64 %indvars.iv178
  %124 = load i32, ptr %123, align 4, !tbaa !5
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [17 x [100003 x %struct.SparseTable]], ptr @st, i64 0, i64 0, i64 %125
  %127 = load i32, ptr %126, align 4, !tbaa !19
  %.not99199 = icmp eq i32 %127, 0
  br i1 %.not99199, label %.critedge.loopexit, label %.lr.ph202

128:                                              ; preds = %.lr.ph202
  %indvars.iv.next174 = add nuw nsw i64 %indvars.iv173200, 1
  %129 = getelementptr inbounds [17 x [100003 x %struct.SparseTable]], ptr @st, i64 0, i64 %indvars.iv.next174, i64 %125
  %130 = load i32, ptr %129, align 4, !tbaa !19
  %.not99 = icmp eq i32 %130, 0
  br i1 %.not99, label %.critedge.loopexit, label %.lr.ph202, !llvm.loop !21

.critedge.loopexit:                               ; preds = %128, %.lr.ph202, %.lr.ph132
  %131 = phi i32 [ %121, %.lr.ph132 ], [ %147, %.lr.ph202 ], [ %147, %128 ]
  %.pre = load i32, ptr @n, align 4, !tbaa !5
  br label %.critedge

.critedge:                                        ; preds = %.critedge.loopexit, %.lr.ph136.split
  %132 = phi i32 [ %.pre, %.critedge.loopexit ], [ %120, %.lr.ph136.split ]
  %133 = phi i32 [ %131, %.critedge.loopexit ], [ %121, %.lr.ph136.split ]
  %indvars.iv.next179 = add nuw nsw i64 %indvars.iv178, 1
  %134 = sext i32 %132 to i64
  %.not94.not = icmp slt i64 %indvars.iv178, %134
  br i1 %.not94.not, label %.lr.ph136.split, label %.preheader103, !llvm.loop !22

.lr.ph202:                                        ; preds = %.lr.ph132, %128
  %135 = phi i32 [ %130, %128 ], [ %127, %.lr.ph132 ]
  %136 = phi ptr [ %129, %128 ], [ %126, %.lr.ph132 ]
  %indvars.iv171201 = phi i64 [ %indvars.iv.next172, %128 ], [ 1, %.lr.ph132 ]
  %indvars.iv173200 = phi i64 [ %indvars.iv.next174, %128 ], [ 0, %.lr.ph132 ]
  %137 = sext i32 %135 to i64
  %138 = getelementptr inbounds [17 x [100003 x %struct.SparseTable]], ptr @st, i64 0, i64 %indvars.iv173200, i64 %137
  %139 = load i32, ptr %138, align 4, !tbaa !19
  %140 = getelementptr inbounds [17 x [100003 x %struct.SparseTable]], ptr @st, i64 0, i64 %indvars.iv171201, i64 %125
  store i32 %139, ptr %140, align 4, !tbaa !19
  %141 = getelementptr inbounds i8, ptr %136, i64 4
  %142 = getelementptr inbounds i8, ptr %138, i64 4
  %143 = getelementptr inbounds i8, ptr %140, i64 4
  call void @_Z6matMulRA3_A3_iS1_S1_(ptr noundef nonnull align 4 dereferenceable(36) %141, ptr noundef nonnull align 4 dereferenceable(36) %142, ptr noundef nonnull align 4 dereferenceable(36) %143)
  %144 = getelementptr inbounds i8, ptr %138, i64 40
  %145 = getelementptr inbounds i8, ptr %136, i64 40
  %146 = getelementptr inbounds i8, ptr %140, i64 40
  call void @_Z6matMulRA3_A3_iS1_S1_(ptr noundef nonnull align 4 dereferenceable(36) %144, ptr noundef nonnull align 4 dereferenceable(36) %145, ptr noundef nonnull align 4 dereferenceable(36) %146)
  %indvars.iv.next172 = add nuw nsw i64 %indvars.iv171201, 1
  %147 = load i32, ptr @mx, align 4, !tbaa !5
  %148 = sext i32 %147 to i64
  %149 = icmp slt i64 %indvars.iv.next172, %148
  br i1 %149, label %128, label %.critedge.loopexit, !llvm.loop !21

150:                                              ; preds = %.lr.ph152, %._crit_edge150
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #8
  %151 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.5, ptr noundef nonnull %7, ptr noundef nonnull %8)
  %152 = load i32, ptr %7, align 4, !tbaa !5
  %153 = load i32, ptr %8, align 4, !tbaa !5
  %154 = call noundef i32 @_Z3lcaii(i32 noundef %152, i32 noundef %153)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %9) #8
  %155 = load i32, ptr %7, align 4, !tbaa !5
  %156 = sext i32 %155 to i64
  %157 = getelementptr inbounds [100003 x %struct.SparseTable], ptr @st, i64 0, i64 %156, i32 1, i64 1, i64 2
  %158 = load <2 x i32>, ptr %157, align 4, !tbaa !5
  store <2 x i32> %158, ptr %9, align 8, !tbaa !5
  %159 = getelementptr inbounds [100003 x %struct.SparseTable], ptr @st, i64 0, i64 %156, i32 1, i64 0, i64 1
  %160 = load i32, ptr %159, align 4, !tbaa !5
  store i32 %160, ptr %119, align 8, !tbaa !5
  %161 = getelementptr inbounds [100003 x %struct.SparseTable], ptr @st, i64 0, i64 %156
  %162 = load i32, ptr %161, align 4, !tbaa !19
  store i32 %162, ptr %7, align 4, !tbaa !5
  %163 = sext i32 %162 to i64
  %164 = getelementptr inbounds [100003 x i32], ptr @dep, i64 0, i64 %163
  %165 = load i32, ptr %164, align 4, !tbaa !5
  %166 = sext i32 %154 to i64
  %167 = getelementptr inbounds [100003 x i32], ptr @dep, i64 0, i64 %166
  %168 = load i32, ptr %167, align 4, !tbaa !5
  %169 = add i32 %165, 1
  %170 = sub i32 %169, %168
  %171 = icmp sgt i32 %170, 0
  br i1 %171, label %.lr.ph140, label %._crit_edge141

._crit_edge141.loopexit:                          ; preds = %188
  %.pre190 = load i32, ptr %167, align 4, !tbaa !5
  br label %._crit_edge141

._crit_edge141:                                   ; preds = %._crit_edge141.loopexit, %150
  %172 = phi i32 [ %.pre190, %._crit_edge141.loopexit ], [ %168, %150 ]
  %173 = load i32, ptr %8, align 4, !tbaa !5
  %174 = sext i32 %173 to i64
  %175 = getelementptr inbounds [100003 x i32], ptr @dep, i64 0, i64 %174
  %176 = load i32, ptr %175, align 4, !tbaa !5
  %177 = sub nsw i32 %176, %172
  %178 = icmp sgt i32 %177, 0
  br i1 %178, label %.lr.ph146, label %._crit_edge150

.lr.ph140:                                        ; preds = %150, %188
  %179 = phi i32 [ %189, %188 ], [ %162, %150 ]
  %indvars.iv181 = phi i64 [ %indvars.iv.next182, %188 ], [ 0, %150 ]
  %.079137 = phi i32 [ %190, %188 ], [ %170, %150 ]
  %180 = and i32 %.079137, 1
  %.not98 = icmp eq i32 %180, 0
  br i1 %.not98, label %188, label %181

181:                                              ; preds = %.lr.ph140
  %182 = sext i32 %179 to i64
  %183 = getelementptr inbounds [17 x [100003 x %struct.SparseTable]], ptr @st, i64 0, i64 %indvars.iv181, i64 %182, i32 2
  call void @_Z6vecMulRA3_A3_iRS_S2_(ptr noundef nonnull align 4 dereferenceable(36) %183, ptr noundef nonnull align 4 dereferenceable(12) %9, ptr noundef nonnull align 4 dereferenceable(12) %9)
  %184 = load i32, ptr %7, align 4, !tbaa !5
  %185 = sext i32 %184 to i64
  %186 = getelementptr inbounds [17 x [100003 x %struct.SparseTable]], ptr @st, i64 0, i64 %indvars.iv181, i64 %185
  %187 = load i32, ptr %186, align 4, !tbaa !19
  store i32 %187, ptr %7, align 4, !tbaa !5
  br label %188

188:                                              ; preds = %.lr.ph140, %181
  %189 = phi i32 [ %179, %.lr.ph140 ], [ %187, %181 ]
  %190 = lshr i32 %.079137, 1
  %indvars.iv.next182 = add nuw nsw i64 %indvars.iv181, 1
  %.not = icmp ult i32 %.079137, 2
  br i1 %.not, label %._crit_edge141.loopexit, label %.lr.ph140, !llvm.loop !24

.preheader:                                       ; preds = %203
  %.not96147 = icmp eq i32 %.1, 0
  br i1 %.not96147, label %._crit_edge150, label %.lr.ph149.preheader

.lr.ph149.preheader:                              ; preds = %.preheader
  %191 = sext i32 %.1 to i64
  br label %.lr.ph149

.lr.ph146:                                        ; preds = %._crit_edge141, %203
  %indvars.iv184 = phi i64 [ %indvars.iv.next185, %203 ], [ 0, %._crit_edge141 ]
  %.076143 = phi i32 [ %205, %203 ], [ %177, %._crit_edge141 ]
  %.077142 = phi i32 [ %.1, %203 ], [ 0, %._crit_edge141 ]
  %192 = phi i32 [ %204, %203 ], [ %173, %._crit_edge141 ]
  %193 = and i32 %.076143, 1
  %.not97 = icmp eq i32 %193, 0
  br i1 %.not97, label %203, label %194

194:                                              ; preds = %.lr.ph146
  %195 = sext i32 %.077142 to i64
  %196 = getelementptr inbounds [17 x [2 x i32]], ptr @_ZZ4mainE3que, i64 0, i64 %195
  %197 = trunc nuw nsw i64 %indvars.iv184 to i32
  store i32 %197, ptr %196, align 8, !tbaa !5
  %198 = add nsw i32 %.077142, 1
  %199 = getelementptr inbounds i8, ptr %196, i64 4
  store i32 %192, ptr %199, align 4, !tbaa !5
  %200 = sext i32 %192 to i64
  %201 = getelementptr inbounds [17 x [100003 x %struct.SparseTable]], ptr @st, i64 0, i64 %indvars.iv184, i64 %200
  %202 = load i32, ptr %201, align 4, !tbaa !19
  store i32 %202, ptr %8, align 4, !tbaa !5
  br label %203

203:                                              ; preds = %.lr.ph146, %194
  %204 = phi i32 [ %202, %194 ], [ %192, %.lr.ph146 ]
  %.1 = phi i32 [ %198, %194 ], [ %.077142, %.lr.ph146 ]
  %205 = lshr i32 %.076143, 1
  %indvars.iv.next185 = add nuw nsw i64 %indvars.iv184, 1
  %.not154 = icmp ult i32 %.076143, 2
  br i1 %.not154, label %.preheader, label %.lr.ph146, !llvm.loop !25

.lr.ph149:                                        ; preds = %.lr.ph149.preheader, %.lr.ph149
  %indvars.iv187 = phi i64 [ %191, %.lr.ph149.preheader ], [ %indvars.iv.next188, %.lr.ph149 ]
  %indvars.iv.next188 = add nsw i64 %indvars.iv187, -1
  %206 = getelementptr inbounds [17 x [2 x i32]], ptr @_ZZ4mainE3que, i64 0, i64 %indvars.iv.next188
  %207 = load i32, ptr %206, align 8, !tbaa !5
  %208 = sext i32 %207 to i64
  %209 = getelementptr inbounds i8, ptr %206, i64 4
  %210 = load i32, ptr %209, align 4, !tbaa !5
  %211 = sext i32 %210 to i64
  %212 = getelementptr inbounds [17 x [100003 x %struct.SparseTable]], ptr @st, i64 0, i64 %208, i64 %211, i32 1
  call void @_Z6vecMulRA3_A3_iRS_S2_(ptr noundef nonnull align 4 dereferenceable(36) %212, ptr noundef nonnull align 4 dereferenceable(12) %9, ptr noundef nonnull align 4 dereferenceable(12) %9)
  %.not96 = icmp eq i64 %indvars.iv.next188, 0
  br i1 %.not96, label %._crit_edge150, label %.lr.ph149, !llvm.loop !26

._crit_edge150:                                   ; preds = %.lr.ph149, %._crit_edge141, %.preheader
  %213 = load i32, ptr %9, align 8, !tbaa !5
  %214 = load i32, ptr %118, align 4, !tbaa !5
  %215 = load i32, ptr %119, align 8, !tbaa !5
  %216 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7, i32 noundef %213, i32 noundef %214, i32 noundef %215)
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %9) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #8
  %217 = load i32, ptr @m, align 4, !tbaa !5
  %218 = add nsw i32 %217, -1
  store i32 %218, ptr @m, align 4, !tbaa !5
  %.not95 = icmp eq i32 %217, 0
  br i1 %.not95, label %._crit_edge153, label %150, !llvm.loop !27

._crit_edge153:                                   ; preds = %._crit_edge150, %.preheader103
  ret i32 0
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #5

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_Z6matMulRA3_A3_iS1_S1_(ptr noundef nonnull align 4 dereferenceable(36), ptr noundef nonnull align 4 dereferenceable(36), ptr noundef nonnull align 4 dereferenceable(36)) local_unnamed_addr #7

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_Z6vecMulRA3_A3_iRS_S2_(ptr noundef nonnull align 4 dereferenceable(36), ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #5

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

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


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