; LLVM IR from tangjz/acm-icpc :: hdu (6050)

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

@t = external dso_local global i32, align 4
@n = external dso_local global i64, align 8
@m = external dso_local global i64, align 8
@Sum = external dso_local global [65 x %struct.Matrix], align 16
@Mat = external dso_local global [65 x %struct.Matrix], align 16
@vec = external dso_local global %struct.Matrix, align 4
@Ans = external dso_local global %struct.Matrix, align 4
@Tmp = external dso_local global %struct.Matrix, align 4
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca %struct.Matrix, align 4
  %4 = alloca %struct.Matrix, align 4
  %5 = alloca %struct.Matrix, align 4
  %6 = alloca i32, align 4
  %7 = alloca %struct.Matrix, align 4
  %8 = alloca %struct.Matrix, align 4
  %9 = alloca %struct.Matrix, align 4
  %10 = alloca %struct.Matrix, align 4
  %11 = alloca %struct.Matrix, align 4
  store i32 0, ptr %1, align 4
  store i32 2, ptr getelementptr inbounds ([3 x i32], ptr getelementptr inbounds (%struct.Matrix, ptr @Mat, i32 0, i32 2), i64 0, i64 1), align 4, !tbaa !5
  store i32 2, ptr getelementptr inbounds (%struct.Matrix, ptr @Mat, i32 0, i32 1), align 4, !tbaa !9
  store i32 2, ptr @Mat, align 16, !tbaa !11
  store i32 2, ptr getelementptr inbounds (%struct.Matrix, ptr @Sum, i32 0, i32 1), align 4, !tbaa !9
  store i32 2, ptr @Sum, align 16, !tbaa !11
  store i32 1, ptr getelementptr inbounds ([3 x i32], ptr getelementptr inbounds ([3 x [3 x i32]], ptr getelementptr inbounds (%struct.Matrix, ptr @Mat, i32 0, i32 2), i64 0, i64 1), i64 0, i64 1), align 4, !tbaa !5
  store i32 1, ptr getelementptr inbounds ([3 x [3 x i32]], ptr getelementptr inbounds (%struct.Matrix, ptr @Mat, i32 0, i32 2), i64 0, i64 1), align 4, !tbaa !5
  store i32 1, ptr getelementptr inbounds ([3 x i32], ptr getelementptr inbounds ([3 x [3 x i32]], ptr getelementptr inbounds (%struct.Matrix, ptr @Sum, i32 0, i32 2), i64 0, i64 1), i64 0, i64 1), align 4, !tbaa !5
  store i32 1, ptr getelementptr inbounds (%struct.Matrix, ptr @Sum, i32 0, i32 2), align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %12

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

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

16:                                               ; preds = %12
  call void @llvm.lifetime.start.p0(i64 44, ptr %3) #5
  %17 = load i32, ptr %2, align 4, !tbaa !5
  %18 = sub nsw i32 %17, 1
  %19 = sext i32 %18 to i64
  %20 = getelementptr inbounds [65 x %struct.Matrix], ptr @Sum, i64 0, i64 %19
  call void @llvm.lifetime.start.p0(i64 44, ptr %4) #5
  %21 = load i32, ptr %2, align 4, !tbaa !5
  %22 = sub nsw i32 %21, 1
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds [65 x %struct.Matrix], ptr @Mat, i64 0, i64 %23
  %25 = load i32, ptr %2, align 4, !tbaa !5
  %26 = sub nsw i32 %25, 1
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [65 x %struct.Matrix], ptr @Sum, i64 0, i64 %27
  call void @_ZNK6MatrixmlERKS_(ptr dead_on_unwind writable sret(%struct.Matrix) align 4 %4, ptr noundef nonnull align 4 dereferenceable(44) %24, ptr noundef nonnull align 4 dereferenceable(44) %28)
  call void @_ZNK6MatrixplERKS_(ptr dead_on_unwind writable sret(%struct.Matrix) align 4 %3, ptr noundef nonnull align 4 dereferenceable(44) %20, ptr noundef nonnull align 4 dereferenceable(44) %4)
  %29 = load i32, ptr %2, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds [65 x %struct.Matrix], ptr @Sum, i64 0, i64 %30
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %31, ptr align 4 %3, i64 44, i1 false), !tbaa.struct !12
  call void @llvm.lifetime.end.p0(i64 44, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 44, ptr %3) #5
  call void @llvm.lifetime.start.p0(i64 44, ptr %5) #5
  %32 = load i32, ptr %2, align 4, !tbaa !5
  %33 = sub nsw i32 %32, 1
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [65 x %struct.Matrix], ptr @Mat, i64 0, i64 %34
  %36 = load i32, ptr %2, align 4, !tbaa !5
  %37 = sub nsw i32 %36, 1
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [65 x %struct.Matrix], ptr @Mat, i64 0, i64 %38
  call void @_ZNK6MatrixmlERKS_(ptr dead_on_unwind writable sret(%struct.Matrix) align 4 %5, ptr noundef nonnull align 4 dereferenceable(44) %35, ptr noundef nonnull align 4 dereferenceable(44) %39)
  %40 = load i32, ptr %2, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [65 x %struct.Matrix], ptr @Mat, i64 0, i64 %41
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %42, ptr align 4 %5, i64 44, i1 false), !tbaa.struct !12
  call void @llvm.lifetime.end.p0(i64 44, ptr %5) #5
  br label %43

