; LLVM IR from tangjz/acm-icpc :: TDL_training/2016-03-13/B - High-Speed Pedestrian walkway 1.0 - tjz (main)

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

@m = external dso_local global i32, align 4
@c = external dso_local global [10 x i32], align 16
@n = external dso_local global i64, align 8
@A = external dso_local global %struct.Matrix, align 4
@B = external dso_local global %struct.Matrix, align 4
@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca %struct.Matrix, align 4
  %11 = alloca i32, align 4
  %12 = alloca %struct.Matrix, align 4
  store i32 0, ptr %1, align 4
  br label %13

13:                                               ; preds = %251, %0
  %14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @m)
  %15 = icmp eq i32 %14, 2
  br i1 %15, label %16, label %259

16:                                               ; preds = %13
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #9
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %17

17:                                               ; preds = %27, %16
  %18 = load i32, ptr %2, align 4, !tbaa !5
  %19 = load i32, ptr @m, align 4, !tbaa !5
  %20 = icmp sle i32 %18, %19
  br i1 %20, label %22, label %21

21:                                               ; preds = %17
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #9
  br label %30

22:                                               ; preds = %17
  %23 = load i32, ptr %2, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds i32, ptr @c, i64 %24
  %26 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %25)
  br label %27

27:                                               ; preds = %22
  %28 = load i32, ptr %2, align 4, !tbaa !5
  %29 = add nsw i32 %28, 1
  store i32 %29, ptr %2, align 4, !tbaa !5
  br label %17, !llvm.loop !9

30:                                               ; preds = %21
  br label %31

31:                                               ; preds = %44, %30
  %32 = load i32, ptr @m, align 4, !tbaa !5
  %33 = icmp sgt i32 %32, 1
  br i1 %33, label %34, label %41

34:                                               ; preds = %31
  %35 = load i32, ptr @m, align 4, !tbaa !5
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [10 x i32], ptr @c, i64 0, i64 %36
  %38 = load i32, ptr %37, align 4, !tbaa !5
  %39 = icmp ne i32 %38, 0
  %40 = xor i1 %39, true
  br label %41

41:                                               ; preds = %34, %31
  %42 = phi i1 [ false, %31 ], [ %40, %34 ]
  br i1 %42, label %43, label %47

43:                                               ; preds = %41
  br label %44

44:                                               ; preds = %43
  %45 = load i32, ptr @m, align 4, !tbaa !5
  %46 = add nsw i32 %45, -1
  store i32 %46, ptr @m, align 4, !tbaa !5
  br label %31, !llvm.loop !11

47:                                               ; preds = %41
  %48 = load i32, ptr @m, align 4, !tbaa !5
  %49 = load i32, ptr @m, align 4, !tbaa !5
  %50 = add nsw i32 %49, 1
  %51 = mul nsw i32 %48, %50
  store i32 %51, ptr getelementptr inbounds (%struct.Matrix, ptr @A, i32 0, i32 1), align 4, !tbaa !12
  store i32 %51, ptr @A, align 4, !tbaa !14
  call void @llvm.memset.p0.i64(ptr align 4 getelementptr inbounds (%struct.Matrix, ptr @A, i32 0, i32 2), i8 0, i64 40000, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #9
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %52

52:                                               ; preds = %130, %47
  %53 = load i32, ptr %3, align 4, !tbaa !5
  %54 = load i32, ptr @m, align 4, !tbaa !5
  %55 = icmp sle i32 %53, %54
  br i1 %55, label %57, label %56

56:                                               ; preds = %52
  store i32 10, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #9
  br label %133

57:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #9
  store i32 1, ptr %5, align 4, !tbaa !5
  br label %58

58:                                               ; preds = %126, %57
  %59 = load i32, ptr %5, align 4, !tbaa !5
  %60 = load i32, ptr @m, align 4, !tbaa !5
  %61 = icmp sle i32 %59, %60
  br i1 %61, label %63, label %62

62:                                               ; preds = %58
  store i32 13, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #9
  br label %129

63:                                               ; preds = %58
  %64 = load i32, ptr @m, align 4, !tbaa !5
  %65 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %66 = load i32, ptr %65, align 4, !tbaa !5
  %67 = sub nsw i32 %64, %66
  %68 = load i32, ptr %3, align 4, !tbaa !5
  %69 = call noundef i32 @_Z3idxii(i32 noundef %67, i32 noundef %68)
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [100 x [100 x i32]], ptr getelementptr inbounds (%struct.Matrix, ptr @A, i32 0, i32 2), i64 0, i64 %70
  %72 = load i32, ptr @m, align 4, !tbaa !5
  %73 = sub nsw i32 %72, 1
  %74 = load i32, ptr %3, align 4, !tbaa !5
  %75 = load i32, ptr %5, align 4, !tbaa !5
  %76 = sub nsw i32 %74, %75
  %77 = call i32 @llvm.abs.i32(i32 %76, i1 true)
  %78 = call noundef i32 @_Z3idxii(i32 noundef %73, i32 noundef %77)
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [100 x i32], ptr %71, i64 0, i64 %79
  %81 = load i32, ptr %5, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [10 x i32], ptr @c, i64 0, i64 %82
  %84 = load i32, ptr %83, align 4, !tbaa !5
  call void @_Z3incRii(ptr noundef nonnull align 4 dereferenceable(4) %80, i32 noundef %84)
  %85 = load i32, ptr %3, align 4, !tbaa !5
  %86 = load i32, ptr %5, align 4, !tbaa !5
  %87 = icmp eq i32 %85, %86
  br i1 %87, label %88, label %125

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

89:                                               ; preds = %121, %88
  %90 = load i32, ptr %6, align 4, !tbaa !5
  %91 = load i32, ptr @m, align 4, !tbaa !5
  %92 = icmp sle i32 %90, %91
  br i1 %92, label %94, label %93

93:                                               ; preds = %89
  store i32 16, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #9
  br label %124

94:                                               ; preds = %89
  %95 = load i32, ptr @m, align 4, !tbaa !5
  %96 = load i32, ptr %3, align 4, !tbaa !5
  %97 = sub nsw i32 %95, %96
  %98 = load i32, ptr %3, align 4, !tbaa !5
  %99 = call noundef i32 @_Z3idxii(i32 noundef %97, i32 noundef %98)
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [100 x [100 x i32]], ptr getelementptr inbounds (%struct.Matrix, ptr @A, i32 0, i32 2), i64 0, i64 %100
  %102 = load i32, ptr @m, align 4, !tbaa !5
  %103 = sub nsw i32 %102, 1
  %104 = load i32, ptr %6, align 4, !tbaa !5
  %105 = call noundef i32 @_Z3idxii(i32 noundef %103, i32 noundef %104)
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [100 x i32], ptr %101, i64 0, i64 %106
  %108 = load i32, ptr %5, align 4, !tbaa !5
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [10 x i32], ptr @c, i64 0, i64 %109
  %111 = load i32, ptr %110, align 4, !tbaa !5
  %112 = sext i32 %111 to i64
  %113 = load i32, ptr %6, align 4, !tbaa !5
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [10 x i32], ptr @c, i64 0, i64 %114
  %116 = load i32, ptr %115, align 4, !tbaa !5
  %117 = sext i32 %116 to i64
  %118 = mul nsw i64 %112, %117
  %119 = srem i64 %118, 1000000009
  %120 = trunc i64 %119 to i32
  call void @_Z3incRii(ptr noundef nonnull align 4 dereferenceable(4) %107, i32 noundef %120)
  br label %121

121:                                              ; preds = %94
  %122 = load i32, ptr %6, align 4, !tbaa !5
  %123 = add nsw i32 %122, 1
  store i32 %123, ptr %6, align 4, !tbaa !5
  br label %89, !llvm.loop !15

124:                                              ; preds = %93
  br label %125

125:                                              ; preds = %124, %63
  br label %126

126:                                              ; preds = %125
  %127 = load i32, ptr %5, align 4, !tbaa !5
  %128 = add nsw i32 %127, 1
  store i32 %128, ptr %5, align 4, !tbaa !5
  br label %58, !llvm.loop !16

129:                                              ; preds = %62
  br label %130

130:                                              ; preds = %129
  %131 = load i32, ptr %3, align 4, !tbaa !5
  %132 = add nsw i32 %131, 1
  store i32 %132, ptr %3, align 4, !tbaa !5
  br label %52, !llvm.loop !17

133:                                              ; preds = %56
  %134 = load i32, ptr @m, align 4, !tbaa !5
  %135 = sub nsw i32 %134, 1
  %136 = call noundef i32 @_Z3idxii(i32 noundef %135, i32 noundef 0)
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds [100 x [100 x i32]], ptr getelementptr inbounds (%struct.Matrix, ptr @A, i32 0, i32 2), i64 0, i64 %137
  %139 = load i32, ptr @m, align 4, !tbaa !5
  %140 = sub nsw i32 %139, 1
  %141 = call noundef i32 @_Z3idxii(i32 noundef %140, i32 noundef 0)
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds [100 x i32], ptr %138, i64 0, i64 %142
  %144 = load i32, ptr getelementptr inbounds ([10 x i32], ptr @c, i64 0, i64 2), align 8, !tbaa !5
  call void @_Z3incRii(ptr noundef nonnull align 4 dereferenceable(4) %143, i32 noundef %144)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #9
  store i32 1, ptr %7, align 4, !tbaa !5
  br label %145

145:                                              ; preds = %172, %133
  %146 = load i32, ptr %7, align 4, !tbaa !5
  %147 = load i32, ptr @m, align 4, !tbaa !5
  %148 = icmp sle i32 %146, %147
  br i1 %148, label %150, label %149

149:                                              ; preds = %145
  store i32 19, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #9
  br label %175

150:                                              ; preds = %145
  %151 = load i32, ptr @m, align 4, !tbaa !5
  %152 = sub nsw i32 %151, 1
  %153 = call noundef i32 @_Z3idxii(i32 noundef %152, i32 noundef 0)
  %154 = sext i32 %153 to i64
  %155 = getelementptr inbounds [100 x [100 x i32]], ptr getelementptr inbounds (%struct.Matrix, ptr @A, i32 0, i32 2), i64 0, i64 %154
  %156 = load i32, ptr @m, align 4, !tbaa !5
  %157 = sub nsw i32 %156, 1
  %158 = load i32, ptr %7, align 4, !tbaa !5
  %159 = call noundef i32 @_Z3idxii(i32 noundef %157, i32 noundef %158)
  %160 = sext i32 %159 to i64
  %161 = getelementptr inbounds [100 x i32], ptr %155, i64 0, i64 %160
  %162 = load i32, ptr getelementptr inbounds ([10 x i32], ptr @c, i64 0, i64 2), align 8, !tbaa !5
  %163 = sext i32 %162 to i64
  %164 = load i32, ptr %7, align 4, !tbaa !5
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds [10 x i32], ptr @c, i64 0, i64 %165
  %167 = load i32, ptr %166, align 4, !tbaa !5
  %168 = sext i32 %167 to i64
  %169 = mul nsw i64 %163, %168
  %170 = srem i64 %169, 1000000009
  %171 = trunc i64 %170 to i32
  call void @_Z3incRii(ptr noundef nonnull align 4 dereferenceable(4) %161, i32 noundef %171)
  br label %172

172:                                              ; preds = %150
  %173 = load i32, ptr %7, align 4, !tbaa !5
  %174 = add nsw i32 %173, 1
  store i32 %174, ptr %7, align 4, !tbaa !5
  br label %145, !llvm.loop !18

175:                                              ; preds = %149
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #9
  store i32 1, ptr %8, align 4, !tbaa !5
  br label %176

176:                                              ; preds = %207, %175
  %177 = load i32, ptr %8, align 4, !tbaa !5
  %178 = load i32, ptr @m, align 4, !tbaa !5
  %179 = icmp slt i32 %177, %178
  br i1 %179, label %181, label %180

180:                                              ; preds = %176
  store i32 22, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #9
  br label %210

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

182:                                              ; preds = %203, %181
  %183 = load i32, ptr %9, align 4, !tbaa !5
  %184 = load i32, ptr @m, align 4, !tbaa !5
  %185 = icmp sle i32 %183, %184
  br i1 %185, label %187, label %186

186:                                              ; preds = %182
  store i32 25, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #9
  br label %206

187:                                              ; preds = %182
  %188 = load i32, ptr @m, align 4, !tbaa !5
  %189 = load i32, ptr %8, align 4, !tbaa !5
  %190 = sub nsw i32 %188, %189
  %191 = load i32, ptr %9, align 4, !tbaa !5
  %192 = call noundef i32 @_Z3idxii(i32 noundef %190, i32 noundef %191)
  %193 = sext i32 %192 to i64
  %194 = getelementptr inbounds [100 x [100 x i32]], ptr getelementptr inbounds (%struct.Matrix, ptr @A, i32 0, i32 2), i64 0, i64 %193
  %195 = load i32, ptr @m, align 4, !tbaa !5
  %196 = load i32, ptr %8, align 4, !tbaa !5
  %197 = sub nsw i32 %195, %196
  %198 = sub nsw i32 %197, 1
  %199 = load i32, ptr %9, align 4, !tbaa !5
  %200 = call noundef i32 @_Z3idxii(i32 noundef %198, i32 noundef %199)
  %201 = sext i32 %200 to i64
  %202 = getelementptr inbounds [100 x i32], ptr %194, i64 0, i64 %201
  call void @_Z3incRii(ptr noundef nonnull align 4 dereferenceable(4) %202, i32 noundef 1)
  br label %203

203:                                              ; preds = %187
  %204 = load i32, ptr %9, align 4, !tbaa !5
  %205 = add nsw i32 %204, 1
  store i32 %205, ptr %9, align 4, !tbaa !5
  br label %182, !llvm.loop !19

206:                                              ; preds = %186
  br label %207

207:                                              ; preds = %206
  %208 = load i32, ptr %8, align 4, !tbaa !5
  %209 = add nsw i32 %208, 1
  store i32 %209, ptr %8, align 4, !tbaa !5
  br label %176, !llvm.loop !20

210:                                              ; preds = %180
  call void @llvm.lifetime.start.p0(i64 40008, ptr %10) #9
  %211 = load i64, ptr @n, align 8, !tbaa !21
  call void @_ZN6Matrix3powEx(ptr dead_on_unwind writable sret(%struct.Matrix) align 4 %10, ptr noundef nonnull align 4 dereferenceable(40008) @A, i64 noundef %211)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 @A, ptr align 4 %10, i64 40008, i1 false), !tbaa.struct !23
  call void @llvm.lifetime.end.p0(i64 40008, ptr %10) #9
  store i32 1, ptr @B, align 4, !tbaa !14
  %212 = load i32, ptr @m, align 4, !tbaa !5
  %213 = load i32, ptr @m, align 4, !tbaa !5
  %214 = add nsw i32 %213, 1
  %215 = mul nsw i32 %212, %214
  store i32 %215, ptr getelementptr inbounds (%struct.Matrix, ptr @B, i32 0, i32 1), align 4, !tbaa !12
  call void @llvm.memset.p0.i64(ptr align 4 getelementptr inbounds (%struct.Matrix, ptr @B, i32 0, i32 2), i8 0, i64 40000, i1 false)
  %216 = load i32, ptr @m, align 4, !tbaa !5
  %217 = sub nsw i32 %216, 1
  %218 = call noundef i32 @_Z3idxii(i32 noundef %217, i32 noundef 0)
  %219 = sext i32 %218 to i64
  %220 = getelementptr inbounds [100 x i32], ptr getelementptr inbounds (%struct.Matrix, ptr @B, i32 0, i32 2), i64 0, i64 %219
  store i32 1, ptr %220, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #9
  store i32 1, ptr %11, align 4, !tbaa !5
  br label %221

221:                                              ; preds = %248, %210
  %222 = load i32, ptr %11, align 4, !tbaa !5
  %223 = load i32, ptr @m, align 4, !tbaa !5
  %224 = icmp sle i32 %222, %223
  br i1 %224, label %226, label %225

225:                                              ; preds = %221
  store i32 28, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #9
  br label %251

226:                                              ; preds = %221
  %227 = load i32, ptr @m, align 4, !tbaa !5
  %228 = sub nsw i32 %227, 1
  %229 = load i32, ptr %11, align 4, !tbaa !5
  %230 = call noundef i32 @_Z3idxii(i32 noundef %228, i32 noundef %229)
  %231 = sext i32 %230 to i64
  %232 = getelementptr inbounds [100 x i32], ptr getelementptr inbounds (%struct.Matrix, ptr @B, i32 0, i32 2), i64 0, i64 %231
  %233 = load i32, ptr @m, align 4, !tbaa !5
  %234 = sub nsw i32 %233, 1
  %235 = call noundef i32 @_Z3idxii(i32 noundef %234, i32 noundef 0)
  %236 = sext i32 %235 to i64
  %237 = getelementptr inbounds [100 x i32], ptr getelementptr inbounds (%struct.Matrix, ptr @B, i32 0, i32 2), i64 0, i64 %236
  %238 = load i32, ptr %237, align 4, !tbaa !5
  %239 = sext i32 %238 to i64
  %240 = load i32, ptr %11, align 4, !tbaa !5
  %241 = sext i32 %240 to i64
  %242 = getelementptr inbounds [10 x i32], ptr @c, i64 0, i64 %241
  %243 = load i32, ptr %242, align 4, !tbaa !5
  %244 = sext i32 %243 to i64
  %245 = mul nsw i64 %239, %244
  %246 = srem i64 %245, 1000000009
  %247 = trunc i64 %246 to i32
  call void @_Z3incRii(ptr noundef nonnull align 4 dereferenceable(4) %232, i32 noundef %247)
  br label %248

248:                                              ; preds = %226
  %249 = load i32, ptr %11, align 4, !tbaa !5
  %250 = add nsw i32 %249, 1
  store i32 %250, ptr %11, align 4, !tbaa !5
  br label %221, !llvm.loop !25

251:                                              ; preds = %225
  call void @llvm.lifetime.start.p0(i64 40008, ptr %12) #9
  call void @_ZNK6MatrixmlERKS_(ptr dead_on_unwind writable sret(%struct.Matrix) align 4 %12, ptr noundef nonnull align 4 dereferenceable(40008) @B, ptr noundef nonnull align 4 dereferenceable(40008) @A)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 @B, ptr align 4 %12, i64 40008, i1 false), !tbaa.struct !23
  call void @llvm.lifetime.end.p0(i64 40008, ptr %12) #9
  %252 = load i32, ptr @m, align 4, !tbaa !5
  %253 = sub nsw i32 %252, 1
  %254 = call noundef i32 @_Z3idxii(i32 noundef %253, i32 noundef 0)
  %255 = sext i32 %254 to i64
  %256 = getelementptr inbounds [100 x i32], ptr getelementptr inbounds (%struct.Matrix, ptr @B, i32 0, i32 2), i64 0, i64 %255
  %257 = load i32, ptr %256, align 4, !tbaa !5
  %258 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %257)
  br label %13, !llvm.loop !26

259:                                              ; preds = %13
  ret i32 0
}

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

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

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

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

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

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #5

; 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(40008), i64 noundef) #6 align 2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #7

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNK6MatrixmlERKS_(ptr dead_on_unwind noalias writable sret(%struct.Matrix) align 4, ptr noundef nonnull align 4 dereferenceable(40008), ptr noundef nonnull align 4 dereferenceable(40008)) #8 align 2

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

attributes #0 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { "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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { 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 #7 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #8 = { 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 #9 = { 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, !6, i64 4}
!13 = !{!"_ZTS6Matrix", !6, i64 0, !6, i64 4, !7, i64 8}
!14 = !{!13, !6, i64 0}
!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 = !{!22, !22, i64 0}
!22 = !{!"long long", !7, i64 0}
!23 = !{i64 0, i64 4, !5, i64 4, i64 4, !5, i64 8, i64 40000, !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, [100 x [100 x i32]] }

@m = external dso_local global i32, align 4
@c = external dso_local global [10 x i32], align 16
@n = external dso_local global i64, align 8
@A = external dso_local global %struct.Matrix, align 4
@B = external dso_local global %struct.Matrix, align 4
@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca %struct.Matrix, align 4
  %4 = alloca %struct.Matrix, align 4
  %5 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @m)
  %6 = icmp eq i32 %5, 2
  br i1 %6, label %.preheader45, label %._crit_edge78

.preheader45:                                     ; preds = %0, %._crit_edge77
  %7 = load i32, ptr @m, align 4, !tbaa !5
  %.not48 = icmp slt i32 %7, 1
  br i1 %.not48, label %.critedge, label %.lr.ph

.preheader44:                                     ; preds = %.lr.ph
  %8 = icmp sgt i32 %11, 1
  br i1 %8, label %.lr.ph50, label %.critedge

.lr.ph:                                           ; preds = %.preheader45, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %.preheader45 ]
  %9 = getelementptr inbounds i32, ptr @c, i64 %indvars.iv
  %10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %9)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %11 = load i32, ptr @m, align 4, !tbaa !5
  %12 = sext i32 %11 to i64
  %.not.not = icmp slt i64 %indvars.iv, %12
  br i1 %.not.not, label %.lr.ph, label %.preheader44, !llvm.loop !9

.lr.ph50:                                         ; preds = %.preheader44, %17
  %13 = phi i32 [ %18, %17 ], [ %11, %.preheader44 ]
  %14 = zext nneg i32 %13 to i64
  %15 = getelementptr inbounds [10 x i32], ptr @c, i64 0, i64 %14
  %16 = load i32, ptr %15, align 4, !tbaa !5
  %.not34 = icmp eq i32 %16, 0
  br i1 %.not34, label %17, label %.critedge

17:                                               ; preds = %.lr.ph50
  %18 = add nsw i32 %13, -1
  store i32 %18, ptr @m, align 4, !tbaa !5
  %19 = icmp sgt i32 %13, 2
  br i1 %19, label %.lr.ph50, label %.critedge, !llvm.loop !11

.critedge:                                        ; preds = %.lr.ph50, %17, %.preheader45, %.preheader44
  %20 = phi i32 [ %11, %.preheader44 ], [ %7, %.preheader45 ], [ %18, %17 ], [ %13, %.lr.ph50 ]
  %.lcssa46 = phi i32 [ %11, %.preheader44 ], [ %7, %.preheader45 ], [ 1, %17 ], [ %13, %.lr.ph50 ]
  %21 = add nsw i32 %.lcssa46, 1
  %22 = mul nsw i32 %21, %.lcssa46
  store i32 %22, ptr getelementptr inbounds (i8, ptr @A, i64 4), align 4, !tbaa !12
  store i32 %22, ptr @A, align 4, !tbaa !14
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(40000) getelementptr inbounds (i8, ptr @A, i64 8), i8 0, i64 40000, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #9
  store i32 1, ptr %1, align 4, !tbaa !5
  %.not3559 = icmp slt i32 %20, 1
  br i1 %.not3559, label %._crit_edge61, label %.lr.ph60

._crit_edge61:                                    ; preds = %._crit_edge, %.critedge
  %.lcssa47 = phi i32 [ %20, %.critedge ], [ %35, %._crit_edge ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #9
  %23 = add nsw i32 %.lcssa47, -1
  %24 = call noundef i32 @_Z3idxii(i32 noundef %23, i32 noundef 0)
  %25 = sext i32 %24 to i64
  %26 = load i32, ptr @m, align 4, !tbaa !5
  %27 = add nsw i32 %26, -1
  %28 = call noundef i32 @_Z3idxii(i32 noundef %27, i32 noundef 0)
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds [100 x [100 x i32]], ptr getelementptr inbounds (i8, ptr @A, i64 8), i64 0, i64 %25, i64 %29
  %31 = load i32, ptr getelementptr inbounds (i8, ptr @c, i64 8), align 8, !tbaa !5
  call void @_Z3incRii(ptr noundef nonnull align 4 dereferenceable(4) %30, i32 noundef %31)
  %32 = load i32, ptr @m, align 4, !tbaa !5
  %.not3663 = icmp slt i32 %32, 1
  br i1 %.not3663, label %._crit_edge72, label %.lr.ph66

.lr.ph60:                                         ; preds = %.critedge, %._crit_edge
  %33 = phi i32 [ %35, %._crit_edge ], [ %20, %.critedge ]
  %34 = phi i32 [ %37, %._crit_edge ], [ 1, %.critedge ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #9
  store i32 1, ptr %2, align 4, !tbaa !5
  %.not4057 = icmp slt i32 %33, 1
  br i1 %.not4057, label %._crit_edge, label %.lr.ph58

._crit_edge.loopexit:                             ; preds = %.loopexit
  %.pre92 = load i32, ptr %1, align 4, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.lr.ph60
  %35 = phi i32 [ %86, %._crit_edge.loopexit ], [ %33, %.lr.ph60 ]
  %36 = phi i32 [ %.pre92, %._crit_edge.loopexit ], [ %34, %.lr.ph60 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #9
  %37 = add nsw i32 %36, 1
  store i32 %37, ptr %1, align 4, !tbaa !5
  %.not35.not = icmp slt i32 %36, %35
  br i1 %.not35.not, label %.lr.ph60, label %._crit_edge61, !llvm.loop !15

.lr.ph58:                                         ; preds = %.lr.ph60, %.loopexit
  %38 = phi i32 [ %86, %.loopexit ], [ %33, %.lr.ph60 ]
  %39 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %40 = load i32, ptr %39, align 4, !tbaa !5
  %41 = sub nsw i32 %38, %40
  %42 = load i32, ptr %1, align 4, !tbaa !5
  %43 = call noundef i32 @_Z3idxii(i32 noundef %41, i32 noundef %42)
  %44 = sext i32 %43 to i64
  %45 = load i32, ptr @m, align 4, !tbaa !5
  %46 = add nsw i32 %45, -1
  %47 = load i32, ptr %1, align 4, !tbaa !5
  %48 = load i32, ptr %2, align 4, !tbaa !5
  %49 = sub nsw i32 %47, %48
  %50 = call i32 @llvm.abs.i32(i32 %49, i1 true)
  %51 = call noundef i32 @_Z3idxii(i32 noundef %46, i32 noundef %50)
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [100 x [100 x i32]], ptr getelementptr inbounds (i8, ptr @A, i64 8), i64 0, i64 %44, i64 %52
  %54 = load i32, ptr %2, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [10 x i32], ptr @c, i64 0, i64 %55
  %57 = load i32, ptr %56, align 4, !tbaa !5
  call void @_Z3incRii(ptr noundef nonnull align 4 dereferenceable(4) %53, i32 noundef %57)
  %58 = load i32, ptr %1, align 4, !tbaa !5
  %59 = load i32, ptr %2, align 4, !tbaa !5
  %60 = icmp ne i32 %58, %59
  %61 = load i32, ptr @m, align 4
  %.not4154 = icmp slt i32 %61, 1
  %or.cond = select i1 %60, i1 true, i1 %.not4154
  br i1 %or.cond, label %.loopexit, label %.lr.ph56

.lr.ph56:                                         ; preds = %.lr.ph58, %.lr.ph56
  %indvars.iv83 = phi i64 [ %indvars.iv.next84, %.lr.ph56 ], [ 1, %.lr.ph58 ]
  %62 = phi i32 [ %84, %.lr.ph56 ], [ %61, %.lr.ph58 ]
  %63 = load i32, ptr %1, align 4, !tbaa !5
  %64 = sub nsw i32 %62, %63
  %65 = call noundef i32 @_Z3idxii(i32 noundef %64, i32 noundef %63)
  %66 = sext i32 %65 to i64
  %67 = load i32, ptr @m, align 4, !tbaa !5
  %68 = add nsw i32 %67, -1
  %69 = trunc nuw nsw i64 %indvars.iv83 to i32
  %70 = call noundef i32 @_Z3idxii(i32 noundef %68, i32 noundef %69)
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [100 x [100 x i32]], ptr getelementptr inbounds (i8, ptr @A, i64 8), i64 0, i64 %66, i64 %71
  %73 = load i32, ptr %2, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [10 x i32], ptr @c, i64 0, i64 %74
  %76 = load i32, ptr %75, align 4, !tbaa !5
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [10 x i32], ptr @c, i64 0, i64 %indvars.iv83
  %79 = load i32, ptr %78, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = mul nsw i64 %80, %77
  %82 = srem i64 %81, 1000000009
  %83 = trunc nsw i64 %82 to i32
  call void @_Z3incRii(ptr noundef nonnull align 4 dereferenceable(4) %72, i32 noundef %83)
  %indvars.iv.next84 = add nuw nsw i64 %indvars.iv83, 1
  %84 = load i32, ptr @m, align 4, !tbaa !5
  %85 = sext i32 %84 to i64
  %.not41.not = icmp slt i64 %indvars.iv83, %85
  br i1 %.not41.not, label %.lr.ph56, label %.loopexit.loopexit, !llvm.loop !16

.loopexit.loopexit:                               ; preds = %.lr.ph56
  %.pre = load i32, ptr %2, align 4, !tbaa !5
  br label %.loopexit

.loopexit:                                        ; preds = %.loopexit.loopexit, %.lr.ph58
  %86 = phi i32 [ %84, %.loopexit.loopexit ], [ %61, %.lr.ph58 ]
  %87 = phi i32 [ %.pre, %.loopexit.loopexit ], [ %59, %.lr.ph58 ]
  %88 = add nsw i32 %87, 1
  store i32 %88, ptr %2, align 4, !tbaa !5
  %.not40.not = icmp slt i32 %87, %86
  br i1 %.not40.not, label %.lr.ph58, label %._crit_edge.loopexit, !llvm.loop !17

.preheader43:                                     ; preds = %.lr.ph66
  %89 = icmp sgt i32 %108, 1
  br i1 %89, label %.preheader42, label %._crit_edge72

.lr.ph66:                                         ; preds = %._crit_edge61, %.lr.ph66
  %indvars.iv86 = phi i64 [ %indvars.iv.next87, %.lr.ph66 ], [ 1, %._crit_edge61 ]
  %90 = phi i32 [ %108, %.lr.ph66 ], [ %32, %._crit_edge61 ]
  %91 = add nsw i32 %90, -1
  %92 = call noundef i32 @_Z3idxii(i32 noundef %91, i32 noundef 0)
  %93 = sext i32 %92 to i64
  %94 = load i32, ptr @m, align 4, !tbaa !5
  %95 = add nsw i32 %94, -1
  %96 = trunc nuw nsw i64 %indvars.iv86 to i32
  %97 = call noundef i32 @_Z3idxii(i32 noundef %95, i32 noundef %96)
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [100 x [100 x i32]], ptr getelementptr inbounds (i8, ptr @A, i64 8), i64 0, i64 %93, i64 %98
  %100 = load i32, ptr getelementptr inbounds (i8, ptr @c, i64 8), align 8, !tbaa !5
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [10 x i32], ptr @c, i64 0, i64 %indvars.iv86
  %103 = load i32, ptr %102, align 4, !tbaa !5
  %104 = sext i32 %103 to i64
  %105 = mul nsw i64 %104, %101
  %106 = srem i64 %105, 1000000009
  %107 = trunc nsw i64 %106 to i32
  call void @_Z3incRii(ptr noundef nonnull align 4 dereferenceable(4) %99, i32 noundef %107)
  %indvars.iv.next87 = add nuw nsw i64 %indvars.iv86, 1
  %108 = load i32, ptr @m, align 4, !tbaa !5
  %109 = sext i32 %108 to i64
  %.not36.not = icmp slt i64 %indvars.iv86, %109
  br i1 %.not36.not, label %.lr.ph66, label %.preheader43, !llvm.loop !18

.preheader42:                                     ; preds = %.preheader43, %._crit_edge70
  %110 = phi i32 [ %121, %._crit_edge70 ], [ %108, %.preheader43 ]
  %.02471 = phi i32 [ %122, %._crit_edge70 ], [ 1, %.preheader43 ]
  %.not3867 = icmp slt i32 %110, 0
  br i1 %.not3867, label %._crit_edge70, label %.lr.ph69

.lr.ph69:                                         ; preds = %.preheader42
  %111 = xor i32 %.02471, -1
  br label %124

._crit_edge72:                                    ; preds = %._crit_edge70, %._crit_edge61, %.preheader43
  call void @llvm.lifetime.start.p0(i64 40008, ptr nonnull %3) #9
  %112 = load i64, ptr @n, align 8, !tbaa !19
  call void @_ZN6Matrix3powEx(ptr dead_on_unwind nonnull writable sret(%struct.Matrix) align 4 %3, ptr noundef nonnull align 4 dereferenceable(40008) @A, i64 noundef %112)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(40008) @A, ptr noundef nonnull align 4 dereferenceable(40008) %3, i64 40008, i1 false), !tbaa.struct !21
  call void @llvm.lifetime.end.p0(i64 40008, ptr nonnull %3) #9
  store i32 1, ptr @B, align 4, !tbaa !14
  %113 = load i32, ptr @m, align 4, !tbaa !5
  %114 = add nsw i32 %113, 1
  %115 = mul nsw i32 %114, %113
  store i32 %115, ptr getelementptr inbounds (i8, ptr @B, i64 4), align 4, !tbaa !12
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(40000) getelementptr inbounds (i8, ptr @B, i64 8), i8 0, i64 40000, i1 false)
  %116 = add nsw i32 %113, -1
  %117 = call noundef i32 @_Z3idxii(i32 noundef %116, i32 noundef 0)
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [100 x i32], ptr getelementptr inbounds (i8, ptr @B, i64 8), i64 0, i64 %118
  store i32 1, ptr %119, align 4, !tbaa !5
  %120 = load i32, ptr @m, align 4, !tbaa !5
  %.not3773 = icmp slt i32 %120, 1
  br i1 %.not3773, label %._crit_edge77, label %.lr.ph76

._crit_edge70:                                    ; preds = %124, %.preheader42
  %121 = phi i32 [ %110, %.preheader42 ], [ %135, %124 ]
  %122 = add nuw nsw i32 %.02471, 1
  %123 = icmp slt i32 %122, %121
  br i1 %123, label %.preheader42, label %._crit_edge72, !llvm.loop !23

124:                                              ; preds = %.lr.ph69, %124
  %125 = phi i32 [ %110, %.lr.ph69 ], [ %135, %124 ]
  %.02368 = phi i32 [ 0, %.lr.ph69 ], [ %134, %124 ]
  %126 = sub nsw i32 %125, %.02471
  %127 = call noundef i32 @_Z3idxii(i32 noundef %126, i32 noundef %.02368)
  %128 = sext i32 %127 to i64
  %129 = load i32, ptr @m, align 4, !tbaa !5
  %130 = add i32 %129, %111
  %131 = call noundef i32 @_Z3idxii(i32 noundef %130, i32 noundef %.02368)
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds [100 x [100 x i32]], ptr getelementptr inbounds (i8, ptr @A, i64 8), i64 0, i64 %128, i64 %132
  call void @_Z3incRii(ptr noundef nonnull align 4 dereferenceable(4) %133, i32 noundef 1)
  %134 = add nuw nsw i32 %.02368, 1
  %135 = load i32, ptr @m, align 4, !tbaa !5
  %.not38.not = icmp slt i32 %.02368, %135
  br i1 %.not38.not, label %124, label %._crit_edge70, !llvm.loop !25

._crit_edge77:                                    ; preds = %.lr.ph76, %._crit_edge72
  call void @llvm.lifetime.start.p0(i64 40008, ptr nonnull %4) #9
  call void @_ZNK6MatrixmlERKS_(ptr dead_on_unwind nonnull writable sret(%struct.Matrix) align 4 %4, ptr noundef nonnull align 4 dereferenceable(40008) @B, ptr noundef nonnull align 4 dereferenceable(40008) @A)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(40008) @B, ptr noundef nonnull align 4 dereferenceable(40008) %4, i64 40008, i1 false), !tbaa.struct !21
  call void @llvm.lifetime.end.p0(i64 40008, ptr nonnull %4) #9
  %136 = load i32, ptr @m, align 4, !tbaa !5
  %137 = add nsw i32 %136, -1
  %138 = call noundef i32 @_Z3idxii(i32 noundef %137, i32 noundef 0)
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds [100 x i32], ptr getelementptr inbounds (i8, ptr @B, i64 8), i64 0, i64 %139
  %141 = load i32, ptr %140, align 4, !tbaa !5
  %142 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %141)
  %143 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @m)
  %144 = icmp eq i32 %143, 2
  br i1 %144, label %.preheader45, label %._crit_edge78, !llvm.loop !26

.lr.ph76:                                         ; preds = %._crit_edge72, %.lr.ph76
  %indvars.iv89 = phi i64 [ %indvars.iv.next90, %.lr.ph76 ], [ 1, %._crit_edge72 ]
  %145 = phi i32 [ %164, %.lr.ph76 ], [ %120, %._crit_edge72 ]
  %146 = add nsw i32 %145, -1
  %147 = trunc nuw nsw i64 %indvars.iv89 to i32
  %148 = call noundef i32 @_Z3idxii(i32 noundef %146, i32 noundef %147)
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds [100 x i32], ptr getelementptr inbounds (i8, ptr @B, i64 8), i64 0, i64 %149
  %151 = load i32, ptr @m, align 4, !tbaa !5
  %152 = add nsw i32 %151, -1
  %153 = call noundef i32 @_Z3idxii(i32 noundef %152, i32 noundef 0)
  %154 = sext i32 %153 to i64
  %155 = getelementptr inbounds [100 x i32], ptr getelementptr inbounds (i8, ptr @B, i64 8), i64 0, i64 %154
  %156 = load i32, ptr %155, align 4, !tbaa !5
  %157 = sext i32 %156 to i64
  %158 = getelementptr inbounds [10 x i32], ptr @c, i64 0, i64 %indvars.iv89
  %159 = load i32, ptr %158, align 4, !tbaa !5
  %160 = sext i32 %159 to i64
  %161 = mul nsw i64 %160, %157
  %162 = srem i64 %161, 1000000009
  %163 = trunc nsw i64 %162 to i32
  call void @_Z3incRii(ptr noundef nonnull align 4 dereferenceable(4) %150, i32 noundef %163)
  %indvars.iv.next90 = add nuw nsw i64 %indvars.iv89, 1
  %164 = load i32, ptr @m, align 4, !tbaa !5
  %165 = sext i32 %164 to i64
  %.not37.not = icmp slt i64 %indvars.iv89, %165
  br i1 %.not37.not, label %.lr.ph76, label %._crit_edge77, !llvm.loop !27

._crit_edge78:                                    ; preds = %._crit_edge77, %0
  ret i32 0
}

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

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

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

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

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

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

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #5

; 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(40008), i64 noundef) local_unnamed_addr #6 align 2

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #7

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNK6MatrixmlERKS_(ptr dead_on_unwind noalias writable sret(%struct.Matrix) align 4, ptr noundef nonnull align 4 dereferenceable(40008), ptr noundef nonnull align 4 dereferenceable(40008)) local_unnamed_addr #8 align 2

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

attributes #0 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { 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 #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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 nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { 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 #7 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #8 = { 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 #9 = { 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, !6, i64 4}
!13 = !{!"_ZTS6Matrix", !6, i64 0, !6, i64 4, !7, i64 8}
!14 = !{!13, !6, i64 0}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = !{!20, !20, i64 0}
!20 = !{!"long long", !7, i64 0}
!21 = !{i64 0, i64 4, !5, i64 4, i64 4, !5, i64 8, i64 40000, !22}
!22 = !{!7, !7, i64 0}
!23 = distinct !{!23, !10, !24}
!24 = !{!"llvm.loop.unswitch.partial.disable"}
!25 = distinct !{!25, !10}
!26 = distinct !{!26, !10}
!27 = distinct !{!27, !10}


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