; LLVM IR from tangjz/acm-icpc :: poj (3233)

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

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

9:                                                ; preds = %119, %0
  %10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @k, ptr noundef @m)
  %11 = icmp eq i32 %10, 3
  br i1 %11, label %12, label %120

12:                                               ; preds = %9
  call void @llvm.memset.p0.i64(ptr align 4 @A, i8 0, i64 14408, i1 false)
  %13 = load i32, ptr @n, align 4, !tbaa !5
  %14 = shl i32 %13, 1
  store i32 %14, ptr getelementptr inbounds (%struct.Matrix, ptr @A, i32 0, i32 1), align 4, !tbaa !9
  store i32 %14, ptr @A, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %15

15:                                               ; preds = %55, %12
  %16 = load i32, ptr %2, align 4, !tbaa !5
  %17 = load i32, ptr @n, align 4, !tbaa !5
  %18 = icmp slt i32 %16, %17
  br i1 %18, label %20, label %19

19:                                               ; preds = %15
  store i32 4, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  br label %58

20:                                               ; preds = %15
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %21

21:                                               ; preds = %51, %20
  %22 = load i32, ptr %4, align 4, !tbaa !5
  %23 = load i32, ptr @n, align 4, !tbaa !5
  %24 = icmp slt i32 %22, %23
  br i1 %24, label %26, label %25

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

26:                                               ; preds = %21
  %27 = load i32, ptr %2, align 4, !tbaa !5
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [60 x [60 x i32]], ptr getelementptr inbounds (%struct.Matrix, ptr @A, i32 0, i32 2), i64 0, i64 %28
  %30 = load i32, ptr %4, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [60 x i32], ptr %29, i64 0, i64 %31
  %33 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %32)
  %34 = load i32, ptr @m, align 4, !tbaa !5
  %35 = load i32, ptr %2, align 4, !tbaa !5
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [60 x [60 x i32]], ptr getelementptr inbounds (%struct.Matrix, ptr @A, i32 0, i32 2), i64 0, i64 %36
  %38 = load i32, ptr %4, align 4, !tbaa !5
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds [60 x i32], ptr %37, i64 0, i64 %39
  %41 = load i32, ptr %40, align 4, !tbaa !5
  %42 = srem i32 %41, %34
  store i32 %42, ptr %40, align 4, !tbaa !5
  %43 = load i32, ptr %2, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [60 x [60 x i32]], ptr getelementptr inbounds (%struct.Matrix, ptr @A, i32 0, i32 2), i64 0, i64 %44
  %46 = load i32, ptr @n, align 4, !tbaa !5
  %47 = load i32, ptr %4, align 4, !tbaa !5
  %48 = add nsw i32 %46, %47
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [60 x i32], ptr %45, i64 0, i64 %49
  store i32 %42, ptr %50, align 4, !tbaa !5
  br label %51

51:                                               ; preds = %26
  %52 = load i32, ptr %4, align 4, !tbaa !5
  %53 = add nsw i32 %52, 1
  store i32 %53, ptr %4, align 4, !tbaa !5
  br label %21, !llvm.loop !12

54:                                               ; preds = %25
  br label %55

55:                                               ; preds = %54
  %56 = load i32, ptr %2, align 4, !tbaa !5
  %57 = add nsw i32 %56, 1
  store i32 %57, ptr %2, align 4, !tbaa !5
  br label %15, !llvm.loop !14

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

59:                                               ; preds = %77, %58
  %60 = load i32, ptr %5, align 4, !tbaa !5
  %61 = load i32, ptr @n, align 4, !tbaa !5
  %62 = icmp slt i32 %60, %61
  br i1 %62, label %64, label %63

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

64:                                               ; preds = %59
  %65 = load i32, ptr @m, align 4, !tbaa !5
  %66 = srem i32 1, %65
  %67 = load i32, ptr @n, align 4, !tbaa !5
  %68 = load i32, ptr %5, align 4, !tbaa !5
  %69 = add nsw i32 %67, %68
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [60 x [60 x i32]], ptr getelementptr inbounds (%struct.Matrix, ptr @A, i32 0, i32 2), i64 0, i64 %70
  %72 = load i32, ptr @n, align 4, !tbaa !5
  %73 = load i32, ptr %5, align 4, !tbaa !5
  %74 = add nsw i32 %72, %73
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [60 x i32], ptr %71, i64 0, i64 %75
  store i32 %66, ptr %76, align 4, !tbaa !5
  br label %77

77:                                               ; preds = %64
  %78 = load i32, ptr %5, align 4, !tbaa !5
  %79 = add nsw i32 %78, 1
  store i32 %79, ptr %5, align 4, !tbaa !5
  br label %59, !llvm.loop !15

80:                                               ; preds = %63
  call void @llvm.lifetime.start.p0(i64 14408, ptr %6) #6
  %81 = load i32, ptr @k, align 4, !tbaa !5
  call void @_ZN6Matrix3powEi(ptr dead_on_unwind writable sret(%struct.Matrix) align 4 %6, ptr noundef nonnull align 4 dereferenceable(14408) @A, i32 noundef %81)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 @A, ptr align 4 %6, i64 14408, i1 false), !tbaa.struct !16
  call void @llvm.lifetime.end.p0(i64 14408, ptr %6) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %82

82:                                               ; preds = %116, %80
  %83 = load i32, ptr %7, align 4, !tbaa !5
  %84 = load i32, ptr @n, align 4, !tbaa !5
  %85 = icmp slt i32 %83, %84
  br i1 %85, label %87, label %86

86:                                               ; preds = %82
  store i32 13, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %119

87:                                               ; preds = %82
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %88

88:                                               ; preds = %112, %87
  %89 = load i32, ptr %8, align 4, !tbaa !5
  %90 = load i32, ptr @n, align 4, !tbaa !5
  %91 = icmp slt i32 %89, %90
  br i1 %91, label %93, label %92

92:                                               ; preds = %88
  store i32 16, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %115

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

112:                                              ; preds = %93
  %113 = load i32, ptr %8, align 4, !tbaa !5
  %114 = add nsw i32 %113, 1
  store i32 %114, ptr %8, align 4, !tbaa !5
  br label %88, !llvm.loop !18

115:                                              ; preds = %92
  br label %116

116:                                              ; preds = %115
  %117 = load i32, ptr %7, align 4, !tbaa !5
  %118 = add nsw i32 %117, 1
  store i32 %118, ptr %7, align 4, !tbaa !5
  br label %82, !llvm.loop !19

119:                                              ; preds = %86
  br label %9, !llvm.loop !20

120:                                              ; preds = %9
  ret i32 0
}

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6Matrix3powEi(ptr dead_on_unwind noalias writable sret(%struct.Matrix) align 4, ptr noundef nonnull align 4 dereferenceable(14408), i32 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, ...) #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 nounwind willreturn memory(argmem: write) }
attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #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, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 4}
!10 = !{!"_ZTS6Matrix", !6, i64 0, !6, i64 4, !7, i64 8}
!11 = !{!10, !6, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = distinct !{!15, !13}
!16 = !{i64 0, i64 4, !5, i64 4, i64 4, !5, i64 8, i64 14400, !17}
!17 = !{!7, !7, i64 0}
!18 = distinct !{!18, !13}
!19 = distinct !{!19, !13}
!20 = distinct !{!20, !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, [60 x [60 x i32]] }

@n = external dso_local global i32, align 4
@k = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@A = external dso_local global %struct.Matrix, align 4
@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [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() local_unnamed_addr #0 {
  %1 = alloca %struct.Matrix, align 4
  %2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @k, ptr noundef nonnull @m)
  %3 = icmp eq i32 %2, 3
  br i1 %3, label %.lr.ph39, label %._crit_edge40

.loopexit:                                        ; preds = %._crit_edge36, %._crit_edge33
  %4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @k, ptr noundef nonnull @m)
  %5 = icmp eq i32 %4, 3
  br i1 %5, label %.lr.ph39, label %._crit_edge40, !llvm.loop !5

.lr.ph39:                                         ; preds = %0, %.loopexit
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(14408) getelementptr inbounds (i8, ptr @A, i64 8), i8 0, i64 14400, i1 false)
  %6 = load i32, ptr @n, align 4, !tbaa !7
  %7 = shl i32 %6, 1
  store i32 %7, ptr getelementptr inbounds (i8, ptr @A, i64 4), align 4, !tbaa !11
  store i32 %7, ptr @A, align 4, !tbaa !13
  %8 = icmp sgt i32 %6, 0
  br i1 %8, label %.preheader27, label %._crit_edge33

.preheader28:                                     ; preds = %._crit_edge
  %9 = icmp sgt i32 %16, 0
  br i1 %9, label %.lr.ph32, label %._crit_edge33

.lr.ph32:                                         ; preds = %.preheader28
  %10 = load i32, ptr @m, align 4, !tbaa !7
  %11 = srem i32 1, %10
  %12 = zext nneg i32 %16 to i64
  %xtraiter = and i64 %12, 3
  %13 = icmp ult i32 %16, 4
  br i1 %13, label %._crit_edge33.loopexit.unr-lcssa, label %.lr.ph32.new

.lr.ph32.new:                                     ; preds = %.lr.ph32
  %unroll_iter = and i64 %12, 2147483644
  br label %35

.preheader27:                                     ; preds = %.lr.ph39, %._crit_edge
  %14 = phi i32 [ %16, %._crit_edge ], [ %6, %.lr.ph39 ]
  %indvars.iv45 = phi i64 [ %indvars.iv.next46, %._crit_edge ], [ 0, %.lr.ph39 ]
  %15 = icmp sgt i32 %14, 0
  br i1 %15, label %.lr.ph, label %.preheader27.._crit_edge_crit_edge

.preheader27.._crit_edge_crit_edge:               ; preds = %.preheader27
  %.pre = sext i32 %14 to i64
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.preheader27.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre, %.preheader27.._crit_edge_crit_edge ], [ %28, %.lr.ph ]
  %16 = phi i32 [ %14, %.preheader27.._crit_edge_crit_edge ], [ %23, %.lr.ph ]
  %indvars.iv.next46 = add nuw nsw i64 %indvars.iv45, 1
  %17 = icmp slt i64 %indvars.iv.next46, %.pre-phi
  br i1 %17, label %.preheader27, label %.preheader28, !llvm.loop !14

.lr.ph:                                           ; preds = %.preheader27, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.preheader27 ]
  %18 = getelementptr inbounds [60 x [60 x i32]], ptr getelementptr inbounds (i8, ptr @A, i64 8), i64 0, i64 %indvars.iv45, i64 %indvars.iv
  %19 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %18)
  %20 = load i32, ptr @m, align 4, !tbaa !7
  %21 = load i32, ptr %18, align 4, !tbaa !7
  %22 = srem i32 %21, %20
  store i32 %22, ptr %18, align 4, !tbaa !7
  %23 = load i32, ptr @n, align 4, !tbaa !7
  %24 = trunc nuw nsw i64 %indvars.iv to i32
  %25 = add nsw i32 %23, %24
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds [60 x [60 x i32]], ptr getelementptr inbounds (i8, ptr @A, i64 8), i64 0, i64 %indvars.iv45, i64 %26
  store i32 %22, ptr %27, align 4, !tbaa !7
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %28 = sext i32 %23 to i64
  %29 = icmp slt i64 %indvars.iv.next, %28
  br i1 %29, label %.lr.ph, label %._crit_edge, !llvm.loop !16

._crit_edge33.loopexit.unr-lcssa:                 ; preds = %35, %.lr.ph32
  %indvars.iv48.unr = phi i64 [ 0, %.lr.ph32 ], [ %indvars.iv.next49.3, %35 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge33, label %.epil.preheader

.epil.preheader:                                  ; preds = %._crit_edge33.loopexit.unr-lcssa, %.epil.preheader
  %indvars.iv48.epil = phi i64 [ %indvars.iv.next49.epil, %.epil.preheader ], [ %indvars.iv48.unr, %._crit_edge33.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.epil.preheader ], [ 0, %._crit_edge33.loopexit.unr-lcssa ]
  %30 = add nuw nsw i64 %indvars.iv48.epil, %12
  %31 = getelementptr inbounds [60 x [60 x i32]], ptr getelementptr inbounds (i8, ptr @A, i64 8), i64 0, i64 %30, i64 %30
  store i32 %11, ptr %31, align 4, !tbaa !7
  %indvars.iv.next49.epil = add nuw nsw i64 %indvars.iv48.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge33, label %.epil.preheader, !llvm.loop !17

._crit_edge33:                                    ; preds = %._crit_edge33.loopexit.unr-lcssa, %.epil.preheader, %.lr.ph39, %.preheader28
  call void @llvm.lifetime.start.p0(i64 14408, ptr nonnull %1) #6
  %32 = load i32, ptr @k, align 4, !tbaa !7
  call void @_ZN6Matrix3powEi(ptr dead_on_unwind nonnull writable sret(%struct.Matrix) align 4 %1, ptr noundef nonnull align 4 dereferenceable(14408) @A, i32 noundef %32)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(14408) @A, ptr noundef nonnull align 4 dereferenceable(14408) %1, i64 14408, i1 false), !tbaa.struct !19
  call void @llvm.lifetime.end.p0(i64 14408, ptr nonnull %1) #6
  %33 = load i32, ptr @n, align 4, !tbaa !7
  %34 = icmp sgt i32 %33, 0
  br i1 %34, label %.preheader, label %.loopexit

35:                                               ; preds = %35, %.lr.ph32.new
  %indvars.iv48 = phi i64 [ 0, %.lr.ph32.new ], [ %indvars.iv.next49.3, %35 ]
  %niter = phi i64 [ 0, %.lr.ph32.new ], [ %niter.next.3, %35 ]
  %36 = add nuw nsw i64 %indvars.iv48, %12
  %37 = getelementptr inbounds [60 x [60 x i32]], ptr getelementptr inbounds (i8, ptr @A, i64 8), i64 0, i64 %36, i64 %36
  store i32 %11, ptr %37, align 4, !tbaa !7
  %indvars.iv.next49 = or disjoint i64 %indvars.iv48, 1
  %38 = add nuw nsw i64 %indvars.iv.next49, %12
  %39 = getelementptr inbounds [60 x [60 x i32]], ptr getelementptr inbounds (i8, ptr @A, i64 8), i64 0, i64 %38, i64 %38
  store i32 %11, ptr %39, align 4, !tbaa !7
  %indvars.iv.next49.1 = or disjoint i64 %indvars.iv48, 2
  %40 = add nuw nsw i64 %indvars.iv.next49.1, %12
  %41 = getelementptr inbounds [60 x [60 x i32]], ptr getelementptr inbounds (i8, ptr @A, i64 8), i64 0, i64 %40, i64 %40
  store i32 %11, ptr %41, align 4, !tbaa !7
  %indvars.iv.next49.2 = or disjoint i64 %indvars.iv48, 3
  %42 = add nuw nsw i64 %indvars.iv.next49.2, %12
  %43 = getelementptr inbounds [60 x [60 x i32]], ptr getelementptr inbounds (i8, ptr @A, i64 8), i64 0, i64 %42, i64 %42
  store i32 %11, ptr %43, align 4, !tbaa !7
  %indvars.iv.next49.3 = add nuw nsw i64 %indvars.iv48, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %._crit_edge33.loopexit.unr-lcssa, label %35, !llvm.loop !21

.preheader:                                       ; preds = %._crit_edge33, %._crit_edge36
  %44 = phi i32 [ %46, %._crit_edge36 ], [ %33, %._crit_edge33 ]
  %indvars.iv51 = phi i64 [ %indvars.iv.next52, %._crit_edge36 ], [ 0, %._crit_edge33 ]
  %45 = icmp sgt i32 %44, 0
  br i1 %45, label %.lr.ph35, label %._crit_edge36

._crit_edge36:                                    ; preds = %.lr.ph35, %.preheader
  %46 = phi i32 [ %44, %.preheader ], [ %62, %.lr.ph35 ]
  %indvars.iv.next52 = add nuw nsw i64 %indvars.iv51, 1
  %47 = sext i32 %46 to i64
  %48 = icmp slt i64 %indvars.iv.next52, %47
  br i1 %48, label %.preheader, label %.loopexit, !llvm.loop !22

.lr.ph35:                                         ; preds = %.preheader, %.lr.ph35
  %49 = phi i32 [ %62, %.lr.ph35 ], [ %44, %.preheader ]
  %.034 = phi i32 [ %61, %.lr.ph35 ], [ 0, %.preheader ]
  %50 = add nsw i32 %49, %.034
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [60 x [60 x i32]], ptr getelementptr inbounds (i8, ptr @A, i64 8), i64 0, i64 %indvars.iv51, i64 %51
  %53 = load i32, ptr %52, align 4, !tbaa !7
  %54 = add nsw i32 %49, -1
  %55 = icmp eq i32 %.034, %54
  %56 = zext i1 %55 to i64
  %57 = getelementptr inbounds [3 x i8], ptr @.str.3, i64 0, i64 %56
  %58 = load i8, ptr %57, align 1, !tbaa !20
  %59 = sext i8 %58 to i32
  %60 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %53, i32 noundef %59)
  %61 = add nuw nsw i32 %.034, 1
  %62 = load i32, ptr @n, align 4, !tbaa !7
  %63 = icmp slt i32 %61, %62
  br i1 %63, label %.lr.ph35, label %._crit_edge36, !llvm.loop !23

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6Matrix3powEi(ptr dead_on_unwind noalias writable sret(%struct.Matrix) align 4, ptr noundef nonnull align 4 dereferenceable(14408), i32 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 #1

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


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