; LLVM IR from reyadussalahin/problem-solving :: dynamic_programming/coin_change/loj/F1232 (Solution)

; 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 [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [13 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca [110 x [10010 x i32]], align 16
  %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 i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4404400, ptr %2) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #3
  %14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %3)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #3
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %15

15:                                               ; preds = %155, %0
  %16 = load i32, ptr %4, align 4, !tbaa !5
  %17 = load i32, ptr %3, align 4, !tbaa !5
  %18 = icmp slt i32 %16, %17
  br i1 %18, label %20, label %19

19:                                               ; preds = %15
  store i32 2, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #3
  br label %158

20:                                               ; preds = %15
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  %21 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %6, ptr noundef %7)
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %22

22:                                               ; preds = %32, %20
  %23 = load i32, ptr %8, align 4, !tbaa !5
  %24 = load i32, ptr %7, align 4, !tbaa !5
  %25 = icmp sle i32 %23, %24
  br i1 %25, label %27, label %26

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

27:                                               ; preds = %22
  %28 = getelementptr inbounds [110 x [10010 x i32]], ptr %2, i64 0, i64 0
  %29 = load i32, ptr %8, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds [10010 x i32], ptr %28, i64 0, i64 %30
  store i32 0, ptr %31, align 4, !tbaa !5
  br label %32

32:                                               ; preds = %27
  %33 = load i32, ptr %8, align 4, !tbaa !5
  %34 = add nsw i32 %33, 1
  store i32 %34, ptr %8, align 4, !tbaa !5
  br label %22, !llvm.loop !9

35:                                               ; preds = %26
  %36 = getelementptr inbounds [110 x [10010 x i32]], ptr %2, i64 0, i64 0
  %37 = getelementptr inbounds [10010 x i32], ptr %36, i64 0, i64 0
  store i32 1, ptr %37, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  store i32 1, ptr %9, align 4, !tbaa !5
  br label %38

38:                                               ; preds = %141, %35
  %39 = load i32, ptr %9, align 4, !tbaa !5
  %40 = load i32, ptr %6, align 4, !tbaa !5
  %41 = icmp sle i32 %39, %40
  br i1 %41, label %43, label %42

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

43:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  %44 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %10)
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %45

45:                                               ; preds = %57, %43
  %46 = load i32, ptr %11, align 4, !tbaa !5
  %47 = load i32, ptr %7, align 4, !tbaa !5
  %48 = icmp sle i32 %46, %47
  br i1 %48, label %50, label %49

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

50:                                               ; preds = %45
  %51 = load i32, ptr %9, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [110 x [10010 x i32]], ptr %2, i64 0, i64 %52
  %54 = load i32, ptr %11, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [10010 x i32], ptr %53, i64 0, i64 %55
  store i32 0, ptr %56, align 4, !tbaa !5
  br label %57

57:                                               ; preds = %50
  %58 = load i32, ptr %11, align 4, !tbaa !5
  %59 = add nsw i32 %58, 1
  store i32 %59, ptr %11, align 4, !tbaa !5
  br label %45, !llvm.loop !11

60:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #3
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %61

61:                                               ; preds = %104, %60
  %62 = load i32, ptr %12, align 4, !tbaa !5
  %63 = load i32, ptr %10, align 4, !tbaa !5
  %64 = add nsw i32 %62, %63
  %65 = load i32, ptr %7, align 4, !tbaa !5
  %66 = icmp sle i32 %64, %65
  br i1 %66, label %68, label %67

67:                                               ; preds = %61
  store i32 14, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #3
  br label %107

68:                                               ; preds = %61
  %69 = load i32, ptr %9, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [110 x [10010 x i32]], ptr %2, i64 0, i64 %70
  %72 = load i32, ptr %12, align 4, !tbaa !5
  %73 = load i32, ptr %10, align 4, !tbaa !5
  %74 = add nsw i32 %72, %73
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [10010 x i32], ptr %71, i64 0, i64 %75
  %77 = load i32, ptr %76, align 4, !tbaa !5
  %78 = load i32, ptr %9, align 4, !tbaa !5
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [110 x [10010 x i32]], ptr %2, i64 0, i64 %79
  %81 = load i32, ptr %12, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [10010 x i32], ptr %80, i64 0, i64 %82
  %84 = load i32, ptr %83, align 4, !tbaa !5
  %85 = add nsw i32 %77, %84
  %86 = load i32, ptr %9, align 4, !tbaa !5
  %87 = sub nsw i32 %86, 1
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [110 x [10010 x i32]], ptr %2, i64 0, i64 %88
  %90 = load i32, ptr %12, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [10010 x i32], ptr %89, i64 0, i64 %91
  %93 = load i32, ptr %92, align 4, !tbaa !5
  %94 = add nsw i32 %85, %93
  %95 = srem i32 %94, 100000007
  %96 = load i32, ptr %9, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [110 x [10010 x i32]], ptr %2, i64 0, i64 %97
  %99 = load i32, ptr %12, align 4, !tbaa !5
  %100 = load i32, ptr %10, align 4, !tbaa !5
  %101 = add nsw i32 %99, %100
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [10010 x i32], ptr %98, i64 0, i64 %102
  store i32 %95, ptr %103, align 4, !tbaa !5
  br label %104

104:                                              ; preds = %68
  %105 = load i32, ptr %12, align 4, !tbaa !5
  %106 = add nsw i32 %105, 1
  store i32 %106, ptr %12, align 4, !tbaa !5
  br label %61, !llvm.loop !12

107:                                              ; preds = %67
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #3
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %108

108:                                              ; preds = %137, %107
  %109 = load i32, ptr %13, align 4, !tbaa !5
  %110 = load i32, ptr %7, align 4, !tbaa !5
  %111 = icmp sle i32 %109, %110
  br i1 %111, label %113, label %112

112:                                              ; preds = %108
  store i32 17, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #3
  br label %140

113:                                              ; preds = %108
  %114 = load i32, ptr %9, align 4, !tbaa !5
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [110 x [10010 x i32]], ptr %2, i64 0, i64 %115
  %117 = load i32, ptr %13, align 4, !tbaa !5
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [10010 x i32], ptr %116, i64 0, i64 %118
  %120 = load i32, ptr %119, align 4, !tbaa !5
  %121 = load i32, ptr %9, align 4, !tbaa !5
  %122 = sub nsw i32 %121, 1
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds [110 x [10010 x i32]], ptr %2, i64 0, i64 %123
  %125 = load i32, ptr %13, align 4, !tbaa !5
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds [10010 x i32], ptr %124, i64 0, i64 %126
  %128 = load i32, ptr %127, align 4, !tbaa !5
  %129 = add nsw i32 %120, %128
  %130 = srem i32 %129, 100000007
  %131 = load i32, ptr %9, align 4, !tbaa !5
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds [110 x [10010 x i32]], ptr %2, i64 0, i64 %132
  %134 = load i32, ptr %13, align 4, !tbaa !5
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds [10010 x i32], ptr %133, i64 0, i64 %135
  store i32 %130, ptr %136, align 4, !tbaa !5
  br label %137

137:                                              ; preds = %113
  %138 = load i32, ptr %13, align 4, !tbaa !5
  %139 = add nsw i32 %138, 1
  store i32 %139, ptr %13, align 4, !tbaa !5
  br label %108, !llvm.loop !13

140:                                              ; preds = %112
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  br label %141

141:                                              ; preds = %140
  %142 = load i32, ptr %9, align 4, !tbaa !5
  %143 = add nsw i32 %142, 1
  store i32 %143, ptr %9, align 4, !tbaa !5
  br label %38, !llvm.loop !14

144:                                              ; preds = %42
  %145 = load i32, ptr %4, align 4, !tbaa !5
  %146 = add nsw i32 %145, 1
  %147 = load i32, ptr %6, align 4, !tbaa !5
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds [110 x [10010 x i32]], ptr %2, i64 0, i64 %148
  %150 = load i32, ptr %7, align 4, !tbaa !5
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds [10010 x i32], ptr %149, i64 0, i64 %151
  %153 = load i32, ptr %152, align 4, !tbaa !5
  %154 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %146, i32 noundef %153)
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  br label %155

155:                                              ; preds = %144
  %156 = load i32, ptr %4, align 4, !tbaa !5
  %157 = add nsw i32 %156, 1
  store i32 %157, ptr %4, align 4, !tbaa !5
  br label %15, !llvm.loop !15

158:                                              ; preds = %19
  store i32 0, ptr %1, align 4
  store i32 1, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #3
  call void @llvm.lifetime.end.p0(i64 4404400, ptr %2) #3
  %159 = load i32, ptr %1, align 4
  ret i32 %159
}

; 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

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

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 = { 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 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !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 [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [13 x i8], align 1

; Function Attrs: mustprogress nofree norecurse nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca [110 x [10010 x i32]], align 16
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4404400, ptr nonnull %1) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #5
  %6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %2)
  %7 = load i32, ptr %2, align 4, !tbaa !5
  %8 = icmp sgt i32 %7, 0
  br i1 %8, label %.lr.ph64.preheader, label %._crit_edge65

.lr.ph64.preheader:                               ; preds = %0
  %invariant.gep = getelementptr inbounds i8, ptr %1, i64 40040
  %invariant.gep108 = getelementptr i8, ptr %1, i64 40040
  %invariant.gep110 = getelementptr i8, ptr %1, i64 40044
  br label %.lr.ph64

._crit_edge65:                                    ; preds = %._crit_edge61, %0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 4404400, ptr nonnull %1) #5
  ret i32 0

.lr.ph64:                                         ; preds = %.lr.ph64.preheader, %._crit_edge61
  %.03562 = phi i32 [ %16, %._crit_edge61 ], [ 0, %.lr.ph64.preheader ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #5
  %9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %3, ptr noundef nonnull %4)
  %10 = load i32, ptr %4, align 4, !tbaa !5
  %.not44 = icmp slt i32 %10, 0
  br i1 %.not44, label %._crit_edge, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %.lr.ph64
  %11 = add nuw i32 %10, 1
  %12 = zext i32 %11 to i64
  %13 = shl nuw nsw i64 %12, 2
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1) %1, i8 0, i64 %13, i1 false), !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph.preheader, %.lr.ph64
  store i32 1, ptr %1, align 16, !tbaa !5
  %14 = load i32, ptr %3, align 4, !tbaa !5
  %.not3857 = icmp slt i32 %14, 1
  br i1 %.not3857, label %._crit_edge.._crit_edge61_crit_edge, label %.lr.ph60

._crit_edge.._crit_edge61_crit_edge:              ; preds = %._crit_edge
  %.pre = sext i32 %14 to i64
  br label %._crit_edge61

._crit_edge61:                                    ; preds = %._crit_edge56, %._crit_edge.._crit_edge61_crit_edge
  %.pre-phi = phi i64 [ %.pre, %._crit_edge.._crit_edge61_crit_edge ], [ %71, %._crit_edge56 ]
  %15 = phi i32 [ %10, %._crit_edge.._crit_edge61_crit_edge ], [ %26, %._crit_edge56 ]
  %16 = add nuw nsw i32 %.03562, 1
  %17 = sext i32 %15 to i64
  %18 = getelementptr inbounds [110 x [10010 x i32]], ptr %1, i64 0, i64 %.pre-phi, i64 %17
  %19 = load i32, ptr %18, align 4, !tbaa !5
  %20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %16, i32 noundef %19)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #5
  %21 = load i32, ptr %2, align 4, !tbaa !5
  %22 = icmp slt i32 %16, %21
  br i1 %22, label %.lr.ph64, label %._crit_edge65, !llvm.loop !9

.lr.ph60:                                         ; preds = %._crit_edge, %._crit_edge56
  %indvars.iv72 = phi i64 [ %indvars.iv.next73, %._crit_edge56 ], [ 1, %._crit_edge ]
  %indvar = phi i64 [ %indvar.next, %._crit_edge56 ], [ 0, %._crit_edge ]
  %23 = mul nuw nsw i64 %indvar, 40040
  %gep109 = getelementptr i8, ptr %invariant.gep108, i64 %23
  %gep111 = getelementptr i8, ptr %invariant.gep110, i64 %23
  %scevgep82 = getelementptr i8, ptr %1, i64 %23
  %24 = or disjoint i64 %23, 4
  %scevgep83 = getelementptr i8, ptr %1, i64 %24
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #5
  %25 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %5)
  %26 = load i32, ptr %4, align 4, !tbaa !5
  %.not3946 = icmp slt i32 %26, 0
  br i1 %.not3946, label %.preheader42, label %.lr.ph49

.lr.ph49:                                         ; preds = %.lr.ph60
  %27 = mul nuw nsw i64 %indvar, 40040
  %gep = getelementptr i8, ptr %invariant.gep, i64 %27
  %28 = add nuw i32 %26, 1
  %29 = zext i32 %28 to i64
  %30 = shl nuw nsw i64 %29, 2
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(1) %gep, i8 0, i64 %30, i1 false), !tbaa !5
  br label %.preheader42

.preheader42:                                     ; preds = %.lr.ph49, %.lr.ph60
  %31 = load i32, ptr %5, align 4, !tbaa !5
  %.not4050 = icmp sgt i32 %31, %26
  br i1 %.not4050, label %.preheader, label %.lr.ph52

.lr.ph52:                                         ; preds = %.preheader42
  %32 = add nsw i64 %indvars.iv72, -1
  %33 = sext i32 %31 to i64
  %34 = sext i32 %26 to i64
  %invariant.op = sub nsw i64 %34, %33
  %smax88 = call i64 @llvm.smax.i64(i64 %invariant.op, i64 0)
  %35 = add nuw nsw i64 %smax88, 1
  %min.iters.check91 = icmp slt i64 %invariant.op, 7
  br i1 %min.iters.check91, label %scalar.ph90.preheader, label %vector.memcheck

scalar.ph90.preheader:                            ; preds = %middle.block89, %vector.memcheck, %.lr.ph52
  %indvars.iv.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %.lr.ph52 ], [ %n.vec94, %middle.block89 ]
  br label %scalar.ph90

vector.memcheck:                                  ; preds = %.lr.ph52
  %36 = shl nsw i64 %33, 2
  %scevgep78 = getelementptr i8, ptr %gep109, i64 %36
  %37 = shl nuw nsw i64 %invariant.op, 2
  %38 = shl nsw i64 %34, 2
  %scevgep80 = getelementptr i8, ptr %gep111, i64 %38
  %scevgep81 = getelementptr i8, ptr %gep111, i64 %37
  %scevgep84 = getelementptr i8, ptr %scevgep83, i64 %37
  %bound0 = icmp ult ptr %scevgep78, %scevgep81
  %bound1 = icmp ult ptr %gep109, %scevgep80
  %found.conflict = and i1 %bound0, %bound1
  %bound085 = icmp ult ptr %scevgep78, %scevgep84
  %bound186 = icmp ult ptr %scevgep82, %scevgep80
  %found.conflict87 = and i1 %bound085, %bound186
  %conflict.rdx = or i1 %found.conflict, %found.conflict87
  br i1 %conflict.rdx, label %scalar.ph90.preheader, label %vector.ph92

vector.ph92:                                      ; preds = %vector.memcheck
  %n.vec94 = and i64 %35, 9223372036854775800
  br label %vector.body96

vector.body96:                                    ; preds = %vector.body96, %vector.ph92
  %index97 = phi i64 [ 0, %vector.ph92 ], [ %index.next104, %vector.body96 ]
  %39 = add nsw i64 %index97, %33
  %40 = getelementptr inbounds [110 x [10010 x i32]], ptr %1, i64 0, i64 %indvars.iv72, i64 %39
  %41 = getelementptr inbounds i8, ptr %40, i64 16
  %wide.load98 = load <4 x i32>, ptr %40, align 4, !tbaa !5, !alias.scope !11, !noalias !14
  %wide.load99 = load <4 x i32>, ptr %41, align 4, !tbaa !5, !alias.scope !11, !noalias !14
  %42 = getelementptr inbounds [110 x [10010 x i32]], ptr %1, i64 0, i64 %indvars.iv72, i64 %index97
  %43 = getelementptr inbounds i8, ptr %42, i64 16
  %wide.load100 = load <4 x i32>, ptr %42, align 8, !tbaa !5, !alias.scope !17
  %wide.load101 = load <4 x i32>, ptr %43, align 8, !tbaa !5, !alias.scope !17
  %44 = add nsw <4 x i32> %wide.load100, %wide.load98
  %45 = add nsw <4 x i32> %wide.load101, %wide.load99
  %46 = getelementptr inbounds [110 x [10010 x i32]], ptr %1, i64 0, i64 %32, i64 %index97
  %47 = getelementptr inbounds i8, ptr %46, i64 16
  %wide.load102 = load <4 x i32>, ptr %46, align 8, !tbaa !5, !alias.scope !18
  %wide.load103 = load <4 x i32>, ptr %47, align 8, !tbaa !5, !alias.scope !18
  %48 = add nsw <4 x i32> %44, %wide.load102
  %49 = add nsw <4 x i32> %45, %wide.load103
  %50 = srem <4 x i32> %48, <i32 100000007, i32 100000007, i32 100000007, i32 100000007>
  %51 = srem <4 x i32> %49, <i32 100000007, i32 100000007, i32 100000007, i32 100000007>
  store <4 x i32> %50, ptr %40, align 4, !tbaa !5, !alias.scope !11, !noalias !14
  store <4 x i32> %51, ptr %41, align 4, !tbaa !5, !alias.scope !11, !noalias !14
  %index.next104 = add nuw i64 %index97, 8
  %52 = icmp eq i64 %index.next104, %n.vec94
  br i1 %52, label %middle.block89, label %vector.body96, !llvm.loop !19

middle.block89:                                   ; preds = %vector.body96
  %cmp.n105 = icmp eq i64 %35, %n.vec94
  br i1 %cmp.n105, label %.preheader, label %scalar.ph90.preheader

.preheader:                                       ; preds = %scalar.ph90, %middle.block89, %.preheader42
  br i1 %.not3946, label %._crit_edge56, label %.lr.ph55

.lr.ph55:                                         ; preds = %.preheader
  %53 = add nsw i64 %indvars.iv72, -1
  %54 = add nuw i32 %26, 1
  %wide.trip.count = zext i32 %54 to i64
  %min.iters.check = icmp ult i32 %26, 3
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

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

vector.ph:                                        ; preds = %.lr.ph55
  %n.vec = and i64 %wide.trip.count, 4294967292
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %55 = getelementptr inbounds [110 x [10010 x i32]], ptr %1, i64 0, i64 %indvars.iv72, i64 %index
  %wide.load = load <4 x i32>, ptr %55, align 8, !tbaa !5
  %56 = getelementptr inbounds [110 x [10010 x i32]], ptr %1, i64 0, i64 %53, i64 %index
  %wide.load77 = load <4 x i32>, ptr %56, align 8, !tbaa !5
  %57 = add nsw <4 x i32> %wide.load77, %wide.load
  %58 = srem <4 x i32> %57, <i32 100000007, i32 100000007, i32 100000007, i32 100000007>
  store <4 x i32> %58, ptr %55, align 8, !tbaa !5
  %index.next = add nuw i64 %index, 4
  %59 = icmp eq i64 %index.next, %n.vec
  br i1 %59, label %middle.block, label %vector.body, !llvm.loop !22

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

scalar.ph90:                                      ; preds = %scalar.ph90.preheader, %scalar.ph90
  %indvars.iv = phi i64 [ %indvars.iv.next, %scalar.ph90 ], [ %indvars.iv.ph, %scalar.ph90.preheader ]
  %60 = add nsw i64 %indvars.iv, %33
  %61 = getelementptr inbounds [110 x [10010 x i32]], ptr %1, i64 0, i64 %indvars.iv72, i64 %60
  %62 = load i32, ptr %61, align 4, !tbaa !5
  %63 = getelementptr inbounds [110 x [10010 x i32]], ptr %1, i64 0, i64 %indvars.iv72, i64 %indvars.iv
  %64 = load i32, ptr %63, align 4, !tbaa !5
  %65 = add nsw i32 %64, %62
  %66 = getelementptr inbounds [110 x [10010 x i32]], ptr %1, i64 0, i64 %32, i64 %indvars.iv
  %67 = load i32, ptr %66, align 4, !tbaa !5
  %68 = add nsw i32 %65, %67
  %69 = srem i32 %68, 100000007
  store i32 %69, ptr %61, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %.not40.not = icmp slt i64 %indvars.iv, %invariant.op
  br i1 %.not40.not, label %scalar.ph90, label %.preheader, !llvm.loop !23

._crit_edge56:                                    ; preds = %scalar.ph, %middle.block, %.preheader
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #5
  %indvars.iv.next73 = add nuw nsw i64 %indvars.iv72, 1
  %70 = load i32, ptr %3, align 4, !tbaa !5
  %71 = sext i32 %70 to i64
  %.not38.not = icmp slt i64 %indvars.iv72, %71
  %indvar.next = add nuw nsw i64 %indvar, 1
  br i1 %.not38.not, label %.lr.ph60, label %._crit_edge61, !llvm.loop !24

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv69 = phi i64 [ %indvars.iv.next70, %scalar.ph ], [ %indvars.iv69.ph, %scalar.ph.preheader ]
  %72 = getelementptr inbounds [110 x [10010 x i32]], ptr %1, i64 0, i64 %indvars.iv72, i64 %indvars.iv69
  %73 = load i32, ptr %72, align 4, !tbaa !5
  %74 = getelementptr inbounds [110 x [10010 x i32]], ptr %1, i64 0, i64 %53, i64 %indvars.iv69
  %75 = load i32, ptr %74, align 4, !tbaa !5
  %76 = add nsw i32 %75, %73
  %77 = srem i32 %76, 100000007
  store i32 %77, ptr %72, align 4, !tbaa !5
  %indvars.iv.next70 = add nuw nsw i64 %indvars.iv69, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next70, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge56, label %scalar.ph, !llvm.loop !25
}

; 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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

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

attributes #0 = { mustprogress nofree 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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12}
!12 = distinct !{!12, !13}
!13 = distinct !{!13, !"LVerDomain"}
!14 = !{!15, !16}
!15 = distinct !{!15, !13}
!16 = distinct !{!16, !13}
!17 = !{!15}
!18 = !{!16}
!19 = distinct !{!19, !10, !20, !21}
!20 = !{!"llvm.loop.isvectorized", i32 1}
!21 = !{!"llvm.loop.unroll.runtime.disable"}
!22 = distinct !{!22, !10, !20, !21}
!23 = distinct !{!23, !10, !20}
!24 = distinct !{!24, !10}
!25 = distinct !{!25, !10, !21, !20}


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