; LLVM IR from tangjz/acm-icpc :: lydsy (5437)

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

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@mod = external dso_local global i32, align 4
@mat = external dso_local global [5 x [101 x [101 x i32]]], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@_ZZ4mainE3buf = external hidden global [101 x i8], align 16
@.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 [4 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z7mat_addPA101_iS0_S0_(ptr noundef, ptr noundef, ptr 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: 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 @_Z7mat_mulPA101_iS0_S0_(ptr noundef, ptr noundef, ptr noundef) #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #2 {
  %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 i64, align 8
  %7 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %9

9:                                                ; preds = %55, %0
  %10 = load i32, ptr %2, align 4, !tbaa !5
  %11 = load i32, ptr @n, align 4, !tbaa !5
  %12 = icmp slt i32 %10, %11
  br i1 %12, label %14, label %13

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

14:                                               ; preds = %9
  %15 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef @_ZZ4mainE3buf)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %16

16:                                               ; preds = %51, %14
  %17 = load i32, ptr %4, 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 5, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  br label %54

21:                                               ; preds = %16
  %22 = load i32, ptr %4, align 4, !tbaa !5
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds [101 x i8], ptr @_ZZ4mainE3buf, i64 0, i64 %23
  %25 = load i8, ptr %24, align 1, !tbaa !9
  %26 = sext i8 %25 to i32
  %27 = icmp eq i32 %26, 89
  %28 = zext i1 %27 to i32
  %29 = load i32, ptr %2, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds [101 x [101 x i32]], ptr @mat, i64 0, i64 %30
  %32 = load i32, ptr %4, align 4, !tbaa !5
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [101 x i32], ptr %31, i64 0, i64 %33
  store i32 %28, ptr %34, align 4, !tbaa !5
  %35 = load i32, ptr %2, align 4, !tbaa !5
  %36 = load i32, ptr %4, align 4, !tbaa !5
  %37 = icmp eq i32 %35, %36
  %38 = zext i1 %37 to i32
  %39 = load i32, ptr %2, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [101 x [101 x i32]], ptr getelementptr inbounds ([5 x [101 x [101 x i32]]], ptr @mat, i64 0, i64 2), i64 0, i64 %40
  %42 = load i32, ptr %4, align 4, !tbaa !5
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds [101 x i32], ptr %41, i64 0, i64 %43
  store i32 %38, ptr %44, align 4, !tbaa !5
  %45 = load i32, ptr %2, align 4, !tbaa !5
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [101 x [101 x i32]], ptr getelementptr inbounds ([5 x [101 x [101 x i32]]], ptr @mat, i64 0, i64 1), i64 0, i64 %46
  %48 = load i32, ptr %4, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [101 x i32], ptr %47, i64 0, i64 %49
  store i32 %38, ptr %50, align 4, !tbaa !5
  br label %51

51:                                               ; preds = %21
  %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 %16, !llvm.loop !10

54:                                               ; preds = %20
  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 %9, !llvm.loop !12

58:                                               ; preds = %13
  %59 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef @m, ptr noundef @mod)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %60

60:                                               ; preds = %74, %58
  %61 = load i32, ptr @m, align 4, !tbaa !5
  %62 = icmp sgt i32 %61, 0
  br i1 %62, label %64, label %63

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

64:                                               ; preds = %60
  %65 = load i32, ptr %5, align 4, !tbaa !5
  %66 = icmp ne i32 %65, 0
  br i1 %66, label %67, label %68

67:                                               ; preds = %64
  call void @_Z7mat_mulPA101_iS0_S0_(ptr noundef @mat, ptr noundef getelementptr inbounds ([5 x [101 x [101 x i32]]], ptr @mat, i64 0, i64 1), ptr noundef getelementptr inbounds ([5 x [101 x [101 x i32]]], ptr @mat, i64 0, i64 3))
  call void @_Z7mat_addPA101_iS0_S0_(ptr noundef getelementptr inbounds ([5 x [101 x [101 x i32]]], ptr @mat, i64 0, i64 1), ptr noundef getelementptr inbounds ([5 x [101 x [101 x i32]]], ptr @mat, i64 0, i64 3), ptr noundef getelementptr inbounds ([5 x [101 x [101 x i32]]], ptr @mat, i64 0, i64 1))
  call void @_Z7mat_mulPA101_iS0_S0_(ptr noundef @mat, ptr noundef @mat, ptr noundef @mat)
  br label %68

68:                                               ; preds = %67, %64
  %69 = load i32, ptr @m, align 4, !tbaa !5
  %70 = and i32 %69, 1
  %71 = icmp ne i32 %70, 0
  br i1 %71, label %72, label %73

72:                                               ; preds = %68
  call void @_Z7mat_mulPA101_iS0_S0_(ptr noundef getelementptr inbounds ([5 x [101 x [101 x i32]]], ptr @mat, i64 0, i64 2), ptr noundef getelementptr inbounds ([5 x [101 x [101 x i32]]], ptr @mat, i64 0, i64 1), ptr noundef getelementptr inbounds ([5 x [101 x [101 x i32]]], ptr @mat, i64 0, i64 3))
  call void @_Z7mat_addPA101_iS0_S0_(ptr noundef getelementptr inbounds ([5 x [101 x [101 x i32]]], ptr @mat, i64 0, i64 4), ptr noundef getelementptr inbounds ([5 x [101 x [101 x i32]]], ptr @mat, i64 0, i64 3), ptr noundef getelementptr inbounds ([5 x [101 x [101 x i32]]], ptr @mat, i64 0, i64 4))
  call void @_Z7mat_mulPA101_iS0_S0_(ptr noundef getelementptr inbounds ([5 x [101 x [101 x i32]]], ptr @mat, i64 0, i64 2), ptr noundef @mat, ptr noundef getelementptr inbounds ([5 x [101 x [101 x i32]]], ptr @mat, i64 0, i64 2))
  br label %73

73:                                               ; preds = %72, %68
  br label %74

74:                                               ; preds = %73
  %75 = load i32, ptr @m, align 4, !tbaa !5
  %76 = ashr i32 %75, 1
  store i32 %76, ptr @m, align 4, !tbaa !5
  %77 = load i32, ptr %5, align 4, !tbaa !5
  %78 = add nsw i32 %77, 1
  store i32 %78, ptr %5, align 4, !tbaa !5
  br label %60, !llvm.loop !13

79:                                               ; preds = %63
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  store i64 0, ptr %6, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %80

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

84:                                               ; preds = %80
  store i32 11, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %100

85:                                               ; preds = %80
  %86 = load i32, ptr %7, align 4, !tbaa !5
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [101 x [101 x i32]], ptr getelementptr inbounds ([5 x [101 x [101 x i32]]], ptr @mat, i64 0, i64 4), i64 0, i64 %87
  %89 = load i32, ptr %7, align 4, !tbaa !5
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [101 x i32], ptr %88, i64 0, i64 %90
  %92 = load i32, ptr %91, align 4, !tbaa !5
  %93 = sub nsw i32 %92, 1
  %94 = sext i32 %93 to i64
  %95 = load i64, ptr %6, align 8, !tbaa !14
  %96 = add nsw i64 %95, %94
  store i64 %96, ptr %6, align 8, !tbaa !14
  br label %97

97:                                               ; preds = %85
  %98 = load i32, ptr %7, align 4, !tbaa !5
  %99 = add nsw i32 %98, 1
  store i32 %99, ptr %7, align 4, !tbaa !5
  br label %80, !llvm.loop !16

100:                                              ; preds = %84
  %101 = load i32, ptr @mod, align 4, !tbaa !5
  %102 = sext i32 %101 to i64
  %103 = load i64, ptr %6, align 8, !tbaa !14
  %104 = srem i64 %103, %102
  store i64 %104, ptr %6, align 8, !tbaa !14
  %105 = icmp slt i64 %104, 0
  br i1 %105, label %106, label %112

106:                                              ; preds = %100
  %107 = load i32, ptr @mod, align 4, !tbaa !5
  %108 = sext i32 %107 to i64
  %109 = load i64, ptr %6, align 8, !tbaa !14
  %110 = add nsw i64 %109, %108
  store i64 %110, ptr %6, align 8, !tbaa !14
  %111 = icmp ne i64 %110, 0
  br label %112

112:                                              ; preds = %106, %100
  %113 = phi i1 [ false, %100 ], [ %111, %106 ]
  %114 = load i64, ptr %6, align 8, !tbaa !14
  %115 = trunc i64 %114 to i32
  %116 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %115)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  %117 = load i32, ptr %1, align 4
  ret i32 %117
}

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

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

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


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

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@mod = external dso_local global i32, align 4
@mat = external dso_local global [5 x [101 x [101 x i32]]], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@_ZZ4mainE3buf = external hidden global [101 x i8], align 16
@.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 [4 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z7mat_addPA101_iS0_S0_(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z7mat_mulPA101_iS0_S0_(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress norecurse nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 {
  %1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
  %2 = load i32, ptr @n, align 4, !tbaa !5
  %3 = icmp sgt i32 %2, 0
  br i1 %3, label %.lr.ph34, label %._crit_edge35

._crit_edge35:                                    ; preds = %._crit_edge, %0
  %4 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull @m, ptr noundef nonnull @mod)
  %.pr = load i32, ptr @m, align 4, !tbaa !5
  %5 = icmp sgt i32 %.pr, 0
  br i1 %5, label %.lr.ph38.preheader, label %.preheader

.lr.ph38.preheader:                               ; preds = %._crit_edge35
  %6 = and i32 %.pr, 1
  %.not30.peel = icmp eq i32 %6, 0
  br i1 %.not30.peel, label %8, label %7

7:                                                ; preds = %.lr.ph38.preheader
  tail call void @_Z7mat_mulPA101_iS0_S0_(ptr noundef nonnull getelementptr inbounds (i8, ptr @mat, i64 81608), ptr noundef nonnull getelementptr inbounds (i8, ptr @mat, i64 40804), ptr noundef nonnull getelementptr inbounds (i8, ptr @mat, i64 122412))
  tail call void @_Z7mat_addPA101_iS0_S0_(ptr noundef nonnull getelementptr inbounds (i8, ptr @mat, i64 163216), ptr noundef nonnull getelementptr inbounds (i8, ptr @mat, i64 122412), ptr noundef nonnull getelementptr inbounds (i8, ptr @mat, i64 163216))
  tail call void @_Z7mat_mulPA101_iS0_S0_(ptr noundef nonnull getelementptr inbounds (i8, ptr @mat, i64 81608), ptr noundef nonnull @mat, ptr noundef nonnull getelementptr inbounds (i8, ptr @mat, i64 81608))
  %.pre = load i32, ptr @m, align 4, !tbaa !5
  br label %8

8:                                                ; preds = %7, %.lr.ph38.preheader
  %9 = phi i32 [ %.pre, %7 ], [ %.pr, %.lr.ph38.preheader ]
  %10 = ashr i32 %9, 1
  store i32 %10, ptr @m, align 4, !tbaa !5
  %11 = icmp sgt i32 %10, 0
  br i1 %11, label %.lr.ph38.peel.next, label %.preheader

.lr.ph34:                                         ; preds = %0, %._crit_edge
  %indvars.iv44 = phi i64 [ %indvars.iv.next45, %._crit_edge ], [ 0, %0 ]
  %12 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @_ZZ4mainE3buf)
  %13 = load i32, ptr @n, align 4, !tbaa !5
  %14 = icmp sgt i32 %13, 0
  br i1 %14, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.lr.ph34
  %wide.trip.count = zext nneg i32 %13 to i64
  %min.iters.check = icmp ult i32 %13, 4
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

scalar.ph.preheader:                              ; preds = %middle.block, %.lr.ph
  %indvars.iv.ph = phi i64 [ 0, %.lr.ph ], [ %n.vec, %middle.block ]
  br label %scalar.ph

vector.ph:                                        ; preds = %.lr.ph
  %n.vec = and i64 %wide.trip.count, 2147483644
  %broadcast.splatinsert = insertelement <4 x i64> poison, i64 %indvars.iv44, i64 0
  %broadcast.splat = shufflevector <4 x i64> %broadcast.splatinsert, <4 x i64> poison, <4 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.ind = phi <4 x i64> [ <i64 0, i64 1, i64 2, i64 3>, %vector.ph ], [ %vec.ind.next, %vector.body ]
  %15 = getelementptr inbounds [101 x i8], ptr @_ZZ4mainE3buf, i64 0, i64 %index
  %wide.load = load <4 x i8>, ptr %15, align 4, !tbaa !9
  %16 = icmp eq <4 x i8> %wide.load, <i8 89, i8 89, i8 89, i8 89>
  %17 = zext <4 x i1> %16 to <4 x i32>
  %18 = getelementptr inbounds [101 x [101 x i32]], ptr @mat, i64 0, i64 %indvars.iv44, i64 %index
  store <4 x i32> %17, ptr %18, align 4, !tbaa !5
  %19 = icmp eq <4 x i64> %broadcast.splat, %vec.ind
  %20 = zext <4 x i1> %19 to <4 x i32>
  %21 = getelementptr inbounds [101 x [101 x i32]], ptr getelementptr inbounds (i8, ptr @mat, i64 81608), i64 0, i64 %indvars.iv44, i64 %index
  store <4 x i32> %20, ptr %21, align 4, !tbaa !5
  %22 = getelementptr inbounds [101 x [101 x i32]], ptr getelementptr inbounds (i8, ptr @mat, i64 40804), i64 0, i64 %indvars.iv44, i64 %index
  store <4 x i32> %20, ptr %22, align 4, !tbaa !5
  %index.next = add nuw i64 %index, 4
  %vec.ind.next = add <4 x i64> %vec.ind, <i64 4, i64 4, i64 4, i64 4>
  %23 = icmp eq i64 %index.next, %n.vec
  br i1 %23, label %middle.block, label %vector.body, !llvm.loop !10

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br i1 %cmp.n, label %._crit_edge, label %scalar.ph.preheader

._crit_edge:                                      ; preds = %scalar.ph, %middle.block, %.lr.ph34
  %indvars.iv.next45 = add nuw nsw i64 %indvars.iv44, 1
  %24 = sext i32 %13 to i64
  %25 = icmp slt i64 %indvars.iv.next45, %24
  br i1 %25, label %.lr.ph34, label %._crit_edge35, !llvm.loop !14

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %scalar.ph ], [ %indvars.iv.ph, %scalar.ph.preheader ]
  %26 = getelementptr inbounds [101 x i8], ptr @_ZZ4mainE3buf, i64 0, i64 %indvars.iv
  %27 = load i8, ptr %26, align 1, !tbaa !9
  %28 = icmp eq i8 %27, 89
  %29 = zext i1 %28 to i32
  %30 = getelementptr inbounds [101 x [101 x i32]], ptr @mat, i64 0, i64 %indvars.iv44, i64 %indvars.iv
  store i32 %29, ptr %30, align 4, !tbaa !5
  %31 = icmp eq i64 %indvars.iv44, %indvars.iv
  %32 = zext i1 %31 to i32
  %33 = getelementptr inbounds [101 x [101 x i32]], ptr getelementptr inbounds (i8, ptr @mat, i64 81608), i64 0, i64 %indvars.iv44, i64 %indvars.iv
  store i32 %32, ptr %33, align 4, !tbaa !5
  %34 = getelementptr inbounds [101 x [101 x i32]], ptr getelementptr inbounds (i8, ptr @mat, i64 40804), i64 0, i64 %indvars.iv44, i64 %indvars.iv
  store i32 %32, ptr %34, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %scalar.ph, !llvm.loop !15

.preheader:                                       ; preds = %62, %8, %._crit_edge35
  %35 = load i32, ptr @n, align 4, !tbaa !5
  %36 = icmp sgt i32 %35, 0
  br i1 %36, label %.lr.ph41.preheader, label %._crit_edge42

.lr.ph41.preheader:                               ; preds = %.preheader
  %wide.trip.count51 = zext nneg i32 %35 to i64
  %min.iters.check57 = icmp ult i32 %35, 4
  br i1 %min.iters.check57, label %.lr.ph41.preheader67, label %vector.ph58

.lr.ph41.preheader67:                             ; preds = %middle.block55, %.lr.ph41.preheader
  %indvars.iv48.ph = phi i64 [ 0, %.lr.ph41.preheader ], [ %n.vec60, %middle.block55 ]
  %.02439.ph = phi i64 [ 0, %.lr.ph41.preheader ], [ %59, %middle.block55 ]
  br label %.lr.ph41

vector.ph58:                                      ; preds = %.lr.ph41.preheader
  %n.vec60 = and i64 %wide.trip.count51, 2147483644
  br label %vector.body62

vector.body62:                                    ; preds = %vector.body62, %vector.ph58
  %index63 = phi i64 [ 0, %vector.ph58 ], [ %index.next65, %vector.body62 ]
  %vec.phi = phi <2 x i64> [ zeroinitializer, %vector.ph58 ], [ %56, %vector.body62 ]
  %vec.phi64 = phi <2 x i64> [ zeroinitializer, %vector.ph58 ], [ %57, %vector.body62 ]
  %37 = or disjoint i64 %index63, 1
  %38 = or disjoint i64 %index63, 2
  %39 = or disjoint i64 %index63, 3
  %40 = getelementptr inbounds [101 x [101 x i32]], ptr getelementptr inbounds (i8, ptr @mat, i64 163216), i64 0, i64 %index63, i64 %index63
  %41 = getelementptr inbounds [101 x [101 x i32]], ptr getelementptr inbounds (i8, ptr @mat, i64 163216), i64 0, i64 %37, i64 %37
  %42 = getelementptr inbounds [101 x [101 x i32]], ptr getelementptr inbounds (i8, ptr @mat, i64 163216), i64 0, i64 %38, i64 %38
  %43 = getelementptr inbounds [101 x [101 x i32]], ptr getelementptr inbounds (i8, ptr @mat, i64 163216), i64 0, i64 %39, i64 %39
  %44 = load i32, ptr %40, align 16, !tbaa !5
  %45 = load i32, ptr %41, align 8, !tbaa !5
  %46 = insertelement <2 x i32> poison, i32 %44, i64 0
  %47 = insertelement <2 x i32> %46, i32 %45, i64 1
  %48 = load i32, ptr %42, align 16, !tbaa !5
  %49 = load i32, ptr %43, align 8, !tbaa !5
  %50 = insertelement <2 x i32> poison, i32 %48, i64 0
  %51 = insertelement <2 x i32> %50, i32 %49, i64 1
  %52 = add nsw <2 x i32> %47, <i32 -1, i32 -1>
  %53 = add nsw <2 x i32> %51, <i32 -1, i32 -1>
  %54 = sext <2 x i32> %52 to <2 x i64>
  %55 = sext <2 x i32> %53 to <2 x i64>
  %56 = add <2 x i64> %vec.phi, %54
  %57 = add <2 x i64> %vec.phi64, %55
  %index.next65 = add nuw i64 %index63, 4
  %58 = icmp eq i64 %index.next65, %n.vec60
  br i1 %58, label %middle.block55, label %vector.body62, !llvm.loop !16

middle.block55:                                   ; preds = %vector.body62
  %bin.rdx = add <2 x i64> %57, %56
  %59 = tail call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx)
  %cmp.n66 = icmp eq i64 %n.vec60, %wide.trip.count51
  br i1 %cmp.n66, label %._crit_edge42, label %.lr.ph41.preheader67

.lr.ph38.peel.next:                               ; preds = %8, %62
  tail call void @_Z7mat_mulPA101_iS0_S0_(ptr noundef nonnull @mat, ptr noundef nonnull getelementptr inbounds (i8, ptr @mat, i64 40804), ptr noundef nonnull getelementptr inbounds (i8, ptr @mat, i64 122412))
  tail call void @_Z7mat_addPA101_iS0_S0_(ptr noundef nonnull getelementptr inbounds (i8, ptr @mat, i64 40804), ptr noundef nonnull getelementptr inbounds (i8, ptr @mat, i64 122412), ptr noundef nonnull getelementptr inbounds (i8, ptr @mat, i64 40804))
  tail call void @_Z7mat_mulPA101_iS0_S0_(ptr noundef nonnull @mat, ptr noundef nonnull @mat, ptr noundef nonnull @mat)
  %.pre53 = load i32, ptr @m, align 4, !tbaa !5
  %60 = and i32 %.pre53, 1
  %.not30 = icmp eq i32 %60, 0
  br i1 %.not30, label %62, label %61

61:                                               ; preds = %.lr.ph38.peel.next
  tail call void @_Z7mat_mulPA101_iS0_S0_(ptr noundef nonnull getelementptr inbounds (i8, ptr @mat, i64 81608), ptr noundef nonnull getelementptr inbounds (i8, ptr @mat, i64 40804), ptr noundef nonnull getelementptr inbounds (i8, ptr @mat, i64 122412))
  tail call void @_Z7mat_addPA101_iS0_S0_(ptr noundef nonnull getelementptr inbounds (i8, ptr @mat, i64 163216), ptr noundef nonnull getelementptr inbounds (i8, ptr @mat, i64 122412), ptr noundef nonnull getelementptr inbounds (i8, ptr @mat, i64 163216))
  tail call void @_Z7mat_mulPA101_iS0_S0_(ptr noundef nonnull getelementptr inbounds (i8, ptr @mat, i64 81608), ptr noundef nonnull @mat, ptr noundef nonnull getelementptr inbounds (i8, ptr @mat, i64 81608))
  %.pre54 = load i32, ptr @m, align 4, !tbaa !5
  br label %62

62:                                               ; preds = %.lr.ph38.peel.next, %61
  %63 = phi i32 [ %.pre53, %.lr.ph38.peel.next ], [ %.pre54, %61 ]
  %64 = ashr i32 %63, 1
  store i32 %64, ptr @m, align 4, !tbaa !5
  %65 = icmp sgt i32 %64, 0
  br i1 %65, label %.lr.ph38.peel.next, label %.preheader, !llvm.loop !17

._crit_edge42:                                    ; preds = %.lr.ph41, %middle.block55, %.preheader
  %.024.lcssa = phi i64 [ 0, %.preheader ], [ %59, %middle.block55 ], [ %77, %.lr.ph41 ]
  %66 = load i32, ptr @mod, align 4, !tbaa !5
  %67 = sext i32 %66 to i64
  %68 = srem i64 %.024.lcssa, %67
  %69 = icmp slt i64 %68, 0
  %70 = select i1 %69, i64 %67, i64 0
  %spec.select = add nsw i64 %70, %68
  %71 = trunc i64 %spec.select to i32
  %72 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %71)
  ret i32 0

.lr.ph41:                                         ; preds = %.lr.ph41.preheader67, %.lr.ph41
  %indvars.iv48 = phi i64 [ %indvars.iv.next49, %.lr.ph41 ], [ %indvars.iv48.ph, %.lr.ph41.preheader67 ]
  %.02439 = phi i64 [ %77, %.lr.ph41 ], [ %.02439.ph, %.lr.ph41.preheader67 ]
  %73 = getelementptr inbounds [101 x [101 x i32]], ptr getelementptr inbounds (i8, ptr @mat, i64 163216), i64 0, i64 %indvars.iv48, i64 %indvars.iv48
  %74 = load i32, ptr %73, align 4, !tbaa !5
  %75 = add nsw i32 %74, -1
  %76 = sext i32 %75 to i64
  %77 = add nsw i64 %.02439, %76
  %indvars.iv.next49 = add nuw nsw i64 %indvars.iv48, 1
  %exitcond52.not = icmp eq i64 %indvars.iv.next49, %wide.trip.count51
  br i1 %exitcond52.not, label %._crit_edge42, label %.lr.ph41, !llvm.loop !19
}

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #3

attributes #0 = { 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 #1 = { 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 #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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }

!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 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11, !12, !13}
!11 = !{!"llvm.loop.mustprogress"}
!12 = !{!"llvm.loop.isvectorized", i32 1}
!13 = !{!"llvm.loop.unroll.runtime.disable"}
!14 = distinct !{!14, !11}
!15 = distinct !{!15, !11, !13, !12}
!16 = distinct !{!16, !11, !12, !13}
!17 = distinct !{!17, !11, !18}
!18 = !{!"llvm.loop.peeled.count", i32 1}
!19 = distinct !{!19, !11, !13, !12}


; Effective O3 passes: BDCEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopFullUnrollPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,PostOrderFunctionAttrsPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass