; LLVM IR from tangjz/acm-icpc :: hdu (6358)

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

@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@L = external dso_local global i32, align 4
@R = external dso_local global i32, align 4
@q = external dso_local global i32, align 4
@f = external dso_local global [30 x [9 x [9 x i32]]], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [4 x i8], align 1

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z6matPowRA9_A9_ii(ptr noundef nonnull align 4 dereferenceable(324), i32 noundef) #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 ptr, align 8
  %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 i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i8, align 1
  %22 = alloca i8, align 1
  %23 = alloca i32, align 4
  %24 = alloca ptr, align 8
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  %28 = alloca i32, align 4
  %29 = alloca i32, align 4
  %30 = alloca ptr, align 8
  %31 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %32 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @t)
  br label %33

33:                                               ; preds = %392, %0
  %34 = load i32, ptr @t, align 4, !tbaa !5
  %35 = add nsw i32 %34, -1
  store i32 %35, ptr @t, align 4, !tbaa !5
  %36 = icmp ne i32 %34, 0
  br i1 %36, label %37, label %393

37:                                               ; preds = %33
  %38 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef @n, ptr noundef @L, ptr noundef @R, ptr noundef @q)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %39

39:                                               ; preds = %45, %37
  %40 = load i32, ptr %2, align 4, !tbaa !5
  %41 = shl i32 1, %40
  %42 = load i32, ptr @R, align 4, !tbaa !5
  %43 = icmp sle i32 %41, %42
  br i1 %43, label %44, label %48

44:                                               ; preds = %39
  br label %45

45:                                               ; preds = %44
  %46 = load i32, ptr %2, align 4, !tbaa !5
  %47 = add nsw i32 %46, 1
  store i32 %47, ptr %2, align 4, !tbaa !5
  br label %39, !llvm.loop !9

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

49:                                               ; preds = %247, %48
  %50 = load i32, ptr %3, align 4, !tbaa !5
  %51 = load i32, ptr %2, align 4, !tbaa !5
  %52 = icmp slt i32 %50, %51
  br i1 %52, label %54, label %53

53:                                               ; preds = %49
  store i32 7, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  br label %250

54:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  %55 = load i32, ptr %3, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [30 x [9 x [9 x i32]]], ptr @f, i64 0, i64 %56
  store ptr %57, ptr %5, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %58

58:                                               ; preds = %79, %54
  %59 = load i32, ptr %6, align 4, !tbaa !5
  %60 = icmp slt i32 %59, 8
  br i1 %60, label %62, label %61

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

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

63:                                               ; preds = %75, %62
  %64 = load i32, ptr %7, align 4, !tbaa !5
  %65 = icmp slt i32 %64, 8
  br i1 %65, label %67, label %66

66:                                               ; preds = %63
  store i32 13, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %78

67:                                               ; preds = %63
  %68 = load ptr, ptr %5, align 8, !tbaa !11
  %69 = load i32, ptr %6, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [9 x [9 x i32]], ptr %68, i64 0, i64 %70
  %72 = load i32, ptr %7, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [9 x i32], ptr %71, i64 0, i64 %73
  store i32 0, ptr %74, align 4, !tbaa !5
  br label %75

75:                                               ; preds = %67
  %76 = load i32, ptr %7, align 4, !tbaa !5
  %77 = add nsw i32 %76, 1
  store i32 %77, ptr %7, align 4, !tbaa !5
  br label %63, !llvm.loop !13

78:                                               ; preds = %66
  br label %79

79:                                               ; preds = %78
  %80 = load i32, ptr %6, align 4, !tbaa !5
  %81 = add nsw i32 %80, 1
  store i32 %81, ptr %6, align 4, !tbaa !5
  br label %58, !llvm.loop !14

82:                                               ; preds = %61
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  %83 = load i32, ptr %3, align 4, !tbaa !5
  %84 = shl i32 1, %83
  store i32 %84, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  %85 = load i32, ptr @R, align 4, !tbaa !5
  %86 = load i32, ptr %8, align 4, !tbaa !5
  %87 = and i32 %85, %86
  %88 = icmp sgt i32 %87, 0
  %89 = zext i1 %88 to i32
  store i32 %89, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %90 = load i32, ptr @R, align 4, !tbaa !5
  %91 = load i32, ptr %8, align 4, !tbaa !5
  %92 = sub nsw i32 %91, 1
  %93 = and i32 %90, %92
  store i32 %93, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %94

94:                                               ; preds = %110, %82
  %95 = load i32, ptr %11, align 4, !tbaa !5
  %96 = icmp slt i32 %95, 4
  br i1 %96, label %98, label %97

97:                                               ; preds = %94
  store i32 16, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %113

98:                                               ; preds = %94
  %99 = load ptr, ptr %5, align 8, !tbaa !11
  %100 = load i32, ptr %11, align 4, !tbaa !5
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [9 x [9 x i32]], ptr %99, i64 0, i64 %101
  %103 = load i32, ptr %11, align 4, !tbaa !5
  %104 = load i32, ptr %9, align 4, !tbaa !5
  %105 = xor i32 %103, %104
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [9 x i32], ptr %102, i64 0, i64 %106
  %108 = load i32, ptr %10, align 4, !tbaa !5
  %109 = add nsw i32 %108, 1
  call void @_Z7mod_incRii(ptr noundef nonnull align 4 dereferenceable(4) %107, i32 noundef %109)
  br label %110

110:                                              ; preds = %98
  %111 = load i32, ptr %11, align 4, !tbaa !5
  %112 = add nsw i32 %111, 1
  store i32 %112, ptr %11, align 4, !tbaa !5
  br label %94, !llvm.loop !15

113:                                              ; preds = %97
  %114 = load i32, ptr %9, align 4, !tbaa !5
  %115 = icmp ne i32 %114, 0
  br i1 %115, label %116, label %142

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

