; LLVM IR from ahampriyanshu/algo-ds-101 :: Maths/Algebra/Derivative_Of_Polynomial (Matrix_Multiplication)

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

@.str = external hidden unnamed_addr constant [48 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [2 x i8], align 1

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

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

20:                                               ; preds = %16
  br label %21

21:                                               ; preds = %20
  %22 = load i32, ptr %6, align 4, !tbaa !5
  %23 = add nsw i32 %22, 1
  store i32 %23, ptr %6, align 4, !tbaa !5
  br label %16, !llvm.loop !9

24:                                               ; preds = %16
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %25

25:                                               ; preds = %37, %24
  %26 = load i32, ptr %7, align 4, !tbaa !5
  %27 = load i32, ptr %3, align 4, !tbaa !5
  %28 = icmp slt i32 %26, %27
  br i1 %28, label %29, label %40

29:                                               ; preds = %25
  %30 = load i32, ptr %6, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [100 x [100 x i32]], ptr %9, i64 0, i64 %31
  %33 = load i32, ptr %7, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [100 x i32], ptr %32, i64 0, i64 %34
  %36 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.3, ptr noundef %35)
  br label %37

37:                                               ; preds = %29
  %38 = load i32, ptr %7, align 4, !tbaa !5
  %39 = add nsw i32 %38, 1
  store i32 %39, ptr %7, align 4, !tbaa !5
  br label %25, !llvm.loop !11

40:                                               ; preds = %25
  %41 = call i32 (ptr, ...) @printf(ptr noundef @.str.4)
  %42 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %4, ptr noundef %5)
  %43 = load i32, ptr %4, align 4, !tbaa !5
  %44 = load i32, ptr %3, align 4, !tbaa !5
  %45 = icmp ne i32 %43, %44
  br i1 %45, label %46, label %48

46:                                               ; preds = %40
  %47 = call i32 (ptr, ...) @printf(ptr noundef @.str.5)
  br label %75

48:                                               ; preds = %40
  %49 = call i32 (ptr, ...) @printf(ptr noundef @.str.6)
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %50

50:                                               ; preds = %55, %48
  %51 = load i32, ptr %6, align 4, !tbaa !5
  %52 = load i32, ptr %4, align 4, !tbaa !5
  %53 = icmp slt i32 %51, %52
  br i1 %53, label %54, label %58

54:                                               ; preds = %50
  br label %55

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

58:                                               ; preds = %50
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %59

59:                                               ; preds = %71, %58
  %60 = load i32, ptr %7, align 4, !tbaa !5
  %61 = load i32, ptr %5, align 4, !tbaa !5
  %62 = icmp slt i32 %60, %61
  br i1 %62, label %63, label %74

63:                                               ; preds = %59
  %64 = load i32, ptr %6, align 4, !tbaa !5
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [100 x [100 x i32]], ptr %10, i64 0, i64 %65
  %67 = load i32, ptr %7, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [100 x i32], ptr %66, i64 0, i64 %68
  %70 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.3, ptr noundef %69)
  br label %71

71:                                               ; preds = %63
  %72 = load i32, ptr %7, align 4, !tbaa !5
  %73 = add nsw i32 %72, 1
  store i32 %73, ptr %7, align 4, !tbaa !5
  br label %59, !llvm.loop !13

74:                                               ; preds = %59
  br label %75

75:                                               ; preds = %74, %46
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %76

76:                                               ; preds = %123, %75
  %77 = load i32, ptr %6, align 4, !tbaa !5
  %78 = load i32, ptr %2, align 4, !tbaa !5
  %79 = icmp slt i32 %77, %78
  br i1 %79, label %80, label %126

80:                                               ; preds = %76
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %81

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

85:                                               ; preds = %81
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %86

86:                                               ; preds = %108, %85
  %87 = load i32, ptr %8, align 4, !tbaa !5
  %88 = load i32, ptr %4, align 4, !tbaa !5
  %89 = icmp slt i32 %87, %88
  br i1 %89, label %90, label %111

90:                                               ; preds = %86
  %91 = load i32, ptr %6, align 4, !tbaa !5
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [100 x [100 x i32]], ptr %9, i64 0, i64 %92
  %94 = load i32, ptr %8, align 4, !tbaa !5
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [100 x i32], ptr %93, i64 0, i64 %95
  %97 = load i32, ptr %96, align 4, !tbaa !5
  %98 = load i32, ptr %7, align 4, !tbaa !5
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [100 x [100 x i32]], ptr %10, i64 0, i64 %99
  %101 = load i32, ptr %8, align 4, !tbaa !5
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [100 x i32], ptr %100, i64 0, i64 %102
  %104 = load i32, ptr %103, align 4, !tbaa !5
  %105 = mul nsw i32 %97, %104
  %106 = load i32, ptr %12, align 4, !tbaa !5
  %107 = add nsw i32 %106, %105
  store i32 %107, ptr %12, align 4, !tbaa !5
  br label %108

108:                                              ; preds = %90
  %109 = load i32, ptr %8, align 4, !tbaa !5
  %110 = add nsw i32 %109, 1
  store i32 %110, ptr %8, align 4, !tbaa !5
  br label %86, !llvm.loop !14

111:                                              ; preds = %86
  %112 = load i32, ptr %12, align 4, !tbaa !5
  %113 = load i32, ptr %6, align 4, !tbaa !5
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [100 x [100 x i32]], ptr %11, i64 0, i64 %114
  %116 = load i32, ptr %7, align 4, !tbaa !5
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [100 x i32], ptr %115, i64 0, i64 %117
  store i32 %112, ptr %118, align 4, !tbaa !5
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %119

119:                                              ; preds = %111
  %120 = load i32, ptr %7, align 4, !tbaa !5
  %121 = add nsw i32 %120, 1
  store i32 %121, ptr %7, align 4, !tbaa !5
  br label %81, !llvm.loop !15

122:                                              ; preds = %81
  br label %123

123:                                              ; preds = %122
  %124 = load i32, ptr %6, align 4, !tbaa !5
  %125 = add nsw i32 %124, 1
  store i32 %125, ptr %6, align 4, !tbaa !5
  br label %76, !llvm.loop !16

126:                                              ; preds = %76
  %127 = call i32 (ptr, ...) @printf(ptr noundef @.str.7)
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %128

128:                                              ; preds = %151, %126
  %129 = load i32, ptr %6, align 4, !tbaa !5
  %130 = load i32, ptr %2, align 4, !tbaa !5
  %131 = icmp slt i32 %129, %130
  br i1 %131, label %132, label %154

132:                                              ; preds = %128
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %133

133:                                              ; preds = %146, %132
  %134 = load i32, ptr %7, align 4, !tbaa !5
  %135 = load i32, ptr %5, align 4, !tbaa !5
  %136 = icmp slt i32 %134, %135
  br i1 %136, label %137, label %149

137:                                              ; preds = %133
  %138 = load i32, ptr %6, align 4, !tbaa !5
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds [100 x [100 x i32]], ptr %11, i64 0, i64 %139
  %141 = load i32, ptr %7, align 4, !tbaa !5
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds [100 x i32], ptr %140, i64 0, i64 %142
  %144 = load i32, ptr %143, align 4, !tbaa !5
  %145 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %144)
  br label %146

146:                                              ; preds = %137
  %147 = load i32, ptr %7, align 4, !tbaa !5
  %148 = add nsw i32 %147, 1
  store i32 %148, ptr %7, align 4, !tbaa !5
  br label %133, !llvm.loop !17

149:                                              ; preds = %133
  %150 = call i32 (ptr, ...) @printf(ptr noundef @.str.8)
  br label %151

151:                                              ; preds = %149
  %152 = load i32, ptr %6, align 4, !tbaa !5
  %153 = add nsw i32 %152, 1
  store i32 %153, ptr %6, align 4, !tbaa !5
  br label %128, !llvm.loop !18

154:                                              ; preds = %128
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 40000, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 40000, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 40000, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #3
  ret i32 0
}

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

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

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

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

attributes #0 = { 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 = { "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 = { 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/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !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"

@.str = external hidden unnamed_addr constant [48 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: nofree nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
.preheader43:
  %0 = alloca i32, align 4
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca [100 x [100 x i32]], align 16
  %5 = alloca [100 x [100 x i32]], align 16
  %6 = alloca [100 x [100 x i32]], align 16
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %0) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #5
  call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %4) #5
  call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %5) #5
  call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %6) #5
  %7 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str)
  %8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %0, ptr noundef nonnull %1)
  %9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
  %10 = load i32, ptr %1, align 4, !tbaa !5
  %11 = icmp sgt i32 %10, 0
  br i1 %11, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader43
  %12 = load i32, ptr %0, align 4, !tbaa !5
  %smax = call i32 @llvm.smax.i32(i32 %12, i32 0)
  %13 = zext nneg i32 %smax to i64
  br label %14

14:                                               ; preds = %.lr.ph, %14
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %14 ]
  %15 = getelementptr inbounds [100 x [100 x i32]], ptr %4, i64 0, i64 %13, i64 %indvars.iv
  %16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %15)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %17 = load i32, ptr %1, align 4, !tbaa !5
  %18 = sext i32 %17 to i64
  %19 = icmp slt i64 %indvars.iv.next, %18
  br i1 %19, label %14, label %._crit_edge, !llvm.loop !9

._crit_edge:                                      ; preds = %14, %.preheader43
  %20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4)
  %21 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %2, ptr noundef nonnull %3)
  %22 = load i32, ptr %2, align 4, !tbaa !5
  %23 = load i32, ptr %1, align 4, !tbaa !5
  %.not = icmp eq i32 %22, %23
  br i1 %.not, label %.preheader42, label %24

24:                                               ; preds = %._crit_edge
  %25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5)
  br label %.loopexit

.preheader42:                                     ; preds = %._crit_edge
  %26 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6)
  %27 = load i32, ptr %3, align 4, !tbaa !5
  %28 = icmp sgt i32 %27, 0
  br i1 %28, label %.lr.ph46, label %.loopexit

.lr.ph46:                                         ; preds = %.preheader42
  %29 = load i32, ptr %2, align 4, !tbaa !5
  %smax67 = call i32 @llvm.smax.i32(i32 %29, i32 0)
  %30 = zext nneg i32 %smax67 to i64
  br label %31

31:                                               ; preds = %.lr.ph46, %31
  %indvars.iv68 = phi i64 [ 0, %.lr.ph46 ], [ %indvars.iv.next69, %31 ]
  %32 = getelementptr inbounds [100 x [100 x i32]], ptr %5, i64 0, i64 %30, i64 %indvars.iv68
  %33 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %32)
  %indvars.iv.next69 = add nuw nsw i64 %indvars.iv68, 1
  %34 = load i32, ptr %3, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = icmp slt i64 %indvars.iv.next69, %35
  br i1 %36, label %31, label %.loopexit, !llvm.loop !11

.loopexit:                                        ; preds = %31, %.preheader42, %24
  %37 = load i32, ptr %0, align 4, !tbaa !5
  %38 = icmp sgt i32 %37, 0
  br i1 %38, label %.preheader41.lr.ph, label %._crit_edge54

.preheader41.lr.ph:                               ; preds = %.loopexit
  %39 = load i32, ptr %3, align 4, !tbaa !5
  %40 = icmp sgt i32 %39, 0
  %41 = load i32, ptr %2, align 4
  br i1 %40, label %.preheader41.lr.ph.split.us, label %._crit_edge54

.preheader41.lr.ph.split.us:                      ; preds = %.preheader41.lr.ph
  %42 = icmp sgt i32 %41, 0
  br i1 %42, label %.preheader41.us.us.preheader, label %.preheader41.us.preheader

.preheader41.us.preheader:                        ; preds = %.preheader41.lr.ph.split.us
  %43 = zext nneg i32 %39 to i64
  %44 = shl nuw nsw i64 %43, 2
  %wide.trip.count = zext nneg i32 %37 to i64
  %xtraiter = and i64 %wide.trip.count, 7
  %45 = icmp ult i32 %37, 8
  br i1 %45, label %._crit_edge54.loopexit105.unr-lcssa, label %.preheader41.us.preheader.new

.preheader41.us.preheader.new:                    ; preds = %.preheader41.us.preheader
  %unroll_iter = and i64 %wide.trip.count, 2147483640
  %invariant.gep = getelementptr i8, ptr %6, i64 400
  %invariant.gep109 = getelementptr i8, ptr %6, i64 800
  %invariant.gep111 = getelementptr i8, ptr %6, i64 1200
  %invariant.gep113 = getelementptr i8, ptr %6, i64 1600
  %invariant.gep115 = getelementptr i8, ptr %6, i64 2000
  %invariant.gep117 = getelementptr i8, ptr %6, i64 2400
  %invariant.gep119 = getelementptr i8, ptr %6, i64 2800
  br label %.preheader41.us

.preheader41.us.us.preheader:                     ; preds = %.preheader41.lr.ph.split.us
  %wide.trip.count88 = zext nneg i32 %37 to i64
  %wide.trip.count83 = zext nneg i32 %39 to i64
  %wide.trip.count78 = zext nneg i32 %41 to i64
  %min.iters.check = icmp ult i32 %41, 8
  %n.vec = and i64 %wide.trip.count78, 2147483640
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count78
  br label %.preheader41.us.us

.preheader41.us.us:                               ; preds = %.preheader41.us.us.preheader, %._crit_edge52.split.us.us.us
  %indvars.iv85 = phi i64 [ 0, %.preheader41.us.us.preheader ], [ %indvars.iv.next86, %._crit_edge52.split.us.us.us ]
  br label %.preheader40.us.us.us

.preheader40.us.us.us:                            ; preds = %._crit_edge50.us.us.us, %.preheader41.us.us
  %indvars.iv80 = phi i64 [ %indvars.iv.next81, %._crit_edge50.us.us.us ], [ 0, %.preheader41.us.us ]
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.body

vector.body:                                      ; preds = %.preheader40.us.us.us, %vector.body
  %index = phi i64 [ %index.next, %vector.body ], [ 0, %.preheader40.us.us.us ]
  %vec.phi = phi <4 x i32> [ %52, %vector.body ], [ zeroinitializer, %.preheader40.us.us.us ]
  %vec.phi98 = phi <4 x i32> [ %53, %vector.body ], [ zeroinitializer, %.preheader40.us.us.us ]
  %46 = getelementptr inbounds [100 x [100 x i32]], ptr %4, i64 0, i64 %indvars.iv85, i64 %index
  %47 = getelementptr inbounds i8, ptr %46, i64 16
  %wide.load = load <4 x i32>, ptr %46, align 16, !tbaa !5
  %wide.load99 = load <4 x i32>, ptr %47, align 16, !tbaa !5
  %48 = getelementptr inbounds [100 x [100 x i32]], ptr %5, i64 0, i64 %indvars.iv80, i64 %index
  %49 = getelementptr inbounds i8, ptr %48, i64 16
  %wide.load100 = load <4 x i32>, ptr %48, align 16, !tbaa !5
  %wide.load101 = load <4 x i32>, ptr %49, align 16, !tbaa !5
  %50 = mul nsw <4 x i32> %wide.load100, %wide.load
  %51 = mul nsw <4 x i32> %wide.load101, %wide.load99
  %52 = add <4 x i32> %50, %vec.phi
  %53 = add <4 x i32> %51, %vec.phi98
  %index.next = add nuw i64 %index, 8
  %54 = icmp eq i64 %index.next, %n.vec
  br i1 %54, label %middle.block, label %vector.body, !llvm.loop !12

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <4 x i32> %53, %52
  %55 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
  br i1 %cmp.n, label %._crit_edge50.us.us.us, label %scalar.ph.preheader

scalar.ph.preheader:                              ; preds = %middle.block, %.preheader40.us.us.us
  %indvars.iv75.ph = phi i64 [ 0, %.preheader40.us.us.us ], [ %n.vec, %middle.block ]
  %.248.us.us.us.ph = phi i32 [ 0, %.preheader40.us.us.us ], [ %55, %middle.block ]
  br label %scalar.ph

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv75 = phi i64 [ %indvars.iv.next76, %scalar.ph ], [ %indvars.iv75.ph, %scalar.ph.preheader ]
  %.248.us.us.us = phi i32 [ %61, %scalar.ph ], [ %.248.us.us.us.ph, %scalar.ph.preheader ]
  %56 = getelementptr inbounds [100 x [100 x i32]], ptr %4, i64 0, i64 %indvars.iv85, i64 %indvars.iv75
  %57 = load i32, ptr %56, align 4, !tbaa !5
  %58 = getelementptr inbounds [100 x [100 x i32]], ptr %5, i64 0, i64 %indvars.iv80, i64 %indvars.iv75
  %59 = load i32, ptr %58, align 4, !tbaa !5
  %60 = mul nsw i32 %59, %57
  %61 = add nsw i32 %60, %.248.us.us.us
  %indvars.iv.next76 = add nuw nsw i64 %indvars.iv75, 1
  %exitcond79.not = icmp eq i64 %indvars.iv.next76, %wide.trip.count78
  br i1 %exitcond79.not, label %._crit_edge50.us.us.us, label %scalar.ph, !llvm.loop !15

._crit_edge50.us.us.us:                           ; preds = %scalar.ph, %middle.block
  %.lcssa = phi i32 [ %55, %middle.block ], [ %61, %scalar.ph ]
  %62 = getelementptr inbounds [100 x [100 x i32]], ptr %6, i64 0, i64 %indvars.iv85, i64 %indvars.iv80
  store i32 %.lcssa, ptr %62, align 4, !tbaa !5
  %indvars.iv.next81 = add nuw nsw i64 %indvars.iv80, 1
  %exitcond84.not = icmp eq i64 %indvars.iv.next81, %wide.trip.count83
  br i1 %exitcond84.not, label %._crit_edge52.split.us.us.us, label %.preheader40.us.us.us, !llvm.loop !16

._crit_edge52.split.us.us.us:                     ; preds = %._crit_edge50.us.us.us
  %indvars.iv.next86 = add nuw nsw i64 %indvars.iv85, 1
  %exitcond89.not = icmp eq i64 %indvars.iv.next86, %wide.trip.count88
  br i1 %exitcond89.not, label %._crit_edge54, label %.preheader41.us.us, !llvm.loop !17

.preheader41.us:                                  ; preds = %.preheader41.us, %.preheader41.us.preheader.new
  %indvar = phi i64 [ 0, %.preheader41.us.preheader.new ], [ %indvar.next.7, %.preheader41.us ]
  %niter = phi i64 [ 0, %.preheader41.us.preheader.new ], [ %niter.next.7, %.preheader41.us ]
  %63 = mul nuw nsw i64 %indvar, 400
  %scevgep = getelementptr i8, ptr %6, i64 %63
  call void @llvm.memset.p0.i64(ptr align 16 %scevgep, i8 0, i64 %44, i1 false), !tbaa !5
  %64 = mul nuw i64 %indvar, 400
  %gep = getelementptr i8, ptr %invariant.gep, i64 %64
  call void @llvm.memset.p0.i64(ptr align 16 %gep, i8 0, i64 %44, i1 false), !tbaa !5
  %65 = mul nuw i64 %indvar, 400
  %gep110 = getelementptr i8, ptr %invariant.gep109, i64 %65
  call void @llvm.memset.p0.i64(ptr align 16 %gep110, i8 0, i64 %44, i1 false), !tbaa !5
  %66 = mul nuw i64 %indvar, 400
  %gep112 = getelementptr i8, ptr %invariant.gep111, i64 %66
  call void @llvm.memset.p0.i64(ptr align 16 %gep112, i8 0, i64 %44, i1 false), !tbaa !5
  %67 = mul nuw i64 %indvar, 400
  %gep114 = getelementptr i8, ptr %invariant.gep113, i64 %67
  call void @llvm.memset.p0.i64(ptr align 16 %gep114, i8 0, i64 %44, i1 false), !tbaa !5
  %68 = mul nuw i64 %indvar, 400
  %gep116 = getelementptr i8, ptr %invariant.gep115, i64 %68
  call void @llvm.memset.p0.i64(ptr align 16 %gep116, i8 0, i64 %44, i1 false), !tbaa !5
  %69 = mul nuw i64 %indvar, 400
  %gep118 = getelementptr i8, ptr %invariant.gep117, i64 %69
  call void @llvm.memset.p0.i64(ptr align 16 %gep118, i8 0, i64 %44, i1 false), !tbaa !5
  %70 = mul nuw i64 %indvar, 400
  %gep120 = getelementptr i8, ptr %invariant.gep119, i64 %70
  call void @llvm.memset.p0.i64(ptr align 16 %gep120, i8 0, i64 %44, i1 false), !tbaa !5
  %indvar.next.7 = add nuw nsw i64 %indvar, 8
  %niter.next.7 = add i64 %niter, 8
  %niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter
  br i1 %niter.ncmp.7, label %._crit_edge54.loopexit105.unr-lcssa, label %.preheader41.us, !llvm.loop !17

._crit_edge54.loopexit105.unr-lcssa:              ; preds = %.preheader41.us, %.preheader41.us.preheader
  %indvar.unr = phi i64 [ 0, %.preheader41.us.preheader ], [ %indvar.next.7, %.preheader41.us ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge54, label %.preheader41.us.epil

.preheader41.us.epil:                             ; preds = %._crit_edge54.loopexit105.unr-lcssa, %.preheader41.us.epil
  %indvar.epil = phi i64 [ %indvar.next.epil, %.preheader41.us.epil ], [ %indvar.unr, %._crit_edge54.loopexit105.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.preheader41.us.epil ], [ 0, %._crit_edge54.loopexit105.unr-lcssa ]
  %71 = mul nuw nsw i64 %indvar.epil, 400
  %scevgep.epil = getelementptr i8, ptr %6, i64 %71
  call void @llvm.memset.p0.i64(ptr align 16 %scevgep.epil, i8 0, i64 %44, i1 false), !tbaa !5
  %indvar.next.epil = add nuw nsw i64 %indvar.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_edge54, label %.preheader41.us.epil, !llvm.loop !18

._crit_edge54:                                    ; preds = %._crit_edge54.loopexit105.unr-lcssa, %.preheader41.us.epil, %._crit_edge52.split.us.us.us, %.preheader41.lr.ph, %.loopexit
  %72 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7)
  %73 = load i32, ptr %0, align 4, !tbaa !5
  %74 = icmp sgt i32 %73, 0
  br i1 %74, label %.preheader, label %._crit_edge63

.preheader:                                       ; preds = %._crit_edge54, %._crit_edge61
  %indvars.iv93 = phi i64 [ %indvars.iv.next94, %._crit_edge61 ], [ 0, %._crit_edge54 ]
  %75 = load i32, ptr %3, align 4, !tbaa !5
  %76 = icmp sgt i32 %75, 0
  br i1 %76, label %.lr.ph60, label %._crit_edge61

.lr.ph60:                                         ; preds = %.preheader, %.lr.ph60
  %indvars.iv90 = phi i64 [ %indvars.iv.next91, %.lr.ph60 ], [ 0, %.preheader ]
  %77 = getelementptr inbounds [100 x [100 x i32]], ptr %6, i64 0, i64 %indvars.iv93, i64 %indvars.iv90
  %78 = load i32, ptr %77, align 4, !tbaa !5
  %79 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %78)
  %indvars.iv.next91 = add nuw nsw i64 %indvars.iv90, 1
  %80 = load i32, ptr %3, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = icmp slt i64 %indvars.iv.next91, %81
  br i1 %82, label %.lr.ph60, label %._crit_edge61, !llvm.loop !20

._crit_edge61:                                    ; preds = %.lr.ph60, %.preheader
  %83 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8)
  %indvars.iv.next94 = add nuw nsw i64 %indvars.iv93, 1
  %84 = load i32, ptr %0, align 4, !tbaa !5
  %85 = sext i32 %84 to i64
  %86 = icmp slt i64 %indvars.iv.next94, %85
  br i1 %86, label %.preheader, label %._crit_edge63, !llvm.loop !21

._crit_edge63:                                    ; preds = %._crit_edge61, %._crit_edge54
  call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %0) #5
  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 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #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: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #3

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

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

attributes #0 = { nofree 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10, !13, !14}
!13 = !{!"llvm.loop.isvectorized", i32 1}
!14 = !{!"llvm.loop.unroll.runtime.disable"}
!15 = distinct !{!15, !10, !14, !13}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.unroll.disable"}
!20 = distinct !{!20, !10}
!21 = distinct !{!21, !10}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopIdiomRecognizePass,LoopInstSimplifyPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass