; LLVM IR from kazunetakahashi/atcoder :: 201411_201509/1116_morning_medium (D)

; 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 }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@p = external dso_local global [1010 x i32], align 16
@l = external dso_local global [2020 x i32], align 16
@DP = external dso_local global [1010 x [2020 x i64]], align 16
@DPsum = external dso_local global [1010 x [2020 x i64]], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  %12 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %13

13:                                               ; preds = %32, %0
  %14 = load i32, ptr %3, align 4, !tbaa !5
  %15 = load i32, ptr %2, align 4, !tbaa !5
  %16 = icmp slt i32 %14, %15
  br i1 %16, label %18, label %17

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

18:                                               ; preds = %13
  %19 = load i32, ptr %3, align 4, !tbaa !5
  %20 = sext i32 %19 to i64
  %21 = getelementptr inbounds [1010 x i32], ptr @p, i64 0, i64 %20
  %22 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %21)
  %23 = load i32, ptr %3, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds [2020 x i32], ptr @l, i64 0, i64 %24
  %26 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %22, ptr noundef nonnull align 4 dereferenceable(4) %25)
  %27 = load i32, ptr %3, align 4, !tbaa !5
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [1010 x i32], ptr @p, i64 0, i64 %28
  %30 = load i32, ptr %29, align 4, !tbaa !5
  %31 = add nsw i32 %30, 1010
  store i32 %31, ptr %29, align 4, !tbaa !5
  br label %32

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

35:                                               ; preds = %17
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 0, ptr %4, align 4, !tbaa !5
  call void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef @DP, ptr noundef getelementptr inbounds (i64, ptr @DP, i64 2040200), ptr noundef nonnull align 4 dereferenceable(4) %4)
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  %36 = load i32, ptr @l, align 16, !tbaa !5
  %37 = mul nsw i32 -1, %36
  store i32 %37, ptr %5, align 4, !tbaa !5
  br label %38

38:                                               ; preds = %48, %35
  %39 = load i32, ptr %5, align 4, !tbaa !5
  %40 = load i32, ptr @l, align 16, !tbaa !5
  %41 = icmp sle i32 %39, %40
  br i1 %41, label %43, label %42

42:                                               ; preds = %38
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  br label %51

43:                                               ; preds = %38
  %44 = load i32, ptr %5, align 4, !tbaa !5
  %45 = add nsw i32 %44, 1010
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [2020 x i64], ptr @DP, i64 0, i64 %46
  store i64 1, ptr %47, align 8, !tbaa !11
  br label %48

48:                                               ; preds = %43
  %49 = load i32, ptr %5, align 4, !tbaa !5
  %50 = add nsw i32 %49, 1
  store i32 %50, ptr %5, align 4, !tbaa !5
  br label %38, !llvm.loop !13

51:                                               ; preds = %42
  %52 = load i64, ptr @DP, align 16, !tbaa !11
  store i64 %52, ptr @DPsum, align 16, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 1, ptr %6, align 4, !tbaa !5
  br label %53

53:                                               ; preds = %71, %51
  %54 = load i32, ptr %6, align 4, !tbaa !5
  %55 = icmp slt i32 %54, 2020
  br i1 %55, label %57, label %56

56:                                               ; preds = %53
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %74

57:                                               ; preds = %53
  %58 = load i32, ptr %6, align 4, !tbaa !5
  %59 = sub nsw i32 %58, 1
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [2020 x i64], ptr @DPsum, i64 0, i64 %60
  %62 = load i64, ptr %61, align 8, !tbaa !11
  %63 = load i32, ptr %6, align 4, !tbaa !5
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [2020 x i64], ptr @DP, i64 0, i64 %64
  %66 = load i64, ptr %65, align 8, !tbaa !11
  %67 = add nsw i64 %62, %66
  %68 = load i32, ptr %6, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [2020 x i64], ptr @DPsum, i64 0, i64 %69
  store i64 %67, ptr %70, align 8, !tbaa !11
  br label %71

71:                                               ; preds = %57
  %72 = load i32, ptr %6, align 4, !tbaa !5
  %73 = add nsw i32 %72, 1
  store i32 %73, ptr %6, align 4, !tbaa !5
  br label %53, !llvm.loop !14

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

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

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

80:                                               ; preds = %75
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  %81 = load i32, ptr %7, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [2020 x i32], ptr @l, i64 0, i64 %82
  %84 = load i32, ptr %83, align 4, !tbaa !5
  %85 = mul nsw i32 -1, %84
  store i32 %85, ptr %9, align 4, !tbaa !5
  br label %86

86:                                               ; preds = %129, %80
  %87 = load i32, ptr %9, align 4, !tbaa !5
  %88 = load i32, ptr %7, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [2020 x i32], ptr @l, i64 0, i64 %89
  %91 = load i32, ptr %90, align 4, !tbaa !5
  %92 = icmp sle i32 %87, %91
  br i1 %92, label %94, label %93

93:                                               ; preds = %86
  store i32 14, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %132

94:                                               ; preds = %86
  %95 = load i32, ptr %7, align 4, !tbaa !5
  %96 = sub nsw i32 %95, 1
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [1010 x [2020 x i64]], ptr @DPsum, i64 0, i64 %97
  %99 = load i32, ptr %7, align 4, !tbaa !5
  %100 = sub nsw i32 %99, 1
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [2020 x i32], ptr @l, i64 0, i64 %101
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  %103 = load i32, ptr %7, align 4, !tbaa !5
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [1010 x i32], ptr @p, i64 0, i64 %104
  %106 = load i32, ptr %105, align 4, !tbaa !5
  %107 = load i32, ptr %9, align 4, !tbaa !5
  %108 = add nsw i32 %106, %107
  %109 = load i32, ptr %7, align 4, !tbaa !5
  %110 = sub nsw i32 %109, 1
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [1010 x i32], ptr @p, i64 0, i64 %111
  %113 = load i32, ptr %112, align 4, !tbaa !5
  %114 = sub nsw i32 %108, %113
  %115 = sub nsw i32 %114, 1
  store i32 %115, ptr %10, align 4, !tbaa !5
  %116 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %102, ptr noundef nonnull align 4 dereferenceable(4) %10)
  %117 = load i32, ptr %116, align 4, !tbaa !5
  %118 = add nsw i32 %117, 1010
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [2020 x i64], ptr %98, i64 0, i64 %119
  %121 = load i64, ptr %120, align 8, !tbaa !11
  %122 = load i32, ptr %7, align 4, !tbaa !5
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds [1010 x [2020 x i64]], ptr @DP, i64 0, i64 %123
  %125 = load i32, ptr %9, align 4, !tbaa !5
  %126 = add nsw i32 %125, 1010
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds [2020 x i64], ptr %124, i64 0, i64 %127
  store i64 %121, ptr %128, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %129

129:                                              ; preds = %94
  %130 = load i32, ptr %9, align 4, !tbaa !5
  %131 = add nsw i32 %130, 1
  store i32 %131, ptr %9, align 4, !tbaa !5
  br label %86, !llvm.loop !15

132:                                              ; preds = %93
  %133 = load i32, ptr %7, align 4, !tbaa !5
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds [1010 x [2020 x i64]], ptr @DP, i64 0, i64 %134
  %136 = getelementptr inbounds [2020 x i64], ptr %135, i64 0, i64 0
  %137 = load i64, ptr %136, align 16, !tbaa !11
  %138 = load i32, ptr %7, align 4, !tbaa !5
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds [1010 x [2020 x i64]], ptr @DPsum, i64 0, i64 %139
  %141 = getelementptr inbounds [2020 x i64], ptr %140, i64 0, i64 0
  store i64 %137, ptr %141, align 16, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 1, ptr %11, align 4, !tbaa !5
  br label %142

142:                                              ; preds = %177, %132
  %143 = load i32, ptr %11, align 4, !tbaa !5
  %144 = icmp slt i32 %143, 2020
  br i1 %144, label %146, label %145

145:                                              ; preds = %142
  store i32 17, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %180

146:                                              ; preds = %142
  %147 = load i32, ptr %7, align 4, !tbaa !5
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds [1010 x [2020 x i64]], ptr @DPsum, i64 0, i64 %148
  %150 = load i32, ptr %11, align 4, !tbaa !5
  %151 = sub nsw i32 %150, 1
  %152 = sext i32 %151 to i64
  %153 = getelementptr inbounds [2020 x i64], ptr %149, i64 0, i64 %152
  %154 = load i64, ptr %153, align 8, !tbaa !11
  %155 = load i32, ptr %7, align 4, !tbaa !5
  %156 = sext i32 %155 to i64
  %157 = getelementptr inbounds [1010 x [2020 x i64]], ptr @DP, i64 0, i64 %156
  %158 = load i32, ptr %11, align 4, !tbaa !5
  %159 = sext i32 %158 to i64
  %160 = getelementptr inbounds [2020 x i64], ptr %157, i64 0, i64 %159
  %161 = load i64, ptr %160, align 8, !tbaa !11
  %162 = add nsw i64 %154, %161
  %163 = load i32, ptr %7, align 4, !tbaa !5
  %164 = sext i32 %163 to i64
  %165 = getelementptr inbounds [1010 x [2020 x i64]], ptr @DPsum, i64 0, i64 %164
  %166 = load i32, ptr %11, align 4, !tbaa !5
  %167 = sext i32 %166 to i64
  %168 = getelementptr inbounds [2020 x i64], ptr %165, i64 0, i64 %167
  store i64 %162, ptr %168, align 8, !tbaa !11
  %169 = load i32, ptr %7, align 4, !tbaa !5
  %170 = sext i32 %169 to i64
  %171 = getelementptr inbounds [1010 x [2020 x i64]], ptr @DPsum, i64 0, i64 %170
  %172 = load i32, ptr %11, align 4, !tbaa !5
  %173 = sext i32 %172 to i64
  %174 = getelementptr inbounds [2020 x i64], ptr %171, i64 0, i64 %173
  %175 = load i64, ptr %174, align 8, !tbaa !11
  %176 = srem i64 %175, 1000000007
  store i64 %176, ptr %174, align 8, !tbaa !11
  br label %177

177:                                              ; preds = %146
  %178 = load i32, ptr %11, align 4, !tbaa !5
  %179 = add nsw i32 %178, 1
  store i32 %179, ptr %11, align 4, !tbaa !5
  br label %142, !llvm.loop !16

180:                                              ; preds = %145
  br label %181

181:                                              ; preds = %180
  %182 = load i32, ptr %7, align 4, !tbaa !5
  %183 = add nsw i32 %182, 1
  store i32 %183, ptr %7, align 4, !tbaa !5
  br label %75, !llvm.loop !17

184:                                              ; preds = %79
  %185 = load i32, ptr %2, align 4, !tbaa !5
  %186 = sub nsw i32 %185, 1
  %187 = sext i32 %186 to i64
  %188 = getelementptr inbounds [1010 x [2020 x i64]], ptr @DPsum, i64 0, i64 %187
  %189 = getelementptr inbounds [2020 x i64], ptr %188, i64 0, i64 2019
  %190 = load i64, ptr %189, align 8, !tbaa !11
  %191 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %190)
  %192 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %191, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  %193 = load i32, ptr %1, align 4
  ret i32 %193
}

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 4 dereferenceable(4)) #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #4

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #5 align 2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #5 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #3

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 = { inlinehint 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 #4 = { inlinehint 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 #5 = { 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 #6 = { 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, i64 0}
!12 = !{!"long long", !7, i64 0}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !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"

%"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 }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@p = external dso_local global [1010 x i32], align 16
@l = external dso_local global [2020 x i32], align 16
@DP = external dso_local global [1010 x [2020 x i64]], align 16
@DPsum = external dso_local local_unnamed_addr global [1010 x [2020 x i64]], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  %4 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %5 = load i32, ptr %1, align 4, !tbaa !5
  %6 = icmp sgt i32 %5, 0
  br i1 %6, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %0
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  store i32 0, ptr %2, align 4, !tbaa !5
  call void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef nonnull @DP, ptr noundef nonnull getelementptr inbounds (i8, ptr @DP, i64 16321600), ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  %7 = load i32, ptr @l, align 16, !tbaa !5
  %.not47 = icmp slt i32 %7, 0
  br i1 %.not47, label %._crit_edge51, label %.lr.ph50.preheader

.lr.ph50.preheader:                               ; preds = %._crit_edge
  %8 = sub nsw i32 0, %7
  %9 = sext i32 %8 to i64
  %10 = add nuw i32 %7, 1
  %min.iters.check = icmp ult i32 %7, 2
  br i1 %min.iters.check, label %.lr.ph50.preheader84, label %vector.ph

.lr.ph50.preheader84:                             ; preds = %vector.body, %.lr.ph50.preheader
  %indvars.iv64.ph = phi i64 [ %9, %.lr.ph50.preheader ], [ %ind.end, %vector.body ]
  br label %.lr.ph50

vector.ph:                                        ; preds = %.lr.ph50.preheader
  %11 = shl nuw i32 %7, 1
  %12 = and i32 %11, -4
  %n.vec = zext i32 %12 to i64
  %ind.end = add nsw i64 %n.vec, %9
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %offset.idx = add i64 %index, %9
  %13 = add nsw i64 %offset.idx, 1010
  %14 = getelementptr inbounds [2020 x i64], ptr @DP, i64 0, i64 %13
  %15 = getelementptr inbounds i8, ptr %14, i64 16
  store <2 x i64> <i64 1, i64 1>, ptr %14, align 8, !tbaa !9
  store <2 x i64> <i64 1, i64 1>, ptr %15, align 8, !tbaa !9
  %index.next = add nuw i64 %index, 4
  %16 = icmp eq i64 %index.next, %n.vec
  br i1 %16, label %.lr.ph50.preheader84, label %vector.body, !llvm.loop !11

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %17 = getelementptr inbounds [1010 x i32], ptr @p, i64 0, i64 %indvars.iv
  %18 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %17)
  %19 = getelementptr inbounds [2020 x i32], ptr @l, i64 0, i64 %indvars.iv
  %20 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %18, ptr noundef nonnull align 4 dereferenceable(4) %19)
  %21 = load i32, ptr %17, align 4, !tbaa !5
  %22 = add nsw i32 %21, 1010
  store i32 %22, ptr %17, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %23 = load i32, ptr %1, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  %25 = icmp slt i64 %indvars.iv.next, %24
  br i1 %25, label %.lr.ph, label %._crit_edge, !llvm.loop !15

._crit_edge51:                                    ; preds = %.lr.ph50, %._crit_edge
  %26 = load i64, ptr @DP, align 16, !tbaa !9
  store i64 %26, ptr @DPsum, align 16, !tbaa !9
  br label %31

.lr.ph50:                                         ; preds = %.lr.ph50.preheader84, %.lr.ph50
  %indvars.iv64 = phi i64 [ %indvars.iv.next65, %.lr.ph50 ], [ %indvars.iv64.ph, %.lr.ph50.preheader84 ]
  %27 = add nsw i64 %indvars.iv64, 1010
  %28 = getelementptr inbounds [2020 x i64], ptr @DP, i64 0, i64 %27
  store i64 1, ptr %28, align 8, !tbaa !9
  %indvars.iv.next65 = add nsw i64 %indvars.iv64, 1
  %lftr.wideiv = trunc i64 %indvars.iv.next65 to i32
  %exitcond.not = icmp eq i32 %10, %lftr.wideiv
  br i1 %exitcond.not, label %._crit_edge51, label %.lr.ph50, !llvm.loop !16

.preheader:                                       ; preds = %31
  %29 = load i32, ptr %1, align 4, !tbaa !5
  %30 = icmp sgt i32 %29, 1
  br i1 %30, label %.lr.ph60, label %._crit_edge61

31:                                               ; preds = %31, %._crit_edge51
  %32 = phi i64 [ %26, %._crit_edge51 ], [ %43, %31 ]
  %indvars.iv67 = phi i64 [ 1, %._crit_edge51 ], [ %indvars.iv.next68.2, %31 ]
  %33 = getelementptr inbounds [2020 x i64], ptr @DP, i64 0, i64 %indvars.iv67
  %34 = load i64, ptr %33, align 8, !tbaa !9
  %35 = add nsw i64 %34, %32
  %36 = getelementptr inbounds [2020 x i64], ptr @DPsum, i64 0, i64 %indvars.iv67
  store i64 %35, ptr %36, align 8, !tbaa !9
  %indvars.iv.next68 = add nuw nsw i64 %indvars.iv67, 1
  %37 = getelementptr inbounds [2020 x i64], ptr @DP, i64 0, i64 %indvars.iv.next68
  %38 = load i64, ptr %37, align 8, !tbaa !9
  %39 = add nsw i64 %38, %35
  %40 = getelementptr inbounds [2020 x i64], ptr @DPsum, i64 0, i64 %indvars.iv.next68
  store i64 %39, ptr %40, align 8, !tbaa !9
  %indvars.iv.next68.1 = add nuw nsw i64 %indvars.iv67, 2
  %41 = getelementptr inbounds [2020 x i64], ptr @DP, i64 0, i64 %indvars.iv.next68.1
  %42 = load i64, ptr %41, align 8, !tbaa !9
  %43 = add nsw i64 %42, %39
  %44 = getelementptr inbounds [2020 x i64], ptr @DPsum, i64 0, i64 %indvars.iv.next68.1
  store i64 %43, ptr %44, align 8, !tbaa !9
  %indvars.iv.next68.2 = add nuw nsw i64 %indvars.iv67, 3
  %exitcond70.not.2 = icmp eq i64 %indvars.iv.next68.2, 2020
  br i1 %exitcond70.not.2, label %.preheader, label %31, !llvm.loop !17

._crit_edge61:                                    ; preds = %79, %.preheader
  %.lcssa = phi i32 [ %29, %.preheader ], [ %80, %79 ]
  %45 = add nsw i32 %.lcssa, -1
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [1010 x [2020 x i64]], ptr @DPsum, i64 0, i64 %46, i64 2019
  %48 = load i64, ptr %47, align 8, !tbaa !9
  %49 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %48)
  %50 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %49, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  ret i32 0

.lr.ph60:                                         ; preds = %.preheader, %79
  %indvars.iv78 = phi i64 [ %indvars.iv.next79, %79 ], [ 1, %.preheader ]
  %51 = getelementptr inbounds [2020 x i32], ptr @l, i64 0, i64 %indvars.iv78
  %52 = load i32, ptr %51, align 4, !tbaa !5
  %.not4553 = icmp slt i32 %52, 0
  br i1 %.not4553, label %._crit_edge57, label %.lr.ph56

.lr.ph56:                                         ; preds = %.lr.ph60
  %53 = sub nsw i32 0, %52
  %54 = add nsw i64 %indvars.iv78, -1
  %55 = getelementptr inbounds [2020 x i32], ptr @l, i64 0, i64 %54
  %56 = getelementptr inbounds [1010 x i32], ptr @p, i64 0, i64 %indvars.iv78
  %57 = getelementptr inbounds [1010 x i32], ptr @p, i64 0, i64 %54
  %58 = sext i32 %53 to i64
  br label %62

._crit_edge57:                                    ; preds = %62, %.lr.ph60
  %59 = getelementptr inbounds [1010 x [2020 x i64]], ptr @DP, i64 0, i64 %indvars.iv78
  %60 = load i64, ptr %59, align 16, !tbaa !9
  %61 = getelementptr inbounds [1010 x [2020 x i64]], ptr @DPsum, i64 0, i64 %indvars.iv78
  store i64 %60, ptr %61, align 16, !tbaa !9
  br label %83

62:                                               ; preds = %.lr.ph56, %62
  %indvars.iv71 = phi i64 [ %58, %.lr.ph56 ], [ %indvars.iv.next72, %62 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  %63 = load i32, ptr %56, align 4, !tbaa !5
  %64 = trunc nsw i64 %indvars.iv71 to i32
  %65 = add nsw i32 %63, %64
  %66 = load i32, ptr %57, align 4, !tbaa !5
  %67 = xor i32 %66, -1
  %68 = add i32 %65, %67
  store i32 %68, ptr %3, align 4, !tbaa !5
  %69 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %55, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %70 = load i32, ptr %69, align 4, !tbaa !5
  %71 = add nsw i32 %70, 1010
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [1010 x [2020 x i64]], ptr @DPsum, i64 0, i64 %54, i64 %72
  %74 = load i64, ptr %73, align 8, !tbaa !9
  %75 = add nsw i64 %indvars.iv71, 1010
  %76 = getelementptr inbounds [1010 x [2020 x i64]], ptr @DP, i64 0, i64 %indvars.iv78, i64 %75
  store i64 %74, ptr %76, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  %indvars.iv.next72 = add nsw i64 %indvars.iv71, 1
  %77 = load i32, ptr %51, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %.not45.not = icmp slt i64 %indvars.iv71, %78
  br i1 %.not45.not, label %62, label %._crit_edge57, !llvm.loop !18

79:                                               ; preds = %83
  %indvars.iv.next79 = add nuw nsw i64 %indvars.iv78, 1
  %80 = load i32, ptr %1, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = icmp slt i64 %indvars.iv.next79, %81
  br i1 %82, label %.lr.ph60, label %._crit_edge61, !llvm.loop !19

83:                                               ; preds = %90, %._crit_edge57
  %84 = phi i64 [ %60, %._crit_edge57 ], [ %95, %90 ]
  %indvars.iv74 = phi i64 [ 1, %._crit_edge57 ], [ %indvars.iv.next75.1, %90 ]
  %85 = getelementptr inbounds [1010 x [2020 x i64]], ptr @DP, i64 0, i64 %indvars.iv78, i64 %indvars.iv74
  %86 = load i64, ptr %85, align 8, !tbaa !9
  %87 = add nsw i64 %86, %84
  %88 = getelementptr inbounds [1010 x [2020 x i64]], ptr @DPsum, i64 0, i64 %indvars.iv78, i64 %indvars.iv74
  %89 = srem i64 %87, 1000000007
  store i64 %89, ptr %88, align 8, !tbaa !9
  %indvars.iv.next75 = add nuw nsw i64 %indvars.iv74, 1
  %exitcond77.not = icmp eq i64 %indvars.iv.next75, 2020
  br i1 %exitcond77.not, label %79, label %90, !llvm.loop !20

90:                                               ; preds = %83
  %91 = getelementptr inbounds [1010 x [2020 x i64]], ptr @DP, i64 0, i64 %indvars.iv78, i64 %indvars.iv.next75
  %92 = load i64, ptr %91, align 8, !tbaa !9
  %93 = add nsw i64 %92, %89
  %94 = getelementptr inbounds [1010 x [2020 x i64]], ptr @DPsum, i64 0, i64 %indvars.iv78, i64 %indvars.iv.next75
  %95 = srem i64 %93, 1000000007
  store i64 %95, ptr %94, align 8, !tbaa !9
  %indvars.iv.next75.1 = add nuw nsw i64 %indvars.iv74, 2
  br label %83
}

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) 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: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) local_unnamed_addr #5 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #3

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 = { mustprogress 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 = { inlinehint 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 #4 = { inlinehint 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 #5 = { 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 #6 = { 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, !13, !14}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!"llvm.loop.isvectorized", i32 1}
!14 = !{!"llvm.loop.unroll.runtime.disable"}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12, !14, !13}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}


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