117:                                              ; preds = %138, %116
  %118 = load i32, ptr %12, align 4, !tbaa !5
  %119 = icmp slt i32 %118, 4
  br i1 %119, label %121, label %120

120:                                              ; preds = %117
  store i32 19, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %141

121:                                              ; preds = %117
  %122 = load ptr, ptr %5, align 8, !tbaa !11
  %123 = load i32, ptr %12, align 4, !tbaa !5
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds [9 x [9 x i32]], ptr %122, i64 0, i64 %124
  %126 = load i32, ptr %12, align 4, !tbaa !5
  %127 = or i32 2, %126
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [9 x i32], ptr %125, i64 0, i64 %128
  %130 = load i32, ptr %12, align 4, !tbaa !5
  %131 = and i32 %130, 2
  %132 = icmp ne i32 %131, 0
  br i1 %132, label %133, label %135

133:                                              ; preds = %121
  %134 = load i32, ptr %8, align 4, !tbaa !5
  br label %136

135:                                              ; preds = %121
  br label %136

136:                                              ; preds = %135, %133
  %137 = phi i32 [ %134, %133 ], [ 1, %135 ]
  call void @_Z7mod_incRii(ptr noundef nonnull align 4 dereferenceable(4) %129, i32 noundef %137)
  br label %138

138:                                              ; preds = %136
  %139 = load i32, ptr %12, align 4, !tbaa !5
  %140 = add nsw i32 %139, 1
  store i32 %140, ptr %12, align 4, !tbaa !5
  br label %117, !llvm.loop !16

141:                                              ; preds = %120
  br label %142

142:                                              ; preds = %141, %113
  %143 = load i32, ptr @L, align 4, !tbaa !5
  %144 = icmp ne i32 %143, 0
  br i1 %144, label %145, label %209

145:                                              ; preds = %142
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  %146 = load i32, ptr @L, align 4, !tbaa !5
  %147 = sub nsw i32 %146, 1
  %148 = load i32, ptr %8, align 4, !tbaa !5
  %149 = and i32 %147, %148
  %150 = icmp sgt i32 %149, 0
  %151 = zext i1 %150 to i32
  store i32 %151, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  %152 = load i32, ptr @L, align 4, !tbaa !5
  %153 = sub nsw i32 %152, 1
  %154 = load i32, ptr %8, align 4, !tbaa !5
  %155 = sub nsw i32 %154, 1
  %156 = and i32 %153, %155
  store i32 %156, ptr %14, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  store i32 0, ptr %15, align 4, !tbaa !5
  br label %157

157:                                              ; preds = %175, %145
  %158 = load i32, ptr %15, align 4, !tbaa !5
  %159 = icmp slt i32 %158, 4
  br i1 %159, label %161, label %160

160:                                              ; preds = %157
  store i32 22, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  br label %178

161:                                              ; preds = %157
  %162 = load ptr, ptr %5, align 8, !tbaa !11
  %163 = load i32, ptr %15, align 4, !tbaa !5
  %164 = sext i32 %163 to i64
  %165 = getelementptr inbounds [9 x [9 x i32]], ptr %162, i64 0, i64 %164
  %166 = load i32, ptr %15, align 4, !tbaa !5
  %167 = load i32, ptr %13, align 4, !tbaa !5
  %168 = xor i32 %166, %167
  %169 = or i32 4, %168
  %170 = sext i32 %169 to i64
  %171 = getelementptr inbounds [9 x i32], ptr %165, i64 0, i64 %170
  %172 = load i32, ptr %14, align 4, !tbaa !5
  %173 = add nsw i32 %172, 1
  %174 = sub nsw i32 1000000007, %173
  call void @_Z7mod_incRii(ptr noundef nonnull align 4 dereferenceable(4) %171, i32 noundef %174)
  br label %175

175:                                              ; preds = %161
  %176 = load i32, ptr %15, align 4, !tbaa !5
  %177 = add nsw i32 %176, 1
  store i32 %177, ptr %15, align 4, !tbaa !5
  br label %157, !llvm.loop !17

178:                                              ; preds = %160
  %179 = load i32, ptr %13, align 4, !tbaa !5
  %180 = icmp ne i32 %179, 0
  br i1 %180, label %181, label %208

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

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

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

186:                                              ; preds = %182
  %187 = load ptr, ptr %5, align 8, !tbaa !11
  %188 = load i32, ptr %16, align 4, !tbaa !5
  %189 = sext i32 %188 to i64
  %190 = getelementptr inbounds [9 x [9 x i32]], ptr %187, i64 0, i64 %189
  %191 = load i32, ptr %16, align 4, !tbaa !5
  %192 = or i32 6, %191
  %193 = sext i32 %192 to i64
  %194 = getelementptr inbounds [9 x i32], ptr %190, i64 0, i64 %193
  %195 = load i32, ptr %16, align 4, !tbaa !5
  %196 = and i32 %195, 2
  %197 = icmp ne i32 %196, 0
  br i1 %197, label %198, label %200

198:                                              ; preds = %186
  %199 = load i32, ptr %8, align 4, !tbaa !5
  br label %201

200:                                              ; preds = %186
  br label %201

201:                                              ; preds = %200, %198
  %202 = phi i32 [ %199, %198 ], [ 1, %200 ]
  %203 = sub nsw i32 1000000007, %202
  call void @_Z7mod_incRii(ptr noundef nonnull align 4 dereferenceable(4) %194, i32 noundef %203)
  br label %204

204:                                              ; preds = %201
  %205 = load i32, ptr %16, align 4, !tbaa !5
  %206 = add nsw i32 %205, 1
  store i32 %206, ptr %16, align 4, !tbaa !5
  br label %182, !llvm.loop !18

207:                                              ; preds = %185
  br label %208

208:                                              ; preds = %207, %178
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %209

209:                                              ; preds = %208, %142
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  store i32 4, ptr %17, align 4, !tbaa !5
  br label %210

210:                                              ; preds = %241, %209
  %211 = load i32, ptr %17, align 4, !tbaa !5
  %212 = icmp slt i32 %211, 8
  br i1 %212, label %214, label %213

213:                                              ; preds = %210
  store i32 28, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  br label %244

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

215:                                              ; preds = %237, %214
  %216 = load i32, ptr %18, align 4, !tbaa !5
  %217 = icmp slt i32 %216, 8
  br i1 %217, label %219, label %218

218:                                              ; preds = %215
  store i32 31, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  br label %240

219:                                              ; preds = %215
  %220 = load ptr, ptr %5, align 8, !tbaa !11
  %221 = load i32, ptr %17, align 4, !tbaa !5
  %222 = xor i32 %221, 4
  %223 = sext i32 %222 to i64
  %224 = getelementptr inbounds [9 x [9 x i32]], ptr %220, i64 0, i64 %223
  %225 = load i32, ptr %18, align 4, !tbaa !5
  %226 = xor i32 %225, 4
  %227 = sext i32 %226 to i64
  %228 = getelementptr inbounds [9 x i32], ptr %224, i64 0, i64 %227
  %229 = load i32, ptr %228, align 4, !tbaa !5
  %230 = load ptr, ptr %5, align 8, !tbaa !11
  %231 = load i32, ptr %17, align 4, !tbaa !5
  %232 = sext i32 %231 to i64
  %233 = getelementptr inbounds [9 x [9 x i32]], ptr %230, i64 0, i64 %232
  %234 = load i32, ptr %18, align 4, !tbaa !5
  %235 = sext i32 %234 to i64
  %236 = getelementptr inbounds [9 x i32], ptr %233, i64 0, i64 %235
  store i32 %229, ptr %236, align 4, !tbaa !5
  br label %237

237:                                              ; preds = %219
  %238 = load i32, ptr %18, align 4, !tbaa !5
  %239 = add nsw i32 %238, 1
  store i32 %239, ptr %18, align 4, !tbaa !5
  br label %215, !llvm.loop !19

240:                                              ; preds = %218
  br label %241

241:                                              ; preds = %240
  %242 = load i32, ptr %17, align 4, !tbaa !5
  %243 = add nsw i32 %242, 1
  store i32 %243, ptr %17, align 4, !tbaa !5
  br label %210, !llvm.loop !20

244:                                              ; preds = %213
  %245 = load ptr, ptr %5, align 8, !tbaa !11
  %246 = load i32, ptr @n, align 4, !tbaa !5
  call void @_Z6matPowRA9_A9_ii(ptr noundef nonnull align 4 dereferenceable(324) %245, i32 noundef %246)
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  br label %247

247:                                              ; preds = %244
  %248 = load i32, ptr %3, align 4, !tbaa !5
  %249 = add nsw i32 %248, 1
  store i32 %249, ptr %3, align 4, !tbaa !5
  br label %49, !llvm.loop !21

250:                                              ; preds = %53
  br label %251

251:                                              ; preds = %391, %389, %250
  %252 = load i32, ptr @q, align 4, !tbaa !5
  %253 = add nsw i32 %252, -1
  store i32 %253, ptr @q, align 4, !tbaa !5
  %254 = icmp ne i32 %252, 0
  br i1 %254, label %255, label %392

255:                                              ; preds = %251
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #5
  %256 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %19)
  %257 = load i32, ptr %19, align 4, !tbaa !5
  %258 = load i32, ptr %2, align 4, !tbaa !5
  %259 = shl i32 1, %258
  %260 = icmp sge i32 %257, %259
  br i1 %260, label %261, label %263

261:                                              ; preds = %255
  %262 = call i32 @puts(ptr noundef @.str.2)
  store i32 34, ptr %4, align 4
  br label %389, !llvm.loop !22

263:                                              ; preds = %255
  %264 = load i32, ptr @R, align 4, !tbaa !5
  %265 = icmp ne i32 %264, 0
  br i1 %265, label %268, label %266

266:                                              ; preds = %263
  %267 = call i32 @puts(ptr noundef @.str.3)
  store i32 34, ptr %4, align 4
  br label %389, !llvm.loop !22

268:                                              ; preds = %263
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #5
  store i32 0, ptr %20, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %21) #5
  store i8 1, ptr %21, align 1, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 1, ptr %22) #5
  store i8 1, ptr %22, align 1, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #5
  %269 = load i32, ptr %2, align 4, !tbaa !5
  %270 = sub nsw i32 %269, 1
  store i32 %270, ptr %23, align 4, !tbaa !5
  br label %271

271:                                              ; preds = %364, %268
  %272 = load i32, ptr %23, align 4, !tbaa !5
  %273 = icmp sge i32 %272, 0
  br i1 %273, label %274, label %282

274:                                              ; preds = %271
  %275 = load i8, ptr %21, align 1, !tbaa !23, !range !25, !noundef !26
  %276 = trunc i8 %275 to i1
  br i1 %276, label %280, label %277

277:                                              ; preds = %274
  %278 = load i8, ptr %22, align 1, !tbaa !23, !range !25, !noundef !26
  %279 = trunc i8 %278 to i1
  br label %280

280:                                              ; preds = %277, %274
  %281 = phi i1 [ true, %274 ], [ %279, %277 ]
  br label %282

282:                                              ; preds = %280, %271
  %283 = phi i1 [ false, %271 ], [ %281, %280 ]
  br i1 %283, label %285, label %284

284:                                              ; preds = %282
  store i32 36, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #5
  br label %367

285:                                              ; preds = %282
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #5
  %286 = load i32, ptr %23, align 4, !tbaa !5
  %287 = sext i32 %286 to i64
  %288 = getelementptr inbounds [30 x [9 x [9 x i32]]], ptr @f, i64 0, i64 %287
  store ptr %288, ptr %24, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #5
  %289 = load i32, ptr @L, align 4, !tbaa !5
  %290 = icmp ne i32 %289, 0
  br i1 %290, label %291, label %298

291:                                              ; preds = %285
  %292 = load i32, ptr @L, align 4, !tbaa !5
  %293 = sub nsw i32 %292, 1
  %294 = load i32, ptr %23, align 4, !tbaa !5
  %295 = ashr i32 %293, %294
  %296 = and i32 %295, 1
  %297 = icmp ne i32 %296, 0
  br label %298

298:                                              ; preds = %291, %285
  %299 = phi i1 [ false, %285 ], [ %297, %291 ]
  %300 = zext i1 %299 to i32
  store i32 %300, ptr %25, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #5
  %301 = load i32, ptr @R, align 4, !tbaa !5
  %302 = load i32, ptr %23, align 4, !tbaa !5
  %303 = ashr i32 %301, %302
  %304 = and i32 %303, 1
  store i32 %304, ptr %26, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #5
  %305 = load i32, ptr %19, align 4, !tbaa !5
  %306 = load i32, ptr %23, align 4, !tbaa !5
  %307 = ashr i32 %305, %306
  %308 = and i32 %307, 1
  store i32 %308, ptr %27, align 4, !tbaa !5
  %309 = load i8, ptr %21, align 1, !tbaa !23, !range !25, !noundef !26
  %310 = trunc i8 %309 to i1
  br i1 %310, label %311, label %319

311:                                              ; preds = %298
  %312 = load ptr, ptr %24, align 8, !tbaa !11
  %313 = getelementptr inbounds [9 x [9 x i32]], ptr %312, i64 0, i64 0
  %314 = load i32, ptr %27, align 4, !tbaa !5
  %315 = or i32 2, %314
  %316 = sext i32 %315 to i64
  %317 = getelementptr inbounds [9 x i32], ptr %313, i64 0, i64 %316
  %318 = load i32, ptr %317, align 4, !tbaa !5
  call void @_Z7mod_incRii(ptr noundef nonnull align 4 dereferenceable(4) %20, i32 noundef %318)
  br label %319

319:                                              ; preds = %311, %298
  %320 = load i8, ptr %22, align 1, !tbaa !23, !range !25, !noundef !26
  %321 = trunc i8 %320 to i1
  br i1 %321, label %322, label %330

322:                                              ; preds = %319
  %323 = load ptr, ptr %24, align 8, !tbaa !11
  %324 = getelementptr inbounds [9 x [9 x i32]], ptr %323, i64 0, i64 0
  %325 = load i32, ptr %27, align 4, !tbaa !5
  %326 = or i32 6, %325
  %327 = sext i32 %326 to i64
  %328 = getelementptr inbounds [9 x i32], ptr %324, i64 0, i64 %327
  %329 = load i32, ptr %328, align 4, !tbaa !5
  call void @_Z7mod_incRii(ptr noundef nonnull align 4 dereferenceable(4) %20, i32 noundef %329)
  br label %330

330:                                              ; preds = %322, %319
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #5
  %331 = load i32, ptr @n, align 4, !tbaa !5
  %332 = and i32 %331, 1
  %333 = icmp ne i32 %332, 0
  br i1 %333, label %334, label %336

334:                                              ; preds = %330
  %335 = load i32, ptr %26, align 4, !tbaa !5
  br label %337

336:                                              ; preds = %330
  br label %337

337:                                              ; preds = %336, %334
  %338 = phi i32 [ %335, %334 ], [ 0, %336 ]
  store i32 %338, ptr %28, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #5
  %339 = load i32, ptr %28, align 4, !tbaa !5
  %340 = load i32, ptr %25, align 4, !tbaa !5
  %341 = xor i32 %339, %340
  %342 = load i32, ptr %26, align 4, !tbaa !5
  %343 = xor i32 %341, %342
  store i32 %343, ptr %29, align 4, !tbaa !5
  %344 = load i32, ptr %28, align 4, !tbaa !5
  %345 = load i32, ptr %27, align 4, !tbaa !5
  %346 = icmp eq i32 %344, %345
  %347 = zext i1 %346 to i32
  %348 = load i8, ptr %21, align 1, !tbaa !23, !range !25, !noundef !26
  %349 = trunc i8 %348 to i1
  %350 = zext i1 %349 to i32
  %351 = and i32 %350, %347
  %352 = icmp ne i32 %351, 0
  %353 = zext i1 %352 to i8
  store i8 %353, ptr %21, align 1, !tbaa !23
  %354 = load i32, ptr %29, align 4, !tbaa !5
  %355 = load i32, ptr %27, align 4, !tbaa !5
  %356 = icmp eq i32 %354, %355
  %357 = zext i1 %356 to i32
  %358 = load i8, ptr %22, align 1, !tbaa !23, !range !25, !noundef !26
  %359 = trunc i8 %358 to i1
  %360 = zext i1 %359 to i32
  %361 = and i32 %360, %357
  %362 = icmp ne i32 %361, 0
  %363 = zext i1 %362 to i8
  store i8 %363, ptr %22, align 1, !tbaa !23
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #5
  br label %364

364:                                              ; preds = %337
  %365 = load i32, ptr %23, align 4, !tbaa !5
  %366 = add nsw i32 %365, -1
  store i32 %366, ptr %23, align 4, !tbaa !5
  br label %271, !llvm.loop !27

367:                                              ; preds = %284
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #5
  store ptr @f, ptr %30, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #5
  %368 = load i32, ptr %19, align 4, !tbaa !5
  %369 = and i32 %368, 1
  store i32 %369, ptr %31, align 4, !tbaa !5
  %370 = load i8, ptr %21, align 1, !tbaa !23, !range !25, !noundef !26
  %371 = trunc i8 %370 to i1
  br i1 %371, label %372, label %377

