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

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

@iact = external dso_local global [62 x i32], align 16
@deg = external dso_local global i32, align 4
@val = external dso_local global [62 x i32], align 16
@nxt = external dso_local global [62 x i32], align 16
@seq = external dso_local global [62 x i32], align 16
@n = external dso_local global i64, align 8
@m = external dso_local global i64, align 8
@A = external dso_local global %struct.Matrix, align 4
@.str = external hidden unnamed_addr constant [9 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z5valuei(i32 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 norecurse uwtable
define dso_local noundef i32 @main() #2 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i64, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i64, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca %struct.Matrix, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca %struct.Matrix, align 4
  store i32 0, ptr %1, align 4
  store i32 0, ptr @iact, align 16, !tbaa !5
  store i32 1, ptr getelementptr inbounds ([62 x i32], ptr @iact, i64 0, i64 1), align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #8
  store i32 2, ptr %2, align 4, !tbaa !5
  br label %19

19:                                               ; preds = %40, %0
  %20 = load i32, ptr %2, align 4, !tbaa !5
  %21 = icmp sle i32 %20, 61
  br i1 %21, label %23, label %22

22:                                               ; preds = %19
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #8
  br label %43

23:                                               ; preds = %19
  %24 = load i32, ptr %2, align 4, !tbaa !5
  %25 = sdiv i32 1000000007, %24
  %26 = sext i32 %25 to i64
  %27 = load i32, ptr %2, align 4, !tbaa !5
  %28 = srem i32 1000000007, %27
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds [62 x i32], ptr @iact, i64 0, i64 %29
  %31 = load i32, ptr %30, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = mul nsw i64 %26, %32
  %34 = srem i64 %33, 1000000007
  %35 = sub nsw i64 1000000007, %34
  %36 = trunc i64 %35 to i32
  %37 = load i32, ptr %2, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [62 x i32], ptr @iact, i64 0, i64 %38
  store i32 %36, ptr %39, align 4, !tbaa !5
  br label %40

40:                                               ; preds = %23
  %41 = load i32, ptr %2, align 4, !tbaa !5
  %42 = add nsw i32 %41, 1
  store i32 %42, ptr %2, align 4, !tbaa !5
  br label %19, !llvm.loop !9

43:                                               ; preds = %22
  store i32 1, ptr @iact, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #8
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %44

44:                                               ; preds = %66, %43
  %45 = load i32, ptr %3, align 4, !tbaa !5
  %46 = icmp sle i32 %45, 61
  br i1 %46, label %48, label %47

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

48:                                               ; preds = %44
  %49 = load i32, ptr %3, align 4, !tbaa !5
  %50 = sub nsw i32 %49, 1
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [62 x i32], ptr @iact, i64 0, i64 %51
  %53 = load i32, ptr %52, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = load i32, ptr %3, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [62 x i32], ptr @iact, i64 0, i64 %56
  %58 = load i32, ptr %57, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %60 = mul nsw i64 %54, %59
  %61 = srem i64 %60, 1000000007
  %62 = trunc i64 %61 to i32
  %63 = load i32, ptr %3, align 4, !tbaa !5
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [62 x i32], ptr @iact, i64 0, i64 %64
  store i32 %62, ptr %65, align 4, !tbaa !5
  br label %66

66:                                               ; preds = %48
  %67 = load i32, ptr %3, align 4, !tbaa !5
  %68 = add nsw i32 %67, 1
  store i32 %68, ptr %3, align 4, !tbaa !5
  br label %44, !llvm.loop !11

69:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #8
  %70 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @m)
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #8
  %71 = load i64, ptr @n, align 8, !tbaa !12
  %72 = shl i64 %71, 1
  %73 = sub nsw i64 %72, 1
  store i64 %73, ptr %5, align 8, !tbaa !12
  store i32 1, ptr @val, align 16, !tbaa !5
  store i32 1, ptr @deg, align 4, !tbaa !5
  store i32 1, ptr %4, align 4, !tbaa !5
  br label %74

74:                                               ; preds = %139, %69
  %75 = load i64, ptr %5, align 8, !tbaa !12
  %76 = add nsw i64 %75, -1
  store i64 %76, ptr %5, align 8, !tbaa !12
  %77 = icmp sge i64 %76, 0
  br i1 %77, label %78, label %142

78:                                               ; preds = %74
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #8
  store i32 0, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #8
  %79 = load i64, ptr %5, align 8, !tbaa !12
  %80 = and i64 %79, 1
  %81 = trunc i64 %80 to i32
  store i32 %81, ptr %7, align 4, !tbaa !5
  br label %82

82:                                               ; preds = %105, %78
  %83 = load i32, ptr %6, align 4, !tbaa !5
  %84 = load i32, ptr @deg, align 4, !tbaa !5
  %85 = icmp sle i32 %83, %84
  br i1 %85, label %87, label %86

86:                                               ; preds = %82
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #8
  br label %110

87:                                               ; preds = %82
  %88 = load i32, ptr %6, align 4, !tbaa !5
  %89 = icmp sgt i32 %88, 0
  br i1 %89, label %90, label %96

90:                                               ; preds = %87
  %91 = load i32, ptr %6, align 4, !tbaa !5
  %92 = sub nsw i32 %91, 1
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [62 x i32], ptr @nxt, i64 0, i64 %93
  %95 = load i32, ptr %94, align 4, !tbaa !5
  br label %97

96:                                               ; preds = %87
  br label %97

97:                                               ; preds = %96, %90
  %98 = phi i32 [ %95, %90 ], [ 0, %96 ]
  %99 = load i32, ptr %7, align 4, !tbaa !5
  %100 = call noundef i32 @_Z5valuei(i32 noundef %99)
  %101 = call noundef i32 @_Z7mod_addii(i32 noundef %98, i32 noundef %100)
  %102 = load i32, ptr %6, align 4, !tbaa !5
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds [62 x i32], ptr @nxt, i64 0, i64 %103
  store i32 %101, ptr %104, align 4, !tbaa !5
  br label %105

105:                                              ; preds = %97
  %106 = load i32, ptr %6, align 4, !tbaa !5
  %107 = add nsw i32 %106, 1
  store i32 %107, ptr %6, align 4, !tbaa !5
  %108 = load i32, ptr %7, align 4, !tbaa !5
  %109 = call noundef i32 @_Z7mod_addii(i32 noundef %108, i32 noundef 2)
  store i32 %109, ptr %7, align 4, !tbaa !5
  br label %82, !llvm.loop !14

110:                                              ; preds = %86
  %111 = load i32, ptr @deg, align 4, !tbaa !5
  %112 = add nsw i32 %111, 1
  store i32 %112, ptr @deg, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #8
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %113

113:                                              ; preds = %126, %110
  %114 = load i32, ptr %8, align 4, !tbaa !5
  %115 = load i32, ptr @deg, align 4, !tbaa !5
  %116 = icmp slt i32 %114, %115
  br i1 %116, label %118, label %117

117:                                              ; preds = %113
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #8
  br label %129

118:                                              ; preds = %113
  %119 = load i32, ptr %8, align 4, !tbaa !5
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds [62 x i32], ptr @nxt, i64 0, i64 %120
  %122 = load i32, ptr %121, align 4, !tbaa !5
  %123 = load i32, ptr %8, align 4, !tbaa !5
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds [62 x i32], ptr @val, i64 0, i64 %124
  store i32 %122, ptr %125, align 4, !tbaa !5
  br label %126

126:                                              ; preds = %118
  %127 = load i32, ptr %8, align 4, !tbaa !5
  %128 = add nsw i32 %127, 1
  store i32 %128, ptr %8, align 4, !tbaa !5
  br label %113, !llvm.loop !15

129:                                              ; preds = %117
  %130 = load i64, ptr %5, align 8, !tbaa !12
  %131 = ashr i64 %130, 1
  store i64 %131, ptr %5, align 8, !tbaa !12
  %132 = load i64, ptr %5, align 8, !tbaa !12
  %133 = srem i64 %132, 1000000007
  %134 = trunc i64 %133 to i32
  %135 = call noundef i32 @_Z5valuei(i32 noundef %134)
  %136 = load i32, ptr %4, align 4, !tbaa !5
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds [62 x i32], ptr @seq, i64 0, i64 %137
  store i32 %135, ptr %138, align 4, !tbaa !5
  br label %139

139:                                              ; preds = %129
  %140 = load i32, ptr %4, align 4, !tbaa !5
  %141 = add nsw i32 %140, 1
  store i32 %141, ptr %4, align 4, !tbaa !5
  br label %74, !llvm.loop !16

142:                                              ; preds = %74
  %143 = load i32, ptr %4, align 4, !tbaa !5
  %144 = add nsw i32 %143, -1
  store i32 %144, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #8
  %145 = load i64, ptr @n, align 8, !tbaa !12
  %146 = sub nsw i64 %145, 1
  store i64 %146, ptr %9, align 8, !tbaa !12
  store i32 1, ptr @val, align 16, !tbaa !5
  store i32 1, ptr @deg, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #8
  store i32 1, ptr %10, align 4, !tbaa !5
  br label %147

147:                                              ; preds = %218, %142
  %148 = load i64, ptr %9, align 8, !tbaa !12
  %149 = add nsw i64 %148, -1
  store i64 %149, ptr %9, align 8, !tbaa !12
  %150 = icmp sge i64 %149, 0
  br i1 %150, label %152, label %151

151:                                              ; preds = %147
  store i32 17, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  br label %221

152:                                              ; preds = %147
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #8
  store i32 0, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #8
  %153 = load i64, ptr %9, align 8, !tbaa !12
  %154 = and i64 %153, 1
  %155 = trunc i64 %154 to i32
  store i32 %155, ptr %13, align 4, !tbaa !5
  br label %156

156:                                              ; preds = %179, %152
  %157 = load i32, ptr %12, align 4, !tbaa !5
  %158 = load i32, ptr @deg, align 4, !tbaa !5
  %159 = icmp sle i32 %157, %158
  br i1 %159, label %161, label %160

160:                                              ; preds = %156
  store i32 20, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  br label %184

161:                                              ; preds = %156
  %162 = load i32, ptr %12, align 4, !tbaa !5
  %163 = icmp sgt i32 %162, 0
  br i1 %163, label %164, label %170

164:                                              ; preds = %161
  %165 = load i32, ptr %12, align 4, !tbaa !5
  %166 = sub nsw i32 %165, 1
  %167 = sext i32 %166 to i64
  %168 = getelementptr inbounds [62 x i32], ptr @nxt, i64 0, i64 %167
  %169 = load i32, ptr %168, align 4, !tbaa !5
  br label %171

170:                                              ; preds = %161
  br label %171

171:                                              ; preds = %170, %164
  %172 = phi i32 [ %169, %164 ], [ 0, %170 ]
  %173 = load i32, ptr %13, align 4, !tbaa !5
  %174 = call noundef i32 @_Z5valuei(i32 noundef %173)
  %175 = call noundef i32 @_Z7mod_addii(i32 noundef %172, i32 noundef %174)
  %176 = load i32, ptr %12, align 4, !tbaa !5
  %177 = sext i32 %176 to i64
  %178 = getelementptr inbounds [62 x i32], ptr @nxt, i64 0, i64 %177
  store i32 %175, ptr %178, align 4, !tbaa !5
  br label %179

179:                                              ; preds = %171
  %180 = load i32, ptr %12, align 4, !tbaa !5
  %181 = add nsw i32 %180, 1
  store i32 %181, ptr %12, align 4, !tbaa !5
  %182 = load i32, ptr %13, align 4, !tbaa !5
  %183 = call noundef i32 @_Z7mod_addii(i32 noundef %182, i32 noundef 2)
  store i32 %183, ptr %13, align 4, !tbaa !5
  br label %156, !llvm.loop !17

184:                                              ; preds = %160
  %185 = load i32, ptr @deg, align 4, !tbaa !5
  %186 = add nsw i32 %185, 1
  store i32 %186, ptr @deg, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #8
  store i32 0, ptr %14, align 4, !tbaa !5
  br label %187

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

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

192:                                              ; preds = %187
  %193 = load i32, ptr %14, align 4, !tbaa !5
  %194 = sext i32 %193 to i64
  %195 = getelementptr inbounds [62 x i32], ptr @nxt, i64 0, i64 %194
  %196 = load i32, ptr %195, align 4, !tbaa !5
  %197 = load i32, ptr %14, align 4, !tbaa !5
  %198 = sext i32 %197 to i64
  %199 = getelementptr inbounds [62 x i32], ptr @val, i64 0, i64 %198
  store i32 %196, ptr %199, align 4, !tbaa !5
  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 !18

203:                                              ; preds = %191
  %204 = load i64, ptr %9, align 8, !tbaa !12
  %205 = ashr i64 %204, 1
  store i64 %205, ptr %9, align 8, !tbaa !12
  %206 = load i32, ptr %10, align 4, !tbaa !5
  %207 = sext i32 %206 to i64
  %208 = getelementptr inbounds [62 x i32], ptr @seq, i64 0, i64 %207
  %209 = load i32, ptr %208, align 4, !tbaa !5
  %210 = load i64, ptr %9, align 8, !tbaa !12
  %211 = srem i64 %210, 1000000007
  %212 = trunc i64 %211 to i32
  %213 = call noundef i32 @_Z5valuei(i32 noundef %212)
  %214 = call noundef i32 @_Z7mod_decii(i32 noundef %209, i32 noundef %213)
  %215 = load i32, ptr %10, align 4, !tbaa !5
  %216 = sext i32 %215 to i64
  %217 = getelementptr inbounds [62 x i32], ptr @seq, i64 0, i64 %216
  store i32 %214, ptr %217, align 4, !tbaa !5
  br label %218

218:                                              ; preds = %203
  %219 = load i32, ptr %10, align 4, !tbaa !5
  %220 = add nsw i32 %219, 1
  store i32 %220, ptr %10, align 4, !tbaa !5
  br label %147, !llvm.loop !19

221:                                              ; preds = %151
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #8
  call void @llvm.lifetime.start.p0(i64 14892, ptr %15) #8
  call void @llvm.memset.p0.i64(ptr align 4 %15, i8 0, i64 14892, i1 false)
  %222 = getelementptr inbounds %struct.Matrix, ptr %15, i32 0, i32 0
  %223 = load i32, ptr %4, align 4, !tbaa !5
  store i32 %223, ptr %222, align 4, !tbaa !20
  %224 = getelementptr inbounds %struct.Matrix, ptr %15, i32 0, i32 1
  %225 = load i32, ptr %4, align 4, !tbaa !5
  store i32 %225, ptr %224, align 4, !tbaa !22
  %226 = getelementptr inbounds %struct.Matrix, ptr %15, i32 0, i32 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 @A, ptr align 4 %15, i64 14892, i1 false), !tbaa.struct !23
  call void @llvm.lifetime.end.p0(i64 14892, ptr %15) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #8
  store i32 1, ptr %16, align 4, !tbaa !5
  br label %227

227:                                              ; preds = %240, %221
  %228 = load i32, ptr %16, align 4, !tbaa !5
  %229 = load i32, ptr %4, align 4, !tbaa !5
  %230 = icmp slt i32 %228, %229
  br i1 %230, label %232, label %231

231:                                              ; preds = %227
  store i32 26, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #8
  br label %243

232:                                              ; preds = %227
  %233 = load i32, ptr %16, align 4, !tbaa !5
  %234 = sext i32 %233 to i64
  %235 = getelementptr inbounds [61 x [61 x i32]], ptr getelementptr inbounds (%struct.Matrix, ptr @A, i32 0, i32 2), i64 0, i64 %234
  %236 = load i32, ptr %16, align 4, !tbaa !5
  %237 = sub nsw i32 %236, 1
  %238 = sext i32 %237 to i64
  %239 = getelementptr inbounds [61 x i32], ptr %235, i64 0, i64 %238
  store i32 1, ptr %239, align 4, !tbaa !5
  br label %240

240:                                              ; preds = %232
  %241 = load i32, ptr %16, align 4, !tbaa !5
  %242 = add nsw i32 %241, 1
  store i32 %242, ptr %16, align 4, !tbaa !5
  br label %227, !llvm.loop !25

243:                                              ; preds = %231
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #8
  store i32 0, ptr %17, align 4, !tbaa !5
  br label %244

