; LLVM IR from tangjz/acm-icpc :: projecteuler (419)

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

@seq = external dso_local global [9 x ptr], align 16
@A = external dso_local global %struct.Matrix, align 4
@B = external dso_local global %struct.Matrix, align 4
@_ZL3nxt = external hidden constant [144 x [2 x i32]], align 16
@.str.9 = external hidden unnamed_addr constant [5 x i8], align 1
@_ZL3ctr = external hidden constant [92 x [3 x i32]], align 16
@.str.10 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [3 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 i64, align 8
  %4 = alloca i32, align 4
  %5 = alloca [3 x i32], align 4
  %6 = alloca i32, align 4
  %7 = alloca %struct.Matrix, align 4
  %8 = alloca %struct.Matrix, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  store i32 92, ptr getelementptr inbounds (%struct.Matrix, ptr @A, i32 0, i32 1), align 4, !tbaa !5
  store i32 92, ptr @A, align 4, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 0, ptr %2, align 4, !tbaa !11
  br label %12

12:                                               ; preds = %33, %0
  %13 = load i32, ptr %2, align 4, !tbaa !11
  %14 = icmp slt i32 %13, 144
  br i1 %14, label %16, label %15

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

16:                                               ; preds = %12
  %17 = load i32, ptr %2, align 4, !tbaa !11
  %18 = sext i32 %17 to i64
  %19 = getelementptr inbounds [144 x [2 x i32]], ptr @_ZL3nxt, i64 0, i64 %18
  %20 = getelementptr inbounds [2 x i32], ptr %19, i64 0, i64 0
  %21 = load i32, ptr %20, align 8, !tbaa !11
  %22 = sext i32 %21 to i64
  %23 = getelementptr inbounds [92 x [92 x i32]], ptr getelementptr inbounds (%struct.Matrix, ptr @A, i32 0, i32 2), i64 0, i64 %22
  %24 = load i32, ptr %2, align 4, !tbaa !11
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds [144 x [2 x i32]], ptr @_ZL3nxt, i64 0, i64 %25
  %27 = getelementptr inbounds [2 x i32], ptr %26, i64 0, i64 1
  %28 = load i32, ptr %27, align 4, !tbaa !11
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds [92 x i32], ptr %23, i64 0, i64 %29
  %31 = load i32, ptr %30, align 4, !tbaa !11
  %32 = add i32 %31, 1
  store i32 %32, ptr %30, align 4, !tbaa !11
  br label %33

33:                                               ; preds = %16
  %34 = load i32, ptr %2, align 4, !tbaa !11
  %35 = add nsw i32 %34, 1
  store i32 %35, ptr %2, align 4, !tbaa !11
  br label %12, !llvm.loop !12

36:                                               ; preds = %15
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #6
  br label %37

37:                                               ; preds = %136, %36
  %38 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.9, ptr noundef %3)
  %39 = icmp eq i32 %38, 1
  br i1 %39, label %41, label %40

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

41:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 12, ptr %5) #6
  call void @llvm.memset.p0.i64(ptr align 4 %5, i8 0, i64 12, i1 false)
  %42 = load i64, ptr %3, align 8, !tbaa !14
  %43 = icmp sle i64 %42, 8
  br i1 %43, label %44, label %73

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

45:                                               ; preds = %69, %44
  %46 = load i64, ptr %3, align 8, !tbaa !14
  %47 = getelementptr inbounds [9 x ptr], ptr @seq, i64 0, i64 %46
  %48 = load ptr, ptr %47, align 8, !tbaa !16
  %49 = load i32, ptr %6, align 4, !tbaa !11
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds i8, ptr %48, i64 %50
  %52 = load i8, ptr %51, align 1, !tbaa !18
  %53 = icmp ne i8 %52, 0
  br i1 %53, label %55, label %54

54:                                               ; preds = %45
  store i32 7, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %72

55:                                               ; preds = %45
  %56 = load i64, ptr %3, align 8, !tbaa !14
  %57 = getelementptr inbounds [9 x ptr], ptr @seq, i64 0, i64 %56
  %58 = load ptr, ptr %57, align 8, !tbaa !16
  %59 = load i32, ptr %6, align 4, !tbaa !11
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds i8, ptr %58, i64 %60
  %62 = load i8, ptr %61, align 1, !tbaa !18
  %63 = sext i8 %62 to i32
  %64 = sub nsw i32 %63, 49
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [3 x i32], ptr %5, i64 0, i64 %65
  %67 = load i32, ptr %66, align 4, !tbaa !11
  %68 = add i32 %67, 1
  store i32 %68, ptr %66, align 4, !tbaa !11
  br label %69

