; LLVM IR from tangjz/acm-icpc :: hdu (5829)

; 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.std::greater" = type { i8 }

@pw = external dso_local global [100001 x i32], align 16
@fact = external dso_local global [100001 x i32], align 16
@iact = external dso_local global [100001 x i32], align 16
@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@a = external dso_local global [100001 x i32], align 16
@h = external dso_local global [100001 x i32], align 16
@w = external dso_local global [262144 x i32], align 16
@inv2 = external dso_local global [19 x i32], align 16
@bitrev = external dso_local global [262144 x i32], align 16
@f = external dso_local global [262144 x i32], align 16
@g = external dso_local global [262144 x i32], align 16

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca %"struct.std::greater", align 1
  %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
  store i32 0, ptr %1, align 4
  store i32 1, ptr @w, align 16, !tbaa !5
  %15 = call noundef i32 @_Z7mod_powii(i32 noundef 3, i32 noundef 3808)
  store i32 %15, ptr getelementptr inbounds ([262144 x i32], ptr @w, i64 0, i64 1), align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  store i32 2, ptr %2, align 4, !tbaa !5
  br label %16

16:                                               ; preds = %35, %0
  %17 = load i32, ptr %2, align 4, !tbaa !5
  %18 = icmp slt i32 %17, 262144
  br i1 %18, label %20, label %19

19:                                               ; preds = %16
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #4
  br label %38

20:                                               ; preds = %16
  %21 = load i32, ptr %2, align 4, !tbaa !5
  %22 = sub nsw i32 %21, 1
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds [262144 x i32], ptr @w, i64 0, i64 %23
  %25 = load i32, ptr %24, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  %27 = load i32, ptr getelementptr inbounds ([262144 x i32], ptr @w, i64 0, i64 1), align 4, !tbaa !5
  %28 = sext i32 %27 to i64
  %29 = mul nsw i64 %26, %28
  %30 = srem i64 %29, 998244353
  %31 = trunc i64 %30 to i32
  %32 = load i32, ptr %2, align 4, !tbaa !5
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [262144 x i32], ptr @w, i64 0, i64 %33
  store i32 %31, ptr %34, align 4, !tbaa !5
  br label %35

35:                                               ; preds = %20
  %36 = load i32, ptr %2, align 4, !tbaa !5
  %37 = add nsw i32 %36, 1
  store i32 %37, ptr %2, align 4, !tbaa !5
  br label %16, !llvm.loop !9

38:                                               ; preds = %19
  store i32 1, ptr @inv2, align 16, !tbaa !5
  store i32 499122177, ptr getelementptr inbounds ([19 x i32], ptr @inv2, i64 0, i64 1), align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  store i32 2, ptr %3, align 4, !tbaa !5
  br label %39

39:                                               ; preds = %58, %38
  %40 = load i32, ptr %3, align 4, !tbaa !5
  %41 = icmp sle i32 %40, 18
  br i1 %41, label %43, label %42

42:                                               ; preds = %39
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  br label %61

43:                                               ; preds = %39
  %44 = load i32, ptr %3, align 4, !tbaa !5
  %45 = sub nsw i32 %44, 1
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [19 x i32], ptr @inv2, i64 0, i64 %46
  %48 = load i32, ptr %47, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = load i32, ptr getelementptr inbounds ([19 x i32], ptr @inv2, i64 0, i64 1), align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = mul nsw i64 %49, %51
  %53 = srem i64 %52, 998244353
  %54 = trunc i64 %53 to i32
  %55 = load i32, ptr %3, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [19 x i32], ptr @inv2, i64 0, i64 %56
  store i32 %54, ptr %57, align 4, !tbaa !5
  br label %58

58:                                               ; preds = %43
  %59 = load i32, ptr %3, align 4, !tbaa !5
  %60 = add nsw i32 %59, 1
  store i32 %60, ptr %3, align 4, !tbaa !5
  br label %39, !llvm.loop !11

61:                                               ; preds = %42
  store i32 1, ptr getelementptr inbounds ([100001 x i32], ptr @iact, i64 0, i64 1), align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  store i32 2, ptr %4, align 4, !tbaa !5
  br label %62

62:                                               ; preds = %83, %61
  %63 = load i32, ptr %4, align 4, !tbaa !5
  %64 = icmp slt i32 %63, 100001
  br i1 %64, label %66, label %65

65:                                               ; preds = %62
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  br label %86

66:                                               ; preds = %62
  %67 = load i32, ptr %4, align 4, !tbaa !5
  %68 = sdiv i32 998244353, %67
  %69 = sext i32 %68 to i64
  %70 = load i32, ptr %4, align 4, !tbaa !5
  %71 = srem i32 998244353, %70
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [100001 x i32], ptr @iact, i64 0, i64 %72
  %74 = load i32, ptr %73, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = mul nsw i64 %69, %75
  %77 = srem i64 %76, 998244353
  %78 = sub nsw i64 998244353, %77
  %79 = trunc i64 %78 to i32
  %80 = load i32, ptr %4, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [100001 x i32], ptr @iact, i64 0, i64 %81
  store i32 %79, ptr %82, align 4, !tbaa !5
  br label %83

83:                                               ; preds = %66
  %84 = load i32, ptr %4, align 4, !tbaa !5
  %85 = add nsw i32 %84, 1
  store i32 %85, ptr %4, align 4, !tbaa !5
  br label %62, !llvm.loop !12

86:                                               ; preds = %65
  store i32 1, ptr @iact, align 16, !tbaa !5
  store i32 1, ptr @fact, align 16, !tbaa !5
  store i32 1, ptr @pw, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  store i32 1, ptr %5, align 4, !tbaa !5
  br label %87

87:                                               ; preds = %140, %86
  %88 = load i32, ptr %5, align 4, !tbaa !5
  %89 = icmp slt i32 %88, 100001
  br i1 %89, label %91, label %90

90:                                               ; preds = %87
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  br label %143

91:                                               ; preds = %87
  %92 = load i32, ptr %5, align 4, !tbaa !5
  %93 = sub nsw i32 %92, 1
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [100001 x i32], ptr @pw, i64 0, i64 %94
  %96 = load i32, ptr %95, align 4, !tbaa !5
  %97 = shl i32 %96, 1
  %98 = load i32, ptr %5, align 4, !tbaa !5
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [100001 x i32], ptr @pw, i64 0, i64 %99
  store i32 %97, ptr %100, align 4, !tbaa !5
  %101 = icmp sge i32 %97, 998244353
  br i1 %101, label %102, label %108

102:                                              ; preds = %91
  %103 = load i32, ptr %5, align 4, !tbaa !5
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [100001 x i32], ptr @pw, i64 0, i64 %104
  %106 = load i32, ptr %105, align 4, !tbaa !5
  %107 = sub nsw i32 %106, 998244353
  store i32 %107, ptr %105, align 4, !tbaa !5
  br label %108

108:                                              ; preds = %102, %91
  %109 = load i32, ptr %5, align 4, !tbaa !5
  %110 = sub nsw i32 %109, 1
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [100001 x i32], ptr @fact, i64 0, i64 %111
  %113 = load i32, ptr %112, align 4, !tbaa !5
  %114 = sext i32 %113 to i64
  %115 = load i32, ptr %5, align 4, !tbaa !5
  %116 = sext i32 %115 to i64
  %117 = mul nsw i64 %114, %116
  %118 = srem i64 %117, 998244353
  %119 = trunc i64 %118 to i32
  %120 = load i32, ptr %5, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [100001 x i32], ptr @fact, i64 0, i64 %121
  store i32 %119, ptr %122, align 4, !tbaa !5
  %123 = load i32, ptr %5, align 4, !tbaa !5
  %124 = sub nsw i32 %123, 1
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [100001 x i32], ptr @iact, i64 0, i64 %125
  %127 = load i32, ptr %126, align 4, !tbaa !5
  %128 = sext i32 %127 to i64
  %129 = load i32, ptr %5, align 4, !tbaa !5
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [100001 x i32], ptr @iact, i64 0, i64 %130
  %132 = load i32, ptr %131, align 4, !tbaa !5
  %133 = sext i32 %132 to i64
  %134 = mul nsw i64 %128, %133
  %135 = srem i64 %134, 998244353
  %136 = trunc i64 %135 to i32
  %137 = load i32, ptr %5, align 4, !tbaa !5
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds [100001 x i32], ptr @iact, i64 0, i64 %138
  store i32 %136, ptr %139, align 4, !tbaa !5
  br label %140

140:                                              ; preds = %108
  %141 = load i32, ptr %5, align 4, !tbaa !5
  %142 = add nsw i32 %141, 1
  store i32 %142, ptr %5, align 4, !tbaa !5
  br label %87, !llvm.loop !13

143:                                              ; preds = %90
  call void @_Z4scanIiEvRT_(ptr noundef nonnull align 4 dereferenceable(4) @t)
  br label %144

144:                                              ; preds = %344, %143
  %145 = load i32, ptr @t, align 4, !tbaa !5
  %146 = add nsw i32 %145, -1
  store i32 %146, ptr @t, align 4, !tbaa !5
  %147 = icmp ne i32 %145, 0
  br i1 %147, label %148, label %346

148:                                              ; preds = %144
  call void @_Z4scanIiEvRT_(ptr noundef nonnull align 4 dereferenceable(4) @n)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %149

149:                                              ; preds = %158, %148
  %150 = load i32, ptr %6, align 4, !tbaa !5
  %151 = load i32, ptr @n, align 4, !tbaa !5
  %152 = icmp slt i32 %150, %151
  br i1 %152, label %154, label %153

153:                                              ; preds = %149
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  br label %161

154:                                              ; preds = %149
  %155 = load i32, ptr %6, align 4, !tbaa !5
  %156 = sext i32 %155 to i64
  %157 = getelementptr inbounds [100001 x i32], ptr @a, i64 0, i64 %156
  call void @_Z4scanIiEvRT_(ptr noundef nonnull align 4 dereferenceable(4) %157)
  br label %158

158:                                              ; preds = %154
  %159 = load i32, ptr %6, align 4, !tbaa !5
  %160 = add nsw i32 %159, 1
  store i32 %160, ptr %6, align 4, !tbaa !5
  br label %149, !llvm.loop !14

161:                                              ; preds = %153
  %162 = load i32, ptr @n, align 4, !tbaa !5
  %163 = sext i32 %162 to i64
  %164 = getelementptr inbounds i32, ptr @a, i64 %163
  call void @_ZSt4sortIPiSt7greaterIiEEvT_S3_T0_(ptr noundef @a, ptr noundef %164)
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  store i32 0, ptr %8, align 4, !tbaa !5
  store i32 1, ptr %9, align 4, !tbaa !5
  br label %165

165:                                              ; preds = %171, %161
  %166 = load i32, ptr %9, align 4, !tbaa !5
  %167 = load i32, ptr @n, align 4, !tbaa !5
  %168 = shl i32 %167, 1
  %169 = icmp slt i32 %166, %168
  br i1 %169, label %170, label %176

170:                                              ; preds = %165
  br label %171

171:                                              ; preds = %170
  %172 = load i32, ptr %8, align 4, !tbaa !5
  %173 = add nsw i32 %172, 1
  store i32 %173, ptr %8, align 4, !tbaa !5
  %174 = load i32, ptr %9, align 4, !tbaa !5
  %175 = shl i32 %174, 1
  store i32 %175, ptr %9, align 4, !tbaa !5
  br label %165, !llvm.loop !15

176:                                              ; preds = %165
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  store i32 1, ptr %10, align 4, !tbaa !5
  br label %177

177:                                              ; preds = %198, %176
  %178 = load i32, ptr %10, align 4, !tbaa !5
  %179 = load i32, ptr %9, align 4, !tbaa !5
  %180 = icmp slt i32 %178, %179
  br i1 %180, label %182, label %181

181:                                              ; preds = %177
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  br label %201

182:                                              ; preds = %177
  %183 = load i32, ptr %10, align 4, !tbaa !5
  %184 = ashr i32 %183, 1
  %185 = sext i32 %184 to i64
  %186 = getelementptr inbounds [262144 x i32], ptr @bitrev, i64 0, i64 %185
  %187 = load i32, ptr %186, align 4, !tbaa !5
  %188 = ashr i32 %187, 1
  %189 = load i32, ptr %10, align 4, !tbaa !5
  %190 = and i32 %189, 1
  %191 = load i32, ptr %8, align 4, !tbaa !5
  %192 = sub nsw i32 %191, 1
  %193 = shl i32 %190, %192
  %194 = or i32 %188, %193
  %195 = load i32, ptr %10, align 4, !tbaa !5
  %196 = sext i32 %195 to i64
  %197 = getelementptr inbounds [262144 x i32], ptr @bitrev, i64 0, i64 %196
  store i32 %194, ptr %197, align 4, !tbaa !5
  br label %198

198:                                              ; preds = %182
  %199 = load i32, ptr %10, align 4, !tbaa !5
  %200 = add nsw i32 %199, 1
  store i32 %200, ptr %10, align 4, !tbaa !5
  br label %177, !llvm.loop !16

201:                                              ; preds = %181
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %202

202:                                              ; preds = %241, %201
  %203 = load i32, ptr %11, align 4, !tbaa !5
  %204 = load i32, ptr %9, align 4, !tbaa !5
  %205 = icmp slt i32 %203, %204
  br i1 %205, label %207, label %206

206:                                              ; preds = %202
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  br label %244

207:                                              ; preds = %202
  %208 = load i32, ptr %11, align 4, !tbaa !5
  %209 = load i32, ptr @n, align 4, !tbaa !5
  %210 = icmp slt i32 %208, %209
  br i1 %210, label %211, label %234

211:                                              ; preds = %207
  %212 = load i32, ptr %11, align 4, !tbaa !5
  %213 = sext i32 %212 to i64
  %214 = getelementptr inbounds [100001 x i32], ptr @a, i64 0, i64 %213
  %215 = load i32, ptr %214, align 4, !tbaa !5
  %216 = sext i32 %215 to i64
  %217 = load i32, ptr @n, align 4, !tbaa !5
  %218 = load i32, ptr %11, align 4, !tbaa !5
  %219 = sub nsw i32 %217, %218
  %220 = sub nsw i32 %219, 1
  %221 = sext i32 %220 to i64
  %222 = getelementptr inbounds [100001 x i32], ptr @pw, i64 0, i64 %221
  %223 = load i32, ptr %222, align 4, !tbaa !5
  %224 = sext i32 %223 to i64
  %225 = mul nsw i64 %216, %224
  %226 = srem i64 %225, 998244353
  %227 = load i32, ptr %11, align 4, !tbaa !5
  %228 = sext i32 %227 to i64
  %229 = getelementptr inbounds [100001 x i32], ptr @fact, i64 0, i64 %228
  %230 = load i32, ptr %229, align 4, !tbaa !5
  %231 = sext i32 %230 to i64
  %232 = mul nsw i64 %226, %231
  %233 = srem i64 %232, 998244353
  br label %235

234:                                              ; preds = %207
  br label %235

235:                                              ; preds = %234, %211
  %236 = phi i64 [ %233, %211 ], [ 0, %234 ]
  %237 = trunc i64 %236 to i32
  %238 = load i32, ptr %11, align 4, !tbaa !5
  %239 = sext i32 %238 to i64
  %240 = getelementptr inbounds [262144 x i32], ptr @f, i64 0, i64 %239
  store i32 %237, ptr %240, align 4, !tbaa !5
  br label %241

241:                                              ; preds = %235
  %242 = load i32, ptr %11, align 4, !tbaa !5
  %243 = add nsw i32 %242, 1
  store i32 %243, ptr %11, align 4, !tbaa !5
  br label %202, !llvm.loop !17

244:                                              ; preds = %206
  %245 = load i32, ptr %9, align 4, !tbaa !5
  call void @_Z3NTTiPii(i32 noundef %245, ptr noundef @f, i32 noundef 1)
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %246

246:                                              ; preds = %268, %244
  %247 = load i32, ptr %12, align 4, !tbaa !5
  %248 = load i32, ptr %9, align 4, !tbaa !5
  %249 = icmp slt i32 %247, %248
  br i1 %249, label %251, label %250

250:                                              ; preds = %246
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  br label %271

251:                                              ; preds = %246
  %252 = load i32, ptr %12, align 4, !tbaa !5
  %253 = load i32, ptr @n, align 4, !tbaa !5
  %254 = icmp sle i32 %252, %253
  br i1 %254, label %255, label %262

255:                                              ; preds = %251
  %256 = load i32, ptr @n, align 4, !tbaa !5
  %257 = load i32, ptr %12, align 4, !tbaa !5
  %258 = sub nsw i32 %256, %257
  %259 = sext i32 %258 to i64
  %260 = getelementptr inbounds [100001 x i32], ptr @iact, i64 0, i64 %259
  %261 = load i32, ptr %260, align 4, !tbaa !5
  br label %263

262:                                              ; preds = %251
  br label %263

263:                                              ; preds = %262, %255
  %264 = phi i32 [ %261, %255 ], [ 0, %262 ]
  %265 = load i32, ptr %12, align 4, !tbaa !5
  %266 = sext i32 %265 to i64
  %267 = getelementptr inbounds [262144 x i32], ptr @g, i64 0, i64 %266
  store i32 %264, ptr %267, align 4, !tbaa !5
  br label %268

268:                                              ; preds = %263
  %269 = load i32, ptr %12, align 4, !tbaa !5
  %270 = add nsw i32 %269, 1
  store i32 %270, ptr %12, align 4, !tbaa !5
  br label %246, !llvm.loop !18

271:                                              ; preds = %250
  %272 = load i32, ptr %9, align 4, !tbaa !5
  call void @_Z3NTTiPii(i32 noundef %272, ptr noundef @g, i32 noundef 1)
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %273

273:                                              ; preds = %295, %271
  %274 = load i32, ptr %13, align 4, !tbaa !5
  %275 = load i32, ptr %9, align 4, !tbaa !5
  %276 = icmp slt i32 %274, %275
  br i1 %276, label %278, label %277

277:                                              ; preds = %273
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  br label %298

278:                                              ; preds = %273
  %279 = load i32, ptr %13, align 4, !tbaa !5
  %280 = sext i32 %279 to i64
  %281 = getelementptr inbounds [262144 x i32], ptr @f, i64 0, i64 %280
  %282 = load i32, ptr %281, align 4, !tbaa !5
  %283 = sext i32 %282 to i64
  %284 = load i32, ptr %13, align 4, !tbaa !5
  %285 = sext i32 %284 to i64
  %286 = getelementptr inbounds [262144 x i32], ptr @g, i64 0, i64 %285
  %287 = load i32, ptr %286, align 4, !tbaa !5
  %288 = sext i32 %287 to i64
  %289 = mul nsw i64 %283, %288
  %290 = srem i64 %289, 998244353
  %291 = trunc i64 %290 to i32
  %292 = load i32, ptr %13, align 4, !tbaa !5
  %293 = sext i32 %292 to i64
  %294 = getelementptr inbounds [262144 x i32], ptr @f, i64 0, i64 %293
  store i32 %291, ptr %294, align 4, !tbaa !5
  br label %295

295:                                              ; preds = %278
  %296 = load i32, ptr %13, align 4, !tbaa !5
  %297 = add nsw i32 %296, 1
  store i32 %297, ptr %13, align 4, !tbaa !5
  br label %273, !llvm.loop !19

298:                                              ; preds = %277
  %299 = load i32, ptr %9, align 4, !tbaa !5
  call void @_Z3NTTiPii(i32 noundef %299, ptr noundef @f, i32 noundef -1)
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  store i32 0, ptr %14, align 4, !tbaa !5
  br label %300

300:                                              ; preds = %341, %298
  %301 = load i32, ptr %14, align 4, !tbaa !5
  %302 = load i32, ptr @n, align 4, !tbaa !5
  %303 = icmp slt i32 %301, %302
  br i1 %303, label %305, label %304

304:                                              ; preds = %300
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  br label %344

305:                                              ; preds = %300
  %306 = load i32, ptr %14, align 4, !tbaa !5
  %307 = icmp ne i32 %306, 0
  br i1 %307, label %308, label %314

308:                                              ; preds = %305
  %309 = load i32, ptr %14, align 4, !tbaa !5
  %310 = sub nsw i32 %309, 1
  %311 = sext i32 %310 to i64
  %312 = getelementptr inbounds [100001 x i32], ptr @h, i64 0, i64 %311
  %313 = load i32, ptr %312, align 4, !tbaa !5
  br label %315

314:                                              ; preds = %305
  br label %315

315:                                              ; preds = %314, %308
  %316 = phi i32 [ %313, %308 ], [ 0, %314 ]
  %317 = sext i32 %316 to i64
  %318 = load i32, ptr @n, align 4, !tbaa !5
  %319 = load i32, ptr %14, align 4, !tbaa !5
  %320 = add nsw i32 %318, %319
  %321 = sext i32 %320 to i64
  %322 = getelementptr inbounds [262144 x i32], ptr @f, i64 0, i64 %321
  %323 = load i32, ptr %322, align 4, !tbaa !5
  %324 = sext i32 %323 to i64
  %325 = load i32, ptr %14, align 4, !tbaa !5
  %326 = sext i32 %325 to i64
  %327 = getelementptr inbounds [100001 x i32], ptr @iact, i64 0, i64 %326
  %328 = load i32, ptr %327, align 4, !tbaa !5
  %329 = sext i32 %328 to i64
  %330 = mul nsw i64 %324, %329
  %331 = add nsw i64 %317, %330
  %332 = srem i64 %331, 998244353
  %333 = trunc i64 %332 to i32
  %334 = load i32, ptr %14, align 4, !tbaa !5
  %335 = sext i32 %334 to i64
  %336 = getelementptr inbounds [100001 x i32], ptr @h, i64 0, i64 %335
  store i32 %333, ptr %336, align 4, !tbaa !5
  %337 = load i32, ptr %14, align 4, !tbaa !5
  %338 = sext i32 %337 to i64
  %339 = getelementptr inbounds [100001 x i32], ptr @h, i64 0, i64 %338
  %340 = load i32, ptr %339, align 4, !tbaa !5
  call void @_Z5printIiEvT_c(i32 noundef %340, i8 noundef signext 32)
  br label %341

341:                                              ; preds = %315
  %342 = load i32, ptr %14, align 4, !tbaa !5
  %343 = add nsw i32 %342, 1
  store i32 %343, ptr %14, align 4, !tbaa !5
  br label %300, !llvm.loop !20

344:                                              ; preds = %304
  %345 = call i32 @putchar(i32 noundef 10)
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  br label %144, !llvm.loop !21

346:                                              ; preds = %144
  ret i32 0
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z7mod_powii(i32 noundef, i32 noundef) #1

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_Z4scanIiEvRT_(ptr noundef nonnull align 4 dereferenceable(4)) #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPiSt7greaterIiEEvT_S3_T0_(ptr noundef, ptr noundef) #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_Z3NTTiPii(i32 noundef, ptr noundef, i32 noundef) #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_Z5printIiEvT_c(i32 noundef, i8 noundef signext) #3

; Function Attrs: inlinehint mustprogress uwtable
declare i32 @putchar(i32 noundef) #3

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

@pw = external dso_local local_unnamed_addr global [100001 x i32], align 16
@fact = external dso_local local_unnamed_addr global [100001 x i32], align 16
@iact = external dso_local local_unnamed_addr global [100001 x i32], align 16
@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@a = external dso_local global [100001 x i32], align 16
@h = external dso_local local_unnamed_addr global [100001 x i32], align 16
@w = external dso_local local_unnamed_addr global [262144 x i32], align 16
@inv2 = external dso_local local_unnamed_addr global [19 x i32], align 16
@bitrev = external dso_local local_unnamed_addr global [262144 x i32], align 16
@f = external dso_local global [262144 x i32], align 16
@g = external dso_local global [262144 x i32], align 16

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  store i32 1, ptr @w, align 16, !tbaa !5
  %1 = tail call noundef i32 @_Z7mod_powii(i32 noundef 3, i32 noundef 3808)
  store i32 %1, ptr getelementptr inbounds (i8, ptr @w, i64 4), align 4, !tbaa !5
  br label %3

2:                                                ; preds = %3
  store <4 x i32> <i32 1, i32 499122177, i32 748683265, i32 873463809>, ptr @inv2, align 16, !tbaa !5
  store <4 x i32> <i32 935854081, i32 967049217, i32 982646785, i32 990445569>, ptr getelementptr inbounds (i8, ptr @inv2, i64 16), align 16, !tbaa !5
  store <4 x i32> <i32 994344961, i32 996294657, i32 997269505, i32 997756929>, ptr getelementptr inbounds (i8, ptr @inv2, i64 32), align 16, !tbaa !5
  store <4 x i32> <i32 998000641, i32 998122497, i32 998183425, i32 998213889>, ptr getelementptr inbounds (i8, ptr @inv2, i64 48), align 16, !tbaa !5
  store i32 998229121, ptr getelementptr inbounds (i8, ptr @inv2, i64 64), align 16, !tbaa !5
  store i32 998236737, ptr getelementptr inbounds (i8, ptr @inv2, i64 68), align 4, !tbaa !5
  store i32 998240545, ptr getelementptr inbounds (i8, ptr @inv2, i64 72), align 8, !tbaa !5
  store i32 1, ptr getelementptr inbounds (i8, ptr @iact, i64 4), align 4, !tbaa !5
  br label %19

3:                                                ; preds = %3, %0
  %4 = phi i32 [ %1, %0 ], [ %16, %3 ]
  %indvars.iv = phi i64 [ 2, %0 ], [ %indvars.iv.next.1, %3 ]
  %5 = sext i32 %4 to i64
  %6 = load i32, ptr getelementptr inbounds (i8, ptr @w, i64 4), align 4, !tbaa !5
  %7 = sext i32 %6 to i64
  %8 = mul nsw i64 %7, %5
  %9 = srem i64 %8, 998244353
  %10 = trunc nsw i64 %9 to i32
  %11 = getelementptr inbounds [262144 x i32], ptr @w, i64 0, i64 %indvars.iv
  store i32 %10, ptr %11, align 8, !tbaa !5
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %12 = load i32, ptr getelementptr inbounds (i8, ptr @w, i64 4), align 4, !tbaa !5
  %13 = sext i32 %12 to i64
  %14 = mul nsw i64 %9, %13
  %15 = srem i64 %14, 998244353
  %16 = trunc nsw i64 %15 to i32
  %17 = getelementptr inbounds [262144 x i32], ptr @w, i64 0, i64 %indvars.iv.next
  store i32 %16, ptr %17, align 4, !tbaa !5
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %exitcond.not.1 = icmp eq i64 %indvars.iv.next.1, 262144
  br i1 %exitcond.not.1, label %2, label %3, !llvm.loop !9

18:                                               ; preds = %19
  store i32 1, ptr @iact, align 16, !tbaa !5
  store i32 1, ptr @fact, align 16, !tbaa !5
  store i32 1, ptr @pw, align 16, !tbaa !5
  br label %36

19:                                               ; preds = %2, %19
  %indvars.iv127 = phi i64 [ 2, %2 ], [ %indvars.iv.next128, %19 ]
  %20 = trunc nuw nsw i64 %indvars.iv127 to i32
  %21 = udiv i32 998244353, %20
  %22 = zext nneg i32 %21 to i64
  %23 = urem i32 998244353, %20
  %24 = zext nneg i32 %23 to i64
  %25 = getelementptr inbounds [100001 x i32], ptr @iact, i64 0, i64 %24
  %26 = load i32, ptr %25, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %28 = mul nsw i64 %27, %22
  %29 = srem i64 %28, 998244353
  %30 = trunc nsw i64 %29 to i32
  %31 = sub nsw i32 998244353, %30
  %32 = getelementptr inbounds [100001 x i32], ptr @iact, i64 0, i64 %indvars.iv127
  store i32 %31, ptr %32, align 4, !tbaa !5
  %indvars.iv.next128 = add nuw nsw i64 %indvars.iv127, 1
  %exitcond130.not = icmp eq i64 %indvars.iv.next128, 100001
  br i1 %exitcond130.not, label %18, label %19, !llvm.loop !11

33:                                               ; preds = %36
  tail call void @_Z4scanIiEvRT_(ptr noundef nonnull align 4 dereferenceable(4) @t)
  %34 = load i32, ptr @t, align 4, !tbaa !5
  %35 = add nsw i32 %34, -1
  store i32 %35, ptr @t, align 4, !tbaa !5
  %.not116 = icmp eq i32 %34, 0
  br i1 %.not116, label %._crit_edge119, label %.lr.ph118

36:                                               ; preds = %18, %36
  %37 = phi i64 [ 1, %18 ], [ %52, %36 ]
  %38 = phi i64 [ 1, %18 ], [ %45, %36 ]
  %39 = phi i32 [ 1, %18 ], [ %spec.select, %36 ]
  %indvars.iv131 = phi i64 [ 1, %18 ], [ %indvars.iv.next132, %36 ]
  %40 = shl i32 %39, 1
  %41 = getelementptr inbounds [100001 x i32], ptr @pw, i64 0, i64 %indvars.iv131
  %42 = icmp sgt i32 %40, 998244352
  %43 = add nsw i32 %40, -998244353
  %spec.select = select i1 %42, i32 %43, i32 %40
  store i32 %spec.select, ptr %41, align 4, !tbaa !5
  %44 = mul nsw i64 %38, %indvars.iv131
  %45 = srem i64 %44, 998244353
  %46 = trunc nsw i64 %45 to i32
  %47 = getelementptr inbounds [100001 x i32], ptr @fact, i64 0, i64 %indvars.iv131
  store i32 %46, ptr %47, align 4, !tbaa !5
  %48 = getelementptr inbounds [100001 x i32], ptr @iact, i64 0, i64 %indvars.iv131
  %49 = load i32, ptr %48, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = mul nsw i64 %37, %50
  %52 = srem i64 %51, 998244353
  %53 = trunc nsw i64 %52 to i32
  store i32 %53, ptr %48, align 4, !tbaa !5
  %indvars.iv.next132 = add nuw nsw i64 %indvars.iv131, 1
  %exitcond134.not = icmp eq i64 %indvars.iv.next132, 100001
  br i1 %exitcond134.not, label %33, label %36, !llvm.loop !12

.lr.ph118:                                        ; preds = %33, %._crit_edge115
  tail call void @_Z4scanIiEvRT_(ptr noundef nonnull align 4 dereferenceable(4) @n)
  %54 = load i32, ptr @n, align 4, !tbaa !5
  %55 = icmp sgt i32 %54, 0
  br i1 %55, label %.lr.ph, label %.lr.ph118.._crit_edge_crit_edge

.lr.ph118.._crit_edge_crit_edge:                  ; preds = %.lr.ph118
  %.pre = sext i32 %54 to i64
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.lr.ph118.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre, %.lr.ph118.._crit_edge_crit_edge ], [ %62, %.lr.ph ]
  %56 = getelementptr inbounds i32, ptr @a, i64 %.pre-phi
  tail call void @_ZSt4sortIPiSt7greaterIiEEvT_S3_T0_(ptr noundef nonnull @a, ptr noundef nonnull %56)
  %57 = load i32, ptr @n, align 4, !tbaa !5
  %58 = shl i32 %57, 1
  %59 = icmp sgt i32 %58, 1
  br i1 %59, label %.lr.ph95, label %.lr.ph102.preheader

.lr.ph:                                           ; preds = %.lr.ph118, %.lr.ph
  %indvars.iv135 = phi i64 [ %indvars.iv.next136, %.lr.ph ], [ 0, %.lr.ph118 ]
  %60 = getelementptr inbounds [100001 x i32], ptr @a, i64 0, i64 %indvars.iv135
  tail call void @_Z4scanIiEvRT_(ptr noundef nonnull align 4 dereferenceable(4) %60)
  %indvars.iv.next136 = add nuw nsw i64 %indvars.iv135, 1
  %61 = load i32, ptr @n, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = icmp slt i64 %indvars.iv.next136, %62
  br i1 %63, label %.lr.ph, label %._crit_edge, !llvm.loop !13

.preheader85:                                     ; preds = %.lr.ph95
  %64 = icmp sgt i32 %69, 1
  br i1 %64, label %.lr.ph100, label %.preheader

.lr.ph100:                                        ; preds = %.preheader85
  %65 = icmp eq i32 %69, 2
  br i1 %65, label %.preheader.loopexit.epilog-lcssa, label %.lr.ph100.new

.lr.ph100.new:                                    ; preds = %.lr.ph100
  %wide.trip.count = zext nneg i32 %69 to i64
  %66 = shl nuw i32 1, %.07392
  %67 = add nsw i64 %wide.trip.count, -4
  br label %83

.lr.ph95:                                         ; preds = %._crit_edge, %.lr.ph95
  %.07293 = phi i32 [ %69, %.lr.ph95 ], [ 1, %._crit_edge ]
  %.07392 = phi i32 [ %68, %.lr.ph95 ], [ 0, %._crit_edge ]
  %68 = add nuw nsw i32 %.07392, 1
  %69 = shl i32 %.07293, 1
  %70 = icmp slt i32 %69, %58
  br i1 %70, label %.lr.ph95, label %.preheader85, !llvm.loop !14

.preheader.loopexit.epilog-lcssa:                 ; preds = %83, %.lr.ph100
  %indvars.iv138.unr = phi i64 [ 1, %.lr.ph100 ], [ %indvars.iv.next139.1, %83 ]
  %71 = trunc nuw nsw i64 %indvars.iv138.unr to i32
  %72 = lshr i64 %indvars.iv138.unr, 1
  %73 = and i64 %72, 2147483647
  %74 = getelementptr inbounds [262144 x i32], ptr @bitrev, i64 0, i64 %73
  %75 = load i32, ptr %74, align 4, !tbaa !5
  %76 = ashr i32 %75, 1
  %77 = and i32 %71, 1
  %78 = shl nuw i32 %77, %.07392
  %79 = or i32 %76, %78
  %80 = getelementptr inbounds [262144 x i32], ptr @bitrev, i64 0, i64 %indvars.iv138.unr
  store i32 %79, ptr %80, align 4, !tbaa !5
  br label %.preheader

.preheader:                                       ; preds = %.preheader.loopexit.epilog-lcssa, %.preheader85
  %81 = icmp sgt i32 %69, 0
  br i1 %81, label %.lr.ph102.preheader, label %._crit_edge103.thread

._crit_edge103.thread:                            ; preds = %.preheader
  tail call void @_Z3NTTiPii(i32 noundef %69, ptr noundef nonnull @f, i32 noundef 1)
  tail call void @_Z3NTTiPii(i32 noundef %69, ptr noundef nonnull @g, i32 noundef 1)
  br label %._crit_edge111

.lr.ph102.preheader:                              ; preds = %._crit_edge, %.preheader
  %.072.lcssa163166 = phi i32 [ %69, %.preheader ], [ 1, %._crit_edge ]
  %82 = sext i32 %57 to i64
  %wide.trip.count145 = zext nneg i32 %.072.lcssa163166 to i64
  br label %.lr.ph102

83:                                               ; preds = %83, %.lr.ph100.new
  %indvars.iv138 = phi i64 [ 1, %.lr.ph100.new ], [ %indvars.iv.next139.1, %83 ]
  %niter = phi i64 [ 0, %.lr.ph100.new ], [ %niter.next.1, %83 ]
  %84 = lshr i64 %indvars.iv138, 1
  %85 = and i64 %84, 2147483647
  %86 = getelementptr inbounds [262144 x i32], ptr @bitrev, i64 0, i64 %85
  %87 = load i32, ptr %86, align 4, !tbaa !5
  %88 = ashr i32 %87, 1
  %89 = or i32 %88, %66
  %90 = getelementptr inbounds [262144 x i32], ptr @bitrev, i64 0, i64 %indvars.iv138
  store i32 %89, ptr %90, align 4, !tbaa !5
  %indvars.iv.next139 = add nuw nsw i64 %indvars.iv138, 1
  %91 = lshr i64 %indvars.iv.next139, 1
  %92 = and i64 %91, 2147483647
  %93 = getelementptr inbounds [262144 x i32], ptr @bitrev, i64 0, i64 %92
  %94 = load i32, ptr %93, align 4, !tbaa !5
  %95 = ashr i32 %94, 1
  %96 = getelementptr inbounds [262144 x i32], ptr @bitrev, i64 0, i64 %indvars.iv.next139
  store i32 %95, ptr %96, align 4, !tbaa !5
  %indvars.iv.next139.1 = add nuw nsw i64 %indvars.iv138, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter, %67
  br i1 %niter.ncmp.1, label %.preheader.loopexit.epilog-lcssa, label %83, !llvm.loop !15

._crit_edge103:                                   ; preds = %120
  tail call void @_Z3NTTiPii(i32 noundef %.072.lcssa163166, ptr noundef nonnull @f, i32 noundef 1)
  %97 = load i32, ptr @n, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %99 = add nsw i64 %wide.trip.count145, -1
  %xtraiter175 = and i64 %wide.trip.count145, 1
  %100 = icmp eq i64 %99, 0
  br i1 %100, label %._crit_edge107.unr-lcssa, label %._crit_edge103.new

._crit_edge103.new:                               ; preds = %._crit_edge103
  %unroll_iter177 = and i64 %wide.trip.count145, 2147483646
  br label %131

.lr.ph102:                                        ; preds = %.lr.ph102.preheader, %120
  %indvars.iv142 = phi i64 [ 0, %.lr.ph102.preheader ], [ %indvars.iv.next143, %120 ]
  %101 = icmp slt i64 %indvars.iv142, %82
  br i1 %101, label %102, label %120

102:                                              ; preds = %.lr.ph102
  %103 = getelementptr inbounds [100001 x i32], ptr @a, i64 0, i64 %indvars.iv142
  %104 = load i32, ptr %103, align 4, !tbaa !5
  %105 = sext i32 %104 to i64
  %106 = trunc i64 %indvars.iv142 to i32
  %107 = xor i32 %106, -1
  %108 = add i32 %57, %107
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [100001 x i32], ptr @pw, i64 0, i64 %109
  %111 = load i32, ptr %110, align 4, !tbaa !5
  %112 = sext i32 %111 to i64
  %113 = mul nsw i64 %112, %105
  %114 = srem i64 %113, 998244353
  %115 = getelementptr inbounds [100001 x i32], ptr @fact, i64 0, i64 %indvars.iv142
  %116 = load i32, ptr %115, align 4, !tbaa !5
  %117 = sext i32 %116 to i64
  %118 = mul nsw i64 %114, %117
  %119 = srem i64 %118, 998244353
  br label %120

120:                                              ; preds = %.lr.ph102, %102
  %121 = phi i64 [ %119, %102 ], [ 0, %.lr.ph102 ]
  %122 = trunc nsw i64 %121 to i32
  %123 = getelementptr inbounds [262144 x i32], ptr @f, i64 0, i64 %indvars.iv142
  store i32 %122, ptr %123, align 4, !tbaa !5
  %indvars.iv.next143 = add nuw nsw i64 %indvars.iv142, 1
  %exitcond146.not = icmp eq i64 %indvars.iv.next143, %wide.trip.count145
  br i1 %exitcond146.not, label %._crit_edge103, label %.lr.ph102, !llvm.loop !16

._crit_edge107.unr-lcssa:                         ; preds = %143, %._crit_edge103
  %indvars.iv147.unr = phi i64 [ 0, %._crit_edge103 ], [ %indvars.iv.next148.1, %143 ]
  %lcmp.mod176.not = icmp eq i64 %xtraiter175, 0
  br i1 %lcmp.mod176.not, label %._crit_edge107, label %.epil.preheader174

.epil.preheader174:                               ; preds = %._crit_edge107.unr-lcssa
  %.not84.epil = icmp sgt i64 %indvars.iv147.unr, %98
  br i1 %.not84.epil, label %._crit_edge107.epilog-lcssa, label %124

124:                                              ; preds = %.epil.preheader174
  %125 = sub nsw i64 %98, %indvars.iv147.unr
  %126 = getelementptr inbounds [100001 x i32], ptr @iact, i64 0, i64 %125
  %127 = load i32, ptr %126, align 4, !tbaa !5
  br label %._crit_edge107.epilog-lcssa

._crit_edge107.epilog-lcssa:                      ; preds = %124, %.epil.preheader174
  %128 = phi i32 [ %127, %124 ], [ 0, %.epil.preheader174 ]
  %129 = getelementptr inbounds [262144 x i32], ptr @g, i64 0, i64 %indvars.iv147.unr
  store i32 %128, ptr %129, align 4, !tbaa !5
  br label %._crit_edge107

._crit_edge107:                                   ; preds = %._crit_edge107.unr-lcssa, %._crit_edge107.epilog-lcssa
  tail call void @_Z3NTTiPii(i32 noundef %.072.lcssa163166, ptr noundef nonnull @g, i32 noundef 1)
  %xtraiter179 = and i64 %wide.trip.count145, 1
  %130 = icmp eq i64 %99, 0
  br i1 %130, label %._crit_edge111.loopexit.unr-lcssa, label %._crit_edge107.new

._crit_edge107.new:                               ; preds = %._crit_edge107
  %unroll_iter181 = and i64 %wide.trip.count145, 2147483646
  br label %.lr.ph110

131:                                              ; preds = %143, %._crit_edge103.new
  %indvars.iv147 = phi i64 [ 0, %._crit_edge103.new ], [ %indvars.iv.next148.1, %143 ]
  %niter178 = phi i64 [ 0, %._crit_edge103.new ], [ %niter178.next.1, %143 ]
  %.not84 = icmp sgt i64 %indvars.iv147, %98
  br i1 %.not84, label %136, label %132

132:                                              ; preds = %131
  %133 = sub nsw i64 %98, %indvars.iv147
  %134 = getelementptr inbounds [100001 x i32], ptr @iact, i64 0, i64 %133
  %135 = load i32, ptr %134, align 4, !tbaa !5
  br label %136

136:                                              ; preds = %131, %132
  %137 = phi i32 [ %135, %132 ], [ 0, %131 ]
  %138 = getelementptr inbounds [262144 x i32], ptr @g, i64 0, i64 %indvars.iv147
  store i32 %137, ptr %138, align 8, !tbaa !5
  %indvars.iv.next148 = or disjoint i64 %indvars.iv147, 1
  %.not84.1.not = icmp slt i64 %indvars.iv147, %98
  br i1 %.not84.1.not, label %139, label %143

139:                                              ; preds = %136
  %140 = sub nsw i64 %98, %indvars.iv.next148
  %141 = getelementptr inbounds [100001 x i32], ptr @iact, i64 0, i64 %140
  %142 = load i32, ptr %141, align 4, !tbaa !5
  br label %143

143:                                              ; preds = %139, %136
  %144 = phi i32 [ %142, %139 ], [ 0, %136 ]
  %145 = getelementptr inbounds [262144 x i32], ptr @g, i64 0, i64 %indvars.iv.next148
  store i32 %144, ptr %145, align 4, !tbaa !5
  %indvars.iv.next148.1 = add nuw nsw i64 %indvars.iv147, 2
  %niter178.next.1 = add i64 %niter178, 2
  %niter178.ncmp.1 = icmp eq i64 %niter178.next.1, %unroll_iter177
  br i1 %niter178.ncmp.1, label %._crit_edge107.unr-lcssa, label %131, !llvm.loop !17

._crit_edge111.loopexit.unr-lcssa:                ; preds = %.lr.ph110, %._crit_edge107
  %indvars.iv152.unr = phi i64 [ 0, %._crit_edge107 ], [ %indvars.iv.next153.1, %.lr.ph110 ]
  %lcmp.mod180.not = icmp eq i64 %xtraiter179, 0
  br i1 %lcmp.mod180.not, label %._crit_edge111, label %.lr.ph110.epil

.lr.ph110.epil:                                   ; preds = %._crit_edge111.loopexit.unr-lcssa
  %146 = getelementptr inbounds [262144 x i32], ptr @f, i64 0, i64 %indvars.iv152.unr
  %147 = load i32, ptr %146, align 4, !tbaa !5
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds [262144 x i32], ptr @g, i64 0, i64 %indvars.iv152.unr
  %150 = load i32, ptr %149, align 4, !tbaa !5
  %151 = sext i32 %150 to i64
  %152 = mul nsw i64 %151, %148
  %153 = srem i64 %152, 998244353
  %154 = trunc nsw i64 %153 to i32
  store i32 %154, ptr %146, align 4, !tbaa !5
  br label %._crit_edge111

._crit_edge111:                                   ; preds = %.lr.ph110.epil, %._crit_edge111.loopexit.unr-lcssa, %._crit_edge103.thread
  %.072.lcssa163165168170 = phi i32 [ %69, %._crit_edge103.thread ], [ %.072.lcssa163166, %._crit_edge111.loopexit.unr-lcssa ], [ %.072.lcssa163166, %.lr.ph110.epil ]
  tail call void @_Z3NTTiPii(i32 noundef %.072.lcssa163165168170, ptr noundef nonnull @f, i32 noundef -1)
  %155 = load i32, ptr @n, align 4, !tbaa !5
  %156 = icmp sgt i32 %155, 0
  br i1 %156, label %.lr.ph114.preheader, label %._crit_edge115

.lr.ph114.preheader:                              ; preds = %._crit_edge111
  %157 = zext nneg i32 %155 to i64
  %158 = getelementptr inbounds [262144 x i32], ptr @f, i64 0, i64 %157
  %159 = load i32, ptr %158, align 4, !tbaa !5
  %160 = sext i32 %159 to i64
  %161 = load i32, ptr @iact, align 16, !tbaa !5
  %162 = sext i32 %161 to i64
  %163 = mul nsw i64 %162, %160
  %164 = srem i64 %163, 998244353
  %165 = trunc nsw i64 %164 to i32
  store i32 %165, ptr @h, align 16, !tbaa !5
  tail call void @_Z5printIiEvT_c(i32 noundef %165, i8 noundef signext 32)
  %166 = load i32, ptr @n, align 4, !tbaa !5
  %167 = icmp sgt i32 %166, 1
  br i1 %167, label %.lr.ph114.peel.next, label %._crit_edge115

.lr.ph110:                                        ; preds = %.lr.ph110, %._crit_edge107.new
  %indvars.iv152 = phi i64 [ 0, %._crit_edge107.new ], [ %indvars.iv.next153.1, %.lr.ph110 ]
  %niter182 = phi i64 [ 0, %._crit_edge107.new ], [ %niter182.next.1, %.lr.ph110 ]
  %168 = getelementptr inbounds [262144 x i32], ptr @f, i64 0, i64 %indvars.iv152
  %169 = load i32, ptr %168, align 8, !tbaa !5
  %170 = sext i32 %169 to i64
  %171 = getelementptr inbounds [262144 x i32], ptr @g, i64 0, i64 %indvars.iv152
  %172 = load i32, ptr %171, align 8, !tbaa !5
  %173 = sext i32 %172 to i64
  %174 = mul nsw i64 %173, %170
  %175 = srem i64 %174, 998244353
  %176 = trunc nsw i64 %175 to i32
  store i32 %176, ptr %168, align 8, !tbaa !5
  %indvars.iv.next153 = or disjoint i64 %indvars.iv152, 1
  %177 = getelementptr inbounds [262144 x i32], ptr @f, i64 0, i64 %indvars.iv.next153
  %178 = load i32, ptr %177, align 4, !tbaa !5
  %179 = sext i32 %178 to i64
  %180 = getelementptr inbounds [262144 x i32], ptr @g, i64 0, i64 %indvars.iv.next153
  %181 = load i32, ptr %180, align 4, !tbaa !5
  %182 = sext i32 %181 to i64
  %183 = mul nsw i64 %182, %179
  %184 = srem i64 %183, 998244353
  %185 = trunc nsw i64 %184 to i32
  store i32 %185, ptr %177, align 4, !tbaa !5
  %indvars.iv.next153.1 = add nuw nsw i64 %indvars.iv152, 2
  %niter182.next.1 = add i64 %niter182, 2
  %niter182.ncmp.1 = icmp eq i64 %niter182.next.1, %unroll_iter181
  br i1 %niter182.ncmp.1, label %._crit_edge111.loopexit.unr-lcssa, label %.lr.ph110, !llvm.loop !18

._crit_edge115:                                   ; preds = %.lr.ph114.peel.next, %.lr.ph114.preheader, %._crit_edge111
  %186 = tail call i32 @putchar(i32 noundef 10)
  %187 = load i32, ptr @t, align 4, !tbaa !5
  %188 = add nsw i32 %187, -1
  store i32 %188, ptr @t, align 4, !tbaa !5
  %.not = icmp eq i32 %187, 0
  br i1 %.not, label %._crit_edge119, label %.lr.ph118, !llvm.loop !19

.lr.ph114.peel.next:                              ; preds = %.lr.ph114.preheader, %.lr.ph114.peel.next
  %indvars.iv157 = phi i64 [ %indvars.iv.next158, %.lr.ph114.peel.next ], [ 1, %.lr.ph114.preheader ]
  %189 = phi i32 [ %207, %.lr.ph114.peel.next ], [ %166, %.lr.ph114.preheader ]
  %190 = add nsw i64 %indvars.iv157, -1
  %191 = getelementptr inbounds [100001 x i32], ptr @h, i64 0, i64 %190
  %192 = load i32, ptr %191, align 4, !tbaa !5
  %193 = sext i32 %192 to i64
  %194 = sext i32 %189 to i64
  %195 = add nsw i64 %indvars.iv157, %194
  %196 = getelementptr inbounds [262144 x i32], ptr @f, i64 0, i64 %195
  %197 = load i32, ptr %196, align 4, !tbaa !5
  %198 = sext i32 %197 to i64
  %199 = getelementptr inbounds [100001 x i32], ptr @iact, i64 0, i64 %indvars.iv157
  %200 = load i32, ptr %199, align 4, !tbaa !5
  %201 = sext i32 %200 to i64
  %202 = mul nsw i64 %201, %198
  %203 = add nsw i64 %202, %193
  %204 = srem i64 %203, 998244353
  %205 = trunc nsw i64 %204 to i32
  %206 = getelementptr inbounds [100001 x i32], ptr @h, i64 0, i64 %indvars.iv157
  store i32 %205, ptr %206, align 4, !tbaa !5
  tail call void @_Z5printIiEvT_c(i32 noundef %205, i8 noundef signext 32)
  %indvars.iv.next158 = add nuw nsw i64 %indvars.iv157, 1
  %207 = load i32, ptr @n, align 4, !tbaa !5
  %208 = sext i32 %207 to i64
  %209 = icmp slt i64 %indvars.iv.next158, %208
  br i1 %209, label %.lr.ph114.peel.next, label %._crit_edge115, !llvm.loop !20

._crit_edge119:                                   ; preds = %._crit_edge115, %33
  ret i32 0
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z7mod_powii(i32 noundef, i32 noundef) local_unnamed_addr #1

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPiSt7greaterIiEEvT_S3_T0_(ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_Z3NTTiPii(i32 noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_Z5printIiEvT_c(i32 noundef, i8 noundef signext) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress nofree nounwind uwtable
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3

attributes #0 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { 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 #2 = { 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 #3 = { inlinehint mustprogress nofree 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" }

!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 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10, !21}
!21 = !{!"llvm.loop.peeled.count", i32 1}


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