43:                                               ; preds = %16
  %44 = load i32, ptr %2, align 4, !tbaa !5
  %45 = add nsw i32 %44, 1
  store i32 %45, ptr %2, align 4, !tbaa !5
  br label %12, !llvm.loop !14

46:                                               ; preds = %15
  store i32 1, ptr getelementptr inbounds ([3 x i32], ptr getelementptr inbounds (%struct.Matrix, ptr @vec, i32 0, i32 2), i64 0, i64 1), align 4, !tbaa !5
  store i32 1, ptr getelementptr inbounds (%struct.Matrix, ptr @vec, i32 0, i32 2), align 4, !tbaa !5
  store i32 1, ptr @vec, align 4, !tbaa !11
  store i32 2, ptr getelementptr inbounds (%struct.Matrix, ptr @vec, i32 0, i32 1), align 4, !tbaa !9
  %47 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @t)
  br label %48

48:                                               ; preds = %76, %46
  %49 = load i32, ptr @t, align 4, !tbaa !5
  %50 = add nsw i32 %49, -1
  store i32 %50, ptr @t, align 4, !tbaa !5
  %51 = icmp ne i32 %49, 0
  br i1 %51, label %52, label %81

52:                                               ; preds = %48
  %53 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef @n, ptr noundef @m)
  store i32 2, ptr getelementptr inbounds (%struct.Matrix, ptr @Tmp, i32 0, i32 1), align 4, !tbaa !9
  store i32 2, ptr @Tmp, align 4, !tbaa !11
  store i32 2, ptr getelementptr inbounds (%struct.Matrix, ptr @Ans, i32 0, i32 1), align 4, !tbaa !9
  store i32 2, ptr @Ans, align 4, !tbaa !11
  store i32 0, ptr getelementptr inbounds ([3 x [3 x i32]], ptr getelementptr inbounds (%struct.Matrix, ptr @Tmp, i32 0, i32 2), i64 0, i64 1), align 4, !tbaa !5
  store i32 0, ptr getelementptr inbounds ([3 x i32], ptr getelementptr inbounds (%struct.Matrix, ptr @Tmp, i32 0, i32 2), i64 0, i64 1), align 4, !tbaa !5
  store i32 0, ptr getelementptr inbounds ([3 x i32], ptr getelementptr inbounds ([3 x [3 x i32]], ptr getelementptr inbounds (%struct.Matrix, ptr @Ans, i32 0, i32 2), i64 0, i64 1), i64 0, i64 1), align 4, !tbaa !5
  store i32 0, ptr getelementptr inbounds ([3 x [3 x i32]], ptr getelementptr inbounds (%struct.Matrix, ptr @Ans, i32 0, i32 2), i64 0, i64 1), align 4, !tbaa !5
  store i32 0, ptr getelementptr inbounds ([3 x i32], ptr getelementptr inbounds (%struct.Matrix, ptr @Ans, i32 0, i32 2), i64 0, i64 1), align 4, !tbaa !5
  store i32 0, ptr getelementptr inbounds (%struct.Matrix, ptr @Ans, i32 0, i32 2), align 4, !tbaa !5
  store i32 1, ptr getelementptr inbounds ([3 x i32], ptr getelementptr inbounds ([3 x [3 x i32]], ptr getelementptr inbounds (%struct.Matrix, ptr @Tmp, i32 0, i32 2), i64 0, i64 1), i64 0, i64 1), align 4, !tbaa !5
  store i32 1, ptr getelementptr inbounds (%struct.Matrix, ptr @Tmp, i32 0, i32 2), align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %54

54:                                               ; preds = %71, %52
  %55 = load i64, ptr @n, align 8, !tbaa !16
  %56 = icmp ne i64 %55, 0
  br i1 %56, label %58, label %57

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

58:                                               ; preds = %54
  %59 = load i64, ptr @n, align 8, !tbaa !16
  %60 = xor i64 %59, -1
  %61 = and i64 %60, 1
  %62 = icmp ne i64 %61, 0
  br i1 %62, label %63, label %64

63:                                               ; preds = %58
  br label %71

64:                                               ; preds = %58
  call void @llvm.lifetime.start.p0(i64 44, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 44, ptr %8) #5
  %65 = load i32, ptr %6, align 4, !tbaa !5
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [65 x %struct.Matrix], ptr @Sum, i64 0, i64 %66
  call void @_ZNK6MatrixmlERKS_(ptr dead_on_unwind writable sret(%struct.Matrix) align 4 %8, ptr noundef nonnull align 4 dereferenceable(44) @Tmp, ptr noundef nonnull align 4 dereferenceable(44) %67)
  call void @_ZNK6MatrixplERKS_(ptr dead_on_unwind writable sret(%struct.Matrix) align 4 %7, ptr noundef nonnull align 4 dereferenceable(44) @Ans, ptr noundef nonnull align 4 dereferenceable(44) %8)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 @Ans, ptr align 4 %7, i64 44, i1 false), !tbaa.struct !12
  call void @llvm.lifetime.end.p0(i64 44, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 44, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 44, ptr %9) #5
  %68 = load i32, ptr %6, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [65 x %struct.Matrix], ptr @Mat, i64 0, i64 %69
  call void @_ZNK6MatrixmlERKS_(ptr dead_on_unwind writable sret(%struct.Matrix) align 4 %9, ptr noundef nonnull align 4 dereferenceable(44) @Tmp, ptr noundef nonnull align 4 dereferenceable(44) %70)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 @Tmp, ptr align 4 %9, i64 44, i1 false), !tbaa.struct !12
  call void @llvm.lifetime.end.p0(i64 44, ptr %9) #5
  br label %71

71:                                               ; preds = %64, %63
  %72 = load i32, ptr %6, align 4, !tbaa !5
  %73 = add nsw i32 %72, 1
  store i32 %73, ptr %6, align 4, !tbaa !5
  %74 = load i64, ptr @n, align 8, !tbaa !16
  %75 = ashr i64 %74, 1
  store i64 %75, ptr @n, align 8, !tbaa !16
  br label %54, !llvm.loop !18

76:                                               ; preds = %57
  call void @llvm.lifetime.start.p0(i64 44, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 44, ptr %11) #5
  %77 = load i64, ptr @m, align 8, !tbaa !16
  %78 = sub nsw i64 %77, 1
  call void @_ZNK6Matrix3powEx(ptr dead_on_unwind writable sret(%struct.Matrix) align 4 %11, ptr noundef nonnull align 4 dereferenceable(44) @Ans, i64 noundef %78)
  call void @_ZNK6MatrixmlERKS_(ptr dead_on_unwind writable sret(%struct.Matrix) align 4 %10, ptr noundef nonnull align 4 dereferenceable(44) @vec, ptr noundef nonnull align 4 dereferenceable(44) %11)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 @Ans, ptr align 4 %10, i64 44, i1 false), !tbaa.struct !12
  call void @llvm.lifetime.end.p0(i64 44, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 44, ptr %10) #5
  %79 = load i32, ptr getelementptr inbounds (%struct.Matrix, ptr @Ans, i32 0, i32 2), align 4, !tbaa !5
  %80 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %79)
  br label %48, !llvm.loop !19

81:                                               ; preds = %48
  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: mustprogress uwtable
declare dso_local void @_ZNK6MatrixplERKS_(ptr dead_on_unwind noalias writable sret(%struct.Matrix) align 4, ptr noundef nonnull align 4 dereferenceable(44), ptr noundef nonnull align 4 dereferenceable(44)) #2 align 2

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

; 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, ...) #4

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

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

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 = { 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 #3 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { "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 = { 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 = !{i64 0, i64 4, !5, i64 4, i64 4, !5, i64 8, i64 36, !13}
!13 = !{!7, !7, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = !{!17, !17, i64 0}
!17 = !{!"long long", !7, i64 0}
!18 = distinct !{!18, !15}
!19 = distinct !{!19, !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, [3 x [3 x i32]] }

@t = external dso_local global i32, align 4
@n = external dso_local global i64, align 8
@m = external dso_local global i64, align 8
@Sum = external dso_local global [65 x %struct.Matrix], align 16
@Mat = external dso_local global [65 x %struct.Matrix], align 16
@vec = external dso_local global %struct.Matrix, align 4
@Ans = external dso_local global %struct.Matrix, align 4
@Tmp = external dso_local global %struct.Matrix, align 4
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca %struct.Matrix, align 4
  %2 = alloca %struct.Matrix, align 4
  %3 = alloca %struct.Matrix, align 4
  %4 = alloca %struct.Matrix, align 4
  %5 = alloca %struct.Matrix, align 4
  %6 = alloca %struct.Matrix, align 4
  %7 = alloca %struct.Matrix, align 4
  %8 = alloca %struct.Matrix, align 4
  store i32 2, ptr getelementptr inbounds (i8, ptr @Mat, i64 12), align 4, !tbaa !5
  store i32 2, ptr getelementptr inbounds (i8, ptr @Mat, i64 4), align 4, !tbaa !9
  store i32 2, ptr @Mat, align 16, !tbaa !11
  store i32 2, ptr getelementptr inbounds (i8, ptr @Sum, i64 4), align 4, !tbaa !9
  store i32 2, ptr @Sum, align 16, !tbaa !11
  store i32 1, ptr getelementptr inbounds (i8, ptr @Mat, i64 24), align 8, !tbaa !5
  store i32 1, ptr getelementptr inbounds (i8, ptr @Mat, i64 20), align 4, !tbaa !5
  store i32 1, ptr getelementptr inbounds (i8, ptr @Sum, i64 24), align 8, !tbaa !5
  store i32 1, ptr getelementptr inbounds (i8, ptr @Sum, i64 8), align 8, !tbaa !5
  br label %13

9:                                                ; preds = %13
  store <4 x i32> <i32 1, i32 2, i32 1, i32 1>, ptr @vec, align 4, !tbaa !5
  %10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @t)
  %11 = load i32, ptr @t, align 4, !tbaa !5
  %12 = add nsw i32 %11, -1
  store i32 %12, ptr @t, align 4, !tbaa !5
  %.not19 = icmp eq i32 %11, 0
  br i1 %.not19, label %._crit_edge22, label %.lr.ph21

13:                                               ; preds = %0, %13
  %indvars.iv = phi i64 [ 1, %0 ], [ %indvars.iv.next, %13 ]
  call void @llvm.lifetime.start.p0(i64 44, ptr nonnull %1) #5
  %14 = add nsw i64 %indvars.iv, -1
  %15 = getelementptr inbounds [65 x %struct.Matrix], ptr @Sum, i64 0, i64 %14
  call void @llvm.lifetime.start.p0(i64 44, ptr nonnull %2) #5
  %16 = getelementptr inbounds [65 x %struct.Matrix], ptr @Mat, i64 0, i64 %14
  call void @_ZNK6MatrixmlERKS_(ptr dead_on_unwind nonnull writable sret(%struct.Matrix) align 4 %2, ptr noundef nonnull align 4 dereferenceable(44) %16, ptr noundef nonnull align 4 dereferenceable(44) %15)
  call void @_ZNK6MatrixplERKS_(ptr dead_on_unwind nonnull writable sret(%struct.Matrix) align 4 %1, ptr noundef nonnull align 4 dereferenceable(44) %15, ptr noundef nonnull align 4 dereferenceable(44) %2)
  %17 = getelementptr inbounds [65 x %struct.Matrix], ptr @Sum, i64 0, i64 %indvars.iv
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(44) %17, ptr noundef nonnull align 4 dereferenceable(44) %1, i64 44, i1 false), !tbaa.struct !12
  call void @llvm.lifetime.end.p0(i64 44, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 44, ptr nonnull %1) #5
  call void @llvm.lifetime.start.p0(i64 44, ptr nonnull %3) #5
  call void @_ZNK6MatrixmlERKS_(ptr dead_on_unwind nonnull writable sret(%struct.Matrix) align 4 %3, ptr noundef nonnull align 4 dereferenceable(44) %16, ptr noundef nonnull align 4 dereferenceable(44) %16)
  %18 = getelementptr inbounds [65 x %struct.Matrix], ptr @Mat, i64 0, i64 %indvars.iv
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(44) %18, ptr noundef nonnull align 4 dereferenceable(44) %3, i64 44, i1 false), !tbaa.struct !12
  call void @llvm.lifetime.end.p0(i64 44, ptr nonnull %3) #5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 65
  br i1 %exitcond.not, label %9, label %13, !llvm.loop !14

.lr.ph21:                                         ; preds = %9, %._crit_edge
  %19 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @n, ptr noundef nonnull @m)
  store i32 0, ptr getelementptr inbounds (i8, ptr @Tmp, i64 20), align 4, !tbaa !5
  store i32 0, ptr getelementptr inbounds (i8, ptr @Ans, i64 24), align 4, !tbaa !5
  store i32 0, ptr getelementptr inbounds (i8, ptr @Ans, i64 20), align 4, !tbaa !5
  store <4 x i32> <i32 2, i32 2, i32 0, i32 0>, ptr @Ans, align 4, !tbaa !5
  store i32 1, ptr getelementptr inbounds (i8, ptr @Tmp, i64 24), align 4, !tbaa !5
  store <4 x i32> <i32 2, i32 2, i32 1, i32 0>, ptr @Tmp, align 4, !tbaa !5
  %.pr = load i64, ptr @n, align 8, !tbaa !16
  %.not1417 = icmp eq i64 %.pr, 0
  br i1 %.not1417, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %31, %.lr.ph21
  call void @llvm.lifetime.start.p0(i64 44, ptr nonnull %7) #5
  call void @llvm.lifetime.start.p0(i64 44, ptr nonnull %8) #5
  %20 = load i64, ptr @m, align 8, !tbaa !16
  %21 = add nsw i64 %20, -1
  call void @_ZNK6Matrix3powEx(ptr dead_on_unwind nonnull writable sret(%struct.Matrix) align 4 %8, ptr noundef nonnull align 4 dereferenceable(44) @Ans, i64 noundef %21)
  call void @_ZNK6MatrixmlERKS_(ptr dead_on_unwind nonnull writable sret(%struct.Matrix) align 4 %7, ptr noundef nonnull align 4 dereferenceable(44) @vec, ptr noundef nonnull align 4 dereferenceable(44) %8)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(44) @Ans, ptr noundef nonnull align 4 dereferenceable(44) %7, i64 44, i1 false), !tbaa.struct !12
  call void @llvm.lifetime.end.p0(i64 44, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 44, ptr nonnull %7) #5
  %22 = load i32, ptr getelementptr inbounds (i8, ptr @Ans, i64 8), align 4, !tbaa !5
  %23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %22)
  %24 = load i32, ptr @t, align 4, !tbaa !5
  %25 = add nsw i32 %24, -1
  store i32 %25, ptr @t, align 4, !tbaa !5
  %.not = icmp eq i32 %24, 0
  br i1 %.not, label %._crit_edge22, label %.lr.ph21, !llvm.loop !18