69:                                               ; preds = %55
  %70 = load i32, ptr %6, align 4, !tbaa !11
  %71 = add nsw i32 %70, 1
  store i32 %71, ptr %6, align 4, !tbaa !11
  br label %45, !llvm.loop !19

72:                                               ; preds = %54
  br label %115

73:                                               ; preds = %41
  store i32 1, ptr @B, align 4, !tbaa !10
  store i32 92, ptr getelementptr inbounds (%struct.Matrix, ptr @B, i32 0, i32 1), align 4, !tbaa !5
  call void @llvm.memset.p0.i64(ptr align 4 getelementptr inbounds (%struct.Matrix, ptr @B, i32 0, i32 2), i8 0, i64 33856, i1 false)
  %74 = load i32, ptr getelementptr inbounds ([92 x i32], ptr getelementptr inbounds (%struct.Matrix, ptr @B, i32 0, i32 2), i64 0, i64 23), align 4, !tbaa !11
  %75 = add i32 %74, 1
  store i32 %75, ptr getelementptr inbounds ([92 x i32], ptr getelementptr inbounds (%struct.Matrix, ptr @B, i32 0, i32 2), i64 0, i64 23), align 4, !tbaa !11
  %76 = load i32, ptr getelementptr inbounds ([92 x i32], ptr getelementptr inbounds (%struct.Matrix, ptr @B, i32 0, i32 2), i64 0, i64 38), align 4, !tbaa !11
  %77 = add i32 %76, 1
  store i32 %77, ptr getelementptr inbounds ([92 x i32], ptr getelementptr inbounds (%struct.Matrix, ptr @B, i32 0, i32 2), i64 0, i64 38), align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 33864, ptr %7) #6
  call void @llvm.lifetime.start.p0(i64 33864, ptr %8) #6
  %78 = load i64, ptr %3, align 8, !tbaa !14
  %79 = sub nsw i64 %78, 8
  call void @_ZNK6Matrix3powEx(ptr dead_on_unwind writable sret(%struct.Matrix) align 4 %8, ptr noundef nonnull align 4 dereferenceable(33864) @A, i64 noundef %79)
  call void @_ZNK6MatrixmlERKS_(ptr dead_on_unwind writable sret(%struct.Matrix) align 4 %7, ptr noundef nonnull align 4 dereferenceable(33864) @B, ptr noundef nonnull align 4 dereferenceable(33864) %8)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 @B, ptr align 4 %7, i64 33864, i1 false), !tbaa.struct !20
  call void @llvm.lifetime.end.p0(i64 33864, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 33864, ptr %7) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 0, ptr %9, align 4, !tbaa !11
  br label %80

80:                                               ; preds = %111, %73
  %81 = load i32, ptr %9, align 4, !tbaa !11
  %82 = icmp slt i32 %81, 92
  br i1 %82, label %84, label %83

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

84:                                               ; preds = %80
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 0, ptr %10, align 4, !tbaa !11
  br label %85

85:                                               ; preds = %107, %84
  %86 = load i32, ptr %10, align 4, !tbaa !11
  %87 = icmp slt i32 %86, 3
  br i1 %87, label %89, label %88

88:                                               ; preds = %85
  store i32 13, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %110

89:                                               ; preds = %85
  %90 = load i32, ptr %9, align 4, !tbaa !11
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [92 x i32], ptr getelementptr inbounds (%struct.Matrix, ptr @B, i32 0, i32 2), i64 0, i64 %91
  %93 = load i32, ptr %92, align 4, !tbaa !11
  %94 = load i32, ptr %9, align 4, !tbaa !11
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [92 x [3 x i32]], ptr @_ZL3ctr, i64 0, i64 %95
  %97 = load i32, ptr %10, align 4, !tbaa !11
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [3 x i32], ptr %96, i64 0, i64 %98
  %100 = load i32, ptr %99, align 4, !tbaa !11
  %101 = mul i32 %93, %100
  %102 = load i32, ptr %10, align 4, !tbaa !11
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds [3 x i32], ptr %5, i64 0, i64 %103
  %105 = load i32, ptr %104, align 4, !tbaa !11
  %106 = add i32 %105, %101
  store i32 %106, ptr %104, align 4, !tbaa !11
  br label %107

107:                                              ; preds = %89
  %108 = load i32, ptr %10, align 4, !tbaa !11
  %109 = add nsw i32 %108, 1
  store i32 %109, ptr %10, align 4, !tbaa !11
  br label %85, !llvm.loop !21

110:                                              ; preds = %88
  br label %111

111:                                              ; preds = %110
  %112 = load i32, ptr %9, align 4, !tbaa !11
  %113 = add nsw i32 %112, 1
  store i32 %113, ptr %9, align 4, !tbaa !11
  br label %80, !llvm.loop !22

114:                                              ; preds = %83
  br label %115

115:                                              ; preds = %114, %72
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 0, ptr %11, align 4, !tbaa !11
  br label %116

116:                                              ; preds = %133, %115
  %117 = load i32, ptr %11, align 4, !tbaa !11
  %118 = icmp slt i32 %117, 3
  br i1 %118, label %120, label %119

119:                                              ; preds = %116
  store i32 16, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %136

120:                                              ; preds = %116
  %121 = load i32, ptr %11, align 4, !tbaa !11
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [3 x i32], ptr %5, i64 0, i64 %122
  %124 = load i32, ptr %123, align 4, !tbaa !11
  %125 = and i32 %124, 1073741823
  %126 = load i32, ptr %11, align 4, !tbaa !11
  %127 = icmp eq i32 %126, 2
  %128 = zext i1 %127 to i64
  %129 = getelementptr inbounds [3 x i8], ptr @.str.11, i64 0, i64 %128
  %130 = load i8, ptr %129, align 1, !tbaa !18
  %131 = sext i8 %130 to i32
  %132 = call i32 (ptr, ...) @printf(ptr noundef @.str.10, i32 noundef %125, i32 noundef %131)
  br label %133

133:                                              ; preds = %120
  %134 = load i32, ptr %11, align 4, !tbaa !11
  %135 = add nsw i32 %134, 1
  store i32 %135, ptr %11, align 4, !tbaa !11
  br label %116, !llvm.loop !23

136:                                              ; preds = %119
  call void @llvm.lifetime.end.p0(i64 12, ptr %5) #6
  br label %37, !llvm.loop !24

137:                                              ; preds = %40
  ret i32 0
}

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

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

declare i32 @__isoc99_scanf(ptr noundef, ...) #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: 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(33864), ptr noundef nonnull align 4 dereferenceable(33864)) #4 align 2

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

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

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

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

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


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

@seq = external dso_local local_unnamed_addr global [9 x ptr], align 16
@A = external dso_local global %struct.Matrix, align 4
@B = external dso_local global %struct.Matrix, align 4
@_ZL3nxt = external hidden local_unnamed_addr constant [144 x [2 x i32]], align 16
@.str.9 = external hidden unnamed_addr constant [5 x i8], align 1
@_ZL3ctr = external hidden local_unnamed_addr constant [92 x [3 x i32]], align 16
@.str.10 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress norecurse nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i64, align 8
  %2 = alloca [3 x i32], align 4
  %3 = alloca %struct.Matrix, align 4
  %4 = alloca %struct.Matrix, align 4
  store i32 92, ptr getelementptr inbounds (i8, ptr @A, i64 4), align 4, !tbaa !5
  store i32 92, ptr @A, align 4, !tbaa !10
  br label %12

5:                                                ; preds = %12
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #6
  %6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.9, ptr noundef nonnull %1)
  %7 = icmp eq i32 %6, 1
  br i1 %7, label %.lr.ph32.preheader, label %._crit_edge

.lr.ph32.preheader:                               ; preds = %5
  %.phi.trans.insert = getelementptr inbounds i8, ptr %2, i64 4
  %.phi.trans.insert50 = getelementptr inbounds i8, ptr %2, i64 8
  %8 = load i8, ptr @.str.11, align 1
  %9 = sext i8 %8 to i32
  %10 = load i8, ptr getelementptr inbounds (i8, ptr @.str.11, i64 1), align 1
  %11 = sext i8 %10 to i32
  br label %.lr.ph32

12:                                               ; preds = %12, %0
  %indvars.iv = phi i64 [ 0, %0 ], [ %indvars.iv.next.2, %12 ]
  %13 = getelementptr inbounds [144 x [2 x i32]], ptr @_ZL3nxt, i64 0, i64 %indvars.iv
  %14 = load i32, ptr %13, align 8, !tbaa !11
  %15 = sext i32 %14 to i64
  %16 = getelementptr inbounds i8, ptr %13, i64 4
  %17 = load i32, ptr %16, align 4, !tbaa !11
  %18 = sext i32 %17 to i64
  %19 = getelementptr inbounds [92 x [92 x i32]], ptr getelementptr inbounds (i8, ptr @A, i64 8), i64 0, i64 %15, i64 %18
  %20 = load i32, ptr %19, align 4, !tbaa !11
  %21 = add i32 %20, 1
  store i32 %21, ptr %19, align 4, !tbaa !11
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %22 = getelementptr inbounds [144 x [2 x i32]], ptr @_ZL3nxt, i64 0, i64 %indvars.iv.next
  %23 = load i32, ptr %22, align 8, !tbaa !11
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds i8, ptr %22, i64 4
  %26 = load i32, ptr %25, align 4, !tbaa !11
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [92 x [92 x i32]], ptr getelementptr inbounds (i8, ptr @A, i64 8), i64 0, i64 %24, i64 %27
  %29 = load i32, ptr %28, align 4, !tbaa !11
  %30 = add i32 %29, 1
  store i32 %30, ptr %28, align 4, !tbaa !11
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %31 = getelementptr inbounds [144 x [2 x i32]], ptr @_ZL3nxt, i64 0, i64 %indvars.iv.next.1
  %32 = load i32, ptr %31, align 8, !tbaa !11
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds i8, ptr %31, i64 4
  %35 = load i32, ptr %34, align 4, !tbaa !11
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [92 x [92 x i32]], ptr getelementptr inbounds (i8, ptr @A, i64 8), i64 0, i64 %33, i64 %36
  %38 = load i32, ptr %37, align 4, !tbaa !11
  %39 = add i32 %38, 1
  store i32 %39, ptr %37, align 4, !tbaa !11
  %indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
  %exitcond.not.2 = icmp eq i64 %indvars.iv.next.2, 144
  br i1 %exitcond.not.2, label %5, label %12, !llvm.loop !12

._crit_edge:                                      ; preds = %.loopexit, %5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #6
  ret i32 0

.lr.ph32:                                         ; preds = %.lr.ph32.preheader, %.loopexit
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %2) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %2, i8 0, i64 12, i1 false)
  %40 = load i64, ptr %1, align 8, !tbaa !14
  %41 = icmp slt i64 %40, 9
  br i1 %41, label %.preheader24, label %53

.preheader24:                                     ; preds = %.lr.ph32
  %42 = getelementptr inbounds [9 x ptr], ptr @seq, i64 0, i64 %40
  %43 = load ptr, ptr %42, align 8, !tbaa !16
  %44 = load i8, ptr %43, align 1, !tbaa !18
  %.not29 = icmp eq i8 %44, 0
  br i1 %.not29, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader24, %.lr.ph
  %indvars.iv43 = phi i64 [ %indvars.iv.next44, %.lr.ph ], [ 0, %.preheader24 ]
  %45 = phi i8 [ %52, %.lr.ph ], [ %44, %.preheader24 ]
  %46 = sext i8 %45 to i64
  %47 = add nsw i64 %46, -49
  %48 = getelementptr inbounds [3 x i32], ptr %2, i64 0, i64 %47
  %49 = load i32, ptr %48, align 4, !tbaa !11
  %50 = add i32 %49, 1
  store i32 %50, ptr %48, align 4, !tbaa !11
  %indvars.iv.next44 = add nuw nsw i64 %indvars.iv43, 1
  %51 = getelementptr inbounds i8, ptr %43, i64 %indvars.iv.next44
  %52 = load i8, ptr %51, align 1, !tbaa !18
  %.not = icmp eq i8 %52, 0
  br i1 %.not, label %.loopexit.loopexit, label %.lr.ph, !llvm.loop !19

53:                                               ; preds = %.lr.ph32
  store i32 1, ptr @B, align 4, !tbaa !10
  store i32 92, ptr getelementptr inbounds (i8, ptr @B, i64 4), align 4, !tbaa !5
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(33856) getelementptr inbounds (i8, ptr @B, i64 8), i8 0, i64 33856, i1 false)
  store i32 1, ptr getelementptr inbounds (i8, ptr @B, i64 100), align 4, !tbaa !11
  store i32 1, ptr getelementptr inbounds (i8, ptr @B, i64 160), align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 33864, ptr nonnull %3) #6
  call void @llvm.lifetime.start.p0(i64 33864, ptr nonnull %4) #6
  %54 = add nsw i64 %40, -8
  call void @_ZNK6Matrix3powEx(ptr dead_on_unwind nonnull writable sret(%struct.Matrix) align 4 %4, ptr noundef nonnull align 4 dereferenceable(33864) @A, i64 noundef %54)
  call void @_ZNK6MatrixmlERKS_(ptr dead_on_unwind nonnull writable sret(%struct.Matrix) align 4 %3, ptr noundef nonnull align 4 dereferenceable(33864) @B, ptr noundef nonnull align 4 dereferenceable(33864) %4)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(33864) @B, ptr noundef nonnull align 4 dereferenceable(33864) %3, i64 33864, i1 false), !tbaa.struct !20
  call void @llvm.lifetime.end.p0(i64 33864, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 33864, ptr nonnull %3) #6
  br label %.preheader

.preheader:                                       ; preds = %53, %.preheader
  %55 = phi i32 [ 0, %53 ], [ %71, %.preheader ]
  %56 = phi i32 [ 0, %53 ], [ %67, %.preheader ]
  %57 = phi i32 [ 0, %53 ], [ %63, %.preheader ]
  %indvars.iv39 = phi i64 [ 0, %53 ], [ %indvars.iv.next40, %.preheader ]
  %58 = getelementptr inbounds [92 x i32], ptr getelementptr inbounds (i8, ptr @B, i64 8), i64 0, i64 %indvars.iv39
  %59 = load i32, ptr %58, align 4, !tbaa !11
  %60 = getelementptr inbounds [92 x [3 x i32]], ptr @_ZL3ctr, i64 0, i64 %indvars.iv39, i64 0
  %61 = load i32, ptr %60, align 4, !tbaa !11
  %62 = mul i32 %61, %59
  %63 = add i32 %57, %62
  %64 = getelementptr inbounds [92 x [3 x i32]], ptr @_ZL3ctr, i64 0, i64 %indvars.iv39, i64 1
  %65 = load i32, ptr %64, align 4, !tbaa !11
  %66 = mul i32 %65, %59
  %67 = add i32 %56, %66
  %68 = getelementptr inbounds [92 x [3 x i32]], ptr @_ZL3ctr, i64 0, i64 %indvars.iv39, i64 2
  %69 = load i32, ptr %68, align 4, !tbaa !11
  %70 = mul i32 %69, %59
  %71 = add i32 %55, %70
  %indvars.iv.next40 = add nuw nsw i64 %indvars.iv39, 1
  %exitcond42.not = icmp eq i64 %indvars.iv.next40, 92
  br i1 %exitcond42.not, label %.loopexit, label %.preheader, !llvm.loop !21

.loopexit.loopexit:                               ; preds = %.lr.ph
  %.pre = load i32, ptr %2, align 4, !tbaa !11
  %.pre49 = load i32, ptr %.phi.trans.insert, align 4, !tbaa !11
  %.pre51 = load i32, ptr %.phi.trans.insert50, align 4, !tbaa !11
  br label %.loopexit

.loopexit:                                        ; preds = %.preheader, %.loopexit.loopexit, %.preheader24
  %72 = phi i32 [ %.pre51, %.loopexit.loopexit ], [ 0, %.preheader24 ], [ %71, %.preheader ]
  %73 = phi i32 [ %.pre49, %.loopexit.loopexit ], [ 0, %.preheader24 ], [ %67, %.preheader ]
  %74 = phi i32 [ %.pre, %.loopexit.loopexit ], [ 0, %.preheader24 ], [ %63, %.preheader ]
  %75 = and i32 %74, 1073741823
  %76 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.10, i32 noundef %75, i32 noundef %9)
  %77 = and i32 %73, 1073741823
  %78 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.10, i32 noundef %77, i32 noundef %9)
  %79 = and i32 %72, 1073741823
  %80 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.10, i32 noundef %79, i32 noundef %11)
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %2) #6
  %81 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.9, ptr noundef nonnull %1)
  %82 = icmp eq i32 %81, 1
  br i1 %82, label %.lr.ph32, label %._crit_edge, !llvm.loop !22
}

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

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

; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #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: 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(33864), ptr noundef nonnull align 4 dereferenceable(33864)) local_unnamed_addr #4 align 2

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

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

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

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

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

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


; Effective O3 passes: BDCEPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass