; LLVM IR from tangjz/acm-icpc :: 51nod (1566)

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

@n = external dso_local global i32, align 4
@t = external dso_local global i32, align 4
@a = external dso_local global [220 x i32], align 16
@f = external dso_local global [220 x i32], align 16
@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 [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z3updRii(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #1 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca %struct.Matrix, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %15 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @t)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %16

16:                                               ; preds = %35, %0
  %17 = load i32, ptr %2, align 4, !tbaa !5
  %18 = load i32, ptr @n, align 4, !tbaa !5
  %19 = icmp slt i32 %17, %18
  br i1 %19, label %21, label %20

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

21:                                               ; preds = %16
  %22 = load i32, ptr %2, align 4, !tbaa !5
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds i32, ptr @a, i64 %23
  %25 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %24)
  %26 = load i32, ptr %2, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [220 x i32], ptr @a, i64 0, i64 %27
  %29 = load i32, ptr %28, align 4, !tbaa !5
  %30 = load i32, ptr %2, align 4, !tbaa !5
  %31 = load i32, ptr @n, align 4, !tbaa !5
  %32 = add nsw i32 %30, %31
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [220 x i32], ptr @a, i64 0, i64 %33
  store i32 %29, ptr %34, align 4, !tbaa !5
  br label %35

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

38:                                               ; preds = %20
  %39 = load i32, ptr @t, align 4, !tbaa !5
  %40 = icmp eq i32 %39, 1
  br i1 %40, label %41, label %90

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

42:                                               ; preds = %84, %41
  %43 = load i32, ptr %4, align 4, !tbaa !5
  %44 = load i32, ptr @n, align 4, !tbaa !5
  %45 = icmp slt i32 %43, %44
  br i1 %45, label %47, label %46

46:                                               ; preds = %42
  store i32 5, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  br label %87

47:                                               ; preds = %42
  %48 = load i32, ptr %4, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [220 x i32], ptr @f, i64 0, i64 %49
  store i32 1, ptr %50, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %51

51:                                               ; preds = %76, %47
  %52 = load i32, ptr %6, align 4, !tbaa !5
  %53 = load i32, ptr %4, align 4, !tbaa !5
  %54 = icmp slt i32 %52, %53
  br i1 %54, label %56, label %55

55:                                               ; preds = %51
  store i32 8, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %79

56:                                               ; preds = %51
  %57 = load i32, ptr %6, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [220 x i32], ptr @a, i64 0, i64 %58
  %60 = load i32, ptr %59, align 4, !tbaa !5
  %61 = load i32, ptr %4, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [220 x i32], ptr @a, i64 0, i64 %62
  %64 = load i32, ptr %63, align 4, !tbaa !5
  %65 = icmp sle i32 %60, %64
  br i1 %65, label %66, label %75

66:                                               ; preds = %56
  %67 = load i32, ptr %4, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [220 x i32], ptr @f, i64 0, i64 %68
  %70 = load i32, ptr %6, align 4, !tbaa !5
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [220 x i32], ptr @f, i64 0, i64 %71
  %73 = load i32, ptr %72, align 4, !tbaa !5
  %74 = add nsw i32 %73, 1
  call void @_Z3updRii(ptr noundef nonnull align 4 dereferenceable(4) %69, i32 noundef %74)
  br label %75

75:                                               ; preds = %66, %56
  br label %76

76:                                               ; preds = %75
  %77 = load i32, ptr %6, align 4, !tbaa !5
  %78 = add nsw i32 %77, 1
  store i32 %78, ptr %6, align 4, !tbaa !5
  br label %51, !llvm.loop !11

79:                                               ; preds = %55
  %80 = load i32, ptr %4, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [220 x i32], ptr @f, i64 0, i64 %81
  %83 = load i32, ptr %82, align 4, !tbaa !5
  call void @_Z3updRii(ptr noundef nonnull align 4 dereferenceable(4) %3, i32 noundef %83)
  br label %84

84:                                               ; preds = %79
  %85 = load i32, ptr %4, align 4, !tbaa !5
  %86 = add nsw i32 %85, 1
  store i32 %86, ptr %4, align 4, !tbaa !5
  br label %42, !llvm.loop !12

87:                                               ; preds = %46
  %88 = load i32, ptr %3, align 4, !tbaa !5
  %89 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %88)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  br label %211

