; LLVM IR from tangjz/acm-icpc :: hdu (5362)

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

@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@p = external dso_local global [2010 x i32], align 16
@f = external dso_local global [2010 x [2010 x i32]], align 16
@ans = external dso_local global i32, align 4
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z3incRii(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #1 {
  %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
  store i32 0, ptr %1, align 4
  %6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @t)
  br label %7

7:                                                ; preds = %148, %0
  %8 = load i32, ptr @t, align 4, !tbaa !5
  %9 = add nsw i32 %8, -1
  store i32 %9, ptr @t, align 4, !tbaa !5
  %10 = icmp ne i32 %8, 0
  br i1 %10, label %11, label %151

11:                                               ; preds = %7
  %12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef @n, ptr noundef @m)
  store i32 1, ptr @p, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %13

13:                                               ; preds = %33, %11
  %14 = load i32, ptr %2, align 4, !tbaa !5
  %15 = load i32, ptr @n, align 4, !tbaa !5
  %16 = icmp sle i32 %14, %15
  br i1 %16, label %18, label %17

17:                                               ; preds = %13
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #4
  br label %36

18:                                               ; preds = %13
  %19 = load i32, ptr %2, align 4, !tbaa !5
  %20 = sub nsw i32 %19, 1
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds [2010 x i32], ptr @p, i64 0, i64 %21
  %23 = load i32, ptr %22, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  %25 = load i32, ptr @m, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  %27 = mul nsw i64 %24, %26
  %28 = srem i64 %27, 1000000007
  %29 = trunc i64 %28 to i32
  %30 = load i32, ptr %2, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [2010 x i32], ptr @p, i64 0, i64 %31
  store i32 %29, ptr %32, align 4, !tbaa !5
  br label %33

33:                                               ; preds = %18
  %34 = load i32, ptr %2, align 4, !tbaa !5
  %35 = add nsw i32 %34, 1
  store i32 %35, ptr %2, align 4, !tbaa !5
  br label %13, !llvm.loop !9

36:                                               ; preds = %17
  store i32 0, ptr @ans, align 4, !tbaa !5
  store i32 1, ptr @f, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %37

37:                                               ; preds = %145, %36
  %38 = load i32, ptr %3, align 4, !tbaa !5
  %39 = load i32, ptr @n, align 4, !tbaa !5
  %40 = icmp sle i32 %38, %39
  br i1 %40, label %42, label %41

41:                                               ; preds = %37
  store i32 7, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  br label %148

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

43:                                               ; preds = %112, %42
  %44 = load i32, ptr %5, align 4, !tbaa !5
  %45 = load i32, ptr %3, align 4, !tbaa !5
  %46 = icmp sle i32 %44, %45
  br i1 %46, label %48, label %47

47:                                               ; preds = %43
  store i32 10, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  br label %115

48:                                               ; preds = %43
  %49 = load i32, ptr %3, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [2010 x [2010 x i32]], ptr @f, i64 0, i64 %50
  %52 = load i32, ptr %5, align 4, !tbaa !5
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [2010 x i32], ptr %51, i64 0, i64 %53
  store i32 0, ptr %54, align 4, !tbaa !5
  %55 = load i32, ptr %3, align 4, !tbaa !5
  %56 = sub nsw i32 %55, 1
  %57 = load i32, ptr %5, align 4, !tbaa !5
  %58 = add nsw i32 %57, 1
  %59 = icmp sge i32 %56, %58
  br i1 %59, label %60, label %83

60:                                               ; preds = %48
  %61 = load i32, ptr %3, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [2010 x [2010 x i32]], ptr @f, i64 0, i64 %62
  %64 = load i32, ptr %5, align 4, !tbaa !5
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [2010 x i32], ptr %63, i64 0, i64 %65
  %67 = load i32, ptr %3, align 4, !tbaa !5
  %68 = sub nsw i32 %67, 1
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [2010 x [2010 x i32]], ptr @f, i64 0, i64 %69
  %71 = load i32, ptr %5, align 4, !tbaa !5
  %72 = add nsw i32 %71, 1
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [2010 x i32], ptr %70, i64 0, i64 %73
  %75 = load i32, ptr %74, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = load i32, ptr %5, align 4, !tbaa !5
  %78 = add nsw i32 %77, 1
  %79 = sext i32 %78 to i64
  %80 = mul nsw i64 %76, %79
  %81 = srem i64 %80, 1000000007
  %82 = trunc i64 %81 to i32
  call void @_Z3incRii(ptr noundef nonnull align 4 dereferenceable(4) %66, i32 noundef %82)
  br label %83

83:                                               ; preds = %60, %48
  %84 = load i32, ptr %5, align 4, !tbaa !5
  %85 = icmp sgt i32 %84, 0
  br i1 %85, label %86, label %111

86:                                               ; preds = %83
  %87 = load i32, ptr %3, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [2010 x [2010 x i32]], ptr @f, i64 0, i64 %88
  %90 = load i32, ptr %5, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [2010 x i32], ptr %89, i64 0, i64 %91
  %93 = load i32, ptr %3, align 4, !tbaa !5
  %94 = sub nsw i32 %93, 1
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [2010 x [2010 x i32]], ptr @f, i64 0, i64 %95
  %97 = load i32, ptr %5, align 4, !tbaa !5
  %98 = sub nsw i32 %97, 1
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [2010 x i32], ptr %96, i64 0, i64 %99
  %101 = load i32, ptr %100, align 4, !tbaa !5
  %102 = sext i32 %101 to i64
  %103 = load i32, ptr @m, align 4, !tbaa !5
  %104 = load i32, ptr %5, align 4, !tbaa !5
  %105 = sub nsw i32 %103, %104
  %106 = add nsw i32 %105, 1
  %107 = sext i32 %106 to i64
  %108 = mul nsw i64 %102, %107
  %109 = srem i64 %108, 1000000007
  %110 = trunc i64 %109 to i32
  call void @_Z3incRii(ptr noundef nonnull align 4 dereferenceable(4) %92, i32 noundef %110)
  br label %111

111:                                              ; preds = %86, %83
  br label %112

112:                                              ; preds = %111
  %113 = load i32, ptr %5, align 4, !tbaa !5
  %114 = add nsw i32 %113, 1
  store i32 %114, ptr %5, align 4, !tbaa !5
  br label %43, !llvm.loop !11

115:                                              ; preds = %47
  %116 = load i32, ptr @n, align 4, !tbaa !5
  %117 = load i32, ptr %3, align 4, !tbaa !5
  %118 = sub nsw i32 %116, %117
  %119 = add nsw i32 %118, 1
  %120 = sext i32 %119 to i64
  %121 = load i32, ptr @n, align 4, !tbaa !5
  %122 = load i32, ptr %3, align 4, !tbaa !5
  %123 = sub nsw i32 %121, %122
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds [2010 x i32], ptr @p, i64 0, i64 %124
  %126 = load i32, ptr %125, align 4, !tbaa !5
  %127 = sext i32 %126 to i64
  %128 = mul nsw i64 %120, %127
  %129 = srem i64 %128, 1000000007
  %130 = load i32, ptr %3, align 4, !tbaa !5
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds [2010 x [2010 x i32]], ptr @f, i64 0, i64 %131
  %133 = getelementptr inbounds [2010 x i32], ptr %132, i64 0, i64 0
  %134 = load i32, ptr %133, align 8, !tbaa !5
  %135 = load i32, ptr %3, align 4, !tbaa !5
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds [2010 x [2010 x i32]], ptr @f, i64 0, i64 %136
  %138 = getelementptr inbounds [2010 x i32], ptr %137, i64 0, i64 1
  %139 = load i32, ptr %138, align 4, !tbaa !5
  %140 = add nsw i32 %134, %139
  %141 = sext i32 %140 to i64
  %142 = mul nsw i64 %129, %141
  %143 = srem i64 %142, 1000000007
  %144 = trunc i64 %143 to i32
  call void @_Z3incRii(ptr noundef nonnull align 4 dereferenceable(4) @ans, i32 noundef %144)
  br label %145

145:                                              ; preds = %115
  %146 = load i32, ptr %3, align 4, !tbaa !5
  %147 = add nsw i32 %146, 1
  store i32 %147, ptr %3, align 4, !tbaa !5
  br label %37, !llvm.loop !12

148:                                              ; preds = %41
  %149 = load i32, ptr @ans, align 4, !tbaa !5
  %150 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %149)
  br label %7, !llvm.loop !13

151:                                              ; preds = %7
  ret i32 0
}

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

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

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

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

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 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 = { "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 willreturn memory(argmem: readwrite) }
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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !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"

@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@p = external dso_local local_unnamed_addr global [2010 x i32], align 16
@f = external dso_local global [2010 x [2010 x i32]], align 16
@ans = external dso_local global i32, align 4
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z3incRii(ptr noundef nonnull align 4 dereferenceable(4), i32 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 @t)
  %2 = load i32, ptr @t, align 4, !tbaa !5
  %3 = add nsw i32 %2, -1
  store i32 %3, ptr @t, align 4, !tbaa !5
  %.not43 = icmp eq i32 %2, 0
  br i1 %.not43, label %._crit_edge46, label %.lr.ph45

.lr.ph45:                                         ; preds = %0, %._crit_edge42
  %4 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @n, ptr noundef nonnull @m)
  store i32 1, ptr @p, align 16, !tbaa !5
  %5 = load i32, ptr @n, align 4, !tbaa !5
  %.not3237 = icmp slt i32 %5, 1
  br i1 %.not3237, label %._crit_edge.thread, label %.lr.ph

._crit_edge.thread:                               ; preds = %.lr.ph45
  store i32 0, ptr @ans, align 4, !tbaa !5
  store i32 1, ptr @f, align 16, !tbaa !5
  br label %._crit_edge42

.lr.ph:                                           ; preds = %.lr.ph45
  %6 = load i32, ptr @m, align 4, !tbaa !5
  %7 = sext i32 %6 to i64
  %8 = zext nneg i32 %5 to i64
  %xtraiter = and i64 %8, 1
  %9 = icmp eq i32 %5, 1
  br i1 %9, label %._crit_edge.unr-lcssa, label %.lr.ph.new

.lr.ph.new:                                       ; preds = %.lr.ph
  %unroll_iter = and i64 %8, 2147483646
  br label %14

._crit_edge.unr-lcssa:                            ; preds = %14, %.lr.ph
  %.unr = phi i64 [ 1, %.lr.ph ], [ %21, %14 ]
  %indvars.iv.unr = phi i64 [ 1, %.lr.ph ], [ %indvars.iv.next.1, %14 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge, label %._crit_edge.epilog-lcssa

._crit_edge.epilog-lcssa:                         ; preds = %._crit_edge.unr-lcssa
  %10 = mul nsw i64 %.unr, %7
  %11 = srem i64 %10, 1000000007
  %12 = trunc nsw i64 %11 to i32
  %13 = getelementptr inbounds [2010 x i32], ptr @p, i64 0, i64 %indvars.iv.unr
  store i32 %12, ptr %13, align 4, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.unr-lcssa, %._crit_edge.epilog-lcssa
  store i32 0, ptr @ans, align 4, !tbaa !5
  store i32 1, ptr @f, align 16, !tbaa !5
  br i1 %.not3237, label %._crit_edge42, label %.preheader

14:                                               ; preds = %14, %.lr.ph.new
  %15 = phi i64 [ 1, %.lr.ph.new ], [ %21, %14 ]
  %indvars.iv = phi i64 [ 1, %.lr.ph.new ], [ %indvars.iv.next.1, %14 ]
  %niter = phi i64 [ 0, %.lr.ph.new ], [ %niter.next.1, %14 ]
  %16 = mul nsw i64 %15, %7
  %17 = srem i64 %16, 1000000007
  %18 = trunc nsw i64 %17 to i32
  %19 = getelementptr inbounds [2010 x i32], ptr @p, i64 0, i64 %indvars.iv
  store i32 %18, ptr %19, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %20 = mul nsw i64 %17, %7
  %21 = srem i64 %20, 1000000007
  %22 = trunc nsw i64 %21 to i32
  %23 = getelementptr inbounds [2010 x i32], ptr @p, i64 0, i64 %indvars.iv.next
  store i32 %22, ptr %23, align 4, !tbaa !5
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge.unr-lcssa, label %14, !llvm.loop !9

.preheader:                                       ; preds = %._crit_edge, %.loopexit
  %indvars.iv58 = phi i64 [ %indvars.iv.next59, %.loopexit ], [ 1, %._crit_edge ]
  %indvars.iv56 = phi i64 [ %indvars.iv.next57, %.loopexit ], [ 2, %._crit_edge ]
  %24 = add nsw i64 %indvars.iv58, -1
  %25 = getelementptr inbounds [2010 x [2010 x i32]], ptr @f, i64 0, i64 %indvars.iv58, i64 0
  store i32 0, ptr %25, align 8, !tbaa !5
  %.not35.not.peel = icmp ugt i64 %indvars.iv58, 1
  br i1 %.not35.not.peel, label %26, label %.peel.next.preheader

.peel.next.preheader:                             ; preds = %26, %.preheader
  br label %.peel.next

26:                                               ; preds = %.preheader
  %27 = getelementptr inbounds [2010 x [2010 x i32]], ptr @f, i64 0, i64 %24, i64 1
  %28 = load i32, ptr %27, align 4, !tbaa !5
  %29 = srem i32 %28, 1000000007
  tail call void @_Z3incRii(ptr noundef nonnull align 4 dereferenceable(4) %25, i32 noundef %29)
  br label %.peel.next.preheader

._crit_edge42.loopexit:                           ; preds = %.loopexit
  %.pre = load i32, ptr @ans, align 4, !tbaa !5
  br label %._crit_edge42

._crit_edge42:                                    ; preds = %._crit_edge.thread, %._crit_edge42.loopexit, %._crit_edge
  %30 = phi i32 [ %.pre, %._crit_edge42.loopexit ], [ 0, %._crit_edge ], [ 0, %._crit_edge.thread ]
  %31 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %30)
  %32 = load i32, ptr @t, align 4, !tbaa !5
  %33 = add nsw i32 %32, -1
  store i32 %33, ptr @t, align 4, !tbaa !5
  %.not = icmp eq i32 %32, 0
  br i1 %.not, label %._crit_edge46, label %.lr.ph45, !llvm.loop !11

.loopexit:                                        ; preds = %63
  %34 = load i32, ptr @n, align 4, !tbaa !5
  %35 = trunc nuw nsw i64 %indvars.iv58 to i32
  %36 = sub nsw i32 %34, %35
  %37 = add nsw i32 %36, 1
  %38 = sext i32 %37 to i64
  %39 = sext i32 %36 to i64
  %40 = getelementptr inbounds [2010 x i32], ptr @p, i64 0, i64 %39
  %41 = load i32, ptr %40, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = mul nsw i64 %38, %42
  %44 = srem i64 %43, 1000000007
  %45 = load i32, ptr %25, align 8, !tbaa !5
  %46 = getelementptr inbounds i8, ptr %25, i64 4
  %47 = load i32, ptr %46, align 4, !tbaa !5
  %48 = add nsw i32 %47, %45
  %49 = sext i32 %48 to i64
  %50 = mul nsw i64 %44, %49
  %51 = srem i64 %50, 1000000007
  %52 = trunc nsw i64 %51 to i32
  tail call void @_Z3incRii(ptr noundef nonnull align 4 dereferenceable(4) @ans, i32 noundef %52)
  %indvars.iv.next59 = add nuw nsw i64 %indvars.iv58, 1
  %53 = load i32, ptr @n, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %.not33.not = icmp slt i64 %indvars.iv58, %54
  %indvars.iv.next57 = add nuw nsw i64 %indvars.iv56, 1
  br i1 %.not33.not, label %.preheader, label %._crit_edge42.loopexit, !llvm.loop !12

.peel.next:                                       ; preds = %.peel.next.preheader, %63
  %indvars.iv48 = phi i64 [ %indvars.iv.next49, %63 ], [ 1, %.peel.next.preheader ]
  %55 = getelementptr inbounds [2010 x [2010 x i32]], ptr @f, i64 0, i64 %indvars.iv58, i64 %indvars.iv48
  store i32 0, ptr %55, align 4, !tbaa !5
  %indvars.iv.next49 = add nuw nsw i64 %indvars.iv48, 1
  %.not35.not = icmp ugt i64 %indvars.iv58, %indvars.iv.next49
  br i1 %.not35.not, label %56, label %63

56:                                               ; preds = %.peel.next
  %57 = getelementptr inbounds [2010 x [2010 x i32]], ptr @f, i64 0, i64 %24, i64 %indvars.iv.next49
  %58 = load i32, ptr %57, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %60 = mul nsw i64 %indvars.iv.next49, %59
  %61 = srem i64 %60, 1000000007
  %62 = trunc nsw i64 %61 to i32
  tail call void @_Z3incRii(ptr noundef nonnull align 4 dereferenceable(4) %55, i32 noundef %62)
  br label %63

63:                                               ; preds = %56, %.peel.next
  %64 = add nsw i64 %indvars.iv48, -1
  %65 = getelementptr inbounds [2010 x [2010 x i32]], ptr @f, i64 0, i64 %24, i64 %64
  %66 = load i32, ptr %65, align 4, !tbaa !5
  %67 = sext i32 %66 to i64
  %68 = load i32, ptr @m, align 4, !tbaa !5
  %69 = trunc nuw nsw i64 %indvars.iv48 to i32
  %reass.sub = sub i32 %68, %69
  %70 = add i32 %reass.sub, 1
  %71 = sext i32 %70 to i64
  %72 = mul nsw i64 %71, %67
  %73 = srem i64 %72, 1000000007
  %74 = trunc nsw i64 %73 to i32
  tail call void @_Z3incRii(ptr noundef nonnull align 4 dereferenceable(4) %55, i32 noundef %74)
  %exitcond54.not = icmp eq i64 %indvars.iv.next49, %indvars.iv56
  br i1 %exitcond54.not, label %.loopexit, label %.peel.next, !llvm.loop !13

._crit_edge46:                                    ; preds = %._crit_edge42, %0
  ret i32 0
}

; 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

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

!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}
!14 = !{!"llvm.loop.peeled.count", i32 1}


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