; LLVM IR from tangjz/acm-icpc :: 51nod (1033)

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

@A = external dso_local global %struct.Matrix, align 4
@B = external dso_local global %struct.Matrix, align 4
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@constinit = external hidden constant [4 x [4 x i32]], align 4
@constinit.2 = external hidden constant [4 x [4 x i32]], align 4
@constinit.3 = external hidden constant [4 x [4 x i32]], align 4
@constinit.4 = external hidden constant [4 x [4 x i32]], align 4
@.str.5 = 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 i32, align 4
  %4 = alloca i32, 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
  %9 = alloca %struct.Matrix, align 4
  %10 = alloca %struct.Matrix, align 4
  %11 = alloca %struct.Matrix, align 4
  %12 = alloca %struct.Matrix, align 4
  %13 = alloca %struct.Matrix, align 4
  %14 = alloca %struct.Matrix, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  %15 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2, ptr noundef %3)
  %16 = load i32, ptr %2, align 4, !tbaa !5
  %17 = and i32 %16, 1
  %18 = icmp ne i32 %17, 0
  br i1 %18, label %19, label %25

19:                                               ; preds = %0
  %20 = load i32, ptr %3, align 4, !tbaa !5
  %21 = and i32 %20, 1
  %22 = icmp ne i32 %21, 0
  br i1 %22, label %23, label %25

23:                                               ; preds = %19
  %24 = call i32 @puts(ptr noundef @.str.1)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %4, align 4
  br label %95

25:                                               ; preds = %19, %0
  %26 = load i32, ptr %3, align 4, !tbaa !5
  %27 = load i32, ptr %2, align 4, !tbaa !5
  %28 = icmp slt i32 %26, %27
  br i1 %28, label %29, label %39

29:                                               ; preds = %25
  %30 = load i32, ptr %2, align 4, !tbaa !5
  %31 = load i32, ptr %3, align 4, !tbaa !5
  %32 = add nsw i32 %30, %31
  store i32 %32, ptr %3, align 4, !tbaa !5
  %33 = load i32, ptr %3, align 4, !tbaa !5
  %34 = load i32, ptr %2, align 4, !tbaa !5
  %35 = sub nsw i32 %33, %34
  store i32 %35, ptr %2, align 4, !tbaa !5
  %36 = load i32, ptr %3, align 4, !tbaa !5
  %37 = load i32, ptr %2, align 4, !tbaa !5
  %38 = sub nsw i32 %36, %37
  store i32 %38, ptr %3, align 4, !tbaa !5
  br label %39

39:                                               ; preds = %29, %25
  %40 = load i32, ptr %2, align 4, !tbaa !5
  switch i32 %40, label %77 [
    i32 2, label %41
    i32 3, label %49
    i32 4, label %57
    i32 5, label %67
  ]

41:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 72, ptr %5) #6
  call void @llvm.memset.p0.i64(ptr align 4 %5, i8 0, i64 72, i1 false)
  %42 = getelementptr inbounds %struct.Matrix, ptr %5, i32 0, i32 0
  store i32 1, ptr %42, align 4, !tbaa !9
  %43 = getelementptr inbounds %struct.Matrix, ptr %5, i32 0, i32 1
  store i32 2, ptr %43, align 4, !tbaa !11
  %44 = getelementptr inbounds %struct.Matrix, ptr %5, i32 0, i32 2
  store i32 1, ptr %44, align 4, !tbaa !5
  %45 = getelementptr inbounds i32, ptr %44, i64 1
  store i32 1, ptr %45, align 4, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 @A, ptr align 4 %5, i64 72, i1 false), !tbaa.struct !12
  call void @llvm.lifetime.end.p0(i64 72, ptr %5) #6
  call void @llvm.lifetime.start.p0(i64 72, ptr %6) #6
  %46 = getelementptr inbounds %struct.Matrix, ptr %6, i32 0, i32 0
  store i32 2, ptr %46, align 4, !tbaa !9
  %47 = getelementptr inbounds %struct.Matrix, ptr %6, i32 0, i32 1
  store i32 2, ptr %47, align 4, !tbaa !11
  %48 = getelementptr inbounds %struct.Matrix, ptr %6, i32 0, i32 2
  call void @llvm.memset.p0.i64(ptr align 4 %48, i8 0, i64 64, i1 false)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %48, ptr align 4 @constinit, i64 64, i1 false), !tbaa.struct !14
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 @B, ptr align 4 %6, i64 72, i1 false), !tbaa.struct !12
  call void @llvm.lifetime.end.p0(i64 72, ptr %6) #6
  br label %77

49:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 72, ptr %7) #6
  call void @llvm.memset.p0.i64(ptr align 4 %7, i8 0, i64 72, i1 false)
  %50 = getelementptr inbounds %struct.Matrix, ptr %7, i32 0, i32 0
  store i32 1, ptr %50, align 4, !tbaa !9
  %51 = getelementptr inbounds %struct.Matrix, ptr %7, i32 0, i32 1
  store i32 2, ptr %51, align 4, !tbaa !11
  %52 = getelementptr inbounds %struct.Matrix, ptr %7, i32 0, i32 2
  store i32 1, ptr %52, align 4, !tbaa !5
  %53 = getelementptr inbounds i32, ptr %52, i64 1
  store i32 1, ptr %53, align 4, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 @A, ptr align 4 %7, i64 72, i1 false), !tbaa.struct !12
  call void @llvm.lifetime.end.p0(i64 72, ptr %7) #6
  call void @llvm.lifetime.start.p0(i64 72, ptr %8) #6
  %54 = getelementptr inbounds %struct.Matrix, ptr %8, i32 0, i32 0
  store i32 2, ptr %54, align 4, !tbaa !9
  %55 = getelementptr inbounds %struct.Matrix, ptr %8, i32 0, i32 1
  store i32 2, ptr %55, align 4, !tbaa !11
  %56 = getelementptr inbounds %struct.Matrix, ptr %8, i32 0, i32 2
  call void @llvm.memset.p0.i64(ptr align 4 %56, i8 0, i64 64, i1 false)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %56, ptr align 4 @constinit.2, i64 64, i1 false), !tbaa.struct !14
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 @B, ptr align 4 %8, i64 72, i1 false), !tbaa.struct !12
  call void @llvm.lifetime.end.p0(i64 72, ptr %8) #6
  br label %77

57:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 72, ptr %9) #6
  %58 = getelementptr inbounds %struct.Matrix, ptr %9, i32 0, i32 0
  store i32 1, ptr %58, align 4, !tbaa !9
  %59 = getelementptr inbounds %struct.Matrix, ptr %9, i32 0, i32 1
  store i32 4, ptr %59, align 4, !tbaa !11
  %60 = getelementptr inbounds %struct.Matrix, ptr %9, i32 0, i32 2
  call void @llvm.memset.p0.i64(ptr align 4 %60, i8 0, i64 64, i1 false)
  store i32 1, ptr %60, align 4, !tbaa !5
  %61 = getelementptr inbounds i32, ptr %60, i64 1
  %62 = getelementptr inbounds i32, ptr %60, i64 2
  store i32 1, ptr %62, align 4, !tbaa !5
  %63 = getelementptr inbounds i32, ptr %60, i64 3
  store i32 1, ptr %63, align 4, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 @A, ptr align 4 %9, i64 72, i1 false), !tbaa.struct !12
  call void @llvm.lifetime.end.p0(i64 72, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 72, ptr %10) #6
  %64 = getelementptr inbounds %struct.Matrix, ptr %10, i32 0, i32 0
  store i32 4, ptr %64, align 4, !tbaa !9
  %65 = getelementptr inbounds %struct.Matrix, ptr %10, i32 0, i32 1
  store i32 4, ptr %65, align 4, !tbaa !11
  %66 = getelementptr inbounds %struct.Matrix, ptr %10, i32 0, i32 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %66, ptr align 4 @constinit.3, i64 64, i1 false), !tbaa.struct !14
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 @B, ptr align 4 %10, i64 72, i1 false), !tbaa.struct !12
  call void @llvm.lifetime.end.p0(i64 72, ptr %10) #6
  br label %77

67:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 72, ptr %11) #6
  %68 = getelementptr inbounds %struct.Matrix, ptr %11, i32 0, i32 0
  store i32 1, ptr %68, align 4, !tbaa !9
  %69 = getelementptr inbounds %struct.Matrix, ptr %11, i32 0, i32 1
  store i32 4, ptr %69, align 4, !tbaa !11
  %70 = getelementptr inbounds %struct.Matrix, ptr %11, i32 0, i32 2
  call void @llvm.memset.p0.i64(ptr align 4 %70, i8 0, i64 64, i1 false)
  store i32 95, ptr %70, align 4, !tbaa !5
  %71 = getelementptr inbounds i32, ptr %70, i64 1
  store i32 8, ptr %71, align 4, !tbaa !5
  %72 = getelementptr inbounds i32, ptr %70, i64 2
  store i32 1, ptr %72, align 4, !tbaa !5
  %73 = getelementptr inbounds i32, ptr %70, i64 3
  store i32 1, ptr %73, align 4, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 @A, ptr align 4 %11, i64 72, i1 false), !tbaa.struct !12
  call void @llvm.lifetime.end.p0(i64 72, ptr %11) #6
  call void @llvm.lifetime.start.p0(i64 72, ptr %12) #6
  %74 = getelementptr inbounds %struct.Matrix, ptr %12, i32 0, i32 0
  store i32 4, ptr %74, align 4, !tbaa !9
  %75 = getelementptr inbounds %struct.Matrix, ptr %12, i32 0, i32 1
  store i32 4, ptr %75, align 4, !tbaa !11
  %76 = getelementptr inbounds %struct.Matrix, ptr %12, i32 0, i32 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %76, ptr align 4 @constinit.4, i64 64, i1 false), !tbaa.struct !14
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 @B, ptr align 4 %12, i64 72, i1 false), !tbaa.struct !12
  call void @llvm.lifetime.end.p0(i64 72, ptr %12) #6
  br label %77

77:                                               ; preds = %67, %57, %49, %41, %39
  call void @llvm.lifetime.start.p0(i64 72, ptr %13) #6
  call void @llvm.lifetime.start.p0(i64 72, ptr %14) #6
  %78 = load i32, ptr %2, align 4, !tbaa !5
  %79 = and i32 %78, 1
  %80 = icmp ne i32 %79, 0
  br i1 %80, label %81, label %84

81:                                               ; preds = %77
  %82 = load i32, ptr %3, align 4, !tbaa !5
  %83 = ashr i32 %82, 1
  br label %87

84:                                               ; preds = %77
  %85 = load i32, ptr %3, align 4, !tbaa !5
  %86 = sub nsw i32 %85, 1
  br label %87

87:                                               ; preds = %84, %81
  %88 = phi i32 [ %83, %81 ], [ %86, %84 ]
  call void @_ZN6Matrix3powEi(ptr dead_on_unwind writable sret(%struct.Matrix) align 4 %14, ptr noundef nonnull align 4 dereferenceable(72) @B, i32 noundef %88)
  call void @_ZNK6MatrixmlERKS_(ptr dead_on_unwind writable sret(%struct.Matrix) align 4 %13, ptr noundef nonnull align 4 dereferenceable(72) @A, ptr noundef nonnull align 4 dereferenceable(72) %14)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 @A, ptr align 4 %13, i64 72, i1 false), !tbaa.struct !12
  call void @llvm.lifetime.end.p0(i64 72, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 72, ptr %13) #6
  %89 = load i32, ptr getelementptr inbounds (%struct.Matrix, ptr @A, i32 0, i32 1), align 4, !tbaa !11
  %90 = sub nsw i32 %89, 1
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [4 x i32], ptr getelementptr inbounds (%struct.Matrix, ptr @A, i32 0, i32 2), i64 0, i64 %91
  %93 = load i32, ptr %92, align 4, !tbaa !5
  %94 = call i32 (ptr, ...) @printf(ptr noundef @.str.5, i32 noundef %93)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %4, align 4
  br label %95

95:                                               ; preds = %87, %23
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  %96 = load i32, ptr %1, align 4
  ret i32 %96
}

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

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

declare i32 @puts(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: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

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

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

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

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

@A = external dso_local global %struct.Matrix, align 4
@B = external dso_local global %struct.Matrix, align 4
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@constinit = external hidden local_unnamed_addr constant [4 x [4 x i32]], align 4
@constinit.2 = external hidden local_unnamed_addr constant [4 x [4 x i32]], align 4
@constinit.3 = external hidden local_unnamed_addr constant [4 x [4 x i32]], align 4
@constinit.4 = external hidden local_unnamed_addr constant [4 x [4 x i32]], align 4
@.str.5 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca %struct.Matrix, align 4
  %4 = alloca %struct.Matrix, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  %5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1, ptr noundef nonnull %2)
  %6 = load i32, ptr %1, align 4, !tbaa !5
  %7 = and i32 %6, 1
  %.not = icmp eq i32 %7, 0
  %.pre = load i32, ptr %2, align 4
  %8 = and i32 %.pre, 1
  %.not30 = icmp eq i32 %8, 0
  %or.cond = select i1 %.not, i1 true, i1 %.not30
  br i1 %or.cond, label %11, label %9

9:                                                ; preds = %0
  %10 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.1)
  br label %31

11:                                               ; preds = %0
  %12 = icmp slt i32 %.pre, %6
  br i1 %12, label %13, label %thread-pre-split

13:                                               ; preds = %11
  store i32 %.pre, ptr %1, align 4, !tbaa !5
  store i32 %6, ptr %2, align 4, !tbaa !5
  br label %thread-pre-split

thread-pre-split:                                 ; preds = %11, %13
  %14 = phi i32 [ %6, %13 ], [ %.pre, %11 ]
  %15 = phi i32 [ %.pre, %13 ], [ %6, %11 ]
  switch i32 %15, label %20 [
    i32 2, label %16
    i32 3, label %17
    i32 4, label %18
    i32 5, label %19
  ]

16:                                               ; preds = %thread-pre-split
  store <4 x i32> <i32 1, i32 2, i32 1, i32 1>, ptr @A, align 4
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(56) getelementptr inbounds (i8, ptr @A, i64 16), i8 0, i64 56, i1 false)
  store i32 2, ptr @B, align 4, !tbaa !5
  store i32 2, ptr getelementptr inbounds (i8, ptr @B, i64 4), align 4, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(64) getelementptr inbounds (i8, ptr @B, i64 8), ptr noundef nonnull align 4 dereferenceable(64) @constinit, i64 64, i1 false)
  br label %20

17:                                               ; preds = %thread-pre-split
  store <4 x i32> <i32 1, i32 2, i32 1, i32 1>, ptr @A, align 4
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(56) getelementptr inbounds (i8, ptr @A, i64 16), i8 0, i64 56, i1 false)
  store i32 2, ptr @B, align 4, !tbaa !5
  store i32 2, ptr getelementptr inbounds (i8, ptr @B, i64 4), align 4, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(64) getelementptr inbounds (i8, ptr @B, i64 8), ptr noundef nonnull align 4 dereferenceable(64) @constinit.2, i64 64, i1 false)
  br label %20

18:                                               ; preds = %thread-pre-split
  store <4 x i32> <i32 1, i32 4, i32 1, i32 0>, ptr @A, align 4
  store i32 1, ptr getelementptr inbounds (i8, ptr @A, i64 16), align 4
  store i32 1, ptr getelementptr inbounds (i8, ptr @A, i64 20), align 4
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(48) getelementptr inbounds (i8, ptr @A, i64 24), i8 0, i64 48, i1 false)
  store i32 4, ptr @B, align 4, !tbaa !5
  store i32 4, ptr getelementptr inbounds (i8, ptr @B, i64 4), align 4, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(64) getelementptr inbounds (i8, ptr @B, i64 8), ptr noundef nonnull align 4 dereferenceable(64) @constinit.3, i64 64, i1 false), !tbaa.struct !9
  br label %20

19:                                               ; preds = %thread-pre-split
  store <4 x i32> <i32 1, i32 4, i32 95, i32 8>, ptr @A, align 4
  store i32 1, ptr getelementptr inbounds (i8, ptr @A, i64 16), align 4
  store i32 1, ptr getelementptr inbounds (i8, ptr @A, i64 20), align 4
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(48) getelementptr inbounds (i8, ptr @A, i64 24), i8 0, i64 48, i1 false)
  store i32 4, ptr @B, align 4, !tbaa !5
  store i32 4, ptr getelementptr inbounds (i8, ptr @B, i64 4), align 4, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(64) getelementptr inbounds (i8, ptr @B, i64 8), ptr noundef nonnull align 4 dereferenceable(64) @constinit.4, i64 64, i1 false), !tbaa.struct !9
  br label %20

20:                                               ; preds = %19, %18, %17, %16, %thread-pre-split
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %3) #6
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %4) #6
  %21 = and i32 %15, 1
  %.not31 = icmp eq i32 %21, 0
  %22 = ashr i32 %14, 1
  %23 = add nsw i32 %14, -1
  %24 = select i1 %.not31, i32 %23, i32 %22
  call void @_ZN6Matrix3powEi(ptr dead_on_unwind nonnull writable sret(%struct.Matrix) align 4 %4, ptr noundef nonnull align 4 dereferenceable(72) @B, i32 noundef %24)
  call void @_ZNK6MatrixmlERKS_(ptr dead_on_unwind nonnull writable sret(%struct.Matrix) align 4 %3, ptr noundef nonnull align 4 dereferenceable(72) @A, ptr noundef nonnull align 4 dereferenceable(72) %4)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(72) @A, ptr noundef nonnull align 4 dereferenceable(72) %3, i64 72, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %3) #6
  %25 = load i32, ptr getelementptr inbounds (i8, ptr @A, i64 4), align 4, !tbaa !12
  %26 = add nsw i32 %25, -1
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [4 x i32], ptr getelementptr inbounds (i8, ptr @A, i64 8), i64 0, i64 %27
  %29 = load i32, ptr %28, align 4, !tbaa !5
  %30 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %29)
  br label %31

31:                                               ; preds = %20, %9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  ret i32 0
}

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

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

; Function Attrs: nofree nounwind
declare noundef i32 @puts(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 nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

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

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

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

attributes #0 = { mustprogress norecurse 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 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 = !{i64 0, i64 64, !10}
!10 = !{!7, !7, i64 0}
!11 = !{i64 0, i64 4, !5, i64 4, i64 4, !5, i64 8, i64 64, !10}
!12 = !{!13, !6, i64 4}
!13 = !{!"_ZTS6Matrix", !6, i64 0, !6, i64 4, !7, i64 8}


; Effective O3 passes: CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,MemCpyOptPass,PostOrderFunctionAttrsPass,ReassociatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass