; LLVM IR from tangjz/acm-icpc :: codeforces/complete (1334E)

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

@t = external dso_local global i32, align 4
@tot = external dso_local global i32, align 4
@a = external dso_local global [15 x i32], align 16
@b = external dso_local global [15 x i32], align 16
@fct = external dso_local global [51 x i32], align 16
@ifct = external dso_local global [51 x i32], align 16
@n = external dso_local global i64, align 8
@pr = external dso_local global [51 x i64], align 16
@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i64, align 8
  %11 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  store i32 1, ptr getelementptr inbounds ([51 x i32], ptr @ifct, 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 %12

12:                                               ; preds = %33, %0
  %13 = load i32, ptr %2, align 4, !tbaa !5
  %14 = icmp slt i32 %13, 51
  br i1 %14, label %16, label %15

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

16:                                               ; preds = %12
  %17 = load i32, ptr %2, align 4, !tbaa !5
  %18 = sdiv i32 998244353, %17
  %19 = sext i32 %18 to i64
  %20 = load i32, ptr %2, align 4, !tbaa !5
  %21 = srem i32 998244353, %20
  %22 = sext i32 %21 to i64
  %23 = getelementptr inbounds [51 x i32], ptr @ifct, i64 0, i64 %22
  %24 = load i32, ptr %23, align 4, !tbaa !5
  %25 = sext i32 %24 to i64
  %26 = mul nsw i64 %19, %25
  %27 = srem i64 %26, 998244353
  %28 = trunc i64 %27 to i32
  %29 = sub nsw i32 998244353, %28
  %30 = load i32, ptr %2, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [51 x i32], ptr @ifct, i64 0, i64 %31
  store i32 %29, ptr %32, align 4, !tbaa !5
  br label %33

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

36:                                               ; preds = %15
  store i32 1, ptr @ifct, align 16, !tbaa !5
  store i32 1, ptr @fct, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %37

37:                                               ; preds = %73, %36
  %38 = load i32, ptr %3, align 4, !tbaa !5
  %39 = icmp slt i32 %38, 51
  br i1 %39, label %41, label %40

40:                                               ; preds = %37
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  br label %76

41:                                               ; preds = %37
  %42 = load i32, ptr %3, align 4, !tbaa !5
  %43 = sub nsw i32 %42, 1
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [51 x i32], ptr @fct, i64 0, i64 %44
  %46 = load i32, ptr %45, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = load i32, ptr %3, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = mul nsw i64 %47, %49
  %51 = srem i64 %50, 998244353
  %52 = trunc i64 %51 to i32
  %53 = load i32, ptr %3, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [51 x i32], ptr @fct, i64 0, i64 %54
  store i32 %52, ptr %55, align 4, !tbaa !5
  %56 = load i32, ptr %3, align 4, !tbaa !5
  %57 = sub nsw i32 %56, 1
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [51 x i32], ptr @ifct, i64 0, i64 %58
  %60 = load i32, ptr %59, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = load i32, ptr %3, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [51 x i32], ptr @ifct, i64 0, i64 %63
  %65 = load i32, ptr %64, align 4, !tbaa !5
  %66 = sext i32 %65 to i64
  %67 = mul nsw i64 %61, %66
  %68 = srem i64 %67, 998244353
  %69 = trunc i64 %68 to i32
  %70 = load i32, ptr %3, align 4, !tbaa !5
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [51 x i32], ptr @ifct, i64 0, i64 %71
  store i32 %69, ptr %72, align 4, !tbaa !5
  br label %73

73:                                               ; preds = %41
  %74 = load i32, ptr %3, align 4, !tbaa !5
  %75 = add nsw i32 %74, 1
  store i32 %75, ptr %3, align 4, !tbaa !5
  br label %37, !llvm.loop !11

76:                                               ; preds = %40
  %77 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @t)
  %78 = load i64, ptr @n, align 8, !tbaa !12
  call void @_Z15getPrimeFactorsxRiPx(i64 noundef %78, ptr noundef nonnull align 4 dereferenceable(4) @tot, ptr noundef @pr)
  br label %79

79:                                               ; preds = %183, %76
  %80 = load i32, ptr @t, align 4, !tbaa !5
  %81 = add nsw i32 %80, -1
  store i32 %81, ptr @t, align 4, !tbaa !5
  %82 = icmp ne i32 %80, 0
  br i1 %82, label %83, label %203

83:                                               ; preds = %79
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  %84 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %4, ptr noundef %5)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 0, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store i32 0, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 1, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %85

85:                                               ; preds = %180, %83
  %86 = load i32, ptr %9, align 4, !tbaa !5
  %87 = load i32, ptr @tot, align 4, !tbaa !5
  %88 = icmp slt i32 %86, %87
  br i1 %88, label %90, label %89

89:                                               ; preds = %85
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %183

90:                                               ; preds = %85
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %91 = load i32, ptr %9, align 4, !tbaa !5
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [51 x i64], ptr @pr, i64 0, i64 %92
  %94 = load i64, ptr %93, align 8, !tbaa !12
  store i64 %94, ptr %10, align 8, !tbaa !12
  %95 = load i32, ptr %9, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [15 x i32], ptr @a, i64 0, i64 %96
  store i32 0, ptr %97, align 4, !tbaa !5
  br label %98

98:                                               ; preds = %104, %90
  %99 = load i64, ptr %4, align 8, !tbaa !12
  %100 = load i64, ptr %10, align 8, !tbaa !12
  %101 = srem i64 %99, %100
  %102 = icmp eq i64 %101, 0
  br i1 %102, label %103, label %113

103:                                              ; preds = %98
  br label %104

104:                                              ; preds = %103
  %105 = load i64, ptr %10, align 8, !tbaa !12
  %106 = load i64, ptr %4, align 8, !tbaa !12
  %107 = sdiv i64 %106, %105
  store i64 %107, ptr %4, align 8, !tbaa !12
  %108 = load i32, ptr %9, align 4, !tbaa !5
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [15 x i32], ptr @a, i64 0, i64 %109
  %111 = load i32, ptr %110, align 4, !tbaa !5
  %112 = add nsw i32 %111, 1
  store i32 %112, ptr %110, align 4, !tbaa !5
  br label %98, !llvm.loop !14

113:                                              ; preds = %98
  %114 = load i32, ptr %9, align 4, !tbaa !5
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [15 x i32], ptr @b, i64 0, i64 %115
  store i32 0, ptr %116, align 4, !tbaa !5
  br label %117

117:                                              ; preds = %123, %113
  %118 = load i64, ptr %5, align 8, !tbaa !12
  %119 = load i64, ptr %10, align 8, !tbaa !12
  %120 = srem i64 %118, %119
  %121 = icmp eq i64 %120, 0
  br i1 %121, label %122, label %132

122:                                              ; preds = %117
  br label %123

123:                                              ; preds = %122
  %124 = load i64, ptr %10, align 8, !tbaa !12
  %125 = load i64, ptr %5, align 8, !tbaa !12
  %126 = sdiv i64 %125, %124
  store i64 %126, ptr %5, align 8, !tbaa !12
  %127 = load i32, ptr %9, align 4, !tbaa !5
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [15 x i32], ptr @b, i64 0, i64 %128
  %130 = load i32, ptr %129, align 4, !tbaa !5
  %131 = add nsw i32 %130, 1
  store i32 %131, ptr %129, align 4, !tbaa !5
  br label %117, !llvm.loop !15

132:                                              ; preds = %117
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %133 = load i32, ptr %9, align 4, !tbaa !5
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds [15 x i32], ptr @a, i64 0, i64 %134
  %136 = load i32, ptr %9, align 4, !tbaa !5
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds [15 x i32], ptr @b, i64 0, i64 %137
  %139 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %135, ptr noundef nonnull align 4 dereferenceable(4) %138)
  %140 = load i32, ptr %139, align 4, !tbaa !5
  store i32 %140, ptr %11, align 4, !tbaa !5
  %141 = load i32, ptr %11, align 4, !tbaa !5
  %142 = load i32, ptr %9, align 4, !tbaa !5
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds [15 x i32], ptr @a, i64 0, i64 %143
  %145 = load i32, ptr %144, align 4, !tbaa !5
  %146 = sub nsw i32 %145, %141
  store i32 %146, ptr %144, align 4, !tbaa !5
  %147 = load i32, ptr %6, align 4, !tbaa !5
  %148 = add nsw i32 %147, %146
  store i32 %148, ptr %6, align 4, !tbaa !5
  %149 = load i32, ptr %11, align 4, !tbaa !5
  %150 = load i32, ptr %9, align 4, !tbaa !5
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds [15 x i32], ptr @b, i64 0, i64 %151
  %153 = load i32, ptr %152, align 4, !tbaa !5
  %154 = sub nsw i32 %153, %149
  store i32 %154, ptr %152, align 4, !tbaa !5
  %155 = load i32, ptr %7, align 4, !tbaa !5
  %156 = add nsw i32 %155, %154
  store i32 %156, ptr %7, align 4, !tbaa !5
  %157 = load i32, ptr %8, align 4, !tbaa !5
  %158 = sext i32 %157 to i64
  %159 = load i32, ptr %9, align 4, !tbaa !5
  %160 = sext i32 %159 to i64
  %161 = getelementptr inbounds [15 x i32], ptr @a, i64 0, i64 %160
  %162 = load i32, ptr %161, align 4, !tbaa !5
  %163 = sext i32 %162 to i64
  %164 = getelementptr inbounds [51 x i32], ptr @ifct, i64 0, i64 %163
  %165 = load i32, ptr %164, align 4, !tbaa !5
  %166 = sext i32 %165 to i64
  %167 = mul nsw i64 %158, %166
  %168 = srem i64 %167, 998244353
  %169 = load i32, ptr %9, align 4, !tbaa !5
  %170 = sext i32 %169 to i64
  %171 = getelementptr inbounds [15 x i32], ptr @b, i64 0, i64 %170
  %172 = load i32, ptr %171, align 4, !tbaa !5
  %173 = sext i32 %172 to i64
  %174 = getelementptr inbounds [51 x i32], ptr @ifct, i64 0, i64 %173
  %175 = load i32, ptr %174, align 4, !tbaa !5
  %176 = sext i32 %175 to i64
  %177 = mul nsw i64 %168, %176
  %178 = srem i64 %177, 998244353
  %179 = trunc i64 %178 to i32
  store i32 %179, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  br label %180

180:                                              ; preds = %132
  %181 = load i32, ptr %9, align 4, !tbaa !5
  %182 = add nsw i32 %181, 1
  store i32 %182, ptr %9, align 4, !tbaa !5
  br label %85, !llvm.loop !16

183:                                              ; preds = %89
  %184 = load i32, ptr %8, align 4, !tbaa !5
  %185 = sext i32 %184 to i64
  %186 = load i32, ptr %6, align 4, !tbaa !5
  %187 = sext i32 %186 to i64
  %188 = getelementptr inbounds [51 x i32], ptr @fct, i64 0, i64 %187
  %189 = load i32, ptr %188, align 4, !tbaa !5
  %190 = sext i32 %189 to i64
  %191 = mul nsw i64 %185, %190
  %192 = srem i64 %191, 998244353
  %193 = load i32, ptr %7, align 4, !tbaa !5
  %194 = sext i32 %193 to i64
  %195 = getelementptr inbounds [51 x i32], ptr @fct, i64 0, i64 %194
  %196 = load i32, ptr %195, align 4, !tbaa !5
  %197 = sext i32 %196 to i64
  %198 = mul nsw i64 %192, %197
  %199 = srem i64 %198, 998244353
  %200 = trunc i64 %199 to i32
  store i32 %200, ptr %8, align 4, !tbaa !5
  %201 = load i32, ptr %8, align 4, !tbaa !5
  %202 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %201)
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  br label %79, !llvm.loop !17

203:                                              ; preds = %79
  ret i32 0
}

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

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

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

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

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

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

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

@t = external dso_local global i32, align 4
@tot = external dso_local global i32, align 4
@a = external dso_local global [15 x i32], align 16
@b = external dso_local global [15 x i32], align 16
@fct = external dso_local local_unnamed_addr global [51 x i32], align 16
@ifct = external dso_local local_unnamed_addr global [51 x i32], align 16
@n = external dso_local global i64, align 8
@pr = external dso_local global [51 x i64], align 16
@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i64, align 8
  %2 = alloca i64, align 8
  store i32 1, ptr getelementptr inbounds (i8, ptr @ifct, i64 4), align 4, !tbaa !5
  br label %4

3:                                                ; preds = %4
  store i32 1, ptr @ifct, align 16, !tbaa !5
  store i32 1, ptr @fct, align 16, !tbaa !5
  br label %23

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

18:                                               ; preds = %23
  %19 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @t)
  %20 = load i64, ptr @n, align 8, !tbaa !11
  tail call void @_Z15getPrimeFactorsxRiPx(i64 noundef %20, ptr noundef nonnull align 4 dereferenceable(4) @tot, ptr noundef nonnull @pr)
  %21 = load i32, ptr @t, align 4, !tbaa !5
  %22 = add nsw i32 %21, -1
  store i32 %22, ptr @t, align 4, !tbaa !5
  %.not65 = icmp eq i32 %21, 0
  br i1 %.not65, label %._crit_edge68, label %.lr.ph67

23:                                               ; preds = %3, %23
  %24 = phi i64 [ 1, %3 ], [ %34, %23 ]
  %25 = phi i64 [ 1, %3 ], [ %27, %23 ]
  %indvars.iv76 = phi i64 [ 1, %3 ], [ %indvars.iv.next77, %23 ]
  %26 = mul nsw i64 %25, %indvars.iv76
  %27 = srem i64 %26, 998244353
  %28 = trunc nsw i64 %27 to i32
  %29 = getelementptr inbounds [51 x i32], ptr @fct, i64 0, i64 %indvars.iv76
  store i32 %28, ptr %29, align 4, !tbaa !5
  %30 = getelementptr inbounds [51 x i32], ptr @ifct, i64 0, i64 %indvars.iv76
  %31 = load i32, ptr %30, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = mul nsw i64 %24, %32
  %34 = srem i64 %33, 998244353
  %35 = trunc nsw i64 %34 to i32
  store i32 %35, ptr %30, align 4, !tbaa !5
  %indvars.iv.next77 = add nuw nsw i64 %indvars.iv76, 1
  %exitcond79.not = icmp eq i64 %indvars.iv.next77, 51
  br i1 %exitcond79.not, label %18, label %23, !llvm.loop !13

.lr.ph67:                                         ; preds = %18, %._crit_edge61
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #5
  %36 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %1, ptr noundef nonnull %2)
  %37 = load i32, ptr @tot, align 4, !tbaa !5
  %38 = icmp sgt i32 %37, 0
  br i1 %38, label %.lr.ph60, label %._crit_edge61

._crit_edge61:                                    ; preds = %74, %.lr.ph67
  %.043.lcssa = phi i32 [ 0, %.lr.ph67 ], [ %79, %74 ]
  %.042.lcssa = phi i32 [ 0, %.lr.ph67 ], [ %82, %74 ]
  %.041.lcssa = phi i64 [ 1, %.lr.ph67 ], [ %94, %74 ]
  %39 = sext i32 %.043.lcssa to i64
  %40 = getelementptr inbounds [51 x i32], ptr @fct, i64 0, i64 %39
  %41 = load i32, ptr %40, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = mul nsw i64 %.041.lcssa, %42
  %44 = srem i64 %43, 998244353
  %45 = sext i32 %.042.lcssa to i64
  %46 = getelementptr inbounds [51 x i32], ptr @fct, i64 0, i64 %45
  %47 = load i32, ptr %46, align 4, !tbaa !5
  %48 = sext i32 %47 to i64
  %49 = mul nsw i64 %44, %48
  %50 = srem i64 %49, 998244353
  %51 = trunc nsw i64 %50 to i32
  %52 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %51)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #5
  %53 = load i32, ptr @t, align 4, !tbaa !5
  %54 = add nsw i32 %53, -1
  store i32 %54, ptr @t, align 4, !tbaa !5
  %.not = icmp eq i32 %53, 0
  br i1 %.not, label %._crit_edge68, label %.lr.ph67, !llvm.loop !14

.lr.ph60:                                         ; preds = %.lr.ph67, %74
  %indvars.iv80 = phi i64 [ %indvars.iv.next81, %74 ], [ 0, %.lr.ph67 ]
  %.04157 = phi i64 [ %94, %74 ], [ 1, %.lr.ph67 ]
  %.04256 = phi i32 [ %82, %74 ], [ 0, %.lr.ph67 ]
  %.04355 = phi i32 [ %79, %74 ], [ 0, %.lr.ph67 ]
  %55 = getelementptr inbounds [51 x i64], ptr @pr, i64 0, i64 %indvars.iv80
  %56 = load i64, ptr %55, align 8, !tbaa !11
  %57 = getelementptr inbounds [15 x i32], ptr @a, i64 0, i64 %indvars.iv80
  %.promoted = load i64, ptr %1, align 8, !tbaa !11
  %58 = srem i64 %.promoted, %56
  %59 = icmp eq i64 %58, 0
  br i1 %59, label %.lr.ph, label %65

.lr.ph:                                           ; preds = %.lr.ph60, %.lr.ph
  %storemerge47 = phi i32 [ %62, %.lr.ph ], [ 0, %.lr.ph60 ]
  %60 = phi i64 [ %61, %.lr.ph ], [ %.promoted, %.lr.ph60 ]
  %61 = sdiv i64 %60, %56
  %62 = add nuw nsw i32 %storemerge47, 1
  %63 = srem i64 %61, %56
  %64 = icmp eq i64 %63, 0
  br i1 %64, label %.lr.ph, label %._crit_edge, !llvm.loop !15

._crit_edge:                                      ; preds = %.lr.ph
  store i64 %61, ptr %1, align 8, !tbaa !11
  br label %65

65:                                               ; preds = %._crit_edge, %.lr.ph60
  %storemerge.lcssa = phi i32 [ %62, %._crit_edge ], [ 0, %.lr.ph60 ]
  store i32 %storemerge.lcssa, ptr %57, align 4, !tbaa !5
  %66 = getelementptr inbounds [15 x i32], ptr @b, i64 0, i64 %indvars.iv80
  %.promoted48 = load i64, ptr %2, align 8, !tbaa !11
  %67 = srem i64 %.promoted48, %56
  %68 = icmp eq i64 %67, 0
  br i1 %68, label %.lr.ph51, label %74

.lr.ph51:                                         ; preds = %65, %.lr.ph51
  %storemerge4449 = phi i32 [ %71, %.lr.ph51 ], [ 0, %65 ]
  %69 = phi i64 [ %70, %.lr.ph51 ], [ %.promoted48, %65 ]
  %70 = sdiv i64 %69, %56
  %71 = add nuw nsw i32 %storemerge4449, 1
  %72 = srem i64 %70, %56
  %73 = icmp eq i64 %72, 0
  br i1 %73, label %.lr.ph51, label %._crit_edge52, !llvm.loop !16

._crit_edge52:                                    ; preds = %.lr.ph51
  store i64 %70, ptr %2, align 8, !tbaa !11
  br label %74

74:                                               ; preds = %._crit_edge52, %65
  %storemerge44.lcssa = phi i32 [ %71, %._crit_edge52 ], [ 0, %65 ]
  store i32 %storemerge44.lcssa, ptr %66, align 4, !tbaa !5
  %75 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %57, ptr noundef nonnull align 4 dereferenceable(4) %66)
  %76 = load i32, ptr %75, align 4, !tbaa !5
  %77 = load i32, ptr %57, align 4, !tbaa !5
  %78 = sub nsw i32 %77, %76
  store i32 %78, ptr %57, align 4, !tbaa !5
  %79 = add nsw i32 %78, %.04355
  %80 = load i32, ptr %66, align 4, !tbaa !5
  %81 = sub nsw i32 %80, %76
  store i32 %81, ptr %66, align 4, !tbaa !5
  %82 = add nsw i32 %81, %.04256
  %83 = sext i32 %78 to i64
  %84 = getelementptr inbounds [51 x i32], ptr @ifct, i64 0, i64 %83
  %85 = load i32, ptr %84, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = mul nsw i64 %.04157, %86
  %88 = srem i64 %87, 998244353
  %89 = sext i32 %81 to i64
  %90 = getelementptr inbounds [51 x i32], ptr @ifct, i64 0, i64 %89
  %91 = load i32, ptr %90, align 4, !tbaa !5
  %92 = sext i32 %91 to i64
  %93 = mul nsw i64 %88, %92
  %94 = srem i64 %93, 998244353
  %indvars.iv.next81 = add nuw nsw i64 %indvars.iv80, 1
  %95 = load i32, ptr @tot, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = icmp slt i64 %indvars.iv.next81, %96
  br i1 %97, label %.lr.ph60, label %._crit_edge61, !llvm.loop !17

._crit_edge68:                                    ; preds = %._crit_edge61, %18
  ret i32 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: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

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

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

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

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


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