; LLVM IR from VastoLorde95/Competitive-Programming :: Hackerrank/Codesprints 2016/Codesprint May/Problem D (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_ostream" = type { ptr, %"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_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::initializer_list" = type { ptr, i64 }
%"class.std::allocator" = type { i8 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@dp = external dso_local global [5001 x [5001 x i64]], align 16
@cnt = external dso_local global [5001 x i64], align 16
@a = external dso_local global i32, align 4
@b = external dso_local global i32, align 4
@c = external dso_local global i32, align 4
@d = external dso_local global i32, align 4
@_ZSt3cin = external global %"class.std::basic_istream", align 8

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #0 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)) #1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #2 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca %"class.std::vector", align 8
  %3 = alloca %"class.std::initializer_list", align 8
  %4 = alloca [4 x i32], align 4
  %5 = alloca %"class.std::allocator", align 1
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %9 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %10 = alloca i64, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i64, align 8
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %22 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @a)
  %23 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %22, ptr noundef nonnull align 4 dereferenceable(4) @b)
  %24 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %23, ptr noundef nonnull align 4 dereferenceable(4) @c)
  %25 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %24, ptr noundef nonnull align 4 dereferenceable(4) @d)
  call void @llvm.lifetime.start.p0(i64 24, ptr %2) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %4) #6
  %26 = load i32, ptr @a, align 4, !tbaa !5
  store i32 %26, ptr %4, align 4, !tbaa !5
  %27 = getelementptr inbounds i32, ptr %4, i64 1
  %28 = load i32, ptr @b, align 4, !tbaa !5
  store i32 %28, ptr %27, align 4, !tbaa !5
  %29 = getelementptr inbounds i32, ptr %4, i64 2
  %30 = load i32, ptr @c, align 4, !tbaa !5
  store i32 %30, ptr %29, align 4, !tbaa !5
  %31 = getelementptr inbounds i32, ptr %4, i64 3
  %32 = load i32, ptr @d, align 4, !tbaa !5
  store i32 %32, ptr %31, align 4, !tbaa !5
  %33 = getelementptr inbounds %"class.std::initializer_list", ptr %3, i32 0, i32 0
  store ptr %4, ptr %33, align 8, !tbaa !9
  %34 = getelementptr inbounds %"class.std::initializer_list", ptr %3, i32 0, i32 1
  store i64 4, ptr %34, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 1, ptr %5) #6
  call void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #6
  %35 = getelementptr inbounds { ptr, i64 }, ptr %3, i32 0, i32 0
  %36 = load ptr, ptr %35, align 8
  %37 = getelementptr inbounds { ptr, i64 }, ptr %3, i32 0, i32 1
  %38 = load i64, ptr %37, align 8
  invoke void @_ZNSt6vectorIiSaIiEEC2ESt16initializer_listIiERKS0_(ptr noundef nonnull align 8 dereferenceable(24) %2, ptr %36, i64 %38, ptr noundef nonnull align 1 dereferenceable(1) %5)
          to label %39 unwind label %62

39:                                               ; preds = %0
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %4) #6
  %40 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  %41 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %8, i32 0, i32 0
  store ptr %40, ptr %41, align 8
  %42 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  %43 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %9, i32 0, i32 0
  store ptr %42, ptr %43, align 8
  %44 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %8, i32 0, i32 0
  %45 = load ptr, ptr %44, align 8
  %46 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %9, i32 0, i32 0
  %47 = load ptr, ptr %46, align 8
  invoke void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEEvT_S7_(ptr %45, ptr %47)
          to label %48 unwind label %66

48:                                               ; preds = %39
  %49 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef 0) #6
  %50 = load i32, ptr %49, align 4, !tbaa !5
  store i32 %50, ptr @a, align 4, !tbaa !5
  %51 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef 1) #6
  %52 = load i32, ptr %51, align 4, !tbaa !5
  store i32 %52, ptr @b, align 4, !tbaa !5
  %53 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef 2) #6
  %54 = load i32, ptr %53, align 4, !tbaa !5
  store i32 %54, ptr @c, align 4, !tbaa !5
  %55 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef 3) #6
  %56 = load i32, ptr %55, align 4, !tbaa !5
  store i32 %56, ptr @d, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  store i64 0, ptr %10, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 1, ptr %11, align 4, !tbaa !5
  br label %57

