; LLVM IR from VastoLorde95/Competitive-Programming :: Codeforces/385 Division 1/Problem A (A)

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

@g = external dso_local global [2001 x %"class.std::vector"], align 16
@f = external dso_local global [2001 x i32], align 16
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@k = external dso_local global i32, align 4
@edge = external dso_local global [2001 x [2001 x i32]], align 16
@vis = external dso_local global [2001 x i32], align 16
@comp = external dso_local global %"class.std::vector", align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3dfsi(i32 noundef) #0

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

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #2 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i64, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i64, align 8
  %19 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %20 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %21 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %22 = getelementptr i8, ptr %21, i64 -24
  %23 = load i64, ptr %22, align 8
  %24 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %23
  %25 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %24, ptr noundef null)
  %26 = load ptr, ptr @_ZSt4cout, align 8, !tbaa !5
  %27 = getelementptr i8, ptr %26, i64 -24
  %28 = load i64, ptr %27, align 8
  %29 = getelementptr inbounds i8, ptr @_ZSt4cout, i64 %28
  %30 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %29, ptr noundef null)
  %31 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @n)
  %32 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %31, ptr noundef nonnull align 4 dereferenceable(4) @m)
  %33 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %32, ptr noundef nonnull align 4 dereferenceable(4) @k)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  store i32 1, ptr %2, align 4, !tbaa !8
  br label %34

34:                                               ; preds = %44, %0
  %35 = load i32, ptr %2, align 4, !tbaa !8
  %36 = load i32, ptr @k, align 4, !tbaa !8
  %37 = icmp sle i32 %35, %36
  br i1 %37, label %39, label %38

38:                                               ; preds = %34
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  br label %47

39:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  %40 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %41 = load i32, ptr %3, align 4, !tbaa !8
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [2001 x i32], ptr @f, i64 0, i64 %42
  store i32 1, ptr %43, align 4, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  br label %44

44:                                               ; preds = %39
  %45 = load i32, ptr %2, align 4, !tbaa !8
  %46 = add nsw i32 %45, 1
  store i32 %46, ptr %2, align 4, !tbaa !8
  br label %34, !llvm.loop !11

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

48:                                               ; preds = %74, %47
  %49 = load i32, ptr %4, align 4, !tbaa !8
  %50 = load i32, ptr @m, align 4, !tbaa !8
  %51 = icmp slt i32 %49, %50
  br i1 %51, label %53, label %52

52:                                               ; preds = %48
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  br label %77

53:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  %54 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %55 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %54, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %56 = load i32, ptr %5, align 4, !tbaa !8
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [2001 x %"class.std::vector"], ptr @g, i64 0, i64 %57
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %58, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %59 = load i32, ptr %6, align 4, !tbaa !8
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [2001 x %"class.std::vector"], ptr @g, i64 0, i64 %60
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %61, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %62 = load i32, ptr %6, align 4, !tbaa !8
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [2001 x [2001 x i32]], ptr @edge, i64 0, i64 %63
  %65 = load i32, ptr %5, align 4, !tbaa !8
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [2001 x i32], ptr %64, i64 0, i64 %66
  store i32 1, ptr %67, align 4, !tbaa !8
  %68 = load i32, ptr %5, align 4, !tbaa !8
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [2001 x [2001 x i32]], ptr @edge, i64 0, i64 %69
  %71 = load i32, ptr %6, align 4, !tbaa !8
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [2001 x i32], ptr %70, i64 0, i64 %72
  store i32 1, ptr %73, align 4, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  br label %74

74:                                               ; preds = %53
  %75 = load i32, ptr %4, align 4, !tbaa !8
  %76 = add nsw i32 %75, 1
  store i32 %76, ptr %4, align 4, !tbaa !8
  br label %48, !llvm.loop !13

77:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  store i64 0, ptr %7, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  store i64 0, ptr %8, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store i32 1, ptr %9, align 4, !tbaa !8
  br label %78

78:                                               ; preds = %147, %77
  %79 = load i32, ptr %9, align 4, !tbaa !8
  %80 = load i32, ptr @n, align 4, !tbaa !8
  %81 = icmp sle i32 %79, %80
  br i1 %81, label %83, label %82

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

83:                                               ; preds = %78
  %84 = load i32, ptr %9, align 4, !tbaa !8
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [2001 x i32], ptr @f, i64 0, i64 %85
  %87 = load i32, ptr %86, align 4, !tbaa !8
  %88 = icmp ne i32 %87, 0
  br i1 %88, label %89, label %146

89:                                               ; preds = %83
  call void @_ZNSt6vectorIiSaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) @comp) #7
  %90 = load i32, ptr %9, align 4, !tbaa !8
  call void @_Z3dfsi(i32 noundef %90)
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  store i64 0, ptr %11, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  store i32 0, ptr %12, align 4, !tbaa !8
  br label %91

91:                                               ; preds = %129, %89
  %92 = load i32, ptr %12, align 4, !tbaa !8
  %93 = sext i32 %92 to i64
  %94 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @comp) #7
  %95 = icmp ult i64 %93, %94
  br i1 %95, label %97, label %96

96:                                               ; preds = %91
  store i32 11, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  br label %132

97:                                               ; preds = %91
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  %98 = load i32, ptr %12, align 4, !tbaa !8
  %99 = add nsw i32 %98, 1
  store i32 %99, ptr %13, align 4, !tbaa !8
  br label %100

100:                                              ; preds = %125, %97
  %101 = load i32, ptr %13, align 4, !tbaa !8
  %102 = sext i32 %101 to i64
  %103 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @comp) #7
  %104 = icmp ult i64 %102, %103
  br i1 %104, label %106, label %105

105:                                              ; preds = %100
  store i32 14, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  br label %128

106:                                              ; preds = %100
  %107 = load i32, ptr %12, align 4, !tbaa !8
  %108 = sext i32 %107 to i64
  %109 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @comp, i64 noundef %108) #7
  %110 = load i32, ptr %109, align 4, !tbaa !8
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [2001 x [2001 x i32]], ptr @edge, i64 0, i64 %111
  %113 = load i32, ptr %13, align 4, !tbaa !8
  %114 = sext i32 %113 to i64
  %115 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @comp, i64 noundef %114) #7
  %116 = load i32, ptr %115, align 4, !tbaa !8
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [2001 x i32], ptr %112, i64 0, i64 %117
  %119 = load i32, ptr %118, align 4, !tbaa !8
  %120 = icmp ne i32 %119, 0
  br i1 %120, label %121, label %124

121:                                              ; preds = %106
  %122 = load i64, ptr %11, align 8, !tbaa !14
  %123 = add nsw i64 %122, 1
  store i64 %123, ptr %11, align 8, !tbaa !14
  br label %124

124:                                              ; preds = %121, %106
  br label %125

125:                                              ; preds = %124
  %126 = load i32, ptr %13, align 4, !tbaa !8
  %127 = add nsw i32 %126, 1
  store i32 %127, ptr %13, align 4, !tbaa !8
  br label %100, !llvm.loop !16

128:                                              ; preds = %105
  br label %129

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

132:                                              ; preds = %96
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  %133 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @comp) #7
  store i64 %133, ptr %14, align 8, !tbaa !14
  %134 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %14)
  %135 = load i64, ptr %134, align 8, !tbaa !14
  store i64 %135, ptr %7, align 8, !tbaa !14
  %136 = load i64, ptr %14, align 8, !tbaa !14
  %137 = load i64, ptr %14, align 8, !tbaa !14
  %138 = sub nsw i64 %137, 1
  %139 = mul nsw i64 %136, %138
  %140 = sdiv i64 %139, 2
  store i64 %140, ptr %14, align 8, !tbaa !14
  %141 = load i64, ptr %14, align 8, !tbaa !14
  %142 = load i64, ptr %11, align 8, !tbaa !14
  %143 = sub nsw i64 %141, %142
  %144 = load i64, ptr %8, align 8, !tbaa !14
  %145 = add nsw i64 %144, %143
  store i64 %145, ptr %8, align 8, !tbaa !14
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  br label %146

146:                                              ; preds = %132, %83
  br label %147

147:                                              ; preds = %146
  %148 = load i32, ptr %9, align 4, !tbaa !8
  %149 = add nsw i32 %148, 1
  store i32 %149, ptr %9, align 4, !tbaa !8
  br label %78, !llvm.loop !18

150:                                              ; preds = %82
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  store i64 0, ptr %15, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  store i32 1, ptr %16, align 4, !tbaa !8
  br label %151

151:                                              ; preds = %193, %150
  %152 = load i32, ptr %16, align 4, !tbaa !8
  %153 = load i32, ptr @n, align 4, !tbaa !8
  %154 = icmp sle i32 %152, %153
  br i1 %154, label %156, label %155

155:                                              ; preds = %151
  store i32 17, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  br label %196

156:                                              ; preds = %151
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  %157 = load i32, ptr %16, align 4, !tbaa !8
  %158 = add nsw i32 %157, 1
  store i32 %158, ptr %17, align 4, !tbaa !8
  br label %159

159:                                              ; preds = %189, %156
  %160 = load i32, ptr %17, align 4, !tbaa !8
  %161 = load i32, ptr @n, align 4, !tbaa !8
  %162 = icmp sle i32 %160, %161
  br i1 %162, label %164, label %163

163:                                              ; preds = %159
  store i32 20, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  br label %192

164:                                              ; preds = %159
  %165 = load i32, ptr %16, align 4, !tbaa !8
  %166 = sext i32 %165 to i64
  %167 = getelementptr inbounds [2001 x i32], ptr @vis, i64 0, i64 %166
  %168 = load i32, ptr %167, align 4, !tbaa !8
  %169 = icmp ne i32 %168, 0
  br i1 %169, label %188, label %170

170:                                              ; preds = %164
  %171 = load i32, ptr %17, align 4, !tbaa !8
  %172 = sext i32 %171 to i64
  %173 = getelementptr inbounds [2001 x i32], ptr @vis, i64 0, i64 %172
  %174 = load i32, ptr %173, align 4, !tbaa !8
  %175 = icmp ne i32 %174, 0
  br i1 %175, label %188, label %176

176:                                              ; preds = %170
  %177 = load i32, ptr %16, align 4, !tbaa !8
  %178 = sext i32 %177 to i64
  %179 = getelementptr inbounds [2001 x [2001 x i32]], ptr @edge, i64 0, i64 %178
  %180 = load i32, ptr %17, align 4, !tbaa !8
  %181 = sext i32 %180 to i64
  %182 = getelementptr inbounds [2001 x i32], ptr %179, i64 0, i64 %181
  %183 = load i32, ptr %182, align 4, !tbaa !8
  %184 = icmp ne i32 %183, 0
  br i1 %184, label %185, label %188

185:                                              ; preds = %176
  %186 = load i64, ptr %15, align 8, !tbaa !14
  %187 = add nsw i64 %186, 1
  store i64 %187, ptr %15, align 8, !tbaa !14
  br label %188

188:                                              ; preds = %185, %176, %170, %164
  br label %189

189:                                              ; preds = %188
  %190 = load i32, ptr %17, align 4, !tbaa !8
  %191 = add nsw i32 %190, 1
  store i32 %191, ptr %17, align 4, !tbaa !8
  br label %159, !llvm.loop !19

192:                                              ; preds = %163
  br label %193

193:                                              ; preds = %192
  %194 = load i32, ptr %16, align 4, !tbaa !8
  %195 = add nsw i32 %194, 1
  store i32 %195, ptr %16, align 4, !tbaa !8
  br label %151, !llvm.loop !20

196:                                              ; preds = %155
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  store i64 0, ptr %18, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  store i32 1, ptr %19, align 4, !tbaa !8
  br label %197

197:                                              ; preds = %212, %196
  %198 = load i32, ptr %19, align 4, !tbaa !8
  %199 = load i32, ptr @n, align 4, !tbaa !8
  %200 = icmp sle i32 %198, %199
  br i1 %200, label %202, label %201

201:                                              ; preds = %197
  store i32 23, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  br label %215

202:                                              ; preds = %197
  %203 = load i32, ptr %19, align 4, !tbaa !8
  %204 = sext i32 %203 to i64
  %205 = getelementptr inbounds [2001 x i32], ptr @vis, i64 0, i64 %204
  %206 = load i32, ptr %205, align 4, !tbaa !8
  %207 = icmp ne i32 %206, 0
  br i1 %207, label %211, label %208

208:                                              ; preds = %202
  %209 = load i64, ptr %18, align 8, !tbaa !14
  %210 = add nsw i64 %209, 1
  store i64 %210, ptr %18, align 8, !tbaa !14
  br label %211

211:                                              ; preds = %208, %202
  br label %212

212:                                              ; preds = %211
  %213 = load i32, ptr %19, align 4, !tbaa !8
  %214 = add nsw i32 %213, 1
  store i32 %214, ptr %19, align 4, !tbaa !8
  br label %197, !llvm.loop !21

215:                                              ; preds = %201
  %216 = load i64, ptr %18, align 8, !tbaa !14
  %217 = load i64, ptr %18, align 8, !tbaa !14
  %218 = sub nsw i64 %217, 1
  %219 = mul nsw i64 %216, %218
  %220 = sdiv i64 %219, 2
  %221 = load i64, ptr %15, align 8, !tbaa !14
  %222 = sub nsw i64 %220, %221
  %223 = load i64, ptr %8, align 8, !tbaa !14
  %224 = add nsw i64 %223, %222
  store i64 %224, ptr %8, align 8, !tbaa !14
  %225 = load i64, ptr %18, align 8, !tbaa !14
  %226 = load i64, ptr %7, align 8, !tbaa !14
  %227 = mul nsw i64 %225, %226
  %228 = load i64, ptr %8, align 8, !tbaa !14
  %229 = add nsw i64 %228, %227
  store i64 %229, ptr %8, align 8, !tbaa !14
  %230 = load i64, ptr %8, align 8, !tbaa !14
  %231 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %230)
  %232 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %231, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  %233 = load i32, ptr %1, align 4
  ret i32 %233
}

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

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

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: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24)) #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #4 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) #4 align 2

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


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::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::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" }

@g = external dso_local global [2001 x %"class.std::vector"], align 16
@f = external dso_local local_unnamed_addr global [2001 x i32], align 16
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@k = external dso_local global i32, align 4
@edge = external dso_local local_unnamed_addr global [2001 x [2001 x i32]], align 16
@vis = external dso_local local_unnamed_addr global [2001 x i32], align 16
@comp = external dso_local global %"class.std::vector", align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3dfsi(i32 noundef) local_unnamed_addr #0

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

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %7 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %8 = getelementptr i8, ptr %7, i64 -24
  %9 = load i64, ptr %8, align 8
  %10 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %9
  %11 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %10, ptr noundef null)
  %12 = load ptr, ptr @_ZSt4cout, align 8, !tbaa !5
  %13 = getelementptr i8, ptr %12, i64 -24
  %14 = load i64, ptr %13, align 8
  %15 = getelementptr inbounds i8, ptr @_ZSt4cout, i64 %14
  %16 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %15, ptr noundef null)
  %17 = 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) @n)
  %18 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %17, ptr noundef nonnull align 4 dereferenceable(4) @m)
  %19 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %18, ptr noundef nonnull align 4 dereferenceable(4) @k)
  %20 = load i32, ptr @k, align 4, !tbaa !8
  %.not72 = icmp slt i32 %20, 1
  br i1 %.not72, label %.preheader71, label %.lr.ph

.preheader71:                                     ; preds = %.lr.ph, %0
  %21 = load i32, ptr @m, align 4, !tbaa !8
  %22 = icmp sgt i32 %21, 0
  br i1 %22, label %.lr.ph75, label %._crit_edge

.lr.ph:                                           ; preds = %0, %.lr.ph
  %.05473 = phi i32 [ %27, %.lr.ph ], [ 1, %0 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #8
  %23 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %24 = load i32, ptr %1, align 4, !tbaa !8
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds [2001 x i32], ptr @f, i64 0, i64 %25
  store i32 1, ptr %26, align 4, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #8
  %27 = add nuw nsw i32 %.05473, 1
  %28 = load i32, ptr @k, align 4, !tbaa !8
  %.not.not = icmp slt i32 %.05473, %28
  br i1 %.not.not, label %.lr.ph, label %.preheader71, !llvm.loop !11

._crit_edge:                                      ; preds = %.lr.ph75, %.preheader71
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #8
  store i64 0, ptr %4, align 8, !tbaa !13
  %29 = load i32, ptr @n, align 4, !tbaa !8
  %.not5786 = icmp slt i32 %29, 1
  br i1 %.not5786, label %._crit_edge108, label %.lr.ph90

.lr.ph75:                                         ; preds = %.preheader71, %.lr.ph75
  %.05374 = phi i32 [ %44, %.lr.ph75 ], [ 0, %.preheader71 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #8
  %30 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %31 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %30, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %32 = load i32, ptr %2, align 4, !tbaa !8
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [2001 x %"class.std::vector"], ptr @g, i64 0, i64 %33
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %34, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %35 = load i32, ptr %3, align 4, !tbaa !8
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [2001 x %"class.std::vector"], ptr @g, i64 0, i64 %36
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %37, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %38 = load i32, ptr %3, align 4, !tbaa !8
  %39 = sext i32 %38 to i64
  %40 = load i32, ptr %2, align 4, !tbaa !8
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [2001 x [2001 x i32]], ptr @edge, i64 0, i64 %39, i64 %41
  store i32 1, ptr %42, align 4, !tbaa !8
  %43 = getelementptr inbounds [2001 x [2001 x i32]], ptr @edge, i64 0, i64 %41, i64 %39
  store i32 1, ptr %43, align 4, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #8
  %44 = add nuw nsw i32 %.05374, 1
  %45 = load i32, ptr @m, align 4, !tbaa !8
  %46 = icmp slt i32 %44, %45
  br i1 %46, label %.lr.ph75, label %._crit_edge, !llvm.loop !15

.preheader69:                                     ; preds = %81
  %.not5899 = icmp slt i32 %83, 1
  br i1 %.not5899, label %._crit_edge108, label %.lr.ph102.preheader

.lr.ph102.preheader:                              ; preds = %.preheader69
  %47 = add nuw i32 %83, 1
  %48 = zext nneg i32 %83 to i64
  %wide.trip.count = zext i32 %47 to i64
  %49 = add nsw i32 %83, -2
  br label %.lr.ph102

.lr.ph90:                                         ; preds = %._crit_edge, %81
  %50 = phi i64 [ %82, %81 ], [ 0, %._crit_edge ]
  %51 = phi i32 [ %83, %81 ], [ %29, %._crit_edge ]
  %indvars.iv118 = phi i64 [ %indvars.iv.next119, %81 ], [ 1, %._crit_edge ]
  %.05187 = phi i64 [ %.152, %81 ], [ 0, %._crit_edge ]
  %52 = getelementptr inbounds [2001 x i32], ptr @f, i64 0, i64 %indvars.iv118
  %53 = load i32, ptr %52, align 4, !tbaa !8
  %.not65 = icmp eq i32 %53, 0
  br i1 %.not65, label %81, label %54

54:                                               ; preds = %.lr.ph90
  call void @_ZNSt6vectorIiSaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) @comp) #8
  %55 = trunc nuw nsw i64 %indvars.iv118 to i32
  call void @_Z3dfsi(i32 noundef %55)
  %56 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @comp) #8
  %.not = icmp eq i64 %56, 0
  br i1 %.not, label %._crit_edge84, label %.lr.ph83

.loopexit70:                                      ; preds = %.lr.ph79, %.lr.ph83
  %.148.lcssa = phi i64 [ %.04780, %.lr.ph83 ], [ %spec.select, %.lr.ph79 ]
  %57 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @comp) #8
  %58 = icmp ugt i64 %57, %indvars.iv.next116
  %indvars.iv.next = add i64 %indvars.iv, 1
  br i1 %58, label %.lr.ph83, label %._crit_edge84, !llvm.loop !16

._crit_edge84:                                    ; preds = %.loopexit70, %54
  %.047.lcssa = phi i64 [ 0, %54 ], [ %.148.lcssa, %.loopexit70 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #8
  %59 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @comp) #8
  store i64 %59, ptr %5, align 8, !tbaa !13
  %60 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %61 = load i64, ptr %60, align 8, !tbaa !13
  store i64 %61, ptr %4, align 8, !tbaa !13
  %62 = load i64, ptr %5, align 8, !tbaa !13
  %63 = add nsw i64 %62, -1
  %64 = mul nsw i64 %63, %62
  %65 = sdiv i64 %64, 2
  %66 = sub i64 %.05187, %.047.lcssa
  %67 = add i64 %66, %65
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #8
  %.pre = load i32, ptr @n, align 4, !tbaa !8
  br label %81

.lr.ph83:                                         ; preds = %54, %.loopexit70
  %indvars.iv115 = phi i64 [ %indvars.iv.next116, %.loopexit70 ], [ 0, %54 ]
  %indvars.iv = phi i64 [ %indvars.iv.next, %.loopexit70 ], [ 1, %54 ]
  %.04780 = phi i64 [ %.148.lcssa, %.loopexit70 ], [ 0, %54 ]
  %indvars.iv.next116 = add nuw nsw i64 %indvars.iv115, 1
  %68 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @comp) #8
  %69 = icmp ugt i64 %68, %indvars.iv.next116
  br i1 %69, label %.lr.ph79, label %.loopexit70

.lr.ph79:                                         ; preds = %.lr.ph83, %.lr.ph79
  %indvars.iv112 = phi i64 [ %indvars.iv.next113, %.lr.ph79 ], [ %indvars.iv, %.lr.ph83 ]
  %.14876 = phi i64 [ %spec.select, %.lr.ph79 ], [ %.04780, %.lr.ph83 ]
  %70 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @comp, i64 noundef %indvars.iv115) #8
  %71 = load i32, ptr %70, align 4, !tbaa !8
  %72 = sext i32 %71 to i64
  %73 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @comp, i64 noundef %indvars.iv112) #8
  %74 = load i32, ptr %73, align 4, !tbaa !8
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [2001 x [2001 x i32]], ptr @edge, i64 0, i64 %72, i64 %75
  %77 = load i32, ptr %76, align 4, !tbaa !8
  %.not66 = icmp ne i32 %77, 0
  %78 = zext i1 %.not66 to i64
  %spec.select = add nsw i64 %.14876, %78
  %indvars.iv.next113 = add nuw nsw i64 %indvars.iv112, 1
  %79 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @comp) #8
  %80 = icmp ugt i64 %79, %indvars.iv.next113
  br i1 %80, label %.lr.ph79, label %.loopexit70, !llvm.loop !17

81:                                               ; preds = %.lr.ph90, %._crit_edge84
  %82 = phi i64 [ %61, %._crit_edge84 ], [ %50, %.lr.ph90 ]
  %83 = phi i32 [ %.pre, %._crit_edge84 ], [ %51, %.lr.ph90 ]
  %.152 = phi i64 [ %67, %._crit_edge84 ], [ %.05187, %.lr.ph90 ]
  %indvars.iv.next119 = add nuw nsw i64 %indvars.iv118, 1
  %84 = sext i32 %83 to i64
  %.not57.not = icmp slt i64 %indvars.iv118, %84
  br i1 %.not57.not, label %.lr.ph90, label %.preheader69, !llvm.loop !18

.loopexit:                                        ; preds = %.lr.ph97.split.us.prol.loopexit, %120, %.lr.ph97, %.lr.ph102
  %.144.lcssa = phi i64 [ %.043100, %.lr.ph102 ], [ %.043100, %.lr.ph97 ], [ %.2.us.lcssa.unr, %.lr.ph97.split.us.prol.loopexit ], [ %.2.us.1, %120 ]
  %indvars.iv.next122 = add nuw nsw i64 %indvars.iv121, 1
  %exitcond129.not = icmp eq i64 %indvars.iv.next127, %wide.trip.count
  %indvar.next = add i32 %indvar, 1
  br i1 %exitcond129.not, label %.preheader, label %.lr.ph102, !llvm.loop !19

.preheader:                                       ; preds = %.loopexit
  br i1 %.not5899, label %._crit_edge108, label %.lr.ph107.preheader

.lr.ph107.preheader:                              ; preds = %.preheader
  %85 = add nuw i32 %83, 1
  %wide.trip.count133 = zext i32 %85 to i64
  %86 = zext nneg i32 %83 to i64
  %min.iters.check = icmp ult i32 %83, 4
  br i1 %min.iters.check, label %.lr.ph107.preheader151, label %vector.ph

.lr.ph107.preheader151:                           ; preds = %middle.block, %.lr.ph107.preheader
  %indvars.iv130.ph = phi i64 [ 1, %.lr.ph107.preheader ], [ %ind.end, %middle.block ]
  %.040105.ph = phi i64 [ 0, %.lr.ph107.preheader ], [ %96, %middle.block ]
  br label %.lr.ph107

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

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.phi = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %93, %vector.body ]
  %vec.phi149 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %94, %vector.body ]
  %offset.idx = or disjoint i64 %index, 1
  %87 = getelementptr inbounds [2001 x i32], ptr @vis, i64 0, i64 %offset.idx
  %88 = getelementptr inbounds i8, ptr %87, i64 8
  %wide.load = load <2 x i32>, ptr %87, align 4, !tbaa !8
  %wide.load150 = load <2 x i32>, ptr %88, align 4, !tbaa !8
  %89 = icmp eq <2 x i32> %wide.load, zeroinitializer
  %90 = icmp eq <2 x i32> %wide.load150, zeroinitializer
  %91 = zext <2 x i1> %89 to <2 x i64>
  %92 = zext <2 x i1> %90 to <2 x i64>
  %93 = add <2 x i64> %vec.phi, %91
  %94 = add <2 x i64> %vec.phi149, %92
  %index.next = add nuw i64 %index, 4
  %95 = icmp eq i64 %index.next, %n.vec
  br i1 %95, label %middle.block, label %vector.body, !llvm.loop !20

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <2 x i64> %94, %93
  %96 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx)
  %cmp.n = icmp eq i64 %n.vec, %86
  br i1 %cmp.n, label %._crit_edge108, label %.lr.ph107.preheader151

.lr.ph102:                                        ; preds = %.lr.ph102.preheader, %.loopexit
  %indvar = phi i32 [ 0, %.lr.ph102.preheader ], [ %indvar.next, %.loopexit ]
  %indvars.iv126 = phi i64 [ 1, %.lr.ph102.preheader ], [ %indvars.iv.next127, %.loopexit ]
  %indvars.iv121 = phi i64 [ 2, %.lr.ph102.preheader ], [ %indvars.iv.next122, %.loopexit ]
  %.043100 = phi i64 [ 0, %.lr.ph102.preheader ], [ %.144.lcssa, %.loopexit ]
  %indvars.iv.next127 = add nuw nsw i64 %indvars.iv126, 1
  %.not6193.not = icmp ult i64 %indvars.iv126, %48
  br i1 %.not6193.not, label %.lr.ph97, label %.loopexit

.lr.ph97:                                         ; preds = %.lr.ph102
  %97 = getelementptr inbounds [2001 x i32], ptr @vis, i64 0, i64 %indvars.iv126
  %98 = load i32, ptr %97, align 4, !tbaa !8
  %.not62 = icmp eq i32 %98, 0
  br i1 %.not62, label %.lr.ph97.split.us.preheader, label %.loopexit

.lr.ph97.split.us.preheader:                      ; preds = %.lr.ph97
  %99 = sub i32 %indvar, %83
  %100 = and i32 %99, 1
  %lcmp.mod.not.not = icmp eq i32 %100, 0
  br i1 %lcmp.mod.not.not, label %.lr.ph97.split.us.prol, label %.lr.ph97.split.us.prol.loopexit

.lr.ph97.split.us.prol:                           ; preds = %.lr.ph97.split.us.preheader
  %101 = getelementptr inbounds [2001 x i32], ptr @vis, i64 0, i64 %indvars.iv121
  %102 = load i32, ptr %101, align 4, !tbaa !8
  %.not63.us.prol = icmp eq i32 %102, 0
  br i1 %.not63.us.prol, label %103, label %.lr.ph97.split.us.prol.loopexit.unr-lcssa

103:                                              ; preds = %.lr.ph97.split.us.prol
  %104 = getelementptr inbounds [2001 x [2001 x i32]], ptr @edge, i64 0, i64 %indvars.iv126, i64 %indvars.iv121
  %105 = load i32, ptr %104, align 4, !tbaa !8
  %.not64.us.prol = icmp ne i32 %105, 0
  %106 = zext i1 %.not64.us.prol to i64
  %spec.select67.us.prol = add nsw i64 %.043100, %106
  br label %.lr.ph97.split.us.prol.loopexit.unr-lcssa

.lr.ph97.split.us.prol.loopexit.unr-lcssa:        ; preds = %103, %.lr.ph97.split.us.prol
  %.2.us.prol = phi i64 [ %.043100, %.lr.ph97.split.us.prol ], [ %spec.select67.us.prol, %103 ]
  %indvars.iv.next124.prol = add nuw nsw i64 %indvars.iv121, 1
  br label %.lr.ph97.split.us.prol.loopexit

.lr.ph97.split.us.prol.loopexit:                  ; preds = %.lr.ph97.split.us.prol.loopexit.unr-lcssa, %.lr.ph97.split.us.preheader
  %.2.us.lcssa.unr = phi i64 [ poison, %.lr.ph97.split.us.preheader ], [ %.2.us.prol, %.lr.ph97.split.us.prol.loopexit.unr-lcssa ]
  %indvars.iv123.unr = phi i64 [ %indvars.iv121, %.lr.ph97.split.us.preheader ], [ %indvars.iv.next124.prol, %.lr.ph97.split.us.prol.loopexit.unr-lcssa ]
  %.14494.us.unr = phi i64 [ %.043100, %.lr.ph97.split.us.preheader ], [ %.2.us.prol, %.lr.ph97.split.us.prol.loopexit.unr-lcssa ]
  %107 = icmp eq i32 %49, %indvar
  br i1 %107, label %.loopexit, label %.lr.ph97.split.us

.lr.ph97.split.us:                                ; preds = %.lr.ph97.split.us.prol.loopexit, %120
  %indvars.iv123 = phi i64 [ %indvars.iv.next124.1, %120 ], [ %indvars.iv123.unr, %.lr.ph97.split.us.prol.loopexit ]
  %.14494.us = phi i64 [ %.2.us.1, %120 ], [ %.14494.us.unr, %.lr.ph97.split.us.prol.loopexit ]
  %108 = getelementptr inbounds [2001 x i32], ptr @vis, i64 0, i64 %indvars.iv123
  %109 = load i32, ptr %108, align 4, !tbaa !8
  %.not63.us = icmp eq i32 %109, 0
  br i1 %.not63.us, label %110, label %.lr.ph97.split.us.1

110:                                              ; preds = %.lr.ph97.split.us
  %111 = getelementptr inbounds [2001 x [2001 x i32]], ptr @edge, i64 0, i64 %indvars.iv126, i64 %indvars.iv123
  %112 = load i32, ptr %111, align 4, !tbaa !8
  %.not64.us = icmp ne i32 %112, 0
  %113 = zext i1 %.not64.us to i64
  %spec.select67.us = add nsw i64 %.14494.us, %113
  br label %.lr.ph97.split.us.1

.lr.ph97.split.us.1:                              ; preds = %110, %.lr.ph97.split.us
  %.2.us = phi i64 [ %.14494.us, %.lr.ph97.split.us ], [ %spec.select67.us, %110 ]
  %indvars.iv.next124 = add nuw nsw i64 %indvars.iv123, 1
  %114 = getelementptr inbounds [2001 x i32], ptr @vis, i64 0, i64 %indvars.iv.next124
  %115 = load i32, ptr %114, align 4, !tbaa !8
  %.not63.us.1 = icmp eq i32 %115, 0
  br i1 %.not63.us.1, label %116, label %120

116:                                              ; preds = %.lr.ph97.split.us.1
  %117 = getelementptr inbounds [2001 x [2001 x i32]], ptr @edge, i64 0, i64 %indvars.iv126, i64 %indvars.iv.next124
  %118 = load i32, ptr %117, align 4, !tbaa !8
  %.not64.us.1 = icmp ne i32 %118, 0
  %119 = zext i1 %.not64.us.1 to i64
  %spec.select67.us.1 = add nsw i64 %.2.us, %119
  br label %120

120:                                              ; preds = %116, %.lr.ph97.split.us.1
  %.2.us.1 = phi i64 [ %.2.us, %.lr.ph97.split.us.1 ], [ %spec.select67.us.1, %116 ]
  %indvars.iv.next124.1 = add nuw nsw i64 %indvars.iv123, 2
  %lftr.wideiv.1 = trunc i64 %indvars.iv.next124.1 to i32
  %exitcond.not.1 = icmp eq i32 %47, %lftr.wideiv.1
  br i1 %exitcond.not.1, label %.loopexit, label %.lr.ph97.split.us, !llvm.loop !23

._crit_edge108:                                   ; preds = %.lr.ph107, %middle.block, %._crit_edge, %.preheader69, %.preheader
  %.043.lcssa146 = phi i64 [ %.144.lcssa, %.preheader ], [ 0, %.preheader69 ], [ 0, %._crit_edge ], [ %.144.lcssa, %middle.block ], [ %.144.lcssa, %.lr.ph107 ]
  %121 = phi i64 [ %82, %.preheader ], [ %82, %.preheader69 ], [ 0, %._crit_edge ], [ %82, %middle.block ], [ %82, %.lr.ph107 ]
  %.051.lcssa138145 = phi i64 [ %.152, %.preheader ], [ %.152, %.preheader69 ], [ 0, %._crit_edge ], [ %.152, %middle.block ], [ %.152, %.lr.ph107 ]
  %.040.lcssa = phi i64 [ 0, %.preheader ], [ 0, %.preheader69 ], [ 0, %._crit_edge ], [ %96, %middle.block ], [ %spec.select68, %.lr.ph107 ]
  %122 = add nsw i64 %.040.lcssa, -1
  %123 = mul nsw i64 %122, %.040.lcssa
  %124 = sdiv i64 %123, 2
  %125 = mul nsw i64 %121, %.040.lcssa
  %126 = sub i64 %.051.lcssa138145, %.043.lcssa146
  %127 = add i64 %126, %124
  %128 = add nsw i64 %127, %125
  %129 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %128)
  %130 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %129, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #8
  ret i32 0

.lr.ph107:                                        ; preds = %.lr.ph107.preheader151, %.lr.ph107
  %indvars.iv130 = phi i64 [ %indvars.iv.next131, %.lr.ph107 ], [ %indvars.iv130.ph, %.lr.ph107.preheader151 ]
  %.040105 = phi i64 [ %spec.select68, %.lr.ph107 ], [ %.040105.ph, %.lr.ph107.preheader151 ]
  %131 = getelementptr inbounds [2001 x i32], ptr @vis, i64 0, i64 %indvars.iv130
  %132 = load i32, ptr %131, align 4, !tbaa !8
  %.not60 = icmp eq i32 %132, 0
  %133 = zext i1 %.not60 to i64
  %spec.select68 = add nuw nsw i64 %.040105, %133
  %indvars.iv.next131 = add nuw nsw i64 %indvars.iv130, 1
  %exitcond134.not = icmp eq i64 %indvars.iv.next131, %wide.trip.count133
  br i1 %exitcond134.not, label %._crit_edge108, label %.lr.ph107, !llvm.loop !24
}

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

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

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 nounwind uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #4 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 #4 align 2

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

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

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


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