; LLVM IR from kazunetakahashi/atcoder :: 2019/0217_nikkei2019-final (E)

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

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }

@N = external dso_local global i64, align 8
@K = external dso_local global i64, align 8
@L = external dso_local global i64, align 8
@DP = external dso_local global [5010 x [5010 x i64]], align 16
@DP2 = external dso_local global [5010 x [5010 x i64]], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z4initv() #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 uwtable
declare dso_local void @_Z5flushv() #2

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #3 {
  %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
  store i32 0, ptr %1, align 4
  %7 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @N)
  %8 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef nonnull align 8 dereferenceable(8) @K)
  call void @_Z4initv()
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %9

9:                                                ; preds = %164, %0
  %10 = load i32, ptr %2, align 4, !tbaa !5
  %11 = sext i32 %10 to i64
  %12 = load i64, ptr @L, align 8, !tbaa !9
  %13 = icmp slt i64 %11, %12
  br i1 %13, label %15, label %14

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

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

16:                                               ; preds = %88, %15
  %17 = load i32, ptr %4, align 4, !tbaa !5
  %18 = sext i32 %17 to i64
  %19 = load i64, ptr @L, align 8, !tbaa !9
  %20 = icmp slt i64 %18, %19
  br i1 %20, label %22, label %21

21:                                               ; preds = %16
  store i32 5, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  br label %91

22:                                               ; preds = %16
  %23 = load i32, ptr %2, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds [5010 x [5010 x i64]], ptr @DP, i64 0, i64 %24
  %26 = load i32, ptr %4, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [5010 x i64], ptr %25, i64 0, i64 %27
  store i64 0, ptr %28, align 8, !tbaa !9
  %29 = load i32, ptr %4, align 4, !tbaa !5
  %30 = load i32, ptr %2, align 4, !tbaa !5
  %31 = icmp slt i32 %29, %30
  br i1 %31, label %32, label %33

32:                                               ; preds = %22
  br label %88

33:                                               ; preds = %22
  %34 = load i32, ptr %2, align 4, !tbaa !5
  %35 = sub nsw i32 %34, 1
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [5010 x [5010 x i64]], ptr @DP2, i64 0, i64 %36
  %38 = load i32, ptr %4, align 4, !tbaa !5
  %39 = sub nsw i32 %38, 1
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [5010 x i64], ptr %37, i64 0, i64 %40
  %42 = load i64, ptr %41, align 8, !tbaa !9
  %43 = load i32, ptr %4, align 4, !tbaa !5
  %44 = load i32, ptr %2, align 4, !tbaa !5
  %45 = sub nsw i32 %43, %44
  %46 = call noundef i64 @_Z5poweri(i32 noundef %45)
  %47 = mul nsw i64 %42, %46
  %48 = srem i64 %47, 1000000007
  %49 = load i32, ptr %2, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [5010 x [5010 x i64]], ptr @DP, i64 0, i64 %50
  %52 = load i32, ptr %4, align 4, !tbaa !5
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [5010 x i64], ptr %51, i64 0, i64 %53
  %55 = load i64, ptr %54, align 8, !tbaa !9
  %56 = add nsw i64 %55, %48
  store i64 %56, ptr %54, align 8, !tbaa !9
  %57 = load i32, ptr %2, align 4, !tbaa !5
  %58 = sub nsw i32 %57, 1
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [5010 x [5010 x i64]], ptr @DP, i64 0, i64 %59
  %61 = load i32, ptr %4, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [5010 x i64], ptr %60, i64 0, i64 %62
  %64 = load i64, ptr %63, align 8, !tbaa !9
  %65 = load i32, ptr %4, align 4, !tbaa !5
  %66 = load i32, ptr %2, align 4, !tbaa !5
  %67 = sub nsw i32 %65, %66
  %68 = add nsw i32 %67, 1
  %69 = call noundef i64 @_Z6power2i(i32 noundef %68)
  %70 = mul nsw i64 %64, %69
  %71 = srem i64 %70, 1000000007
  %72 = load i32, ptr %2, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [5010 x [5010 x i64]], ptr @DP, i64 0, i64 %73
  %75 = load i32, ptr %4, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [5010 x i64], ptr %74, i64 0, i64 %76
  %78 = load i64, ptr %77, align 8, !tbaa !9
  %79 = add nsw i64 %78, %71
  store i64 %79, ptr %77, align 8, !tbaa !9
  %80 = load i32, ptr %2, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [5010 x [5010 x i64]], ptr @DP, i64 0, i64 %81
  %83 = load i32, ptr %4, align 4, !tbaa !5
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [5010 x i64], ptr %82, i64 0, i64 %84
  %86 = load i64, ptr %85, align 8, !tbaa !9
  %87 = srem i64 %86, 1000000007
  store i64 %87, ptr %85, align 8, !tbaa !9
  br label %88

88:                                               ; preds = %33, %32
  %89 = load i32, ptr %4, align 4, !tbaa !5
  %90 = add nsw i32 %89, 1
  store i32 %90, ptr %4, align 4, !tbaa !5
  br label %16, !llvm.loop !11

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

92:                                               ; preds = %104, %91
  %93 = load i32, ptr %5, align 4, !tbaa !5
  %94 = load i32, ptr %2, align 4, !tbaa !5
  %95 = icmp slt i32 %93, %94
  br i1 %95, label %97, label %96

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

97:                                               ; preds = %92
  %98 = load i32, ptr %2, align 4, !tbaa !5
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [5010 x [5010 x i64]], ptr @DP2, i64 0, i64 %99
  %101 = load i32, ptr %5, align 4, !tbaa !5
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [5010 x i64], ptr %100, i64 0, i64 %102
  store i64 0, ptr %103, align 8, !tbaa !9
  br label %104

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

107:                                              ; preds = %96
  %108 = load i32, ptr %2, align 4, !tbaa !5
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [5010 x [5010 x i64]], ptr @DP, i64 0, i64 %109
  %111 = load i32, ptr %2, align 4, !tbaa !5
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [5010 x i64], ptr %110, i64 0, i64 %112
  %114 = load i64, ptr %113, align 8, !tbaa !9
  %115 = load i32, ptr %2, align 4, !tbaa !5
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [5010 x [5010 x i64]], ptr @DP2, i64 0, i64 %116
  %118 = load i32, ptr %2, align 4, !tbaa !5
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [5010 x i64], ptr %117, i64 0, i64 %119
  store i64 %114, ptr %120, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  %121 = load i32, ptr %2, align 4, !tbaa !5
  %122 = add nsw i32 %121, 1
  store i32 %122, ptr %6, align 4, !tbaa !5
  br label %123

123:                                              ; preds = %160, %107
  %124 = load i32, ptr %6, align 4, !tbaa !5
  %125 = sext i32 %124 to i64
  %126 = load i64, ptr @L, align 8, !tbaa !9
  %127 = icmp slt i64 %125, %126
  br i1 %127, label %129, label %128

128:                                              ; preds = %123
  store i32 11, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  br label %163

129:                                              ; preds = %123
  %130 = load i32, ptr %2, align 4, !tbaa !5
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds [5010 x [5010 x i64]], ptr @DP2, i64 0, i64 %131
  %133 = load i32, ptr %6, align 4, !tbaa !5
  %134 = sub nsw i32 %133, 1
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds [5010 x i64], ptr %132, i64 0, i64 %135
  %137 = load i64, ptr %136, align 8, !tbaa !9
  %138 = load i32, ptr %2, align 4, !tbaa !5
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds [5010 x [5010 x i64]], ptr @DP, i64 0, i64 %139
  %141 = load i32, ptr %6, align 4, !tbaa !5
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds [5010 x i64], ptr %140, i64 0, i64 %142
  %144 = load i64, ptr %143, align 8, !tbaa !9
  %145 = add nsw i64 %137, %144
  %146 = load i32, ptr %2, align 4, !tbaa !5
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds [5010 x [5010 x i64]], ptr @DP2, i64 0, i64 %147
  %149 = load i32, ptr %6, align 4, !tbaa !5
  %150 = sext i32 %149 to i64
  %151 = getelementptr inbounds [5010 x i64], ptr %148, i64 0, i64 %150
  store i64 %145, ptr %151, align 8, !tbaa !9
  %152 = load i32, ptr %2, align 4, !tbaa !5
  %153 = sext i32 %152 to i64
  %154 = getelementptr inbounds [5010 x [5010 x i64]], ptr @DP2, i64 0, i64 %153
  %155 = load i32, ptr %6, align 4, !tbaa !5
  %156 = sext i32 %155 to i64
  %157 = getelementptr inbounds [5010 x i64], ptr %154, i64 0, i64 %156
  %158 = load i64, ptr %157, align 8, !tbaa !9
  %159 = srem i64 %158, 1000000007
  store i64 %159, ptr %157, align 8, !tbaa !9
  br label %160

160:                                              ; preds = %129
  %161 = load i32, ptr %6, align 4, !tbaa !5
  %162 = add nsw i32 %161, 1
  store i32 %162, ptr %6, align 4, !tbaa !5
  br label %123, !llvm.loop !14

163:                                              ; preds = %128
  br label %164

164:                                              ; preds = %163
  %165 = load i32, ptr %2, align 4, !tbaa !5
  %166 = add nsw i32 %165, 1
  store i32 %166, ptr %2, align 4, !tbaa !5
  br label %9, !llvm.loop !15

167:                                              ; preds = %14
  call void @_Z5flushv()
  %168 = load i32, ptr %1, align 4
  ret i32 %168
}

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) #2 align 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress 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 = { 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 #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 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !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"

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }

@N = external dso_local global i64, align 8
@K = external dso_local global i64, align 8
@L = external dso_local local_unnamed_addr global i64, align 8
@DP = external dso_local local_unnamed_addr global [5010 x [5010 x i64]], align 16
@DP2 = external dso_local local_unnamed_addr global [5010 x [5010 x i64]], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z4initv() local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5flushv() local_unnamed_addr #1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 {
  %1 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @N)
  %2 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 8 dereferenceable(8) @K)
  tail call void @_Z4initv()
  %3 = load i64, ptr @L, align 8, !tbaa !5
  %4 = icmp sgt i64 %3, 1
  br i1 %4, label %.preheader49, label %._crit_edge

.loopexit:                                        ; preds = %.lr.ph53, %.preheader
  %5 = icmp sgt i64 %13, %indvars.iv.next79
  %indvar.next68 = add nuw nsw i64 %indvar67, 1
  %indvars.iv.next74 = add nuw i32 %indvars.iv73, 1
  br i1 %5, label %.preheader49, label %._crit_edge, !llvm.loop !9

.preheader49:                                     ; preds = %0, %.loopexit
  %6 = phi i64 [ %13, %.loopexit ], [ %3, %0 ]
  %indvars.iv78 = phi i64 [ %indvars.iv.next79, %.loopexit ], [ 1, %0 ]
  %indvars.iv73 = phi i32 [ %indvars.iv.next74, %.loopexit ], [ 2, %0 ]
  %indvar67 = phi i64 [ %indvar.next68, %.loopexit ], [ 0, %0 ]
  %7 = sext i32 %indvars.iv73 to i64
  %8 = mul nuw i64 %indvar67, 40080
  %gep = getelementptr i8, ptr getelementptr inbounds (i8, ptr @DP2, i64 40080), i64 %8
  %9 = shl i64 %indvar67, 3
  %10 = add nuw i64 %9, 8
  %11 = icmp sgt i64 %6, 0
  br i1 %11, label %.lr.ph, label %.preheader

.lr.ph:                                           ; preds = %.preheader49
  %12 = add nsw i64 %indvars.iv78, -1
  br label %18

._crit_edge:                                      ; preds = %.loopexit, %0
  tail call void @_Z5flushv()
  ret i32 0

.preheader:                                       ; preds = %44, %.preheader49
  %13 = phi i64 [ %6, %.preheader49 ], [ %45, %44 ]
  %.lcssa = phi i64 [ %6, %.preheader49 ], [ %46, %44 ]
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1) %gep, i8 0, i64 %10, i1 false), !tbaa !5
  %14 = getelementptr inbounds [5010 x [5010 x i64]], ptr @DP, i64 0, i64 %indvars.iv78, i64 %indvars.iv78
  %15 = load i64, ptr %14, align 8, !tbaa !5
  %16 = getelementptr inbounds [5010 x [5010 x i64]], ptr @DP2, i64 0, i64 %indvars.iv78, i64 %indvars.iv78
  store i64 %15, ptr %16, align 8, !tbaa !5
  %indvars.iv.next79 = add nuw nsw i64 %indvars.iv78, 1
  %17 = icmp sgt i64 %.lcssa, %indvars.iv.next79
  br i1 %17, label %.lr.ph53, label %.loopexit

18:                                               ; preds = %.lr.ph, %44
  %19 = phi i64 [ %6, %.lr.ph ], [ %45, %44 ]
  %20 = phi i64 [ %6, %.lr.ph ], [ %46, %44 ]
  %indvars.iv64 = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next65, %44 ]
  %21 = getelementptr inbounds [5010 x [5010 x i64]], ptr @DP, i64 0, i64 %indvars.iv78, i64 %indvars.iv64
  store i64 0, ptr %21, align 8, !tbaa !5
  %22 = icmp ult i64 %indvars.iv64, %indvars.iv78
  br i1 %22, label %44, label %23

23:                                               ; preds = %18
  %24 = add nsw i64 %indvars.iv64, -1
  %25 = getelementptr inbounds [5010 x [5010 x i64]], ptr @DP2, i64 0, i64 %12, i64 %24
  %26 = load i64, ptr %25, align 8, !tbaa !5
  %27 = sub nsw i64 %indvars.iv64, %indvars.iv78
  %28 = trunc nsw i64 %27 to i32
  %29 = tail call noundef i64 @_Z5poweri(i32 noundef %28)
  %30 = mul nsw i64 %29, %26
  %31 = srem i64 %30, 1000000007
  %32 = load i64, ptr %21, align 8, !tbaa !5
  %33 = add nsw i64 %31, %32
  store i64 %33, ptr %21, align 8, !tbaa !5
  %34 = getelementptr inbounds [5010 x [5010 x i64]], ptr @DP, i64 0, i64 %12, i64 %indvars.iv64
  %35 = load i64, ptr %34, align 8, !tbaa !5
  %36 = trunc i64 %27 to i32
  %37 = add i32 %36, 1
  %38 = tail call noundef i64 @_Z6power2i(i32 noundef %37)
  %39 = mul nsw i64 %38, %35
  %40 = srem i64 %39, 1000000007
  %41 = load i64, ptr %21, align 8, !tbaa !5
  %42 = add nsw i64 %40, %41
  %43 = srem i64 %42, 1000000007
  store i64 %43, ptr %21, align 8, !tbaa !5
  %.pre = load i64, ptr @L, align 8, !tbaa !5
  br label %44

44:                                               ; preds = %18, %23
  %45 = phi i64 [ %19, %18 ], [ %.pre, %23 ]
  %46 = phi i64 [ %20, %18 ], [ %.pre, %23 ]
  %indvars.iv.next65 = add nuw nsw i64 %indvars.iv64, 1
  %47 = icmp sgt i64 %46, %indvars.iv.next65
  br i1 %47, label %18, label %.preheader, !llvm.loop !12

.lr.ph53:                                         ; preds = %.preheader, %.lr.ph53
  %indvars.iv75 = phi i64 [ %indvars.iv.next76, %.lr.ph53 ], [ %7, %.preheader ]
  %48 = phi i64 [ %indvars.iv.next76, %.lr.ph53 ], [ %indvars.iv.next79, %.preheader ]
  %49 = add nsw i64 %indvars.iv75, -1
  %50 = getelementptr inbounds [5010 x [5010 x i64]], ptr @DP2, i64 0, i64 %indvars.iv78, i64 %49
  %51 = load i64, ptr %50, align 8, !tbaa !5
  %52 = getelementptr inbounds [5010 x [5010 x i64]], ptr @DP, i64 0, i64 %indvars.iv78, i64 %48
  %53 = load i64, ptr %52, align 8, !tbaa !5
  %54 = add nsw i64 %53, %51
  %55 = getelementptr inbounds [5010 x [5010 x i64]], ptr @DP2, i64 0, i64 %indvars.iv78, i64 %48
  %56 = srem i64 %54, 1000000007
  store i64 %56, ptr %55, align 8, !tbaa !5
  %indvars.iv.next76 = add nuw nsw i64 %indvars.iv75, 1
  %57 = icmp sgt i64 %.lcssa, %indvars.iv.next76
  br i1 %57, label %.lr.ph53, label %.loopexit, !llvm.loop !13
}

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1 align 2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #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 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 = { 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 = { nocallback nofree nounwind willreturn memory(argmem: write) }

!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, !11}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.unswitch.partial.disable"}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopIdiomRecognizePass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SCCPPass,SROAPass,SimpleLoopUnswitchPass,SimplifyCFGPass,TailCallElimPass