; LLVM IR from VastoLorde95/Competitive-Programming :: Hackerrank/Codesprints 2016/Codesprint May/Problem F (F)

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

@cat = external dso_local global [201000 x i64], align 16
@dp = external dso_local global [201 x [201 x i64]], align 16
@f = external dso_local global [201000 x i64], align 16
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@t = 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 [6 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_Z4fastxx(i64 noundef, i64 noundef) #0

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

; Function Attrs: 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 @_Z3addRxx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_Z1Cii(i32 noundef, i32 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 i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i64, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  store i64 1, ptr @cat, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  store i32 1, ptr %2, align 4, !tbaa !9
  br label %11

11:                                               ; preds = %39, %0
  %12 = load i32, ptr %2, align 4, !tbaa !9
  %13 = icmp slt i32 %12, 201000
  br i1 %13, label %15, label %14

14:                                               ; preds = %11
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #4
  br label %42

15:                                               ; preds = %11
  %16 = load i32, ptr %2, align 4, !tbaa !9
  %17 = sub nsw i32 %16, 1
  %18 = mul nsw i32 2, %17
  %19 = add nsw i32 %18, 1
  %20 = sext i32 %19 to i64
  %21 = load i32, ptr %2, align 4, !tbaa !9
  %22 = sub nsw i32 %21, 1
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds [201000 x i64], ptr @cat, i64 0, i64 %23
  %25 = load i64, ptr %24, align 8, !tbaa !5
  %26 = mul nsw i64 %25, 2
  %27 = mul nsw i64 %20, %26
  %28 = srem i64 %27, 1000000007
  %29 = srem i64 %28, 1000000007
  %30 = load i32, ptr %2, align 4, !tbaa !9
  %31 = add nsw i32 %30, 1
  %32 = sext i32 %31 to i64
  %33 = call noundef i64 @_Z4fastxx(i64 noundef %32, i64 noundef 1000000005)
  %34 = mul nsw i64 %29, %33
  %35 = srem i64 %34, 1000000007
  %36 = load i32, ptr %2, align 4, !tbaa !9
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [201000 x i64], ptr @cat, i64 0, i64 %37
  store i64 %35, ptr %38, align 8, !tbaa !5
  br label %39

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

42:                                               ; preds = %14
  store i64 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 !9
  br label %43

43:                                               ; preds = %60, %42
  %44 = load i32, ptr %3, align 4, !tbaa !9
  %45 = icmp slt i32 %44, 201000
  br i1 %45, label %47, label %46

46:                                               ; preds = %43
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  br label %63

47:                                               ; preds = %43
  %48 = load i32, ptr %3, align 4, !tbaa !9
  %49 = sub nsw i32 %48, 1
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [201000 x i64], ptr @f, i64 0, i64 %50
  %52 = load i64, ptr %51, align 8, !tbaa !5
  %53 = load i32, ptr %3, align 4, !tbaa !9
  %54 = sext i32 %53 to i64
  %55 = mul nsw i64 %52, %54
  %56 = srem i64 %55, 1000000007
  %57 = load i32, ptr %3, align 4, !tbaa !9
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [201000 x i64], ptr @f, i64 0, i64 %58
  store i64 %56, ptr %59, align 8, !tbaa !5
  br label %60

60:                                               ; preds = %47
  %61 = load i32, ptr %3, align 4, !tbaa !9
  %62 = add nsw i32 %61, 1
  store i32 %62, ptr %3, align 4, !tbaa !9
  br label %43, !llvm.loop !13

63:                                               ; preds = %46
  store i64 1, ptr @dp, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  store i32 1, ptr %4, align 4, !tbaa !9
  br label %64

64:                                               ; preds = %112, %63
  %65 = load i32, ptr %4, align 4, !tbaa !9
  %66 = icmp slt i32 %65, 201
  br i1 %66, label %68, label %67

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

68:                                               ; preds = %64
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  store i32 1, ptr %6, align 4, !tbaa !9
  br label %69

69:                                               ; preds = %108, %68
  %70 = load i32, ptr %6, align 4, !tbaa !9
  %71 = load i32, ptr %4, align 4, !tbaa !9
  %72 = icmp sle i32 %70, %71
  br i1 %72, label %74, label %73

73:                                               ; preds = %69
  store i32 11, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  br label %111

74:                                               ; preds = %69
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  store i32 1, ptr %7, align 4, !tbaa !9
  br label %75

75:                                               ; preds = %104, %74
  %76 = load i32, ptr %7, align 4, !tbaa !9
  %77 = load i32, ptr %4, align 4, !tbaa !9
  %78 = icmp sle i32 %76, %77
  br i1 %78, label %80, label %79

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

80:                                               ; preds = %75
  %81 = load i32, ptr %4, align 4, !tbaa !9
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [201 x [201 x i64]], ptr @dp, i64 0, i64 %82
  %84 = load i32, ptr %6, align 4, !tbaa !9
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [201 x i64], ptr %83, i64 0, i64 %85
  %87 = load i32, ptr %4, align 4, !tbaa !9
  %88 = load i32, ptr %7, align 4, !tbaa !9
  %89 = sub nsw i32 %87, %88
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [201 x [201 x i64]], ptr @dp, i64 0, i64 %90
  %92 = load i32, ptr %6, align 4, !tbaa !9
  %93 = sub nsw i32 %92, 1
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [201 x i64], ptr %91, i64 0, i64 %94
  %96 = load i64, ptr %95, align 8, !tbaa !5
  %97 = load i32, ptr %7, align 4, !tbaa !9
  %98 = sub nsw i32 %97, 1
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [201000 x i64], ptr @cat, i64 0, i64 %99
  %101 = load i64, ptr %100, align 8, !tbaa !5
  %102 = mul nsw i64 %96, %101
  %103 = srem i64 %102, 1000000007
  call void @_Z3addRxx(ptr noundef nonnull align 8 dereferenceable(8) %86, i64 noundef %103)
  br label %104

104:                                              ; preds = %80
  %105 = load i32, ptr %7, align 4, !tbaa !9
  %106 = add nsw i32 %105, 1
  store i32 %106, ptr %7, align 4, !tbaa !9
  br label %75, !llvm.loop !14

107:                                              ; preds = %79
  br label %108

108:                                              ; preds = %107
  %109 = load i32, ptr %6, align 4, !tbaa !9
  %110 = add nsw i32 %109, 1
  store i32 %110, ptr %6, align 4, !tbaa !9
  br label %69, !llvm.loop !15

111:                                              ; preds = %73
  br label %112

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

115:                                              ; preds = %67
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %116 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @t)
  br label %117

117:                                              ; preds = %148, %115
  %118 = load i32, ptr @t, align 4, !tbaa !9
  %119 = add nsw i32 %118, -1
  store i32 %119, ptr @t, align 4, !tbaa !9
  %120 = icmp ne i32 %118, 0
  br i1 %120, label %121, label %170

121:                                              ; preds = %117
  %122 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef @n, ptr noundef @m)
  store i64 0, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  %123 = load i32, ptr @n, align 4, !tbaa !9
  %124 = mul nsw i32 2, %123
  store i32 %124, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  store i32 1, ptr %10, align 4, !tbaa !9
  br label %125

125:                                              ; preds = %145, %121
  %126 = load i32, ptr %10, align 4, !tbaa !9
  %127 = load i32, ptr @m, align 4, !tbaa !9
  %128 = icmp sle i32 %126, %127
  br i1 %128, label %130, label %129

129:                                              ; preds = %125
  store i32 19, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  br label %148

130:                                              ; preds = %125
  %131 = load i32, ptr @m, align 4, !tbaa !9
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds [201 x [201 x i64]], ptr @dp, i64 0, i64 %132
  %134 = load i32, ptr %10, align 4, !tbaa !9
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds [201 x i64], ptr %133, i64 0, i64 %135
  %137 = load i64, ptr %136, align 8, !tbaa !5
  %138 = load i32, ptr %9, align 4, !tbaa !9
  %139 = load i32, ptr %10, align 4, !tbaa !9
  %140 = add nsw i32 %138, %139
  %141 = load i32, ptr %10, align 4, !tbaa !9
  %142 = call noundef i64 @_Z1Cii(i32 noundef %140, i32 noundef %141)
  %143 = mul nsw i64 %137, %142
  %144 = srem i64 %143, 1000000007
  call void @_Z3addRxx(ptr noundef nonnull align 8 dereferenceable(8) %8, i64 noundef %144)
  br label %145

145:                                              ; preds = %130
  %146 = load i32, ptr %10, align 4, !tbaa !9
  %147 = add nsw i32 %146, 1
  store i32 %147, ptr %10, align 4, !tbaa !9
  br label %125, !llvm.loop !17

148:                                              ; preds = %129
  %149 = load i64, ptr %8, align 8, !tbaa !5
  %150 = load i32, ptr @n, align 4, !tbaa !9
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds [201000 x i64], ptr @f, i64 0, i64 %151
  %153 = load i64, ptr %152, align 8, !tbaa !5
  %154 = mul nsw i64 %149, %153
  %155 = srem i64 %154, 1000000007
  %156 = load i32, ptr @m, align 4, !tbaa !9
  %157 = sext i32 %156 to i64
  %158 = getelementptr inbounds [201000 x i64], ptr @f, i64 0, i64 %157
  %159 = load i64, ptr %158, align 8, !tbaa !5
  %160 = mul nsw i64 %155, %159
  %161 = srem i64 %160, 1000000007
  %162 = load i32, ptr @n, align 4, !tbaa !9
  %163 = sext i32 %162 to i64
  %164 = getelementptr inbounds [201000 x i64], ptr @cat, i64 0, i64 %163
  %165 = load i64, ptr %164, align 8, !tbaa !5
  %166 = mul nsw i64 %161, %165
  %167 = srem i64 %166, 1000000007
  store i64 %167, ptr %8, align 8, !tbaa !5
  %168 = load i64, ptr %8, align 8, !tbaa !5
  %169 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i64 noundef %168)
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  br label %117, !llvm.loop !18

170:                                              ; preds = %117
  store i32 0, ptr %1, align 4
  store i32 1, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  %171 = load i32, ptr %1, align 4
  ret i32 %171
}

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 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}


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

@cat = external dso_local local_unnamed_addr global [201000 x i64], align 16
@dp = external dso_local global [201 x [201 x i64]], align 16
@f = external dso_local local_unnamed_addr global [201000 x i64], align 16
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@t = 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 [6 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_Z4fastxx(i64 noundef, i64 noundef) local_unnamed_addr #0

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

; Function Attrs: mustprogress 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 @_Z3addRxx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_Z1Cii(i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress norecurse nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 {
  %1 = alloca i64, align 8
  store i64 1, ptr @cat, align 16, !tbaa !5
  br label %3

2:                                                ; preds = %3
  store i64 1, ptr @f, align 16, !tbaa !5
  br label %14

3:                                                ; preds = %0, %3
  %4 = phi i64 [ 1, %0 ], [ %11, %3 ]
  %indvars.iv = phi i64 [ 1, %0 ], [ %indvars.iv.next, %3 ]
  %5 = shl i64 %indvars.iv, 2
  %6 = add i64 %5, -2
  %7 = mul i64 %6, %4
  %8 = srem i64 %7, 1000000007
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %9 = tail call noundef i64 @_Z4fastxx(i64 noundef %indvars.iv.next, i64 noundef 1000000005)
  %10 = mul nsw i64 %8, %9
  %11 = srem i64 %10, 1000000007
  %12 = getelementptr inbounds [201000 x i64], ptr @cat, i64 0, i64 %indvars.iv
  store i64 %11, ptr %12, align 8, !tbaa !5
  %exitcond.not = icmp eq i64 %indvars.iv.next, 201000
  br i1 %exitcond.not, label %2, label %3, !llvm.loop !9

13:                                               ; preds = %14
  store i64 1, ptr @dp, align 16, !tbaa !5
  br label %.preheader41

14:                                               ; preds = %19, %2
  %15 = phi i64 [ 1, %2 ], [ %21, %19 ]
  %indvars.iv55 = phi i64 [ 1, %2 ], [ %indvars.iv.next56.1, %19 ]
  %16 = mul nsw i64 %15, %indvars.iv55
  %17 = srem i64 %16, 1000000007
  %18 = getelementptr inbounds [201000 x i64], ptr @f, i64 0, i64 %indvars.iv55
  store i64 %17, ptr %18, align 8, !tbaa !5
  %indvars.iv.next56 = add nuw nsw i64 %indvars.iv55, 1
  %exitcond58.not = icmp eq i64 %indvars.iv.next56, 201000
  br i1 %exitcond58.not, label %13, label %19, !llvm.loop !11

19:                                               ; preds = %14
  %20 = mul nsw i64 %17, %indvars.iv.next56
  %21 = srem i64 %20, 1000000007
  %22 = getelementptr inbounds [201000 x i64], ptr @f, i64 0, i64 %indvars.iv.next56
  store i64 %21, ptr %22, align 8, !tbaa !5
  %indvars.iv.next56.1 = add nuw nsw i64 %indvars.iv55, 2
  br label %14

.preheader41:                                     ; preds = %13, %29
  %indvars.iv72 = phi i64 [ 1, %13 ], [ %indvars.iv.next73, %29 ]
  %indvars.iv70 = phi i64 [ 2, %13 ], [ %indvars.iv.next71, %29 ]
  br label %.preheader

23:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #4
  %24 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @t)
  %25 = load i32, ptr @t, align 4, !tbaa !12
  %26 = add nsw i32 %25, -1
  store i32 %26, ptr @t, align 4, !tbaa !12
  %.not49 = icmp eq i32 %25, 0
  br i1 %.not49, label %._crit_edge52, label %.lr.ph51

.preheader:                                       ; preds = %.preheader41, %30
  %indvars.iv65 = phi i64 [ 1, %.preheader41 ], [ %indvars.iv.next66, %30 ]
  %27 = getelementptr inbounds [201 x [201 x i64]], ptr @dp, i64 0, i64 %indvars.iv72, i64 %indvars.iv65
  %28 = add nsw i64 %indvars.iv65, -1
  br label %31

29:                                               ; preds = %30
  %indvars.iv.next73 = add nuw nsw i64 %indvars.iv72, 1
  %indvars.iv.next71 = add nuw nsw i64 %indvars.iv70, 1
  %exitcond77.not = icmp eq i64 %indvars.iv.next73, 201
  br i1 %exitcond77.not, label %23, label %.preheader41, !llvm.loop !14

30:                                               ; preds = %31
  %indvars.iv.next66 = add nuw nsw i64 %indvars.iv65, 1
  %exitcond69.not = icmp eq i64 %indvars.iv.next66, %indvars.iv70
  br i1 %exitcond69.not, label %29, label %.preheader, !llvm.loop !15

31:                                               ; preds = %.preheader, %31
  %indvars.iv59 = phi i64 [ 1, %.preheader ], [ %indvars.iv.next60, %31 ]
  %32 = sub nsw i64 %indvars.iv72, %indvars.iv59
  %33 = getelementptr inbounds [201 x [201 x i64]], ptr @dp, i64 0, i64 %32, i64 %28
  %34 = load i64, ptr %33, align 8, !tbaa !5
  %35 = add nsw i64 %indvars.iv59, -1
  %36 = getelementptr inbounds [201000 x i64], ptr @cat, i64 0, i64 %35
  %37 = load i64, ptr %36, align 8, !tbaa !5
  %38 = mul nsw i64 %37, %34
  %39 = srem i64 %38, 1000000007
  tail call void @_Z3addRxx(ptr noundef nonnull align 8 dereferenceable(8) %27, i64 noundef %39)
  %indvars.iv.next60 = add nuw nsw i64 %indvars.iv59, 1
  %exitcond64.not = icmp eq i64 %indvars.iv.next60, %indvars.iv70
  br i1 %exitcond64.not, label %30, label %31, !llvm.loop !16

.lr.ph51:                                         ; preds = %23, %._crit_edge
  %40 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @n, ptr noundef nonnull @m)
  store i64 0, ptr %1, align 8, !tbaa !5
  %41 = load i32, ptr @n, align 4, !tbaa !12
  %42 = shl nsw i32 %41, 1
  %43 = load i32, ptr @m, align 4, !tbaa !12
  %.not3847 = icmp slt i32 %43, 1
  br i1 %.not3847, label %.lr.ph51.._crit_edge_crit_edge, label %.lr.ph

.lr.ph51.._crit_edge_crit_edge:                   ; preds = %.lr.ph51
  %.pre82 = sext i32 %43 to i64
  br label %._crit_edge

._crit_edge.loopexit:                             ; preds = %.lr.ph
  %.pre = load i64, ptr %1, align 8, !tbaa !5
  %.pre81 = load i32, ptr @n, align 4, !tbaa !12
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph51.._crit_edge_crit_edge, %._crit_edge.loopexit
  %.pre-phi = phi i64 [ %.pre82, %.lr.ph51.._crit_edge_crit_edge ], [ %71, %._crit_edge.loopexit ]
  %44 = phi i32 [ %41, %.lr.ph51.._crit_edge_crit_edge ], [ %.pre81, %._crit_edge.loopexit ]
  %45 = phi i64 [ 0, %.lr.ph51.._crit_edge_crit_edge ], [ %.pre, %._crit_edge.loopexit ]
  %46 = sext i32 %44 to i64
  %47 = getelementptr inbounds [201000 x i64], ptr @f, i64 0, i64 %46
  %48 = load i64, ptr %47, align 8, !tbaa !5
  %49 = mul nsw i64 %48, %45
  %50 = srem i64 %49, 1000000007
  %51 = getelementptr inbounds [201000 x i64], ptr @f, i64 0, i64 %.pre-phi
  %52 = load i64, ptr %51, align 8, !tbaa !5
  %53 = mul nsw i64 %50, %52
  %54 = srem i64 %53, 1000000007
  %55 = getelementptr inbounds [201000 x i64], ptr @cat, i64 0, i64 %46
  %56 = load i64, ptr %55, align 8, !tbaa !5
  %57 = mul nsw i64 %54, %56
  %58 = srem i64 %57, 1000000007
  store i64 %58, ptr %1, align 8, !tbaa !5
  %59 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %58)
  %60 = load i32, ptr @t, align 4, !tbaa !12
  %61 = add nsw i32 %60, -1
  store i32 %61, ptr @t, align 4, !tbaa !12
  %.not = icmp eq i32 %60, 0
  br i1 %.not, label %._crit_edge52, label %.lr.ph51, !llvm.loop !17

.lr.ph:                                           ; preds = %.lr.ph51, %.lr.ph
  %indvars.iv78 = phi i64 [ %indvars.iv.next79, %.lr.ph ], [ 1, %.lr.ph51 ]
  %62 = phi i32 [ %70, %.lr.ph ], [ %43, %.lr.ph51 ]
  %indvars80 = trunc i64 %indvars.iv78 to i32
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [201 x [201 x i64]], ptr @dp, i64 0, i64 %63, i64 %indvars.iv78
  %65 = load i64, ptr %64, align 8, !tbaa !5
  %66 = add nsw i32 %42, %indvars80
  %67 = call noundef i64 @_Z1Cii(i32 noundef %66, i32 noundef %indvars80)
  %68 = mul nsw i64 %67, %65
  %69 = srem i64 %68, 1000000007
  call void @_Z3addRxx(ptr noundef nonnull align 8 dereferenceable(8) %1, i64 noundef %69)
  %indvars.iv.next79 = add nuw nsw i64 %indvars.iv78, 1
  %70 = load i32, ptr @m, align 4, !tbaa !12
  %71 = sext i32 %70 to i64
  %.not38.not = icmp slt i64 %indvars.iv78, %71
  br i1 %.not38.not, label %.lr.ph, label %._crit_edge.loopexit, !llvm.loop !18

._crit_edge52:                                    ; preds = %._crit_edge, %23
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #4
  ret i32 0
}

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

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { 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 #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 = !{!"long long", !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 = !{!13, !13, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}


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