; LLVM IR from kazunetakahashi/atcoder :: 2018/1125_code-thanks-festival-2018 (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 }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@T = external dso_local global i32, align 4
@a = external dso_local global [700 x i64], align 16
@DP = external dso_local global [700 x [1000 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 nounwind uwtable
declare dso_local noundef i64 @_Z3cntxx(i64 noundef, i64 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
  %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 i64, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %14 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @T)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  store i32 0, ptr %2, align 4, !tbaa !5
  call void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef @a, ptr noundef getelementptr inbounds (i64, ptr @a, i64 700), ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %15

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

19:                                               ; preds = %15
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  br label %28

20:                                               ; preds = %15
  %21 = load i32, ptr %3, align 4, !tbaa !5
  %22 = sext i32 %21 to i64
  %23 = getelementptr inbounds [700 x i64], ptr @a, i64 0, i64 %22
  %24 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %23)
  br label %25

25:                                               ; preds = %20
  %26 = load i32, ptr %3, align 4, !tbaa !5
  %27 = add nsw i32 %26, 1
  store i32 %27, ptr %3, align 4, !tbaa !5
  br label %15, !llvm.loop !9

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

29:                                               ; preds = %37, %28
  %30 = load i32, ptr %4, align 4, !tbaa !5
  %31 = icmp slt i32 %30, 1000
  br i1 %31, label %33, label %32

32:                                               ; preds = %29
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  br label %40

33:                                               ; preds = %29
  %34 = load i32, ptr %4, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [1000 x i64], ptr @DP, i64 0, i64 %35
  store i64 0, ptr %36, align 8, !tbaa !11
  br label %37

37:                                               ; preds = %33
  %38 = load i32, ptr %4, align 4, !tbaa !5
  %39 = add nsw i32 %38, 1
  store i32 %39, ptr %4, align 4, !tbaa !5
  br label %29, !llvm.loop !13

40:                                               ; preds = %32
  store i64 1, ptr @DP, align 16, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  store i32 1, ptr %5, align 4, !tbaa !5
  br label %41

41:                                               ; preds = %109, %40
  %42 = load i32, ptr %5, align 4, !tbaa !5
  %43 = load i32, ptr @T, align 4, !tbaa !5
  %44 = mul nsw i32 2, %43
  %45 = icmp sle i32 %42, %44
  br i1 %45, label %47, label %46

46:                                               ; preds = %41
  store i32 8, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  br label %112

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

48:                                               ; preds = %105, %47
  %49 = load i32, ptr %7, align 4, !tbaa !5
  %50 = icmp slt i32 %49, 1000
  br i1 %50, label %52, label %51

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

52:                                               ; preds = %48
  %53 = load i32, ptr %5, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [700 x [1000 x i64]], ptr @DP, i64 0, i64 %54
  %56 = load i32, ptr %7, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [1000 x i64], ptr %55, i64 0, i64 %57
  store i64 0, ptr %58, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %59

59:                                               ; preds = %101, %52
  %60 = load i32, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  %61 = load i32, ptr %7, align 4, !tbaa !5
  %62 = mul nsw i32 2, %61
  store i32 %62, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  store i32 999, ptr %10, align 4, !tbaa !5
  %63 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %9, ptr noundef nonnull align 4 dereferenceable(4) %10)
  %64 = load i32, ptr %63, align 4, !tbaa !5
  %65 = icmp sle i32 %60, %64
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br i1 %65, label %67, label %66

66:                                               ; preds = %59
  store i32 14, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  br label %104

67:                                               ; preds = %59
  %68 = load i32, ptr %5, align 4, !tbaa !5
  %69 = sub nsw i32 %68, 1
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [700 x [1000 x i64]], ptr @DP, i64 0, i64 %70
  %72 = load i32, ptr %8, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [1000 x i64], ptr %71, i64 0, i64 %73
  %75 = load i64, ptr %74, align 8, !tbaa !11
  %76 = load i32, ptr %5, align 4, !tbaa !5
  %77 = sext i32 %76 to i64
  %78 = load i32, ptr %7, align 4, !tbaa !5
  %79 = mul nsw i32 2, %78
  %80 = load i32, ptr %8, align 4, !tbaa !5
  %81 = sub nsw i32 %79, %80
  %82 = sext i32 %81 to i64
  %83 = call noundef i64 @_Z3cntxx(i64 noundef %77, i64 noundef %82)
  %84 = mul nsw i64 %75, %83
  %85 = load i32, ptr %5, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [700 x [1000 x i64]], ptr @DP, i64 0, i64 %86
  %88 = load i32, ptr %7, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [1000 x i64], ptr %87, i64 0, i64 %89
  %91 = load i64, ptr %90, align 8, !tbaa !11
  %92 = add nsw i64 %91, %84
  store i64 %92, ptr %90, align 8, !tbaa !11
  %93 = load i32, ptr %5, align 4, !tbaa !5
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [700 x [1000 x i64]], ptr @DP, i64 0, i64 %94
  %96 = load i32, ptr %7, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [1000 x i64], ptr %95, i64 0, i64 %97
  %99 = load i64, ptr %98, align 8, !tbaa !11
  %100 = srem i64 %99, 1000000007
  store i64 %100, ptr %98, align 8, !tbaa !11
  br label %101

101:                                              ; preds = %67
  %102 = load i32, ptr %8, align 4, !tbaa !5
  %103 = add nsw i32 %102, 1
  store i32 %103, ptr %8, align 4, !tbaa !5
  br label %59, !llvm.loop !14

104:                                              ; preds = %66
  br label %105

105:                                              ; preds = %104
  %106 = load i32, ptr %7, align 4, !tbaa !5
  %107 = add nsw i32 %106, 1
  store i32 %107, ptr %7, align 4, !tbaa !5
  br label %48, !llvm.loop !15

108:                                              ; preds = %51
  br label %109

109:                                              ; preds = %108
  %110 = load i32, ptr %5, align 4, !tbaa !5
  %111 = add nsw i32 %110, 1
  store i32 %111, ptr %5, align 4, !tbaa !5
  br label %41, !llvm.loop !16

112:                                              ; preds = %46
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  store i64 0, ptr %11, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  store i32 1, ptr %12, align 4, !tbaa !5
  br label %113

113:                                              ; preds = %129, %112
  %114 = load i32, ptr %12, align 4, !tbaa !5
  %115 = load i32, ptr @T, align 4, !tbaa !5
  %116 = mul nsw i32 2, %115
  %117 = icmp sle i32 %114, %116
  br i1 %117, label %119, label %118

118:                                              ; preds = %113
  store i32 17, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  br label %132

119:                                              ; preds = %113
  %120 = load i32, ptr %12, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [700 x i64], ptr @a, i64 0, i64 %121
  %123 = load i64, ptr %122, align 8, !tbaa !11
  %124 = icmp sgt i64 %123, 0
  br i1 %124, label %125, label %128

125:                                              ; preds = %119
  %126 = load i64, ptr %11, align 8, !tbaa !11
  %127 = add nsw i64 %126, 1
  store i64 %127, ptr %11, align 8, !tbaa !11
  br label %128

128:                                              ; preds = %125, %119
  br label %129

129:                                              ; preds = %128
  %130 = load i32, ptr %12, align 4, !tbaa !5
  %131 = add nsw i32 %130, 1
  store i32 %131, ptr %12, align 4, !tbaa !5
  br label %113, !llvm.loop !17

132:                                              ; preds = %118
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  store i32 1, ptr %13, align 4, !tbaa !5
  br label %133

133:                                              ; preds = %149, %132
  %134 = load i32, ptr %13, align 4, !tbaa !5
  %135 = load i32, ptr @T, align 4, !tbaa !5
  %136 = mul nsw i32 2, %135
  %137 = icmp sle i32 %134, %136
  br i1 %137, label %139, label %138

138:                                              ; preds = %133
  store i32 20, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  br label %152

139:                                              ; preds = %133
  %140 = load i32, ptr %13, align 4, !tbaa !5
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds [700 x [1000 x i64]], ptr @DP, i64 0, i64 %141
  %143 = getelementptr inbounds [1000 x i64], ptr %142, i64 0, i64 1
  %144 = load i64, ptr %143, align 8, !tbaa !11
  %145 = load i64, ptr %11, align 8, !tbaa !11
  %146 = add nsw i64 %145, %144
  store i64 %146, ptr %11, align 8, !tbaa !11
  %147 = load i64, ptr %11, align 8, !tbaa !11
  %148 = srem i64 %147, 1000000007
  store i64 %148, ptr %11, align 8, !tbaa !11
  br label %149

149:                                              ; preds = %139
  %150 = load i32, ptr %13, align 4, !tbaa !5
  %151 = add nsw i32 %150, 1
  store i32 %151, ptr %13, align 4, !tbaa !5
  br label %133, !llvm.loop !18

152:                                              ; preds = %138
  %153 = load i64, ptr %11, align 8, !tbaa !11
  %154 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %153)
  %155 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %154, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  %156 = load i32, ptr %1, align 4
  ret i32 %156
}

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

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

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

; 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)) #5 align 2

; 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)) #6

; 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 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 = { 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #7 = { 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}
!18 = distinct !{!18, !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" }

@T = external dso_local global i32, align 4
@a = external dso_local global [700 x i64], align 16
@DP = external dso_local local_unnamed_addr global [700 x [1000 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 nounwind uwtable
declare dso_local noundef i64 @_Z3cntxx(i64 noundef, i64 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @T)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #9
  store i32 0, ptr %1, align 4, !tbaa !5
  call void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef nonnull @a, ptr noundef nonnull getelementptr inbounds (i8, ptr @a, i64 5600), ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #9
  %5 = load i32, ptr @T, align 4, !tbaa !5
  %.not49 = icmp slt i32 %5, 1
  br i1 %.not49, label %.preheader48.thread, label %.lr.ph

.preheader48.thread:                              ; preds = %0
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(8000) @DP, i8 0, i64 8000, i1 false), !tbaa !9
  store i64 1, ptr @DP, align 16, !tbaa !9
  %6 = shl nsw i32 %5, 1
  br label %.preheader46

.preheader48:                                     ; preds = %.lr.ph
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(8000) @DP, i8 0, i64 8000, i1 false), !tbaa !9
  store i64 1, ptr @DP, align 16, !tbaa !9
  %7 = shl nsw i32 %10, 1
  %.not4256 = icmp slt i32 %10, 1
  br i1 %.not4256, label %.preheader46, label %.preheader47

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %0 ]
  %8 = getelementptr inbounds [700 x i64], ptr @a, i64 0, i64 %indvars.iv
  %9 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %8)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %10 = load i32, ptr @T, align 4, !tbaa !5
  %11 = sext i32 %10 to i64
  %.not.not = icmp slt i64 %indvars.iv, %11
  br i1 %.not.not, label %.lr.ph, label %.preheader48, !llvm.loop !11

.preheader47:                                     ; preds = %.preheader48, %25
  %indvars.iv81 = phi i64 [ %indvars.iv.next82, %25 ], [ 1, %.preheader48 ]
  %12 = add nsw i64 %indvars.iv81, -1
  br label %29

.preheader46:                                     ; preds = %25, %.preheader48.thread, %.preheader48
  %.lcssa = phi i32 [ %7, %.preheader48 ], [ %6, %.preheader48.thread ], [ %27, %25 ]
  %.not4358 = icmp slt i32 %.lcssa, 1
  br i1 %.not4358, label %._crit_edge67, label %.lr.ph61.preheader

.lr.ph61.preheader:                               ; preds = %.preheader46
  %13 = or disjoint i32 %.lcssa, 1
  %wide.trip.count = zext nneg i32 %13 to i64
  %14 = zext nneg i32 %.lcssa to i64
  %min.iters.check = icmp ult i32 %.lcssa, 4
  br i1 %min.iters.check, label %.lr.ph61.preheader104, label %vector.ph

.lr.ph61.preheader104:                            ; preds = %middle.block, %.lr.ph61.preheader
  %indvars.iv84.ph = phi i64 [ 1, %.lr.ph61.preheader ], [ %ind.end, %middle.block ]
  %.03659.ph = phi i64 [ 0, %.lr.ph61.preheader ], [ %24, %middle.block ]
  br label %.lr.ph61

vector.ph:                                        ; preds = %.lr.ph61.preheader
  %n.vec = and i64 %14, 2147483644
  %ind.end = or disjoint i64 %n.vec, 1
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.phi = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %21, %vector.body ]
  %vec.phi101 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %22, %vector.body ]
  %offset.idx = or disjoint i64 %index, 1
  %15 = getelementptr inbounds [700 x i64], ptr @a, i64 0, i64 %offset.idx
  %16 = getelementptr inbounds i8, ptr %15, i64 16
  %wide.load = load <2 x i64>, ptr %15, align 8, !tbaa !9
  %wide.load102 = load <2 x i64>, ptr %16, align 8, !tbaa !9
  %17 = icmp sgt <2 x i64> %wide.load, zeroinitializer
  %18 = icmp sgt <2 x i64> %wide.load102, zeroinitializer
  %19 = zext <2 x i1> %17 to <2 x i64>
  %20 = zext <2 x i1> %18 to <2 x i64>
  %21 = add <2 x i64> %vec.phi, %19
  %22 = add <2 x i64> %vec.phi101, %20
  %index.next = add nuw i64 %index, 4
  %23 = icmp eq i64 %index.next, %n.vec
  br i1 %23, label %middle.block, label %vector.body, !llvm.loop !13

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <2 x i64> %22, %21
  %24 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx)
  %cmp.n = icmp eq i64 %n.vec, %14
  br i1 %cmp.n, label %.preheader, label %.lr.ph61.preheader104

25:                                               ; preds = %._crit_edge
  %indvars.iv.next82 = add nuw nsw i64 %indvars.iv81, 1
  %26 = load i32, ptr @T, align 4, !tbaa !5
  %27 = shl nsw i32 %26, 1
  %28 = sext i32 %27 to i64
  %.not42.not = icmp slt i64 %indvars.iv81, %28
  br i1 %.not42.not, label %.preheader47, label %.preheader46, !llvm.loop !16

29:                                               ; preds = %.preheader47, %._crit_edge
  %indvars.iv78 = phi i64 [ 0, %.preheader47 ], [ %indvars.iv.next79, %._crit_edge ]
  %30 = getelementptr inbounds [700 x [1000 x i64]], ptr @DP, i64 0, i64 %indvars.iv81, i64 %indvars.iv78
  store i64 0, ptr %30, align 8, !tbaa !9
  %31 = shl nuw nsw i64 %indvars.iv78, 1
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #9
  %32 = trunc nuw nsw i64 %31 to i32
  store i32 %32, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #9
  store i32 999, ptr %3, align 4, !tbaa !5
  %33 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %34 = load i32, ptr %33, align 4, !tbaa !5
  %.not4552 = icmp slt i32 %34, 0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #9
  br i1 %.not4552, label %._crit_edge, label %.lr.ph54

._crit_edge:                                      ; preds = %.lr.ph54, %29
  %indvars.iv.next79 = add nuw nsw i64 %indvars.iv78, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next79, 1000
  br i1 %exitcond.not, label %25, label %29, !llvm.loop !17

.lr.ph54:                                         ; preds = %29, %.lr.ph54
  %indvars.iv75 = phi i64 [ %indvars.iv.next76, %.lr.ph54 ], [ 0, %29 ]
  %35 = getelementptr inbounds [700 x [1000 x i64]], ptr @DP, i64 0, i64 %12, i64 %indvars.iv75
  %36 = load i64, ptr %35, align 8, !tbaa !9
  %37 = sub nsw i64 %31, %indvars.iv75
  %38 = call noundef i64 @_Z3cntxx(i64 noundef %indvars.iv81, i64 noundef %37)
  %39 = mul nsw i64 %38, %36
  %40 = load i64, ptr %30, align 8, !tbaa !9
  %41 = add nsw i64 %40, %39
  %42 = srem i64 %41, 1000000007
  store i64 %42, ptr %30, align 8, !tbaa !9
  %indvars.iv.next76 = add nuw nsw i64 %indvars.iv75, 1
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #9
  store i32 %32, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #9
  store i32 999, ptr %3, align 4, !tbaa !5
  %43 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %44 = load i32, ptr %43, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %.not45.not = icmp slt i64 %indvars.iv75, %45
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #9
  br i1 %.not45.not, label %.lr.ph54, label %._crit_edge, !llvm.loop !18

.preheader:                                       ; preds = %.lr.ph61, %middle.block
  %spec.select.lcssa = phi i64 [ %24, %middle.block ], [ %spec.select, %.lr.ph61 ]
  br i1 %.not4358, label %._crit_edge67, label %.lr.ph66

.lr.ph61:                                         ; preds = %.lr.ph61.preheader104, %.lr.ph61
  %indvars.iv84 = phi i64 [ %indvars.iv.next85, %.lr.ph61 ], [ %indvars.iv84.ph, %.lr.ph61.preheader104 ]
  %.03659 = phi i64 [ %spec.select, %.lr.ph61 ], [ %.03659.ph, %.lr.ph61.preheader104 ]
  %46 = getelementptr inbounds [700 x i64], ptr @a, i64 0, i64 %indvars.iv84
  %47 = load i64, ptr %46, align 8, !tbaa !9
  %48 = icmp sgt i64 %47, 0
  %49 = zext i1 %48 to i64
  %spec.select = add nuw nsw i64 %.03659, %49
  %indvars.iv.next85 = add nuw nsw i64 %indvars.iv84, 1
  %exitcond87.not = icmp eq i64 %indvars.iv.next85, %wide.trip.count
  br i1 %exitcond87.not, label %.preheader, label %.lr.ph61, !llvm.loop !19

._crit_edge67:                                    ; preds = %.lr.ph66, %.preheader46, %.preheader
  %.2.lcssa = phi i64 [ %spec.select.lcssa, %.preheader ], [ 0, %.preheader46 ], [ %59, %.lr.ph66 ]
  %50 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %.2.lcssa)
  %51 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %50, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  ret i32 0

.lr.ph66:                                         ; preds = %.preheader, %.lr.ph66
  %indvars.iv88 = phi i64 [ %indvars.iv.next89.1, %.lr.ph66 ], [ 1, %.preheader ]
  %.264 = phi i64 [ %59, %.lr.ph66 ], [ %spec.select.lcssa, %.preheader ]
  %niter = phi i64 [ %niter.next.1, %.lr.ph66 ], [ 0, %.preheader ]
  %52 = getelementptr inbounds [700 x [1000 x i64]], ptr @DP, i64 0, i64 %indvars.iv88, i64 1
  %53 = load i64, ptr %52, align 8, !tbaa !9
  %54 = add nsw i64 %53, %.264
  %55 = srem i64 %54, 1000000007
  %indvars.iv.next89 = add nuw nsw i64 %indvars.iv88, 1
  %56 = getelementptr inbounds [700 x [1000 x i64]], ptr @DP, i64 0, i64 %indvars.iv.next89, i64 1
  %57 = load i64, ptr %56, align 8, !tbaa !9
  %58 = add nsw i64 %57, %55
  %59 = srem i64 %58, 1000000007
  %indvars.iv.next89.1 = add nuw nsw i64 %indvars.iv88, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %14
  br i1 %niter.ncmp.1, label %._crit_edge67, label %.lr.ph66, !llvm.loop !20
}

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

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

; 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 #5 align 2

; 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 #6

; 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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #7

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #8

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 = { 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #7 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #8 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #9 = { 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, !15}
!14 = !{!"llvm.loop.isvectorized", i32 1}
!15 = !{!"llvm.loop.unroll.runtime.disable"}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12, !15, !14}
!20 = distinct !{!20, !12}


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