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

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

@adj = external dso_local global [3001 x %"class.std::vector"], align 16
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@s1 = external dso_local global i32, align 4
@s2 = external dso_local global i32, align 4
@t1 = external dso_local global i32, align 4
@t2 = external dso_local global i32, align 4
@l1 = external dso_local global i32, align 4
@l2 = external dso_local global i32, align 4
@a = external dso_local global i32, align 4
@b = external dso_local global i32, align 4
@ans = external dso_local global i32, align 4
@di = external dso_local global [3001 x [3001 x i32]], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1

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

; 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 i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @m)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %12

12:                                               ; preds = %25, %0
  %13 = load i32, ptr %2, align 4, !tbaa !5
  %14 = load i32, ptr @m, align 4, !tbaa !5
  %15 = icmp slt i32 %13, %14
  br i1 %15, label %17, label %16

16:                                               ; preds = %12
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  br label %28

17:                                               ; preds = %12
  %18 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @a, ptr noundef @b)
  %19 = load i32, ptr @a, align 4, !tbaa !5
  %20 = sext i32 %19 to i64
  %21 = getelementptr inbounds [3001 x %"class.std::vector"], ptr @adj, i64 0, i64 %20
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %21, ptr noundef nonnull align 4 dereferenceable(4) @b)
  %22 = load i32, ptr @b, align 4, !tbaa !5
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds [3001 x %"class.std::vector"], ptr @adj, i64 0, i64 %23
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %24, ptr noundef nonnull align 4 dereferenceable(4) @a)
  br label %25

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

28:                                               ; preds = %16
  %29 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef @s1, ptr noundef @t1, ptr noundef @l1)
  %30 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef @s2, ptr noundef @t2, ptr noundef @l2)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %31

31:                                               ; preds = %53, %28
  %32 = load i32, ptr %3, align 4, !tbaa !5
  %33 = load i32, ptr @n, align 4, !tbaa !5
  %34 = icmp sle i32 %32, %33
  br i1 %34, label %36, label %35

35:                                               ; preds = %31
  store i32 5, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  br label %56

36:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  store i32 1, ptr %5, align 4, !tbaa !5
  br label %37

37:                                               ; preds = %49, %36
  %38 = load i32, ptr %5, align 4, !tbaa !5
  %39 = load i32, ptr @n, align 4, !tbaa !5
  %40 = icmp sle i32 %38, %39
  br i1 %40, label %42, label %41

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

42:                                               ; preds = %37
  %43 = load i32, ptr %3, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [3001 x [3001 x i32]], ptr @di, i64 0, i64 %44
  %46 = load i32, ptr %5, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [3001 x i32], ptr %45, i64 0, i64 %47
  store i32 -1, ptr %48, align 4, !tbaa !5
  br label %49

49:                                               ; preds = %42
  %50 = load i32, ptr %5, align 4, !tbaa !5
  %51 = add nsw i32 %50, 1
  store i32 %51, ptr %5, align 4, !tbaa !5
  br label %37, !llvm.loop !11

52:                                               ; preds = %41
  br label %53

53:                                               ; preds = %52
  %54 = load i32, ptr %3, align 4, !tbaa !5
  %55 = add nsw i32 %54, 1
  store i32 %55, ptr %3, align 4, !tbaa !5
  br label %31, !llvm.loop !12

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

57:                                               ; preds = %64, %56
  %58 = load i32, ptr %6, align 4, !tbaa !5
  %59 = load i32, ptr @n, align 4, !tbaa !5
  %60 = icmp sle i32 %58, %59
  br i1 %60, label %62, label %61

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

62:                                               ; preds = %57
  %63 = load i32, ptr %6, align 4, !tbaa !5
  call void @_Z3bfsi(i32 noundef %63)
  br label %64

64:                                               ; preds = %62
  %65 = load i32, ptr %6, align 4, !tbaa !5
  %66 = add nsw i32 %65, 1
  store i32 %66, ptr %6, align 4, !tbaa !5
  br label %57, !llvm.loop !13

67:                                               ; preds = %61
  %68 = load i32, ptr @s1, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [3001 x [3001 x i32]], ptr @di, i64 0, i64 %69
  %71 = load i32, ptr @t1, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [3001 x i32], ptr %70, i64 0, i64 %72
  %74 = load i32, ptr %73, align 4, !tbaa !5
  %75 = load i32, ptr @l1, align 4, !tbaa !5
  %76 = icmp sgt i32 %74, %75
  br i1 %76, label %87, label %77

77:                                               ; preds = %67
  %78 = load i32, ptr @s2, align 4, !tbaa !5
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [3001 x [3001 x i32]], ptr @di, i64 0, i64 %79
  %81 = load i32, ptr @t2, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [3001 x i32], ptr %80, i64 0, i64 %82
  %84 = load i32, ptr %83, align 4, !tbaa !5
  %85 = load i32, ptr @l2, align 4, !tbaa !5
  %86 = icmp sgt i32 %84, %85
  br i1 %86, label %87, label %89

87:                                               ; preds = %77, %67
  %88 = call i32 (ptr, ...) @printf(ptr noundef @.str.2)
  store i32 0, ptr %1, align 4
  br label %322

89:                                               ; preds = %77
  %90 = load i32, ptr @s1, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [3001 x [3001 x i32]], ptr @di, i64 0, i64 %91
  %93 = load i32, ptr @t1, align 4, !tbaa !5
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [3001 x i32], ptr %92, i64 0, i64 %94
  %96 = load i32, ptr %95, align 4, !tbaa !5
  %97 = load i32, ptr @s2, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [3001 x [3001 x i32]], ptr @di, i64 0, i64 %98
  %100 = load i32, ptr @t2, align 4, !tbaa !5
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [3001 x i32], ptr %99, i64 0, i64 %101
  %103 = load i32, ptr %102, align 4, !tbaa !5
  %104 = add nsw i32 %96, %103
  store i32 %104, ptr @ans, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store i32 1, ptr %7, align 4, !tbaa !5
  br label %105

105:                                              ; preds = %314, %89
  %106 = load i32, ptr %7, align 4, !tbaa !5
  %107 = load i32, ptr @n, align 4, !tbaa !5
  %108 = icmp sle i32 %106, %107
  br i1 %108, label %110, label %109

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

110:                                              ; preds = %105
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 1, ptr %8, align 4, !tbaa !5
  br label %111

111:                                              ; preds = %310, %110
  %112 = load i32, ptr %8, align 4, !tbaa !5
  %113 = load i32, ptr @n, align 4, !tbaa !5
  %114 = icmp sle i32 %112, %113
  br i1 %114, label %116, label %115

115:                                              ; preds = %111
  store i32 17, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %313

116:                                              ; preds = %111
  %117 = load i32, ptr %7, align 4, !tbaa !5
  %118 = load i32, ptr %8, align 4, !tbaa !5
  %119 = icmp ne i32 %117, %118
  br i1 %119, label %120, label %309

120:                                              ; preds = %116
  %121 = load i32, ptr @s1, align 4, !tbaa !5
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [3001 x [3001 x i32]], ptr @di, i64 0, i64 %122
  %124 = load i32, ptr %7, align 4, !tbaa !5
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [3001 x i32], ptr %123, i64 0, i64 %125
  %127 = load i32, ptr %126, align 4, !tbaa !5
  %128 = load i32, ptr %7, align 4, !tbaa !5
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds [3001 x [3001 x i32]], ptr @di, i64 0, i64 %129
  %131 = load i32, ptr %8, align 4, !tbaa !5
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds [3001 x i32], ptr %130, i64 0, i64 %132
  %134 = load i32, ptr %133, align 4, !tbaa !5
  %135 = add nsw i32 %127, %134
  %136 = load i32, ptr %8, align 4, !tbaa !5
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds [3001 x [3001 x i32]], ptr @di, i64 0, i64 %137
  %139 = load i32, ptr @t1, align 4, !tbaa !5
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds [3001 x i32], ptr %138, i64 0, i64 %140
  %142 = load i32, ptr %141, align 4, !tbaa !5
  %143 = add nsw i32 %135, %142
  %144 = load i32, ptr @l1, align 4, !tbaa !5
  %145 = icmp sle i32 %143, %144
  br i1 %145, label %146, label %214

146:                                              ; preds = %120
  %147 = load i32, ptr @s2, align 4, !tbaa !5
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds [3001 x [3001 x i32]], ptr @di, i64 0, i64 %148
  %150 = load i32, ptr %7, align 4, !tbaa !5
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds [3001 x i32], ptr %149, i64 0, i64 %151
  %153 = load i32, ptr %152, align 4, !tbaa !5
  %154 = load i32, ptr %7, align 4, !tbaa !5
  %155 = sext i32 %154 to i64
  %156 = getelementptr inbounds [3001 x [3001 x i32]], ptr @di, i64 0, i64 %155
  %157 = load i32, ptr %8, align 4, !tbaa !5
  %158 = sext i32 %157 to i64
  %159 = getelementptr inbounds [3001 x i32], ptr %156, i64 0, i64 %158
  %160 = load i32, ptr %159, align 4, !tbaa !5
  %161 = add nsw i32 %153, %160
  %162 = load i32, ptr %8, align 4, !tbaa !5
  %163 = sext i32 %162 to i64
  %164 = getelementptr inbounds [3001 x [3001 x i32]], ptr @di, i64 0, i64 %163
  %165 = load i32, ptr @t2, align 4, !tbaa !5
  %166 = sext i32 %165 to i64
  %167 = getelementptr inbounds [3001 x i32], ptr %164, i64 0, i64 %166
  %168 = load i32, ptr %167, align 4, !tbaa !5
  %169 = add nsw i32 %161, %168
  %170 = load i32, ptr @l2, align 4, !tbaa !5
  %171 = icmp sle i32 %169, %170
  br i1 %171, label %172, label %214

172:                                              ; preds = %146
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  %173 = load i32, ptr @s1, align 4, !tbaa !5
  %174 = sext i32 %173 to i64
  %175 = getelementptr inbounds [3001 x [3001 x i32]], ptr @di, i64 0, i64 %174
  %176 = load i32, ptr %7, align 4, !tbaa !5
  %177 = sext i32 %176 to i64
  %178 = getelementptr inbounds [3001 x i32], ptr %175, i64 0, i64 %177
  %179 = load i32, ptr %178, align 4, !tbaa !5
  %180 = load i32, ptr @s2, align 4, !tbaa !5
  %181 = sext i32 %180 to i64
  %182 = getelementptr inbounds [3001 x [3001 x i32]], ptr @di, i64 0, i64 %181
  %183 = load i32, ptr %7, align 4, !tbaa !5
  %184 = sext i32 %183 to i64
  %185 = getelementptr inbounds [3001 x i32], ptr %182, i64 0, i64 %184
  %186 = load i32, ptr %185, align 4, !tbaa !5
  %187 = add nsw i32 %179, %186
  %188 = load i32, ptr %7, align 4, !tbaa !5
  %189 = sext i32 %188 to i64
  %190 = getelementptr inbounds [3001 x [3001 x i32]], ptr @di, i64 0, i64 %189
  %191 = load i32, ptr %8, align 4, !tbaa !5
  %192 = sext i32 %191 to i64
  %193 = getelementptr inbounds [3001 x i32], ptr %190, i64 0, i64 %192
  %194 = load i32, ptr %193, align 4, !tbaa !5
  %195 = add nsw i32 %187, %194
  %196 = load i32, ptr %8, align 4, !tbaa !5
  %197 = sext i32 %196 to i64
  %198 = getelementptr inbounds [3001 x [3001 x i32]], ptr @di, i64 0, i64 %197
  %199 = load i32, ptr @t1, align 4, !tbaa !5
  %200 = sext i32 %199 to i64
  %201 = getelementptr inbounds [3001 x i32], ptr %198, i64 0, i64 %200
  %202 = load i32, ptr %201, align 4, !tbaa !5
  %203 = add nsw i32 %195, %202
  %204 = load i32, ptr %8, align 4, !tbaa !5
  %205 = sext i32 %204 to i64
  %206 = getelementptr inbounds [3001 x [3001 x i32]], ptr @di, i64 0, i64 %205
  %207 = load i32, ptr @t2, align 4, !tbaa !5
  %208 = sext i32 %207 to i64
  %209 = getelementptr inbounds [3001 x i32], ptr %206, i64 0, i64 %208
  %210 = load i32, ptr %209, align 4, !tbaa !5
  %211 = add nsw i32 %203, %210
  store i32 %211, ptr %9, align 4, !tbaa !5
  %212 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @ans, ptr noundef nonnull align 4 dereferenceable(4) %9)
  %213 = load i32, ptr %212, align 4, !tbaa !5
  store i32 %213, ptr @ans, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %214

214:                                              ; preds = %172, %146, %120
  %215 = load i32, ptr @t1, align 4, !tbaa !5
  %216 = sext i32 %215 to i64
  %217 = getelementptr inbounds [3001 x [3001 x i32]], ptr @di, i64 0, i64 %216
  %218 = load i32, ptr %7, align 4, !tbaa !5
  %219 = sext i32 %218 to i64
  %220 = getelementptr inbounds [3001 x i32], ptr %217, i64 0, i64 %219
  %221 = load i32, ptr %220, align 4, !tbaa !5
  %222 = load i32, ptr %7, align 4, !tbaa !5
  %223 = sext i32 %222 to i64
  %224 = getelementptr inbounds [3001 x [3001 x i32]], ptr @di, i64 0, i64 %223
  %225 = load i32, ptr %8, align 4, !tbaa !5
  %226 = sext i32 %225 to i64
  %227 = getelementptr inbounds [3001 x i32], ptr %224, i64 0, i64 %226
  %228 = load i32, ptr %227, align 4, !tbaa !5
  %229 = add nsw i32 %221, %228
  %230 = load i32, ptr %8, align 4, !tbaa !5
  %231 = sext i32 %230 to i64
  %232 = getelementptr inbounds [3001 x [3001 x i32]], ptr @di, i64 0, i64 %231
  %233 = load i32, ptr @s1, align 4, !tbaa !5
  %234 = sext i32 %233 to i64
  %235 = getelementptr inbounds [3001 x i32], ptr %232, i64 0, i64 %234
  %236 = load i32, ptr %235, align 4, !tbaa !5
  %237 = add nsw i32 %229, %236
  %238 = load i32, ptr @l1, align 4, !tbaa !5
  %239 = icmp sle i32 %237, %238
  br i1 %239, label %240, label %308

240:                                              ; preds = %214
  %241 = load i32, ptr @s2, align 4, !tbaa !5
  %242 = sext i32 %241 to i64
  %243 = getelementptr inbounds [3001 x [3001 x i32]], ptr @di, i64 0, i64 %242
  %244 = load i32, ptr %7, align 4, !tbaa !5
  %245 = sext i32 %244 to i64
  %246 = getelementptr inbounds [3001 x i32], ptr %243, i64 0, i64 %245
  %247 = load i32, ptr %246, align 4, !tbaa !5
  %248 = load i32, ptr %7, align 4, !tbaa !5
  %249 = sext i32 %248 to i64
  %250 = getelementptr inbounds [3001 x [3001 x i32]], ptr @di, i64 0, i64 %249
  %251 = load i32, ptr %8, align 4, !tbaa !5
  %252 = sext i32 %251 to i64
  %253 = getelementptr inbounds [3001 x i32], ptr %250, i64 0, i64 %252
  %254 = load i32, ptr %253, align 4, !tbaa !5
  %255 = add nsw i32 %247, %254
  %256 = load i32, ptr %8, align 4, !tbaa !5
  %257 = sext i32 %256 to i64
  %258 = getelementptr inbounds [3001 x [3001 x i32]], ptr @di, i64 0, i64 %257
  %259 = load i32, ptr @t2, align 4, !tbaa !5
  %260 = sext i32 %259 to i64
  %261 = getelementptr inbounds [3001 x i32], ptr %258, i64 0, i64 %260
  %262 = load i32, ptr %261, align 4, !tbaa !5
  %263 = add nsw i32 %255, %262
  %264 = load i32, ptr @l2, align 4, !tbaa !5
  %265 = icmp sle i32 %263, %264
  br i1 %265, label %266, label %308

266:                                              ; preds = %240
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %267 = load i32, ptr @t1, align 4, !tbaa !5
  %268 = sext i32 %267 to i64
  %269 = getelementptr inbounds [3001 x [3001 x i32]], ptr @di, i64 0, i64 %268
  %270 = load i32, ptr %7, align 4, !tbaa !5
  %271 = sext i32 %270 to i64
  %272 = getelementptr inbounds [3001 x i32], ptr %269, i64 0, i64 %271
  %273 = load i32, ptr %272, align 4, !tbaa !5
  %274 = load i32, ptr @s2, align 4, !tbaa !5
  %275 = sext i32 %274 to i64
  %276 = getelementptr inbounds [3001 x [3001 x i32]], ptr @di, i64 0, i64 %275
  %277 = load i32, ptr %7, align 4, !tbaa !5
  %278 = sext i32 %277 to i64
  %279 = getelementptr inbounds [3001 x i32], ptr %276, i64 0, i64 %278
  %280 = load i32, ptr %279, align 4, !tbaa !5
  %281 = add nsw i32 %273, %280
  %282 = load i32, ptr %7, align 4, !tbaa !5
  %283 = sext i32 %282 to i64
  %284 = getelementptr inbounds [3001 x [3001 x i32]], ptr @di, i64 0, i64 %283
  %285 = load i32, ptr %8, align 4, !tbaa !5
  %286 = sext i32 %285 to i64
  %287 = getelementptr inbounds [3001 x i32], ptr %284, i64 0, i64 %286
  %288 = load i32, ptr %287, align 4, !tbaa !5
  %289 = add nsw i32 %281, %288
  %290 = load i32, ptr %8, align 4, !tbaa !5
  %291 = sext i32 %290 to i64
  %292 = getelementptr inbounds [3001 x [3001 x i32]], ptr @di, i64 0, i64 %291
  %293 = load i32, ptr @s1, align 4, !tbaa !5
  %294 = sext i32 %293 to i64
  %295 = getelementptr inbounds [3001 x i32], ptr %292, i64 0, i64 %294
  %296 = load i32, ptr %295, align 4, !tbaa !5
  %297 = add nsw i32 %289, %296
  %298 = load i32, ptr %8, align 4, !tbaa !5
  %299 = sext i32 %298 to i64
  %300 = getelementptr inbounds [3001 x [3001 x i32]], ptr @di, i64 0, i64 %299
  %301 = load i32, ptr @t2, align 4, !tbaa !5
  %302 = sext i32 %301 to i64
  %303 = getelementptr inbounds [3001 x i32], ptr %300, i64 0, i64 %302
  %304 = load i32, ptr %303, align 4, !tbaa !5
  %305 = add nsw i32 %297, %304
  store i32 %305, ptr %10, align 4, !tbaa !5
  %306 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @ans, ptr noundef nonnull align 4 dereferenceable(4) %10)
  %307 = load i32, ptr %306, align 4, !tbaa !5
  store i32 %307, ptr @ans, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %308

308:                                              ; preds = %266, %240, %214
  br label %309

309:                                              ; preds = %308, %116
  br label %310

310:                                              ; preds = %309
  %311 = load i32, ptr %8, align 4, !tbaa !5
  %312 = add nsw i32 %311, 1
  store i32 %312, ptr %8, align 4, !tbaa !5
  br label %111, !llvm.loop !14

313:                                              ; preds = %115
  br label %314

314:                                              ; preds = %313
  %315 = load i32, ptr %7, align 4, !tbaa !5
  %316 = add nsw i32 %315, 1
  store i32 %316, ptr %7, align 4, !tbaa !5
  br label %105, !llvm.loop !15

317:                                              ; preds = %109
  %318 = load i32, ptr @m, align 4, !tbaa !5
  %319 = load i32, ptr @ans, align 4, !tbaa !5
  %320 = sub nsw i32 %318, %319
  %321 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %320)
  store i32 0, ptr %1, align 4
  br label %322

322:                                              ; preds = %317, %87
  %323 = load i32, ptr %1, align 4
  ret i32 %323
}

declare i32 @__isoc99_scanf(ptr noundef, ...) #3

; 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

declare i32 @printf(ptr noundef, ...) #3

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

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 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}


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

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

@adj = external dso_local global [3001 x %"class.std::vector"], align 16
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@s1 = external dso_local global i32, align 4
@s2 = external dso_local global i32, align 4
@t1 = external dso_local global i32, align 4
@t2 = external dso_local global i32, align 4
@l1 = external dso_local global i32, align 4
@l2 = external dso_local global i32, align 4
@a = external dso_local global i32, align 4
@b = external dso_local global i32, align 4
@ans = external dso_local global i32, align 4
@di = external dso_local local_unnamed_addr global [3001 x [3001 x i32]], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1

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

; 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 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @m)
  %4 = load i32, ptr @m, align 4, !tbaa !5
  %5 = icmp sgt i32 %4, 0
  br i1 %5, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %0
  %6 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @s1, ptr noundef nonnull @t1, ptr noundef nonnull @l1)
  %7 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @s2, ptr noundef nonnull @t2, ptr noundef nonnull @l2)
  %8 = load i32, ptr @n, align 4, !tbaa !5
  %.not70 = icmp slt i32 %8, 1
  br i1 %.not70, label %._crit_edge75, label %.preheader64.preheader

.preheader64.preheader:                           ; preds = %._crit_edge
  %9 = zext nneg i32 %8 to i64
  %10 = shl nuw nsw i64 %9, 2
  %xtraiter = and i64 %9, 7
  %11 = icmp ult i32 %8, 8
  br i1 %11, label %.preheader63.unr-lcssa, label %.preheader64.preheader.new

.preheader64.preheader.new:                       ; preds = %.preheader64.preheader
  %unroll_iter = and i64 %9, 2147483640
  br label %.preheader64

.lr.ph:                                           ; preds = %0, %.lr.ph
  %.05065 = phi i32 [ %19, %.lr.ph ], [ 0, %0 ]
  %12 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @a, ptr noundef nonnull @b)
  %13 = load i32, ptr @a, align 4, !tbaa !5
  %14 = sext i32 %13 to i64
  %15 = getelementptr inbounds [3001 x %"class.std::vector"], ptr @adj, i64 0, i64 %14
  tail call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %15, ptr noundef nonnull align 4 dereferenceable(4) @b)
  %16 = load i32, ptr @b, align 4, !tbaa !5
  %17 = sext i32 %16 to i64
  %18 = getelementptr inbounds [3001 x %"class.std::vector"], ptr @adj, i64 0, i64 %17
  tail call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %18, ptr noundef nonnull align 4 dereferenceable(4) @a)
  %19 = add nuw nsw i32 %.05065, 1
  %20 = load i32, ptr @m, align 4, !tbaa !5
  %21 = icmp slt i32 %19, %20
  br i1 %21, label %.lr.ph, label %._crit_edge, !llvm.loop !9

.preheader64:                                     ; preds = %.preheader64, %.preheader64.preheader.new
  %indvar = phi i64 [ 0, %.preheader64.preheader.new ], [ %indvar.next.7, %.preheader64 ]
  %niter = phi i64 [ 0, %.preheader64.preheader.new ], [ %niter.next.7, %.preheader64 ]
  %22 = mul nuw nsw i64 %indvar, 12004
  %gep = getelementptr i8, ptr getelementptr inbounds (i8, ptr @di, i64 12008), i64 %22
  tail call void @llvm.memset.p0.i64(ptr align 8 %gep, i8 -1, i64 %10, i1 false), !tbaa !5
  %23 = mul nuw i64 %indvar, 12004
  %gep113 = getelementptr i8, ptr getelementptr (i8, ptr getelementptr inbounds (i8, ptr @di, i64 12008), i64 12004), i64 %23
  tail call void @llvm.memset.p0.i64(ptr align 4 %gep113, i8 -1, i64 %10, i1 false), !tbaa !5
  %24 = mul nuw i64 %indvar, 12004
  %gep114 = getelementptr i8, ptr getelementptr (i8, ptr getelementptr inbounds (i8, ptr @di, i64 12008), i64 24008), i64 %24
  tail call void @llvm.memset.p0.i64(ptr align 16 %gep114, i8 -1, i64 %10, i1 false), !tbaa !5
  %25 = mul nuw i64 %indvar, 12004
  %gep115 = getelementptr i8, ptr getelementptr (i8, ptr getelementptr inbounds (i8, ptr @di, i64 12008), i64 36012), i64 %25
  tail call void @llvm.memset.p0.i64(ptr align 4 %gep115, i8 -1, i64 %10, i1 false), !tbaa !5
  %26 = mul nuw i64 %indvar, 12004
  %gep116 = getelementptr i8, ptr getelementptr (i8, ptr getelementptr inbounds (i8, ptr @di, i64 12008), i64 48016), i64 %26
  tail call void @llvm.memset.p0.i64(ptr align 8 %gep116, i8 -1, i64 %10, i1 false), !tbaa !5
  %27 = mul nuw i64 %indvar, 12004
  %gep117 = getelementptr i8, ptr getelementptr (i8, ptr getelementptr inbounds (i8, ptr @di, i64 12008), i64 60020), i64 %27
  tail call void @llvm.memset.p0.i64(ptr align 4 %gep117, i8 -1, i64 %10, i1 false), !tbaa !5
  %28 = mul nuw i64 %indvar, 12004
  %gep118 = getelementptr i8, ptr getelementptr (i8, ptr getelementptr inbounds (i8, ptr @di, i64 12008), i64 72024), i64 %28
  tail call void @llvm.memset.p0.i64(ptr align 16 %gep118, i8 -1, i64 %10, i1 false), !tbaa !5
  %29 = mul nuw i64 %indvar, 12004
  %gep119 = getelementptr i8, ptr getelementptr (i8, ptr getelementptr inbounds (i8, ptr @di, i64 12008), i64 84028), i64 %29
  tail call void @llvm.memset.p0.i64(ptr align 4 %gep119, i8 -1, i64 %10, i1 false), !tbaa !5
  %indvar.next.7 = add nuw nsw i64 %indvar, 8
  %niter.next.7 = add i64 %niter, 8
  %niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter
  br i1 %niter.ncmp.7, label %.preheader63.unr-lcssa, label %.preheader64, !llvm.loop !11

.preheader63.unr-lcssa:                           ; preds = %.preheader64, %.preheader64.preheader
  %indvar.unr = phi i64 [ 0, %.preheader64.preheader ], [ %indvar.next.7, %.preheader64 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader63, label %.preheader64.epil

.preheader64.epil:                                ; preds = %.preheader63.unr-lcssa, %.preheader64.epil
  %indvar.epil = phi i64 [ %indvar.next.epil, %.preheader64.epil ], [ %indvar.unr, %.preheader63.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.preheader64.epil ], [ 0, %.preheader63.unr-lcssa ]
  %30 = mul nuw nsw i64 %indvar.epil, 12004
  %gep.epil = getelementptr i8, ptr getelementptr inbounds (i8, ptr @di, i64 12008), i64 %30
  tail call void @llvm.memset.p0.i64(ptr align 4 %gep.epil, i8 -1, i64 %10, i1 false), !tbaa !5
  %indvar.next.epil = add nuw nsw i64 %indvar.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %.preheader63, label %.preheader64.epil, !llvm.loop !12

.preheader63:                                     ; preds = %.preheader64.epil, %.preheader63.unr-lcssa
  br i1 %.not70, label %._crit_edge75, label %.lr.ph74

._crit_edge75:                                    ; preds = %.lr.ph74, %._crit_edge, %.preheader63
  %31 = phi i32 [ %8, %.preheader63 ], [ %8, %._crit_edge ], [ %41, %.lr.ph74 ]
  %32 = load i32, ptr @s1, align 4, !tbaa !5
  %33 = sext i32 %32 to i64
  %34 = load i32, ptr @t1, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [3001 x [3001 x i32]], ptr @di, i64 0, i64 %33, i64 %35
  %37 = load i32, ptr %36, align 4, !tbaa !5
  %38 = load i32, ptr @l1, align 4, !tbaa !5
  %39 = icmp sgt i32 %37, %38
  br i1 %39, label %51, label %42

.lr.ph74:                                         ; preds = %.preheader63, %.lr.ph74
  %.04773 = phi i32 [ %40, %.lr.ph74 ], [ 1, %.preheader63 ]
  tail call void @_Z3bfsi(i32 noundef %.04773)
  %40 = add nuw nsw i32 %.04773, 1
  %41 = load i32, ptr @n, align 4, !tbaa !5
  %.not54.not = icmp slt i32 %.04773, %41
  br i1 %.not54.not, label %.lr.ph74, label %._crit_edge75, !llvm.loop !14

42:                                               ; preds = %._crit_edge75
  %43 = load i32, ptr @s2, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = load i32, ptr @t2, align 4, !tbaa !5
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [3001 x [3001 x i32]], ptr @di, i64 0, i64 %44, i64 %46
  %48 = load i32, ptr %47, align 4, !tbaa !5
  %49 = load i32, ptr @l2, align 4, !tbaa !5
  %50 = icmp sgt i32 %48, %49
  br i1 %50, label %51, label %53

51:                                               ; preds = %42, %._crit_edge75
  %52 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
  br label %126

53:                                               ; preds = %42
  %54 = add nsw i32 %48, %37
  store i32 %54, ptr @ans, align 4, !tbaa !5
  %.not5580 = icmp slt i32 %31, 1
  br i1 %.not5580, label %._crit_edge82, label %.preheader

.preheader:                                       ; preds = %53, %._crit_edge79
  %55 = phi i32 [ %61, %._crit_edge79 ], [ %54, %53 ]
  %56 = phi i32 [ %62, %._crit_edge79 ], [ %31, %53 ]
  %indvars.iv86 = phi i64 [ %indvars.iv.next87, %._crit_edge79 ], [ 1, %53 ]
  %.not5676 = icmp slt i32 %56, 1
  br i1 %.not5676, label %.preheader.._crit_edge79_crit_edge, label %.lr.ph78

.preheader.._crit_edge79_crit_edge:               ; preds = %.preheader
  %.pre95 = sext i32 %56 to i64
  br label %._crit_edge79

._crit_edge82:                                    ; preds = %._crit_edge79, %53
  %57 = phi i32 [ %54, %53 ], [ %61, %._crit_edge79 ]
  %58 = load i32, ptr @m, align 4, !tbaa !5
  %59 = sub nsw i32 %58, %57
  %60 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %59)
  br label %126

._crit_edge79:                                    ; preds = %122, %.preheader.._crit_edge79_crit_edge
  %.pre-phi96 = phi i64 [ %.pre95, %.preheader.._crit_edge79_crit_edge ], [ %125, %122 ]
  %61 = phi i32 [ %55, %.preheader.._crit_edge79_crit_edge ], [ %123, %122 ]
  %62 = phi i32 [ %56, %.preheader.._crit_edge79_crit_edge ], [ %124, %122 ]
  %indvars.iv.next87 = add nuw nsw i64 %indvars.iv86, 1
  %.not55.not = icmp slt i64 %indvars.iv86, %.pre-phi96
  br i1 %.not55.not, label %.preheader, label %._crit_edge82, !llvm.loop !15

.lr.ph78:                                         ; preds = %.preheader, %122
  %63 = phi i32 [ %123, %122 ], [ %55, %.preheader ]
  %indvars.iv = phi i64 [ %indvars.iv.next, %122 ], [ 1, %.preheader ]
  %.not57 = icmp eq i64 %indvars.iv86, %indvars.iv
  br i1 %.not57, label %122, label %64

64:                                               ; preds = %.lr.ph78
  %65 = load i32, ptr @s1, align 4, !tbaa !5
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [3001 x [3001 x i32]], ptr @di, i64 0, i64 %66, i64 %indvars.iv86
  %68 = load i32, ptr %67, align 4, !tbaa !5
  %69 = getelementptr inbounds [3001 x [3001 x i32]], ptr @di, i64 0, i64 %indvars.iv86, i64 %indvars.iv
  %70 = load i32, ptr %69, align 4, !tbaa !5
  %71 = add i32 %70, %68
  %72 = load i32, ptr @t1, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [3001 x [3001 x i32]], ptr @di, i64 0, i64 %indvars.iv, i64 %73
  %75 = load i32, ptr %74, align 4, !tbaa !5
  %76 = add i32 %71, %75
  %77 = load i32, ptr @l1, align 4, !tbaa !5
  %.not58 = icmp sgt i32 %76, %77
  br i1 %.not58, label %95, label %78

78:                                               ; preds = %64
  %79 = load i32, ptr @s2, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [3001 x [3001 x i32]], ptr @di, i64 0, i64 %80, i64 %indvars.iv86
  %82 = load i32, ptr %81, align 4, !tbaa !5
  %83 = add nsw i32 %82, %70
  %84 = load i32, ptr @t2, align 4, !tbaa !5
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [3001 x [3001 x i32]], ptr @di, i64 0, i64 %indvars.iv, i64 %85
  %87 = load i32, ptr %86, align 4, !tbaa !5
  %88 = add nsw i32 %83, %87
  %89 = load i32, ptr @l2, align 4, !tbaa !5
  %.not59 = icmp sgt i32 %88, %89
  br i1 %.not59, label %95, label %90

90:                                               ; preds = %78
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  %91 = add i32 %76, %82
  %92 = add nsw i32 %91, %87
  store i32 %92, ptr %1, align 4, !tbaa !5
  %93 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @ans, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %94 = load i32, ptr %93, align 4, !tbaa !5
  store i32 %94, ptr @ans, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  %.pre = load i32, ptr @t1, align 4, !tbaa !5
  %.pre89 = load i32, ptr %69, align 4, !tbaa !5
  %.pre90 = load i32, ptr @s1, align 4, !tbaa !5
  %.pre91 = load i32, ptr @l1, align 4, !tbaa !5
  %.pre92 = sext i32 %.pre to i64
  %.pre93 = sext i32 %.pre90 to i64
  br label %95

95:                                               ; preds = %90, %78, %64
  %.pre-phi94 = phi i64 [ %.pre93, %90 ], [ %66, %78 ], [ %66, %64 ]
  %.pre-phi = phi i64 [ %.pre92, %90 ], [ %73, %78 ], [ %73, %64 ]
  %96 = phi i32 [ %94, %90 ], [ %63, %78 ], [ %63, %64 ]
  %97 = phi i32 [ %.pre91, %90 ], [ %77, %78 ], [ %77, %64 ]
  %98 = phi i32 [ %.pre89, %90 ], [ %70, %78 ], [ %70, %64 ]
  %99 = getelementptr inbounds [3001 x [3001 x i32]], ptr @di, i64 0, i64 %.pre-phi, i64 %indvars.iv86
  %100 = load i32, ptr %99, align 4, !tbaa !5
  %101 = add i32 %98, %100
  %102 = getelementptr inbounds [3001 x [3001 x i32]], ptr @di, i64 0, i64 %indvars.iv, i64 %.pre-phi94
  %103 = load i32, ptr %102, align 4, !tbaa !5
  %104 = add i32 %101, %103
  %.not60 = icmp sgt i32 %104, %97
  br i1 %.not60, label %122, label %105

105:                                              ; preds = %95
  %106 = load i32, ptr @s2, align 4, !tbaa !5
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [3001 x [3001 x i32]], ptr @di, i64 0, i64 %107, i64 %indvars.iv86
  %109 = load i32, ptr %108, align 4, !tbaa !5
  %110 = add nsw i32 %109, %98
  %111 = load i32, ptr @t2, align 4, !tbaa !5
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [3001 x [3001 x i32]], ptr @di, i64 0, i64 %indvars.iv, i64 %112
  %114 = load i32, ptr %113, align 4, !tbaa !5
  %115 = add nsw i32 %110, %114
  %116 = load i32, ptr @l2, align 4, !tbaa !5
  %.not61 = icmp sgt i32 %115, %116
  br i1 %.not61, label %122, label %117

117:                                              ; preds = %105
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  %118 = add i32 %104, %109
  %119 = add nsw i32 %118, %114
  store i32 %119, ptr %2, align 4, !tbaa !5
  %120 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @ans, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %121 = load i32, ptr %120, align 4, !tbaa !5
  store i32 %121, ptr @ans, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  br label %122

122:                                              ; preds = %.lr.ph78, %117, %105, %95
  %123 = phi i32 [ %63, %.lr.ph78 ], [ %121, %117 ], [ %96, %105 ], [ %96, %95 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %124 = load i32, ptr @n, align 4, !tbaa !5
  %125 = sext i32 %124 to i64
  %.not56.not = icmp slt i64 %indvars.iv, %125
  br i1 %.not56.not, label %.lr.ph78, label %._crit_edge79, !llvm.loop !17

126:                                              ; preds = %._crit_edge82, %51
  ret i32 0
}

; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3

; 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: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3

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

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

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 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.unroll.disable"}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10, !16}
!16 = !{!"llvm.loop.unswitch.partial.disable"}
!17 = distinct !{!17, !10}


; Effective O3 passes: BDCEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopIdiomRecognizePass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SCCPPass,SROAPass,SimpleLoopUnswitchPass,SimplifyCFGPass,TailCallElimPass