372:                                              ; preds = %367
  %373 = load i32, ptr %31, align 4, !tbaa !5
  %374 = sext i32 %373 to i64
  %375 = getelementptr inbounds [9 x i32], ptr @f, i64 0, i64 %374
  %376 = load i32, ptr %375, align 4, !tbaa !5
  call void @_Z7mod_incRii(ptr noundef nonnull align 4 dereferenceable(4) %20, i32 noundef %376)
  br label %377

377:                                              ; preds = %372, %367
  %378 = load i8, ptr %22, align 1, !tbaa !23, !range !25, !noundef !26
  %379 = trunc i8 %378 to i1
  br i1 %379, label %380, label %386

380:                                              ; preds = %377
  %381 = load i32, ptr %31, align 4, !tbaa !5
  %382 = or i32 4, %381
  %383 = sext i32 %382 to i64
  %384 = getelementptr inbounds [9 x i32], ptr @f, i64 0, i64 %383
  %385 = load i32, ptr %384, align 4, !tbaa !5
  call void @_Z7mod_incRii(ptr noundef nonnull align 4 dereferenceable(4) %20, i32 noundef %385)
  br label %386

386:                                              ; preds = %380, %377
  %387 = load i32, ptr %20, align 4, !tbaa !5
  %388 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, i32 noundef %387)
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  store i32 0, ptr %4, align 4
  br label %389

389:                                              ; preds = %386, %266, %261
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #5
  %390 = load i32, ptr %4, align 4
  switch i32 %390, label %394 [
    i32 0, label %391
    i32 34, label %251
  ]

391:                                              ; preds = %389
  br label %251, !llvm.loop !22

392:                                              ; preds = %251
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  br label %33, !llvm.loop !28

393:                                              ; preds = %33
  ret i32 0

394:                                              ; preds = %389
  unreachable
}

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

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

declare i32 @puts(ptr noundef) #3

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { 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 = !{!"any pointer", !7, i64 0}
!13 = distinct !{!13, !10}
!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 = distinct !{!20, !10}
!21 = distinct !{!21, !10}
!22 = distinct !{!22, !10}
!23 = !{!24, !24, i64 0}
!24 = !{!"bool", !7, i64 0}
!25 = !{i8 0, i8 2}
!26 = !{}
!27 = distinct !{!27, !10}
!28 = distinct !{!28, !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"

@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@L = external dso_local global i32, align 4
@R = external dso_local global i32, align 4
@q = external dso_local global i32, align 4
@f = external dso_local global [30 x [9 x [9 x i32]]], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [4 x i8], align 1

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

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

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

; Function Attrs: mustprogress norecurse nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @t)
  %4 = load i32, ptr @t, align 4, !tbaa !5
  %5 = add nsw i32 %4, -1
  store i32 %5, ptr @t, align 4, !tbaa !5
  %.not136 = icmp eq i32 %4, 0
  br i1 %.not136, label %._crit_edge, label %.lr.ph137

.loopexit117:                                     ; preds = %157, %.preheader116
  %6 = load i32, ptr @t, align 4, !tbaa !5
  %7 = add nsw i32 %6, -1
  store i32 %7, ptr @t, align 4, !tbaa !5
  %.not = icmp eq i32 %6, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph137, !llvm.loop !9

.lr.ph137:                                        ; preds = %0, %.loopexit117
  %8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @n, ptr noundef nonnull @L, ptr noundef nonnull @R, ptr noundef nonnull @q)
  %9 = load i32, ptr @R, align 4, !tbaa !5
  br label %10

10:                                               ; preds = %10, %.lr.ph137
  %indvars.iv = phi i64 [ %indvars.iv.next, %10 ], [ 0, %.lr.ph137 ]
  %.0 = phi i32 [ %12, %10 ], [ 0, %.lr.ph137 ]
  %11 = shl nuw i32 1, %.0
  %.not103 = icmp sgt i32 %11, %9
  %12 = add nuw nsw i32 %.0, 1
  %indvars.iv.next = add nuw i64 %indvars.iv, 1
  br i1 %.not103, label %.preheader118, label %10, !llvm.loop !11

.preheader118:                                    ; preds = %10
  %.not138 = icmp eq i32 %.0, 0
  br i1 %.not138, label %.preheader116, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %.preheader118
  %wide.trip.count = zext nneg i32 %.0 to i64
  br label %.lr.ph