244:                                              ; preds = %263, %243
  %245 = load i32, ptr %17, align 4, !tbaa !5
  %246 = load i32, ptr %4, align 4, !tbaa !5
  %247 = icmp slt i32 %245, %246
  br i1 %247, label %249, label %248

248:                                              ; preds = %244
  store i32 29, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #8
  br label %266

249:                                              ; preds = %244
  %250 = load i32, ptr %4, align 4, !tbaa !5
  %251 = load i32, ptr %17, align 4, !tbaa !5
  %252 = sub nsw i32 %250, %251
  %253 = sext i32 %252 to i64
  %254 = getelementptr inbounds [62 x i32], ptr @seq, i64 0, i64 %253
  %255 = load i32, ptr %254, align 4, !tbaa !5
  %256 = load i32, ptr %17, align 4, !tbaa !5
  %257 = sext i32 %256 to i64
  %258 = getelementptr inbounds [61 x [61 x i32]], ptr getelementptr inbounds (%struct.Matrix, ptr @A, i32 0, i32 2), i64 0, i64 %257
  %259 = load i32, ptr %4, align 4, !tbaa !5
  %260 = sub nsw i32 %259, 1
  %261 = sext i32 %260 to i64
  %262 = getelementptr inbounds [61 x i32], ptr %258, i64 0, i64 %261
  store i32 %255, ptr %262, align 4, !tbaa !5
  br label %263

263:                                              ; preds = %249
  %264 = load i32, ptr %17, align 4, !tbaa !5
  %265 = add nsw i32 %264, 1
  store i32 %265, ptr %17, align 4, !tbaa !5
  br label %244, !llvm.loop !26

266:                                              ; preds = %248
  call void @llvm.lifetime.start.p0(i64 14892, ptr %18) #8
  %267 = load i64, ptr @m, align 8, !tbaa !12
  call void @_ZN6Matrix3powEx(ptr dead_on_unwind writable sret(%struct.Matrix) align 4 %18, ptr noundef nonnull align 4 dereferenceable(14892) @A, i64 noundef %267)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 @A, ptr align 4 %18, i64 14892, i1 false), !tbaa.struct !23
  call void @llvm.lifetime.end.p0(i64 14892, ptr %18) #8
  %268 = load i32, ptr %4, align 4, !tbaa !5
  %269 = sub nsw i32 %268, 1
  %270 = sext i32 %269 to i64
  %271 = getelementptr inbounds [61 x [61 x i32]], ptr getelementptr inbounds (%struct.Matrix, ptr @A, i32 0, i32 2), i64 0, i64 %270
  %272 = load i32, ptr %4, align 4, !tbaa !5
  %273 = sub nsw i32 %272, 1
  %274 = sext i32 %273 to i64
  %275 = getelementptr inbounds [61 x i32], ptr %271, i64 0, i64 %274
  %276 = load i32, ptr %275, align 4, !tbaa !5
  %277 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %276)
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #8
  ret i32 0
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z7mod_addii(i32 noundef, i32 noundef) #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z7mod_decii(i32 noundef, i32 noundef) #4

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5

; 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) #6

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6Matrix3powEx(ptr dead_on_unwind noalias writable sret(%struct.Matrix) align 4, ptr noundef nonnull align 4 dereferenceable(14892), i64 noundef) #7 align 2

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

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 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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { 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 #8 = { nounwind }

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

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

@iact = external dso_local local_unnamed_addr global [62 x i32], align 16
@deg = external dso_local local_unnamed_addr global i32, align 4
@val = external dso_local local_unnamed_addr global [62 x i32], align 16
@nxt = external dso_local local_unnamed_addr global [62 x i32], align 16
@seq = external dso_local local_unnamed_addr global [62 x i32], align 16
@n = external dso_local global i64, align 8
@m = external dso_local global i64, align 8
@A = external dso_local global %struct.Matrix, align 4
@.str = external hidden unnamed_addr constant [9 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z5valuei(i32 noundef) local_unnamed_addr #0

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

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

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

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

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

17:                                               ; preds = %23
  %18 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @m)
  %19 = load i64, ptr @n, align 8, !tbaa !11
  %20 = shl i64 %19, 1
  store i32 1, ptr @val, align 16, !tbaa !5
  store i32 1, ptr @deg, align 4, !tbaa !5
  %21 = icmp sgt i64 %20, 1
  br i1 %21, label %.lr.ph98.preheader, label %._crit_edge99

.lr.ph98.preheader:                               ; preds = %17
  %22 = add nsw i64 %20, -2
  br label %.lr.ph98

23:                                               ; preds = %31, %2
  %24 = phi i64 [ 1, %2 ], [ %36, %31 ]
  %indvars.iv128 = phi i64 [ 1, %2 ], [ %indvars.iv.next129.1, %31 ]
  %25 = getelementptr inbounds [62 x i32], ptr @iact, i64 0, i64 %indvars.iv128
  %26 = load i32, ptr %25, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %28 = mul nsw i64 %24, %27
  %29 = srem i64 %28, 1000000007
  %30 = trunc nsw i64 %29 to i32
  store i32 %30, ptr %25, align 4, !tbaa !5
  %indvars.iv.next129 = add nuw nsw i64 %indvars.iv128, 1
  %exitcond131.not = icmp eq i64 %indvars.iv.next129, 62
  br i1 %exitcond131.not, label %17, label %31, !llvm.loop !13

31:                                               ; preds = %23
  %32 = getelementptr inbounds [62 x i32], ptr @iact, i64 0, i64 %indvars.iv.next129
  %33 = load i32, ptr %32, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = mul nsw i64 %29, %34
  %36 = srem i64 %35, 1000000007
  %37 = trunc nsw i64 %36 to i32
  store i32 %37, ptr %32, align 4, !tbaa !5
  %indvars.iv.next129.1 = add nuw nsw i64 %indvars.iv128, 2
  br label %23

.lr.ph98thread-pre-split:                         ; preds = %._crit_edge95
  %38 = add nsw i64 %60, -1
  %.pr = load i32, ptr @deg, align 4, !tbaa !5
  br label %.lr.ph98

.lr.ph98:                                         ; preds = %.lr.ph98thread-pre-split, %.lr.ph98.preheader
  %39 = phi i32 [ %.pr, %.lr.ph98thread-pre-split ], [ 1, %.lr.ph98.preheader ]
  %indvars.iv139 = phi i64 [ %indvars.iv.next140, %.lr.ph98thread-pre-split ], [ 1, %.lr.ph98.preheader ]
  %40 = phi i64 [ %38, %.lr.ph98thread-pre-split ], [ %22, %.lr.ph98.preheader ]
  %.not8188 = icmp slt i32 %39, 0
  br i1 %.not8188, label %._crit_edge.thread, label %.lr.ph.preheader

._crit_edge.thread:                               ; preds = %.lr.ph98
  %41 = add nsw i32 %39, 1
  store i32 %41, ptr @deg, align 4, !tbaa !5
  br label %._crit_edge95

.lr.ph.preheader:                                 ; preds = %.lr.ph98
  %42 = trunc i64 %40 to i32
  %43 = and i32 %42, 1
  %44 = tail call noundef i32 @_Z5valuei(i32 noundef %43)
  %45 = tail call noundef i32 @_Z7mod_addii(i32 noundef 0, i32 noundef %44)
  store i32 %45, ptr @nxt, align 16, !tbaa !5
  %46 = tail call noundef i32 @_Z7mod_addii(i32 noundef %43, i32 noundef 2)
  %47 = load i32, ptr @deg, align 4, !tbaa !5
  %.not81.not.peel = icmp sgt i32 %47, 0
  br i1 %.not81.not.peel, label %.lr.ph.peel.next, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph.peel.next, %.lr.ph.preheader
  %.lcssa85 = phi i32 [ %47, %.lr.ph.preheader ], [ %58, %.lr.ph.peel.next ]
  %48 = add i32 %.lcssa85, 1
  store i32 %48, ptr @deg, align 4, !tbaa !5
  %.not8491 = icmp slt i32 %.lcssa85, 0
  br i1 %.not8491, label %._crit_edge95, label %.lr.ph94.preheader

.lr.ph94.preheader:                               ; preds = %._crit_edge
  %49 = zext i32 %48 to i64
  %50 = shl nuw nsw i64 %49, 2
  tail call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 16 @val, ptr nonnull align 16 @nxt, i64 %50, i1 false), !tbaa !5
  br label %._crit_edge95

.lr.ph.peel.next:                                 ; preds = %.lr.ph.preheader, %.lr.ph.peel.next
  %indvars.iv132 = phi i64 [ %indvars.iv.next133, %.lr.ph.peel.next ], [ 1, %.lr.ph.preheader ]
  %.06990 = phi i32 [ %57, %.lr.ph.peel.next ], [ %46, %.lr.ph.preheader ]
  %51 = add nsw i64 %indvars.iv132, -1
  %52 = getelementptr inbounds [62 x i32], ptr @nxt, i64 0, i64 %51
  %53 = load i32, ptr %52, align 4, !tbaa !5
  %54 = tail call noundef i32 @_Z5valuei(i32 noundef %.06990)
  %55 = tail call noundef i32 @_Z7mod_addii(i32 noundef %53, i32 noundef %54)
  %56 = getelementptr inbounds [62 x i32], ptr @nxt, i64 0, i64 %indvars.iv132
  store i32 %55, ptr %56, align 4, !tbaa !5
  %indvars.iv.next133 = add nuw nsw i64 %indvars.iv132, 1
  %57 = tail call noundef i32 @_Z7mod_addii(i32 noundef %.06990, i32 noundef 2)
  %58 = load i32, ptr @deg, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %.not81.not = icmp slt i64 %indvars.iv132, %59
  br i1 %.not81.not, label %.lr.ph.peel.next, label %._crit_edge, !llvm.loop !14

._crit_edge95:                                    ; preds = %._crit_edge.thread, %.lr.ph94.preheader, %._crit_edge
  %60 = lshr i64 %40, 1
  %61 = urem i64 %60, 1000000007
  %62 = trunc nuw nsw i64 %61 to i32
  %63 = tail call noundef i32 @_Z5valuei(i32 noundef %62)
  %64 = getelementptr inbounds [62 x i32], ptr @seq, i64 0, i64 %indvars.iv139
  store i32 %63, ptr %64, align 4, !tbaa !5
  %indvars.iv.next140 = add nuw nsw i64 %indvars.iv139, 1
  %.not123 = icmp ult i64 %40, 2
  br i1 %.not123, label %._crit_edge99.loopexit, label %.lr.ph98thread-pre-split, !llvm.loop !16

._crit_edge99.loopexit:                           ; preds = %._crit_edge95
  %65 = trunc nuw i64 %indvars.iv.next140 to i32
  %.pre = load i64, ptr @n, align 8, !tbaa !11
  br label %._crit_edge99

._crit_edge99:                                    ; preds = %._crit_edge99.loopexit, %17
  %66 = phi i64 [ %19, %17 ], [ %.pre, %._crit_edge99.loopexit ]
  %.072.lcssa = phi i32 [ 1, %17 ], [ %65, %._crit_edge99.loopexit ]
  %67 = add i32 %.072.lcssa, -1
  store i32 1, ptr @val, align 16, !tbaa !5
  store i32 1, ptr @deg, align 4, !tbaa !5
  %68 = icmp sgt i64 %66, 1
  br i1 %68, label %.lr.ph115.preheader, label %._crit_edge116

.lr.ph115.preheader:                              ; preds = %._crit_edge99
  %69 = add nsw i64 %66, -2
  br label %.lr.ph115

._crit_edge116:                                   ; preds = %._crit_edge112, %._crit_edge99
  store i32 %67, ptr @A, align 4, !tbaa !5
  store i32 %67, ptr getelementptr inbounds (i8, ptr @A, i64 4), align 4, !tbaa !5
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(14884) getelementptr inbounds (i8, ptr @A, i64 8), i8 0, i64 14884, i1 false)
  %70 = icmp sgt i32 %.072.lcssa, 2
  br i1 %70, label %.lr.ph119.preheader, label %.preheader

.lr.ph119.preheader:                              ; preds = %._crit_edge116
  %wide.trip.count = zext nneg i32 %67 to i64
  %71 = add nsw i64 %wide.trip.count, -1
  %72 = add nsw i64 %wide.trip.count, -2
  %xtraiter = and i64 %71, 3
  %73 = icmp ult i64 %72, 3
  br i1 %73, label %.preheader.loopexit.unr-lcssa, label %.lr.ph119.preheader.new

.lr.ph119.preheader.new:                          ; preds = %.lr.ph119.preheader
  %unroll_iter = and i64 %71, -4
  br label %.lr.ph119

.lr.ph115thread-pre-split:                        ; preds = %._crit_edge112
  %74 = add nsw i64 %96, -1
  %indvars.iv.next150 = add nuw nsw i64 %indvars.iv149, 1
  %.pr166 = load i32, ptr @deg, align 4, !tbaa !5
  br label %.lr.ph115

.lr.ph115:                                        ; preds = %.lr.ph115thread-pre-split, %.lr.ph115.preheader
  %75 = phi i32 [ %.pr166, %.lr.ph115thread-pre-split ], [ 1, %.lr.ph115.preheader ]
  %indvars.iv149 = phi i64 [ %indvars.iv.next150, %.lr.ph115thread-pre-split ], [ 1, %.lr.ph115.preheader ]
  %76 = phi i64 [ %74, %.lr.ph115thread-pre-split ], [ %69, %.lr.ph115.preheader ]
  %.not101 = icmp slt i32 %75, 0
  br i1 %.not101, label %._crit_edge106.thread, label %.lr.ph105.preheader

._crit_edge106.thread:                            ; preds = %.lr.ph115
  %77 = add nsw i32 %75, 1
  store i32 %77, ptr @deg, align 4, !tbaa !5
  br label %._crit_edge112

.lr.ph105.preheader:                              ; preds = %.lr.ph115
  %78 = trunc i64 %76 to i32
  %79 = and i32 %78, 1
  %80 = tail call noundef i32 @_Z5valuei(i32 noundef %79)
  %81 = tail call noundef i32 @_Z7mod_addii(i32 noundef 0, i32 noundef %80)
  store i32 %81, ptr @nxt, align 16, !tbaa !5
  %82 = tail call noundef i32 @_Z7mod_addii(i32 noundef %79, i32 noundef 2)
  %83 = load i32, ptr @deg, align 4, !tbaa !5
  %.not.not.peel = icmp sgt i32 %83, 0
  br i1 %.not.not.peel, label %.lr.ph105.peel.next, label %._crit_edge106

._crit_edge106:                                   ; preds = %.lr.ph105.peel.next, %.lr.ph105.preheader
  %.lcssa = phi i32 [ %83, %.lr.ph105.preheader ], [ %94, %.lr.ph105.peel.next ]
  %84 = add i32 %.lcssa, 1
  store i32 %84, ptr @deg, align 4, !tbaa !5
  %.not83108 = icmp slt i32 %.lcssa, 0
  br i1 %.not83108, label %._crit_edge112, label %.lr.ph111.preheader

.lr.ph111.preheader:                              ; preds = %._crit_edge106
  %85 = zext i32 %84 to i64
  %86 = shl nuw nsw i64 %85, 2
  tail call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 16 @val, ptr nonnull align 16 @nxt, i64 %86, i1 false), !tbaa !5
  br label %._crit_edge112

.lr.ph105.peel.next:                              ; preds = %.lr.ph105.preheader, %.lr.ph105.peel.next
  %indvars.iv142 = phi i64 [ %indvars.iv.next143, %.lr.ph105.peel.next ], [ 1, %.lr.ph105.preheader ]
  %.064103 = phi i32 [ %93, %.lr.ph105.peel.next ], [ %82, %.lr.ph105.preheader ]
  %87 = add nsw i64 %indvars.iv142, -1
  %88 = getelementptr inbounds [62 x i32], ptr @nxt, i64 0, i64 %87
  %89 = load i32, ptr %88, align 4, !tbaa !5
  %90 = tail call noundef i32 @_Z5valuei(i32 noundef %.064103)
  %91 = tail call noundef i32 @_Z7mod_addii(i32 noundef %89, i32 noundef %90)
  %92 = getelementptr inbounds [62 x i32], ptr @nxt, i64 0, i64 %indvars.iv142
  store i32 %91, ptr %92, align 4, !tbaa !5
  %indvars.iv.next143 = add nuw nsw i64 %indvars.iv142, 1
  %93 = tail call noundef i32 @_Z7mod_addii(i32 noundef %.064103, i32 noundef 2)
  %94 = load i32, ptr @deg, align 4, !tbaa !5
  %95 = sext i32 %94 to i64
  %.not.not = icmp slt i64 %indvars.iv142, %95
  br i1 %.not.not, label %.lr.ph105.peel.next, label %._crit_edge106, !llvm.loop !17

._crit_edge112:                                   ; preds = %._crit_edge106.thread, %.lr.ph111.preheader, %._crit_edge106
  %96 = lshr i64 %76, 1
  %97 = getelementptr inbounds [62 x i32], ptr @seq, i64 0, i64 %indvars.iv149
  %98 = load i32, ptr %97, align 4, !tbaa !5
  %99 = urem i64 %96, 1000000007
  %100 = trunc nuw nsw i64 %99 to i32
  %101 = tail call noundef i32 @_Z5valuei(i32 noundef %100)
  %102 = tail call noundef i32 @_Z7mod_decii(i32 noundef %98, i32 noundef %101)
  store i32 %102, ptr %97, align 4, !tbaa !5
  %.not = icmp ult i64 %76, 2
  br i1 %.not, label %._crit_edge116, label %.lr.ph115thread-pre-split, !llvm.loop !18

.preheader.loopexit.unr-lcssa:                    ; preds = %.lr.ph119, %.lr.ph119.preheader
  %indvars.iv152.unr = phi i64 [ 1, %.lr.ph119.preheader ], [ %indvars.iv.next153.3, %.lr.ph119 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader, label %.lr.ph119.epil

.lr.ph119.epil:                                   ; preds = %.preheader.loopexit.unr-lcssa, %.lr.ph119.epil
  %indvars.iv152.epil = phi i64 [ %indvars.iv.next153.epil, %.lr.ph119.epil ], [ %indvars.iv152.unr, %.preheader.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph119.epil ], [ 0, %.preheader.loopexit.unr-lcssa ]
  %103 = add nsw i64 %indvars.iv152.epil, -1
  %104 = getelementptr inbounds [61 x [61 x i32]], ptr getelementptr inbounds (i8, ptr @A, i64 8), i64 0, i64 %indvars.iv152.epil, i64 %103
  store i32 1, ptr %104, align 4, !tbaa !5
  %indvars.iv.next153.epil = add nuw nsw i64 %indvars.iv152.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %.preheader, label %.lr.ph119.epil, !llvm.loop !19

.preheader:                                       ; preds = %.preheader.loopexit.unr-lcssa, %.lr.ph119.epil, %._crit_edge116
  %105 = icmp sgt i32 %.072.lcssa, 1
  %106 = add nsw i32 %.072.lcssa, -2
  br i1 %105, label %.lr.ph121, label %.preheader.._crit_edge122_crit_edge

.preheader.._crit_edge122_crit_edge:              ; preds = %.preheader
  %.pre162 = sext i32 %106 to i64
  br label %._crit_edge122

.lr.ph121:                                        ; preds = %.preheader
  %107 = zext nneg i32 %106 to i64
  %108 = zext nneg i32 %67 to i64
  %wide.trip.count159 = zext nneg i32 %67 to i64
  %109 = add nsw i64 %wide.trip.count159, -1
  %xtraiter175 = and i64 %wide.trip.count159, 3
  %110 = icmp ult i64 %109, 3
  br i1 %110, label %._crit_edge122.loopexit.unr-lcssa, label %.lr.ph121.new

.lr.ph121.new:                                    ; preds = %.lr.ph121
  %unroll_iter178 = and i64 %wide.trip.count159, 2147483644
  br label %126

.lr.ph119:                                        ; preds = %.lr.ph119, %.lr.ph119.preheader.new
  %indvars.iv152 = phi i64 [ 1, %.lr.ph119.preheader.new ], [ %indvars.iv.next153.3, %.lr.ph119 ]
  %niter = phi i64 [ 0, %.lr.ph119.preheader.new ], [ %niter.next.3, %.lr.ph119 ]
  %111 = add nsw i64 %indvars.iv152, -1
  %112 = getelementptr inbounds [61 x [61 x i32]], ptr getelementptr inbounds (i8, ptr @A, i64 8), i64 0, i64 %indvars.iv152, i64 %111
  store i32 1, ptr %112, align 4, !tbaa !5
  %indvars.iv.next153 = add nuw nsw i64 %indvars.iv152, 1
  %113 = getelementptr inbounds [61 x [61 x i32]], ptr getelementptr inbounds (i8, ptr @A, i64 8), i64 0, i64 %indvars.iv.next153, i64 %indvars.iv152
  store i32 1, ptr %113, align 4, !tbaa !5
  %indvars.iv.next153.1 = add nuw nsw i64 %indvars.iv152, 2
  %114 = add nuw nsw i64 %indvars.iv152, 1
  %115 = getelementptr inbounds [61 x [61 x i32]], ptr getelementptr inbounds (i8, ptr @A, i64 8), i64 0, i64 %indvars.iv.next153.1, i64 %114
  store i32 1, ptr %115, align 4, !tbaa !5
  %indvars.iv.next153.2 = add nuw nsw i64 %indvars.iv152, 3
  %116 = add nuw nsw i64 %indvars.iv152, 2
  %117 = getelementptr inbounds [61 x [61 x i32]], ptr getelementptr inbounds (i8, ptr @A, i64 8), i64 0, i64 %indvars.iv.next153.2, i64 %116
  store i32 1, ptr %117, align 4, !tbaa !5
  %indvars.iv.next153.3 = add nuw nsw i64 %indvars.iv152, 4
  %niter.next.3 = add nuw i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %.preheader.loopexit.unr-lcssa, label %.lr.ph119, !llvm.loop !21

._crit_edge122.loopexit.unr-lcssa:                ; preds = %126, %.lr.ph121
  %indvars.iv156.unr = phi i64 [ 0, %.lr.ph121 ], [ %indvars.iv.next157.3, %126 ]
  %lcmp.mod177.not = icmp eq i64 %xtraiter175, 0
  br i1 %lcmp.mod177.not, label %._crit_edge122, label %.epil.preheader

.epil.preheader:                                  ; preds = %._crit_edge122.loopexit.unr-lcssa, %.epil.preheader
  %indvars.iv156.epil = phi i64 [ %indvars.iv.next157.epil, %.epil.preheader ], [ %indvars.iv156.unr, %._crit_edge122.loopexit.unr-lcssa ]
  %epil.iter176 = phi i64 [ %epil.iter176.next, %.epil.preheader ], [ 0, %._crit_edge122.loopexit.unr-lcssa ]
  %118 = sub nsw i64 %108, %indvars.iv156.epil
  %119 = getelementptr inbounds [62 x i32], ptr @seq, i64 0, i64 %118
  %120 = load i32, ptr %119, align 4, !tbaa !5
  %121 = getelementptr inbounds [61 x [61 x i32]], ptr getelementptr inbounds (i8, ptr @A, i64 8), i64 0, i64 %indvars.iv156.epil, i64 %107
  store i32 %120, ptr %121, align 4, !tbaa !5
  %indvars.iv.next157.epil = add nuw nsw i64 %indvars.iv156.epil, 1
  %epil.iter176.next = add i64 %epil.iter176, 1
  %epil.iter176.cmp.not = icmp eq i64 %epil.iter176.next, %xtraiter175
  br i1 %epil.iter176.cmp.not, label %._crit_edge122, label %.epil.preheader, !llvm.loop !22

._crit_edge122:                                   ; preds = %._crit_edge122.loopexit.unr-lcssa, %.epil.preheader, %.preheader.._crit_edge122_crit_edge
  %.pre-phi163 = phi i64 [ %.pre162, %.preheader.._crit_edge122_crit_edge ], [ %107, %.epil.preheader ], [ %107, %._crit_edge122.loopexit.unr-lcssa ]
  call void @llvm.lifetime.start.p0(i64 14892, ptr nonnull %1) #8
  %122 = load i64, ptr @m, align 8, !tbaa !11
  call void @_ZN6Matrix3powEx(ptr dead_on_unwind nonnull writable sret(%struct.Matrix) align 4 %1, ptr noundef nonnull align 4 dereferenceable(14892) @A, i64 noundef %122)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(14892) @A, ptr noundef nonnull align 4 dereferenceable(14892) %1, i64 14892, i1 false), !tbaa.struct !23
  call void @llvm.lifetime.end.p0(i64 14892, ptr nonnull %1) #8
  %123 = getelementptr inbounds [61 x [61 x i32]], ptr getelementptr inbounds (i8, ptr @A, i64 8), i64 0, i64 %.pre-phi163, i64 %.pre-phi163
  %124 = load i32, ptr %123, align 4, !tbaa !5
  %125 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %124)
  ret i32 0

126:                                              ; preds = %126, %.lr.ph121.new
  %indvars.iv156 = phi i64 [ 0, %.lr.ph121.new ], [ %indvars.iv.next157.3, %126 ]
  %niter179 = phi i64 [ 0, %.lr.ph121.new ], [ %niter179.next.3, %126 ]
  %127 = sub nsw i64 %108, %indvars.iv156
  %128 = getelementptr inbounds [62 x i32], ptr @seq, i64 0, i64 %127
  %129 = load i32, ptr %128, align 4, !tbaa !5
  %130 = getelementptr inbounds [61 x [61 x i32]], ptr getelementptr inbounds (i8, ptr @A, i64 8), i64 0, i64 %indvars.iv156, i64 %107
  store i32 %129, ptr %130, align 4, !tbaa !5
  %indvars.iv.next157 = or disjoint i64 %indvars.iv156, 1
  %131 = sub nsw i64 %108, %indvars.iv.next157
  %132 = getelementptr inbounds [62 x i32], ptr @seq, i64 0, i64 %131
  %133 = load i32, ptr %132, align 4, !tbaa !5
  %134 = getelementptr inbounds [61 x [61 x i32]], ptr getelementptr inbounds (i8, ptr @A, i64 8), i64 0, i64 %indvars.iv.next157, i64 %107
  store i32 %133, ptr %134, align 4, !tbaa !5
  %indvars.iv.next157.1 = or disjoint i64 %indvars.iv156, 2
  %135 = sub nsw i64 %108, %indvars.iv.next157.1
  %136 = getelementptr inbounds [62 x i32], ptr @seq, i64 0, i64 %135
  %137 = load i32, ptr %136, align 4, !tbaa !5
  %138 = getelementptr inbounds [61 x [61 x i32]], ptr getelementptr inbounds (i8, ptr @A, i64 8), i64 0, i64 %indvars.iv.next157.1, i64 %107
  store i32 %137, ptr %138, align 4, !tbaa !5
  %indvars.iv.next157.2 = or disjoint i64 %indvars.iv156, 3
  %139 = sub nsw i64 %108, %indvars.iv.next157.2
  %140 = getelementptr inbounds [62 x i32], ptr @seq, i64 0, i64 %139
  %141 = load i32, ptr %140, align 4, !tbaa !5
  %142 = getelementptr inbounds [61 x [61 x i32]], ptr getelementptr inbounds (i8, ptr @A, i64 8), i64 0, i64 %indvars.iv.next157.2, i64 %107
  store i32 %141, ptr %142, align 4, !tbaa !5
  %indvars.iv.next157.3 = add nuw nsw i64 %indvars.iv156, 4
  %niter179.next.3 = add i64 %niter179, 4
  %niter179.ncmp.3 = icmp eq i64 %niter179.next.3, %unroll_iter178
  br i1 %niter179.ncmp.3, label %._crit_edge122.loopexit.unr-lcssa, label %126, !llvm.loop !25
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z7mod_addii(i32 noundef, i32 noundef) local_unnamed_addr #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z7mod_decii(i32 noundef, i32 noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5

; 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) #6

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6Matrix3powEx(ptr dead_on_unwind noalias writable sret(%struct.Matrix) align 4, ptr noundef nonnull align 4 dereferenceable(14892), i64 noundef) local_unnamed_addr #7 align 2

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

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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #4 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { 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 #8 = { nounwind }

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

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


; Effective O3 passes: BDCEPass,CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopFullUnrollPass,LoopIdiomRecognizePass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,MemCpyOptPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass