; LLVM IR from lzyrapx/Competitive-Programming :: BZOJ (BZOJ 3456（多项式求逆+NTT）)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@mod = external dso_local global i64, align 8
@n = external dso_local global i64, align 8
@m = external dso_local global i64, align 8
@fac = external dso_local global [1000000 x i64], align 16
@L = external dso_local global i32, align 4
@A = external dso_local global [1000000 x i32], align 16
@B = external dso_local global [1000000 x i32], align 16
@C = external dso_local global [1000000 x i32], align 16
@inv_B = external dso_local global [1000000 x i32], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_Z6qpowerxx(i64 noundef, i64 noundef) #0

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

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

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #3 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %6 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @n)
  store i64 1, ptr @m, align 8, !tbaa !5
  br label %7

7:                                                ; preds = %12, %0
  %8 = load i64, ptr @m, align 8, !tbaa !5
  %9 = load i64, ptr @n, align 8, !tbaa !5
  %10 = shl i64 %9, 1
  %11 = icmp sle i64 %8, %10
  br i1 %11, label %12, label %17

12:                                               ; preds = %7
  %13 = load i64, ptr @m, align 8, !tbaa !5
  %14 = shl i64 %13, 1
  store i64 %14, ptr @m, align 8, !tbaa !5
  %15 = load i32, ptr @L, align 4, !tbaa !9
  %16 = add nsw i32 %15, 1
  store i32 %16, ptr @L, align 4, !tbaa !9
  br label %7, !llvm.loop !11

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

18:                                               ; preds = %38, %17
  %19 = load i32, ptr %2, align 4, !tbaa !9
  %20 = sext i32 %19 to i64
  %21 = load i64, ptr @n, align 8, !tbaa !5
  %22 = icmp sle i64 %20, %21
  br i1 %22, label %24, label %23

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

24:                                               ; preds = %18
  %25 = load i32, ptr %2, align 4, !tbaa !9
  %26 = sub nsw i32 %25, 1
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [1000000 x i64], ptr @fac, i64 0, i64 %27
  %29 = load i64, ptr %28, align 8, !tbaa !5
  %30 = load i32, ptr %2, align 4, !tbaa !9
  %31 = sext i32 %30 to i64
  %32 = mul nsw i64 %29, %31
  %33 = load i64, ptr @mod, align 8, !tbaa !5
  %34 = srem i64 %32, %33
  %35 = load i32, ptr %2, align 4, !tbaa !9
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [1000000 x i64], ptr @fac, i64 0, i64 %36
  store i64 %34, ptr %37, align 8, !tbaa !5
  br label %38

38:                                               ; preds = %24
  %39 = load i32, ptr %2, align 4, !tbaa !9
  %40 = add nsw i32 %39, 1
  store i32 %40, ptr %2, align 4, !tbaa !9
  br label %18, !llvm.loop !13

41:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #5
  store i64 0, ptr %3, align 8, !tbaa !5
  br label %42

42:                                               ; preds = %66, %41
  %43 = load i64, ptr %3, align 8, !tbaa !5
  %44 = load i64, ptr @n, align 8, !tbaa !5
  %45 = icmp sle i64 %43, %44
  br i1 %45, label %47, label %46

46:                                               ; preds = %42
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  br label %69

47:                                               ; preds = %42
  %48 = load i64, ptr %3, align 8, !tbaa !5
  %49 = load i64, ptr %3, align 8, !tbaa !5
  %50 = sub nsw i64 %49, 1
  %51 = mul nsw i64 %48, %50
  %52 = ashr i64 %51, 1
  %53 = call noundef i64 @_Z6qpowerxx(i64 noundef 2, i64 noundef %52)
  %54 = load i64, ptr %3, align 8, !tbaa !5
  %55 = getelementptr inbounds [1000000 x i64], ptr @fac, i64 0, i64 %54
  %56 = load i64, ptr %55, align 8, !tbaa !5
  %57 = load i64, ptr @mod, align 8, !tbaa !5
  %58 = sub nsw i64 %57, 2
  %59 = call noundef i64 @_Z6qpowerxx(i64 noundef %56, i64 noundef %58)
  %60 = mul nsw i64 %53, %59
  %61 = load i64, ptr @mod, align 8, !tbaa !5
  %62 = srem i64 %60, %61
  %63 = trunc i64 %62 to i32
  %64 = load i64, ptr %3, align 8, !tbaa !5
  %65 = getelementptr inbounds [1000000 x i32], ptr @B, i64 0, i64 %64
  store i32 %63, ptr %65, align 4, !tbaa !9
  br label %66

66:                                               ; preds = %47
  %67 = load i64, ptr %3, align 8, !tbaa !5
  %68 = add nsw i64 %67, 1
  store i64 %68, ptr %3, align 8, !tbaa !5
  br label %42, !llvm.loop !14

69:                                               ; preds = %46
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #5
  store i64 1, ptr %4, align 8, !tbaa !5
  br label %70

70:                                               ; preds = %95, %69
  %71 = load i64, ptr %4, align 8, !tbaa !5
  %72 = load i64, ptr @n, align 8, !tbaa !5
  %73 = icmp sle i64 %71, %72
  br i1 %73, label %75, label %74

74:                                               ; preds = %70
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  br label %98

75:                                               ; preds = %70
  %76 = load i64, ptr %4, align 8, !tbaa !5
  %77 = load i64, ptr %4, align 8, !tbaa !5
  %78 = sub nsw i64 %77, 1
  %79 = mul nsw i64 %76, %78
  %80 = ashr i64 %79, 1
  %81 = call noundef i64 @_Z6qpowerxx(i64 noundef 2, i64 noundef %80)
  %82 = load i64, ptr %4, align 8, !tbaa !5
  %83 = sub nsw i64 %82, 1
  %84 = getelementptr inbounds [1000000 x i64], ptr @fac, i64 0, i64 %83
  %85 = load i64, ptr %84, align 8, !tbaa !5
  %86 = load i64, ptr @mod, align 8, !tbaa !5
  %87 = sub nsw i64 %86, 2
  %88 = call noundef i64 @_Z6qpowerxx(i64 noundef %85, i64 noundef %87)
  %89 = mul nsw i64 %81, %88
  %90 = load i64, ptr @mod, align 8, !tbaa !5
  %91 = srem i64 %89, %90
  %92 = trunc i64 %91 to i32
  %93 = load i64, ptr %4, align 8, !tbaa !5
  %94 = getelementptr inbounds [1000000 x i32], ptr @C, i64 0, i64 %93
  store i32 %92, ptr %94, align 4, !tbaa !9
  br label %95

95:                                               ; preds = %75
  %96 = load i64, ptr %4, align 8, !tbaa !5
  %97 = add nsw i64 %96, 1
  store i64 %97, ptr %4, align 8, !tbaa !5
  br label %70, !llvm.loop !15

98:                                               ; preds = %74
  store i32 1, ptr @A, align 16, !tbaa !9
  %99 = load i64, ptr @m, align 8, !tbaa !5
  %100 = trunc i64 %99 to i32
  %101 = load i32, ptr @L, align 4, !tbaa !9
  call void @_Z7ployInvPiS_ii(ptr noundef @B, ptr noundef @inv_B, i32 noundef %100, i32 noundef %101)
  %102 = load i64, ptr @m, align 8, !tbaa !5
  %103 = trunc i64 %102 to i32
  %104 = load i32, ptr @L, align 4, !tbaa !9
  call void @_Z3NTTPiiii(ptr noundef @inv_B, i32 noundef 1, i32 noundef %103, i32 noundef %104)
  %105 = load i64, ptr @m, align 8, !tbaa !5
  %106 = trunc i64 %105 to i32
  %107 = load i32, ptr @L, align 4, !tbaa !9
  call void @_Z3NTTPiiii(ptr noundef @C, i32 noundef 1, i32 noundef %106, i32 noundef %107)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  store i32 0, ptr %5, align 4, !tbaa !9
  br label %108

108:                                              ; preds = %133, %98
  %109 = load i32, ptr %5, align 4, !tbaa !9
  %110 = sext i32 %109 to i64
  %111 = load i64, ptr @m, align 8, !tbaa !5
  %112 = icmp slt i64 %110, %111
  br i1 %112, label %114, label %113

113:                                              ; preds = %108
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %136

114:                                              ; preds = %108
  %115 = load i32, ptr %5, align 4, !tbaa !9
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [1000000 x i32], ptr @inv_B, i64 0, i64 %116
  %118 = load i32, ptr %117, align 4, !tbaa !9
  %119 = sext i32 %118 to i64
  %120 = mul nsw i64 1, %119
  %121 = load i32, ptr %5, align 4, !tbaa !9
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [1000000 x i32], ptr @C, i64 0, i64 %122
  %124 = load i32, ptr %123, align 4, !tbaa !9
  %125 = sext i32 %124 to i64
  %126 = mul nsw i64 %120, %125
  %127 = load i64, ptr @mod, align 8, !tbaa !5
  %128 = srem i64 %126, %127
  %129 = trunc i64 %128 to i32
  %130 = load i32, ptr %5, align 4, !tbaa !9
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds [1000000 x i32], ptr @A, i64 0, i64 %131
  store i32 %129, ptr %132, align 4, !tbaa !9
  br label %133

133:                                              ; preds = %114
  %134 = load i32, ptr %5, align 4, !tbaa !9
  %135 = add nsw i32 %134, 1
  store i32 %135, ptr %5, align 4, !tbaa !9
  br label %108, !llvm.loop !16

136:                                              ; preds = %113
  %137 = load i64, ptr @m, align 8, !tbaa !5
  %138 = trunc i64 %137 to i32
  %139 = load i32, ptr @L, align 4, !tbaa !9
  call void @_Z3NTTPiiii(ptr noundef @A, i32 noundef -1, i32 noundef %138, i32 noundef %139)
  %140 = load i64, ptr @n, align 8, !tbaa !5
  %141 = getelementptr inbounds [1000000 x i32], ptr @A, i64 0, i64 %140
  %142 = load i32, ptr %141, align 4, !tbaa !9
  %143 = sext i32 %142 to i64
  %144 = load i64, ptr @n, align 8, !tbaa !5
  %145 = sub nsw i64 %144, 1
  %146 = getelementptr inbounds [1000000 x i64], ptr @fac, i64 0, i64 %145
  %147 = load i64, ptr %146, align 8, !tbaa !5
  %148 = mul nsw i64 %143, %147
  %149 = load i64, ptr @mod, align 8, !tbaa !5
  %150 = srem i64 %148, %149
  %151 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %150)
  %152 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %151, i8 noundef signext 10)
  ret i32 0
}

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) #4

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #2 align 2

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


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@mod = external dso_local local_unnamed_addr global i64, align 8
@n = external dso_local global i64, align 8
@m = external dso_local local_unnamed_addr global i64, align 8
@fac = external dso_local local_unnamed_addr global [1000000 x i64], align 16
@L = external dso_local local_unnamed_addr global i32, align 4
@A = external dso_local global [1000000 x i32], align 16
@B = external dso_local global [1000000 x i32], align 16
@C = external dso_local global [1000000 x i32], align 16
@inv_B = external dso_local global [1000000 x i32], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_Z6qpowerxx(i64 noundef, i64 noundef) local_unnamed_addr #0

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 {
  %1 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @n)
  store i64 1, ptr @m, align 8, !tbaa !5
  %2 = load i64, ptr @n, align 8, !tbaa !5
  %3 = shl i64 %2, 1
  %.not34 = icmp slt i64 %3, 1
  br i1 %.not34, label %8, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %0
  %L.promoted = load i32, ptr @L, align 4, !tbaa !9
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %4 = phi i64 [ %6, %.lr.ph ], [ 1, %.lr.ph.preheader ]
  %5 = phi i32 [ %7, %.lr.ph ], [ %L.promoted, %.lr.ph.preheader ]
  %6 = shl i64 %4, 1
  %7 = add nsw i32 %5, 1
  %.not = icmp sgt i64 %6, %3
  br i1 %.not, label %._crit_edge, label %.lr.ph, !llvm.loop !11

._crit_edge:                                      ; preds = %.lr.ph
  store i64 %6, ptr @m, align 8, !tbaa !5
  store i32 %7, ptr @L, align 4, !tbaa !9
  br label %8

8:                                                ; preds = %._crit_edge, %0
  store i64 1, ptr @fac, align 16, !tbaa !5
  %.not2937 = icmp slt i64 %2, 1
  br i1 %.not2937, label %.preheader32, label %.lr.ph40

.lr.ph40:                                         ; preds = %8
  %9 = load i64, ptr @mod, align 8, !tbaa !5
  %xtraiter = and i64 %2, 1
  %10 = icmp eq i64 %2, 1
  br i1 %10, label %.preheader32.loopexit.unr-lcssa, label %.lr.ph40.new

.lr.ph40.new:                                     ; preds = %.lr.ph40
  %unroll_iter = and i64 %2, 9223372036854775806
  br label %14

.preheader32.loopexit.unr-lcssa:                  ; preds = %14, %.lr.ph40
  %.unr = phi i64 [ 1, %.lr.ph40 ], [ %20, %14 ]
  %indvars.iv.unr = phi i64 [ 1, %.lr.ph40 ], [ %indvars.iv.next.1, %14 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader32, label %.preheader32.loopexit.epilog-lcssa

.preheader32.loopexit.epilog-lcssa:               ; preds = %.preheader32.loopexit.unr-lcssa
  %11 = mul nsw i64 %.unr, %indvars.iv.unr
  %12 = srem i64 %11, %9
  %13 = getelementptr inbounds [1000000 x i64], ptr @fac, i64 0, i64 %indvars.iv.unr
  store i64 %12, ptr %13, align 8, !tbaa !5
  br label %.preheader32

.preheader32:                                     ; preds = %.preheader32.loopexit.epilog-lcssa, %.preheader32.loopexit.unr-lcssa, %8
  %.not3041 = icmp slt i64 %2, 0
  br i1 %.not3041, label %._crit_edge47, label %.lr.ph43

14:                                               ; preds = %14, %.lr.ph40.new
  %15 = phi i64 [ 1, %.lr.ph40.new ], [ %20, %14 ]
  %indvars.iv = phi i64 [ 1, %.lr.ph40.new ], [ %indvars.iv.next.1, %14 ]
  %niter = phi i64 [ 0, %.lr.ph40.new ], [ %niter.next.1, %14 ]
  %16 = mul nsw i64 %15, %indvars.iv
  %17 = srem i64 %16, %9
  %18 = getelementptr inbounds [1000000 x i64], ptr @fac, i64 0, i64 %indvars.iv
  store i64 %17, ptr %18, align 8, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %19 = mul nsw i64 %17, %indvars.iv.next
  %20 = srem i64 %19, %9
  %21 = getelementptr inbounds [1000000 x i64], ptr @fac, i64 0, i64 %indvars.iv.next
  store i64 %20, ptr %21, align 8, !tbaa !5
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %.preheader32.loopexit.unr-lcssa, label %14, !llvm.loop !13

.preheader:                                       ; preds = %.lr.ph43
  %22 = icmp slt i64 %38, 1
  br i1 %22, label %._crit_edge47, label %.lr.ph46

.lr.ph43:                                         ; preds = %.preheader32, %.lr.ph43
  %.02342 = phi i64 [ %37, %.lr.ph43 ], [ 0, %.preheader32 ]
  %23 = add nsw i64 %.02342, -1
  %24 = mul nsw i64 %23, %.02342
  %25 = ashr i64 %24, 1
  %26 = tail call noundef i64 @_Z6qpowerxx(i64 noundef 2, i64 noundef %25)
  %27 = getelementptr inbounds [1000000 x i64], ptr @fac, i64 0, i64 %.02342
  %28 = load i64, ptr %27, align 8, !tbaa !5
  %29 = load i64, ptr @mod, align 8, !tbaa !5
  %30 = add nsw i64 %29, -2
  %31 = tail call noundef i64 @_Z6qpowerxx(i64 noundef %28, i64 noundef %30)
  %32 = mul nsw i64 %31, %26
  %33 = load i64, ptr @mod, align 8, !tbaa !5
  %34 = srem i64 %32, %33
  %35 = trunc i64 %34 to i32
  %36 = getelementptr inbounds [1000000 x i32], ptr @B, i64 0, i64 %.02342
  store i32 %35, ptr %36, align 4, !tbaa !9
  %37 = add nuw nsw i64 %.02342, 1
  %38 = load i64, ptr @n, align 8, !tbaa !5
  %.not30.not = icmp slt i64 %.02342, %38
  br i1 %.not30.not, label %.lr.ph43, label %.preheader, !llvm.loop !14

._crit_edge47:                                    ; preds = %.lr.ph46, %.preheader32, %.preheader
  store i32 1, ptr @A, align 16, !tbaa !9
  %39 = load i64, ptr @m, align 8, !tbaa !5
  %40 = trunc i64 %39 to i32
  %41 = load i32, ptr @L, align 4, !tbaa !9
  tail call void @_Z7ployInvPiS_ii(ptr noundef nonnull @B, ptr noundef nonnull @inv_B, i32 noundef %40, i32 noundef %41)
  %42 = load i64, ptr @m, align 8, !tbaa !5
  %43 = trunc i64 %42 to i32
  %44 = load i32, ptr @L, align 4, !tbaa !9
  tail call void @_Z3NTTPiiii(ptr noundef nonnull @inv_B, i32 noundef 1, i32 noundef %43, i32 noundef %44)
  %45 = load i64, ptr @m, align 8, !tbaa !5
  %46 = trunc i64 %45 to i32
  %47 = load i32, ptr @L, align 4, !tbaa !9
  tail call void @_Z3NTTPiiii(ptr noundef nonnull @C, i32 noundef 1, i32 noundef %46, i32 noundef %47)
  %48 = load i64, ptr @m, align 8, !tbaa !5
  %49 = icmp sgt i64 %48, 0
  br i1 %49, label %.lr.ph50, label %._crit_edge51

.lr.ph50:                                         ; preds = %._crit_edge47
  %50 = load i64, ptr @mod, align 8, !tbaa !5
  %xtraiter67 = and i64 %48, 1
  %51 = icmp eq i64 %48, 1
  br i1 %51, label %._crit_edge51.loopexit.unr-lcssa, label %.lr.ph50.new

.lr.ph50.new:                                     ; preds = %.lr.ph50
  %unroll_iter69 = and i64 %48, 9223372036854775806
  br label %92

.lr.ph46:                                         ; preds = %.preheader, %.lr.ph46
  %.02245 = phi i64 [ %66, %.lr.ph46 ], [ 1, %.preheader ]
  %52 = add nsw i64 %.02245, -1
  %53 = mul nsw i64 %52, %.02245
  %54 = ashr i64 %53, 1
  %55 = tail call noundef i64 @_Z6qpowerxx(i64 noundef 2, i64 noundef %54)
  %56 = getelementptr inbounds [1000000 x i64], ptr @fac, i64 0, i64 %52
  %57 = load i64, ptr %56, align 8, !tbaa !5
  %58 = load i64, ptr @mod, align 8, !tbaa !5
  %59 = add nsw i64 %58, -2
  %60 = tail call noundef i64 @_Z6qpowerxx(i64 noundef %57, i64 noundef %59)
  %61 = mul nsw i64 %60, %55
  %62 = load i64, ptr @mod, align 8, !tbaa !5
  %63 = srem i64 %61, %62
  %64 = trunc i64 %63 to i32
  %65 = getelementptr inbounds [1000000 x i32], ptr @C, i64 0, i64 %.02245
  store i32 %64, ptr %65, align 4, !tbaa !9
  %66 = add nuw nsw i64 %.02245, 1
  %67 = load i64, ptr @n, align 8, !tbaa !5
  %.not31.not = icmp slt i64 %.02245, %67
  br i1 %.not31.not, label %.lr.ph46, label %._crit_edge47, !llvm.loop !15

._crit_edge51.loopexit.unr-lcssa:                 ; preds = %92, %.lr.ph50
  %indvars.iv55.unr = phi i64 [ 0, %.lr.ph50 ], [ %indvars.iv.next56.1, %92 ]
  %lcmp.mod68.not = icmp eq i64 %xtraiter67, 0
  br i1 %lcmp.mod68.not, label %._crit_edge51, label %._crit_edge51.loopexit.epilog-lcssa

._crit_edge51.loopexit.epilog-lcssa:              ; preds = %._crit_edge51.loopexit.unr-lcssa
  %68 = getelementptr inbounds [1000000 x i32], ptr @inv_B, i64 0, i64 %indvars.iv55.unr
  %69 = load i32, ptr %68, align 4, !tbaa !9
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [1000000 x i32], ptr @C, i64 0, i64 %indvars.iv55.unr
  %72 = load i32, ptr %71, align 4, !tbaa !9
  %73 = sext i32 %72 to i64
  %74 = mul nsw i64 %73, %70
  %75 = srem i64 %74, %50
  %76 = trunc i64 %75 to i32
  %77 = getelementptr inbounds [1000000 x i32], ptr @A, i64 0, i64 %indvars.iv55.unr
  store i32 %76, ptr %77, align 4, !tbaa !9
  br label %._crit_edge51

._crit_edge51:                                    ; preds = %._crit_edge51.loopexit.epilog-lcssa, %._crit_edge51.loopexit.unr-lcssa, %._crit_edge47
  %78 = trunc i64 %48 to i32
  %79 = load i32, ptr @L, align 4, !tbaa !9
  tail call void @_Z3NTTPiiii(ptr noundef nonnull @A, i32 noundef -1, i32 noundef %78, i32 noundef %79)
  %80 = load i64, ptr @n, align 8, !tbaa !5
  %81 = getelementptr inbounds [1000000 x i32], ptr @A, i64 0, i64 %80
  %82 = load i32, ptr %81, align 4, !tbaa !9
  %83 = sext i32 %82 to i64
  %84 = add nsw i64 %80, -1
  %85 = getelementptr inbounds [1000000 x i64], ptr @fac, i64 0, i64 %84
  %86 = load i64, ptr %85, align 8, !tbaa !5
  %87 = mul nsw i64 %86, %83
  %88 = load i64, ptr @mod, align 8, !tbaa !5
  %89 = srem i64 %87, %88
  %90 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %89)
  %91 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %90, i8 noundef signext 10)
  ret i32 0

92:                                               ; preds = %92, %.lr.ph50.new
  %indvars.iv55 = phi i64 [ 0, %.lr.ph50.new ], [ %indvars.iv.next56.1, %92 ]
  %niter70 = phi i64 [ 0, %.lr.ph50.new ], [ %niter70.next.1, %92 ]
  %93 = getelementptr inbounds [1000000 x i32], ptr @inv_B, i64 0, i64 %indvars.iv55
  %94 = load i32, ptr %93, align 8, !tbaa !9
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [1000000 x i32], ptr @C, i64 0, i64 %indvars.iv55
  %97 = load i32, ptr %96, align 8, !tbaa !9
  %98 = sext i32 %97 to i64
  %99 = mul nsw i64 %98, %95
  %100 = srem i64 %99, %50
  %101 = trunc i64 %100 to i32
  %102 = getelementptr inbounds [1000000 x i32], ptr @A, i64 0, i64 %indvars.iv55
  store i32 %101, ptr %102, align 8, !tbaa !9
  %indvars.iv.next56 = or disjoint i64 %indvars.iv55, 1
  %103 = getelementptr inbounds [1000000 x i32], ptr @inv_B, i64 0, i64 %indvars.iv.next56
  %104 = load i32, ptr %103, align 4, !tbaa !9
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [1000000 x i32], ptr @C, i64 0, i64 %indvars.iv.next56
  %107 = load i32, ptr %106, align 4, !tbaa !9
  %108 = sext i32 %107 to i64
  %109 = mul nsw i64 %108, %105
  %110 = srem i64 %109, %50
  %111 = trunc i64 %110 to i32
  %112 = getelementptr inbounds [1000000 x i32], ptr @A, i64 0, i64 %indvars.iv.next56
  store i32 %111, ptr %112, align 4, !tbaa !9
  %indvars.iv.next56.1 = add nuw nsw i64 %indvars.iv55, 2
  %niter70.next.1 = add i64 %niter70, 2
  %niter70.ncmp.1 = icmp eq i64 %niter70.next.1, %unroll_iter69
  br i1 %niter70.ncmp.1, label %._crit_edge51.loopexit.unr-lcssa, label %92, !llvm.loop !16
}

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) local_unnamed_addr #1 align 2

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

!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 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}


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