; LLVM IR from tangjz/acm-icpc :: codeforces/gym (102028G)

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

@inv = external dso_local global [200001 x i32], align 16
@a = external dso_local global [200001 x i32], align 16
@b = external dso_local global [200001 x i32], align 16
@c = external dso_local global [200001 x i32], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [76 x i8], align 1
@__PRETTY_FUNCTION__.main = external hidden unnamed_addr constant [11 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z8NTT_initv() #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: mustprogress uwtable
declare dso_local void @_Z8poly_muliPiS_S_(i32 noundef, ptr noundef, ptr noundef, ptr noundef) #0

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

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

; 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
  %13 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @_Z8NTT_initv()
  store i32 0, ptr @a, align 16, !tbaa !5
  store i32 1, ptr getelementptr inbounds ([200001 x i32], ptr @a, i64 0, i64 1), align 4, !tbaa !5
  store i32 1, ptr getelementptr inbounds ([200001 x i32], ptr @inv, i64 0, i64 1), align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 2, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %14

14:                                               ; preds = %57, %0
  %15 = load i32, ptr %2, align 4, !tbaa !5
  %16 = icmp slt i32 %15, 200001
  br i1 %16, label %18, label %17

17:                                               ; preds = %14
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  br label %60

18:                                               ; preds = %14
  %19 = load i32, ptr %2, align 4, !tbaa !5
  %20 = sdiv i32 998244353, %19
  %21 = sext i32 %20 to i64
  %22 = load i32, ptr %2, align 4, !tbaa !5
  %23 = srem i32 998244353, %22
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds [200001 x i32], ptr @inv, i64 0, i64 %24
  %26 = load i32, ptr %25, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %28 = mul nsw i64 %21, %27
  %29 = srem i64 %28, 998244353
  %30 = trunc i64 %29 to i32
  %31 = sub nsw i32 998244353, %30
  %32 = load i32, ptr %2, align 4, !tbaa !5
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [200001 x i32], ptr @inv, i64 0, i64 %33
  store i32 %31, ptr %34, align 4, !tbaa !5
  %35 = load i32, ptr %3, align 4, !tbaa !5
  %36 = sext i32 %35 to i64
  %37 = load i32, ptr %2, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [200001 x i32], ptr @inv, i64 0, i64 %38
  %40 = load i32, ptr %39, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = mul nsw i64 %36, %41
  %43 = srem i64 %42, 998244353
  %44 = trunc i64 %43 to i32
  store i32 %44, ptr %3, align 4, !tbaa !5
  %45 = load i32, ptr %2, align 4, !tbaa !5
  %46 = load i32, ptr %2, align 4, !tbaa !5
  %47 = call noundef i32 @_Z7mod_powii(i32 noundef %45, i32 noundef %46)
  %48 = sext i32 %47 to i64
  %49 = load i32, ptr %3, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = mul nsw i64 %48, %50
  %52 = srem i64 %51, 998244353
  %53 = trunc i64 %52 to i32
  %54 = load i32, ptr %2, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [200001 x i32], ptr @a, i64 0, i64 %55
  store i32 %53, ptr %56, align 4, !tbaa !5
  br label %57

57:                                               ; preds = %18
  %58 = load i32, ptr %2, align 4, !tbaa !5
  %59 = add nsw i32 %58, 1
  store i32 %59, ptr %2, align 4, !tbaa !5
  br label %14, !llvm.loop !9

60:                                               ; preds = %17
  call void @_Z8poly_muliPiS_S_(i32 noundef 200001, ptr noundef @a, ptr noundef @a, ptr noundef @b)
  call void @_Z8poly_muliPiS_S_(i32 noundef 200001, ptr noundef @a, ptr noundef @b, ptr noundef @a)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %61

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

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

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

83:                                               ; preds = %65
  %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 %61, !llvm.loop !11

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

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

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

91:                                               ; preds = %87
  %92 = load i32, ptr %6, align 4, !tbaa !5
  %93 = sext i32 %92 to i64
  %94 = load i32, ptr %5, align 4, !tbaa !5
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [200001 x i32], ptr @inv, i64 0, i64 %95
  %97 = load i32, ptr %96, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %99 = mul nsw i64 %93, %98
  %100 = srem i64 %99, 998244353
  %101 = trunc i64 %100 to i32
  store i32 %101, ptr %6, align 4, !tbaa !5
  %102 = load i32, ptr %5, align 4, !tbaa !5
  %103 = add nsw i32 %102, 1
  %104 = load i32, ptr %5, align 4, !tbaa !5
  %105 = sub nsw i32 %104, 1
  %106 = call noundef i32 @_Z7mod_powii(i32 noundef %103, i32 noundef %105)
  %107 = sext i32 %106 to i64
  %108 = load i32, ptr %6, align 4, !tbaa !5
  %109 = sext i32 %108 to i64
  %110 = mul nsw i64 %107, %109
  %111 = srem i64 %110, 998244353
  %112 = trunc i64 %111 to i32
  %113 = load i32, ptr %5, align 4, !tbaa !5
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [200001 x i32], ptr @a, i64 0, i64 %114
  store i32 %112, ptr %115, align 4, !tbaa !5
  br label %116

116:                                              ; preds = %91
  %117 = load i32, ptr %5, align 4, !tbaa !5
  %118 = add nsw i32 %117, 1
  store i32 %118, ptr %5, align 4, !tbaa !5
  br label %87, !llvm.loop !12

119:                                              ; preds = %90
  call void @_Z5solveii(i32 noundef 0, i32 noundef 200000)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 200000, ptr %7, align 4, !tbaa !5
  br label %120

120:                                              ; preds = %142, %119
  %121 = load i32, ptr %7, align 4, !tbaa !5
  %122 = icmp sgt i32 %121, 0
  br i1 %122, label %124, label %123

123:                                              ; preds = %120
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %145

124:                                              ; preds = %120
  %125 = load i32, ptr %7, align 4, !tbaa !5
  %126 = sext i32 %125 to i64
  %127 = sub nsw i64 %126, 1
  %128 = mul nsw i64 %127, 499122177
  %129 = srem i64 %128, 998244353
  %130 = load i32, ptr %7, align 4, !tbaa !5
  %131 = sub nsw i32 %130, 1
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds [200001 x i32], ptr @a, i64 0, i64 %132
  %134 = load i32, ptr %133, align 4, !tbaa !5
  %135 = sext i32 %134 to i64
  %136 = mul nsw i64 %129, %135
  %137 = srem i64 %136, 998244353
  %138 = trunc i64 %137 to i32
  %139 = load i32, ptr %7, align 4, !tbaa !5
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds [200001 x i32], ptr @a, i64 0, i64 %140
  store i32 %138, ptr %141, align 4, !tbaa !5
  br label %142

142:                                              ; preds = %124
  %143 = load i32, ptr %7, align 4, !tbaa !5
  %144 = add nsw i32 %143, -1
  store i32 %144, ptr %7, align 4, !tbaa !5
  br label %120, !llvm.loop !13

145:                                              ; preds = %123
  store i32 0, ptr @a, align 16, !tbaa !5
  call void @_Z8poly_muliPiS_S_(i32 noundef 200001, ptr noundef @a, ptr noundef @c, ptr noundef @a)
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %146

146:                                              ; preds = %186, %145
  %147 = load i32, ptr %8, align 4, !tbaa !5
  %148 = icmp slt i32 %147, 200001
  br i1 %148, label %150, label %149

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

150:                                              ; preds = %146
  %151 = load i32, ptr %8, align 4, !tbaa !5
  %152 = sext i32 %151 to i64
  %153 = load i32, ptr %8, align 4, !tbaa !5
  %154 = sext i32 %153 to i64
  %155 = sub nsw i64 %154, 1
  %156 = mul nsw i64 %152, %155
  %157 = sdiv i64 %156, 2
  %158 = srem i64 %157, 998244353
  %159 = load i32, ptr %8, align 4, !tbaa !5
  %160 = sext i32 %159 to i64
  %161 = getelementptr inbounds [200001 x i32], ptr @c, i64 0, i64 %160
  %162 = load i32, ptr %161, align 4, !tbaa !5
  %163 = sext i32 %162 to i64
  %164 = mul nsw i64 %158, %163
  %165 = load i32, ptr %8, align 4, !tbaa !5
  %166 = sext i32 %165 to i64
  %167 = getelementptr inbounds [200001 x i32], ptr @a, i64 0, i64 %166
  %168 = load i32, ptr %167, align 4, !tbaa !5
  %169 = sext i32 %168 to i64
  %170 = sub nsw i64 %164, %169
  %171 = srem i64 %170, 998244353
  %172 = trunc i64 %171 to i32
  %173 = load i32, ptr %8, align 4, !tbaa !5
  %174 = sext i32 %173 to i64
  %175 = getelementptr inbounds [200001 x i32], ptr @a, i64 0, i64 %174
  store i32 %172, ptr %175, align 4, !tbaa !5
  %176 = icmp slt i32 %172, 0
  br i1 %176, label %177, label %184

177:                                              ; preds = %150
  %178 = load i32, ptr %8, align 4, !tbaa !5
  %179 = sext i32 %178 to i64
  %180 = getelementptr inbounds [200001 x i32], ptr @a, i64 0, i64 %179
  %181 = load i32, ptr %180, align 4, !tbaa !5
  %182 = add nsw i32 %181, 998244353
  store i32 %182, ptr %180, align 4, !tbaa !5
  %183 = icmp ne i32 %182, 0
  br label %184

184:                                              ; preds = %177, %150
  %185 = phi i1 [ false, %150 ], [ %183, %177 ]
  br label %186

186:                                              ; preds = %184
  %187 = load i32, ptr %8, align 4, !tbaa !5
  %188 = add nsw i32 %187, 1
  store i32 %188, ptr %8, align 4, !tbaa !5
  br label %146, !llvm.loop !14

189:                                              ; preds = %149
  call void @_Z8poly_muliPiS_S_(i32 noundef 200001, ptr noundef @b, ptr noundef @c, ptr noundef @b)
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  %190 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %9)
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  store i32 1, ptr %12, align 4, !tbaa !5
  br label %191

191:                                              ; preds = %237, %189
  %192 = load i32, ptr %12, align 4, !tbaa !5
  %193 = load i32, ptr %9, align 4, !tbaa !5
  %194 = icmp sle i32 %192, %193
  br i1 %194, label %196, label %195

195:                                              ; preds = %191
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %240

196:                                              ; preds = %191
  %197 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %10, ptr noundef %11)
  %198 = load i32, ptr %10, align 4, !tbaa !5
  %199 = sext i32 %198 to i64
  %200 = getelementptr inbounds [200001 x i32], ptr @c, i64 0, i64 %199
  %201 = load i32, ptr %200, align 4, !tbaa !5
  %202 = icmp ne i32 %201, 0
  br i1 %202, label %203, label %204

203:                                              ; preds = %196
  br label %206

204:                                              ; preds = %196
  call void @__assert_fail(ptr noundef @.str.2, ptr noundef @.str.3, i32 noundef 117, ptr noundef @__PRETTY_FUNCTION__.main) #7
  unreachable

205:                                              ; No predecessors!
  br label %206

206:                                              ; preds = %205, %203
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  %207 = load i32, ptr %11, align 4, !tbaa !5
  %208 = sext i32 %207 to i64
  %209 = load i32, ptr %11, align 4, !tbaa !5
  %210 = sext i32 %209 to i64
  %211 = mul nsw i64 %208, %210
  %212 = srem i64 %211, 998244353
  %213 = load i32, ptr %10, align 4, !tbaa !5
  %214 = sext i32 %213 to i64
  %215 = getelementptr inbounds [200001 x i32], ptr @a, i64 0, i64 %214
  %216 = load i32, ptr %215, align 4, !tbaa !5
  %217 = sext i32 %216 to i64
  %218 = mul nsw i64 %212, %217
  %219 = load i32, ptr %10, align 4, !tbaa !5
  %220 = sext i32 %219 to i64
  %221 = getelementptr inbounds [200001 x i32], ptr @b, i64 0, i64 %220
  %222 = load i32, ptr %221, align 4, !tbaa !5
  %223 = sext i32 %222 to i64
  %224 = add nsw i64 %218, %223
  %225 = srem i64 %224, 998244353
  %226 = load i32, ptr %10, align 4, !tbaa !5
  %227 = sext i32 %226 to i64
  %228 = getelementptr inbounds [200001 x i32], ptr @c, i64 0, i64 %227
  %229 = load i32, ptr %228, align 4, !tbaa !5
  %230 = call noundef i32 @_Z7mod_invi(i32 noundef %229)
  %231 = sext i32 %230 to i64
  %232 = mul nsw i64 %225, %231
  %233 = srem i64 %232, 998244353
  %234 = trunc i64 %233 to i32
  store i32 %234, ptr %13, align 4, !tbaa !5
  %235 = load i32, ptr %13, align 4, !tbaa !5
  %236 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, i32 noundef %235)
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %237

237:                                              ; preds = %206
  %238 = load i32, ptr %12, align 4, !tbaa !5
  %239 = add nsw i32 %238, 1
  store i32 %239, ptr %12, align 4, !tbaa !5
  br label %191, !llvm.loop !15

240:                                              ; preds = %195
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  ret i32 0
}

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #5

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

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


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

@inv = external dso_local local_unnamed_addr global [200001 x i32], align 16
@a = external dso_local global [200001 x i32], align 16
@b = external dso_local global [200001 x i32], align 16
@c = external dso_local global [200001 x i32], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [76 x i8], align 1
@__PRETTY_FUNCTION__.main = external hidden unnamed_addr constant [11 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z8NTT_initv() local_unnamed_addr #0

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z8poly_muliPiS_S_(i32 noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

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

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

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

4:                                                ; preds = %5
  tail call void @_Z8poly_muliPiS_S_(i32 noundef 200001, ptr noundef nonnull @a, ptr noundef nonnull @a, ptr noundef nonnull @b)
  tail call void @_Z8poly_muliPiS_S_(i32 noundef 200001, ptr noundef nonnull @a, ptr noundef nonnull @b, ptr noundef nonnull @a)
  br label %29

5:                                                ; preds = %0, %5
  %indvars.iv = phi i64 [ 2, %0 ], [ %indvars.iv.next, %5 ]
  %.04650 = phi i64 [ 1, %0 ], [ %21, %5 ]
  %6 = trunc nuw nsw i64 %indvars.iv to i32
  %7 = udiv i32 998244353, %6
  %8 = zext nneg i32 %7 to i64
  %9 = urem i32 998244353, %6
  %10 = zext nneg i32 %9 to i64
  %11 = getelementptr inbounds [200001 x i32], ptr @inv, i64 0, i64 %10
  %12 = load i32, ptr %11, align 4, !tbaa !5
  %13 = sext i32 %12 to i64
  %14 = mul nsw i64 %13, %8
  %15 = srem i64 %14, 998244353
  %16 = trunc nsw i64 %15 to i32
  %17 = sub nsw i32 998244353, %16
  %18 = getelementptr inbounds [200001 x i32], ptr @inv, i64 0, i64 %indvars.iv
  store i32 %17, ptr %18, align 4, !tbaa !5
  %19 = zext nneg i32 %17 to i64
  %20 = mul nuw nsw i64 %.04650, %19
  %21 = urem i64 %20, 998244353
  %22 = tail call noundef i32 @_Z7mod_powii(i32 noundef %6, i32 noundef %6)
  %23 = sext i32 %22 to i64
  %24 = mul nsw i64 %21, %23
  %25 = srem i64 %24, 998244353
  %26 = trunc nsw i64 %25 to i32
  %27 = getelementptr inbounds [200001 x i32], ptr @a, i64 0, i64 %indvars.iv
  store i32 %26, ptr %27, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 200001
  br i1 %exitcond.not, label %4, label %5, !llvm.loop !9

28:                                               ; preds = %29
  store i32 1, ptr @a, align 16, !tbaa !5
  br label %52

29:                                               ; preds = %40, %4
  %indvars.iv60 = phi i64 [ 0, %4 ], [ %indvars.iv.next61.1, %40 ]
  %30 = getelementptr inbounds [200001 x i32], ptr @b, i64 0, i64 %indvars.iv60
  %31 = load i32, ptr %30, align 8, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = mul nsw i64 %32, 499122177
  %34 = getelementptr inbounds [200001 x i32], ptr @a, i64 0, i64 %indvars.iv60
  %35 = load i32, ptr %34, align 8, !tbaa !5
  %36 = sext i32 %35 to i64
  %37 = add nsw i64 %33, %36
  %38 = srem i64 %37, 998244353
  %39 = trunc nsw i64 %38 to i32
  store i32 %39, ptr %30, align 8, !tbaa !5
  %exitcond63.not = icmp eq i64 %indvars.iv60, 200000
  br i1 %exitcond63.not, label %28, label %40, !llvm.loop !11

40:                                               ; preds = %29
  %indvars.iv.next61 = or disjoint i64 %indvars.iv60, 1
  %41 = getelementptr inbounds [200001 x i32], ptr @b, i64 0, i64 %indvars.iv.next61
  %42 = load i32, ptr %41, align 4, !tbaa !5
  %43 = sext i32 %42 to i64
  %44 = mul nsw i64 %43, 499122177
  %45 = getelementptr inbounds [200001 x i32], ptr @a, i64 0, i64 %indvars.iv.next61
  %46 = load i32, ptr %45, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = add nsw i64 %44, %47
  %49 = srem i64 %48, 998244353
  %50 = trunc nsw i64 %49 to i32
  store i32 %50, ptr %41, align 4, !tbaa !5
  %indvars.iv.next61.1 = add nuw nsw i64 %indvars.iv60, 2
  br label %29

51:                                               ; preds = %52
  tail call void @_Z5solveii(i32 noundef 0, i32 noundef 200000)
  br label %67

52:                                               ; preds = %28, %52
  %indvars.iv64 = phi i64 [ 1, %28 ], [ %indvars.iv.next65, %52 ]
  %.04354 = phi i64 [ 1, %28 ], [ %57, %52 ]
  %53 = getelementptr inbounds [200001 x i32], ptr @inv, i64 0, i64 %indvars.iv64
  %54 = load i32, ptr %53, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = mul nsw i64 %.04354, %55
  %57 = srem i64 %56, 998244353
  %indvars.iv.next65 = add nuw nsw i64 %indvars.iv64, 1
  %indvars = trunc i64 %indvars.iv.next65 to i32
  %58 = trunc i64 %indvars.iv64 to i32
  %59 = add i32 %58, -1
  %60 = tail call noundef i32 @_Z7mod_powii(i32 noundef %indvars, i32 noundef %59)
  %61 = sext i32 %60 to i64
  %62 = mul nsw i64 %57, %61
  %63 = srem i64 %62, 998244353
  %64 = trunc nsw i64 %63 to i32
  %65 = getelementptr inbounds [200001 x i32], ptr @a, i64 0, i64 %indvars.iv64
  store i32 %64, ptr %65, align 4, !tbaa !5
  %exitcond67.not = icmp eq i64 %indvars.iv.next65, 200001
  br i1 %exitcond67.not, label %51, label %52, !llvm.loop !12

66:                                               ; preds = %67
  store i32 0, ptr @a, align 16, !tbaa !5
  tail call void @_Z8poly_muliPiS_S_(i32 noundef 200001, ptr noundef nonnull @a, ptr noundef nonnull @c, ptr noundef nonnull @a)
  br label %82

67:                                               ; preds = %51, %67
  %indvars.iv68 = phi i64 [ 200000, %51 ], [ %indvars.iv.next69, %67 ]
  %68 = mul nuw nsw i64 %indvars.iv68, 499122177
  %69 = add nsw i64 %68, -499122177
  %70 = urem i64 %69, 998244353
  %indvars.iv.next69 = add nsw i64 %indvars.iv68, -1
  %71 = getelementptr inbounds [200001 x i32], ptr @a, i64 0, i64 %indvars.iv.next69
  %72 = load i32, ptr %71, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = mul nsw i64 %70, %73
  %75 = srem i64 %74, 998244353
  %76 = trunc nsw i64 %75 to i32
  %77 = getelementptr inbounds [200001 x i32], ptr @a, i64 0, i64 %indvars.iv68
  store i32 %76, ptr %77, align 4, !tbaa !5
  %78 = icmp ugt i64 %indvars.iv68, 1
  br i1 %78, label %67, label %66, !llvm.loop !13

79:                                               ; preds = %82
  tail call void @_Z8poly_muliPiS_S_(i32 noundef 200001, ptr noundef nonnull @b, ptr noundef nonnull @c, ptr noundef nonnull @b)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  %80 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  %81 = load i32, ptr %1, align 4, !tbaa !5
  %.not57 = icmp slt i32 %81, 1
  br i1 %.not57, label %._crit_edge, label %.lr.ph

82:                                               ; preds = %66, %82
  %indvars.iv72 = phi i64 [ 0, %66 ], [ %indvars.iv.next73, %82 ]
  %83 = add nsw i64 %indvars.iv72, -1
  %84 = mul nsw i64 %83, %indvars.iv72
  %85 = sdiv i64 %84, 2
  %86 = srem i64 %85, 998244353
  %87 = getelementptr inbounds [200001 x i32], ptr @c, i64 0, i64 %indvars.iv72
  %88 = load i32, ptr %87, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = mul nsw i64 %86, %89
  %91 = getelementptr inbounds [200001 x i32], ptr @a, i64 0, i64 %indvars.iv72
  %92 = load i32, ptr %91, align 4, !tbaa !5
  %93 = sext i32 %92 to i64
  %94 = sub nsw i64 %90, %93
  %95 = srem i64 %94, 998244353
  %96 = trunc nsw i64 %95 to i32
  %97 = icmp slt i64 %95, 0
  %98 = add nsw i32 %96, 998244353
  %spec.select = select i1 %97, i32 %98, i32 %96
  store i32 %spec.select, ptr %91, align 4, !tbaa !5
  %indvars.iv.next73 = add nuw nsw i64 %indvars.iv72, 1
  %exitcond76.not = icmp eq i64 %indvars.iv.next73, 200001
  br i1 %exitcond76.not, label %79, label %82, !llvm.loop !14

._crit_edge:                                      ; preds = %105, %79
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  ret i32 0

.lr.ph:                                           ; preds = %79, %105
  %.04058 = phi i32 [ %125, %105 ], [ 1, %79 ]
  %99 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %2, ptr noundef nonnull %3)
  %100 = load i32, ptr %2, align 4, !tbaa !5
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [200001 x i32], ptr @c, i64 0, i64 %101
  %103 = load i32, ptr %102, align 4, !tbaa !5
  %.not49 = icmp eq i32 %103, 0
  br i1 %.not49, label %104, label %105

104:                                              ; preds = %.lr.ph
  call void @__assert_fail(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.3, i32 noundef 117, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #7
  unreachable

105:                                              ; preds = %.lr.ph
  %106 = load i32, ptr %3, align 4, !tbaa !5
  %107 = sext i32 %106 to i64
  %108 = mul nsw i64 %107, %107
  %109 = urem i64 %108, 998244353
  %110 = getelementptr inbounds [200001 x i32], ptr @a, i64 0, i64 %101
  %111 = load i32, ptr %110, align 4, !tbaa !5
  %112 = sext i32 %111 to i64
  %113 = mul nsw i64 %109, %112
  %114 = getelementptr inbounds [200001 x i32], ptr @b, i64 0, i64 %101
  %115 = load i32, ptr %114, align 4, !tbaa !5
  %116 = sext i32 %115 to i64
  %117 = add nsw i64 %113, %116
  %118 = srem i64 %117, 998244353
  %119 = call noundef i32 @_Z7mod_invi(i32 noundef %103)
  %120 = sext i32 %119 to i64
  %121 = mul nsw i64 %118, %120
  %122 = srem i64 %121, 998244353
  %123 = trunc nsw i64 %122 to i32
  %124 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %123)
  %125 = add nuw nsw i32 %.04058, 1
  %126 = load i32, ptr %1, align 4, !tbaa !5
  %.not.not = icmp slt i32 %.04058, %126
  br i1 %.not.not, label %.lr.ph, label %._crit_edge, !llvm.loop !15
}

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #5

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

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


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