; LLVM IR from tangjz/acm-icpc :: codeforces/gym (101412C)

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

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@p = external dso_local global i32, align 4
@x = external dso_local global i32, align 4
@y = external dso_local global i32, align 4
@z = external dso_local global i32, align 4
@A = external dso_local global %struct.Matrix, align 4
@B = external dso_local global %struct.Matrix, align 4
@.str = external hidden unnamed_addr constant [13 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = 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 %struct.Matrix, align 4
  %3 = alloca i32, align 4
  %4 = alloca %struct.Matrix, align 4
  %5 = alloca i32, align 4
  %6 = alloca %struct.Matrix, align 4
  %7 = alloca %struct.Matrix, align 4
  %8 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  br label %9

9:                                                ; preds = %117, %0
  %10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @p, ptr noundef @x, ptr noundef @y, ptr noundef @z, ptr noundef @m)
  %11 = icmp eq i32 %10, 6
  br i1 %11, label %12, label %25

12:                                               ; preds = %9
  %13 = load i32, ptr @n, align 4, !tbaa !5
  %14 = load i32, ptr @p, align 4, !tbaa !5
  %15 = add nsw i32 %13, %14
  %16 = load i32, ptr @x, align 4, !tbaa !5
  %17 = add nsw i32 %15, %16
  %18 = load i32, ptr @y, align 4, !tbaa !5
  %19 = add nsw i32 %17, %18
  %20 = load i32, ptr @z, align 4, !tbaa !5
  %21 = add nsw i32 %19, %20
  %22 = load i32, ptr @m, align 4, !tbaa !5
  %23 = add nsw i32 %21, %22
  %24 = icmp ne i32 %23, 0
  br label %25

25:                                               ; preds = %12, %9
  %26 = phi i1 [ false, %9 ], [ %24, %12 ]
  br i1 %26, label %27, label %118

27:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 10008, ptr %2) #6
  call void @llvm.memset.p0.i64(ptr align 4 %2, i8 0, i64 10008, i1 false)
  %28 = getelementptr inbounds %struct.Matrix, ptr %2, i32 0, i32 0
  store i32 1, ptr %28, align 4, !tbaa !9
  %29 = getelementptr inbounds %struct.Matrix, ptr %2, i32 0, i32 1
  %30 = load i32, ptr @n, align 4, !tbaa !5
  store i32 %30, ptr %29, align 4, !tbaa !11
  %31 = getelementptr inbounds %struct.Matrix, ptr %2, i32 0, i32 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 @A, ptr align 4 %2, i64 10008, i1 false), !tbaa.struct !12
  call void @llvm.lifetime.end.p0(i64 10008, ptr %2) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %32

32:                                               ; preds = %42, %27
  %33 = load i32, ptr %3, align 4, !tbaa !5
  %34 = load i32, ptr @n, align 4, !tbaa !5
  %35 = icmp slt i32 %33, %34
  br i1 %35, label %37, label %36

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

37:                                               ; preds = %32
  %38 = load i32, ptr %3, align 4, !tbaa !5
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds i32, ptr getelementptr inbounds (%struct.Matrix, ptr @A, i32 0, i32 2), i64 %39
  %41 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %40)
  br label %42

42:                                               ; preds = %37
  %43 = load i32, ptr %3, align 4, !tbaa !5
  %44 = add nsw i32 %43, 1
  store i32 %44, ptr %3, align 4, !tbaa !5
  br label %32, !llvm.loop !14

45:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 10008, ptr %4) #6
  call void @llvm.memset.p0.i64(ptr align 4 %4, i8 0, i64 10008, i1 false)
  %46 = getelementptr inbounds %struct.Matrix, ptr %4, i32 0, i32 0
  %47 = load i32, ptr @n, align 4, !tbaa !5
  store i32 %47, ptr %46, align 4, !tbaa !9
  %48 = getelementptr inbounds %struct.Matrix, ptr %4, i32 0, i32 1
  %49 = load i32, ptr @n, align 4, !tbaa !5
  store i32 %49, ptr %48, align 4, !tbaa !11
  %50 = getelementptr inbounds %struct.Matrix, ptr %4, i32 0, i32 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 @B, ptr align 4 %4, i64 10008, i1 false), !tbaa.struct !12
  call void @llvm.lifetime.end.p0(i64 10008, ptr %4) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %51

51:                                               ; preds = %90, %45
  %52 = load i32, ptr %5, align 4, !tbaa !5
  %53 = load i32, ptr @n, align 4, !tbaa !5
  %54 = icmp slt i32 %52, %53
  br i1 %54, label %56, label %55

55:                                               ; preds = %51
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  br label %93

56:                                               ; preds = %51
  %57 = load i32, ptr %5, align 4, !tbaa !5
  %58 = icmp ne i32 %57, 0
  br i1 %58, label %59, label %68

59:                                               ; preds = %56
  %60 = load i32, ptr @z, align 4, !tbaa !5
  %61 = load i32, ptr %5, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [50 x [50 x i32]], ptr getelementptr inbounds (%struct.Matrix, ptr @B, i32 0, i32 2), i64 0, i64 %62
  %64 = load i32, ptr %5, align 4, !tbaa !5
  %65 = sub nsw i32 %64, 1
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [50 x i32], ptr %63, i64 0, i64 %66
  store i32 %60, ptr %67, align 4, !tbaa !5
  br label %68

68:                                               ; preds = %59, %56
  %69 = load i32, ptr @y, align 4, !tbaa !5
  %70 = load i32, ptr %5, align 4, !tbaa !5
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [50 x [50 x i32]], ptr getelementptr inbounds (%struct.Matrix, ptr @B, i32 0, i32 2), i64 0, i64 %71
  %73 = load i32, ptr %5, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [50 x i32], ptr %72, i64 0, i64 %74
  store i32 %69, ptr %75, align 4, !tbaa !5
  %76 = load i32, ptr %5, align 4, !tbaa !5
  %77 = add nsw i32 %76, 1
  %78 = load i32, ptr @n, align 4, !tbaa !5
  %79 = icmp slt i32 %77, %78
  br i1 %79, label %80, label %89

80:                                               ; preds = %68
  %81 = load i32, ptr @x, align 4, !tbaa !5
  %82 = load i32, ptr %5, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [50 x [50 x i32]], ptr getelementptr inbounds (%struct.Matrix, ptr @B, i32 0, i32 2), i64 0, i64 %83
  %85 = load i32, ptr %5, align 4, !tbaa !5
  %86 = add nsw i32 %85, 1
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [50 x i32], ptr %84, i64 0, i64 %87
  store i32 %81, ptr %88, align 4, !tbaa !5
  br label %89

89:                                               ; preds = %80, %68
  br label %90

90:                                               ; preds = %89
  %91 = load i32, ptr %5, align 4, !tbaa !5
  %92 = add nsw i32 %91, 1
  store i32 %92, ptr %5, align 4, !tbaa !5
  br label %51, !llvm.loop !16

93:                                               ; preds = %55
  call void @llvm.lifetime.start.p0(i64 10008, ptr %6) #6
  call void @llvm.lifetime.start.p0(i64 10008, ptr %7) #6
  %94 = load i32, ptr @m, align 4, !tbaa !5
  call void @_ZN6Matrix3powEi(ptr dead_on_unwind writable sret(%struct.Matrix) align 4 %7, ptr noundef nonnull align 4 dereferenceable(10008) @B, i32 noundef %94)
  call void @_ZNK6MatrixmlERKS_(ptr dead_on_unwind writable sret(%struct.Matrix) align 4 %6, ptr noundef nonnull align 4 dereferenceable(10008) @A, ptr noundef nonnull align 4 dereferenceable(10008) %7)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 @A, ptr align 4 %6, i64 10008, i1 false), !tbaa.struct !12
  call void @llvm.lifetime.end.p0(i64 10008, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 10008, ptr %6) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %95

95:                                               ; preds = %114, %93
  %96 = load i32, ptr %8, align 4, !tbaa !5
  %97 = load i32, ptr @n, align 4, !tbaa !5
  %98 = icmp slt i32 %96, %97
  br i1 %98, label %100, label %99

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

100:                                              ; preds = %95
  %101 = load i32, ptr %8, align 4, !tbaa !5
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [50 x i32], ptr getelementptr inbounds (%struct.Matrix, ptr @A, i32 0, i32 2), i64 0, i64 %102
  %104 = load i32, ptr %103, align 4, !tbaa !5
  %105 = load i32, ptr %8, align 4, !tbaa !5
  %106 = load i32, ptr @n, align 4, !tbaa !5
  %107 = sub nsw i32 %106, 1
  %108 = icmp eq i32 %105, %107
  %109 = zext i1 %108 to i64
  %110 = getelementptr inbounds [3 x i8], ptr @.str.3, i64 0, i64 %109
  %111 = load i8, ptr %110, align 1, !tbaa !13
  %112 = sext i8 %111 to i32
  %113 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %104, i32 noundef %112)
  br label %114

114:                                              ; preds = %100
  %115 = load i32, ptr %8, align 4, !tbaa !5
  %116 = add nsw i32 %115, 1
  store i32 %116, ptr %8, align 4, !tbaa !5
  br label %95, !llvm.loop !17

117:                                              ; preds = %99
  br label %9, !llvm.loop !18

118:                                              ; preds = %25
  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 nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #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) #2

; 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(10008), ptr noundef nonnull align 4 dereferenceable(10008)) #5 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6Matrix3powEi(ptr dead_on_unwind noalias writable sret(%struct.Matrix) align 4, ptr noundef nonnull align 4 dereferenceable(10008), i32 noundef) #5 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 = { 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 = { 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 = !{!10, !6, i64 0}
!10 = !{!"_ZTS6Matrix", !6, i64 0, !6, i64 4, !7, i64 8}
!11 = !{!10, !6, i64 4}
!12 = !{i64 0, i64 4, !5, i64 4, i64 4, !5, i64 8, i64 10000, !13}
!13 = !{!7, !7, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15}
!17 = distinct !{!17, !15}
!18 = distinct !{!18, !15}


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

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@p = external dso_local global i32, align 4
@x = external dso_local global i32, align 4
@y = external dso_local global i32, align 4
@z = external dso_local global i32, align 4
@A = external dso_local global %struct.Matrix, align 4
@B = external dso_local global %struct.Matrix, align 4
@.str = external hidden unnamed_addr constant [13 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = 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 %struct.Matrix, align 4
  %2 = alloca %struct.Matrix, align 4
  %3 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @p, ptr noundef nonnull @x, ptr noundef nonnull @y, ptr noundef nonnull @z, ptr noundef nonnull @m)
  %4 = icmp eq i32 %3, 6
  br i1 %4, label %.lr.ph34, label %.critedge

.loopexit:                                        ; preds = %.lr.ph32, %._crit_edge29
  %5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @p, ptr noundef nonnull @x, ptr noundef nonnull @y, ptr noundef nonnull @z, ptr noundef nonnull @m)
  %6 = icmp eq i32 %5, 6
  br i1 %6, label %.lr.ph34, label %.critedge, !llvm.loop !5

.lr.ph34:                                         ; preds = %0, %.loopexit
  %7 = load i32, ptr @n, align 4, !tbaa !7
  %8 = load i32, ptr @p, align 4, !tbaa !7
  %9 = add nsw i32 %8, %7
  %10 = load i32, ptr @x, align 4, !tbaa !7
  %11 = add nsw i32 %9, %10
  %12 = load i32, ptr @y, align 4, !tbaa !7
  %13 = add nsw i32 %11, %12
  %14 = load i32, ptr @z, align 4, !tbaa !7
  %15 = add nsw i32 %13, %14
  %16 = load i32, ptr @m, align 4, !tbaa !7
  %17 = sub i32 0, %16
  %.not = icmp eq i32 %15, %17
  br i1 %.not, label %.critedge, label %18

18:                                               ; preds = %.lr.ph34
  store i32 1, ptr @A, align 4, !tbaa !7
  store i32 %7, ptr getelementptr inbounds (i8, ptr @A, i64 4), align 4, !tbaa !7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(10000) getelementptr inbounds (i8, ptr @A, i64 8), i8 0, i64 10000, i1 false)
  %19 = icmp sgt i32 %7, 0
  br i1 %19, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %18
  %.lcssa = phi i32 [ %7, %18 ], [ %28, %.lr.ph ]
  store i32 %.lcssa, ptr @B, align 4, !tbaa !7
  store i32 %.lcssa, ptr getelementptr inbounds (i8, ptr @B, i64 4), align 4, !tbaa !7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(10000) getelementptr inbounds (i8, ptr @B, i64 8), i8 0, i64 10000, i1 false)
  %20 = icmp sgt i32 %.lcssa, 0
  br i1 %20, label %21, label %._crit_edge29

21:                                               ; preds = %._crit_edge
  %22 = load i32, ptr @z, align 4
  %23 = load i32, ptr @y, align 4, !tbaa !7
  %24 = load i32, ptr @x, align 4
  %25 = zext nneg i32 %.lcssa to i64
  %wide.trip.count = zext nneg i32 %.lcssa to i64
  store i32 %23, ptr getelementptr inbounds (i8, ptr @B, i64 8), align 4, !tbaa !7
  %.not46 = icmp eq i32 %.lcssa, 1
  br i1 %.not46, label %._crit_edge29, label %.peel.next

.peel.next:                                       ; preds = %21
  store i32 %24, ptr getelementptr inbounds (i8, ptr @B, i64 12), align 4, !tbaa !7
  br label %34

.lr.ph:                                           ; preds = %18, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %18 ]
  %26 = getelementptr inbounds i32, ptr getelementptr inbounds (i8, ptr @A, i64 8), i64 %indvars.iv
  %27 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %26)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %28 = load i32, ptr @n, align 4, !tbaa !7
  %29 = sext i32 %28 to i64
  %30 = icmp slt i64 %indvars.iv.next, %29
  br i1 %30, label %.lr.ph, label %._crit_edge, !llvm.loop !11

._crit_edge29:                                    ; preds = %41, %21, %._crit_edge
  call void @llvm.lifetime.start.p0(i64 10008, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 10008, ptr nonnull %2) #6
  %31 = load i32, ptr @m, align 4, !tbaa !7
  call void @_ZN6Matrix3powEi(ptr dead_on_unwind nonnull writable sret(%struct.Matrix) align 4 %2, ptr noundef nonnull align 4 dereferenceable(10008) @B, i32 noundef %31)
  call void @_ZNK6MatrixmlERKS_(ptr dead_on_unwind nonnull writable sret(%struct.Matrix) align 4 %1, ptr noundef nonnull align 4 dereferenceable(10008) @A, ptr noundef nonnull align 4 dereferenceable(10008) %2)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(10008) @A, ptr noundef nonnull align 4 dereferenceable(10008) %1, i64 10008, i1 false), !tbaa.struct !12
  call void @llvm.lifetime.end.p0(i64 10008, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 10008, ptr nonnull %1) #6
  %32 = load i32, ptr @n, align 4, !tbaa !7
  %33 = icmp sgt i32 %32, 0
  br i1 %33, label %.lr.ph32, label %.loopexit

34:                                               ; preds = %.peel.next, %41
  %indvars.iv38 = phi i64 [ 1, %.peel.next ], [ %indvars.iv.next39, %41 ]
  %35 = add nsw i64 %indvars.iv38, -1
  %36 = getelementptr inbounds [50 x [50 x i32]], ptr getelementptr inbounds (i8, ptr @B, i64 8), i64 0, i64 %indvars.iv38, i64 %35
  store i32 %22, ptr %36, align 4, !tbaa !7
  %37 = getelementptr inbounds [50 x [50 x i32]], ptr getelementptr inbounds (i8, ptr @B, i64 8), i64 0, i64 %indvars.iv38, i64 %indvars.iv38
  store i32 %23, ptr %37, align 4, !tbaa !7
  %indvars.iv.next39 = add nuw nsw i64 %indvars.iv38, 1
  %38 = icmp ult i64 %indvars.iv.next39, %25
  br i1 %38, label %39, label %41

39:                                               ; preds = %34
  %40 = getelementptr inbounds [50 x [50 x i32]], ptr getelementptr inbounds (i8, ptr @B, i64 8), i64 0, i64 %indvars.iv38, i64 %indvars.iv.next39
  store i32 %24, ptr %40, align 4, !tbaa !7
  br label %41

41:                                               ; preds = %34, %39
  %exitcond.not = icmp eq i64 %indvars.iv.next39, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge29, label %34, !llvm.loop !14

.lr.ph32:                                         ; preds = %._crit_edge29, %.lr.ph32
  %indvars.iv42 = phi i64 [ %indvars.iv.next43, %.lr.ph32 ], [ 0, %._crit_edge29 ]
  %42 = phi i32 [ %53, %.lr.ph32 ], [ %32, %._crit_edge29 ]
  %43 = getelementptr inbounds [50 x i32], ptr getelementptr inbounds (i8, ptr @A, i64 8), i64 0, i64 %indvars.iv42
  %44 = load i32, ptr %43, align 4, !tbaa !7
  %45 = add nsw i32 %42, -1
  %46 = zext i32 %45 to i64
  %47 = icmp eq i64 %indvars.iv42, %46
  %48 = zext i1 %47 to i64
  %49 = getelementptr inbounds [3 x i8], ptr @.str.3, i64 0, i64 %48
  %50 = load i8, ptr %49, align 1, !tbaa !13
  %51 = sext i8 %50 to i32
  %52 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %44, i32 noundef %51)
  %indvars.iv.next43 = add nuw nsw i64 %indvars.iv42, 1
  %53 = load i32, ptr @n, align 4, !tbaa !7
  %54 = sext i32 %53 to i64
  %55 = icmp slt i64 %indvars.iv.next43, %54
  br i1 %55, label %.lr.ph32, label %.loopexit, !llvm.loop !16

.critedge:                                        ; preds = %.lr.ph34, %.loopexit, %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 nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #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) #2

; 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(10008), ptr noundef nonnull align 4 dereferenceable(10008)) local_unnamed_addr #5 align 2

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

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

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 = { 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 = { 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 = { 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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = distinct !{!11, !6}
!12 = !{i64 0, i64 4, !7, i64 4, i64 4, !7, i64 8, i64 10000, !13}
!13 = !{!9, !9, i64 0}
!14 = distinct !{!14, !6, !15}
!15 = !{!"llvm.loop.peeled.count", i32 1}
!16 = distinct !{!16, !6}


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