.preheader116:                                    ; preds = %.loopexit, %.preheader118
  %13 = load i32, ptr @q, align 4, !tbaa !5
  %14 = add nsw i32 %13, -1
  store i32 %14, ptr @q, align 4, !tbaa !5
  %.not104134 = icmp eq i32 %13, 0
  br i1 %.not104134, label %.loopexit117, label %.lr.ph135

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.loopexit
  %indvar = phi i64 [ 0, %.lr.ph.preheader ], [ %indvar.next, %.loopexit ]
  %15 = mul nuw nsw i64 %indvar, 324
  %scevgep = getelementptr i8, ptr @f, i64 %15
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(32) %scevgep, i8 0, i64 32, i1 false), !tbaa !5
  %gep = getelementptr i8, ptr getelementptr inbounds (i8, ptr @f, i64 36), i64 %15
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(32) %gep, i8 0, i64 32, i1 false), !tbaa !5
  %gep163 = getelementptr i8, ptr getelementptr inbounds (i8, ptr @f, i64 72), i64 %15
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(32) %gep163, i8 0, i64 32, i1 false), !tbaa !5
  %gep164 = getelementptr i8, ptr getelementptr inbounds (i8, ptr @f, i64 108), i64 %15
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(32) %gep164, i8 0, i64 32, i1 false), !tbaa !5
  %gep165 = getelementptr i8, ptr getelementptr inbounds (i8, ptr @f, i64 144), i64 %15
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(32) %gep165, i8 0, i64 32, i1 false), !tbaa !5
  %gep166 = getelementptr i8, ptr getelementptr inbounds (i8, ptr @f, i64 180), i64 %15
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(32) %gep166, i8 0, i64 32, i1 false), !tbaa !5
  %gep167 = getelementptr i8, ptr getelementptr inbounds (i8, ptr @f, i64 216), i64 %15
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(32) %gep167, i8 0, i64 32, i1 false), !tbaa !5
  %gep168 = getelementptr i8, ptr getelementptr inbounds (i8, ptr @f, i64 252), i64 %15
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(32) %gep168, i8 0, i64 32, i1 false), !tbaa !5
  %16 = trunc nuw nsw i64 %indvar to i32
  %17 = shl nuw i32 1, %16
  %18 = load i32, ptr @R, align 4, !tbaa !5
  %19 = and i32 %18, %17
  %20 = icmp sgt i32 %19, 0
  %21 = zext i1 %20 to i32
  %22 = add nsw i32 %17, -1
  %23 = and i32 %18, %22
  %24 = add nsw i32 %23, 1
  %25 = zext i1 %20 to i64
  %26 = getelementptr inbounds [30 x [9 x [9 x i32]]], ptr @f, i64 0, i64 %indvar, i64 0, i64 %25
  call void @_Z7mod_incRii(ptr noundef nonnull align 4 dereferenceable(4) %26, i32 noundef %24)
  %27 = xor i32 %21, 1
  %28 = zext nneg i32 %27 to i64
  %29 = getelementptr inbounds [30 x [9 x [9 x i32]]], ptr @f, i64 0, i64 %indvar, i64 1, i64 %28
  call void @_Z7mod_incRii(ptr noundef nonnull align 4 dereferenceable(4) %29, i32 noundef %24)
  %30 = or disjoint i32 %21, 2
  %31 = zext nneg i32 %30 to i64
  %32 = getelementptr inbounds [30 x [9 x [9 x i32]]], ptr @f, i64 0, i64 %indvar, i64 2, i64 %31
  call void @_Z7mod_incRii(ptr noundef nonnull align 4 dereferenceable(4) %32, i32 noundef %24)
  %33 = xor i32 %21, 3
  %34 = zext nneg i32 %33 to i64
  %35 = getelementptr inbounds [30 x [9 x [9 x i32]]], ptr @f, i64 0, i64 %indvar, i64 3, i64 %34
  call void @_Z7mod_incRii(ptr noundef nonnull align 4 dereferenceable(4) %35, i32 noundef %24)
  %36 = getelementptr inbounds [30 x [9 x [9 x i32]]], ptr @f, i64 0, i64 %indvar
  br i1 %20, label %.preheader114.preheader, label %.loopexit115

.preheader114.preheader:                          ; preds = %.lr.ph
  %37 = getelementptr inbounds [30 x [9 x [9 x i32]]], ptr @f, i64 0, i64 %indvar, i64 0, i64 2
  call void @_Z7mod_incRii(ptr noundef nonnull align 4 dereferenceable(4) %37, i32 noundef 1)
  %38 = getelementptr inbounds [30 x [9 x [9 x i32]]], ptr @f, i64 0, i64 %indvar, i64 1, i64 3
  call void @_Z7mod_incRii(ptr noundef nonnull align 4 dereferenceable(4) %38, i32 noundef 1)
  %39 = getelementptr inbounds [30 x [9 x [9 x i32]]], ptr @f, i64 0, i64 %indvar, i64 2, i64 2
  call void @_Z7mod_incRii(ptr noundef nonnull align 4 dereferenceable(4) %39, i32 noundef %17)
  %40 = getelementptr inbounds [30 x [9 x [9 x i32]]], ptr @f, i64 0, i64 %indvar, i64 3, i64 3
  call void @_Z7mod_incRii(ptr noundef nonnull align 4 dereferenceable(4) %40, i32 noundef %17)
  br label %.loopexit115

.loopexit115:                                     ; preds = %.preheader114.preheader, %.lr.ph
  %41 = load i32, ptr @L, align 4, !tbaa !5
  %.not109 = icmp eq i32 %41, 0
  br i1 %.not109, label %.loopexit, label %42

42:                                               ; preds = %.loopexit115
  %43 = add nsw i32 %41, -1
  %44 = and i32 %43, %17
  %45 = icmp sgt i32 %44, 0
  %46 = zext i1 %45 to i32
  %47 = and i32 %43, %22
  %48 = sub nsw i32 1000000006, %47
  %49 = or disjoint i32 %46, 4
  %50 = zext nneg i32 %49 to i64
  %51 = getelementptr inbounds [30 x [9 x [9 x i32]]], ptr @f, i64 0, i64 %indvar, i64 0, i64 %50
  call void @_Z7mod_incRii(ptr noundef nonnull align 4 dereferenceable(4) %51, i32 noundef %48)
  %52 = xor i32 %46, 5
  %53 = zext nneg i32 %52 to i64
  %54 = getelementptr inbounds [30 x [9 x [9 x i32]]], ptr @f, i64 0, i64 %indvar, i64 1, i64 %53
  call void @_Z7mod_incRii(ptr noundef nonnull align 4 dereferenceable(4) %54, i32 noundef %48)
  %55 = or disjoint i32 %46, 6
  %56 = zext nneg i32 %55 to i64
  %57 = getelementptr inbounds [30 x [9 x [9 x i32]]], ptr @f, i64 0, i64 %indvar, i64 2, i64 %56
  call void @_Z7mod_incRii(ptr noundef nonnull align 4 dereferenceable(4) %57, i32 noundef %48)
  %58 = xor i32 %46, 7
  %59 = zext nneg i32 %58 to i64
  %60 = getelementptr inbounds [30 x [9 x [9 x i32]]], ptr @f, i64 0, i64 %indvar, i64 3, i64 %59
  call void @_Z7mod_incRii(ptr noundef nonnull align 4 dereferenceable(4) %60, i32 noundef %48)
  br i1 %45, label %.preheader113, label %.loopexit

.preheader113:                                    ; preds = %42
  %61 = sub nsw i32 1000000007, %17
  %62 = getelementptr inbounds [30 x [9 x [9 x i32]]], ptr @f, i64 0, i64 %indvar, i64 0, i64 6
  call void @_Z7mod_incRii(ptr noundef nonnull align 4 dereferenceable(4) %62, i32 noundef 1000000006)
  %63 = getelementptr inbounds [30 x [9 x [9 x i32]]], ptr @f, i64 0, i64 %indvar, i64 1, i64 7
  call void @_Z7mod_incRii(ptr noundef nonnull align 4 dereferenceable(4) %63, i32 noundef 1000000006)
  %64 = getelementptr inbounds [30 x [9 x [9 x i32]]], ptr @f, i64 0, i64 %indvar, i64 2, i64 6
  call void @_Z7mod_incRii(ptr noundef nonnull align 4 dereferenceable(4) %64, i32 noundef %61)
  %65 = getelementptr inbounds [30 x [9 x [9 x i32]]], ptr @f, i64 0, i64 %indvar, i64 3, i64 7
  call void @_Z7mod_incRii(ptr noundef nonnull align 4 dereferenceable(4) %65, i32 noundef %61)
  br label %.loopexit

.loopexit:                                        ; preds = %.preheader113, %42, %.loopexit115
  %66 = getelementptr inbounds [30 x [9 x [9 x i32]]], ptr @f, i64 0, i64 %indvar, i64 0, i64 4
  %67 = getelementptr inbounds [30 x [9 x [9 x i32]]], ptr @f, i64 0, i64 %indvar, i64 4, i64 0
  %68 = load <4 x i32>, ptr %66, align 4, !tbaa !5
  store <4 x i32> %68, ptr %67, align 4, !tbaa !5
  %69 = getelementptr inbounds [30 x [9 x [9 x i32]]], ptr @f, i64 0, i64 %indvar, i64 4, i64 4
  %70 = load <4 x i32>, ptr %36, align 4, !tbaa !5
  store <4 x i32> %70, ptr %69, align 4, !tbaa !5
  %71 = getelementptr inbounds [30 x [9 x [9 x i32]]], ptr @f, i64 0, i64 %indvar, i64 1, i64 4
  %72 = getelementptr inbounds [30 x [9 x [9 x i32]]], ptr @f, i64 0, i64 %indvar, i64 5, i64 0
  %73 = load <4 x i32>, ptr %71, align 4, !tbaa !5
  store <4 x i32> %73, ptr %72, align 4, !tbaa !5
  %74 = getelementptr inbounds [30 x [9 x [9 x i32]]], ptr @f, i64 0, i64 %indvar, i64 1, i64 0
  %75 = getelementptr inbounds [30 x [9 x [9 x i32]]], ptr @f, i64 0, i64 %indvar, i64 5, i64 4
  %76 = load <4 x i32>, ptr %74, align 4, !tbaa !5
  store <4 x i32> %76, ptr %75, align 4, !tbaa !5
  %77 = getelementptr inbounds [30 x [9 x [9 x i32]]], ptr @f, i64 0, i64 %indvar, i64 2, i64 4
  %78 = getelementptr inbounds [30 x [9 x [9 x i32]]], ptr @f, i64 0, i64 %indvar, i64 6, i64 0
  %79 = load <4 x i32>, ptr %77, align 4, !tbaa !5
  store <4 x i32> %79, ptr %78, align 4, !tbaa !5
  %80 = getelementptr inbounds [30 x [9 x [9 x i32]]], ptr @f, i64 0, i64 %indvar, i64 2, i64 0
  %81 = getelementptr inbounds [30 x [9 x [9 x i32]]], ptr @f, i64 0, i64 %indvar, i64 6, i64 4
  %82 = load <4 x i32>, ptr %80, align 4, !tbaa !5
  store <4 x i32> %82, ptr %81, align 4, !tbaa !5
  %83 = getelementptr inbounds [30 x [9 x [9 x i32]]], ptr @f, i64 0, i64 %indvar, i64 3, i64 4
  %84 = getelementptr inbounds [30 x [9 x [9 x i32]]], ptr @f, i64 0, i64 %indvar, i64 7, i64 0
  %85 = load <4 x i32>, ptr %83, align 4, !tbaa !5
  store <4 x i32> %85, ptr %84, align 4, !tbaa !5
  %86 = getelementptr inbounds [30 x [9 x [9 x i32]]], ptr @f, i64 0, i64 %indvar, i64 3, i64 0
  %87 = getelementptr inbounds [30 x [9 x [9 x i32]]], ptr @f, i64 0, i64 %indvar, i64 7, i64 4
  %88 = load <4 x i32>, ptr %86, align 4, !tbaa !5
  store <4 x i32> %88, ptr %87, align 4, !tbaa !5
  %89 = load i32, ptr @n, align 4, !tbaa !5
  call void @_Z6matPowRA9_A9_ii(ptr noundef nonnull align 4 dereferenceable(324) %36, i32 noundef %89)
  %indvar.next = add nuw nsw i64 %indvar, 1
  %exitcond.not = icmp eq i64 %indvar.next, %wide.trip.count
  br i1 %exitcond.not, label %.preheader116, label %.lr.ph, !llvm.loop !12

.lr.ph135:                                        ; preds = %.preheader116, %157
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  %90 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  %91 = load i32, ptr %1, align 4, !tbaa !5
  %.not105 = icmp slt i32 %91, %11
  br i1 %.not105, label %94, label %92

92:                                               ; preds = %.lr.ph135
  %93 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.2)
  br label %157, !llvm.loop !13

94:                                               ; preds = %.lr.ph135
  %95 = load i32, ptr @R, align 4, !tbaa !5
  %.not106 = icmp eq i32 %95, 0
  br i1 %.not106, label %96, label %98

96:                                               ; preds = %94
  %97 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.3)
  br label %157, !llvm.loop !13

98:                                               ; preds = %94
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  store i32 0, ptr %2, align 4, !tbaa !5
  br i1 %.not138, label %.thread, label %.lr.ph132

.thread:                                          ; preds = %98
  %99 = and i32 %91, 1
  %100 = zext nneg i32 %99 to i64
  %101 = getelementptr inbounds [9 x i32], ptr @f, i64 0, i64 %100
  %102 = load i32, ptr %101, align 4, !tbaa !5
  call void @_Z7mod_incRii(ptr noundef nonnull align 4 dereferenceable(4) %2, i32 noundef %102)
  br label %148

.critedge:                                        ; preds = %131
  %.pre = load i32, ptr %1, align 4, !tbaa !5
  %103 = and i32 %.pre, 1
  br i1 %138, label %143, label %147

.lr.ph132:                                        ; preds = %98, %131
  %indvars.iv154 = phi i64 [ %indvars.iv.next155, %131 ], [ %indvars.iv, %98 ]
  %.095130 = phi i1 [ %140, %131 ], [ true, %98 ]
  %.096129 = phi i1 [ %138, %131 ], [ true, %98 ]
  %104 = trunc nuw i64 %indvars.iv154 to i32
  %.094131 = add nsw i32 %104, -1
  %105 = zext nneg i32 %.094131 to i64
  %106 = getelementptr inbounds [30 x [9 x [9 x i32]]], ptr @f, i64 0, i64 %105
  %107 = load i32, ptr @L, align 4, !tbaa !5
  %.not107 = icmp ne i32 %107, 0
  %108 = add nsw i32 %107, -1
  %109 = shl nuw i32 1, %.094131
  %110 = and i32 %108, %109
  %111 = icmp ne i32 %110, 0
  %112 = select i1 %.not107, i1 %111, i1 false
  %113 = zext i1 %112 to i32
  %114 = load i32, ptr @R, align 4, !tbaa !5
  %115 = lshr i32 %114, %.094131
  %116 = and i32 %115, 1
  %117 = load i32, ptr %1, align 4, !tbaa !5
  %118 = lshr i32 %117, %.094131
  %119 = and i32 %118, 1
  br i1 %.096129, label %120, label %125

120:                                              ; preds = %.lr.ph132
  %121 = or disjoint i32 %119, 2
  %122 = zext nneg i32 %121 to i64
  %123 = getelementptr inbounds [9 x i32], ptr %106, i64 0, i64 %122
  %124 = load i32, ptr %123, align 4, !tbaa !5
  call void @_Z7mod_incRii(ptr noundef nonnull align 4 dereferenceable(4) %2, i32 noundef %124)
  br label %125

125:                                              ; preds = %120, %.lr.ph132
  br i1 %.095130, label %126, label %131

126:                                              ; preds = %125
  %127 = or disjoint i32 %119, 6
  %128 = zext nneg i32 %127 to i64
  %129 = getelementptr inbounds [9 x i32], ptr %106, i64 0, i64 %128
  %130 = load i32, ptr %129, align 4, !tbaa !5
  call void @_Z7mod_incRii(ptr noundef nonnull align 4 dereferenceable(4) %2, i32 noundef %130)
  br label %131

131:                                              ; preds = %126, %125
  %132 = load i32, ptr @n, align 4, !tbaa !5
  %133 = and i32 %132, 1
  %.not108 = icmp eq i32 %133, 0
  %134 = select i1 %.not108, i32 0, i32 %116
  %135 = xor i32 %116, %113
  %136 = xor i32 %135, %134
  %137 = icmp eq i32 %134, %119
  %138 = and i1 %.096129, %137
  %139 = icmp eq i32 %136, %119
  %140 = and i1 %.095130, %139
  %141 = icmp sgt i64 %indvars.iv154, 1
  %142 = select i1 %138, i1 true, i1 %140
  %or.cond = select i1 %141, i1 %142, i1 false
  %indvars.iv.next155 = add nsw i64 %indvars.iv154, -1
  br i1 %or.cond, label %.lr.ph132, label %.critedge, !llvm.loop !14

143:                                              ; preds = %.critedge
  %144 = zext nneg i32 %103 to i64
  %145 = getelementptr inbounds [9 x i32], ptr @f, i64 0, i64 %144
  %146 = load i32, ptr %145, align 4, !tbaa !5
  call void @_Z7mod_incRii(ptr noundef nonnull align 4 dereferenceable(4) %2, i32 noundef %146)
  br i1 %140, label %148, label %154

147:                                              ; preds = %.critedge
  br i1 %140, label %148, label %154

148:                                              ; preds = %.thread, %143, %147
  %149 = phi i32 [ %103, %143 ], [ %103, %147 ], [ %99, %.thread ]
  %150 = or disjoint i32 %149, 4
  %151 = zext nneg i32 %150 to i64
  %152 = getelementptr inbounds [9 x i32], ptr @f, i64 0, i64 %151
  %153 = load i32, ptr %152, align 4, !tbaa !5
  call void @_Z7mod_incRii(ptr noundef nonnull align 4 dereferenceable(4) %2, i32 noundef %153)
  br label %154

154:                                              ; preds = %143, %148, %147
  %155 = load i32, ptr %2, align 4, !tbaa !5
  %156 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %155)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  br label %157

157:                                              ; preds = %154, %96, %92
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  %158 = load i32, ptr @q, align 4, !tbaa !5
  %159 = add nsw i32 %158, -1
  store i32 %159, ptr @q, align 4, !tbaa !5
  %.not104 = icmp eq i32 %158, 0
  br i1 %.not104, label %.loopexit117, label %.lr.ph135

._crit_edge:                                      ; preds = %.loopexit117, %0
  ret i32 0
}

; 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 void @_Z7mod_incRii(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) local_unnamed_addr #4

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

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { mustprogress norecurse 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 #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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 = distinct !{!13, !10}
!14 = distinct !{!14, !10}


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