; LLVM IR from ADJA/algos :: NumberTheory (Matrix)

; 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"

%class.Matrix = type { [55 x [55 x i32]], i32, i32 }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }

@n = external dso_local global i32, align 4
@len = external dso_local global i64, align 8
@a = external dso_local global [55 x [55 x i32]], align 16
@col = external dso_local global [55 x [55 x i32]], align 16
@mat = external dso_local global %class.Matrix, align 4
@.str = external hidden unnamed_addr constant [8 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z6binPow6Matrixx(ptr dead_on_unwind noalias writable sret(%class.Matrix) align 4, ptr noundef byval(%class.Matrix) align 8, i64 noundef) #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 @_ZN6Matrix3mulES_S_(ptr dead_on_unwind noalias writable sret(%class.Matrix) align 4, ptr noundef byval(%class.Matrix) align 8, ptr noundef byval(%class.Matrix) align 8) #0 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) #2

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #3 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca %class.Matrix, align 4
  %6 = alloca %class.Matrix, align 4
  %7 = alloca %class.Matrix, align 8
  %8 = alloca i32, align 4
  %9 = alloca %class.Matrix, align 4
  %10 = alloca %class.Matrix, align 4
  %11 = alloca %class.Matrix, align 8
  %12 = alloca %class.Matrix, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %15 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @len)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %16

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

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

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

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

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

27:                                               ; preds = %22
  %28 = load i32, ptr %4, align 4, !tbaa !5
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds [55 x [55 x i32]], ptr @a, i64 0, i64 %29
  %31 = load i32, ptr %2, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [55 x i32], ptr %30, i64 0, i64 %32
  %34 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef %33)
  br label %35

35:                                               ; preds = %27
  %36 = load i32, ptr %4, align 4, !tbaa !5
  %37 = add nsw i32 %36, 1
  store i32 %37, ptr %4, align 4, !tbaa !5
  br label %22, !llvm.loop !9

38:                                               ; preds = %26
  br label %39

39:                                               ; preds = %38
  %40 = load i32, ptr %2, align 4, !tbaa !5
  %41 = add nsw i32 %40, 1
  store i32 %41, ptr %2, align 4, !tbaa !5
  br label %16, !llvm.loop !11

42:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 12108, ptr %5) #6
  %43 = load i32, ptr @n, align 4, !tbaa !5
  %44 = load i32, ptr @n, align 4, !tbaa !5
  call void @_ZN6MatrixC2EiiPA55_i(ptr noundef nonnull align 4 dereferenceable(12108) %5, i32 noundef %43, i32 noundef %44, ptr noundef @a)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 @mat, ptr align 4 %5, i64 12108, i1 false), !tbaa.struct !12
  call void @llvm.lifetime.end.p0(i64 12108, ptr %5) #6
  call void @llvm.lifetime.start.p0(i64 12108, ptr %6) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %7, ptr align 4 @mat, i64 12108, i1 false), !tbaa.struct !12
  %45 = load i64, ptr @len, align 8, !tbaa !14
  call void @_Z6binPow6Matrixx(ptr dead_on_unwind writable sret(%class.Matrix) align 4 %6, ptr noundef byval(%class.Matrix) align 8 %7, i64 noundef %45)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 @mat, ptr align 4 %6, i64 12108, i1 false), !tbaa.struct !12
  call void @llvm.lifetime.end.p0(i64 12108, 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 %46

46:                                               ; preds = %56, %42
  %47 = load i32, ptr %8, align 4, !tbaa !5
  %48 = load i32, ptr @n, align 4, !tbaa !5
  %49 = icmp slt i32 %47, %48
  br i1 %49, label %51, label %50

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

51:                                               ; preds = %46
  %52 = load i32, ptr %8, align 4, !tbaa !5
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [55 x [55 x i32]], ptr @col, i64 0, i64 %53
  %55 = getelementptr inbounds [55 x i32], ptr %54, i64 0, i64 0
  store i32 1, ptr %55, align 4, !tbaa !5
  br label %56

56:                                               ; preds = %51
  %57 = load i32, ptr %8, align 4, !tbaa !5
  %58 = add nsw i32 %57, 1
  store i32 %58, ptr %8, align 4, !tbaa !5
  br label %46, !llvm.loop !16

59:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 12108, ptr %9) #6
  %60 = load i32, ptr @n, align 4, !tbaa !5
  call void @_ZN6MatrixC2EiiPA55_i(ptr noundef nonnull align 4 dereferenceable(12108) %9, i32 noundef %60, i32 noundef 1, ptr noundef @col)
  call void @llvm.lifetime.start.p0(i64 12108, ptr %10) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %11, ptr align 4 @mat, i64 12108, i1 false), !tbaa.struct !12
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %12, ptr align 4 %9, i64 12108, i1 false), !tbaa.struct !12
  call void @_ZN6Matrix3mulES_S_(ptr dead_on_unwind writable sret(%class.Matrix) align 4 %10, ptr noundef byval(%class.Matrix) align 8 %11, ptr noundef byval(%class.Matrix) align 8 %12)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %9, ptr align 4 %10, i64 12108, i1 false), !tbaa.struct !12
  call void @llvm.lifetime.end.p0(i64 12108, ptr %10) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  store i32 0, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  store i32 0, ptr %14, align 4, !tbaa !5
  br label %61

61:                                               ; preds = %76, %59
  %62 = load i32, ptr %14, align 4, !tbaa !5
  %63 = load i32, ptr @n, align 4, !tbaa !5
  %64 = icmp slt i32 %62, %63
  br i1 %64, label %66, label %65

65:                                               ; preds = %61
  store i32 11, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %79

66:                                               ; preds = %61
  %67 = load i32, ptr %13, align 4, !tbaa !5
  %68 = getelementptr inbounds %class.Matrix, ptr %9, i32 0, i32 0
  %69 = load i32, ptr %14, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [55 x [55 x i32]], ptr %68, i64 0, i64 %70
  %72 = getelementptr inbounds [55 x i32], ptr %71, i64 0, i64 0
  %73 = load i32, ptr %72, align 4, !tbaa !5
  %74 = add nsw i32 %67, %73
  %75 = srem i32 %74, 1000000007
  store i32 %75, ptr %13, align 4, !tbaa !5
  br label %76

76:                                               ; preds = %66
  %77 = load i32, ptr %14, align 4, !tbaa !5
  %78 = add nsw i32 %77, 1
  store i32 %78, ptr %14, align 4, !tbaa !5
  br label %61, !llvm.loop !17

79:                                               ; preds = %65
  %80 = load i32, ptr %13, align 4, !tbaa !5
  %81 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %80)
  %82 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %81, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 12108, ptr %9) #6
  %83 = load i32, ptr %1, align 4
  ret i32 %83
}

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6MatrixC2EiiPA55_i(ptr noundef nonnull align 4 dereferenceable(12108), i32 noundef, i32 noundef, ptr noundef) unnamed_addr #0 align 2

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #4

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #5

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #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 = { inlinehint 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 #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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = !{i64 0, i64 12100, !13, i64 12100, i64 4, !5, i64 12104, i64 4, !5}
!13 = !{!7, !7, i64 0}
!14 = !{!15, !15, i64 0}
!15 = !{!"long long", !7, i64 0}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}


; 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"

%class.Matrix = type { [55 x [55 x i32]], i32, i32 }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }

@n = external dso_local global i32, align 4
@len = external dso_local global i64, align 8
@a = external dso_local global [55 x [55 x i32]], align 16
@col = external dso_local global [55 x [55 x i32]], align 16
@mat = external dso_local local_unnamed_addr global %class.Matrix, align 4
@.str = external hidden unnamed_addr constant [8 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z6binPow6Matrixx(ptr dead_on_unwind noalias writable sret(%class.Matrix) align 4, ptr noundef byval(%class.Matrix) align 8, i64 noundef) local_unnamed_addr #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 @_ZN6Matrix3mulES_S_(ptr dead_on_unwind noalias writable sret(%class.Matrix) align 4, ptr noundef byval(%class.Matrix) align 8, ptr noundef byval(%class.Matrix) align 8) local_unnamed_addr #0 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) #2

; 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 norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #3 {
  %1 = alloca %class.Matrix, align 4
  %2 = alloca %class.Matrix, align 4
  %3 = alloca %class.Matrix, align 8
  %4 = alloca %class.Matrix, align 8
  %5 = alloca %class.Matrix, align 4
  %6 = alloca %class.Matrix, align 8
  %7 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @len)
  %8 = load i32, ptr @n, align 4, !tbaa !5
  %9 = icmp sgt i32 %8, 0
  br i1 %9, label %.preheader, label %._crit_edge22

.preheader:                                       ; preds = %0, %._crit_edge
  %10 = phi i32 [ %16, %._crit_edge ], [ %8, %0 ]
  %indvars.iv37 = phi i64 [ %indvars.iv.next38, %._crit_edge ], [ 0, %0 ]
  %11 = icmp sgt i32 %10, 0
  br i1 %11, label %.lr.ph, label %.preheader.._crit_edge_crit_edge

.preheader.._crit_edge_crit_edge:                 ; preds = %.preheader
  %.pre = sext i32 %10 to i64
  br label %._crit_edge

._crit_edge22:                                    ; preds = %._crit_edge, %0
  %.lcssa19 = phi i32 [ %8, %0 ], [ %16, %._crit_edge ]
  call void @llvm.lifetime.start.p0(i64 12108, ptr nonnull %1) #7
  call void @_ZN6MatrixC2EiiPA55_i(ptr noundef nonnull align 4 dereferenceable(12108) %1, i32 noundef %.lcssa19, i32 noundef %.lcssa19, ptr noundef nonnull @a)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12108) @mat, ptr noundef nonnull align 4 dereferenceable(12108) %1, i64 12108, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.end.p0(i64 12108, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 12108, ptr nonnull %2) #7
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(12108) %3, ptr noundef nonnull align 4 dereferenceable(12108) @mat, i64 12108, i1 false), !tbaa.struct !9
  %12 = load i64, ptr @len, align 8, !tbaa !11
  call void @_Z6binPow6Matrixx(ptr dead_on_unwind nonnull writable sret(%class.Matrix) align 4 %2, ptr noundef nonnull byval(%class.Matrix) align 8 %3, i64 noundef %12)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12108) @mat, ptr noundef nonnull align 4 dereferenceable(12108) %2, i64 12108, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.end.p0(i64 12108, ptr nonnull %2) #7
  %13 = load i32, ptr @n, align 4, !tbaa !5
  %14 = icmp sgt i32 %13, 0
  br i1 %14, label %.lr.ph25.preheader, label %._crit_edge26

.lr.ph25.preheader:                               ; preds = %._crit_edge22
  %wide.trip.count = zext nneg i32 %13 to i64
  %xtraiter = and i64 %wide.trip.count, 3
  %15 = icmp ult i32 %13, 4
  br i1 %15, label %._crit_edge26.loopexit.unr-lcssa, label %.lr.ph25.preheader.new

.lr.ph25.preheader.new:                           ; preds = %.lr.ph25.preheader
  %unroll_iter = and i64 %wide.trip.count, 2147483644
  br label %.lr.ph25

._crit_edge:                                      ; preds = %.lr.ph, %.preheader.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre, %.preheader.._crit_edge_crit_edge ], [ %21, %.lr.ph ]
  %16 = phi i32 [ %10, %.preheader.._crit_edge_crit_edge ], [ %20, %.lr.ph ]
  %indvars.iv.next38 = add nuw nsw i64 %indvars.iv37, 1
  %17 = icmp slt i64 %indvars.iv.next38, %.pre-phi
  br i1 %17, label %.preheader, label %._crit_edge22, !llvm.loop !13

.lr.ph:                                           ; preds = %.preheader, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.preheader ]
  %18 = getelementptr inbounds [55 x [55 x i32]], ptr @a, i64 0, i64 %indvars.iv, i64 %indvars.iv37
  %19 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %18)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %20 = load i32, ptr @n, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %22 = icmp slt i64 %indvars.iv.next, %21
  br i1 %22, label %.lr.ph, label %._crit_edge, !llvm.loop !16

._crit_edge26.loopexit.unr-lcssa:                 ; preds = %.lr.ph25, %.lr.ph25.preheader
  %indvars.iv40.unr = phi i64 [ 0, %.lr.ph25.preheader ], [ %indvars.iv.next41.3, %.lr.ph25 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge26, label %.lr.ph25.epil

.lr.ph25.epil:                                    ; preds = %._crit_edge26.loopexit.unr-lcssa, %.lr.ph25.epil
  %indvars.iv40.epil = phi i64 [ %indvars.iv.next41.epil, %.lr.ph25.epil ], [ %indvars.iv40.unr, %._crit_edge26.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph25.epil ], [ 0, %._crit_edge26.loopexit.unr-lcssa ]
  %23 = getelementptr inbounds [55 x [55 x i32]], ptr @col, i64 0, i64 %indvars.iv40.epil
  store i32 1, ptr %23, align 4, !tbaa !5
  %indvars.iv.next41.epil = add nuw nsw i64 %indvars.iv40.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_edge26, label %.lr.ph25.epil, !llvm.loop !17

._crit_edge26:                                    ; preds = %._crit_edge26.loopexit.unr-lcssa, %.lr.ph25.epil, %._crit_edge22
  call void @llvm.lifetime.start.p0(i64 12108, ptr nonnull %4) #7
  call void @_ZN6MatrixC2EiiPA55_i(ptr noundef nonnull align 4 dereferenceable(12108) %4, i32 noundef %13, i32 noundef 1, ptr noundef nonnull @col)
  call void @llvm.lifetime.start.p0(i64 12108, ptr nonnull %5) #7
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(12108) %6, ptr noundef nonnull align 4 dereferenceable(12108) @mat, i64 12108, i1 false), !tbaa.struct !9
  call void @_ZN6Matrix3mulES_S_(ptr dead_on_unwind nonnull writable sret(%class.Matrix) align 4 %5, ptr noundef nonnull byval(%class.Matrix) align 8 %6, ptr noundef nonnull byval(%class.Matrix) align 8 %4)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(12108) %4, ptr noundef nonnull align 4 dereferenceable(12108) %5, i64 12108, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.end.p0(i64 12108, ptr nonnull %5) #7
  %24 = load i32, ptr @n, align 4, !tbaa !5
  %25 = icmp sgt i32 %24, 0
  br i1 %25, label %.lr.ph31.preheader, label %._crit_edge32

.lr.ph31.preheader:                               ; preds = %._crit_edge26
  %wide.trip.count46 = zext nneg i32 %24 to i64
  %xtraiter57 = and i64 %wide.trip.count46, 1
  %26 = icmp eq i32 %24, 1
  br i1 %26, label %._crit_edge32.loopexit.unr-lcssa, label %.lr.ph31.preheader.new

.lr.ph31.preheader.new:                           ; preds = %.lr.ph31.preheader
  %unroll_iter61 = and i64 %wide.trip.count46, 2147483646
  br label %.lr.ph31

.lr.ph25:                                         ; preds = %.lr.ph25, %.lr.ph25.preheader.new
  %indvars.iv40 = phi i64 [ 0, %.lr.ph25.preheader.new ], [ %indvars.iv.next41.3, %.lr.ph25 ]
  %niter = phi i64 [ 0, %.lr.ph25.preheader.new ], [ %niter.next.3, %.lr.ph25 ]
  %27 = getelementptr inbounds [55 x [55 x i32]], ptr @col, i64 0, i64 %indvars.iv40
  store i32 1, ptr %27, align 16, !tbaa !5
  %indvars.iv.next41 = or disjoint i64 %indvars.iv40, 1
  %28 = getelementptr inbounds [55 x [55 x i32]], ptr @col, i64 0, i64 %indvars.iv.next41
  store i32 1, ptr %28, align 4, !tbaa !5
  %indvars.iv.next41.1 = or disjoint i64 %indvars.iv40, 2
  %29 = getelementptr inbounds [55 x [55 x i32]], ptr @col, i64 0, i64 %indvars.iv.next41.1
  store i32 1, ptr %29, align 8, !tbaa !5
  %indvars.iv.next41.2 = or disjoint i64 %indvars.iv40, 3
  %30 = getelementptr inbounds [55 x [55 x i32]], ptr @col, i64 0, i64 %indvars.iv.next41.2
  store i32 1, ptr %30, align 4, !tbaa !5
  %indvars.iv.next41.3 = add nuw nsw i64 %indvars.iv40, 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_edge26.loopexit.unr-lcssa, label %.lr.ph25, !llvm.loop !19

._crit_edge32.loopexit.unr-lcssa:                 ; preds = %.lr.ph31, %.lr.ph31.preheader
  %.lcssa.ph = phi i32 [ poison, %.lr.ph31.preheader ], [ %44, %.lr.ph31 ]
  %indvars.iv43.unr = phi i64 [ 0, %.lr.ph31.preheader ], [ %indvars.iv.next44.1, %.lr.ph31 ]
  %.01528.unr = phi i32 [ 0, %.lr.ph31.preheader ], [ %44, %.lr.ph31 ]
  %lcmp.mod59.not = icmp eq i64 %xtraiter57, 0
  br i1 %lcmp.mod59.not, label %._crit_edge32, label %.lr.ph31.epil

.lr.ph31.epil:                                    ; preds = %._crit_edge32.loopexit.unr-lcssa
  %31 = getelementptr inbounds [55 x [55 x i32]], ptr %4, i64 0, i64 %indvars.iv43.unr
  %32 = load i32, ptr %31, align 4, !tbaa !5
  %33 = add nsw i32 %32, %.01528.unr
  %34 = srem i32 %33, 1000000007
  br label %._crit_edge32

._crit_edge32:                                    ; preds = %.lr.ph31.epil, %._crit_edge32.loopexit.unr-lcssa, %._crit_edge26
  %.015.lcssa = phi i32 [ 0, %._crit_edge26 ], [ %.lcssa.ph, %._crit_edge32.loopexit.unr-lcssa ], [ %34, %.lr.ph31.epil ]
  %35 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %.015.lcssa)
  %36 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %35, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 12108, ptr nonnull %4) #7
  ret i32 0

.lr.ph31:                                         ; preds = %.lr.ph31, %.lr.ph31.preheader.new
  %indvars.iv43 = phi i64 [ 0, %.lr.ph31.preheader.new ], [ %indvars.iv.next44.1, %.lr.ph31 ]
  %.01528 = phi i32 [ 0, %.lr.ph31.preheader.new ], [ %44, %.lr.ph31 ]
  %niter62 = phi i64 [ 0, %.lr.ph31.preheader.new ], [ %niter62.next.1, %.lr.ph31 ]
  %37 = getelementptr inbounds [55 x [55 x i32]], ptr %4, i64 0, i64 %indvars.iv43
  %38 = load i32, ptr %37, align 8, !tbaa !5
  %39 = add nsw i32 %38, %.01528
  %40 = srem i32 %39, 1000000007
  %indvars.iv.next44 = or disjoint i64 %indvars.iv43, 1
  %41 = getelementptr inbounds [55 x [55 x i32]], ptr %4, i64 0, i64 %indvars.iv.next44
  %42 = load i32, ptr %41, align 4, !tbaa !5
  %43 = add nsw i32 %42, %40
  %44 = srem i32 %43, 1000000007
  %indvars.iv.next44.1 = add nuw nsw i64 %indvars.iv43, 2
  %niter62.next.1 = add i64 %niter62, 2
  %niter62.ncmp.1 = icmp eq i64 %niter62.next.1, %unroll_iter61
  br i1 %niter62.ncmp.1, label %._crit_edge32.loopexit.unr-lcssa, label %.lr.ph31, !llvm.loop !20
}

; 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 @_ZN6MatrixC2EiiPA55_i(ptr noundef nonnull align 4 dereferenceable(12108), i32 noundef, i32 noundef, ptr noundef) unnamed_addr #0 align 2

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #5

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #6

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #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 = { "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 = { inlinehint 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 #7 = { 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 12100, !10, i64 12100, i64 4, !5, i64 12104, i64 4, !5}
!10 = !{!7, !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long long", !7, i64 0}
!13 = distinct !{!13, !14, !15}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!"llvm.loop.unswitch.partial.disable"}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.unroll.disable"}
!19 = distinct !{!19, !14}
!20 = distinct !{!20, !14}


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