; LLVM IR from eyangch/competitive-programming :: Codeforces/1542 (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" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@MOD = external dso_local global i64, align 8
@N = external dso_local global i64, align 8
@a = external dso_local global [500 x i64], align 16
@dp = external dso_local global [500 x [2000 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 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca i8, align 1
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i32, align 4
  %8 = alloca %"class.std::vector", align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca i64, align 8
  %17 = alloca i64, align 8
  %18 = alloca i64, align 8
  %19 = alloca i64, align 8
  %20 = alloca i64, align 8
  %21 = alloca i64, align 8
  %22 = alloca i64, align 8
  %23 = alloca i64, align 8
  %24 = alloca i64, align 8
  %25 = alloca i64, align 8
  %26 = alloca i64, align 8
  %27 = alloca i64, align 8
  %28 = alloca i64, align 8
  %29 = alloca i64, align 8
  %30 = alloca i64, align 8
  %31 = alloca i64, align 8
  %32 = alloca i64, align 8
  %33 = alloca i64, align 8
  %34 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %35 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %36 = getelementptr i8, ptr %35, i64 -24
  %37 = load i64, ptr %36, align 8
  %38 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %37
  %39 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %38, ptr noundef null)
  %40 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %41 = 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)
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #7
  store i64 0, ptr %2, align 8, !tbaa !8
  br label %42

42:                                               ; preds = %61, %0
  %43 = load i64, ptr %2, align 8, !tbaa !8
  %44 = load i64, ptr @N, align 8, !tbaa !8
  %45 = icmp slt i64 %43, %44
  br i1 %45, label %47, label %46

46:                                               ; preds = %42
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #7
  br label %64

47:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 1, ptr %3) #7
  %48 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 1 dereferenceable(1) %3)
  %49 = load i8, ptr %3, align 1, !tbaa !11
  %50 = sext i8 %49 to i32
  %51 = icmp eq i32 %50, 45
  br i1 %51, label %52, label %55

52:                                               ; preds = %47
  %53 = load i64, ptr %2, align 8, !tbaa !8
  %54 = getelementptr inbounds [500 x i64], ptr @a, i64 0, i64 %53
  store i64 -1, ptr %54, align 8, !tbaa !8
  br label %60

55:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #7
  %56 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %57 = load i64, ptr %4, align 8, !tbaa !8
  %58 = load i64, ptr %2, align 8, !tbaa !8
  %59 = getelementptr inbounds [500 x i64], ptr @a, i64 0, i64 %58
  store i64 %57, ptr %59, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #7
  br label %60

60:                                               ; preds = %55, %52
  call void @llvm.lifetime.end.p0(i64 1, ptr %3) #7
  br label %61

61:                                               ; preds = %60
  %62 = load i64, ptr %2, align 8, !tbaa !8
  %63 = add nsw i64 %62, 1
  store i64 %63, ptr %2, align 8, !tbaa !8
  br label %42, !llvm.loop !12

64:                                               ; preds = %46
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #7
  store i64 0, ptr %5, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  store i64 0, ptr %6, align 8, !tbaa !8
  br label %65

65:                                               ; preds = %397, %64
  %66 = load i64, ptr %6, align 8, !tbaa !8
  %67 = load i64, ptr @N, align 8, !tbaa !8
  %68 = icmp slt i64 %66, %67
  br i1 %68, label %70, label %69

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

70:                                               ; preds = %65
  %71 = load i64, ptr %6, align 8, !tbaa !8
  %72 = getelementptr inbounds [500 x i64], ptr @a, i64 0, i64 %71
  %73 = load i64, ptr %72, align 8, !tbaa !8
  %74 = icmp eq i64 %73, -1
  br i1 %74, label %75, label %76

75:                                               ; preds = %70
  br label %397

76:                                               ; preds = %70
  call void @llvm.lifetime.start.p0(i64 24, ptr %8) #7
  call void @_ZNSt6vectorIxSaIxEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  store i64 0, ptr %9, align 8, !tbaa !8
  br label %77

77:                                               ; preds = %152, %76
  %78 = load i64, ptr %9, align 8, !tbaa !8
  %79 = load i64, ptr @N, align 8, !tbaa !8
  %80 = icmp slt i64 %78, %79
  br i1 %80, label %82, label %81

81:                                               ; preds = %77
  store i32 8, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  br label %156

82:                                               ; preds = %77
  %83 = load i64, ptr %9, align 8, !tbaa !8
  %84 = getelementptr inbounds [500 x i64], ptr @a, i64 0, i64 %83
  %85 = load i64, ptr %84, align 8, !tbaa !8
  %86 = icmp eq i64 %85, -1
  br i1 %86, label %87, label %93

87:                                               ; preds = %82
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  store i64 -1, ptr %10, align 8, !tbaa !8
  invoke void @_ZNSt6vectorIxSaIxEE9push_backEOx(ptr noundef nonnull align 8 dereferenceable(24) %8, ptr noundef nonnull align 8 dereferenceable(8) %10)
          to label %88 unwind label %89

88:                                               ; preds = %87
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  br label %151

89:                                               ; preds = %87
  %90 = landingpad { ptr, i32 }
          cleanup
  %91 = extractvalue { ptr, i32 } %90, 0
  store ptr %91, ptr %11, align 8
  %92 = extractvalue { ptr, i32 } %90, 1
  store i32 %92, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  br label %155

93:                                               ; preds = %82
  %94 = load i64, ptr %9, align 8, !tbaa !8
  %95 = getelementptr inbounds [500 x i64], ptr @a, i64 0, i64 %94
  %96 = load i64, ptr %95, align 8, !tbaa !8
  %97 = load i64, ptr %6, align 8, !tbaa !8
  %98 = getelementptr inbounds [500 x i64], ptr @a, i64 0, i64 %97
  %99 = load i64, ptr %98, align 8, !tbaa !8
  %100 = icmp slt i64 %96, %99
  br i1 %100, label %101, label %107

101:                                              ; preds = %93
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  store i64 1, ptr %13, align 8, !tbaa !8
  invoke void @_ZNSt6vectorIxSaIxEE9push_backEOx(ptr noundef nonnull align 8 dereferenceable(24) %8, ptr noundef nonnull align 8 dereferenceable(8) %13)
          to label %102 unwind label %103

102:                                              ; preds = %101
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  br label %150

103:                                              ; preds = %101
  %104 = landingpad { ptr, i32 }
          cleanup
  %105 = extractvalue { ptr, i32 } %104, 0
  store ptr %105, ptr %11, align 8
  %106 = extractvalue { ptr, i32 } %104, 1
  store i32 %106, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  br label %155

107:                                              ; preds = %93
  %108 = load i64, ptr %9, align 8, !tbaa !8
  %109 = getelementptr inbounds [500 x i64], ptr @a, i64 0, i64 %108
  %110 = load i64, ptr %109, align 8, !tbaa !8
  %111 = load i64, ptr %6, align 8, !tbaa !8
  %112 = getelementptr inbounds [500 x i64], ptr @a, i64 0, i64 %111
  %113 = load i64, ptr %112, align 8, !tbaa !8
  %114 = icmp sgt i64 %110, %113
  br i1 %114, label %115, label %121

115:                                              ; preds = %107
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  store i64 0, ptr %14, align 8, !tbaa !8
  invoke void @_ZNSt6vectorIxSaIxEE9push_backEOx(ptr noundef nonnull align 8 dereferenceable(24) %8, ptr noundef nonnull align 8 dereferenceable(8) %14)
          to label %116 unwind label %117

116:                                              ; preds = %115
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  br label %149

117:                                              ; preds = %115
  %118 = landingpad { ptr, i32 }
          cleanup
  %119 = extractvalue { ptr, i32 } %118, 0
  store ptr %119, ptr %11, align 8
  %120 = extractvalue { ptr, i32 } %118, 1
  store i32 %120, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  br label %155

121:                                              ; preds = %107
  %122 = load i64, ptr %9, align 8, !tbaa !8
  %123 = load i64, ptr %6, align 8, !tbaa !8
  %124 = icmp slt i64 %122, %123
  br i1 %124, label %125, label %131

125:                                              ; preds = %121
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  store i64 1, ptr %15, align 8, !tbaa !8
  invoke void @_ZNSt6vectorIxSaIxEE9push_backEOx(ptr noundef nonnull align 8 dereferenceable(24) %8, ptr noundef nonnull align 8 dereferenceable(8) %15)
          to label %126 unwind label %127

126:                                              ; preds = %125
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  br label %148

127:                                              ; preds = %125
  %128 = landingpad { ptr, i32 }
          cleanup
  %129 = extractvalue { ptr, i32 } %128, 0
  store ptr %129, ptr %11, align 8
  %130 = extractvalue { ptr, i32 } %128, 1
  store i32 %130, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  br label %155

131:                                              ; preds = %121
  %132 = load i64, ptr %9, align 8, !tbaa !8
  %133 = load i64, ptr %6, align 8, !tbaa !8
  %134 = icmp sgt i64 %132, %133
  br i1 %134, label %135, label %141

135:                                              ; preds = %131
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  store i64 0, ptr %16, align 8, !tbaa !8
  invoke void @_ZNSt6vectorIxSaIxEE9push_backEOx(ptr noundef nonnull align 8 dereferenceable(24) %8, ptr noundef nonnull align 8 dereferenceable(8) %16)
          to label %136 unwind label %137

136:                                              ; preds = %135
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  br label %147

137:                                              ; preds = %135
  %138 = landingpad { ptr, i32 }
          cleanup
  %139 = extractvalue { ptr, i32 } %138, 0
  store ptr %139, ptr %11, align 8
  %140 = extractvalue { ptr, i32 } %138, 1
  store i32 %140, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  br label %155

141:                                              ; preds = %131
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  store i64 0, ptr %17, align 8, !tbaa !8
  invoke void @_ZNSt6vectorIxSaIxEE9push_backEOx(ptr noundef nonnull align 8 dereferenceable(24) %8, ptr noundef nonnull align 8 dereferenceable(8) %17)
          to label %142 unwind label %143

142:                                              ; preds = %141
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  br label %147

143:                                              ; preds = %141
  %144 = landingpad { ptr, i32 }
          cleanup
  %145 = extractvalue { ptr, i32 } %144, 0
  store ptr %145, ptr %11, align 8
  %146 = extractvalue { ptr, i32 } %144, 1
  store i32 %146, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  br label %155

147:                                              ; preds = %142, %136
  br label %148

148:                                              ; preds = %147, %126
  br label %149

149:                                              ; preds = %148, %116
  br label %150

150:                                              ; preds = %149, %102
  br label %151

151:                                              ; preds = %150, %88
  br label %152

152:                                              ; preds = %151
  %153 = load i64, ptr %9, align 8, !tbaa !8
  %154 = add nsw i64 %153, 1
  store i64 %154, ptr %9, align 8, !tbaa !8
  br label %77, !llvm.loop !14

155:                                              ; preds = %143, %137, %127, %117, %103, %89
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  br label %401

156:                                              ; preds = %81
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  store i64 0, ptr %18, align 8, !tbaa !8
  %157 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef 0) #7
  %158 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %18, ptr noundef nonnull align 8 dereferenceable(8) %157)
          to label %159 unwind label %176

159:                                              ; preds = %156
  %160 = load i64, ptr %158, align 8, !tbaa !8
  %161 = add nsw i64 1000, %160
  %162 = getelementptr inbounds [2000 x i64], ptr @dp, i64 0, i64 %161
  store i64 0, ptr %162, align 8, !tbaa !8
  store i64 0, ptr getelementptr inbounds ([2000 x i64], ptr @dp, i64 0, i64 1000), align 16, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  %163 = load i64, ptr %6, align 8, !tbaa !8
  %164 = icmp ne i64 %163, 0
  br i1 %164, label %165, label %184

165:                                              ; preds = %159
  %166 = load i64, ptr getelementptr inbounds ([2000 x i64], ptr @dp, i64 0, i64 1000), align 16, !tbaa !8
  %167 = add nsw i64 %166, 1
  store i64 %167, ptr getelementptr inbounds ([2000 x i64], ptr @dp, i64 0, i64 1000), align 16, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #7
  store i64 0, ptr %19, align 8, !tbaa !8
  %168 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef 0) #7
  %169 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %19, ptr noundef nonnull align 8 dereferenceable(8) %168)
          to label %170 unwind label %180

170:                                              ; preds = %165
  %171 = load i64, ptr %169, align 8, !tbaa !8
  %172 = add nsw i64 1000, %171
  %173 = getelementptr inbounds [2000 x i64], ptr @dp, i64 0, i64 %172
  %174 = load i64, ptr %173, align 8, !tbaa !8
  %175 = add nsw i64 %174, 1
  store i64 %175, ptr %173, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  br label %185

176:                                              ; preds = %156
  %177 = landingpad { ptr, i32 }
          cleanup
  %178 = extractvalue { ptr, i32 } %177, 0
  store ptr %178, ptr %11, align 8
  %179 = extractvalue { ptr, i32 } %177, 1
  store i32 %179, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  br label %401

180:                                              ; preds = %165
  %181 = landingpad { ptr, i32 }
          cleanup
  %182 = extractvalue { ptr, i32 } %181, 0
  store ptr %182, ptr %11, align 8
  %183 = extractvalue { ptr, i32 } %181, 1
  store i32 %183, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  br label %401

184:                                              ; preds = %159
  store i64 1, ptr getelementptr inbounds ([2000 x i64], ptr @dp, i64 0, i64 1000), align 16, !tbaa !8
  br label %185

185:                                              ; preds = %184, %170
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #7
  store i64 1000, ptr %20, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #7
  store i64 1000, ptr %22, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #7
  %186 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef 0) #7
  %187 = load i64, ptr %186, align 8, !tbaa !8
  %188 = add nsw i64 1000, %187
  store i64 %188, ptr %23, align 8, !tbaa !8
  %189 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %22, ptr noundef nonnull align 8 dereferenceable(8) %23)
          to label %190 unwind label %197

190:                                              ; preds = %185
  %191 = load i64, ptr %189, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  store i64 %191, ptr %21, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #7
  store i64 1, ptr %24, align 8, !tbaa !8
  br label %192

192:                                              ; preds = %368, %190
  %193 = load i64, ptr %24, align 8, !tbaa !8
  %194 = load i64, ptr @N, align 8, !tbaa !8
  %195 = icmp slt i64 %193, %194
  br i1 %195, label %201, label %196

196:                                              ; preds = %192
  store i32 11, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #7
  br label %371

197:                                              ; preds = %185
  %198 = landingpad { ptr, i32 }
          cleanup
  %199 = extractvalue { ptr, i32 } %198, 0
  store ptr %199, ptr %11, align 8
  %200 = extractvalue { ptr, i32 } %198, 1
  store i32 %200, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  br label %400

201:                                              ; preds = %192
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #7
  %202 = load i64, ptr %20, align 8, !tbaa !8
  store i64 %202, ptr %25, align 8, !tbaa !8
  br label %203

203:                                              ; preds = %221, %201
  %204 = load i64, ptr %25, align 8, !tbaa !8
  %205 = load i64, ptr %21, align 8, !tbaa !8
  %206 = icmp sle i64 %204, %205
  br i1 %206, label %208, label %207

207:                                              ; preds = %203
  store i32 14, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #7
  br label %224

208:                                              ; preds = %203
  %209 = load i64, ptr %24, align 8, !tbaa !8
  %210 = getelementptr inbounds [500 x [2000 x i64]], ptr @dp, i64 0, i64 %209
  %211 = load i64, ptr %25, align 8, !tbaa !8
  %212 = load i64, ptr %24, align 8, !tbaa !8
  %213 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %212) #7
  %214 = load i64, ptr %213, align 8, !tbaa !8
  %215 = add nsw i64 %211, %214
  %216 = getelementptr inbounds [2000 x i64], ptr %210, i64 0, i64 %215
  store i64 0, ptr %216, align 8, !tbaa !8
  %217 = load i64, ptr %24, align 8, !tbaa !8
  %218 = getelementptr inbounds [500 x [2000 x i64]], ptr @dp, i64 0, i64 %217
  %219 = load i64, ptr %25, align 8, !tbaa !8
  %220 = getelementptr inbounds [2000 x i64], ptr %218, i64 0, i64 %219
  store i64 0, ptr %220, align 8, !tbaa !8
  br label %221

221:                                              ; preds = %208
  %222 = load i64, ptr %25, align 8, !tbaa !8
  %223 = add nsw i64 %222, 1
  store i64 %223, ptr %25, align 8, !tbaa !8
  br label %203, !llvm.loop !15

224:                                              ; preds = %207
  %225 = load i64, ptr %24, align 8, !tbaa !8
  %226 = load i64, ptr %6, align 8, !tbaa !8
  %227 = icmp eq i64 %225, %226
  br i1 %227, label %228, label %250

228:                                              ; preds = %224
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #7
  %229 = load i64, ptr %20, align 8, !tbaa !8
  store i64 %229, ptr %26, align 8, !tbaa !8
  br label %230

230:                                              ; preds = %246, %228
  %231 = load i64, ptr %26, align 8, !tbaa !8
  %232 = load i64, ptr %21, align 8, !tbaa !8
  %233 = icmp sle i64 %231, %232
  br i1 %233, label %235, label %234

234:                                              ; preds = %230
  store i32 17, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #7
  br label %249

235:                                              ; preds = %230
  %236 = load i64, ptr %24, align 8, !tbaa !8
  %237 = sub nsw i64 %236, 1
  %238 = getelementptr inbounds [500 x [2000 x i64]], ptr @dp, i64 0, i64 %237
  %239 = load i64, ptr %26, align 8, !tbaa !8
  %240 = getelementptr inbounds [2000 x i64], ptr %238, i64 0, i64 %239
  %241 = load i64, ptr %240, align 8, !tbaa !8
  %242 = load i64, ptr %24, align 8, !tbaa !8
  %243 = getelementptr inbounds [500 x [2000 x i64]], ptr @dp, i64 0, i64 %242
  %244 = load i64, ptr %26, align 8, !tbaa !8
  %245 = getelementptr inbounds [2000 x i64], ptr %243, i64 0, i64 %244
  store i64 %241, ptr %245, align 8, !tbaa !8
  br label %246

246:                                              ; preds = %235
  %247 = load i64, ptr %26, align 8, !tbaa !8
  %248 = add nsw i64 %247, 1
  store i64 %248, ptr %26, align 8, !tbaa !8
  br label %230, !llvm.loop !16

249:                                              ; preds = %234
  br label %368

250:                                              ; preds = %224
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #7
  %251 = load i64, ptr %20, align 8, !tbaa !8
  store i64 %251, ptr %27, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #7
  %252 = load i64, ptr %21, align 8, !tbaa !8
  store i64 %252, ptr %28, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #7
  %253 = load i64, ptr %20, align 8, !tbaa !8
  store i64 %253, ptr %29, align 8, !tbaa !8
  br label %254

254:                                              ; preds = %333, %250
  %255 = load i64, ptr %29, align 8, !tbaa !8
  %256 = load i64, ptr %21, align 8, !tbaa !8
  %257 = icmp sle i64 %255, %256
  br i1 %257, label %259, label %258

258:                                              ; preds = %254
  store i32 20, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #7
  br label %337

259:                                              ; preds = %254
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #7
  %260 = load i64, ptr %29, align 8, !tbaa !8
  %261 = load i64, ptr %24, align 8, !tbaa !8
  %262 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %261) #7
  %263 = load i64, ptr %262, align 8, !tbaa !8
  %264 = add nsw i64 %260, %263
  store i64 %264, ptr %30, align 8, !tbaa !8
  %265 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %28, ptr noundef nonnull align 8 dereferenceable(8) %30)
          to label %266 unwind label %288

266:                                              ; preds = %259
  %267 = load i64, ptr %265, align 8, !tbaa !8
  store i64 %267, ptr %28, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #7
  %268 = load i64, ptr %24, align 8, !tbaa !8
  %269 = load i64, ptr %6, align 8, !tbaa !8
  %270 = icmp sgt i64 %268, %269
  br i1 %270, label %271, label %292

271:                                              ; preds = %266
  %272 = load i64, ptr %24, align 8, !tbaa !8
  %273 = sub nsw i64 %272, 1
  %274 = getelementptr inbounds [500 x [2000 x i64]], ptr @dp, i64 0, i64 %273
  %275 = load i64, ptr %29, align 8, !tbaa !8
  %276 = getelementptr inbounds [2000 x i64], ptr %274, i64 0, i64 %275
  %277 = load i64, ptr %276, align 8, !tbaa !8
  %278 = load i64, ptr %24, align 8, !tbaa !8
  %279 = getelementptr inbounds [500 x [2000 x i64]], ptr @dp, i64 0, i64 %278
  %280 = load i64, ptr %29, align 8, !tbaa !8
  %281 = load i64, ptr %24, align 8, !tbaa !8
  %282 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %281) #7
  %283 = load i64, ptr %282, align 8, !tbaa !8
  %284 = add nsw i64 %280, %283
  %285 = getelementptr inbounds [2000 x i64], ptr %279, i64 0, i64 %284
  %286 = load i64, ptr %285, align 8, !tbaa !8
  %287 = add nsw i64 %286, %277
  store i64 %287, ptr %285, align 8, !tbaa !8
  br label %292

288:                                              ; preds = %259
  %289 = landingpad { ptr, i32 }
          cleanup
  %290 = extractvalue { ptr, i32 } %289, 0
  store ptr %290, ptr %11, align 8
  %291 = extractvalue { ptr, i32 } %289, 1
  store i32 %291, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #7
  br label %336

292:                                              ; preds = %271, %266
  %293 = load i64, ptr %24, align 8, !tbaa !8
  %294 = load i64, ptr %6, align 8, !tbaa !8
  %295 = icmp slt i64 %293, %294
  br i1 %295, label %296, label %320

296:                                              ; preds = %292
  %297 = load i64, ptr %24, align 8, !tbaa !8
  %298 = sub nsw i64 %297, 1
  %299 = getelementptr inbounds [500 x [2000 x i64]], ptr @dp, i64 0, i64 %298
  %300 = load i64, ptr %29, align 8, !tbaa !8
  %301 = getelementptr inbounds [2000 x i64], ptr %299, i64 0, i64 %300
  %302 = load i64, ptr %301, align 8, !tbaa !8
  %303 = load i64, ptr %24, align 8, !tbaa !8
  %304 = getelementptr inbounds [500 x [2000 x i64]], ptr @dp, i64 0, i64 %303
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #7
  store i64 1000, ptr %31, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #7
  %305 = load i64, ptr %29, align 8, !tbaa !8
  %306 = load i64, ptr %24, align 8, !tbaa !8
  %307 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %306) #7
  %308 = load i64, ptr %307, align 8, !tbaa !8
  %309 = add nsw i64 %305, %308
  store i64 %309, ptr %32, align 8, !tbaa !8
  %310 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %31, ptr noundef nonnull align 8 dereferenceable(8) %32)
          to label %311 unwind label %316

311:                                              ; preds = %296
  %312 = load i64, ptr %310, align 8, !tbaa !8
  %313 = getelementptr inbounds [2000 x i64], ptr %304, i64 0, i64 %312
  %314 = load i64, ptr %313, align 8, !tbaa !8
  %315 = add nsw i64 %314, %302
  store i64 %315, ptr %313, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #7
  br label %320

316:                                              ; preds = %296
  %317 = landingpad { ptr, i32 }
          cleanup
  %318 = extractvalue { ptr, i32 } %317, 0
  store ptr %318, ptr %11, align 8
  %319 = extractvalue { ptr, i32 } %317, 1
  store i32 %319, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #7
  br label %336

320:                                              ; preds = %311, %292
  %321 = load i64, ptr %24, align 8, !tbaa !8
  %322 = sub nsw i64 %321, 1
  %323 = getelementptr inbounds [500 x [2000 x i64]], ptr @dp, i64 0, i64 %322
  %324 = load i64, ptr %29, align 8, !tbaa !8
  %325 = getelementptr inbounds [2000 x i64], ptr %323, i64 0, i64 %324
  %326 = load i64, ptr %325, align 8, !tbaa !8
  %327 = load i64, ptr %24, align 8, !tbaa !8
  %328 = getelementptr inbounds [500 x [2000 x i64]], ptr @dp, i64 0, i64 %327
  %329 = load i64, ptr %29, align 8, !tbaa !8
  %330 = getelementptr inbounds [2000 x i64], ptr %328, i64 0, i64 %329
  %331 = load i64, ptr %330, align 8, !tbaa !8
  %332 = add nsw i64 %331, %326
  store i64 %332, ptr %330, align 8, !tbaa !8
  br label %333

333:                                              ; preds = %320
  %334 = load i64, ptr %29, align 8, !tbaa !8
  %335 = add nsw i64 %334, 1
  store i64 %335, ptr %29, align 8, !tbaa !8
  br label %254, !llvm.loop !17

336:                                              ; preds = %316, %288
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #7
  br label %400

337:                                              ; preds = %258
  %338 = load i64, ptr %27, align 8, !tbaa !8
  store i64 %338, ptr %20, align 8, !tbaa !8
  %339 = load i64, ptr %28, align 8, !tbaa !8
  store i64 %339, ptr %21, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %33) #7
  %340 = load i64, ptr %20, align 8, !tbaa !8
  store i64 %340, ptr %33, align 8, !tbaa !8
  br label %341

341:                                              ; preds = %364, %337
  %342 = load i64, ptr %33, align 8, !tbaa !8
  %343 = load i64, ptr %21, align 8, !tbaa !8
  %344 = icmp sle i64 %342, %343
  br i1 %344, label %346, label %345

345:                                              ; preds = %341
  store i32 23, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #7
  br label %367

346:                                              ; preds = %341
  br label %347

347:                                              ; preds = %355, %346
  %348 = load i64, ptr %24, align 8, !tbaa !8
  %349 = getelementptr inbounds [500 x [2000 x i64]], ptr @dp, i64 0, i64 %348
  %350 = load i64, ptr %33, align 8, !tbaa !8
  %351 = getelementptr inbounds [2000 x i64], ptr %349, i64 0, i64 %350
  %352 = load i64, ptr %351, align 8, !tbaa !8
  %353 = load i64, ptr @MOD, align 8, !tbaa !8
  %354 = icmp sgt i64 %352, %353
  br i1 %354, label %355, label %363

355:                                              ; preds = %347
  %356 = load i64, ptr @MOD, align 8, !tbaa !8
  %357 = load i64, ptr %24, align 8, !tbaa !8
  %358 = getelementptr inbounds [500 x [2000 x i64]], ptr @dp, i64 0, i64 %357
  %359 = load i64, ptr %33, align 8, !tbaa !8
  %360 = getelementptr inbounds [2000 x i64], ptr %358, i64 0, i64 %359
  %361 = load i64, ptr %360, align 8, !tbaa !8
  %362 = sub nsw i64 %361, %356
  store i64 %362, ptr %360, align 8, !tbaa !8
  br label %347, !llvm.loop !18

363:                                              ; preds = %347
  br label %364

364:                                              ; preds = %363
  %365 = load i64, ptr %33, align 8, !tbaa !8
  %366 = add nsw i64 %365, 1
  store i64 %366, ptr %33, align 8, !tbaa !8
  br label %341, !llvm.loop !19

367:                                              ; preds = %345
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #7
  br label %368

368:                                              ; preds = %367, %249
  %369 = load i64, ptr %24, align 8, !tbaa !8
  %370 = add nsw i64 %369, 1
  store i64 %370, ptr %24, align 8, !tbaa !8
  br label %192, !llvm.loop !20

371:                                              ; preds = %196
  call void @llvm.lifetime.start.p0(i64 8, ptr %34) #7
  store i64 1000, ptr %34, align 8, !tbaa !8
  br label %372

372:                                              ; preds = %393, %371
  %373 = load i64, ptr %34, align 8, !tbaa !8
  %374 = load i64, ptr %21, align 8, !tbaa !8
  %375 = icmp sle i64 %373, %374
  br i1 %375, label %377, label %376

376:                                              ; preds = %372
  store i32 28, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #7
  br label %396

377:                                              ; preds = %372
  %378 = load i64, ptr %6, align 8, !tbaa !8
  %379 = getelementptr inbounds [500 x i64], ptr @a, i64 0, i64 %378
  %380 = load i64, ptr %379, align 8, !tbaa !8
  %381 = load i64, ptr @N, align 8, !tbaa !8
  %382 = sub nsw i64 %381, 1
  %383 = getelementptr inbounds [500 x [2000 x i64]], ptr @dp, i64 0, i64 %382
  %384 = load i64, ptr %34, align 8, !tbaa !8
  %385 = getelementptr inbounds [2000 x i64], ptr %383, i64 0, i64 %384
  %386 = load i64, ptr %385, align 8, !tbaa !8
  %387 = mul nsw i64 %380, %386
  %388 = load i64, ptr %5, align 8, !tbaa !8
  %389 = add nsw i64 %388, %387
  store i64 %389, ptr %5, align 8, !tbaa !8
  %390 = load i64, ptr @MOD, align 8, !tbaa !8
  %391 = load i64, ptr %5, align 8, !tbaa !8
  %392 = srem i64 %391, %390
  store i64 %392, ptr %5, align 8, !tbaa !8
  br label %393

393:                                              ; preds = %377
  %394 = load i64, ptr %34, align 8, !tbaa !8
  %395 = add nsw i64 %394, 1
  store i64 %395, ptr %34, align 8, !tbaa !8
  br label %372, !llvm.loop !21

396:                                              ; preds = %376
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %8) #7
  br label %397

397:                                              ; preds = %396, %75
  %398 = load i64, ptr %6, align 8, !tbaa !8
  %399 = add nsw i64 %398, 1
  store i64 %399, ptr %6, align 8, !tbaa !8
  br label %65, !llvm.loop !22

400:                                              ; preds = %336, %197
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  br label %401

401:                                              ; preds = %400, %180, %176, %155
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  br label %407

402:                                              ; preds = %69
  %403 = load i64, ptr %5, align 8, !tbaa !8
  %404 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %403)
  %405 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %404, i8 noundef signext 10)
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  %406 = load i32, ptr %1, align 4
  ret i32 %406

407:                                              ; preds = %401
  %408 = load ptr, ptr %11, align 8
  %409 = load i32, ptr %12, align 4
  %410 = insertvalue { ptr, i32 } poison, ptr %408, 0
  %411 = insertvalue { ptr, i32 } %410, i32 %409, 1
  resume { ptr, i32 } %411
}

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) #1 align 2

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) #2

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

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 1 dereferenceable(1)) #2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIxSaIxEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIxSaIxEE9push_backEOx(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(8)) #3 align 2

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) #6

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

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 nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "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 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 = { 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 #6 = { 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 #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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"long long", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = !{!10, !10, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = distinct !{!15, !13}
!16 = distinct !{!16, !13}
!17 = distinct !{!17, !13}
!18 = distinct !{!18, !13}
!19 = distinct !{!19, !13}
!20 = distinct !{!20, !13}
!21 = distinct !{!21, !13}
!22 = distinct !{!22, !13}


; 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" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@MOD = external dso_local local_unnamed_addr global i64, align 8
@N = external dso_local global i64, align 8
@a = external dso_local local_unnamed_addr global [500 x i64], align 16
@dp = external dso_local local_unnamed_addr global [500 x [2000 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 personality ptr @__gxx_personality_v0 {
  %1 = alloca i8, align 1
  %2 = alloca i64, align 8
  %3 = alloca %"class.std::vector", align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca i64, align 8
  %17 = alloca i64, align 8
  %18 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %19 = getelementptr i8, ptr %18, i64 -24
  %20 = load i64, ptr %19, align 8
  %21 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %20
  %22 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %21, ptr noundef null)
  %23 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %24 = 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)
  %25 = load i64, ptr @N, align 8, !tbaa !8
  %26 = icmp sgt i64 %25, 0
  br i1 %26, label %.lr.ph, label %._crit_edge156

.preheader114:                                    ; preds = %34
  %27 = icmp sgt i64 %37, 0
  br i1 %27, label %.lr.ph155, label %._crit_edge156

.lr.ph:                                           ; preds = %0, %34
  %.087121 = phi i64 [ %36, %34 ], [ 0, %0 ]
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %1) #7
  %28 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 1 dereferenceable(1) %1)
  %29 = load i8, ptr %1, align 1, !tbaa !11
  %30 = icmp eq i8 %29, 45
  br i1 %30, label %34, label %31

31:                                               ; preds = %.lr.ph
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #7
  %32 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %33 = load i64, ptr %2, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #7
  br label %34

34:                                               ; preds = %.lr.ph, %31
  %.sink = phi i64 [ %33, %31 ], [ -1, %.lr.ph ]
  %35 = getelementptr inbounds [500 x i64], ptr @a, i64 0, i64 %.087121
  store i64 %.sink, ptr %35, align 8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %1) #7
  %36 = add nuw nsw i64 %.087121, 1
  %37 = load i64, ptr @N, align 8, !tbaa !8
  %38 = icmp slt i64 %36, %37
  br i1 %38, label %.lr.ph, label %.preheader114, !llvm.loop !12

._crit_edge156:                                   ; preds = %213, %0, %.preheader114
  %.098.lcssa = phi i64 [ 0, %.preheader114 ], [ 0, %0 ], [ %.2, %213 ]
  %39 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %.098.lcssa)
  %40 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %39, i8 noundef signext 10)
  ret i32 0

.lr.ph155:                                        ; preds = %.preheader114, %213
  %41 = phi i64 [ %214, %213 ], [ %37, %.preheader114 ]
  %.097153 = phi i64 [ %215, %213 ], [ 0, %.preheader114 ]
  %.098152 = phi i64 [ %.2, %213 ], [ 0, %.preheader114 ]
  %42 = getelementptr inbounds [500 x i64], ptr @a, i64 0, i64 %.097153
  %43 = load i64, ptr %42, align 8, !tbaa !8
  %44 = icmp eq i64 %43, -1
  br i1 %44, label %213, label %45

45:                                               ; preds = %.lr.ph155
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #7
  call void @_ZNSt6vectorIxSaIxEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #7
  %46 = load i64, ptr @N, align 8, !tbaa !8
  %47 = icmp sgt i64 %46, 0
  br i1 %47, label %.lr.ph123, label %._crit_edge

._crit_edge:                                      ; preds = %89, %45
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #7
  store i64 0, ptr %10, align 8, !tbaa !8
  %48 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef 0) #7
  %49 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %48)
  %50 = load i64, ptr %49, align 8, !tbaa !8
  %51 = add nsw i64 %50, 1000
  %52 = getelementptr inbounds [2000 x i64], ptr @dp, i64 0, i64 %51
  store i64 0, ptr %52, align 8, !tbaa !8
  store i64 0, ptr getelementptr inbounds (i8, ptr @dp, i64 8000), align 16, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #7
  %.not = icmp eq i64 %.097153, 0
  store i64 1, ptr getelementptr inbounds (i8, ptr @dp, i64 8000), align 16, !tbaa !8
  br i1 %.not, label %102, label %94

.lr.ph123:                                        ; preds = %45, %89
  %.096122 = phi i64 [ %90, %89 ], [ 0, %45 ]
  %53 = getelementptr inbounds [500 x i64], ptr @a, i64 0, i64 %.096122
  %54 = load i64, ptr %53, align 8, !tbaa !8
  %55 = icmp eq i64 %54, -1
  br i1 %55, label %56, label %60

56:                                               ; preds = %.lr.ph123
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  store i64 -1, ptr %4, align 8, !tbaa !8
  invoke void @_ZNSt6vectorIxSaIxEE9push_backEOx(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 8 dereferenceable(8) %4)
          to label %57 unwind label %58

57:                                               ; preds = %56
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  br label %89

58:                                               ; preds = %56
  %59 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  br label %93

60:                                               ; preds = %.lr.ph123
  %61 = load i64, ptr %42, align 8, !tbaa !8
  %62 = icmp slt i64 %54, %61
  br i1 %62, label %63, label %67

63:                                               ; preds = %60
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #7
  store i64 1, ptr %5, align 8, !tbaa !8
  invoke void @_ZNSt6vectorIxSaIxEE9push_backEOx(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 8 dereferenceable(8) %5)
          to label %64 unwind label %65

64:                                               ; preds = %63
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  br label %89

65:                                               ; preds = %63
  %66 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  br label %93

67:                                               ; preds = %60
  %68 = icmp sgt i64 %54, %61
  br i1 %68, label %69, label %73

69:                                               ; preds = %67
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #7
  store i64 0, ptr %6, align 8, !tbaa !8
  invoke void @_ZNSt6vectorIxSaIxEE9push_backEOx(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 8 dereferenceable(8) %6)
          to label %70 unwind label %71

70:                                               ; preds = %69
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  br label %89

71:                                               ; preds = %69
  %72 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  br label %93

73:                                               ; preds = %67
  %74 = icmp ult i64 %.096122, %.097153
  br i1 %74, label %75, label %79

75:                                               ; preds = %73
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #7
  store i64 1, ptr %7, align 8, !tbaa !8
  invoke void @_ZNSt6vectorIxSaIxEE9push_backEOx(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 8 dereferenceable(8) %7)
          to label %76 unwind label %77

76:                                               ; preds = %75
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  br label %89

77:                                               ; preds = %75
  %78 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  br label %93

79:                                               ; preds = %73
  %80 = icmp ugt i64 %.096122, %.097153
  br i1 %80, label %81, label %85

81:                                               ; preds = %79
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #7
  store i64 0, ptr %8, align 8, !tbaa !8
  invoke void @_ZNSt6vectorIxSaIxEE9push_backEOx(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 8 dereferenceable(8) %8)
          to label %82 unwind label %83

82:                                               ; preds = %81
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #7
  br label %89

83:                                               ; preds = %81
  %84 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #7
  br label %93

85:                                               ; preds = %79
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #7
  store i64 0, ptr %9, align 8, !tbaa !8
  invoke void @_ZNSt6vectorIxSaIxEE9push_backEOx(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 8 dereferenceable(8) %9)
          to label %86 unwind label %87

86:                                               ; preds = %85
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #7
  br label %89

87:                                               ; preds = %85
  %88 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #7
  br label %93

89:                                               ; preds = %57, %70, %82, %86, %76, %64
  %90 = add nuw nsw i64 %.096122, 1
  %91 = load i64, ptr @N, align 8, !tbaa !8
  %92 = icmp slt i64 %90, %91
  br i1 %92, label %.lr.ph123, label %._crit_edge, !llvm.loop !14

93:                                               ; preds = %87, %83, %77, %71, %65, %58
  %.pn = phi { ptr, i32 } [ %59, %58 ], [ %66, %65 ], [ %72, %71 ], [ %78, %77 ], [ %84, %83 ], [ %88, %87 ]
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #7
  resume { ptr, i32 } %.pn

94:                                               ; preds = %._crit_edge
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #7
  store i64 0, ptr %11, align 8, !tbaa !8
  %95 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef 0) #7
  %96 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %95)
  %97 = load i64, ptr %96, align 8, !tbaa !8
  %98 = add nsw i64 %97, 1000
  %99 = getelementptr inbounds [2000 x i64], ptr @dp, i64 0, i64 %98
  %100 = load i64, ptr %99, align 8, !tbaa !8
  %101 = add nsw i64 %100, 1
  store i64 %101, ptr %99, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #7
  br label %102

102:                                              ; preds = %._crit_edge, %94
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #7
  store i64 1000, ptr %12, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #7
  %103 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef 0) #7
  %104 = load i64, ptr %103, align 8, !tbaa !8
  %105 = add nsw i64 %104, 1000
  store i64 %105, ptr %13, align 8, !tbaa !8
  %106 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %13)
  %107 = load i64, ptr %106, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #7
  %108 = load i64, ptr @N, align 8, !tbaa !8
  %109 = icmp sgt i64 %108, 1
  br i1 %109, label %.preheader112.preheader, label %.preheader113

.preheader112.preheader:                          ; preds = %102
  %110 = add nsw i64 %.097153, -1
  br label %.preheader112

.preheader113:                                    ; preds = %.loopexit, %102
  %.091.lcssa = phi i64 [ %107, %102 ], [ %.1, %.loopexit ]
  %.lcssa = phi i64 [ %108, %102 ], [ %193, %.loopexit ]
  %.not105146 = icmp slt i64 %.091.lcssa, 1000
  br i1 %.not105146, label %._crit_edge150, label %.lr.ph149

.lr.ph149:                                        ; preds = %.preheader113
  %111 = load i64, ptr %42, align 8, !tbaa !8
  %112 = add nsw i64 %.lcssa, -1
  %113 = load i64, ptr @MOD, align 8, !tbaa !8
  %114 = add nsw i64 %.091.lcssa, -999
  %xtraiter181 = and i64 %114, 1
  %115 = icmp eq i64 %.091.lcssa, 1000
  br i1 %115, label %._crit_edge150.loopexit.unr-lcssa, label %.lr.ph149.new

.lr.ph149.new:                                    ; preds = %.lr.ph149
  %unroll_iter184 = and i64 %114, -2
  br label %200

.preheader112:                                    ; preds = %.preheader112.preheader, %.loopexit
  %.090143 = phi i64 [ %192, %.loopexit ], [ 1, %.preheader112.preheader ]
  %.091142 = phi i64 [ %.1, %.loopexit ], [ %107, %.preheader112.preheader ]
  %.not106124 = icmp slt i64 %.091142, 1000
  br i1 %.not106124, label %._crit_edge127.thread, label %.lr.ph126

._crit_edge127:                                   ; preds = %.lr.ph126
  %116 = icmp eq i64 %.090143, %.097153
  br i1 %116, label %.preheader111, label %132

._crit_edge127.thread:                            ; preds = %.preheader112
  %117 = icmp eq i64 %.090143, %.097153
  br i1 %117, label %.loopexit, label %.thread

.thread:                                          ; preds = %._crit_edge127.thread
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #7
  br label %._crit_edge138

.preheader111:                                    ; preds = %._crit_edge127
  br i1 %.not106124, label %.loopexit, label %.lr.ph141.preheader

.lr.ph141.preheader:                              ; preds = %.preheader111
  %118 = add nsw i64 %.091142, -999
  %min.iters.check = icmp ult i64 %118, 2
  br i1 %min.iters.check, label %.lr.ph141.preheader176, label %vector.ph

.lr.ph141.preheader176:                           ; preds = %middle.block, %.lr.ph141.preheader
  %.088140.ph = phi i64 [ 1000, %.lr.ph141.preheader ], [ %ind.end, %middle.block ]
  br label %.lr.ph141

vector.ph:                                        ; preds = %.lr.ph141.preheader
  %n.vec = and i64 %118, -2
  %ind.end = add i64 %n.vec, 1000
  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, 1000
  %119 = getelementptr inbounds [500 x [2000 x i64]], ptr @dp, i64 0, i64 %110, i64 %offset.idx
  %wide.load = load <2 x i64>, ptr %119, align 16, !tbaa !8
  %120 = getelementptr inbounds [500 x [2000 x i64]], ptr @dp, i64 0, i64 %.097153, i64 %offset.idx
  store <2 x i64> %wide.load, ptr %120, align 16, !tbaa !8
  %index.next = add nuw i64 %index, 2
  %121 = icmp eq i64 %index.next, %n.vec
  br i1 %121, label %middle.block, label %vector.body, !llvm.loop !15

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %118, %n.vec
  br i1 %cmp.n, label %.loopexit, label %.lr.ph141.preheader176

