; LLVM IR from tangjz/acm-icpc :: lydsy (4417)

; 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 { i32, i32, [101 x [101 x i32]] }

@A = external dso_local global %struct.Matrix, align 4
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.3 = 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 i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca %struct.Matrix, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  %9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2, ptr noundef %3)
  %10 = load i32, ptr %3, align 4, !tbaa !5
  %11 = icmp eq i32 %10, 2
  br i1 %11, label %12, label %21

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

15:                                               ; preds = %12
  br label %17

16:                                               ; preds = %12
  br label %17

17:                                               ; preds = %16, %15
  %18 = phi ptr [ @.str.1, %15 ], [ @.str.2, %16 ]
  %19 = getelementptr inbounds [2 x i8], ptr %18, i64 0, i64 0
  %20 = call i32 @puts(ptr noundef %19)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %4, align 4
  br label %164

21:                                               ; preds = %0
  %22 = load i32, ptr %2, align 4, !tbaa !5
  %23 = shl i32 %22, 1
  store i32 %23, ptr getelementptr inbounds (%struct.Matrix, ptr @A, i32 0, i32 1), align 4, !tbaa !9
  store i32 %23, ptr @A, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %24

24:                                               ; preds = %98, %21
  %25 = load i32, ptr %5, align 4, !tbaa !5
  %26 = load i32, ptr %2, align 4, !tbaa !5
  %27 = icmp slt i32 %25, %26
  br i1 %27, label %29, label %28

28:                                               ; preds = %24
  store i32 2, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %101

29:                                               ; preds = %24
  %30 = load i32, ptr %5, align 4, !tbaa !5
  %31 = load i32, ptr %2, align 4, !tbaa !5
  %32 = add nsw i32 %30, %31
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [101 x [101 x i32]], ptr getelementptr inbounds (%struct.Matrix, ptr @A, i32 0, i32 2), i64 0, i64 %33
  %35 = load i32, ptr %5, align 4, !tbaa !5
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [101 x i32], ptr %34, i64 0, i64 %36
  %38 = load i32, ptr %37, align 4, !tbaa !5
  %39 = add nsw i32 %38, 1
  store i32 %39, ptr %37, align 4, !tbaa !5
  %40 = load i32, ptr %5, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [101 x [101 x i32]], ptr getelementptr inbounds (%struct.Matrix, ptr @A, i32 0, i32 2), i64 0, i64 %41
  %43 = load i32, ptr %5, align 4, !tbaa !5
  %44 = load i32, ptr %2, align 4, !tbaa !5
  %45 = add nsw i32 %43, %44
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [101 x i32], ptr %42, i64 0, i64 %46
  %48 = load i32, ptr %47, align 4, !tbaa !5
  %49 = add nsw i32 %48, 1
  store i32 %49, ptr %47, align 4, !tbaa !5
  %50 = load i32, ptr %5, align 4, !tbaa !5
  %51 = icmp ne i32 %50, 0
  br i1 %51, label %52, label %66

52:                                               ; preds = %29
  %53 = load i32, ptr %5, align 4, !tbaa !5
  %54 = sub nsw i32 %53, 1
  %55 = load i32, ptr %2, align 4, !tbaa !5
  %56 = add nsw i32 %54, %55
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [101 x [101 x i32]], ptr getelementptr inbounds (%struct.Matrix, ptr @A, i32 0, i32 2), i64 0, i64 %57
  %59 = load i32, ptr %5, align 4, !tbaa !5
  %60 = load i32, ptr %2, align 4, !tbaa !5
  %61 = add nsw i32 %59, %60
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [101 x i32], ptr %58, i64 0, i64 %62
  %64 = load i32, ptr %63, align 4, !tbaa !5
  %65 = add nsw i32 %64, 1
  store i32 %65, ptr %63, align 4, !tbaa !5
  br label %66

66:                                               ; preds = %52, %29
  %67 = load i32, ptr %5, align 4, !tbaa !5
  %68 = load i32, ptr %2, align 4, !tbaa !5
  %69 = add nsw i32 %67, %68
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [101 x [101 x i32]], ptr getelementptr inbounds (%struct.Matrix, ptr @A, i32 0, i32 2), i64 0, i64 %70
  %72 = load i32, ptr %5, align 4, !tbaa !5
  %73 = load i32, ptr %2, align 4, !tbaa !5
  %74 = add nsw i32 %72, %73
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [101 x i32], ptr %71, i64 0, i64 %75
  %77 = load i32, ptr %76, align 4, !tbaa !5
  %78 = add nsw i32 %77, 1
  store i32 %78, ptr %76, align 4, !tbaa !5
  %79 = load i32, ptr %5, align 4, !tbaa !5
  %80 = add nsw i32 %79, 1
  %81 = load i32, ptr %2, align 4, !tbaa !5
  %82 = icmp slt i32 %80, %81
  br i1 %82, label %83, label %97

83:                                               ; preds = %66
  %84 = load i32, ptr %5, align 4, !tbaa !5
  %85 = add nsw i32 %84, 1
  %86 = load i32, ptr %2, align 4, !tbaa !5
  %87 = add nsw i32 %85, %86
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [101 x [101 x i32]], ptr getelementptr inbounds (%struct.Matrix, ptr @A, i32 0, i32 2), i64 0, i64 %88
  %90 = load i32, ptr %5, align 4, !tbaa !5
  %91 = load i32, ptr %2, align 4, !tbaa !5
  %92 = add nsw i32 %90, %91
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [101 x i32], ptr %89, i64 0, i64 %93
  %95 = load i32, ptr %94, align 4, !tbaa !5
  %96 = add nsw i32 %95, 1
  store i32 %96, ptr %94, align 4, !tbaa !5
  br label %97

97:                                               ; preds = %83, %66
  br label %98

98:                                               ; preds = %97
  %99 = load i32, ptr %5, align 4, !tbaa !5
  %100 = add nsw i32 %99, 1
  store i32 %100, ptr %5, align 4, !tbaa !5
  br label %24, !llvm.loop !12

101:                                              ; preds = %28
  call void @llvm.lifetime.start.p0(i64 40812, ptr %6) #5
  %102 = load i32, ptr %3, align 4, !tbaa !5
  %103 = sub nsw i32 %102, 3
  call void @_ZN6Matrix3powEi(ptr dead_on_unwind writable sret(%struct.Matrix) align 4 %6, ptr noundef nonnull align 4 dereferenceable(40812) @A, i32 noundef %103)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 @A, ptr align 4 %6, i64 40812, i1 false), !tbaa.struct !14
  call void @llvm.lifetime.end.p0(i64 40812, ptr %6) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  %104 = load i32, ptr %2, align 4, !tbaa !5
  %105 = shl i32 %104, 1
  %106 = sub nsw i32 %105, 1
  store i32 %106, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  %107 = load i32, ptr %7, align 4, !tbaa !5
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [101 x i32], ptr getelementptr inbounds (%struct.Matrix, ptr @A, i32 0, i32 2), i64 0, i64 %108
  %110 = load i32, ptr %109, align 4, !tbaa !5
  %111 = load i32, ptr %2, align 4, !tbaa !5
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [101 x [101 x i32]], ptr getelementptr inbounds (%struct.Matrix, ptr @A, i32 0, i32 2), i64 0, i64 %112
  %114 = load i32, ptr %7, align 4, !tbaa !5
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [101 x i32], ptr %113, i64 0, i64 %115
  %117 = load i32, ptr %116, align 4, !tbaa !5
  %118 = add nsw i32 %110, %117
  store i32 %118, ptr %8, align 4, !tbaa !5
  %119 = load i32, ptr %2, align 4, !tbaa !5
  %120 = icmp sgt i32 %119, 1
  br i1 %120, label %121, label %160

121:                                              ; preds = %101
  %122 = load i32, ptr %7, align 4, !tbaa !5
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds [101 x i32], ptr getelementptr inbounds ([101 x [101 x i32]], ptr getelementptr inbounds (%struct.Matrix, ptr @A, i32 0, i32 2), i64 0, i64 1), i64 0, i64 %123
  %125 = load i32, ptr %124, align 4, !tbaa !5
  %126 = load i32, ptr %2, align 4, !tbaa !5
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds [101 x [101 x i32]], ptr getelementptr inbounds (%struct.Matrix, ptr @A, i32 0, i32 2), i64 0, i64 %127
  %129 = load i32, ptr %7, align 4, !tbaa !5
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [101 x i32], ptr %128, i64 0, i64 %130
  %132 = load i32, ptr %131, align 4, !tbaa !5
  %133 = add nsw i32 %125, %132
  %134 = load i32, ptr %2, align 4, !tbaa !5
  %135 = add nsw i32 %134, 1
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds [101 x [101 x i32]], ptr getelementptr inbounds (%struct.Matrix, ptr @A, i32 0, i32 2), i64 0, i64 %136
  %138 = load i32, ptr %7, align 4, !tbaa !5
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds [101 x i32], ptr %137, i64 0, i64 %139
  %141 = load i32, ptr %140, align 4, !tbaa !5
  %142 = shl i32 %141, 1
  %143 = add nsw i32 %133, %142
  %144 = load i32, ptr %8, align 4, !tbaa !5
  %145 = add nsw i32 %144, %143
  store i32 %145, ptr %8, align 4, !tbaa !5
  %146 = load i32, ptr %2, align 4, !tbaa !5
  %147 = icmp sgt i32 %146, 2
  br i1 %147, label %148, label %159

148:                                              ; preds = %121
  %149 = load i32, ptr %2, align 4, !tbaa !5
  %150 = add nsw i32 %149, 2
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds [101 x [101 x i32]], ptr getelementptr inbounds (%struct.Matrix, ptr @A, i32 0, i32 2), i64 0, i64 %151
  %153 = load i32, ptr %7, align 4, !tbaa !5
  %154 = sext i32 %153 to i64
  %155 = getelementptr inbounds [101 x i32], ptr %152, i64 0, i64 %154
  %156 = load i32, ptr %155, align 4, !tbaa !5
  %157 = load i32, ptr %8, align 4, !tbaa !5
  %158 = add nsw i32 %157, %156
  store i32 %158, ptr %8, align 4, !tbaa !5
  br label %159

159:                                              ; preds = %148, %121
  br label %160

160:                                              ; preds = %159, %101
  %161 = load i32, ptr %8, align 4, !tbaa !5
  %162 = srem i32 %161, 30011
  %163 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %162)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %164

164:                                              ; preds = %160, %17
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  %165 = load i32, ptr %1, align 4
  ret i32 %165
}

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

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

declare i32 @puts(ptr noundef) #2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6Matrix3powEi(ptr dead_on_unwind noalias writable sret(%struct.Matrix) align 4, ptr noundef nonnull align 4 dereferenceable(40812), i32 noundef) #3 align 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) #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 = { 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = !{!10, !6, i64 4}
!10 = !{!"_ZTS6Matrix", !6, i64 0, !6, i64 4, !7, i64 8}
!11 = !{!10, !6, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = !{i64 0, i64 4, !5, i64 4, i64 4, !5, i64 8, i64 40804, !15}
!15 = !{!7, !7, i64 0}


; 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 { i32, i32, [101 x [101 x i32]] }

@A = external dso_local global %struct.Matrix, align 4
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.3 = 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 i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca %struct.Matrix, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #5
  %4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1, ptr noundef nonnull %2)
  %5 = load i32, ptr %2, align 4, !tbaa !5
  %6 = icmp eq i32 %5, 2
  %7 = load i32, ptr %1, align 4, !tbaa !5
  br i1 %6, label %8, label %11

8:                                                ; preds = %0
  %9 = icmp slt i32 %7, 3
  %.str.1..str.2 = select i1 %9, ptr @.str.1, ptr @.str.2
  %10 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
  br label %85

11:                                               ; preds = %0
  %12 = shl i32 %7, 1
  store i32 %12, ptr getelementptr inbounds (i8, ptr @A, i64 4), align 4, !tbaa !9
  store i32 %12, ptr @A, align 4, !tbaa !11
  %13 = icmp sgt i32 %7, 0
  br i1 %13, label %14, label %._crit_edge

14:                                               ; preds = %11
  %15 = add nsw i32 %7, -1
  %16 = zext nneg i32 %7 to i64
  %wide.trip.count = zext nneg i32 %7 to i64
  %17 = getelementptr inbounds [101 x [101 x i32]], ptr getelementptr inbounds (i8, ptr @A, i64 8), i64 0, i64 %16, i64 0
  %18 = load i32, ptr %17, align 4, !tbaa !5
  %19 = add nsw i32 %18, 1
  store i32 %19, ptr %17, align 4, !tbaa !5
  %20 = getelementptr inbounds [101 x [101 x i32]], ptr getelementptr inbounds (i8, ptr @A, i64 8), i64 0, i64 0, i64 %16
  %21 = load i32, ptr %20, align 4, !tbaa !5
  %22 = add nsw i32 %21, 1
  store i32 %22, ptr %20, align 4, !tbaa !5
  %.phi.trans.insert = getelementptr inbounds [101 x [101 x i32]], ptr getelementptr inbounds (i8, ptr @A, i64 8), i64 0, i64 %16, i64 %16
  %.pre = load i32, ptr %.phi.trans.insert, align 4, !tbaa !5
  %23 = getelementptr inbounds [101 x [101 x i32]], ptr getelementptr inbounds (i8, ptr @A, i64 8), i64 0, i64 %16, i64 %16
  %24 = add nsw i32 %.pre, 1
  store i32 %24, ptr %23, align 4, !tbaa !5
  %.not35 = icmp eq i32 %7, 1
  br i1 %.not35, label %._crit_edge, label %.peel.next

.peel.next:                                       ; preds = %14
  %25 = add nuw nsw i64 %16, 1
  %26 = getelementptr inbounds [101 x [101 x i32]], ptr getelementptr inbounds (i8, ptr @A, i64 8), i64 0, i64 %25, i64 %16
  %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 %41

._crit_edge:                                      ; preds = %64, %14, %11
  call void @llvm.lifetime.start.p0(i64 40812, ptr nonnull %3) #5
  %29 = add nsw i32 %5, -3
  call void @_ZN6Matrix3powEi(ptr dead_on_unwind nonnull writable sret(%struct.Matrix) align 4 %3, ptr noundef nonnull align 4 dereferenceable(40812) @A, i32 noundef %29)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(40812) @A, ptr noundef nonnull align 4 dereferenceable(40812) %3, i64 40812, i1 false), !tbaa.struct !12
  call void @llvm.lifetime.end.p0(i64 40812, ptr nonnull %3) #5
  %30 = load i32, ptr %1, align 4, !tbaa !5
  %31 = shl i32 %30, 1
  %32 = add nsw i32 %31, -1
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [101 x i32], ptr getelementptr inbounds (i8, ptr @A, i64 8), i64 0, i64 %33
  %35 = load i32, ptr %34, align 4, !tbaa !5
  %36 = sext i32 %30 to i64
  %37 = getelementptr inbounds [101 x [101 x i32]], ptr getelementptr inbounds (i8, ptr @A, i64 8), i64 0, i64 %36, i64 %33
  %38 = load i32, ptr %37, align 4, !tbaa !5
  %39 = add nsw i32 %38, %35
  %40 = icmp sgt i32 %30, 1
  br i1 %40, label %65, label %82

41:                                               ; preds = %.peel.next, %64
  %indvars.iv = phi i64 [ 1, %.peel.next ], [ %indvars.iv.next, %64 ]
  %42 = add nuw nsw i64 %indvars.iv, %16
  %43 = getelementptr inbounds [101 x [101 x i32]], ptr getelementptr inbounds (i8, ptr @A, i64 8), i64 0, i64 %42, i64 %indvars.iv
  %44 = load i32, ptr %43, align 4, !tbaa !5
  %45 = add nsw i32 %44, 1
  store i32 %45, ptr %43, align 4, !tbaa !5
  %46 = getelementptr inbounds [101 x [101 x i32]], ptr getelementptr inbounds (i8, ptr @A, i64 8), i64 0, i64 %indvars.iv, i64 %42
  %47 = load i32, ptr %46, align 4, !tbaa !5
  %48 = add nsw i32 %47, 1
  store i32 %48, ptr %46, align 4, !tbaa !5
  %49 = trunc nuw nsw i64 %indvars.iv to i32
  %50 = add i32 %15, %49
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [101 x [101 x i32]], ptr getelementptr inbounds (i8, ptr @A, i64 8), i64 0, i64 %51, i64 %42
  %53 = load i32, ptr %52, align 4, !tbaa !5
  %54 = add nsw i32 %53, 1
  store i32 %54, ptr %52, align 4, !tbaa !5
  %55 = getelementptr inbounds [101 x [101 x i32]], ptr getelementptr inbounds (i8, ptr @A, i64 8), i64 0, i64 %42, i64 %42
  %56 = load i32, ptr %55, align 4, !tbaa !5
  %57 = add nsw i32 %56, 1
  store i32 %57, ptr %55, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %58 = icmp ult i64 %indvars.iv.next, %16
  br i1 %58, label %59, label %64

59:                                               ; preds = %41
  %60 = add nuw nsw i64 %indvars.iv.next, %16
  %61 = getelementptr inbounds [101 x [101 x i32]], ptr getelementptr inbounds (i8, ptr @A, i64 8), i64 0, i64 %60, i64 %42
  %62 = load i32, ptr %61, align 4, !tbaa !5
  %63 = add nsw i32 %62, 1
  store i32 %63, ptr %61, align 4, !tbaa !5
  br label %64

64:                                               ; preds = %41, %59
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %41, !llvm.loop !14

65:                                               ; preds = %._crit_edge
  %66 = getelementptr inbounds [101 x i32], ptr getelementptr inbounds (i8, ptr @A, i64 412), i64 0, i64 %33
  %67 = load i32, ptr %66, align 4, !tbaa !5
  %68 = add nuw nsw i32 %30, 1
  %69 = zext nneg i32 %68 to i64
  %70 = getelementptr inbounds [101 x [101 x i32]], ptr getelementptr inbounds (i8, ptr @A, i64 8), i64 0, i64 %69, i64 %33
  %71 = load i32, ptr %70, align 4, !tbaa !5
  %72 = shl i32 %71, 1
  %73 = add i32 %39, %38
  %74 = add i32 %73, %67
  %75 = add i32 %74, %72
  %.not = icmp eq i32 %30, 2
  br i1 %.not, label %82, label %76

76:                                               ; preds = %65
  %77 = add nuw nsw i32 %30, 2
  %78 = zext nneg i32 %77 to i64
  %79 = getelementptr inbounds [101 x [101 x i32]], ptr getelementptr inbounds (i8, ptr @A, i64 8), i64 0, i64 %78, i64 %33
  %80 = load i32, ptr %79, align 4, !tbaa !5
  %81 = add nsw i32 %80, %75
  br label %82

82:                                               ; preds = %65, %76, %._crit_edge
  %.0 = phi i32 [ %81, %76 ], [ %75, %65 ], [ %39, %._crit_edge ]
  %83 = srem i32 %.0, 30011
  %84 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %83)
  br label %85

85:                                               ; preds = %82, %8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  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: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6Matrix3powEi(ptr dead_on_unwind noalias writable sret(%struct.Matrix) align 4, ptr noundef nonnull align 4 dereferenceable(40812), i32 noundef) local_unnamed_addr #3 align 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) #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 = { 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = !{!10, !6, i64 4}
!10 = !{!"_ZTS6Matrix", !6, i64 0, !6, i64 4, !7, i64 8}
!11 = !{!10, !6, i64 0}
!12 = !{i64 0, i64 4, !5, i64 4, i64 4, !5, i64 8, i64 40804, !13}
!13 = !{!7, !7, i64 0}
!14 = distinct !{!14, !15, !16}
!15 = !{!"llvm.loop.mustprogress"}
!16 = !{!"llvm.loop.peeled.count", i32 1}


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