57:                                               ; preds = %94, %48
  %58 = load i32, ptr %11, align 4, !tbaa !5
  %59 = load i32, ptr @c, align 4, !tbaa !5
  %60 = icmp sle i32 %58, %59
  br i1 %60, label %70, label %61

61:                                               ; preds = %57
  store i32 2, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %97

62:                                               ; preds = %0
  %63 = landingpad { ptr, i32 }
          cleanup
  %64 = extractvalue { ptr, i32 } %63, 0
  store ptr %64, ptr %6, align 8
  %65 = extractvalue { ptr, i32 } %63, 1
  store i32 %65, ptr %7, align 4
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %4) #6
  br label %211

66:                                               ; preds = %39
  %67 = landingpad { ptr, i32 }
          cleanup
  %68 = extractvalue { ptr, i32 } %67, 0
  store ptr %68, ptr %6, align 8
  %69 = extractvalue { ptr, i32 } %67, 1
  store i32 %69, ptr %7, align 4
  br label %210

70:                                               ; preds = %57
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  %71 = load i32, ptr %11, align 4, !tbaa !5
  store i32 %71, ptr %13, align 4, !tbaa !5
  br label %72

72:                                               ; preds = %90, %70
  %73 = load i32, ptr %13, align 4, !tbaa !5
  %74 = load i32, ptr @d, align 4, !tbaa !5
  %75 = icmp sle i32 %73, %74
  br i1 %75, label %77, label %76

76:                                               ; preds = %72
  store i32 5, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %93

77:                                               ; preds = %72
  %78 = load i32, ptr %11, align 4, !tbaa !5
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [5001 x [5001 x i64]], ptr @dp, i64 0, i64 %79
  %81 = load i32, ptr %11, align 4, !tbaa !5
  %82 = load i32, ptr %13, align 4, !tbaa !5
  %83 = xor i32 %81, %82
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [5001 x i64], ptr %80, i64 0, i64 %84
  %86 = load i64, ptr %85, align 8, !tbaa !14
  %87 = add nsw i64 %86, 1
  store i64 %87, ptr %85, align 8, !tbaa !14
  %88 = load i64, ptr %10, align 8, !tbaa !14
  %89 = add nsw i64 %88, 1
  store i64 %89, ptr %10, align 8, !tbaa !14
  br label %90

90:                                               ; preds = %77
  %91 = load i32, ptr %13, align 4, !tbaa !5
  %92 = add nsw i32 %91, 1
  store i32 %92, ptr %13, align 4, !tbaa !5
  br label %72, !llvm.loop !16

93:                                               ; preds = %76
  br label %94

94:                                               ; preds = %93
  %95 = load i32, ptr %11, align 4, !tbaa !5
  %96 = add nsw i32 %95, 1
  store i32 %96, ptr %11, align 4, !tbaa !5
  br label %57, !llvm.loop !18

97:                                               ; preds = %61
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  store i32 0, ptr %14, align 4, !tbaa !5
  br label %98

98:                                               ; preds = %128, %97
  %99 = load i32, ptr %14, align 4, !tbaa !5
  %100 = icmp slt i32 %99, 5001
  br i1 %100, label %102, label %101

101:                                              ; preds = %98
  store i32 8, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %131

102:                                              ; preds = %98
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  store i32 4999, ptr %15, align 4, !tbaa !5
  br label %103

103:                                              ; preds = %124, %102
  %104 = load i32, ptr %15, align 4, !tbaa !5
  %105 = icmp sgt i32 %104, 0
  br i1 %105, label %107, label %106

106:                                              ; preds = %103
  store i32 11, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %127

107:                                              ; preds = %103
  %108 = load i32, ptr %15, align 4, !tbaa !5
  %109 = add nsw i32 %108, 1
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [5001 x [5001 x i64]], ptr @dp, i64 0, i64 %110
  %112 = load i32, ptr %14, align 4, !tbaa !5
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds [5001 x i64], ptr %111, i64 0, i64 %113
  %115 = load i64, ptr %114, align 8, !tbaa !14
  %116 = load i32, ptr %15, align 4, !tbaa !5
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [5001 x [5001 x i64]], ptr @dp, i64 0, i64 %117
  %119 = load i32, ptr %14, align 4, !tbaa !5
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds [5001 x i64], ptr %118, i64 0, i64 %120
  %122 = load i64, ptr %121, align 8, !tbaa !14
  %123 = add nsw i64 %122, %115
  store i64 %123, ptr %121, align 8, !tbaa !14
  br label %124

124:                                              ; preds = %107
  %125 = load i32, ptr %15, align 4, !tbaa !5
  %126 = add nsw i32 %125, -1
  store i32 %126, ptr %15, align 4, !tbaa !5
  br label %103, !llvm.loop !19

127:                                              ; preds = %106
  br label %128

128:                                              ; preds = %127
  %129 = load i32, ptr %14, align 4, !tbaa !5
  %130 = add nsw i32 %129, 1
  store i32 %130, ptr %14, align 4, !tbaa !5
  br label %98, !llvm.loop !20

131:                                              ; preds = %101
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  store i32 1, ptr %16, align 4, !tbaa !5
  br label %132

132:                                              ; preds = %158, %131
  %133 = load i32, ptr %16, align 4, !tbaa !5
  %134 = icmp slt i32 %133, 5001
  br i1 %134, label %136, label %135

135:                                              ; preds = %132
  store i32 14, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  br label %161

136:                                              ; preds = %132
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  store i32 0, ptr %17, align 4, !tbaa !5
  br label %137

137:                                              ; preds = %154, %136
  %138 = load i32, ptr %17, align 4, !tbaa !5
  %139 = icmp slt i32 %138, 5001
  br i1 %139, label %141, label %140

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

141:                                              ; preds = %137
  %142 = load i32, ptr %16, align 4, !tbaa !5
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds [5001 x [5001 x i64]], ptr @dp, i64 0, i64 %143
  %145 = load i32, ptr %17, align 4, !tbaa !5
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds [5001 x i64], ptr %144, i64 0, i64 %146
  %148 = load i64, ptr %147, align 8, !tbaa !14
  %149 = load i32, ptr %16, align 4, !tbaa !5
  %150 = sext i32 %149 to i64
  %151 = getelementptr inbounds [5001 x i64], ptr @cnt, i64 0, i64 %150
  %152 = load i64, ptr %151, align 8, !tbaa !14
  %153 = add nsw i64 %152, %148
  store i64 %153, ptr %151, align 8, !tbaa !14
  br label %154

154:                                              ; preds = %141
  %155 = load i32, ptr %17, align 4, !tbaa !5
  %156 = add nsw i32 %155, 1
  store i32 %156, ptr %17, align 4, !tbaa !5
  br label %137, !llvm.loop !21

157:                                              ; preds = %140
  br label %158

158:                                              ; preds = %157
  %159 = load i32, ptr %16, align 4, !tbaa !5
  %160 = add nsw i32 %159, 1
  store i32 %160, ptr %16, align 4, !tbaa !5
  br label %132, !llvm.loop !22

161:                                              ; preds = %135
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  store i64 0, ptr %18, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  store i32 1, ptr %19, align 4, !tbaa !5
  br label %162

162:                                              ; preds = %196, %161
  %163 = load i32, ptr %19, align 4, !tbaa !5
  %164 = load i32, ptr @a, align 4, !tbaa !5
  %165 = icmp sle i32 %163, %164
  br i1 %165, label %167, label %166

166:                                              ; preds = %162
  store i32 20, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  br label %199

167:                                              ; preds = %162
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #6
  %168 = load i32, ptr %19, align 4, !tbaa !5
  store i32 %168, ptr %20, align 4, !tbaa !5
  br label %169

169:                                              ; preds = %192, %167
  %170 = load i32, ptr %20, align 4, !tbaa !5
  %171 = load i32, ptr @b, align 4, !tbaa !5
  %172 = icmp sle i32 %170, %171
  br i1 %172, label %174, label %173

173:                                              ; preds = %169
  store i32 23, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  br label %195

174:                                              ; preds = %169
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #6
  %175 = load i32, ptr %19, align 4, !tbaa !5
  %176 = load i32, ptr %20, align 4, !tbaa !5
  %177 = xor i32 %175, %176
  store i32 %177, ptr %21, align 4, !tbaa !5
  %178 = load i32, ptr %20, align 4, !tbaa !5
  %179 = sext i32 %178 to i64
  %180 = getelementptr inbounds [5001 x i64], ptr @cnt, i64 0, i64 %179
  %181 = load i64, ptr %180, align 8, !tbaa !14
  %182 = load i32, ptr %20, align 4, !tbaa !5
  %183 = sext i32 %182 to i64
  %184 = getelementptr inbounds [5001 x [5001 x i64]], ptr @dp, i64 0, i64 %183
  %185 = load i32, ptr %21, align 4, !tbaa !5
  %186 = sext i32 %185 to i64
  %187 = getelementptr inbounds [5001 x i64], ptr %184, i64 0, i64 %186
  %188 = load i64, ptr %187, align 8, !tbaa !14
  %189 = sub nsw i64 %181, %188
  %190 = load i64, ptr %18, align 8, !tbaa !14
  %191 = add nsw i64 %190, %189
  store i64 %191, ptr %18, align 8, !tbaa !14
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #6
  br label %192

192:                                              ; preds = %174
  %193 = load i32, ptr %20, align 4, !tbaa !5
  %194 = add nsw i32 %193, 1
  store i32 %194, ptr %20, align 4, !tbaa !5
  br label %169, !llvm.loop !23

195:                                              ; preds = %173
  br label %196

196:                                              ; preds = %195
  %197 = load i32, ptr %19, align 4, !tbaa !5
  %198 = add nsw i32 %197, 1
  store i32 %198, ptr %19, align 4, !tbaa !5
  br label %162, !llvm.loop !24

199:                                              ; preds = %166
  %200 = load i64, ptr %18, align 8, !tbaa !14
  %201 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %200)
          to label %202 unwind label %206

202:                                              ; preds = %199
  %203 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %201, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %204 unwind label %206

204:                                              ; preds = %202
  store i32 0, ptr %1, align 4
  store i32 1, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %2) #6
  %205 = load i32, ptr %1, align 4
  ret i32 %205

206:                                              ; preds = %202, %199
  %207 = landingpad { ptr, i32 }
          cleanup
  %208 = extractvalue { ptr, i32 } %207, 0
  store ptr %208, ptr %6, align 8
  %209 = extractvalue { ptr, i32 } %207, 1
  store i32 %209, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  br label %210

210:                                              ; preds = %206, %66
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  br label %211

211:                                              ; preds = %210, %62
  call void @llvm.lifetime.end.p0(i64 24, ptr %2) #6
  br label %212

212:                                              ; preds = %211
  %213 = load ptr, ptr %6, align 8
  %214 = load i32, ptr %7, align 4
  %215 = insertvalue { ptr, i32 } poison, ptr %213, 0
  %216 = insertvalue { ptr, i32 } %215, i32 %214, 1
  resume { ptr, i32 } %216
}

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), 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: mustprogress nounwind uwtable
declare dso_local void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEEC2ESt16initializer_listIiERKS0_(ptr noundef nonnull align 8 dereferenceable(24), ptr, i64, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #0 align 2

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEEvT_S7_(ptr, ptr) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) #5 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) #5 align 2

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

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

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

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

attributes #0 = { 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 #1 = { 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 #2 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { 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 = { 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, !11, i64 0}
!10 = !{!"_ZTSSt16initializer_listIiE", !11, i64 0, !12, i64 8}
!11 = !{!"any pointer", !7, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!10, !12, i64 8}
!14 = !{!15, !15, i64 0}
!15 = !{!"long long", !7, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = distinct !{!18, !17}
!19 = distinct !{!19, !17}
!20 = distinct !{!20, !17}
!21 = distinct !{!21, !17}
!22 = distinct !{!22, !17}
!23 = distinct !{!23, !17}
!24 = distinct !{!24, !17}


; 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_ostream" = type { ptr, %"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_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator" = type { i8 }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@dp = external dso_local local_unnamed_addr global [5001 x [5001 x i64]], align 16
@cnt = external dso_local local_unnamed_addr global [5001 x i64], align 16
@a = external dso_local global i32, align 4
@b = external dso_local global i32, align 4
@c = external dso_local global i32, align 4
@d = external dso_local global i32, align 4
@_ZSt3cin = external global %"class.std::basic_istream", align 8

; 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 #0 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)) #1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.std::vector", align 8
  %2 = alloca [4 x i32], align 4
  %3 = alloca %"class.std::allocator", align 1
  %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) @a)
  %5 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %4, ptr noundef nonnull align 4 dereferenceable(4) @b)
  %6 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 4 dereferenceable(4) @c)
  %7 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %6, ptr noundef nonnull align 4 dereferenceable(4) @d)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %2) #7
  %8 = load i32, ptr @a, align 4, !tbaa !5
  store i32 %8, ptr %2, align 4, !tbaa !5
  %9 = getelementptr inbounds i8, ptr %2, i64 4
  %10 = load i32, ptr @b, align 4, !tbaa !5
  store i32 %10, ptr %9, align 4, !tbaa !5
  %11 = getelementptr inbounds i8, ptr %2, i64 8
  %12 = load i32, ptr @c, align 4, !tbaa !5
  store i32 %12, ptr %11, align 4, !tbaa !5
  %13 = getelementptr inbounds i8, ptr %2, i64 12
  %14 = load i32, ptr @d, align 4, !tbaa !5
  store i32 %14, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %3) #7
  call void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #7
  invoke void @_ZNSt6vectorIiSaIiEEC2ESt16initializer_listIiERKS0_(ptr noundef nonnull align 8 dereferenceable(24) %1, ptr nonnull %2, i64 4, ptr noundef nonnull align 1 dereferenceable(1) %3)
          to label %15 unwind label %39

15:                                               ; preds = %0
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %2) #7
  %16 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #7
  %17 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #7
  invoke void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEEvT_S7_(ptr %16, ptr %17)
          to label %18 unwind label %41

18:                                               ; preds = %15
  %19 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef 0) #7
  %20 = load i32, ptr %19, align 4, !tbaa !5
  store i32 %20, ptr @a, align 4, !tbaa !5
  %21 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef 1) #7
  %22 = load i32, ptr %21, align 4, !tbaa !5
  store i32 %22, ptr @b, align 4, !tbaa !5
  %23 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef 2) #7
  %24 = load i32, ptr %23, align 4, !tbaa !5
  store i32 %24, ptr @c, align 4, !tbaa !5
  %25 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef 3) #7
  %26 = load i32, ptr %25, align 4, !tbaa !5
  store i32 %26, ptr @d, align 4, !tbaa !5
  %27 = load i32, ptr @c, align 4, !tbaa !5
  %.not68 = icmp slt i32 %27, 1
  br i1 %.not68, label %.preheader62.preheader, label %.preheader64.preheader

.preheader62.preheader:                           ; preds = %._crit_edge, %18
  br label %.preheader62

.preheader64.preheader:                           ; preds = %18
  %28 = sext i32 %26 to i64
  %29 = add nuw i32 %27, 1
  %wide.trip.count = zext i32 %29 to i64
  br label %.preheader64

.preheader64:                                     ; preds = %.preheader64.preheader, %._crit_edge
  %indvar = phi i32 [ 0, %.preheader64.preheader ], [ %indvar.next, %._crit_edge ]
  %indvars.iv88 = phi i64 [ 1, %.preheader64.preheader ], [ %indvars.iv.next89, %._crit_edge ]
  %indvars.iv = phi i32 [ %26, %.preheader64.preheader ], [ %indvars.iv.next, %._crit_edge ]
  %.04869 = phi i64 [ 0, %.preheader64.preheader ], [ %.149.lcssa, %._crit_edge ]
  %.neg = add i32 %indvar, 1
  %.not5865 = icmp sgt i64 %indvars.iv88, %28
  br i1 %.not5865, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader64
  %30 = trunc i64 %.04869 to i32
  %31 = add i32 %indvars.iv, %30
  %32 = trunc nuw nsw i64 %indvars.iv88 to i32
  %xtraiter = and i32 %indvars.iv, 1
  %lcmp.mod.not = icmp eq i32 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.prol.loopexit, label %.prol.loopexit.unr-lcssa

.prol.loopexit.unr-lcssa:                         ; preds = %.lr.ph
  %33 = getelementptr inbounds [5001 x [5001 x i64]], ptr @dp, i64 0, i64 %indvars.iv88, i64 0
  %34 = load i64, ptr %33, align 8, !tbaa !9
  %35 = add nsw i64 %34, 1
  store i64 %35, ptr %33, align 8, !tbaa !9
  %36 = add i64 %.04869, 1
  %37 = add nuw nsw i32 %32, 1
  br label %.prol.loopexit

.prol.loopexit:                                   ; preds = %.prol.loopexit.unr-lcssa, %.lr.ph
  %.lcssa126.unr = phi i64 [ poison, %.lr.ph ], [ %36, %.prol.loopexit.unr-lcssa ]
  %.04667.unr = phi i32 [ %32, %.lr.ph ], [ %37, %.prol.loopexit.unr-lcssa ]
  %.14966.unr = phi i64 [ %.04869, %.lr.ph ], [ %36, %.prol.loopexit.unr-lcssa ]
  %38 = icmp eq i32 %26, %.neg
  br i1 %38, label %._crit_edge, label %.lr.ph.new

39:                                               ; preds = %0
  %40 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %2) #7
  br label %107

41:                                               ; preds = %15
  %42 = landingpad { ptr, i32 }
          cleanup
  br label %106

._crit_edge:                                      ; preds = %.prol.loopexit, %.lr.ph.new, %.preheader64
  %.149.lcssa = phi i64 [ %.04869, %.preheader64 ], [ %.lcssa126.unr, %.prol.loopexit ], [ %54, %.lr.ph.new ]
  %indvars.iv.next89 = add nuw nsw i64 %indvars.iv88, 1
  %indvars.iv.next = add i32 %indvars.iv, -1
  %exitcond91.not = icmp eq i64 %indvars.iv.next89, %wide.trip.count
  %indvar.next = add i32 %indvar, 1
  br i1 %exitcond91.not, label %.preheader62.preheader, label %.preheader64, !llvm.loop !11

.lr.ph.new:                                       ; preds = %.prol.loopexit, %.lr.ph.new
  %.04667 = phi i32 [ %55, %.lr.ph.new ], [ %.04667.unr, %.prol.loopexit ]
  %.14966 = phi i64 [ %54, %.lr.ph.new ], [ %.14966.unr, %.prol.loopexit ]
  %43 = xor i32 %.04667, %32
  %44 = zext nneg i32 %43 to i64
  %45 = getelementptr inbounds [5001 x [5001 x i64]], ptr @dp, i64 0, i64 %indvars.iv88, i64 %44
  %46 = load i64, ptr %45, align 8, !tbaa !9
  %47 = add nsw i64 %46, 1
  store i64 %47, ptr %45, align 8, !tbaa !9
  %48 = add nuw nsw i32 %.04667, 1
  %49 = xor i32 %48, %32
  %50 = zext nneg i32 %49 to i64
  %51 = getelementptr inbounds [5001 x [5001 x i64]], ptr @dp, i64 0, i64 %indvars.iv88, i64 %50
  %52 = load i64, ptr %51, align 8, !tbaa !9
  %53 = add nsw i64 %52, 1
  store i64 %53, ptr %51, align 8, !tbaa !9
  %54 = add i64 %.14966, 2
  %55 = add nuw nsw i32 %.04667, 2
  %lftr.wideiv.1 = trunc i64 %54 to i32
  %exitcond.not.1 = icmp eq i32 %31, %lftr.wideiv.1
  br i1 %exitcond.not.1, label %._crit_edge, label %.lr.ph.new, !llvm.loop !13

.preheader62:                                     ; preds = %.preheader62.preheader, %56
  %indvars.iv95 = phi i64 [ %indvars.iv.next96, %56 ], [ 0, %.preheader62.preheader ]
  %.phi.trans.insert = getelementptr inbounds [5001 x [5001 x i64]], ptr @dp, i64 0, i64 5000, i64 %indvars.iv95
  %.pre = load i64, ptr %.phi.trans.insert, align 8, !tbaa !9
  br label %57

56:                                               ; preds = %57
  %indvars.iv.next96 = add nuw nsw i64 %indvars.iv95, 1
  %exitcond98.not = icmp eq i64 %indvars.iv.next96, 5001
  br i1 %exitcond98.not, label %.preheader60, label %.preheader62, !llvm.loop !14

57:                                               ; preds = %69, %.preheader62
  %58 = phi i64 [ %.pre, %.preheader62 ], [ %72, %69 ]
  %indvars.iv92 = phi i64 [ 4999, %.preheader62 ], [ %indvars.iv.next93.3, %69 ]
  %59 = getelementptr inbounds [5001 x [5001 x i64]], ptr @dp, i64 0, i64 %indvars.iv92, i64 %indvars.iv95
  %60 = load i64, ptr %59, align 8, !tbaa !9
  %61 = add nsw i64 %60, %58
  store i64 %61, ptr %59, align 8, !tbaa !9
  %indvars.iv.next93 = add nsw i64 %indvars.iv92, -1
  %62 = getelementptr inbounds [5001 x [5001 x i64]], ptr @dp, i64 0, i64 %indvars.iv.next93, i64 %indvars.iv95
  %63 = load i64, ptr %62, align 8, !tbaa !9
  %64 = add nsw i64 %63, %61
  store i64 %64, ptr %62, align 8, !tbaa !9
  %indvars.iv.next93.1 = add nsw i64 %indvars.iv92, -2
  %65 = getelementptr inbounds [5001 x [5001 x i64]], ptr @dp, i64 0, i64 %indvars.iv.next93.1, i64 %indvars.iv95
  %66 = load i64, ptr %65, align 8, !tbaa !9
  %67 = add nsw i64 %66, %64
  store i64 %67, ptr %65, align 8, !tbaa !9
  %68 = icmp ugt i64 %indvars.iv.next93.1, 1
  br i1 %68, label %69, label %56, !llvm.loop !15

69:                                               ; preds = %57
  %indvars.iv.next93.2 = add nsw i64 %indvars.iv92, -3
  %70 = getelementptr inbounds [5001 x [5001 x i64]], ptr @dp, i64 0, i64 %indvars.iv.next93.2, i64 %indvars.iv95
  %71 = load i64, ptr %70, align 8, !tbaa !9
  %72 = add nsw i64 %71, %67
  store i64 %72, ptr %70, align 8, !tbaa !9
  %indvars.iv.next93.3 = add nsw i64 %indvars.iv92, -4
  br label %57

.preheader60:                                     ; preds = %56, %.loopexit
  %indvars.iv103 = phi i64 [ %indvars.iv.next104, %.loopexit ], [ 1, %56 ]
  %73 = getelementptr inbounds [5001 x i64], ptr @cnt, i64 0, i64 %indvars.iv103
  %.promoted = load i64, ptr %73, align 8, !tbaa !9
  %74 = insertelement <2 x i64> <i64 poison, i64 0>, i64 %.promoted, i64 0
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %.preheader60
  %index = phi i64 [ 0, %.preheader60 ], [ %index.next.1, %vector.body ]
  %vec.phi = phi <2 x i64> [ %74, %.preheader60 ], [ %81, %vector.body ]
  %vec.phi121 = phi <2 x i64> [ zeroinitializer, %.preheader60 ], [ %82, %vector.body ]
  %75 = getelementptr inbounds [5001 x [5001 x i64]], ptr @dp, i64 0, i64 %indvars.iv103, i64 %index
  %76 = getelementptr inbounds i8, ptr %75, i64 16
  %wide.load = load <2 x i64>, ptr %75, align 8, !tbaa !9
  %wide.load122 = load <2 x i64>, ptr %76, align 8, !tbaa !9
  %77 = add <2 x i64> %vec.phi, %wide.load
  %78 = add <2 x i64> %vec.phi121, %wide.load122
  %index.next = or disjoint i64 %index, 4
  %79 = getelementptr inbounds [5001 x [5001 x i64]], ptr @dp, i64 0, i64 %indvars.iv103, i64 %index.next
  %80 = getelementptr inbounds i8, ptr %79, i64 16
  %wide.load.1 = load <2 x i64>, ptr %79, align 8, !tbaa !9
  %wide.load122.1 = load <2 x i64>, ptr %80, align 8, !tbaa !9
  %81 = add <2 x i64> %77, %wide.load.1
  %82 = add <2 x i64> %78, %wide.load122.1
  %index.next.1 = add nuw nsw i64 %index, 8
  %83 = icmp eq i64 %index.next.1, 5000
  br i1 %83, label %.loopexit, label %vector.body, !llvm.loop !16

.preheader59:                                     ; preds = %.loopexit
  %84 = load i32, ptr @a, align 4, !tbaa !5
  %.not5481 = icmp slt i32 %84, 1
  br i1 %.not5481, label %._crit_edge84, label %.preheader.lr.ph

.preheader.lr.ph:                                 ; preds = %.preheader59
  %85 = load i32, ptr @b, align 4, !tbaa !5
  %86 = add i32 %85, 1
  %87 = add nuw i32 %84, 1
  %wide.trip.count115 = zext i32 %87 to i64
  %wide.trip.count112 = zext i32 %86 to i64
  br label %.preheader

.loopexit:                                        ; preds = %vector.body
  %bin.rdx = add <2 x i64> %82, %81
  %88 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx)
  %89 = getelementptr inbounds [5001 x [5001 x i64]], ptr @dp, i64 0, i64 %indvars.iv103, i64 5000
  %90 = load i64, ptr %89, align 8, !tbaa !9
  %91 = add nsw i64 %88, %90
  store i64 %91, ptr %73, align 8, !tbaa !9
  %indvars.iv.next104 = add nuw nsw i64 %indvars.iv103, 1
  %exitcond106.not = icmp eq i64 %indvars.iv.next104, 5001
  br i1 %exitcond106.not, label %.preheader59, label %.preheader60, !llvm.loop !19

.preheader:                                       ; preds = %.preheader.lr.ph, %._crit_edge79
  %indvars.iv107 = phi i64 [ 1, %.preheader.lr.ph ], [ %indvars.iv.next108, %._crit_edge79 ]
  %.04182 = phi i64 [ 0, %.preheader.lr.ph ], [ %.1.lcssa, %._crit_edge79 ]
  %indvars114 = trunc i64 %indvars.iv107 to i32
  %.not5775 = icmp slt i32 %85, %indvars114
  br i1 %.not5775, label %._crit_edge79, label %.lr.ph78

._crit_edge84:                                    ; preds = %._crit_edge79, %.preheader59
  %.041.lcssa = phi i64 [ 0, %.preheader59 ], [ %.1.lcssa, %._crit_edge79 ]
  %92 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %.041.lcssa)
          to label %101 unwind label %104

._crit_edge79:                                    ; preds = %.lr.ph78, %.preheader
  %.1.lcssa = phi i64 [ %.04182, %.preheader ], [ %100, %.lr.ph78 ]
  %indvars.iv.next108 = add nuw nsw i64 %indvars.iv107, 1
  %exitcond116.not = icmp eq i64 %indvars.iv.next108, %wide.trip.count115
  br i1 %exitcond116.not, label %._crit_edge84, label %.preheader, !llvm.loop !20

.lr.ph78:                                         ; preds = %.preheader, %.lr.ph78
  %indvars.iv109 = phi i64 [ %indvars.iv.next110, %.lr.ph78 ], [ %indvars.iv107, %.preheader ]
  %.176 = phi i64 [ %100, %.lr.ph78 ], [ %.04182, %.preheader ]
  %93 = xor i64 %indvars.iv109, %indvars.iv107
  %94 = getelementptr inbounds [5001 x i64], ptr @cnt, i64 0, i64 %indvars.iv109
  %95 = load i64, ptr %94, align 8, !tbaa !9
  %96 = and i64 %93, 4294967295
  %97 = getelementptr inbounds [5001 x [5001 x i64]], ptr @dp, i64 0, i64 %indvars.iv109, i64 %96
  %98 = load i64, ptr %97, align 8, !tbaa !9
  %99 = add i64 %95, %.176
  %100 = sub i64 %99, %98
  %indvars.iv.next110 = add nuw nsw i64 %indvars.iv109, 1
  %exitcond113.not = icmp eq i64 %indvars.iv.next110, %wide.trip.count112
  br i1 %exitcond113.not, label %._crit_edge79, label %.lr.ph78, !llvm.loop !21

101:                                              ; preds = %._crit_edge84
  %102 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %92, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %103 unwind label %104

103:                                              ; preds = %101
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %1) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %1) #7
  ret i32 0

104:                                              ; preds = %101, %._crit_edge84
  %105 = landingpad { ptr, i32 }
          cleanup
  br label %106

106:                                              ; preds = %104, %41
  %.pn = phi { ptr, i32 } [ %105, %104 ], [ %42, %41 ]
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %1) #7
  br label %107

107:                                              ; preds = %106, %39
  %.pn.pn = phi { ptr, i32 } [ %.pn, %106 ], [ %40, %39 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %1) #7
  resume { ptr, i32 } %.pn.pn
}

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 #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 nounwind uwtable
declare dso_local void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEEC2ESt16initializer_listIiERKS0_(ptr noundef nonnull align 8 dereferenceable(24), ptr, i64, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #0 align 2

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEEvT_S7_(ptr, ptr) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #5 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #5 align 2

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

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

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

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

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

attributes #0 = { 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 #1 = { 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 #2 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12, !17, !18}
!17 = !{!"llvm.loop.isvectorized", i32 1}
!18 = !{!"llvm.loop.unroll.runtime.disable"}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}
!21 = distinct !{!21, !12}


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