90:                                               ; preds = %38
  %91 = load i32, ptr @n, align 4, !tbaa !5
  store i32 %91, ptr getelementptr inbounds (%struct.Matrix, ptr @A, i32 0, i32 1), align 4, !tbaa !13
  store i32 %91, ptr @A, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %92

92:                                               ; preds = %175, %90
  %93 = load i32, ptr %7, align 4, !tbaa !5
  %94 = load i32, ptr @n, align 4, !tbaa !5
  %95 = icmp slt i32 %93, %94
  br i1 %95, label %97, label %96

96:                                               ; preds = %92
  store i32 11, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %178

97:                                               ; preds = %92
  %98 = load i32, ptr %7, align 4, !tbaa !5
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [220 x i32], ptr @f, i64 0, i64 %99
  store i32 0, ptr %100, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  %101 = load i32, ptr %7, align 4, !tbaa !5
  %102 = add nsw i32 %101, 1
  store i32 %102, ptr %8, align 4, !tbaa !5
  br label %103

103:                                              ; preds = %149, %97
  %104 = load i32, ptr %8, align 4, !tbaa !5
  %105 = load i32, ptr @n, align 4, !tbaa !5
  %106 = shl i32 %105, 1
  %107 = icmp slt i32 %104, %106
  br i1 %107, label %109, label %108

108:                                              ; preds = %103
  store i32 14, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %152

109:                                              ; preds = %103
  %110 = load i32, ptr %8, align 4, !tbaa !5
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [220 x i32], ptr @f, i64 0, i64 %111
  store i32 -1, ptr %112, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  %113 = load i32, ptr %7, align 4, !tbaa !5
  store i32 %113, ptr %9, align 4, !tbaa !5
  br label %114

114:                                              ; preds = %145, %109
  %115 = load i32, ptr %9, align 4, !tbaa !5
  %116 = load i32, ptr %8, align 4, !tbaa !5
  %117 = icmp slt i32 %115, %116
  br i1 %117, label %119, label %118

118:                                              ; preds = %114
  store i32 17, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %148

119:                                              ; preds = %114
  %120 = load i32, ptr %9, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [220 x i32], ptr @f, i64 0, i64 %121
  %123 = load i32, ptr %122, align 4, !tbaa !5
  %124 = icmp ne i32 %123, -1
  br i1 %124, label %125, label %144

125:                                              ; preds = %119
  %126 = load i32, ptr %9, align 4, !tbaa !5
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds [220 x i32], ptr @a, i64 0, i64 %127
  %129 = load i32, ptr %128, align 4, !tbaa !5
  %130 = load i32, ptr %8, align 4, !tbaa !5
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds [220 x i32], ptr @a, i64 0, i64 %131
  %133 = load i32, ptr %132, align 4, !tbaa !5
  %134 = icmp sle i32 %129, %133
  br i1 %134, label %135, label %144

135:                                              ; preds = %125
  %136 = load i32, ptr %8, align 4, !tbaa !5
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds [220 x i32], ptr @f, i64 0, i64 %137
  %139 = load i32, ptr %9, align 4, !tbaa !5
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds [220 x i32], ptr @f, i64 0, i64 %140
  %142 = load i32, ptr %141, align 4, !tbaa !5
  %143 = add nsw i32 %142, 1
  call void @_Z3updRii(ptr noundef nonnull align 4 dereferenceable(4) %138, i32 noundef %143)
  br label %144

144:                                              ; preds = %135, %125, %119
  br label %145

145:                                              ; preds = %144
  %146 = load i32, ptr %9, align 4, !tbaa !5
  %147 = add nsw i32 %146, 1
  store i32 %147, ptr %9, align 4, !tbaa !5
  br label %114, !llvm.loop !16

148:                                              ; preds = %118
  br label %149

149:                                              ; preds = %148
  %150 = load i32, ptr %8, align 4, !tbaa !5
  %151 = add nsw i32 %150, 1
  store i32 %151, ptr %8, align 4, !tbaa !5
  br label %103, !llvm.loop !17

152:                                              ; preds = %108
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %153

153:                                              ; preds = %171, %152
  %154 = load i32, ptr %10, align 4, !tbaa !5
  %155 = load i32, ptr @n, align 4, !tbaa !5
  %156 = icmp slt i32 %154, %155
  br i1 %156, label %158, label %157

157:                                              ; preds = %153
  store i32 20, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %174

158:                                              ; preds = %153
  %159 = load i32, ptr %10, align 4, !tbaa !5
  %160 = load i32, ptr @n, align 4, !tbaa !5
  %161 = add nsw i32 %159, %160
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds [220 x i32], ptr @f, i64 0, i64 %162
  %164 = load i32, ptr %163, align 4, !tbaa !5
  %165 = load i32, ptr %7, align 4, !tbaa !5
  %166 = sext i32 %165 to i64
  %167 = getelementptr inbounds [110 x [110 x i32]], ptr getelementptr inbounds (%struct.Matrix, ptr @A, i32 0, i32 2), i64 0, i64 %166
  %168 = load i32, ptr %10, align 4, !tbaa !5
  %169 = sext i32 %168 to i64
  %170 = getelementptr inbounds [110 x i32], ptr %167, i64 0, i64 %169
  store i32 %164, ptr %170, align 4, !tbaa !5
  br label %171

171:                                              ; preds = %158
  %172 = load i32, ptr %10, align 4, !tbaa !5
  %173 = add nsw i32 %172, 1
  store i32 %173, ptr %10, align 4, !tbaa !5
  br label %153, !llvm.loop !18

174:                                              ; preds = %157
  br label %175

175:                                              ; preds = %174
  %176 = load i32, ptr %7, align 4, !tbaa !5
  %177 = add nsw i32 %176, 1
  store i32 %177, ptr %7, align 4, !tbaa !5
  br label %92, !llvm.loop !19

178:                                              ; preds = %96
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 0, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 48408, ptr %12) #6
  %179 = load i32, ptr @t, align 4, !tbaa !5
  %180 = sub nsw i32 %179, 1
  call void @_ZNK6Matrix3powEi(ptr dead_on_unwind writable sret(%struct.Matrix) align 4 %12, ptr noundef nonnull align 4 dereferenceable(48408) @A, i32 noundef %180)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 @A, ptr align 4 %12, i64 48408, i1 false), !tbaa.struct !20
  call void @llvm.lifetime.end.p0(i64 48408, ptr %12) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %181

181:                                              ; preds = %204, %178
  %182 = load i32, ptr %13, align 4, !tbaa !5
  %183 = load i32, ptr @n, align 4, !tbaa !5
  %184 = icmp slt i32 %182, %183
  br i1 %184, label %186, label %185

185:                                              ; preds = %181
  store i32 23, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %207

186:                                              ; preds = %181
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  store i32 0, ptr %14, align 4, !tbaa !5
  br label %187

187:                                              ; preds = %200, %186
  %188 = load i32, ptr %14, align 4, !tbaa !5
  %189 = load i32, ptr @n, align 4, !tbaa !5
  %190 = icmp slt i32 %188, %189
  br i1 %190, label %192, label %191

191:                                              ; preds = %187
  store i32 26, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %203

192:                                              ; preds = %187
  %193 = load i32, ptr %13, align 4, !tbaa !5
  %194 = sext i32 %193 to i64
  %195 = getelementptr inbounds [110 x [110 x i32]], ptr getelementptr inbounds (%struct.Matrix, ptr @A, i32 0, i32 2), i64 0, i64 %194
  %196 = load i32, ptr %14, align 4, !tbaa !5
  %197 = sext i32 %196 to i64
  %198 = getelementptr inbounds [110 x i32], ptr %195, i64 0, i64 %197
  %199 = load i32, ptr %198, align 4, !tbaa !5
  call void @_Z3updRii(ptr noundef nonnull align 4 dereferenceable(4) %11, i32 noundef %199)
  br label %200

200:                                              ; preds = %192
  %201 = load i32, ptr %14, align 4, !tbaa !5
  %202 = add nsw i32 %201, 1
  store i32 %202, ptr %14, align 4, !tbaa !5
  br label %187, !llvm.loop !22

203:                                              ; preds = %191
  br label %204

204:                                              ; preds = %203
  %205 = load i32, ptr %13, align 4, !tbaa !5
  %206 = add nsw i32 %205, 1
  store i32 %206, ptr %13, align 4, !tbaa !5
  br label %181, !llvm.loop !23

207:                                              ; preds = %185
  %208 = load i32, ptr %11, align 4, !tbaa !5
  %209 = add nsw i32 %208, 1
  %210 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %209)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %211

211:                                              ; preds = %207, %87
  %212 = load i32, ptr %1, align 4
  ret i32 %212
}

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK6Matrix3powEi(ptr dead_on_unwind noalias writable sret(%struct.Matrix) align 4, ptr noundef nonnull align 4 dereferenceable(48408), i32 noundef) #4 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) #5

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 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 #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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = !{!14, !6, i64 4}
!14 = !{!"_ZTS6Matrix", !6, i64 0, !6, i64 4, !7, i64 8}
!15 = !{!14, !6, i64 0}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}
!20 = !{i64 0, i64 4, !5, i64 4, i64 4, !5, i64 8, i64 48400, !21}
!21 = !{!7, !7, i64 0}
!22 = distinct !{!22, !10}
!23 = distinct !{!23, !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"

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

@n = external dso_local global i32, align 4
@t = external dso_local global i32, align 4
@a = external dso_local global [220 x i32], align 16
@f = external dso_local global [220 x i32], align 16
@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 [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z3updRii(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca %struct.Matrix, align 4
  %4 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @t)
  %5 = load i32, ptr @n, align 4, !tbaa !5
  %6 = icmp sgt i32 %5, 0
  br i1 %6, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %0
  %7 = phi i32 [ %5, %0 ], [ %14, %.lr.ph ]
  %8 = load i32, ptr @t, align 4, !tbaa !5
  %9 = icmp eq i32 %8, 1
  %10 = icmp sgt i32 %7, 0
  br i1 %9, label %21, label %39

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %11 = getelementptr inbounds i32, ptr @a, i64 %indvars.iv
  %12 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %11)
  %13 = load i32, ptr %11, align 4, !tbaa !5
  %14 = load i32, ptr @n, align 4, !tbaa !5
  %15 = trunc nuw nsw i64 %indvars.iv to i32
  %16 = add nsw i32 %14, %15
  %17 = sext i32 %16 to i64
  %18 = getelementptr inbounds [220 x i32], ptr @a, i64 0, i64 %17
  store i32 %13, ptr %18, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %19 = sext i32 %14 to i64
  %20 = icmp slt i64 %indvars.iv.next, %19
  br i1 %20, label %.lr.ph, label %._crit_edge, !llvm.loop !9

21:                                               ; preds = %._crit_edge
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  store i32 0, ptr %1, align 4, !tbaa !5
  br i1 %10, label %.lr.ph86, label %._crit_edge87

._crit_edge87.loopexit:                           ; preds = %._crit_edge83
  %.pre124 = load i32, ptr %1, align 4, !tbaa !5
  br label %._crit_edge87

._crit_edge87:                                    ; preds = %._crit_edge87.loopexit, %21
  %22 = phi i32 [ %.pre124, %._crit_edge87.loopexit ], [ 0, %21 ]
  %23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %22)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  br label %88

.lr.ph86:                                         ; preds = %21, %._crit_edge83
  %indvars.iv118 = phi i64 [ %indvars.iv.next119, %._crit_edge83 ], [ 0, %21 ]
  %24 = getelementptr inbounds [220 x i32], ptr @f, i64 0, i64 %indvars.iv118
  store i32 1, ptr %24, align 4, !tbaa !5
  %.not88 = icmp eq i64 %indvars.iv118, 0
  br i1 %.not88, label %._crit_edge83, label %.lr.ph82

.lr.ph82:                                         ; preds = %.lr.ph86
  %25 = getelementptr inbounds [220 x i32], ptr @a, i64 0, i64 %indvars.iv118
  br label %30

._crit_edge83.loopexit:                           ; preds = %38
  %.pre123 = load i32, ptr %24, align 4, !tbaa !5
  br label %._crit_edge83

._crit_edge83:                                    ; preds = %._crit_edge83.loopexit, %.lr.ph86
  %26 = phi i32 [ %.pre123, %._crit_edge83.loopexit ], [ 1, %.lr.ph86 ]
  call void @_Z3updRii(ptr noundef nonnull align 4 dereferenceable(4) %1, i32 noundef %26)
  %indvars.iv.next119 = add nuw nsw i64 %indvars.iv118, 1
  %27 = load i32, ptr @n, align 4, !tbaa !5
  %28 = sext i32 %27 to i64
  %29 = icmp slt i64 %indvars.iv.next119, %28
  br i1 %29, label %.lr.ph86, label %._crit_edge87.loopexit, !llvm.loop !11

30:                                               ; preds = %.lr.ph82, %38
  %indvars.iv114 = phi i64 [ 0, %.lr.ph82 ], [ %indvars.iv.next115, %38 ]
  %31 = getelementptr inbounds [220 x i32], ptr @a, i64 0, i64 %indvars.iv114
  %32 = load i32, ptr %31, align 4, !tbaa !5
  %33 = load i32, ptr %25, align 4, !tbaa !5
  %.not57 = icmp sgt i32 %32, %33
  br i1 %.not57, label %38, label %34

34:                                               ; preds = %30
  %35 = getelementptr inbounds [220 x i32], ptr @f, i64 0, i64 %indvars.iv114
  %36 = load i32, ptr %35, align 4, !tbaa !5
  %37 = add nsw i32 %36, 1
  call void @_Z3updRii(ptr noundef nonnull align 4 dereferenceable(4) %24, i32 noundef %37)
  br label %38

38:                                               ; preds = %30, %34
  %indvars.iv.next115 = add nuw nsw i64 %indvars.iv114, 1
  %exitcond117.not = icmp eq i64 %indvars.iv.next115, %indvars.iv118
  br i1 %exitcond117.not, label %._crit_edge83.loopexit, label %30, !llvm.loop !12

39:                                               ; preds = %._crit_edge
  store i32 %7, ptr getelementptr inbounds (i8, ptr @A, i64 4), align 4, !tbaa !13
  store i32 %7, ptr @A, align 4, !tbaa !15
  br i1 %10, label %.lr.ph73, label %._crit_edge74

.loopexit:                                        ; preds = %.lr.ph70.preheader, %.preheader58
  %40 = sext i32 %52 to i64
  %41 = icmp slt i64 %indvars.iv.next94, %40
  %indvars.iv.next99 = add nuw nsw i64 %indvars.iv98, 1
  br i1 %41, label %.lr.ph73, label %._crit_edge74.loopexit, !llvm.loop !16

._crit_edge74.loopexit:                           ; preds = %.loopexit
  %.pre121 = load i32, ptr @t, align 4, !tbaa !5
  br label %._crit_edge74

._crit_edge74:                                    ; preds = %._crit_edge74.loopexit, %39
  %42 = phi i32 [ %.pre121, %._crit_edge74.loopexit ], [ %8, %39 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  store i32 0, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 48408, ptr nonnull %3) #6
  %43 = add nsw i32 %42, -1
  call void @_ZNK6Matrix3powEi(ptr dead_on_unwind nonnull writable sret(%struct.Matrix) align 4 %3, ptr noundef nonnull align 4 dereferenceable(48408) @A, i32 noundef %43)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(48408) @A, ptr noundef nonnull align 4 dereferenceable(48408) %3, i64 48408, i1 false), !tbaa.struct !17
  call void @llvm.lifetime.end.p0(i64 48408, ptr nonnull %3) #6
  %44 = load i32, ptr @n, align 4, !tbaa !5
  %45 = icmp sgt i32 %44, 0
  br i1 %45, label %.preheader, label %._crit_edge79

.lr.ph73:                                         ; preds = %39, %.loopexit
  %46 = phi i32 [ %52, %.loopexit ], [ %7, %39 ]
  %indvars.iv98 = phi i64 [ %indvars.iv.next99, %.loopexit ], [ 1, %39 ]
  %indvars.iv93 = phi i64 [ %indvars.iv.next94, %.loopexit ], [ 0, %39 ]
  %47 = mul nuw nsw i64 %indvars.iv93, 440
  %gep = getelementptr i8, ptr getelementptr inbounds (i8, ptr @A, i64 8), i64 %47
  %48 = getelementptr inbounds [220 x i32], ptr @f, i64 0, i64 %indvars.iv93
  store i32 0, ptr %48, align 4, !tbaa !5
  %indvars.iv.next94 = add nuw nsw i64 %indvars.iv93, 1
  %49 = shl i32 %46, 1
  %50 = sext i32 %49 to i64
  %51 = icmp slt i64 %indvars.iv.next94, %50
  br i1 %51, label %.lr.ph67, label %.preheader58

.preheader58:                                     ; preds = %._crit_edge64, %.lr.ph73
  %52 = phi i32 [ %46, %.lr.ph73 ], [ %61, %._crit_edge64 ]
  %.lcssa = phi i32 [ %46, %.lr.ph73 ], [ %62, %._crit_edge64 ]
  %53 = icmp sgt i32 %.lcssa, 0
  br i1 %53, label %.lr.ph70.preheader, label %.loopexit

.lr.ph70.preheader:                               ; preds = %.preheader58
  %54 = zext nneg i32 %.lcssa to i64
  %55 = shl nuw nsw i64 %54, 2
  %scevgep103 = getelementptr i8, ptr @f, i64 %55
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 4 %gep, ptr align 4 %scevgep103, i64 %55, i1 false), !tbaa !5
  br label %.loopexit

.lr.ph67:                                         ; preds = %.lr.ph73, %._crit_edge64
  %56 = phi i32 [ %61, %._crit_edge64 ], [ %46, %.lr.ph73 ]
  %57 = phi i32 [ %62, %._crit_edge64 ], [ %46, %.lr.ph73 ]
  %indvars.iv100 = phi i64 [ %indvars.iv.next101, %._crit_edge64 ], [ %indvars.iv98, %.lr.ph73 ]
  %58 = getelementptr inbounds [220 x i32], ptr @f, i64 0, i64 %indvars.iv100
  store i32 -1, ptr %58, align 4, !tbaa !5
  %59 = icmp ult i64 %indvars.iv93, %indvars.iv100
  br i1 %59, label %.lr.ph63, label %._crit_edge64

.lr.ph63:                                         ; preds = %.lr.ph67
  %60 = getelementptr inbounds [220 x i32], ptr @a, i64 0, i64 %indvars.iv100
  br label %66

._crit_edge64.loopexit:                           ; preds = %75
  %.pre = load i32, ptr @n, align 4, !tbaa !5
  br label %._crit_edge64

._crit_edge64:                                    ; preds = %._crit_edge64.loopexit, %.lr.ph67
  %61 = phi i32 [ %.pre, %._crit_edge64.loopexit ], [ %56, %.lr.ph67 ]
  %62 = phi i32 [ %.pre, %._crit_edge64.loopexit ], [ %57, %.lr.ph67 ]
  %indvars.iv.next101 = add nuw nsw i64 %indvars.iv100, 1
  %63 = shl i32 %62, 1
  %64 = trunc nuw i64 %indvars.iv.next101 to i32
  %65 = icmp sgt i32 %63, %64
  br i1 %65, label %.lr.ph67, label %.preheader58, !llvm.loop !19

66:                                               ; preds = %.lr.ph63, %75
  %indvars.iv95 = phi i64 [ %indvars.iv93, %.lr.ph63 ], [ %indvars.iv.next96, %75 ]
  %67 = getelementptr inbounds [220 x i32], ptr @f, i64 0, i64 %indvars.iv95
  %68 = load i32, ptr %67, align 4, !tbaa !5
  %.not = icmp eq i32 %68, -1
  br i1 %.not, label %75, label %69

69:                                               ; preds = %66
  %70 = getelementptr inbounds [220 x i32], ptr @a, i64 0, i64 %indvars.iv95
  %71 = load i32, ptr %70, align 4, !tbaa !5
  %72 = load i32, ptr %60, align 4, !tbaa !5
  %.not56 = icmp sgt i32 %71, %72
  br i1 %.not56, label %75, label %73

73:                                               ; preds = %69
  %74 = add nuw nsw i32 %68, 1
  tail call void @_Z3updRii(ptr noundef nonnull align 4 dereferenceable(4) %58, i32 noundef %74)
  br label %75

75:                                               ; preds = %66, %69, %73
  %indvars.iv.next96 = add nuw nsw i64 %indvars.iv95, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next96, %indvars.iv100
  br i1 %exitcond.not, label %._crit_edge64.loopexit, label %66, !llvm.loop !20

.preheader:                                       ; preds = %._crit_edge74, %._crit_edge77
  %76 = phi i32 [ %81, %._crit_edge77 ], [ %44, %._crit_edge74 ]
  %indvars.iv111 = phi i64 [ %indvars.iv.next112, %._crit_edge77 ], [ 0, %._crit_edge74 ]
  %77 = icmp sgt i32 %76, 0
  br i1 %77, label %.lr.ph76, label %.preheader.._crit_edge77_crit_edge

.preheader.._crit_edge77_crit_edge:               ; preds = %.preheader
  %.pre125 = sext i32 %76 to i64
  br label %._crit_edge77

._crit_edge79.loopexit:                           ; preds = %._crit_edge77
  %.pre122 = load i32, ptr %2, align 4, !tbaa !5
  %78 = add nsw i32 %.pre122, 1
  br label %._crit_edge79

._crit_edge79:                                    ; preds = %._crit_edge79.loopexit, %._crit_edge74
  %79 = phi i32 [ %78, %._crit_edge79.loopexit ], [ 1, %._crit_edge74 ]
  %80 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %79)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  br label %88

._crit_edge77:                                    ; preds = %.lr.ph76, %.preheader.._crit_edge77_crit_edge
  %.pre-phi = phi i64 [ %.pre125, %.preheader.._crit_edge77_crit_edge ], [ %86, %.lr.ph76 ]
  %81 = phi i32 [ %76, %.preheader.._crit_edge77_crit_edge ], [ %85, %.lr.ph76 ]
  %indvars.iv.next112 = add nuw nsw i64 %indvars.iv111, 1
  %82 = icmp slt i64 %indvars.iv.next112, %.pre-phi
  br i1 %82, label %.preheader, label %._crit_edge79.loopexit, !llvm.loop !21

.lr.ph76:                                         ; preds = %.preheader, %.lr.ph76
  %indvars.iv108 = phi i64 [ %indvars.iv.next109, %.lr.ph76 ], [ 0, %.preheader ]
  %83 = getelementptr inbounds [110 x [110 x i32]], ptr getelementptr inbounds (i8, ptr @A, i64 8), i64 0, i64 %indvars.iv111, i64 %indvars.iv108
  %84 = load i32, ptr %83, align 4, !tbaa !5
  call void @_Z3updRii(ptr noundef nonnull align 4 dereferenceable(4) %2, i32 noundef %84)
  %indvars.iv.next109 = add nuw nsw i64 %indvars.iv108, 1
  %85 = load i32, ptr @n, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = icmp slt i64 %indvars.iv.next109, %86
  br i1 %87, label %.lr.ph76, label %._crit_edge77, !llvm.loop !23

88:                                               ; preds = %._crit_edge79, %._crit_edge87
  ret i32 0
}

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK6Matrix3powEi(ptr dead_on_unwind noalias writable sret(%struct.Matrix) align 4, ptr noundef nonnull align 4 dereferenceable(48408), i32 noundef) local_unnamed_addr #4 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) #5

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 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 #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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = !{!14, !6, i64 4}
!14 = !{!"_ZTS6Matrix", !6, i64 0, !6, i64 4, !7, i64 8}
!15 = !{!14, !6, i64 0}
!16 = distinct !{!16, !10}
!17 = !{i64 0, i64 4, !5, i64 4, i64 4, !5, i64 8, i64 48400, !18}
!18 = !{!7, !7, i64 0}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10}
!21 = distinct !{!21, !10, !22}
!22 = !{!"llvm.loop.unswitch.partial.disable"}
!23 = distinct !{!23, !10}


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