.lr.ph126:                                        ; preds = %.preheader112, %.lr.ph126
  %.089125 = phi i64 [ %127, %.lr.ph126 ], [ 1000, %.preheader112 ]
  %122 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.090143) #7
  %123 = load i64, ptr %122, align 8, !tbaa !8
  %124 = add nsw i64 %123, %.089125
  %125 = getelementptr inbounds [500 x [2000 x i64]], ptr @dp, i64 0, i64 %.090143, i64 %124
  store i64 0, ptr %125, align 8, !tbaa !8
  %126 = getelementptr inbounds [500 x [2000 x i64]], ptr @dp, i64 0, i64 %.090143, i64 %.089125
  store i64 0, ptr %126, align 8, !tbaa !8
  %127 = add nuw i64 %.089125, 1
  %exitcond.not = icmp eq i64 %.089125, %.091142
  br i1 %exitcond.not, label %._crit_edge127, label %.lr.ph126, !llvm.loop !18

.lr.ph141:                                        ; preds = %.lr.ph141.preheader176, %.lr.ph141
  %.088140 = phi i64 [ %131, %.lr.ph141 ], [ %.088140.ph, %.lr.ph141.preheader176 ]
  %128 = getelementptr inbounds [500 x [2000 x i64]], ptr @dp, i64 0, i64 %110, i64 %.088140
  %129 = load i64, ptr %128, align 8, !tbaa !8
  %130 = getelementptr inbounds [500 x [2000 x i64]], ptr @dp, i64 0, i64 %.097153, i64 %.088140
  store i64 %129, ptr %130, align 8, !tbaa !8
  %131 = add nuw i64 %.088140, 1
  %exitcond164.not = icmp eq i64 %.088140, %.091142
  br i1 %exitcond164.not, label %.loopexit, label %.lr.ph141, !llvm.loop !19

132:                                              ; preds = %._crit_edge127
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #7
  store i64 %.091142, ptr %14, align 8, !tbaa !8
  br i1 %.not106124, label %._crit_edge138, label %.lr.ph131

.lr.ph131:                                        ; preds = %132
  %133 = icmp ugt i64 %.090143, %.097153
  %134 = add nsw i64 %.090143, -1
  %135 = icmp ult i64 %.090143, %.097153
  br label %139

._crit_edge132:                                   ; preds = %166
  %.pre = load i64, ptr %14, align 8, !tbaa !8
  %.not108136 = icmp slt i64 %.pre, 1000
  br i1 %.not108136, label %._crit_edge138, label %.preheader.lr.ph

.preheader.lr.ph:                                 ; preds = %._crit_edge132
  %136 = load i64, ptr @MOD, align 8, !tbaa !8
  %137 = add nsw i64 %.pre, -999
  %xtraiter = and i64 %137, 1
  %138 = icmp eq i64 %.pre, 1000
  br i1 %138, label %._crit_edge138.loopexit.unr-lcssa, label %.preheader.lr.ph.new

.preheader.lr.ph.new:                             ; preds = %.preheader.lr.ph
  %unroll_iter = and i64 %137, -2
  br label %.preheader

139:                                              ; preds = %.lr.ph131, %166
  %.086129 = phi i64 [ 1000, %.lr.ph131 ], [ %172, %166 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #7
  %140 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.090143) #7
  %141 = load i64, ptr %140, align 8, !tbaa !8
  %142 = add nsw i64 %141, %.086129
  store i64 %142, ptr %15, align 8, !tbaa !8
  %143 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %15)
  %144 = load i64, ptr %143, align 8, !tbaa !8
  store i64 %144, ptr %14, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #7
  br i1 %133, label %145, label %154

145:                                              ; preds = %139
  %146 = getelementptr inbounds [500 x [2000 x i64]], ptr @dp, i64 0, i64 %134, i64 %.086129
  %147 = load i64, ptr %146, align 8, !tbaa !8
  %148 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.090143) #7
  %149 = load i64, ptr %148, align 8, !tbaa !8
  %150 = add nsw i64 %149, %.086129
  %151 = getelementptr inbounds [500 x [2000 x i64]], ptr @dp, i64 0, i64 %.090143, i64 %150
  %152 = load i64, ptr %151, align 8, !tbaa !8
  %153 = add nsw i64 %152, %147
  store i64 %153, ptr %151, align 8, !tbaa !8
  br label %154

154:                                              ; preds = %145, %139
  br i1 %135, label %155, label %166

155:                                              ; preds = %154
  %156 = getelementptr inbounds [500 x [2000 x i64]], ptr @dp, i64 0, i64 %134, i64 %.086129
  %157 = load i64, ptr %156, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %16) #7
  store i64 1000, ptr %16, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %17) #7
  %158 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.090143) #7
  %159 = load i64, ptr %158, align 8, !tbaa !8
  %160 = add nsw i64 %159, %.086129
  store i64 %160, ptr %17, align 8, !tbaa !8
  %161 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %16, ptr noundef nonnull align 8 dereferenceable(8) %17)
  %162 = load i64, ptr %161, align 8, !tbaa !8
  %163 = getelementptr inbounds [500 x [2000 x i64]], ptr @dp, i64 0, i64 %.090143, i64 %162
  %164 = load i64, ptr %163, align 8, !tbaa !8
  %165 = add nsw i64 %164, %157
  store i64 %165, ptr %163, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %17) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #7
  br label %166

166:                                              ; preds = %155, %154
  %167 = getelementptr inbounds [500 x [2000 x i64]], ptr @dp, i64 0, i64 %134, i64 %.086129
  %168 = load i64, ptr %167, align 8, !tbaa !8
  %169 = getelementptr inbounds [500 x [2000 x i64]], ptr @dp, i64 0, i64 %.090143, i64 %.086129
  %170 = load i64, ptr %169, align 8, !tbaa !8
  %171 = add nsw i64 %170, %168
  store i64 %171, ptr %169, align 8, !tbaa !8
  %172 = add nuw i64 %.086129, 1
  %exitcond161.not = icmp eq i64 %.086129, %.091142
  br i1 %exitcond161.not, label %._crit_edge132, label %139, !llvm.loop !20

.preheader:                                       ; preds = %190, %.preheader.lr.ph.new
  %.085137 = phi i64 [ 1000, %.preheader.lr.ph.new ], [ %191, %190 ]
  %niter = phi i64 [ 0, %.preheader.lr.ph.new ], [ %niter.next.1, %190 ]
  %173 = getelementptr inbounds [500 x [2000 x i64]], ptr @dp, i64 0, i64 %.090143, i64 %.085137
  %.promoted = load i64, ptr %173, align 16, !tbaa !8
  %174 = icmp sgt i64 %.promoted, %136
  br i1 %174, label %.lr.ph133, label %.preheader.1

._crit_edge138.loopexit.unr-lcssa:                ; preds = %190, %.preheader.lr.ph
  %.085137.unr = phi i64 [ 1000, %.preheader.lr.ph ], [ %191, %190 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge138, label %.preheader.epil

.preheader.epil:                                  ; preds = %._crit_edge138.loopexit.unr-lcssa
  %175 = getelementptr inbounds [500 x [2000 x i64]], ptr @dp, i64 0, i64 %.090143, i64 %.085137.unr
  %.promoted.epil = load i64, ptr %175, align 8, !tbaa !8
  %176 = icmp sgt i64 %.promoted.epil, %136
  br i1 %176, label %.lr.ph133.epil, label %._crit_edge138

.lr.ph133.epil:                                   ; preds = %.preheader.epil, %.lr.ph133.epil
  %177 = phi i64 [ %178, %.lr.ph133.epil ], [ %.promoted.epil, %.preheader.epil ]
  %178 = sub nsw i64 %177, %136
  %179 = icmp sgt i64 %178, %136
  br i1 %179, label %.lr.ph133.epil, label %._crit_edge134.epil, !llvm.loop !21

._crit_edge134.epil:                              ; preds = %.lr.ph133.epil
  store i64 %178, ptr %175, align 8, !tbaa !8
  br label %._crit_edge138

._crit_edge138:                                   ; preds = %._crit_edge138.loopexit.unr-lcssa, %._crit_edge134.epil, %.preheader.epil, %.thread, %132, %._crit_edge132
  %180 = phi i64 [ %.pre, %._crit_edge132 ], [ %.091142, %132 ], [ %.091142, %.thread ], [ %.pre, %.preheader.epil ], [ %.pre, %._crit_edge134.epil ], [ %.pre, %._crit_edge138.loopexit.unr-lcssa ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #7
  br label %.loopexit

.lr.ph133:                                        ; preds = %.preheader, %.lr.ph133
  %181 = phi i64 [ %182, %.lr.ph133 ], [ %.promoted, %.preheader ]
  %182 = sub nsw i64 %181, %136
  %183 = icmp sgt i64 %182, %136
  br i1 %183, label %.lr.ph133, label %._crit_edge134, !llvm.loop !21

._crit_edge134:                                   ; preds = %.lr.ph133
  store i64 %182, ptr %173, align 16, !tbaa !8
  br label %.preheader.1

.preheader.1:                                     ; preds = %._crit_edge134, %.preheader
  %184 = or disjoint i64 %.085137, 1
  %185 = getelementptr inbounds [500 x [2000 x i64]], ptr @dp, i64 0, i64 %.090143, i64 %184
  %.promoted.1 = load i64, ptr %185, align 8, !tbaa !8
  %186 = icmp sgt i64 %.promoted.1, %136
  br i1 %186, label %.lr.ph133.1, label %190

.lr.ph133.1:                                      ; preds = %.preheader.1, %.lr.ph133.1
  %187 = phi i64 [ %188, %.lr.ph133.1 ], [ %.promoted.1, %.preheader.1 ]
  %188 = sub nsw i64 %187, %136
  %189 = icmp sgt i64 %188, %136
  br i1 %189, label %.lr.ph133.1, label %._crit_edge134.1, !llvm.loop !21

._crit_edge134.1:                                 ; preds = %.lr.ph133.1
  store i64 %188, ptr %185, align 8, !tbaa !8
  br label %190

190:                                              ; preds = %._crit_edge134.1, %.preheader.1
  %191 = add nuw i64 %.085137, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge138.loopexit.unr-lcssa, label %.preheader, !llvm.loop !22

.loopexit:                                        ; preds = %.lr.ph141, %middle.block, %._crit_edge127.thread, %.preheader111, %._crit_edge138
  %.1 = phi i64 [ %180, %._crit_edge138 ], [ %.091142, %.preheader111 ], [ %.091142, %._crit_edge127.thread ], [ %.091142, %middle.block ], [ %.091142, %.lr.ph141 ]
  %192 = add nuw nsw i64 %.090143, 1
  %193 = load i64, ptr @N, align 8, !tbaa !8
  %194 = icmp slt i64 %192, %193
  br i1 %194, label %.preheader112, label %.preheader113, !llvm.loop !23

._crit_edge150.loopexit.unr-lcssa:                ; preds = %200, %.lr.ph149
  %.lcssa179.ph = phi i64 [ poison, %.lr.ph149 ], [ %211, %200 ]
  %.0148.unr = phi i64 [ 1000, %.lr.ph149 ], [ %212, %200 ]
  %.199147.unr = phi i64 [ %.098152, %.lr.ph149 ], [ %211, %200 ]
  %lcmp.mod182.not = icmp eq i64 %xtraiter181, 0
  br i1 %lcmp.mod182.not, label %._crit_edge150, label %._crit_edge150.loopexit.epilog-lcssa

._crit_edge150.loopexit.epilog-lcssa:             ; preds = %._crit_edge150.loopexit.unr-lcssa
  %195 = getelementptr inbounds [500 x [2000 x i64]], ptr @dp, i64 0, i64 %112, i64 %.0148.unr
  %196 = load i64, ptr %195, align 8, !tbaa !8
  %197 = mul nsw i64 %196, %111
  %198 = add nsw i64 %197, %.199147.unr
  %199 = srem i64 %198, %113
  br label %._crit_edge150

._crit_edge150:                                   ; preds = %._crit_edge150.loopexit.epilog-lcssa, %._crit_edge150.loopexit.unr-lcssa, %.preheader113
  %.199.lcssa = phi i64 [ %.098152, %.preheader113 ], [ %.lcssa179.ph, %._crit_edge150.loopexit.unr-lcssa ], [ %199, %._crit_edge150.loopexit.epilog-lcssa ]
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #7
  %.pre166 = load i64, ptr @N, align 8, !tbaa !8
  br label %213

200:                                              ; preds = %200, %.lr.ph149.new
  %.0148 = phi i64 [ 1000, %.lr.ph149.new ], [ %212, %200 ]
  %.199147 = phi i64 [ %.098152, %.lr.ph149.new ], [ %211, %200 ]
  %niter185 = phi i64 [ 0, %.lr.ph149.new ], [ %niter185.next.1, %200 ]
  %201 = getelementptr inbounds [500 x [2000 x i64]], ptr @dp, i64 0, i64 %112, i64 %.0148
  %202 = load i64, ptr %201, align 16, !tbaa !8
  %203 = mul nsw i64 %202, %111
  %204 = add nsw i64 %203, %.199147
  %205 = srem i64 %204, %113
  %206 = or disjoint i64 %.0148, 1
  %207 = getelementptr inbounds [500 x [2000 x i64]], ptr @dp, i64 0, i64 %112, i64 %206
  %208 = load i64, ptr %207, align 8, !tbaa !8
  %209 = mul nsw i64 %208, %111
  %210 = add nsw i64 %209, %205
  %211 = srem i64 %210, %113
  %212 = add nuw i64 %.0148, 2
  %niter185.next.1 = add i64 %niter185, 2
  %niter185.ncmp.1 = icmp eq i64 %niter185.next.1, %unroll_iter184
  br i1 %niter185.ncmp.1, label %._crit_edge150.loopexit.unr-lcssa, label %200, !llvm.loop !24

213:                                              ; preds = %.lr.ph155, %._crit_edge150
  %214 = phi i64 [ %41, %.lr.ph155 ], [ %.pre166, %._crit_edge150 ]
  %.2 = phi i64 [ %.098152, %.lr.ph155 ], [ %.199.lcssa, %._crit_edge150 ]
  %215 = add nuw nsw i64 %.097153, 1
  %216 = icmp slt i64 %215, %214
  br i1 %216, label %.lr.ph155, label %._crit_edge156, !llvm.loop !25
}

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

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) local_unnamed_addr #2

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

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 1 dereferenceable(1)) 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) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIxSaIxEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIxSaIxEE9push_backEOx(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3 align 2

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) 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 #3 align 2

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 nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "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 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 = { 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 #6 = { 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 #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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"long long", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = !{!10, !10, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = distinct !{!15, !13, !16, !17}
!16 = !{!"llvm.loop.isvectorized", i32 1}
!17 = !{!"llvm.loop.unroll.runtime.disable"}
!18 = distinct !{!18, !13}
!19 = distinct !{!19, !13, !17, !16}
!20 = distinct !{!20, !13}
!21 = distinct !{!21, !13}
!22 = distinct !{!22, !13}
!23 = distinct !{!23, !13}
!24 = distinct !{!24, !13}
!25 = distinct !{!25, !13}


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