.lr.ph:                                           ; preds = %.lr.ph21, %31
  %indvars.iv24 = phi i64 [ %indvars.iv.next25, %31 ], [ 0, %.lr.ph21 ]
  %26 = phi i64 [ %33, %31 ], [ %.pr, %.lr.ph21 ]
  %27 = and i64 %26, 1
  %.not15.not = icmp eq i64 %27, 0
  br i1 %.not15.not, label %31, label %28

28:                                               ; preds = %.lr.ph
  call void @llvm.lifetime.start.p0(i64 44, ptr nonnull %4) #5
  call void @llvm.lifetime.start.p0(i64 44, ptr nonnull %5) #5
  %29 = getelementptr inbounds [65 x %struct.Matrix], ptr @Sum, i64 0, i64 %indvars.iv24
  call void @_ZNK6MatrixmlERKS_(ptr dead_on_unwind nonnull writable sret(%struct.Matrix) align 4 %5, ptr noundef nonnull align 4 dereferenceable(44) @Tmp, ptr noundef nonnull align 4 dereferenceable(44) %29)
  call void @_ZNK6MatrixplERKS_(ptr dead_on_unwind nonnull writable sret(%struct.Matrix) align 4 %4, ptr noundef nonnull align 4 dereferenceable(44) @Ans, ptr noundef nonnull align 4 dereferenceable(44) %5)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(44) @Ans, ptr noundef nonnull align 4 dereferenceable(44) %4, i64 44, i1 false), !tbaa.struct !12
  call void @llvm.lifetime.end.p0(i64 44, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 44, ptr nonnull %4) #5
  call void @llvm.lifetime.start.p0(i64 44, ptr nonnull %6) #5
  %30 = getelementptr inbounds [65 x %struct.Matrix], ptr @Mat, i64 0, i64 %indvars.iv24
  call void @_ZNK6MatrixmlERKS_(ptr dead_on_unwind nonnull writable sret(%struct.Matrix) align 4 %6, ptr noundef nonnull align 4 dereferenceable(44) @Tmp, ptr noundef nonnull align 4 dereferenceable(44) %30)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(44) @Tmp, ptr noundef nonnull align 4 dereferenceable(44) %6, i64 44, i1 false), !tbaa.struct !12
  call void @llvm.lifetime.end.p0(i64 44, ptr nonnull %6) #5
  %.pre = load i64, ptr @n, align 8, !tbaa !16
  br label %31

31:                                               ; preds = %.lr.ph, %28
  %32 = phi i64 [ %26, %.lr.ph ], [ %.pre, %28 ]
  %indvars.iv.next25 = add nuw nsw i64 %indvars.iv24, 1
  %33 = ashr i64 %32, 1
  store i64 %33, ptr @n, align 8, !tbaa !16
  %.not14 = icmp ult i64 %32, 2
  br i1 %.not14, label %._crit_edge, label %.lr.ph, !llvm.loop !19

._crit_edge22:                                    ; preds = %._crit_edge, %9
  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: mustprogress uwtable
declare dso_local void @_ZNK6MatrixplERKS_(ptr dead_on_unwind noalias writable sret(%struct.Matrix) align 4, ptr noundef nonnull align 4 dereferenceable(44), ptr noundef nonnull align 4 dereferenceable(44)) local_unnamed_addr #2 align 2

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

; 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 #4

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

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

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 = { 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 #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { 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 = !{i64 0, i64 4, !5, i64 4, i64 4, !5, i64 8, i64 36, !13}
!13 = !{!7, !7, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = !{!17, !17, i64 0}
!17 = !{!"long long", !7, i64 0}
!18 = distinct !{!18, !15}
!19 = distinct !{!19, !15}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass