; LLVM IR from lzyrapx/Competitive-Programming :: LibreOJ/2002（容斥+dp+矩阵快速幂）.ll (Z6solve2v)

; 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.matrix = type { [110 x [110 x i32]] }

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@p = external dso_local global i32, align 4
@A = external dso_local global %struct.matrix, align 4
@isprime = external dso_local global [20000010 x i8], align 16
@dp = external dso_local global [110 x i32], align 16

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z8multipow6matrixi(ptr dead_on_unwind noalias writable sret(%struct.matrix) align 4, ptr noundef byval(%struct.matrix) align 8, i32 noundef) #0

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #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: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z6solve2v() #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 %struct.matrix, align 4
  %7 = alloca %struct.matrix, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  call void @llvm.memset.p0.i64(ptr align 16 @dp, i8 0, i64 440, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #4
  store i32 1, ptr %1, align 4, !tbaa !5
  br label %10

10:                                               ; preds = %30, %0
  %11 = load i32, ptr %1, align 4, !tbaa !5
  %12 = load i32, ptr @m, align 4, !tbaa !5
  %13 = icmp sle i32 %11, %12
  br i1 %13, label %15, label %14

14:                                               ; preds = %10
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #4
  br label %33

15:                                               ; preds = %10
  %16 = load i32, ptr %1, align 4, !tbaa !5
  %17 = sext i32 %16 to i64
  %18 = getelementptr inbounds [20000010 x i8], ptr @isprime, i64 0, i64 %17
  %19 = load i8, ptr %18, align 1, !tbaa !9, !range !11, !noundef !12
  %20 = trunc i8 %19 to i1
  br i1 %20, label %21, label %29

21:                                               ; preds = %15
  %22 = load i32, ptr %1, align 4, !tbaa !5
  %23 = load i32, ptr @p, align 4, !tbaa !5
  %24 = srem i32 %22, %23
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds [110 x i32], ptr @dp, i64 0, i64 %25
  %27 = load i32, ptr %26, align 4, !tbaa !5
  %28 = add nsw i32 %27, 1
  store i32 %28, ptr %26, align 4, !tbaa !5
  br label %29

29:                                               ; preds = %21, %15
  br label %30

30:                                               ; preds = %29
  %31 = load i32, ptr %1, align 4, !tbaa !5
  %32 = add nsw i32 %31, 1
  store i32 %32, ptr %1, align 4, !tbaa !5
  br label %10, !llvm.loop !13

33:                                               ; preds = %14
  call void @llvm.memset.p0.i64(ptr align 4 @A, i8 0, i64 48400, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %34

34:                                               ; preds = %60, %33
  %35 = load i32, ptr %2, align 4, !tbaa !5
  %36 = load i32, ptr @m, align 4, !tbaa !5
  %37 = icmp sle i32 %35, %36
  br i1 %37, label %39, label %38

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

39:                                               ; preds = %34
  %40 = load i32, ptr %2, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [20000010 x i8], ptr @isprime, i64 0, i64 %41
  %43 = load i8, ptr %42, align 1, !tbaa !9, !range !11, !noundef !12
  %44 = trunc i8 %43 to i1
  br i1 %44, label %45, label %59

45:                                               ; preds = %39
  %46 = load i32, ptr %2, align 4, !tbaa !5
  %47 = sub nsw i32 0, %46
  %48 = load i32, ptr @p, align 4, !tbaa !5
  %49 = srem i32 %47, %48
  %50 = load i32, ptr @p, align 4, !tbaa !5
  %51 = add nsw i32 %49, %50
  %52 = load i32, ptr @p, align 4, !tbaa !5
  %53 = srem i32 %51, %52
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [110 x [110 x i32]], ptr @A, i64 0, i64 %54
  %56 = getelementptr inbounds [110 x i32], ptr %55, i64 0, i64 0
  %57 = load i32, ptr %56, align 4, !tbaa !5
  %58 = add nsw i32 %57, 1
  store i32 %58, ptr %56, align 4, !tbaa !5
  br label %59

59:                                               ; preds = %45, %39
  br label %60

60:                                               ; preds = %59
  %61 = load i32, ptr %2, align 4, !tbaa !5
  %62 = add nsw i32 %61, 1
  store i32 %62, ptr %2, align 4, !tbaa !5
  br label %34, !llvm.loop !15

63:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %64

64:                                               ; preds = %99, %63
  %65 = load i32, ptr %3, align 4, !tbaa !5
  %66 = load i32, ptr @p, align 4, !tbaa !5
  %67 = icmp slt i32 %65, %66
  br i1 %67, label %69, label %68

68:                                               ; preds = %64
  store i32 8, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  br label %102

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

70:                                               ; preds = %95, %69
  %71 = load i32, ptr %5, align 4, !tbaa !5
  %72 = load i32, ptr @p, align 4, !tbaa !5
  %73 = icmp slt i32 %71, %72
  br i1 %73, label %75, label %74

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

75:                                               ; preds = %70
  %76 = load i32, ptr %5, align 4, !tbaa !5
  %77 = sub nsw i32 %76, 1
  %78 = load i32, ptr @p, align 4, !tbaa !5
  %79 = add nsw i32 %77, %78
  %80 = load i32, ptr @p, align 4, !tbaa !5
  %81 = srem i32 %79, %80
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [110 x [110 x i32]], ptr @A, i64 0, i64 %82
  %84 = load i32, ptr %3, align 4, !tbaa !5
  %85 = sub nsw i32 %84, 1
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [110 x i32], ptr %83, i64 0, i64 %86
  %88 = load i32, ptr %87, align 4, !tbaa !5
  %89 = load i32, ptr %5, align 4, !tbaa !5
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [110 x [110 x i32]], ptr @A, i64 0, i64 %90
  %92 = load i32, ptr %3, align 4, !tbaa !5
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [110 x i32], ptr %91, i64 0, i64 %93
  store i32 %88, ptr %94, align 4, !tbaa !5
  br label %95

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

98:                                               ; preds = %74
  br label %99

99:                                               ; preds = %98
  %100 = load i32, ptr %3, align 4, !tbaa !5
  %101 = add nsw i32 %100, 1
  store i32 %101, ptr %3, align 4, !tbaa !5
  br label %64, !llvm.loop !17

102:                                              ; preds = %68
  call void @llvm.lifetime.start.p0(i64 48400, ptr %6) #4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %7, ptr align 4 @A, i64 48400, i1 false), !tbaa.struct !18
  %103 = load i32, ptr @n, align 4, !tbaa !5
  %104 = sub nsw i32 %103, 1
  call void @_Z8multipow6matrixi(ptr dead_on_unwind writable sret(%struct.matrix) align 4 %6, ptr noundef byval(%struct.matrix) align 8 %7, i32 noundef %104)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 @A, ptr align 4 %6, i64 48400, i1 false), !tbaa.struct !18
  call void @llvm.lifetime.end.p0(i64 48400, ptr %6) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  store i32 0, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %105

105:                                              ; preds = %130, %102
  %106 = load i32, ptr %9, align 4, !tbaa !5
  %107 = load i32, ptr @p, align 4, !tbaa !5
  %108 = icmp slt i32 %106, %107
  br i1 %108, label %110, label %109

109:                                              ; preds = %105
  store i32 14, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  br label %133

110:                                              ; preds = %105
  %111 = load i32, ptr %8, align 4, !tbaa !5
  %112 = sext i32 %111 to i64
  %113 = load i32, ptr %9, align 4, !tbaa !5
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [110 x i32], ptr @dp, i64 0, i64 %114
  %116 = load i32, ptr %115, align 4, !tbaa !5
  %117 = sext i32 %116 to i64
  %118 = mul nsw i64 1, %117
  %119 = load i32, ptr %9, align 4, !tbaa !5
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds [110 x [110 x i32]], ptr @A, i64 0, i64 %120
  %122 = getelementptr inbounds [110 x i32], ptr %121, i64 0, i64 0
  %123 = load i32, ptr %122, align 4, !tbaa !5
  %124 = sext i32 %123 to i64
  %125 = mul nsw i64 %118, %124
  %126 = srem i64 %125, 20170408
  %127 = add nsw i64 %112, %126
  %128 = srem i64 %127, 20170408
  %129 = trunc i64 %128 to i32
  store i32 %129, ptr %8, align 4, !tbaa !5
  br label %130

130:                                              ; preds = %110
  %131 = load i32, ptr %9, align 4, !tbaa !5
  %132 = add nsw i32 %131, 1
  store i32 %132, ptr %9, align 4, !tbaa !5
  br label %105, !llvm.loop !20

133:                                              ; preds = %109
  %134 = load i32, ptr %8, align 4, !tbaa !5
  store i32 1, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  ret i32 %134
}

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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = !{!10, !10, i64 0}
!10 = !{!"bool", !7, i64 0}
!11 = !{i8 0, i8 2}
!12 = !{}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !14}
!18 = !{i64 0, i64 48400, !19}
!19 = !{!7, !7, i64 0}
!20 = distinct !{!20, !14}


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

%struct.matrix = type { [110 x [110 x i32]] }

@n = external dso_local local_unnamed_addr global i32, align 4
@m = external dso_local local_unnamed_addr global i32, align 4
@p = external dso_local local_unnamed_addr global i32, align 4
@A = external dso_local local_unnamed_addr global %struct.matrix, align 4
@isprime = external dso_local local_unnamed_addr global [20000010 x i8], align 16
@dp = external dso_local local_unnamed_addr global [110 x i32], align 16

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z8multipow6matrixi(ptr dead_on_unwind noalias writable sret(%struct.matrix) align 4, ptr noundef byval(%struct.matrix) align 8, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #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 nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

; Function Attrs: mustprogress uwtable
define dso_local noundef range(i32 -20170407, 20170408) i32 @_Z6solve2v() local_unnamed_addr #0 {
  %1 = alloca %struct.matrix, align 4
  %2 = alloca %struct.matrix, align 8
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(440) @dp, i8 0, i64 440, i1 false)
  %3 = load i32, ptr @m, align 4, !tbaa !5
  %.not30 = icmp slt i32 %3, 1
  %.pre.pre = load i32, ptr @p, align 4
  br i1 %.not30, label %._crit_edge.thread, label %.lr.ph

._crit_edge.thread:                               ; preds = %0
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(48400) @A, i8 0, i64 48400, i1 false)
  br label %.preheader29

.lr.ph:                                           ; preds = %0
  %4 = zext nneg i32 %3 to i64
  %xtraiter = and i64 %4, 1
  %5 = icmp eq i32 %3, 1
  br i1 %5, label %._crit_edge.unr-lcssa, label %.lr.ph.new

.lr.ph.new:                                       ; preds = %.lr.ph
  %unroll_iter = and i64 %4, 2147483646
  br label %17

._crit_edge.unr-lcssa:                            ; preds = %39, %.lr.ph
  %indvars.iv.unr = phi i64 [ 1, %.lr.ph ], [ %indvars.iv.next.1, %39 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge, label %.epil.preheader

.epil.preheader:                                  ; preds = %._crit_edge.unr-lcssa
  %6 = getelementptr inbounds [20000010 x i8], ptr @isprime, i64 0, i64 %indvars.iv.unr
  %7 = load i8, ptr %6, align 1, !tbaa !9, !range !11, !noundef !12
  %8 = trunc nuw i8 %7 to i1
  br i1 %8, label %9, label %._crit_edge

9:                                                ; preds = %.epil.preheader
  %10 = trunc nuw nsw i64 %indvars.iv.unr to i32
  %11 = srem i32 %10, %.pre.pre
  %12 = zext nneg i32 %11 to i64
  %13 = getelementptr inbounds [110 x i32], ptr @dp, i64 0, i64 %12
  %14 = load i32, ptr %13, align 4, !tbaa !5
  %15 = add nsw i32 %14, 1
  store i32 %15, ptr %13, align 4, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %.epil.preheader, %9, %._crit_edge.unr-lcssa
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(48400) @A, i8 0, i64 48400, i1 false)
  br i1 %.not30, label %.preheader29, label %.lr.ph35

.lr.ph35:                                         ; preds = %._crit_edge
  %16 = add nuw i32 %3, 1
  %wide.trip.count51 = zext i32 %16 to i64
  br label %65

17:                                               ; preds = %39, %.lr.ph.new
  %indvars.iv = phi i64 [ 1, %.lr.ph.new ], [ %indvars.iv.next.1, %39 ]
  %niter = phi i64 [ 0, %.lr.ph.new ], [ %niter.next.1, %39 ]
  %18 = getelementptr inbounds [20000010 x i8], ptr @isprime, i64 0, i64 %indvars.iv
  %19 = load i8, ptr %18, align 1, !tbaa !9, !range !11, !noundef !12
  %20 = trunc nuw i8 %19 to i1
  br i1 %20, label %21, label %28

21:                                               ; preds = %17
  %22 = trunc nuw nsw i64 %indvars.iv to i32
  %23 = srem i32 %22, %.pre.pre
  %24 = zext nneg i32 %23 to i64
  %25 = getelementptr inbounds [110 x i32], ptr @dp, i64 0, i64 %24
  %26 = load i32, ptr %25, align 4, !tbaa !5
  %27 = add nsw i32 %26, 1
  store i32 %27, ptr %25, align 4, !tbaa !5
  br label %28

28:                                               ; preds = %17, %21
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %29 = getelementptr inbounds [20000010 x i8], ptr @isprime, i64 0, i64 %indvars.iv.next
  %30 = load i8, ptr %29, align 1, !tbaa !9, !range !11, !noundef !12
  %31 = trunc nuw i8 %30 to i1
  br i1 %31, label %32, label %39

32:                                               ; preds = %28
  %33 = trunc nuw nsw i64 %indvars.iv.next to i32
  %34 = srem i32 %33, %.pre.pre
  %35 = zext nneg i32 %34 to i64
  %36 = getelementptr inbounds [110 x i32], ptr @dp, i64 0, i64 %35
  %37 = load i32, ptr %36, align 4, !tbaa !5
  %38 = add nsw i32 %37, 1
  store i32 %38, ptr %36, align 4, !tbaa !5
  br label %39

39:                                               ; preds = %32, %28
  %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 %._crit_edge.unr-lcssa, label %17, !llvm.loop !13

.preheader29:                                     ; preds = %78, %._crit_edge.thread, %._crit_edge
  %40 = icmp sgt i32 %.pre.pre, 1
  br i1 %40, label %.preheader.lr.ph, label %._crit_edge40

.preheader.lr.ph:                                 ; preds = %.preheader29
  %41 = add nsw i32 %.pre.pre, -1
  %wide.trip.count61 = zext nneg i32 %.pre.pre to i64
  %xtraiter69 = and i64 %wide.trip.count61, 1
  %unroll_iter71 = and i64 %wide.trip.count61, 2147483646
  %lcmp.mod70.not = icmp eq i64 %xtraiter69, 0
  br label %.preheader.us

.preheader.us:                                    ; preds = %._crit_edge38.us, %.preheader.lr.ph
  %indvars.iv58 = phi i64 [ %indvars.iv.next59, %._crit_edge38.us ], [ 1, %.preheader.lr.ph ]
  %42 = add nsw i64 %indvars.iv58, -1
  br label %43

43:                                               ; preds = %43, %.preheader.us
  %indvars.iv53 = phi i64 [ 0, %.preheader.us ], [ %indvars.iv.next54.1, %43 ]
  %niter72 = phi i64 [ 0, %.preheader.us ], [ %niter72.next.1, %43 ]
  %44 = trunc nuw nsw i64 %indvars.iv53 to i32
  %45 = add i32 %41, %44
  %46 = srem i32 %45, %.pre.pre
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [110 x [110 x i32]], ptr @A, i64 0, i64 %47, i64 %42
  %49 = load i32, ptr %48, align 4, !tbaa !5
  %50 = getelementptr inbounds [110 x [110 x i32]], ptr @A, i64 0, i64 %indvars.iv53, i64 %indvars.iv58
  store i32 %49, ptr %50, align 4, !tbaa !5
  %indvars.iv.next54 = or disjoint i64 %indvars.iv53, 1
  %51 = trunc nuw nsw i64 %indvars.iv.next54 to i32
  %52 = add i32 %41, %51
  %53 = srem i32 %52, %.pre.pre
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [110 x [110 x i32]], ptr @A, i64 0, i64 %54, i64 %42
  %56 = load i32, ptr %55, align 4, !tbaa !5
  %57 = getelementptr inbounds [110 x [110 x i32]], ptr @A, i64 0, i64 %indvars.iv.next54, i64 %indvars.iv58
  store i32 %56, ptr %57, align 4, !tbaa !5
  %indvars.iv.next54.1 = add nuw nsw i64 %indvars.iv53, 2
  %niter72.next.1 = add i64 %niter72, 2
  %niter72.ncmp.1 = icmp eq i64 %niter72.next.1, %unroll_iter71
  br i1 %niter72.ncmp.1, label %._crit_edge38.us.unr-lcssa, label %43, !llvm.loop !15

._crit_edge38.us.unr-lcssa:                       ; preds = %43
  br i1 %lcmp.mod70.not, label %._crit_edge38.us, label %._crit_edge38.us.epilog-lcssa

._crit_edge38.us.epilog-lcssa:                    ; preds = %._crit_edge38.us.unr-lcssa
  %58 = trunc nuw nsw i64 %indvars.iv.next54.1 to i32
  %59 = add i32 %41, %58
  %60 = srem i32 %59, %.pre.pre
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [110 x [110 x i32]], ptr @A, i64 0, i64 %61, i64 %42
  %63 = load i32, ptr %62, align 4, !tbaa !5
  %64 = getelementptr inbounds [110 x [110 x i32]], ptr @A, i64 0, i64 %indvars.iv.next54.1, i64 %indvars.iv58
  store i32 %63, ptr %64, align 4, !tbaa !5
  br label %._crit_edge38.us

._crit_edge38.us:                                 ; preds = %._crit_edge38.us.unr-lcssa, %._crit_edge38.us.epilog-lcssa
  %indvars.iv.next59 = add nuw nsw i64 %indvars.iv58, 1
  %exitcond62.not = icmp eq i64 %indvars.iv.next59, %wide.trip.count61
  br i1 %exitcond62.not, label %._crit_edge40, label %.preheader.us, !llvm.loop !16

65:                                               ; preds = %.lr.ph35, %78
  %indvars.iv48 = phi i64 [ 1, %.lr.ph35 ], [ %indvars.iv.next49, %78 ]
  %66 = getelementptr inbounds [20000010 x i8], ptr @isprime, i64 0, i64 %indvars.iv48
  %67 = load i8, ptr %66, align 1, !tbaa !9, !range !11, !noundef !12
  %68 = trunc nuw i8 %67 to i1
  br i1 %68, label %69, label %78

69:                                               ; preds = %65
  %70 = trunc nuw nsw i64 %indvars.iv48 to i32
  %71 = srem i32 %70, %.pre.pre
  %72 = sub i32 %.pre.pre, %71
  %73 = srem i32 %72, %.pre.pre
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [110 x [110 x i32]], ptr @A, i64 0, i64 %74
  %76 = load i32, ptr %75, align 4, !tbaa !5
  %77 = add nsw i32 %76, 1
  store i32 %77, ptr %75, align 4, !tbaa !5
  br label %78

78:                                               ; preds = %65, %69
  %indvars.iv.next49 = add nuw nsw i64 %indvars.iv48, 1
  %exitcond52.not = icmp eq i64 %indvars.iv.next49, %wide.trip.count51
  br i1 %exitcond52.not, label %.preheader29, label %65, !llvm.loop !17

._crit_edge40:                                    ; preds = %._crit_edge38.us, %.preheader29
  call void @llvm.lifetime.start.p0(i64 48400, ptr nonnull %1) #4
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(48400) %2, ptr noundef nonnull align 4 dereferenceable(48400) @A, i64 48400, i1 false), !tbaa.struct !18
  %79 = load i32, ptr @n, align 4, !tbaa !5
  %80 = add nsw i32 %79, -1
  call void @_Z8multipow6matrixi(ptr dead_on_unwind nonnull writable sret(%struct.matrix) align 4 %1, ptr noundef nonnull byval(%struct.matrix) align 8 %2, i32 noundef %80)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(48400) @A, ptr noundef nonnull align 4 dereferenceable(48400) %1, i64 48400, i1 false), !tbaa.struct !18
  call void @llvm.lifetime.end.p0(i64 48400, ptr nonnull %1) #4
  %81 = load i32, ptr @p, align 4, !tbaa !5
  %82 = icmp sgt i32 %81, 0
  br i1 %82, label %.lr.ph44.preheader, label %._crit_edge45

.lr.ph44.preheader:                               ; preds = %._crit_edge40
  %wide.trip.count66 = zext nneg i32 %81 to i64
  br label %.lr.ph44

._crit_edge45.loopexit:                           ; preds = %.lr.ph44
  %83 = trunc nsw i64 %93 to i32
  br label %._crit_edge45

._crit_edge45:                                    ; preds = %._crit_edge45.loopexit, %._crit_edge40
  %.022.lcssa = phi i32 [ 0, %._crit_edge40 ], [ %83, %._crit_edge45.loopexit ]
  ret i32 %.022.lcssa

.lr.ph44:                                         ; preds = %.lr.ph44.preheader, %.lr.ph44
  %indvars.iv63 = phi i64 [ 0, %.lr.ph44.preheader ], [ %indvars.iv.next64, %.lr.ph44 ]
  %.02241 = phi i64 [ 0, %.lr.ph44.preheader ], [ %93, %.lr.ph44 ]
  %84 = getelementptr inbounds [110 x i32], ptr @dp, i64 0, i64 %indvars.iv63
  %85 = load i32, ptr %84, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [110 x [110 x i32]], ptr @A, i64 0, i64 %indvars.iv63
  %88 = load i32, ptr %87, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = mul nsw i64 %89, %86
  %91 = srem i64 %90, 20170408
  %92 = add nsw i64 %91, %.02241
  %93 = srem i64 %92, 20170408
  %indvars.iv.next64 = add nuw nsw i64 %indvars.iv63, 1
  %exitcond67.not = icmp eq i64 %indvars.iv.next64, %wide.trip.count66
  br i1 %exitcond67.not, label %._crit_edge45.loopexit, label %.lr.ph44, !llvm.loop !20
}

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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = !{!10, !10, i64 0}
!10 = !{!"bool", !7, i64 0}
!11 = !{i8 0, i8 2}
!12 = !{}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !14}
!18 = !{i64 0, i64 48400, !19}
!19 = !{!7, !7, i64 0}
!20 = distinct !{!20, !14}


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