; LLVM IR from tangjz/acm-icpc :: luogu (1397)

; 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 { i64, i64 }

@nlen = external dso_local global i32, align 4
@mlen = external dso_local global i32, align 4
@n = external dso_local global [1000010 x i8], align 16
@m = external dso_local global [1000010 x i8], align 16
@a = external dso_local global i64, align 8
@b = external dso_local global i64, align 8
@c = external dso_local global i64, align 8
@d = external dso_local global i64, align 8
@A = external dso_local global [11 x %struct.Matrix], align 16
@B = external dso_local global [11 x %struct.Matrix], align 16
@SA = external dso_local global %struct.Matrix, align 8
@SB = external dso_local global %struct.Matrix, align 8
@.str = external hidden unnamed_addr constant [21 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [6 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 %struct.Matrix, align 8
  %4 = alloca %struct.Matrix, align 8
  %5 = alloca %struct.Matrix, align 8
  %6 = alloca %struct.Matrix, align 8
  %7 = alloca %struct.Matrix, align 8
  %8 = alloca %struct.Matrix, align 8
  %9 = alloca %struct.Matrix, align 8
  %10 = alloca %struct.Matrix, align 8
  %11 = alloca %struct.Matrix, align 8
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  %12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @m, ptr noundef @a, ptr noundef @b, ptr noundef @c, ptr noundef @d)
  %13 = call i64 @strlen(ptr noundef @n) #8
  %14 = trunc i64 %13 to i32
  store i32 %14, ptr @nlen, align 4, !tbaa !5
  %15 = call i64 @strlen(ptr noundef @m) #8
  %16 = trunc i64 %15 to i32
  store i32 %16, ptr @mlen, align 4, !tbaa !5
  %17 = load i32, ptr @nlen, align 4, !tbaa !5
  %18 = sub nsw i32 %17, 1
  store i32 %18, ptr %2, align 4, !tbaa !5
  %19 = load i32, ptr %2, align 4, !tbaa !5
  %20 = sext i32 %19 to i64
  %21 = getelementptr inbounds [1000010 x i8], ptr @n, i64 0, i64 %20
  %22 = load i8, ptr %21, align 1, !tbaa !9
  %23 = add i8 %22, -1
  store i8 %23, ptr %21, align 1, !tbaa !9
  br label %24

24:                                               ; preds = %56, %0
  %25 = load i32, ptr %2, align 4, !tbaa !5
  %26 = icmp sge i32 %25, 0
  br i1 %26, label %27, label %59

27:                                               ; preds = %24
  %28 = load i32, ptr %2, align 4, !tbaa !5
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds [1000010 x i8], ptr @n, i64 0, i64 %29
  %31 = load i8, ptr %30, align 1, !tbaa !9
  %32 = sext i8 %31 to i32
  %33 = icmp slt i32 %32, 48
  br i1 %33, label %34, label %48

34:                                               ; preds = %27
  %35 = load i32, ptr %2, align 4, !tbaa !5
  %36 = sub nsw i32 %35, 1
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [1000010 x i8], ptr @n, i64 0, i64 %37
  %39 = load i8, ptr %38, align 1, !tbaa !9
  %40 = add i8 %39, -1
  store i8 %40, ptr %38, align 1, !tbaa !9
  %41 = load i32, ptr %2, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [1000010 x i8], ptr @n, i64 0, i64 %42
  %44 = load i8, ptr %43, align 1, !tbaa !9
  %45 = sext i8 %44 to i32
  %46 = add nsw i32 %45, 10
  %47 = trunc i32 %46 to i8
  store i8 %47, ptr %43, align 1, !tbaa !9
  br label %48

48:                                               ; preds = %34, %27
  %49 = load i32, ptr %2, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [1000010 x i8], ptr @n, i64 0, i64 %50
  %52 = load i8, ptr %51, align 1, !tbaa !9
  %53 = sext i8 %52 to i32
  %54 = sub nsw i32 %53, 48
  %55 = trunc i32 %54 to i8
  store i8 %55, ptr %51, align 1, !tbaa !9
  br label %56

56:                                               ; preds = %48
  %57 = load i32, ptr %2, align 4, !tbaa !5
  %58 = add nsw i32 %57, -1
  store i32 %58, ptr %2, align 4, !tbaa !5
  br label %24, !llvm.loop !10

59:                                               ; preds = %24
  %60 = load i32, ptr @mlen, align 4, !tbaa !5
  %61 = sub nsw i32 %60, 1
  store i32 %61, ptr %2, align 4, !tbaa !5
  %62 = load i32, ptr %2, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [1000010 x i8], ptr @m, i64 0, i64 %63
  %65 = load i8, ptr %64, align 1, !tbaa !9
  %66 = add i8 %65, -1
  store i8 %66, ptr %64, align 1, !tbaa !9
  br label %67

67:                                               ; preds = %99, %59
  %68 = load i32, ptr %2, align 4, !tbaa !5
  %69 = icmp sge i32 %68, 0
  br i1 %69, label %70, label %102

70:                                               ; preds = %67
  %71 = load i32, ptr %2, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [1000010 x i8], ptr @m, i64 0, i64 %72
  %74 = load i8, ptr %73, align 1, !tbaa !9
  %75 = sext i8 %74 to i32
  %76 = icmp slt i32 %75, 48
  br i1 %76, label %77, label %91

77:                                               ; preds = %70
  %78 = load i32, ptr %2, align 4, !tbaa !5
  %79 = sub nsw i32 %78, 1
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [1000010 x i8], ptr @m, i64 0, i64 %80
  %82 = load i8, ptr %81, align 1, !tbaa !9
  %83 = add i8 %82, -1
  store i8 %83, ptr %81, align 1, !tbaa !9
  %84 = load i32, ptr %2, align 4, !tbaa !5
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [1000010 x i8], ptr @m, i64 0, i64 %85
  %87 = load i8, ptr %86, align 1, !tbaa !9
  %88 = sext i8 %87 to i32
  %89 = add nsw i32 %88, 10
  %90 = trunc i32 %89 to i8
  store i8 %90, ptr %86, align 1, !tbaa !9
  br label %91

91:                                               ; preds = %77, %70
  %92 = load i32, ptr %2, align 4, !tbaa !5
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [1000010 x i8], ptr @m, i64 0, i64 %93
  %95 = load i8, ptr %94, align 1, !tbaa !9
  %96 = sext i8 %95 to i32
  %97 = sub nsw i32 %96, 48
  %98 = trunc i32 %97 to i8
  store i8 %98, ptr %94, align 1, !tbaa !9
  br label %99

99:                                               ; preds = %91
  %100 = load i32, ptr %2, align 4, !tbaa !5
  %101 = add nsw i32 %100, -1
  store i32 %101, ptr %2, align 4, !tbaa !5
  br label %67, !llvm.loop !12

102:                                              ; preds = %67
  call void @llvm.lifetime.start.p0(i64 16, ptr %3) #7
  %103 = getelementptr inbounds %struct.Matrix, ptr %3, i32 0, i32 0
  store i64 1, ptr %103, align 8, !tbaa !13
  %104 = getelementptr inbounds %struct.Matrix, ptr %3, i32 0, i32 1
  store i64 0, ptr %104, align 8, !tbaa !16
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 @SB, ptr align 8 %3, i64 16, i1 false), !tbaa.struct !17
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 @SA, ptr align 8 @SB, i64 16, i1 false), !tbaa.struct !17
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 @B, ptr align 8 @SA, i64 16, i1 false), !tbaa.struct !17
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 @A, ptr align 8 @B, i64 16, i1 false), !tbaa.struct !17
  call void @llvm.lifetime.end.p0(i64 16, ptr %3) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr %4) #7
  %105 = getelementptr inbounds %struct.Matrix, ptr %4, i32 0, i32 0
  %106 = load i64, ptr @a, align 8, !tbaa !18
  store i64 %106, ptr %105, align 8, !tbaa !13
  %107 = getelementptr inbounds %struct.Matrix, ptr %4, i32 0, i32 1
  %108 = load i64, ptr @b, align 8, !tbaa !18
  store i64 %108, ptr %107, align 8, !tbaa !16
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 getelementptr inbounds ([11 x %struct.Matrix], ptr @A, i64 0, i64 1), ptr align 8 %4, i64 16, i1 false), !tbaa.struct !17
  call void @llvm.lifetime.end.p0(i64 16, ptr %4) #7
  store i32 2, ptr %2, align 4, !tbaa !5
  br label %109

109:                                              ; preds = %125, %102
  %110 = load i32, ptr %2, align 4, !tbaa !5
  %111 = icmp slt i32 %110, 10
  br i1 %111, label %112, label %128

112:                                              ; preds = %109
  call void @llvm.lifetime.start.p0(i64 16, ptr %5) #7
  %113 = load i32, ptr %2, align 4, !tbaa !5
  %114 = sub nsw i32 %113, 1
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [11 x %struct.Matrix], ptr @A, i64 0, i64 %115
  %117 = call { i64, i64 } @_ZNK6MatrixmlERKS_(ptr noundef nonnull align 8 dereferenceable(16) getelementptr inbounds ([11 x %struct.Matrix], ptr @A, i64 0, i64 1), ptr noundef nonnull align 8 dereferenceable(16) %116)
  %118 = getelementptr inbounds { i64, i64 }, ptr %5, i32 0, i32 0
  %119 = extractvalue { i64, i64 } %117, 0
  store i64 %119, ptr %118, align 8
  %120 = getelementptr inbounds { i64, i64 }, ptr %5, i32 0, i32 1
  %121 = extractvalue { i64, i64 } %117, 1
  store i64 %121, ptr %120, align 8
  %122 = load i32, ptr %2, align 4, !tbaa !5
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds [11 x %struct.Matrix], ptr @A, i64 0, i64 %123
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %124, ptr align 8 %5, i64 16, i1 false), !tbaa.struct !17
  call void @llvm.lifetime.end.p0(i64 16, ptr %5) #7
  br label %125

125:                                              ; preds = %112
  %126 = load i32, ptr %2, align 4, !tbaa !5
  %127 = add nsw i32 %126, 1
  store i32 %127, ptr %2, align 4, !tbaa !5
  br label %109, !llvm.loop !19

128:                                              ; preds = %109
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %129

129:                                              ; preds = %151, %128
  %130 = load i32, ptr %2, align 4, !tbaa !5
  %131 = load i32, ptr @mlen, align 4, !tbaa !5
  %132 = icmp slt i32 %130, %131
  br i1 %132, label %133, label %154

133:                                              ; preds = %129
  call void @llvm.lifetime.start.p0(i64 16, ptr %6) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr %7) #7
  %134 = call { i64, i64 } @_ZNK6Matrix5pow10Ev(ptr noundef nonnull align 8 dereferenceable(16) @SA)
  %135 = getelementptr inbounds { i64, i64 }, ptr %7, i32 0, i32 0
  %136 = extractvalue { i64, i64 } %134, 0
  store i64 %136, ptr %135, align 8
  %137 = getelementptr inbounds { i64, i64 }, ptr %7, i32 0, i32 1
  %138 = extractvalue { i64, i64 } %134, 1
  store i64 %138, ptr %137, align 8
  %139 = load i32, ptr %2, align 4, !tbaa !5
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds [1000010 x i8], ptr @m, i64 0, i64 %140
  %142 = load i8, ptr %141, align 1, !tbaa !9
  %143 = sext i8 %142 to i32
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds [11 x %struct.Matrix], ptr @A, i64 0, i64 %144
  %146 = call { i64, i64 } @_ZNK6MatrixmlERKS_(ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef nonnull align 8 dereferenceable(16) %145)
  %147 = getelementptr inbounds { i64, i64 }, ptr %6, i32 0, i32 0
  %148 = extractvalue { i64, i64 } %146, 0
  store i64 %148, ptr %147, align 8
  %149 = getelementptr inbounds { i64, i64 }, ptr %6, i32 0, i32 1
  %150 = extractvalue { i64, i64 } %146, 1
  store i64 %150, ptr %149, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 @SA, ptr align 8 %6, i64 16, i1 false), !tbaa.struct !17
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %6) #7
  br label %151

151:                                              ; preds = %133
  %152 = load i32, ptr %2, align 4, !tbaa !5
  %153 = add nsw i32 %152, 1
  store i32 %153, ptr %2, align 4, !tbaa !5
  br label %129, !llvm.loop !20

154:                                              ; preds = %129
  call void @llvm.lifetime.start.p0(i64 16, ptr %8) #7
  %155 = getelementptr inbounds %struct.Matrix, ptr %8, i32 0, i32 0
  %156 = load i64, ptr @c, align 8, !tbaa !18
  store i64 %156, ptr %155, align 8, !tbaa !13
  %157 = getelementptr inbounds %struct.Matrix, ptr %8, i32 0, i32 1
  %158 = load i64, ptr @d, align 8, !tbaa !18
  store i64 %158, ptr %157, align 8, !tbaa !16
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 getelementptr inbounds ([11 x %struct.Matrix], ptr @B, i64 0, i64 1), ptr align 8 %8, i64 16, i1 false), !tbaa.struct !17
  call void @llvm.lifetime.end.p0(i64 16, ptr %8) #7
  call void @_ZN6MatrixmLERKS_(ptr noundef nonnull align 8 dereferenceable(16) getelementptr inbounds ([11 x %struct.Matrix], ptr @B, i64 0, i64 1), ptr noundef nonnull align 8 dereferenceable(16) @SA)
  store i32 2, ptr %2, align 4, !tbaa !5
  br label %159

159:                                              ; preds = %175, %154
  %160 = load i32, ptr %2, align 4, !tbaa !5
  %161 = icmp slt i32 %160, 10
  br i1 %161, label %162, label %178

162:                                              ; preds = %159
  call void @llvm.lifetime.start.p0(i64 16, ptr %9) #7
  %163 = load i32, ptr %2, align 4, !tbaa !5
  %164 = sub nsw i32 %163, 1
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds [11 x %struct.Matrix], ptr @B, i64 0, i64 %165
  %167 = call { i64, i64 } @_ZNK6MatrixmlERKS_(ptr noundef nonnull align 8 dereferenceable(16) getelementptr inbounds ([11 x %struct.Matrix], ptr @B, i64 0, i64 1), ptr noundef nonnull align 8 dereferenceable(16) %166)
  %168 = getelementptr inbounds { i64, i64 }, ptr %9, i32 0, i32 0
  %169 = extractvalue { i64, i64 } %167, 0
  store i64 %169, ptr %168, align 8
  %170 = getelementptr inbounds { i64, i64 }, ptr %9, i32 0, i32 1
  %171 = extractvalue { i64, i64 } %167, 1
  store i64 %171, ptr %170, align 8
  %172 = load i32, ptr %2, align 4, !tbaa !5
  %173 = sext i32 %172 to i64
  %174 = getelementptr inbounds [11 x %struct.Matrix], ptr @B, i64 0, i64 %173
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %174, ptr align 8 %9, i64 16, i1 false), !tbaa.struct !17
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #7
  br label %175

175:                                              ; preds = %162
  %176 = load i32, ptr %2, align 4, !tbaa !5
  %177 = add nsw i32 %176, 1
  store i32 %177, ptr %2, align 4, !tbaa !5
  br label %159, !llvm.loop !21

178:                                              ; preds = %159
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %179

179:                                              ; preds = %201, %178
  %180 = load i32, ptr %2, align 4, !tbaa !5
  %181 = load i32, ptr @nlen, align 4, !tbaa !5
  %182 = icmp slt i32 %180, %181
  br i1 %182, label %183, label %204

183:                                              ; preds = %179
  call void @llvm.lifetime.start.p0(i64 16, ptr %10) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #7
  %184 = call { i64, i64 } @_ZNK6Matrix5pow10Ev(ptr noundef nonnull align 8 dereferenceable(16) @SB)
  %185 = getelementptr inbounds { i64, i64 }, ptr %11, i32 0, i32 0
  %186 = extractvalue { i64, i64 } %184, 0
  store i64 %186, ptr %185, align 8
  %187 = getelementptr inbounds { i64, i64 }, ptr %11, i32 0, i32 1
  %188 = extractvalue { i64, i64 } %184, 1
  store i64 %188, ptr %187, align 8
  %189 = load i32, ptr %2, align 4, !tbaa !5
  %190 = sext i32 %189 to i64
  %191 = getelementptr inbounds [1000010 x i8], ptr @n, i64 0, i64 %190
  %192 = load i8, ptr %191, align 1, !tbaa !9
  %193 = sext i8 %192 to i32
  %194 = sext i32 %193 to i64
  %195 = getelementptr inbounds [11 x %struct.Matrix], ptr @B, i64 0, i64 %194
  %196 = call { i64, i64 } @_ZNK6MatrixmlERKS_(ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef nonnull align 8 dereferenceable(16) %195)
  %197 = getelementptr inbounds { i64, i64 }, ptr %10, i32 0, i32 0
  %198 = extractvalue { i64, i64 } %196, 0
  store i64 %198, ptr %197, align 8
  %199 = getelementptr inbounds { i64, i64 }, ptr %10, i32 0, i32 1
  %200 = extractvalue { i64, i64 } %196, 1
  store i64 %200, ptr %199, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 @SB, ptr align 8 %10, i64 16, i1 false), !tbaa.struct !17
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #7
  br label %201

201:                                              ; preds = %183
  %202 = load i32, ptr %2, align 4, !tbaa !5
  %203 = add nsw i32 %202, 1
  store i32 %203, ptr %2, align 4, !tbaa !5
  br label %179, !llvm.loop !22

204:                                              ; preds = %179
  call void @_ZN6MatrixmLERKS_(ptr noundef nonnull align 8 dereferenceable(16) @SA, ptr noundef nonnull align 8 dereferenceable(16) @SB)
  %205 = load i64, ptr @SA, align 8, !tbaa !13
  %206 = load i64, ptr getelementptr inbounds (%struct.Matrix, ptr @SA, i32 0, i32 1), align 8, !tbaa !16
  %207 = add nsw i64 %205, %206
  %208 = srem i64 %207, 1000000007
  %209 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i64 noundef %208)
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  ret i32 0
}

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

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

; Function Attrs: nounwind willreturn memory(read)
declare i64 @strlen(ptr noundef) #3

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local { i64, i64 } @_ZNK6MatrixmlERKS_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i64 } @_ZNK6Matrix5pow10Ev(ptr noundef nonnull align 8 dereferenceable(16)) #6 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6MatrixmLERKS_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #5 align 2

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

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

!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 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
!13 = !{!14, !15, i64 0}
!14 = !{!"_ZTS6Matrix", !15, i64 0, !15, i64 8}
!15 = !{!"long long", !7, i64 0}
!16 = !{!14, !15, i64 8}
!17 = !{i64 0, i64 8, !18, i64 8, i64 8, !18}
!18 = !{!15, !15, i64 0}
!19 = distinct !{!19, !11}
!20 = distinct !{!20, !11}
!21 = distinct !{!21, !11}
!22 = distinct !{!22, !11}


; 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 { i64, i64 }

@nlen = external dso_local local_unnamed_addr global i32, align 4
@mlen = external dso_local local_unnamed_addr global i32, align 4
@n = external dso_local global [1000010 x i8], align 16
@m = external dso_local global [1000010 x i8], align 16
@a = external dso_local global i64, align 8
@b = external dso_local global i64, align 8
@c = external dso_local global i64, align 8
@d = external dso_local global i64, align 8
@A = external dso_local global [11 x %struct.Matrix], align 16
@B = external dso_local global [11 x %struct.Matrix], align 16
@SA = external dso_local global %struct.Matrix, align 8
@SB = external dso_local global %struct.Matrix, align 8
@.str = external hidden unnamed_addr constant [21 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca %struct.Matrix, align 8
  %2 = alloca %struct.Matrix, align 8
  %3 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @m, ptr noundef nonnull @a, ptr noundef nonnull @b, ptr noundef nonnull @c, ptr noundef nonnull @d)
  %4 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) @n) #7
  %5 = trunc i64 %4 to i32
  store i32 %5, ptr @nlen, align 4, !tbaa !5
  %6 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) @m) #7
  %7 = trunc i64 %6 to i32
  store i32 %7, ptr @mlen, align 4, !tbaa !5
  %8 = shl i64 %4, 32
  %sext = add i64 %8, -4294967296
  %9 = ashr exact i64 %sext, 32
  %10 = getelementptr inbounds [1000010 x i8], ptr @n, i64 0, i64 %9
  %11 = load i8, ptr %10, align 1, !tbaa !9
  %12 = add i8 %11, -1
  store i8 %12, ptr %10, align 1, !tbaa !9
  %13 = icmp sgt i32 %5, 0
  br i1 %13, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %0
  %14 = and i64 %4, 2147483647
  %15 = add nsw i64 %14, -1
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph._crit_edge
  %indvars.iv = phi i64 [ %15, %.lr.ph.preheader ], [ %19, %.lr.ph._crit_edge ]
  %16 = getelementptr inbounds [1000010 x i8], ptr @n, i64 0, i64 %indvars.iv
  %17 = load i8, ptr %16, align 1, !tbaa !9
  %18 = icmp slt i8 %17, 48
  %19 = add nsw i64 %indvars.iv, -1
  br i1 %18, label %20, label %.lr.ph._crit_edge

20:                                               ; preds = %.lr.ph
  %21 = getelementptr inbounds [1000010 x i8], ptr @n, i64 0, i64 %19
  %22 = load i8, ptr %21, align 1, !tbaa !9
  %23 = add i8 %22, -1
  store i8 %23, ptr %21, align 1, !tbaa !9
  %24 = add nsw i8 %17, 10
  br label %.lr.ph._crit_edge

.lr.ph._crit_edge:                                ; preds = %.lr.ph, %20
  %25 = phi i8 [ %24, %20 ], [ %17, %.lr.ph ]
  %26 = add i8 %25, -48
  store i8 %26, ptr %16, align 1, !tbaa !9
  %27 = icmp sgt i64 %indvars.iv, 0
  br i1 %27, label %.lr.ph, label %._crit_edge, !llvm.loop !10

._crit_edge:                                      ; preds = %.lr.ph._crit_edge, %0
  %28 = shl i64 %6, 32
  %sext71 = add i64 %28, -4294967296
  %29 = ashr exact i64 %sext71, 32
  %30 = getelementptr inbounds [1000010 x i8], ptr @m, i64 0, i64 %29
  %31 = load i8, ptr %30, align 1, !tbaa !9
  %32 = add i8 %31, -1
  store i8 %32, ptr %30, align 1, !tbaa !9
  %33 = icmp sgt i32 %7, 0
  br i1 %33, label %.lr.ph44.preheader, label %._crit_edge45

.lr.ph44.preheader:                               ; preds = %._crit_edge
  %34 = and i64 %6, 2147483647
  %35 = add nsw i64 %34, -1
  br label %.lr.ph44

.lr.ph44:                                         ; preds = %.lr.ph44.preheader, %.lr.ph44._crit_edge
  %indvars.iv55 = phi i64 [ %35, %.lr.ph44.preheader ], [ %39, %.lr.ph44._crit_edge ]
  %36 = getelementptr inbounds [1000010 x i8], ptr @m, i64 0, i64 %indvars.iv55
  %37 = load i8, ptr %36, align 1, !tbaa !9
  %38 = icmp slt i8 %37, 48
  %39 = add nsw i64 %indvars.iv55, -1
  br i1 %38, label %40, label %.lr.ph44._crit_edge

40:                                               ; preds = %.lr.ph44
  %41 = getelementptr inbounds [1000010 x i8], ptr @m, i64 0, i64 %39
  %42 = load i8, ptr %41, align 1, !tbaa !9
  %43 = add i8 %42, -1
  store i8 %43, ptr %41, align 1, !tbaa !9
  %44 = add nsw i8 %37, 10
  br label %.lr.ph44._crit_edge

.lr.ph44._crit_edge:                              ; preds = %.lr.ph44, %40
  %45 = phi i8 [ %44, %40 ], [ %37, %.lr.ph44 ]
  %46 = add i8 %45, -48
  store i8 %46, ptr %36, align 1, !tbaa !9
  %47 = icmp sgt i64 %indvars.iv55, 0
  br i1 %47, label %.lr.ph44, label %._crit_edge45, !llvm.loop !12

._crit_edge45:                                    ; preds = %.lr.ph44._crit_edge, %._crit_edge
  store i64 1, ptr @SB, align 8, !tbaa !13
  store i64 0, ptr getelementptr inbounds (i8, ptr @SB, i64 8), align 8, !tbaa !13
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) @SA, ptr noundef nonnull align 8 dereferenceable(16) @SB, i64 16, i1 false), !tbaa.struct !15
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) @B, ptr noundef nonnull align 8 dereferenceable(16) @SB, i64 16, i1 false)
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) @A, ptr noundef nonnull align 8 dereferenceable(16) @SB, i64 16, i1 false)
  %48 = load i64, ptr @a, align 8, !tbaa !13
  %49 = load i64, ptr @b, align 8, !tbaa !13
  store i64 %48, ptr getelementptr inbounds (i8, ptr @A, i64 16), align 16, !tbaa !13
  store i64 %49, ptr getelementptr inbounds (i8, ptr @A, i64 24), align 8, !tbaa !13
  %50 = tail call { i64, i64 } @_ZNK6MatrixmlERKS_(ptr noundef nonnull align 8 dereferenceable(16) getelementptr inbounds (i8, ptr @A, i64 16), ptr noundef nonnull align 8 dereferenceable(16) getelementptr inbounds (i8, ptr @A, i64 16))
  %51 = extractvalue { i64, i64 } %50, 0
  %52 = extractvalue { i64, i64 } %50, 1
  store i64 %51, ptr getelementptr inbounds (i8, ptr @A, i64 32), align 16, !tbaa !13
  store i64 %52, ptr getelementptr inbounds (i8, ptr @A, i64 40), align 8, !tbaa !13
  %53 = tail call { i64, i64 } @_ZNK6MatrixmlERKS_(ptr noundef nonnull align 8 dereferenceable(16) getelementptr inbounds (i8, ptr @A, i64 16), ptr noundef nonnull align 8 dereferenceable(16) getelementptr inbounds (i8, ptr @A, i64 32))
  %54 = extractvalue { i64, i64 } %53, 0
  %55 = extractvalue { i64, i64 } %53, 1
  store i64 %54, ptr getelementptr inbounds (i8, ptr @A, i64 48), align 16, !tbaa !13
  store i64 %55, ptr getelementptr inbounds (i8, ptr @A, i64 56), align 8, !tbaa !13
  %56 = tail call { i64, i64 } @_ZNK6MatrixmlERKS_(ptr noundef nonnull align 8 dereferenceable(16) getelementptr inbounds (i8, ptr @A, i64 16), ptr noundef nonnull align 8 dereferenceable(16) getelementptr inbounds (i8, ptr @A, i64 48))
  %57 = extractvalue { i64, i64 } %56, 0
  %58 = extractvalue { i64, i64 } %56, 1
  store i64 %57, ptr getelementptr inbounds (i8, ptr @A, i64 64), align 16, !tbaa !13
  store i64 %58, ptr getelementptr inbounds (i8, ptr @A, i64 72), align 8, !tbaa !13
  %59 = tail call { i64, i64 } @_ZNK6MatrixmlERKS_(ptr noundef nonnull align 8 dereferenceable(16) getelementptr inbounds (i8, ptr @A, i64 16), ptr noundef nonnull align 8 dereferenceable(16) getelementptr inbounds (i8, ptr @A, i64 64))
  %60 = extractvalue { i64, i64 } %59, 0
  %61 = extractvalue { i64, i64 } %59, 1
  store i64 %60, ptr getelementptr inbounds (i8, ptr @A, i64 80), align 16, !tbaa !13
  store i64 %61, ptr getelementptr inbounds (i8, ptr @A, i64 88), align 8, !tbaa !13
  %62 = tail call { i64, i64 } @_ZNK6MatrixmlERKS_(ptr noundef nonnull align 8 dereferenceable(16) getelementptr inbounds (i8, ptr @A, i64 16), ptr noundef nonnull align 8 dereferenceable(16) getelementptr inbounds (i8, ptr @A, i64 80))
  %63 = extractvalue { i64, i64 } %62, 0
  %64 = extractvalue { i64, i64 } %62, 1
  store i64 %63, ptr getelementptr inbounds (i8, ptr @A, i64 96), align 16, !tbaa !13
  store i64 %64, ptr getelementptr inbounds (i8, ptr @A, i64 104), align 8, !tbaa !13
  %65 = tail call { i64, i64 } @_ZNK6MatrixmlERKS_(ptr noundef nonnull align 8 dereferenceable(16) getelementptr inbounds (i8, ptr @A, i64 16), ptr noundef nonnull align 8 dereferenceable(16) getelementptr inbounds (i8, ptr @A, i64 96))
  %66 = extractvalue { i64, i64 } %65, 0
  %67 = extractvalue { i64, i64 } %65, 1
  store i64 %66, ptr getelementptr inbounds (i8, ptr @A, i64 112), align 16, !tbaa !13
  store i64 %67, ptr getelementptr inbounds (i8, ptr @A, i64 120), align 8, !tbaa !13
  %68 = tail call { i64, i64 } @_ZNK6MatrixmlERKS_(ptr noundef nonnull align 8 dereferenceable(16) getelementptr inbounds (i8, ptr @A, i64 16), ptr noundef nonnull align 8 dereferenceable(16) getelementptr inbounds (i8, ptr @A, i64 112))
  %69 = extractvalue { i64, i64 } %68, 0
  %70 = extractvalue { i64, i64 } %68, 1
  store i64 %69, ptr getelementptr inbounds (i8, ptr @A, i64 128), align 16, !tbaa !13
  store i64 %70, ptr getelementptr inbounds (i8, ptr @A, i64 136), align 8, !tbaa !13
  %71 = tail call { i64, i64 } @_ZNK6MatrixmlERKS_(ptr noundef nonnull align 8 dereferenceable(16) getelementptr inbounds (i8, ptr @A, i64 16), ptr noundef nonnull align 8 dereferenceable(16) getelementptr inbounds (i8, ptr @A, i64 128))
  %72 = extractvalue { i64, i64 } %71, 0
  %73 = extractvalue { i64, i64 } %71, 1
  store i64 %72, ptr getelementptr inbounds (i8, ptr @A, i64 144), align 16, !tbaa !13
  store i64 %73, ptr getelementptr inbounds (i8, ptr @A, i64 152), align 8, !tbaa !13
  %74 = load i32, ptr @mlen, align 4, !tbaa !5
  %75 = icmp sgt i32 %74, 0
  br i1 %75, label %.lr.ph48, label %._crit_edge49

.lr.ph48:                                         ; preds = %._crit_edge45
  %76 = getelementptr inbounds i8, ptr %1, i64 8
  br label %77

77:                                               ; preds = %.lr.ph48, %77
  %indvars.iv61 = phi i64 [ 0, %.lr.ph48 ], [ %indvars.iv.next62, %77 ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %1) #8
  %78 = call { i64, i64 } @_ZNK6Matrix5pow10Ev(ptr noundef nonnull align 8 dereferenceable(16) @SA)
  %79 = extractvalue { i64, i64 } %78, 0
  store i64 %79, ptr %1, align 8
  %80 = extractvalue { i64, i64 } %78, 1
  store i64 %80, ptr %76, align 8
  %81 = getelementptr inbounds [1000010 x i8], ptr @m, i64 0, i64 %indvars.iv61
  %82 = load i8, ptr %81, align 1, !tbaa !9
  %83 = sext i8 %82 to i64
  %84 = getelementptr inbounds [11 x %struct.Matrix], ptr @A, i64 0, i64 %83
  %85 = call { i64, i64 } @_ZNK6MatrixmlERKS_(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 8 dereferenceable(16) %84)
  %86 = extractvalue { i64, i64 } %85, 0
  %87 = extractvalue { i64, i64 } %85, 1
  store i64 %86, ptr @SA, align 8, !tbaa !13
  store i64 %87, ptr getelementptr inbounds (i8, ptr @SA, i64 8), align 8, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %1) #8
  %indvars.iv.next62 = add nuw nsw i64 %indvars.iv61, 1
  %88 = load i32, ptr @mlen, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = icmp slt i64 %indvars.iv.next62, %89
  br i1 %90, label %77, label %._crit_edge49, !llvm.loop !16

._crit_edge49:                                    ; preds = %77, %._crit_edge45
  %91 = load i64, ptr @c, align 8, !tbaa !13
  %92 = load i64, ptr @d, align 8, !tbaa !13
  store i64 %91, ptr getelementptr inbounds (i8, ptr @B, i64 16), align 16, !tbaa !13
  store i64 %92, ptr getelementptr inbounds (i8, ptr @B, i64 24), align 8, !tbaa !13
  call void @_ZN6MatrixmLERKS_(ptr noundef nonnull align 8 dereferenceable(16) getelementptr inbounds (i8, ptr @B, i64 16), ptr noundef nonnull align 8 dereferenceable(16) @SA)
  %93 = call { i64, i64 } @_ZNK6MatrixmlERKS_(ptr noundef nonnull align 8 dereferenceable(16) getelementptr inbounds (i8, ptr @B, i64 16), ptr noundef nonnull align 8 dereferenceable(16) getelementptr inbounds (i8, ptr @B, i64 16))
  %94 = extractvalue { i64, i64 } %93, 0
  %95 = extractvalue { i64, i64 } %93, 1
  store i64 %94, ptr getelementptr inbounds (i8, ptr @B, i64 32), align 16, !tbaa !13
  store i64 %95, ptr getelementptr inbounds (i8, ptr @B, i64 40), align 8, !tbaa !13
  %96 = call { i64, i64 } @_ZNK6MatrixmlERKS_(ptr noundef nonnull align 8 dereferenceable(16) getelementptr inbounds (i8, ptr @B, i64 16), ptr noundef nonnull align 8 dereferenceable(16) getelementptr inbounds (i8, ptr @B, i64 32))
  %97 = extractvalue { i64, i64 } %96, 0
  %98 = extractvalue { i64, i64 } %96, 1
  store i64 %97, ptr getelementptr inbounds (i8, ptr @B, i64 48), align 16, !tbaa !13
  store i64 %98, ptr getelementptr inbounds (i8, ptr @B, i64 56), align 8, !tbaa !13
  %99 = call { i64, i64 } @_ZNK6MatrixmlERKS_(ptr noundef nonnull align 8 dereferenceable(16) getelementptr inbounds (i8, ptr @B, i64 16), ptr noundef nonnull align 8 dereferenceable(16) getelementptr inbounds (i8, ptr @B, i64 48))
  %100 = extractvalue { i64, i64 } %99, 0
  %101 = extractvalue { i64, i64 } %99, 1
  store i64 %100, ptr getelementptr inbounds (i8, ptr @B, i64 64), align 16, !tbaa !13
  store i64 %101, ptr getelementptr inbounds (i8, ptr @B, i64 72), align 8, !tbaa !13
  %102 = call { i64, i64 } @_ZNK6MatrixmlERKS_(ptr noundef nonnull align 8 dereferenceable(16) getelementptr inbounds (i8, ptr @B, i64 16), ptr noundef nonnull align 8 dereferenceable(16) getelementptr inbounds (i8, ptr @B, i64 64))
  %103 = extractvalue { i64, i64 } %102, 0
  %104 = extractvalue { i64, i64 } %102, 1
  store i64 %103, ptr getelementptr inbounds (i8, ptr @B, i64 80), align 16, !tbaa !13
  store i64 %104, ptr getelementptr inbounds (i8, ptr @B, i64 88), align 8, !tbaa !13
  %105 = call { i64, i64 } @_ZNK6MatrixmlERKS_(ptr noundef nonnull align 8 dereferenceable(16) getelementptr inbounds (i8, ptr @B, i64 16), ptr noundef nonnull align 8 dereferenceable(16) getelementptr inbounds (i8, ptr @B, i64 80))
  %106 = extractvalue { i64, i64 } %105, 0
  %107 = extractvalue { i64, i64 } %105, 1
  store i64 %106, ptr getelementptr inbounds (i8, ptr @B, i64 96), align 16, !tbaa !13
  store i64 %107, ptr getelementptr inbounds (i8, ptr @B, i64 104), align 8, !tbaa !13
  %108 = call { i64, i64 } @_ZNK6MatrixmlERKS_(ptr noundef nonnull align 8 dereferenceable(16) getelementptr inbounds (i8, ptr @B, i64 16), ptr noundef nonnull align 8 dereferenceable(16) getelementptr inbounds (i8, ptr @B, i64 96))
  %109 = extractvalue { i64, i64 } %108, 0
  %110 = extractvalue { i64, i64 } %108, 1
  store i64 %109, ptr getelementptr inbounds (i8, ptr @B, i64 112), align 16, !tbaa !13
  store i64 %110, ptr getelementptr inbounds (i8, ptr @B, i64 120), align 8, !tbaa !13
  %111 = call { i64, i64 } @_ZNK6MatrixmlERKS_(ptr noundef nonnull align 8 dereferenceable(16) getelementptr inbounds (i8, ptr @B, i64 16), ptr noundef nonnull align 8 dereferenceable(16) getelementptr inbounds (i8, ptr @B, i64 112))
  %112 = extractvalue { i64, i64 } %111, 0
  %113 = extractvalue { i64, i64 } %111, 1
  store i64 %112, ptr getelementptr inbounds (i8, ptr @B, i64 128), align 16, !tbaa !13
  store i64 %113, ptr getelementptr inbounds (i8, ptr @B, i64 136), align 8, !tbaa !13
  %114 = call { i64, i64 } @_ZNK6MatrixmlERKS_(ptr noundef nonnull align 8 dereferenceable(16) getelementptr inbounds (i8, ptr @B, i64 16), ptr noundef nonnull align 8 dereferenceable(16) getelementptr inbounds (i8, ptr @B, i64 128))
  %115 = extractvalue { i64, i64 } %114, 0
  %116 = extractvalue { i64, i64 } %114, 1
  store i64 %115, ptr getelementptr inbounds (i8, ptr @B, i64 144), align 16, !tbaa !13
  store i64 %116, ptr getelementptr inbounds (i8, ptr @B, i64 152), align 8, !tbaa !13
  %117 = load i32, ptr @nlen, align 4, !tbaa !5
  %118 = icmp sgt i32 %117, 0
  br i1 %118, label %.lr.ph52, label %._crit_edge53

.lr.ph52:                                         ; preds = %._crit_edge49
  %119 = getelementptr inbounds i8, ptr %2, i64 8
  br label %120

120:                                              ; preds = %.lr.ph52, %120
  %indvars.iv67 = phi i64 [ 0, %.lr.ph52 ], [ %indvars.iv.next68, %120 ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %2) #8
  %121 = call { i64, i64 } @_ZNK6Matrix5pow10Ev(ptr noundef nonnull align 8 dereferenceable(16) @SB)
  %122 = extractvalue { i64, i64 } %121, 0
  store i64 %122, ptr %2, align 8
  %123 = extractvalue { i64, i64 } %121, 1
  store i64 %123, ptr %119, align 8
  %124 = getelementptr inbounds [1000010 x i8], ptr @n, i64 0, i64 %indvars.iv67
  %125 = load i8, ptr %124, align 1, !tbaa !9
  %126 = sext i8 %125 to i64
  %127 = getelementptr inbounds [11 x %struct.Matrix], ptr @B, i64 0, i64 %126
  %128 = call { i64, i64 } @_ZNK6MatrixmlERKS_(ptr noundef nonnull align 8 dereferenceable(16) %2, ptr noundef nonnull align 8 dereferenceable(16) %127)
  %129 = extractvalue { i64, i64 } %128, 0
  %130 = extractvalue { i64, i64 } %128, 1
  store i64 %129, ptr @SB, align 8, !tbaa !13
  store i64 %130, ptr getelementptr inbounds (i8, ptr @SB, i64 8), align 8, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %2) #8
  %indvars.iv.next68 = add nuw nsw i64 %indvars.iv67, 1
  %131 = load i32, ptr @nlen, align 4, !tbaa !5
  %132 = sext i32 %131 to i64
  %133 = icmp slt i64 %indvars.iv.next68, %132
  br i1 %133, label %120, label %._crit_edge53, !llvm.loop !17

._crit_edge53:                                    ; preds = %120, %._crit_edge49
  call void @_ZN6MatrixmLERKS_(ptr noundef nonnull align 8 dereferenceable(16) @SA, ptr noundef nonnull align 8 dereferenceable(16) @SB)
  %134 = load i64, ptr @SA, align 8, !tbaa !18
  %135 = load i64, ptr getelementptr inbounds (i8, ptr @SA, i64 8), align 8, !tbaa !20
  %136 = add nsw i64 %135, %134
  %137 = srem i64 %136, 1000000007
  %138 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %137)
  ret i32 0
}

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

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local { i64, i64 } @_ZNK6MatrixmlERKS_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i64 } @_ZNK6Matrix5pow10Ev(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #6 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6MatrixmLERKS_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #5 align 2

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

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

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

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


; Effective O3 passes: CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,MemCpyOptPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass