; LLVM IR from tangjz/acm-icpc :: codechef/SEPT18 (STCFOTT)

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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@q = external dso_local global i32, align 4
@mx = external dso_local global i32, align 4
@inv = external dso_local global [481 x i32], align 16
@seq = external dso_local global [481 x i32], align 16
@mat = external dso_local global [21 x [481 x [481 x i32]]], align 16
@sum = external dso_local global [21 x [481 x [481 x i32]]], align 16
@ans = external dso_local global [1 x [481 x i32]], align 16
@tmp = external dso_local global [2 x [1 x [481 x i32]]], align 16
@e = external dso_local global [481 x %"class.std::vector"], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 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 nounwind uwtable
declare dso_local void @_Z7mat_addiiPA481_iS0_S0_(i32 noundef, i32 noundef, ptr noundef, ptr noundef, ptr 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: mustprogress nounwind uwtable
declare dso_local void @_Z7mat_muliiiPA481_iS0_S0_(i32 noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef) #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3dfsii(i32 noundef, i32 noundef) #2

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #3 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %13 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n)
  store i32 1, ptr getelementptr inbounds ([481 x i32], ptr @inv, i64 0, i64 1), align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  store i32 2, ptr %2, align 4, !tbaa !5
  br label %14

14:                                               ; preds = %47, %0
  %15 = load i32, ptr %2, align 4, !tbaa !5
  %16 = load i32, ptr @n, align 4, !tbaa !5
  %17 = icmp sle i32 %15, %16
  br i1 %17, label %19, label %18

18:                                               ; preds = %14
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  br label %50

19:                                               ; preds = %14
  %20 = load i32, ptr %2, align 4, !tbaa !5
  %21 = sdiv i32 998244353, %20
  %22 = sext i32 %21 to i64
  %23 = load i32, ptr %2, align 4, !tbaa !5
  %24 = srem i32 998244353, %23
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds [481 x i32], ptr @inv, i64 0, i64 %25
  %27 = load i32, ptr %26, align 4, !tbaa !5
  %28 = sext i32 %27 to i64
  %29 = mul nsw i64 %22, %28
  %30 = srem i64 %29, 998244353
  %31 = trunc i64 %30 to i32
  %32 = sub nsw i32 998244353, %31
  %33 = load i32, ptr %2, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [481 x i32], ptr @inv, i64 0, i64 %34
  store i32 %32, ptr %35, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  %36 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef %3, ptr noundef %4)
  %37 = load i32, ptr %3, align 4, !tbaa !5
  %38 = add nsw i32 %37, -1
  store i32 %38, ptr %3, align 4, !tbaa !5
  %39 = load i32, ptr %4, align 4, !tbaa !5
  %40 = add nsw i32 %39, -1
  store i32 %40, ptr %4, align 4, !tbaa !5
  %41 = load i32, ptr %3, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [481 x %"class.std::vector"], ptr @e, i64 0, i64 %42
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %43, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %44 = load i32, ptr %4, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [481 x %"class.std::vector"], ptr @e, i64 0, i64 %45
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %46, ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  br label %47

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

50:                                               ; preds = %18
  call void @_Z3dfsii(i32 noundef 0, i32 noundef -1)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %51

51:                                               ; preds = %64, %50
  %52 = load i32, ptr %5, align 4, !tbaa !5
  %53 = load i32, ptr @n, align 4, !tbaa !5
  %54 = shl i32 %53, 1
  %55 = icmp slt i32 %52, %54
  br i1 %55, label %57, label %56

56:                                               ; preds = %51
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %67

57:                                               ; preds = %51
  %58 = load i32, ptr %5, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [481 x [481 x i32]], ptr @sum, i64 0, i64 %59
  %61 = load i32, ptr %5, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [481 x i32], ptr %60, i64 0, i64 %62
  store i32 1, ptr %63, align 4, !tbaa !5
  br label %64

64:                                               ; preds = %57
  %65 = load i32, ptr %5, align 4, !tbaa !5
  %66 = add nsw i32 %65, 1
  store i32 %66, ptr %5, align 4, !tbaa !5
  br label %51, !llvm.loop !11

67:                                               ; preds = %56
  %68 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @m)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %69

69:                                               ; preds = %79, %67
  %70 = load i32, ptr %6, align 4, !tbaa !5
  %71 = load i32, ptr @m, align 4, !tbaa !5
  %72 = icmp slt i32 %70, %71
  br i1 %72, label %74, label %73

73:                                               ; preds = %69
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %82

74:                                               ; preds = %69
  %75 = load i32, ptr %6, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds i32, ptr @seq, i64 %76
  %78 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %77)
  br label %79

79:                                               ; preds = %74
  %80 = load i32, ptr %6, align 4, !tbaa !5
  %81 = add nsw i32 %80, 1
  store i32 %81, ptr %6, align 4, !tbaa !5
  br label %69, !llvm.loop !12

82:                                               ; preds = %73
  %83 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @q)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %84

84:                                               ; preds = %214, %82
  %85 = load i32, ptr %7, align 4, !tbaa !5
  %86 = load i32, ptr @m, align 4, !tbaa !5
  %87 = icmp slt i32 %85, %86
  br i1 %87, label %89, label %88

88:                                               ; preds = %84
  store i32 11, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %217

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

90:                                               ; preds = %104, %89
  %91 = load i32, ptr %9, align 4, !tbaa !5
  %92 = load i32, ptr @n, align 4, !tbaa !5
  %93 = shl i32 %92, 1
  %94 = icmp slt i32 %91, %93
  br i1 %94, label %96, label %95

95:                                               ; preds = %90
  store i32 14, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %107

96:                                               ; preds = %90
  %97 = load i32, ptr %9, align 4, !tbaa !5
  %98 = icmp ne i32 %97, 0
  %99 = xor i1 %98, true
  %100 = zext i1 %99 to i32
  %101 = load i32, ptr %9, align 4, !tbaa !5
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [481 x i32], ptr @tmp, i64 0, i64 %102
  store i32 %100, ptr %103, align 4, !tbaa !5
  br label %104

104:                                              ; preds = %96
  %105 = load i32, ptr %9, align 4, !tbaa !5
  %106 = add nsw i32 %105, 1
  store i32 %106, ptr %9, align 4, !tbaa !5
  br label %90, !llvm.loop !13

107:                                              ; preds = %95
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 0, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %108 = load i32, ptr @q, align 4, !tbaa !5
  %109 = load i32, ptr %7, align 4, !tbaa !5
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [481 x i32], ptr @seq, i64 0, i64 %110
  %112 = load i32, ptr %111, align 4, !tbaa !5
  %113 = sub nsw i32 %108, %112
  %114 = add nsw i32 %113, 1
  store i32 %114, ptr %11, align 4, !tbaa !5
  br label %115

115:                                              ; preds = %208, %107
  %116 = load i32, ptr %11, align 4, !tbaa !5
  %117 = icmp sgt i32 %116, 0
  br i1 %117, label %119, label %118

118:                                              ; preds = %115
  store i32 17, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %213

119:                                              ; preds = %115
  %120 = load i32, ptr %11, align 4, !tbaa !5
  %121 = and i32 %120, 1
  %122 = icmp ne i32 %121, 0
  br i1 %122, label %124, label %123

123:                                              ; preds = %119
  br label %208

124:                                              ; preds = %119
  br label %125

125:                                              ; preds = %186, %124
  %126 = load i32, ptr @mx, align 4, !tbaa !5
  %127 = load i32, ptr %10, align 4, !tbaa !5
  %128 = icmp slt i32 %126, %127
  br i1 %128, label %129, label %189

129:                                              ; preds = %125
  %130 = load i32, ptr @n, align 4, !tbaa !5
  %131 = shl i32 %130, 1
  %132 = load i32, ptr @n, align 4, !tbaa !5
  %133 = shl i32 %132, 1
  %134 = load i32, ptr @n, align 4, !tbaa !5
  %135 = shl i32 %134, 1
  %136 = load i32, ptr @mx, align 4, !tbaa !5
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds [21 x [481 x [481 x i32]]], ptr @mat, i64 0, i64 %137
  %139 = getelementptr inbounds [481 x [481 x i32]], ptr %138, i64 0, i64 0
  %140 = load i32, ptr @mx, align 4, !tbaa !5
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds [21 x [481 x [481 x i32]]], ptr @sum, i64 0, i64 %141
  %143 = getelementptr inbounds [481 x [481 x i32]], ptr %142, i64 0, i64 0
  %144 = load i32, ptr @mx, align 4, !tbaa !5
  %145 = add nsw i32 %144, 1
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds [21 x [481 x [481 x i32]]], ptr @sum, i64 0, i64 %146
  %148 = getelementptr inbounds [481 x [481 x i32]], ptr %147, i64 0, i64 0
  call void @_Z7mat_muliiiPA481_iS0_S0_(i32 noundef %131, i32 noundef %133, i32 noundef %135, ptr noundef %139, ptr noundef %143, ptr noundef %148)
  %149 = load i32, ptr @n, align 4, !tbaa !5
  %150 = shl i32 %149, 1
  %151 = load i32, ptr @n, align 4, !tbaa !5
  %152 = shl i32 %151, 1
  %153 = load i32, ptr @mx, align 4, !tbaa !5
  %154 = sext i32 %153 to i64
  %155 = getelementptr inbounds [21 x [481 x [481 x i32]]], ptr @sum, i64 0, i64 %154
  %156 = getelementptr inbounds [481 x [481 x i32]], ptr %155, i64 0, i64 0
  %157 = load i32, ptr @mx, align 4, !tbaa !5
  %158 = add nsw i32 %157, 1
  %159 = sext i32 %158 to i64
  %160 = getelementptr inbounds [21 x [481 x [481 x i32]]], ptr @sum, i64 0, i64 %159
  %161 = getelementptr inbounds [481 x [481 x i32]], ptr %160, i64 0, i64 0
  %162 = load i32, ptr @mx, align 4, !tbaa !5
  %163 = add nsw i32 %162, 1
  %164 = sext i32 %163 to i64
  %165 = getelementptr inbounds [21 x [481 x [481 x i32]]], ptr @sum, i64 0, i64 %164
  %166 = getelementptr inbounds [481 x [481 x i32]], ptr %165, i64 0, i64 0
  call void @_Z7mat_addiiPA481_iS0_S0_(i32 noundef %150, i32 noundef %152, ptr noundef %156, ptr noundef %161, ptr noundef %166)
  %167 = load i32, ptr @n, align 4, !tbaa !5
  %168 = shl i32 %167, 1
  %169 = load i32, ptr @n, align 4, !tbaa !5
  %170 = shl i32 %169, 1
  %171 = load i32, ptr @n, align 4, !tbaa !5
  %172 = shl i32 %171, 1
  %173 = load i32, ptr @mx, align 4, !tbaa !5
  %174 = sext i32 %173 to i64
  %175 = getelementptr inbounds [21 x [481 x [481 x i32]]], ptr @mat, i64 0, i64 %174
  %176 = getelementptr inbounds [481 x [481 x i32]], ptr %175, i64 0, i64 0
  %177 = load i32, ptr @mx, align 4, !tbaa !5
  %178 = sext i32 %177 to i64
  %179 = getelementptr inbounds [21 x [481 x [481 x i32]]], ptr @mat, i64 0, i64 %178
  %180 = getelementptr inbounds [481 x [481 x i32]], ptr %179, i64 0, i64 0
  %181 = load i32, ptr @mx, align 4, !tbaa !5
  %182 = add nsw i32 %181, 1
  %183 = sext i32 %182 to i64
  %184 = getelementptr inbounds [21 x [481 x [481 x i32]]], ptr @mat, i64 0, i64 %183
  %185 = getelementptr inbounds [481 x [481 x i32]], ptr %184, i64 0, i64 0
  call void @_Z7mat_muliiiPA481_iS0_S0_(i32 noundef %168, i32 noundef %170, i32 noundef %172, ptr noundef %176, ptr noundef %180, ptr noundef %185)
  br label %186

186:                                              ; preds = %129
  %187 = load i32, ptr @mx, align 4, !tbaa !5
  %188 = add nsw i32 %187, 1
  store i32 %188, ptr @mx, align 4, !tbaa !5
  br label %125, !llvm.loop !14

189:                                              ; preds = %125
  %190 = load i32, ptr @n, align 4, !tbaa !5
  %191 = shl i32 %190, 1
  %192 = load i32, ptr @n, align 4, !tbaa !5
  %193 = shl i32 %192, 1
  %194 = load i32, ptr %10, align 4, !tbaa !5
  %195 = sext i32 %194 to i64
  %196 = getelementptr inbounds [21 x [481 x [481 x i32]]], ptr @sum, i64 0, i64 %195
  %197 = getelementptr inbounds [481 x [481 x i32]], ptr %196, i64 0, i64 0
  call void @_Z7mat_muliiiPA481_iS0_S0_(i32 noundef 1, i32 noundef %191, i32 noundef %193, ptr noundef @tmp, ptr noundef %197, ptr noundef getelementptr inbounds ([2 x [1 x [481 x i32]]], ptr @tmp, i64 0, i64 1))
  %198 = load i32, ptr @n, align 4, !tbaa !5
  %199 = shl i32 %198, 1
  call void @_Z7mat_addiiPA481_iS0_S0_(i32 noundef 1, i32 noundef %199, ptr noundef @ans, ptr noundef getelementptr inbounds ([2 x [1 x [481 x i32]]], ptr @tmp, i64 0, i64 1), ptr noundef @ans)
  %200 = load i32, ptr @n, align 4, !tbaa !5
  %201 = shl i32 %200, 1
  %202 = load i32, ptr @n, align 4, !tbaa !5
  %203 = shl i32 %202, 1
  %204 = load i32, ptr %10, align 4, !tbaa !5
  %205 = sext i32 %204 to i64
  %206 = getelementptr inbounds [21 x [481 x [481 x i32]]], ptr @mat, i64 0, i64 %205
  %207 = getelementptr inbounds [481 x [481 x i32]], ptr %206, i64 0, i64 0
  call void @_Z7mat_muliiiPA481_iS0_S0_(i32 noundef 1, i32 noundef %201, i32 noundef %203, ptr noundef @tmp, ptr noundef %207, ptr noundef @tmp)
  br label %208

208:                                              ; preds = %189, %123
  %209 = load i32, ptr %10, align 4, !tbaa !5
  %210 = add nsw i32 %209, 1
  store i32 %210, ptr %10, align 4, !tbaa !5
  %211 = load i32, ptr %11, align 4, !tbaa !5
  %212 = ashr i32 %211, 1
  store i32 %212, ptr %11, align 4, !tbaa !5
  br label %115, !llvm.loop !15

213:                                              ; preds = %118
  br label %214

214:                                              ; preds = %213
  %215 = load i32, ptr %7, align 4, !tbaa !5
  %216 = add nsw i32 %215, 1
  store i32 %216, ptr %7, align 4, !tbaa !5
  br label %84, !llvm.loop !16

217:                                              ; preds = %88
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %218

218:                                              ; preds = %258, %217
  %219 = load i32, ptr %12, align 4, !tbaa !5
  %220 = load i32, ptr @n, align 4, !tbaa !5
  %221 = icmp slt i32 %219, %220
  br i1 %221, label %223, label %222

222:                                              ; preds = %218
  store i32 23, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %261

223:                                              ; preds = %218
  %224 = load i32, ptr @n, align 4, !tbaa !5
  %225 = load i32, ptr %12, align 4, !tbaa !5
  %226 = add nsw i32 %224, %225
  %227 = sext i32 %226 to i64
  %228 = getelementptr inbounds [481 x i32], ptr @ans, i64 0, i64 %227
  %229 = load i32, ptr %228, align 4, !tbaa !5
  %230 = load i32, ptr %12, align 4, !tbaa !5
  %231 = sext i32 %230 to i64
  %232 = getelementptr inbounds [481 x i32], ptr @ans, i64 0, i64 %231
  %233 = load i32, ptr %232, align 4, !tbaa !5
  %234 = add nsw i32 %233, %229
  store i32 %234, ptr %232, align 4, !tbaa !5
  %235 = icmp sge i32 %234, 998244353
  br i1 %235, label %236, label %243

236:                                              ; preds = %223
  %237 = load i32, ptr %12, align 4, !tbaa !5
  %238 = sext i32 %237 to i64
  %239 = getelementptr inbounds [481 x i32], ptr @ans, i64 0, i64 %238
  %240 = load i32, ptr %239, align 4, !tbaa !5
  %241 = sub nsw i32 %240, 998244353
  store i32 %241, ptr %239, align 4, !tbaa !5
  %242 = icmp ne i32 %241, 0
  br label %243

243:                                              ; preds = %236, %223
  %244 = phi i1 [ false, %223 ], [ %242, %236 ]
  %245 = load i32, ptr %12, align 4, !tbaa !5
  %246 = sext i32 %245 to i64
  %247 = getelementptr inbounds [481 x i32], ptr @ans, i64 0, i64 %246
  %248 = load i32, ptr %247, align 4, !tbaa !5
  %249 = load i32, ptr %12, align 4, !tbaa !5
  %250 = load i32, ptr @n, align 4, !tbaa !5
  %251 = sub nsw i32 %250, 1
  %252 = icmp eq i32 %249, %251
  %253 = zext i1 %252 to i64
  %254 = getelementptr inbounds [3 x i8], ptr @.str.4, i64 0, i64 %253
  %255 = load i8, ptr %254, align 1, !tbaa !17
  %256 = sext i8 %255 to i32
  %257 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %248, i32 noundef %256)
  br label %258

258:                                              ; preds = %243
  %259 = load i32, ptr %12, align 4, !tbaa !5
  %260 = add nsw i32 %259, 1
  store i32 %260, ptr %12, align 4, !tbaa !5
  br label %218, !llvm.loop !18

261:                                              ; preds = %222
  ret i32 0
}

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) #2 align 2

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = 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 = distinct !{!16, !10}
!17 = !{!7, !7, i64 0}
!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"

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@q = external dso_local global i32, align 4
@mx = external dso_local local_unnamed_addr global i32, align 4
@inv = external dso_local local_unnamed_addr global [481 x i32], align 16
@seq = external dso_local global [481 x i32], align 16
@mat = external dso_local global [21 x [481 x [481 x i32]]], align 16
@sum = external dso_local global [21 x [481 x [481 x i32]]], align 16
@ans = external dso_local global [1 x [481 x i32]], align 16
@tmp = external dso_local global [2 x [1 x [481 x i32]]], align 16
@e = external dso_local global [481 x %"class.std::vector"], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 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 nounwind uwtable
declare dso_local void @_Z7mat_addiiPA481_iS0_S0_(i32 noundef, i32 noundef, ptr noundef, ptr noundef, ptr 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 void @_Z7mat_muliiiPA481_iS0_S0_(i32 noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3dfsii(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 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
  store i32 1, ptr getelementptr inbounds (i8, ptr @inv, i64 4), align 4, !tbaa !5
  %4 = load i32, ptr @n, align 4, !tbaa !5
  %.not47 = icmp slt i32 %4, 2
  br i1 %.not47, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %0
  call void @_Z3dfsii(i32 noundef 0, i32 noundef -1)
  %5 = load i32, ptr @n, align 4, !tbaa !5
  %6 = shl i32 %5, 1
  %7 = icmp sgt i32 %6, 0
  br i1 %7, label %.lr.ph51.preheader, label %._crit_edge52

.lr.ph51.preheader:                               ; preds = %._crit_edge
  %wide.trip.count = zext nneg i32 %6 to i64
  %xtraiter = and i64 %wide.trip.count, 2
  %8 = icmp ult i32 %6, 4
  br i1 %8, label %._crit_edge52.loopexit.unr-lcssa, label %.lr.ph51.preheader.new

.lr.ph51.preheader.new:                           ; preds = %.lr.ph51.preheader
  %unroll_iter = and i64 %wide.trip.count, 2147483644
  br label %.lr.ph51

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 2, %0 ]
  %9 = trunc nuw nsw i64 %indvars.iv to i32
  %10 = udiv i32 998244353, %9
  %11 = zext nneg i32 %10 to i64
  %12 = urem i32 998244353, %9
  %13 = zext nneg i32 %12 to i64
  %14 = getelementptr inbounds [481 x i32], ptr @inv, i64 0, i64 %13
  %15 = load i32, ptr %14, align 4, !tbaa !5
  %16 = sext i32 %15 to i64
  %17 = mul nsw i64 %16, %11
  %18 = srem i64 %17, 998244353
  %19 = trunc nsw i64 %18 to i32
  %20 = sub nsw i32 998244353, %19
  %21 = getelementptr inbounds [481 x i32], ptr @inv, i64 0, i64 %indvars.iv
  store i32 %20, ptr %21, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #5
  %22 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %1, ptr noundef nonnull %2)
  %23 = load i32, ptr %1, align 4, !tbaa !5
  %24 = add nsw i32 %23, -1
  store i32 %24, ptr %1, align 4, !tbaa !5
  %25 = load i32, ptr %2, align 4, !tbaa !5
  %26 = add nsw i32 %25, -1
  store i32 %26, ptr %2, align 4, !tbaa !5
  %27 = sext i32 %24 to i64
  %28 = getelementptr inbounds [481 x %"class.std::vector"], ptr @e, i64 0, i64 %27
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %28, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %29 = load i32, ptr %2, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds [481 x %"class.std::vector"], ptr @e, i64 0, i64 %30
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %31, ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %32 = load i32, ptr @n, align 4, !tbaa !5
  %33 = sext i32 %32 to i64
  %.not.not = icmp slt i64 %indvars.iv, %33
  br i1 %.not.not, label %.lr.ph, label %._crit_edge, !llvm.loop !9

._crit_edge52.loopexit.unr-lcssa:                 ; preds = %.lr.ph51, %.lr.ph51.preheader
  %indvars.iv72.unr = phi i64 [ 0, %.lr.ph51.preheader ], [ %indvars.iv.next73.3, %.lr.ph51 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge52, label %.lr.ph51.epil

.lr.ph51.epil:                                    ; preds = %._crit_edge52.loopexit.unr-lcssa, %.lr.ph51.epil
  %indvars.iv72.epil = phi i64 [ %indvars.iv.next73.epil, %.lr.ph51.epil ], [ %indvars.iv72.unr, %._crit_edge52.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph51.epil ], [ 0, %._crit_edge52.loopexit.unr-lcssa ]
  %34 = getelementptr inbounds [481 x [481 x i32]], ptr @sum, i64 0, i64 %indvars.iv72.epil, i64 %indvars.iv72.epil
  store i32 1, ptr %34, align 4, !tbaa !5
  %indvars.iv.next73.epil = add nuw nsw i64 %indvars.iv72.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge52, label %.lr.ph51.epil, !llvm.loop !11

._crit_edge52:                                    ; preds = %._crit_edge52.loopexit.unr-lcssa, %.lr.ph51.epil, %._crit_edge
  %35 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @m)
  %36 = load i32, ptr @m, align 4, !tbaa !5
  %37 = icmp sgt i32 %36, 0
  br i1 %37, label %.lr.ph55, label %._crit_edge56

.lr.ph51:                                         ; preds = %.lr.ph51, %.lr.ph51.preheader.new
  %indvars.iv72 = phi i64 [ 0, %.lr.ph51.preheader.new ], [ %indvars.iv.next73.3, %.lr.ph51 ]
  %niter = phi i64 [ 0, %.lr.ph51.preheader.new ], [ %niter.next.3, %.lr.ph51 ]
  %38 = getelementptr inbounds [481 x [481 x i32]], ptr @sum, i64 0, i64 %indvars.iv72, i64 %indvars.iv72
  store i32 1, ptr %38, align 16, !tbaa !5
  %indvars.iv.next73 = or disjoint i64 %indvars.iv72, 1
  %39 = getelementptr inbounds [481 x [481 x i32]], ptr @sum, i64 0, i64 %indvars.iv.next73, i64 %indvars.iv.next73
  store i32 1, ptr %39, align 8, !tbaa !5
  %indvars.iv.next73.1 = or disjoint i64 %indvars.iv72, 2
  %40 = getelementptr inbounds [481 x [481 x i32]], ptr @sum, i64 0, i64 %indvars.iv.next73.1, i64 %indvars.iv.next73.1
  store i32 1, ptr %40, align 16, !tbaa !5
  %indvars.iv.next73.2 = or disjoint i64 %indvars.iv72, 3
  %41 = getelementptr inbounds [481 x [481 x i32]], ptr @sum, i64 0, i64 %indvars.iv.next73.2, i64 %indvars.iv.next73.2
  store i32 1, ptr %41, align 8, !tbaa !5
  %indvars.iv.next73.3 = add nuw nsw i64 %indvars.iv72, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %._crit_edge52.loopexit.unr-lcssa, label %.lr.ph51, !llvm.loop !13

._crit_edge56:                                    ; preds = %.lr.ph55, %._crit_edge52
  %42 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @q)
  %43 = load i32, ptr @m, align 4, !tbaa !5
  %44 = icmp sgt i32 %43, 0
  br i1 %44, label %.preheader46, label %.preheader

.lr.ph55:                                         ; preds = %._crit_edge52, %.lr.ph55
  %indvars.iv75 = phi i64 [ %indvars.iv.next76, %.lr.ph55 ], [ 0, %._crit_edge52 ]
  %45 = getelementptr inbounds i32, ptr @seq, i64 %indvars.iv75
  %46 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %45)
  %indvars.iv.next76 = add nuw nsw i64 %indvars.iv75, 1
  %47 = load i32, ptr @m, align 4, !tbaa !5
  %48 = sext i32 %47 to i64
  %49 = icmp slt i64 %indvars.iv.next76, %48
  br i1 %49, label %.lr.ph55, label %._crit_edge56, !llvm.loop !14

.preheader46:                                     ; preds = %._crit_edge56, %._crit_edge66
  %50 = phi i32 [ %71, %._crit_edge66 ], [ %43, %._crit_edge56 ]
  %indvars.iv86 = phi i64 [ %indvars.iv.next87, %._crit_edge66 ], [ 0, %._crit_edge56 ]
  %51 = load i32, ptr @n, align 4, !tbaa !5
  %52 = shl i32 %51, 1
  %53 = icmp sgt i32 %52, 0
  br i1 %53, label %.lr.ph58.preheader, label %._crit_edge59

.lr.ph58.preheader:                               ; preds = %.preheader46
  %wide.trip.count81 = zext nneg i32 %52 to i64
  %min.iters.check = icmp ult i32 %52, 8
  br i1 %min.iters.check, label %.lr.ph58.preheader93, label %vector.ph

.lr.ph58.preheader93:                             ; preds = %middle.block, %.lr.ph58.preheader
  %indvars.iv78.ph = phi i64 [ 0, %.lr.ph58.preheader ], [ %n.vec, %middle.block ]
  br label %.lr.ph58

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

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.ind = phi <4 x i64> [ <i64 0, i64 1, i64 2, i64 3>, %vector.ph ], [ %vec.ind.next, %vector.body ]
  %54 = icmp eq <4 x i64> %vec.ind, zeroinitializer
  %55 = icmp eq <4 x i64> %vec.ind, <i64 -4, i64 -4, i64 -4, i64 -4>
  %56 = zext <4 x i1> %54 to <4 x i32>
  %57 = zext <4 x i1> %55 to <4 x i32>
  %58 = getelementptr inbounds [481 x i32], ptr @tmp, i64 0, i64 %index
  %59 = getelementptr inbounds i8, ptr %58, i64 16
  store <4 x i32> %56, ptr %58, align 16, !tbaa !5
  store <4 x i32> %57, ptr %59, align 16, !tbaa !5
  %index.next = add nuw i64 %index, 8
  %vec.ind.next = add <4 x i64> %vec.ind, <i64 8, i64 8, i64 8, i64 8>
  %60 = icmp eq i64 %index.next, %n.vec
  br i1 %60, label %middle.block, label %vector.body, !llvm.loop !15

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count81
  br i1 %cmp.n, label %._crit_edge59, label %.lr.ph58.preheader93

.preheader:                                       ; preds = %._crit_edge66, %._crit_edge56
  %61 = load i32, ptr @n, align 4, !tbaa !5
  %62 = icmp sgt i32 %61, 0
  br i1 %62, label %.lr.ph69, label %._crit_edge70

._crit_edge59:                                    ; preds = %.lr.ph58, %middle.block, %.preheader46
  %63 = load i32, ptr @q, align 4, !tbaa !5
  %64 = getelementptr inbounds [481 x i32], ptr @seq, i64 0, i64 %indvars.iv86
  %65 = load i32, ptr %64, align 4, !tbaa !5
  %66 = add i32 %63, 1
  %67 = sub i32 %66, %65
  %68 = icmp sgt i32 %67, 0
  br i1 %68, label %.lr.ph65, label %._crit_edge66

.lr.ph58:                                         ; preds = %.lr.ph58.preheader93, %.lr.ph58
  %indvars.iv78 = phi i64 [ %indvars.iv.next79, %.lr.ph58 ], [ %indvars.iv78.ph, %.lr.ph58.preheader93 ]
  %.not44 = icmp eq i64 %indvars.iv78, 0
  %69 = zext i1 %.not44 to i32
  %70 = getelementptr inbounds [481 x i32], ptr @tmp, i64 0, i64 %indvars.iv78
  store i32 %69, ptr %70, align 4, !tbaa !5
  %indvars.iv.next79 = add nuw nsw i64 %indvars.iv78, 1
  %exitcond82.not = icmp eq i64 %indvars.iv.next79, %wide.trip.count81
  br i1 %exitcond82.not, label %._crit_edge59, label %.lr.ph58, !llvm.loop !18

._crit_edge66.loopexit:                           ; preds = %115
  %.pre = load i32, ptr @m, align 4, !tbaa !5
  br label %._crit_edge66

._crit_edge66:                                    ; preds = %._crit_edge66.loopexit, %._crit_edge59
  %71 = phi i32 [ %.pre, %._crit_edge66.loopexit ], [ %50, %._crit_edge59 ]
  %indvars.iv.next87 = add nuw nsw i64 %indvars.iv86, 1
  %72 = sext i32 %71 to i64
  %73 = icmp slt i64 %indvars.iv.next87, %72
  br i1 %73, label %.preheader46, label %.preheader, !llvm.loop !19

.lr.ph65:                                         ; preds = %._crit_edge59, %115
  %indvars.iv83 = phi i64 [ %indvars.iv.next84, %115 ], [ 0, %._crit_edge59 ]
  %.03363 = phi i32 [ %116, %115 ], [ %67, %._crit_edge59 ]
  %74 = and i32 %.03363, 1
  %.not43 = icmp eq i32 %74, 0
  br i1 %.not43, label %115, label %.preheader45

.preheader45:                                     ; preds = %.lr.ph65
  %75 = load i32, ptr @mx, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = icmp sgt i64 %indvars.iv83, %76
  br i1 %77, label %.lr.ph60, label %._crit_edge61

.lr.ph60:                                         ; preds = %.preheader45, %.lr.ph60
  %78 = phi i32 [ %104, %.lr.ph60 ], [ %75, %.preheader45 ]
  %79 = load i32, ptr @n, align 4, !tbaa !5
  %80 = shl i32 %79, 1
  %81 = sext i32 %78 to i64
  %82 = getelementptr inbounds [21 x [481 x [481 x i32]]], ptr @mat, i64 0, i64 %81
  %83 = getelementptr inbounds [21 x [481 x [481 x i32]]], ptr @sum, i64 0, i64 %81
  %84 = add nsw i32 %78, 1
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [21 x [481 x [481 x i32]]], ptr @sum, i64 0, i64 %85
  call void @_Z7mat_muliiiPA481_iS0_S0_(i32 noundef %80, i32 noundef %80, i32 noundef %80, ptr noundef nonnull %82, ptr noundef nonnull %83, ptr noundef nonnull %86)
  %87 = load i32, ptr @n, align 4, !tbaa !5
  %88 = shl i32 %87, 1
  %89 = load i32, ptr @mx, align 4, !tbaa !5
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [21 x [481 x [481 x i32]]], ptr @sum, i64 0, i64 %90
  %92 = add nsw i32 %89, 1
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [21 x [481 x [481 x i32]]], ptr @sum, i64 0, i64 %93
  call void @_Z7mat_addiiPA481_iS0_S0_(i32 noundef %88, i32 noundef %88, ptr noundef nonnull %91, ptr noundef nonnull %94, ptr noundef nonnull %94)
  %95 = load i32, ptr @n, align 4, !tbaa !5
  %96 = shl i32 %95, 1
  %97 = load i32, ptr @mx, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [21 x [481 x [481 x i32]]], ptr @mat, i64 0, i64 %98
  %100 = add nsw i32 %97, 1
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [21 x [481 x [481 x i32]]], ptr @mat, i64 0, i64 %101
  call void @_Z7mat_muliiiPA481_iS0_S0_(i32 noundef %96, i32 noundef %96, i32 noundef %96, ptr noundef nonnull %99, ptr noundef nonnull %99, ptr noundef nonnull %102)
  %103 = load i32, ptr @mx, align 4, !tbaa !5
  %104 = add nsw i32 %103, 1
  store i32 %104, ptr @mx, align 4, !tbaa !5
  %105 = sext i32 %104 to i64
  %106 = icmp sgt i64 %indvars.iv83, %105
  br i1 %106, label %.lr.ph60, label %._crit_edge61, !llvm.loop !20

._crit_edge61:                                    ; preds = %.lr.ph60, %.preheader45
  %107 = load i32, ptr @n, align 4, !tbaa !5
  %108 = shl i32 %107, 1
  %109 = getelementptr inbounds [21 x [481 x [481 x i32]]], ptr @sum, i64 0, i64 %indvars.iv83
  call void @_Z7mat_muliiiPA481_iS0_S0_(i32 noundef 1, i32 noundef %108, i32 noundef %108, ptr noundef nonnull @tmp, ptr noundef nonnull %109, ptr noundef nonnull getelementptr inbounds (i8, ptr @tmp, i64 1924))
  %110 = load i32, ptr @n, align 4, !tbaa !5
  %111 = shl i32 %110, 1
  call void @_Z7mat_addiiPA481_iS0_S0_(i32 noundef 1, i32 noundef %111, ptr noundef nonnull @ans, ptr noundef nonnull getelementptr inbounds (i8, ptr @tmp, i64 1924), ptr noundef nonnull @ans)
  %112 = load i32, ptr @n, align 4, !tbaa !5
  %113 = shl i32 %112, 1
  %114 = getelementptr inbounds [21 x [481 x [481 x i32]]], ptr @mat, i64 0, i64 %indvars.iv83
  call void @_Z7mat_muliiiPA481_iS0_S0_(i32 noundef 1, i32 noundef %113, i32 noundef %113, ptr noundef nonnull @tmp, ptr noundef nonnull %114, ptr noundef nonnull @tmp)
  br label %115

115:                                              ; preds = %.lr.ph65, %._crit_edge61
  %indvars.iv.next84 = add nuw nsw i64 %indvars.iv83, 1
  %116 = lshr i32 %.03363, 1
  %.not = icmp ult i32 %.03363, 2
  br i1 %.not, label %._crit_edge66.loopexit, label %.lr.ph65, !llvm.loop !21

._crit_edge70:                                    ; preds = %.lr.ph69, %.preheader
  ret i32 0

.lr.ph69:                                         ; preds = %.preheader, %.lr.ph69
  %indvars.iv89 = phi i64 [ %indvars.iv.next90, %.lr.ph69 ], [ 0, %.preheader ]
  %117 = phi i32 [ %136, %.lr.ph69 ], [ %61, %.preheader ]
  %118 = trunc nuw nsw i64 %indvars.iv89 to i32
  %119 = add nsw i32 %117, %118
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds [481 x i32], ptr @ans, i64 0, i64 %120
  %122 = load i32, ptr %121, align 4, !tbaa !5
  %123 = getelementptr inbounds [481 x i32], ptr @ans, i64 0, i64 %indvars.iv89
  %124 = load i32, ptr %123, align 4, !tbaa !5
  %125 = add nsw i32 %124, %122
  %126 = icmp sgt i32 %125, 998244352
  %127 = add nsw i32 %125, -998244353
  %spec.select = select i1 %126, i32 %127, i32 %125
  store i32 %spec.select, ptr %123, align 4, !tbaa !5
  %128 = add nsw i32 %117, -1
  %129 = zext i32 %128 to i64
  %130 = icmp eq i64 %indvars.iv89, %129
  %131 = zext i1 %130 to i64
  %132 = getelementptr inbounds [3 x i8], ptr @.str.4, i64 0, i64 %131
  %133 = load i8, ptr %132, align 1, !tbaa !22
  %134 = sext i8 %133 to i32
  %135 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %spec.select, i32 noundef %134)
  %indvars.iv.next90 = add nuw nsw i64 %indvars.iv89, 1
  %136 = load i32, ptr @n, align 4, !tbaa !5
  %137 = sext i32 %136 to i64
  %138 = icmp slt i64 %indvars.iv.next90, %137
  br i1 %138, label %.lr.ph69, label %._crit_edge70, !llvm.loop !23
}

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2 align 2

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

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #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 = { 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, !12}
!12 = !{!"llvm.loop.unroll.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10, !16, !17}
!16 = !{!"llvm.loop.isvectorized", i32 1}
!17 = !{!"llvm.loop.unroll.runtime.disable"}
!18 = distinct !{!18, !10, !17, !16}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10}
!21 = distinct !{!21, !10}
!22 = !{!7, !7, i64 0}
!23 = distinct !{!23, !10}


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